@openrig/cli 0.4.2 → 0.4.4
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/daemon/assets/guidance/openrig-start.md +6 -0
- package/daemon/assets/plugins/openrig-core/hooks/scripts/activity-relay.cjs +42 -2
- package/daemon/assets/plugins/openrig-core/skills/mission-slice-sop/SKILL.md +115 -0
- package/daemon/assets/plugins/openrig-core/skills/openrig-user/SKILL.md +12 -12
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts +46 -0
- package/daemon/dist/adapters/codex-runtime-adapter.d.ts.map +1 -1
- package/daemon/dist/adapters/codex-runtime-adapter.js +167 -3
- package/daemon/dist/adapters/codex-runtime-adapter.js.map +1 -1
- package/daemon/dist/adapters/tmux.d.ts +31 -0
- package/daemon/dist/adapters/tmux.d.ts.map +1 -1
- package/daemon/dist/adapters/tmux.js +62 -0
- package/daemon/dist/adapters/tmux.js.map +1 -1
- package/daemon/dist/build-info.d.ts +12 -0
- package/daemon/dist/build-info.d.ts.map +1 -0
- package/daemon/dist/build-info.js +11 -0
- package/daemon/dist/build-info.js.map +1 -0
- package/daemon/dist/db/migrations/045_resume_verification.d.ts +29 -0
- package/daemon/dist/db/migrations/045_resume_verification.d.ts.map +1 -0
- package/daemon/dist/db/migrations/045_resume_verification.js +34 -0
- package/daemon/dist/db/migrations/045_resume_verification.js.map +1 -0
- package/daemon/dist/db/migrations/046_seat_identity_verdicts.d.ts +41 -0
- package/daemon/dist/db/migrations/046_seat_identity_verdicts.d.ts.map +1 -0
- package/daemon/dist/db/migrations/046_seat_identity_verdicts.js +56 -0
- package/daemon/dist/db/migrations/046_seat_identity_verdicts.js.map +1 -0
- package/daemon/dist/db/migrations/047_events_node_type_index.d.ts +48 -0
- package/daemon/dist/db/migrations/047_events_node_type_index.d.ts.map +1 -0
- package/daemon/dist/db/migrations/047_events_node_type_index.js +52 -0
- package/daemon/dist/db/migrations/047_events_node_type_index.js.map +1 -0
- package/daemon/dist/db/migrations/048_queue_item_evidence_ref.d.ts +18 -0
- package/daemon/dist/db/migrations/048_queue_item_evidence_ref.d.ts.map +1 -0
- package/daemon/dist/db/migrations/048_queue_item_evidence_ref.js +22 -0
- package/daemon/dist/db/migrations/048_queue_item_evidence_ref.js.map +1 -0
- package/daemon/dist/domain/activity-endpoint.d.ts +25 -0
- package/daemon/dist/domain/activity-endpoint.d.ts.map +1 -0
- package/daemon/dist/domain/activity-endpoint.js +91 -0
- package/daemon/dist/domain/activity-endpoint.js.map +1 -0
- package/daemon/dist/domain/claim-service.d.ts +36 -0
- package/daemon/dist/domain/claim-service.d.ts.map +1 -1
- package/daemon/dist/domain/claim-service.js +90 -0
- package/daemon/dist/domain/claim-service.js.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts +57 -0
- package/daemon/dist/domain/claude-compaction-enforcer.d.ts.map +1 -1
- package/daemon/dist/domain/claude-compaction-enforcer.js +149 -3
- package/daemon/dist/domain/claude-compaction-enforcer.js.map +1 -1
- package/daemon/dist/domain/event-loop-monitor.d.ts +100 -0
- package/daemon/dist/domain/event-loop-monitor.d.ts.map +1 -0
- package/daemon/dist/domain/event-loop-monitor.js +127 -0
- package/daemon/dist/domain/event-loop-monitor.js.map +1 -0
- package/daemon/dist/domain/feed/attention-aggregator.d.ts +31 -0
- package/daemon/dist/domain/feed/attention-aggregator.d.ts.map +1 -0
- package/daemon/dist/domain/feed/attention-aggregator.js +119 -0
- package/daemon/dist/domain/feed/attention-aggregator.js.map +1 -0
- package/daemon/dist/domain/files/file-write-service.d.ts +11 -2
- package/daemon/dist/domain/files/file-write-service.d.ts.map +1 -1
- package/daemon/dist/domain/files/file-write-service.js +77 -0
- package/daemon/dist/domain/files/file-write-service.js.map +1 -1
- package/daemon/dist/domain/gate-predicate.d.ts +29 -0
- package/daemon/dist/domain/gate-predicate.d.ts.map +1 -0
- package/daemon/dist/domain/gate-predicate.js +73 -0
- package/daemon/dist/domain/gate-predicate.js.map +1 -0
- package/daemon/dist/domain/graph-projection.d.ts +7 -1
- package/daemon/dist/domain/graph-projection.d.ts.map +1 -1
- package/daemon/dist/domain/graph-projection.js +19 -1
- package/daemon/dist/domain/graph-projection.js.map +1 -1
- package/daemon/dist/domain/hosts/fanout-contract.d.ts +33 -0
- package/daemon/dist/domain/hosts/fanout-contract.d.ts.map +1 -0
- package/daemon/dist/domain/hosts/fanout-contract.js +23 -0
- package/daemon/dist/domain/hosts/fanout-contract.js.map +1 -0
- package/daemon/dist/domain/hosts/hosts-registry-reader.d.ts +49 -0
- package/daemon/dist/domain/hosts/hosts-registry-reader.d.ts.map +1 -0
- package/daemon/dist/domain/hosts/hosts-registry-reader.js +165 -0
- package/daemon/dist/domain/hosts/hosts-registry-reader.js.map +1 -0
- package/daemon/dist/domain/hosts/remote-daemon-http.d.ts +35 -0
- package/daemon/dist/domain/hosts/remote-daemon-http.d.ts.map +1 -0
- package/daemon/dist/domain/hosts/remote-daemon-http.js +105 -0
- package/daemon/dist/domain/hosts/remote-daemon-http.js.map +1 -0
- package/daemon/dist/domain/human-route-enforcer.d.ts +71 -0
- package/daemon/dist/domain/human-route-enforcer.d.ts.map +1 -0
- package/daemon/dist/domain/human-route-enforcer.js +80 -0
- package/daemon/dist/domain/human-route-enforcer.js.map +1 -0
- package/daemon/dist/domain/mission-control/audit-browse.d.ts +8 -0
- package/daemon/dist/domain/mission-control/audit-browse.d.ts.map +1 -1
- package/daemon/dist/domain/mission-control/audit-browse.js +19 -0
- package/daemon/dist/domain/mission-control/audit-browse.js.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-action-log.d.ts +1 -1
- 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 +4 -0
- package/daemon/dist/domain/mission-control/mission-control-action-log.js.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-fleet-cli-capability.js +1 -1
- package/daemon/dist/domain/mission-control/mission-control-fleet-cli-capability.js.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-read-layer.js +1 -1
- package/daemon/dist/domain/mission-control/mission-control-read-layer.js.map +1 -1
- package/daemon/dist/domain/mission-control/mission-control-write-contract.d.ts +28 -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 +125 -0
- package/daemon/dist/domain/mission-control/mission-control-write-contract.js.map +1 -1
- package/daemon/dist/domain/node-inventory.d.ts +7 -1
- package/daemon/dist/domain/node-inventory.d.ts.map +1 -1
- package/daemon/dist/domain/node-inventory.js +84 -5
- package/daemon/dist/domain/node-inventory.js.map +1 -1
- package/daemon/dist/domain/periodic-snapshot-scheduler.d.ts +4 -0
- package/daemon/dist/domain/periodic-snapshot-scheduler.d.ts.map +1 -1
- package/daemon/dist/domain/periodic-snapshot-scheduler.js +11 -0
- package/daemon/dist/domain/periodic-snapshot-scheduler.js.map +1 -1
- package/daemon/dist/domain/policies/idle-gate-qitem.d.ts +14 -0
- package/daemon/dist/domain/policies/idle-gate-qitem.d.ts.map +1 -0
- package/daemon/dist/domain/policies/idle-gate-qitem.js +114 -0
- package/daemon/dist/domain/policies/idle-gate-qitem.js.map +1 -0
- package/daemon/dist/domain/ps-projection.d.ts +28 -1
- package/daemon/dist/domain/ps-projection.d.ts.map +1 -1
- package/daemon/dist/domain/ps-projection.js +39 -0
- package/daemon/dist/domain/ps-projection.js.map +1 -1
- package/daemon/dist/domain/queue-repository.d.ts +25 -1
- package/daemon/dist/domain/queue-repository.d.ts.map +1 -1
- package/daemon/dist/domain/queue-repository.js +111 -7
- package/daemon/dist/domain/queue-repository.js.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.d.ts +8 -0
- package/daemon/dist/domain/restore-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/restore-orchestrator.js +109 -27
- package/daemon/dist/domain/restore-orchestrator.js.map +1 -1
- package/daemon/dist/domain/restore-plan-preview.d.ts +25 -1
- package/daemon/dist/domain/restore-plan-preview.d.ts.map +1 -1
- package/daemon/dist/domain/restore-plan-preview.js +72 -4
- package/daemon/dist/domain/restore-plan-preview.js.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.d.ts +44 -2
- package/daemon/dist/domain/resume-metadata-refresher.d.ts.map +1 -1
- package/daemon/dist/domain/resume-metadata-refresher.js +92 -6
- package/daemon/dist/domain/resume-metadata-refresher.js.map +1 -1
- package/daemon/dist/domain/resume-token-capture.d.ts +50 -0
- package/daemon/dist/domain/resume-token-capture.d.ts.map +1 -0
- package/daemon/dist/domain/resume-token-capture.js +63 -0
- package/daemon/dist/domain/resume-token-capture.js.map +1 -0
- package/daemon/dist/domain/review/brief-spine.d.ts +19 -0
- package/daemon/dist/domain/review/brief-spine.d.ts.map +1 -0
- package/daemon/dist/domain/review/brief-spine.js +86 -0
- package/daemon/dist/domain/review/brief-spine.js.map +1 -0
- package/daemon/dist/domain/review/compose.d.ts +228 -0
- package/daemon/dist/domain/review/compose.d.ts.map +1 -0
- package/daemon/dist/domain/review/compose.js +773 -0
- package/daemon/dist/domain/review/compose.js.map +1 -0
- package/daemon/dist/domain/review/freeze.d.ts +31 -0
- package/daemon/dist/domain/review/freeze.d.ts.map +1 -0
- package/daemon/dist/domain/review/freeze.js +257 -0
- package/daemon/dist/domain/review/freeze.js.map +1 -0
- package/daemon/dist/domain/review/gather.d.ts +100 -0
- package/daemon/dist/domain/review/gather.d.ts.map +1 -0
- package/daemon/dist/domain/review/gather.js +676 -0
- package/daemon/dist/domain/review/gather.js.map +1 -0
- package/daemon/dist/domain/review/types.d.ts +258 -0
- package/daemon/dist/domain/review/types.d.ts.map +1 -0
- package/daemon/dist/domain/review/types.js +35 -0
- package/daemon/dist/domain/review/types.js.map +1 -0
- package/daemon/dist/domain/rig-status-compose.d.ts +62 -0
- package/daemon/dist/domain/rig-status-compose.d.ts.map +1 -0
- package/daemon/dist/domain/rig-status-compose.js +149 -0
- package/daemon/dist/domain/rig-status-compose.js.map +1 -0
- package/daemon/dist/domain/rig-teardown.d.ts +3 -1
- package/daemon/dist/domain/rig-teardown.d.ts.map +1 -1
- package/daemon/dist/domain/rig-teardown.js +4 -19
- package/daemon/dist/domain/rig-teardown.js.map +1 -1
- package/daemon/dist/domain/route-timing-recorder.d.ts +42 -0
- package/daemon/dist/domain/route-timing-recorder.d.ts.map +1 -0
- package/daemon/dist/domain/route-timing-recorder.js +62 -0
- package/daemon/dist/domain/route-timing-recorder.js.map +1 -0
- package/daemon/dist/domain/scope/scope-approve.d.ts +64 -0
- package/daemon/dist/domain/scope/scope-approve.d.ts.map +1 -0
- package/daemon/dist/domain/scope/scope-approve.js +153 -0
- package/daemon/dist/domain/scope/scope-approve.js.map +1 -0
- package/daemon/dist/domain/scope/scope-audit.d.ts +11 -1
- package/daemon/dist/domain/scope/scope-audit.d.ts.map +1 -1
- package/daemon/dist/domain/scope/scope-audit.js +203 -2
- package/daemon/dist/domain/scope/scope-audit.js.map +1 -1
- package/daemon/dist/domain/seat-handover-service.d.ts +50 -7
- package/daemon/dist/domain/seat-handover-service.d.ts.map +1 -1
- package/daemon/dist/domain/seat-handover-service.js +273 -33
- package/daemon/dist/domain/seat-handover-service.js.map +1 -1
- package/daemon/dist/domain/seat-identity-reconciler.d.ts +59 -0
- package/daemon/dist/domain/seat-identity-reconciler.d.ts.map +1 -0
- package/daemon/dist/domain/seat-identity-reconciler.js +207 -0
- package/daemon/dist/domain/seat-identity-reconciler.js.map +1 -0
- package/daemon/dist/domain/seat-identity-store.d.ts +27 -0
- package/daemon/dist/domain/seat-identity-store.d.ts.map +1 -0
- package/daemon/dist/domain/seat-identity-store.js +106 -0
- package/daemon/dist/domain/seat-identity-store.js.map +1 -0
- package/daemon/dist/domain/seat-switch-client-service.d.ts +57 -0
- package/daemon/dist/domain/seat-switch-client-service.d.ts.map +1 -0
- package/daemon/dist/domain/seat-switch-client-service.js +168 -0
- package/daemon/dist/domain/seat-switch-client-service.js.map +1 -0
- package/daemon/dist/domain/self-attach-service.d.ts +8 -0
- package/daemon/dist/domain/self-attach-service.d.ts.map +1 -1
- package/daemon/dist/domain/self-attach-service.js +20 -7
- package/daemon/dist/domain/self-attach-service.js.map +1 -1
- package/daemon/dist/domain/session-registry.d.ts +35 -4
- package/daemon/dist/domain/session-registry.d.ts.map +1 -1
- package/daemon/dist/domain/session-registry.js +89 -10
- package/daemon/dist/domain/session-registry.js.map +1 -1
- package/daemon/dist/domain/session-transport.d.ts +8 -1
- package/daemon/dist/domain/session-transport.d.ts.map +1 -1
- package/daemon/dist/domain/session-transport.js +143 -37
- package/daemon/dist/domain/session-transport.js.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.d.ts.map +1 -1
- package/daemon/dist/domain/startup-orchestrator.js +34 -2
- package/daemon/dist/domain/startup-orchestrator.js.map +1 -1
- package/daemon/dist/domain/startup-proof.d.ts +63 -0
- package/daemon/dist/domain/startup-proof.d.ts.map +1 -0
- package/daemon/dist/domain/startup-proof.js +165 -0
- package/daemon/dist/domain/startup-proof.js.map +1 -0
- package/daemon/dist/domain/successor-session-launcher.d.ts +103 -0
- package/daemon/dist/domain/successor-session-launcher.d.ts.map +1 -0
- package/daemon/dist/domain/successor-session-launcher.js +246 -0
- package/daemon/dist/domain/successor-session-launcher.js.map +1 -0
- package/daemon/dist/domain/topology/multi-rig-launcher.d.ts +49 -0
- package/daemon/dist/domain/topology/multi-rig-launcher.d.ts.map +1 -0
- package/daemon/dist/domain/topology/multi-rig-launcher.js +132 -0
- package/daemon/dist/domain/topology/multi-rig-launcher.js.map +1 -0
- package/daemon/dist/domain/topology/remote-up-leaf.d.ts +29 -0
- package/daemon/dist/domain/topology/remote-up-leaf.d.ts.map +1 -0
- package/daemon/dist/domain/topology/remote-up-leaf.js +60 -0
- package/daemon/dist/domain/topology/remote-up-leaf.js.map +1 -0
- package/daemon/dist/domain/topology/topology-manifest.d.ts +34 -0
- package/daemon/dist/domain/topology/topology-manifest.d.ts.map +1 -0
- package/daemon/dist/domain/topology/topology-manifest.js +195 -0
- package/daemon/dist/domain/topology/topology-manifest.js.map +1 -0
- package/daemon/dist/domain/types.d.ts +86 -0
- package/daemon/dist/domain/types.d.ts.map +1 -1
- package/daemon/dist/domain/types.js +8 -0
- package/daemon/dist/domain/types.js.map +1 -1
- package/daemon/dist/domain/up-command-router.d.ts +1 -1
- package/daemon/dist/domain/up-command-router.d.ts.map +1 -1
- package/daemon/dist/domain/up-command-router.js +34 -2
- package/daemon/dist/domain/up-command-router.js.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.d.ts +17 -0
- package/daemon/dist/domain/user-settings/settings-store.d.ts.map +1 -1
- package/daemon/dist/domain/user-settings/settings-store.js +109 -0
- package/daemon/dist/domain/user-settings/settings-store.js.map +1 -1
- package/daemon/dist/domain/watchdog-jobs-repository.d.ts +2 -2
- package/daemon/dist/domain/watchdog-jobs-repository.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-jobs-repository.js +4 -0
- package/daemon/dist/domain/watchdog-jobs-repository.js.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.d.ts.map +1 -1
- package/daemon/dist/domain/watchdog-policy-engine.js +19 -0
- package/daemon/dist/domain/watchdog-policy-engine.js.map +1 -1
- package/daemon/dist/domain/workspace/default-workspace-scaffold.d.ts.map +1 -1
- package/daemon/dist/domain/workspace/default-workspace-scaffold.js +51 -6
- package/daemon/dist/domain/workspace/default-workspace-scaffold.js.map +1 -1
- package/daemon/dist/domain/workspace/workspace-doctor.d.ts +11 -0
- package/daemon/dist/domain/workspace/workspace-doctor.d.ts.map +1 -1
- package/daemon/dist/domain/workspace/workspace-doctor.js +82 -0
- package/daemon/dist/domain/workspace/workspace-doctor.js.map +1 -1
- package/daemon/dist/index.d.ts.map +1 -1
- package/daemon/dist/index.js +18 -1
- package/daemon/dist/index.js.map +1 -1
- package/daemon/dist/routes/activity.d.ts.map +1 -1
- package/daemon/dist/routes/activity.js +26 -0
- package/daemon/dist/routes/activity.js.map +1 -1
- package/daemon/dist/routes/agent-images.d.ts.map +1 -1
- package/daemon/dist/routes/agent-images.js +139 -0
- package/daemon/dist/routes/agent-images.js.map +1 -1
- package/daemon/dist/routes/compaction.d.ts +17 -0
- package/daemon/dist/routes/compaction.d.ts.map +1 -0
- package/daemon/dist/routes/compaction.js +125 -0
- package/daemon/dist/routes/compaction.js.map +1 -0
- package/daemon/dist/routes/config.d.ts.map +1 -1
- package/daemon/dist/routes/config.js +15 -6
- package/daemon/dist/routes/config.js.map +1 -1
- package/daemon/dist/routes/files.d.ts.map +1 -1
- package/daemon/dist/routes/files.js +45 -1
- package/daemon/dist/routes/files.js.map +1 -1
- package/daemon/dist/routes/mission-control.d.ts.map +1 -1
- package/daemon/dist/routes/mission-control.js +67 -2
- package/daemon/dist/routes/mission-control.js.map +1 -1
- package/daemon/dist/routes/queue.d.ts +8 -2
- package/daemon/dist/routes/queue.d.ts.map +1 -1
- package/daemon/dist/routes/queue.js +44 -4
- package/daemon/dist/routes/queue.js.map +1 -1
- package/daemon/dist/routes/restore-check.d.ts +10 -0
- package/daemon/dist/routes/restore-check.d.ts.map +1 -1
- package/daemon/dist/routes/restore-check.js +46 -37
- package/daemon/dist/routes/restore-check.js.map +1 -1
- package/daemon/dist/routes/review.d.ts +3 -0
- package/daemon/dist/routes/review.d.ts.map +1 -0
- package/daemon/dist/routes/review.js +169 -0
- package/daemon/dist/routes/review.js.map +1 -0
- package/daemon/dist/routes/rigs.d.ts.map +1 -1
- package/daemon/dist/routes/rigs.js +70 -1
- package/daemon/dist/routes/rigs.js.map +1 -1
- package/daemon/dist/routes/scope-approve.d.ts +3 -0
- package/daemon/dist/routes/scope-approve.d.ts.map +1 -0
- package/daemon/dist/routes/scope-approve.js +55 -0
- package/daemon/dist/routes/scope-approve.js.map +1 -0
- package/daemon/dist/routes/scope-audit.d.ts.map +1 -1
- package/daemon/dist/routes/scope-audit.js +28 -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 +53 -2
- package/daemon/dist/routes/seat.js.map +1 -1
- package/daemon/dist/routes/sessions.d.ts.map +1 -1
- package/daemon/dist/routes/sessions.js +44 -9
- package/daemon/dist/routes/sessions.js.map +1 -1
- package/daemon/dist/routes/slices.d.ts.map +1 -1
- package/daemon/dist/routes/slices.js +49 -9
- package/daemon/dist/routes/slices.js.map +1 -1
- package/daemon/dist/routes/snapshots.d.ts.map +1 -1
- package/daemon/dist/routes/snapshots.js +16 -1
- package/daemon/dist/routes/snapshots.js.map +1 -1
- package/daemon/dist/routes/terminal-ws.d.ts.map +1 -1
- package/daemon/dist/routes/terminal-ws.js +58 -21
- package/daemon/dist/routes/terminal-ws.js.map +1 -1
- package/daemon/dist/routes/transport.d.ts.map +1 -1
- package/daemon/dist/routes/transport.js +12 -5
- package/daemon/dist/routes/transport.js.map +1 -1
- package/daemon/dist/routes/up.d.ts.map +1 -1
- package/daemon/dist/routes/up.js +84 -0
- package/daemon/dist/routes/up.js.map +1 -1
- package/daemon/dist/routes/workspace.js +2 -2
- package/daemon/dist/server.d.ts +33 -0
- package/daemon/dist/server.d.ts.map +1 -1
- package/daemon/dist/server.js +41 -1
- package/daemon/dist/server.js.map +1 -1
- package/daemon/dist/startup.d.ts +1 -0
- package/daemon/dist/startup.d.ts.map +1 -1
- package/daemon/dist/startup.js +108 -20
- package/daemon/dist/startup.js.map +1 -1
- package/daemon/docs/reference/agent-startup-guide.md +1 -1
- package/daemon/docs/reference/product-factory-vps-runbook.md +132 -0
- package/daemon/docs/reference/sdlc-conventions.md +187 -0
- package/daemon/specs/agents/conveyor/builder/agent.yaml +1 -1
- package/daemon/specs/agents/conveyor/builder/guidance/role.md +1 -0
- package/daemon/specs/agents/conveyor/lead/agent.yaml +1 -1
- package/daemon/specs/agents/conveyor/lead/guidance/role.md +1 -0
- package/daemon/specs/agents/conveyor/planner/agent.yaml +1 -1
- package/daemon/specs/agents/conveyor/planner/guidance/role.md +1 -0
- package/daemon/specs/agents/conveyor/reviewer/agent.yaml +1 -1
- package/daemon/specs/agents/conveyor/reviewer/guidance/role.md +1 -0
- package/daemon/specs/agents/design/product-designer/agent.yaml +1 -1
- package/daemon/specs/agents/design/product-designer/guidance/role.md +1 -0
- package/daemon/specs/agents/development/implementer/agent.yaml +1 -1
- package/daemon/specs/agents/development/implementer/guidance/role.md +1 -0
- package/daemon/specs/agents/development/qa/agent.yaml +1 -1
- package/daemon/specs/agents/development/qa/guidance/role.md +1 -0
- package/daemon/specs/agents/orchestration/orchestrator/agent.yaml +1 -1
- package/daemon/specs/agents/orchestration/orchestrator/guidance/role.md +1 -0
- package/daemon/specs/agents/product-management/pm/agent.yaml +1 -0
- package/daemon/specs/agents/product-management/pm/guidance/role.md +13 -0
- package/daemon/specs/agents/review/independent-reviewer/agent.yaml +1 -1
- package/daemon/specs/agents/review/independent-reviewer/guidance/role.md +1 -0
- package/daemon/specs/agents/shared/agent.yaml +2 -0
- package/daemon/specs/agents/shared/skills/core/mission-slice-sop/SKILL.md +115 -0
- package/daemon/specs/agents/shared/skills/core/openrig-operator/SKILL.md +4 -4
- package/daemon/specs/agents/shared/skills/core/openrig-user/SKILL.md +69 -23
- package/daemon/specs/agents/shared/skills/pods/orchestration-team/SKILL.md +3 -3
- package/daemon/specs/rigs/focused/pm-team/CULTURE.md +4 -0
- package/daemon/specs/rigs/launch/kernel/agents/operator/agent/guidance/role.md +1 -1
- package/daemon/specs/rigs/launch/kernel/agents/operator/agent/startup/context.md +1 -1
- package/daemon/specs/rigs/preview/product-team/CULTURE.md +4 -0
- package/dist/build-info.d.ts +8 -0
- package/dist/build-info.d.ts.map +1 -0
- package/dist/build-info.js +11 -0
- package/dist/build-info.js.map +1 -0
- package/dist/commands/compact.d.ts +15 -0
- package/dist/commands/compact.d.ts.map +1 -0
- package/dist/commands/compact.js +62 -0
- package/dist/commands/compact.js.map +1 -0
- package/dist/commands/config-init-workspace.d.ts.map +1 -1
- package/dist/commands/config-init-workspace.js +20 -4
- package/dist/commands/config-init-workspace.js.map +1 -1
- package/dist/commands/daemon.d.ts.map +1 -1
- package/dist/commands/daemon.js +18 -2
- package/dist/commands/daemon.js.map +1 -1
- package/dist/commands/doctor.js +2 -2
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/expand.js +1 -1
- package/dist/commands/expand.js.map +1 -1
- package/dist/commands/file.d.ts +7 -0
- package/dist/commands/file.d.ts.map +1 -0
- package/dist/commands/file.js +77 -0
- package/dist/commands/file.js.map +1 -0
- package/dist/commands/fork.d.ts +4 -0
- package/dist/commands/fork.d.ts.map +1 -0
- package/dist/commands/fork.js +101 -0
- package/dist/commands/fork.js.map +1 -0
- package/dist/commands/host.d.ts +34 -0
- package/dist/commands/host.d.ts.map +1 -0
- package/dist/commands/host.js +448 -0
- package/dist/commands/host.js.map +1 -0
- package/dist/commands/launch.d.ts.map +1 -1
- package/dist/commands/launch.js +34 -4
- package/dist/commands/launch.js.map +1 -1
- package/dist/commands/proof.d.ts +54 -0
- package/dist/commands/proof.d.ts.map +1 -0
- package/dist/commands/proof.js +311 -0
- package/dist/commands/proof.js.map +1 -0
- package/dist/commands/ps.d.ts +41 -7
- package/dist/commands/ps.d.ts.map +1 -1
- package/dist/commands/ps.js +357 -135
- package/dist/commands/ps.js.map +1 -1
- package/dist/commands/queue.d.ts +6 -0
- package/dist/commands/queue.d.ts.map +1 -1
- package/dist/commands/queue.js +154 -4
- package/dist/commands/queue.js.map +1 -1
- package/dist/commands/reconcile-session.d.ts.map +1 -1
- package/dist/commands/reconcile-session.js +2 -2
- package/dist/commands/reconcile-session.js.map +1 -1
- package/dist/commands/restore-check.d.ts.map +1 -1
- package/dist/commands/restore-check.js +93 -0
- package/dist/commands/restore-check.js.map +1 -1
- package/dist/commands/scope.d.ts.map +1 -1
- package/dist/commands/scope.js +191 -4
- package/dist/commands/scope.js.map +1 -1
- package/dist/commands/seat.d.ts +17 -0
- package/dist/commands/seat.d.ts.map +1 -1
- package/dist/commands/seat.js +145 -32
- package/dist/commands/seat.js.map +1 -1
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +161 -11
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/start.d.ts +5 -0
- package/dist/commands/start.d.ts.map +1 -1
- package/dist/commands/start.js.map +1 -1
- package/dist/commands/startup-proof.d.ts +24 -0
- package/dist/commands/startup-proof.d.ts.map +1 -0
- package/dist/commands/startup-proof.js +100 -0
- package/dist/commands/startup-proof.js.map +1 -0
- package/dist/commands/unclaim.js +2 -2
- package/dist/commands/unclaim.js.map +1 -1
- package/dist/commands/up.d.ts +2 -0
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +79 -2
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/watchdog.js +2 -2
- package/dist/commands/watchdog.js.map +1 -1
- package/dist/commands/workspace.js +6 -6
- package/dist/commands/workspace.js.map +1 -1
- package/dist/config-store.d.ts +4 -0
- package/dist/config-store.d.ts.map +1 -1
- package/dist/config-store.js +68 -0
- package/dist/config-store.js.map +1 -1
- package/dist/cross-host-executor.d.ts +1 -0
- package/dist/cross-host-executor.d.ts.map +1 -1
- package/dist/cross-host-executor.js +4 -1
- package/dist/cross-host-executor.js.map +1 -1
- package/dist/daemon-lifecycle.d.ts +23 -0
- package/dist/daemon-lifecycle.d.ts.map +1 -1
- package/dist/daemon-lifecycle.js +54 -6
- package/dist/daemon-lifecycle.js.map +1 -1
- package/dist/host-registry.d.ts +9 -0
- package/dist/host-registry.d.ts.map +1 -1
- package/dist/host-registry.js +32 -2
- package/dist/host-registry.js.map +1 -1
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/codex-auth.d.ts +24 -0
- package/dist/lib/codex-auth.d.ts.map +1 -1
- package/dist/lib/codex-auth.js +89 -17
- package/dist/lib/codex-auth.js.map +1 -1
- package/dist/lib/file-transfer.d.ts +89 -0
- package/dist/lib/file-transfer.d.ts.map +1 -0
- package/dist/lib/file-transfer.js +300 -0
- package/dist/lib/file-transfer.js.map +1 -0
- package/dist/lib/hosts/fanout-contract.d.ts +33 -0
- package/dist/lib/hosts/fanout-contract.d.ts.map +1 -0
- package/dist/lib/hosts/fanout-contract.js +23 -0
- package/dist/lib/hosts/fanout-contract.js.map +1 -0
- package/dist/lib/scope/scope-audit.d.ts +11 -1
- package/dist/lib/scope/scope-audit.d.ts.map +1 -1
- package/dist/lib/scope/scope-audit.js +203 -2
- package/dist/lib/scope/scope-audit.js.map +1 -1
- package/dist/lib/scope/templates.d.ts +1 -0
- package/dist/lib/scope/templates.d.ts.map +1 -1
- package/dist/lib/scope/templates.js +9 -0
- package/dist/lib/scope/templates.js.map +1 -1
- package/dist/lib/scope-templates/backlog-deprecation.md +16 -0
- package/dist/lib/scope-templates/backlog-tech-debt.md +16 -0
- package/dist/lib/scope-templates/bug-fix.md +16 -0
- package/dist/lib/scope-templates/implementation-prd.md +33 -0
- package/dist/lib/scope-templates/mission-placeholder.md +41 -0
- package/dist/lib/scope-templates/mission-progress.md +2 -0
- package/dist/lib/scope-templates/mission-release.md +41 -0
- package/dist/lib/scope-templates/placeholder.md +12 -4
- package/dist/lib/scope-templates/proof.md +6 -0
- package/dist/lib/scope-templates/release-feature.md +14 -6
- package/dist/lib/scope-templates/research.md +16 -0
- package/dist/lib/scope-templates/slice-progress.md +2 -0
- package/dist/openrig-compat.d.ts +19 -0
- package/dist/openrig-compat.d.ts.map +1 -1
- package/dist/openrig-compat.js +31 -1
- package/dist/openrig-compat.js.map +1 -1
- package/dist/version.d.ts +5 -0
- package/dist/version.d.ts.map +1 -1
- package/dist/version.js +11 -1
- package/dist/version.js.map +1 -1
- package/package.json +1 -1
- package/ui/dist/assets/index-D69ZhNIr.js +598 -0
- package/ui/dist/assets/index-DJYun-8d.css +32 -0
- package/ui/dist/index.html +23 -2
- package/ui/dist/assets/index-CnqRX7A3.css +0 -32
- package/ui/dist/assets/index-CtL9jXFt.js +0 -582
|
@@ -145,26 +145,11 @@ export class RigTeardownOrchestrator {
|
|
|
145
145
|
type: "rig.deleted", rigId, seq: persistedSeq, createdAt: persistedAt,
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
|
-
/** Get latest session per node, filtered to live statuses
|
|
148
|
+
/** Get latest session per node, filtered to live statuses.
|
|
149
|
+
* OPR.0.4.3.20 FR-4 — delegates to the shared SessionRegistry method so the
|
|
150
|
+
* teardown pre-down path and the periodic/manual snapshot refresh share ONE query. */
|
|
149
151
|
getLatestLiveSessions(rigId) {
|
|
150
|
-
|
|
151
|
-
SELECT n.id as node_id, s.id as session_id, s.session_name, s.status, n.runtime, n.cwd, s.resume_type, s.resume_token
|
|
152
|
-
FROM nodes n
|
|
153
|
-
JOIN sessions s ON s.node_id = n.id
|
|
154
|
-
WHERE n.rig_id = ?
|
|
155
|
-
AND s.id = (SELECT s2.id FROM sessions s2 WHERE s2.node_id = n.id ORDER BY s2.created_at DESC, s2.id DESC LIMIT 1)
|
|
156
|
-
AND s.status IN ('running', 'idle', 'unknown')
|
|
157
|
-
`).all(rigId);
|
|
158
|
-
return rows.map((r) => ({
|
|
159
|
-
nodeId: r.node_id,
|
|
160
|
-
sessionId: r.session_id,
|
|
161
|
-
sessionName: r.session_name,
|
|
162
|
-
status: r.status,
|
|
163
|
-
runtime: r.runtime,
|
|
164
|
-
resumeType: r.resume_type,
|
|
165
|
-
resumeToken: r.resume_token,
|
|
166
|
-
cwd: r.cwd,
|
|
167
|
-
}));
|
|
152
|
+
return this.deps.sessionRegistry.getLatestLiveSessions(rigId);
|
|
168
153
|
}
|
|
169
154
|
cleanupManagedGuidanceFiles(rigId) {
|
|
170
155
|
const rows = this.db.prepare(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rig-teardown.js","sourceRoot":"","sources":["../../src/domain/rig-teardown.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,O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C,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC;YAClD,SAAS,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC;YACtE,UAAU,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC;SAC1C,EAAE,UAAU,CAAC,CAAC;IACjB,CAAC;CACF"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { MiddlewareHandler } from "hono";
|
|
2
|
+
/**
|
|
3
|
+
* OPR.0.4.3.21 — request-duration accounting for the EXPENSIVE topology
|
|
4
|
+
* routes only (rigs summary/graph, per-rig nodes, ps). These are the densest
|
|
5
|
+
* synchronous-CPU handlers (per-rig getNodeInventory fan-out, tmux
|
|
6
|
+
* attachAgentActivity) and are the prime suspects when the event loop starves.
|
|
7
|
+
*
|
|
8
|
+
* Reuse-first (ponytail): one lightweight `app.use` middleware, in-memory
|
|
9
|
+
* rolling last/max per route label, surfaced on the existing `/healthz`
|
|
10
|
+
* payload. No new route, no new store, no persistence. Cheap routes are NOT
|
|
11
|
+
* measured (label === null → the middleware is a no-op for them).
|
|
12
|
+
*/
|
|
13
|
+
export interface RouteTiming {
|
|
14
|
+
/** Duration of the most recent request to this route (ms). */
|
|
15
|
+
lastMs: number;
|
|
16
|
+
/** Largest duration observed for this route (ms) since boot. */
|
|
17
|
+
maxMs: number;
|
|
18
|
+
/** Number of requests observed for this route since boot. */
|
|
19
|
+
count: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Classify a request into a stable expensive-route label, or null when the
|
|
23
|
+
* route is not one we account for. Pure so the labeling is unit-provable.
|
|
24
|
+
*
|
|
25
|
+
* Grounded at 719a059e (IMPL-SPEC §1.4):
|
|
26
|
+
* - GET /api/rigs/summary (rigs.ts:163 per-rig getNodeInventory)
|
|
27
|
+
* - GET /api/rigs/:id/graph (rigs.ts:205 attachAgentActivity tmux fan-out)
|
|
28
|
+
* - GET /api/rigs/:id/nodes (sessions.ts:82 per-node enrichment)
|
|
29
|
+
* - GET /api/ps (ps-projection.ts:151 N+1 inventory)
|
|
30
|
+
*/
|
|
31
|
+
export declare function expensiveRouteLabel(method: string, path: string): string | null;
|
|
32
|
+
export declare class RouteTimingRecorder {
|
|
33
|
+
private readonly timings;
|
|
34
|
+
record(label: string, durationMs: number): void;
|
|
35
|
+
snapshot(): Record<string, RouteTiming>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The single timing middleware. Measures wall-clock around `next()` and
|
|
39
|
+
* records ONLY when the request maps to an expensive route label.
|
|
40
|
+
*/
|
|
41
|
+
export declare function createRouteTimingMiddleware(recorder: RouteTimingRecorder): MiddlewareHandler;
|
|
42
|
+
//# sourceMappingURL=route-timing-recorder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-timing-recorder.d.ts","sourceRoot":"","sources":["../../src/domain/route-timing-recorder.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,MAAM,CAAC;AAE9C;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,WAAW;IAC1B,8DAA8D;IAC9D,MAAM,EAAE,MAAM,CAAC;IACf,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAS/E;AAED,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkC;IAE1D,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI;IAW/C,QAAQ,IAAI,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC;CAKxC;AAED;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,mBAAmB,GAAG,iBAAiB,CAc5F"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { performance } from "node:perf_hooks";
|
|
2
|
+
/**
|
|
3
|
+
* Classify a request into a stable expensive-route label, or null when the
|
|
4
|
+
* route is not one we account for. Pure so the labeling is unit-provable.
|
|
5
|
+
*
|
|
6
|
+
* Grounded at 719a059e (IMPL-SPEC §1.4):
|
|
7
|
+
* - GET /api/rigs/summary (rigs.ts:163 per-rig getNodeInventory)
|
|
8
|
+
* - GET /api/rigs/:id/graph (rigs.ts:205 attachAgentActivity tmux fan-out)
|
|
9
|
+
* - GET /api/rigs/:id/nodes (sessions.ts:82 per-node enrichment)
|
|
10
|
+
* - GET /api/ps (ps-projection.ts:151 N+1 inventory)
|
|
11
|
+
*/
|
|
12
|
+
export function expensiveRouteLabel(method, path) {
|
|
13
|
+
if (method !== "GET")
|
|
14
|
+
return null;
|
|
15
|
+
if (path === "/api/ps")
|
|
16
|
+
return "GET /api/ps";
|
|
17
|
+
if (path === "/api/rigs/summary")
|
|
18
|
+
return "GET /api/rigs/summary";
|
|
19
|
+
// /api/rigs/:id/graph and /api/rigs/:id/nodes — a single dynamic segment
|
|
20
|
+
// between /api/rigs/ and the trailing verb.
|
|
21
|
+
const rigsMatch = /^\/api\/rigs\/[^/]+\/(graph|nodes)$/.exec(path);
|
|
22
|
+
if (rigsMatch)
|
|
23
|
+
return `GET /api/rigs/:id/${rigsMatch[1]}`;
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
export class RouteTimingRecorder {
|
|
27
|
+
timings = new Map();
|
|
28
|
+
record(label, durationMs) {
|
|
29
|
+
const existing = this.timings.get(label);
|
|
30
|
+
if (!existing) {
|
|
31
|
+
this.timings.set(label, { lastMs: durationMs, maxMs: durationMs, count: 1 });
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
existing.lastMs = durationMs;
|
|
35
|
+
existing.maxMs = Math.max(existing.maxMs, durationMs);
|
|
36
|
+
existing.count += 1;
|
|
37
|
+
}
|
|
38
|
+
snapshot() {
|
|
39
|
+
return Object.fromEntries([...this.timings.entries()].map(([label, t]) => [label, { ...t }]));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* The single timing middleware. Measures wall-clock around `next()` and
|
|
44
|
+
* records ONLY when the request maps to an expensive route label.
|
|
45
|
+
*/
|
|
46
|
+
export function createRouteTimingMiddleware(recorder) {
|
|
47
|
+
return async (c, next) => {
|
|
48
|
+
const label = expensiveRouteLabel(c.req.method, c.req.path);
|
|
49
|
+
if (!label) {
|
|
50
|
+
await next();
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const startedAt = performance.now();
|
|
54
|
+
try {
|
|
55
|
+
await next();
|
|
56
|
+
}
|
|
57
|
+
finally {
|
|
58
|
+
recorder.record(label, performance.now() - startedAt);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=route-timing-recorder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route-timing-recorder.js","sourceRoot":"","sources":["../../src/domain/route-timing-recorder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAwB9C;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CAAC,MAAc,EAAE,IAAY;IAC9D,IAAI,MAAM,KAAK,KAAK;QAAE,OAAO,IAAI,CAAC;IAClC,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,aAAa,CAAC;IAC7C,IAAI,IAAI,KAAK,mBAAmB;QAAE,OAAO,uBAAuB,CAAC;IACjE,yEAAyE;IACzE,4CAA4C;IAC5C,MAAM,SAAS,GAAG,qCAAqC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACnE,IAAI,SAAS;QAAE,OAAO,qBAAqB,S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AM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE,CAAC;QACpC,IAAI,CAAC;YACH,MAAM,IAAI,EAAE,CAAC;QACf,CAAC;gBAAS,CAAC;YACT,QAAQ,CAAC,MAAM,CAAC,KAAK,EAAE,WAAW,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,CAAC;QACxD,CAAC;IACH,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { MissionControlActionLog } from "../mission-control/mission-control-action-log.js";
|
|
2
|
+
export type ScopeTier = "slice" | "mission";
|
|
3
|
+
export type ApprovalScope = "spec" | "delivery";
|
|
4
|
+
export interface ScopeApproveInput {
|
|
5
|
+
scopeTier: ScopeTier;
|
|
6
|
+
/** Canonical missions-root-relative path (e.g.
|
|
7
|
+
* "release-0.4.4/slices/19-living-notes-signal-layer" or "release-0.4.4"). */
|
|
8
|
+
scopePath: string;
|
|
9
|
+
/** STAGED APPROVAL (founder un-deferred): `spec` = "the PRD matches my
|
|
10
|
+
* intent" (the first accept-point); `delivery` = the terminal sign-off
|
|
11
|
+
* (the freeze trigger). Omitted upstream ⇒ delivery (back-compat). */
|
|
12
|
+
approvalScope: ApprovalScope;
|
|
13
|
+
/** The REAL invoking session (honest provenance — never overwritten by
|
|
14
|
+
* delegation). */
|
|
15
|
+
actorSession: string;
|
|
16
|
+
/** DELEGATED APPROVAL: whose decision this stamp records when an agent
|
|
17
|
+
* invokes on the founder's behalf. Recorded in the audit notes only. */
|
|
18
|
+
onBehalfOf?: string | null;
|
|
19
|
+
}
|
|
20
|
+
export interface ScopeApproveResult {
|
|
21
|
+
scopeTier: ScopeTier;
|
|
22
|
+
scopeId: string;
|
|
23
|
+
scopePath: string;
|
|
24
|
+
approvalScope: ApprovalScope;
|
|
25
|
+
approvedBy: string;
|
|
26
|
+
approvedAt: string;
|
|
27
|
+
onBehalfOf: string | null;
|
|
28
|
+
actionId: string;
|
|
29
|
+
/** Packet-2 interface cell: only the DELIVERY stamp fires the freeze; the
|
|
30
|
+
* compose-and-freeze endpoint ships in Packet 2, so P1 always reports
|
|
31
|
+
* false. The stamp + audit row stand regardless of any render outcome. */
|
|
32
|
+
freezeFired: false;
|
|
33
|
+
}
|
|
34
|
+
export declare class ScopeApproveError extends Error {
|
|
35
|
+
readonly code: string;
|
|
36
|
+
readonly details?: Record<string, unknown> | undefined;
|
|
37
|
+
constructor(code: string, message: string, details?: Record<string, unknown> | undefined);
|
|
38
|
+
}
|
|
39
|
+
/** The pinned audit_notes_json shape (spec-guard blocker 2): a stable,
|
|
40
|
+
* queryable scope-target identity + the approval scope + delegation
|
|
41
|
+
* provenance. The audit-browse read path filters on these keys — the pair
|
|
42
|
+
* is what makes Packet 2's one-query UNVERIFIED-stamp cross-check real. */
|
|
43
|
+
export interface ScopeApprovalAuditNotes extends Record<string, unknown> {
|
|
44
|
+
kind: "scope-approval";
|
|
45
|
+
scope_tier: ScopeTier;
|
|
46
|
+
scope_id: string;
|
|
47
|
+
scope_path: string;
|
|
48
|
+
approval_scope: ApprovalScope;
|
|
49
|
+
on_behalf_of: string | null;
|
|
50
|
+
}
|
|
51
|
+
interface ScopeApproveDeps {
|
|
52
|
+
/** Resolves the live missions root (SliceIndexer.slicesRoot), or null when
|
|
53
|
+
* the workspace is not configured. */
|
|
54
|
+
missionsRoot: () => string | null;
|
|
55
|
+
actionLog: MissionControlActionLog;
|
|
56
|
+
now?: () => Date;
|
|
57
|
+
}
|
|
58
|
+
export declare class ScopeApproveService {
|
|
59
|
+
private readonly deps;
|
|
60
|
+
constructor(deps: ScopeApproveDeps);
|
|
61
|
+
approve(input: ScopeApproveInput): ScopeApproveResult;
|
|
62
|
+
}
|
|
63
|
+
export {};
|
|
64
|
+
//# sourceMappingURL=scope-approve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope-approve.d.ts","sourceRoot":"","sources":["../../../src/domain/scope/scope-approve.ts"],"names":[],"mappings":"AAqBA,OAAO,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CAAC;IAC9B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAOD,UAAU,gBAAgB;IACxB;2CACuC;IACvC,YAAY,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAClC,SAAS,EAAE,uBAAuB,CAAC;IACnC,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;CAClB;AAED,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmB;gBAE5B,IAAI,EAAE,gBAAgB;IAIlC,OAAO,CAAC,KAAK,EAAE,iBAAiB,GAAG,kBAAkB;CAoHtD"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
// OPR.0.4.4.19 FR-9 — scope approve: frontmatter sole-writer + append-only
|
|
2
|
+
// audit row (kills vibe-shuttled approval).
|
|
3
|
+
//
|
|
4
|
+
// Daemon-side by design (plan-review CONFIRMED; arch-lead interface-cell
|
|
5
|
+
// PASS): the stamp is a workspace frontmatter write, the audit row is a
|
|
6
|
+
// mission_control_actions insert, and the freeze-trigger interface cell
|
|
7
|
+
// (Packet 2) invokes the compose-and-freeze endpoint AFTER the stamp+audit
|
|
8
|
+
// commit — so the stamp+audit pair lives behind ONE daemon operation.
|
|
9
|
+
//
|
|
10
|
+
// Ordering (arch-lead PIN, 2026-07-04): frontmatter-first → audit-second →
|
|
11
|
+
// on audit failure LOUD-FAIL + byte-restore the prior frontmatter. The
|
|
12
|
+
// compensating-DELETE variant is REJECTED — no row is ever deleted from
|
|
13
|
+
// mission_control_actions; append-only stands.
|
|
14
|
+
//
|
|
15
|
+
// Two-regime role clarity (BR-6, ratified): approval is the freeze/LOCKED
|
|
16
|
+
// trigger and the regime-2 sign-off — it is NEVER the source of proven-green.
|
|
17
|
+
// Nothing here computes or stores "green".
|
|
18
|
+
import * as fs from "node:fs";
|
|
19
|
+
import * as path from "node:path";
|
|
20
|
+
import YAML from "yaml";
|
|
21
|
+
export class ScopeApproveError extends Error {
|
|
22
|
+
code;
|
|
23
|
+
details;
|
|
24
|
+
constructor(code, message, details) {
|
|
25
|
+
super(message);
|
|
26
|
+
this.code = code;
|
|
27
|
+
this.details = details;
|
|
28
|
+
this.name = "ScopeApproveError";
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const STAMP_FIELDS = {
|
|
32
|
+
delivery: { by: "approved-by", at: "approved-at" },
|
|
33
|
+
spec: { by: "approved-spec-by", at: "approved-spec-at" },
|
|
34
|
+
};
|
|
35
|
+
export class ScopeApproveService {
|
|
36
|
+
deps;
|
|
37
|
+
constructor(deps) {
|
|
38
|
+
this.deps = deps;
|
|
39
|
+
}
|
|
40
|
+
approve(input) {
|
|
41
|
+
const missionsRoot = this.deps.missionsRoot();
|
|
42
|
+
if (!missionsRoot) {
|
|
43
|
+
throw new ScopeApproveError("workspace_not_configured", "The daemon has no missions root configured; scope approve needs the workspace primitive.");
|
|
44
|
+
}
|
|
45
|
+
// Path containment: the scope path must resolve INSIDE the missions root
|
|
46
|
+
// (content-surfaces discipline — no ../ escapes).
|
|
47
|
+
const resolved = path.resolve(missionsRoot, input.scopePath);
|
|
48
|
+
if (resolved !== missionsRoot && !resolved.startsWith(missionsRoot + path.sep)) {
|
|
49
|
+
throw new ScopeApproveError("scope_path_escape", `scopePath '${input.scopePath}' resolves outside the missions root.`, { scopePath: input.scopePath });
|
|
50
|
+
}
|
|
51
|
+
const readmePath = path.join(resolved, "README.md");
|
|
52
|
+
if (!fs.existsSync(readmePath)) {
|
|
53
|
+
throw new ScopeApproveError("scope_not_found", `No README.md at ${input.scopePath} under the missions root — not a declared ${input.scopeTier}.`, { scopePath: input.scopePath, scopeTier: input.scopeTier });
|
|
54
|
+
}
|
|
55
|
+
const originalBytes = fs.readFileSync(readmePath, "utf8");
|
|
56
|
+
const frontmatter = parseFrontmatter(originalBytes);
|
|
57
|
+
const scopeId = typeof frontmatter["id"] === "string" && frontmatter["id"].trim().length > 0
|
|
58
|
+
? frontmatter["id"]
|
|
59
|
+
: null;
|
|
60
|
+
if (!scopeId) {
|
|
61
|
+
throw new ScopeApproveError("scope_id_missing", `${input.scopePath} has no frontmatter id (dot-ID) — the audit target contract requires a stable scope_id.`, { scopePath: input.scopePath, action: "Run: rig scope " + input.scopeTier + " reconcile <path> to mint the id, then re-approve." });
|
|
62
|
+
}
|
|
63
|
+
// Re-stamp at the SAME scope fails loudly naming the existing stamp
|
|
64
|
+
// (no silent re-stamp; un-approve/re-approve is out of scope v1). A
|
|
65
|
+
// spec stamp followed by a delivery stamp is the normal staged sequence.
|
|
66
|
+
const fields = STAMP_FIELDS[input.approvalScope];
|
|
67
|
+
const existingBy = frontmatter[fields.by];
|
|
68
|
+
if (typeof existingBy === "string" && existingBy.trim().length > 0) {
|
|
69
|
+
throw new ScopeApproveError("already_approved", `${input.scopePath} already carries a ${input.approvalScope} approval stamp: ${fields.by}: ${existingBy}, ${fields.at}: ${String(frontmatter[fields.at] ?? "?")}. Re-approval after un-approval is out of scope v1.`, { scopePath: input.scopePath, approvalScope: input.approvalScope, existingBy, existingAt: frontmatter[fields.at] ?? null });
|
|
70
|
+
}
|
|
71
|
+
const approvedAt = (this.deps.now?.() ?? new Date()).toISOString();
|
|
72
|
+
// 1. Frontmatter FIRST (the arch-pinned ordering).
|
|
73
|
+
const updated = writeFrontmatterFields(originalBytes, {
|
|
74
|
+
[fields.by]: input.actorSession,
|
|
75
|
+
[fields.at]: approvedAt,
|
|
76
|
+
});
|
|
77
|
+
fs.writeFileSync(readmePath, updated, "utf8");
|
|
78
|
+
// 2. Audit SECOND. On failure: byte-restore the prior frontmatter and
|
|
79
|
+
// fail loudly — a failed audit write can never leave a trusted half-stamp
|
|
80
|
+
// (QA plan-review guardrail), and no audit row is ever deleted.
|
|
81
|
+
const scopePathCanonical = path.relative(missionsRoot, resolved).split(path.sep).join("/");
|
|
82
|
+
const auditNotes = {
|
|
83
|
+
kind: "scope-approval",
|
|
84
|
+
scope_tier: input.scopeTier,
|
|
85
|
+
scope_id: scopeId,
|
|
86
|
+
scope_path: scopePathCanonical,
|
|
87
|
+
approval_scope: input.approvalScope,
|
|
88
|
+
on_behalf_of: input.onBehalfOf ?? null,
|
|
89
|
+
};
|
|
90
|
+
let actionId;
|
|
91
|
+
try {
|
|
92
|
+
const entry = this.deps.actionLog.record({
|
|
93
|
+
actionVerb: "approve",
|
|
94
|
+
qitemId: null, // scope approvals are NOT qitem actions
|
|
95
|
+
actorSession: input.actorSession,
|
|
96
|
+
actedAt: approvedAt,
|
|
97
|
+
reason: input.onBehalfOf
|
|
98
|
+
? `scope-approval (${input.approvalScope}) on behalf of ${input.onBehalfOf}`
|
|
99
|
+
: `scope-approval (${input.approvalScope})`,
|
|
100
|
+
auditNotes,
|
|
101
|
+
});
|
|
102
|
+
actionId = entry.actionId;
|
|
103
|
+
}
|
|
104
|
+
catch (err) {
|
|
105
|
+
fs.writeFileSync(readmePath, originalBytes, "utf8");
|
|
106
|
+
throw new ScopeApproveError("audit_write_failed", `The approval audit row could not be written; the frontmatter stamp was restored to its prior state (no half-stamp). Cause: ${err instanceof Error ? err.message : String(err)}`, { scopePath: input.scopePath, approvalScope: input.approvalScope });
|
|
107
|
+
}
|
|
108
|
+
// 3. Freeze-trigger interface cell (Packet 2): the DELIVERY stamp will
|
|
109
|
+
// synchronously invoke the ONE compose-and-freeze endpoint AFTER this
|
|
110
|
+
// point. The endpoint does not exist at P1; when it lands, a failed
|
|
111
|
+
// render never un-approves and never half-stamps — the stamp + audit
|
|
112
|
+
// row above stand regardless of the render outcome.
|
|
113
|
+
return {
|
|
114
|
+
scopeTier: input.scopeTier,
|
|
115
|
+
scopeId,
|
|
116
|
+
scopePath: scopePathCanonical,
|
|
117
|
+
approvalScope: input.approvalScope,
|
|
118
|
+
approvedBy: input.actorSession,
|
|
119
|
+
approvedAt,
|
|
120
|
+
onBehalfOf: input.onBehalfOf ?? null,
|
|
121
|
+
actionId,
|
|
122
|
+
freezeFired: false,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
// ——— frontmatter helpers (daemon-side mirror of the CLI scope-fs shape:
|
|
127
|
+
// hand-rolled split + YAML.parse, safe-by-default per PRD §4 leg 2) ———
|
|
128
|
+
function parseFrontmatter(content) {
|
|
129
|
+
if (!content.startsWith("---"))
|
|
130
|
+
return {};
|
|
131
|
+
const match = /^---\s*\n([\s\S]*?)\n---/.exec(content);
|
|
132
|
+
if (!match)
|
|
133
|
+
return {};
|
|
134
|
+
try {
|
|
135
|
+
const parsed = YAML.parse(match[1]);
|
|
136
|
+
return parsed && typeof parsed === "object" ? parsed : {};
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
return {};
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
function writeFrontmatterFields(content, fields) {
|
|
143
|
+
const match = /^---\s*\n([\s\S]*?)\n---/.exec(content);
|
|
144
|
+
if (match) {
|
|
145
|
+
const existing = parseFrontmatter(content);
|
|
146
|
+
const merged = { ...existing, ...fields };
|
|
147
|
+
const yaml = YAML.stringify(merged).trimEnd();
|
|
148
|
+
return content.replace(/^---\s*\n[\s\S]*?\n---/, `---\n${yaml}\n---`);
|
|
149
|
+
}
|
|
150
|
+
const yaml = YAML.stringify(fields).trimEnd();
|
|
151
|
+
return `---\n${yaml}\n---\n\n${content}`;
|
|
152
|
+
}
|
|
153
|
+
//# sourceMappingURL=scope-approve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scope-approve.js","sourceRoot":"","sources":["../../../src/domain/scope/scope-approve.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,4CAA4C;AAC5C,EAAE;AACF,yEAAyE;AACzE,wEAAwE;AACxE,wEAAwE;AACxE,2EAA2E;AAC3E,sEAAsE;AACtE,EAAE;AACF,2EAA2E;AAC3E,uEAAuE;AACvE,wEAAwE;AACxE,+CAA+C;AAC/C,EAAE;AACF,0EAA0E;AAC1E,8EAA8E;AAC9E,2CAA2C;AAE3C,OAAO,KAAK,EAAE,MAAM,SAAS,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type RailStatus = "present" | "missing" | "malformed" | "readme-only";
|
|
2
2
|
export type FindingSeverity = "high" | "medium" | "low" | "info";
|
|
3
|
-
export type FindingKind = "missing_progress" | "registration_ghost" | "missing_id" | "id_convention_violation" | "orphan_progress" | "missing_mission_brief" | "malformed_mission_brief" | "missing_mission_notes" | "missing_proof";
|
|
3
|
+
export type FindingKind = "missing_progress" | "registration_ghost" | "missing_id" | "id_convention_violation" | "orphan_progress" | "missing_mission_brief" | "malformed_mission_brief" | "missing_mission_notes" | "missing_proof" | "progress_not_updated_on_commit" | "proof_artifact_c1_invalid" | "missing_impl_prd" | "missing_intent_section" | "mini_requirements_missing_or_malformed" | "proof_contract_missing_or_malformed" | "ui_slice_missing_mockup";
|
|
4
4
|
export interface AuditFinding {
|
|
5
5
|
kind: FindingKind;
|
|
6
6
|
severity: FindingSeverity;
|
|
@@ -28,11 +28,21 @@ export interface ScopeAuditInput {
|
|
|
28
28
|
proofDirHasEntries?: boolean;
|
|
29
29
|
hasProofPacket?: boolean;
|
|
30
30
|
sliceStatus?: string | null;
|
|
31
|
+
sliceTouchedByRecentCommit?: boolean;
|
|
32
|
+
progressTouchedByRecentCommit?: boolean;
|
|
33
|
+
proofArtifacts?: Array<{
|
|
34
|
+
path: string;
|
|
35
|
+
frontmatterRaw: string | null;
|
|
36
|
+
}>;
|
|
37
|
+
implementationPrdExists?: boolean;
|
|
38
|
+
readmeContent?: string | null;
|
|
39
|
+
implementationPrdContent?: string | null;
|
|
31
40
|
}
|
|
32
41
|
export interface ScopeAuditResult {
|
|
33
42
|
railStatus: RailStatus;
|
|
34
43
|
findings: AuditFinding[];
|
|
35
44
|
frontmatterError: string | null;
|
|
36
45
|
}
|
|
46
|
+
export declare const MISSION_BRIEF_HEADERS: string[];
|
|
37
47
|
export declare function classifyScopeItem(input: ScopeAuditInput): ScopeAuditResult;
|
|
38
48
|
//# sourceMappingURL=scope-audit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-audit.d.ts","sourceRoot":"","sources":["../../../src/domain/scope/scope-audit.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,aAAa,CAAC;AAC7E,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;AACjE,MAAM,MAAM,WAAW,GACnB,kBAAkB,GAClB,oBAAoB,GACpB,YAAY,GACZ,yBAAyB,GACzB,iBAAiB,GACjB,uBAAuB,GACvB,yBAAyB,GACzB,uBAAuB,GACvB,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"scope-audit.d.ts","sourceRoot":"","sources":["../../../src/domain/scope/scope-audit.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,SAAS,GAAG,WAAW,GAAG,aAAa,CAAC;AAC7E,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,KAAK,GAAG,MAAM,CAAC;AACjE,MAAM,MAAM,WAAW,GACnB,kBAAkB,GAClB,oBAAoB,GACpB,YAAY,GACZ,yBAAyB,GACzB,iBAAiB,GACjB,uBAAuB,GACvB,yBAAyB,GACzB,uBAAuB,GACvB,eAAe,GACf,gCAAgC,GAGhC,2BAA2B,GAC3B,kBAAkB,GAIlB,wBAAwB,GACxB,wCAAwC,GACxC,qCAAqC,GACrC,yBAAyB,CAAC;AAE9B,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,EAAE,eAAe,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,GAAG,IAAI,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,kBAAkB,EAA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