@jstn-sdk/rcs 0.1.0 → 0.1.6
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 +154 -101
- 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.d.ts.map +1 -1
- package/dist/cli/index.js +20 -15
- package/dist/cli/index.js.map +1 -1
- 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 +11 -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 +14 -0
- package/docs/readme/README.el.md +14 -0
- package/docs/readme/README.es.md +14 -0
- package/docs/readme/README.fr.md +14 -0
- package/docs/readme/README.it.md +14 -0
- package/docs/readme/README.ja.md +14 -0
- package/docs/readme/README.ko.md +14 -0
- package/docs/readme/README.pl.md +14 -0
- package/docs/readme/README.pt.md +14 -0
- package/docs/readme/README.ru.md +14 -0
- package/docs/readme/README.tr.md +14 -0
- package/docs/readme/README.uk.md +14 -0
- package/docs/readme/README.vi.md +14 -0
- package/docs/readme/README.zh-TW.md +14 -0
- package/docs/readme/README.zh.md +14 -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/release-notes-v0.1.6.md +27 -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,2262 +0,0 @@
|
|
|
1
|
-
import { describe, it } from 'node:test';
|
|
2
|
-
import assert from 'node:assert/strict';
|
|
3
|
-
import { chmod, mkdtemp, rm, mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
4
|
-
import { join } from 'node:path';
|
|
5
|
-
import { tmpdir } from 'node:os';
|
|
6
|
-
import { resolveTeamApiOperation, buildLegacyTeamDeprecationHint, executeTeamApiOperation, LEGACY_TEAM_MCP_TOOLS, TEAM_API_OPERATIONS, } from '../api-interop.js';
|
|
7
|
-
import { initTeamState, createTask, readTeamLeaderAttention, readTeamManifestV2, readTask, writeTeamLeaderAttention, writeTeamManifestV2, writeTeamPhase, sendDirectMessage, enqueueDispatchRequest, readDispatchRequest, listDispatchRequests, appendTeamEvent, markOwnedTeamsLeaderStopObserved, markOwnedTeamsLeaderSessionStopped, updateWorkerHeartbeat, writeMonitorSnapshot, writeWorkerStatus, } from '../state.js';
|
|
8
|
-
async function setupTeam(name) {
|
|
9
|
-
const cwd = await mkdtemp(join(tmpdir(), `rcs-interop-${name}-`));
|
|
10
|
-
const previousTeamStateRoot = process.env.RCS_TEAM_STATE_ROOT;
|
|
11
|
-
delete process.env.RCS_TEAM_STATE_ROOT;
|
|
12
|
-
await initTeamState(name, 'test task', 'executor', 2, cwd);
|
|
13
|
-
return {
|
|
14
|
-
cwd,
|
|
15
|
-
cleanup: async () => {
|
|
16
|
-
if (typeof previousTeamStateRoot === 'string')
|
|
17
|
-
process.env.RCS_TEAM_STATE_ROOT = previousTeamStateRoot;
|
|
18
|
-
else
|
|
19
|
-
delete process.env.RCS_TEAM_STATE_ROOT;
|
|
20
|
-
await rm(cwd, { recursive: true, force: true });
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
async function setupDisplayTeam(internalName, displayName, sessionId, workerCount = 2) {
|
|
25
|
-
const cwd = await mkdtemp(join(tmpdir(), `rcs-interop-${internalName}-`));
|
|
26
|
-
const previousTeamStateRoot = process.env.RCS_TEAM_STATE_ROOT;
|
|
27
|
-
const previousSessionId = process.env.RCS_SESSION_ID;
|
|
28
|
-
delete process.env.RCS_TEAM_STATE_ROOT;
|
|
29
|
-
process.env.RCS_SESSION_ID = sessionId;
|
|
30
|
-
await initTeamState(internalName, 'display-name API test', 'executor', workerCount, cwd, undefined, {
|
|
31
|
-
RCS_SESSION_ID: sessionId,
|
|
32
|
-
}, {
|
|
33
|
-
display_name: displayName,
|
|
34
|
-
requested_name: displayName,
|
|
35
|
-
identity_source: 'env-session',
|
|
36
|
-
});
|
|
37
|
-
return {
|
|
38
|
-
cwd,
|
|
39
|
-
cleanup: async () => {
|
|
40
|
-
if (typeof previousTeamStateRoot === 'string')
|
|
41
|
-
process.env.RCS_TEAM_STATE_ROOT = previousTeamStateRoot;
|
|
42
|
-
else
|
|
43
|
-
delete process.env.RCS_TEAM_STATE_ROOT;
|
|
44
|
-
if (typeof previousSessionId === 'string')
|
|
45
|
-
process.env.RCS_SESSION_ID = previousSessionId;
|
|
46
|
-
else
|
|
47
|
-
delete process.env.RCS_SESSION_ID;
|
|
48
|
-
await rm(cwd, { recursive: true, force: true });
|
|
49
|
-
},
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
async function withMailboxCompatHoleRuntime(cwd, fn) {
|
|
53
|
-
const fakeBin = join(cwd, 'runtime-bin');
|
|
54
|
-
const runtimePath = join(fakeBin, 'rcs-runtime');
|
|
55
|
-
const previousPath = process.env.PATH;
|
|
56
|
-
const previousBinary = process.env.RCS_RUNTIME_BINARY;
|
|
57
|
-
const previousBridge = process.env.RCS_RUNTIME_BRIDGE;
|
|
58
|
-
await mkdir(fakeBin, { recursive: true });
|
|
59
|
-
await writeFile(runtimePath, `#!/usr/bin/env node
|
|
60
|
-
const fs = require('fs');
|
|
61
|
-
const path = require('path');
|
|
62
|
-
const argv = process.argv.slice(2);
|
|
63
|
-
function argValue(prefix) {
|
|
64
|
-
const entry = argv.find((value) => value.startsWith(prefix));
|
|
65
|
-
return entry ? entry.slice(prefix.length) : null;
|
|
66
|
-
}
|
|
67
|
-
function stateDir() {
|
|
68
|
-
return argValue('--state-dir=') || process.cwd();
|
|
69
|
-
}
|
|
70
|
-
function readJson(file, fallback) {
|
|
71
|
-
try { return JSON.parse(fs.readFileSync(file, 'utf8')); } catch { return fallback; }
|
|
72
|
-
}
|
|
73
|
-
function writeJson(file, value) {
|
|
74
|
-
fs.mkdirSync(path.dirname(file), { recursive: true });
|
|
75
|
-
fs.writeFileSync(file, JSON.stringify(value, null, 2) + '\\n');
|
|
76
|
-
}
|
|
77
|
-
if (argv[0] === 'schema') {
|
|
78
|
-
process.stdout.write(JSON.stringify({ schema_version: 1, commands: [], events: [], transport: 'tmux' }) + '\\n');
|
|
79
|
-
process.exit(0);
|
|
80
|
-
}
|
|
81
|
-
if (argv[0] !== 'exec') process.exit(1);
|
|
82
|
-
const command = JSON.parse(argv[1] || '{}');
|
|
83
|
-
const dir = stateDir();
|
|
84
|
-
if (command.command === 'CreateMailboxMessage') {
|
|
85
|
-
writeJson(path.join(dir, 'mailbox.json'), readJson(path.join(dir, 'mailbox.json'), { records: [] }));
|
|
86
|
-
process.stdout.write(JSON.stringify({ event: 'MailboxMessageCreated', message_id: command.message_id, from_worker: command.from_worker, to_worker: command.to_worker }) + '\\n');
|
|
87
|
-
process.exit(0);
|
|
88
|
-
}
|
|
89
|
-
process.stdout.write(JSON.stringify({ event: 'ok' }) + '\\n');
|
|
90
|
-
`, 'utf8');
|
|
91
|
-
await chmod(runtimePath, 0o755);
|
|
92
|
-
process.env.PATH = `${fakeBin}:${previousPath || ''}`;
|
|
93
|
-
process.env.RCS_RUNTIME_BINARY = runtimePath;
|
|
94
|
-
process.env.RCS_RUNTIME_BRIDGE = '1';
|
|
95
|
-
try {
|
|
96
|
-
return await fn();
|
|
97
|
-
}
|
|
98
|
-
finally {
|
|
99
|
-
if (typeof previousPath === 'string')
|
|
100
|
-
process.env.PATH = previousPath;
|
|
101
|
-
else
|
|
102
|
-
delete process.env.PATH;
|
|
103
|
-
if (typeof previousBinary === 'string')
|
|
104
|
-
process.env.RCS_RUNTIME_BINARY = previousBinary;
|
|
105
|
-
else
|
|
106
|
-
delete process.env.RCS_RUNTIME_BINARY;
|
|
107
|
-
if (typeof previousBridge === 'string')
|
|
108
|
-
process.env.RCS_RUNTIME_BRIDGE = previousBridge;
|
|
109
|
-
else
|
|
110
|
-
delete process.env.RCS_RUNTIME_BRIDGE;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
async function readTeamDeliveryLog(cwd) {
|
|
114
|
-
const path = join(cwd, '.rcs', 'logs', `team-delivery-${new Date().toISOString().slice(0, 10)}.jsonl`);
|
|
115
|
-
const raw = await readFile(path, 'utf-8').catch(() => '');
|
|
116
|
-
return raw
|
|
117
|
-
.split('\n')
|
|
118
|
-
.map((line) => line.trim())
|
|
119
|
-
.filter(Boolean)
|
|
120
|
-
.map((line) => JSON.parse(line));
|
|
121
|
-
}
|
|
122
|
-
// ─── resolveTeamApiOperation ──────────────────────────────────────────────
|
|
123
|
-
describe('resolveTeamApiOperation', () => {
|
|
124
|
-
it('resolves a valid kebab-case operation', () => {
|
|
125
|
-
assert.equal(resolveTeamApiOperation('send-message'), 'send-message');
|
|
126
|
-
});
|
|
127
|
-
it('normalizes legacy team_ prefix to kebab-case', () => {
|
|
128
|
-
assert.equal(resolveTeamApiOperation('team_send_message'), 'send-message');
|
|
129
|
-
});
|
|
130
|
-
it('normalizes underscores to hyphens', () => {
|
|
131
|
-
assert.equal(resolveTeamApiOperation('claim_task'), 'claim-task');
|
|
132
|
-
});
|
|
133
|
-
it('returns null for unknown operations', () => {
|
|
134
|
-
assert.equal(resolveTeamApiOperation('nonexistent-op'), null);
|
|
135
|
-
});
|
|
136
|
-
it('returns null for empty string', () => {
|
|
137
|
-
assert.equal(resolveTeamApiOperation(''), null);
|
|
138
|
-
});
|
|
139
|
-
it('handles whitespace and casing', () => {
|
|
140
|
-
assert.equal(resolveTeamApiOperation(' SEND_MESSAGE '), 'send-message');
|
|
141
|
-
});
|
|
142
|
-
it('resolves all 33 operations from the operation list', () => {
|
|
143
|
-
for (const op of TEAM_API_OPERATIONS) {
|
|
144
|
-
assert.equal(resolveTeamApiOperation(op), op);
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
// ─── buildLegacyTeamDeprecationHint ───────────────────────────────────────
|
|
149
|
-
describe('buildLegacyTeamDeprecationHint', () => {
|
|
150
|
-
it('produces CLI hint with resolved operation name', () => {
|
|
151
|
-
const hint = buildLegacyTeamDeprecationHint('team_send_message', { team_name: 'alpha' });
|
|
152
|
-
assert.match(hint, /rcs team api send-message/);
|
|
153
|
-
assert.match(hint, /"team_name":"alpha"/);
|
|
154
|
-
});
|
|
155
|
-
it('falls back to generic hint for unresolvable legacy name', () => {
|
|
156
|
-
const hint = buildLegacyTeamDeprecationHint('team_nonexistent', { foo: 'bar' });
|
|
157
|
-
assert.match(hint, /rcs team api <operation>/);
|
|
158
|
-
});
|
|
159
|
-
it('uses empty JSON when no args provided', () => {
|
|
160
|
-
const hint = buildLegacyTeamDeprecationHint('team_list_tasks');
|
|
161
|
-
assert.match(hint, /\{\}/);
|
|
162
|
-
});
|
|
163
|
-
});
|
|
164
|
-
// ─── constants ────────────────────────────────────────────────────────────
|
|
165
|
-
describe('LEGACY_TEAM_MCP_TOOLS', () => {
|
|
166
|
-
it('contains 29 legacy tool names', () => {
|
|
167
|
-
assert.equal(LEGACY_TEAM_MCP_TOOLS.length, 29);
|
|
168
|
-
});
|
|
169
|
-
it('all start with team_', () => {
|
|
170
|
-
for (const name of LEGACY_TEAM_MCP_TOOLS) {
|
|
171
|
-
assert.match(name, /^team_/);
|
|
172
|
-
}
|
|
173
|
-
});
|
|
174
|
-
});
|
|
175
|
-
describe('TEAM_API_OPERATIONS', () => {
|
|
176
|
-
it('contains 33 operations', () => {
|
|
177
|
-
assert.equal(TEAM_API_OPERATIONS.length, 33);
|
|
178
|
-
});
|
|
179
|
-
it('all use kebab-case', () => {
|
|
180
|
-
for (const op of TEAM_API_OPERATIONS) {
|
|
181
|
-
assert.doesNotMatch(op, /_/);
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
});
|
|
185
|
-
// ─── validateCommonFields (via executeTeamApiOperation) ───────────────────
|
|
186
|
-
describe('validateCommonFields', () => {
|
|
187
|
-
it('rejects invalid team_name pattern', async () => {
|
|
188
|
-
const result = await executeTeamApiOperation('list-tasks', { team_name: 'INVALID CAPS!' }, '/tmp');
|
|
189
|
-
assert.equal(result.ok, false);
|
|
190
|
-
if (!result.ok) {
|
|
191
|
-
assert.equal(result.error.code, 'operation_failed');
|
|
192
|
-
assert.match(result.error.message, /Invalid team_name/);
|
|
193
|
-
}
|
|
194
|
-
});
|
|
195
|
-
it('resolves a long display team_name before applying internal key validation', async () => {
|
|
196
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-api-long-display-'));
|
|
197
|
-
try {
|
|
198
|
-
await initTeamState('long-display-aaaaaaaa', 'test task', 'executor', 1, cwd, undefined, { RCS_SESSION_ID: 'session-long' }, {
|
|
199
|
-
display_name: 'this-is-a-long-display-name-that-exceeds-thirty-chars',
|
|
200
|
-
requested_name: 'this-is-a-long-display-name-that-exceeds-thirty-chars',
|
|
201
|
-
identity_source: 'env-session',
|
|
202
|
-
});
|
|
203
|
-
const previousSessionId = process.env.RCS_SESSION_ID;
|
|
204
|
-
try {
|
|
205
|
-
process.env.RCS_SESSION_ID = 'session-long';
|
|
206
|
-
const result = await executeTeamApiOperation('list-tasks', {
|
|
207
|
-
team_name: 'this-is-a-long-display-name-that-exceeds-thirty-chars',
|
|
208
|
-
}, cwd);
|
|
209
|
-
assert.equal(result.ok, true);
|
|
210
|
-
if (result.ok)
|
|
211
|
-
assert.equal(result.data.count, 0);
|
|
212
|
-
}
|
|
213
|
-
finally {
|
|
214
|
-
if (previousSessionId === undefined)
|
|
215
|
-
delete process.env.RCS_SESSION_ID;
|
|
216
|
-
else
|
|
217
|
-
process.env.RCS_SESSION_ID = previousSessionId;
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
finally {
|
|
221
|
-
await rm(cwd, { recursive: true, force: true });
|
|
222
|
-
}
|
|
223
|
-
});
|
|
224
|
-
it('rejects invalid worker name pattern', async () => {
|
|
225
|
-
const { cwd, cleanup } = await setupTeam('validate-worker');
|
|
226
|
-
try {
|
|
227
|
-
const result = await executeTeamApiOperation('read-worker-status', {
|
|
228
|
-
team_name: 'validate-worker',
|
|
229
|
-
worker: 'CAPS NOT ALLOWED!',
|
|
230
|
-
}, cwd);
|
|
231
|
-
assert.equal(result.ok, false);
|
|
232
|
-
if (!result.ok) {
|
|
233
|
-
assert.match(result.error.message, /Invalid worker/);
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
finally {
|
|
237
|
-
await cleanup();
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
it('rejects invalid task_id pattern', async () => {
|
|
241
|
-
const { cwd, cleanup } = await setupTeam('validate-task-id');
|
|
242
|
-
try {
|
|
243
|
-
const result = await executeTeamApiOperation('read-task', {
|
|
244
|
-
team_name: 'validate-task-id',
|
|
245
|
-
task_id: 'not-a-number',
|
|
246
|
-
}, cwd);
|
|
247
|
-
assert.equal(result.ok, false);
|
|
248
|
-
if (!result.ok) {
|
|
249
|
-
assert.match(result.error.message, /Invalid task_id/);
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
finally {
|
|
253
|
-
await cleanup();
|
|
254
|
-
}
|
|
255
|
-
});
|
|
256
|
-
});
|
|
257
|
-
// ─── send-message ─────────────────────────────────────────────────────────
|
|
258
|
-
describe('executeTeamApiOperation: send-message', () => {
|
|
259
|
-
it('sends a message successfully and enqueues mailbox dispatch delivery', async () => {
|
|
260
|
-
const { cwd, cleanup } = await setupTeam('msg-team');
|
|
261
|
-
try {
|
|
262
|
-
const result = await executeTeamApiOperation('send-message', {
|
|
263
|
-
team_name: 'msg-team',
|
|
264
|
-
from_worker: 'worker-1',
|
|
265
|
-
to_worker: 'worker-2',
|
|
266
|
-
body: 'hello',
|
|
267
|
-
}, cwd);
|
|
268
|
-
assert.equal(result.ok, true);
|
|
269
|
-
if (!result.ok)
|
|
270
|
-
throw new Error('expected successful send-message result');
|
|
271
|
-
assert.ok(result.data.message);
|
|
272
|
-
const message = result.data.message;
|
|
273
|
-
const messageId = String(message.message_id ?? '');
|
|
274
|
-
assert.ok(messageId, 'message should include a message_id');
|
|
275
|
-
const parsedRequests = await listDispatchRequests('msg-team', cwd, { kind: 'mailbox' });
|
|
276
|
-
const mailboxRequest = parsedRequests.find((request) => request.message_id === messageId);
|
|
277
|
-
assert.ok(mailboxRequest, 'send-message should enqueue a mailbox dispatch request');
|
|
278
|
-
assert.equal(mailboxRequest?.to_worker, 'worker-2');
|
|
279
|
-
const deliveryLog = await readTeamDeliveryLog(cwd);
|
|
280
|
-
assert.ok(deliveryLog.some((entry) => entry.event === 'mailbox_created'
|
|
281
|
-
&& entry.message_id === messageId
|
|
282
|
-
&& entry.from_worker === 'worker-1'
|
|
283
|
-
&& entry.to_worker === 'worker-2'));
|
|
284
|
-
assert.ok(deliveryLog.some((entry) => entry.event === 'dispatch_attempted'
|
|
285
|
-
&& entry.request_id === mailboxRequest?.request_id
|
|
286
|
-
&& entry.message_id === messageId
|
|
287
|
-
&& entry.to_worker === 'worker-2'));
|
|
288
|
-
}
|
|
289
|
-
finally {
|
|
290
|
-
await cleanup();
|
|
291
|
-
}
|
|
292
|
-
});
|
|
293
|
-
it('returns the persisted leader mailbox message when hook-targeted sends are deduped from a worker worktree', async () => {
|
|
294
|
-
const teamName = 'msg-team-leader-dedupe';
|
|
295
|
-
const repoCwd = await mkdtemp(join(tmpdir(), 'rcs-interop-send-root-'));
|
|
296
|
-
const workerCwd = await mkdtemp(join(tmpdir(), 'rcs-interop-send-worktree-'));
|
|
297
|
-
const prevTeamStateRoot = process.env.RCS_TEAM_STATE_ROOT;
|
|
298
|
-
delete process.env.RCS_TEAM_STATE_ROOT;
|
|
299
|
-
try {
|
|
300
|
-
await initTeamState(teamName, 'leader mailbox dedupe', 'executor', 2, repoCwd);
|
|
301
|
-
const configPath = join(repoCwd, '.rcs', 'state', 'team', teamName, 'config.json');
|
|
302
|
-
const config = JSON.parse(await readFile(configPath, 'utf-8'));
|
|
303
|
-
config.leader_pane_id = '%55';
|
|
304
|
-
await writeFile(configPath, `${JSON.stringify(config, null, 2)}\n`, 'utf8');
|
|
305
|
-
const manifestPath = join(repoCwd, '.rcs', 'state', 'team', teamName, 'manifest.v2.json');
|
|
306
|
-
const manifest = JSON.parse(await readFile(manifestPath, 'utf-8'));
|
|
307
|
-
manifest.leader_pane_id = '%55';
|
|
308
|
-
await writeFile(manifestPath, `${JSON.stringify(manifest, null, 2)}\n`, 'utf8');
|
|
309
|
-
process.env.RCS_TEAM_STATE_ROOT = join(repoCwd, '.rcs', 'state');
|
|
310
|
-
const first = await executeTeamApiOperation('send-message', {
|
|
311
|
-
team_name: teamName,
|
|
312
|
-
from_worker: 'worker-1',
|
|
313
|
-
to_worker: 'leader-fixed',
|
|
314
|
-
body: 'ACK: worker-1 initialized',
|
|
315
|
-
}, workerCwd);
|
|
316
|
-
assert.equal(first.ok, true);
|
|
317
|
-
if (!first.ok)
|
|
318
|
-
throw new Error('expected first send-message call to succeed');
|
|
319
|
-
const second = await executeTeamApiOperation('send-message', {
|
|
320
|
-
team_name: teamName,
|
|
321
|
-
from_worker: 'worker-1',
|
|
322
|
-
to_worker: 'leader-fixed',
|
|
323
|
-
body: 'ACK: worker-1 initialized',
|
|
324
|
-
}, workerCwd);
|
|
325
|
-
assert.equal(second.ok, true);
|
|
326
|
-
if (!second.ok)
|
|
327
|
-
throw new Error('expected duplicate send-message call to succeed');
|
|
328
|
-
const firstMessage = first.data.message;
|
|
329
|
-
const secondMessage = second.data.message;
|
|
330
|
-
assert.equal(secondMessage.message_id, firstMessage.message_id);
|
|
331
|
-
assert.equal(secondMessage.to_worker, 'leader-fixed');
|
|
332
|
-
assert.equal(secondMessage.body, 'ACK: worker-1 initialized');
|
|
333
|
-
const mailbox = JSON.parse(await readFile(join(repoCwd, '.rcs', 'state', 'team', teamName, 'mailbox', 'leader-fixed.json'), 'utf-8'));
|
|
334
|
-
const workerMessages = (mailbox.messages ?? []).filter((message) => message.from_worker === 'worker-1' && message.to_worker === 'leader-fixed');
|
|
335
|
-
assert.equal(workerMessages.length, 1, 'deduped leader sends should not append duplicate worker mailbox rows');
|
|
336
|
-
const deliveryLog = [
|
|
337
|
-
...(await readTeamDeliveryLog(repoCwd)),
|
|
338
|
-
...(await readTeamDeliveryLog(workerCwd)),
|
|
339
|
-
];
|
|
340
|
-
const createdEvents = deliveryLog.filter((entry) => entry.event === 'mailbox_created'
|
|
341
|
-
&& entry.from_worker === 'worker-1'
|
|
342
|
-
&& entry.to_worker === 'leader-fixed'
|
|
343
|
-
&& entry.message_id === firstMessage.message_id);
|
|
344
|
-
assert.equal(createdEvents.length, 1, 'deduped leader sends should only emit one mailbox_created event');
|
|
345
|
-
}
|
|
346
|
-
finally {
|
|
347
|
-
if (typeof prevTeamStateRoot === 'string')
|
|
348
|
-
process.env.RCS_TEAM_STATE_ROOT = prevTeamStateRoot;
|
|
349
|
-
else
|
|
350
|
-
delete process.env.RCS_TEAM_STATE_ROOT;
|
|
351
|
-
await rm(repoCwd, { recursive: true, force: true });
|
|
352
|
-
await rm(workerCwd, { recursive: true, force: true });
|
|
353
|
-
}
|
|
354
|
-
});
|
|
355
|
-
it('returns the persisted mailbox message when bridge compat omits the mailbox row under an explicit shared state root', async () => {
|
|
356
|
-
const teamName = 'msg-team-shared-root';
|
|
357
|
-
const root = await mkdtemp(join(tmpdir(), 'rcs-interop-shared-root-'));
|
|
358
|
-
const leaderCwd = join(root, 'leader');
|
|
359
|
-
const workerCwd = join(root, 'worker-worktree');
|
|
360
|
-
const sharedStateRoot = join(root, 'shared-state');
|
|
361
|
-
const prevTeamStateRoot = process.env.RCS_TEAM_STATE_ROOT;
|
|
362
|
-
try {
|
|
363
|
-
await mkdir(leaderCwd, { recursive: true });
|
|
364
|
-
await mkdir(workerCwd, { recursive: true });
|
|
365
|
-
process.env.RCS_TEAM_STATE_ROOT = sharedStateRoot;
|
|
366
|
-
await initTeamState(teamName, 'shared state root mailbox fallback', 'executor', 2, leaderCwd);
|
|
367
|
-
await withMailboxCompatHoleRuntime(root, async () => {
|
|
368
|
-
const result = await executeTeamApiOperation('send-message', {
|
|
369
|
-
team_name: teamName,
|
|
370
|
-
from_worker: 'worker-1',
|
|
371
|
-
to_worker: 'leader-fixed',
|
|
372
|
-
body: 'shared-root hello',
|
|
373
|
-
}, workerCwd);
|
|
374
|
-
assert.equal(result.ok, true);
|
|
375
|
-
if (!result.ok)
|
|
376
|
-
throw new Error('expected send-message call to succeed');
|
|
377
|
-
const message = result.data.message;
|
|
378
|
-
assert.equal(message.body, 'shared-root hello');
|
|
379
|
-
assert.equal(message.to_worker, 'leader-fixed');
|
|
380
|
-
const mailbox = JSON.parse(await readFile(join(sharedStateRoot, 'team', teamName, 'mailbox', 'leader-fixed.json'), 'utf8'));
|
|
381
|
-
assert.equal(mailbox.messages?.length, 1);
|
|
382
|
-
});
|
|
383
|
-
}
|
|
384
|
-
finally {
|
|
385
|
-
if (typeof prevTeamStateRoot === 'string')
|
|
386
|
-
process.env.RCS_TEAM_STATE_ROOT = prevTeamStateRoot;
|
|
387
|
-
else
|
|
388
|
-
delete process.env.RCS_TEAM_STATE_ROOT;
|
|
389
|
-
await rm(root, { recursive: true, force: true });
|
|
390
|
-
}
|
|
391
|
-
});
|
|
392
|
-
it('returns error when from_worker missing', async () => {
|
|
393
|
-
const result = await executeTeamApiOperation('send-message', {
|
|
394
|
-
team_name: 'any', to_worker: 'w2', body: 'hi',
|
|
395
|
-
}, '/tmp');
|
|
396
|
-
assert.equal(result.ok, false);
|
|
397
|
-
if (!result.ok)
|
|
398
|
-
assert.match(result.error.message, /from_worker is required/);
|
|
399
|
-
});
|
|
400
|
-
it('returns error when team_name, to_worker, or body missing', async () => {
|
|
401
|
-
const result = await executeTeamApiOperation('send-message', {
|
|
402
|
-
from_worker: 'w1',
|
|
403
|
-
}, '/tmp');
|
|
404
|
-
assert.equal(result.ok, false);
|
|
405
|
-
if (!result.ok)
|
|
406
|
-
assert.match(result.error.message, /team_name.*from_worker.*to_worker.*body/);
|
|
407
|
-
});
|
|
408
|
-
});
|
|
409
|
-
// ─── broadcast ────────────────────────────────────────────────────────────
|
|
410
|
-
describe('executeTeamApiOperation: broadcast', () => {
|
|
411
|
-
it('broadcasts a message successfully', async () => {
|
|
412
|
-
const { cwd, cleanup } = await setupTeam('bc-team');
|
|
413
|
-
try {
|
|
414
|
-
const result = await executeTeamApiOperation('broadcast', {
|
|
415
|
-
team_name: 'bc-team',
|
|
416
|
-
from_worker: 'worker-1',
|
|
417
|
-
body: 'hello everyone',
|
|
418
|
-
}, cwd);
|
|
419
|
-
assert.equal(result.ok, true);
|
|
420
|
-
if (result.ok) {
|
|
421
|
-
assert.ok('count' in result.data);
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
finally {
|
|
425
|
-
await cleanup();
|
|
426
|
-
}
|
|
427
|
-
});
|
|
428
|
-
it('returns error when required fields missing', async () => {
|
|
429
|
-
const result = await executeTeamApiOperation('broadcast', {
|
|
430
|
-
team_name: 'x',
|
|
431
|
-
}, '/tmp');
|
|
432
|
-
assert.equal(result.ok, false);
|
|
433
|
-
});
|
|
434
|
-
});
|
|
435
|
-
// ─── mailbox-list ─────────────────────────────────────────────────────────
|
|
436
|
-
describe('executeTeamApiOperation: mailbox-list', () => {
|
|
437
|
-
it('lists mailbox messages (empty initially)', async () => {
|
|
438
|
-
const { cwd, cleanup } = await setupTeam('mbox-team');
|
|
439
|
-
try {
|
|
440
|
-
const result = await executeTeamApiOperation('mailbox-list', {
|
|
441
|
-
team_name: 'mbox-team',
|
|
442
|
-
worker: 'worker-1',
|
|
443
|
-
}, cwd);
|
|
444
|
-
assert.equal(result.ok, true);
|
|
445
|
-
if (result.ok) {
|
|
446
|
-
assert.equal(result.data.count, 0);
|
|
447
|
-
}
|
|
448
|
-
}
|
|
449
|
-
finally {
|
|
450
|
-
await cleanup();
|
|
451
|
-
}
|
|
452
|
-
});
|
|
453
|
-
it('filters out delivered messages when include_delivered is false', async () => {
|
|
454
|
-
const { cwd, cleanup } = await setupTeam('mbox-filter');
|
|
455
|
-
try {
|
|
456
|
-
const result = await executeTeamApiOperation('mailbox-list', {
|
|
457
|
-
team_name: 'mbox-filter',
|
|
458
|
-
worker: 'worker-1',
|
|
459
|
-
include_delivered: false,
|
|
460
|
-
}, cwd);
|
|
461
|
-
assert.equal(result.ok, true);
|
|
462
|
-
}
|
|
463
|
-
finally {
|
|
464
|
-
await cleanup();
|
|
465
|
-
}
|
|
466
|
-
});
|
|
467
|
-
it('returns error when required fields missing', async () => {
|
|
468
|
-
const result = await executeTeamApiOperation('mailbox-list', { team_name: 'x' }, '/tmp');
|
|
469
|
-
assert.equal(result.ok, false);
|
|
470
|
-
});
|
|
471
|
-
});
|
|
472
|
-
// ─── mailbox-mark-delivered ───────────────────────────────────────────────
|
|
473
|
-
describe('executeTeamApiOperation: mailbox-mark-delivered', () => {
|
|
474
|
-
it('marks a message delivered after sending and promotes matching dispatch receipt', async () => {
|
|
475
|
-
const { cwd, cleanup } = await setupTeam('mark-dlv');
|
|
476
|
-
try {
|
|
477
|
-
// Ensure the worker-2 mailbox directory exists so sendDirectMessage can write
|
|
478
|
-
await mkdir(join(cwd, '.rcs', 'state', 'team', 'mark-dlv', 'mailbox', 'worker-2'), { recursive: true });
|
|
479
|
-
const sendResult = await executeTeamApiOperation('send-message', {
|
|
480
|
-
team_name: 'mark-dlv', from_worker: 'worker-1', to_worker: 'worker-2', body: 'ack',
|
|
481
|
-
}, cwd);
|
|
482
|
-
assert.equal(sendResult.ok, true);
|
|
483
|
-
const msg = sendResult.data.message;
|
|
484
|
-
const msgId = String(msg?.message_id ?? '');
|
|
485
|
-
assert.ok(msgId, 'message should have a message_id');
|
|
486
|
-
const dispatch = await enqueueDispatchRequest('mark-dlv', {
|
|
487
|
-
kind: 'mailbox',
|
|
488
|
-
to_worker: 'worker-2',
|
|
489
|
-
worker_index: 2,
|
|
490
|
-
message_id: msgId,
|
|
491
|
-
trigger_message: 'check mailbox',
|
|
492
|
-
}, cwd);
|
|
493
|
-
const result = await executeTeamApiOperation('mailbox-mark-delivered', {
|
|
494
|
-
team_name: 'mark-dlv', worker: 'worker-2', message_id: msgId,
|
|
495
|
-
}, cwd);
|
|
496
|
-
assert.equal(result.ok, true);
|
|
497
|
-
if (!result.ok)
|
|
498
|
-
throw new Error('expected successful mailbox-mark-delivered result');
|
|
499
|
-
assert.equal(result.data.dispatch_request_id, dispatch.request.request_id);
|
|
500
|
-
assert.equal(result.data.dispatch_updated, true);
|
|
501
|
-
const updatedDispatch = await readDispatchRequest('mark-dlv', dispatch.request.request_id, cwd);
|
|
502
|
-
assert.equal(updatedDispatch?.status, 'delivered');
|
|
503
|
-
const deliveryLog = await readTeamDeliveryLog(cwd);
|
|
504
|
-
assert.ok(deliveryLog.some((entry) => entry.event === 'delivered'
|
|
505
|
-
&& entry.message_id === msgId
|
|
506
|
-
&& entry.to_worker === 'worker-2'));
|
|
507
|
-
assert.ok(deliveryLog.some((entry) => entry.event === 'mark_delivered'
|
|
508
|
-
&& entry.message_id === msgId
|
|
509
|
-
&& entry.request_id === dispatch.request.request_id
|
|
510
|
-
&& entry.dispatch_updated === true));
|
|
511
|
-
}
|
|
512
|
-
finally {
|
|
513
|
-
await cleanup();
|
|
514
|
-
}
|
|
515
|
-
});
|
|
516
|
-
it('marks leader-fixed mailbox delivery from a worker worktree and resolves the matching dispatch receipt', async () => {
|
|
517
|
-
const teamName = 'mark-dlv-leader-worktree';
|
|
518
|
-
const repoCwd = await mkdtemp(join(tmpdir(), 'rcs-interop-mark-dlv-root-'));
|
|
519
|
-
const workerCwd = await mkdtemp(join(tmpdir(), 'rcs-interop-mark-dlv-worktree-'));
|
|
520
|
-
const prevTeamStateRoot = process.env.RCS_TEAM_STATE_ROOT;
|
|
521
|
-
delete process.env.RCS_TEAM_STATE_ROOT;
|
|
522
|
-
try {
|
|
523
|
-
await initTeamState(teamName, 'leader mailbox delivery receipt', 'executor', 2, repoCwd);
|
|
524
|
-
process.env.RCS_TEAM_STATE_ROOT = join(repoCwd, '.rcs', 'state');
|
|
525
|
-
const sendResult = await executeTeamApiOperation('send-message', {
|
|
526
|
-
team_name: teamName,
|
|
527
|
-
from_worker: 'worker-1',
|
|
528
|
-
to_worker: 'leader-fixed',
|
|
529
|
-
body: 'DONE: worker-1 finished a mailbox integrity probe',
|
|
530
|
-
}, workerCwd);
|
|
531
|
-
assert.equal(sendResult.ok, true);
|
|
532
|
-
if (!sendResult.ok)
|
|
533
|
-
throw new Error('expected successful leader send-message result');
|
|
534
|
-
const message = sendResult.data.message;
|
|
535
|
-
const messageId = String(message.message_id ?? '');
|
|
536
|
-
assert.ok(messageId, 'leader mailbox message should include a message_id');
|
|
537
|
-
const pendingRequests = await listDispatchRequests(teamName, repoCwd, { kind: 'mailbox', to_worker: 'leader-fixed' });
|
|
538
|
-
const pendingDispatch = pendingRequests.find((request) => request.message_id === messageId);
|
|
539
|
-
assert.ok(pendingDispatch, 'leader mailbox send should enqueue a matching dispatch request');
|
|
540
|
-
const result = await executeTeamApiOperation('mailbox-mark-delivered', {
|
|
541
|
-
team_name: teamName,
|
|
542
|
-
worker: 'leader-fixed',
|
|
543
|
-
message_id: messageId,
|
|
544
|
-
}, workerCwd);
|
|
545
|
-
assert.equal(result.ok, true);
|
|
546
|
-
if (!result.ok)
|
|
547
|
-
throw new Error('expected successful leader mailbox-mark-delivered result');
|
|
548
|
-
assert.equal(result.data.updated, true);
|
|
549
|
-
assert.equal(result.data.dispatch_request_id, pendingDispatch?.request_id);
|
|
550
|
-
assert.equal(result.data.dispatch_updated, true);
|
|
551
|
-
const updatedDispatch = await readDispatchRequest(teamName, pendingDispatch.request_id, repoCwd);
|
|
552
|
-
assert.equal(updatedDispatch?.status, 'delivered');
|
|
553
|
-
assert.ok(updatedDispatch?.delivered_at, 'leader dispatch receipt should record delivered_at');
|
|
554
|
-
const leaderMailbox = JSON.parse(await readFile(join(repoCwd, '.rcs', 'state', 'team', teamName, 'mailbox', 'leader-fixed.json'), 'utf-8'));
|
|
555
|
-
const deliveredMessage = (leaderMailbox.messages ?? []).find((entry) => entry.message_id === messageId);
|
|
556
|
-
assert.equal(typeof deliveredMessage?.delivered_at, 'string');
|
|
557
|
-
}
|
|
558
|
-
finally {
|
|
559
|
-
if (typeof prevTeamStateRoot === 'string')
|
|
560
|
-
process.env.RCS_TEAM_STATE_ROOT = prevTeamStateRoot;
|
|
561
|
-
else
|
|
562
|
-
delete process.env.RCS_TEAM_STATE_ROOT;
|
|
563
|
-
await rm(repoCwd, { recursive: true, force: true });
|
|
564
|
-
await rm(workerCwd, { recursive: true, force: true });
|
|
565
|
-
}
|
|
566
|
-
});
|
|
567
|
-
it('reports when no matching mailbox dispatch request exists', async () => {
|
|
568
|
-
const { cwd, cleanup } = await setupTeam('mark-dlv-no-dispatch');
|
|
569
|
-
try {
|
|
570
|
-
const message = await sendDirectMessage('mark-dlv-no-dispatch', 'worker-1', 'worker-2', 'ack', cwd);
|
|
571
|
-
const result = await executeTeamApiOperation('mailbox-mark-delivered', {
|
|
572
|
-
team_name: 'mark-dlv-no-dispatch',
|
|
573
|
-
worker: 'worker-2',
|
|
574
|
-
message_id: message.message_id,
|
|
575
|
-
}, cwd);
|
|
576
|
-
assert.equal(result.ok, true);
|
|
577
|
-
if (!result.ok)
|
|
578
|
-
throw new Error('expected success envelope');
|
|
579
|
-
assert.equal(result.data.dispatch_request_id, null);
|
|
580
|
-
assert.equal(result.data.dispatch_updated, false);
|
|
581
|
-
}
|
|
582
|
-
finally {
|
|
583
|
-
await cleanup();
|
|
584
|
-
}
|
|
585
|
-
});
|
|
586
|
-
it('returns error when required fields missing', async () => {
|
|
587
|
-
const result = await executeTeamApiOperation('mailbox-mark-delivered', {
|
|
588
|
-
team_name: 'x', worker: 'w',
|
|
589
|
-
}, '/tmp');
|
|
590
|
-
assert.equal(result.ok, false);
|
|
591
|
-
});
|
|
592
|
-
});
|
|
593
|
-
// ─── mailbox-mark-notified ────────────────────────────────────────────────
|
|
594
|
-
describe('executeTeamApiOperation: mailbox-mark-notified', () => {
|
|
595
|
-
it('marks a message notified after sending', async () => {
|
|
596
|
-
const { cwd, cleanup } = await setupTeam('mark-ntf');
|
|
597
|
-
try {
|
|
598
|
-
// Ensure the worker-2 mailbox directory exists so sendDirectMessage can write
|
|
599
|
-
await mkdir(join(cwd, '.rcs', 'state', 'team', 'mark-ntf', 'mailbox', 'worker-2'), { recursive: true });
|
|
600
|
-
const sendResult = await executeTeamApiOperation('send-message', {
|
|
601
|
-
team_name: 'mark-ntf', from_worker: 'worker-1', to_worker: 'worker-2', body: 'notify me',
|
|
602
|
-
}, cwd);
|
|
603
|
-
// Send must succeed to test mark-notified
|
|
604
|
-
assert.equal(sendResult.ok, true);
|
|
605
|
-
const msg = sendResult.data.message;
|
|
606
|
-
const msgId = String(msg?.message_id ?? '');
|
|
607
|
-
assert.ok(msgId, 'message should have a message_id');
|
|
608
|
-
const result = await executeTeamApiOperation('mailbox-mark-notified', {
|
|
609
|
-
team_name: 'mark-ntf', worker: 'worker-2', message_id: msgId,
|
|
610
|
-
}, cwd);
|
|
611
|
-
// Mark operation returns a valid envelope (pass or fail based on state layer)
|
|
612
|
-
assert.ok(typeof result.ok === 'boolean');
|
|
613
|
-
}
|
|
614
|
-
finally {
|
|
615
|
-
await cleanup();
|
|
616
|
-
}
|
|
617
|
-
});
|
|
618
|
-
it('returns error when required fields missing', async () => {
|
|
619
|
-
const result = await executeTeamApiOperation('mailbox-mark-notified', {
|
|
620
|
-
team_name: 'x',
|
|
621
|
-
}, '/tmp');
|
|
622
|
-
assert.equal(result.ok, false);
|
|
623
|
-
});
|
|
624
|
-
});
|
|
625
|
-
// ─── create-task ──────────────────────────────────────────────────────────
|
|
626
|
-
describe('executeTeamApiOperation: create-task', () => {
|
|
627
|
-
it('creates a task successfully', async () => {
|
|
628
|
-
const { cwd, cleanup } = await setupTeam('create-tsk');
|
|
629
|
-
try {
|
|
630
|
-
const result = await executeTeamApiOperation('create-task', {
|
|
631
|
-
team_name: 'create-tsk',
|
|
632
|
-
subject: 'My task',
|
|
633
|
-
description: 'Description here',
|
|
634
|
-
}, cwd);
|
|
635
|
-
assert.equal(result.ok, true);
|
|
636
|
-
if (result.ok) {
|
|
637
|
-
assert.ok(result.data.task);
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
finally {
|
|
641
|
-
await cleanup();
|
|
642
|
-
}
|
|
643
|
-
});
|
|
644
|
-
it('creates a task with optional fields', async () => {
|
|
645
|
-
const { cwd, cleanup } = await setupTeam('create-tsk-opt');
|
|
646
|
-
try {
|
|
647
|
-
const result = await executeTeamApiOperation('create-task', {
|
|
648
|
-
team_name: 'create-tsk-opt',
|
|
649
|
-
subject: 'Owned task',
|
|
650
|
-
description: 'Has owner',
|
|
651
|
-
owner: 'worker-1',
|
|
652
|
-
blocked_by: ['999'],
|
|
653
|
-
requires_code_change: true,
|
|
654
|
-
}, cwd);
|
|
655
|
-
assert.equal(result.ok, true);
|
|
656
|
-
}
|
|
657
|
-
finally {
|
|
658
|
-
await cleanup();
|
|
659
|
-
}
|
|
660
|
-
});
|
|
661
|
-
it('returns error when required fields missing', async () => {
|
|
662
|
-
const result = await executeTeamApiOperation('create-task', {
|
|
663
|
-
team_name: 'x', subject: 'only subject',
|
|
664
|
-
}, '/tmp');
|
|
665
|
-
assert.equal(result.ok, false);
|
|
666
|
-
});
|
|
667
|
-
});
|
|
668
|
-
// ─── read-task ────────────────────────────────────────────────────────────
|
|
669
|
-
describe('executeTeamApiOperation: read-task', () => {
|
|
670
|
-
it('reads an existing task', async () => {
|
|
671
|
-
const { cwd, cleanup } = await setupTeam('read-tsk');
|
|
672
|
-
try {
|
|
673
|
-
const task = await createTask('read-tsk', {
|
|
674
|
-
subject: 'Readable', description: 'A task to read', status: 'pending',
|
|
675
|
-
}, cwd);
|
|
676
|
-
const result = await executeTeamApiOperation('read-task', {
|
|
677
|
-
team_name: 'read-tsk', task_id: task.id,
|
|
678
|
-
}, cwd);
|
|
679
|
-
assert.equal(result.ok, true);
|
|
680
|
-
if (result.ok)
|
|
681
|
-
assert.ok(result.data.task);
|
|
682
|
-
}
|
|
683
|
-
finally {
|
|
684
|
-
await cleanup();
|
|
685
|
-
}
|
|
686
|
-
});
|
|
687
|
-
it('returns task_not_found for nonexistent task', async () => {
|
|
688
|
-
const { cwd, cleanup } = await setupTeam('read-tsk-nf');
|
|
689
|
-
try {
|
|
690
|
-
const result = await executeTeamApiOperation('read-task', {
|
|
691
|
-
team_name: 'read-tsk-nf', task_id: '9999',
|
|
692
|
-
}, cwd);
|
|
693
|
-
assert.equal(result.ok, false);
|
|
694
|
-
if (!result.ok)
|
|
695
|
-
assert.equal(result.error.code, 'task_not_found');
|
|
696
|
-
}
|
|
697
|
-
finally {
|
|
698
|
-
await cleanup();
|
|
699
|
-
}
|
|
700
|
-
});
|
|
701
|
-
it('returns error when required fields missing', async () => {
|
|
702
|
-
const result = await executeTeamApiOperation('read-task', { team_name: 'x' }, '/tmp');
|
|
703
|
-
assert.equal(result.ok, false);
|
|
704
|
-
});
|
|
705
|
-
});
|
|
706
|
-
// ─── list-tasks ───────────────────────────────────────────────────────────
|
|
707
|
-
describe('executeTeamApiOperation: list-tasks', () => {
|
|
708
|
-
it('lists tasks for a team', async () => {
|
|
709
|
-
const { cwd, cleanup } = await setupTeam('list-tsk');
|
|
710
|
-
try {
|
|
711
|
-
await createTask('list-tsk', { subject: 'T1', description: 'D1', status: 'pending' }, cwd);
|
|
712
|
-
const result = await executeTeamApiOperation('list-tasks', {
|
|
713
|
-
team_name: 'list-tsk',
|
|
714
|
-
}, cwd);
|
|
715
|
-
assert.equal(result.ok, true);
|
|
716
|
-
if (result.ok) {
|
|
717
|
-
assert.ok(result.data.count >= 1);
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
finally {
|
|
721
|
-
await cleanup();
|
|
722
|
-
}
|
|
723
|
-
});
|
|
724
|
-
it('resolves team working directory from manifest metadata over worker identity/config fallbacks', async () => {
|
|
725
|
-
const teamName = 'list-tsk-meta';
|
|
726
|
-
const cwdA = await mkdtemp(join(tmpdir(), 'rcs-interop-meta-a-'));
|
|
727
|
-
const cwdB = await mkdtemp(join(tmpdir(), 'rcs-interop-meta-b-'));
|
|
728
|
-
const prevTeamWorker = process.env.RCS_TEAM_WORKER;
|
|
729
|
-
const prevTeamStateRoot = process.env.RCS_TEAM_STATE_ROOT;
|
|
730
|
-
delete process.env.RCS_TEAM_STATE_ROOT;
|
|
731
|
-
process.env.RCS_TEAM_WORKER = `${teamName}/worker-1`;
|
|
732
|
-
try {
|
|
733
|
-
await initTeamState(teamName, 'metadata precedence', 'executor', 2, cwdA);
|
|
734
|
-
await initTeamState(teamName, 'metadata precedence', 'executor', 2, cwdB);
|
|
735
|
-
await createTask(teamName, { subject: 'From manifest root', description: 'B lane', status: 'pending' }, cwdB);
|
|
736
|
-
const teamRootA = join(cwdA, '.rcs', 'state', 'team', teamName);
|
|
737
|
-
const configPath = join(teamRootA, 'config.json');
|
|
738
|
-
const manifestPath = join(teamRootA, 'manifest.v2.json');
|
|
739
|
-
const config = JSON.parse(await readFile(configPath, 'utf-8'));
|
|
740
|
-
const manifest = JSON.parse(await readFile(manifestPath, 'utf-8'));
|
|
741
|
-
config.team_state_root = join(cwdA, '.rcs', 'state');
|
|
742
|
-
manifest.team_state_root = join(cwdB, '.rcs', 'state');
|
|
743
|
-
await writeFile(configPath, `${JSON.stringify(config, null, 2)}\n`, 'utf8');
|
|
744
|
-
await writeFile(manifestPath, `${JSON.stringify(manifest, null, 2)}\n`, 'utf8');
|
|
745
|
-
const result = await executeTeamApiOperation('list-tasks', { team_name: teamName }, cwdA);
|
|
746
|
-
assert.equal(result.ok, true);
|
|
747
|
-
if (!result.ok)
|
|
748
|
-
throw new Error('expected list-tasks to succeed');
|
|
749
|
-
assert.equal(result.data.count, 1);
|
|
750
|
-
}
|
|
751
|
-
finally {
|
|
752
|
-
if (typeof prevTeamWorker === 'string')
|
|
753
|
-
process.env.RCS_TEAM_WORKER = prevTeamWorker;
|
|
754
|
-
else
|
|
755
|
-
delete process.env.RCS_TEAM_WORKER;
|
|
756
|
-
if (typeof prevTeamStateRoot === 'string')
|
|
757
|
-
process.env.RCS_TEAM_STATE_ROOT = prevTeamStateRoot;
|
|
758
|
-
else
|
|
759
|
-
delete process.env.RCS_TEAM_STATE_ROOT;
|
|
760
|
-
await rm(cwdA, { recursive: true, force: true });
|
|
761
|
-
await rm(cwdB, { recursive: true, force: true });
|
|
762
|
-
}
|
|
763
|
-
});
|
|
764
|
-
it('resolves display team names from RCS_TEAM_STATE_ROOT when API calls run outside the leader cwd', async () => {
|
|
765
|
-
const { cwd: leaderCwd, cleanup } = await setupDisplayTeam('api-root-display-11111111', 'api-root-display', 'session-api-root-display');
|
|
766
|
-
const workerCwd = await mkdtemp(join(tmpdir(), 'rcs-interop-api-root-worker-'));
|
|
767
|
-
try {
|
|
768
|
-
process.env.RCS_TEAM_STATE_ROOT = join(leaderCwd, '.rcs', 'state');
|
|
769
|
-
await createTask('api-root-display-11111111', { subject: 'From shared root', description: 'D', status: 'pending' }, leaderCwd);
|
|
770
|
-
const event = await appendTeamEvent('api-root-display-11111111', {
|
|
771
|
-
type: 'task_completed',
|
|
772
|
-
worker: 'worker-1',
|
|
773
|
-
task_id: '1',
|
|
774
|
-
}, leaderCwd);
|
|
775
|
-
await writeMonitorSnapshot('api-root-display-11111111', {
|
|
776
|
-
taskStatusById: { '1': 'pending' },
|
|
777
|
-
workerAliveByName: { 'worker-1': true, 'worker-2': true },
|
|
778
|
-
workerStateByName: { 'worker-1': 'idle', 'worker-2': 'working' },
|
|
779
|
-
workerTurnCountByName: { 'worker-1': 1, 'worker-2': 1 },
|
|
780
|
-
workerTaskIdByName: { 'worker-1': '1', 'worker-2': '1' },
|
|
781
|
-
mailboxNotifiedByMessageId: {},
|
|
782
|
-
completedEventTaskIds: {},
|
|
783
|
-
}, leaderCwd);
|
|
784
|
-
const listResult = await executeTeamApiOperation('list-tasks', { team_name: 'api-root-display' }, workerCwd);
|
|
785
|
-
assert.equal(listResult.ok, true);
|
|
786
|
-
if (!listResult.ok)
|
|
787
|
-
throw new Error('expected list-tasks to succeed');
|
|
788
|
-
assert.equal(listResult.data.count, 1);
|
|
789
|
-
assert.equal(listResult.data.tasks[0]?.subject, 'From shared root');
|
|
790
|
-
const eventsResult = await executeTeamApiOperation('read-events', {
|
|
791
|
-
team_name: 'api-root-display',
|
|
792
|
-
type: 'task_completed',
|
|
793
|
-
}, workerCwd);
|
|
794
|
-
assert.equal(eventsResult.ok, true);
|
|
795
|
-
if (!eventsResult.ok)
|
|
796
|
-
throw new Error('expected read-events to succeed');
|
|
797
|
-
assert.equal(eventsResult.data.count, 1);
|
|
798
|
-
assert.equal(eventsResult.data.events[0]?.event_id, event.event_id);
|
|
799
|
-
const idleResult = await executeTeamApiOperation('read-idle-state', { team_name: 'api-root-display' }, workerCwd);
|
|
800
|
-
assert.equal(idleResult.ok, true);
|
|
801
|
-
if (!idleResult.ok)
|
|
802
|
-
throw new Error('expected read-idle-state to succeed');
|
|
803
|
-
assert.equal(idleResult.data.team_name, 'api-root-display-11111111');
|
|
804
|
-
assert.deepEqual(idleResult.data.idle_workers, ['worker-1']);
|
|
805
|
-
}
|
|
806
|
-
finally {
|
|
807
|
-
await rm(workerCwd, { recursive: true, force: true });
|
|
808
|
-
await cleanup();
|
|
809
|
-
}
|
|
810
|
-
});
|
|
811
|
-
it('prefers RCS_TEAM_STATE_ROOT over manifest metadata when resolving the team working directory', async () => {
|
|
812
|
-
const teamName = 'list-tsk-env-root';
|
|
813
|
-
const cwdA = await mkdtemp(join(tmpdir(), 'rcs-interop-env-a-'));
|
|
814
|
-
const cwdB = await mkdtemp(join(tmpdir(), 'rcs-interop-env-b-'));
|
|
815
|
-
const prevTeamWorker = process.env.RCS_TEAM_WORKER;
|
|
816
|
-
const prevTeamStateRoot = process.env.RCS_TEAM_STATE_ROOT;
|
|
817
|
-
delete process.env.RCS_TEAM_STATE_ROOT;
|
|
818
|
-
process.env.RCS_TEAM_WORKER = `${teamName}/worker-1`;
|
|
819
|
-
try {
|
|
820
|
-
await initTeamState(teamName, 'env root precedence', 'executor', 2, cwdA);
|
|
821
|
-
await initTeamState(teamName, 'env root precedence', 'executor', 2, cwdB);
|
|
822
|
-
await createTask(teamName, { subject: 'From env root', description: 'A lane', status: 'pending' }, cwdA);
|
|
823
|
-
await createTask(teamName, { subject: 'From manifest root', description: 'B lane', status: 'pending' }, cwdB);
|
|
824
|
-
const teamRootA = join(cwdA, '.rcs', 'state', 'team', teamName);
|
|
825
|
-
const manifestPath = join(teamRootA, 'manifest.v2.json');
|
|
826
|
-
const manifest = JSON.parse(await readFile(manifestPath, 'utf-8'));
|
|
827
|
-
manifest.team_state_root = join(cwdB, '.rcs', 'state');
|
|
828
|
-
await writeFile(manifestPath, `${JSON.stringify(manifest, null, 2)}\n`, 'utf8');
|
|
829
|
-
process.env.RCS_TEAM_STATE_ROOT = join(cwdA, '.rcs', 'state');
|
|
830
|
-
const result = await executeTeamApiOperation('list-tasks', { team_name: teamName }, cwdB);
|
|
831
|
-
assert.equal(result.ok, true);
|
|
832
|
-
if (!result.ok)
|
|
833
|
-
throw new Error('expected list-tasks to succeed');
|
|
834
|
-
assert.equal(result.data.count, 1);
|
|
835
|
-
const tasks = result.data.tasks;
|
|
836
|
-
assert.equal(tasks[0]?.subject, 'From env root');
|
|
837
|
-
}
|
|
838
|
-
finally {
|
|
839
|
-
if (typeof prevTeamWorker === 'string')
|
|
840
|
-
process.env.RCS_TEAM_WORKER = prevTeamWorker;
|
|
841
|
-
else
|
|
842
|
-
delete process.env.RCS_TEAM_WORKER;
|
|
843
|
-
if (typeof prevTeamStateRoot === 'string')
|
|
844
|
-
process.env.RCS_TEAM_STATE_ROOT = prevTeamStateRoot;
|
|
845
|
-
else
|
|
846
|
-
delete process.env.RCS_TEAM_STATE_ROOT;
|
|
847
|
-
await rm(cwdA, { recursive: true, force: true });
|
|
848
|
-
await rm(cwdB, { recursive: true, force: true });
|
|
849
|
-
}
|
|
850
|
-
});
|
|
851
|
-
it('returns error when team_name missing', async () => {
|
|
852
|
-
const result = await executeTeamApiOperation('list-tasks', {}, '/tmp');
|
|
853
|
-
assert.equal(result.ok, false);
|
|
854
|
-
});
|
|
855
|
-
});
|
|
856
|
-
// ─── update-task ──────────────────────────────────────────────────────────
|
|
857
|
-
describe('executeTeamApiOperation: update-task', () => {
|
|
858
|
-
it('updates task subject and description', async () => {
|
|
859
|
-
const { cwd, cleanup } = await setupTeam('upd-tsk');
|
|
860
|
-
try {
|
|
861
|
-
const task = await createTask('upd-tsk', { subject: 'Old', description: 'Old desc', status: 'pending' }, cwd);
|
|
862
|
-
const result = await executeTeamApiOperation('update-task', {
|
|
863
|
-
team_name: 'upd-tsk', task_id: task.id,
|
|
864
|
-
subject: 'New subject', description: 'New desc',
|
|
865
|
-
}, cwd);
|
|
866
|
-
assert.equal(result.ok, true);
|
|
867
|
-
}
|
|
868
|
-
finally {
|
|
869
|
-
await cleanup();
|
|
870
|
-
}
|
|
871
|
-
});
|
|
872
|
-
it('rejects lifecycle fields (status, owner, result, error)', async () => {
|
|
873
|
-
const { cwd, cleanup } = await setupTeam('upd-tsk-lc');
|
|
874
|
-
try {
|
|
875
|
-
const task = await createTask('upd-tsk-lc', { subject: 'X', description: 'Y', status: 'pending' }, cwd);
|
|
876
|
-
const result = await executeTeamApiOperation('update-task', {
|
|
877
|
-
team_name: 'upd-tsk-lc', task_id: task.id, status: 'completed',
|
|
878
|
-
}, cwd);
|
|
879
|
-
assert.equal(result.ok, false);
|
|
880
|
-
if (!result.ok)
|
|
881
|
-
assert.match(result.error.message, /lifecycle fields/);
|
|
882
|
-
}
|
|
883
|
-
finally {
|
|
884
|
-
await cleanup();
|
|
885
|
-
}
|
|
886
|
-
});
|
|
887
|
-
it('rejects unexpected fields', async () => {
|
|
888
|
-
const { cwd, cleanup } = await setupTeam('upd-tsk-uf');
|
|
889
|
-
try {
|
|
890
|
-
const task = await createTask('upd-tsk-uf', { subject: 'X', description: 'Y', status: 'pending' }, cwd);
|
|
891
|
-
const result = await executeTeamApiOperation('update-task', {
|
|
892
|
-
team_name: 'upd-tsk-uf', task_id: task.id, random_field: 'bad',
|
|
893
|
-
}, cwd);
|
|
894
|
-
assert.equal(result.ok, false);
|
|
895
|
-
if (!result.ok)
|
|
896
|
-
assert.match(result.error.message, /unsupported fields/);
|
|
897
|
-
}
|
|
898
|
-
finally {
|
|
899
|
-
await cleanup();
|
|
900
|
-
}
|
|
901
|
-
});
|
|
902
|
-
it('rejects non-string subject', async () => {
|
|
903
|
-
const { cwd, cleanup } = await setupTeam('upd-tsk-ns');
|
|
904
|
-
try {
|
|
905
|
-
const task = await createTask('upd-tsk-ns', { subject: 'X', description: 'Y', status: 'pending' }, cwd);
|
|
906
|
-
const result = await executeTeamApiOperation('update-task', {
|
|
907
|
-
team_name: 'upd-tsk-ns', task_id: task.id, subject: 123,
|
|
908
|
-
}, cwd);
|
|
909
|
-
assert.equal(result.ok, false);
|
|
910
|
-
if (!result.ok)
|
|
911
|
-
assert.match(result.error.message, /subject must be a string/);
|
|
912
|
-
}
|
|
913
|
-
finally {
|
|
914
|
-
await cleanup();
|
|
915
|
-
}
|
|
916
|
-
});
|
|
917
|
-
it('rejects non-string description', async () => {
|
|
918
|
-
const { cwd, cleanup } = await setupTeam('upd-tsk-nd');
|
|
919
|
-
try {
|
|
920
|
-
const task = await createTask('upd-tsk-nd', { subject: 'X', description: 'Y', status: 'pending' }, cwd);
|
|
921
|
-
const result = await executeTeamApiOperation('update-task', {
|
|
922
|
-
team_name: 'upd-tsk-nd', task_id: task.id, description: 42,
|
|
923
|
-
}, cwd);
|
|
924
|
-
assert.equal(result.ok, false);
|
|
925
|
-
if (!result.ok)
|
|
926
|
-
assert.match(result.error.message, /description must be a string/);
|
|
927
|
-
}
|
|
928
|
-
finally {
|
|
929
|
-
await cleanup();
|
|
930
|
-
}
|
|
931
|
-
});
|
|
932
|
-
it('rejects non-boolean requires_code_change', async () => {
|
|
933
|
-
const { cwd, cleanup } = await setupTeam('upd-tsk-rcc');
|
|
934
|
-
try {
|
|
935
|
-
const task = await createTask('upd-tsk-rcc', { subject: 'X', description: 'Y', status: 'pending' }, cwd);
|
|
936
|
-
const result = await executeTeamApiOperation('update-task', {
|
|
937
|
-
team_name: 'upd-tsk-rcc', task_id: task.id, requires_code_change: 'yes',
|
|
938
|
-
}, cwd);
|
|
939
|
-
assert.equal(result.ok, false);
|
|
940
|
-
if (!result.ok)
|
|
941
|
-
assert.match(result.error.message, /requires_code_change must be a boolean/);
|
|
942
|
-
}
|
|
943
|
-
finally {
|
|
944
|
-
await cleanup();
|
|
945
|
-
}
|
|
946
|
-
});
|
|
947
|
-
it('validates blocked_by as array of valid task IDs', async () => {
|
|
948
|
-
const { cwd, cleanup } = await setupTeam('upd-tsk-bb');
|
|
949
|
-
try {
|
|
950
|
-
const task = await createTask('upd-tsk-bb', { subject: 'X', description: 'Y', status: 'pending' }, cwd);
|
|
951
|
-
const result = await executeTeamApiOperation('update-task', {
|
|
952
|
-
team_name: 'upd-tsk-bb', task_id: task.id, blocked_by: 'not-an-array',
|
|
953
|
-
}, cwd);
|
|
954
|
-
assert.equal(result.ok, false);
|
|
955
|
-
if (!result.ok)
|
|
956
|
-
assert.match(result.error.message, /must be an array/);
|
|
957
|
-
}
|
|
958
|
-
finally {
|
|
959
|
-
await cleanup();
|
|
960
|
-
}
|
|
961
|
-
});
|
|
962
|
-
it('rejects blocked_by with non-string entries', async () => {
|
|
963
|
-
const { cwd, cleanup } = await setupTeam('upd-tsk-bbns');
|
|
964
|
-
try {
|
|
965
|
-
const task = await createTask('upd-tsk-bbns', { subject: 'X', description: 'Y', status: 'pending' }, cwd);
|
|
966
|
-
const result = await executeTeamApiOperation('update-task', {
|
|
967
|
-
team_name: 'upd-tsk-bbns', task_id: task.id, blocked_by: [123],
|
|
968
|
-
}, cwd);
|
|
969
|
-
assert.equal(result.ok, false);
|
|
970
|
-
if (!result.ok)
|
|
971
|
-
assert.match(result.error.message, /entries must be strings/);
|
|
972
|
-
}
|
|
973
|
-
finally {
|
|
974
|
-
await cleanup();
|
|
975
|
-
}
|
|
976
|
-
});
|
|
977
|
-
it('rejects blocked_by with invalid task ID format', async () => {
|
|
978
|
-
const { cwd, cleanup } = await setupTeam('upd-tsk-bbid');
|
|
979
|
-
try {
|
|
980
|
-
const task = await createTask('upd-tsk-bbid', { subject: 'X', description: 'Y', status: 'pending' }, cwd);
|
|
981
|
-
const result = await executeTeamApiOperation('update-task', {
|
|
982
|
-
team_name: 'upd-tsk-bbid', task_id: task.id, blocked_by: ['abc'],
|
|
983
|
-
}, cwd);
|
|
984
|
-
assert.equal(result.ok, false);
|
|
985
|
-
if (!result.ok)
|
|
986
|
-
assert.match(result.error.message, /invalid task ID/);
|
|
987
|
-
}
|
|
988
|
-
finally {
|
|
989
|
-
await cleanup();
|
|
990
|
-
}
|
|
991
|
-
});
|
|
992
|
-
it('returns task_not_found when task does not exist', async () => {
|
|
993
|
-
const { cwd, cleanup } = await setupTeam('upd-tsk-nf');
|
|
994
|
-
try {
|
|
995
|
-
const result = await executeTeamApiOperation('update-task', {
|
|
996
|
-
team_name: 'upd-tsk-nf', task_id: '9999', subject: 'New',
|
|
997
|
-
}, cwd);
|
|
998
|
-
assert.equal(result.ok, false);
|
|
999
|
-
if (!result.ok)
|
|
1000
|
-
assert.equal(result.error.code, 'task_not_found');
|
|
1001
|
-
}
|
|
1002
|
-
finally {
|
|
1003
|
-
await cleanup();
|
|
1004
|
-
}
|
|
1005
|
-
});
|
|
1006
|
-
});
|
|
1007
|
-
// ─── claim-task ───────────────────────────────────────────────────────────
|
|
1008
|
-
describe('executeTeamApiOperation: claim-task', () => {
|
|
1009
|
-
it('claims a task successfully', async () => {
|
|
1010
|
-
const { cwd, cleanup } = await setupTeam('claim-tsk');
|
|
1011
|
-
try {
|
|
1012
|
-
const task = await createTask('claim-tsk', { subject: 'Claim me', description: 'D', status: 'pending' }, cwd);
|
|
1013
|
-
const result = await executeTeamApiOperation('claim-task', {
|
|
1014
|
-
team_name: 'claim-tsk', task_id: task.id, worker: 'worker-1',
|
|
1015
|
-
}, cwd);
|
|
1016
|
-
assert.equal(result.ok, true);
|
|
1017
|
-
}
|
|
1018
|
-
finally {
|
|
1019
|
-
await cleanup();
|
|
1020
|
-
}
|
|
1021
|
-
});
|
|
1022
|
-
it('rejects non-integer expected_version', async () => {
|
|
1023
|
-
const result = await executeTeamApiOperation('claim-task', {
|
|
1024
|
-
team_name: 'x', task_id: '1', worker: 'w1', expected_version: 'abc',
|
|
1025
|
-
}, '/tmp');
|
|
1026
|
-
assert.equal(result.ok, false);
|
|
1027
|
-
if (!result.ok)
|
|
1028
|
-
assert.match(result.error.message, /expected_version must be a positive integer/);
|
|
1029
|
-
});
|
|
1030
|
-
it('rejects zero expected_version', async () => {
|
|
1031
|
-
const result = await executeTeamApiOperation('claim-task', {
|
|
1032
|
-
team_name: 'x', task_id: '1', worker: 'w1', expected_version: 0,
|
|
1033
|
-
}, '/tmp');
|
|
1034
|
-
assert.equal(result.ok, false);
|
|
1035
|
-
if (!result.ok)
|
|
1036
|
-
assert.match(result.error.message, /expected_version must be a positive integer/);
|
|
1037
|
-
});
|
|
1038
|
-
it('returns error when required fields missing', async () => {
|
|
1039
|
-
const result = await executeTeamApiOperation('claim-task', {
|
|
1040
|
-
team_name: 'x', task_id: '1',
|
|
1041
|
-
}, '/tmp');
|
|
1042
|
-
assert.equal(result.ok, false);
|
|
1043
|
-
});
|
|
1044
|
-
});
|
|
1045
|
-
// ─── transition-task-status ───────────────────────────────────────────────
|
|
1046
|
-
describe('executeTeamApiOperation: transition-task-status', () => {
|
|
1047
|
-
it('returns error when required fields missing', async () => {
|
|
1048
|
-
const result = await executeTeamApiOperation('transition-task-status', {
|
|
1049
|
-
team_name: 'x', task_id: '1', from: 'in_progress',
|
|
1050
|
-
}, '/tmp');
|
|
1051
|
-
assert.equal(result.ok, false);
|
|
1052
|
-
});
|
|
1053
|
-
it('rejects invalid status values', async () => {
|
|
1054
|
-
const result = await executeTeamApiOperation('transition-task-status', {
|
|
1055
|
-
team_name: 'x', task_id: '1', from: 'invalid', to: 'completed', claim_token: 'tok',
|
|
1056
|
-
}, '/tmp');
|
|
1057
|
-
assert.equal(result.ok, false);
|
|
1058
|
-
if (!result.ok)
|
|
1059
|
-
assert.match(result.error.message, /valid task statuses/);
|
|
1060
|
-
});
|
|
1061
|
-
it('persists optional result and error payloads', async () => {
|
|
1062
|
-
const { cwd, cleanup } = await setupTeam('transition-payload');
|
|
1063
|
-
try {
|
|
1064
|
-
const completedTask = await createTask('transition-payload', { subject: 'done', description: 'd', status: 'pending' }, cwd);
|
|
1065
|
-
const claimCompleted = await executeTeamApiOperation('claim-task', {
|
|
1066
|
-
team_name: 'transition-payload', task_id: completedTask.id, worker: 'worker-1',
|
|
1067
|
-
}, cwd);
|
|
1068
|
-
assert.equal(claimCompleted.ok, true);
|
|
1069
|
-
if (!claimCompleted.ok)
|
|
1070
|
-
return;
|
|
1071
|
-
const completedClaimToken = String(claimCompleted.data.claimToken);
|
|
1072
|
-
const completedResult = 'Verification:\nPASS - transition evidence stored';
|
|
1073
|
-
const completedTransition = await executeTeamApiOperation('transition-task-status', {
|
|
1074
|
-
team_name: 'transition-payload',
|
|
1075
|
-
task_id: completedTask.id,
|
|
1076
|
-
from: 'in_progress',
|
|
1077
|
-
to: 'completed',
|
|
1078
|
-
claim_token: completedClaimToken,
|
|
1079
|
-
result: completedResult,
|
|
1080
|
-
}, cwd);
|
|
1081
|
-
assert.equal(completedTransition.ok, true);
|
|
1082
|
-
const completedReread = await readTask('transition-payload', completedTask.id, cwd);
|
|
1083
|
-
assert.equal(completedReread?.result, completedResult);
|
|
1084
|
-
assert.equal(completedReread?.error, undefined);
|
|
1085
|
-
const failedTask = await createTask('transition-payload', { subject: 'fail', description: 'd', status: 'pending' }, cwd);
|
|
1086
|
-
const claimFailed = await executeTeamApiOperation('claim-task', {
|
|
1087
|
-
team_name: 'transition-payload', task_id: failedTask.id, worker: 'worker-1',
|
|
1088
|
-
}, cwd);
|
|
1089
|
-
assert.equal(claimFailed.ok, true);
|
|
1090
|
-
if (!claimFailed.ok)
|
|
1091
|
-
return;
|
|
1092
|
-
const failedClaimToken = String(claimFailed.data.claimToken);
|
|
1093
|
-
const failedError = 'Verification failed';
|
|
1094
|
-
const failedTransition = await executeTeamApiOperation('transition-task-status', {
|
|
1095
|
-
team_name: 'transition-payload',
|
|
1096
|
-
task_id: failedTask.id,
|
|
1097
|
-
from: 'in_progress',
|
|
1098
|
-
to: 'failed',
|
|
1099
|
-
claim_token: failedClaimToken,
|
|
1100
|
-
error: failedError,
|
|
1101
|
-
}, cwd);
|
|
1102
|
-
assert.equal(failedTransition.ok, true);
|
|
1103
|
-
const failedReread = await readTask('transition-payload', failedTask.id, cwd);
|
|
1104
|
-
assert.equal(failedReread?.error, failedError);
|
|
1105
|
-
assert.equal(failedReread?.result, undefined);
|
|
1106
|
-
}
|
|
1107
|
-
finally {
|
|
1108
|
-
await cleanup();
|
|
1109
|
-
}
|
|
1110
|
-
});
|
|
1111
|
-
it('rejects non-string result and error payloads', async () => {
|
|
1112
|
-
const badResult = await executeTeamApiOperation('transition-task-status', {
|
|
1113
|
-
team_name: 'x', task_id: '1', from: 'in_progress', to: 'completed', claim_token: 'tok', result: true,
|
|
1114
|
-
}, '/tmp');
|
|
1115
|
-
assert.equal(badResult.ok, false);
|
|
1116
|
-
if (!badResult.ok)
|
|
1117
|
-
assert.match(badResult.error.message, /result must be a string/);
|
|
1118
|
-
const badError = await executeTeamApiOperation('transition-task-status', {
|
|
1119
|
-
team_name: 'x', task_id: '1', from: 'in_progress', to: 'failed', claim_token: 'tok', error: 42,
|
|
1120
|
-
}, '/tmp');
|
|
1121
|
-
assert.equal(badError.ok, false);
|
|
1122
|
-
if (!badError.ok)
|
|
1123
|
-
assert.match(badError.error.message, /error must be a string/);
|
|
1124
|
-
});
|
|
1125
|
-
});
|
|
1126
|
-
// ─── release-task-claim ───────────────────────────────────────────────────
|
|
1127
|
-
describe('executeTeamApiOperation: release-task-claim', () => {
|
|
1128
|
-
it('returns error when required fields missing', async () => {
|
|
1129
|
-
const result = await executeTeamApiOperation('release-task-claim', {
|
|
1130
|
-
team_name: 'x', task_id: '1',
|
|
1131
|
-
}, '/tmp');
|
|
1132
|
-
assert.equal(result.ok, false);
|
|
1133
|
-
});
|
|
1134
|
-
});
|
|
1135
|
-
// ─── read-config ──────────────────────────────────────────────────────────
|
|
1136
|
-
describe('executeTeamApiOperation: read-config', () => {
|
|
1137
|
-
it('reads team config successfully', async () => {
|
|
1138
|
-
const { cwd, cleanup } = await setupTeam('rd-cfg');
|
|
1139
|
-
try {
|
|
1140
|
-
const result = await executeTeamApiOperation('read-config', {
|
|
1141
|
-
team_name: 'rd-cfg',
|
|
1142
|
-
}, cwd);
|
|
1143
|
-
assert.equal(result.ok, true);
|
|
1144
|
-
if (result.ok)
|
|
1145
|
-
assert.ok(result.data.config);
|
|
1146
|
-
}
|
|
1147
|
-
finally {
|
|
1148
|
-
await cleanup();
|
|
1149
|
-
}
|
|
1150
|
-
});
|
|
1151
|
-
it('returns team_not_found for nonexistent team', async () => {
|
|
1152
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-interop-cfg-nf-'));
|
|
1153
|
-
try {
|
|
1154
|
-
const result = await executeTeamApiOperation('read-config', {
|
|
1155
|
-
team_name: 'nonexistent-cfg',
|
|
1156
|
-
}, cwd);
|
|
1157
|
-
assert.equal(result.ok, false);
|
|
1158
|
-
if (!result.ok)
|
|
1159
|
-
assert.equal(result.error.code, 'team_not_found');
|
|
1160
|
-
}
|
|
1161
|
-
finally {
|
|
1162
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1163
|
-
}
|
|
1164
|
-
});
|
|
1165
|
-
it('returns error when team_name missing', async () => {
|
|
1166
|
-
const result = await executeTeamApiOperation('read-config', {}, '/tmp');
|
|
1167
|
-
assert.equal(result.ok, false);
|
|
1168
|
-
});
|
|
1169
|
-
});
|
|
1170
|
-
// ─── read-manifest ────────────────────────────────────────────────────────
|
|
1171
|
-
describe('executeTeamApiOperation: read-manifest', () => {
|
|
1172
|
-
it('returns manifest_not_found when manifest does not exist', async () => {
|
|
1173
|
-
const { cwd, cleanup } = await setupTeam('rd-mfst');
|
|
1174
|
-
try {
|
|
1175
|
-
const result = await executeTeamApiOperation('read-manifest', {
|
|
1176
|
-
team_name: 'rd-mfst',
|
|
1177
|
-
}, cwd);
|
|
1178
|
-
assert.ok(result.ok === true || (result.ok === false && result.error.code === 'manifest_not_found'));
|
|
1179
|
-
}
|
|
1180
|
-
finally {
|
|
1181
|
-
await cleanup();
|
|
1182
|
-
}
|
|
1183
|
-
});
|
|
1184
|
-
it('returns error when team_name missing', async () => {
|
|
1185
|
-
const result = await executeTeamApiOperation('read-manifest', {}, '/tmp');
|
|
1186
|
-
assert.equal(result.ok, false);
|
|
1187
|
-
});
|
|
1188
|
-
});
|
|
1189
|
-
// ─── read-worker-status ───────────────────────────────────────────────────
|
|
1190
|
-
describe('executeTeamApiOperation: read-worker-status', () => {
|
|
1191
|
-
it('reads worker status', async () => {
|
|
1192
|
-
const { cwd, cleanup } = await setupTeam('rd-ws');
|
|
1193
|
-
try {
|
|
1194
|
-
const result = await executeTeamApiOperation('read-worker-status', {
|
|
1195
|
-
team_name: 'rd-ws', worker: 'worker-1',
|
|
1196
|
-
}, cwd);
|
|
1197
|
-
assert.equal(result.ok, true);
|
|
1198
|
-
}
|
|
1199
|
-
finally {
|
|
1200
|
-
await cleanup();
|
|
1201
|
-
}
|
|
1202
|
-
});
|
|
1203
|
-
it('returns error when required fields missing', async () => {
|
|
1204
|
-
const result = await executeTeamApiOperation('read-worker-status', {
|
|
1205
|
-
team_name: 'x',
|
|
1206
|
-
}, '/tmp');
|
|
1207
|
-
assert.equal(result.ok, false);
|
|
1208
|
-
});
|
|
1209
|
-
});
|
|
1210
|
-
// ─── read-worker-heartbeat ────────────────────────────────────────────────
|
|
1211
|
-
describe('executeTeamApiOperation: read-worker-heartbeat', () => {
|
|
1212
|
-
it('reads worker heartbeat', async () => {
|
|
1213
|
-
const { cwd, cleanup } = await setupTeam('rd-hb');
|
|
1214
|
-
try {
|
|
1215
|
-
const result = await executeTeamApiOperation('read-worker-heartbeat', {
|
|
1216
|
-
team_name: 'rd-hb', worker: 'worker-1',
|
|
1217
|
-
}, cwd);
|
|
1218
|
-
assert.equal(result.ok, true);
|
|
1219
|
-
}
|
|
1220
|
-
finally {
|
|
1221
|
-
await cleanup();
|
|
1222
|
-
}
|
|
1223
|
-
});
|
|
1224
|
-
it('returns error when required fields missing', async () => {
|
|
1225
|
-
const result = await executeTeamApiOperation('read-worker-heartbeat', {
|
|
1226
|
-
team_name: 'x',
|
|
1227
|
-
}, '/tmp');
|
|
1228
|
-
assert.equal(result.ok, false);
|
|
1229
|
-
});
|
|
1230
|
-
});
|
|
1231
|
-
// ─── update-worker-heartbeat ──────────────────────────────────────────────
|
|
1232
|
-
describe('executeTeamApiOperation: update-worker-heartbeat', () => {
|
|
1233
|
-
it('updates worker heartbeat successfully', async () => {
|
|
1234
|
-
const { cwd, cleanup } = await setupTeam('upd-hb');
|
|
1235
|
-
try {
|
|
1236
|
-
const result = await executeTeamApiOperation('update-worker-heartbeat', {
|
|
1237
|
-
team_name: 'upd-hb', worker: 'worker-1', pid: 12345, turn_count: 5, alive: true,
|
|
1238
|
-
}, cwd);
|
|
1239
|
-
assert.equal(result.ok, true);
|
|
1240
|
-
}
|
|
1241
|
-
finally {
|
|
1242
|
-
await cleanup();
|
|
1243
|
-
}
|
|
1244
|
-
});
|
|
1245
|
-
it('returns error when required fields missing or wrong types', async () => {
|
|
1246
|
-
const result = await executeTeamApiOperation('update-worker-heartbeat', {
|
|
1247
|
-
team_name: 'x', worker: 'w1', pid: 'not-a-number', turn_count: 1, alive: true,
|
|
1248
|
-
}, '/tmp');
|
|
1249
|
-
assert.equal(result.ok, false);
|
|
1250
|
-
});
|
|
1251
|
-
});
|
|
1252
|
-
// ─── write-worker-inbox ───────────────────────────────────────────────────
|
|
1253
|
-
describe('executeTeamApiOperation: write-worker-inbox', () => {
|
|
1254
|
-
it('writes to worker inbox', async () => {
|
|
1255
|
-
const { cwd, cleanup } = await setupTeam('wr-inbox');
|
|
1256
|
-
try {
|
|
1257
|
-
const result = await executeTeamApiOperation('write-worker-inbox', {
|
|
1258
|
-
team_name: 'wr-inbox', worker: 'worker-1', content: 'Hello worker!',
|
|
1259
|
-
}, cwd);
|
|
1260
|
-
assert.equal(result.ok, true);
|
|
1261
|
-
}
|
|
1262
|
-
finally {
|
|
1263
|
-
await cleanup();
|
|
1264
|
-
}
|
|
1265
|
-
});
|
|
1266
|
-
it('returns error when required fields missing', async () => {
|
|
1267
|
-
const result = await executeTeamApiOperation('write-worker-inbox', {
|
|
1268
|
-
team_name: 'x', worker: 'w1',
|
|
1269
|
-
}, '/tmp');
|
|
1270
|
-
assert.equal(result.ok, false);
|
|
1271
|
-
});
|
|
1272
|
-
});
|
|
1273
|
-
// ─── write-worker-identity ────────────────────────────────────────────────
|
|
1274
|
-
describe('executeTeamApiOperation: write-worker-identity', () => {
|
|
1275
|
-
it('writes worker identity', async () => {
|
|
1276
|
-
const { cwd, cleanup } = await setupTeam('wr-id');
|
|
1277
|
-
try {
|
|
1278
|
-
const result = await executeTeamApiOperation('write-worker-identity', {
|
|
1279
|
-
team_name: 'wr-id', worker: 'worker-1', index: 1, role: 'executor',
|
|
1280
|
-
}, cwd);
|
|
1281
|
-
assert.equal(result.ok, true);
|
|
1282
|
-
}
|
|
1283
|
-
finally {
|
|
1284
|
-
await cleanup();
|
|
1285
|
-
}
|
|
1286
|
-
});
|
|
1287
|
-
it('writes worker identity with optional fields', async () => {
|
|
1288
|
-
const { cwd, cleanup } = await setupTeam('wr-id-opt');
|
|
1289
|
-
try {
|
|
1290
|
-
const result = await executeTeamApiOperation('write-worker-identity', {
|
|
1291
|
-
team_name: 'wr-id-opt', worker: 'worker-1', index: 1, role: 'executor',
|
|
1292
|
-
assigned_tasks: ['1', '2'], pid: 9999, pane_id: '%10',
|
|
1293
|
-
working_dir: '/tmp', worktree_path: '/wt', worktree_branch: 'main',
|
|
1294
|
-
worktree_detached: false, team_state_root: '/state',
|
|
1295
|
-
}, cwd);
|
|
1296
|
-
assert.equal(result.ok, true);
|
|
1297
|
-
}
|
|
1298
|
-
finally {
|
|
1299
|
-
await cleanup();
|
|
1300
|
-
}
|
|
1301
|
-
});
|
|
1302
|
-
it('returns error when required fields missing', async () => {
|
|
1303
|
-
const result = await executeTeamApiOperation('write-worker-identity', {
|
|
1304
|
-
team_name: 'x', worker: 'w1',
|
|
1305
|
-
}, '/tmp');
|
|
1306
|
-
assert.equal(result.ok, false);
|
|
1307
|
-
});
|
|
1308
|
-
});
|
|
1309
|
-
// ─── append-event ─────────────────────────────────────────────────────────
|
|
1310
|
-
describe('executeTeamApiOperation: append-event', () => {
|
|
1311
|
-
it('appends a valid event', async () => {
|
|
1312
|
-
const { cwd, cleanup } = await setupTeam('evt-team');
|
|
1313
|
-
try {
|
|
1314
|
-
const result = await executeTeamApiOperation('append-event', {
|
|
1315
|
-
team_name: 'evt-team', type: 'task_completed', worker: 'worker-1', task_id: '1',
|
|
1316
|
-
}, cwd);
|
|
1317
|
-
assert.equal(result.ok, true);
|
|
1318
|
-
}
|
|
1319
|
-
finally {
|
|
1320
|
-
await cleanup();
|
|
1321
|
-
}
|
|
1322
|
-
});
|
|
1323
|
-
it('rejects invalid event type', async () => {
|
|
1324
|
-
const result = await executeTeamApiOperation('append-event', {
|
|
1325
|
-
team_name: 'x', type: 'invalid_type', worker: 'w1',
|
|
1326
|
-
}, '/tmp');
|
|
1327
|
-
assert.equal(result.ok, false);
|
|
1328
|
-
if (!result.ok)
|
|
1329
|
-
assert.match(result.error.message, /type must be one of/);
|
|
1330
|
-
});
|
|
1331
|
-
it('returns error when required fields missing', async () => {
|
|
1332
|
-
const result = await executeTeamApiOperation('append-event', {
|
|
1333
|
-
team_name: 'x',
|
|
1334
|
-
}, '/tmp');
|
|
1335
|
-
assert.equal(result.ok, false);
|
|
1336
|
-
});
|
|
1337
|
-
});
|
|
1338
|
-
// ─── read-events ──────────────────────────────────────────────────────────
|
|
1339
|
-
describe('executeTeamApiOperation: read-events', () => {
|
|
1340
|
-
it('returns canonical filtered events', async () => {
|
|
1341
|
-
const { cwd, cleanup } = await setupTeam('evt-read');
|
|
1342
|
-
try {
|
|
1343
|
-
const first = await appendTeamEvent('evt-read', {
|
|
1344
|
-
type: 'task_completed',
|
|
1345
|
-
worker: 'worker-2',
|
|
1346
|
-
task_id: '2',
|
|
1347
|
-
}, cwd);
|
|
1348
|
-
const second = await appendTeamEvent('evt-read', {
|
|
1349
|
-
type: 'worker_idle',
|
|
1350
|
-
worker: 'worker-1',
|
|
1351
|
-
task_id: '1',
|
|
1352
|
-
prev_state: 'working',
|
|
1353
|
-
}, cwd);
|
|
1354
|
-
await appendTeamEvent('evt-read', {
|
|
1355
|
-
type: 'task_failed',
|
|
1356
|
-
worker: 'worker-1',
|
|
1357
|
-
task_id: '1',
|
|
1358
|
-
}, cwd);
|
|
1359
|
-
const result = await executeTeamApiOperation('read-events', {
|
|
1360
|
-
team_name: 'evt-read',
|
|
1361
|
-
after_event_id: first.event_id,
|
|
1362
|
-
worker: 'worker-1',
|
|
1363
|
-
task_id: '1',
|
|
1364
|
-
type: 'worker_idle',
|
|
1365
|
-
}, cwd);
|
|
1366
|
-
assert.equal(result.ok, true);
|
|
1367
|
-
if (result.ok) {
|
|
1368
|
-
assert.equal(result.data.count, 1);
|
|
1369
|
-
assert.equal(result.data.cursor, second.event_id);
|
|
1370
|
-
const events = result.data.events;
|
|
1371
|
-
assert.equal(events.length, 1);
|
|
1372
|
-
assert.equal(events[0]?.type, 'worker_state_changed');
|
|
1373
|
-
assert.equal(events[0]?.source_type, 'worker_idle');
|
|
1374
|
-
assert.equal(events[0]?.worker, 'worker-1');
|
|
1375
|
-
assert.equal(events[0]?.task_id, '1');
|
|
1376
|
-
}
|
|
1377
|
-
}
|
|
1378
|
-
finally {
|
|
1379
|
-
await cleanup();
|
|
1380
|
-
}
|
|
1381
|
-
});
|
|
1382
|
-
it('resolves display team names before reading events', async () => {
|
|
1383
|
-
const { cwd, cleanup } = await setupDisplayTeam('evt-display-11111111', 'evt-display', 'session-events-display');
|
|
1384
|
-
try {
|
|
1385
|
-
const event = await appendTeamEvent('evt-display-11111111', {
|
|
1386
|
-
type: 'task_completed',
|
|
1387
|
-
worker: 'worker-1',
|
|
1388
|
-
task_id: '1',
|
|
1389
|
-
}, cwd);
|
|
1390
|
-
const result = await executeTeamApiOperation('read-events', {
|
|
1391
|
-
team_name: 'evt-display',
|
|
1392
|
-
type: 'task_completed',
|
|
1393
|
-
}, cwd);
|
|
1394
|
-
assert.equal(result.ok, true);
|
|
1395
|
-
if (result.ok) {
|
|
1396
|
-
assert.equal(result.data.count, 1);
|
|
1397
|
-
assert.equal(result.data.cursor, event.event_id);
|
|
1398
|
-
const events = result.data.events;
|
|
1399
|
-
assert.equal(events[0]?.event_id, event.event_id);
|
|
1400
|
-
assert.equal(events[0]?.type, 'task_completed');
|
|
1401
|
-
assert.equal(events[0]?.worker, 'worker-1');
|
|
1402
|
-
}
|
|
1403
|
-
}
|
|
1404
|
-
finally {
|
|
1405
|
-
await cleanup();
|
|
1406
|
-
}
|
|
1407
|
-
});
|
|
1408
|
-
it('rejects invalid event filters', async () => {
|
|
1409
|
-
const result = await executeTeamApiOperation('read-events', {
|
|
1410
|
-
team_name: 'evt-read-invalid',
|
|
1411
|
-
type: 'not_an_event',
|
|
1412
|
-
}, '/tmp');
|
|
1413
|
-
assert.equal(result.ok, false);
|
|
1414
|
-
if (!result.ok) {
|
|
1415
|
-
assert.match(result.error.message, /type must be one of/);
|
|
1416
|
-
}
|
|
1417
|
-
});
|
|
1418
|
-
});
|
|
1419
|
-
// ─── await-event ──────────────────────────────────────────────────────────
|
|
1420
|
-
describe('executeTeamApiOperation: await-event', () => {
|
|
1421
|
-
it('waits for the next matching event', async () => {
|
|
1422
|
-
const { cwd, cleanup } = await setupTeam('evt-await');
|
|
1423
|
-
try {
|
|
1424
|
-
const waitPromise = executeTeamApiOperation('await-event', {
|
|
1425
|
-
team_name: 'evt-await',
|
|
1426
|
-
worker: 'worker-1',
|
|
1427
|
-
task_id: '1',
|
|
1428
|
-
type: 'task_completed',
|
|
1429
|
-
timeout_ms: 500,
|
|
1430
|
-
poll_ms: 25,
|
|
1431
|
-
}, cwd);
|
|
1432
|
-
setTimeout(() => {
|
|
1433
|
-
void appendTeamEvent('evt-await', {
|
|
1434
|
-
type: 'worker_state_changed',
|
|
1435
|
-
worker: 'worker-2',
|
|
1436
|
-
task_id: '2',
|
|
1437
|
-
state: 'working',
|
|
1438
|
-
}, cwd);
|
|
1439
|
-
}, 25);
|
|
1440
|
-
setTimeout(() => {
|
|
1441
|
-
void appendTeamEvent('evt-await', {
|
|
1442
|
-
type: 'task_completed',
|
|
1443
|
-
worker: 'worker-1',
|
|
1444
|
-
task_id: '1',
|
|
1445
|
-
}, cwd);
|
|
1446
|
-
}, 60);
|
|
1447
|
-
const result = await waitPromise;
|
|
1448
|
-
assert.equal(result.ok, true);
|
|
1449
|
-
if (result.ok) {
|
|
1450
|
-
assert.equal(result.data.status, 'event');
|
|
1451
|
-
assert.equal(typeof result.data.cursor, 'string');
|
|
1452
|
-
const event = result.data.event;
|
|
1453
|
-
assert.equal(event?.type, 'task_completed');
|
|
1454
|
-
assert.equal(event?.worker, 'worker-1');
|
|
1455
|
-
assert.equal(event?.task_id, '1');
|
|
1456
|
-
}
|
|
1457
|
-
}
|
|
1458
|
-
finally {
|
|
1459
|
-
await cleanup();
|
|
1460
|
-
}
|
|
1461
|
-
});
|
|
1462
|
-
it('rejects invalid timeout values', async () => {
|
|
1463
|
-
const result = await executeTeamApiOperation('await-event', {
|
|
1464
|
-
team_name: 'evt-await-invalid',
|
|
1465
|
-
timeout_ms: -1,
|
|
1466
|
-
}, '/tmp');
|
|
1467
|
-
assert.equal(result.ok, false);
|
|
1468
|
-
if (!result.ok) {
|
|
1469
|
-
assert.match(result.error.message, /timeout_ms must be a non-negative integer/);
|
|
1470
|
-
}
|
|
1471
|
-
});
|
|
1472
|
-
it('resolves display team names before awaiting events', async () => {
|
|
1473
|
-
const { cwd, cleanup } = await setupDisplayTeam('evt-await-display-111111', 'evt-await-display', 'session-await-display');
|
|
1474
|
-
try {
|
|
1475
|
-
const waitPromise = executeTeamApiOperation('await-event', {
|
|
1476
|
-
team_name: 'evt-await-display',
|
|
1477
|
-
type: 'task_completed',
|
|
1478
|
-
timeout_ms: 500,
|
|
1479
|
-
poll_ms: 25,
|
|
1480
|
-
}, cwd);
|
|
1481
|
-
setTimeout(() => {
|
|
1482
|
-
void appendTeamEvent('evt-await-display-111111', {
|
|
1483
|
-
type: 'task_completed',
|
|
1484
|
-
worker: 'worker-1',
|
|
1485
|
-
task_id: '1',
|
|
1486
|
-
}, cwd);
|
|
1487
|
-
}, 25);
|
|
1488
|
-
const result = await waitPromise;
|
|
1489
|
-
assert.equal(result.ok, true);
|
|
1490
|
-
if (result.ok) {
|
|
1491
|
-
assert.equal(result.data.status, 'event');
|
|
1492
|
-
const event = result.data.event;
|
|
1493
|
-
assert.equal(event?.type, 'task_completed');
|
|
1494
|
-
assert.equal(event?.worker, 'worker-1');
|
|
1495
|
-
assert.equal(event?.task_id, '1');
|
|
1496
|
-
}
|
|
1497
|
-
}
|
|
1498
|
-
finally {
|
|
1499
|
-
await cleanup();
|
|
1500
|
-
}
|
|
1501
|
-
});
|
|
1502
|
-
});
|
|
1503
|
-
// ─── read-idle-state ────────────────────────────────────────────────────────
|
|
1504
|
-
describe('executeTeamApiOperation: read-idle-state', () => {
|
|
1505
|
-
it('returns structured idle state from summary, snapshot, and recent events', async () => {
|
|
1506
|
-
const { cwd, cleanup } = await setupTeam('idle-state-team');
|
|
1507
|
-
try {
|
|
1508
|
-
await writeMonitorSnapshot('idle-state-team', {
|
|
1509
|
-
taskStatusById: { '1': 'pending' },
|
|
1510
|
-
workerAliveByName: { 'worker-1': true, 'worker-2': true },
|
|
1511
|
-
workerStateByName: { 'worker-1': 'idle', 'worker-2': 'working' },
|
|
1512
|
-
workerTurnCountByName: { 'worker-1': 3, 'worker-2': 5 },
|
|
1513
|
-
workerTaskIdByName: { 'worker-1': '1', 'worker-2': '1' },
|
|
1514
|
-
mailboxNotifiedByMessageId: {},
|
|
1515
|
-
completedEventTaskIds: {},
|
|
1516
|
-
}, cwd);
|
|
1517
|
-
await appendTeamEvent('idle-state-team', {
|
|
1518
|
-
type: 'worker_idle',
|
|
1519
|
-
worker: 'worker-1',
|
|
1520
|
-
task_id: '1',
|
|
1521
|
-
prev_state: 'working',
|
|
1522
|
-
}, cwd);
|
|
1523
|
-
const allIdleEvent = await appendTeamEvent('idle-state-team', {
|
|
1524
|
-
type: 'all_workers_idle',
|
|
1525
|
-
worker: 'worker-1',
|
|
1526
|
-
worker_count: 2,
|
|
1527
|
-
}, cwd);
|
|
1528
|
-
const result = await executeTeamApiOperation('read-idle-state', {
|
|
1529
|
-
team_name: 'idle-state-team',
|
|
1530
|
-
}, cwd);
|
|
1531
|
-
assert.equal(result.ok, true);
|
|
1532
|
-
if (result.ok) {
|
|
1533
|
-
assert.equal(result.data.team_name, 'idle-state-team');
|
|
1534
|
-
assert.equal(result.data.worker_count, 2);
|
|
1535
|
-
assert.equal(result.data.idle_worker_count, 1);
|
|
1536
|
-
assert.deepEqual(result.data.idle_workers, ['worker-1']);
|
|
1537
|
-
assert.deepEqual(result.data.non_idle_workers, ['worker-2']);
|
|
1538
|
-
assert.equal(result.data.all_workers_idle, false);
|
|
1539
|
-
const byWorker = result.data.last_idle_transition_by_worker;
|
|
1540
|
-
assert.equal(byWorker['worker-1']?.source_type, 'worker_idle');
|
|
1541
|
-
assert.equal(byWorker['worker-2'], null);
|
|
1542
|
-
const lastAllIdle = result.data.last_all_workers_idle_event;
|
|
1543
|
-
assert.equal(lastAllIdle?.event_id, allIdleEvent.event_id);
|
|
1544
|
-
assert.equal(lastAllIdle?.type, 'all_workers_idle');
|
|
1545
|
-
assert.equal(lastAllIdle?.worker_count, 2);
|
|
1546
|
-
}
|
|
1547
|
-
}
|
|
1548
|
-
finally {
|
|
1549
|
-
await cleanup();
|
|
1550
|
-
}
|
|
1551
|
-
});
|
|
1552
|
-
it('resolves display team names before reading idle state', async () => {
|
|
1553
|
-
const { cwd, cleanup } = await setupDisplayTeam('idle-display-11111111', 'idle-display', 'session-idle-display');
|
|
1554
|
-
try {
|
|
1555
|
-
await writeMonitorSnapshot('idle-display-11111111', {
|
|
1556
|
-
taskStatusById: {},
|
|
1557
|
-
workerAliveByName: { 'worker-1': true, 'worker-2': true },
|
|
1558
|
-
workerStateByName: { 'worker-1': 'idle', 'worker-2': 'idle' },
|
|
1559
|
-
workerTurnCountByName: { 'worker-1': 1, 'worker-2': 1 },
|
|
1560
|
-
workerTaskIdByName: { 'worker-1': '', 'worker-2': '' },
|
|
1561
|
-
mailboxNotifiedByMessageId: {},
|
|
1562
|
-
completedEventTaskIds: {},
|
|
1563
|
-
}, cwd);
|
|
1564
|
-
const result = await executeTeamApiOperation('read-idle-state', {
|
|
1565
|
-
team_name: 'idle-display',
|
|
1566
|
-
}, cwd);
|
|
1567
|
-
assert.equal(result.ok, true);
|
|
1568
|
-
if (result.ok) {
|
|
1569
|
-
assert.equal(result.data.team_name, 'idle-display-11111111');
|
|
1570
|
-
assert.equal(result.data.all_workers_idle, true);
|
|
1571
|
-
assert.deepEqual(result.data.idle_workers, ['worker-1', 'worker-2']);
|
|
1572
|
-
}
|
|
1573
|
-
}
|
|
1574
|
-
finally {
|
|
1575
|
-
await cleanup();
|
|
1576
|
-
}
|
|
1577
|
-
});
|
|
1578
|
-
});
|
|
1579
|
-
// ─── read-stall-state ───────────────────────────────────────────────────────
|
|
1580
|
-
describe('executeTeamApiOperation: read-stall-state', () => {
|
|
1581
|
-
it('returns structured stall state from authoritative leader attention state', async () => {
|
|
1582
|
-
const { cwd, cleanup } = await setupTeam('stall-state-team');
|
|
1583
|
-
try {
|
|
1584
|
-
const task = await createTask('stall-state-team', {
|
|
1585
|
-
subject: 'Pending work',
|
|
1586
|
-
description: 'Needs attention',
|
|
1587
|
-
status: 'pending',
|
|
1588
|
-
}, cwd);
|
|
1589
|
-
await writeWorkerStatus('stall-state-team', 'worker-1', {
|
|
1590
|
-
state: 'working',
|
|
1591
|
-
current_task_id: task.id,
|
|
1592
|
-
updated_at: '2026-03-10T10:00:00.000Z',
|
|
1593
|
-
}, cwd);
|
|
1594
|
-
await writeWorkerStatus('stall-state-team', 'worker-2', {
|
|
1595
|
-
state: 'idle',
|
|
1596
|
-
updated_at: '2026-03-10T10:00:00.000Z',
|
|
1597
|
-
}, cwd);
|
|
1598
|
-
await updateWorkerHeartbeat('stall-state-team', 'worker-1', {
|
|
1599
|
-
alive: true,
|
|
1600
|
-
pid: 101,
|
|
1601
|
-
turn_count: 1,
|
|
1602
|
-
last_turn_at: '2026-03-10T10:00:00.000Z',
|
|
1603
|
-
}, cwd);
|
|
1604
|
-
await updateWorkerHeartbeat('stall-state-team', 'worker-2', {
|
|
1605
|
-
alive: true,
|
|
1606
|
-
pid: 102,
|
|
1607
|
-
turn_count: 1,
|
|
1608
|
-
last_turn_at: '2026-03-10T10:00:00.000Z',
|
|
1609
|
-
}, cwd);
|
|
1610
|
-
const primed = await executeTeamApiOperation('get-summary', {
|
|
1611
|
-
team_name: 'stall-state-team',
|
|
1612
|
-
}, cwd);
|
|
1613
|
-
assert.equal(primed.ok, true);
|
|
1614
|
-
await updateWorkerHeartbeat('stall-state-team', 'worker-1', {
|
|
1615
|
-
alive: true,
|
|
1616
|
-
pid: 101,
|
|
1617
|
-
turn_count: 8,
|
|
1618
|
-
last_turn_at: '2026-03-10T10:05:00.000Z',
|
|
1619
|
-
}, cwd);
|
|
1620
|
-
await writeMonitorSnapshot('stall-state-team', {
|
|
1621
|
-
taskStatusById: { [task.id]: 'pending' },
|
|
1622
|
-
workerAliveByName: { 'worker-1': true, 'worker-2': true },
|
|
1623
|
-
workerStateByName: { 'worker-1': 'idle', 'worker-2': 'idle' },
|
|
1624
|
-
workerTurnCountByName: { 'worker-1': 8, 'worker-2': 1 },
|
|
1625
|
-
workerTaskIdByName: { 'worker-1': task.id, 'worker-2': '' },
|
|
1626
|
-
mailboxNotifiedByMessageId: {},
|
|
1627
|
-
completedEventTaskIds: {},
|
|
1628
|
-
}, cwd);
|
|
1629
|
-
await writeTeamLeaderAttention('stall-state-team', {
|
|
1630
|
-
team_name: 'stall-state-team',
|
|
1631
|
-
updated_at: '2026-03-10T10:05:00.000Z',
|
|
1632
|
-
source: 'native_stop',
|
|
1633
|
-
leader_decision_state: 'still_actionable',
|
|
1634
|
-
leader_attention_pending: true,
|
|
1635
|
-
leader_attention_reason: 'leader_session_stopped',
|
|
1636
|
-
attention_reasons: ['leader_session_stopped'],
|
|
1637
|
-
leader_stale: false,
|
|
1638
|
-
leader_session_active: false,
|
|
1639
|
-
leader_session_id: 'leader-session-1',
|
|
1640
|
-
leader_session_stopped_at: '2026-03-10T10:05:00.000Z',
|
|
1641
|
-
unread_leader_message_count: 1,
|
|
1642
|
-
work_remaining: true,
|
|
1643
|
-
stalled_for_ms: null,
|
|
1644
|
-
}, cwd);
|
|
1645
|
-
const result = await executeTeamApiOperation('read-stall-state', {
|
|
1646
|
-
team_name: 'stall-state-team',
|
|
1647
|
-
}, cwd);
|
|
1648
|
-
assert.equal(result.ok, true);
|
|
1649
|
-
if (result.ok) {
|
|
1650
|
-
assert.equal(result.data.team_name, 'stall-state-team');
|
|
1651
|
-
assert.equal(result.data.team_stalled, true);
|
|
1652
|
-
assert.equal(result.data.leader_stale, true);
|
|
1653
|
-
assert.deepEqual(result.data.stalled_workers, ['worker-1']);
|
|
1654
|
-
assert.deepEqual(result.data.dead_workers, []);
|
|
1655
|
-
assert.equal(result.data.pending_task_count, 1);
|
|
1656
|
-
assert.equal(result.data.all_workers_idle, true);
|
|
1657
|
-
assert.match(result.data.reasons.join(' '), /workers_non_reporting:worker-1/);
|
|
1658
|
-
assert.match(result.data.reasons.join(' '), /leader_attention_pending:leader_session_stopped/);
|
|
1659
|
-
const attention = result.data.leader_attention_state;
|
|
1660
|
-
assert.equal(attention?.leader_session_active, false);
|
|
1661
|
-
assert.equal(attention?.source, 'native_stop');
|
|
1662
|
-
}
|
|
1663
|
-
}
|
|
1664
|
-
finally {
|
|
1665
|
-
await cleanup();
|
|
1666
|
-
}
|
|
1667
|
-
});
|
|
1668
|
-
it('resolves display team names before reading stall state', async () => {
|
|
1669
|
-
const { cwd, cleanup } = await setupDisplayTeam('stall-display-1111111', 'stall-display', 'session-stall-display');
|
|
1670
|
-
try {
|
|
1671
|
-
await sendDirectMessage('stall-display-1111111', 'worker-1', 'leader-fixed', 'please review', cwd);
|
|
1672
|
-
const result = await executeTeamApiOperation('read-stall-state', {
|
|
1673
|
-
team_name: 'stall-display',
|
|
1674
|
-
}, cwd);
|
|
1675
|
-
assert.equal(result.ok, true);
|
|
1676
|
-
if (result.ok) {
|
|
1677
|
-
assert.equal(result.data.team_name, 'stall-display-1111111');
|
|
1678
|
-
assert.equal(result.data.leader_attention_pending, true);
|
|
1679
|
-
assert.equal(result.data.unread_leader_message_count, 1);
|
|
1680
|
-
}
|
|
1681
|
-
}
|
|
1682
|
-
finally {
|
|
1683
|
-
await cleanup();
|
|
1684
|
-
}
|
|
1685
|
-
});
|
|
1686
|
-
it('uses unread leader mailbox state even without recent nudge events', async () => {
|
|
1687
|
-
const { cwd, cleanup } = await setupTeam('stall-state-mailbox');
|
|
1688
|
-
try {
|
|
1689
|
-
await sendDirectMessage('stall-state-mailbox', 'worker-1', 'leader-fixed', 'please review', cwd);
|
|
1690
|
-
const result = await executeTeamApiOperation('read-stall-state', {
|
|
1691
|
-
team_name: 'stall-state-mailbox',
|
|
1692
|
-
}, cwd);
|
|
1693
|
-
assert.equal(result.ok, true);
|
|
1694
|
-
if (result.ok) {
|
|
1695
|
-
assert.equal(result.data.leader_attention_pending, true);
|
|
1696
|
-
assert.equal(result.data.leader_stale, false);
|
|
1697
|
-
assert.equal(result.data.unread_leader_message_count, 1);
|
|
1698
|
-
assert.match(result.data.reasons.join(' '), /leader_attention_pending:unread_leader_mailbox/);
|
|
1699
|
-
}
|
|
1700
|
-
}
|
|
1701
|
-
finally {
|
|
1702
|
-
await cleanup();
|
|
1703
|
-
}
|
|
1704
|
-
});
|
|
1705
|
-
it('suppresses stale native-stop attention after newer leader activity', async () => {
|
|
1706
|
-
const { cwd, cleanup } = await setupTeam('stall-state-resume');
|
|
1707
|
-
try {
|
|
1708
|
-
await writeTeamLeaderAttention('stall-state-resume', {
|
|
1709
|
-
team_name: 'stall-state-resume',
|
|
1710
|
-
updated_at: '2026-03-10T10:05:00.000Z',
|
|
1711
|
-
source: 'native_stop',
|
|
1712
|
-
leader_decision_state: 'still_actionable',
|
|
1713
|
-
leader_attention_pending: true,
|
|
1714
|
-
leader_attention_reason: 'leader_session_stopped',
|
|
1715
|
-
attention_reasons: ['leader_session_stopped'],
|
|
1716
|
-
leader_stale: false,
|
|
1717
|
-
leader_session_active: false,
|
|
1718
|
-
leader_session_id: 'leader-session-1',
|
|
1719
|
-
leader_session_stopped_at: '2026-03-10T10:05:00.000Z',
|
|
1720
|
-
unread_leader_message_count: 0,
|
|
1721
|
-
work_remaining: false,
|
|
1722
|
-
stalled_for_ms: null,
|
|
1723
|
-
}, cwd);
|
|
1724
|
-
await writeFile(join(cwd, '.rcs', 'state', 'leader-runtime-activity.json'), JSON.stringify({
|
|
1725
|
-
last_activity_at: '2026-03-10T10:06:00.000Z',
|
|
1726
|
-
last_source: 'team_status',
|
|
1727
|
-
last_team_name: 'stall-state-resume',
|
|
1728
|
-
}, null, 2));
|
|
1729
|
-
const result = await executeTeamApiOperation('read-stall-state', {
|
|
1730
|
-
team_name: 'stall-state-resume',
|
|
1731
|
-
}, cwd);
|
|
1732
|
-
assert.equal(result.ok, true);
|
|
1733
|
-
if (result.ok) {
|
|
1734
|
-
assert.equal(result.data.leader_attention_pending, false);
|
|
1735
|
-
assert.equal(result.data.leader_stale, false);
|
|
1736
|
-
assert.doesNotMatch(result.data.reasons.join(' '), /leader_attention_pending:leader_session_stopped/);
|
|
1737
|
-
}
|
|
1738
|
-
}
|
|
1739
|
-
finally {
|
|
1740
|
-
await cleanup();
|
|
1741
|
-
}
|
|
1742
|
-
});
|
|
1743
|
-
it('suppresses stale native-stop attention after newer detached worktree progress', async () => {
|
|
1744
|
-
const { cwd, cleanup } = await setupTeam('stall-state-detached-progress');
|
|
1745
|
-
try {
|
|
1746
|
-
const workerWorktree = join(cwd, 'worktrees', 'worker-1');
|
|
1747
|
-
await mkdir(join(workerWorktree, '.rcs', 'state'), { recursive: true });
|
|
1748
|
-
const manifest = await readTeamManifestV2('stall-state-detached-progress', cwd);
|
|
1749
|
-
assert.ok(manifest);
|
|
1750
|
-
await writeTeamManifestV2({
|
|
1751
|
-
...manifest,
|
|
1752
|
-
workers: (manifest.workers ?? []).map((worker) => (worker.name === 'worker-1'
|
|
1753
|
-
? { ...worker, worktree_path: workerWorktree }
|
|
1754
|
-
: worker)),
|
|
1755
|
-
}, cwd);
|
|
1756
|
-
await writeTeamLeaderAttention('stall-state-detached-progress', {
|
|
1757
|
-
team_name: 'stall-state-detached-progress',
|
|
1758
|
-
updated_at: '2026-03-10T10:05:00.000Z',
|
|
1759
|
-
source: 'native_stop',
|
|
1760
|
-
leader_decision_state: 'still_actionable',
|
|
1761
|
-
leader_attention_pending: true,
|
|
1762
|
-
leader_attention_reason: 'leader_session_stopped',
|
|
1763
|
-
attention_reasons: ['leader_session_stopped'],
|
|
1764
|
-
leader_stale: false,
|
|
1765
|
-
leader_session_active: false,
|
|
1766
|
-
leader_session_id: 'leader-session-1',
|
|
1767
|
-
leader_session_stopped_at: '2026-03-10T10:05:00.000Z',
|
|
1768
|
-
unread_leader_message_count: 0,
|
|
1769
|
-
work_remaining: false,
|
|
1770
|
-
stalled_for_ms: null,
|
|
1771
|
-
}, cwd);
|
|
1772
|
-
await writeFile(join(workerWorktree, '.rcs', 'state', 'current-task-baseline.json'), JSON.stringify({
|
|
1773
|
-
version: 1,
|
|
1774
|
-
tasks: [],
|
|
1775
|
-
}, null, 2));
|
|
1776
|
-
const result = await executeTeamApiOperation('read-stall-state', {
|
|
1777
|
-
team_name: 'stall-state-detached-progress',
|
|
1778
|
-
}, cwd);
|
|
1779
|
-
assert.equal(result.ok, true);
|
|
1780
|
-
if (result.ok) {
|
|
1781
|
-
assert.equal(result.data.leader_attention_pending, false);
|
|
1782
|
-
assert.equal(result.data.leader_stale, false);
|
|
1783
|
-
assert.doesNotMatch(result.data.reasons.join(' '), /leader_attention_pending:leader_session_stopped/);
|
|
1784
|
-
}
|
|
1785
|
-
}
|
|
1786
|
-
finally {
|
|
1787
|
-
await cleanup();
|
|
1788
|
-
}
|
|
1789
|
-
});
|
|
1790
|
-
it('marks only active leader-owned teams as stopped on session end', async () => {
|
|
1791
|
-
const { cwd, cleanup } = await setupTeam('owned-team');
|
|
1792
|
-
try {
|
|
1793
|
-
await initTeamState('other-team', 'Other', 'executor', 1, cwd);
|
|
1794
|
-
const ownedManifest = await readTeamManifestV2('owned-team', cwd);
|
|
1795
|
-
const otherManifest = await readTeamManifestV2('other-team', cwd);
|
|
1796
|
-
assert.ok(ownedManifest);
|
|
1797
|
-
assert.ok(otherManifest);
|
|
1798
|
-
await writeTeamManifestV2({
|
|
1799
|
-
...ownedManifest,
|
|
1800
|
-
leader: {
|
|
1801
|
-
...ownedManifest.leader,
|
|
1802
|
-
session_id: 'leader-session-1',
|
|
1803
|
-
},
|
|
1804
|
-
}, cwd);
|
|
1805
|
-
await writeTeamManifestV2({
|
|
1806
|
-
...otherManifest,
|
|
1807
|
-
leader: {
|
|
1808
|
-
...otherManifest.leader,
|
|
1809
|
-
session_id: 'leader-session-2',
|
|
1810
|
-
},
|
|
1811
|
-
}, cwd);
|
|
1812
|
-
await writeTeamLeaderAttention('owned-team', {
|
|
1813
|
-
team_name: 'owned-team',
|
|
1814
|
-
updated_at: '2026-03-10T10:12:00.000Z',
|
|
1815
|
-
source: 'notify_hook',
|
|
1816
|
-
leader_decision_state: 'still_actionable',
|
|
1817
|
-
leader_attention_pending: true,
|
|
1818
|
-
leader_attention_reason: 'stale_leader_with_messages',
|
|
1819
|
-
attention_reasons: ['stale_leader_with_messages'],
|
|
1820
|
-
leader_stale: true,
|
|
1821
|
-
leader_session_active: true,
|
|
1822
|
-
leader_session_id: 'leader-session-1',
|
|
1823
|
-
leader_session_stopped_at: null,
|
|
1824
|
-
unread_leader_message_count: 1,
|
|
1825
|
-
work_remaining: true,
|
|
1826
|
-
stalled_for_ms: null,
|
|
1827
|
-
}, cwd);
|
|
1828
|
-
await writeTeamPhase('other-team', {
|
|
1829
|
-
current_phase: 'complete',
|
|
1830
|
-
max_fix_attempts: 3,
|
|
1831
|
-
current_fix_attempt: 0,
|
|
1832
|
-
transitions: [],
|
|
1833
|
-
updated_at: '2026-03-10T10:10:00.000Z',
|
|
1834
|
-
}, cwd);
|
|
1835
|
-
const updatedTeams = await markOwnedTeamsLeaderSessionStopped(cwd, 'leader-session-1', '2026-03-10T10:15:00.000Z');
|
|
1836
|
-
assert.deepEqual(updatedTeams, ['owned-team']);
|
|
1837
|
-
const ownedAttention = await readTeamLeaderAttention('owned-team', cwd);
|
|
1838
|
-
const otherAttention = await readTeamLeaderAttention('other-team', cwd);
|
|
1839
|
-
assert.equal(ownedAttention?.leader_session_active, false);
|
|
1840
|
-
assert.equal(ownedAttention?.leader_attention_pending, true);
|
|
1841
|
-
assert.equal(ownedAttention?.leader_attention_reason, 'stale_leader_with_messages');
|
|
1842
|
-
assert.deepEqual(ownedAttention?.attention_reasons, ['stale_leader_with_messages', 'leader_session_stopped']);
|
|
1843
|
-
assert.equal(otherAttention, null);
|
|
1844
|
-
}
|
|
1845
|
-
finally {
|
|
1846
|
-
await cleanup();
|
|
1847
|
-
}
|
|
1848
|
-
});
|
|
1849
|
-
it('marks only active leader-owned teams from the native stop hook', async () => {
|
|
1850
|
-
const { cwd, cleanup } = await setupTeam('owned-stop-team');
|
|
1851
|
-
try {
|
|
1852
|
-
const ownedManifest = await readTeamManifestV2('owned-stop-team', cwd);
|
|
1853
|
-
assert.ok(ownedManifest);
|
|
1854
|
-
await writeTeamManifestV2({
|
|
1855
|
-
...ownedManifest,
|
|
1856
|
-
leader: {
|
|
1857
|
-
...ownedManifest.leader,
|
|
1858
|
-
session_id: 'leader-session-stop',
|
|
1859
|
-
},
|
|
1860
|
-
}, cwd);
|
|
1861
|
-
const updatedTeams = await markOwnedTeamsLeaderStopObserved(cwd, 'leader-session-stop', '2026-03-10T10:15:00.000Z');
|
|
1862
|
-
assert.deepEqual(updatedTeams, ['owned-stop-team']);
|
|
1863
|
-
const ownedAttention = await readTeamLeaderAttention('owned-stop-team', cwd);
|
|
1864
|
-
assert.equal(ownedAttention?.source, 'native_stop');
|
|
1865
|
-
assert.equal(ownedAttention?.leader_session_active, false);
|
|
1866
|
-
}
|
|
1867
|
-
finally {
|
|
1868
|
-
await cleanup();
|
|
1869
|
-
}
|
|
1870
|
-
});
|
|
1871
|
-
});
|
|
1872
|
-
// ─── get-summary ──────────────────────────────────────────────────────────
|
|
1873
|
-
describe('executeTeamApiOperation: get-summary', () => {
|
|
1874
|
-
it('returns summary for existing team', async () => {
|
|
1875
|
-
const { cwd, cleanup } = await setupTeam('sum-team');
|
|
1876
|
-
try {
|
|
1877
|
-
const result = await executeTeamApiOperation('get-summary', {
|
|
1878
|
-
team_name: 'sum-team',
|
|
1879
|
-
}, cwd);
|
|
1880
|
-
assert.equal(result.ok, true);
|
|
1881
|
-
}
|
|
1882
|
-
finally {
|
|
1883
|
-
await cleanup();
|
|
1884
|
-
}
|
|
1885
|
-
});
|
|
1886
|
-
it('returns team_not_found for nonexistent team', async () => {
|
|
1887
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-interop-sum-nf-'));
|
|
1888
|
-
try {
|
|
1889
|
-
const result = await executeTeamApiOperation('get-summary', {
|
|
1890
|
-
team_name: 'nonexistent-sum',
|
|
1891
|
-
}, cwd);
|
|
1892
|
-
assert.equal(result.ok, false);
|
|
1893
|
-
if (!result.ok)
|
|
1894
|
-
assert.equal(result.error.code, 'team_not_found');
|
|
1895
|
-
}
|
|
1896
|
-
finally {
|
|
1897
|
-
await rm(cwd, { recursive: true, force: true });
|
|
1898
|
-
}
|
|
1899
|
-
});
|
|
1900
|
-
it('returns error when team_name missing', async () => {
|
|
1901
|
-
const result = await executeTeamApiOperation('get-summary', {}, '/tmp');
|
|
1902
|
-
assert.equal(result.ok, false);
|
|
1903
|
-
});
|
|
1904
|
-
});
|
|
1905
|
-
// ─── cleanup ──────────────────────────────────────────────────────────────
|
|
1906
|
-
describe('executeTeamApiOperation: cleanup', () => {
|
|
1907
|
-
it('routes normal cleanup through shutdownTeam', async () => {
|
|
1908
|
-
const { cwd, cleanup } = await setupTeam('cleanup-team');
|
|
1909
|
-
try {
|
|
1910
|
-
const result = await executeTeamApiOperation('cleanup', {
|
|
1911
|
-
team_name: 'cleanup-team',
|
|
1912
|
-
}, cwd);
|
|
1913
|
-
assert.equal(result.ok, true);
|
|
1914
|
-
if (result.ok) {
|
|
1915
|
-
assert.equal(result.data.team_name, 'cleanup-team');
|
|
1916
|
-
assert.equal(result.data.cleanup_mode, 'shutdown');
|
|
1917
|
-
}
|
|
1918
|
-
}
|
|
1919
|
-
finally {
|
|
1920
|
-
await cleanup();
|
|
1921
|
-
}
|
|
1922
|
-
});
|
|
1923
|
-
it('deactivates lingering team mode state after cleanup removes canonical team state', async () => {
|
|
1924
|
-
const { cwd, cleanup } = await setupTeam('cleanup-mode-sync');
|
|
1925
|
-
try {
|
|
1926
|
-
const stateDir = join(cwd, '.rcs', 'state');
|
|
1927
|
-
const sessionId = 'sess-cleanup-mode-sync';
|
|
1928
|
-
await mkdir(join(stateDir, 'sessions', sessionId), { recursive: true });
|
|
1929
|
-
await writeFile(join(stateDir, 'session.json'), JSON.stringify({ session_id: sessionId }, null, 2));
|
|
1930
|
-
const manifest = await readTeamManifestV2('cleanup-mode-sync', cwd);
|
|
1931
|
-
assert.ok(manifest);
|
|
1932
|
-
if (!manifest)
|
|
1933
|
-
throw new Error('manifest missing');
|
|
1934
|
-
await writeTeamManifestV2({
|
|
1935
|
-
...manifest,
|
|
1936
|
-
leader: {
|
|
1937
|
-
...(manifest.leader ?? {}),
|
|
1938
|
-
session_id: sessionId,
|
|
1939
|
-
},
|
|
1940
|
-
}, cwd);
|
|
1941
|
-
const activeState = {
|
|
1942
|
-
active: true,
|
|
1943
|
-
current_phase: 'starting',
|
|
1944
|
-
team_name: 'cleanup-mode-sync',
|
|
1945
|
-
session_id: sessionId,
|
|
1946
|
-
};
|
|
1947
|
-
await writeFile(join(stateDir, 'team-state.json'), JSON.stringify(activeState, null, 2));
|
|
1948
|
-
await writeFile(join(stateDir, 'sessions', sessionId, 'team-state.json'), JSON.stringify(activeState, null, 2));
|
|
1949
|
-
const result = await executeTeamApiOperation('cleanup', {
|
|
1950
|
-
team_name: 'cleanup-mode-sync',
|
|
1951
|
-
}, cwd);
|
|
1952
|
-
assert.equal(result.ok, true);
|
|
1953
|
-
const rootState = JSON.parse(await readFile(join(stateDir, 'team-state.json'), 'utf-8'));
|
|
1954
|
-
assert.equal(rootState.active, false);
|
|
1955
|
-
assert.equal(rootState.current_phase, 'cancelled');
|
|
1956
|
-
assert.ok(typeof rootState.completed_at === 'string' && rootState.completed_at.length > 0);
|
|
1957
|
-
const scopedState = JSON.parse(await readFile(join(stateDir, 'sessions', sessionId, 'team-state.json'), 'utf-8'));
|
|
1958
|
-
assert.equal(scopedState.active, false);
|
|
1959
|
-
assert.equal(scopedState.current_phase, 'cancelled');
|
|
1960
|
-
assert.ok(typeof scopedState.completed_at === 'string' && scopedState.completed_at.length > 0);
|
|
1961
|
-
}
|
|
1962
|
-
finally {
|
|
1963
|
-
await cleanup();
|
|
1964
|
-
}
|
|
1965
|
-
});
|
|
1966
|
-
it('does not bypass shutdown gate for pending work', async () => {
|
|
1967
|
-
const { cwd, cleanup } = await setupTeam('cleanup-gated');
|
|
1968
|
-
try {
|
|
1969
|
-
await createTask('cleanup-gated', {
|
|
1970
|
-
subject: 'pending task',
|
|
1971
|
-
description: 'should block normal cleanup',
|
|
1972
|
-
status: 'pending',
|
|
1973
|
-
}, cwd);
|
|
1974
|
-
const result = await executeTeamApiOperation('cleanup', {
|
|
1975
|
-
team_name: 'cleanup-gated',
|
|
1976
|
-
}, cwd);
|
|
1977
|
-
assert.equal(result.ok, false);
|
|
1978
|
-
if (!result.ok)
|
|
1979
|
-
assert.match(result.error.message, /shutdown_gate_blocked/);
|
|
1980
|
-
}
|
|
1981
|
-
finally {
|
|
1982
|
-
await cleanup();
|
|
1983
|
-
}
|
|
1984
|
-
});
|
|
1985
|
-
it('returns error when team_name missing', async () => {
|
|
1986
|
-
const result = await executeTeamApiOperation('cleanup', {}, '/tmp');
|
|
1987
|
-
assert.equal(result.ok, false);
|
|
1988
|
-
});
|
|
1989
|
-
it('requires confirm_issues for failed-task cleanup on normal teams', async () => {
|
|
1990
|
-
const { cwd, cleanup } = await setupTeam('cleanup-gate');
|
|
1991
|
-
try {
|
|
1992
|
-
await createTask('cleanup-gate', {
|
|
1993
|
-
subject: 'failed task',
|
|
1994
|
-
description: 'must keep team state when gate blocks cleanup',
|
|
1995
|
-
status: 'failed',
|
|
1996
|
-
}, cwd);
|
|
1997
|
-
const result = await executeTeamApiOperation('cleanup', {
|
|
1998
|
-
team_name: 'cleanup-gate',
|
|
1999
|
-
}, cwd);
|
|
2000
|
-
assert.equal(result.ok, false);
|
|
2001
|
-
if (!result.ok) {
|
|
2002
|
-
assert.match(result.error.message, /shutdown_confirm_issues_required:failed=1/);
|
|
2003
|
-
}
|
|
2004
|
-
const summary = await executeTeamApiOperation('get-summary', {
|
|
2005
|
-
team_name: 'cleanup-gate',
|
|
2006
|
-
}, cwd);
|
|
2007
|
-
assert.equal(summary.ok, true);
|
|
2008
|
-
}
|
|
2009
|
-
finally {
|
|
2010
|
-
await cleanup();
|
|
2011
|
-
}
|
|
2012
|
-
});
|
|
2013
|
-
it('allows cleanup with confirm_issues when failed tasks remain', async () => {
|
|
2014
|
-
const { cwd, cleanup } = await setupTeam('cleanup-confirm-issues');
|
|
2015
|
-
try {
|
|
2016
|
-
await createTask('cleanup-confirm-issues', {
|
|
2017
|
-
subject: 'failed task',
|
|
2018
|
-
description: 'requires explicit confirmation',
|
|
2019
|
-
status: 'failed',
|
|
2020
|
-
}, cwd);
|
|
2021
|
-
const result = await executeTeamApiOperation('cleanup', {
|
|
2022
|
-
team_name: 'cleanup-confirm-issues',
|
|
2023
|
-
confirm_issues: true,
|
|
2024
|
-
}, cwd);
|
|
2025
|
-
assert.equal(result.ok, true);
|
|
2026
|
-
if (result.ok) {
|
|
2027
|
-
assert.equal(result.data.team_name, 'cleanup-confirm-issues');
|
|
2028
|
-
assert.equal(result.data.cleanup_mode, 'shutdown');
|
|
2029
|
-
}
|
|
2030
|
-
}
|
|
2031
|
-
finally {
|
|
2032
|
-
await cleanup();
|
|
2033
|
-
}
|
|
2034
|
-
});
|
|
2035
|
-
});
|
|
2036
|
-
describe('executeTeamApiOperation: orphan-cleanup', () => {
|
|
2037
|
-
it('uses destructive orphan cleanup explicitly', async () => {
|
|
2038
|
-
const { cwd } = await setupTeam('cleanup-orphan');
|
|
2039
|
-
const result = await executeTeamApiOperation('orphan-cleanup', {
|
|
2040
|
-
team_name: 'cleanup-orphan',
|
|
2041
|
-
}, cwd);
|
|
2042
|
-
assert.equal(result.ok, true);
|
|
2043
|
-
if (result.ok) {
|
|
2044
|
-
assert.equal(result.data.team_name, 'cleanup-orphan');
|
|
2045
|
-
assert.equal(result.data.cleanup_mode, 'orphan_cleanup');
|
|
2046
|
-
}
|
|
2047
|
-
});
|
|
2048
|
-
it('resolves display team names before orphan cleanup', async () => {
|
|
2049
|
-
const { cwd, cleanup } = await setupDisplayTeam('orphan-display-111111', 'orphan-display', 'session-orphan-display');
|
|
2050
|
-
try {
|
|
2051
|
-
const result = await executeTeamApiOperation('orphan-cleanup', {
|
|
2052
|
-
team_name: 'orphan-display',
|
|
2053
|
-
}, cwd);
|
|
2054
|
-
assert.equal(result.ok, true);
|
|
2055
|
-
if (result.ok) {
|
|
2056
|
-
assert.equal(result.data.team_name, 'orphan-display-111111');
|
|
2057
|
-
assert.equal(result.data.cleanup_mode, 'orphan_cleanup');
|
|
2058
|
-
}
|
|
2059
|
-
}
|
|
2060
|
-
finally {
|
|
2061
|
-
await cleanup();
|
|
2062
|
-
}
|
|
2063
|
-
});
|
|
2064
|
-
it('returns error when team_name missing', async () => {
|
|
2065
|
-
const result = await executeTeamApiOperation('orphan-cleanup', {}, '/tmp');
|
|
2066
|
-
assert.equal(result.ok, false);
|
|
2067
|
-
});
|
|
2068
|
-
});
|
|
2069
|
-
// ─── write-shutdown-request ───────────────────────────────────────────────
|
|
2070
|
-
describe('executeTeamApiOperation: write-shutdown-request', () => {
|
|
2071
|
-
it('writes a shutdown request', async () => {
|
|
2072
|
-
const { cwd, cleanup } = await setupTeam('sd-req');
|
|
2073
|
-
try {
|
|
2074
|
-
const result = await executeTeamApiOperation('write-shutdown-request', {
|
|
2075
|
-
team_name: 'sd-req', worker: 'worker-1', requested_by: 'leader-fixed',
|
|
2076
|
-
}, cwd);
|
|
2077
|
-
assert.equal(result.ok, true);
|
|
2078
|
-
}
|
|
2079
|
-
finally {
|
|
2080
|
-
await cleanup();
|
|
2081
|
-
}
|
|
2082
|
-
});
|
|
2083
|
-
it('returns error when required fields missing', async () => {
|
|
2084
|
-
const result = await executeTeamApiOperation('write-shutdown-request', {
|
|
2085
|
-
team_name: 'x', worker: 'w1',
|
|
2086
|
-
}, '/tmp');
|
|
2087
|
-
assert.equal(result.ok, false);
|
|
2088
|
-
});
|
|
2089
|
-
});
|
|
2090
|
-
// ─── read-shutdown-ack ────────────────────────────────────────────────────
|
|
2091
|
-
describe('executeTeamApiOperation: read-shutdown-ack', () => {
|
|
2092
|
-
it('reads shutdown ack (null when not present)', async () => {
|
|
2093
|
-
const { cwd, cleanup } = await setupTeam('sd-ack');
|
|
2094
|
-
try {
|
|
2095
|
-
const result = await executeTeamApiOperation('read-shutdown-ack', {
|
|
2096
|
-
team_name: 'sd-ack', worker: 'worker-1',
|
|
2097
|
-
}, cwd);
|
|
2098
|
-
assert.equal(result.ok, true);
|
|
2099
|
-
}
|
|
2100
|
-
finally {
|
|
2101
|
-
await cleanup();
|
|
2102
|
-
}
|
|
2103
|
-
});
|
|
2104
|
-
it('supports min_updated_at parameter', async () => {
|
|
2105
|
-
const { cwd, cleanup } = await setupTeam('sd-ack-min');
|
|
2106
|
-
try {
|
|
2107
|
-
const result = await executeTeamApiOperation('read-shutdown-ack', {
|
|
2108
|
-
team_name: 'sd-ack-min', worker: 'worker-1', min_updated_at: new Date().toISOString(),
|
|
2109
|
-
}, cwd);
|
|
2110
|
-
assert.equal(result.ok, true);
|
|
2111
|
-
}
|
|
2112
|
-
finally {
|
|
2113
|
-
await cleanup();
|
|
2114
|
-
}
|
|
2115
|
-
});
|
|
2116
|
-
it('returns error when required fields missing', async () => {
|
|
2117
|
-
const result = await executeTeamApiOperation('read-shutdown-ack', {
|
|
2118
|
-
team_name: 'x',
|
|
2119
|
-
}, '/tmp');
|
|
2120
|
-
assert.equal(result.ok, false);
|
|
2121
|
-
});
|
|
2122
|
-
});
|
|
2123
|
-
// ─── read-monitor-snapshot ────────────────────────────────────────────────
|
|
2124
|
-
describe('executeTeamApiOperation: read-monitor-snapshot', () => {
|
|
2125
|
-
it('reads monitor snapshot', async () => {
|
|
2126
|
-
const { cwd, cleanup } = await setupTeam('rd-mon');
|
|
2127
|
-
try {
|
|
2128
|
-
const result = await executeTeamApiOperation('read-monitor-snapshot', {
|
|
2129
|
-
team_name: 'rd-mon',
|
|
2130
|
-
}, cwd);
|
|
2131
|
-
assert.equal(result.ok, true);
|
|
2132
|
-
}
|
|
2133
|
-
finally {
|
|
2134
|
-
await cleanup();
|
|
2135
|
-
}
|
|
2136
|
-
});
|
|
2137
|
-
it('returns error when team_name missing', async () => {
|
|
2138
|
-
const result = await executeTeamApiOperation('read-monitor-snapshot', {}, '/tmp');
|
|
2139
|
-
assert.equal(result.ok, false);
|
|
2140
|
-
});
|
|
2141
|
-
});
|
|
2142
|
-
// ─── write-monitor-snapshot ───────────────────────────────────────────────
|
|
2143
|
-
describe('executeTeamApiOperation: write-monitor-snapshot', () => {
|
|
2144
|
-
it('writes monitor snapshot', async () => {
|
|
2145
|
-
const { cwd, cleanup } = await setupTeam('wr-mon');
|
|
2146
|
-
try {
|
|
2147
|
-
const result = await executeTeamApiOperation('write-monitor-snapshot', {
|
|
2148
|
-
team_name: 'wr-mon',
|
|
2149
|
-
snapshot: {
|
|
2150
|
-
teamName: 'wr-mon',
|
|
2151
|
-
phase: 'team-exec',
|
|
2152
|
-
workers: [],
|
|
2153
|
-
tasks: { total: 0, pending: 0, blocked: 0, in_progress: 0, completed: 0, failed: 0 },
|
|
2154
|
-
deadWorkers: [],
|
|
2155
|
-
nonReportingWorkers: [],
|
|
2156
|
-
},
|
|
2157
|
-
}, cwd);
|
|
2158
|
-
assert.equal(result.ok, true);
|
|
2159
|
-
}
|
|
2160
|
-
finally {
|
|
2161
|
-
await cleanup();
|
|
2162
|
-
}
|
|
2163
|
-
});
|
|
2164
|
-
it('returns error when snapshot missing', async () => {
|
|
2165
|
-
const result = await executeTeamApiOperation('write-monitor-snapshot', {
|
|
2166
|
-
team_name: 'x',
|
|
2167
|
-
}, '/tmp');
|
|
2168
|
-
assert.equal(result.ok, false);
|
|
2169
|
-
});
|
|
2170
|
-
});
|
|
2171
|
-
// ─── read-task-approval ───────────────────────────────────────────────────
|
|
2172
|
-
describe('executeTeamApiOperation: read-task-approval', () => {
|
|
2173
|
-
it('reads task approval (null when not set)', async () => {
|
|
2174
|
-
const { cwd, cleanup } = await setupTeam('rd-appr');
|
|
2175
|
-
try {
|
|
2176
|
-
const task = await createTask('rd-appr', { subject: 'A', description: 'B', status: 'pending' }, cwd);
|
|
2177
|
-
const result = await executeTeamApiOperation('read-task-approval', {
|
|
2178
|
-
team_name: 'rd-appr', task_id: task.id,
|
|
2179
|
-
}, cwd);
|
|
2180
|
-
assert.equal(result.ok, true);
|
|
2181
|
-
}
|
|
2182
|
-
finally {
|
|
2183
|
-
await cleanup();
|
|
2184
|
-
}
|
|
2185
|
-
});
|
|
2186
|
-
it('returns error when required fields missing', async () => {
|
|
2187
|
-
const result = await executeTeamApiOperation('read-task-approval', {
|
|
2188
|
-
team_name: 'x',
|
|
2189
|
-
}, '/tmp');
|
|
2190
|
-
assert.equal(result.ok, false);
|
|
2191
|
-
});
|
|
2192
|
-
});
|
|
2193
|
-
// ─── write-task-approval ──────────────────────────────────────────────────
|
|
2194
|
-
describe('executeTeamApiOperation: write-task-approval', () => {
|
|
2195
|
-
it('writes task approval successfully', async () => {
|
|
2196
|
-
const { cwd, cleanup } = await setupTeam('wr-appr');
|
|
2197
|
-
try {
|
|
2198
|
-
const task = await createTask('wr-appr', { subject: 'A', description: 'B', status: 'pending' }, cwd);
|
|
2199
|
-
const result = await executeTeamApiOperation('write-task-approval', {
|
|
2200
|
-
team_name: 'wr-appr', task_id: task.id, status: 'approved',
|
|
2201
|
-
reviewer: 'leader-fixed', decision_reason: 'Looks good',
|
|
2202
|
-
}, cwd);
|
|
2203
|
-
assert.equal(result.ok, true);
|
|
2204
|
-
}
|
|
2205
|
-
finally {
|
|
2206
|
-
await cleanup();
|
|
2207
|
-
}
|
|
2208
|
-
});
|
|
2209
|
-
it('rejects invalid approval status', async () => {
|
|
2210
|
-
const result = await executeTeamApiOperation('write-task-approval', {
|
|
2211
|
-
team_name: 'x', task_id: '1', status: 'maybe',
|
|
2212
|
-
reviewer: 'r', decision_reason: 'reason',
|
|
2213
|
-
}, '/tmp');
|
|
2214
|
-
assert.equal(result.ok, false);
|
|
2215
|
-
if (!result.ok)
|
|
2216
|
-
assert.match(result.error.message, /status must be one of/);
|
|
2217
|
-
});
|
|
2218
|
-
it('rejects non-boolean required field', async () => {
|
|
2219
|
-
const result = await executeTeamApiOperation('write-task-approval', {
|
|
2220
|
-
team_name: 'x', task_id: '1', status: 'approved',
|
|
2221
|
-
reviewer: 'r', decision_reason: 'reason', required: 'yes',
|
|
2222
|
-
}, '/tmp');
|
|
2223
|
-
assert.equal(result.ok, false);
|
|
2224
|
-
if (!result.ok)
|
|
2225
|
-
assert.match(result.error.message, /required must be a boolean/);
|
|
2226
|
-
});
|
|
2227
|
-
it('returns error when required fields missing', async () => {
|
|
2228
|
-
const result = await executeTeamApiOperation('write-task-approval', {
|
|
2229
|
-
team_name: 'x', task_id: '1',
|
|
2230
|
-
}, '/tmp');
|
|
2231
|
-
assert.equal(result.ok, false);
|
|
2232
|
-
});
|
|
2233
|
-
});
|
|
2234
|
-
// ─── error envelope (catch block) ─────────────────────────────────────────
|
|
2235
|
-
describe('executeTeamApiOperation: error handling', () => {
|
|
2236
|
-
it('wraps thrown errors in an error envelope', async () => {
|
|
2237
|
-
const cwd = await mkdtemp(join(tmpdir(), 'rcs-interop-err-'));
|
|
2238
|
-
try {
|
|
2239
|
-
await mkdir(join(cwd, '.rcs', 'state', 'team', 'err-team'), { recursive: true });
|
|
2240
|
-
await writeFile(join(cwd, '.rcs', 'state', 'team', 'err-team', 'config.json'), '{}', 'utf8');
|
|
2241
|
-
const result = await executeTeamApiOperation('claim-task', {
|
|
2242
|
-
team_name: 'err-team', task_id: '1', worker: 'w1',
|
|
2243
|
-
}, cwd);
|
|
2244
|
-
assert.ok(result.ok === true || result.ok === false);
|
|
2245
|
-
if (!result.ok) {
|
|
2246
|
-
assert.equal(result.operation, 'claim-task');
|
|
2247
|
-
assert.ok(result.error.code);
|
|
2248
|
-
assert.ok(result.error.message);
|
|
2249
|
-
}
|
|
2250
|
-
}
|
|
2251
|
-
finally {
|
|
2252
|
-
await rm(cwd, { recursive: true, force: true });
|
|
2253
|
-
}
|
|
2254
|
-
});
|
|
2255
|
-
it('resolves team cwd from empty team_name using fallback', async () => {
|
|
2256
|
-
const result = await executeTeamApiOperation('list-tasks', {
|
|
2257
|
-
team_name: '',
|
|
2258
|
-
}, '/tmp');
|
|
2259
|
-
assert.equal(result.ok, false);
|
|
2260
|
-
});
|
|
2261
|
-
});
|
|
2262
|
-
//# sourceMappingURL=api-interop.test.js.map
|