@openrig/cli 0.7.18 → 0.7.19
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 +7 -6
- package/daemon/assets/claude-hook-bridge.cjs +146 -0
- package/daemon/assets/plugins/openrig/.claude-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/.codex-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/.cursor-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig/plugin.json +1 -1
- package/daemon/assets/plugins/openrig-core/.claude-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig-core/.codex-plugin/plugin.json +1 -1
- package/daemon/assets/plugins/openrig-core/README.md +1 -1
- package/daemon/assets/plugins/openrig-core/hooks/claude.json +14 -14
- package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +43 -22
- package/daemon/assets/plugins/openrig-core/hooks/scripts/refocus.cjs +1 -0
- package/daemon/assets/plugins/openrig-core/skills/mission-slice-sop/SKILL.md +1 -1
- package/daemon/assets/plugins/openrig-core/skills/refocusing/scripts/trace-to-root.py +70 -2
- package/daemon/assets/skills/rigs/SKILL.md +40 -19
- package/daemon/context-packs/help/manifest.yaml +1 -1
- package/daemon/context-packs/onboarding-width/manifest.yaml +1 -1
- package/daemon/context-packs/onboarding-width/public-what-you-can-do.md +16 -7
- package/daemon/context-packs/reference/getting-started.md +9 -4
- package/daemon/context-packs/reference/manifest.yaml +1 -1
- package/daemon/context-packs/reference/rig-spec.md +56 -26
- package/daemon/context-packs/reference/whats-new.md +82 -11
- package/daemon/context-packs/skills/agent-operated-software/manifest.yaml +1 -1
- package/daemon/context-packs/skills/agent-operated-workflows/manifest.yaml +1 -1
- package/daemon/context-packs/skills/applying-a-permission-policy/manifest.yaml +1 -1
- package/daemon/context-packs/skills/claude-compaction-restore/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-starters/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/agent-startup-and-context-ingestion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/cross-host-rig-commands/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/human-in-the-loop/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/messaging-the-human/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-architect/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-cmux/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-herdr/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-skills/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-software-factory/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/openrig-upgrade/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/rig-bundles-and-shareable-artifacts/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/rig-lifecycle/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/session-source-fork/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/specification-system/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/topology-mutation-and-seat-management/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/watchdog/manifest.yaml +1 -1
- package/daemon/context-packs/skills/core/working-with-an-openrig-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/delegating-work/manifest.yaml +1 -1
- package/daemon/context-packs/skills/forming-an-openrig-mental-model/manifest.yaml +1 -1
- package/daemon/context-packs/skills/loading-addressable-markdown/manifest.yaml +1 -1
- package/daemon/context-packs/skills/mission-slice-sop/SKILL.md +1 -1
- package/daemon/context-packs/skills/mission-slice-sop/manifest.yaml +1 -1
- package/daemon/context-packs/skills/openrig-operating-model/manifest.yaml +1 -1
- package/daemon/context-packs/skills/openrig-user/manifest.yaml +1 -1
- package/daemon/context-packs/skills/orienting-to-an-inherited-seat/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/backlog-capture/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/context-builder/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/exec-summary/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/office-hours/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/plan-review/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/requirements-writer/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pm/ui-mockup/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/development-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/orchestration-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/oversight-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/pods/review-team/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/agent-browser/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/context-engineering/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/dogfood/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/frontend-design/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/systematic-debugging/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/test-driven-development/manifest.yaml +1 -1
- package/daemon/context-packs/skills/process/verification-before-completion/manifest.yaml +1 -1
- package/daemon/context-packs/skills/queue-handoff/manifest.yaml +1 -1
- package/daemon/context-packs/skills/refocusing/manifest.yaml +1 -1
- package/daemon/context-packs/skills/refocusing/scripts/trace-to-root.py +70 -2
- package/daemon/context-packs/skills/retiring-and-inheriting-a-seat/manifest.yaml +1 -1
- package/daemon/context-packs/skills/seat-continuity-and-handover/manifest.yaml +1 -1
- package/daemon/context-packs/skills/session-compaction-and-restore/manifest.yaml +1 -1
- package/daemon/context-packs/skills/software-for-agents/manifest.yaml +1 -1
- package/daemon/context-packs/world-example/manifest.yaml +1 -1
- package/daemon/context-packs/world-public/manifest.yaml +1 -1
- package/daemon/dist/adapters/claude-code-adapter.d.ts +9 -0
- package/daemon/dist/adapters/claude-code-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-code-adapter.js +41 -4
- package/daemon/dist/adapters/claude-code-adapter.js.map +1 -1
- package/daemon/dist/adapters/claude-resume.d.ts +2 -0
- package/daemon/dist/adapters/claude-resume.d.ts.map +1 -1
- package/daemon/dist/adapters/claude-resume.js +3 -1
- package/daemon/dist/adapters/claude-resume.js.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts +5 -0
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.js +45 -10
- package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/kernel-authority.d.ts +7 -0
- package/daemon/dist/adapters/kernel-authority.d.ts.map +1 -1
- package/daemon/dist/adapters/kernel-authority.js +24 -1
- package/daemon/dist/adapters/kernel-authority.js.map +1 -1
- package/daemon/dist/adapters/pi-resume.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-resume.js +5 -7
- package/daemon/dist/adapters/pi-resume.js.map +1 -1
- package/daemon/dist/adapters/pi-runner-protocol.d.ts +5 -1
- package/daemon/dist/adapters/pi-runner-protocol.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runner.d.ts +34 -0
- package/daemon/dist/adapters/pi-runner.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runner.js +359 -26
- package/daemon/dist/adapters/pi-runner.js.map +1 -1
- package/daemon/dist/adapters/pi-runtime-adapter.d.ts +7 -1
- package/daemon/dist/adapters/pi-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/pi-runtime-adapter.js +29 -19
- package/daemon/dist/adapters/pi-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/tmux.d.ts +54 -34
- package/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux.js +183 -57
- package/daemon/dist/adapters/tmux.js.map +1 -1
- package/daemon/dist/build-info.js +3 -3
- package/daemon/dist/db/all-migrations.d.ts.map +1 -1
- package/daemon/dist/db/all-migrations.js +6 -0
- package/daemon/dist/db/all-migrations.js.map +1 -1
- package/daemon/dist/db/migrations/171_seat_hook_bridge.d.ts +5 -0
- package/daemon/dist/db/migrations/171_seat_hook_bridge.d.ts.map +1 -0
- package/daemon/dist/db/migrations/171_seat_hook_bridge.js +25 -0
- package/daemon/dist/db/migrations/171_seat_hook_bridge.js.map +1 -0
- package/daemon/dist/db/migrations/174_session_launched_cwd.d.ts +6 -0
- package/daemon/dist/db/migrations/174_session_launched_cwd.d.ts.map +1 -0
- package/daemon/dist/db/migrations/174_session_launched_cwd.js +8 -0
- package/daemon/dist/db/migrations/174_session_launched_cwd.js.map +1 -0
- package/daemon/dist/db/migrations/175_core_app_access.d.ts +3 -0
- package/daemon/dist/db/migrations/175_core_app_access.d.ts.map +1 -0
- package/daemon/dist/db/migrations/175_core_app_access.js +26 -0
- package/daemon/dist/db/migrations/175_core_app_access.js.map +1 -0
- package/daemon/dist/domain/activity-grants.d.ts.map +1 -1
- package/daemon/dist/domain/activity-grants.js +6 -4
- package/daemon/dist/domain/activity-grants.js.map +1 -1
- package/daemon/dist/domain/agent-activity-store.d.ts +23 -0
- package/daemon/dist/domain/agent-activity-store.d.ts.map +1 -1
- package/daemon/dist/domain/agent-activity-store.js +62 -5
- package/daemon/dist/domain/agent-activity-store.js.map +1 -1
- package/daemon/dist/domain/claude-activity-hooks.d.ts +4 -2
- package/daemon/dist/domain/claude-activity-hooks.d.ts.map +1 -1
- package/daemon/dist/domain/claude-activity-hooks.js +5 -3
- package/daemon/dist/domain/claude-activity-hooks.js.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts +64 -3
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.js +203 -6
- package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
- package/daemon/dist/domain/compaction-restore-notice.d.ts +3 -1
- package/daemon/dist/domain/compaction-restore-notice.d.ts.map +1 -1
- package/daemon/dist/domain/compaction-restore-notice.js +22 -3
- package/daemon/dist/domain/compaction-restore-notice.js.map +1 -1
- package/daemon/dist/domain/configured-account.d.ts +3 -0
- package/daemon/dist/domain/configured-account.d.ts.map +1 -0
- package/daemon/dist/domain/configured-account.js +10 -0
- package/daemon/dist/domain/configured-account.js.map +1 -0
- package/daemon/dist/domain/core-app-access.d.ts +51 -0
- package/daemon/dist/domain/core-app-access.d.ts.map +1 -0
- package/daemon/dist/domain/core-app-access.js +107 -0
- package/daemon/dist/domain/core-app-access.js.map +1 -0
- package/daemon/dist/domain/core-app-job.d.ts +411 -0
- package/daemon/dist/domain/core-app-job.d.ts.map +1 -0
- package/daemon/dist/domain/core-app-job.js +537 -0
- package/daemon/dist/domain/core-app-job.js.map +1 -0
- package/daemon/dist/domain/current-park-arm.d.ts +4 -0
- package/daemon/dist/domain/current-park-arm.d.ts.map +1 -0
- package/daemon/dist/domain/current-park-arm.js +14 -0
- package/daemon/dist/domain/current-park-arm.js.map +1 -0
- package/daemon/dist/domain/cwd-resolution.d.ts +12 -0
- package/daemon/dist/domain/cwd-resolution.d.ts.map +1 -1
- package/daemon/dist/domain/cwd-resolution.js +21 -1
- package/daemon/dist/domain/cwd-resolution.js.map +1 -1
- package/daemon/dist/domain/execution-view.d.ts.map +1 -1
- package/daemon/dist/domain/execution-view.js +9 -3
- package/daemon/dist/domain/execution-view.js.map +1 -1
- package/daemon/dist/domain/gateway/participants.d.ts +2 -0
- package/daemon/dist/domain/gateway/participants.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/participants.js +5 -1
- package/daemon/dist/domain/gateway/participants.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.d.ts +1 -0
- package/daemon/dist/domain/gateway/slack/message.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/message.js +37 -17
- package/daemon/dist/domain/gateway/slack/message.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/settled-asks.js +1 -1
- package/daemon/dist/domain/gateway/slack/settled-asks.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts +1 -0
- package/daemon/dist/domain/gateway/slack/slack-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-delivery.js +2 -0
- package/daemon/dist/domain/gateway/slack/slack-delivery.js.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts +4 -0
- package/daemon/dist/domain/gateway/slack/slack-subsystem.d.ts.map +1 -1
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js +26 -2
- package/daemon/dist/domain/gateway/slack/slack-subsystem.js.map +1 -1
- package/daemon/dist/domain/hook-bridge.d.ts +345 -0
- package/daemon/dist/domain/hook-bridge.d.ts.map +1 -0
- package/daemon/dist/domain/hook-bridge.js +547 -0
- package/daemon/dist/domain/hook-bridge.js.map +1 -0
- package/daemon/dist/domain/hosted-wake.d.ts +9 -0
- package/daemon/dist/domain/hosted-wake.d.ts.map +1 -1
- package/daemon/dist/domain/hosted-wake.js +45 -6
- package/daemon/dist/domain/hosted-wake.js.map +1 -1
- package/daemon/dist/domain/human-ask-attention.d.ts +10 -0
- package/daemon/dist/domain/human-ask-attention.d.ts.map +1 -0
- package/daemon/dist/domain/human-ask-attention.js +22 -0
- package/daemon/dist/domain/human-ask-attention.js.map +1 -0
- package/daemon/dist/domain/mission-control/mission-control-action-log.d.ts +4 -0
- package/daemon/dist/domain/mission-control/mission-control-action-log.d.ts.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-action-log.js +8 -1
- package/daemon/dist/domain/mission-control/mission-control-action-log.js.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts +10 -0
- package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js +64 -12
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
- package/daemon/dist/domain/native-continuation-notice.d.ts +16 -0
- package/daemon/dist/domain/native-continuation-notice.d.ts.map +1 -0
- package/daemon/dist/domain/native-continuation-notice.js +79 -0
- package/daemon/dist/domain/native-continuation-notice.js.map +1 -0
- package/daemon/dist/domain/native-process-lineage.d.ts +16 -0
- package/daemon/dist/domain/native-process-lineage.d.ts.map +1 -1
- package/daemon/dist/domain/native-process-lineage.js +48 -3
- package/daemon/dist/domain/native-process-lineage.js.map +1 -1
- package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
- package/daemon/dist/domain/node-inventory.js +27 -6
- package/daemon/dist/domain/node-inventory.js.map +1 -1
- package/daemon/dist/domain/node-launcher.d.ts +6 -0
- package/daemon/dist/domain/node-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/node-launcher.js +16 -2
- package/daemon/dist/domain/node-launcher.js.map +1 -1
- package/daemon/dist/domain/outbox-handler.d.ts +21 -3
- package/daemon/dist/domain/outbox-handler.d.ts.map +1 -1
- package/daemon/dist/domain/outbox-handler.js +88 -8
- package/daemon/dist/domain/outbox-handler.js.map +1 -1
- package/daemon/dist/domain/park-wake-text.d.ts +18 -0
- package/daemon/dist/domain/park-wake-text.d.ts.map +1 -1
- package/daemon/dist/domain/park-wake-text.js +44 -0
- package/daemon/dist/domain/park-wake-text.js.map +1 -1
- package/daemon/dist/domain/policies/idle-gate-qitem.d.ts +3 -0
- package/daemon/dist/domain/policies/idle-gate-qitem.d.ts.map +1 -1
- package/daemon/dist/domain/policies/idle-gate-qitem.js +15 -0
- package/daemon/dist/domain/policies/idle-gate-qitem.js.map +1 -1
- package/daemon/dist/domain/policies/parked-owner-consumer.d.ts +6 -1
- package/daemon/dist/domain/policies/parked-owner-consumer.d.ts.map +1 -1
- package/daemon/dist/domain/policies/parked-owner-consumer.js +28 -1
- package/daemon/dist/domain/policies/parked-owner-consumer.js.map +1 -1
- package/daemon/dist/domain/process-limits.d.ts +21 -11
- package/daemon/dist/domain/process-limits.d.ts.map +1 -1
- package/daemon/dist/domain/process-limits.js +74 -20
- package/daemon/dist/domain/process-limits.js.map +1 -1
- package/daemon/dist/domain/process-table.d.ts +15 -0
- package/daemon/dist/domain/process-table.d.ts.map +1 -1
- package/daemon/dist/domain/process-table.js +39 -0
- package/daemon/dist/domain/process-table.js.map +1 -1
- package/daemon/dist/domain/queue-erasure.d.ts.map +1 -1
- package/daemon/dist/domain/queue-erasure.js +3 -0
- package/daemon/dist/domain/queue-erasure.js.map +1 -1
- package/daemon/dist/domain/queue-repository.d.ts +60 -7
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.js +178 -36
- package/daemon/dist/domain/queue-repository.js.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.d.ts +2 -0
- package/daemon/dist/domain/queue-stuck-sweep.d.ts.map +1 -1
- package/daemon/dist/domain/queue-stuck-sweep.js +29 -0
- package/daemon/dist/domain/queue-stuck-sweep.js.map +1 -1
- package/daemon/dist/domain/queue-waiting.d.ts.map +1 -1
- package/daemon/dist/domain/queue-waiting.js +28 -3
- package/daemon/dist/domain/queue-waiting.js.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.d.ts +12 -0
- package/daemon/dist/domain/queue-wake-ladder.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wake-ladder.js +115 -14
- package/daemon/dist/domain/queue-wake-ladder.js.map +1 -1
- package/daemon/dist/domain/queue-wake-repository.d.ts +8 -0
- package/daemon/dist/domain/queue-wake-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-wake-repository.js +48 -8
- package/daemon/dist/domain/queue-wake-repository.js.map +1 -1
- package/daemon/dist/domain/reconciler.d.ts +18 -2
- package/daemon/dist/domain/reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/reconciler.js +40 -0
- package/daemon/dist/domain/reconciler.js.map +1 -1
- package/daemon/dist/domain/restore-attempt-receipt.d.ts.map +1 -1
- package/daemon/dist/domain/restore-attempt-receipt.js +3 -2
- package/daemon/dist/domain/restore-attempt-receipt.js.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts +5 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.js +73 -8
- package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
- package/daemon/dist/domain/restore-topology.d.ts +7 -1
- package/daemon/dist/domain/restore-topology.d.ts.map +1 -1
- package/daemon/dist/domain/restore-topology.js +21 -0
- package/daemon/dist/domain/restore-topology.js.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.d.ts +2 -3
- package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.js +6 -25
- package/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
- package/daemon/dist/domain/rig-repository.d.ts.map +1 -1
- package/daemon/dist/domain/rig-repository.js +7 -6
- package/daemon/dist/domain/rig-repository.js.map +1 -1
- package/daemon/dist/domain/rig-teardown.d.ts +16 -3
- package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
- package/daemon/dist/domain/rig-teardown.js +73 -9
- package/daemon/dist/domain/rig-teardown.js.map +1 -1
- package/daemon/dist/domain/rigspec-exporter.js +2 -2
- package/daemon/dist/domain/rigspec-exporter.js.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.d.ts +5 -0
- package/daemon/dist/domain/rigspec-instantiator.d.ts.map +1 -1
- package/daemon/dist/domain/rigspec-instantiator.js +17 -7
- package/daemon/dist/domain/rigspec-instantiator.js.map +1 -1
- package/daemon/dist/domain/rosters.d.ts +11 -0
- package/daemon/dist/domain/rosters.d.ts.map +1 -1
- package/daemon/dist/domain/rosters.js +21 -2
- package/daemon/dist/domain/rosters.js.map +1 -1
- package/daemon/dist/domain/runner-channel.d.ts +35 -3
- package/daemon/dist/domain/runner-channel.d.ts.map +1 -1
- package/daemon/dist/domain/runner-channel.js +177 -8
- package/daemon/dist/domain/runner-channel.js.map +1 -1
- package/daemon/dist/domain/runner-permissions.d.ts +26 -3
- package/daemon/dist/domain/runner-permissions.d.ts.map +1 -1
- package/daemon/dist/domain/runner-permissions.js +160 -39
- package/daemon/dist/domain/runner-permissions.js.map +1 -1
- package/daemon/dist/domain/scope/mission-parent.d.ts +19 -0
- package/daemon/dist/domain/scope/mission-parent.d.ts.map +1 -0
- package/daemon/dist/domain/scope/mission-parent.js +134 -0
- package/daemon/dist/domain/scope/mission-parent.js.map +1 -0
- package/daemon/dist/domain/scope/scope-audit.d.ts.map +1 -1
- package/daemon/dist/domain/scope/scope-audit.js +8 -0
- package/daemon/dist/domain/scope/scope-audit.js.map +1 -1
- package/daemon/dist/domain/scope/types.d.ts +3 -1
- package/daemon/dist/domain/scope/types.d.ts.map +1 -1
- package/daemon/dist/domain/scope/types.js +5 -1
- package/daemon/dist/domain/scope/types.js.map +1 -1
- package/daemon/dist/domain/seat-delivery-guard.d.ts +14 -2
- package/daemon/dist/domain/seat-delivery-guard.d.ts.map +1 -1
- package/daemon/dist/domain/seat-delivery-guard.js +53 -14
- package/daemon/dist/domain/seat-delivery-guard.js.map +1 -1
- package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-handover-service.js +9 -4
- package/daemon/dist/domain/seat-handover-service.js.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.d.ts +4 -3
- package/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.js +40 -5
- package/daemon/dist/domain/seat-identity-reconciler.js.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.d.ts +14 -6
- package/daemon/dist/domain/seat-lifecycle-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-lifecycle-service.js +104 -22
- package/daemon/dist/domain/seat-lifecycle-service.js.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.d.ts.map +1 -1
- package/daemon/dist/domain/seat-restart-in-place.js +4 -1
- package/daemon/dist/domain/seat-restart-in-place.js.map +1 -1
- package/daemon/dist/domain/seat-runtime-switch-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-runtime-switch-service.js +2 -0
- package/daemon/dist/domain/seat-runtime-switch-service.js.map +1 -1
- package/daemon/dist/domain/seat-skill-apply.d.ts +1 -1
- package/daemon/dist/domain/seat-skill-apply.d.ts.map +1 -1
- package/daemon/dist/domain/seat-skill-apply.js +3 -2
- package/daemon/dist/domain/seat-skill-apply.js.map +1 -1
- package/daemon/dist/domain/session-registry.d.ts +5 -1
- package/daemon/dist/domain/session-registry.d.ts.map +1 -1
- package/daemon/dist/domain/session-registry.js +12 -1
- package/daemon/dist/domain/session-registry.js.map +1 -1
- package/daemon/dist/domain/session-transport.d.ts +40 -1
- package/daemon/dist/domain/session-transport.d.ts.map +1 -1
- package/daemon/dist/domain/session-transport.js +211 -10
- package/daemon/dist/domain/session-transport.js.map +1 -1
- package/daemon/dist/domain/shared-history-selection.d.ts.map +1 -1
- package/daemon/dist/domain/shared-history-selection.js +9 -5
- package/daemon/dist/domain/shared-history-selection.js.map +1 -1
- package/daemon/dist/domain/slices/slice-indexer.d.ts +1 -1
- package/daemon/dist/domain/slices/slice-indexer.d.ts.map +1 -1
- package/daemon/dist/domain/slices/slice-indexer.js +4 -0
- package/daemon/dist/domain/slices/slice-indexer.js.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.d.ts +1 -0
- package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.js +6 -4
- package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -1
- package/daemon/dist/domain/successor-session-launcher.js +10 -4
- package/daemon/dist/domain/successor-session-launcher.js.map +1 -1
- package/daemon/dist/domain/terminal/herdr-adapter.d.ts +35 -1
- package/daemon/dist/domain/terminal/herdr-adapter.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/herdr-adapter.js +231 -33
- package/daemon/dist/domain/terminal/herdr-adapter.js.map +1 -1
- package/daemon/dist/domain/terminal/herdr-sessions.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/herdr-sessions.js +2 -1
- package/daemon/dist/domain/terminal/herdr-sessions.js.map +1 -1
- package/daemon/dist/domain/terminal/rig-viewer-records.d.ts +59 -0
- package/daemon/dist/domain/terminal/rig-viewer-records.d.ts.map +1 -0
- package/daemon/dist/domain/terminal/rig-viewer-records.js +210 -0
- package/daemon/dist/domain/terminal/rig-viewer-records.js.map +1 -0
- package/daemon/dist/domain/terminal/terminal-provider.d.ts +2 -0
- package/daemon/dist/domain/terminal/terminal-provider.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/terminal-service.d.ts +99 -4
- package/daemon/dist/domain/terminal/terminal-service.d.ts.map +1 -1
- package/daemon/dist/domain/terminal/terminal-service.js +556 -36
- package/daemon/dist/domain/terminal/terminal-service.js.map +1 -1
- package/daemon/dist/domain/terminal/tile-layout.js +1 -1
- package/daemon/dist/domain/terminal/tile-layout.js.map +1 -1
- package/daemon/dist/domain/terminal/tmux-viewer-guard.d.ts +25 -0
- package/daemon/dist/domain/terminal/tmux-viewer-guard.d.ts.map +1 -0
- package/daemon/dist/domain/terminal/tmux-viewer-guard.js +70 -0
- package/daemon/dist/domain/terminal/tmux-viewer-guard.js.map +1 -0
- package/daemon/dist/domain/transcript-grep-worker.d.ts +2 -0
- package/daemon/dist/domain/transcript-grep-worker.d.ts.map +1 -0
- package/daemon/dist/domain/transcript-grep-worker.js +108 -0
- package/daemon/dist/domain/transcript-grep-worker.js.map +1 -0
- package/daemon/dist/domain/transcript-grep.d.ts +26 -0
- package/daemon/dist/domain/transcript-grep.d.ts.map +1 -0
- package/daemon/dist/domain/transcript-grep.js +90 -0
- package/daemon/dist/domain/transcript-grep.js.map +1 -0
- package/daemon/dist/domain/transcript-store.d.ts +8 -2
- package/daemon/dist/domain/transcript-store.d.ts.map +1 -1
- package/daemon/dist/domain/transcript-store.js +10 -60
- package/daemon/dist/domain/transcript-store.js.map +1 -1
- package/daemon/dist/domain/types.d.ts +69 -2
- package/daemon/dist/domain/types.d.ts.map +1 -1
- package/daemon/dist/domain/types.js.map +1 -1
- package/daemon/dist/domain/watchdog-delivery-receipts.d.ts +4 -0
- package/daemon/dist/domain/watchdog-delivery-receipts.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-delivery-receipts.js +35 -2
- package/daemon/dist/domain/watchdog-delivery-receipts.js.map +1 -1
- package/daemon/dist/domain/watchdog-delivery.d.ts +44 -0
- package/daemon/dist/domain/watchdog-delivery.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-delivery.js +60 -2
- package/daemon/dist/domain/watchdog-delivery.js.map +1 -1
- package/daemon/dist/domain/watchdog-history-log.d.ts +12 -0
- package/daemon/dist/domain/watchdog-history-log.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-history-log.js +19 -1
- package/daemon/dist/domain/watchdog-history-log.js.map +1 -1
- package/daemon/dist/domain/watchdog-jobs-repository.d.ts +32 -0
- package/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-jobs-repository.js +78 -0
- package/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.d.ts +17 -3
- package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.js +19 -5
- package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
- package/daemon/dist/domain/workflow-projector.js +1 -1
- package/daemon/dist/domain/workflow-projector.js.map +1 -1
- package/daemon/dist/domain/workflow-runtime.d.ts +12 -0
- package/daemon/dist/domain/workflow-runtime.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-runtime.js +64 -7
- package/daemon/dist/domain/workflow-runtime.js.map +1 -1
- package/daemon/dist/domain/workflow-step-trail-log.d.ts +2 -2
- package/daemon/dist/domain/workflow-step-trail-log.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-step-trail-log.js.map +1 -1
- package/daemon/dist/domain/workflow-types.d.ts +3 -1
- package/daemon/dist/domain/workflow-types.d.ts.map +1 -1
- package/daemon/dist/domain/workflow-types.js.map +1 -1
- package/daemon/dist/index.d.ts.map +1 -1
- package/daemon/dist/index.js +5 -1
- package/daemon/dist/index.js.map +1 -1
- package/daemon/dist/lib/pane-envelope.d.ts +3 -0
- package/daemon/dist/lib/pane-envelope.d.ts.map +1 -1
- package/daemon/dist/lib/pane-envelope.js +3 -1
- package/daemon/dist/lib/pane-envelope.js.map +1 -1
- package/daemon/dist/mission-parent-surface.d.ts +2 -0
- package/daemon/dist/mission-parent-surface.d.ts.map +1 -0
- package/daemon/dist/mission-parent-surface.js +2 -0
- package/daemon/dist/mission-parent-surface.js.map +1 -0
- package/daemon/dist/routes/activity.d.ts +18 -1
- package/daemon/dist/routes/activity.d.ts.map +1 -1
- package/daemon/dist/routes/activity.js +47 -9
- package/daemon/dist/routes/activity.js.map +1 -1
- package/daemon/dist/routes/attention.d.ts.map +1 -1
- package/daemon/dist/routes/attention.js +194 -177
- package/daemon/dist/routes/attention.js.map +1 -1
- package/daemon/dist/routes/core-app.d.ts +10 -0
- package/daemon/dist/routes/core-app.d.ts.map +1 -0
- package/daemon/dist/routes/core-app.js +175 -0
- package/daemon/dist/routes/core-app.js.map +1 -0
- package/daemon/dist/routes/hook-bridge.d.ts +3 -0
- package/daemon/dist/routes/hook-bridge.d.ts.map +1 -0
- package/daemon/dist/routes/hook-bridge.js +158 -0
- package/daemon/dist/routes/hook-bridge.js.map +1 -0
- package/daemon/dist/routes/missions.d.ts.map +1 -1
- package/daemon/dist/routes/missions.js +14 -2
- package/daemon/dist/routes/missions.js.map +1 -1
- package/daemon/dist/routes/queue.d.ts +1 -1
- package/daemon/dist/routes/queue.d.ts.map +1 -1
- package/daemon/dist/routes/queue.js +8 -5
- package/daemon/dist/routes/queue.js.map +1 -1
- package/daemon/dist/routes/rigspec.js +1 -1
- package/daemon/dist/routes/rigspec.js.map +1 -1
- package/daemon/dist/routes/scope-audit.d.ts.map +1 -1
- package/daemon/dist/routes/scope-audit.js +7 -1
- package/daemon/dist/routes/scope-audit.js.map +1 -1
- package/daemon/dist/routes/seat.d.ts.map +1 -1
- package/daemon/dist/routes/seat.js +30 -4
- package/daemon/dist/routes/seat.js.map +1 -1
- package/daemon/dist/routes/slices.d.ts.map +1 -1
- package/daemon/dist/routes/slices.js +21 -2
- package/daemon/dist/routes/slices.js.map +1 -1
- package/daemon/dist/routes/startup.js +2 -1
- package/daemon/dist/routes/startup.js.map +1 -1
- package/daemon/dist/routes/terminal.d.ts.map +1 -1
- package/daemon/dist/routes/terminal.js +47 -6
- package/daemon/dist/routes/terminal.js.map +1 -1
- package/daemon/dist/routes/transcripts.d.ts.map +1 -1
- package/daemon/dist/routes/transcripts.js +16 -1
- package/daemon/dist/routes/transcripts.js.map +1 -1
- package/daemon/dist/routes/watchdog.d.ts.map +1 -1
- package/daemon/dist/routes/watchdog.js +3 -2
- package/daemon/dist/routes/watchdog.js.map +1 -1
- package/daemon/dist/routes/workflow.d.ts.map +1 -1
- package/daemon/dist/routes/workflow.js +5 -0
- package/daemon/dist/routes/workflow.js.map +1 -1
- package/daemon/dist/server.d.ts +2 -0
- package/daemon/dist/server.d.ts.map +1 -1
- package/daemon/dist/server.js +11 -0
- package/daemon/dist/server.js.map +1 -1
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +90 -33
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/dist/terminal-viewer-guard-surface.d.ts +2 -0
- package/daemon/dist/terminal-viewer-guard-surface.d.ts.map +1 -0
- package/daemon/dist/terminal-viewer-guard-surface.js +2 -0
- package/daemon/dist/terminal-viewer-guard-surface.js.map +1 -0
- package/daemon/docs/reference/agent-startup-guide.md +4 -1
- package/daemon/docs/reference/claude-status-line.md +3 -2
- package/daemon/docs/reference/community-harness-examples/cursor/openrig-cursor-launch +6 -0
- package/daemon/docs/reference/community-harness-examples/dsh/README.md +1 -1
- package/daemon/docs/reference/community-harness-examples/dsh/openrig-dsh-runner.mjs +186 -30
- package/daemon/docs/reference/community-harness-examples/hermes/openrig-hermes-launch +6 -0
- package/daemon/docs/reference/community-harness-examples/openclaw/openrig-openclaw-launch +6 -0
- package/daemon/docs/reference/community-harness-examples/openshell/README.md +2 -0
- package/daemon/docs/reference/community-harness-examples/pi-tui/openrig-pi-tui-launch +6 -0
- package/daemon/docs/reference/community-harness-presets.md +6 -5
- package/daemon/docs/reference/core-app.md +212 -0
- package/daemon/docs/reference/daemon-http-clients.md +6 -0
- package/daemon/docs/reference/getting-started.md +9 -4
- package/daemon/docs/reference/harness-runner-contract.md +50 -4
- package/daemon/docs/reference/hosted-members.md +21 -1
- package/daemon/docs/reference/quickstart.md +4 -3
- package/daemon/docs/reference/rig-spec.md +56 -26
- package/daemon/docs/reference/rosters.md +8 -0
- package/daemon/docs/reference/sdlc-conventions.md +42 -5
- package/daemon/docs/reference/seat-delivery.md +87 -6
- package/daemon/docs/reference/terminal-sessions.md +99 -1
- package/daemon/docs/reference/whats-new.md +82 -11
- package/daemon/specs/rigs/launch/factory/guidance/lead-first-move.md +4 -3
- package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +13 -3
- package/daemon/specs/rigs/launch/starter/guidance/lead-first-move.md +4 -3
- package/dist/ask-wake.d.ts.map +1 -1
- package/dist/ask-wake.js +8 -1
- package/dist/ask-wake.js.map +1 -1
- package/dist/build-info.js +3 -3
- package/dist/commands/archive.js +1 -1
- package/dist/commands/archive.js.map +1 -1
- package/dist/commands/daemon.d.ts.map +1 -1
- package/dist/commands/daemon.js +7 -0
- package/dist/commands/daemon.js.map +1 -1
- package/dist/commands/down.d.ts.map +1 -1
- package/dist/commands/down.js +5 -0
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/ps.d.ts +2 -1
- package/dist/commands/ps.d.ts.map +1 -1
- package/dist/commands/ps.js +9 -4
- package/dist/commands/ps.js.map +1 -1
- package/dist/commands/queue.js +4 -4
- package/dist/commands/queue.js.map +1 -1
- package/dist/commands/roster.d.ts +5 -0
- package/dist/commands/roster.d.ts.map +1 -1
- package/dist/commands/scope.d.ts.map +1 -1
- package/dist/commands/scope.js +346 -9
- package/dist/commands/scope.js.map +1 -1
- package/dist/commands/seat.d.ts.map +1 -1
- package/dist/commands/seat.js +90 -8
- package/dist/commands/seat.js.map +1 -1
- package/dist/commands/send.d.ts +2 -0
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +3 -1
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/terminal.d.ts +56 -0
- package/dist/commands/terminal.d.ts.map +1 -1
- package/dist/commands/terminal.js +194 -4
- package/dist/commands/terminal.js.map +1 -1
- package/dist/commands/transcript.js +1 -1
- package/dist/commands/transcript.js.map +1 -1
- package/dist/commands/unarchive.js +1 -1
- package/dist/commands/unarchive.js.map +1 -1
- package/dist/commands/workflow-follow.d.ts +3 -1
- package/dist/commands/workflow-follow.d.ts.map +1 -1
- package/dist/commands/workflow-follow.js +25 -6
- package/dist/commands/workflow-follow.js.map +1 -1
- package/dist/commands/workflow-render.d.ts.map +1 -1
- package/dist/commands/workflow-render.js +5 -1
- package/dist/commands/workflow-render.js.map +1 -1
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +14 -4
- package/dist/commands/workflow.js.map +1 -1
- package/dist/daemon-lifecycle.d.ts.map +1 -1
- package/dist/daemon-lifecycle.js +11 -0
- package/dist/daemon-lifecycle.js.map +1 -1
- package/dist/lib/scope/mission-composition.d.ts +1 -0
- package/dist/lib/scope/mission-composition.d.ts.map +1 -1
- package/dist/lib/scope/mission-composition.js +14 -0
- package/dist/lib/scope/mission-composition.js.map +1 -1
- package/dist/lib/scope/scope-audit.d.ts.map +1 -1
- package/dist/lib/scope/scope-audit.js +8 -0
- package/dist/lib/scope/scope-audit.js.map +1 -1
- package/dist/lib/scope/scope-fs.d.ts +10 -0
- package/dist/lib/scope/scope-fs.d.ts.map +1 -1
- package/dist/lib/scope/scope-fs.js +60 -0
- package/dist/lib/scope/scope-fs.js.map +1 -1
- package/dist/lib/scope/types.d.ts +3 -1
- package/dist/lib/scope/types.d.ts.map +1 -1
- package/dist/lib/scope/types.js +5 -1
- package/dist/lib/scope/types.js.map +1 -1
- package/dist/mcp-server.d.ts.map +1 -1
- package/dist/mcp-server.js +18 -8
- package/dist/mcp-server.js.map +1 -1
- package/dist/restore-packet/packet-writer.d.ts.map +1 -1
- package/dist/restore-packet/packet-writer.js +8 -5
- package/dist/restore-packet/packet-writer.js.map +1 -1
- package/dist/terminal-window.d.ts +2 -1
- package/dist/terminal-window.d.ts.map +1 -1
- package/dist/terminal-window.js +567 -41
- package/dist/terminal-window.js.map +1 -1
- package/package.json +1 -1
- package/tui/dist/daemon-client.d.ts +4 -0
- package/tui/dist/daemon-client.d.ts.map +1 -1
- package/tui/dist/daemon-client.js.map +1 -1
- package/tui/dist/execution/execution-model.d.ts.map +1 -1
- package/tui/dist/execution/execution-model.js +22 -5
- package/tui/dist/execution/execution-model.js.map +1 -1
- package/tui/dist/hydrate.d.ts.map +1 -1
- package/tui/dist/hydrate.js +6 -3
- package/tui/dist/hydrate.js.map +1 -1
- package/tui/dist/navigator.d.ts +1 -1
- package/tui/dist/navigator.d.ts.map +1 -1
- package/tui/dist/navigator.js +4 -2
- package/tui/dist/navigator.js.map +1 -1
- package/tui/dist/pulse/render-pulse.d.ts.map +1 -1
- package/tui/dist/pulse/render-pulse.js +7 -14
- package/tui/dist/pulse/render-pulse.js.map +1 -1
- package/tui/dist/render.d.ts.map +1 -1
- package/tui/dist/render.js +29 -21
- package/tui/dist/render.js.map +1 -1
- package/tui/dist/stylize.d.ts.map +1 -1
- package/tui/dist/stylize.js +3 -3
- package/tui/dist/stylize.js.map +1 -1
- package/tui/dist/terminals/terminal-model.d.ts +1 -0
- package/tui/dist/terminals/terminal-model.d.ts.map +1 -1
- package/tui/dist/terminals/terminal-model.js +4 -2
- package/tui/dist/terminals/terminal-model.js.map +1 -1
- package/tui/dist/types.d.ts +1 -0
- package/tui/dist/types.d.ts.map +1 -1
- package/tui/dist/visual-layout.d.ts +3 -0
- package/tui/dist/visual-layout.d.ts.map +1 -1
- package/tui/dist/visual-layout.js +17 -0
- package/tui/dist/visual-layout.js.map +1 -1
- package/ui/dist/assets/{index-1O1f3A7K.js → index-B-sMy02c.js} +107 -107
- package/ui/dist/assets/{index-BX8TUZ0E.css → index-DiN7RwWg.css} +1 -1
- package/ui/dist/index.html +2 -2
package/dist/commands/scope.js
CHANGED
|
@@ -8,20 +8,22 @@
|
|
|
8
8
|
import fs from "node:fs";
|
|
9
9
|
import path from "node:path";
|
|
10
10
|
import { Command } from "commander";
|
|
11
|
+
import YAML from "yaml";
|
|
12
|
+
import { readParentScope, validateMissionParent } from "../../daemon/dist/mission-parent-surface.js";
|
|
11
13
|
import { DaemonClient } from "../client.js";
|
|
12
14
|
import { attestationLineage } from "../lib/scope/attestation-lineage.js";
|
|
13
15
|
import { getDaemonStatus, getDaemonUrl, statusGuardMessage } from "../daemon-lifecycle.js";
|
|
14
16
|
import { renderDaemonTransportError } from "../cli-error.js";
|
|
15
17
|
import { daemonMayAnswer } from "../daemon-reachability.js";
|
|
16
18
|
import { realDeps } from "./daemon.js";
|
|
17
|
-
import { CLOSE_REASONS, MISSION_TEMPLATE_KINDS, SLICE_TEMPLATE_KINDS, STAGE_VALUES, ScopeCliError, } from "../lib/scope/types.js";
|
|
19
|
+
import { CLOSE_REASONS, MISSION_TEMPLATE_KINDS, NON_DELIVERY_CLOSE_REASONS, SLICE_TEMPLATE_KINDS, STAGE_VALUES, ScopeCliError, } from "../lib/scope/types.js";
|
|
18
20
|
import { DEFAULT_PROJECT_PREFIX, inferMissionDotId, isMissionDotId, isSliceDotId, nextEscapeBandOrdinal, sliceIdFromMission, } from "../lib/scope/dot-id.js";
|
|
19
|
-
import { buildMissionDependencyGraph, ensureMissionId, ensureMissionIdPersisted, findMission, resolveNodeFile, findSlice, listMissions, listSlices, moveSlice, rollbackMovedSlice, nextSliceNN, tryClaimSliceNN, NOTES_FILE_PRECEDENCE, pad2, readFrontmatter, resolveNotesFile, readProjectMissionsRoot, resolveMissionsRoot, splitFrontmatter, todayDateISO, updateFrontmatter, } from "../lib/scope/scope-fs.js";
|
|
21
|
+
import { buildMissionDependencyGraph, ensureMissionId, ensureMissionIdPersisted, findMission, indexerReadsStatusIn, readIndexerSliceStatus, resolveNodeFile, findSlice, listMissions, listSlices, moveSlice, rollbackMovedSlice, nextSliceNN, tryClaimSliceNN, NOTES_FILE_PRECEDENCE, pad2, readFrontmatter, resolveNotesFile, readProjectMissionsRoot, resolveMissionsRoot, splitFrontmatter, todayDateISO, updateFrontmatter, } from "../lib/scope/scope-fs.js";
|
|
20
22
|
import { renderCapabilityDeltaTemplate, renderNotesTemplate, renderMissionProgressTemplate, renderMissionTemplate, renderSliceProofTemplate, renderSliceProgressTemplate, renderSliceTemplate, titleFromSlug, } from "../lib/scope/templates.js";
|
|
21
23
|
import { addProgressRow, DEFAULT_PROGRESS_SECTION, parseStatus, PROGRESS_STATUSES, setProgressRow, } from "../lib/scope/progress-edit.js";
|
|
22
24
|
import { deriveScopeTrust } from "../lib/scope/trust.js";
|
|
23
25
|
import { capabilityDeltaExpiryFindings } from "../lib/scope/capability-delta.js";
|
|
24
|
-
import { applyMissionCompositionEdits, appendMissionMembership, nextMissionMembershipOrder, planMissionMembershipAdd, planMissionMembershipRemove, } from "../lib/scope/mission-composition.js";
|
|
26
|
+
import { applyMissionCompositionEdits, appendMissionMembership, nextMissionMembershipOrder, planMissionMembershipAdd, planMissionMembershipRemove, planMissionMembershipSetActive, } from "../lib/scope/mission-composition.js";
|
|
25
27
|
function makeStdout() {
|
|
26
28
|
return { write: (text) => process.stdout.write(text) };
|
|
27
29
|
}
|
|
@@ -190,6 +192,9 @@ function buildSliceShowCommand() {
|
|
|
190
192
|
.map((e) => ({ name: e.name, kind: e.isDirectory() ? "dir" : "file" }));
|
|
191
193
|
// FR-5: derive read-time trust from (stage x verified) — NEVER stored.
|
|
192
194
|
const trust = deriveScopeTrust(slice.frontmatter);
|
|
195
|
+
const parentWarnings = [];
|
|
196
|
+
const scopeNodes = readParentScope(missionsRoot, { onInvalid: (message) => parentWarnings.push(message) });
|
|
197
|
+
const childMissions = slice.id && scopeNodes.filter((node) => node.id === slice.id).length === 1 ? scopeNodes.filter((node) => node.kind === "mission" && node.parent === slice.id) : [];
|
|
193
198
|
const payload = {
|
|
194
199
|
ok: true,
|
|
195
200
|
slice: {
|
|
@@ -202,6 +207,8 @@ function buildSliceShowCommand() {
|
|
|
202
207
|
trust,
|
|
203
208
|
readme,
|
|
204
209
|
children,
|
|
210
|
+
childMissions,
|
|
211
|
+
parentWarnings,
|
|
205
212
|
},
|
|
206
213
|
};
|
|
207
214
|
if (json) {
|
|
@@ -214,6 +221,10 @@ function buildSliceShowCommand() {
|
|
|
214
221
|
out.write(formatTrustLine(trust));
|
|
215
222
|
out.write(` path: ${slice.absPath}\n`);
|
|
216
223
|
out.write(` children: ${children.length}\n`);
|
|
224
|
+
for (const warning of parentWarnings)
|
|
225
|
+
out.write(` warning: ${warning}\n`);
|
|
226
|
+
if (childMissions.length)
|
|
227
|
+
out.write(` child missions: ${childMissions.map((node) => node.name).join(", ")}\n`);
|
|
217
228
|
if (readme) {
|
|
218
229
|
out.write("\n--- README ---\n");
|
|
219
230
|
out.write(readme);
|
|
@@ -461,11 +472,25 @@ function buildSliceShipCommand() {
|
|
|
461
472
|
// ---------------------------------------------------------------------
|
|
462
473
|
// rig scope slice close
|
|
463
474
|
// ---------------------------------------------------------------------
|
|
475
|
+
/** How many judgment files the slice records, or `null` when the judgments folder cannot be read (unknown, not zero).
|
|
476
|
+
* A folder that does not exist records none. */
|
|
477
|
+
function countRecordedSliceJudgments(sliceAbsPath) {
|
|
478
|
+
const judgmentsDir = path.join(sliceAbsPath, "proof", "judgments");
|
|
479
|
+
try {
|
|
480
|
+
return fs.readdirSync(judgmentsDir, { withFileTypes: true })
|
|
481
|
+
.filter((entry) => entry.isFile() && entry.name.toLowerCase().endsWith(".md"))
|
|
482
|
+
.length;
|
|
483
|
+
}
|
|
484
|
+
catch (err) {
|
|
485
|
+
return err.code === "ENOENT" ? 0 : null;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
464
488
|
function buildSliceCloseCommand() {
|
|
465
489
|
return new Command("close")
|
|
466
|
-
.description("Close a slice (move to <mission>/closed
|
|
490
|
+
.description("Close a slice (move to <mission>/closed/ by default, or update status in place with --in-place)")
|
|
467
491
|
.argument("<slice-path>", "Slice path (absolute, relative, or NN-slug)")
|
|
468
492
|
.requiredOption("--reason <reason>", `Closure reason: ${CLOSE_REASONS.join(" | ")}`)
|
|
493
|
+
.option("--in-place", "Keep the slice under <mission>/slices/ instead of moving to <mission>/closed/")
|
|
469
494
|
.option("--note <text>", "Optional closure note")
|
|
470
495
|
.option("--mission <name>", "Hint mission when slice-path is just NN-slug")
|
|
471
496
|
.option("--json", "Machine-readable output")
|
|
@@ -473,6 +498,7 @@ function buildSliceCloseCommand() {
|
|
|
473
498
|
const out = makeStdout();
|
|
474
499
|
const json = Boolean(opts.json);
|
|
475
500
|
try {
|
|
501
|
+
const inPlace = Boolean(opts.inPlace);
|
|
476
502
|
const reason = opts.reason;
|
|
477
503
|
if (!CLOSE_REASONS.includes(reason)) {
|
|
478
504
|
throw new ScopeCliError({
|
|
@@ -481,10 +507,161 @@ function buildSliceCloseCommand() {
|
|
|
481
507
|
action: `Pick one of: ${CLOSE_REASONS.join(", ")}.`,
|
|
482
508
|
});
|
|
483
509
|
}
|
|
510
|
+
if (!inPlace && reason === "delivered") {
|
|
511
|
+
throw new ScopeCliError({
|
|
512
|
+
fact: `--reason "delivered" requires --in-place.`,
|
|
513
|
+
consequence: "Slice not closed; moving to closed/ is reserved for non-delivery closures.",
|
|
514
|
+
action: `Pass --in-place with --reason delivered, or use rig scope slice ship, or pick a non-delivery reason (${NON_DELIVERY_CLOSE_REASONS.join(", ")}).`,
|
|
515
|
+
});
|
|
516
|
+
}
|
|
484
517
|
const missionsRoot = resolveMissionsRoot({ override: getOpts(command).workspace });
|
|
485
518
|
const slice = findSlice(missionsRoot, slicePath, opts.mission ?? null);
|
|
486
519
|
const mission = findMission(missionsRoot, slice.missionName);
|
|
487
520
|
const closedDir = path.join(mission.absPath, "closed");
|
|
521
|
+
const judgmentCount = countRecordedSliceJudgments(slice.absPath);
|
|
522
|
+
if (inPlace) {
|
|
523
|
+
const resolvedSliceAbs = path.resolve(slice.absPath);
|
|
524
|
+
const resolvedClosedDir = path.resolve(closedDir);
|
|
525
|
+
if (resolvedSliceAbs === resolvedClosedDir || resolvedSliceAbs.startsWith(`${resolvedClosedDir}${path.sep}`)) {
|
|
526
|
+
throw new ScopeCliError({
|
|
527
|
+
fact: `Slice "${slice.name}" is already under ${slice.missionName}/closed/.`,
|
|
528
|
+
consequence: "Slice not closed in place.",
|
|
529
|
+
action: "Inspect the slice under closed/, or move it back under slices/ before updating in place.",
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
if (!slice.readmePath) {
|
|
533
|
+
throw new ScopeCliError({
|
|
534
|
+
fact: `Slice "${slice.name}" at ${slice.absPath} has no SPEC.md or README.md.`,
|
|
535
|
+
consequence: "Cannot record in-place closure status without a slice node file.",
|
|
536
|
+
action: "Repair or add SPEC.md before closing --in-place.",
|
|
537
|
+
});
|
|
538
|
+
}
|
|
539
|
+
const targetStatus = reason === "delivered" ? "done" : `closed-${reason}`;
|
|
540
|
+
const compositionEdit = planMissionMembershipSetActive(mission.absPath, sliceManifestRef(mission.absPath, slice.absPath), reason === "delivered");
|
|
541
|
+
const edits = compositionEdit ? [compositionEdit] : [];
|
|
542
|
+
const nodePath = slice.readmePath;
|
|
543
|
+
const originalNode = fs.readFileSync(nodePath, "utf8");
|
|
544
|
+
const progressPath = path.join(slice.absPath, "PROGRESS.md");
|
|
545
|
+
let originalProgress = null;
|
|
546
|
+
try {
|
|
547
|
+
originalProgress = fs.readFileSync(progressPath, "utf8");
|
|
548
|
+
}
|
|
549
|
+
catch (err) {
|
|
550
|
+
if (err.code !== "ENOENT")
|
|
551
|
+
throw err;
|
|
552
|
+
}
|
|
553
|
+
// The slice indexer lets PROGRESS.md override the node file, so a status it reads there is reconciled too.
|
|
554
|
+
const shouldReconcileProgressStatus = originalProgress !== null && indexerReadsStatusIn(originalProgress);
|
|
555
|
+
applyMissionCompositionEdits(edits);
|
|
556
|
+
let attemptedProgressWrite = false;
|
|
557
|
+
let readBackMismatch = null;
|
|
558
|
+
try {
|
|
559
|
+
const updates = {
|
|
560
|
+
status: targetStatus,
|
|
561
|
+
"closed-on": todayDateISO(),
|
|
562
|
+
};
|
|
563
|
+
if (opts.note)
|
|
564
|
+
updates["closure-note"] = opts.note;
|
|
565
|
+
updateFrontmatter(nodePath, updates);
|
|
566
|
+
if (shouldReconcileProgressStatus) {
|
|
567
|
+
attemptedProgressWrite = true;
|
|
568
|
+
updateFrontmatter(progressPath, { status: targetStatus });
|
|
569
|
+
}
|
|
570
|
+
// Read the status back the way the slice indexer does; a shape that reads differently rolls everything back.
|
|
571
|
+
const readBack = readIndexerSliceStatus(slice.absPath);
|
|
572
|
+
if (readBack.status !== targetStatus) {
|
|
573
|
+
const readFile = readBack.file ?? nodePath;
|
|
574
|
+
readBackMismatch = new ScopeCliError({
|
|
575
|
+
fact: `After writing status "${targetStatus}", the slice indexer reads ${readBack.status === null ? "no status" : `"${readBack.status}"`} from ${readFile}.`,
|
|
576
|
+
consequence: "In-place closure refused.",
|
|
577
|
+
action: `Give ${path.basename(readFile)} one top-level scalar "status:" line, with no inline "#" comment and no duplicate or nested "status:" entry, or close without --in-place, then retry.`,
|
|
578
|
+
});
|
|
579
|
+
throw readBackMismatch;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
catch (error) {
|
|
583
|
+
const rollbackFailures = [];
|
|
584
|
+
try {
|
|
585
|
+
fs.writeFileSync(nodePath, originalNode, "utf8");
|
|
586
|
+
}
|
|
587
|
+
catch (rbErr) {
|
|
588
|
+
rollbackFailures.push(`restore ${nodePath}: ${rbErr instanceof Error ? rbErr.message : String(rbErr)}`);
|
|
589
|
+
}
|
|
590
|
+
if (attemptedProgressWrite && originalProgress !== null) {
|
|
591
|
+
try {
|
|
592
|
+
fs.writeFileSync(progressPath, originalProgress, "utf8");
|
|
593
|
+
}
|
|
594
|
+
catch (rbErr) {
|
|
595
|
+
rollbackFailures.push(`restore ${progressPath}: ${rbErr instanceof Error ? rbErr.message : String(rbErr)}`);
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
if (edits.length > 0) {
|
|
599
|
+
try {
|
|
600
|
+
rollbackComposition(edits);
|
|
601
|
+
}
|
|
602
|
+
catch (rbErr) {
|
|
603
|
+
rollbackFailures.push(`rollback mission composition: ${rbErr instanceof Error ? rbErr.message : String(rbErr)}`);
|
|
604
|
+
}
|
|
605
|
+
}
|
|
606
|
+
if (rollbackFailures.length > 0) {
|
|
607
|
+
if (error instanceof ScopeCliError) {
|
|
608
|
+
// Never promise restoration here: the slice may be left partly changed, and the failures below say where.
|
|
609
|
+
const stateKnown = error === readBackMismatch
|
|
610
|
+
? ` Rollback did NOT complete (${rollbackFailures.join("; ")}). The slice's files and ${path.join(mission.absPath, "mission.yaml")} may be partly changed and their current state is unknown.`
|
|
611
|
+
: ` (rollback failure(s): ${rollbackFailures.join("; ")})`;
|
|
612
|
+
throw new ScopeCliError({
|
|
613
|
+
fact: error.fact,
|
|
614
|
+
consequence: `${error.consequence}${stateKnown}`,
|
|
615
|
+
action: error === readBackMismatch
|
|
616
|
+
? `Inspect ${nodePath}, ${progressPath} and ${path.join(mission.absPath, "mission.yaml")} and repair any leftover change before closing this slice again. ${error.action}`
|
|
617
|
+
: error.action,
|
|
618
|
+
});
|
|
619
|
+
}
|
|
620
|
+
const origMessage = error instanceof Error ? error.message : String(error);
|
|
621
|
+
throw new Error(`${origMessage} (rollback failure(s): ${rollbackFailures.join("; ")})`, { cause: error });
|
|
622
|
+
}
|
|
623
|
+
if (error instanceof ScopeCliError && error === readBackMismatch) {
|
|
624
|
+
throw new ScopeCliError({
|
|
625
|
+
fact: error.fact,
|
|
626
|
+
consequence: "In-place closure rolled back: every file it changed was restored, so readers cannot disagree about this slice's status.",
|
|
627
|
+
action: error.action,
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
|
+
throw error;
|
|
631
|
+
}
|
|
632
|
+
emit(out, {
|
|
633
|
+
ok: true,
|
|
634
|
+
closed: {
|
|
635
|
+
mission: slice.missionName,
|
|
636
|
+
name: slice.name,
|
|
637
|
+
id: slice.id,
|
|
638
|
+
reason,
|
|
639
|
+
status: targetStatus,
|
|
640
|
+
inPlace: true,
|
|
641
|
+
note: opts.note ?? null,
|
|
642
|
+
path: slice.absPath,
|
|
643
|
+
git: { usedGit: false, repoRoot: null },
|
|
644
|
+
proofApplicability: {
|
|
645
|
+
evaluated: false,
|
|
646
|
+
changed: null,
|
|
647
|
+
pathPreserved: true,
|
|
648
|
+
receiptFilesPreserved: true,
|
|
649
|
+
judgmentCount,
|
|
650
|
+
},
|
|
651
|
+
},
|
|
652
|
+
}, json, [
|
|
653
|
+
`Closed ${slice.missionName}/${slice.name} in place (${targetStatus})`,
|
|
654
|
+
` reason: ${reason}`,
|
|
655
|
+
` status: ${targetStatus}`,
|
|
656
|
+
` path: ${slice.absPath}`,
|
|
657
|
+
...(judgmentCount === null
|
|
658
|
+
? [" proof: judgment folder could not be read (judgment count unknown; applicability not evaluated; run rig proof show to check current readiness)"]
|
|
659
|
+
: judgmentCount > 0
|
|
660
|
+
? [` proof: ${judgmentCount} recorded judgment file(s) kept in place (applicability not evaluated; run rig proof show to check current readiness)`]
|
|
661
|
+
: []),
|
|
662
|
+
]);
|
|
663
|
+
return;
|
|
664
|
+
}
|
|
488
665
|
const destName = slice.name;
|
|
489
666
|
const destAbs = path.join(closedDir, destName);
|
|
490
667
|
const compositionEdit = planMissionMembershipRemove(mission.absPath, sliceManifestRef(mission.absPath, slice.absPath));
|
|
@@ -501,10 +678,11 @@ function buildSliceCloseCommand() {
|
|
|
501
678
|
}
|
|
502
679
|
const { usedGit, repoRoot } = moveResult;
|
|
503
680
|
const newReadme = resolveNodeFile(destAbs);
|
|
681
|
+
const targetStatus = `closed-${reason}`;
|
|
504
682
|
try {
|
|
505
683
|
if (newReadme) {
|
|
506
684
|
const updates = {
|
|
507
|
-
status:
|
|
685
|
+
status: targetStatus,
|
|
508
686
|
"closed-on": todayDateISO(),
|
|
509
687
|
};
|
|
510
688
|
if (opts.note)
|
|
@@ -526,14 +704,28 @@ function buildSliceCloseCommand() {
|
|
|
526
704
|
name: destName,
|
|
527
705
|
id: slice.id,
|
|
528
706
|
reason,
|
|
707
|
+
status: targetStatus,
|
|
708
|
+
inPlace: false,
|
|
529
709
|
note: opts.note ?? null,
|
|
530
710
|
path: destAbs,
|
|
531
711
|
git: { usedGit, repoRoot },
|
|
712
|
+
proofApplicability: {
|
|
713
|
+
evaluated: false,
|
|
714
|
+
changed: judgmentCount === null ? null : judgmentCount > 0,
|
|
715
|
+
pathPreserved: false,
|
|
716
|
+
receiptFilesPreserved: true,
|
|
717
|
+
judgmentCount,
|
|
718
|
+
},
|
|
532
719
|
},
|
|
533
720
|
}, json, [
|
|
534
721
|
`Closed ${slice.missionName}/${slice.name} → ${slice.missionName}/closed/${destName}`,
|
|
535
722
|
` reason: ${reason}`,
|
|
536
723
|
` git: ${usedGit ? "git mv" : "fs.rename (not in a git repo)"}`,
|
|
724
|
+
...(judgmentCount === null
|
|
725
|
+
? [" proof: judgment folder could not be read, so recorded judgments (if any) now read unknown after path move (use --in-place to keep slice path in place; accepted proof still requires unchanged item, policy, and cited evidence)"]
|
|
726
|
+
: judgmentCount > 0
|
|
727
|
+
? [` proof: ${judgmentCount} recorded judgment(s) now read unknown after path move (use --in-place to keep slice path in place; accepted proof still requires unchanged item, policy, and cited evidence)`]
|
|
728
|
+
: []),
|
|
537
729
|
]);
|
|
538
730
|
}
|
|
539
731
|
catch (err) {
|
|
@@ -673,6 +865,40 @@ function buildMissionShowCommand() {
|
|
|
673
865
|
}));
|
|
674
866
|
// FR-5: derive read-time trust from (stage x verified) — NEVER stored.
|
|
675
867
|
const trust = deriveScopeTrust(mission.frontmatter);
|
|
868
|
+
const parentWarnings = [];
|
|
869
|
+
const scopeNodes = readParentScope(missionsRoot, { onInvalid: (message) => parentWarnings.push(message) });
|
|
870
|
+
const own = scopeNodes.find((node) => node.kind === "mission" && node.path === mission.absPath);
|
|
871
|
+
const parentMatches = own?.parent ? scopeNodes.filter((node) => node.id === own.parent) : [];
|
|
872
|
+
const parent = parentMatches.length === 1 ? parentMatches[0] : null;
|
|
873
|
+
const parentChain = [];
|
|
874
|
+
let parentGap = null;
|
|
875
|
+
const seenParents = new Set();
|
|
876
|
+
let currentParent = own;
|
|
877
|
+
while (currentParent?.parent) {
|
|
878
|
+
const matches = scopeNodes.filter((node) => node.id === currentParent.parent);
|
|
879
|
+
if (matches.length !== 1) {
|
|
880
|
+
parentGap = `${currentParent.parent} does not resolve uniquely`;
|
|
881
|
+
break;
|
|
882
|
+
}
|
|
883
|
+
const next = matches[0];
|
|
884
|
+
if (seenParents.has(next.id) || next.id === own?.id) {
|
|
885
|
+
parentGap = `cycle at ${next.id}`;
|
|
886
|
+
break;
|
|
887
|
+
}
|
|
888
|
+
seenParents.add(next.id);
|
|
889
|
+
parentChain.push(next);
|
|
890
|
+
if (next.kind === "slice") {
|
|
891
|
+
const owners = scopeNodes.filter((node) => node.kind === "mission" && node.id === next.missionId);
|
|
892
|
+
if (owners.length !== 1) {
|
|
893
|
+
parentGap = `${next.missionId} does not resolve uniquely`;
|
|
894
|
+
break;
|
|
895
|
+
}
|
|
896
|
+
currentParent = owners[0];
|
|
897
|
+
}
|
|
898
|
+
else
|
|
899
|
+
currentParent = next;
|
|
900
|
+
}
|
|
901
|
+
const childMissions = mission.id && scopeNodes.filter((node) => node.id === mission.id).length === 1 ? scopeNodes.filter((node) => node.kind === "mission" && node.parent === mission.id) : [];
|
|
676
902
|
const payload = {
|
|
677
903
|
ok: true,
|
|
678
904
|
mission: {
|
|
@@ -686,6 +912,12 @@ function buildMissionShowCommand() {
|
|
|
686
912
|
trust,
|
|
687
913
|
readme,
|
|
688
914
|
slices,
|
|
915
|
+
parent,
|
|
916
|
+
parentId: own?.parent ?? null,
|
|
917
|
+
parentChain,
|
|
918
|
+
parentGap,
|
|
919
|
+
parentWarnings,
|
|
920
|
+
childMissions,
|
|
689
921
|
},
|
|
690
922
|
};
|
|
691
923
|
if (json) {
|
|
@@ -694,6 +926,12 @@ function buildMissionShowCommand() {
|
|
|
694
926
|
else {
|
|
695
927
|
out.write(`Mission: ${mission.name}\n`);
|
|
696
928
|
out.write(` id: ${mission.id ?? "—"}\n`);
|
|
929
|
+
if (own?.parent)
|
|
930
|
+
out.write(` parent: ${parent?.name ?? own.parent} (${own.parent})\n`);
|
|
931
|
+
for (const warning of parentWarnings)
|
|
932
|
+
out.write(` warning: ${warning}\n`);
|
|
933
|
+
if (childMissions.length)
|
|
934
|
+
out.write(` child missions: ${childMissions.map((node) => node.name).join(", ")}\n`);
|
|
697
935
|
out.write(formatTrustLine(trust));
|
|
698
936
|
out.write(` active slices: ${mission.activeSliceCount}\n`);
|
|
699
937
|
out.write(` shipped slices: ${mission.shippedSliceCount}\n`);
|
|
@@ -758,6 +996,7 @@ function buildMissionCreateCommand() {
|
|
|
758
996
|
.option("--title <text>", "Display title (defaults to titlecased name)")
|
|
759
997
|
.option("--intent <text>", "Authored intent stored in SPEC.md frontmatter (defaults to title)")
|
|
760
998
|
.option("--depends-on <dot-id...>", "Advisory build-order dependencies on sibling mission dot-IDs")
|
|
999
|
+
.option("--parent <dot-id>", "Mission or slice this mission breaks down")
|
|
761
1000
|
.option("--no-notes", "Skip NOTES.md scaffolding")
|
|
762
1001
|
.option("--no-mission-notes", "Deprecated alias for --no-notes")
|
|
763
1002
|
.option("--json", "Machine-readable output")
|
|
@@ -826,6 +1065,13 @@ function buildMissionCreateCommand() {
|
|
|
826
1065
|
const title = opts.title ?? titleFromSlug(name.replace(/^release-/, ""));
|
|
827
1066
|
const intent = opts.intent ?? title;
|
|
828
1067
|
const dependsOn = Array.isArray(opts.dependsOn) ? [...new Set(opts.dependsOn)] : [];
|
|
1068
|
+
const parentWarnings = [];
|
|
1069
|
+
if (opts.parent !== undefined) {
|
|
1070
|
+
const nodes = readParentScope(missionsRoot, { onInvalid: (message) => parentWarnings.push(message) });
|
|
1071
|
+
for (const node of nodes.filter((node) => node.id === id))
|
|
1072
|
+
parentWarnings.push(`Mission ID ${id} is already in use at ${node.path}.`);
|
|
1073
|
+
validateMissionParent(nodes, id, opts.parent, (message) => parentWarnings.push(message));
|
|
1074
|
+
}
|
|
829
1075
|
const project = id.split(".")[0];
|
|
830
1076
|
for (const dependency of dependsOn) {
|
|
831
1077
|
if (dependency === id) {
|
|
@@ -881,7 +1127,13 @@ function buildMissionCreateCommand() {
|
|
|
881
1127
|
// New scaffolds author SPEC.md; existing README-backed nodes are never rewritten.
|
|
882
1128
|
const readmePath = path.join(absPath, "SPEC.md");
|
|
883
1129
|
fs.writeFileSync(readmePath, readmeBody, "utf8");
|
|
884
|
-
|
|
1130
|
+
let manifestBody = missionManifest(name);
|
|
1131
|
+
if (opts.parent !== undefined) {
|
|
1132
|
+
const manifest = YAML.parseDocument(manifestBody);
|
|
1133
|
+
manifest.setIn(["metadata", "parent"], opts.parent);
|
|
1134
|
+
manifestBody = manifest.toString();
|
|
1135
|
+
}
|
|
1136
|
+
fs.writeFileSync(path.join(absPath, "mission.yaml"), manifestBody, "utf8");
|
|
885
1137
|
const progressPath = path.join(absPath, "PROGRESS.md");
|
|
886
1138
|
fs.writeFileSync(progressPath, progressBody, "utf8");
|
|
887
1139
|
const capabilityDeltaPath = capabilityDeltaBody
|
|
@@ -908,6 +1160,7 @@ function buildMissionCreateCommand() {
|
|
|
908
1160
|
humanLines.push(` capability delta: ${capabilityDeltaPath}`);
|
|
909
1161
|
const advisories = [
|
|
910
1162
|
...rootAdvisories,
|
|
1163
|
+
...parentWarnings,
|
|
911
1164
|
...(notesRendered?.resolvedFrom === "legacy-env"
|
|
912
1165
|
? ["OPENRIG_MISSION_NOTES_TEMPLATE_PATH is deprecated; use OPENRIG_NOTES_TEMPLATE_PATH"]
|
|
913
1166
|
: []),
|
|
@@ -934,6 +1187,66 @@ function buildMissionCreateCommand() {
|
|
|
934
1187
|
}
|
|
935
1188
|
});
|
|
936
1189
|
}
|
|
1190
|
+
function buildMissionParentCommand() {
|
|
1191
|
+
return new Command("parent")
|
|
1192
|
+
.description("Set or clear the mission or slice this mission breaks down")
|
|
1193
|
+
.argument("<mission>", "Mission name or path")
|
|
1194
|
+
.argument("[parent]", "Parent mission or slice dot-ID")
|
|
1195
|
+
.option("--clear", "Remove the parent link")
|
|
1196
|
+
.option("--json", "Machine-readable output")
|
|
1197
|
+
.action(async (name, parent, opts, command) => {
|
|
1198
|
+
const out = makeStdout(), json = Boolean(opts.json);
|
|
1199
|
+
try {
|
|
1200
|
+
if (Boolean(parent) === Boolean(opts.clear))
|
|
1201
|
+
throw new ScopeCliError({ fact: "Choose a parent ID or --clear.", consequence: "No parent was changed.", action: "Pass exactly one parent ID or --clear." });
|
|
1202
|
+
const root = resolveMissionsRoot({ override: getOpts(command).workspace, strictOverride: true });
|
|
1203
|
+
const mission = findMission(root, name);
|
|
1204
|
+
const realRoot = fs.realpathSync(root);
|
|
1205
|
+
const realMission = fs.realpathSync(mission.absPath);
|
|
1206
|
+
if (path.dirname(realMission) !== realRoot)
|
|
1207
|
+
throw new ScopeCliError({ fact: `Mission ${name} is outside the selected missions root.`, consequence: "No parent was changed.", action: "Select a mission inside the selected workspace." });
|
|
1208
|
+
const writeTarget = fs.existsSync(path.join(mission.absPath, "mission.yaml")) ? path.join(mission.absPath, "mission.yaml") : mission.readmePath;
|
|
1209
|
+
if (path.dirname(fs.realpathSync(writeTarget)) !== realMission)
|
|
1210
|
+
throw new ScopeCliError({ fact: `Mission file for ${name} is outside its directory.`, consequence: "No parent was changed.", action: "Use a mission whose authored files are inside its directory." });
|
|
1211
|
+
const warnings = [];
|
|
1212
|
+
if (parent) {
|
|
1213
|
+
const nodes = readParentScope(root, { onInvalid: (message) => warnings.push(message) });
|
|
1214
|
+
validateMissionParent(nodes, mission.id ?? "", parent, (message) => warnings.push(message));
|
|
1215
|
+
}
|
|
1216
|
+
const manifestPath = path.join(mission.absPath, "mission.yaml");
|
|
1217
|
+
if (fs.existsSync(manifestPath)) {
|
|
1218
|
+
const doc = YAML.parseDocument(fs.readFileSync(manifestPath, "utf8"));
|
|
1219
|
+
if (doc.errors.length)
|
|
1220
|
+
throw doc.errors[0];
|
|
1221
|
+
if (parent)
|
|
1222
|
+
doc.setIn(["metadata", "parent"], parent);
|
|
1223
|
+
else
|
|
1224
|
+
doc.deleteIn(["metadata", "parent"]);
|
|
1225
|
+
fs.writeFileSync(manifestPath, doc.toString(), "utf8");
|
|
1226
|
+
}
|
|
1227
|
+
else if (parent) {
|
|
1228
|
+
updateFrontmatter(mission.readmePath, { parent });
|
|
1229
|
+
}
|
|
1230
|
+
else {
|
|
1231
|
+
const original = fs.readFileSync(mission.readmePath, "utf8");
|
|
1232
|
+
const match = /^---[ \t]*\r?\n([\s\S]*?)\r?\n---[ \t]*(?=\r?\n|$)/.exec(original);
|
|
1233
|
+
if (match) {
|
|
1234
|
+
const doc = YAML.parseDocument(match[1]);
|
|
1235
|
+
if (doc.errors.length)
|
|
1236
|
+
updateFrontmatter(mission.readmePath, { parent: null });
|
|
1237
|
+
else {
|
|
1238
|
+
doc.delete("parent");
|
|
1239
|
+
fs.writeFileSync(mission.readmePath, `---\n${doc.toString()}---${original.slice(match[0].length)}`, "utf8");
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
emit(out, { ok: true, mission: mission.name, parent: parent ?? null, warnings }, json, [`Mission ${mission.name} parent: ${parent ?? "(none)"}`, ...warnings.map((message) => `Warning: ${message}`)]);
|
|
1244
|
+
}
|
|
1245
|
+
catch (err) {
|
|
1246
|
+
fail(err, json, out);
|
|
1247
|
+
}
|
|
1248
|
+
});
|
|
1249
|
+
}
|
|
937
1250
|
function buildMissionGraphCommand() {
|
|
938
1251
|
return new Command("graph")
|
|
939
1252
|
.description("Show advisory sibling build-order edges and the current ready set")
|
|
@@ -1151,6 +1464,27 @@ function buildAuditCommand() {
|
|
|
1151
1464
|
...missionResult.findings.map((f) => ({ ...f, scope: "mission", scopeName: missionName })),
|
|
1152
1465
|
...sliceResults.flatMap((s) => s.result.findings.map((f) => ({ ...f, scope: "slice", scopeName: s.name }))),
|
|
1153
1466
|
];
|
|
1467
|
+
const parentFindings = [];
|
|
1468
|
+
const parentNodes = readParentScope(missionsRoot, { onInvalid: (message) => parentFindings.push(message) });
|
|
1469
|
+
const audited = parentNodes.find((node) => node.kind === "mission" && node.path === missionDir);
|
|
1470
|
+
if (audited?.parent) {
|
|
1471
|
+
try {
|
|
1472
|
+
validateMissionParent(parentNodes, audited.id ?? "", audited.parent, (message) => parentFindings.push(message));
|
|
1473
|
+
}
|
|
1474
|
+
catch (error) {
|
|
1475
|
+
parentFindings.push(error.message);
|
|
1476
|
+
}
|
|
1477
|
+
}
|
|
1478
|
+
if (audited) {
|
|
1479
|
+
const children = parentNodes.filter((node) => node.kind === "mission" && node.parent && (node.parent === audited.id || parentNodes.some((target) => target.kind === "slice" && target.missionId === audited.id && target.id === node.parent)));
|
|
1480
|
+
for (const child of children) {
|
|
1481
|
+
const target = parentNodes.filter((node) => node.id === child.parent);
|
|
1482
|
+
if (target.length !== 1)
|
|
1483
|
+
parentFindings.push(`Child ${child.id} has an ambiguous parent ${child.parent}.`);
|
|
1484
|
+
else if (target[0].kind === "slice" && /^(done|closed|shipped)(?:$|-)/.test(target[0].status ?? "") && ["active", "in-progress", "wip", "blocked"].includes(child.status ?? ""))
|
|
1485
|
+
parentFindings.push(`Child ${child.id} is active while parent slice ${child.parent} is complete.`);
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1154
1488
|
const hardFindings = allFindings.filter((f) => f.severity === "high");
|
|
1155
1489
|
if (json) {
|
|
1156
1490
|
out.write(JSON.stringify({
|
|
@@ -1164,8 +1498,8 @@ function buildAuditCommand() {
|
|
|
1164
1498
|
// OPR.0.5.0.18 — amendment lineage (present only when re-stamped).
|
|
1165
1499
|
...(s.attestations ? { attestations: s.attestations } : {}),
|
|
1166
1500
|
})),
|
|
1167
|
-
graph,
|
|
1168
|
-
totalFindings: allFindings.length,
|
|
1501
|
+
graph, parentFindings,
|
|
1502
|
+
totalFindings: allFindings.length + parentFindings.length,
|
|
1169
1503
|
}, null, 2));
|
|
1170
1504
|
out.write("\n");
|
|
1171
1505
|
if (hardFindings.length > 0)
|
|
@@ -1195,6 +1529,8 @@ function buildAuditCommand() {
|
|
|
1195
1529
|
}
|
|
1196
1530
|
out.write("\n");
|
|
1197
1531
|
}
|
|
1532
|
+
for (const finding of parentFindings)
|
|
1533
|
+
out.write(`PARENT LINK: ${finding}\n`);
|
|
1198
1534
|
if (allFindings.length > 0) {
|
|
1199
1535
|
out.write("FINDINGS:\n");
|
|
1200
1536
|
for (const f of allFindings) {
|
|
@@ -1210,7 +1546,7 @@ function buildAuditCommand() {
|
|
|
1210
1546
|
out.write(`\nWARN: ${allFindings.length} advisory finding(s)\n`);
|
|
1211
1547
|
}
|
|
1212
1548
|
}
|
|
1213
|
-
else {
|
|
1549
|
+
else if (!parentFindings.length) {
|
|
1214
1550
|
out.write("PASS: all scope items have valid rails\n");
|
|
1215
1551
|
}
|
|
1216
1552
|
}
|
|
@@ -2066,6 +2402,7 @@ export function scopeCommand() {
|
|
|
2066
2402
|
mission.addCommand(buildMissionLsCommand());
|
|
2067
2403
|
mission.addCommand(buildMissionShowCommand());
|
|
2068
2404
|
mission.addCommand(buildMissionCreateCommand());
|
|
2405
|
+
mission.addCommand(buildMissionParentCommand());
|
|
2069
2406
|
mission.addCommand(buildMissionGraphCommand());
|
|
2070
2407
|
mission.addCommand(buildMissionProgressCommand());
|
|
2071
2408
|
mission.addCommand(buildMissionRepairCommand());
|