harnery 0.32.0 → 0.34.0
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 +2 -0
- package/dist/commander.d.ts.map +1 -1
- package/dist/commander.js +7 -1
- package/dist/commands/adapter.js +2 -2
- package/dist/commands/agents.d.ts +144 -1
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +1408 -565
- package/dist/commands/artifacts.d.ts.map +1 -1
- package/dist/commands/artifacts.js +7 -6
- package/dist/commands/backup.d.ts +1 -1
- package/dist/commands/backup.d.ts.map +1 -1
- package/dist/commands/backup.js +29 -16
- package/dist/commands/browse.d.ts.map +1 -1
- package/dist/commands/browse.js +234 -12
- package/dist/commands/checkpoint.d.ts.map +1 -1
- package/dist/commands/checkpoint.js +3 -2
- package/dist/commands/claude-desktop.d.ts +2 -2
- package/dist/commands/claude-desktop.d.ts.map +1 -1
- package/dist/commands/claude-desktop.js +2 -2
- package/dist/commands/context.js +1 -6
- package/dist/commands/decision.d.ts.map +1 -1
- package/dist/commands/decision.js +22 -38
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +91 -28
- package/dist/commands/doctor.d.ts +4 -2
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +55 -7
- package/dist/commands/events.d.ts +5 -0
- package/dist/commands/events.d.ts.map +1 -0
- package/dist/commands/events.js +189 -0
- package/dist/commands/governor.d.ts.map +1 -1
- package/dist/commands/governor.js +13 -4
- package/dist/commands/init.d.ts +10 -2
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +233 -51
- package/dist/commands/instructions.d.ts +4 -0
- package/dist/commands/instructions.d.ts.map +1 -0
- package/dist/commands/instructions.js +100 -0
- package/dist/commands/journal.d.ts.map +1 -1
- package/dist/commands/journal.js +4 -13
- package/dist/commands/ledger-v3.d.ts +5 -0
- package/dist/commands/ledger-v3.d.ts.map +1 -0
- package/dist/commands/ledger-v3.js +91 -0
- package/dist/commands/presence.d.ts.map +1 -1
- package/dist/commands/presence.js +15 -6
- package/dist/commands/sync.d.ts +1 -1
- package/dist/commands/sync.js +1 -1
- package/dist/commands/web.d.ts +6 -0
- package/dist/commands/web.d.ts.map +1 -1
- package/dist/commands/web.js +67 -7
- package/dist/commands/work.d.ts.map +1 -1
- package/dist/commands/work.js +22 -5
- package/dist/core/adapter.d.ts +5 -0
- package/dist/core/adapter.d.ts.map +1 -0
- package/dist/core/adapter.js +1 -0
- package/dist/core/adapters/attest.d.ts +5 -2
- package/dist/core/adapters/attest.d.ts.map +1 -1
- package/dist/core/adapters/attest.js +8 -3
- package/dist/core/adapters/profiles.d.ts +6 -6
- package/dist/core/adapters/profiles.d.ts.map +1 -1
- package/dist/core/adapters/profiles.js +4 -4
- package/dist/core/agents/canonical-emit.d.ts +17 -15
- package/dist/core/agents/canonical-emit.d.ts.map +1 -1
- package/dist/core/agents/canonical-emit.js +27 -25
- package/dist/core/agents/cli.js +212 -235
- package/dist/core/agents/codex-archive-v3.d.ts +14 -0
- package/dist/core/agents/codex-archive-v3.d.ts.map +1 -0
- package/dist/core/agents/codex-archive-v3.js +110 -0
- package/dist/core/agents/coord-client.d.ts +19 -70
- package/dist/core/agents/coord-client.d.ts.map +1 -1
- package/dist/core/agents/coord-client.js +65 -155
- package/dist/core/agents/finalization.d.ts +4 -1
- package/dist/core/agents/finalization.d.ts.map +1 -1
- package/dist/core/agents/finalization.js +89 -32
- package/dist/core/agents/index.d.ts +5 -5
- package/dist/core/agents/index.d.ts.map +1 -1
- package/dist/core/agents/index.js +5 -5
- package/dist/core/agents/live-authority-v3.d.ts +59 -0
- package/dist/core/agents/live-authority-v3.d.ts.map +1 -0
- package/dist/core/agents/live-authority-v3.js +233 -0
- package/dist/core/agents/live-lifecycle-v3.d.ts +20 -0
- package/dist/core/agents/live-lifecycle-v3.d.ts.map +1 -0
- package/dist/core/agents/live-lifecycle-v3.js +91 -0
- package/dist/core/agents/live-observation-v3.d.ts +25 -0
- package/dist/core/agents/live-observation-v3.d.ts.map +1 -0
- package/dist/core/agents/live-observation-v3.js +157 -0
- package/dist/core/agents/render/prompt-context.d.ts +10 -4
- package/dist/core/agents/render/prompt-context.d.ts.map +1 -1
- package/dist/core/agents/render/prompt-context.js +61 -55
- package/dist/core/agents/render/session-context.d.ts +1 -1
- package/dist/core/agents/render/session-context.d.ts.map +1 -1
- package/dist/core/agents/render/session-context.js +15 -33
- package/dist/core/agents/rules/claim-conflict.d.ts +3 -3
- package/dist/core/agents/rules/claim-conflict.d.ts.map +1 -1
- package/dist/core/agents/rules/claim-conflict.js +79 -127
- package/dist/core/agents/rules/commit-conflict.d.ts.map +1 -1
- package/dist/core/agents/rules/commit-conflict.js +3 -18
- package/dist/core/agents/rules/stop-hook.d.ts +9 -50
- package/dist/core/agents/rules/stop-hook.d.ts.map +1 -1
- package/dist/core/agents/rules/stop-hook.js +193 -236
- package/dist/core/agents/session-events.d.ts +5 -7
- package/dist/core/agents/session-events.d.ts.map +1 -1
- package/dist/core/agents/session-events.js +127 -95
- package/dist/core/agents/session-finalization-state-v3.d.ts +30 -0
- package/dist/core/agents/session-finalization-state-v3.d.ts.map +1 -0
- package/dist/core/agents/session-finalization-state-v3.js +40 -0
- package/dist/core/agents/session-finalizer-v3.d.ts +107 -0
- package/dist/core/agents/session-finalizer-v3.d.ts.map +1 -0
- package/dist/core/agents/session-finalizer-v3.js +734 -0
- package/dist/core/agents/session-name-display.d.ts +40 -0
- package/dist/core/agents/session-name-display.d.ts.map +1 -0
- package/dist/core/agents/session-name-display.js +119 -0
- package/dist/core/agents/state/activity-log.d.ts +3 -3
- package/dist/core/agents/state/activity-log.d.ts.map +1 -1
- package/dist/core/agents/state/activity-log.js +7 -16
- package/dist/core/agents/state/heartbeat-writer.d.ts +29 -46
- package/dist/core/agents/state/heartbeat-writer.d.ts.map +1 -1
- package/dist/core/agents/state/heartbeat-writer.js +59 -199
- package/dist/core/agents/state/live-coordination-view.d.ts +31 -0
- package/dist/core/agents/state/live-coordination-view.d.ts.map +1 -0
- package/dist/core/agents/state/live-coordination-view.js +209 -0
- package/dist/core/agents/state/session-state.d.ts +45 -0
- package/dist/core/agents/state/session-state.d.ts.map +1 -0
- package/dist/core/agents/state/session-state.js +90 -0
- package/dist/core/agents/state/stale-sweep.d.ts +1 -1
- package/dist/core/agents/state/stale-sweep.d.ts.map +1 -1
- package/dist/core/agents/state/stale-sweep.js +26 -15
- package/dist/core/artifacts/index.d.ts.map +1 -1
- package/dist/core/artifacts/index.js +5 -7
- package/dist/core/config.d.ts +33 -2
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +98 -2
- package/dist/core/context/index.d.ts +1 -4
- package/dist/core/context/index.d.ts.map +1 -1
- package/dist/core/context/index.js +9 -9
- package/dist/core/events/span-parent.d.ts +15 -0
- package/dist/core/events/span-parent.d.ts.map +1 -0
- package/dist/core/events/span-parent.js +34 -0
- package/dist/core/events/v3/advance.d.ts +14 -0
- package/dist/core/events/v3/advance.d.ts.map +1 -0
- package/dist/core/events/v3/advance.js +134 -0
- package/dist/core/events/v3/authority-outbox.d.ts +78 -0
- package/dist/core/events/v3/authority-outbox.d.ts.map +1 -0
- package/dist/core/events/v3/authority-outbox.js +399 -0
- package/dist/core/events/v3/base-builder.d.ts +20 -0
- package/dist/core/events/v3/base-builder.d.ts.map +1 -0
- package/dist/core/events/v3/base-builder.js +29 -0
- package/dist/core/events/v3/base-contract.d.ts +7576 -0
- package/dist/core/events/v3/base-contract.d.ts.map +1 -0
- package/dist/core/events/v3/base-contract.js +647 -0
- package/dist/core/events/v3/bootstrap.d.ts +34 -0
- package/dist/core/events/v3/bootstrap.d.ts.map +1 -0
- package/dist/core/events/v3/bootstrap.js +175 -0
- package/dist/core/events/v3/builder.d.ts +20 -0
- package/dist/core/events/v3/builder.d.ts.map +1 -0
- package/dist/core/events/v3/builder.js +28 -0
- package/dist/core/events/v3/canonical.d.ts +31 -0
- package/dist/core/events/v3/canonical.d.ts.map +1 -0
- package/dist/core/events/v3/canonical.js +100 -0
- package/dist/core/events/v3/capabilities.d.ts +31 -0
- package/dist/core/events/v3/capabilities.d.ts.map +1 -0
- package/dist/core/events/v3/capabilities.js +107 -0
- package/dist/core/events/v3/capability-drift.d.ts +22 -0
- package/dist/core/events/v3/capability-drift.d.ts.map +1 -0
- package/dist/core/events/v3/capability-drift.js +134 -0
- package/dist/core/events/v3/catalog.d.ts +38 -0
- package/dist/core/events/v3/catalog.d.ts.map +1 -0
- package/dist/core/events/v3/catalog.js +135 -0
- package/dist/core/events/v3/clock-order.d.ts +34 -0
- package/dist/core/events/v3/clock-order.d.ts.map +1 -0
- package/dist/core/events/v3/clock-order.js +35 -0
- package/dist/core/events/v3/contract.d.ts +171 -0
- package/dist/core/events/v3/contract.d.ts.map +1 -0
- package/dist/core/events/v3/contract.js +180 -0
- package/dist/core/events/v3/control.d.ts +111 -0
- package/dist/core/events/v3/control.d.ts.map +1 -0
- package/dist/core/events/v3/control.js +419 -0
- package/dist/core/events/v3/coordination-view.d.ts +69 -0
- package/dist/core/events/v3/coordination-view.d.ts.map +1 -0
- package/dist/core/events/v3/coordination-view.js +119 -0
- package/dist/core/events/v3/economics.d.ts +77 -0
- package/dist/core/events/v3/economics.d.ts.map +1 -0
- package/dist/core/events/v3/economics.js +274 -0
- package/dist/core/events/v3/finalization-view.d.ts +26 -0
- package/dist/core/events/v3/finalization-view.d.ts.map +1 -0
- package/dist/core/events/v3/finalization-view.js +37 -0
- package/dist/core/events/v3/fingerprint-keys.d.ts +25 -0
- package/dist/core/events/v3/fingerprint-keys.d.ts.map +1 -0
- package/dist/core/events/v3/fingerprint-keys.js +217 -0
- package/dist/core/events/v3/generated.d.ts +4 -0
- package/dist/core/events/v3/generated.d.ts.map +1 -0
- package/dist/core/events/v3/generated.js +47 -0
- package/dist/core/events/v3/ids.d.ts +9 -0
- package/dist/core/events/v3/ids.d.ts.map +1 -0
- package/dist/core/events/v3/ids.js +25 -0
- package/dist/core/events/v3/index.d.ts +35 -0
- package/dist/core/events/v3/index.d.ts.map +1 -0
- package/dist/core/events/v3/index.js +33 -0
- package/dist/core/events/v3/latency.d.ts +63 -0
- package/dist/core/events/v3/latency.d.ts.map +1 -0
- package/dist/core/events/v3/latency.js +412 -0
- package/dist/core/events/v3/live-feed.d.ts +45 -0
- package/dist/core/events/v3/live-feed.d.ts.map +1 -0
- package/dist/core/events/v3/live-feed.js +246 -0
- package/dist/core/events/v3/live-observation.d.ts +35 -0
- package/dist/core/events/v3/live-observation.d.ts.map +1 -0
- package/dist/core/events/v3/live-observation.js +1 -0
- package/dist/core/events/v3/live-routing.d.ts +57 -0
- package/dist/core/events/v3/live-routing.d.ts.map +1 -0
- package/dist/core/events/v3/live-routing.js +107 -0
- package/dist/core/events/v3/producers/command-recorder.d.ts +67 -0
- package/dist/core/events/v3/producers/command-recorder.d.ts.map +1 -0
- package/dist/core/events/v3/producers/command-recorder.js +477 -0
- package/dist/core/events/v3/producers/command.d.ts +50 -0
- package/dist/core/events/v3/producers/command.d.ts.map +1 -0
- package/dist/core/events/v3/producers/command.js +135 -0
- package/dist/core/events/v3/producers/coordination-recorder.d.ts +53 -0
- package/dist/core/events/v3/producers/coordination-recorder.d.ts.map +1 -0
- package/dist/core/events/v3/producers/coordination-recorder.js +376 -0
- package/dist/core/events/v3/producers/coordination.d.ts +90 -0
- package/dist/core/events/v3/producers/coordination.d.ts.map +1 -0
- package/dist/core/events/v3/producers/coordination.js +229 -0
- package/dist/core/events/v3/producers/hook-base.d.ts +54 -0
- package/dist/core/events/v3/producers/hook-base.d.ts.map +1 -0
- package/dist/core/events/v3/producers/hook-base.js +424 -0
- package/dist/core/events/v3/producers/hook.d.ts +29 -0
- package/dist/core/events/v3/producers/hook.d.ts.map +1 -0
- package/dist/core/events/v3/producers/hook.js +71 -0
- package/dist/core/events/v3/producers/intake.d.ts +65 -0
- package/dist/core/events/v3/producers/intake.d.ts.map +1 -0
- package/dist/core/events/v3/producers/intake.js +244 -0
- package/dist/core/events/v3/producers/recorder.d.ts +240 -0
- package/dist/core/events/v3/producers/recorder.d.ts.map +1 -0
- package/dist/core/events/v3/producers/recorder.js +2176 -0
- package/dist/core/events/v3/projection.d.ts +101 -0
- package/dist/core/events/v3/projection.d.ts.map +1 -0
- package/dist/core/events/v3/projection.js +479 -0
- package/dist/core/events/v3/reader.d.ts +75 -0
- package/dist/core/events/v3/reader.d.ts.map +1 -0
- package/dist/core/events/v3/reader.js +778 -0
- package/dist/core/events/v3/recovery-record.d.ts +47 -0
- package/dist/core/events/v3/recovery-record.d.ts.map +1 -0
- package/dist/core/events/v3/recovery-record.js +167 -0
- package/dist/core/events/v3/recovery.d.ts +22 -0
- package/dist/core/events/v3/recovery.d.ts.map +1 -0
- package/dist/core/events/v3/recovery.js +227 -0
- package/dist/core/events/v3/span-state.d.ts +52 -0
- package/dist/core/events/v3/span-state.d.ts.map +1 -0
- package/dist/core/events/v3/span-state.js +142 -0
- package/dist/core/events/v3/targets.d.ts +23 -0
- package/dist/core/events/v3/targets.d.ts.map +1 -0
- package/dist/core/events/v3/targets.js +134 -0
- package/dist/core/events/v3/turn-telemetry.d.ts +41 -0
- package/dist/core/events/v3/turn-telemetry.d.ts.map +1 -0
- package/dist/core/events/v3/turn-telemetry.js +168 -0
- package/dist/core/events/v3/validate.d.ts +9 -0
- package/dist/core/events/v3/validate.d.ts.map +1 -0
- package/dist/core/events/v3/validate.js +281 -0
- package/dist/core/events/v3/writer.d.ts +56 -0
- package/dist/core/events/v3/writer.d.ts.map +1 -0
- package/dist/core/events/v3/writer.js +335 -0
- package/dist/core/governor/index.d.ts +1 -1
- package/dist/core/governor/index.d.ts.map +1 -1
- package/dist/core/governor/index.js +1 -1
- package/dist/core/governor/plan-api.d.ts +2 -1
- package/dist/core/governor/plan-api.d.ts.map +1 -1
- package/dist/core/governor/plan-api.js +6 -3
- package/dist/core/governor/read.d.ts +1 -1
- package/dist/core/governor/read.d.ts.map +1 -1
- package/dist/core/governor/read.js +1 -1
- package/dist/core/governor/state.d.ts +9 -0
- package/dist/core/governor/state.d.ts.map +1 -1
- package/dist/core/governor/state.js +40 -3
- package/dist/core/guard/config.d.ts +5 -0
- package/dist/core/guard/config.d.ts.map +1 -0
- package/dist/core/guard/config.js +157 -0
- package/dist/core/guard/coordinator.d.ts +14 -0
- package/dist/core/guard/coordinator.d.ts.map +1 -0
- package/dist/core/guard/coordinator.js +173 -0
- package/dist/core/guard/evaluator.d.ts +4 -0
- package/dist/core/guard/evaluator.d.ts.map +1 -0
- package/dist/core/guard/evaluator.js +242 -0
- package/dist/core/guard/evidence-v3.d.ts +15 -0
- package/dist/core/guard/evidence-v3.d.ts.map +1 -0
- package/dist/core/guard/evidence-v3.js +171 -0
- package/dist/core/guard/index.d.ts +10 -0
- package/dist/core/guard/index.d.ts.map +1 -0
- package/dist/core/guard/index.js +6 -0
- package/dist/core/guard/live-source-v3.d.ts +40 -0
- package/dist/core/guard/live-source-v3.d.ts.map +1 -0
- package/dist/core/guard/live-source-v3.js +128 -0
- package/dist/core/guard/storage.d.ts +27 -0
- package/dist/core/guard/storage.d.ts.map +1 -0
- package/dist/core/guard/storage.js +140 -0
- package/dist/core/guard/types.d.ts +119 -0
- package/dist/core/guard/types.d.ts.map +1 -0
- package/dist/core/guard/types.js +1 -0
- package/dist/core/hooks/adapter/detect.d.ts +18 -1
- package/dist/core/hooks/adapter/detect.d.ts.map +1 -1
- package/dist/core/hooks/adapter/detect.js +29 -0
- package/dist/core/hooks/adapter/events.d.ts +7 -4
- package/dist/core/hooks/adapter/events.d.ts.map +1 -1
- package/dist/core/hooks/adapter/events.js +13 -4
- package/dist/core/hooks/adapter/output.d.ts +2 -2
- package/dist/core/hooks/adapter/output.d.ts.map +1 -1
- package/dist/core/hooks/adapter/parse.d.ts +7 -4
- package/dist/core/hooks/adapter/parse.d.ts.map +1 -1
- package/dist/core/hooks/adapter/parse.js +64 -24
- package/dist/core/hooks/adapter/wiring.d.ts +30 -4
- package/dist/core/hooks/adapter/wiring.d.ts.map +1 -1
- package/dist/core/hooks/adapter/wiring.js +89 -11
- package/dist/core/hooks/cli.d.ts +1 -1
- package/dist/core/hooks/cli.js +345 -400
- package/dist/core/hooks/codex-authorization.d.ts +30 -0
- package/dist/core/hooks/codex-authorization.d.ts.map +1 -0
- package/dist/core/hooks/codex-authorization.js +199 -0
- package/dist/core/hooks/effects/image-capture.d.ts +20 -34
- package/dist/core/hooks/effects/image-capture.d.ts.map +1 -1
- package/dist/core/hooks/effects/image-capture.js +212 -221
- package/dist/core/hooks/effects/index.d.ts +1 -9
- package/dist/core/hooks/effects/index.d.ts.map +1 -1
- package/dist/core/hooks/effects/index.js +1 -24
- package/dist/core/hooks/events/input-hash.d.ts +7 -0
- package/dist/core/hooks/events/input-hash.d.ts.map +1 -0
- package/dist/core/hooks/events/input-hash.js +43 -0
- package/dist/core/hooks/index.d.ts +4 -3
- package/dist/core/hooks/index.d.ts.map +1 -1
- package/dist/core/hooks/index.js +2 -3
- package/dist/core/hooks/resolve/coord-root.d.ts +1 -1
- package/dist/core/hooks/resolve/coord-root.js +1 -1
- package/dist/core/hooks/resolve/owner.d.ts +16 -15
- package/dist/core/hooks/resolve/owner.d.ts.map +1 -1
- package/dist/core/hooks/resolve/owner.js +51 -42
- package/dist/core/hooks/resolve/transcript.d.ts +33 -3
- package/dist/core/hooks/resolve/transcript.d.ts.map +1 -1
- package/dist/core/hooks/resolve/transcript.js +155 -14
- package/dist/core/hooks/session-name-presence.d.ts +9 -10
- package/dist/core/hooks/session-name-presence.d.ts.map +1 -1
- package/dist/core/hooks/session-name-presence.js +15 -15
- package/dist/core/hooks/unsafe-cross-shell.d.ts +1 -1
- package/dist/core/hooks/unsafe-cross-shell.d.ts.map +1 -1
- package/dist/core/journal/index.d.ts +2 -2
- package/dist/core/journal/index.d.ts.map +1 -1
- package/dist/core/journal/index.js +9 -22
- package/dist/core/presence/blob.d.ts +8 -3
- package/dist/core/presence/blob.d.ts.map +1 -1
- package/dist/core/presence/blob.js +54 -41
- package/dist/core/presence/codec-digest.d.ts +29 -0
- package/dist/core/presence/codec-digest.d.ts.map +1 -0
- package/dist/core/presence/codec-digest.js +170 -0
- package/dist/core/presence/index.js +15 -1
- package/dist/core/presence/relay-client.d.ts +1 -1
- package/dist/core/presence/relay-client.d.ts.map +1 -1
- package/dist/core/presence/relay-client.js +5 -5
- package/dist/core/work/index.d.ts +1 -1
- package/dist/core/work/index.d.ts.map +1 -1
- package/dist/core/work/index.js +1 -1
- package/dist/core/work/read.d.ts +1 -1
- package/dist/core/work/read.d.ts.map +1 -1
- package/dist/core/work/read.js +1 -1
- package/dist/core/work/runner.d.ts.map +1 -1
- package/dist/core/work/runner.js +6 -0
- package/dist/core/work/state.d.ts +9 -0
- package/dist/core/work/state.d.ts.map +1 -1
- package/dist/core/work/state.js +17 -3
- package/dist/core/workflow/engine.js +24 -25
- package/dist/core/workflow/live-session-v3.d.ts +19 -0
- package/dist/core/workflow/live-session-v3.d.ts.map +1 -0
- package/dist/core/workflow/live-session-v3.js +86 -0
- package/dist/core/workflow/scope-id.d.ts +3 -0
- package/dist/core/workflow/scope-id.d.ts.map +1 -0
- package/dist/core/workflow/scope-id.js +5 -0
- package/dist/core/workflow/workspaces/leases.d.ts +4 -0
- package/dist/core/workflow/workspaces/leases.d.ts.map +1 -1
- package/dist/core/workflow/workspaces/leases.js +53 -19
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/browser/client.d.ts +41 -0
- package/dist/lib/browser/client.d.ts.map +1 -1
- package/dist/lib/browser/client.js +203 -0
- package/dist/lib/browser/critique.d.ts +28 -2
- package/dist/lib/browser/critique.d.ts.map +1 -1
- package/dist/lib/browser/critique.js +74 -18
- package/dist/lib/browser/geometry.d.ts +1 -1
- package/dist/lib/browser/geometry.d.ts.map +1 -1
- package/dist/lib/browser/geometry.js +130 -6
- package/dist/lib/browser/index.d.ts +3 -0
- package/dist/lib/browser/index.d.ts.map +1 -1
- package/dist/lib/browser/index.js +3 -0
- package/dist/lib/browser/qa-plan.d.ts +174 -0
- package/dist/lib/browser/qa-plan.d.ts.map +1 -0
- package/dist/lib/browser/qa-plan.js +321 -0
- package/dist/lib/browser/qa-reuse.d.ts +99 -0
- package/dist/lib/browser/qa-reuse.d.ts.map +1 -0
- package/dist/lib/browser/qa-reuse.js +222 -0
- package/dist/lib/browser/qa-snapshot.d.ts +64 -0
- package/dist/lib/browser/qa-snapshot.d.ts.map +1 -0
- package/dist/lib/browser/qa-snapshot.js +171 -0
- package/dist/lib/browser/runts.d.ts.map +1 -1
- package/dist/lib/browser/runts.js +22 -1
- package/dist/lib/browser/tiling.d.ts +71 -0
- package/dist/lib/browser/tiling.d.ts.map +1 -0
- package/dist/lib/browser/tiling.js +118 -0
- package/dist/lib/context/index.d.ts +0 -3
- package/dist/lib/context/index.d.ts.map +1 -1
- package/dist/lib/context/index.js +20 -42
- package/dist/lib/council/index.d.ts +2 -2
- package/dist/lib/council/index.d.ts.map +1 -1
- package/dist/lib/council/index.js +9 -20
- package/dist/lib/docs-frontmatter.d.ts +1 -6
- package/dist/lib/docs-frontmatter.d.ts.map +1 -1
- package/dist/lib/docs-frontmatter.js +12 -78
- package/dist/lib/docs-index.d.ts +9 -0
- package/dist/lib/docs-index.d.ts.map +1 -1
- package/dist/lib/docs-index.js +32 -3
- package/dist/lib/docs-lint.d.ts.map +1 -1
- package/dist/lib/docs-lint.js +14 -30
- package/dist/lib/docs-metadata-audit.d.ts +19 -0
- package/dist/lib/docs-metadata-audit.d.ts.map +1 -0
- package/dist/lib/docs-metadata-audit.js +132 -0
- package/dist/lib/docs-metadata-managed.d.ts +23 -0
- package/dist/lib/docs-metadata-managed.d.ts.map +1 -0
- package/dist/lib/docs-metadata-managed.js +78 -0
- package/dist/lib/docs-metadata-sync.d.ts +20 -0
- package/dist/lib/docs-metadata-sync.d.ts.map +1 -0
- package/dist/lib/docs-metadata-sync.js +222 -0
- package/dist/lib/docs-metadata-v2-schema.d.ts +273 -0
- package/dist/lib/docs-metadata-v2-schema.d.ts.map +1 -0
- package/dist/lib/docs-metadata-v2-schema.js +134 -0
- package/dist/lib/docs-metadata-v2.d.ts +21 -0
- package/dist/lib/docs-metadata-v2.d.ts.map +1 -0
- package/dist/lib/docs-metadata-v2.js +424 -0
- package/dist/lib/docs-new.d.ts +11 -0
- package/dist/lib/docs-new.d.ts.map +1 -0
- package/dist/lib/docs-new.js +52 -0
- package/dist/lib/docs-sweep.d.ts.map +1 -1
- package/dist/lib/docs-sweep.js +45 -29
- package/dist/lib/headless/index.d.ts +98 -0
- package/dist/lib/headless/index.d.ts.map +1 -0
- package/dist/lib/headless/index.js +211 -0
- package/dist/lib/identities/assume.d.ts +4 -4
- package/dist/lib/identities/assume.d.ts.map +1 -1
- package/dist/lib/identities/assume.js +52 -68
- package/dist/lib/instructions/apply.d.ts +5 -4
- package/dist/lib/instructions/apply.d.ts.map +1 -1
- package/dist/lib/instructions/apply.js +32 -20
- package/dist/lib/instructions/bundle.d.ts +33 -0
- package/dist/lib/instructions/bundle.d.ts.map +1 -0
- package/dist/lib/instructions/bundle.js +149 -0
- package/dist/lib/instructions/splice.d.ts +0 -1
- package/dist/lib/instructions/splice.d.ts.map +1 -1
- package/dist/lib/instructions/splice.js +22 -6
- package/dist/lib/instructions/templates.d.ts +7 -5
- package/dist/lib/instructions/templates.d.ts.map +1 -1
- package/dist/lib/instructions/templates.js +79 -9
- package/package.json +27 -6
- package/schemas/config.schema.json +120 -2
- package/schemas/docs-metadata-v2.schema.json +441 -0
- package/schemas/event-v3.schema.json +24472 -0
- package/src/commander.ts +7 -1
- package/src/commands/adapter.ts +2 -2
- package/src/commands/agents.ts +1737 -570
- package/src/commands/artifacts.ts +7 -6
- package/src/commands/backup.ts +29 -21
- package/src/commands/browse.ts +349 -8
- package/src/commands/checkpoint.ts +4 -3
- package/src/commands/claude-desktop.ts +7 -5
- package/src/commands/context.ts +1 -6
- package/src/commands/decision.ts +27 -44
- package/src/commands/docs.ts +100 -33
- package/src/commands/doctor.ts +73 -8
- package/src/commands/events.ts +256 -0
- package/src/commands/governor.ts +18 -4
- package/src/commands/init.ts +264 -57
- package/src/commands/instructions.ts +129 -0
- package/src/commands/journal.ts +4 -13
- package/src/commands/ledger-v3.ts +111 -0
- package/src/commands/presence.ts +18 -11
- package/src/commands/sync.ts +1 -1
- package/src/commands/web.ts +67 -8
- package/src/commands/work.ts +28 -5
- package/src/core/adapter.ts +5 -0
- package/src/core/adapters/attest.ts +8 -3
- package/src/core/adapters/profiles.ts +4 -6
- package/src/core/agents/canonical-emit.ts +39 -28
- package/src/core/agents/cli.ts +242 -263
- package/src/core/agents/codex-archive-v3.ts +138 -0
- package/src/core/agents/coord-client.ts +75 -177
- package/src/core/agents/finalization.ts +120 -38
- package/src/core/agents/index.ts +5 -5
- package/src/core/agents/live-authority-v3.ts +375 -0
- package/src/core/agents/live-lifecycle-v3.ts +140 -0
- package/src/core/agents/live-observation-v3.ts +216 -0
- package/src/core/agents/render/prompt-context.ts +89 -55
- package/src/core/agents/render/session-context.ts +23 -32
- package/src/core/agents/rules/claim-conflict.ts +85 -126
- package/src/core/agents/rules/commit-conflict.ts +3 -14
- package/src/core/agents/rules/stop-hook.ts +239 -293
- package/src/core/agents/session-events.ts +137 -104
- package/src/core/agents/session-finalization-state-v3.ts +90 -0
- package/src/core/agents/session-finalizer-v3.ts +953 -0
- package/src/core/agents/session-name-display.ts +149 -0
- package/src/core/agents/state/activity-log.ts +6 -14
- package/src/core/agents/state/heartbeat-writer.ts +98 -242
- package/src/core/agents/state/live-coordination-view.ts +290 -0
- package/src/core/agents/state/session-state.ts +143 -0
- package/src/core/agents/state/stale-sweep.ts +40 -17
- package/src/core/artifacts/index.ts +4 -5
- package/src/core/config.ts +148 -3
- package/src/core/context/index.ts +9 -17
- package/src/core/events/span-parent.ts +46 -0
- package/src/core/events/v3/advance.ts +168 -0
- package/src/core/events/v3/authority-outbox.ts +548 -0
- package/src/core/events/v3/base-builder.ts +60 -0
- package/src/core/events/v3/base-contract.ts +882 -0
- package/src/core/events/v3/bootstrap.ts +226 -0
- package/src/core/events/v3/builder.ts +59 -0
- package/src/core/events/v3/canonical.ts +153 -0
- package/src/core/events/v3/capabilities.ts +171 -0
- package/src/core/events/v3/capability-drift.ts +177 -0
- package/src/core/events/v3/catalog.ts +202 -0
- package/src/core/events/v3/clock-order.ts +41 -0
- package/src/core/events/v3/contract.ts +365 -0
- package/src/core/events/v3/control.ts +576 -0
- package/src/core/events/v3/coordination-view.ts +193 -0
- package/src/core/events/v3/economics.ts +384 -0
- package/src/core/events/v3/finalization-view.ts +67 -0
- package/src/core/events/v3/fingerprint-keys.ts +260 -0
- package/src/core/events/v3/generated.ts +48 -0
- package/src/core/events/v3/ids.ts +33 -0
- package/src/core/events/v3/index.ts +322 -0
- package/src/core/events/v3/latency.ts +551 -0
- package/src/core/events/v3/live-feed.ts +319 -0
- package/src/core/events/v3/live-observation.ts +39 -0
- package/src/core/events/v3/live-routing.ts +135 -0
- package/src/core/events/v3/producers/command-recorder.ts +631 -0
- package/src/core/events/v3/producers/command.ts +201 -0
- package/src/core/events/v3/producers/coordination-recorder.ts +538 -0
- package/src/core/events/v3/producers/coordination.ts +355 -0
- package/src/core/events/v3/producers/hook-base.ts +578 -0
- package/src/core/events/v3/producers/hook.ts +119 -0
- package/src/core/events/v3/producers/intake.ts +319 -0
- package/src/core/events/v3/producers/recorder.ts +2805 -0
- package/src/core/events/v3/projection.ts +653 -0
- package/src/core/events/v3/reader.ts +1127 -0
- package/src/core/events/v3/recovery-record.ts +244 -0
- package/src/core/events/v3/recovery.ts +271 -0
- package/src/core/events/v3/span-state.ts +187 -0
- package/src/core/events/v3/targets.ts +182 -0
- package/src/core/events/v3/turn-telemetry.ts +259 -0
- package/src/core/events/v3/validate.ts +361 -0
- package/src/core/events/v3/writer.ts +419 -0
- package/src/core/governor/index.ts +3 -0
- package/src/core/governor/plan-api.ts +10 -2
- package/src/core/governor/read.ts +3 -0
- package/src/core/governor/state.ts +52 -5
- package/src/core/guard/config.ts +206 -0
- package/src/core/guard/coordinator.ts +227 -0
- package/src/core/guard/evaluator.ts +343 -0
- package/src/core/guard/evidence-v3.ts +227 -0
- package/src/core/guard/index.ts +35 -0
- package/src/core/guard/live-source-v3.ts +204 -0
- package/src/core/guard/storage.ts +188 -0
- package/src/core/guard/types.ts +152 -0
- package/src/core/hooks/adapter/detect.ts +28 -1
- package/src/core/hooks/adapter/events.ts +15 -6
- package/src/core/hooks/adapter/output.ts +7 -2
- package/src/core/hooks/adapter/parse.ts +81 -36
- package/src/core/hooks/adapter/wiring.ts +119 -13
- package/src/core/hooks/cli.ts +398 -422
- package/src/core/hooks/codex-authorization.ts +253 -0
- package/src/core/hooks/effects/image-capture.ts +228 -238
- package/src/core/hooks/effects/index.ts +1 -36
- package/src/core/hooks/events/input-hash.ts +47 -0
- package/src/core/hooks/index.ts +4 -11
- package/src/core/hooks/resolve/coord-root.ts +1 -1
- package/src/core/hooks/resolve/owner.ts +52 -45
- package/src/core/hooks/resolve/transcript.ts +165 -14
- package/src/core/hooks/session-name-presence.ts +14 -15
- package/src/core/hooks/unsafe-cross-shell.ts +1 -1
- package/src/core/journal/index.ts +15 -22
- package/src/core/presence/blob.ts +63 -38
- package/src/core/presence/codec-digest.ts +215 -0
- package/src/core/presence/index.ts +18 -1
- package/src/core/presence/relay-client.ts +5 -5
- package/src/core/work/index.ts +3 -0
- package/src/core/work/read.ts +3 -0
- package/src/core/work/runner.ts +6 -0
- package/src/core/work/state.ts +27 -3
- package/src/core/workflow/engine.ts +24 -24
- package/src/core/workflow/live-session-v3.ts +126 -0
- package/src/core/workflow/scope-id.ts +6 -0
- package/src/core/workflow/workspaces/leases.ts +56 -19
- package/src/index.ts +1 -1
- package/src/lib/browser/client.ts +230 -0
- package/src/lib/browser/critique.ts +104 -27
- package/src/lib/browser/geometry.ts +143 -14
- package/src/lib/browser/index.ts +34 -0
- package/src/lib/browser/qa-plan.ts +501 -0
- package/src/lib/browser/qa-reuse.ts +306 -0
- package/src/lib/browser/qa-snapshot.ts +223 -0
- package/src/lib/browser/runts.ts +27 -2
- package/src/lib/browser/tiling.ts +164 -0
- package/src/lib/context/index.ts +22 -46
- package/src/lib/council/index.ts +9 -21
- package/src/lib/docs-frontmatter.ts +8 -79
- package/src/lib/docs-index.ts +33 -3
- package/src/lib/docs-lint.ts +15 -29
- package/src/lib/docs-metadata-audit.ts +166 -0
- package/src/lib/docs-metadata-managed.ts +83 -0
- package/src/lib/docs-metadata-sync.ts +262 -0
- package/src/lib/docs-metadata-v2-schema.ts +138 -0
- package/src/lib/docs-metadata-v2.ts +646 -0
- package/src/lib/docs-new.ts +63 -0
- package/src/lib/docs-sweep.ts +42 -28
- package/src/lib/headless/index.ts +287 -0
- package/src/lib/identities/assume.ts +67 -86
- package/src/lib/instructions/apply.ts +33 -20
- package/src/lib/instructions/bundle.ts +199 -0
- package/src/lib/instructions/splice.ts +21 -7
- package/src/lib/instructions/templates.ts +85 -13
- package/dist/core/agents/cli-emit.d.ts +0 -27
- package/dist/core/agents/cli-emit.d.ts.map +0 -1
- package/dist/core/agents/cli-emit.js +0 -57
- package/dist/core/agents/codex-replay.d.ts +0 -29
- package/dist/core/agents/codex-replay.d.ts.map +0 -1
- package/dist/core/agents/codex-replay.js +0 -138
- package/dist/core/agents/events/consume.d.ts +0 -82
- package/dist/core/agents/events/consume.d.ts.map +0 -1
- package/dist/core/agents/events/consume.js +0 -195
- package/dist/core/agents/events/emit.d.ts +0 -42
- package/dist/core/agents/events/emit.d.ts.map +0 -1
- package/dist/core/agents/events/emit.js +0 -75
- package/dist/core/agents/events/ulid.d.ts +0 -11
- package/dist/core/agents/events/ulid.d.ts.map +0 -1
- package/dist/core/agents/events/ulid.js +0 -47
- package/dist/core/agents/state/heartbeat-projector.d.ts +0 -65
- package/dist/core/agents/state/heartbeat-projector.d.ts.map +0 -1
- package/dist/core/agents/state/heartbeat-projector.js +0 -527
- package/dist/core/hooks/events/emit.d.ts +0 -31
- package/dist/core/hooks/events/emit.d.ts.map +0 -1
- package/dist/core/hooks/events/emit.js +0 -93
- package/dist/core/hooks/events/rotate.d.ts +0 -43
- package/dist/core/hooks/events/rotate.d.ts.map +0 -1
- package/dist/core/hooks/events/rotate.js +0 -142
- package/dist/core/hooks/events/schema.d.ts +0 -312
- package/dist/core/hooks/events/schema.d.ts.map +0 -1
- package/dist/core/hooks/events/schema.js +0 -12
- package/dist/core/hooks/events/ulid.d.ts +0 -10
- package/dist/core/hooks/events/ulid.d.ts.map +0 -1
- package/dist/core/hooks/events/ulid.js +0 -47
- package/dist/lib/docs-frontmatter-migrate.d.ts +0 -33
- package/dist/lib/docs-frontmatter-migrate.d.ts.map +0 -1
- package/dist/lib/docs-frontmatter-migrate.js +0 -364
- package/src/core/agents/cli-emit.ts +0 -64
- package/src/core/agents/codex-replay.ts +0 -163
- package/src/core/agents/events/consume.ts +0 -254
- package/src/core/agents/events/emit.ts +0 -115
- package/src/core/agents/events/ulid.ts +0 -51
- package/src/core/agents/state/heartbeat-projector.ts +0 -582
- package/src/core/hooks/events/emit.ts +0 -125
- package/src/core/hooks/events/rotate.ts +0 -151
- package/src/core/hooks/events/schema.ts +0 -538
- package/src/core/hooks/events/ulid.ts +0 -51
- package/src/lib/docs-frontmatter-migrate.ts +0 -427
package/src/commands/decision.ts
CHANGED
|
@@ -1,13 +1,8 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
2
|
import type { Command } from "commander";
|
|
3
3
|
import type { EmitContext } from "../commander.ts";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
monorepoRoot,
|
|
7
|
-
normalizeAdapter,
|
|
8
|
-
readHeartbeat,
|
|
9
|
-
resolveOwner,
|
|
10
|
-
} from "../core/agents/index.ts";
|
|
4
|
+
import { emitEventV3, monorepoRoot, normalizeAdapter, resolveOwner } from "../core/agents/index.ts";
|
|
5
|
+
import { readLiveCoordinationRow } from "../core/agents/state/live-coordination-view.ts";
|
|
11
6
|
import { resolveBinName } from "../core/config.ts";
|
|
12
7
|
import {
|
|
13
8
|
archiveDecision,
|
|
@@ -79,7 +74,7 @@ export function registerDecisionCommand(program: Command, emitParam: EmitContext
|
|
|
79
74
|
brief = readFileSync(opts.brief, "utf8");
|
|
80
75
|
}
|
|
81
76
|
const owner = resolveOwner();
|
|
82
|
-
const hb = owner ?
|
|
77
|
+
const hb = owner ? readLiveCoordinationRow(coordRoot, owner) : null;
|
|
83
78
|
const r = fileDecision(coordRoot, {
|
|
84
79
|
question: question.join(" "),
|
|
85
80
|
tier,
|
|
@@ -91,11 +86,7 @@ export function registerDecisionCommand(program: Command, emitParam: EmitContext
|
|
|
91
86
|
filedById: owner ?? undefined,
|
|
92
87
|
});
|
|
93
88
|
if (!r.ok) return fail("file_failed", r.reason);
|
|
94
|
-
emitDecisionEvent("
|
|
95
|
-
decision_id: r.manifest!.decision_id,
|
|
96
|
-
tier,
|
|
97
|
-
stakes,
|
|
98
|
-
});
|
|
89
|
+
emitDecisionEvent("filed", r.manifest!);
|
|
99
90
|
emit.data(r.manifest);
|
|
100
91
|
});
|
|
101
92
|
|
|
@@ -214,7 +205,8 @@ export function registerDecisionCommand(program: Command, emitParam: EmitContext
|
|
|
214
205
|
.action((id: string, opts: ResolveOpts) => {
|
|
215
206
|
const coordRoot = coordRootOrExit();
|
|
216
207
|
const owner = resolveOwner();
|
|
217
|
-
const resolvedBy =
|
|
208
|
+
const resolvedBy =
|
|
209
|
+
opts.resolvedBy ?? (owner ? readLiveCoordinationRow(coordRoot, owner)?.name : undefined);
|
|
218
210
|
if (!resolvedBy) {
|
|
219
211
|
return fail("no_resolver", "pass --resolved-by (no agent session to infer it from)");
|
|
220
212
|
}
|
|
@@ -228,12 +220,7 @@ export function registerDecisionCommand(program: Command, emitParam: EmitContext
|
|
|
228
220
|
resolved_by: resolvedBy,
|
|
229
221
|
});
|
|
230
222
|
if (!r.ok) return fail("resolve_failed", r.reason);
|
|
231
|
-
emitDecisionEvent("
|
|
232
|
-
decision_id: id,
|
|
233
|
-
tier: r.manifest!.tier,
|
|
234
|
-
stakes: r.manifest!.stakes,
|
|
235
|
-
confidence: opts.confidence ?? null,
|
|
236
|
-
});
|
|
223
|
+
emitDecisionEvent("resolved", r.manifest!);
|
|
237
224
|
emit.data(r.manifest);
|
|
238
225
|
});
|
|
239
226
|
|
|
@@ -259,11 +246,7 @@ export function registerDecisionCommand(program: Command, emitParam: EmitContext
|
|
|
259
246
|
note: opts.note,
|
|
260
247
|
});
|
|
261
248
|
if (!r.ok) return fail("review_failed", r.reason);
|
|
262
|
-
emitDecisionEvent("
|
|
263
|
-
decision_id: id,
|
|
264
|
-
verdict: opts.verdict,
|
|
265
|
-
tier: r.manifest!.tier,
|
|
266
|
-
});
|
|
249
|
+
emitDecisionEvent("reviewed", r.manifest!);
|
|
267
250
|
emit.data(r.manifest);
|
|
268
251
|
});
|
|
269
252
|
|
|
@@ -300,11 +283,7 @@ export function registerDecisionCommand(program: Command, emitParam: EmitContext
|
|
|
300
283
|
const coordRoot = coordRootOrExit();
|
|
301
284
|
const r = archiveDecision(coordRoot, id, opts.graduatedTo);
|
|
302
285
|
if (!r.ok) return fail("archive_failed", r.reason);
|
|
303
|
-
emitDecisionEvent("
|
|
304
|
-
decision_id: id,
|
|
305
|
-
tier: r.manifest!.tier,
|
|
306
|
-
graduated_to: opts.graduatedTo ?? null,
|
|
307
|
-
});
|
|
286
|
+
emitDecisionEvent("archived", r.manifest!);
|
|
308
287
|
emit.data(r.manifest);
|
|
309
288
|
});
|
|
310
289
|
|
|
@@ -320,7 +299,7 @@ export function registerDecisionCommand(program: Command, emitParam: EmitContext
|
|
|
320
299
|
const coordRoot = coordRootOrExit();
|
|
321
300
|
const r = reopenDecision(coordRoot, id);
|
|
322
301
|
if (!r.ok) return fail("reopen_failed", r.reason);
|
|
323
|
-
emitDecisionEvent("
|
|
302
|
+
emitDecisionEvent("reviewed", r.manifest!, "archived");
|
|
324
303
|
emit.data(r.manifest);
|
|
325
304
|
});
|
|
326
305
|
|
|
@@ -333,10 +312,7 @@ export function registerDecisionCommand(program: Command, emitParam: EmitContext
|
|
|
333
312
|
const coordRoot = coordRootOrExit();
|
|
334
313
|
const r = supersedeDecision(coordRoot, id, opts.by);
|
|
335
314
|
if (!r.ok) return fail("supersede_failed", r.reason);
|
|
336
|
-
emitDecisionEvent("
|
|
337
|
-
decision_id: id,
|
|
338
|
-
superseded_by: opts.by ?? null,
|
|
339
|
-
});
|
|
315
|
+
emitDecisionEvent("superseded", r.manifest!);
|
|
340
316
|
emit.data(r.manifest);
|
|
341
317
|
});
|
|
342
318
|
|
|
@@ -349,10 +325,7 @@ export function registerDecisionCommand(program: Command, emitParam: EmitContext
|
|
|
349
325
|
const coordRoot = coordRootOrExit();
|
|
350
326
|
const r = wontfixDecision(coordRoot, id, opts.reason);
|
|
351
327
|
if (!r.ok) return fail("wontfix_failed", r.reason);
|
|
352
|
-
emitDecisionEvent("
|
|
353
|
-
decision_id: id,
|
|
354
|
-
reason: opts.reason ?? null,
|
|
355
|
-
});
|
|
328
|
+
emitDecisionEvent("wontfix", r.manifest!);
|
|
356
329
|
emit.data(r.manifest);
|
|
357
330
|
});
|
|
358
331
|
}
|
|
@@ -458,15 +431,25 @@ function summarize(m: DecisionManifest): Record<string, unknown> {
|
|
|
458
431
|
* session to attribute it to (operator-side filing). Powers the docket metrics
|
|
459
432
|
* without new telemetry plumbing.
|
|
460
433
|
*/
|
|
461
|
-
function emitDecisionEvent(
|
|
434
|
+
function emitDecisionEvent(
|
|
435
|
+
newState: string,
|
|
436
|
+
manifest: DecisionManifest,
|
|
437
|
+
priorState?: string,
|
|
438
|
+
): void {
|
|
462
439
|
const owner = resolveOwner();
|
|
463
440
|
if (!owner) return;
|
|
464
|
-
const
|
|
465
|
-
|
|
466
|
-
|
|
441
|
+
const root = monorepoRoot();
|
|
442
|
+
const hb = root ? readLiveCoordinationRow(root, owner) : null;
|
|
443
|
+
emitEventV3({
|
|
467
444
|
owner,
|
|
468
445
|
session: hb?.session_id ?? owner,
|
|
469
446
|
adapter: normalizeAdapter(hb?.platform),
|
|
470
|
-
|
|
447
|
+
observation: {
|
|
448
|
+
event_type: "decision.state_changed",
|
|
449
|
+
decision_id: manifest.decision_id,
|
|
450
|
+
...(priorState ? { prior_state: priorState } : {}),
|
|
451
|
+
new_state: newState,
|
|
452
|
+
record: manifest,
|
|
453
|
+
},
|
|
471
454
|
});
|
|
472
455
|
}
|
package/src/commands/docs.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import type { Command } from "commander";
|
|
2
2
|
import type { EmitContext, HarneryProgramContext } from "../commander.ts";
|
|
3
3
|
import { initDocsContext as initDocs, scanDocs } from "../lib/docs.ts";
|
|
4
|
-
import {
|
|
5
|
-
initDocsMigrationContext,
|
|
6
|
-
runFrontmatterMigration,
|
|
7
|
-
} from "../lib/docs-frontmatter-migrate.ts";
|
|
8
4
|
import { initDocsContext as initDocsIndex, runIndex } from "../lib/docs-index.ts";
|
|
9
5
|
import { initDocsContext as initDocsLinks, runLinks } from "../lib/docs-links.ts";
|
|
10
6
|
import { initDocsContext as initDocsLint, runLint } from "../lib/docs-lint.ts";
|
|
11
7
|
import { readDocsMetadata, readDocsMetadataKey } from "../lib/docs-meta.ts";
|
|
8
|
+
import { initDocsMetadataAuditContext, runDocsMetadataAudit } from "../lib/docs-metadata-audit.ts";
|
|
9
|
+
import { initDocsMetadataSyncContext, runDocsMetadataSync } from "../lib/docs-metadata-sync.ts";
|
|
10
|
+
import { createDocsFile } from "../lib/docs-new.ts";
|
|
12
11
|
import {
|
|
13
12
|
countColdHandoffs,
|
|
14
13
|
initDocsContext as initDocsSweep,
|
|
@@ -21,7 +20,6 @@ function ensureContext(context: HarneryProgramContext | undefined): void {
|
|
|
21
20
|
}
|
|
22
21
|
const opts = { repoRoot: context.repoRoot, submodules: context.submodules };
|
|
23
22
|
initDocs(opts);
|
|
24
|
-
initDocsMigrationContext(opts);
|
|
25
23
|
initDocsIndex(opts);
|
|
26
24
|
initDocsLint({
|
|
27
25
|
...opts,
|
|
@@ -29,6 +27,8 @@ function ensureContext(context: HarneryProgramContext | undefined): void {
|
|
|
29
27
|
docsRootAllowlist: context.docsRootAllowlist,
|
|
30
28
|
});
|
|
31
29
|
initDocsLinks({ ...opts, extraExcludedPrefixes: context.extraDocsExcludedPrefixes });
|
|
30
|
+
initDocsMetadataAuditContext(opts);
|
|
31
|
+
initDocsMetadataSyncContext(opts);
|
|
32
32
|
initDocsSweep(opts);
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -84,21 +84,109 @@ export function registerDocsCommand(
|
|
|
84
84
|
}
|
|
85
85
|
});
|
|
86
86
|
|
|
87
|
-
docs
|
|
88
|
-
.command("
|
|
89
|
-
.description("
|
|
87
|
+
const metadata = docs
|
|
88
|
+
.command("metadata")
|
|
89
|
+
.description("Validate and maintain the versioned markdown metadata contract");
|
|
90
|
+
|
|
91
|
+
metadata
|
|
92
|
+
.command("validate")
|
|
93
|
+
.description("Validate every managed Markdown file against harnery-doc/v2")
|
|
90
94
|
.option("--repo <name>", "Limit to one submodule or '.' for parent")
|
|
91
|
-
.
|
|
92
|
-
.action(async (opts: { repo?: string; yes?: boolean }) => {
|
|
95
|
+
.action(async (opts: { repo?: string }) => {
|
|
93
96
|
try {
|
|
94
97
|
ensureContext(context);
|
|
95
|
-
|
|
98
|
+
const rows = await runDocsMetadataAudit(opts);
|
|
99
|
+
const errors = rows
|
|
100
|
+
.flatMap((row) => row.issues)
|
|
101
|
+
.filter((issue) => issue.severity === "error");
|
|
102
|
+
const warnings = rows
|
|
103
|
+
.flatMap((row) => row.issues)
|
|
104
|
+
.filter((issue) => issue.severity === "warning");
|
|
105
|
+
emit.data({
|
|
106
|
+
repo: opts.repo ?? null,
|
|
107
|
+
counts: {
|
|
108
|
+
files: rows.length,
|
|
109
|
+
valid: rows.filter((row) => row.state === "valid").length,
|
|
110
|
+
invalid: rows.filter((row) => row.state === "invalid").length,
|
|
111
|
+
legacy: rows.filter((row) => row.state === "legacy").length,
|
|
112
|
+
missing: rows.filter((row) => row.state === "missing").length,
|
|
113
|
+
errors: errors.length,
|
|
114
|
+
warnings: warnings.length,
|
|
115
|
+
},
|
|
116
|
+
rows,
|
|
117
|
+
});
|
|
118
|
+
if (errors.length > 0) emit.setExitCode(1);
|
|
96
119
|
} catch (err: unknown) {
|
|
97
120
|
const msg = err instanceof Error ? err.message : String(err);
|
|
98
121
|
emit.error({ code: "docs_error", message: msg });
|
|
99
122
|
}
|
|
100
123
|
});
|
|
101
124
|
|
|
125
|
+
metadata
|
|
126
|
+
.command("sync")
|
|
127
|
+
.description("Synchronize semantic and lifecycle timestamps on staged v2 documents")
|
|
128
|
+
.argument("[files...]", "Explicit repository-relative Markdown files; defaults to staged files")
|
|
129
|
+
.option("--repo <name>", "Limit to one submodule or '.' for parent")
|
|
130
|
+
.option("--check", "Report timestamp drift without writing")
|
|
131
|
+
.option("--reviewed", "Record an explicit runbook review and move its due date")
|
|
132
|
+
.action(
|
|
133
|
+
async (files: string[], opts: { repo?: string; check?: boolean; reviewed?: boolean }) => {
|
|
134
|
+
try {
|
|
135
|
+
ensureContext(context);
|
|
136
|
+
const rows = await runDocsMetadataSync({ ...opts, files });
|
|
137
|
+
emit.data({
|
|
138
|
+
check: !!opts.check,
|
|
139
|
+
counts: {
|
|
140
|
+
files: rows.length,
|
|
141
|
+
updated: rows.filter((row) => row.status === "updated").length,
|
|
142
|
+
drift: rows.filter((row) => row.status === "drift").length,
|
|
143
|
+
invalid: rows.filter((row) => row.status === "invalid").length,
|
|
144
|
+
},
|
|
145
|
+
rows,
|
|
146
|
+
});
|
|
147
|
+
if (rows.some((row) => row.status === "drift" || row.status === "invalid")) {
|
|
148
|
+
emit.setExitCode(1);
|
|
149
|
+
}
|
|
150
|
+
} catch (err: unknown) {
|
|
151
|
+
emit.error({
|
|
152
|
+
code: "docs_error",
|
|
153
|
+
message: err instanceof Error ? err.message : String(err),
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
);
|
|
158
|
+
|
|
159
|
+
docs
|
|
160
|
+
.command("new")
|
|
161
|
+
.description("Create a document with canonical harnery-doc/v2 metadata")
|
|
162
|
+
.argument("<type>", "plan, issue, handoff, runbook, or topic")
|
|
163
|
+
.argument("<path>", "Repository-relative Markdown path")
|
|
164
|
+
.requiredOption("--summary <text>", "One-sentence document summary")
|
|
165
|
+
.requiredOption("--owner <id>", "Canonical lowercase kebab-case owner id")
|
|
166
|
+
.option("--status <status>", "Initial lifecycle status")
|
|
167
|
+
.option("--severity <severity>", "Issue severity", "medium")
|
|
168
|
+
.action(
|
|
169
|
+
(
|
|
170
|
+
type: "plan" | "issue" | "handoff" | "runbook" | "topic",
|
|
171
|
+
path: string,
|
|
172
|
+
opts: { summary: string; owner: string; status?: string; severity?: string },
|
|
173
|
+
) => {
|
|
174
|
+
try {
|
|
175
|
+
ensureContext(context);
|
|
176
|
+
if (!["plan", "issue", "handoff", "runbook", "topic"].includes(type)) {
|
|
177
|
+
throw new Error(`unsupported document type '${type}'`);
|
|
178
|
+
}
|
|
179
|
+
const file = createDocsFile(context!.repoRoot!, { type, path, ...opts });
|
|
180
|
+
emit.data({ path: file, schema: "harnery-doc/v2", type });
|
|
181
|
+
} catch (err: unknown) {
|
|
182
|
+
emit.error({
|
|
183
|
+
code: "docs_error",
|
|
184
|
+
message: err instanceof Error ? err.message : String(err),
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
);
|
|
189
|
+
|
|
102
190
|
docs
|
|
103
191
|
.command("lint")
|
|
104
192
|
.description(
|
|
@@ -166,7 +254,7 @@ export function registerDocsCommand(
|
|
|
166
254
|
.command("index")
|
|
167
255
|
.description("Regenerate index READMEs for docs/audits/ and docs/issues/ directories")
|
|
168
256
|
.option("--dry-run", "Show what would change, don't write files")
|
|
169
|
-
.option("--repo <name>", "Limit to one submodule or '.' for parent")
|
|
257
|
+
.option("--repo <name>", "Limit to one package (in-tree or submodule) or '.' for parent")
|
|
170
258
|
.action(async (opts: { dryRun?: boolean; repo?: string }) => {
|
|
171
259
|
try {
|
|
172
260
|
ensureContext(context);
|
|
@@ -178,27 +266,6 @@ export function registerDocsCommand(
|
|
|
178
266
|
});
|
|
179
267
|
}
|
|
180
268
|
|
|
181
|
-
// --- `harn docs frontmatter-migrate` ---
|
|
182
|
-
|
|
183
|
-
function handleFrontmatterMigration(opts: { repo?: string; yes?: boolean }): void {
|
|
184
|
-
const rows = runFrontmatterMigration({ repo: opts.repo, apply: !!opts.yes });
|
|
185
|
-
const counts = {
|
|
186
|
-
would_update: rows.filter((row) => row.status === "would-update").length,
|
|
187
|
-
updated: rows.filter((row) => row.status === "updated").length,
|
|
188
|
-
skipped: rows.filter((row) => row.status === "skipped").length,
|
|
189
|
-
errors: rows.filter((row) => row.status === "error").length,
|
|
190
|
-
};
|
|
191
|
-
emit.data({
|
|
192
|
-
dry_run: !opts.yes,
|
|
193
|
-
applied: !!opts.yes && counts.errors === 0,
|
|
194
|
-
aborted: !!opts.yes && counts.errors > 0,
|
|
195
|
-
repo: opts.repo ?? null,
|
|
196
|
-
counts,
|
|
197
|
-
rows,
|
|
198
|
-
});
|
|
199
|
-
if (counts.errors > 0) emit.setExitCode(1);
|
|
200
|
-
}
|
|
201
|
-
|
|
202
269
|
// --- `harn docs meta` ---
|
|
203
270
|
|
|
204
271
|
function handleMeta(
|
package/src/commands/doctor.ts
CHANGED
|
@@ -21,7 +21,14 @@ import { BUILTIN_ADAPTER_IDS } from "../core/adapters/index.ts";
|
|
|
21
21
|
import { resolveBinName, ripgrepAutoInstall } from "../core/config.ts";
|
|
22
22
|
import { ADAPTER_SPECS, type AdapterId } from "../core/hooks/adapter/events.ts";
|
|
23
23
|
import { loadAdapterWiring, summarizeAdapterWiring } from "../core/hooks/adapter/wiring.ts";
|
|
24
|
-
import {
|
|
24
|
+
import {
|
|
25
|
+
type CodexHookAuthorizationResult,
|
|
26
|
+
probeCodexHookAuthorization,
|
|
27
|
+
} from "../core/hooks/codex-authorization.ts";
|
|
28
|
+
import {
|
|
29
|
+
type CodexWslBridgeStatus,
|
|
30
|
+
inspectCodexWslBridge,
|
|
31
|
+
} from "../core/hooks/codex-wsl-bridge.ts";
|
|
25
32
|
import {
|
|
26
33
|
ADAPTER_BINARIES,
|
|
27
34
|
ADAPTER_INSTALL_HINTS,
|
|
@@ -34,7 +41,7 @@ import { findRg, installRg, managedRgPath, rgInstallSupported } from "../lib/too
|
|
|
34
41
|
|
|
35
42
|
type Severity = "ok" | "warn" | "fail";
|
|
36
43
|
|
|
37
|
-
interface Check {
|
|
44
|
+
export interface Check {
|
|
38
45
|
name: string;
|
|
39
46
|
severity: Severity;
|
|
40
47
|
detail: string;
|
|
@@ -66,7 +73,7 @@ export function registerDoctorCommand(program: Command, emit: EmitContext): void
|
|
|
66
73
|
emit.text(`ripgrep install failed: ${(err as Error).message}\n`);
|
|
67
74
|
}
|
|
68
75
|
}
|
|
69
|
-
const checks = runChecks();
|
|
76
|
+
const checks = await runChecks();
|
|
70
77
|
const requiredFailed = checks.some((c) => c.severity === "fail");
|
|
71
78
|
|
|
72
79
|
if (opts.json) {
|
|
@@ -99,13 +106,15 @@ export function registerDoctorCommand(program: Command, emit: EmitContext): void
|
|
|
99
106
|
});
|
|
100
107
|
}
|
|
101
108
|
|
|
102
|
-
export function runChecks(): Check[] {
|
|
103
|
-
const
|
|
109
|
+
export async function runChecks(): Promise<Check[]> {
|
|
110
|
+
const codexWslStatus = inspectCodexWslBridge();
|
|
111
|
+
const codexWslBridge = checkCodexWslBridge(codexWslStatus);
|
|
104
112
|
// Probe the adapter CLIs before the hook check runs, not in output order:
|
|
105
113
|
// an unwired adapter only matters if its CLI is actually installed, and
|
|
106
114
|
// probing once here keeps that join to one spawn per CLI.
|
|
107
115
|
const workflow = BUILTIN_ADAPTER_IDS.map((id) => ({ id, ...checkWorkflowAdapter(id) }));
|
|
108
116
|
const installed = workflow.filter((w) => w.installed).map((w) => w.id as AdapterId);
|
|
117
|
+
const codexAuthorization = await checkCodexHookAuthorization(installed, codexWslStatus);
|
|
109
118
|
return [
|
|
110
119
|
checkNode(),
|
|
111
120
|
checkGit(),
|
|
@@ -113,6 +122,7 @@ export function runChecks(): Check[] {
|
|
|
113
122
|
checkRipgrep(),
|
|
114
123
|
checkHarneryDir(),
|
|
115
124
|
checkAdapterHooks(installed),
|
|
125
|
+
...(codexAuthorization ? [codexAuthorization] : []),
|
|
116
126
|
checkGitHookRegions(),
|
|
117
127
|
...(codexWslBridge ? [codexWslBridge] : []),
|
|
118
128
|
...workflow.map((w) => w.check),
|
|
@@ -153,8 +163,7 @@ function checkGitHookRegions(): Check {
|
|
|
153
163
|
}
|
|
154
164
|
}
|
|
155
165
|
|
|
156
|
-
function checkCodexWslBridge(): Check | null {
|
|
157
|
-
const status = inspectCodexWslBridge();
|
|
166
|
+
function checkCodexWslBridge(status: CodexWslBridgeStatus | null): Check | null {
|
|
158
167
|
if (!status) return null;
|
|
159
168
|
return {
|
|
160
169
|
name: "codex:WSL bridge",
|
|
@@ -166,6 +175,49 @@ function checkCodexWslBridge(): Check | null {
|
|
|
166
175
|
};
|
|
167
176
|
}
|
|
168
177
|
|
|
178
|
+
export function codexAuthorizationCheck(result: CodexHookAuthorizationResult): Check {
|
|
179
|
+
const reviewHint =
|
|
180
|
+
"terminal UI: run `/hooks`; Codex Desktop: open Settings > Hooks; after approval, start a fresh task";
|
|
181
|
+
if (result.status === "runnable") {
|
|
182
|
+
return { name: "codex:hook authorization", severity: "ok", detail: result.detail };
|
|
183
|
+
}
|
|
184
|
+
if (result.status === "review_required" || result.status === "disabled") {
|
|
185
|
+
return {
|
|
186
|
+
name: "codex:hook authorization",
|
|
187
|
+
severity: "warn",
|
|
188
|
+
detail: result.detail,
|
|
189
|
+
hint: reviewHint,
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
return {
|
|
193
|
+
name: "codex:hook authorization",
|
|
194
|
+
severity: "warn",
|
|
195
|
+
detail: `authorization unverified: ${result.detail}`,
|
|
196
|
+
hint: reviewHint,
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
async function checkCodexHookAuthorization(
|
|
201
|
+
installedAdapters: AdapterId[],
|
|
202
|
+
codexWslStatus: CodexWslBridgeStatus | null,
|
|
203
|
+
): Promise<Check | null> {
|
|
204
|
+
const root = findCoordProjectRoot();
|
|
205
|
+
if (!root || !summarizeAdapterWiring(root).wired.includes("codex")) return null;
|
|
206
|
+
|
|
207
|
+
if (codexWslStatus) {
|
|
208
|
+
return {
|
|
209
|
+
name: "codex:hook authorization",
|
|
210
|
+
severity: "warn",
|
|
211
|
+
detail:
|
|
212
|
+
"unverified from WSL; the Windows-native Codex runtime owns this workspace's trust state",
|
|
213
|
+
hint: "run the host's Windows bridge doctor, or open Codex Desktop Settings > Hooks; start a fresh task after approval",
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
if (!installedAdapters.includes("codex")) return null;
|
|
217
|
+
|
|
218
|
+
return codexAuthorizationCheck(await probeCodexHookAuthorization({ cwd: root }));
|
|
219
|
+
}
|
|
220
|
+
|
|
169
221
|
function checkRipgrep(): Check {
|
|
170
222
|
const found = findRg();
|
|
171
223
|
if (found) {
|
|
@@ -382,7 +434,7 @@ function checkHarneryDir(): Check {
|
|
|
382
434
|
name: ".harnery/",
|
|
383
435
|
severity: "warn",
|
|
384
436
|
detail: "no .harnery/ found above cwd",
|
|
385
|
-
hint: "
|
|
437
|
+
hint: "initialize the project with `harn init` from the repository root",
|
|
386
438
|
};
|
|
387
439
|
}
|
|
388
440
|
|
|
@@ -420,6 +472,19 @@ function checkAdapterHooks(installedAdapters: AdapterId[] = []): Check {
|
|
|
420
472
|
bits.push(`${d.missing.length} missing (${d.missing.map((m) => m.subcommand).join(", ")})`);
|
|
421
473
|
}
|
|
422
474
|
if (d.orphans.length > 0) bits.push(`${d.orphans.length} orphaned (${d.orphans.join(", ")})`);
|
|
475
|
+
if (d.duplicates.length > 0) {
|
|
476
|
+
bits.push(
|
|
477
|
+
`${d.duplicates.length} duplicated (${d.duplicates.map((e) => e.settingsKey).join(", ")})`,
|
|
478
|
+
);
|
|
479
|
+
}
|
|
480
|
+
if (d.misplaced.length > 0) {
|
|
481
|
+
bits.push(
|
|
482
|
+
`${d.misplaced.length} misplaced (${d.misplaced.map((e) => e.subcommand).join(", ")})`,
|
|
483
|
+
);
|
|
484
|
+
}
|
|
485
|
+
if (d.stale.length > 0) {
|
|
486
|
+
bits.push(`${d.stale.length} stale (${d.stale.map((e) => e.settingsKey).join(", ")})`);
|
|
487
|
+
}
|
|
423
488
|
if (d.invalidTopLevelKeys.length > 0) {
|
|
424
489
|
bits.push(`invalid fields (${d.invalidTopLevelKeys.join(", ")})`);
|
|
425
490
|
}
|