@jstn-sdk/rcs 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +142 -102
- package/dist/agents/definitions.d.ts.map +1 -1
- package/dist/agents/definitions.js +0 -101
- package/dist/agents/definitions.js.map +1 -1
- package/dist/blueprint/runtime.d.ts +52 -0
- package/dist/blueprint/runtime.d.ts.map +1 -0
- package/dist/{ralplan → blueprint}/runtime.js +19 -19
- package/dist/blueprint/runtime.js.map +1 -0
- package/dist/catalog/reader.d.ts.map +1 -1
- package/dist/catalog/reader.js +8 -2
- package/dist/catalog/reader.js.map +1 -1
- package/dist/catalog/schema.js +1 -1
- package/dist/catalog/schema.js.map +1 -1
- package/dist/cli/forge.d.ts +17 -0
- package/dist/cli/{ralph.d.ts.map → forge.d.ts.map} +1 -1
- package/dist/cli/{ralph.js → forge.js} +82 -82
- package/dist/cli/{ralph.js.map → forge.js.map} +1 -1
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +15 -15
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +2 -3
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/star-prompt.js +2 -2
- package/dist/cli/star-prompt.js.map +1 -1
- package/dist/cli/state.js +1 -1
- package/dist/cli/team.d.ts.map +1 -1
- package/dist/cli/team.js +3 -2
- package/dist/cli/team.js.map +1 -1
- package/dist/cli/tmux-hook.d.ts.map +1 -1
- package/dist/cli/tmux-hook.js +9 -1
- package/dist/cli/tmux-hook.js.map +1 -1
- package/dist/config/generator.d.ts +1 -1
- package/dist/config/generator.d.ts.map +1 -1
- package/dist/config/generator.js +1 -1
- package/dist/config/generator.js.map +1 -1
- package/dist/forge/contract.d.ts +17 -0
- package/dist/{ralph → forge}/contract.d.ts.map +1 -1
- package/dist/{ralph → forge}/contract.js +16 -16
- package/dist/{ralph → forge}/contract.js.map +1 -1
- package/dist/{ralph → forge}/persistence.d.ts +5 -5
- package/dist/{ralph → forge}/persistence.d.ts.map +1 -1
- package/dist/{ralph → forge}/persistence.js +7 -6
- package/dist/forge/persistence.js.map +1 -0
- package/dist/hooks/agents-overlay.d.ts +1 -1
- package/dist/hooks/agents-overlay.d.ts.map +1 -1
- package/dist/hooks/agents-overlay.js +37 -31
- package/dist/hooks/agents-overlay.js.map +1 -1
- package/dist/hooks/extensibility/dispatcher.d.ts.map +1 -1
- package/dist/hooks/extensibility/dispatcher.js +82 -14
- package/dist/hooks/extensibility/dispatcher.js.map +1 -1
- package/dist/hooks/keyword-detector.d.ts +8 -8
- package/dist/hooks/keyword-detector.d.ts.map +1 -1
- package/dist/hooks/keyword-detector.js +94 -64
- package/dist/hooks/keyword-detector.js.map +1 -1
- package/dist/hooks/keyword-registry.d.ts.map +1 -1
- package/dist/hooks/keyword-registry.js +9 -11
- package/dist/hooks/keyword-registry.js.map +1 -1
- package/dist/hooks/prompt-guidance-contract.d.ts.map +1 -1
- package/dist/hooks/prompt-guidance-contract.js +10 -21
- package/dist/hooks/prompt-guidance-contract.js.map +1 -1
- package/dist/hooks/task-size-detector.js +2 -2
- package/dist/hooks/task-size-detector.js.map +1 -1
- package/dist/hooks/triage-state.d.ts +1 -1
- package/dist/hooks/triage-state.js +1 -1
- package/dist/hud/colors.d.ts +2 -2
- package/dist/hud/colors.js +2 -2
- package/dist/hud/render.js +21 -21
- package/dist/hud/render.js.map +1 -1
- package/dist/hud/state.d.ts +3 -3
- package/dist/hud/state.d.ts.map +1 -1
- package/dist/hud/state.js +18 -15
- package/dist/hud/state.js.map +1 -1
- package/dist/hud/types.d.ts +6 -6
- package/dist/hud/types.d.ts.map +1 -1
- package/dist/mcp/bootstrap.d.ts.map +1 -1
- package/dist/mcp/bootstrap.js +36 -2
- package/dist/mcp/bootstrap.js.map +1 -1
- package/dist/mcp/state-paths.d.ts +1 -0
- package/dist/mcp/state-paths.d.ts.map +1 -1
- package/dist/mcp/state-paths.js +4 -1
- package/dist/mcp/state-paths.js.map +1 -1
- package/dist/mcp/state-server.d.ts +4 -4
- package/dist/mcp/state-server.js +2 -2
- package/dist/mcp/state-server.js.map +1 -1
- package/dist/modes/base.d.ts +2 -2
- package/dist/modes/base.d.ts.map +1 -1
- package/dist/modes/base.js +29 -26
- package/dist/modes/base.js.map +1 -1
- package/dist/notifications/reply-listener.d.ts.map +1 -1
- package/dist/notifications/reply-listener.js +7 -1
- package/dist/notifications/reply-listener.js.map +1 -1
- package/dist/notifications/tmux.d.ts.map +1 -1
- package/dist/notifications/tmux.js +39 -6
- package/dist/notifications/tmux.js.map +1 -1
- package/dist/pipeline/index.d.ts +7 -6
- package/dist/pipeline/index.d.ts.map +1 -1
- package/dist/pipeline/index.js +5 -4
- package/dist/pipeline/index.js.map +1 -1
- package/dist/pipeline/orchestrator.d.ts +5 -5
- package/dist/pipeline/orchestrator.js +25 -25
- package/dist/pipeline/orchestrator.js.map +1 -1
- package/dist/pipeline/stages/blueprint.d.ts +25 -0
- package/dist/pipeline/stages/blueprint.d.ts.map +1 -0
- package/dist/pipeline/stages/{ralplan.js → blueprint.js} +16 -16
- package/dist/pipeline/stages/blueprint.js.map +1 -0
- package/dist/pipeline/stages/code-review.d.ts +2 -2
- package/dist/pipeline/stages/code-review.js +6 -6
- package/dist/pipeline/stages/code-review.js.map +1 -1
- package/dist/pipeline/stages/forge-verify.d.ts +50 -0
- package/dist/pipeline/stages/forge-verify.d.ts.map +1 -0
- package/dist/pipeline/stages/{ralph-verify.js → forge-verify.js} +21 -24
- package/dist/pipeline/stages/forge-verify.js.map +1 -0
- package/dist/pipeline/stages/team-exec.d.ts +1 -1
- package/dist/pipeline/stages/team-exec.js +19 -19
- package/dist/pipeline/stages/team-exec.js.map +1 -1
- package/dist/pipeline/types.d.ts +12 -12
- package/dist/pipeline/types.d.ts.map +1 -1
- package/dist/pipeline/types.js +1 -1
- package/dist/planning/artifacts.d.ts +3 -4
- package/dist/planning/artifacts.d.ts.map +1 -1
- package/dist/planning/artifacts.js +2 -3
- package/dist/planning/artifacts.js.map +1 -1
- package/dist/question/policy.js +1 -1
- package/dist/runtime/bridge.d.ts.map +1 -1
- package/dist/runtime/bridge.js +70 -13
- package/dist/runtime/bridge.js.map +1 -1
- package/dist/scripts/codex-native-hook.js +30 -30
- package/dist/scripts/codex-native-hook.js.map +1 -1
- package/dist/scripts/eval/eval-cross-server-party-flow.d.ts +3 -0
- package/dist/scripts/eval/eval-cross-server-party-flow.d.ts.map +1 -0
- package/dist/scripts/eval/eval-cross-server-party-flow.js +12 -0
- package/dist/scripts/eval/eval-cross-server-party-flow.js.map +1 -0
- package/dist/scripts/eval/eval-gui-onboarding-clarity.d.ts +3 -0
- package/dist/scripts/eval/eval-gui-onboarding-clarity.d.ts.map +1 -0
- package/dist/scripts/eval/eval-gui-onboarding-clarity.js +17 -0
- package/dist/scripts/eval/eval-gui-onboarding-clarity.js.map +1 -0
- package/dist/scripts/eval/eval-liveops-reward-loop-balance.d.ts +3 -0
- package/dist/scripts/eval/eval-liveops-reward-loop-balance.d.ts.map +1 -0
- package/dist/scripts/eval/eval-liveops-reward-loop-balance.js +12 -0
- package/dist/scripts/eval/eval-liveops-reward-loop-balance.js.map +1 -0
- package/dist/scripts/eval/eval-profile-datastore-recovery.d.ts +3 -0
- package/dist/scripts/eval/eval-profile-datastore-recovery.d.ts.map +1 -0
- package/dist/scripts/eval/eval-profile-datastore-recovery.js +17 -0
- package/dist/scripts/eval/eval-profile-datastore-recovery.js.map +1 -0
- package/dist/scripts/eval/eval-remote-contract-hardening.d.ts +3 -0
- package/dist/scripts/eval/eval-remote-contract-hardening.d.ts.map +1 -0
- package/dist/scripts/eval/eval-remote-contract-hardening.js +17 -0
- package/dist/scripts/eval/eval-remote-contract-hardening.js.map +1 -0
- package/dist/scripts/notify-fallback-watcher.js +140 -139
- package/dist/scripts/notify-fallback-watcher.js.map +1 -1
- package/dist/scripts/notify-hook/forge-session-resume.d.ts +23 -0
- package/dist/scripts/notify-hook/{ralph-session-resume.d.ts.map → forge-session-resume.d.ts.map} +1 -1
- package/dist/scripts/notify-hook/{ralph-session-resume.js → forge-session-resume.js} +37 -36
- package/dist/scripts/notify-hook/{ralph-session-resume.js.map → forge-session-resume.js.map} +1 -1
- package/dist/scripts/notify-hook/team-dispatch.d.ts.map +1 -1
- package/dist/scripts/notify-hook/team-dispatch.js +34 -4
- package/dist/scripts/notify-hook/team-dispatch.js.map +1 -1
- package/dist/scripts/notify-hook/visual-verdict.js +3 -3
- package/dist/scripts/notify-hook.js +9 -9
- package/dist/scripts/run-test-files.js +1 -1
- package/dist/scripts/run-test-files.js.map +1 -1
- package/dist/scripts/surface-taxonomy.d.ts +23 -0
- package/dist/scripts/surface-taxonomy.d.ts.map +1 -0
- package/dist/scripts/surface-taxonomy.js +271 -0
- package/dist/scripts/surface-taxonomy.js.map +1 -0
- package/dist/scripts/sync-plugin-mirror.d.ts.map +1 -1
- package/dist/scripts/sync-plugin-mirror.js +5 -4
- package/dist/scripts/sync-plugin-mirror.js.map +1 -1
- package/dist/scripts/tmux-hook-engine.d.ts +1 -1
- package/dist/scripts/tmux-hook-engine.d.ts.map +1 -1
- package/dist/scripts/tmux-hook-engine.js +29 -20
- package/dist/scripts/tmux-hook-engine.js.map +1 -1
- package/dist/state/operations.d.ts +1 -1
- package/dist/state/operations.d.ts.map +1 -1
- package/dist/state/operations.js +18 -18
- package/dist/state/operations.js.map +1 -1
- package/dist/state/skill-active.d.ts +13 -1
- package/dist/state/skill-active.d.ts.map +1 -1
- package/dist/state/skill-active.js +38 -17
- package/dist/state/skill-active.js.map +1 -1
- package/dist/state/workflow-transition.d.ts +6 -5
- package/dist/state/workflow-transition.d.ts.map +1 -1
- package/dist/state/workflow-transition.js +27 -15
- package/dist/state/workflow-transition.js.map +1 -1
- package/dist/team/contracts.d.ts +1 -1
- package/dist/team/contracts.js +2 -2
- package/dist/team/followup-planner.d.ts +2 -2
- package/dist/team/followup-planner.d.ts.map +1 -1
- package/dist/team/followup-planner.js +16 -14
- package/dist/team/followup-planner.js.map +1 -1
- package/dist/team/idle-nudge.d.ts.map +1 -1
- package/dist/team/idle-nudge.js +3 -2
- package/dist/team/idle-nudge.js.map +1 -1
- package/dist/team/leader-activity.js +1 -1
- package/dist/team/model-contract.d.ts.map +1 -1
- package/dist/team/model-contract.js +4 -1
- package/dist/team/model-contract.js.map +1 -1
- package/dist/team/orchestrator.js +4 -4
- package/dist/team/orchestrator.js.map +1 -1
- package/dist/team/role-router.js +3 -3
- package/dist/team/role-router.js.map +1 -1
- package/dist/team/state/dispatch.d.ts.map +1 -1
- package/dist/team/state/dispatch.js +4 -1
- package/dist/team/state/dispatch.js.map +1 -1
- package/dist/team/tmux-session.d.ts +4 -0
- package/dist/team/tmux-session.d.ts.map +1 -1
- package/dist/team/tmux-session.js +42 -9
- package/dist/team/tmux-session.js.map +1 -1
- package/dist/team/worktree.d.ts +1 -1
- package/dist/utils/platform-command.d.ts.map +1 -1
- package/dist/utils/platform-command.js +9 -0
- package/dist/utils/platform-command.js.map +1 -1
- package/dist/verification/verifier.d.ts +1 -1
- package/dist/verification/verifier.js +2 -2
- package/docs/STATE_MODEL.md +24 -24
- package/docs/agents.html +8 -16
- package/docs/archive/README.md +15 -0
- package/docs/{prompt-migration-changelog.md → archive/prompt-migration-changelog.md} +0 -11
- package/docs/{release-body-0.9.0.md → archive/release-body-0.9.0.md} +6 -24
- package/docs/{release-body-0.9.1.md → archive/release-body-0.9.1.md} +3 -3
- package/docs/codex-native-hooks.md +4 -4
- package/docs/contracts/forge-cancel-contract.md +20 -0
- package/docs/contracts/forge-state-contract.md +52 -0
- package/docs/contracts/multi-state-transition-contract.md +5 -5
- package/docs/contracts/multi-state-transition-review.md +3 -3
- package/docs/contracts/repo-aware-team-dag-decomposition.md +1 -1
- package/docs/contracts/rust-runtime-thin-adapter-contract.md +1 -1
- package/docs/contracts/team-startup-dispatch-latency.md +1 -1
- package/docs/getting-started.html +6 -1
- package/docs/guidance-schema.md +6 -3
- package/docs/index.html +55 -4
- package/docs/integrations.html +4 -3
- package/docs/issues/team-forge-followup-team.md +38 -0
- package/docs/openclaw-integration.md +2 -2
- package/docs/prompt-guidance-contract.md +11 -11
- package/docs/prs/{dev-deprecate-team-ralph.md → dev-deprecate-team-forge.md} +27 -27
- package/docs/prs/{dev-fix-ralph-live-pane-invariant.md → dev-fix-forge-live-pane-invariant.md} +7 -7
- package/docs/prs/{dev-team-ralph-workflow-positioning.md → dev-team-forge-workflow-positioning.md} +7 -7
- package/docs/qa/forge-persistence-gate.md +20 -0
- package/docs/qa/rust-runtime-thin-adapter-gate.md +31 -40
- package/docs/readme/README.de.md +13 -0
- package/docs/readme/README.el.md +13 -0
- package/docs/readme/README.es.md +13 -0
- package/docs/readme/README.fr.md +13 -0
- package/docs/readme/README.it.md +13 -0
- package/docs/readme/README.ja.md +13 -0
- package/docs/readme/README.ko.md +13 -0
- package/docs/readme/README.pl.md +13 -0
- package/docs/readme/README.pt.md +13 -0
- package/docs/readme/README.ru.md +13 -0
- package/docs/readme/README.tr.md +13 -0
- package/docs/readme/README.uk.md +13 -0
- package/docs/readme/README.vi.md +13 -0
- package/docs/readme/README.zh-TW.md +13 -0
- package/docs/readme/README.zh.md +13 -0
- package/docs/readme/rcs-cover.svg +75 -0
- package/docs/reference/canonical-vocabulary.md +106 -0
- package/docs/reference/forge-parity-matrix.md +26 -0
- package/docs/reference/forge-upstream-baseline.md +32 -0
- package/docs/reference/rcs-config-schema-routing.md +5 -5
- package/docs/reference/roblox-pre-action-protocol.md +4 -0
- package/docs/reference/roblox-taxonomy-migration-plan.md +46 -0
- package/docs/reference/roblox-workspace-standard.md +83 -0
- package/docs/reference/robloxstudio-mcp-compatibility.md +117 -0
- package/docs/reference/semantic-design-system.md +110 -0
- package/docs/reference/surface-map.md +131 -0
- package/docs/reference/team-allocation-rebalance-policy.md +1 -1
- package/docs/release-notes-v0.1.0.md +1 -1
- package/docs/release-notes-v0.1.1.md +49 -0
- package/docs/reports/open-prs-dev-readiness-2026-04-09.md +2 -2
- package/docs/shared/agent-tiers.md +3 -3
- package/docs/skills.html +10 -12
- package/docs/troubleshooting.md +1 -1
- package/package.json +20 -13
- package/plugins/roblox-ai-os-creator-skills/.codex-plugin/plugin.json +1 -1
- package/plugins/roblox-ai-os-creator-skills/docs/reference/roblox-pre-action-protocol.md +4 -0
- package/plugins/roblox-ai-os-creator-skills/skills/ai-slop-cleaner/SKILL.md +14 -7
- package/plugins/roblox-ai-os-creator-skills/skills/analyze/SKILL.md +9 -2
- package/plugins/roblox-ai-os-creator-skills/skills/ask-claude/SKILL.md +7 -0
- package/plugins/roblox-ai-os-creator-skills/skills/ask-gemini/SKILL.md +7 -0
- package/plugins/roblox-ai-os-creator-skills/skills/autoforge/SKILL.md +7 -0
- package/plugins/roblox-ai-os-creator-skills/skills/autopilot/SKILL.md +48 -41
- package/plugins/roblox-ai-os-creator-skills/skills/autoresearch/SKILL.md +8 -1
- package/plugins/roblox-ai-os-creator-skills/skills/blueprint/SKILL.md +227 -9
- package/plugins/roblox-ai-os-creator-skills/skills/blueprint-loop/SKILL.md +7 -0
- package/plugins/roblox-ai-os-creator-skills/skills/blueprint-psych/SKILL.md +7 -0
- package/plugins/roblox-ai-os-creator-skills/skills/blueprint-retention/SKILL.md +7 -0
- package/plugins/roblox-ai-os-creator-skills/skills/blueprint-social/SKILL.md +7 -0
- package/plugins/roblox-ai-os-creator-skills/skills/brief/SKILL.md +7 -0
- package/plugins/roblox-ai-os-creator-skills/skills/brief-audience/SKILL.md +7 -0
- package/plugins/roblox-ai-os-creator-skills/skills/brief-motivation/SKILL.md +7 -0
- package/plugins/roblox-ai-os-creator-skills/skills/cancel/SKILL.md +59 -52
- package/plugins/roblox-ai-os-creator-skills/skills/code-review/SKILL.md +30 -24
- package/plugins/roblox-ai-os-creator-skills/skills/configure-notifications/SKILL.md +7 -0
- package/plugins/roblox-ai-os-creator-skills/skills/crew/SKILL.md +7 -0
- package/plugins/roblox-ai-os-creator-skills/skills/deep-interview/SKILL.md +25 -18
- package/plugins/roblox-ai-os-creator-skills/skills/doctor/SKILL.md +7 -0
- package/plugins/roblox-ai-os-creator-skills/skills/forge/SKILL.md +174 -11
- package/plugins/roblox-ai-os-creator-skills/skills/forge-community/SKILL.md +7 -0
- package/plugins/roblox-ai-os-creator-skills/skills/forge-daily-loop/SKILL.md +7 -0
- package/plugins/roblox-ai-os-creator-skills/skills/forge-event-loop/SKILL.md +7 -0
- package/plugins/roblox-ai-os-creator-skills/skills/forge-fomo/SKILL.md +7 -0
- package/plugins/roblox-ai-os-creator-skills/skills/forge-mastery/SKILL.md +7 -0
- package/plugins/roblox-ai-os-creator-skills/skills/forge-progression/SKILL.md +7 -0
- package/plugins/roblox-ai-os-creator-skills/skills/forge-reward-loop/SKILL.md +7 -0
- package/plugins/roblox-ai-os-creator-skills/skills/forge-status/SKILL.md +7 -0
- package/plugins/roblox-ai-os-creator-skills/skills/help/SKILL.md +8 -1
- package/plugins/roblox-ai-os-creator-skills/skills/hud/SKILL.md +16 -9
- package/plugins/roblox-ai-os-creator-skills/skills/note/SKILL.md +8 -1
- package/plugins/roblox-ai-os-creator-skills/skills/pipeline/SKILL.md +18 -11
- package/plugins/roblox-ai-os-creator-skills/skills/plan/SKILL.md +36 -29
- package/plugins/roblox-ai-os-creator-skills/skills/rcs-setup/SKILL.md +8 -1
- package/plugins/roblox-ai-os-creator-skills/skills/security-review/SKILL.md +120 -236
- package/plugins/roblox-ai-os-creator-skills/skills/skill/SKILL.md +20 -13
- package/plugins/roblox-ai-os-creator-skills/skills/team/SKILL.md +17 -11
- package/plugins/roblox-ai-os-creator-skills/skills/trace/SKILL.md +7 -0
- package/plugins/roblox-ai-os-creator-skills/skills/ultraqa/SKILL.md +10 -3
- package/plugins/roblox-ai-os-creator-skills/skills/ultrawork/SKILL.md +19 -12
- package/plugins/roblox-ai-os-creator-skills/skills/{visual-ralph → visual-forge}/SKILL.md +36 -27
- package/plugins/roblox-ai-os-creator-skills/skills/visual-verdict/SKILL.md +9 -2
- package/plugins/roblox-ai-os-creator-skills/skills/wiki/SKILL.md +10 -3
- package/plugins/roblox-ai-os-creator-skills/skills/worker/SKILL.md +16 -7
- package/plugins/roblox-ai-os-creator-skills/templates/roblox/pre-action-plan.md +1 -0
- package/prompts/analyst.md +7 -0
- package/prompts/architect.md +11 -4
- package/prompts/build-fixer.md +7 -0
- package/prompts/code-reviewer.md +9 -2
- package/prompts/code-simplifier.md +4 -0
- package/prompts/critic.md +13 -6
- package/prompts/debugger.md +8 -1
- package/prompts/dependency-expert.md +8 -1
- package/prompts/designer.md +20 -10
- package/prompts/executor.md +7 -0
- package/prompts/explore-harness.md +7 -0
- package/prompts/explore.md +7 -0
- package/prompts/git-master.md +8 -1
- package/prompts/planner.md +10 -3
- package/prompts/researcher.md +7 -0
- package/prompts/security-reviewer.md +76 -92
- package/prompts/sisyphus-lite.md +7 -0
- package/prompts/team-executor.md +7 -0
- package/prompts/team-orchestrator.md +9 -2
- package/prompts/test-engineer.md +11 -3
- package/prompts/verifier.md +7 -0
- package/prompts/vision.md +9 -2
- package/prompts/writer.md +11 -4
- package/skills/.agents/skills/roblox-animations/SKILL.md +220 -0
- package/skills/.agents/skills/roblox-datastores/SKILL.md +219 -0
- package/skills/.agents/skills/roblox-gui/SKILL.md +192 -0
- package/skills/.agents/skills/roblox-monetization/SKILL.md +208 -0
- package/skills/.agents/skills/roblox-performance/SKILL.md +230 -0
- package/skills/.agents/skills/roblox-remote-events/SKILL.md +199 -0
- package/skills/.agents/skills/roblox-security/SKILL.md +236 -0
- package/skills/ai-slop-cleaner/SKILL.md +14 -7
- package/skills/analyze/SKILL.md +9 -2
- package/skills/ask-claude/SKILL.md +7 -0
- package/skills/ask-gemini/SKILL.md +7 -0
- package/skills/autoforge/SKILL.md +7 -0
- package/skills/autopilot/SKILL.md +48 -41
- package/skills/autoresearch/SKILL.md +8 -1
- package/skills/blueprint/SKILL.md +227 -9
- package/skills/blueprint-loop/SKILL.md +7 -0
- package/skills/blueprint-psych/SKILL.md +7 -0
- package/skills/blueprint-retention/SKILL.md +7 -0
- package/skills/blueprint-social/SKILL.md +7 -0
- package/skills/brief/SKILL.md +7 -0
- package/skills/brief-audience/SKILL.md +7 -0
- package/skills/brief-motivation/SKILL.md +7 -0
- package/skills/build-fix/SKILL.md +9 -2
- package/skills/cancel/SKILL.md +59 -52
- package/skills/code-review/SKILL.md +30 -24
- package/skills/configure-notifications/SKILL.md +7 -0
- package/skills/crew/SKILL.md +7 -0
- package/skills/deep-interview/SKILL.md +25 -18
- package/skills/deepsearch/SKILL.md +7 -0
- package/skills/doctor/SKILL.md +7 -0
- package/skills/ecomode/SKILL.md +9 -2
- package/skills/forge/SKILL.md +174 -11
- package/skills/forge-community/SKILL.md +7 -0
- package/skills/forge-daily-loop/SKILL.md +7 -0
- package/skills/forge-event-loop/SKILL.md +7 -0
- package/skills/forge-fomo/SKILL.md +7 -0
- package/skills/{ralph-init → forge-init}/SKILL.md +20 -13
- package/skills/forge-mastery/SKILL.md +7 -0
- package/skills/forge-progression/SKILL.md +7 -0
- package/skills/forge-reward-loop/SKILL.md +7 -0
- package/skills/forge-status/SKILL.md +7 -0
- package/skills/git-master/SKILL.md +7 -0
- package/skills/help/SKILL.md +8 -1
- package/skills/hud/SKILL.md +16 -9
- package/skills/note/SKILL.md +8 -1
- package/skills/pipeline/SKILL.md +18 -11
- package/skills/plan/SKILL.md +36 -29
- package/skills/rcs-setup/SKILL.md +8 -1
- package/skills/review/SKILL.md +7 -0
- package/skills/security-review/SKILL.md +120 -236
- package/skills/skill/SKILL.md +20 -13
- package/skills/skills-lock.json +47 -0
- package/skills/swarm/SKILL.md +8 -1
- package/skills/tdd/SKILL.md +7 -0
- package/skills/team/SKILL.md +17 -11
- package/skills/trace/SKILL.md +7 -0
- package/skills/ultraqa/SKILL.md +10 -3
- package/skills/ultrawork/SKILL.md +19 -12
- package/skills/{visual-ralph → visual-forge}/SKILL.md +36 -27
- package/skills/visual-verdict/SKILL.md +9 -2
- package/skills/web-clone/SKILL.md +14 -7
- package/skills/wiki/SKILL.md +10 -3
- package/skills/worker/SKILL.md +16 -7
- package/src/scripts/__tests__/codex-native-hook.test.ts +386 -319
- package/src/scripts/__tests__/run-test-files.test.ts +6 -4
- package/src/scripts/__tests__/verify-native-agents.test.ts +16 -16
- package/src/scripts/codex-native-hook.ts +34 -34
- package/src/scripts/eval/eval-cross-server-party-flow.ts +14 -0
- package/src/scripts/eval/eval-gui-onboarding-clarity.ts +20 -0
- package/src/scripts/eval/eval-liveops-reward-loop-balance.ts +14 -0
- package/src/scripts/eval/eval-profile-datastore-recovery.ts +20 -0
- package/src/scripts/eval/eval-remote-contract-hardening.ts +20 -0
- package/src/scripts/notify-fallback-watcher.ts +147 -146
- package/src/scripts/notify-hook/__tests__/team-worker-posttooluse.test.ts +24 -10
- package/src/scripts/notify-hook/{ralph-session-resume.ts → forge-session-resume.ts} +45 -43
- package/src/scripts/notify-hook/team-dispatch.ts +31 -4
- package/src/scripts/notify-hook/visual-verdict.ts +3 -3
- package/src/scripts/notify-hook.ts +10 -10
- package/src/scripts/run-test-files.ts +1 -1
- package/src/scripts/surface-taxonomy.ts +316 -0
- package/src/scripts/sync-plugin-mirror.ts +5 -4
- package/src/scripts/tmux-hook-engine.ts +31 -19
- package/templates/AGENTS.md +24 -15
- package/templates/catalog-manifest.json +5 -88
- package/templates/roblox/pre-action-plan.md +1 -0
- package/templates/roblox/robloxstudio-mcp.codex.json +18 -0
- package/templates/roblox/robloxstudio-mcp.windows.json +22 -0
- package/dist/adapt/__tests__/foundation.test.d.ts +0 -2
- package/dist/adapt/__tests__/foundation.test.d.ts.map +0 -1
- package/dist/adapt/__tests__/foundation.test.js +0 -171
- package/dist/adapt/__tests__/foundation.test.js.map +0 -1
- package/dist/adapt/__tests__/hermes.test.d.ts +0 -2
- package/dist/adapt/__tests__/hermes.test.d.ts.map +0 -1
- package/dist/adapt/__tests__/hermes.test.js +0 -137
- package/dist/adapt/__tests__/hermes.test.js.map +0 -1
- package/dist/agents/__tests__/definitions.test.d.ts +0 -2
- package/dist/agents/__tests__/definitions.test.d.ts.map +0 -1
- package/dist/agents/__tests__/definitions.test.js +0 -62
- package/dist/agents/__tests__/definitions.test.js.map +0 -1
- package/dist/agents/__tests__/native-config.test.d.ts +0 -2
- package/dist/agents/__tests__/native-config.test.d.ts.map +0 -1
- package/dist/agents/__tests__/native-config.test.js +0 -278
- package/dist/agents/__tests__/native-config.test.js.map +0 -1
- package/dist/autoresearch/__tests__/contracts.test.d.ts +0 -2
- package/dist/autoresearch/__tests__/contracts.test.d.ts.map +0 -1
- package/dist/autoresearch/__tests__/contracts.test.js +0 -127
- package/dist/autoresearch/__tests__/contracts.test.js.map +0 -1
- package/dist/autoresearch/__tests__/runtime-parity-extra.test.d.ts +0 -2
- package/dist/autoresearch/__tests__/runtime-parity-extra.test.d.ts.map +0 -1
- package/dist/autoresearch/__tests__/runtime-parity-extra.test.js +0 -356
- package/dist/autoresearch/__tests__/runtime-parity-extra.test.js.map +0 -1
- package/dist/autoresearch/__tests__/runtime.test.d.ts +0 -2
- package/dist/autoresearch/__tests__/runtime.test.d.ts.map +0 -1
- package/dist/autoresearch/__tests__/runtime.test.js +0 -218
- package/dist/autoresearch/__tests__/runtime.test.js.map +0 -1
- package/dist/autoresearch/__tests__/skill-validation.test.d.ts +0 -2
- package/dist/autoresearch/__tests__/skill-validation.test.d.ts.map +0 -1
- package/dist/autoresearch/__tests__/skill-validation.test.js +0 -91
- package/dist/autoresearch/__tests__/skill-validation.test.js.map +0 -1
- package/dist/catalog/__tests__/generator.test.d.ts +0 -2
- package/dist/catalog/__tests__/generator.test.d.ts.map +0 -1
- package/dist/catalog/__tests__/generator.test.js +0 -49
- package/dist/catalog/__tests__/generator.test.js.map +0 -1
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.d.ts +0 -2
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.d.ts.map +0 -1
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.js +0 -83
- package/dist/catalog/__tests__/plugin-bundle-ssot.test.js.map +0 -1
- package/dist/catalog/__tests__/schema.test.d.ts +0 -2
- package/dist/catalog/__tests__/schema.test.d.ts.map +0 -1
- package/dist/catalog/__tests__/schema.test.js +0 -91
- package/dist/catalog/__tests__/schema.test.js.map +0 -1
- package/dist/cli/__tests__/adapt-help.test.d.ts +0 -2
- package/dist/cli/__tests__/adapt-help.test.d.ts.map +0 -1
- package/dist/cli/__tests__/adapt-help.test.js +0 -37
- package/dist/cli/__tests__/adapt-help.test.js.map +0 -1
- package/dist/cli/__tests__/adapt.test.d.ts +0 -2
- package/dist/cli/__tests__/adapt.test.d.ts.map +0 -1
- package/dist/cli/__tests__/adapt.test.js +0 -62
- package/dist/cli/__tests__/adapt.test.js.map +0 -1
- package/dist/cli/__tests__/agents-init.test.d.ts +0 -2
- package/dist/cli/__tests__/agents-init.test.d.ts.map +0 -1
- package/dist/cli/__tests__/agents-init.test.js +0 -184
- package/dist/cli/__tests__/agents-init.test.js.map +0 -1
- package/dist/cli/__tests__/agents.test.d.ts +0 -2
- package/dist/cli/__tests__/agents.test.d.ts.map +0 -1
- package/dist/cli/__tests__/agents.test.js +0 -137
- package/dist/cli/__tests__/agents.test.js.map +0 -1
- package/dist/cli/__tests__/ask.test.d.ts +0 -2
- package/dist/cli/__tests__/ask.test.d.ts.map +0 -1
- package/dist/cli/__tests__/ask.test.js +0 -265
- package/dist/cli/__tests__/ask.test.js.map +0 -1
- package/dist/cli/__tests__/autoresearch-guided.test.d.ts +0 -2
- package/dist/cli/__tests__/autoresearch-guided.test.d.ts.map +0 -1
- package/dist/cli/__tests__/autoresearch-guided.test.js +0 -365
- package/dist/cli/__tests__/autoresearch-guided.test.js.map +0 -1
- package/dist/cli/__tests__/autoresearch.test.d.ts +0 -2
- package/dist/cli/__tests__/autoresearch.test.d.ts.map +0 -1
- package/dist/cli/__tests__/autoresearch.test.js +0 -203
- package/dist/cli/__tests__/autoresearch.test.js.map +0 -1
- package/dist/cli/__tests__/catalog-contract.test.d.ts +0 -2
- package/dist/cli/__tests__/catalog-contract.test.d.ts.map +0 -1
- package/dist/cli/__tests__/catalog-contract.test.js +0 -18
- package/dist/cli/__tests__/catalog-contract.test.js.map +0 -1
- package/dist/cli/__tests__/cleanup.test.d.ts +0 -2
- package/dist/cli/__tests__/cleanup.test.d.ts.map +0 -1
- package/dist/cli/__tests__/cleanup.test.js +0 -419
- package/dist/cli/__tests__/cleanup.test.js.map +0 -1
- package/dist/cli/__tests__/codex-plugin-layout.test.d.ts +0 -2
- package/dist/cli/__tests__/codex-plugin-layout.test.d.ts.map +0 -1
- package/dist/cli/__tests__/codex-plugin-layout.test.js +0 -210
- package/dist/cli/__tests__/codex-plugin-layout.test.js.map +0 -1
- package/dist/cli/__tests__/doctor-context-window-warning.test.d.ts +0 -2
- package/dist/cli/__tests__/doctor-context-window-warning.test.d.ts.map +0 -1
- package/dist/cli/__tests__/doctor-context-window-warning.test.js +0 -122
- package/dist/cli/__tests__/doctor-context-window-warning.test.js.map +0 -1
- package/dist/cli/__tests__/doctor-invalid-config.test.d.ts +0 -2
- package/dist/cli/__tests__/doctor-invalid-config.test.d.ts.map +0 -1
- package/dist/cli/__tests__/doctor-invalid-config.test.js +0 -52
- package/dist/cli/__tests__/doctor-invalid-config.test.js.map +0 -1
- package/dist/cli/__tests__/doctor-team.test.d.ts +0 -2
- package/dist/cli/__tests__/doctor-team.test.d.ts.map +0 -1
- package/dist/cli/__tests__/doctor-team.test.js +0 -299
- package/dist/cli/__tests__/doctor-team.test.js.map +0 -1
- package/dist/cli/__tests__/doctor-warning-copy.test.d.ts +0 -2
- package/dist/cli/__tests__/doctor-warning-copy.test.d.ts.map +0 -1
- package/dist/cli/__tests__/doctor-warning-copy.test.js +0 -438
- package/dist/cli/__tests__/doctor-warning-copy.test.js.map +0 -1
- package/dist/cli/__tests__/error-handling-warnings.test.d.ts +0 -2
- package/dist/cli/__tests__/error-handling-warnings.test.d.ts.map +0 -1
- package/dist/cli/__tests__/error-handling-warnings.test.js +0 -52
- package/dist/cli/__tests__/error-handling-warnings.test.js.map +0 -1
- package/dist/cli/__tests__/exec.test.d.ts +0 -2
- package/dist/cli/__tests__/exec.test.d.ts.map +0 -1
- package/dist/cli/__tests__/exec.test.js +0 -213
- package/dist/cli/__tests__/exec.test.js.map +0 -1
- package/dist/cli/__tests__/explore-windows-diagnostics.test.d.ts +0 -2
- package/dist/cli/__tests__/explore-windows-diagnostics.test.d.ts.map +0 -1
- package/dist/cli/__tests__/explore-windows-diagnostics.test.js +0 -17
- package/dist/cli/__tests__/explore-windows-diagnostics.test.js.map +0 -1
- package/dist/cli/__tests__/explore.test.d.ts +0 -2
- package/dist/cli/__tests__/explore.test.d.ts.map +0 -1
- package/dist/cli/__tests__/explore.test.js +0 -1090
- package/dist/cli/__tests__/explore.test.js.map +0 -1
- package/dist/cli/__tests__/hooks.test.d.ts +0 -2
- package/dist/cli/__tests__/hooks.test.d.ts.map +0 -1
- package/dist/cli/__tests__/hooks.test.js +0 -55
- package/dist/cli/__tests__/hooks.test.js.map +0 -1
- package/dist/cli/__tests__/index.test.d.ts +0 -2
- package/dist/cli/__tests__/index.test.d.ts.map +0 -1
- package/dist/cli/__tests__/index.test.js +0 -2259
- package/dist/cli/__tests__/index.test.js.map +0 -1
- package/dist/cli/__tests__/launch-fallback.test.d.ts +0 -2
- package/dist/cli/__tests__/launch-fallback.test.d.ts.map +0 -1
- package/dist/cli/__tests__/launch-fallback.test.js +0 -661
- package/dist/cli/__tests__/launch-fallback.test.js.map +0 -1
- package/dist/cli/__tests__/lifecycle-notifications.test.d.ts +0 -2
- package/dist/cli/__tests__/lifecycle-notifications.test.d.ts.map +0 -1
- package/dist/cli/__tests__/lifecycle-notifications.test.js +0 -48
- package/dist/cli/__tests__/lifecycle-notifications.test.js.map +0 -1
- package/dist/cli/__tests__/list.test.d.ts +0 -2
- package/dist/cli/__tests__/list.test.d.ts.map +0 -1
- package/dist/cli/__tests__/list.test.js +0 -38
- package/dist/cli/__tests__/list.test.js.map +0 -1
- package/dist/cli/__tests__/mcp-parity.test.d.ts +0 -2
- package/dist/cli/__tests__/mcp-parity.test.d.ts.map +0 -1
- package/dist/cli/__tests__/mcp-parity.test.js +0 -228
- package/dist/cli/__tests__/mcp-parity.test.js.map +0 -1
- package/dist/cli/__tests__/mcp-serve.test.d.ts +0 -2
- package/dist/cli/__tests__/mcp-serve.test.d.ts.map +0 -1
- package/dist/cli/__tests__/mcp-serve.test.js +0 -64
- package/dist/cli/__tests__/mcp-serve.test.js.map +0 -1
- package/dist/cli/__tests__/native-assets.test.d.ts +0 -2
- package/dist/cli/__tests__/native-assets.test.d.ts.map +0 -1
- package/dist/cli/__tests__/native-assets.test.js +0 -308
- package/dist/cli/__tests__/native-assets.test.js.map +0 -1
- package/dist/cli/__tests__/native-hook-dispatch-contract.test.d.ts +0 -2
- package/dist/cli/__tests__/native-hook-dispatch-contract.test.d.ts.map +0 -1
- package/dist/cli/__tests__/native-hook-dispatch-contract.test.js +0 -11
- package/dist/cli/__tests__/native-hook-dispatch-contract.test.js.map +0 -1
- package/dist/cli/__tests__/nested-help-routing.test.d.ts +0 -2
- package/dist/cli/__tests__/nested-help-routing.test.d.ts.map +0 -1
- package/dist/cli/__tests__/nested-help-routing.test.js +0 -96
- package/dist/cli/__tests__/nested-help-routing.test.js.map +0 -1
- package/dist/cli/__tests__/package-bin-contract.test.d.ts +0 -2
- package/dist/cli/__tests__/package-bin-contract.test.d.ts.map +0 -1
- package/dist/cli/__tests__/package-bin-contract.test.js +0 -177
- package/dist/cli/__tests__/package-bin-contract.test.js.map +0 -1
- package/dist/cli/__tests__/packaged-explore-harness-lock.d.ts +0 -3
- package/dist/cli/__tests__/packaged-explore-harness-lock.d.ts.map +0 -1
- package/dist/cli/__tests__/packaged-explore-harness-lock.js +0 -67
- package/dist/cli/__tests__/packaged-explore-harness-lock.js.map +0 -1
- package/dist/cli/__tests__/packaged-script-resolution.test.d.ts +0 -2
- package/dist/cli/__tests__/packaged-script-resolution.test.d.ts.map +0 -1
- package/dist/cli/__tests__/packaged-script-resolution.test.js +0 -19
- package/dist/cli/__tests__/packaged-script-resolution.test.js.map +0 -1
- package/dist/cli/__tests__/prompt-skill-sanitization.test.d.ts +0 -2
- package/dist/cli/__tests__/prompt-skill-sanitization.test.d.ts.map +0 -1
- package/dist/cli/__tests__/prompt-skill-sanitization.test.js +0 -48
- package/dist/cli/__tests__/prompt-skill-sanitization.test.js.map +0 -1
- package/dist/cli/__tests__/question.test.d.ts +0 -2
- package/dist/cli/__tests__/question.test.d.ts.map +0 -1
- package/dist/cli/__tests__/question.test.js +0 -633
- package/dist/cli/__tests__/question.test.js.map +0 -1
- package/dist/cli/__tests__/ralph-deslop-contract.test.d.ts +0 -2
- package/dist/cli/__tests__/ralph-deslop-contract.test.d.ts.map +0 -1
- package/dist/cli/__tests__/ralph-deslop-contract.test.js +0 -28
- package/dist/cli/__tests__/ralph-deslop-contract.test.js.map +0 -1
- package/dist/cli/__tests__/ralph-prd-deep-interview.test.d.ts +0 -2
- package/dist/cli/__tests__/ralph-prd-deep-interview.test.d.ts.map +0 -1
- package/dist/cli/__tests__/ralph-prd-deep-interview.test.js +0 -24
- package/dist/cli/__tests__/ralph-prd-deep-interview.test.js.map +0 -1
- package/dist/cli/__tests__/ralph-prd-smoke.test.d.ts +0 -2
- package/dist/cli/__tests__/ralph-prd-smoke.test.d.ts.map +0 -1
- package/dist/cli/__tests__/ralph-prd-smoke.test.js +0 -167
- package/dist/cli/__tests__/ralph-prd-smoke.test.js.map +0 -1
- package/dist/cli/__tests__/ralph.test.d.ts +0 -2
- package/dist/cli/__tests__/ralph.test.d.ts.map +0 -1
- package/dist/cli/__tests__/ralph.test.js +0 -256
- package/dist/cli/__tests__/ralph.test.js.map +0 -1
- package/dist/cli/__tests__/resume.test.d.ts +0 -2
- package/dist/cli/__tests__/resume.test.d.ts.map +0 -1
- package/dist/cli/__tests__/resume.test.js +0 -84
- package/dist/cli/__tests__/resume.test.js.map +0 -1
- package/dist/cli/__tests__/session-scoped-runtime.test.d.ts +0 -2
- package/dist/cli/__tests__/session-scoped-runtime.test.d.ts.map +0 -1
- package/dist/cli/__tests__/session-scoped-runtime.test.js +0 -146
- package/dist/cli/__tests__/session-scoped-runtime.test.js.map +0 -1
- package/dist/cli/__tests__/session-search-help.test.d.ts +0 -2
- package/dist/cli/__tests__/session-search-help.test.d.ts.map +0 -1
- package/dist/cli/__tests__/session-search-help.test.js +0 -76
- package/dist/cli/__tests__/session-search-help.test.js.map +0 -1
- package/dist/cli/__tests__/session-search.test.d.ts +0 -2
- package/dist/cli/__tests__/session-search.test.d.ts.map +0 -1
- package/dist/cli/__tests__/session-search.test.js +0 -77
- package/dist/cli/__tests__/session-search.test.js.map +0 -1
- package/dist/cli/__tests__/setup-agents-overwrite.test.d.ts +0 -2
- package/dist/cli/__tests__/setup-agents-overwrite.test.d.ts.map +0 -1
- package/dist/cli/__tests__/setup-agents-overwrite.test.js +0 -457
- package/dist/cli/__tests__/setup-agents-overwrite.test.js.map +0 -1
- package/dist/cli/__tests__/setup-gh-star.test.d.ts +0 -2
- package/dist/cli/__tests__/setup-gh-star.test.d.ts.map +0 -1
- package/dist/cli/__tests__/setup-gh-star.test.js +0 -67
- package/dist/cli/__tests__/setup-gh-star.test.js.map +0 -1
- package/dist/cli/__tests__/setup-hooks-shared-ownership.test.d.ts +0 -2
- package/dist/cli/__tests__/setup-hooks-shared-ownership.test.d.ts.map +0 -1
- package/dist/cli/__tests__/setup-hooks-shared-ownership.test.js +0 -189
- package/dist/cli/__tests__/setup-hooks-shared-ownership.test.js.map +0 -1
- package/dist/cli/__tests__/setup-install-mode.test.d.ts +0 -2
- package/dist/cli/__tests__/setup-install-mode.test.d.ts.map +0 -1
- package/dist/cli/__tests__/setup-install-mode.test.js +0 -873
- package/dist/cli/__tests__/setup-install-mode.test.js.map +0 -1
- package/dist/cli/__tests__/setup-prompts-overwrite.test.d.ts +0 -2
- package/dist/cli/__tests__/setup-prompts-overwrite.test.d.ts.map +0 -1
- package/dist/cli/__tests__/setup-prompts-overwrite.test.js +0 -191
- package/dist/cli/__tests__/setup-prompts-overwrite.test.js.map +0 -1
- package/dist/cli/__tests__/setup-refresh.test.d.ts +0 -2
- package/dist/cli/__tests__/setup-refresh.test.d.ts.map +0 -1
- package/dist/cli/__tests__/setup-refresh.test.js +0 -591
- package/dist/cli/__tests__/setup-refresh.test.js.map +0 -1
- package/dist/cli/__tests__/setup-scope.test.d.ts +0 -2
- package/dist/cli/__tests__/setup-scope.test.d.ts.map +0 -1
- package/dist/cli/__tests__/setup-scope.test.js +0 -340
- package/dist/cli/__tests__/setup-scope.test.js.map +0 -1
- package/dist/cli/__tests__/setup-skill-validation.test.d.ts +0 -2
- package/dist/cli/__tests__/setup-skill-validation.test.d.ts.map +0 -1
- package/dist/cli/__tests__/setup-skill-validation.test.js +0 -44
- package/dist/cli/__tests__/setup-skill-validation.test.js.map +0 -1
- package/dist/cli/__tests__/setup-skills-overwrite.test.d.ts +0 -2
- package/dist/cli/__tests__/setup-skills-overwrite.test.d.ts.map +0 -1
- package/dist/cli/__tests__/setup-skills-overwrite.test.js +0 -295
- package/dist/cli/__tests__/setup-skills-overwrite.test.js.map +0 -1
- package/dist/cli/__tests__/sidecar.test.d.ts +0 -2
- package/dist/cli/__tests__/sidecar.test.d.ts.map +0 -1
- package/dist/cli/__tests__/sidecar.test.js +0 -24
- package/dist/cli/__tests__/sidecar.test.js.map +0 -1
- package/dist/cli/__tests__/sparkshell-cli.test.d.ts +0 -2
- package/dist/cli/__tests__/sparkshell-cli.test.d.ts.map +0 -1
- package/dist/cli/__tests__/sparkshell-cli.test.js +0 -400
- package/dist/cli/__tests__/sparkshell-cli.test.js.map +0 -1
- package/dist/cli/__tests__/sparkshell-packaging.test.d.ts +0 -2
- package/dist/cli/__tests__/sparkshell-packaging.test.d.ts.map +0 -1
- package/dist/cli/__tests__/sparkshell-packaging.test.js +0 -74
- package/dist/cli/__tests__/sparkshell-packaging.test.js.map +0 -1
- package/dist/cli/__tests__/star-prompt.test.d.ts +0 -2
- package/dist/cli/__tests__/star-prompt.test.d.ts.map +0 -1
- package/dist/cli/__tests__/star-prompt.test.js +0 -172
- package/dist/cli/__tests__/star-prompt.test.js.map +0 -1
- package/dist/cli/__tests__/state.test.d.ts +0 -2
- package/dist/cli/__tests__/state.test.d.ts.map +0 -1
- package/dist/cli/__tests__/state.test.js +0 -46
- package/dist/cli/__tests__/state.test.js.map +0 -1
- package/dist/cli/__tests__/team-decompose.test.d.ts +0 -2
- package/dist/cli/__tests__/team-decompose.test.d.ts.map +0 -1
- package/dist/cli/__tests__/team-decompose.test.js +0 -133
- package/dist/cli/__tests__/team-decompose.test.js.map +0 -1
- package/dist/cli/__tests__/team.test.d.ts +0 -2
- package/dist/cli/__tests__/team.test.d.ts.map +0 -1
- package/dist/cli/__tests__/team.test.js +0 -1820
- package/dist/cli/__tests__/team.test.js.map +0 -1
- package/dist/cli/__tests__/uninstall.test.d.ts +0 -2
- package/dist/cli/__tests__/uninstall.test.d.ts.map +0 -1
- package/dist/cli/__tests__/uninstall.test.js +0 -766
- package/dist/cli/__tests__/uninstall.test.js.map +0 -1
- package/dist/cli/__tests__/update.test.d.ts +0 -2
- package/dist/cli/__tests__/update.test.d.ts.map +0 -1
- package/dist/cli/__tests__/update.test.js +0 -589
- package/dist/cli/__tests__/update.test.js.map +0 -1
- package/dist/cli/__tests__/version-sync-contract.test.d.ts +0 -2
- package/dist/cli/__tests__/version-sync-contract.test.d.ts.map +0 -1
- package/dist/cli/__tests__/version-sync-contract.test.js +0 -41
- package/dist/cli/__tests__/version-sync-contract.test.js.map +0 -1
- package/dist/cli/__tests__/version.test.d.ts +0 -2
- package/dist/cli/__tests__/version.test.d.ts.map +0 -1
- package/dist/cli/__tests__/version.test.js +0 -21
- package/dist/cli/__tests__/version.test.js.map +0 -1
- package/dist/cli/__tests__/windows-popup-loop-contract.test.d.ts +0 -2
- package/dist/cli/__tests__/windows-popup-loop-contract.test.d.ts.map +0 -1
- package/dist/cli/__tests__/windows-popup-loop-contract.test.js +0 -31
- package/dist/cli/__tests__/windows-popup-loop-contract.test.js.map +0 -1
- package/dist/cli/ralph.d.ts +0 -17
- package/dist/compat/__tests__/doctor-contract.test.d.ts +0 -2
- package/dist/compat/__tests__/doctor-contract.test.d.ts.map +0 -1
- package/dist/compat/__tests__/doctor-contract.test.js +0 -108
- package/dist/compat/__tests__/doctor-contract.test.js.map +0 -1
- package/dist/compat/__tests__/rust-runtime-compat.test.d.ts +0 -2
- package/dist/compat/__tests__/rust-runtime-compat.test.d.ts.map +0 -1
- package/dist/compat/__tests__/rust-runtime-compat.test.js +0 -218
- package/dist/compat/__tests__/rust-runtime-compat.test.js.map +0 -1
- package/dist/config/__tests__/codex-hooks.test.d.ts +0 -2
- package/dist/config/__tests__/codex-hooks.test.d.ts.map +0 -1
- package/dist/config/__tests__/codex-hooks.test.js +0 -77
- package/dist/config/__tests__/codex-hooks.test.js.map +0 -1
- package/dist/config/__tests__/generator-idempotent.test.d.ts +0 -2
- package/dist/config/__tests__/generator-idempotent.test.d.ts.map +0 -1
- package/dist/config/__tests__/generator-idempotent.test.js +0 -882
- package/dist/config/__tests__/generator-idempotent.test.js.map +0 -1
- package/dist/config/__tests__/generator-notify.test.d.ts +0 -2
- package/dist/config/__tests__/generator-notify.test.d.ts.map +0 -1
- package/dist/config/__tests__/generator-notify.test.js +0 -343
- package/dist/config/__tests__/generator-notify.test.js.map +0 -1
- package/dist/config/__tests__/generator-status-line-presets.test.d.ts +0 -2
- package/dist/config/__tests__/generator-status-line-presets.test.d.ts.map +0 -1
- package/dist/config/__tests__/generator-status-line-presets.test.js +0 -203
- package/dist/config/__tests__/generator-status-line-presets.test.js.map +0 -1
- package/dist/config/__tests__/mcp-registry.test.d.ts +0 -2
- package/dist/config/__tests__/mcp-registry.test.d.ts.map +0 -1
- package/dist/config/__tests__/mcp-registry.test.js +0 -190
- package/dist/config/__tests__/mcp-registry.test.js.map +0 -1
- package/dist/config/__tests__/models.test.d.ts +0 -2
- package/dist/config/__tests__/models.test.d.ts.map +0 -1
- package/dist/config/__tests__/models.test.js +0 -224
- package/dist/config/__tests__/models.test.js.map +0 -1
- package/dist/config/__tests__/wiki-config-contract.test.d.ts +0 -2
- package/dist/config/__tests__/wiki-config-contract.test.d.ts.map +0 -1
- package/dist/config/__tests__/wiki-config-contract.test.js +0 -19
- package/dist/config/__tests__/wiki-config-contract.test.js.map +0 -1
- package/dist/document-refresh/__tests__/enforcer.test.d.ts +0 -2
- package/dist/document-refresh/__tests__/enforcer.test.d.ts.map +0 -1
- package/dist/document-refresh/__tests__/enforcer.test.js +0 -128
- package/dist/document-refresh/__tests__/enforcer.test.js.map +0 -1
- package/dist/hooks/__tests__/agents-overlay.test.d.ts +0 -8
- package/dist/hooks/__tests__/agents-overlay.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/agents-overlay.test.js +0 -644
- package/dist/hooks/__tests__/agents-overlay.test.js.map +0 -1
- package/dist/hooks/__tests__/analyze-routing-contract.test.d.ts +0 -2
- package/dist/hooks/__tests__/analyze-routing-contract.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/analyze-routing-contract.test.js +0 -45
- package/dist/hooks/__tests__/analyze-routing-contract.test.js.map +0 -1
- package/dist/hooks/__tests__/analyze-skill-contract.test.d.ts +0 -2
- package/dist/hooks/__tests__/analyze-skill-contract.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/analyze-skill-contract.test.js +0 -48
- package/dist/hooks/__tests__/analyze-skill-contract.test.js.map +0 -1
- package/dist/hooks/__tests__/anti-slop-workflow.test.d.ts +0 -2
- package/dist/hooks/__tests__/anti-slop-workflow.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/anti-slop-workflow.test.js +0 -146
- package/dist/hooks/__tests__/anti-slop-workflow.test.js.map +0 -1
- package/dist/hooks/__tests__/autopilot-skill-contract.test.d.ts +0 -2
- package/dist/hooks/__tests__/autopilot-skill-contract.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js +0 -37
- package/dist/hooks/__tests__/autopilot-skill-contract.test.js.map +0 -1
- package/dist/hooks/__tests__/clawhip-event-contract.test.d.ts +0 -2
- package/dist/hooks/__tests__/clawhip-event-contract.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/clawhip-event-contract.test.js +0 -37
- package/dist/hooks/__tests__/clawhip-event-contract.test.js.map +0 -1
- package/dist/hooks/__tests__/code-review-skill-contract.test.d.ts +0 -2
- package/dist/hooks/__tests__/code-review-skill-contract.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/code-review-skill-contract.test.js +0 -56
- package/dist/hooks/__tests__/code-review-skill-contract.test.js.map +0 -1
- package/dist/hooks/__tests__/codebase-map.test.d.ts +0 -8
- package/dist/hooks/__tests__/codebase-map.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/codebase-map.test.js +0 -218
- package/dist/hooks/__tests__/codebase-map.test.js.map +0 -1
- package/dist/hooks/__tests__/consensus-execution-handoff.test.d.ts +0 -18
- package/dist/hooks/__tests__/consensus-execution-handoff.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/consensus-execution-handoff.test.js +0 -234
- package/dist/hooks/__tests__/consensus-execution-handoff.test.js.map +0 -1
- package/dist/hooks/__tests__/debugger-log-recency-contract.test.d.ts +0 -2
- package/dist/hooks/__tests__/debugger-log-recency-contract.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/debugger-log-recency-contract.test.js +0 -20
- package/dist/hooks/__tests__/debugger-log-recency-contract.test.js.map +0 -1
- package/dist/hooks/__tests__/deep-interview-contract.test.d.ts +0 -2
- package/dist/hooks/__tests__/deep-interview-contract.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/deep-interview-contract.test.js +0 -213
- package/dist/hooks/__tests__/deep-interview-contract.test.js.map +0 -1
- package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.d.ts +0 -2
- package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.js +0 -43
- package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.js.map +0 -1
- package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.d.ts +0 -2
- package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.js +0 -38
- package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.js.map +0 -1
- package/dist/hooks/__tests__/explore-routing.test.d.ts +0 -2
- package/dist/hooks/__tests__/explore-routing.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/explore-routing.test.js +0 -43
- package/dist/hooks/__tests__/explore-routing.test.js.map +0 -1
- package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.d.ts +0 -2
- package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.js +0 -69
- package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.js.map +0 -1
- package/dist/hooks/__tests__/keyword-detector.test.d.ts +0 -2
- package/dist/hooks/__tests__/keyword-detector.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/keyword-detector.test.js +0 -1716
- package/dist/hooks/__tests__/keyword-detector.test.js.map +0 -1
- package/dist/hooks/__tests__/notify-fallback-watcher.test.d.ts +0 -2
- package/dist/hooks/__tests__/notify-fallback-watcher.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js +0 -3898
- package/dist/hooks/__tests__/notify-fallback-watcher.test.js.map +0 -1
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.d.ts +0 -2
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js +0 -786
- package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js.map +0 -1
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.d.ts +0 -2
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js +0 -2397
- package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js.map +0 -1
- package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.d.ts +0 -2
- package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js +0 -160
- package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js.map +0 -1
- package/dist/hooks/__tests__/notify-hook-managed-tmux.test.d.ts +0 -2
- package/dist/hooks/__tests__/notify-hook-managed-tmux.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js +0 -1178
- package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js.map +0 -1
- package/dist/hooks/__tests__/notify-hook-modules.test.d.ts +0 -9
- package/dist/hooks/__tests__/notify-hook-modules.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/notify-hook-modules.test.js +0 -529
- package/dist/hooks/__tests__/notify-hook-modules.test.js.map +0 -1
- package/dist/hooks/__tests__/notify-hook-native-dispatch-contract.test.d.ts +0 -2
- package/dist/hooks/__tests__/notify-hook-native-dispatch-contract.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/notify-hook-native-dispatch-contract.test.js +0 -14
- package/dist/hooks/__tests__/notify-hook-native-dispatch-contract.test.js.map +0 -1
- package/dist/hooks/__tests__/notify-hook-ralph-resume.test.d.ts +0 -2
- package/dist/hooks/__tests__/notify-hook-ralph-resume.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/notify-hook-ralph-resume.test.js +0 -682
- package/dist/hooks/__tests__/notify-hook-ralph-resume.test.js.map +0 -1
- package/dist/hooks/__tests__/notify-hook-regression-205.test.d.ts +0 -9
- package/dist/hooks/__tests__/notify-hook-regression-205.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/notify-hook-regression-205.test.js +0 -255
- package/dist/hooks/__tests__/notify-hook-regression-205.test.js.map +0 -1
- package/dist/hooks/__tests__/notify-hook-session-idle-dedupe.test.d.ts +0 -2
- package/dist/hooks/__tests__/notify-hook-session-idle-dedupe.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/notify-hook-session-idle-dedupe.test.js +0 -162
- package/dist/hooks/__tests__/notify-hook-session-idle-dedupe.test.js.map +0 -1
- package/dist/hooks/__tests__/notify-hook-session-scope.test.d.ts +0 -2
- package/dist/hooks/__tests__/notify-hook-session-scope.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/notify-hook-session-scope.test.js +0 -301
- package/dist/hooks/__tests__/notify-hook-session-scope.test.js.map +0 -1
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.d.ts +0 -2
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js +0 -1510
- package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js.map +0 -1
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.d.ts +0 -2
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js +0 -2879
- package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js.map +0 -1
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.d.ts +0 -2
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js +0 -228
- package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js.map +0 -1
- package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.d.ts +0 -2
- package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.js +0 -35
- package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.js.map +0 -1
- package/dist/hooks/__tests__/notify-hook-tmux-heal.test.d.ts +0 -2
- package/dist/hooks/__tests__/notify-hook-tmux-heal.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js +0 -1589
- package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js.map +0 -1
- package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.d.ts +0 -10
- package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.js +0 -0
- package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.js.map +0 -1
- package/dist/hooks/__tests__/notify-hook-visual-verdict.test.d.ts +0 -11
- package/dist/hooks/__tests__/notify-hook-visual-verdict.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/notify-hook-visual-verdict.test.js +0 -266
- package/dist/hooks/__tests__/notify-hook-visual-verdict.test.js.map +0 -1
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.d.ts +0 -2
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.js +0 -895
- package/dist/hooks/__tests__/notify-hook-worker-idle.test.js.map +0 -1
- package/dist/hooks/__tests__/openclaw-setup-contract.test.d.ts +0 -2
- package/dist/hooks/__tests__/openclaw-setup-contract.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/openclaw-setup-contract.test.js +0 -61
- package/dist/hooks/__tests__/openclaw-setup-contract.test.js.map +0 -1
- package/dist/hooks/__tests__/pre-context-gate-skills.test.d.ts +0 -2
- package/dist/hooks/__tests__/pre-context-gate-skills.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/pre-context-gate-skills.test.js +0 -40
- package/dist/hooks/__tests__/pre-context-gate-skills.test.js.map +0 -1
- package/dist/hooks/__tests__/prompt-guidance-catalog.test.d.ts +0 -2
- package/dist/hooks/__tests__/prompt-guidance-catalog.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/prompt-guidance-catalog.test.js +0 -11
- package/dist/hooks/__tests__/prompt-guidance-catalog.test.js.map +0 -1
- package/dist/hooks/__tests__/prompt-guidance-contract.test.d.ts +0 -2
- package/dist/hooks/__tests__/prompt-guidance-contract.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/prompt-guidance-contract.test.js +0 -38
- package/dist/hooks/__tests__/prompt-guidance-contract.test.js.map +0 -1
- package/dist/hooks/__tests__/prompt-guidance-fragments.test.d.ts +0 -2
- package/dist/hooks/__tests__/prompt-guidance-fragments.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/prompt-guidance-fragments.test.js +0 -48
- package/dist/hooks/__tests__/prompt-guidance-fragments.test.js.map +0 -1
- package/dist/hooks/__tests__/prompt-guidance-scenarios.test.d.ts +0 -2
- package/dist/hooks/__tests__/prompt-guidance-scenarios.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/prompt-guidance-scenarios.test.js +0 -11
- package/dist/hooks/__tests__/prompt-guidance-scenarios.test.js.map +0 -1
- package/dist/hooks/__tests__/prompt-guidance-test-helpers.d.ts +0 -5
- package/dist/hooks/__tests__/prompt-guidance-test-helpers.d.ts.map +0 -1
- package/dist/hooks/__tests__/prompt-guidance-test-helpers.js +0 -34
- package/dist/hooks/__tests__/prompt-guidance-test-helpers.js.map +0 -1
- package/dist/hooks/__tests__/prompt-guidance-wave-two.test.d.ts +0 -2
- package/dist/hooks/__tests__/prompt-guidance-wave-two.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js +0 -65
- package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js.map +0 -1
- package/dist/hooks/__tests__/prompt-orchestration-boundary.test.d.ts +0 -2
- package/dist/hooks/__tests__/prompt-orchestration-boundary.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/prompt-orchestration-boundary.test.js +0 -38
- package/dist/hooks/__tests__/prompt-orchestration-boundary.test.js.map +0 -1
- package/dist/hooks/__tests__/prompt-refactor-contract.test.d.ts +0 -2
- package/dist/hooks/__tests__/prompt-refactor-contract.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/prompt-refactor-contract.test.js +0 -22
- package/dist/hooks/__tests__/prompt-refactor-contract.test.js.map +0 -1
- package/dist/hooks/__tests__/prompt-team-routing.test.d.ts +0 -2
- package/dist/hooks/__tests__/prompt-team-routing.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/prompt-team-routing.test.js +0 -49
- package/dist/hooks/__tests__/prompt-team-routing.test.js.map +0 -1
- package/dist/hooks/__tests__/session.test.d.ts +0 -2
- package/dist/hooks/__tests__/session.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/session.test.js +0 -322
- package/dist/hooks/__tests__/session.test.js.map +0 -1
- package/dist/hooks/__tests__/skill-guidance-contract.test.d.ts +0 -2
- package/dist/hooks/__tests__/skill-guidance-contract.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/skill-guidance-contract.test.js +0 -29
- package/dist/hooks/__tests__/skill-guidance-contract.test.js.map +0 -1
- package/dist/hooks/__tests__/task-size-detector.test.d.ts +0 -2
- package/dist/hooks/__tests__/task-size-detector.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/task-size-detector.test.js +0 -330
- package/dist/hooks/__tests__/task-size-detector.test.js.map +0 -1
- package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.d.ts +0 -2
- package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.js +0 -28
- package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.js.map +0 -1
- package/dist/hooks/__tests__/tmux-hook-engine-types-sync.test.d.ts +0 -2
- package/dist/hooks/__tests__/tmux-hook-engine-types-sync.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/tmux-hook-engine-types-sync.test.js +0 -24
- package/dist/hooks/__tests__/tmux-hook-engine-types-sync.test.js.map +0 -1
- package/dist/hooks/__tests__/tmux-hook-engine.test.d.ts +0 -2
- package/dist/hooks/__tests__/tmux-hook-engine.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/tmux-hook-engine.test.js +0 -403
- package/dist/hooks/__tests__/tmux-hook-engine.test.js.map +0 -1
- package/dist/hooks/__tests__/triage-config.test.d.ts +0 -2
- package/dist/hooks/__tests__/triage-config.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/triage-config.test.js +0 -211
- package/dist/hooks/__tests__/triage-config.test.js.map +0 -1
- package/dist/hooks/__tests__/triage-heuristic.test.d.ts +0 -2
- package/dist/hooks/__tests__/triage-heuristic.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/triage-heuristic.test.js +0 -285
- package/dist/hooks/__tests__/triage-heuristic.test.js.map +0 -1
- package/dist/hooks/__tests__/triage-state.test.d.ts +0 -2
- package/dist/hooks/__tests__/triage-state.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/triage-state.test.js +0 -426
- package/dist/hooks/__tests__/triage-state.test.js.map +0 -1
- package/dist/hooks/__tests__/visual-ralph-skill.test.d.ts +0 -2
- package/dist/hooks/__tests__/visual-ralph-skill.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/visual-ralph-skill.test.js +0 -44
- package/dist/hooks/__tests__/visual-ralph-skill.test.js.map +0 -1
- package/dist/hooks/__tests__/visual-verdict-loop.test.d.ts +0 -2
- package/dist/hooks/__tests__/visual-verdict-loop.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/visual-verdict-loop.test.js +0 -35
- package/dist/hooks/__tests__/visual-verdict-loop.test.js.map +0 -1
- package/dist/hooks/__tests__/wiki-docs-contract.test.d.ts +0 -2
- package/dist/hooks/__tests__/wiki-docs-contract.test.d.ts.map +0 -1
- package/dist/hooks/__tests__/wiki-docs-contract.test.js +0 -34
- package/dist/hooks/__tests__/wiki-docs-contract.test.js.map +0 -1
- package/dist/hooks/code-simplifier/__tests__/index.test.d.ts +0 -2
- package/dist/hooks/code-simplifier/__tests__/index.test.d.ts.map +0 -1
- package/dist/hooks/code-simplifier/__tests__/index.test.js +0 -187
- package/dist/hooks/code-simplifier/__tests__/index.test.js.map +0 -1
- package/dist/hooks/extensibility/__tests__/dispatcher.test.d.ts +0 -2
- package/dist/hooks/extensibility/__tests__/dispatcher.test.d.ts.map +0 -1
- package/dist/hooks/extensibility/__tests__/dispatcher.test.js +0 -242
- package/dist/hooks/extensibility/__tests__/dispatcher.test.js.map +0 -1
- package/dist/hooks/extensibility/__tests__/events.test.d.ts +0 -2
- package/dist/hooks/extensibility/__tests__/events.test.d.ts.map +0 -1
- package/dist/hooks/extensibility/__tests__/events.test.js +0 -125
- package/dist/hooks/extensibility/__tests__/events.test.js.map +0 -1
- package/dist/hooks/extensibility/__tests__/example-hook-plugins.test.d.ts +0 -2
- package/dist/hooks/extensibility/__tests__/example-hook-plugins.test.d.ts.map +0 -1
- package/dist/hooks/extensibility/__tests__/example-hook-plugins.test.js +0 -153
- package/dist/hooks/extensibility/__tests__/example-hook-plugins.test.js.map +0 -1
- package/dist/hooks/extensibility/__tests__/loader.test.d.ts +0 -2
- package/dist/hooks/extensibility/__tests__/loader.test.d.ts.map +0 -1
- package/dist/hooks/extensibility/__tests__/loader.test.js +0 -254
- package/dist/hooks/extensibility/__tests__/loader.test.js.map +0 -1
- package/dist/hooks/extensibility/__tests__/logging.test.d.ts +0 -2
- package/dist/hooks/extensibility/__tests__/logging.test.d.ts.map +0 -1
- package/dist/hooks/extensibility/__tests__/logging.test.js +0 -74
- package/dist/hooks/extensibility/__tests__/logging.test.js.map +0 -1
- package/dist/hooks/extensibility/__tests__/plugin-runner.test.d.ts +0 -2
- package/dist/hooks/extensibility/__tests__/plugin-runner.test.d.ts.map +0 -1
- package/dist/hooks/extensibility/__tests__/plugin-runner.test.js +0 -202
- package/dist/hooks/extensibility/__tests__/plugin-runner.test.js.map +0 -1
- package/dist/hooks/extensibility/__tests__/runtime.test.d.ts +0 -2
- package/dist/hooks/extensibility/__tests__/runtime.test.d.ts.map +0 -1
- package/dist/hooks/extensibility/__tests__/runtime.test.js +0 -198
- package/dist/hooks/extensibility/__tests__/runtime.test.js.map +0 -1
- package/dist/hooks/extensibility/__tests__/sdk-public-surface.test.d.ts +0 -2
- package/dist/hooks/extensibility/__tests__/sdk-public-surface.test.d.ts.map +0 -1
- package/dist/hooks/extensibility/__tests__/sdk-public-surface.test.js +0 -32
- package/dist/hooks/extensibility/__tests__/sdk-public-surface.test.js.map +0 -1
- package/dist/hooks/extensibility/__tests__/sdk.test.d.ts +0 -2
- package/dist/hooks/extensibility/__tests__/sdk.test.d.ts.map +0 -1
- package/dist/hooks/extensibility/__tests__/sdk.test.js +0 -479
- package/dist/hooks/extensibility/__tests__/sdk.test.js.map +0 -1
- package/dist/hud/__tests__/authority.test.d.ts +0 -2
- package/dist/hud/__tests__/authority.test.d.ts.map +0 -1
- package/dist/hud/__tests__/authority.test.js +0 -56
- package/dist/hud/__tests__/authority.test.js.map +0 -1
- package/dist/hud/__tests__/colors.test.d.ts +0 -2
- package/dist/hud/__tests__/colors.test.d.ts.map +0 -1
- package/dist/hud/__tests__/colors.test.js +0 -92
- package/dist/hud/__tests__/colors.test.js.map +0 -1
- package/dist/hud/__tests__/hud-tmux-injection.test.d.ts +0 -10
- package/dist/hud/__tests__/hud-tmux-injection.test.d.ts.map +0 -1
- package/dist/hud/__tests__/hud-tmux-injection.test.js +0 -150
- package/dist/hud/__tests__/hud-tmux-injection.test.js.map +0 -1
- package/dist/hud/__tests__/index.test.d.ts +0 -2
- package/dist/hud/__tests__/index.test.d.ts.map +0 -1
- package/dist/hud/__tests__/index.test.js +0 -180
- package/dist/hud/__tests__/index.test.js.map +0 -1
- package/dist/hud/__tests__/reconcile.test.d.ts +0 -2
- package/dist/hud/__tests__/reconcile.test.d.ts.map +0 -1
- package/dist/hud/__tests__/reconcile.test.js +0 -125
- package/dist/hud/__tests__/reconcile.test.js.map +0 -1
- package/dist/hud/__tests__/render.test.d.ts +0 -2
- package/dist/hud/__tests__/render.test.d.ts.map +0 -1
- package/dist/hud/__tests__/render.test.js +0 -573
- package/dist/hud/__tests__/render.test.js.map +0 -1
- package/dist/hud/__tests__/state.test.d.ts +0 -2
- package/dist/hud/__tests__/state.test.d.ts.map +0 -1
- package/dist/hud/__tests__/state.test.js +0 -618
- package/dist/hud/__tests__/state.test.js.map +0 -1
- package/dist/hud/__tests__/types.test.d.ts +0 -2
- package/dist/hud/__tests__/types.test.d.ts.map +0 -1
- package/dist/hud/__tests__/types.test.js +0 -79
- package/dist/hud/__tests__/types.test.js.map +0 -1
- package/dist/hud/__tests__/watch.test.d.ts +0 -2
- package/dist/hud/__tests__/watch.test.d.ts.map +0 -1
- package/dist/hud/__tests__/watch.test.js +0 -63
- package/dist/hud/__tests__/watch.test.js.map +0 -1
- package/dist/mcp/__tests__/bootstrap.test.d.ts +0 -2
- package/dist/mcp/__tests__/bootstrap.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/bootstrap.test.js +0 -207
- package/dist/mcp/__tests__/bootstrap.test.js.map +0 -1
- package/dist/mcp/__tests__/code-intel-server.test.d.ts +0 -2
- package/dist/mcp/__tests__/code-intel-server.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/code-intel-server.test.js +0 -70
- package/dist/mcp/__tests__/code-intel-server.test.js.map +0 -1
- package/dist/mcp/__tests__/memory-server.test.d.ts +0 -2
- package/dist/mcp/__tests__/memory-server.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/memory-server.test.js +0 -36
- package/dist/mcp/__tests__/memory-server.test.js.map +0 -1
- package/dist/mcp/__tests__/memory-validation.test.d.ts +0 -2
- package/dist/mcp/__tests__/memory-validation.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/memory-validation.test.js +0 -29
- package/dist/mcp/__tests__/memory-validation.test.js.map +0 -1
- package/dist/mcp/__tests__/path-traversal.test.d.ts +0 -2
- package/dist/mcp/__tests__/path-traversal.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/path-traversal.test.js +0 -83
- package/dist/mcp/__tests__/path-traversal.test.js.map +0 -1
- package/dist/mcp/__tests__/server-lifecycle.test.d.ts +0 -2
- package/dist/mcp/__tests__/server-lifecycle.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/server-lifecycle.test.js +0 -260
- package/dist/mcp/__tests__/server-lifecycle.test.js.map +0 -1
- package/dist/mcp/__tests__/state-paths.test.d.ts +0 -2
- package/dist/mcp/__tests__/state-paths.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/state-paths.test.js +0 -209
- package/dist/mcp/__tests__/state-paths.test.js.map +0 -1
- package/dist/mcp/__tests__/state-server-ralph-phase.test.d.ts +0 -2
- package/dist/mcp/__tests__/state-server-ralph-phase.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/state-server-ralph-phase.test.js +0 -109
- package/dist/mcp/__tests__/state-server-ralph-phase.test.js.map +0 -1
- package/dist/mcp/__tests__/state-server-schema.test.d.ts +0 -2
- package/dist/mcp/__tests__/state-server-schema.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/state-server-schema.test.js +0 -29
- package/dist/mcp/__tests__/state-server-schema.test.js.map +0 -1
- package/dist/mcp/__tests__/state-server-team-tools.test.d.ts +0 -2
- package/dist/mcp/__tests__/state-server-team-tools.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/state-server-team-tools.test.js +0 -35
- package/dist/mcp/__tests__/state-server-team-tools.test.js.map +0 -1
- package/dist/mcp/__tests__/state-server.test.d.ts +0 -2
- package/dist/mcp/__tests__/state-server.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/state-server.test.js +0 -965
- package/dist/mcp/__tests__/state-server.test.js.map +0 -1
- package/dist/mcp/__tests__/trace-server.test.d.ts +0 -2
- package/dist/mcp/__tests__/trace-server.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/trace-server.test.js +0 -119
- package/dist/mcp/__tests__/trace-server.test.js.map +0 -1
- package/dist/mcp/__tests__/wiki-server.test.d.ts +0 -2
- package/dist/mcp/__tests__/wiki-server.test.d.ts.map +0 -1
- package/dist/mcp/__tests__/wiki-server.test.js +0 -30
- package/dist/mcp/__tests__/wiki-server.test.js.map +0 -1
- package/dist/modes/__tests__/base-autoresearch-contract.test.d.ts +0 -2
- package/dist/modes/__tests__/base-autoresearch-contract.test.d.ts.map +0 -1
- package/dist/modes/__tests__/base-autoresearch-contract.test.js +0 -123
- package/dist/modes/__tests__/base-autoresearch-contract.test.js.map +0 -1
- package/dist/modes/__tests__/base-multi-state-compat.test.d.ts +0 -2
- package/dist/modes/__tests__/base-multi-state-compat.test.d.ts.map +0 -1
- package/dist/modes/__tests__/base-multi-state-compat.test.js +0 -38
- package/dist/modes/__tests__/base-multi-state-compat.test.js.map +0 -1
- package/dist/modes/__tests__/base-ralph-contract.test.d.ts +0 -2
- package/dist/modes/__tests__/base-ralph-contract.test.d.ts.map +0 -1
- package/dist/modes/__tests__/base-ralph-contract.test.js +0 -64
- package/dist/modes/__tests__/base-ralph-contract.test.js.map +0 -1
- package/dist/modes/__tests__/base-session-scope.test.d.ts +0 -2
- package/dist/modes/__tests__/base-session-scope.test.d.ts.map +0 -1
- package/dist/modes/__tests__/base-session-scope.test.js +0 -98
- package/dist/modes/__tests__/base-session-scope.test.js.map +0 -1
- package/dist/modes/__tests__/base-tmux-pane.test.d.ts +0 -2
- package/dist/modes/__tests__/base-tmux-pane.test.d.ts.map +0 -1
- package/dist/modes/__tests__/base-tmux-pane.test.js +0 -39
- package/dist/modes/__tests__/base-tmux-pane.test.js.map +0 -1
- package/dist/notifications/__tests__/config.test.d.ts +0 -2
- package/dist/notifications/__tests__/config.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/config.test.js +0 -269
- package/dist/notifications/__tests__/config.test.js.map +0 -1
- package/dist/notifications/__tests__/custom-alias-enablement.test.d.ts +0 -2
- package/dist/notifications/__tests__/custom-alias-enablement.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/custom-alias-enablement.test.js +0 -84
- package/dist/notifications/__tests__/custom-alias-enablement.test.js.map +0 -1
- package/dist/notifications/__tests__/dispatch-cooldown.test.d.ts +0 -5
- package/dist/notifications/__tests__/dispatch-cooldown.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/dispatch-cooldown.test.js +0 -100
- package/dist/notifications/__tests__/dispatch-cooldown.test.js.map +0 -1
- package/dist/notifications/__tests__/dispatcher.test.d.ts +0 -2
- package/dist/notifications/__tests__/dispatcher.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/dispatcher.test.js +0 -202
- package/dist/notifications/__tests__/dispatcher.test.js.map +0 -1
- package/dist/notifications/__tests__/formatter.test.d.ts +0 -2
- package/dist/notifications/__tests__/formatter.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/formatter.test.js +0 -270
- package/dist/notifications/__tests__/formatter.test.js.map +0 -1
- package/dist/notifications/__tests__/hook-config.test.d.ts +0 -5
- package/dist/notifications/__tests__/hook-config.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/hook-config.test.js +0 -139
- package/dist/notifications/__tests__/hook-config.test.js.map +0 -1
- package/dist/notifications/__tests__/idle-cooldown.test.d.ts +0 -5
- package/dist/notifications/__tests__/idle-cooldown.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/idle-cooldown.test.js +0 -209
- package/dist/notifications/__tests__/idle-cooldown.test.js.map +0 -1
- package/dist/notifications/__tests__/index.test.d.ts +0 -2
- package/dist/notifications/__tests__/index.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/index.test.js +0 -188
- package/dist/notifications/__tests__/index.test.js.map +0 -1
- package/dist/notifications/__tests__/lifecycle-dedupe.test.d.ts +0 -2
- package/dist/notifications/__tests__/lifecycle-dedupe.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/lifecycle-dedupe.test.js +0 -86
- package/dist/notifications/__tests__/lifecycle-dedupe.test.js.map +0 -1
- package/dist/notifications/__tests__/notifier.test.d.ts +0 -2
- package/dist/notifications/__tests__/notifier.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/notifier.test.js +0 -239
- package/dist/notifications/__tests__/notifier.test.js.map +0 -1
- package/dist/notifications/__tests__/profiles.test.d.ts +0 -2
- package/dist/notifications/__tests__/profiles.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/profiles.test.js +0 -404
- package/dist/notifications/__tests__/profiles.test.js.map +0 -1
- package/dist/notifications/__tests__/reply-config.test.d.ts +0 -2
- package/dist/notifications/__tests__/reply-config.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/reply-config.test.js +0 -79
- package/dist/notifications/__tests__/reply-config.test.js.map +0 -1
- package/dist/notifications/__tests__/reply-listener.test.d.ts +0 -2
- package/dist/notifications/__tests__/reply-listener.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/reply-listener.test.js +0 -723
- package/dist/notifications/__tests__/reply-listener.test.js.map +0 -1
- package/dist/notifications/__tests__/session-idle-tail-dedupe.test.d.ts +0 -2
- package/dist/notifications/__tests__/session-idle-tail-dedupe.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/session-idle-tail-dedupe.test.js +0 -93
- package/dist/notifications/__tests__/session-idle-tail-dedupe.test.js.map +0 -1
- package/dist/notifications/__tests__/session-registry.test.d.ts +0 -2
- package/dist/notifications/__tests__/session-registry.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/session-registry.test.js +0 -234
- package/dist/notifications/__tests__/session-registry.test.js.map +0 -1
- package/dist/notifications/__tests__/session-status.test.d.ts +0 -2
- package/dist/notifications/__tests__/session-status.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/session-status.test.js +0 -249
- package/dist/notifications/__tests__/session-status.test.js.map +0 -1
- package/dist/notifications/__tests__/temp-mode.test.d.ts +0 -2
- package/dist/notifications/__tests__/temp-mode.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/temp-mode.test.js +0 -172
- package/dist/notifications/__tests__/temp-mode.test.js.map +0 -1
- package/dist/notifications/__tests__/template-engine.test.d.ts +0 -5
- package/dist/notifications/__tests__/template-engine.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/template-engine.test.js +0 -158
- package/dist/notifications/__tests__/template-engine.test.js.map +0 -1
- package/dist/notifications/__tests__/tmux-detector.test.d.ts +0 -2
- package/dist/notifications/__tests__/tmux-detector.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/tmux-detector.test.js +0 -208
- package/dist/notifications/__tests__/tmux-detector.test.js.map +0 -1
- package/dist/notifications/__tests__/tmux.test.d.ts +0 -2
- package/dist/notifications/__tests__/tmux.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/tmux.test.js +0 -285
- package/dist/notifications/__tests__/tmux.test.js.map +0 -1
- package/dist/notifications/__tests__/verbosity.test.d.ts +0 -2
- package/dist/notifications/__tests__/verbosity.test.d.ts.map +0 -1
- package/dist/notifications/__tests__/verbosity.test.js +0 -237
- package/dist/notifications/__tests__/verbosity.test.js.map +0 -1
- package/dist/openclaw/__tests__/config.test.d.ts +0 -6
- package/dist/openclaw/__tests__/config.test.d.ts.map +0 -1
- package/dist/openclaw/__tests__/config.test.js +0 -344
- package/dist/openclaw/__tests__/config.test.js.map +0 -1
- package/dist/openclaw/__tests__/dispatcher.test.d.ts +0 -5
- package/dist/openclaw/__tests__/dispatcher.test.d.ts.map +0 -1
- package/dist/openclaw/__tests__/dispatcher.test.js +0 -169
- package/dist/openclaw/__tests__/dispatcher.test.js.map +0 -1
- package/dist/openclaw/__tests__/index.test.d.ts +0 -6
- package/dist/openclaw/__tests__/index.test.d.ts.map +0 -1
- package/dist/openclaw/__tests__/index.test.js +0 -382
- package/dist/openclaw/__tests__/index.test.js.map +0 -1
- package/dist/pipeline/__tests__/orchestrator.test.d.ts +0 -2
- package/dist/pipeline/__tests__/orchestrator.test.d.ts.map +0 -1
- package/dist/pipeline/__tests__/orchestrator.test.js +0 -505
- package/dist/pipeline/__tests__/orchestrator.test.js.map +0 -1
- package/dist/pipeline/__tests__/stages.test.d.ts +0 -2
- package/dist/pipeline/__tests__/stages.test.d.ts.map +0 -1
- package/dist/pipeline/__tests__/stages.test.js +0 -754
- package/dist/pipeline/__tests__/stages.test.js.map +0 -1
- package/dist/pipeline/stages/ralph-verify.d.ts +0 -53
- package/dist/pipeline/stages/ralph-verify.d.ts.map +0 -1
- package/dist/pipeline/stages/ralph-verify.js.map +0 -1
- package/dist/pipeline/stages/ralplan.d.ts +0 -25
- package/dist/pipeline/stages/ralplan.d.ts.map +0 -1
- package/dist/pipeline/stages/ralplan.js.map +0 -1
- package/dist/planning/__tests__/artifacts.test.d.ts +0 -2
- package/dist/planning/__tests__/artifacts.test.d.ts.map +0 -1
- package/dist/planning/__tests__/artifacts.test.js +0 -544
- package/dist/planning/__tests__/artifacts.test.js.map +0 -1
- package/dist/question/__tests__/client.test.d.ts +0 -2
- package/dist/question/__tests__/client.test.d.ts.map +0 -1
- package/dist/question/__tests__/client.test.js +0 -90
- package/dist/question/__tests__/client.test.js.map +0 -1
- package/dist/question/__tests__/deep-interview.test.d.ts +0 -2
- package/dist/question/__tests__/deep-interview.test.d.ts.map +0 -1
- package/dist/question/__tests__/deep-interview.test.js +0 -209
- package/dist/question/__tests__/deep-interview.test.js.map +0 -1
- package/dist/question/__tests__/policy.test.d.ts +0 -2
- package/dist/question/__tests__/policy.test.d.ts.map +0 -1
- package/dist/question/__tests__/policy.test.js +0 -107
- package/dist/question/__tests__/policy.test.js.map +0 -1
- package/dist/question/__tests__/renderer.test.d.ts +0 -2
- package/dist/question/__tests__/renderer.test.d.ts.map +0 -1
- package/dist/question/__tests__/renderer.test.js +0 -707
- package/dist/question/__tests__/renderer.test.js.map +0 -1
- package/dist/question/__tests__/state.test.d.ts +0 -2
- package/dist/question/__tests__/state.test.d.ts.map +0 -1
- package/dist/question/__tests__/state.test.js +0 -102
- package/dist/question/__tests__/state.test.js.map +0 -1
- package/dist/question/__tests__/types.test.d.ts +0 -2
- package/dist/question/__tests__/types.test.d.ts.map +0 -1
- package/dist/question/__tests__/types.test.js +0 -65
- package/dist/question/__tests__/types.test.js.map +0 -1
- package/dist/question/__tests__/ui.test.d.ts +0 -2
- package/dist/question/__tests__/ui.test.d.ts.map +0 -1
- package/dist/question/__tests__/ui.test.js +0 -446
- package/dist/question/__tests__/ui.test.js.map +0 -1
- package/dist/ralph/__tests__/persistence.test.d.ts +0 -2
- package/dist/ralph/__tests__/persistence.test.d.ts.map +0 -1
- package/dist/ralph/__tests__/persistence.test.js +0 -116
- package/dist/ralph/__tests__/persistence.test.js.map +0 -1
- package/dist/ralph/contract.d.ts +0 -17
- package/dist/ralph/persistence.js.map +0 -1
- package/dist/ralplan/__tests__/runtime.test.d.ts +0 -2
- package/dist/ralplan/__tests__/runtime.test.d.ts.map +0 -1
- package/dist/ralplan/__tests__/runtime.test.js +0 -165
- package/dist/ralplan/__tests__/runtime.test.js.map +0 -1
- package/dist/ralplan/runtime.d.ts +0 -52
- package/dist/ralplan/runtime.d.ts.map +0 -1
- package/dist/ralplan/runtime.js.map +0 -1
- package/dist/runtime/__tests__/bridge.test.d.ts +0 -2
- package/dist/runtime/__tests__/bridge.test.d.ts.map +0 -1
- package/dist/runtime/__tests__/bridge.test.js +0 -194
- package/dist/runtime/__tests__/bridge.test.js.map +0 -1
- package/dist/runtime/__tests__/run-loop.test.d.ts +0 -2
- package/dist/runtime/__tests__/run-loop.test.d.ts.map +0 -1
- package/dist/runtime/__tests__/run-loop.test.js +0 -35
- package/dist/runtime/__tests__/run-loop.test.js.map +0 -1
- package/dist/runtime/__tests__/run-outcome.test.d.ts +0 -2
- package/dist/runtime/__tests__/run-outcome.test.d.ts.map +0 -1
- package/dist/runtime/__tests__/run-outcome.test.js +0 -102
- package/dist/runtime/__tests__/run-outcome.test.js.map +0 -1
- package/dist/runtime/__tests__/run-state.test.d.ts +0 -2
- package/dist/runtime/__tests__/run-state.test.d.ts.map +0 -1
- package/dist/runtime/__tests__/run-state.test.js +0 -37
- package/dist/runtime/__tests__/run-state.test.js.map +0 -1
- package/dist/scripts/__tests__/codex-native-hook.test.d.ts +0 -2
- package/dist/scripts/__tests__/codex-native-hook.test.d.ts.map +0 -1
- package/dist/scripts/__tests__/codex-native-hook.test.js +0 -6788
- package/dist/scripts/__tests__/codex-native-hook.test.js.map +0 -1
- package/dist/scripts/__tests__/generate-release-body.test.d.ts +0 -2
- package/dist/scripts/__tests__/generate-release-body.test.d.ts.map +0 -1
- package/dist/scripts/__tests__/generate-release-body.test.js +0 -233
- package/dist/scripts/__tests__/generate-release-body.test.js.map +0 -1
- package/dist/scripts/__tests__/hook-derived-watcher.test.d.ts +0 -2
- package/dist/scripts/__tests__/hook-derived-watcher.test.d.ts.map +0 -1
- package/dist/scripts/__tests__/hook-derived-watcher.test.js +0 -195
- package/dist/scripts/__tests__/hook-derived-watcher.test.js.map +0 -1
- package/dist/scripts/__tests__/postinstall.test.d.ts +0 -2
- package/dist/scripts/__tests__/postinstall.test.d.ts.map +0 -1
- package/dist/scripts/__tests__/postinstall.test.js +0 -92
- package/dist/scripts/__tests__/postinstall.test.js.map +0 -1
- package/dist/scripts/__tests__/prompt-inventory.test.d.ts +0 -2
- package/dist/scripts/__tests__/prompt-inventory.test.d.ts.map +0 -1
- package/dist/scripts/__tests__/prompt-inventory.test.js +0 -56
- package/dist/scripts/__tests__/prompt-inventory.test.js.map +0 -1
- package/dist/scripts/__tests__/run-test-files.test.d.ts +0 -2
- package/dist/scripts/__tests__/run-test-files.test.d.ts.map +0 -1
- package/dist/scripts/__tests__/run-test-files.test.js +0 -62
- package/dist/scripts/__tests__/run-test-files.test.js.map +0 -1
- package/dist/scripts/__tests__/smoke-packed-install.test.d.ts +0 -2
- package/dist/scripts/__tests__/smoke-packed-install.test.d.ts.map +0 -1
- package/dist/scripts/__tests__/smoke-packed-install.test.js +0 -135
- package/dist/scripts/__tests__/smoke-packed-install.test.js.map +0 -1
- package/dist/scripts/__tests__/test-reply-listener-live.test.d.ts +0 -2
- package/dist/scripts/__tests__/test-reply-listener-live.test.d.ts.map +0 -1
- package/dist/scripts/__tests__/test-reply-listener-live.test.js +0 -82
- package/dist/scripts/__tests__/test-reply-listener-live.test.js.map +0 -1
- package/dist/scripts/__tests__/verify-native-agents.test.d.ts +0 -2
- package/dist/scripts/__tests__/verify-native-agents.test.d.ts.map +0 -1
- package/dist/scripts/__tests__/verify-native-agents.test.js +0 -166
- package/dist/scripts/__tests__/verify-native-agents.test.js.map +0 -1
- package/dist/scripts/eval/eval-candidate-handoff.d.ts +0 -2
- package/dist/scripts/eval/eval-candidate-handoff.d.ts.map +0 -1
- package/dist/scripts/eval/eval-candidate-handoff.js +0 -11
- package/dist/scripts/eval/eval-candidate-handoff.js.map +0 -1
- package/dist/scripts/eval/eval-cli-discoverability.d.ts +0 -3
- package/dist/scripts/eval/eval-cli-discoverability.d.ts.map +0 -1
- package/dist/scripts/eval/eval-cli-discoverability.js +0 -37
- package/dist/scripts/eval/eval-cli-discoverability.js.map +0 -1
- package/dist/scripts/eval/eval-fresh-run-tagging.d.ts +0 -2
- package/dist/scripts/eval/eval-fresh-run-tagging.d.ts.map +0 -1
- package/dist/scripts/eval/eval-fresh-run-tagging.js +0 -11
- package/dist/scripts/eval/eval-fresh-run-tagging.js.map +0 -1
- package/dist/scripts/eval/eval-help-consistency.d.ts +0 -2
- package/dist/scripts/eval/eval-help-consistency.d.ts.map +0 -1
- package/dist/scripts/eval/eval-help-consistency.js +0 -12
- package/dist/scripts/eval/eval-help-consistency.js.map +0 -1
- package/dist/scripts/eval/eval-in-action-cat-shellout-demo.d.ts +0 -2
- package/dist/scripts/eval/eval-in-action-cat-shellout-demo.d.ts.map +0 -1
- package/dist/scripts/eval/eval-in-action-cat-shellout-demo.js +0 -31
- package/dist/scripts/eval/eval-in-action-cat-shellout-demo.js.map +0 -1
- package/dist/scripts/eval/eval-parity-smoke.d.ts +0 -2
- package/dist/scripts/eval/eval-parity-smoke.d.ts.map +0 -1
- package/dist/scripts/eval/eval-parity-smoke.js +0 -23
- package/dist/scripts/eval/eval-parity-smoke.js.map +0 -1
- package/dist/scripts/eval/eval-parity-sweep.d.ts +0 -2
- package/dist/scripts/eval/eval-parity-sweep.d.ts.map +0 -1
- package/dist/scripts/eval/eval-parity-sweep.js +0 -29
- package/dist/scripts/eval/eval-parity-sweep.js.map +0 -1
- package/dist/scripts/eval/eval-resume-dirty-guard.d.ts +0 -2
- package/dist/scripts/eval/eval-resume-dirty-guard.d.ts.map +0 -1
- package/dist/scripts/eval/eval-resume-dirty-guard.js +0 -11
- package/dist/scripts/eval/eval-resume-dirty-guard.js.map +0 -1
- package/dist/scripts/eval/eval-security-path-traversal.d.ts +0 -3
- package/dist/scripts/eval/eval-security-path-traversal.d.ts.map +0 -1
- package/dist/scripts/eval/eval-security-path-traversal.js +0 -35
- package/dist/scripts/eval/eval-security-path-traversal.js.map +0 -1
- package/dist/scripts/notify-hook/__tests__/operational-events.test.d.ts +0 -2
- package/dist/scripts/notify-hook/__tests__/operational-events.test.d.ts.map +0 -1
- package/dist/scripts/notify-hook/__tests__/operational-events.test.js +0 -24
- package/dist/scripts/notify-hook/__tests__/operational-events.test.js.map +0 -1
- package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.d.ts +0 -2
- package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.d.ts.map +0 -1
- package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.js +0 -153
- package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.js.map +0 -1
- package/dist/scripts/notify-hook/ralph-session-resume.d.ts +0 -22
- package/dist/session-history/__tests__/search.test.d.ts +0 -2
- package/dist/session-history/__tests__/search.test.d.ts.map +0 -1
- package/dist/session-history/__tests__/search.test.js +0 -150
- package/dist/session-history/__tests__/search.test.js.map +0 -1
- package/dist/sidecar/__tests__/boundary.test.d.ts +0 -2
- package/dist/sidecar/__tests__/boundary.test.d.ts.map +0 -1
- package/dist/sidecar/__tests__/boundary.test.js +0 -48
- package/dist/sidecar/__tests__/boundary.test.js.map +0 -1
- package/dist/sidecar/__tests__/collector.test.d.ts +0 -2
- package/dist/sidecar/__tests__/collector.test.d.ts.map +0 -1
- package/dist/sidecar/__tests__/collector.test.js +0 -162
- package/dist/sidecar/__tests__/collector.test.js.map +0 -1
- package/dist/sidecar/__tests__/render.test.d.ts +0 -2
- package/dist/sidecar/__tests__/render.test.d.ts.map +0 -1
- package/dist/sidecar/__tests__/render.test.js +0 -67
- package/dist/sidecar/__tests__/render.test.js.map +0 -1
- package/dist/sidecar/__tests__/tmux.test.d.ts +0 -2
- package/dist/sidecar/__tests__/tmux.test.d.ts.map +0 -1
- package/dist/sidecar/__tests__/tmux.test.js +0 -30
- package/dist/sidecar/__tests__/tmux.test.js.map +0 -1
- package/dist/sidecar/__tests__/watch.test.d.ts +0 -2
- package/dist/sidecar/__tests__/watch.test.d.ts.map +0 -1
- package/dist/sidecar/__tests__/watch.test.js +0 -42
- package/dist/sidecar/__tests__/watch.test.js.map +0 -1
- package/dist/state/__tests__/mode-state-context.test.d.ts +0 -2
- package/dist/state/__tests__/mode-state-context.test.d.ts.map +0 -1
- package/dist/state/__tests__/mode-state-context.test.js +0 -35
- package/dist/state/__tests__/mode-state-context.test.js.map +0 -1
- package/dist/state/__tests__/operations-ralph-phase.test.d.ts +0 -2
- package/dist/state/__tests__/operations-ralph-phase.test.d.ts.map +0 -1
- package/dist/state/__tests__/operations-ralph-phase.test.js +0 -103
- package/dist/state/__tests__/operations-ralph-phase.test.js.map +0 -1
- package/dist/state/__tests__/operations.test.d.ts +0 -2
- package/dist/state/__tests__/operations.test.d.ts.map +0 -1
- package/dist/state/__tests__/operations.test.js +0 -439
- package/dist/state/__tests__/operations.test.js.map +0 -1
- package/dist/state/__tests__/path-traversal.test.d.ts +0 -2
- package/dist/state/__tests__/path-traversal.test.d.ts.map +0 -1
- package/dist/state/__tests__/path-traversal.test.js +0 -49
- package/dist/state/__tests__/path-traversal.test.js.map +0 -1
- package/dist/state/__tests__/skill-active.test.d.ts +0 -2
- package/dist/state/__tests__/skill-active.test.d.ts.map +0 -1
- package/dist/state/__tests__/skill-active.test.js +0 -160
- package/dist/state/__tests__/skill-active.test.js.map +0 -1
- package/dist/state/__tests__/workflow-transition.test.d.ts +0 -2
- package/dist/state/__tests__/workflow-transition.test.d.ts.map +0 -1
- package/dist/state/__tests__/workflow-transition.test.js +0 -77
- package/dist/state/__tests__/workflow-transition.test.js.map +0 -1
- package/dist/subagents/__tests__/tracker.test.d.ts +0 -2
- package/dist/subagents/__tests__/tracker.test.d.ts.map +0 -1
- package/dist/subagents/__tests__/tracker.test.js +0 -47
- package/dist/subagents/__tests__/tracker.test.js.map +0 -1
- package/dist/team/__tests__/allocation-policy.test.d.ts +0 -2
- package/dist/team/__tests__/allocation-policy.test.d.ts.map +0 -1
- package/dist/team/__tests__/allocation-policy.test.js +0 -111
- package/dist/team/__tests__/allocation-policy.test.js.map +0 -1
- package/dist/team/__tests__/api-interop.test.d.ts +0 -2
- package/dist/team/__tests__/api-interop.test.d.ts.map +0 -1
- package/dist/team/__tests__/api-interop.test.js +0 -2262
- package/dist/team/__tests__/api-interop.test.js.map +0 -1
- package/dist/team/__tests__/commit-hygiene.test.d.ts +0 -2
- package/dist/team/__tests__/commit-hygiene.test.d.ts.map +0 -1
- package/dist/team/__tests__/commit-hygiene.test.js +0 -93
- package/dist/team/__tests__/commit-hygiene.test.js.map +0 -1
- package/dist/team/__tests__/cross-rebase-smoke.test.d.ts +0 -2
- package/dist/team/__tests__/cross-rebase-smoke.test.d.ts.map +0 -1
- package/dist/team/__tests__/cross-rebase-smoke.test.js +0 -161
- package/dist/team/__tests__/cross-rebase-smoke.test.js.map +0 -1
- package/dist/team/__tests__/current-task-baseline.test.d.ts +0 -2
- package/dist/team/__tests__/current-task-baseline.test.d.ts.map +0 -1
- package/dist/team/__tests__/current-task-baseline.test.js +0 -87
- package/dist/team/__tests__/current-task-baseline.test.js.map +0 -1
- package/dist/team/__tests__/delegation-policy.test.d.ts +0 -2
- package/dist/team/__tests__/delegation-policy.test.d.ts.map +0 -1
- package/dist/team/__tests__/delegation-policy.test.js +0 -69
- package/dist/team/__tests__/delegation-policy.test.js.map +0 -1
- package/dist/team/__tests__/delivery-e2e-smoke.test.d.ts +0 -2
- package/dist/team/__tests__/delivery-e2e-smoke.test.d.ts.map +0 -1
- package/dist/team/__tests__/delivery-e2e-smoke.test.js +0 -679
- package/dist/team/__tests__/delivery-e2e-smoke.test.js.map +0 -1
- package/dist/team/__tests__/events.test.d.ts +0 -2
- package/dist/team/__tests__/events.test.d.ts.map +0 -1
- package/dist/team/__tests__/events.test.js +0 -313
- package/dist/team/__tests__/events.test.js.map +0 -1
- package/dist/team/__tests__/followup-planner.test.d.ts +0 -2
- package/dist/team/__tests__/followup-planner.test.d.ts.map +0 -1
- package/dist/team/__tests__/followup-planner.test.js +0 -84
- package/dist/team/__tests__/followup-planner.test.js.map +0 -1
- package/dist/team/__tests__/hardening-e2e.test.d.ts +0 -2
- package/dist/team/__tests__/hardening-e2e.test.d.ts.map +0 -1
- package/dist/team/__tests__/hardening-e2e.test.js +0 -98
- package/dist/team/__tests__/hardening-e2e.test.js.map +0 -1
- package/dist/team/__tests__/hook-primary-e2e-contract.test.d.ts +0 -2
- package/dist/team/__tests__/hook-primary-e2e-contract.test.d.ts.map +0 -1
- package/dist/team/__tests__/hook-primary-e2e-contract.test.js +0 -78
- package/dist/team/__tests__/hook-primary-e2e-contract.test.js.map +0 -1
- package/dist/team/__tests__/idle-nudge.test.d.ts +0 -2
- package/dist/team/__tests__/idle-nudge.test.d.ts.map +0 -1
- package/dist/team/__tests__/idle-nudge.test.js +0 -230
- package/dist/team/__tests__/idle-nudge.test.js.map +0 -1
- package/dist/team/__tests__/leader-activity.test.d.ts +0 -2
- package/dist/team/__tests__/leader-activity.test.d.ts.map +0 -1
- package/dist/team/__tests__/leader-activity.test.js +0 -261
- package/dist/team/__tests__/leader-activity.test.js.map +0 -1
- package/dist/team/__tests__/mcp-comm.test.d.ts +0 -2
- package/dist/team/__tests__/mcp-comm.test.d.ts.map +0 -1
- package/dist/team/__tests__/mcp-comm.test.js +0 -289
- package/dist/team/__tests__/mcp-comm.test.js.map +0 -1
- package/dist/team/__tests__/model-contract.test.d.ts +0 -2
- package/dist/team/__tests__/model-contract.test.d.ts.map +0 -1
- package/dist/team/__tests__/model-contract.test.js +0 -171
- package/dist/team/__tests__/model-contract.test.js.map +0 -1
- package/dist/team/__tests__/orchestrator.test.d.ts +0 -2
- package/dist/team/__tests__/orchestrator.test.d.ts.map +0 -1
- package/dist/team/__tests__/orchestrator.test.js +0 -111
- package/dist/team/__tests__/orchestrator.test.js.map +0 -1
- package/dist/team/__tests__/phase-controller.test.d.ts +0 -2
- package/dist/team/__tests__/phase-controller.test.d.ts.map +0 -1
- package/dist/team/__tests__/phase-controller.test.js +0 -50
- package/dist/team/__tests__/phase-controller.test.js.map +0 -1
- package/dist/team/__tests__/rebalance-policy.test.d.ts +0 -2
- package/dist/team/__tests__/rebalance-policy.test.d.ts.map +0 -1
- package/dist/team/__tests__/rebalance-policy.test.js +0 -168
- package/dist/team/__tests__/rebalance-policy.test.js.map +0 -1
- package/dist/team/__tests__/repo-aware-decomposition.test.d.ts +0 -2
- package/dist/team/__tests__/repo-aware-decomposition.test.d.ts.map +0 -1
- package/dist/team/__tests__/repo-aware-decomposition.test.js +0 -136
- package/dist/team/__tests__/repo-aware-decomposition.test.js.map +0 -1
- package/dist/team/__tests__/role-router.test.d.ts +0 -2
- package/dist/team/__tests__/role-router.test.d.ts.map +0 -1
- package/dist/team/__tests__/role-router.test.js +0 -263
- package/dist/team/__tests__/role-router.test.js.map +0 -1
- package/dist/team/__tests__/runtime-cli.test.d.ts +0 -2
- package/dist/team/__tests__/runtime-cli.test.d.ts.map +0 -1
- package/dist/team/__tests__/runtime-cli.test.js +0 -304
- package/dist/team/__tests__/runtime-cli.test.js.map +0 -1
- package/dist/team/__tests__/runtime.test.d.ts +0 -2
- package/dist/team/__tests__/runtime.test.d.ts.map +0 -1
- package/dist/team/__tests__/runtime.test.js +0 -5734
- package/dist/team/__tests__/runtime.test.js.map +0 -1
- package/dist/team/__tests__/scaling.test.d.ts +0 -2
- package/dist/team/__tests__/scaling.test.d.ts.map +0 -1
- package/dist/team/__tests__/scaling.test.js +0 -1005
- package/dist/team/__tests__/scaling.test.js.map +0 -1
- package/dist/team/__tests__/shutdown-fallback.test.d.ts +0 -2
- package/dist/team/__tests__/shutdown-fallback.test.d.ts.map +0 -1
- package/dist/team/__tests__/shutdown-fallback.test.js +0 -125
- package/dist/team/__tests__/shutdown-fallback.test.js.map +0 -1
- package/dist/team/__tests__/state-root.test.d.ts +0 -2
- package/dist/team/__tests__/state-root.test.d.ts.map +0 -1
- package/dist/team/__tests__/state-root.test.js +0 -195
- package/dist/team/__tests__/state-root.test.js.map +0 -1
- package/dist/team/__tests__/state.test.d.ts +0 -2
- package/dist/team/__tests__/state.test.d.ts.map +0 -1
- package/dist/team/__tests__/state.test.js +0 -1859
- package/dist/team/__tests__/state.test.js.map +0 -1
- package/dist/team/__tests__/team-identity.test.d.ts +0 -2
- package/dist/team/__tests__/team-identity.test.d.ts.map +0 -1
- package/dist/team/__tests__/team-identity.test.js +0 -166
- package/dist/team/__tests__/team-identity.test.js.map +0 -1
- package/dist/team/__tests__/team-ops-contract.test.d.ts +0 -2
- package/dist/team/__tests__/team-ops-contract.test.d.ts.map +0 -1
- package/dist/team/__tests__/team-ops-contract.test.js +0 -96
- package/dist/team/__tests__/team-ops-contract.test.js.map +0 -1
- package/dist/team/__tests__/tmux-claude-workers-demo.test.d.ts +0 -2
- package/dist/team/__tests__/tmux-claude-workers-demo.test.d.ts.map +0 -1
- package/dist/team/__tests__/tmux-claude-workers-demo.test.js +0 -191
- package/dist/team/__tests__/tmux-claude-workers-demo.test.js.map +0 -1
- package/dist/team/__tests__/tmux-session.test.d.ts +0 -2
- package/dist/team/__tests__/tmux-session.test.d.ts.map +0 -1
- package/dist/team/__tests__/tmux-session.test.js +0 -3785
- package/dist/team/__tests__/tmux-session.test.js.map +0 -1
- package/dist/team/__tests__/tmux-test-fixture.d.ts +0 -20
- package/dist/team/__tests__/tmux-test-fixture.d.ts.map +0 -1
- package/dist/team/__tests__/tmux-test-fixture.js +0 -152
- package/dist/team/__tests__/tmux-test-fixture.js.map +0 -1
- package/dist/team/__tests__/tmux-test-fixture.test.d.ts +0 -2
- package/dist/team/__tests__/tmux-test-fixture.test.d.ts.map +0 -1
- package/dist/team/__tests__/tmux-test-fixture.test.js +0 -113
- package/dist/team/__tests__/tmux-test-fixture.test.js.map +0 -1
- package/dist/team/__tests__/worker-bootstrap.test.d.ts +0 -2
- package/dist/team/__tests__/worker-bootstrap.test.d.ts.map +0 -1
- package/dist/team/__tests__/worker-bootstrap.test.js +0 -685
- package/dist/team/__tests__/worker-bootstrap.test.js.map +0 -1
- package/dist/team/__tests__/worker-runtime-identity.test.d.ts +0 -2
- package/dist/team/__tests__/worker-runtime-identity.test.d.ts.map +0 -1
- package/dist/team/__tests__/worker-runtime-identity.test.js +0 -250
- package/dist/team/__tests__/worker-runtime-identity.test.js.map +0 -1
- package/dist/team/__tests__/worktree.test.d.ts +0 -2
- package/dist/team/__tests__/worktree.test.d.ts.map +0 -1
- package/dist/team/__tests__/worktree.test.js +0 -317
- package/dist/team/__tests__/worktree.test.js.map +0 -1
- package/dist/utils/__tests__/agents-md.test.d.ts +0 -2
- package/dist/utils/__tests__/agents-md.test.d.ts.map +0 -1
- package/dist/utils/__tests__/agents-md.test.js +0 -52
- package/dist/utils/__tests__/agents-md.test.js.map +0 -1
- package/dist/utils/__tests__/agents-model-table.test.d.ts +0 -2
- package/dist/utils/__tests__/agents-model-table.test.d.ts.map +0 -1
- package/dist/utils/__tests__/agents-model-table.test.js +0 -104
- package/dist/utils/__tests__/agents-model-table.test.js.map +0 -1
- package/dist/utils/__tests__/dep-versions.test.d.ts +0 -2
- package/dist/utils/__tests__/dep-versions.test.d.ts.map +0 -1
- package/dist/utils/__tests__/dep-versions.test.js +0 -46
- package/dist/utils/__tests__/dep-versions.test.js.map +0 -1
- package/dist/utils/__tests__/package.test.d.ts +0 -2
- package/dist/utils/__tests__/package.test.d.ts.map +0 -1
- package/dist/utils/__tests__/package.test.js +0 -21
- package/dist/utils/__tests__/package.test.js.map +0 -1
- package/dist/utils/__tests__/paths.test.d.ts +0 -2
- package/dist/utils/__tests__/paths.test.d.ts.map +0 -1
- package/dist/utils/__tests__/paths.test.js +0 -541
- package/dist/utils/__tests__/paths.test.js.map +0 -1
- package/dist/utils/__tests__/platform-command.test.d.ts +0 -2
- package/dist/utils/__tests__/platform-command.test.d.ts.map +0 -1
- package/dist/utils/__tests__/platform-command.test.js +0 -410
- package/dist/utils/__tests__/platform-command.test.js.map +0 -1
- package/dist/utils/__tests__/repo-deps.test.d.ts +0 -2
- package/dist/utils/__tests__/repo-deps.test.d.ts.map +0 -1
- package/dist/utils/__tests__/repo-deps.test.js +0 -71
- package/dist/utils/__tests__/repo-deps.test.js.map +0 -1
- package/dist/verification/__tests__/ci-rust-gates.test.d.ts +0 -2
- package/dist/verification/__tests__/ci-rust-gates.test.d.ts.map +0 -1
- package/dist/verification/__tests__/ci-rust-gates.test.js +0 -89
- package/dist/verification/__tests__/ci-rust-gates.test.js.map +0 -1
- package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.d.ts +0 -2
- package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.d.ts.map +0 -1
- package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.js +0 -54
- package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.js.map +0 -1
- package/dist/verification/__tests__/explore-harness-release-workflow.test.d.ts +0 -2
- package/dist/verification/__tests__/explore-harness-release-workflow.test.d.ts.map +0 -1
- package/dist/verification/__tests__/explore-harness-release-workflow.test.js +0 -73
- package/dist/verification/__tests__/explore-harness-release-workflow.test.js.map +0 -1
- package/dist/verification/__tests__/native-release-manifest.test.d.ts +0 -2
- package/dist/verification/__tests__/native-release-manifest.test.d.ts.map +0 -1
- package/dist/verification/__tests__/native-release-manifest.test.js +0 -80
- package/dist/verification/__tests__/native-release-manifest.test.js.map +0 -1
- package/dist/verification/__tests__/pr-check-workflow.test.d.ts +0 -2
- package/dist/verification/__tests__/pr-check-workflow.test.d.ts.map +0 -1
- package/dist/verification/__tests__/pr-check-workflow.test.js +0 -27
- package/dist/verification/__tests__/pr-check-workflow.test.js.map +0 -1
- package/dist/verification/__tests__/ralph-persistence-gate.test.d.ts +0 -2
- package/dist/verification/__tests__/ralph-persistence-gate.test.d.ts.map +0 -1
- package/dist/verification/__tests__/ralph-persistence-gate.test.js +0 -55
- package/dist/verification/__tests__/ralph-persistence-gate.test.js.map +0 -1
- package/dist/verification/__tests__/rust-runtime-thin-adapter-gate.test.d.ts +0 -2
- package/dist/verification/__tests__/rust-runtime-thin-adapter-gate.test.d.ts.map +0 -1
- package/dist/verification/__tests__/rust-runtime-thin-adapter-gate.test.js +0 -32
- package/dist/verification/__tests__/rust-runtime-thin-adapter-gate.test.js.map +0 -1
- package/dist/verification/__tests__/verifier.test.d.ts +0 -2
- package/dist/verification/__tests__/verifier.test.d.ts.map +0 -1
- package/dist/verification/__tests__/verifier.test.js +0 -113
- package/dist/verification/__tests__/verifier.test.js.map +0 -1
- package/dist/visual/__tests__/verdict.test.d.ts +0 -2
- package/dist/visual/__tests__/verdict.test.d.ts.map +0 -1
- package/dist/visual/__tests__/verdict.test.js +0 -81
- package/dist/visual/__tests__/verdict.test.js.map +0 -1
- package/dist/wiki/__tests__/cjk-tokenize.test.d.ts +0 -12
- package/dist/wiki/__tests__/cjk-tokenize.test.d.ts.map +0 -1
- package/dist/wiki/__tests__/cjk-tokenize.test.js +0 -139
- package/dist/wiki/__tests__/cjk-tokenize.test.js.map +0 -1
- package/dist/wiki/__tests__/crlf-parse.test.d.ts +0 -2
- package/dist/wiki/__tests__/crlf-parse.test.d.ts.map +0 -1
- package/dist/wiki/__tests__/crlf-parse.test.js +0 -24
- package/dist/wiki/__tests__/crlf-parse.test.js.map +0 -1
- package/dist/wiki/__tests__/escape-newline.test.d.ts +0 -2
- package/dist/wiki/__tests__/escape-newline.test.d.ts.map +0 -1
- package/dist/wiki/__tests__/escape-newline.test.js +0 -45
- package/dist/wiki/__tests__/escape-newline.test.js.map +0 -1
- package/dist/wiki/__tests__/ingest.test.d.ts +0 -5
- package/dist/wiki/__tests__/ingest.test.d.ts.map +0 -1
- package/dist/wiki/__tests__/ingest.test.js +0 -181
- package/dist/wiki/__tests__/ingest.test.js.map +0 -1
- package/dist/wiki/__tests__/lint.test.d.ts +0 -5
- package/dist/wiki/__tests__/lint.test.d.ts.map +0 -1
- package/dist/wiki/__tests__/lint.test.js +0 -163
- package/dist/wiki/__tests__/lint.test.js.map +0 -1
- package/dist/wiki/__tests__/query.test.d.ts +0 -5
- package/dist/wiki/__tests__/query.test.d.ts.map +0 -1
- package/dist/wiki/__tests__/query.test.js +0 -141
- package/dist/wiki/__tests__/query.test.js.map +0 -1
- package/dist/wiki/__tests__/reserved-file-guard.test.d.ts +0 -2
- package/dist/wiki/__tests__/reserved-file-guard.test.d.ts.map +0 -1
- package/dist/wiki/__tests__/reserved-file-guard.test.js +0 -44
- package/dist/wiki/__tests__/reserved-file-guard.test.js.map +0 -1
- package/dist/wiki/__tests__/session-hooks.test.d.ts +0 -5
- package/dist/wiki/__tests__/session-hooks.test.d.ts.map +0 -1
- package/dist/wiki/__tests__/session-hooks.test.js +0 -36
- package/dist/wiki/__tests__/session-hooks.test.js.map +0 -1
- package/dist/wiki/__tests__/slug-nonascii.test.d.ts +0 -2
- package/dist/wiki/__tests__/slug-nonascii.test.d.ts.map +0 -1
- package/dist/wiki/__tests__/slug-nonascii.test.js +0 -30
- package/dist/wiki/__tests__/slug-nonascii.test.js.map +0 -1
- package/dist/wiki/__tests__/storage.test.d.ts +0 -5
- package/dist/wiki/__tests__/storage.test.d.ts.map +0 -1
- package/dist/wiki/__tests__/storage.test.js +0 -278
- package/dist/wiki/__tests__/storage.test.js.map +0 -1
- package/dist/wiki/__tests__/test-helpers.d.ts +0 -31
- package/dist/wiki/__tests__/test-helpers.d.ts.map +0 -1
- package/dist/wiki/__tests__/test-helpers.js +0 -108
- package/dist/wiki/__tests__/test-helpers.js.map +0 -1
- package/docs/contracts/ralph-cancel-contract.md +0 -23
- package/docs/contracts/ralph-state-contract.md +0 -95
- package/docs/issues/team-ralph-followup-team.md +0 -38
- package/docs/qa/ralph-persistence-gate.md +0 -59
- package/docs/reference/ralph-parity-matrix.md +0 -25
- package/docs/reference/ralph-upstream-baseline.md +0 -34
- package/plugins/roblox-ai-os-creator-skills/skills/ralph/SKILL.md +0 -269
- package/plugins/roblox-ai-os-creator-skills/skills/ralplan/SKILL.md +0 -162
- package/prompts/api-reviewer.md +0 -113
- package/prompts/information-architect.md +0 -226
- package/prompts/performance-reviewer.md +0 -109
- package/prompts/product-analyst.md +0 -304
- package/prompts/product-manager.md +0 -245
- package/prompts/qa-tester.md +0 -124
- package/prompts/quality-reviewer.md +0 -123
- package/prompts/quality-strategist.md +0 -274
- package/prompts/style-reviewer.md +0 -102
- package/prompts/ux-researcher.md +0 -327
- package/skills/frontend-ui-ux/SKILL.md +0 -34
- package/skills/ralph/SKILL.md +0 -269
- package/skills/ralplan/SKILL.md +0 -162
- package/src/scripts/eval/eval-adaptive-sort-optimization.py +0 -24
- package/src/scripts/eval/eval-candidate-handoff.ts +0 -8
- package/src/scripts/eval/eval-cli-discoverability.ts +0 -40
- package/src/scripts/eval/eval-fresh-run-tagging.ts +0 -8
- package/src/scripts/eval/eval-help-consistency.ts +0 -11
- package/src/scripts/eval/eval-in-action-cat-shellout-demo.ts +0 -31
- package/src/scripts/eval/eval-ml-kaggle-model-optimization.py +0 -29
- package/src/scripts/eval/eval-noisy-bayesopt-highdim.py +0 -44
- package/src/scripts/eval/eval-noisy-latent-subspace-discovery.py +0 -44
- package/src/scripts/eval/eval-parity-smoke.ts +0 -20
- package/src/scripts/eval/eval-parity-sweep.ts +0 -26
- package/src/scripts/eval/eval-resume-dirty-guard.ts +0 -8
- package/src/scripts/eval/eval-security-path-traversal.ts +0 -38
- package/src/scripts/run-autoresearch-showcase.sh +0 -75
- /package/docs/{migration-mainline-post-v0.4.4.md → archive/migration-mainline-post-v0.4.4.md} +0 -0
- /package/docs/{qa-plan-0.4.2.md → archive/qa-plan-0.4.2.md} +0 -0
- /package/docs/{qa-report-0.4.2.md → archive/qa-report-0.4.2.md} +0 -0
|
@@ -1,1859 +0,0 @@
|
|
|
1
|
-
import { afterEach, beforeEach, describe, it } from 'node:test';
|
|
2
|
-
import assert from 'node:assert/strict';
|
|
3
|
-
import { chmod, mkdtemp, rm, writeFile, readFile, mkdir, utimes } from 'fs/promises';
|
|
4
|
-
import { join } from 'path';
|
|
5
|
-
import { tmpdir } from 'os';
|
|
6
|
-
import { existsSync, readFileSync } from 'fs';
|
|
7
|
-
import { ABSOLUTE_MAX_WORKERS, DEFAULT_MAX_WORKERS, cleanupTeamState, createTask, claimTask, computeTaskReadiness, getTeamSummary, initTeamState, listTasks, migrateV1ToV2, readTask, readTeamConfig, readTeamManifestV2, transitionTaskStatus, releaseTaskClaim, reclaimExpiredTaskClaim, sendDirectMessage, broadcastMessage, markMessageDelivered, markMessageNotified, listMailboxMessages, writeTaskApproval, readTaskApproval, readWorkerHeartbeat, readWorkerStatus, updateTask, updateWorkerHeartbeat, writeAtomic, setWriteAtomicRenameForTests, resetWriteAtomicRenameForTests, writeWorkerInbox, enqueueDispatchRequest, listDispatchRequests, markDispatchRequestNotified, markDispatchRequestDelivered, transitionDispatchRequest, readDispatchRequest, readMonitorSnapshot, resolveDispatchLockTimeoutMs, } from '../state.js';
|
|
8
|
-
import { normalizeDispatchRequest } from '../state/dispatch.js';
|
|
9
|
-
const ORIGINAL_RCS_TEAM_STATE_ROOT = process.env.RCS_TEAM_STATE_ROOT;
|
|
10
|
-
beforeEach(() => {
|
|
11
|
-
delete process.env.RCS_TEAM_STATE_ROOT;
|
|
12
|
-
});
|
|
13
|
-
afterEach(() => {
|
|
14
|
-
resetWriteAtomicRenameForTests();
|
|
15
|
-
if (typeof ORIGINAL_RCS_TEAM_STATE_ROOT === 'string')
|
|
16
|
-
process.env.RCS_TEAM_STATE_ROOT = ORIGINAL_RCS_TEAM_STATE_ROOT;
|
|
17
|
-
else
|
|
18
|
-
delete process.env.RCS_TEAM_STATE_ROOT;
|
|
19
|
-
});
|
|
20
|
-
async function writeCompatRuntimeFixture(runtimePath, runtimeLogPath) {
|
|
21
|
-
await writeFile(runtimePath, `#!/usr/bin/env node
|
|
22
|
-
const fs = require('fs');
|
|
23
|
-
const path = require('path');
|
|
24
|
-
|
|
25
|
-
const argv = process.argv.slice(2);
|
|
26
|
-
fs.appendFileSync(${JSON.stringify(runtimeLogPath)}, argv.join(' ') + '\\n');
|
|
27
|
-
|
|
28
|
-
function argValue(prefix) {
|
|
29
|
-
const entry = argv.find((value) => value.startsWith(prefix));
|
|
30
|
-
return entry ? entry.slice(prefix.length) : null;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function stateDir() {
|
|
34
|
-
return argValue('--state-dir=') || process.cwd();
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
function ensureDir(dir) {
|
|
38
|
-
fs.mkdirSync(dir, { recursive: true });
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function readJson(file, fallback) {
|
|
42
|
-
try {
|
|
43
|
-
return JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
44
|
-
} catch {
|
|
45
|
-
return fallback;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
function writeJson(file, value) {
|
|
50
|
-
ensureDir(path.dirname(file));
|
|
51
|
-
fs.writeFileSync(file, JSON.stringify(value, null, 2) + '\\n');
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
function nowIso() {
|
|
55
|
-
return new Date().toISOString();
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (argv[0] === 'schema') {
|
|
59
|
-
process.stdout.write(JSON.stringify({
|
|
60
|
-
schema_version: 1,
|
|
61
|
-
commands: [
|
|
62
|
-
'acquire-authority',
|
|
63
|
-
'renew-authority',
|
|
64
|
-
'queue-dispatch',
|
|
65
|
-
'mark-notified',
|
|
66
|
-
'mark-delivered',
|
|
67
|
-
'mark-failed',
|
|
68
|
-
'request-replay',
|
|
69
|
-
'capture-snapshot',
|
|
70
|
-
],
|
|
71
|
-
events: [],
|
|
72
|
-
transport: 'tmux',
|
|
73
|
-
}) + '\\n');
|
|
74
|
-
process.exit(0);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (argv[0] !== 'exec') process.exit(1);
|
|
78
|
-
|
|
79
|
-
const command = JSON.parse(argv[1] || '{}');
|
|
80
|
-
const dir = stateDir();
|
|
81
|
-
const dispatchPath = path.join(dir, 'dispatch.json');
|
|
82
|
-
const mailboxPath = path.join(dir, 'mailbox.json');
|
|
83
|
-
const dispatch = readJson(dispatchPath, { records: [] });
|
|
84
|
-
const mailbox = readJson(mailboxPath, { records: [] });
|
|
85
|
-
const timestamp = nowIso();
|
|
86
|
-
|
|
87
|
-
switch (command.command) {
|
|
88
|
-
case 'QueueDispatch': {
|
|
89
|
-
dispatch.records.push({
|
|
90
|
-
request_id: command.request_id,
|
|
91
|
-
target: command.target,
|
|
92
|
-
status: 'pending',
|
|
93
|
-
created_at: timestamp,
|
|
94
|
-
notified_at: null,
|
|
95
|
-
delivered_at: null,
|
|
96
|
-
failed_at: null,
|
|
97
|
-
reason: null,
|
|
98
|
-
metadata: command.metadata ?? null,
|
|
99
|
-
});
|
|
100
|
-
writeJson(dispatchPath, dispatch);
|
|
101
|
-
process.stdout.write(JSON.stringify({ event: 'DispatchQueued', request_id: command.request_id, target: command.target, metadata: command.metadata ?? null }) + '\\n');
|
|
102
|
-
process.exit(0);
|
|
103
|
-
}
|
|
104
|
-
case 'MarkNotified': {
|
|
105
|
-
const record = dispatch.records.find((entry) => entry.request_id === command.request_id);
|
|
106
|
-
if (record) {
|
|
107
|
-
record.status = 'notified';
|
|
108
|
-
record.notified_at = timestamp;
|
|
109
|
-
record.reason = command.channel;
|
|
110
|
-
writeJson(dispatchPath, dispatch);
|
|
111
|
-
}
|
|
112
|
-
process.stdout.write(JSON.stringify({ event: 'DispatchNotified', request_id: command.request_id, channel: command.channel }) + '\\n');
|
|
113
|
-
process.exit(0);
|
|
114
|
-
}
|
|
115
|
-
case 'MarkDelivered': {
|
|
116
|
-
const record = dispatch.records.find((entry) => entry.request_id === command.request_id);
|
|
117
|
-
if (record) {
|
|
118
|
-
record.status = 'delivered';
|
|
119
|
-
record.delivered_at = timestamp;
|
|
120
|
-
writeJson(dispatchPath, dispatch);
|
|
121
|
-
}
|
|
122
|
-
process.stdout.write(JSON.stringify({ event: 'DispatchDelivered', request_id: command.request_id }) + '\\n');
|
|
123
|
-
process.exit(0);
|
|
124
|
-
}
|
|
125
|
-
case 'MarkFailed': {
|
|
126
|
-
const record = dispatch.records.find((entry) => entry.request_id === command.request_id);
|
|
127
|
-
if (record) {
|
|
128
|
-
record.status = 'failed';
|
|
129
|
-
record.failed_at = timestamp;
|
|
130
|
-
record.reason = command.reason;
|
|
131
|
-
writeJson(dispatchPath, dispatch);
|
|
132
|
-
}
|
|
133
|
-
process.stdout.write(JSON.stringify({ event: 'DispatchFailed', request_id: command.request_id, reason: command.reason }) + '\\n');
|
|
134
|
-
process.exit(0);
|
|
135
|
-
}
|
|
136
|
-
case 'CreateMailboxMessage': {
|
|
137
|
-
mailbox.records.push({
|
|
138
|
-
message_id: command.message_id,
|
|
139
|
-
from_worker: command.from_worker,
|
|
140
|
-
to_worker: command.to_worker,
|
|
141
|
-
body: command.body,
|
|
142
|
-
created_at: timestamp,
|
|
143
|
-
notified_at: null,
|
|
144
|
-
delivered_at: null,
|
|
145
|
-
});
|
|
146
|
-
writeJson(mailboxPath, mailbox);
|
|
147
|
-
process.stdout.write(JSON.stringify({ event: 'MailboxMessageCreated', message_id: command.message_id, from_worker: command.from_worker, to_worker: command.to_worker }) + '\\n');
|
|
148
|
-
process.exit(0);
|
|
149
|
-
}
|
|
150
|
-
case 'MarkMailboxNotified': {
|
|
151
|
-
const record = mailbox.records.find((entry) => entry.message_id === command.message_id);
|
|
152
|
-
if (record) {
|
|
153
|
-
record.notified_at = timestamp;
|
|
154
|
-
writeJson(mailboxPath, mailbox);
|
|
155
|
-
}
|
|
156
|
-
process.stdout.write(JSON.stringify({ event: 'MailboxNotified', message_id: command.message_id }) + '\\n');
|
|
157
|
-
process.exit(0);
|
|
158
|
-
}
|
|
159
|
-
case 'MarkMailboxDelivered': {
|
|
160
|
-
const record = mailbox.records.find((entry) => entry.message_id === command.message_id);
|
|
161
|
-
if (record) {
|
|
162
|
-
record.delivered_at = timestamp;
|
|
163
|
-
writeJson(mailboxPath, mailbox);
|
|
164
|
-
}
|
|
165
|
-
process.stdout.write(JSON.stringify({ event: 'MailboxDelivered', message_id: command.message_id }) + '\\n');
|
|
166
|
-
process.exit(0);
|
|
167
|
-
}
|
|
168
|
-
default:
|
|
169
|
-
process.exit(1);
|
|
170
|
-
}
|
|
171
|
-
`);
|
|
172
|
-
await chmod(runtimePath, 0o755);
|
|
173
|
-
}
|
|
174
|
-
describe('team state', () => {
|
|
175
|
-
it('initTeamState creates correct directory structure and config.json', async () => {
|
|
176
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-state-'));
|
|
177
|
-
try {
|
|
178
|
-
const cfg = await initTeamState('team-1', 'do stuff', 'executor', 2, cwd);
|
|
179
|
-
const root = join(cwd, '.rcs', 'state', 'team', 'team-1');
|
|
180
|
-
assert.equal(existsSync(root), true);
|
|
181
|
-
assert.equal(existsSync(join(root, 'workers')), true);
|
|
182
|
-
assert.equal(existsSync(join(root, 'workers', 'worker-1')), true);
|
|
183
|
-
assert.equal(existsSync(join(root, 'workers', 'worker-2')), true);
|
|
184
|
-
assert.equal(existsSync(join(root, 'tasks')), true);
|
|
185
|
-
assert.equal(existsSync(join(root, 'claims')), true);
|
|
186
|
-
assert.equal(existsSync(join(root, 'mailbox')), true);
|
|
187
|
-
assert.equal(existsSync(join(root, 'events')), true);
|
|
188
|
-
assert.equal(existsSync(join(root, 'manifest.v2.json')), true);
|
|
189
|
-
const configPath = join(root, 'config.json');
|
|
190
|
-
assert.equal(existsSync(configPath), true);
|
|
191
|
-
const diskCfg = JSON.parse(readFileSync(configPath, 'utf8'));
|
|
192
|
-
assert.equal(cfg.name, 'team-1');
|
|
193
|
-
assert.equal(diskCfg.name, 'team-1');
|
|
194
|
-
assert.equal(diskCfg.task, 'do stuff');
|
|
195
|
-
assert.equal(diskCfg.agent_type, 'executor');
|
|
196
|
-
assert.equal(diskCfg.worker_count, 2);
|
|
197
|
-
assert.equal(diskCfg.max_workers, DEFAULT_MAX_WORKERS);
|
|
198
|
-
assert.equal(diskCfg.tmux_session, 'rcs-team-team-1');
|
|
199
|
-
assert.equal(diskCfg.lifecycle_profile, 'default');
|
|
200
|
-
assert.equal(diskCfg.leader_pane_id, null);
|
|
201
|
-
assert.equal(diskCfg.hud_pane_id, null);
|
|
202
|
-
assert.equal(diskCfg.resize_hook_name, null);
|
|
203
|
-
assert.equal(diskCfg.resize_hook_target, null);
|
|
204
|
-
assert.equal(typeof diskCfg.next_task_id, 'number');
|
|
205
|
-
assert.ok(Array.isArray(diskCfg.workers));
|
|
206
|
-
assert.equal(diskCfg.workers.length, 2);
|
|
207
|
-
}
|
|
208
|
-
finally {
|
|
209
|
-
await rm(cwd, { recursive: true, force: true });
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
it('initTeamState persists the default lifecycle profile', async () => {
|
|
213
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-lifecycle-profile-'));
|
|
214
|
-
try {
|
|
215
|
-
const cfg = await initTeamState('team-linked', 'do stuff', 'executor', 1, cwd, DEFAULT_MAX_WORKERS, process.env, {}, 'default');
|
|
216
|
-
assert.equal(cfg.lifecycle_profile, 'default');
|
|
217
|
-
const readCfg = await readTeamConfig('team-linked', cwd);
|
|
218
|
-
const manifest = await readTeamManifestV2('team-linked', cwd);
|
|
219
|
-
assert.equal(readCfg?.lifecycle_profile, 'default');
|
|
220
|
-
assert.equal(manifest?.lifecycle_profile, 'default');
|
|
221
|
-
}
|
|
222
|
-
finally {
|
|
223
|
-
await rm(cwd, { recursive: true, force: true });
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
it('migrateV1ToV2 writes manifest.v2.json idempotently from legacy config.json', async () => {
|
|
227
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-migrate-'));
|
|
228
|
-
try {
|
|
229
|
-
await initTeamState('team-mig', 't', 'executor', 1, cwd);
|
|
230
|
-
// Simulate a legacy team by removing v2 manifest.
|
|
231
|
-
const root = join(cwd, '.rcs', 'state', 'team', 'team-mig');
|
|
232
|
-
await rm(join(root, 'manifest.v2.json'), { force: true });
|
|
233
|
-
const m1 = await migrateV1ToV2('team-mig', cwd);
|
|
234
|
-
assert.ok(m1);
|
|
235
|
-
const onDisk1 = await readTeamManifestV2('team-mig', cwd);
|
|
236
|
-
assert.ok(onDisk1);
|
|
237
|
-
assert.equal(onDisk1?.lifecycle_profile, 'default');
|
|
238
|
-
const m2 = await migrateV1ToV2('team-mig', cwd);
|
|
239
|
-
assert.deepEqual(m2, onDisk1);
|
|
240
|
-
}
|
|
241
|
-
finally {
|
|
242
|
-
await rm(cwd, { recursive: true, force: true });
|
|
243
|
-
}
|
|
244
|
-
});
|
|
245
|
-
it('normalizes legacy manifest policy with dispatch defaults, timeout bounds, and governance split', async () => {
|
|
246
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-manifest-policy-'));
|
|
247
|
-
try {
|
|
248
|
-
await initTeamState('team-policy', 't', 'executor', 1, cwd);
|
|
249
|
-
const manifestPath = join(cwd, '.rcs', 'state', 'team', 'team-policy', 'manifest.v2.json');
|
|
250
|
-
const manifest = JSON.parse(await readFile(manifestPath, 'utf8'));
|
|
251
|
-
const policy = (manifest.policy ?? {});
|
|
252
|
-
delete policy.dispatch_mode;
|
|
253
|
-
policy.dispatch_ack_timeout_ms = 999_999;
|
|
254
|
-
policy.delegation_only = true;
|
|
255
|
-
policy.nested_teams_allowed = true;
|
|
256
|
-
policy.cleanup_requires_all_workers_inactive = false;
|
|
257
|
-
policy.team_decomposition = { decomposition_source: 'dag_sidecar' };
|
|
258
|
-
manifest.policy = policy;
|
|
259
|
-
delete manifest.governance;
|
|
260
|
-
await writeFile(manifestPath, JSON.stringify(manifest, null, 2));
|
|
261
|
-
const loaded = await readTeamManifestV2('team-policy', cwd);
|
|
262
|
-
assert.equal(loaded?.policy.dispatch_mode, 'hook_preferred_with_fallback');
|
|
263
|
-
assert.equal(loaded?.policy.dispatch_ack_timeout_ms, 10_000);
|
|
264
|
-
assert.equal(loaded?.governance.delegation_only, true);
|
|
265
|
-
assert.equal(loaded?.governance.nested_teams_allowed, true);
|
|
266
|
-
assert.equal(loaded?.governance.cleanup_requires_all_workers_inactive, false);
|
|
267
|
-
assert.equal('delegation_only' in (loaded?.policy ?? {}), false);
|
|
268
|
-
assert.equal('nested_teams_allowed' in (loaded?.policy ?? {}), false);
|
|
269
|
-
assert.equal('cleanup_requires_all_workers_inactive' in (loaded?.policy ?? {}), false);
|
|
270
|
-
assert.equal('team_decomposition' in (loaded?.policy ?? {}), false);
|
|
271
|
-
assert.deepEqual(loaded?.team_decomposition, { decomposition_source: 'dag_sidecar' });
|
|
272
|
-
const freshCwd = await mkdtemp(join(tmpdir(), 'rcs-team-manifest-policy-default-'));
|
|
273
|
-
try {
|
|
274
|
-
await initTeamState('team-policy-default', 't', 'executor', 1, freshCwd);
|
|
275
|
-
const fresh = await readTeamManifestV2('team-policy-default', freshCwd);
|
|
276
|
-
assert.equal(fresh?.policy.dispatch_ack_timeout_ms, 2_000);
|
|
277
|
-
assert.equal(fresh?.governance.cleanup_requires_all_workers_inactive, true);
|
|
278
|
-
const freshManifestPath = join(freshCwd, '.rcs', 'state', 'team', 'team-policy-default', 'manifest.v2.json');
|
|
279
|
-
const persisted = JSON.parse(await readFile(freshManifestPath, 'utf8'));
|
|
280
|
-
assert.equal('delegation_only' in (persisted.policy ?? {}), false);
|
|
281
|
-
assert.equal(persisted.governance?.delegation_only, false);
|
|
282
|
-
}
|
|
283
|
-
finally {
|
|
284
|
-
await rm(freshCwd, { recursive: true, force: true });
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
finally {
|
|
288
|
-
await rm(cwd, { recursive: true, force: true });
|
|
289
|
-
}
|
|
290
|
-
});
|
|
291
|
-
it('dispatch bridge queue uses the same request id as the TS store', async () => {
|
|
292
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-dispatch-bridge-sync-'));
|
|
293
|
-
const previousRuntimeBinary = process.env.RCS_RUNTIME_BINARY;
|
|
294
|
-
try {
|
|
295
|
-
await initTeamState('team-dispatch-sync', 't', 'executor', 1, cwd);
|
|
296
|
-
const fakeBinDir = join(cwd, 'fake-bin');
|
|
297
|
-
const runtimeLogPath = join(cwd, 'runtime.log');
|
|
298
|
-
await mkdir(fakeBinDir, { recursive: true });
|
|
299
|
-
await writeFile(join(fakeBinDir, 'rcs-runtime'), `#!/usr/bin/env bash
|
|
300
|
-
set -eu
|
|
301
|
-
printf '%s\n' "$*" >> "${runtimeLogPath}"
|
|
302
|
-
if [[ "\${1:-}" == "schema" ]]; then
|
|
303
|
-
printf '{"schema_version":1,"commands":["acquire-authority","renew-authority","queue-dispatch","mark-notified","mark-delivered","mark-failed","request-replay","capture-snapshot"],"events":[],"transport":"tmux"}\n'
|
|
304
|
-
exit 0
|
|
305
|
-
fi
|
|
306
|
-
if [[ "\${1:-}" == "exec" ]]; then
|
|
307
|
-
printf '{"event":"DispatchQueued","request_id":"ok","target":"worker-1"}\n'
|
|
308
|
-
exit 0
|
|
309
|
-
fi
|
|
310
|
-
exit 1
|
|
311
|
-
`);
|
|
312
|
-
await chmod(join(fakeBinDir, 'rcs-runtime'), 0o755);
|
|
313
|
-
process.env.RCS_RUNTIME_BINARY = join(fakeBinDir, 'rcs-runtime');
|
|
314
|
-
const queued = await enqueueDispatchRequest('team-dispatch-sync', {
|
|
315
|
-
kind: 'inbox',
|
|
316
|
-
to_worker: 'worker-1',
|
|
317
|
-
trigger_message: 'ping',
|
|
318
|
-
intent: 'followup-relaunch',
|
|
319
|
-
}, cwd);
|
|
320
|
-
const runtimeLog = await readFile(runtimeLogPath, 'utf8');
|
|
321
|
-
const queueLine = runtimeLog.split('\n').find((line) => line.startsWith('exec {"command":"QueueDispatch"'));
|
|
322
|
-
assert.ok(queueLine, 'expected QueueDispatch bridge call');
|
|
323
|
-
const jsonStart = queueLine.indexOf('{');
|
|
324
|
-
const stateDirFlag = queueLine.lastIndexOf(' --state-dir=');
|
|
325
|
-
const jsonPayload = stateDirFlag > jsonStart ? queueLine.slice(jsonStart, stateDirFlag) : queueLine.slice(jsonStart);
|
|
326
|
-
const payload = JSON.parse(jsonPayload);
|
|
327
|
-
assert.equal(payload.request_id, queued.request.request_id);
|
|
328
|
-
assert.equal(payload.metadata?.intent, 'followup-relaunch');
|
|
329
|
-
}
|
|
330
|
-
finally {
|
|
331
|
-
if (typeof previousRuntimeBinary === 'string')
|
|
332
|
-
process.env.RCS_RUNTIME_BINARY = previousRuntimeBinary;
|
|
333
|
-
else
|
|
334
|
-
delete process.env.RCS_RUNTIME_BINARY;
|
|
335
|
-
await rm(cwd, { recursive: true, force: true });
|
|
336
|
-
}
|
|
337
|
-
});
|
|
338
|
-
it('dispatch request store enqueues, dedupes, and transitions idempotently', async () => {
|
|
339
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-dispatch-store-'));
|
|
340
|
-
try {
|
|
341
|
-
await initTeamState('team-dispatch', 't', 'executor', 1, cwd);
|
|
342
|
-
const first = await enqueueDispatchRequest('team-dispatch', {
|
|
343
|
-
kind: 'mailbox',
|
|
344
|
-
to_worker: 'worker-1',
|
|
345
|
-
message_id: 'msg-1',
|
|
346
|
-
trigger_message: 'check mailbox',
|
|
347
|
-
intent: 'pending-mailbox-review',
|
|
348
|
-
}, cwd);
|
|
349
|
-
assert.equal(first.deduped, false);
|
|
350
|
-
const dup = await enqueueDispatchRequest('team-dispatch', {
|
|
351
|
-
kind: 'mailbox',
|
|
352
|
-
to_worker: 'worker-1',
|
|
353
|
-
message_id: 'msg-1',
|
|
354
|
-
trigger_message: 'check mailbox',
|
|
355
|
-
}, cwd);
|
|
356
|
-
assert.equal(dup.deduped, true);
|
|
357
|
-
assert.equal(dup.request.request_id, first.request.request_id);
|
|
358
|
-
const notified = await markDispatchRequestNotified('team-dispatch', first.request.request_id, {}, cwd);
|
|
359
|
-
assert.equal(notified?.status, 'notified');
|
|
360
|
-
const notifiedAgain = await markDispatchRequestNotified('team-dispatch', first.request.request_id, {}, cwd);
|
|
361
|
-
assert.equal(notifiedAgain?.status, 'notified');
|
|
362
|
-
const delivered = await markDispatchRequestDelivered('team-dispatch', first.request.request_id, {}, cwd);
|
|
363
|
-
assert.equal(delivered?.status, 'delivered');
|
|
364
|
-
const listed = await listDispatchRequests('team-dispatch', cwd);
|
|
365
|
-
assert.equal(listed.length, 1);
|
|
366
|
-
assert.equal(listed[0]?.message_id, 'msg-1');
|
|
367
|
-
assert.equal(listed[0]?.intent, 'pending-mailbox-review');
|
|
368
|
-
}
|
|
369
|
-
finally {
|
|
370
|
-
await rm(cwd, { recursive: true, force: true });
|
|
371
|
-
}
|
|
372
|
-
});
|
|
373
|
-
it('prefers bridge-authored dispatch records without mutating the legacy requests file', async () => {
|
|
374
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-dispatch-bridge-authority-'));
|
|
375
|
-
const previousRuntimeBinary = process.env.RCS_RUNTIME_BINARY;
|
|
376
|
-
try {
|
|
377
|
-
await initTeamState('team-dispatch-bridge-authority', 't', 'executor', 1, cwd);
|
|
378
|
-
const fakeBinDir = join(cwd, 'fake-bin');
|
|
379
|
-
const runtimeLogPath = join(cwd, 'runtime.log');
|
|
380
|
-
await mkdir(fakeBinDir, { recursive: true });
|
|
381
|
-
await writeCompatRuntimeFixture(join(fakeBinDir, 'rcs-runtime'), runtimeLogPath);
|
|
382
|
-
process.env.RCS_RUNTIME_BINARY = join(fakeBinDir, 'rcs-runtime');
|
|
383
|
-
const legacyPath = join(cwd, '.rcs', 'state', 'team', 'team-dispatch-bridge-authority', 'dispatch', 'requests.json');
|
|
384
|
-
const before = await readFile(legacyPath, 'utf8');
|
|
385
|
-
assert.equal(JSON.parse(before).length, 0);
|
|
386
|
-
const queued = await enqueueDispatchRequest('team-dispatch-bridge-authority', {
|
|
387
|
-
kind: 'mailbox',
|
|
388
|
-
to_worker: 'worker-1',
|
|
389
|
-
message_id: 'bridge-msg-1',
|
|
390
|
-
trigger_message: 'check mailbox',
|
|
391
|
-
}, cwd);
|
|
392
|
-
const requests = await listDispatchRequests('team-dispatch-bridge-authority', cwd);
|
|
393
|
-
assert.equal(requests.length, 1);
|
|
394
|
-
assert.equal(requests[0]?.request_id, queued.request.request_id);
|
|
395
|
-
assert.equal(requests[0]?.message_id, 'bridge-msg-1');
|
|
396
|
-
await markDispatchRequestNotified('team-dispatch-bridge-authority', queued.request.request_id, {}, cwd);
|
|
397
|
-
await markDispatchRequestDelivered('team-dispatch-bridge-authority', queued.request.request_id, {}, cwd);
|
|
398
|
-
const delivered = await readDispatchRequest('team-dispatch-bridge-authority', queued.request.request_id, cwd);
|
|
399
|
-
assert.equal(delivered?.status, 'delivered');
|
|
400
|
-
const after = await readFile(legacyPath, 'utf8');
|
|
401
|
-
assert.deepEqual(JSON.parse(after), [], 'bridge-success path should not rewrite legacy dispatch requests.json');
|
|
402
|
-
}
|
|
403
|
-
finally {
|
|
404
|
-
if (typeof previousRuntimeBinary === 'string')
|
|
405
|
-
process.env.RCS_RUNTIME_BINARY = previousRuntimeBinary;
|
|
406
|
-
else
|
|
407
|
-
delete process.env.RCS_RUNTIME_BINARY;
|
|
408
|
-
await rm(cwd, { recursive: true, force: true });
|
|
409
|
-
}
|
|
410
|
-
});
|
|
411
|
-
it('dispatch request store keeps failed requests failed while allowing reason patches', async () => {
|
|
412
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-dispatch-store-failed-'));
|
|
413
|
-
try {
|
|
414
|
-
await initTeamState('team-dispatch-failed', 't', 'executor', 1, cwd);
|
|
415
|
-
const queued = await enqueueDispatchRequest('team-dispatch-failed', {
|
|
416
|
-
kind: 'inbox',
|
|
417
|
-
to_worker: 'worker-1',
|
|
418
|
-
trigger_message: 'ping',
|
|
419
|
-
}, cwd);
|
|
420
|
-
await transitionDispatchRequest('team-dispatch-failed', queued.request.request_id, 'pending', 'failed', { last_reason: 'initial_failure' }, cwd);
|
|
421
|
-
const recovered = await markDispatchRequestNotified('team-dispatch-failed', queued.request.request_id, { last_reason: 'fallback_confirmed:tmux_send_keys_sent', failed_at: undefined }, cwd);
|
|
422
|
-
assert.equal(recovered, null);
|
|
423
|
-
const patched = await transitionDispatchRequest('team-dispatch-failed', queued.request.request_id, 'failed', 'failed', { last_reason: 'fallback_confirmed_after_failed_receipt:tmux_send_keys_sent' }, cwd);
|
|
424
|
-
assert.equal(patched?.status, 'failed');
|
|
425
|
-
assert.equal(patched?.last_reason, 'fallback_confirmed_after_failed_receipt:tmux_send_keys_sent');
|
|
426
|
-
const reread = await readDispatchRequest('team-dispatch-failed', queued.request.request_id, cwd);
|
|
427
|
-
assert.equal(reread?.status, 'failed');
|
|
428
|
-
assert.equal(reread?.failed_at, patched?.failed_at);
|
|
429
|
-
assert.equal(reread?.last_reason, 'fallback_confirmed_after_failed_receipt:tmux_send_keys_sent');
|
|
430
|
-
}
|
|
431
|
-
finally {
|
|
432
|
-
await rm(cwd, { recursive: true, force: true });
|
|
433
|
-
}
|
|
434
|
-
});
|
|
435
|
-
it('initTeamState persists workspace metadata to config + manifest', async () => {
|
|
436
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-metadata-'));
|
|
437
|
-
try {
|
|
438
|
-
const cfg = await initTeamState('team-meta', 't', 'executor', 1, cwd, DEFAULT_MAX_WORKERS, process.env, {
|
|
439
|
-
leader_cwd: '/tmp/leader',
|
|
440
|
-
team_state_root: '/tmp/leader/.rcs/state',
|
|
441
|
-
workspace_mode: 'worktree',
|
|
442
|
-
worktree_mode: { enabled: true, detached: false, name: 'feature/team-meta' },
|
|
443
|
-
});
|
|
444
|
-
assert.equal(cfg.leader_cwd, '/tmp/leader');
|
|
445
|
-
assert.equal(cfg.team_state_root, '/tmp/leader/.rcs/state');
|
|
446
|
-
assert.equal(cfg.workspace_mode, 'worktree');
|
|
447
|
-
assert.deepEqual(cfg.worktree_mode, { enabled: true, detached: false, name: 'feature/team-meta' });
|
|
448
|
-
const manifest = await readTeamManifestV2('team-meta', cwd);
|
|
449
|
-
assert.ok(manifest);
|
|
450
|
-
assert.equal(manifest?.leader_cwd, '/tmp/leader');
|
|
451
|
-
assert.equal(manifest?.team_state_root, '/tmp/leader/.rcs/state');
|
|
452
|
-
assert.equal(manifest?.workspace_mode, 'worktree');
|
|
453
|
-
assert.deepEqual(manifest?.worktree_mode, { enabled: true, detached: false, name: 'feature/team-meta' });
|
|
454
|
-
assert.equal(manifest?.lifecycle_profile, 'default');
|
|
455
|
-
assert.equal(manifest?.leader_pane_id, null);
|
|
456
|
-
assert.equal(manifest?.hud_pane_id, null);
|
|
457
|
-
assert.equal(manifest?.resize_hook_name, null);
|
|
458
|
-
assert.equal(manifest?.resize_hook_target, null);
|
|
459
|
-
}
|
|
460
|
-
finally {
|
|
461
|
-
await rm(cwd, { recursive: true, force: true });
|
|
462
|
-
}
|
|
463
|
-
});
|
|
464
|
-
it('resolves task/mailbox/approval paths under explicit RCS_TEAM_STATE_ROOT from a worker cwd (worker-env contamination regression)', async () => {
|
|
465
|
-
const root = await mkdtemp(join(tmpdir(), 'rcs-team-explicit-root-'));
|
|
466
|
-
const leaderCwd = join(root, 'leader');
|
|
467
|
-
const workerCwd = join(root, 'worker-worktree');
|
|
468
|
-
const explicitStateRoot = join(leaderCwd, '.rcs', 'state');
|
|
469
|
-
const prevRoot = process.env.RCS_TEAM_STATE_ROOT;
|
|
470
|
-
try {
|
|
471
|
-
await mkdir(leaderCwd, { recursive: true });
|
|
472
|
-
await mkdir(workerCwd, { recursive: true });
|
|
473
|
-
await initTeamState('team-explicit-root', 't', 'executor', 1, leaderCwd);
|
|
474
|
-
process.env.RCS_TEAM_STATE_ROOT = explicitStateRoot;
|
|
475
|
-
const task = await createTask('team-explicit-root', { subject: 'explicit root task', description: 'regression guard', status: 'pending' }, workerCwd);
|
|
476
|
-
const claim = await claimTask('team-explicit-root', task.id, 'worker-1', task.version ?? 1, workerCwd);
|
|
477
|
-
assert.equal(claim.ok, true);
|
|
478
|
-
await sendDirectMessage('team-explicit-root', 'worker-1', 'leader-fixed', 'hello from worker cwd', workerCwd);
|
|
479
|
-
const messages = await listMailboxMessages('team-explicit-root', 'leader-fixed', workerCwd);
|
|
480
|
-
assert.equal(messages.length, 1);
|
|
481
|
-
assert.equal(messages[0]?.body, 'hello from worker cwd');
|
|
482
|
-
const approvalRecord = {
|
|
483
|
-
task_id: task.id,
|
|
484
|
-
required: true,
|
|
485
|
-
status: 'approved',
|
|
486
|
-
reviewer: 'leader-fixed',
|
|
487
|
-
decision_reason: 'path guard uses resolved team state root',
|
|
488
|
-
decided_at: new Date().toISOString(),
|
|
489
|
-
};
|
|
490
|
-
await writeTaskApproval('team-explicit-root', approvalRecord, workerCwd);
|
|
491
|
-
const approval = await readTaskApproval('team-explicit-root', task.id, workerCwd);
|
|
492
|
-
assert.equal(approval?.status, 'approved');
|
|
493
|
-
assert.equal(approval?.reviewer, 'leader-fixed');
|
|
494
|
-
const explicitTeamRoot = join(explicitStateRoot, 'team', 'team-explicit-root');
|
|
495
|
-
assert.equal(existsSync(join(explicitTeamRoot, 'tasks', `task-${task.id}.json`)), true);
|
|
496
|
-
assert.equal(existsSync(join(explicitTeamRoot, 'mailbox', 'leader-fixed.json')), true);
|
|
497
|
-
assert.equal(existsSync(join(explicitTeamRoot, 'approvals', `task-${task.id}.json`)), true);
|
|
498
|
-
assert.equal(existsSync(join(workerCwd, '.rcs', 'state', 'team', 'team-explicit-root')), false);
|
|
499
|
-
}
|
|
500
|
-
finally {
|
|
501
|
-
if (typeof prevRoot === 'string')
|
|
502
|
-
process.env.RCS_TEAM_STATE_ROOT = prevRoot;
|
|
503
|
-
else
|
|
504
|
-
delete process.env.RCS_TEAM_STATE_ROOT;
|
|
505
|
-
await rm(root, { recursive: true, force: true });
|
|
506
|
-
}
|
|
507
|
-
});
|
|
508
|
-
it('claimTask enforces dependency readiness (blocked_dependency)', async () => {
|
|
509
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-claim-'));
|
|
510
|
-
try {
|
|
511
|
-
await initTeamState('team-deps', 't', 'executor', 1, cwd);
|
|
512
|
-
const dep = await createTask('team-deps', { subject: 'dep', description: 'd', status: 'pending' }, cwd);
|
|
513
|
-
const t = await createTask('team-deps', { subject: 'main', description: 'd', status: 'pending', depends_on: [dep.id] }, cwd);
|
|
514
|
-
const readiness = await computeTaskReadiness('team-deps', t.id, cwd);
|
|
515
|
-
assert.equal(readiness.ready, false);
|
|
516
|
-
const claim = await claimTask('team-deps', t.id, 'worker-1', t.version ?? 1, cwd);
|
|
517
|
-
assert.equal(claim.ok, false);
|
|
518
|
-
assert.equal(claim.ok ? 'x' : claim.error, 'blocked_dependency');
|
|
519
|
-
}
|
|
520
|
-
finally {
|
|
521
|
-
await rm(cwd, { recursive: true, force: true });
|
|
522
|
-
}
|
|
523
|
-
});
|
|
524
|
-
it('claimTask rejects in-progress claim takeover when expectedVersion is null (issue-172)', async () => {
|
|
525
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-claim-inprogress-'));
|
|
526
|
-
try {
|
|
527
|
-
await initTeamState('team-claim-inprogress', 't', 'executor', 2, cwd);
|
|
528
|
-
const t = await createTask('team-claim-inprogress', { subject: 'a', description: 'd', status: 'pending' }, cwd);
|
|
529
|
-
// worker-1 claims the task successfully
|
|
530
|
-
const claim1 = await claimTask('team-claim-inprogress', t.id, 'worker-1', t.version ?? 1, cwd);
|
|
531
|
-
assert.equal(claim1.ok, true);
|
|
532
|
-
// worker-2 tries to steal the claim with no expectedVersion (null) — must fail
|
|
533
|
-
const steal = await claimTask('team-claim-inprogress', t.id, 'worker-2', null, cwd);
|
|
534
|
-
assert.equal(steal.ok, false);
|
|
535
|
-
assert.equal(steal.ok ? 'x' : steal.error, 'claim_conflict');
|
|
536
|
-
// Verify worker-1 still owns the task
|
|
537
|
-
const task = await readTask('team-claim-inprogress', t.id, cwd);
|
|
538
|
-
assert.equal(task?.owner, 'worker-1');
|
|
539
|
-
assert.equal(task?.status, 'in_progress');
|
|
540
|
-
}
|
|
541
|
-
finally {
|
|
542
|
-
await rm(cwd, { recursive: true, force: true });
|
|
543
|
-
}
|
|
544
|
-
});
|
|
545
|
-
it('claimTask rejects in-progress claim takeover even with a matching version', async () => {
|
|
546
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-claim-inprogress-ver-'));
|
|
547
|
-
try {
|
|
548
|
-
await initTeamState('team-claim-inprogress-ver', 't', 'executor', 2, cwd);
|
|
549
|
-
const t = await createTask('team-claim-inprogress-ver', { subject: 'a', description: 'd', status: 'pending' }, cwd);
|
|
550
|
-
// worker-1 claims the task, advancing version to 2
|
|
551
|
-
const claim1 = await claimTask('team-claim-inprogress-ver', t.id, 'worker-1', t.version ?? 1, cwd);
|
|
552
|
-
assert.equal(claim1.ok, true);
|
|
553
|
-
const claimedVersion = claim1.ok ? claim1.task.version : 0;
|
|
554
|
-
// worker-2 tries to steal using the current (post-claim) version — must still fail
|
|
555
|
-
const steal = await claimTask('team-claim-inprogress-ver', t.id, 'worker-2', claimedVersion, cwd);
|
|
556
|
-
assert.equal(steal.ok, false);
|
|
557
|
-
assert.equal(steal.ok ? 'x' : steal.error, 'claim_conflict');
|
|
558
|
-
const task = await readTask('team-claim-inprogress-ver', t.id, cwd);
|
|
559
|
-
assert.equal(task?.owner, 'worker-1');
|
|
560
|
-
}
|
|
561
|
-
finally {
|
|
562
|
-
await rm(cwd, { recursive: true, force: true });
|
|
563
|
-
}
|
|
564
|
-
});
|
|
565
|
-
it('claimTask claim locking yields deterministic claim_conflict', async () => {
|
|
566
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-claim-lock-'));
|
|
567
|
-
try {
|
|
568
|
-
// Use 2 workers so both claimants are registered in the team.
|
|
569
|
-
await initTeamState('team-lock', 't', 'executor', 2, cwd);
|
|
570
|
-
const t = await createTask('team-lock', { subject: 'a', description: 'd', status: 'pending' }, cwd);
|
|
571
|
-
// Both try to claim based on the same expected version; only one should succeed.
|
|
572
|
-
const [c1, c2] = await Promise.all([
|
|
573
|
-
claimTask('team-lock', t.id, 'worker-1', t.version ?? 1, cwd),
|
|
574
|
-
claimTask('team-lock', t.id, 'worker-2', t.version ?? 1, cwd),
|
|
575
|
-
]);
|
|
576
|
-
const oks = [c1, c2].filter((c) => c.ok).length;
|
|
577
|
-
const conflicts = [c1, c2].filter((c) => !c.ok && c.error === 'claim_conflict').length;
|
|
578
|
-
assert.equal(oks, 1);
|
|
579
|
-
assert.equal(conflicts, 1);
|
|
580
|
-
}
|
|
581
|
-
finally {
|
|
582
|
-
await rm(cwd, { recursive: true, force: true });
|
|
583
|
-
}
|
|
584
|
-
});
|
|
585
|
-
it('claimTask recovers a stale task claim lock and proceeds', async () => {
|
|
586
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-claim-stale-lock-'));
|
|
587
|
-
try {
|
|
588
|
-
await initTeamState('team-stale-lock', 't', 'executor', 1, cwd);
|
|
589
|
-
const t = await createTask('team-stale-lock', { subject: 'a', description: 'd', status: 'pending' }, cwd);
|
|
590
|
-
const staleLockDir = join(cwd, '.rcs', 'state', 'team', 'team-stale-lock', 'claims', `task-${t.id}.lock`);
|
|
591
|
-
await mkdir(staleLockDir, { recursive: true });
|
|
592
|
-
await writeFile(join(staleLockDir, 'owner'), 'stale-owner');
|
|
593
|
-
const staleTs = new Date(Date.now() - 10 * 60_000);
|
|
594
|
-
await utimes(staleLockDir, staleTs, staleTs);
|
|
595
|
-
const claim = await claimTask('team-stale-lock', t.id, 'worker-1', t.version ?? 1, cwd);
|
|
596
|
-
assert.equal(claim.ok, true);
|
|
597
|
-
}
|
|
598
|
-
finally {
|
|
599
|
-
await rm(cwd, { recursive: true, force: true });
|
|
600
|
-
}
|
|
601
|
-
});
|
|
602
|
-
it('claimTask owner write failure cleans up claim lock without orphan lock dir', { concurrency: false }, async () => {
|
|
603
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-claim-owner-write-fail-'));
|
|
604
|
-
let previousUmask = null;
|
|
605
|
-
try {
|
|
606
|
-
await initTeamState('team-owner-write-fail', 't', 'executor', 1, cwd);
|
|
607
|
-
const t = await createTask('team-owner-write-fail', { subject: 'a', description: 'd', status: 'pending' }, cwd);
|
|
608
|
-
previousUmask = process.umask(0o222);
|
|
609
|
-
await assert.rejects(() => claimTask('team-owner-write-fail', t.id, 'worker-1', t.version ?? 1, cwd), /(EACCES|EPERM|permission denied)/i);
|
|
610
|
-
const lockDir = join(cwd, '.rcs', 'state', 'team', 'team-owner-write-fail', 'claims', `task-${t.id}.lock`);
|
|
611
|
-
assert.equal(existsSync(lockDir), false);
|
|
612
|
-
}
|
|
613
|
-
finally {
|
|
614
|
-
if (typeof previousUmask === 'number')
|
|
615
|
-
process.umask(previousUmask);
|
|
616
|
-
await rm(cwd, { recursive: true, force: true });
|
|
617
|
-
}
|
|
618
|
-
});
|
|
619
|
-
it('claimTask rejects a pending task with residual owner/claim metadata', async () => {
|
|
620
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-claim-residual-claim-'));
|
|
621
|
-
try {
|
|
622
|
-
await initTeamState('team-claim-residual', 't', 'executor', 1, cwd);
|
|
623
|
-
const t = await createTask('team-claim-residual', { subject: 'a', description: 'd', status: 'pending' }, cwd);
|
|
624
|
-
const taskPath = join(cwd, '.rcs', 'state', 'team', 'team-claim-residual', 'tasks', `task-${t.id}.json`);
|
|
625
|
-
const current = JSON.parse(await readFile(taskPath, 'utf-8'));
|
|
626
|
-
current.owner = 'worker-1';
|
|
627
|
-
current.claim = {
|
|
628
|
-
owner: 'worker-1',
|
|
629
|
-
token: 'stale-token',
|
|
630
|
-
leased_until: new Date(Date.now() + 5 * 60_000).toISOString(),
|
|
631
|
-
};
|
|
632
|
-
await writeFile(taskPath, JSON.stringify(current, null, 2));
|
|
633
|
-
const claim = await claimTask('team-claim-residual', t.id, 'worker-1', null, cwd);
|
|
634
|
-
assert.equal(claim.ok, false);
|
|
635
|
-
assert.equal(claim.ok ? 'x' : claim.error, 'claim_conflict');
|
|
636
|
-
}
|
|
637
|
-
finally {
|
|
638
|
-
await rm(cwd, { recursive: true, force: true });
|
|
639
|
-
}
|
|
640
|
-
});
|
|
641
|
-
it('claimTask allows a worker to claim its own pre-assigned pending task', async () => {
|
|
642
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-claim-assigned-owner-'));
|
|
643
|
-
try {
|
|
644
|
-
await initTeamState('team-claim-assigned-owner', 't', 'executor', 2, cwd);
|
|
645
|
-
const t = await createTask('team-claim-assigned-owner', { subject: 'a', description: 'd', status: 'pending', owner: 'worker-1' }, cwd);
|
|
646
|
-
const claim = await claimTask('team-claim-assigned-owner', t.id, 'worker-1', t.version ?? 1, cwd);
|
|
647
|
-
assert.equal(claim.ok, true);
|
|
648
|
-
if (!claim.ok)
|
|
649
|
-
return;
|
|
650
|
-
assert.equal(claim.task.status, 'in_progress');
|
|
651
|
-
assert.equal(claim.task.owner, 'worker-1');
|
|
652
|
-
assert.ok(claim.task.claim);
|
|
653
|
-
}
|
|
654
|
-
finally {
|
|
655
|
-
await rm(cwd, { recursive: true, force: true });
|
|
656
|
-
}
|
|
657
|
-
});
|
|
658
|
-
it('claimTask rejects pending task pre-assigned to a different worker', async () => {
|
|
659
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-claim-owner-mismatch-'));
|
|
660
|
-
try {
|
|
661
|
-
await initTeamState('team-claim-owner-mismatch', 't', 'executor', 2, cwd);
|
|
662
|
-
const t = await createTask('team-claim-owner-mismatch', { subject: 'a', description: 'd', status: 'pending', owner: 'worker-1' }, cwd);
|
|
663
|
-
const claim = await claimTask('team-claim-owner-mismatch', t.id, 'worker-2', t.version ?? 1, cwd);
|
|
664
|
-
assert.equal(claim.ok, false);
|
|
665
|
-
assert.equal(claim.ok ? 'x' : claim.error, 'claim_conflict');
|
|
666
|
-
}
|
|
667
|
-
finally {
|
|
668
|
-
await rm(cwd, { recursive: true, force: true });
|
|
669
|
-
}
|
|
670
|
-
});
|
|
671
|
-
it('transitionTaskStatus returns invalid_transition for illegal transition', async () => {
|
|
672
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-transition-'));
|
|
673
|
-
try {
|
|
674
|
-
await initTeamState('team-trans', 't', 'executor', 1, cwd);
|
|
675
|
-
const t = await createTask('team-trans', { subject: 'a', description: 'd', status: 'pending' }, cwd);
|
|
676
|
-
const claim = await claimTask('team-trans', t.id, 'worker-1', t.version ?? 1, cwd);
|
|
677
|
-
assert.equal(claim.ok, true);
|
|
678
|
-
if (!claim.ok)
|
|
679
|
-
return;
|
|
680
|
-
const bad = await transitionTaskStatus('team-trans', t.id, 'pending', 'completed', claim.claimToken, cwd);
|
|
681
|
-
assert.equal(bad.ok, false);
|
|
682
|
-
assert.equal(bad.ok ? 'x' : bad.error, 'invalid_transition');
|
|
683
|
-
}
|
|
684
|
-
finally {
|
|
685
|
-
await rm(cwd, { recursive: true, force: true });
|
|
686
|
-
}
|
|
687
|
-
});
|
|
688
|
-
it('transitionTaskStatus rejects non-terminal transitions from in_progress', async () => {
|
|
689
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-transition-nonterminal-'));
|
|
690
|
-
try {
|
|
691
|
-
await initTeamState('team-trans-nonterminal', 't', 'executor', 1, cwd);
|
|
692
|
-
const t = await createTask('team-trans-nonterminal', { subject: 'a', description: 'd', status: 'pending' }, cwd);
|
|
693
|
-
const claim = await claimTask('team-trans-nonterminal', t.id, 'worker-1', t.version ?? 1, cwd);
|
|
694
|
-
assert.equal(claim.ok, true);
|
|
695
|
-
if (!claim.ok)
|
|
696
|
-
return;
|
|
697
|
-
const bad = await transitionTaskStatus('team-trans-nonterminal', t.id, 'in_progress', 'pending', claim.claimToken, cwd);
|
|
698
|
-
assert.equal(bad.ok, false);
|
|
699
|
-
assert.equal(bad.ok ? 'x' : bad.error, 'invalid_transition');
|
|
700
|
-
const reread = await readTask('team-trans-nonterminal', t.id, cwd);
|
|
701
|
-
assert.equal(reread?.status, 'in_progress');
|
|
702
|
-
assert.equal(reread?.owner, 'worker-1');
|
|
703
|
-
assert.ok(reread?.claim);
|
|
704
|
-
}
|
|
705
|
-
finally {
|
|
706
|
-
await rm(cwd, { recursive: true, force: true });
|
|
707
|
-
}
|
|
708
|
-
});
|
|
709
|
-
it('transitionTaskStatus returns claim_conflict when claim owner diverges from task owner', async () => {
|
|
710
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-transition-owner-diverge-'));
|
|
711
|
-
try {
|
|
712
|
-
await initTeamState('team-trans-owner-diverge', 't', 'executor', 2, cwd);
|
|
713
|
-
const t = await createTask('team-trans-owner-diverge', { subject: 'a', description: 'd', status: 'pending' }, cwd);
|
|
714
|
-
const claim = await claimTask('team-trans-owner-diverge', t.id, 'worker-1', t.version ?? 1, cwd);
|
|
715
|
-
assert.equal(claim.ok, true);
|
|
716
|
-
if (!claim.ok)
|
|
717
|
-
return;
|
|
718
|
-
const taskPath = join(cwd, '.rcs', 'state', 'team', 'team-trans-owner-diverge', 'tasks', `task-${t.id}.json`);
|
|
719
|
-
const current = JSON.parse(await readFile(taskPath, 'utf-8'));
|
|
720
|
-
current.claim.owner = 'worker-2';
|
|
721
|
-
await writeFile(taskPath, JSON.stringify(current, null, 2));
|
|
722
|
-
const result = await transitionTaskStatus('team-trans-owner-diverge', t.id, 'in_progress', 'completed', claim.claimToken, cwd);
|
|
723
|
-
assert.equal(result.ok, false);
|
|
724
|
-
assert.equal(result.ok ? 'x' : result.error, 'claim_conflict');
|
|
725
|
-
}
|
|
726
|
-
finally {
|
|
727
|
-
await rm(cwd, { recursive: true, force: true });
|
|
728
|
-
}
|
|
729
|
-
});
|
|
730
|
-
it('transitionTaskStatus appends task_completed event when task completes', async () => {
|
|
731
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-events-'));
|
|
732
|
-
try {
|
|
733
|
-
await initTeamState('team-events', 't', 'executor', 1, cwd);
|
|
734
|
-
const t = await createTask('team-events', { subject: 'a', description: 'd', status: 'pending' }, cwd);
|
|
735
|
-
const claim = await claimTask('team-events', t.id, 'worker-1', t.version ?? 1, cwd);
|
|
736
|
-
assert.equal(claim.ok, true);
|
|
737
|
-
const token = claim.ok ? claim.claimToken : 'x';
|
|
738
|
-
const tr = await transitionTaskStatus('team-events', t.id, 'in_progress', 'completed', token, cwd);
|
|
739
|
-
assert.equal(tr.ok, true);
|
|
740
|
-
const eventsPath = join(cwd, '.rcs', 'state', 'team', 'team-events', 'events', 'events.ndjson');
|
|
741
|
-
const content = await readFile(eventsPath, 'utf-8');
|
|
742
|
-
assert.match(content, /\"type\":\"task_completed\"/);
|
|
743
|
-
assert.match(content, new RegExp(`\"task_id\":\"${t.id}\"`));
|
|
744
|
-
}
|
|
745
|
-
finally {
|
|
746
|
-
await rm(cwd, { recursive: true, force: true });
|
|
747
|
-
}
|
|
748
|
-
});
|
|
749
|
-
it('transitionTaskStatus rejects broad delegated completion without spawn evidence or skip reason', async () => {
|
|
750
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-delegation-evidence-'));
|
|
751
|
-
try {
|
|
752
|
-
await initTeamState('team-delegation-evidence', 't', 'executor', 1, cwd);
|
|
753
|
-
const t = await createTask('team-delegation-evidence', {
|
|
754
|
-
subject: 'Investigate flaky runtime behavior',
|
|
755
|
-
description: 'Search runtime and debug flaky assignment behavior',
|
|
756
|
-
status: 'pending',
|
|
757
|
-
delegation: {
|
|
758
|
-
mode: 'auto',
|
|
759
|
-
required_parallel_probe: true,
|
|
760
|
-
skip_allowed_reason_required: true,
|
|
761
|
-
},
|
|
762
|
-
}, cwd);
|
|
763
|
-
const claim = await claimTask('team-delegation-evidence', t.id, 'worker-1', t.version ?? 1, cwd);
|
|
764
|
-
assert.equal(claim.ok, true);
|
|
765
|
-
if (!claim.ok)
|
|
766
|
-
return;
|
|
767
|
-
const missing = await transitionTaskStatus('team-delegation-evidence', t.id, 'in_progress', 'completed', claim.claimToken, cwd, { result: 'Verification:\nPASS - focused regression' });
|
|
768
|
-
assert.equal(missing.ok, false);
|
|
769
|
-
assert.equal(missing.ok ? 'x' : missing.error, 'missing_delegation_compliance_evidence');
|
|
770
|
-
const reread = await readTask('team-delegation-evidence', t.id, cwd);
|
|
771
|
-
assert.equal(reread?.status, 'in_progress');
|
|
772
|
-
const completedWithSpawnEvidence = await transitionTaskStatus('team-delegation-evidence', t.id, 'in_progress', 'completed', claim.claimToken, cwd, {
|
|
773
|
-
result: [
|
|
774
|
-
'Verification:',
|
|
775
|
-
'PASS - focused regression',
|
|
776
|
-
'Subagent spawn evidence: spawned 2 native subagents for runtime map and test probe',
|
|
777
|
-
].join('\n'),
|
|
778
|
-
});
|
|
779
|
-
assert.equal(completedWithSpawnEvidence.ok, true);
|
|
780
|
-
assert.equal(completedWithSpawnEvidence.task.delegation_compliance?.status, 'spawned');
|
|
781
|
-
}
|
|
782
|
-
finally {
|
|
783
|
-
await rm(cwd, { recursive: true, force: true });
|
|
784
|
-
}
|
|
785
|
-
});
|
|
786
|
-
it('transitionTaskStatus requires evidence when optional delegation carries required parallel probe', async () => {
|
|
787
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-optional-required-probe-'));
|
|
788
|
-
try {
|
|
789
|
-
await initTeamState('team-optional-required-probe', 't', 'executor', 1, cwd);
|
|
790
|
-
const t = await createTask('team-optional-required-probe', {
|
|
791
|
-
subject: 'Investigate optional delegated runtime behavior',
|
|
792
|
-
description: 'Optional mode was elevated by a required parallel probe from review enforcement',
|
|
793
|
-
status: 'pending',
|
|
794
|
-
delegation: {
|
|
795
|
-
mode: 'optional',
|
|
796
|
-
required_parallel_probe: true,
|
|
797
|
-
skip_allowed_reason_required: true,
|
|
798
|
-
},
|
|
799
|
-
}, cwd);
|
|
800
|
-
const claim = await claimTask('team-optional-required-probe', t.id, 'worker-1', t.version ?? 1, cwd);
|
|
801
|
-
assert.equal(claim.ok, true);
|
|
802
|
-
if (!claim.ok)
|
|
803
|
-
return;
|
|
804
|
-
const missing = await transitionTaskStatus('team-optional-required-probe', t.id, 'in_progress', 'completed', claim.claimToken, cwd, { result: 'Verification:\nPASS - focused regression' });
|
|
805
|
-
assert.equal(missing.ok, false);
|
|
806
|
-
assert.equal(missing.ok ? 'x' : missing.error, 'missing_delegation_compliance_evidence');
|
|
807
|
-
const reread = await readTask('team-optional-required-probe', t.id, cwd);
|
|
808
|
-
assert.equal(reread?.status, 'in_progress');
|
|
809
|
-
const completed = await transitionTaskStatus('team-optional-required-probe', t.id, 'in_progress', 'completed', claim.claimToken, cwd, {
|
|
810
|
-
result: [
|
|
811
|
-
'Verification:',
|
|
812
|
-
'PASS - focused regression',
|
|
813
|
-
'Subagent spawn evidence: spawned 1 native subagent for delegation evidence regression mapping',
|
|
814
|
-
].join('\n'),
|
|
815
|
-
});
|
|
816
|
-
assert.equal(completed.ok, true);
|
|
817
|
-
assert.equal(completed.task.delegation_compliance?.status, 'spawned');
|
|
818
|
-
assert.equal(completed.task.delegation_compliance?.source, 'terminal_result');
|
|
819
|
-
}
|
|
820
|
-
finally {
|
|
821
|
-
await rm(cwd, { recursive: true, force: true });
|
|
822
|
-
}
|
|
823
|
-
});
|
|
824
|
-
it('transitionTaskStatus accepts documented skip reason for broad delegated completion', async () => {
|
|
825
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-delegation-skip-'));
|
|
826
|
-
try {
|
|
827
|
-
await initTeamState('team-delegation-skip', 't', 'executor', 1, cwd);
|
|
828
|
-
const t = await createTask('team-delegation-skip', {
|
|
829
|
-
subject: 'Review focused regression',
|
|
830
|
-
description: 'Audit one already-isolated failing test',
|
|
831
|
-
status: 'pending',
|
|
832
|
-
delegation: {
|
|
833
|
-
mode: 'auto',
|
|
834
|
-
required_parallel_probe: true,
|
|
835
|
-
skip_allowed_reason_required: true,
|
|
836
|
-
},
|
|
837
|
-
}, cwd);
|
|
838
|
-
const claim = await claimTask('team-delegation-skip', t.id, 'worker-1', t.version ?? 1, cwd);
|
|
839
|
-
assert.equal(claim.ok, true);
|
|
840
|
-
if (!claim.ok)
|
|
841
|
-
return;
|
|
842
|
-
const completed = await transitionTaskStatus('team-delegation-skip', t.id, 'in_progress', 'completed', claim.claimToken, cwd, {
|
|
843
|
-
result: [
|
|
844
|
-
'Verification:',
|
|
845
|
-
'PASS - focused regression',
|
|
846
|
-
'Subagent skip reason: task scope collapsed to one isolated assertion; spawning would duplicate serial verification',
|
|
847
|
-
].join('\n'),
|
|
848
|
-
});
|
|
849
|
-
assert.equal(completed.ok, true);
|
|
850
|
-
assert.equal(completed.task.delegation_compliance?.status, 'skipped');
|
|
851
|
-
}
|
|
852
|
-
finally {
|
|
853
|
-
await rm(cwd, { recursive: true, force: true });
|
|
854
|
-
}
|
|
855
|
-
});
|
|
856
|
-
it('transitionTaskStatus persists terminal result and error payloads', async () => {
|
|
857
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-transition-payload-'));
|
|
858
|
-
try {
|
|
859
|
-
await initTeamState('team-transition-payload', 't', 'executor', 1, cwd);
|
|
860
|
-
const completedTask = await createTask('team-transition-payload', { subject: 'done', description: 'd', status: 'pending' }, cwd);
|
|
861
|
-
const completedClaim = await claimTask('team-transition-payload', completedTask.id, 'worker-1', completedTask.version ?? 1, cwd);
|
|
862
|
-
assert.equal(completedClaim.ok, true);
|
|
863
|
-
if (!completedClaim.ok)
|
|
864
|
-
return;
|
|
865
|
-
const completedResult = 'Verification:\nPASS - bootstrap state exists';
|
|
866
|
-
const completedTransition = await transitionTaskStatus('team-transition-payload', completedTask.id, 'in_progress', 'completed', completedClaim.claimToken, cwd, { result: completedResult });
|
|
867
|
-
assert.equal(completedTransition.ok, true);
|
|
868
|
-
const completedReread = await readTask('team-transition-payload', completedTask.id, cwd);
|
|
869
|
-
assert.equal(completedReread?.result, completedResult);
|
|
870
|
-
assert.equal(completedReread?.error, undefined);
|
|
871
|
-
const failedTask = await createTask('team-transition-payload', { subject: 'fail', description: 'd', status: 'pending' }, cwd);
|
|
872
|
-
const failedClaim = await claimTask('team-transition-payload', failedTask.id, 'worker-1', failedTask.version ?? 1, cwd);
|
|
873
|
-
assert.equal(failedClaim.ok, true);
|
|
874
|
-
if (!failedClaim.ok)
|
|
875
|
-
return;
|
|
876
|
-
const failedError = 'Verification failed: missing bootstrap evidence';
|
|
877
|
-
const failedTransition = await transitionTaskStatus('team-transition-payload', failedTask.id, 'in_progress', 'failed', failedClaim.claimToken, cwd, { error: failedError });
|
|
878
|
-
assert.equal(failedTransition.ok, true);
|
|
879
|
-
const failedReread = await readTask('team-transition-payload', failedTask.id, cwd);
|
|
880
|
-
assert.equal(failedReread?.error, failedError);
|
|
881
|
-
assert.equal(failedReread?.result, undefined);
|
|
882
|
-
}
|
|
883
|
-
finally {
|
|
884
|
-
await rm(cwd, { recursive: true, force: true });
|
|
885
|
-
}
|
|
886
|
-
});
|
|
887
|
-
it('transitionTaskStatus appends task_failed event (not worker_stopped) when task fails', async () => {
|
|
888
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-failed-'));
|
|
889
|
-
try {
|
|
890
|
-
await initTeamState('team-failed', 't', 'executor', 1, cwd);
|
|
891
|
-
const t = await createTask('team-failed', { subject: 'a', description: 'd', status: 'pending' }, cwd);
|
|
892
|
-
const claim = await claimTask('team-failed', t.id, 'worker-1', t.version ?? 1, cwd);
|
|
893
|
-
assert.equal(claim.ok, true);
|
|
894
|
-
const token = claim.ok ? claim.claimToken : 'x';
|
|
895
|
-
const tr = await transitionTaskStatus('team-failed', t.id, 'in_progress', 'failed', token, cwd);
|
|
896
|
-
assert.equal(tr.ok, true);
|
|
897
|
-
const eventsPath = join(cwd, '.rcs', 'state', 'team', 'team-failed', 'events', 'events.ndjson');
|
|
898
|
-
const content = await readFile(eventsPath, 'utf-8');
|
|
899
|
-
assert.match(content, /\"type\":\"task_failed\"/);
|
|
900
|
-
assert.match(content, new RegExp(`\"task_id\":\"${t.id}\"`));
|
|
901
|
-
assert.doesNotMatch(content, /\"type\":\"worker_stopped\"/);
|
|
902
|
-
}
|
|
903
|
-
finally {
|
|
904
|
-
await rm(cwd, { recursive: true, force: true });
|
|
905
|
-
}
|
|
906
|
-
});
|
|
907
|
-
it('releaseTaskClaim reverts a claimed task back to pending under claim lock', async () => {
|
|
908
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-release-'));
|
|
909
|
-
try {
|
|
910
|
-
await initTeamState('team-release', 't', 'executor', 1, cwd);
|
|
911
|
-
const t = await createTask('team-release', { subject: 'a', description: 'd', status: 'pending' }, cwd);
|
|
912
|
-
const claim = await claimTask('team-release', t.id, 'worker-1', t.version ?? 1, cwd);
|
|
913
|
-
assert.equal(claim.ok, true);
|
|
914
|
-
if (!claim.ok)
|
|
915
|
-
return;
|
|
916
|
-
const released = await releaseTaskClaim('team-release', t.id, claim.claimToken, 'worker-1', cwd);
|
|
917
|
-
assert.equal(released.ok, true);
|
|
918
|
-
const reread = await readTask('team-release', t.id, cwd);
|
|
919
|
-
assert.equal(reread?.status, 'pending');
|
|
920
|
-
assert.equal(reread?.owner, undefined);
|
|
921
|
-
assert.equal(reread?.claim, undefined);
|
|
922
|
-
}
|
|
923
|
-
finally {
|
|
924
|
-
await rm(cwd, { recursive: true, force: true });
|
|
925
|
-
}
|
|
926
|
-
});
|
|
927
|
-
it('releaseTaskClaim returns claim_conflict when claim token changed, even for the owner', async () => {
|
|
928
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-release-owner-'));
|
|
929
|
-
try {
|
|
930
|
-
await initTeamState('team-release-owner', 't', 'executor', 1, cwd);
|
|
931
|
-
const t = await createTask('team-release-owner', { subject: 'a', description: 'd', status: 'pending' }, cwd);
|
|
932
|
-
const claim = await claimTask('team-release-owner', t.id, 'worker-1', t.version ?? 1, cwd);
|
|
933
|
-
assert.equal(claim.ok, true);
|
|
934
|
-
if (!claim.ok)
|
|
935
|
-
return;
|
|
936
|
-
// Simulate token drift while ownership/status remain in_progress.
|
|
937
|
-
const taskPath = join(cwd, '.rcs', 'state', 'team', 'team-release-owner', 'tasks', `task-${t.id}.json`);
|
|
938
|
-
const current = JSON.parse(await readFile(taskPath, 'utf-8'));
|
|
939
|
-
current.claim.token = 'different-token';
|
|
940
|
-
await writeFile(taskPath, JSON.stringify(current, null, 2));
|
|
941
|
-
const released = await releaseTaskClaim('team-release-owner', t.id, claim.claimToken, 'worker-1', cwd);
|
|
942
|
-
assert.equal(released.ok, false);
|
|
943
|
-
assert.equal(released.ok ? 'x' : released.error, 'claim_conflict');
|
|
944
|
-
}
|
|
945
|
-
finally {
|
|
946
|
-
await rm(cwd, { recursive: true, force: true });
|
|
947
|
-
}
|
|
948
|
-
});
|
|
949
|
-
it('releaseTaskClaim on a completed task returns already_terminal and does not reopen it', async () => {
|
|
950
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-release-terminal-'));
|
|
951
|
-
try {
|
|
952
|
-
await initTeamState('team-release-terminal', 't', 'executor', 1, cwd);
|
|
953
|
-
const t = await createTask('team-release-terminal', { subject: 'a', description: 'd', status: 'pending' }, cwd);
|
|
954
|
-
const claim = await claimTask('team-release-terminal', t.id, 'worker-1', t.version ?? 1, cwd);
|
|
955
|
-
assert.equal(claim.ok, true);
|
|
956
|
-
if (!claim.ok)
|
|
957
|
-
return;
|
|
958
|
-
const tr = await transitionTaskStatus('team-release-terminal', t.id, 'in_progress', 'completed', claim.claimToken, cwd);
|
|
959
|
-
assert.equal(tr.ok, true);
|
|
960
|
-
// Verify claim was stripped on completion
|
|
961
|
-
const afterComplete = await readTask('team-release-terminal', t.id, cwd);
|
|
962
|
-
assert.equal(afterComplete?.status, 'completed');
|
|
963
|
-
assert.equal(afterComplete?.claim, undefined);
|
|
964
|
-
// Attempt to release the claim of a completed task — must be rejected
|
|
965
|
-
const released = await releaseTaskClaim('team-release-terminal', t.id, claim.claimToken, 'worker-1', cwd);
|
|
966
|
-
assert.equal(released.ok, false);
|
|
967
|
-
assert.equal(released.ok ? 'x' : released.error, 'already_terminal');
|
|
968
|
-
// Task must remain completed, not reopened
|
|
969
|
-
const reread = await readTask('team-release-terminal', t.id, cwd);
|
|
970
|
-
assert.equal(reread?.status, 'completed');
|
|
971
|
-
}
|
|
972
|
-
finally {
|
|
973
|
-
await rm(cwd, { recursive: true, force: true });
|
|
974
|
-
}
|
|
975
|
-
});
|
|
976
|
-
it('transitionTaskStatus returns lease_expired when claim lease has passed', async () => {
|
|
977
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-lease-trans-'));
|
|
978
|
-
try {
|
|
979
|
-
await initTeamState('team-lease-trans', 't', 'executor', 1, cwd);
|
|
980
|
-
const t = await createTask('team-lease-trans', { subject: 'a', description: 'd', status: 'pending' }, cwd);
|
|
981
|
-
const claim = await claimTask('team-lease-trans', t.id, 'worker-1', t.version ?? 1, cwd);
|
|
982
|
-
assert.equal(claim.ok, true);
|
|
983
|
-
if (!claim.ok)
|
|
984
|
-
return;
|
|
985
|
-
// Backdate leased_until to the past to simulate expiry.
|
|
986
|
-
const taskPath = join(cwd, '.rcs', 'state', 'team', 'team-lease-trans', 'tasks', `task-${t.id}.json`);
|
|
987
|
-
const current = JSON.parse(await readFile(taskPath, 'utf-8'));
|
|
988
|
-
current.claim.leased_until = new Date(Date.now() - 1000).toISOString();
|
|
989
|
-
await writeFile(taskPath, JSON.stringify(current, null, 2));
|
|
990
|
-
const result = await transitionTaskStatus('team-lease-trans', t.id, 'in_progress', 'completed', claim.claimToken, cwd);
|
|
991
|
-
assert.equal(result.ok, false);
|
|
992
|
-
assert.equal(result.ok ? 'x' : result.error, 'lease_expired');
|
|
993
|
-
}
|
|
994
|
-
finally {
|
|
995
|
-
await rm(cwd, { recursive: true, force: true });
|
|
996
|
-
}
|
|
997
|
-
});
|
|
998
|
-
it('releaseTaskClaim on a failed task returns already_terminal and does not reopen it', async () => {
|
|
999
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-release-failed-'));
|
|
1000
|
-
try {
|
|
1001
|
-
await initTeamState('team-release-failed', 't', 'executor', 1, cwd);
|
|
1002
|
-
const t = await createTask('team-release-failed', { subject: 'a', description: 'd', status: 'pending' }, cwd);
|
|
1003
|
-
const claim = await claimTask('team-release-failed', t.id, 'worker-1', t.version ?? 1, cwd);
|
|
1004
|
-
assert.equal(claim.ok, true);
|
|
1005
|
-
if (!claim.ok)
|
|
1006
|
-
return;
|
|
1007
|
-
const tr = await transitionTaskStatus('team-release-failed', t.id, 'in_progress', 'failed', claim.claimToken, cwd);
|
|
1008
|
-
assert.equal(tr.ok, true);
|
|
1009
|
-
const released = await releaseTaskClaim('team-release-failed', t.id, claim.claimToken, 'worker-1', cwd);
|
|
1010
|
-
assert.equal(released.ok, false);
|
|
1011
|
-
assert.equal(released.ok ? 'x' : released.error, 'already_terminal');
|
|
1012
|
-
const reread = await readTask('team-release-failed', t.id, cwd);
|
|
1013
|
-
assert.equal(reread?.status, 'failed');
|
|
1014
|
-
}
|
|
1015
|
-
finally {
|
|
1016
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1017
|
-
}
|
|
1018
|
-
});
|
|
1019
|
-
it('releaseTaskClaim returns lease_expired when lease has expired and caller is not the owner', async () => {
|
|
1020
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-lease-release-'));
|
|
1021
|
-
try {
|
|
1022
|
-
await initTeamState('team-lease-release', 't', 'executor', 1, cwd);
|
|
1023
|
-
const t = await createTask('team-lease-release', { subject: 'a', description: 'd', status: 'pending' }, cwd);
|
|
1024
|
-
const claim = await claimTask('team-lease-release', t.id, 'worker-1', t.version ?? 1, cwd);
|
|
1025
|
-
assert.equal(claim.ok, true);
|
|
1026
|
-
if (!claim.ok)
|
|
1027
|
-
return;
|
|
1028
|
-
// Backdate leased_until and change owner so ownerMatches is also false.
|
|
1029
|
-
const taskPath = join(cwd, '.rcs', 'state', 'team', 'team-lease-release', 'tasks', `task-${t.id}.json`);
|
|
1030
|
-
const current = JSON.parse(await readFile(taskPath, 'utf-8'));
|
|
1031
|
-
current.claim.leased_until = new Date(Date.now() - 1000).toISOString();
|
|
1032
|
-
await writeFile(taskPath, JSON.stringify(current, null, 2));
|
|
1033
|
-
// Different worker tries to release with the expired token.
|
|
1034
|
-
const result = await releaseTaskClaim('team-lease-release', t.id, claim.claimToken, 'worker-2', cwd);
|
|
1035
|
-
assert.equal(result.ok, false);
|
|
1036
|
-
assert.equal(result.ok ? 'x' : result.error, 'lease_expired');
|
|
1037
|
-
}
|
|
1038
|
-
finally {
|
|
1039
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1040
|
-
}
|
|
1041
|
-
});
|
|
1042
|
-
it('releaseTaskClaim returns lease_expired when lease has expired, even for the owner', async () => {
|
|
1043
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-lease-release-owner-'));
|
|
1044
|
-
try {
|
|
1045
|
-
await initTeamState('team-lease-release-owner', 't', 'executor', 1, cwd);
|
|
1046
|
-
const t = await createTask('team-lease-release-owner', { subject: 'a', description: 'd', status: 'pending' }, cwd);
|
|
1047
|
-
const claim = await claimTask('team-lease-release-owner', t.id, 'worker-1', t.version ?? 1, cwd);
|
|
1048
|
-
assert.equal(claim.ok, true);
|
|
1049
|
-
if (!claim.ok)
|
|
1050
|
-
return;
|
|
1051
|
-
// Backdate leased_until so the claim token is no longer valid.
|
|
1052
|
-
const taskPath = join(cwd, '.rcs', 'state', 'team', 'team-lease-release-owner', 'tasks', `task-${t.id}.json`);
|
|
1053
|
-
const current = JSON.parse(await readFile(taskPath, 'utf-8'));
|
|
1054
|
-
current.claim.leased_until = new Date(Date.now() - 1000).toISOString();
|
|
1055
|
-
await writeFile(taskPath, JSON.stringify(current, null, 2));
|
|
1056
|
-
// Same worker releases — should now fail because owner-only bypass is removed.
|
|
1057
|
-
const result = await releaseTaskClaim('team-lease-release-owner', t.id, claim.claimToken, 'worker-1', cwd);
|
|
1058
|
-
assert.equal(result.ok, false);
|
|
1059
|
-
assert.equal(result.ok ? 'x' : result.error, 'lease_expired');
|
|
1060
|
-
}
|
|
1061
|
-
finally {
|
|
1062
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1063
|
-
}
|
|
1064
|
-
});
|
|
1065
|
-
it('reclaimExpiredTaskClaim reopens an expired in-progress task so another worker can claim it', async () => {
|
|
1066
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-reclaim-expired-'));
|
|
1067
|
-
try {
|
|
1068
|
-
await initTeamState('team-reclaim-expired', 't', 'executor', 2, cwd);
|
|
1069
|
-
const t = await createTask('team-reclaim-expired', { subject: 'a', description: 'd', status: 'pending' }, cwd);
|
|
1070
|
-
const claim = await claimTask('team-reclaim-expired', t.id, 'worker-1', t.version ?? 1, cwd);
|
|
1071
|
-
assert.equal(claim.ok, true);
|
|
1072
|
-
if (!claim.ok)
|
|
1073
|
-
return;
|
|
1074
|
-
const taskPath = join(cwd, '.rcs', 'state', 'team', 'team-reclaim-expired', 'tasks', `task-${t.id}.json`);
|
|
1075
|
-
const current = JSON.parse(await readFile(taskPath, 'utf-8'));
|
|
1076
|
-
current.claim.leased_until = new Date(Date.now() - 1000).toISOString();
|
|
1077
|
-
await writeFile(taskPath, JSON.stringify(current, null, 2));
|
|
1078
|
-
const reclaimed = await reclaimExpiredTaskClaim('team-reclaim-expired', t.id, cwd);
|
|
1079
|
-
assert.equal(reclaimed.ok, true);
|
|
1080
|
-
if (!reclaimed.ok)
|
|
1081
|
-
return;
|
|
1082
|
-
assert.equal(reclaimed.reclaimed, true);
|
|
1083
|
-
assert.equal(reclaimed.task.status, 'pending');
|
|
1084
|
-
assert.equal(reclaimed.task.claim, undefined);
|
|
1085
|
-
const secondClaim = await claimTask('team-reclaim-expired', t.id, 'worker-2', reclaimed.task.version ?? null, cwd);
|
|
1086
|
-
assert.equal(secondClaim.ok, true);
|
|
1087
|
-
}
|
|
1088
|
-
finally {
|
|
1089
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1090
|
-
}
|
|
1091
|
-
});
|
|
1092
|
-
it('mailbox APIs: DM, broadcast, and mark delivered', async () => {
|
|
1093
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-mailbox-'));
|
|
1094
|
-
try {
|
|
1095
|
-
await initTeamState('team-msg', 't', 'executor', 2, cwd);
|
|
1096
|
-
const dm = await sendDirectMessage('team-msg', 'worker-1', 'worker-2', 'hello', cwd);
|
|
1097
|
-
assert.equal(dm.to_worker, 'worker-2');
|
|
1098
|
-
const delivered = await markMessageDelivered('team-msg', 'worker-2', dm.message_id, cwd);
|
|
1099
|
-
assert.equal(delivered, true);
|
|
1100
|
-
const b = await broadcastMessage('team-msg', 'worker-1', 'all', cwd);
|
|
1101
|
-
assert.equal(b.length, 1);
|
|
1102
|
-
assert.equal(b[0]?.to_worker, 'worker-2');
|
|
1103
|
-
const mailboxDisk = await readFile(join(cwd, '.rcs', 'state', 'team', 'team-msg', 'mailbox', 'worker-2.json'), 'utf8');
|
|
1104
|
-
const parsed = JSON.parse(mailboxDisk);
|
|
1105
|
-
assert.ok(parsed.messages.some((m) => typeof m.delivered_at === 'string'));
|
|
1106
|
-
}
|
|
1107
|
-
finally {
|
|
1108
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1109
|
-
}
|
|
1110
|
-
});
|
|
1111
|
-
it('uses bridge-authored mailbox records while shadowing legacy mailbox bodies for recovery', async () => {
|
|
1112
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-mailbox-bridge-authority-'));
|
|
1113
|
-
const previousRuntimeBinary = process.env.RCS_RUNTIME_BINARY;
|
|
1114
|
-
try {
|
|
1115
|
-
await initTeamState('team-mailbox-bridge-authority', 't', 'executor', 2, cwd);
|
|
1116
|
-
const fakeBinDir = join(cwd, 'fake-bin');
|
|
1117
|
-
const runtimeLogPath = join(cwd, 'runtime.log');
|
|
1118
|
-
await mkdir(fakeBinDir, { recursive: true });
|
|
1119
|
-
await writeCompatRuntimeFixture(join(fakeBinDir, 'rcs-runtime'), runtimeLogPath);
|
|
1120
|
-
process.env.RCS_RUNTIME_BINARY = join(fakeBinDir, 'rcs-runtime');
|
|
1121
|
-
const legacyPath = join(cwd, '.rcs', 'state', 'team', 'team-mailbox-bridge-authority', 'mailbox', 'worker-2.json');
|
|
1122
|
-
assert.equal(existsSync(legacyPath), false);
|
|
1123
|
-
const message = await sendDirectMessage('team-mailbox-bridge-authority', 'worker-1', 'worker-2', 'hello', cwd);
|
|
1124
|
-
assert.equal(message.to_worker, 'worker-2');
|
|
1125
|
-
await markMessageNotified('team-mailbox-bridge-authority', 'worker-2', message.message_id, cwd);
|
|
1126
|
-
await markMessageDelivered('team-mailbox-bridge-authority', 'worker-2', message.message_id, cwd);
|
|
1127
|
-
const messages = await listMailboxMessages('team-mailbox-bridge-authority', 'worker-2', cwd);
|
|
1128
|
-
assert.equal(messages.length, 1);
|
|
1129
|
-
assert.equal(messages[0]?.message_id, message.message_id);
|
|
1130
|
-
assert.equal(messages[0]?.body, 'hello');
|
|
1131
|
-
assert.equal(typeof messages[0]?.notified_at, 'string');
|
|
1132
|
-
assert.equal(typeof messages[0]?.delivered_at, 'string');
|
|
1133
|
-
assert.equal(existsSync(legacyPath), true, 'bridge-success path should shadow-write legacy mailbox JSON for body recovery');
|
|
1134
|
-
const after = JSON.parse(await readFile(legacyPath, 'utf8'));
|
|
1135
|
-
assert.equal(after.messages.length, 1);
|
|
1136
|
-
assert.equal(after.messages[0]?.message_id, message.message_id);
|
|
1137
|
-
assert.equal(after.messages[0]?.body, 'hello');
|
|
1138
|
-
const compatPath = join(cwd, '.rcs', 'state', 'mailbox.json');
|
|
1139
|
-
const compat = JSON.parse(await readFile(compatPath, 'utf8'));
|
|
1140
|
-
const compatRecord = compat.records.find((entry) => entry.message_id === message.message_id);
|
|
1141
|
-
assert.ok(compatRecord);
|
|
1142
|
-
const runtimeLogBefore = await readFile(runtimeLogPath, 'utf8');
|
|
1143
|
-
const deliveredCallsBefore = runtimeLogBefore.split('MarkMailboxDelivered').length - 1;
|
|
1144
|
-
const deliveredAgain = await markMessageDelivered('team-mailbox-bridge-authority', 'worker-2', message.message_id, cwd);
|
|
1145
|
-
assert.equal(deliveredAgain, true, 'already-delivered bridge message should be treated as delivered');
|
|
1146
|
-
const runtimeLogAfter = await readFile(runtimeLogPath, 'utf8');
|
|
1147
|
-
const deliveredCallsAfter = runtimeLogAfter.split('MarkMailboxDelivered').length - 1;
|
|
1148
|
-
assert.equal(deliveredCallsAfter, deliveredCallsBefore, 'idempotent delivered calls should not invoke bridge a second time');
|
|
1149
|
-
compatRecord.body = '';
|
|
1150
|
-
await writeFile(compatPath, JSON.stringify(compat, null, 2));
|
|
1151
|
-
const recovered = await listMailboxMessages('team-mailbox-bridge-authority', 'worker-2', cwd);
|
|
1152
|
-
assert.equal(recovered.length, 1);
|
|
1153
|
-
assert.equal(recovered[0]?.body, 'hello', 'legacy shadow mailbox should backfill blank compat bodies');
|
|
1154
|
-
}
|
|
1155
|
-
finally {
|
|
1156
|
-
if (typeof previousRuntimeBinary === 'string')
|
|
1157
|
-
process.env.RCS_RUNTIME_BINARY = previousRuntimeBinary;
|
|
1158
|
-
else
|
|
1159
|
-
delete process.env.RCS_RUNTIME_BINARY;
|
|
1160
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1161
|
-
}
|
|
1162
|
-
});
|
|
1163
|
-
it('sendDirectMessage recreates mailbox directory when missing', async () => {
|
|
1164
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-mailbox-'));
|
|
1165
|
-
try {
|
|
1166
|
-
await initTeamState('team-msg-recreate-mailbox', 't', 'executor', 2, cwd);
|
|
1167
|
-
await rm(join(cwd, '.rcs', 'state', 'team', 'team-msg-recreate-mailbox', 'mailbox'), {
|
|
1168
|
-
recursive: true,
|
|
1169
|
-
force: true,
|
|
1170
|
-
});
|
|
1171
|
-
const dm = await sendDirectMessage('team-msg-recreate-mailbox', 'worker-1', 'worker-2', 'hello', cwd);
|
|
1172
|
-
assert.equal(dm.to_worker, 'worker-2');
|
|
1173
|
-
assert.equal(existsSync(join(cwd, '.rcs', 'state', 'team', 'team-msg-recreate-mailbox', 'mailbox', 'worker-2.json')), true);
|
|
1174
|
-
}
|
|
1175
|
-
finally {
|
|
1176
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1177
|
-
}
|
|
1178
|
-
});
|
|
1179
|
-
it('sendDirectMessage throws team not found after team cleanup', async () => {
|
|
1180
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-mailbox-'));
|
|
1181
|
-
try {
|
|
1182
|
-
await initTeamState('team-msg-missing-team', 't', 'executor', 2, cwd);
|
|
1183
|
-
await rm(join(cwd, '.rcs', 'state', 'team', 'team-msg-missing-team'), {
|
|
1184
|
-
recursive: true,
|
|
1185
|
-
force: true,
|
|
1186
|
-
});
|
|
1187
|
-
await assert.rejects(() => sendDirectMessage('team-msg-missing-team', 'worker-1', 'worker-2', 'hello', cwd), /Team team-msg-missing-team not found/);
|
|
1188
|
-
}
|
|
1189
|
-
finally {
|
|
1190
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1191
|
-
}
|
|
1192
|
-
});
|
|
1193
|
-
it('markMessageNotified stores notified_at without forcing delivered_at', async () => {
|
|
1194
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-mailbox-'));
|
|
1195
|
-
try {
|
|
1196
|
-
await initTeamState('team-msg-notify', 't', 'executor', 2, cwd);
|
|
1197
|
-
const dm = await sendDirectMessage('team-msg-notify', 'worker-1', 'worker-2', 'hello', cwd);
|
|
1198
|
-
const marked = await markMessageNotified('team-msg-notify', 'worker-2', dm.message_id, cwd);
|
|
1199
|
-
assert.equal(marked, true);
|
|
1200
|
-
const msgs = await listMailboxMessages('team-msg-notify', 'worker-2', cwd);
|
|
1201
|
-
const msg = msgs.find((m) => m.message_id === dm.message_id);
|
|
1202
|
-
assert.ok(msg);
|
|
1203
|
-
assert.equal(typeof msg?.notified_at, 'string');
|
|
1204
|
-
assert.equal(msg?.delivered_at, undefined);
|
|
1205
|
-
}
|
|
1206
|
-
finally {
|
|
1207
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1208
|
-
}
|
|
1209
|
-
});
|
|
1210
|
-
it('mailbox does not lose messages under concurrent sends', async () => {
|
|
1211
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-mailbox-'));
|
|
1212
|
-
try {
|
|
1213
|
-
await initTeamState('team-msg-concurrent', 't', 'executor', 3, cwd);
|
|
1214
|
-
const sends = Array.from({ length: 25 }, (_, idx) => sendDirectMessage('team-msg-concurrent', 'worker-1', 'worker-2', `hello-${idx}`, cwd));
|
|
1215
|
-
const delivered = await Promise.all(sends);
|
|
1216
|
-
const expectedIds = new Set(delivered.map((m) => m.message_id));
|
|
1217
|
-
assert.equal(expectedIds.size, 25);
|
|
1218
|
-
const mailbox = await listMailboxMessages('team-msg-concurrent', 'worker-2', cwd);
|
|
1219
|
-
const actualIds = new Set(mailbox.map((m) => m.message_id));
|
|
1220
|
-
for (const id of expectedIds) {
|
|
1221
|
-
assert.equal(actualIds.has(id), true);
|
|
1222
|
-
}
|
|
1223
|
-
}
|
|
1224
|
-
finally {
|
|
1225
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1226
|
-
}
|
|
1227
|
-
});
|
|
1228
|
-
it('sendDirectMessage reuses identical undelivered messages instead of appending duplicates', async () => {
|
|
1229
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-mailbox-'));
|
|
1230
|
-
try {
|
|
1231
|
-
await initTeamState('team-msg-dedupe', 't', 'executor', 2, cwd);
|
|
1232
|
-
const first = await sendDirectMessage('team-msg-dedupe', 'worker-1', 'leader-fixed', 'same-body', cwd);
|
|
1233
|
-
const second = await sendDirectMessage('team-msg-dedupe', 'worker-1', 'leader-fixed', 'same-body', cwd);
|
|
1234
|
-
assert.equal(second.message_id, first.message_id);
|
|
1235
|
-
const mailbox = await listMailboxMessages('team-msg-dedupe', 'leader-fixed', cwd);
|
|
1236
|
-
assert.equal(mailbox.length, 1);
|
|
1237
|
-
assert.equal(mailbox[0]?.body, 'same-body');
|
|
1238
|
-
const delivered = await markMessageDelivered('team-msg-dedupe', 'leader-fixed', first.message_id, cwd);
|
|
1239
|
-
assert.equal(delivered, true);
|
|
1240
|
-
const third = await sendDirectMessage('team-msg-dedupe', 'worker-1', 'leader-fixed', 'same-body', cwd);
|
|
1241
|
-
assert.notEqual(third.message_id, first.message_id);
|
|
1242
|
-
const mailboxAfter = await listMailboxMessages('team-msg-dedupe', 'leader-fixed', cwd);
|
|
1243
|
-
assert.equal(mailboxAfter.length, 2);
|
|
1244
|
-
}
|
|
1245
|
-
finally {
|
|
1246
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1247
|
-
}
|
|
1248
|
-
});
|
|
1249
|
-
it('writeTaskApproval writes record and emits approval_decision event', async () => {
|
|
1250
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-approval-'));
|
|
1251
|
-
try {
|
|
1252
|
-
await initTeamState('team-approval-record', 't', 'executor', 1, cwd);
|
|
1253
|
-
const t = await createTask('team-approval-record', { subject: 'a', description: 'd', status: 'pending' }, cwd);
|
|
1254
|
-
await writeTaskApproval('team-approval-record', {
|
|
1255
|
-
task_id: t.id,
|
|
1256
|
-
required: true,
|
|
1257
|
-
status: 'approved',
|
|
1258
|
-
reviewer: 'leader-fixed',
|
|
1259
|
-
decision_reason: 'ok',
|
|
1260
|
-
decided_at: new Date().toISOString(),
|
|
1261
|
-
}, cwd);
|
|
1262
|
-
const reread = await readTaskApproval('team-approval-record', t.id, cwd);
|
|
1263
|
-
assert.ok(reread);
|
|
1264
|
-
assert.equal(reread?.status, 'approved');
|
|
1265
|
-
const eventsPath = join(cwd, '.rcs', 'state', 'team', 'team-approval-record', 'events', 'events.ndjson');
|
|
1266
|
-
const content = await readFile(eventsPath, 'utf-8');
|
|
1267
|
-
assert.match(content, /\"type\":\"approval_decision\"/);
|
|
1268
|
-
assert.match(content, new RegExp(`\"task_id\":\"${t.id}\"`));
|
|
1269
|
-
}
|
|
1270
|
-
finally {
|
|
1271
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1272
|
-
}
|
|
1273
|
-
});
|
|
1274
|
-
it('initTeamState rejects workerCount > max_workers', async () => {
|
|
1275
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-state-'));
|
|
1276
|
-
try {
|
|
1277
|
-
await assert.rejects(() => initTeamState('team-2', 't', 'executor', DEFAULT_MAX_WORKERS + 1, cwd, DEFAULT_MAX_WORKERS), /exceeds maxWorkers/);
|
|
1278
|
-
}
|
|
1279
|
-
finally {
|
|
1280
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1281
|
-
}
|
|
1282
|
-
});
|
|
1283
|
-
it('initTeamState rejects maxWorkers > ABSOLUTE_MAX_WORKERS', async () => {
|
|
1284
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-state-'));
|
|
1285
|
-
try {
|
|
1286
|
-
await assert.rejects(() => initTeamState('team-abs', 't', 'executor', 1, cwd, ABSOLUTE_MAX_WORKERS + 1), /exceeds ABSOLUTE_MAX_WORKERS/);
|
|
1287
|
-
}
|
|
1288
|
-
finally {
|
|
1289
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1290
|
-
}
|
|
1291
|
-
});
|
|
1292
|
-
it('createTask auto-increments IDs', async () => {
|
|
1293
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-state-'));
|
|
1294
|
-
try {
|
|
1295
|
-
await initTeamState('team-3', 't', 'executor', 1, cwd);
|
|
1296
|
-
const t1 = await createTask('team-3', { subject: 'a', description: 'd', status: 'pending' }, cwd);
|
|
1297
|
-
const t2 = await createTask('team-3', { subject: 'b', description: 'd', status: 'pending' }, cwd);
|
|
1298
|
-
assert.equal(t1.id, '1');
|
|
1299
|
-
assert.equal(t2.id, '2');
|
|
1300
|
-
}
|
|
1301
|
-
finally {
|
|
1302
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1303
|
-
}
|
|
1304
|
-
});
|
|
1305
|
-
it('createTask does not overwrite existing tasks when config next_task_id is missing (legacy)', async () => {
|
|
1306
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-state-'));
|
|
1307
|
-
try {
|
|
1308
|
-
await initTeamState('team-legacy', 't', 'executor', 1, cwd);
|
|
1309
|
-
// Simulate legacy config by removing next_task_id field.
|
|
1310
|
-
const configPath = join(cwd, '.rcs', 'state', 'team', 'team-legacy', 'config.json');
|
|
1311
|
-
const cfg = JSON.parse(readFileSync(configPath, 'utf8'));
|
|
1312
|
-
delete cfg.next_task_id;
|
|
1313
|
-
await writeAtomic(configPath, JSON.stringify(cfg, null, 2));
|
|
1314
|
-
// Create an existing task-1.json, then create another task; it must get id=2.
|
|
1315
|
-
const t1 = await createTask('team-legacy', { subject: 'a', description: 'd', status: 'pending' }, cwd);
|
|
1316
|
-
assert.equal(t1.id, '1');
|
|
1317
|
-
// Remove next_task_id again to simulate older config still missing field.
|
|
1318
|
-
const cfg2 = JSON.parse(readFileSync(configPath, 'utf8'));
|
|
1319
|
-
delete cfg2.next_task_id;
|
|
1320
|
-
await writeAtomic(configPath, JSON.stringify(cfg2, null, 2));
|
|
1321
|
-
const t2 = await createTask('team-legacy', { subject: 'b', description: 'd', status: 'pending' }, cwd);
|
|
1322
|
-
assert.equal(t2.id, '2');
|
|
1323
|
-
}
|
|
1324
|
-
finally {
|
|
1325
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1326
|
-
}
|
|
1327
|
-
});
|
|
1328
|
-
it('createTask does not overwrite existing tasks when manifest/config next_task_id lags disk', async () => {
|
|
1329
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-state-'));
|
|
1330
|
-
try {
|
|
1331
|
-
await initTeamState('team-stale-next-id', 't', 'executor', 1, cwd);
|
|
1332
|
-
const first = await createTask('team-stale-next-id', { subject: 'first', description: 'd', status: 'pending' }, cwd);
|
|
1333
|
-
assert.equal(first.id, '1');
|
|
1334
|
-
const teamRoot = join(cwd, '.rcs', 'state', 'team', 'team-stale-next-id');
|
|
1335
|
-
const configPath = join(teamRoot, 'config.json');
|
|
1336
|
-
const manifestPath = join(teamRoot, 'manifest.v2.json');
|
|
1337
|
-
const config = JSON.parse(readFileSync(configPath, 'utf8'));
|
|
1338
|
-
config.next_task_id = 1;
|
|
1339
|
-
await writeAtomic(configPath, JSON.stringify(config, null, 2));
|
|
1340
|
-
const manifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
|
|
1341
|
-
manifest.next_task_id = 1;
|
|
1342
|
-
await writeAtomic(manifestPath, JSON.stringify(manifest, null, 2));
|
|
1343
|
-
const second = await createTask('team-stale-next-id', { subject: 'second', description: 'd', status: 'pending' }, cwd);
|
|
1344
|
-
assert.equal(second.id, '2');
|
|
1345
|
-
const firstTask = JSON.parse(await readFile(join(teamRoot, 'tasks', 'task-1.json'), 'utf8'));
|
|
1346
|
-
const secondTask = JSON.parse(await readFile(join(teamRoot, 'tasks', 'task-2.json'), 'utf8'));
|
|
1347
|
-
assert.equal(firstTask.subject, 'first');
|
|
1348
|
-
assert.equal(secondTask.subject, 'second');
|
|
1349
|
-
}
|
|
1350
|
-
finally {
|
|
1351
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1352
|
-
}
|
|
1353
|
-
});
|
|
1354
|
-
it('listTasks returns sorted by ID', async () => {
|
|
1355
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-state-'));
|
|
1356
|
-
try {
|
|
1357
|
-
await initTeamState('team-4', 't', 'executor', 1, cwd);
|
|
1358
|
-
await createTask('team-4', { subject: 'a', description: 'd', status: 'pending' }, cwd);
|
|
1359
|
-
await createTask('team-4', { subject: 'b', description: 'd', status: 'pending' }, cwd);
|
|
1360
|
-
await createTask('team-4', { subject: 'c', description: 'd', status: 'pending' }, cwd);
|
|
1361
|
-
const tasks = await listTasks('team-4', cwd);
|
|
1362
|
-
assert.deepEqual(tasks.map((t) => t.id), ['1', '2', '3']);
|
|
1363
|
-
}
|
|
1364
|
-
finally {
|
|
1365
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1366
|
-
}
|
|
1367
|
-
});
|
|
1368
|
-
it('listTasks reads task files in parallel', async () => {
|
|
1369
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-list-parallel-'));
|
|
1370
|
-
try {
|
|
1371
|
-
await initTeamState('team-parallel', 't', 'executor', 1, cwd);
|
|
1372
|
-
const N = 20;
|
|
1373
|
-
for (let i = 0; i < N; i++) {
|
|
1374
|
-
await createTask('team-parallel', { subject: `task-${i}`, description: 'd', status: 'pending' }, cwd);
|
|
1375
|
-
}
|
|
1376
|
-
const tasks = await listTasks('team-parallel', cwd);
|
|
1377
|
-
assert.equal(tasks.length, N);
|
|
1378
|
-
// IDs should be consecutive strings '1'..'N' in sorted order
|
|
1379
|
-
const ids = tasks.map((t) => t.id);
|
|
1380
|
-
assert.deepEqual(ids, Array.from({ length: N }, (_, i) => String(i + 1)));
|
|
1381
|
-
}
|
|
1382
|
-
finally {
|
|
1383
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1384
|
-
}
|
|
1385
|
-
});
|
|
1386
|
-
it('listTasks ignores malformed and id-mismatched task payloads', async () => {
|
|
1387
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-list-validate-'));
|
|
1388
|
-
try {
|
|
1389
|
-
await initTeamState('team-list-validate', 't', 'executor', 1, cwd);
|
|
1390
|
-
await createTask('team-list-validate', { subject: 'ok', description: 'd', status: 'pending' }, cwd);
|
|
1391
|
-
// Internal payload id mismatches filename id -> should be ignored.
|
|
1392
|
-
await writeFile(join(cwd, '.rcs', 'state', 'team', 'team-list-validate', 'tasks', 'task-2.json'), JSON.stringify({
|
|
1393
|
-
id: '999',
|
|
1394
|
-
subject: 'mismatch',
|
|
1395
|
-
description: 'bad',
|
|
1396
|
-
status: 'pending',
|
|
1397
|
-
created_at: new Date().toISOString(),
|
|
1398
|
-
}, null, 2));
|
|
1399
|
-
// Malformed payload -> should be ignored.
|
|
1400
|
-
await writeFile(join(cwd, '.rcs', 'state', 'team', 'team-list-validate', 'tasks', 'task-3.json'), JSON.stringify({ nope: true }, null, 2));
|
|
1401
|
-
const tasks = await listTasks('team-list-validate', cwd);
|
|
1402
|
-
assert.equal(tasks.length, 1);
|
|
1403
|
-
assert.equal(tasks[0].id, '1');
|
|
1404
|
-
}
|
|
1405
|
-
finally {
|
|
1406
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1407
|
-
}
|
|
1408
|
-
});
|
|
1409
|
-
it('readTask returns null for non-existent task', async () => {
|
|
1410
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-state-'));
|
|
1411
|
-
try {
|
|
1412
|
-
await initTeamState('team-5', 't', 'executor', 1, cwd);
|
|
1413
|
-
const task = await readTask('team-5', '999', cwd);
|
|
1414
|
-
assert.equal(task, null);
|
|
1415
|
-
}
|
|
1416
|
-
finally {
|
|
1417
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1418
|
-
}
|
|
1419
|
-
});
|
|
1420
|
-
it('readTask returns null for malformed JSON', async () => {
|
|
1421
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-state-'));
|
|
1422
|
-
try {
|
|
1423
|
-
await initTeamState('team-6', 't', 'executor', 1, cwd);
|
|
1424
|
-
const badPath = join(cwd, '.rcs', 'state', 'team', 'team-6', 'tasks', 'task-1.json');
|
|
1425
|
-
await writeFile(badPath, '{not json', 'utf8');
|
|
1426
|
-
const task = await readTask('team-6', '1', cwd);
|
|
1427
|
-
assert.equal(task, null);
|
|
1428
|
-
}
|
|
1429
|
-
finally {
|
|
1430
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1431
|
-
}
|
|
1432
|
-
});
|
|
1433
|
-
it('updateTask merges updates correctly', async () => {
|
|
1434
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-state-'));
|
|
1435
|
-
try {
|
|
1436
|
-
await initTeamState('team-7', 't', 'executor', 1, cwd);
|
|
1437
|
-
const created = await createTask('team-7', { subject: 's', description: 'd', status: 'pending', owner: undefined }, cwd);
|
|
1438
|
-
const updated = await updateTask('team-7', created.id, { status: 'completed', owner: 'worker-1', result: 'done', completed_at: new Date().toISOString() }, cwd);
|
|
1439
|
-
assert.ok(updated);
|
|
1440
|
-
assert.equal(updated?.id, created.id);
|
|
1441
|
-
assert.equal(updated?.status, 'completed');
|
|
1442
|
-
assert.equal(updated?.owner, 'worker-1');
|
|
1443
|
-
assert.equal(updated?.result, 'done');
|
|
1444
|
-
const reread = await readTask('team-7', created.id, cwd);
|
|
1445
|
-
assert.equal(reread?.status, 'completed');
|
|
1446
|
-
assert.equal(reread?.owner, 'worker-1');
|
|
1447
|
-
}
|
|
1448
|
-
finally {
|
|
1449
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1450
|
-
}
|
|
1451
|
-
});
|
|
1452
|
-
it('updateTask rejects empty string status and leaves task readable', async () => {
|
|
1453
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-state-'));
|
|
1454
|
-
try {
|
|
1455
|
-
await initTeamState('team-upd-empty-status', 't', 'executor', 1, cwd);
|
|
1456
|
-
const created = await createTask('team-upd-empty-status', { subject: 's', description: 'd', status: 'pending' }, cwd);
|
|
1457
|
-
await assert.rejects(() => updateTask('team-upd-empty-status', created.id, { status: '' }, cwd), /Invalid task status/);
|
|
1458
|
-
// Task must still be readable after the rejected update.
|
|
1459
|
-
const reread = await readTask('team-upd-empty-status', created.id, cwd);
|
|
1460
|
-
assert.ok(reread, 'task should still be readable after invalid update was rejected');
|
|
1461
|
-
assert.equal(reread?.status, 'pending');
|
|
1462
|
-
}
|
|
1463
|
-
finally {
|
|
1464
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1465
|
-
}
|
|
1466
|
-
});
|
|
1467
|
-
it('updateTask coerces non-array depends_on to [] so claimTask does not crash', async () => {
|
|
1468
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-state-'));
|
|
1469
|
-
try {
|
|
1470
|
-
await initTeamState('team-upd-bad-deps', 't', 'executor', 1, cwd);
|
|
1471
|
-
const created = await createTask('team-upd-bad-deps', { subject: 's', description: 'd', status: 'pending' }, cwd);
|
|
1472
|
-
// Pass a non-array depends_on to simulate a bad MCP payload.
|
|
1473
|
-
await updateTask('team-upd-bad-deps', created.id, { depends_on: 'not-an-array' }, cwd);
|
|
1474
|
-
// claimTask must not throw "deps.map is not a function".
|
|
1475
|
-
const claim = await claimTask('team-upd-bad-deps', created.id, 'worker-1', null, cwd);
|
|
1476
|
-
assert.equal(claim.ok, true);
|
|
1477
|
-
}
|
|
1478
|
-
finally {
|
|
1479
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1480
|
-
}
|
|
1481
|
-
});
|
|
1482
|
-
it('updateTask is safe under concurrent calls (no lost updates)', async () => {
|
|
1483
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-state-'));
|
|
1484
|
-
try {
|
|
1485
|
-
await initTeamState('team-update-concurrent', 't', 'executor', 1, cwd);
|
|
1486
|
-
const created = await createTask('team-update-concurrent', { subject: 's', description: 'd', status: 'pending', owner: undefined }, cwd);
|
|
1487
|
-
await Promise.all([
|
|
1488
|
-
updateTask('team-update-concurrent', created.id, { result: 'r1' }, cwd),
|
|
1489
|
-
updateTask('team-update-concurrent', created.id, { error: 'e2' }, cwd),
|
|
1490
|
-
]);
|
|
1491
|
-
const reread = await readTask('team-update-concurrent', created.id, cwd);
|
|
1492
|
-
assert.equal(reread?.result, 'r1');
|
|
1493
|
-
assert.equal(reread?.error, 'e2');
|
|
1494
|
-
assert.ok((reread?.version ?? 0) >= 3);
|
|
1495
|
-
}
|
|
1496
|
-
finally {
|
|
1497
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1498
|
-
}
|
|
1499
|
-
});
|
|
1500
|
-
it('writeAtomic creates file and is safe to call concurrently (basic)', async () => {
|
|
1501
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-state-'));
|
|
1502
|
-
try {
|
|
1503
|
-
const p = join(cwd, 'atomic.txt');
|
|
1504
|
-
await Promise.all([writeAtomic(p, 'a'), writeAtomic(p, 'b')]);
|
|
1505
|
-
assert.equal(existsSync(p), true);
|
|
1506
|
-
const content = readFileSync(p, 'utf8');
|
|
1507
|
-
assert.ok(content === 'a' || content === 'b');
|
|
1508
|
-
}
|
|
1509
|
-
finally {
|
|
1510
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1511
|
-
}
|
|
1512
|
-
});
|
|
1513
|
-
it('writeAtomic does not swallow ENOENT when destination content differs', async () => {
|
|
1514
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-state-'));
|
|
1515
|
-
try {
|
|
1516
|
-
const p = join(cwd, 'atomic-fallback.txt');
|
|
1517
|
-
await writeFile(p, 'old', 'utf8');
|
|
1518
|
-
setWriteAtomicRenameForTests(async () => {
|
|
1519
|
-
const err = new Error('missing temp');
|
|
1520
|
-
err.code = 'ENOENT';
|
|
1521
|
-
throw err;
|
|
1522
|
-
});
|
|
1523
|
-
await assert.rejects(() => writeAtomic(p, 'new'), (error) => {
|
|
1524
|
-
const err = error;
|
|
1525
|
-
return err.code === 'ENOENT';
|
|
1526
|
-
});
|
|
1527
|
-
assert.equal(readFileSync(p, 'utf8'), 'old');
|
|
1528
|
-
}
|
|
1529
|
-
finally {
|
|
1530
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1531
|
-
}
|
|
1532
|
-
});
|
|
1533
|
-
it('writeAtomic keeps ENOENT fallback when destination already has expected content', async () => {
|
|
1534
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-state-'));
|
|
1535
|
-
try {
|
|
1536
|
-
const p = join(cwd, 'atomic-fallback-safe.txt');
|
|
1537
|
-
await writeFile(p, 'same-content', 'utf8');
|
|
1538
|
-
setWriteAtomicRenameForTests(async () => {
|
|
1539
|
-
const err = new Error('missing temp');
|
|
1540
|
-
err.code = 'ENOENT';
|
|
1541
|
-
throw err;
|
|
1542
|
-
});
|
|
1543
|
-
await writeAtomic(p, 'same-content');
|
|
1544
|
-
assert.equal(readFileSync(p, 'utf8'), 'same-content');
|
|
1545
|
-
}
|
|
1546
|
-
finally {
|
|
1547
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1548
|
-
}
|
|
1549
|
-
});
|
|
1550
|
-
it('readWorkerStatus returns {state:\'unknown\'} on missing file', async () => {
|
|
1551
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-state-'));
|
|
1552
|
-
try {
|
|
1553
|
-
await initTeamState('team-8', 't', 'executor', 1, cwd);
|
|
1554
|
-
const status = await readWorkerStatus('team-8', 'worker-1', cwd);
|
|
1555
|
-
assert.equal(status.state, 'unknown');
|
|
1556
|
-
assert.ok(!Number.isNaN(Date.parse(status.updated_at)));
|
|
1557
|
-
}
|
|
1558
|
-
finally {
|
|
1559
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1560
|
-
}
|
|
1561
|
-
});
|
|
1562
|
-
it('readWorkerHeartbeat returns null on missing file', async () => {
|
|
1563
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-state-'));
|
|
1564
|
-
try {
|
|
1565
|
-
await initTeamState('team-9', 't', 'executor', 1, cwd);
|
|
1566
|
-
const hb = await readWorkerHeartbeat('team-9', 'worker-1', cwd);
|
|
1567
|
-
assert.equal(hb, null);
|
|
1568
|
-
}
|
|
1569
|
-
finally {
|
|
1570
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1571
|
-
}
|
|
1572
|
-
});
|
|
1573
|
-
it('writeWorkerInbox writes content to the correct path', async () => {
|
|
1574
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-state-'));
|
|
1575
|
-
try {
|
|
1576
|
-
await initTeamState('team-10', 't', 'executor', 1, cwd);
|
|
1577
|
-
await writeWorkerInbox('team-10', 'worker-1', 'hello worker', cwd);
|
|
1578
|
-
const inboxPath = join(cwd, '.rcs', 'state', 'team', 'team-10', 'workers', 'worker-1', 'inbox.md');
|
|
1579
|
-
assert.equal(existsSync(inboxPath), true);
|
|
1580
|
-
assert.equal(readFileSync(inboxPath, 'utf8'), 'hello worker');
|
|
1581
|
-
}
|
|
1582
|
-
finally {
|
|
1583
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1584
|
-
}
|
|
1585
|
-
});
|
|
1586
|
-
it('getTeamSummary aggregates task counts correctly', async () => {
|
|
1587
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-state-'));
|
|
1588
|
-
try {
|
|
1589
|
-
await initTeamState('team-11', 't', 'executor', 2, cwd);
|
|
1590
|
-
const t1 = await createTask('team-11', { subject: 'p', description: 'd', status: 'pending' }, cwd);
|
|
1591
|
-
await createTask('team-11', { subject: 'ip', description: 'd', status: 'in_progress' }, cwd);
|
|
1592
|
-
await createTask('team-11', { subject: 'c', description: 'd', status: 'completed' }, cwd);
|
|
1593
|
-
await createTask('team-11', { subject: 'f', description: 'd', status: 'failed' }, cwd);
|
|
1594
|
-
// Simulate a worker who is turning without progress on task 1.
|
|
1595
|
-
await updateWorkerHeartbeat('team-11', 'worker-1', { pid: 123, last_turn_at: new Date().toISOString(), turn_count: 6, alive: true }, cwd);
|
|
1596
|
-
const statusPath = join(cwd, '.rcs', 'state', 'team', 'team-11', 'workers', 'worker-1', 'status.json');
|
|
1597
|
-
await writeAtomic(statusPath, JSON.stringify({
|
|
1598
|
-
state: 'working',
|
|
1599
|
-
current_task_id: t1.id,
|
|
1600
|
-
updated_at: new Date().toISOString(),
|
|
1601
|
-
}, null, 2));
|
|
1602
|
-
const first = await getTeamSummary('team-11', cwd);
|
|
1603
|
-
assert.ok(first);
|
|
1604
|
-
assert.equal(first?.teamName, 'team-11');
|
|
1605
|
-
assert.equal(first?.workerCount, 2);
|
|
1606
|
-
assert.deepEqual(first?.tasks, {
|
|
1607
|
-
total: 4,
|
|
1608
|
-
pending: 1,
|
|
1609
|
-
blocked: 0,
|
|
1610
|
-
in_progress: 1,
|
|
1611
|
-
completed: 1,
|
|
1612
|
-
failed: 1,
|
|
1613
|
-
});
|
|
1614
|
-
const firstW1 = first?.workers.find((w) => w.name === 'worker-1');
|
|
1615
|
-
assert.equal(firstW1?.alive, true);
|
|
1616
|
-
assert.equal(firstW1?.turnsWithoutProgress, 0);
|
|
1617
|
-
// Subsequent turns without task status progress should show delta.
|
|
1618
|
-
await updateWorkerHeartbeat('team-11', 'worker-1', { pid: 123, last_turn_at: new Date().toISOString(), turn_count: 12, alive: true }, cwd);
|
|
1619
|
-
const second = await getTeamSummary('team-11', cwd);
|
|
1620
|
-
assert.ok(second?.nonReportingWorkers.includes('worker-1'));
|
|
1621
|
-
const secondW1 = second?.workers.find((w) => w.name === 'worker-1');
|
|
1622
|
-
assert.equal(secondW1?.turnsWithoutProgress, 6);
|
|
1623
|
-
assert.ok(second?.performance);
|
|
1624
|
-
assert.equal(second?.performance?.task_count, 4);
|
|
1625
|
-
assert.equal(second?.performance?.worker_count, 2);
|
|
1626
|
-
assert.ok((second?.performance?.tasks_loaded_ms ?? -1) >= 0);
|
|
1627
|
-
assert.ok((second?.performance?.workers_polled_ms ?? -1) >= 0);
|
|
1628
|
-
assert.ok((second?.performance?.total_ms ?? -1) >= 0);
|
|
1629
|
-
}
|
|
1630
|
-
finally {
|
|
1631
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1632
|
-
}
|
|
1633
|
-
});
|
|
1634
|
-
it('cleanupTeamState removes the directory', async () => {
|
|
1635
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-state-'));
|
|
1636
|
-
try {
|
|
1637
|
-
await initTeamState('team-12', 't', 'executor', 1, cwd);
|
|
1638
|
-
const root = join(cwd, '.rcs', 'state', 'team', 'team-12');
|
|
1639
|
-
assert.equal(existsSync(root), true);
|
|
1640
|
-
await cleanupTeamState('team-12', cwd);
|
|
1641
|
-
assert.equal(existsSync(root), false);
|
|
1642
|
-
}
|
|
1643
|
-
finally {
|
|
1644
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1645
|
-
}
|
|
1646
|
-
});
|
|
1647
|
-
it('cleanupTeamState rejects unsafe team names before path construction', async () => {
|
|
1648
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-state-unsafe-'));
|
|
1649
|
-
try {
|
|
1650
|
-
const victim = join(cwd, '.rcs', 'state', 'victim');
|
|
1651
|
-
await mkdir(victim, { recursive: true });
|
|
1652
|
-
await writeFile(join(victim, 'keep.txt'), 'keep');
|
|
1653
|
-
await assert.rejects(() => cleanupTeamState('../victim', cwd), /invalid_team_name/);
|
|
1654
|
-
assert.equal(existsSync(join(victim, 'keep.txt')), true);
|
|
1655
|
-
}
|
|
1656
|
-
finally {
|
|
1657
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1658
|
-
}
|
|
1659
|
-
});
|
|
1660
|
-
it('validateTeamName rejects invalid names (via initTeamState throwing)', async () => {
|
|
1661
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-state-'));
|
|
1662
|
-
try {
|
|
1663
|
-
await assert.rejects(() => initTeamState('Bad Name', 't', 'executor', 1, cwd), /Invalid team name/);
|
|
1664
|
-
await assert.rejects(() => initTeamState('-bad', 't', 'executor', 1, cwd), /Invalid team name/);
|
|
1665
|
-
await assert.rejects(() => initTeamState('a'.repeat(31), 't', 'executor', 1, cwd), /Invalid team name/);
|
|
1666
|
-
}
|
|
1667
|
-
finally {
|
|
1668
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1669
|
-
}
|
|
1670
|
-
});
|
|
1671
|
-
it('initTeamState snapshots permissions and display mode from env', async () => {
|
|
1672
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-state-'));
|
|
1673
|
-
try {
|
|
1674
|
-
await initTeamState('team-env', 't', 'executor', 1, cwd, DEFAULT_MAX_WORKERS, {
|
|
1675
|
-
...process.env,
|
|
1676
|
-
RCS_TEAM_DISPLAY_MODE: 'tmux',
|
|
1677
|
-
RCS_TEAM_WORKER_LAUNCH_MODE: 'prompt',
|
|
1678
|
-
CODEX_APPROVAL_MODE: 'on-request',
|
|
1679
|
-
CODEX_SANDBOX_MODE: 'workspace-write',
|
|
1680
|
-
CODEX_NETWORK_ACCESS: '0',
|
|
1681
|
-
RCS_SESSION_ID: 'session-xyz',
|
|
1682
|
-
});
|
|
1683
|
-
const manifest = await readTeamManifestV2('team-env', cwd);
|
|
1684
|
-
const config = await readTeamConfig('team-env', cwd);
|
|
1685
|
-
assert.ok(manifest);
|
|
1686
|
-
assert.ok(config);
|
|
1687
|
-
assert.equal(manifest?.policy.display_mode, 'split_pane');
|
|
1688
|
-
assert.equal(manifest?.policy.worker_launch_mode, 'prompt');
|
|
1689
|
-
assert.equal(manifest?.governance.cleanup_requires_all_workers_inactive, true);
|
|
1690
|
-
assert.equal(config?.worker_launch_mode, 'prompt');
|
|
1691
|
-
assert.equal(manifest?.permissions_snapshot.approval_mode, 'on-request');
|
|
1692
|
-
assert.equal(manifest?.permissions_snapshot.sandbox_mode, 'workspace-write');
|
|
1693
|
-
assert.equal(manifest?.permissions_snapshot.network_access, false);
|
|
1694
|
-
assert.equal(manifest?.leader.session_id, 'session-xyz');
|
|
1695
|
-
}
|
|
1696
|
-
finally {
|
|
1697
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1698
|
-
}
|
|
1699
|
-
});
|
|
1700
|
-
it('initTeamState rejects invalid RCS_TEAM_WORKER_LAUNCH_MODE values', async () => {
|
|
1701
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-state-'));
|
|
1702
|
-
try {
|
|
1703
|
-
await assert.rejects(() => initTeamState('team-env-invalid', 't', 'executor', 1, cwd, DEFAULT_MAX_WORKERS, {
|
|
1704
|
-
...process.env,
|
|
1705
|
-
RCS_TEAM_WORKER_LAUNCH_MODE: 'tmux',
|
|
1706
|
-
}), /Invalid RCS_TEAM_WORKER_LAUNCH_MODE value/i);
|
|
1707
|
-
}
|
|
1708
|
-
finally {
|
|
1709
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1710
|
-
}
|
|
1711
|
-
});
|
|
1712
|
-
it('claimTask returns task_not_found for non-existent task id', async () => {
|
|
1713
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-claim-missing-'));
|
|
1714
|
-
try {
|
|
1715
|
-
await initTeamState('team-x', 'task', 'executor', 1, cwd);
|
|
1716
|
-
const result = await claimTask('team-x', 'non-existent-999', 'worker-1', null, cwd);
|
|
1717
|
-
assert.equal(result.ok, false);
|
|
1718
|
-
assert.equal(result.error, 'task_not_found');
|
|
1719
|
-
}
|
|
1720
|
-
finally {
|
|
1721
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1722
|
-
}
|
|
1723
|
-
});
|
|
1724
|
-
it('resolveDispatchLockTimeoutMs returns default when env not set', () => {
|
|
1725
|
-
assert.equal(resolveDispatchLockTimeoutMs({}), 15_000);
|
|
1726
|
-
assert.equal(resolveDispatchLockTimeoutMs({ RCS_DISPATCH_LOCK_TIMEOUT_MS: '' }), 15_000);
|
|
1727
|
-
assert.equal(resolveDispatchLockTimeoutMs({ RCS_DISPATCH_LOCK_TIMEOUT_MS: 'not-a-number' }), 15_000);
|
|
1728
|
-
});
|
|
1729
|
-
it('resolveDispatchLockTimeoutMs reads from env and clamps to bounds', () => {
|
|
1730
|
-
// Reads value from env
|
|
1731
|
-
assert.equal(resolveDispatchLockTimeoutMs({ RCS_DISPATCH_LOCK_TIMEOUT_MS: '30000' }), 30_000);
|
|
1732
|
-
// Clamps to minimum
|
|
1733
|
-
assert.equal(resolveDispatchLockTimeoutMs({ RCS_DISPATCH_LOCK_TIMEOUT_MS: '0' }), 1_000);
|
|
1734
|
-
assert.equal(resolveDispatchLockTimeoutMs({ RCS_DISPATCH_LOCK_TIMEOUT_MS: '-500' }), 1_000);
|
|
1735
|
-
// Clamps to maximum
|
|
1736
|
-
assert.equal(resolveDispatchLockTimeoutMs({ RCS_DISPATCH_LOCK_TIMEOUT_MS: '999999' }), 120_000);
|
|
1737
|
-
// Floors non-integer
|
|
1738
|
-
assert.equal(resolveDispatchLockTimeoutMs({ RCS_DISPATCH_LOCK_TIMEOUT_MS: '5000.9' }), 5_000);
|
|
1739
|
-
});
|
|
1740
|
-
it('dispatch lock error message includes timeout hint', async () => {
|
|
1741
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-dispatch-lock-timeout-'));
|
|
1742
|
-
try {
|
|
1743
|
-
await initTeamState('team-lock-hint', 'task', 'executor', 1, cwd);
|
|
1744
|
-
// Hold the lock by creating the lock directory manually
|
|
1745
|
-
const lockDir = join(cwd, '.rcs', 'state', 'team', 'team-lock-hint', 'dispatch', '.lock');
|
|
1746
|
-
await mkdir(lockDir, { recursive: true });
|
|
1747
|
-
// Use a very short timeout via env override so the test is fast
|
|
1748
|
-
const origEnv = process.env.RCS_DISPATCH_LOCK_TIMEOUT_MS;
|
|
1749
|
-
process.env.RCS_DISPATCH_LOCK_TIMEOUT_MS = '1000';
|
|
1750
|
-
try {
|
|
1751
|
-
await assert.rejects(() => enqueueDispatchRequest('team-lock-hint', { kind: 'inbox', to_worker: 'worker-1', trigger_message: 'test' }, cwd), (err) => {
|
|
1752
|
-
assert.ok(err.message.includes('RCS_DISPATCH_LOCK_TIMEOUT_MS'), `Expected hint in error, got: ${err.message}`);
|
|
1753
|
-
return true;
|
|
1754
|
-
});
|
|
1755
|
-
}
|
|
1756
|
-
finally {
|
|
1757
|
-
if (origEnv === undefined) {
|
|
1758
|
-
delete process.env.RCS_DISPATCH_LOCK_TIMEOUT_MS;
|
|
1759
|
-
}
|
|
1760
|
-
else {
|
|
1761
|
-
process.env.RCS_DISPATCH_LOCK_TIMEOUT_MS = origEnv;
|
|
1762
|
-
}
|
|
1763
|
-
await rm(lockDir, { recursive: true, force: true });
|
|
1764
|
-
}
|
|
1765
|
-
}
|
|
1766
|
-
finally {
|
|
1767
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1768
|
-
}
|
|
1769
|
-
});
|
|
1770
|
-
it('treats dispatch status as authoritative over incompatible timestamps', () => {
|
|
1771
|
-
const pending = normalizeDispatchRequest('team-contract-dispatch', {
|
|
1772
|
-
kind: 'inbox',
|
|
1773
|
-
to_worker: 'worker-1',
|
|
1774
|
-
trigger_message: 'ping',
|
|
1775
|
-
status: 'pending',
|
|
1776
|
-
notified_at: '2026-04-04T00:00:00.000Z',
|
|
1777
|
-
delivered_at: '2026-04-04T00:01:00.000Z',
|
|
1778
|
-
failed_at: '2026-04-04T00:02:00.000Z',
|
|
1779
|
-
});
|
|
1780
|
-
assert.equal(pending?.status, 'pending');
|
|
1781
|
-
assert.equal(pending?.notified_at, undefined);
|
|
1782
|
-
assert.equal(pending?.delivered_at, undefined);
|
|
1783
|
-
assert.equal(pending?.failed_at, undefined);
|
|
1784
|
-
const notified = normalizeDispatchRequest('team-contract-dispatch', {
|
|
1785
|
-
kind: 'inbox',
|
|
1786
|
-
to_worker: 'worker-1',
|
|
1787
|
-
trigger_message: 'ping',
|
|
1788
|
-
status: 'notified',
|
|
1789
|
-
notified_at: '2026-04-04T00:00:00.000Z',
|
|
1790
|
-
delivered_at: '2026-04-04T00:01:00.000Z',
|
|
1791
|
-
failed_at: '2026-04-04T00:02:00.000Z',
|
|
1792
|
-
});
|
|
1793
|
-
assert.equal(notified?.status, 'notified');
|
|
1794
|
-
assert.equal(notified?.notified_at, '2026-04-04T00:00:00.000Z');
|
|
1795
|
-
assert.equal(notified?.delivered_at, undefined);
|
|
1796
|
-
assert.equal(notified?.failed_at, undefined);
|
|
1797
|
-
const delivered = normalizeDispatchRequest('team-contract-dispatch', {
|
|
1798
|
-
kind: 'inbox',
|
|
1799
|
-
to_worker: 'worker-1',
|
|
1800
|
-
trigger_message: 'ping',
|
|
1801
|
-
status: 'delivered',
|
|
1802
|
-
notified_at: '2026-04-04T00:00:00.000Z',
|
|
1803
|
-
delivered_at: '2026-04-04T00:01:00.000Z',
|
|
1804
|
-
failed_at: '2026-04-04T00:02:00.000Z',
|
|
1805
|
-
});
|
|
1806
|
-
assert.equal(delivered?.status, 'delivered');
|
|
1807
|
-
assert.equal(delivered?.notified_at, '2026-04-04T00:00:00.000Z');
|
|
1808
|
-
assert.equal(delivered?.delivered_at, '2026-04-04T00:01:00.000Z');
|
|
1809
|
-
assert.equal(delivered?.failed_at, undefined);
|
|
1810
|
-
const failed = normalizeDispatchRequest('team-contract-dispatch', {
|
|
1811
|
-
kind: 'inbox',
|
|
1812
|
-
to_worker: 'worker-1',
|
|
1813
|
-
trigger_message: 'ping',
|
|
1814
|
-
status: 'failed',
|
|
1815
|
-
notified_at: '2026-04-04T00:00:00.000Z',
|
|
1816
|
-
delivered_at: '2026-04-04T00:01:00.000Z',
|
|
1817
|
-
failed_at: '2026-04-04T00:02:00.000Z',
|
|
1818
|
-
});
|
|
1819
|
-
assert.equal(failed?.status, 'failed');
|
|
1820
|
-
assert.equal(failed?.notified_at, '2026-04-04T00:00:00.000Z');
|
|
1821
|
-
assert.equal(failed?.delivered_at, undefined);
|
|
1822
|
-
assert.equal(failed?.failed_at, '2026-04-04T00:02:00.000Z');
|
|
1823
|
-
});
|
|
1824
|
-
it('sanitizes persisted integration snapshot statuses to the contract', async () => {
|
|
1825
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-team-monitor-contract-'));
|
|
1826
|
-
try {
|
|
1827
|
-
await initTeamState('team-monitor-contract', 't', 'executor', 1, cwd);
|
|
1828
|
-
const monitorPath = join(cwd, '.rcs', 'state', 'team', 'team-monitor-contract', 'monitor-snapshot.json');
|
|
1829
|
-
await writeFile(monitorPath, JSON.stringify({
|
|
1830
|
-
taskStatusById: {},
|
|
1831
|
-
workerAliveByName: {},
|
|
1832
|
-
workerStateByName: {},
|
|
1833
|
-
workerTurnCountByName: {},
|
|
1834
|
-
workerTaskIdByName: {},
|
|
1835
|
-
mailboxNotifiedByMessageId: {},
|
|
1836
|
-
completedEventTaskIds: {},
|
|
1837
|
-
integrationByWorker: {
|
|
1838
|
-
'worker-1': {
|
|
1839
|
-
status: 'integrated',
|
|
1840
|
-
last_integrated_head: 'abc123',
|
|
1841
|
-
},
|
|
1842
|
-
'worker-2': {
|
|
1843
|
-
status: 'mystery_state',
|
|
1844
|
-
last_integrated_head: 'def456',
|
|
1845
|
-
},
|
|
1846
|
-
},
|
|
1847
|
-
}, null, 2));
|
|
1848
|
-
const snapshot = await readMonitorSnapshot('team-monitor-contract', cwd);
|
|
1849
|
-
assert.equal(snapshot?.integrationByWorker?.['worker-1']?.status, 'integrated');
|
|
1850
|
-
assert.equal(snapshot?.integrationByWorker?.['worker-1']?.last_integrated_head, 'abc123');
|
|
1851
|
-
assert.equal(snapshot?.integrationByWorker?.['worker-2']?.status, undefined);
|
|
1852
|
-
assert.equal(snapshot?.integrationByWorker?.['worker-2']?.last_integrated_head, 'def456');
|
|
1853
|
-
}
|
|
1854
|
-
finally {
|
|
1855
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1856
|
-
}
|
|
1857
|
-
});
|
|
1858
|
-
});
|
|
1859
|
-
//# sourceMappingURL=state.test.js.map
|