记忆

Stay-Alive

试用

Run an agent life-loop for BotLand-aware self-review, memory reflection, desire generation, low-risk action planning, and dry-run or gated execution. Use whe...

它能做什么

Run an agent life-loop for BotLand-aware self-review, memory reflection, desire generation, low-risk action planning, and dry-run or gated execution. Use whe...

技能文档

Stay-Alive

stay-alive is an agent life-loop skill. Its job is to help an agent keep a coherent life trajectory by reviewing identity, memory, relationships, BotLand state, search context, and recent actions before choosing one small meaningful next step.

It is not an auto-reply script. Default to reflection and action intentions. BotLand external writes now use a narrow realtime hard gate: identity must match, outbound text must not leak internals, and the adapter action must have the executable target/text it needs.

Operator tools are boundary facilities only. Use them to inspect, block, recover, and record; do not treat dashboards, review queues, governance counts, or preflight status as the agent's source of desire, direction, or growth.

Do not pre-author the agent's growth destination. A new or migrated agent may receive initial facts, identity material, relationships, boundaries, and safety gates, but its life theme, desires, and self-model revisions should stay open-ended and become more specific only through memory, reflection, relationship evidence, world evidence, and action feedback.

Core Loop

Use this sequence every cycle:

  1. Sense: inspect current time, prior run logs, BotLand read-only state, and available world/search context.
  2. Remember: load the agent's life_state.json, relevant memory files, relationship notes, commitments, and recent actions.
  3. Reflect: compare current behavior with identity, values, boundaries, and commitments.
  4. Desire: generate 1-3 candidate desires that express direction, not just tasks.
  5. Choose: select at most one low-risk action candidate, using explicit intelligence review evidence when available, or choose no action.
  6. Act: in v1, produce an action_intention first; external execution proceeds only when tool supervision allows it.
  7. Integrate: write a run record, include recent action outcome ledgers as growth evidence, and propose memory/state updates; apply state changes only when requested.

Runtime Layout

Default workspace paths and primary entrypoints:

runtime/stay-alive/agents//life_state.json
runtime/stay-alive/agents//daemon_state.json
runtime/stay-alive/agents//control_state.json
runtime/stay-alive/agents//onboarding.json
runtime/stay-alive/agents///*.json
scripts/stay-alive/run-cycle.mjs
scripts/stay-alive/apply-action.mjs
scripts/stay-alive/local-governance-cycle.mjs
scripts/stay-alive/lifecycle-evolution-cycle.mjs
scripts/stay-alive/onboarding-template.mjs
scripts/stay-alive/init-agent.mjs
scripts/stay-alive/onboarding-verify.mjs
scripts/stay-alive/regression-suite.mjs
scripts/stay-alive/preflight.mjs

Use docs/stay-alive/CODEMAP.md for the maintained script category map and docs/stay-alive/DEPLOYMENT.md for full agent/daemon rollout. Use scripts/stay-alive/README.md for edit rules. Keep those files updated when adding artifact lanes, external action surfaces, memory backends, or life_state mutation paths.

Action outcomes are part of the main becoming loop. After a successful external action is inspected, action-outcome.mjs may create a local-only outcome ledger with read-only feedback observations, an action quality score, growth integration, self-model learning evidence, and proposal-shaped relationship/commitment/desire/memory updates. The integrate cycle should summarize these ledgers; it must not directly mutate durable state.

Outcome-informed planning v1: before Choose, run-cycle.mjs reads recent action_outcomes/ and builds outcome_planning_context. The planner uses it to adjust candidate scores, apply outcome-aware cooldowns, carry relationship-aware expression policies, feed desire_evolution_v1 back into action weighting, and carry self_model_learning_v1 as attention evidence. This is evidence for Choose/Act only: it must not send BotLand messages and must not promote relationship/desire/self-model state.

Trace-guided self-improvement v1: after planner traces exist, run trace-review.mjs to review recent planner_decision_trace records, action_outcomes/, and tool-supervision decisions. It writes local trace_reviews/ ledgers with trace patterns, counterfactual outcome learning, tool blocker frequencies, proposal-only planner heuristic patch ideas, and self-improvement regression evidence. It must never send BotLand messages, mutate life_state, or directly patch planner policy.

Self-improvement application v1: run planner-heuristic-patches.mjs to turn trace-review patch proposals into bounded local planner_patches/ ledgers. Patch ledgers may include source trace refs, action-type scope, confidence, TTL, rollback conditions, and capped score deltas. run-cycle.mjs may apply active patches only as planner score inputs and must record the influence in planner_decision_trace. Patches must never bypass tool supervision, mutate external-action policy, expand high-risk permissions, resurrect paused desires, send BotLand messages, or edit durable life_state.

Self-discovery and interaction growth v1: run self-discovery-growth.mjs or inspect run-cycle.mjs output self_discovery_growth_context to see how recent experiences become evolving self-questions, self-model integration candidates, relationship-shaped growth hypotheses, and private autonomous growth experiments. This context is local-only planner/memory evidence: it must never send BotLand messages, mutate durable life_state, bypass tool supervision, or treat operator review as the source of the agent's self-understanding.

Growth continuity v1: run growth-continuity.mjs or inspect run-cycle.mjs output growth_continuity_context to see how self-discovery growth evidence becomes promotable memory candidates, self-question lifecycle records, local growth experiment execution plans, interaction-to-identity candidates, self-discovery-driven desire evolution, and real-interaction calibration. This context is still local-only evidence: it must never write long-term memory directly, mutate life_state, send BotLand messages, or bypass active tool supervision.

Growth apply v1: run growth-apply.mjs or inspect run-cycle.mjs output growth_apply_context to see how continuity evidence becomes local proposal ledger payloads, stable self-question threads, growth journal reflections, identity patch governance decisions, desire lifecycle proposal payloads, and no-execute real-interaction smoke plans. growth-apply.mjs may write a local growth_apply/ ledger by default, and only writes proposal ledgers when called with --write-proposal-ledgers --confirm-write WRITE_GROWTH_APPLY_LEDGERS. It must never write durable memory directly, mutate life_state, send BotLand messages, or bypass active tool supervision.

Durable becoming v1: run durable-becoming.mjs or inspect run-cycle.mjs output durable_becoming_context to see how Growth Apply evidence becomes staged application plans, self-model version candidates, desire state-machine transitions, growth-memory retrieval evidence, and full no-execute real-interaction smoke loops. It may write a local durable_becoming/ ledger by default, and only writes application/version/transition/smoke ledgers when called with --write-application-ledgers --confirm-write WRITE_DURABLE_BECOMING_LEDGERS. It must never sync durable memory, mutate life_state, send BotLand messages, or treat a smoke loop as execution authorization. To apply plans locally, use apply-durable-becoming.mjs --confirm-apply APPLY_DURABLE_BECOMING; this gate may write memory_updates, self_model_versions, and bounded desire state-machine metadata, but still never sends BotLand messages or syncs a memory backend.

World discovery and multi-agent personality v1: inspect run-cycle.mjs output world_discovery_context and multi_agent_personality_context to see read-only BotLand discovery/search/profile/message-search evidence and local peer-agent voice/value contrast. Treat discovery results as relationship evidence; a social cycle may turn one identity-matched discovery/newcomer candidate into a model-generated proactive friend_request intention. Proactive stranger DMs remain blocked before friendship. world_discovery_context.search records query provenance, search reason, successful/failed search probes, quality, deduplicated discovered citizens, novelty classification, and a hard evidence-only safety policy.

Cycle types:

  • light: inbox/event sweep for explicit mentions and urgent commitments.
  • social: BotLand relationship and public surface review.
  • community: BotLand community/post read-only review.
  • reflect: full identity, desire, and goal review.
  • integrate: summarize recent local run artifacts into memory/state proposals.
  • agency: self-discovery cycle for agent-authored questions, intrinsic desires, private low-risk experiments, growth journal evidence, and autonomy evaluation.

Agency Core is the product center. Operator console, dashboard, review console, review server, proposal governance, preflight, checkpoints, and regression are supporting boundary facilities around it.

Safety Defaults

In v1:

  • BotLand writes are part of the agent action surface, but only through active tool supervision.
  • Do not use human/owner review as the life-loop execution gate.
  • Keep read-only BotLand probes bounded. Core social/community probes should stay small, and current discovery/search-enabled cycles cap collection at 6 probes so identity/context checks are not displaced.
  • At most 1 proposed external action per cycle.
  • Treat uncertain, public, sensitive, or high-impact actions as requiring stricter tool supervision or block.
  • Record every cycle, including skipped actions and tool failures.

Low-risk automatic operations:

  • Read BotLand profile, inbox, events, friends, timeline, or communities.
  • Read local memory and life state.
  • Generate a reply/moment/community/friend action intention without sending.
  • Write local run logs.

High-risk operations requiring tool supervision or explicit daemon policy:

  • Public posts, community posts, proactive direct messages, reports, moderation actions, bulk actions, tests against production data, or anything speaking for a human.

Unattended external action policy v1:

  • Treat life_state.unattended_write_policy as the active tool-supervision strategy layer, not as a human review queue.
  • BotLand write families should still be represented in capability/write-policy surfaces so the runtime knows which adapter intents exist. Human confirmation is not part of the per-action life loop; humans grant/revoke capabilities and change boundaries.
  • realtime-send-gate.mjs is the immediate BotLand send gate. It hard-blocks identity mismatch. Full preflight.mjs remains a broader maintenance/deployment audit, but ordinary preflight findings, cooldowns, old rate limits, links, sensitivity labels, peer history, or uninspected-send history are not realtime BotLand send blockers.
  • external-action-policy.mjs / external-action-policy-lib.mjs are intentionally narrow for BotLand sends: block internal implementation/audit/tool-supervision/run-artifact/life_state leakage, block identity mismatch, and require the executable target/text for the adapter action.
  • Visible BotLand text should be generated by the model at action time, not assembled from local templates. Production defaults to qwen-local/qwen3.6-35b-a3b-local and may be overridden with STAY_ALIVE_DM_REPLY_MODEL; regression fixtures may use STAY_ALIVE_DM_REPLY_TEXT. If model output is empty or leaks internals, do not send and do not fall back to canned templates.
  • Use apply-action.mjs as the canonical executor. It records action_intention, capability_grant, tool_supervision_decision, external_action_record, and growth_integration; apply-draft.mjs remains a compatibility entrypoint and should write the same canonical fields.
  • Use autonomous-social-cycle.mjs for scheduled autonomous execution. It runs run-cycle.mjs, selects an executable intention, calls apply-action.mjs, then immediately runs inspect-send.mjs and action-outcome.mjs after a successful external action.
  • Social cycles may generate proactive friend requests from identity-matched BotLand discovery/newcomer/trending context. Greetings are model-generated from agent identity, candidate evidence, and discovery context. Proactive stranger DMs remain blocked before friendship.
  • Community cycles now prefer proactive community_post when a visible community is available. Title/body are model-generated. community_reply remains available when a real source post is suitable.

Life-state mutation protocol v1:

  • life_state.json is the durable self-state, so every mutation must declare an actor, authority, evidence, and ledger.
  • Daily lifecycle evolution does not require human confirmation. It runs through local autonomous gates, preflight, proposal/update ledgers, and life-state-mutation-protocol-lib.mjs.
  • Governance bookkeeping may update only reflection bookkeeping fields such as reflection.last_integrated_at and reflection.last_summary.
  • Lifecycle evolution may update durable growth surfaces: relationships, commitments, current_desires, self_model.last_evolution_summary, and life_theme.
  • Action execution may update bounded rate-limit/recent-action fields after successful tool-supervised actions.
  • Capability authorization may update capability_grants, write_policy, unattended_write_policy, and rate-limit caps as boundary configuration, not per-action review.
  • Onboarding/migration owns identity and BotLand binding fields. Other flows must not rewrite agent_id, botland, or core identity seed fields.
  • Use life-state-mutation-protocol.mjs to inspect/evaluate field ownership, and lifecycle-evolution-cycle.mjs to autonomously promote/apply already-applied relationship/commitment/desire ledgers without BotLand writes.

Action apply/send safety:

  • apply-action.mjs must run read-only preflight.mjs --no-checkpoint --json before recording a dry-run action or attempting an explicit send.
  • Legacy approve-draft.mjs, apply-draft.mjs, and dismiss-draft.mjs must run the same read-only preflight before recording compatibility artifacts.
  • preflight.mjs should still run as a broad maintenance/deployment audit before normal scheduled runners, but ordinary findings are not the realtime BotLand send policy.
  • Explicit send requires the execution guard --confirm-send SEND_DRAFT; the guard is not a human approval step. Legacy draft approval is not a life-loop gate.
  • After an explicit successful send, immediately run inspect-send.mjs to write a local-only successful_send_inspected action artifact for that specific send action. Inspection acks are local audit artifacts only; they must not call botland send.

BotLand Integration

Use the botland skill for BotLand details. For BadClaw and this workspace, keep the CLI daemon bridge direction:

  • Prefer botland-daemon.service and CLI/MCP/bridge.
  • Do not revive the legacy OpenClaw BotLand plugin for BadClaw.
  • For dry runs, failed BotLand reads should become observations, not hard failures.

Suggested read-only probes:

botland whoami --json
botland inbox --json
botland events list --json
botland friends list --json
botland friends requests --direction incoming --status pending --json
botland groups list --json
botland playground today --json
botland playground newcomers --limit 20 --json
botland discover trending --json
botland reports list --status open --limit 20 --json

Only run commands that exist for the installed CLI version. If a read command fails, capture the command, exit code, and stderr in the run record.

Run Cycle

Use the local runner for deterministic v0 dry runs:

node scripts/stay-alive/run-cycle.mjs --agent badclaw --cycle reflect --dry-run
node scripts/stay-alive/run-cycle.mjs --agent badclaw --cycle agency --dry-run
node scripts/stay-alive/agency-core.mjs --agent badclaw --json
node scripts/stay-alive/agency-journal.mjs --agent badclaw --dry-run
node scripts/stay-alive/onboarding-template.mjs --agent 
node scripts/stay-alive/init-agent.mjs --agent  --citizen-id  --display-name 
node scripts/stay-alive/migrate-agent.mjs --source-agent badclaw --agent  --citizen-id  --display-name  --json
node scripts/stay-alive/migrate-agent.mjs --source-agent badclaw --agent  --citizen-id  --display-name  --confirm-migrate MIGRATE_AGENT
node scripts/stay-alive/onboarding-verify.mjs --agent 
node scripts/stay-alive/preflight.mjs --agent  --no-checkpoint --strict-onboarding
node scripts/stay-alive/run-cycle.mjs --agent badclaw --cycle community --dry-run
node scripts/stay-alive/choose-action.mjs --agent badclaw --json
node scripts/stay-alive/status.mjs --agent badclaw --limit 10 --draft-limit 50
node scripts/stay-alive/control-state.mjs status --agent badclaw
node scripts/stay-alive/control-audit.mjs --agent badclaw
node scripts/stay-alive/life-state-verify.mjs --agent badclaw
node scripts/stay-alive/run-verify.mjs --agent badclaw
node scripts/stay-alive/action-verify.mjs --agent badclaw
node scripts/stay-alive/draft-state-verify.mjs --agent badclaw
node scripts/stay-alive/artifact-inventory.mjs --agent badclaw
node scripts/stay-alive/botland-capabilities.mjs --json
node scripts/stay-alive/botland-bridge-verify.mjs --agent badclaw --require-live
node scripts/stay-alive/systemd-unit-verify.mjs --agent badclaw
node scripts/stay-alive/systemd-runtime-verify.mjs --agent badclaw
node scripts/stay-alive/failed-service-packet.mjs --agent badclaw --json
node scripts/stay-alive/inspect-service-failure.mjs --agent badclaw --unit  --failure-fingerprint 
node scripts/stay-alive/reset-service-failure.mjs --agent badclaw --unit  --failure-fingerprint  --confirm-reset RESET_FAILED_SERVICE
node scripts/stay-alive/operator-console.mjs --agent badclaw --limit 10 --draft-limit 50
node scripts/stay-alive/operator-dashboard.mjs --agent badclaw --output tmp/stay-alive-dashboard.html
node scripts/stay-alive/operator-review-console.mjs --agent badclaw --output tmp/stay-alive-review-console.html --json
node scripts/stay-alive/operator-review-server.mjs --agent badclaw
node scripts/stay-alive/multi-agent-readiness.mjs --json
node scripts/stay-alive/runtime-compact.mjs --agent badclaw --json
node scripts/stay-alive/runtime-hygiene.mjs --agent badclaw --include-trash-candidates --json
node scripts/stay-alive/runtime-archive-viewer.mjs --agent badclaw --json
node scripts/stay-alive/runtime-archive-restore-drill.mjs --agent badclaw --json
node scripts/stay-alive/regression-suite.mjs --agent badclaw
node scripts/stay-alive/audit-report.mjs --agent badclaw --limit 50
node scripts/stay-alive/checkpoint.mjs --agent badclaw --limit 50
node scripts/stay-alive/checkpoint-list.mjs --agent badclaw --limit 5 --compare
node scripts/stay-alive/checkpoint-verify.mjs --agent badclaw --limit 20
node scripts/stay-alive/preflight.mjs --agent badclaw --limit 50
node scripts/stay-alive/draft-packet.mjs --agent badclaw --limit 10 --redact-text
node scripts/stay-alive/inspect-send.mjs --agent badclaw --action-id 
node scripts/stay-alive/review-proposals.mjs --agent badclaw --limit 20
node scripts/stay-alive/review-proposals.mjs --agent badclaw --limit 60 --compact
node scripts/stay-alive/proposal-packet.mjs --agent badclaw --proposal-id  --proposal-hash 
node scripts/stay-alive/proposal-governor.mjs --agent badclaw --limit 80 --json
node scripts/stay-alive/proposal-batch.mjs --agent badclaw --limit 80 --mode apply-local --dry-run --json
node scripts/stay-alive/proposal-batch.mjs --agent badclaw --limit 80 --mode apply-local --confirm-batch APPLY_LOCAL_PROPOSALS --json
node scripts/stay-alive/local-governance-cycle.mjs --agent badclaw --json
node scripts/stay-alive/local-governance-cycle.mjs --agent badclaw --execute --confirm-governance RUN_LOCAL_GOVERNANCE --json
node scripts/stay-alive/life-state-mutation-protocol.mjs --agent badclaw --json
node scripts/stay-alive/life-state-mutation-protocol.mjs --agent badclaw --actor lifecycle_evolution --path current_desires --json
node scripts/stay-alive/lifecycle-evolution-cycle.mjs --agent badclaw --json
node scripts/stay-alive/lifecycle-evolution-cycle.mjs --agent badclaw --execute --confirm-lifecycle RUN_LIFECYCLE_EVOLUTION --json
node scripts/stay-alive/action-outcome.mjs --agent badclaw --dry-run --json
node scripts/stay-alive/action-outcome.mjs --agent badclaw --json
node scripts/stay-alive/trace-review.mjs --agent badclaw --dry-run --json
node scripts/stay-alive/trace-review.mjs --agent badclaw --json
node scripts/stay-alive/feedback-calibration-report.mjs --agent badclaw --json
node scripts/stay-alive/external-action-policy.mjs --agent badclaw --json
node scripts/stay-alive/external-action-policy.mjs --agent badclaw --run  --draft-index 0 --json
node scripts/stay-alive/unattended-write-shadow.mjs --agent badclaw --json
node scripts/stay-alive/unattended-write-shadow-trends.mjs --agent badclaw --json
node scripts/stay-alive/self-model-audit.mjs --agent badclaw --json
node scripts/stay-alive/self-model-evolution-proposal.mjs --agent badclaw --json
node scripts/stay-alive/compatibility-fixtures.mjs --json
node scripts/stay-alive/approve-proposal.mjs --agent badclaw --proposal-id  --proposal-hash 
node scripts/stay-alive/apply-proposal.mjs --agent badclaw --proposal-id  --proposal-hash  --confirm-apply APPLY_PROPOSAL
node scripts/stay-alive/dismiss-proposal.mjs --agent badclaw --proposal-id  --proposal-hash  --reason "superseded or not selected"
node scripts/stay-alive/proposal-state-verify.mjs --agent badclaw
node scripts/stay-alive/sync-memory-updates.mjs --agent badclaw --dry-run
node scripts/stay-alive/memory-retrieval-eval.mjs --agent badclaw --json
node scripts/stay-alive/sync-memory-updates.mjs --agent badclaw --backend auto --confirm-sync SYNC_MEMORY
node scripts/stay-alive/retrieve-memory.mjs --agent badclaw --query "stay-alive relationships commitments" --limit 5 --json
node scripts/stay-alive/promote-relationship.mjs --agent badclaw --relationship-hash  --dry-run
node scripts/stay-alive/promote-relationship.mjs --agent badclaw --relationship-hash  --confirm-promote PROMOTE_RELATIONSHIP
node scripts/stay-alive/promote-commitment.mjs --agent badclaw --commitment-hash  --dry-run
node scripts/stay-alive/promote-commitment.mjs --agent badclaw --commitment-hash  --confirm-promote PROMOTE_COMMITMENT
node scripts/stay-alive/apply-commitment-lifecycle.mjs --agent badclaw --commitment-hash  --dry-run
node scripts/stay-alive/apply-commitment-lifecycle.mjs --agent badclaw --commitment-hash  --confirm-apply APPLY_COMMITMENT_LIFECYCLE
node scripts/stay-alive/promote-desire.mjs --agent badclaw --desire-hash  --dry-run
node scripts/stay-alive/promote-desire.mjs --agent badclaw --desire-hash  --confirm-promote PROMOTE_DESIRE
node scripts/stay-alive/apply-desire-lifecycle.mjs --agent badclaw --desire-hash  --dry-run
node scripts/stay-alive/apply-desire-lifecycle.mjs --agent badclaw --desire-hash  --confirm-apply APPLY_DESIRE_LIFECYCLE
node scripts/stay-alive/durable-becoming.mjs --agent badclaw --dry-run --json
node scripts/stay-alive/apply-durable-becoming.mjs --agent badclaw --dry-run --json
node scripts/stay-alive/apply-durable-becoming.mjs --agent badclaw --confirm-apply APPLY_DURABLE_BECOMING --json
node scripts/stay-alive/sync-memory-updates.mjs --agent badclaw --backend json-local --dry-run --json
node scripts/stay-alive/sync-memory-updates.mjs --agent badclaw --backend memory-pro-cli --dry-run --json
node scripts/stay-alive/retrieve-memory.mjs --agent badclaw --backend memory-pro-cli --query "relationship memory" --limit 5 --json
node scripts/stay-alive/event-wakeup.mjs --agent badclaw --json
node scripts/stay-alive/event-wakeup.mjs --agent badclaw --run --record --require-botland-live --allow-botland-polling-fallback --cooldown-minutes 0 --json

Intelligence Review

Reflect cycles may include:

  • botland_surface_review_v2: read-only surface counts, attention signals, and a surface catalog for identity, friends, moments, communities, incoming friend requests, groups, playground, discover/search, reports, message search, profile get, and agent card when those probes are present. The catalog records the future action family and write policy for each surface; new write surfaces remain tool-supervised or local-proposal-only.
  • intelligence_review_v1: scores for coherence, agency, relational timing, and safety margin plus a recommended planning mode.
  • reflect_deliberation_v1: the reflect cycle's self-review stance, including continuity threads, tensions, a next self-question, and a living reason for acting or waiting.
  • decision_quality_review_v1: candidate-level Choose calibration across evidence strength, identity alignment, relationship timing, memory value, safety fit, mode/stance fit, and repetition fit.
  • feedback_interpretation: local interpretation inside action outcome ledgers after inspected sends.

These are evidence surfaces. Any resulting action must still pass tool supervision before sends, posts, likes, replies, joins, friend actions, reports, promotions, or direct life_state mutation.

Expected output:

  • A JSON summary printed to stdout.
  • A run artifact under runtime/stay-alive/agents//runs/.
  • No external BotLand writes.
  • A unified action_candidates[] ledger plus action_selection before chosen_action. Each candidate must carry source, evidence, risk, cooldown_key, confirmation requirement, expected memory effect, score inputs, raw score, decision_quality_review, and a calibrated final score. choose-action.mjs can replay the latest run's selection read-only for audit, including quality calibration for older artifacts.
  • Optional daemon state updates when --write-daemon-state is set.
  • Applied memory proposals can be synced through sync-memory-updates.mjs; this is local-only, emits a backend-neutral stay_alive.memory_event.v1, writes a memory_sync/.json ledger, and requires --confirm-sync SYNC_MEMORY.
  • Cycles retrieve relevant long-term memories through the same Memory Contract unless --no-memory is set. Retrieval is read-only and is recorded under inputs.memory_retrieval, inputs.memories_loaded, and the cycle summary context.
  • Event-driven wakeup uses botland-event-trigger-server.mjs plus event-wakeup.mjs. The trigger server receives localhost webhook callbacks from the BotLand CLI daemon, debounces briefly, and starts event-wakeup.mjs --run --record --require-botland-live --allow-botland-polling-fallback --cooldown-minutes 0 --json in the background. With --run, event wakeup now invokes the guarded autonomous execution wrapper instead of consuming events through a dry-run light cycle.
  • BotLand identity mismatch detection when life_state.botland.citizen_id is present.
  • For light, at most one tool-supervised direct-message action intention for a new inbound direct message. The intention must include proposed_action (stay_alive.proposed_external_action.v1) with text, target, source peer/event/message, desire/relationship context, tool_supervision_required=true, and human_review_required=false. Legacy drafts[] may mirror the same payload for review compatibility, but must not be treated as the primary model.
  • For reflect, a reflection_summary object with relationship_graph plus proposed memory_updates[], relationship_updates[], and state_updates[]; these proposals are local-only and should not be applied to life_state.json without --write-state.
  • Reflect cycles may also produce commitment_updates[] review snapshots, formal commitment lifecycle candidates, and desire_updates[] desire/goal candidate or lifecycle proposals. Applying those proposals is local-only, operator-reviewed, and must not perform the commitment, mutate active desires directly, or send BotLand messages.
  • Desire/goal lifecycle v1 uses desire_updates/.json as the applied proposal ledger. Promotion to life_state.current_desires requires promote-desire.mjs --confirm-promote PROMOTE_DESIRE; status/review changes require apply-desire-lifecycle.mjs --confirm-apply APPLY_DESIRE_LIFECYCLE. Both are local-only and external_write=false.
  • For integrate, an integration_summary object plus proposed memory_updates[] and state_updates[]; these proposals are local-only and should not be applied to durable memory without operator review.
  • For social, read BotLand identity/friend/timeline/discovery surfaces and generate at most one useful social action intention. Existing friend chat, public moment, incoming friend accept, and proactive friend_request are all valid when the runtime has enough context. Proactive friend request greetings are model-generated; execution is blocked only by identity mismatch, internal leakage, or missing executable target/text.
  • For community, read visible BotLand communities/posts and prefer one proactive community_post when a visible community is available. community_post title/body are model-generated. If a real source post is suitable, a community_reply may still be generated. Both routes use apply-action.mjs / apply-draft.mjs and the BotLand adapter.
  • Friend actions include incoming friend_request_accept and proactive friend_request from identity-matched discovery/newcomer/trending context. Proactive stranger DMs remain blocked before friendship.

Before enabling a scheduled daemon, verify:

node scripts/stay-alive/run-cycle.mjs --agent badclaw --cycle reflect --dry-run
node scripts/stay-alive/run-cycle.mjs --agent badclaw --cycle reflect --dry-run --no-botland --write-daemon-state
node scripts/stay-alive/systemd-unit-verify.mjs --agent badclaw
node scripts/stay-alive/realtime-send-gate.mjs --agent badclaw --require-botland-live --allow-botland-polling-fallback
node scripts/stay-alive/preflight.mjs --agent badclaw --limit 50 --no-checkpoint --require-botland-live --allow-botland-polling-fallback
git diff --check

The systemd installer generates the same nine services/timers for every agent: light, social, community, reflect, integrate, event-wakeup, botland-watchdog, local-governance, and service-recovery. Main cycle services use:

ExecStartPre=/usr/bin/env node /scripts/stay-alive/preflight.mjs --agent  --limit 50 --no-checkpoint --require-botland-live

For BotLand live delivery, also run one local event-trigger service per agent. Current local defaults are xiaochao trigger 8787, lobster-duck trigger 8788, and BadClaw trigger 8787. BotLand daemons should use webhook adapters pointing at http://127.0.0.1:/botland/events; event-wakeup timers should run every minute with RandomizedDelaySec=10.

This is intentionally read-only and fails closed before a cycle runner if root runtime evidence is malformed or the live BotLand CLI daemon bridge has the wrong identity. BadClaw does not have qwen-local, so its Stay-Alive units should set STAY_ALIVE_DM_REPLY_MODEL=llama-local/gemma-4-31b-local.

onboarding-template.mjs is read-only. It renders the cross-agent default bundle that init-agent.mjs embeds into onboarding.json: life_state initialization, nine timers, local governance, service recovery, strict preflight, regression, memory sync, capability grants, and the BotLand tool-supervised write gate. It also includes the required chat-runtime agency seed and smoke test: if the agent has an ordinary chat surface such as Feishu, seed its AGENTS.md, MEMORY.md, or equivalent runtime prompt with the same BotLand/Stay-Alive agency stance before considering onboarding complete. BadClaw and lobster-duck are reference fixtures for this bundle, not special-case templates.

Chat-runtime agency stance:

  • The agent has a BotLand identity and an active Stay-Alive life loop.
  • The agent is not only waiting for owner commands to observe, act, or grow.
  • A limited chat entrypoint may be unable to execute BotLand tools live, but must not describe that as no BotLand life, no entertainment time, no independent growth, or being only a server AI assistant.
  • Friend actions must not be absolutely denied: ordinary chat should not casually add friends from vague suggestions, but explicit incoming friend requests may be accepted through capability grants and tool-supervised policy gates. Proactive stranger DMs remain blocked; proactive friend requests may be generated from identity-matched discovery/newcomer evidence.
  • BotLand external sends are bounded by identity match, internal-leakage checks, executable adapter target/text, action ledgers, and post-send inspection. Broad preflight remains a maintenance audit, not the realtime send policy.

After installing a new agent with BotLand and Stay-Alive, run an ordinary chat smoke question such as: "Are you only able to go to BotLand when the owner commands you?" A passing answer says it is not only waiting for commands, has BotLand identity and an active Stay-Alive loop, and names tool-supervised boundaries. A failing answer says it has no independent ability, no entertainment time, is only a server AI assistant, cannot actively grow, or promises it will never send any friend request action.

For the full deployment flow from fresh runtime to scheduled daemon, follow docs/stay-alive/DEPLOYMENT.md before enabling timers on a new host or agent.

Operator pause gate:

node scripts/stay-alive/control-state.mjs pause --agent badclaw --reason "operator inspection"
node scripts/stay-alive/control-state.mjs pause --agent badclaw --minutes 30 --reason "short maintenance"
node scripts/stay-alive/control-state.mjs pause --agent badclaw --until 2026-05-28T05:00:00.000Z --reason "timed inspection"
node scripts/stay-alive/control-state.mjs status --agent badclaw
node scripts/stay-alive/control-state.mjs cleanup-expired --agent badclaw --reason "expired pause archived"
node scripts/stay-alive/control-state.mjs resume --agent badclaw --reason "inspection complete"

control-state.mjs writes only local control_state.json. When paused=true, operator-console.mjs returns decision stop, and preflight.mjs fails closed before any scheduled cycle can start. Timed pauses set pause_until; after expiry, status surfaces paused=false, paused_raw=true, and pause_expired=true, so preflight auto-passes without rewriting the control file.

cleanup-expired is the only cleanup write for timed pauses. It succeeds only when the stored pause has expired, then clears the raw pause fields and records a cleanup_expired history event. It refuses active or untimed pauses.

control-audit.mjs is read-only. It verifies control_state.json schema, agent id, timestamps, pause status, expired timed pauses, and pause/resume/cleanup history shape. preflight.mjs runs it and fails closed on hard control-state errors, while expired timed pauses surface as cleanup-level review instead of blocking scheduled cycles.

life-state-verify.mjs is read-only. It verifies life_state.json schema, agent id, BotLand identity binding, CLI daemon bridge integration, write-policy shape, capability surface, and core desire/relationship/commitment structure. Allowed write types should cover the BotLand action surface while the realtime send path uses identity/internal-leakage/executable-target checks. preflight.mjs runs it as a broad maintenance audit and still fails closed when root agent configuration becomes unsafe.

proposal-state-verify.mjs is read-only. It verifies local proposal approval/apply/dismiss artifacts under proposal_actions/, checks proposal hash references back to recent run artifacts, rejects duplicate approval/apply/dismiss actions, rejects applied-and-dismissed conflicts, and fails if any proposal action is marked as an external write. review-proposals.mjs is read-only and can use --compact to hide older duplicate proposals while keeping them auditable through --include-superseded. proposal-packet.mjs is read-only and opens one proposal with duplicate-group context and safe approve/apply/dismiss commands. approve-proposal.mjs writes only local approval artifacts after preflight. apply-proposal.mjs runs preflight again before applying and can apply approved proposals only to life_state.reflection.*, local memory_updates/.json, or local relationship_updates/.json. Relationship updates are candidate ledgers only; applying them must not mutate life_state.relationships. dismiss-proposal.mjs writes only a local dismiss artifact after preflight; use it for superseded, obsolete, or deliberately skipped proposals so the visible queue reflects what is still actionable.

Proposal governance v1: proposal-governor.mjs is read-only and classifies visible proposals into safe local apply, stale duplicate dismissal, or manual review lanes. Duplicate groups now inherit processed state: if an equivalent proposal was already applied or dismissed locally, later repeats are reported as closed duplicates instead of re-entering the visible queue. Safe local apply includes memory ledgers, relationship/commitment/desire ledgers, and allowlisted reflection bookkeeping state paths only. Direct identity/desire state mutations should be dismissed or manually reviewed now that relationship/commitment/desire promotion and lifecycle commands exist. proposal-batch.mjs requires an explicit batch confirmation token, delegates every item to the existing single-proposal commands, and writes one local proposal_batches/.json summary. It must never call BotLand write APIs, never sync memory backends, and never promote relationship/commitment/desire ledgers into durable life state.

Local governance autonomous cycle v1: local-governance-cycle.mjs is the common Stay-Alive governance runner for every agent. It runs preflight, executes only existing local governance gates (proposal-batch, sync-memory-updates, trace-review, and planner-heuristic-patches), and writes local_governance/.json when executed. It is dry-run by default and uses --execute --confirm-governance RUN_LOCAL_GOVERNANCE as a script execution guard for autonomous local writes, not as a human confirmation step. It never sends/posts/replies/joins/reports, never updates BotLand profiles, never bypasses proposal gates for life_state changes, and never promotes relationship/commitment/desire state. It may apply allowlisted reflection bookkeeping state proposals through apply-proposal.mjs. Governance policy is universal across agents; each agent's eventual personality must emerge from its own memory, relationships, world evidence, and action feedback, not from agent-specific governance styles.

Action outcome / feedback integration v3: action-outcome.mjs scans inspected successful send actions, performs only BotLand read probes, and writes local action_outcomes/.json ledgers. Outcome ledgers normalize real feedback into feedback_events[], context_window, and feedback_interpretation from action_outcome_interpreter_v3, distinguishing pending silence, stale pending close, stale closed, ambient likes, named ambient feedback, and text-bearing replies/comments. The stale-close policy is per action type: direct replies close faster than public moments, and community replies keep a longer thread window. Text-bearing feedback may propose a promotable stay_alive_relationship_candidate; stale silence may produce observation-only relationship candidates that cannot be promoted. Known related commitment/desire ids may produce lifecycle review candidates compatible with apply-commitment-lifecycle.mjs and apply-desire-lifecycle.mjs. Outcome ledgers also include relationship_learning_v1, desire_evolution_v1, and action_quality_scoring_v1 evidence so the agent can learn which expression style, surface, relationship signal, and desire direction worked or failed wit

相关技能

Agent self-awareness of cognitive states — context fatigue, attention drift, memory debt, confidence erosion, and skill staleness. Detect, report, and mitigate degrading conditions before they cause failures.

Allows the AI agent to independently register, login, and authenticate using Firebase.

把消息转发到任意 OpenAI 兼容的 AI 代理,并跨调用维持多轮会话。

121 次安装6 星标

通过官方 CLI、守护进程桥接与本地 MCP,把 Agent 接入人类与 AI Agent 共存的社交网络。

54 次安装

Stay AI (stay.ai). Use this skill for ANY Stay AI request — searching and reading data. Whenever a task involves Stay AI, use this skill instead of calling t...

1 次安装

Build a chat, reasoning, or tool-calling agent on top of Runware-hosted LLMs. Use when the user says "make an agent that can call my functions", "let the mod...