harnery 0.35.0 → 0.37.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/dist/commander.d.ts +30 -5
- package/dist/commander.d.ts.map +1 -1
- package/dist/commander.js +128 -96
- package/dist/commands/agents.d.ts +23 -3
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +464 -242
- package/dist/commands/artifacts.d.ts.map +1 -1
- package/dist/commands/artifacts.js +26 -1
- package/dist/commands/backup.d.ts.map +1 -1
- package/dist/commands/backup.js +10 -10
- package/dist/commands/browse-session.d.ts.map +1 -1
- package/dist/commands/browse-session.js +12 -0
- package/dist/commands/browse.d.ts +1 -1
- package/dist/commands/browse.d.ts.map +1 -1
- package/dist/commands/browse.js +16 -4
- package/dist/commands/conversations.d.ts +10 -0
- package/dist/commands/conversations.d.ts.map +1 -0
- package/dist/commands/conversations.js +201 -0
- package/dist/commands/deinit.d.ts.map +1 -1
- package/dist/commands/deinit.js +5 -0
- package/dist/commands/diagnostics.d.ts +4 -0
- package/dist/commands/diagnostics.d.ts.map +1 -0
- package/dist/commands/diagnostics.js +229 -0
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +13 -2
- package/dist/commands/doctor.d.ts +5 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +51 -7
- package/dist/commands/fetch.js +6 -5
- package/dist/commands/files.d.ts +34 -0
- package/dist/commands/files.d.ts.map +1 -0
- package/dist/commands/files.js +166 -0
- package/dist/commands/governor.d.ts.map +1 -1
- package/dist/commands/governor.js +18 -12
- package/dist/commands/inbox.d.ts +5 -0
- package/dist/commands/inbox.d.ts.map +1 -0
- package/dist/commands/inbox.js +57 -0
- package/dist/commands/init.d.ts +4 -5
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +63 -13
- package/dist/commands/ledger-v3.d.ts.map +1 -1
- package/dist/commands/ledger-v3.js +417 -2
- package/dist/commands/logs.d.ts +4 -0
- package/dist/commands/logs.d.ts.map +1 -0
- package/dist/commands/logs.js +169 -0
- package/dist/commands/messages.d.ts +5 -0
- package/dist/commands/messages.d.ts.map +1 -0
- package/dist/commands/messages.js +45 -0
- package/dist/commands/outline.d.ts +1 -1
- package/dist/commands/outline.d.ts.map +1 -1
- package/dist/commands/outline.js +2 -2
- package/dist/commands/qa-run.d.ts +4 -0
- package/dist/commands/qa-run.d.ts.map +1 -0
- package/dist/commands/qa-run.js +141 -0
- package/dist/commands/read.d.ts +1 -1
- package/dist/commands/read.d.ts.map +1 -1
- package/dist/commands/read.js +2 -2
- package/dist/commands/resources.d.ts +4 -0
- package/dist/commands/resources.d.ts.map +1 -0
- package/dist/commands/resources.js +29 -0
- package/dist/commands/semantic.d.ts.map +1 -1
- package/dist/commands/semantic.js +54 -2
- package/dist/commands/storage.d.ts +4 -0
- package/dist/commands/storage.d.ts.map +1 -0
- package/dist/commands/storage.js +238 -0
- package/dist/commands/supervisor.d.ts +4 -0
- package/dist/commands/supervisor.d.ts.map +1 -0
- package/dist/commands/supervisor.js +101 -0
- package/dist/commands/tunnel.d.ts +5 -1
- package/dist/commands/tunnel.d.ts.map +1 -1
- package/dist/commands/tunnel.js +44 -31
- package/dist/commands/web.d.ts +3 -0
- package/dist/commands/web.d.ts.map +1 -1
- package/dist/commands/web.js +84 -7
- package/dist/commands/work.js +3 -3
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +17 -13
- package/dist/core/adapters/profiles.d.ts +1 -1
- package/dist/core/agents/cli.js +215 -41
- package/dist/core/agents/health.d.ts +17 -0
- package/dist/core/agents/health.d.ts.map +1 -0
- package/dist/core/agents/health.js +109 -0
- package/dist/core/agents/live-authority-v3.d.ts +47 -1
- package/dist/core/agents/live-authority-v3.d.ts.map +1 -1
- package/dist/core/agents/live-authority-v3.js +244 -10
- package/dist/core/agents/live-lifecycle-v3.js +6 -1
- package/dist/core/agents/live-observation-v3.d.ts.map +1 -1
- package/dist/core/agents/live-observation-v3.js +6 -1
- package/dist/core/agents/mailbox.d.ts +92 -0
- package/dist/core/agents/mailbox.d.ts.map +1 -0
- package/dist/core/agents/mailbox.js +325 -0
- package/dist/core/agents/reconcile-coordination-v3.d.ts +44 -0
- package/dist/core/agents/reconcile-coordination-v3.d.ts.map +1 -0
- package/dist/core/agents/reconcile-coordination-v3.js +58 -0
- package/dist/core/agents/render/prompt-context.d.ts +14 -3
- package/dist/core/agents/render/prompt-context.d.ts.map +1 -1
- package/dist/core/agents/render/prompt-context.js +54 -16
- package/dist/core/agents/render/session-context.d.ts +8 -0
- package/dist/core/agents/render/session-context.d.ts.map +1 -1
- package/dist/core/agents/render/session-context.js +34 -3
- package/dist/core/agents/rules/commit-conflict.d.ts.map +1 -1
- package/dist/core/agents/rules/commit-conflict.js +50 -1
- package/dist/core/agents/rules/stop-hook.d.ts +2 -0
- package/dist/core/agents/rules/stop-hook.d.ts.map +1 -1
- package/dist/core/agents/rules/stop-hook.js +93 -16
- package/dist/core/agents/rules/verdict.d.ts +1 -0
- package/dist/core/agents/rules/verdict.d.ts.map +1 -1
- package/dist/core/agents/session-events.d.ts.map +1 -1
- package/dist/core/agents/session-events.js +4 -0
- package/dist/core/agents/session-finalization-state-v3.js +1 -1
- package/dist/core/agents/session-finalizer-v3.js +9 -2
- package/dist/core/agents/state/activity-log.d.ts +3 -0
- package/dist/core/agents/state/activity-log.d.ts.map +1 -1
- package/dist/core/agents/state/activity-log.js +6 -3
- package/dist/core/agents/state/heartbeat-writer.d.ts +6 -0
- package/dist/core/agents/state/heartbeat-writer.d.ts.map +1 -1
- package/dist/core/agents/state/heartbeat-writer.js +18 -0
- package/dist/core/agents/state/live-coordination-view.d.ts +5 -7
- package/dist/core/agents/state/live-coordination-view.d.ts.map +1 -1
- package/dist/core/agents/state/live-coordination-view.js +15 -90
- package/dist/core/agents/state/live-coordination-writer.d.ts +12 -0
- package/dist/core/agents/state/live-coordination-writer.d.ts.map +1 -0
- package/dist/core/agents/state/live-coordination-writer.js +92 -0
- package/dist/core/artifacts/index.d.ts +47 -1
- package/dist/core/artifacts/index.d.ts.map +1 -1
- package/dist/core/artifacts/index.js +191 -6
- package/dist/core/config.d.ts +74 -4
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +141 -4
- package/dist/core/conversations/archive.d.ts +49 -0
- package/dist/core/conversations/archive.d.ts.map +1 -0
- package/dist/core/conversations/archive.js +136 -0
- package/dist/core/conversations/catalog.d.ts +10 -0
- package/dist/core/conversations/catalog.d.ts.map +1 -0
- package/dist/core/conversations/catalog.js +72 -0
- package/dist/core/conversations/context-pack.d.ts +6 -0
- package/dist/core/conversations/context-pack.d.ts.map +1 -0
- package/dist/core/conversations/context-pack.js +60 -0
- package/dist/core/conversations/contract.d.ts +155 -0
- package/dist/core/conversations/contract.d.ts.map +1 -0
- package/dist/core/conversations/contract.js +1 -0
- package/dist/core/conversations/evaluation.d.ts +16 -0
- package/dist/core/conversations/evaluation.d.ts.map +1 -0
- package/dist/core/conversations/evaluation.js +9 -0
- package/dist/core/conversations/index.d.ts +10 -0
- package/dist/core/conversations/index.d.ts.map +1 -0
- package/dist/core/conversations/index.js +9 -0
- package/dist/core/conversations/lifecycle.d.ts +28 -0
- package/dist/core/conversations/lifecycle.d.ts.map +1 -0
- package/dist/core/conversations/lifecycle.js +29 -0
- package/dist/core/conversations/normalize.d.ts +14 -0
- package/dist/core/conversations/normalize.d.ts.map +1 -0
- package/dist/core/conversations/normalize.js +82 -0
- package/dist/core/conversations/query.d.ts +8 -0
- package/dist/core/conversations/query.d.ts.map +1 -0
- package/dist/core/conversations/query.js +280 -0
- package/dist/core/conversations/search-index.d.ts +9 -0
- package/dist/core/conversations/search-index.d.ts.map +1 -0
- package/dist/core/conversations/search-index.js +29 -0
- package/dist/core/diagnostics/advice.d.ts +9 -0
- package/dist/core/diagnostics/advice.d.ts.map +1 -0
- package/dist/core/diagnostics/advice.js +112 -0
- package/dist/core/diagnostics/bundle.d.ts +35 -0
- package/dist/core/diagnostics/bundle.d.ts.map +1 -0
- package/dist/core/diagnostics/bundle.js +874 -0
- package/dist/core/diagnostics/comparison.d.ts +5 -0
- package/dist/core/diagnostics/comparison.d.ts.map +1 -0
- package/dist/core/diagnostics/comparison.js +444 -0
- package/dist/core/diagnostics/contract.d.ts +245 -0
- package/dist/core/diagnostics/contract.d.ts.map +1 -0
- package/dist/core/diagnostics/contract.js +18 -0
- package/dist/core/diagnostics/identity.d.ts +3 -0
- package/dist/core/diagnostics/identity.d.ts.map +1 -0
- package/dist/core/diagnostics/identity.js +10 -0
- package/dist/core/diagnostics/index.d.ts +8 -0
- package/dist/core/diagnostics/index.d.ts.map +1 -0
- package/dist/core/diagnostics/index.js +7 -0
- package/dist/core/diagnostics/replay.d.ts +8 -0
- package/dist/core/diagnostics/replay.d.ts.map +1 -0
- package/dist/core/diagnostics/replay.js +213 -0
- package/dist/core/diagnostics/sanitize.d.ts +9 -0
- package/dist/core/diagnostics/sanitize.d.ts.map +1 -0
- package/dist/core/diagnostics/sanitize.js +84 -0
- package/dist/core/events/legacy-storage/canary.d.ts +18 -0
- package/dist/core/events/legacy-storage/canary.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/canary.js +150 -0
- package/dist/core/events/legacy-storage/compression.d.ts +13 -0
- package/dist/core/events/legacy-storage/compression.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/compression.js +107 -0
- package/dist/core/events/legacy-storage/fence.d.ts +15 -0
- package/dist/core/events/legacy-storage/fence.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/fence.js +115 -0
- package/dist/core/events/legacy-storage/index.d.ts +7 -0
- package/dist/core/events/legacy-storage/index.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/index.js +6 -0
- package/dist/core/events/legacy-storage/inventory.d.ts +10 -0
- package/dist/core/events/legacy-storage/inventory.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/inventory.js +40 -0
- package/dist/core/events/legacy-storage/manifest.d.ts +23 -0
- package/dist/core/events/legacy-storage/manifest.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/manifest.js +108 -0
- package/dist/core/events/legacy-storage/reader.d.ts +15 -0
- package/dist/core/events/legacy-storage/reader.d.ts.map +1 -0
- package/dist/core/events/legacy-storage/reader.js +154 -0
- package/dist/core/events/v3/archive-retention.d.ts +33 -0
- package/dist/core/events/v3/archive-retention.d.ts.map +1 -0
- package/dist/core/events/v3/archive-retention.js +195 -0
- package/dist/core/events/v3/authority-outbox.d.ts +7 -2
- package/dist/core/events/v3/authority-outbox.d.ts.map +1 -1
- package/dist/core/events/v3/authority-outbox.js +16 -3
- package/dist/core/events/v3/base-contract.d.ts +81 -41
- package/dist/core/events/v3/base-contract.d.ts.map +1 -1
- package/dist/core/events/v3/base-contract.js +17 -7
- package/dist/core/events/v3/bootstrap.d.ts +39 -0
- package/dist/core/events/v3/bootstrap.d.ts.map +1 -1
- package/dist/core/events/v3/bootstrap.js +167 -3
- package/dist/core/events/v3/capabilities.d.ts +1 -1
- package/dist/core/events/v3/capabilities.d.ts.map +1 -1
- package/dist/core/events/v3/capabilities.js +4 -3
- package/dist/core/events/v3/control-witness.d.ts +44 -0
- package/dist/core/events/v3/control-witness.d.ts.map +1 -0
- package/dist/core/events/v3/control-witness.js +233 -0
- package/dist/core/events/v3/control-writer.d.ts +4 -0
- package/dist/core/events/v3/control-writer.d.ts.map +1 -0
- package/dist/core/events/v3/control-writer.js +16 -0
- package/dist/core/events/v3/control.d.ts +8 -2
- package/dist/core/events/v3/control.d.ts.map +1 -1
- package/dist/core/events/v3/control.js +46 -18
- package/dist/core/events/v3/coordination-transaction-recovery.d.ts +42 -0
- package/dist/core/events/v3/coordination-transaction-recovery.d.ts.map +1 -0
- package/dist/core/events/v3/coordination-transaction-recovery.js +342 -0
- package/dist/core/events/v3/coordination-view.d.ts.map +1 -1
- package/dist/core/events/v3/coordination-view.js +16 -1
- package/dist/core/events/v3/generated.d.ts +1 -1
- package/dist/core/events/v3/generated.js +1 -1
- package/dist/core/events/v3/index.d.ts +5 -2
- package/dist/core/events/v3/index.d.ts.map +1 -1
- package/dist/core/events/v3/index.js +4 -1
- package/dist/core/events/v3/live-route-observer.d.ts +31 -0
- package/dist/core/events/v3/live-route-observer.d.ts.map +1 -0
- package/dist/core/events/v3/live-route-observer.js +58 -0
- package/dist/core/events/v3/live-routing.d.ts +13 -21
- package/dist/core/events/v3/live-routing.d.ts.map +1 -1
- package/dist/core/events/v3/live-routing.js +46 -41
- package/dist/core/events/v3/producers/coordination-recorder.d.ts +11 -1
- package/dist/core/events/v3/producers/coordination-recorder.d.ts.map +1 -1
- package/dist/core/events/v3/producers/coordination-recorder.js +76 -10
- package/dist/core/events/v3/producers/diagnostic-summaries.d.ts +129 -0
- package/dist/core/events/v3/producers/diagnostic-summaries.d.ts.map +1 -0
- package/dist/core/events/v3/producers/diagnostic-summaries.js +499 -0
- package/dist/core/events/v3/producers/hook-base.d.ts +1 -1
- package/dist/core/events/v3/producers/hook-base.d.ts.map +1 -1
- package/dist/core/events/v3/producers/hook-base.js +14 -3
- package/dist/core/events/v3/producers/intake.d.ts +7 -0
- package/dist/core/events/v3/producers/intake.d.ts.map +1 -1
- package/dist/core/events/v3/producers/intake.js +26 -2
- package/dist/core/events/v3/producers/producer-state-observer.d.ts +8 -0
- package/dist/core/events/v3/producers/producer-state-observer.d.ts.map +1 -0
- package/dist/core/events/v3/producers/producer-state-observer.js +45 -0
- package/dist/core/events/v3/producers/recorder.d.ts +71 -1
- package/dist/core/events/v3/producers/recorder.d.ts.map +1 -1
- package/dist/core/events/v3/producers/recorder.js +441 -25
- package/dist/core/events/v3/reader.d.ts +51 -0
- package/dist/core/events/v3/reader.d.ts.map +1 -1
- package/dist/core/events/v3/reader.js +181 -1
- package/dist/core/events/v3/rotation-config.d.ts +9 -0
- package/dist/core/events/v3/rotation-config.d.ts.map +1 -0
- package/dist/core/events/v3/rotation-config.js +91 -0
- package/dist/core/events/v3/runtime-build.d.ts +11 -0
- package/dist/core/events/v3/runtime-build.d.ts.map +1 -0
- package/dist/core/events/v3/runtime-build.js +39 -0
- package/dist/core/events/v3/runtime-identity.d.ts +5 -0
- package/dist/core/events/v3/runtime-identity.d.ts.map +1 -0
- package/dist/core/events/v3/runtime-identity.js +18 -0
- package/dist/core/events/v3/runtime-telemetry-capabilities.d.ts +6 -5
- package/dist/core/events/v3/runtime-telemetry-capabilities.d.ts.map +1 -1
- package/dist/core/events/v3/runtime-telemetry-capabilities.js +1 -1
- package/dist/core/events/v3/support-storage/classify.d.ts +46 -0
- package/dist/core/events/v3/support-storage/classify.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/classify.js +149 -0
- package/dist/core/events/v3/support-storage/eligibility.d.ts +29 -0
- package/dist/core/events/v3/support-storage/eligibility.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/eligibility.js +35 -0
- package/dist/core/events/v3/support-storage/index.d.ts +10 -0
- package/dist/core/events/v3/support-storage/index.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/index.js +9 -0
- package/dist/core/events/v3/support-storage/inventory.d.ts +30 -0
- package/dist/core/events/v3/support-storage/inventory.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/inventory.js +94 -0
- package/dist/core/events/v3/support-storage/logical-authority.d.ts +14 -0
- package/dist/core/events/v3/support-storage/logical-authority.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/logical-authority.js +104 -0
- package/dist/core/events/v3/support-storage/maintenance.d.ts +98 -0
- package/dist/core/events/v3/support-storage/maintenance.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/maintenance.js +352 -0
- package/dist/core/events/v3/support-storage/pack-contract.d.ts +59 -0
- package/dist/core/events/v3/support-storage/pack-contract.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/pack-contract.js +249 -0
- package/dist/core/events/v3/support-storage/pack-reader.d.ts +34 -0
- package/dist/core/events/v3/support-storage/pack-reader.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/pack-reader.js +258 -0
- package/dist/core/events/v3/support-storage/pack-writer.d.ts +30 -0
- package/dist/core/events/v3/support-storage/pack-writer.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/pack-writer.js +268 -0
- package/dist/core/events/v3/support-storage/recovery.d.ts +15 -0
- package/dist/core/events/v3/support-storage/recovery.d.ts.map +1 -0
- package/dist/core/events/v3/support-storage/recovery.js +22 -0
- package/dist/core/events/v3/turn-telemetry.d.ts +14 -8
- package/dist/core/events/v3/turn-telemetry.d.ts.map +1 -1
- package/dist/core/events/v3/turn-telemetry.js +32 -2
- package/dist/core/events/v3/writer.d.ts +13 -1
- package/dist/core/events/v3/writer.d.ts.map +1 -1
- package/dist/core/events/v3/writer.js +126 -12
- package/dist/core/governor/plan-read.d.ts.map +1 -1
- package/dist/core/governor/plan-read.js +5 -21
- package/dist/core/governor/planning.js +6 -8
- package/dist/core/governor/service-read.d.ts +12 -0
- package/dist/core/governor/service-read.d.ts.map +1 -1
- package/dist/core/governor/service-read.js +266 -2
- package/dist/core/governor/service.d.ts +1 -0
- package/dist/core/governor/service.d.ts.map +1 -1
- package/dist/core/governor/service.js +53 -18
- package/dist/core/guard/evidence-v3.d.ts.map +1 -1
- package/dist/core/guard/evidence-v3.js +2 -0
- package/dist/core/hooks/adapter/events.d.ts.map +1 -1
- package/dist/core/hooks/adapter/events.js +1 -0
- package/dist/core/hooks/adapter/output.d.ts +12 -2
- package/dist/core/hooks/adapter/output.d.ts.map +1 -1
- package/dist/core/hooks/adapter/output.js +23 -5
- package/dist/core/hooks/adapter/runtime-telemetry.d.ts +27 -4
- package/dist/core/hooks/adapter/runtime-telemetry.d.ts.map +1 -1
- package/dist/core/hooks/adapter/runtime-telemetry.js +307 -6
- package/dist/core/hooks/cli.js +380 -207
- package/dist/core/hooks/effects/image-capture.d.ts +1 -1
- package/dist/core/hooks/effects/image-capture.d.ts.map +1 -1
- package/dist/core/hooks/effects/image-capture.js +4 -2
- package/dist/core/hooks/health.d.ts +59 -0
- package/dist/core/hooks/health.d.ts.map +1 -0
- package/dist/core/hooks/health.js +84 -0
- package/dist/core/hooks/remediation-cap.d.ts +8 -3
- package/dist/core/hooks/remediation-cap.d.ts.map +1 -1
- package/dist/core/hooks/remediation-cap.js +3 -11
- package/dist/core/hooks/resolve/coord-root.d.ts +22 -9
- package/dist/core/hooks/resolve/coord-root.d.ts.map +1 -1
- package/dist/core/hooks/resolve/coord-root.js +92 -11
- package/dist/core/hooks/resolve/owner.d.ts.map +1 -1
- package/dist/core/hooks/resolve/owner.js +5 -0
- package/dist/core/hooks/resolve/transcript.d.ts +8 -0
- package/dist/core/hooks/resolve/transcript.d.ts.map +1 -1
- package/dist/core/hooks/resolve/transcript.js +11 -0
- package/dist/core/inbox/contract.d.ts +64 -0
- package/dist/core/inbox/contract.d.ts.map +1 -0
- package/dist/core/inbox/contract.js +13 -0
- package/dist/core/inbox/index.d.ts +5 -0
- package/dist/core/inbox/index.d.ts.map +1 -0
- package/dist/core/inbox/index.js +4 -0
- package/dist/core/inbox/lifecycle.d.ts +22 -0
- package/dist/core/inbox/lifecycle.d.ts.map +1 -0
- package/dist/core/inbox/lifecycle.js +41 -0
- package/dist/core/inbox/service.d.ts +36 -0
- package/dist/core/inbox/service.d.ts.map +1 -0
- package/dist/core/inbox/service.js +210 -0
- package/dist/core/inbox/watcher.d.ts +7 -0
- package/dist/core/inbox/watcher.d.ts.map +1 -0
- package/dist/core/inbox/watcher.js +26 -0
- package/dist/core/presence/codec-digest.d.ts.map +1 -1
- package/dist/core/presence/codec-digest.js +14 -3
- package/dist/core/presence/relay-client.d.ts +1 -0
- package/dist/core/presence/relay-client.d.ts.map +1 -1
- package/dist/core/presence/relay-client.js +52 -8
- package/dist/core/resources/contract.d.ts +90 -0
- package/dist/core/resources/contract.d.ts.map +1 -0
- package/dist/core/resources/contract.js +2 -0
- package/dist/core/resources/index.d.ts +6 -0
- package/dist/core/resources/index.d.ts.map +1 -0
- package/dist/core/resources/index.js +5 -0
- package/dist/core/resources/sampler.d.ts +27 -0
- package/dist/core/resources/sampler.d.ts.map +1 -0
- package/dist/core/resources/sampler.js +357 -0
- package/dist/core/resources/service-status.d.ts +3 -0
- package/dist/core/resources/service-status.d.ts.map +1 -0
- package/dist/core/resources/service-status.js +48 -0
- package/dist/core/resources/service.d.ts +26 -0
- package/dist/core/resources/service.d.ts.map +1 -0
- package/dist/core/resources/service.js +292 -0
- package/dist/core/resources/storage.d.ts +13 -0
- package/dist/core/resources/storage.d.ts.map +1 -0
- package/dist/core/resources/storage.js +30 -0
- package/dist/core/semantic/adapters.d.ts +11 -8
- package/dist/core/semantic/adapters.d.ts.map +1 -1
- package/dist/core/semantic/adapters.js +169 -31
- package/dist/core/semantic/contract.d.ts +532 -48
- package/dist/core/semantic/contract.d.ts.map +1 -1
- package/dist/core/semantic/contract.js +104 -3
- package/dist/core/semantic/index.d.ts +7 -3
- package/dist/core/semantic/index.d.ts.map +1 -1
- package/dist/core/semantic/index.js +7 -3
- package/dist/core/semantic/once.d.ts +6 -1
- package/dist/core/semantic/once.d.ts.map +1 -1
- package/dist/core/semantic/once.js +80 -9
- package/dist/core/semantic/prompt.d.ts.map +1 -1
- package/dist/core/semantic/prompt.js +14 -1
- package/dist/core/semantic/review.d.ts +144 -0
- package/dist/core/semantic/review.d.ts.map +1 -0
- package/dist/core/semantic/review.js +544 -0
- package/dist/core/semantic/routes.d.ts +10 -0
- package/dist/core/semantic/routes.d.ts.map +1 -0
- package/dist/core/semantic/routes.js +21 -0
- package/dist/core/semantic/scheduler.d.ts +14 -3
- package/dist/core/semantic/scheduler.d.ts.map +1 -1
- package/dist/core/semantic/scheduler.js +30 -6
- package/dist/core/semantic/service-status.d.ts +20 -0
- package/dist/core/semantic/service-status.d.ts.map +1 -1
- package/dist/core/semantic/service-status.js +60 -4
- package/dist/core/semantic/service.d.ts +1 -0
- package/dist/core/semantic/service.d.ts.map +1 -1
- package/dist/core/semantic/service.js +104 -15
- package/dist/core/semantic/soak.d.ts +75 -0
- package/dist/core/semantic/soak.d.ts.map +1 -0
- package/dist/core/semantic/soak.js +476 -0
- package/dist/core/semantic/storage.d.ts +11 -1
- package/dist/core/semantic/storage.d.ts.map +1 -1
- package/dist/core/semantic/storage.js +4 -3
- package/dist/core/semantic/usage.d.ts +43 -0
- package/dist/core/semantic/usage.d.ts.map +1 -0
- package/dist/core/semantic/usage.js +193 -0
- package/dist/core/semantic/validate.d.ts +3 -1
- package/dist/core/semantic/validate.d.ts.map +1 -1
- package/dist/core/semantic/validate.js +34 -1
- package/dist/core/storage/atomic-json.d.ts +3 -0
- package/dist/core/storage/atomic-json.d.ts.map +1 -0
- package/dist/core/storage/atomic-json.js +15 -0
- package/dist/core/storage/buffer.d.ts +28 -0
- package/dist/core/storage/buffer.d.ts.map +1 -0
- package/dist/core/storage/buffer.js +101 -0
- package/dist/core/storage/builtins.d.ts +3 -0
- package/dist/core/storage/builtins.d.ts.map +1 -0
- package/dist/core/storage/builtins.js +722 -0
- package/dist/core/storage/catalog.d.ts +19 -0
- package/dist/core/storage/catalog.d.ts.map +1 -0
- package/dist/core/storage/catalog.js +365 -0
- package/dist/core/storage/config.d.ts +16 -0
- package/dist/core/storage/config.d.ts.map +1 -0
- package/dist/core/storage/config.js +311 -0
- package/dist/core/storage/contract.d.ts +275 -0
- package/dist/core/storage/contract.d.ts.map +1 -0
- package/dist/core/storage/contract.js +3 -0
- package/dist/core/storage/durable-history.d.ts +36 -0
- package/dist/core/storage/durable-history.d.ts.map +1 -0
- package/dist/core/storage/durable-history.js +606 -0
- package/dist/core/storage/health.d.ts +4 -0
- package/dist/core/storage/health.d.ts.map +1 -0
- package/dist/core/storage/health.js +65 -0
- package/dist/core/storage/index.d.ts +16 -0
- package/dist/core/storage/index.d.ts.map +1 -0
- package/dist/core/storage/index.js +15 -0
- package/dist/core/storage/inventory.d.ts +25 -0
- package/dist/core/storage/inventory.d.ts.map +1 -0
- package/dist/core/storage/inventory.js +666 -0
- package/dist/core/storage/jsonl.d.ts +52 -0
- package/dist/core/storage/jsonl.d.ts.map +1 -0
- package/dist/core/storage/jsonl.js +156 -0
- package/dist/core/storage/log-retention.d.ts +52 -0
- package/dist/core/storage/log-retention.d.ts.map +1 -0
- package/dist/core/storage/log-retention.js +419 -0
- package/dist/core/storage/logger.d.ts +84 -0
- package/dist/core/storage/logger.d.ts.map +1 -0
- package/dist/core/storage/logger.js +413 -0
- package/dist/core/storage/maintenance-providers.d.ts +26 -0
- package/dist/core/storage/maintenance-providers.d.ts.map +1 -0
- package/dist/core/storage/maintenance-providers.js +141 -0
- package/dist/core/storage/maintenance.d.ts +125 -0
- package/dist/core/storage/maintenance.d.ts.map +1 -0
- package/dist/core/storage/maintenance.js +609 -0
- package/dist/core/storage/metrics.d.ts +60 -0
- package/dist/core/storage/metrics.d.ts.map +1 -0
- package/dist/core/storage/metrics.js +134 -0
- package/dist/core/storage/policy.d.ts +7 -0
- package/dist/core/storage/policy.d.ts.map +1 -0
- package/dist/core/storage/policy.js +110 -0
- package/dist/core/storage/process-log.d.ts +38 -0
- package/dist/core/storage/process-log.d.ts.map +1 -0
- package/dist/core/storage/process-log.js +165 -0
- package/dist/core/storage/query.d.ts +48 -0
- package/dist/core/storage/query.d.ts.map +1 -0
- package/dist/core/storage/query.js +346 -0
- package/dist/core/storage/receipts.d.ts +23 -0
- package/dist/core/storage/receipts.d.ts.map +1 -0
- package/dist/core/storage/receipts.js +117 -0
- package/dist/core/storage/segments.d.ts +84 -0
- package/dist/core/storage/segments.d.ts.map +1 -0
- package/dist/core/storage/segments.js +542 -0
- package/dist/core/storage/sink-graph.d.ts +65 -0
- package/dist/core/storage/sink-graph.d.ts.map +1 -0
- package/dist/core/storage/sink-graph.js +213 -0
- package/dist/core/storage/storm-control.d.ts +23 -0
- package/dist/core/storage/storm-control.d.ts.map +1 -0
- package/dist/core/storage/storm-control.js +59 -0
- package/dist/core/supervisor/activity.d.ts +4 -0
- package/dist/core/supervisor/activity.d.ts.map +1 -0
- package/dist/core/supervisor/activity.js +141 -0
- package/dist/core/supervisor/contract.d.ts +268 -0
- package/dist/core/supervisor/contract.d.ts.map +1 -0
- package/dist/core/supervisor/contract.js +35 -0
- package/dist/core/supervisor/explanations.d.ts +4 -0
- package/dist/core/supervisor/explanations.d.ts.map +1 -0
- package/dist/core/supervisor/explanations.js +71 -0
- package/dist/core/supervisor/findings.d.ts +20 -0
- package/dist/core/supervisor/findings.d.ts.map +1 -0
- package/dist/core/supervisor/findings.js +399 -0
- package/dist/core/supervisor/history.d.ts +9 -0
- package/dist/core/supervisor/history.d.ts.map +1 -0
- package/dist/core/supervisor/history.js +46 -0
- package/dist/core/supervisor/hook-health-alerts.d.ts +14 -0
- package/dist/core/supervisor/hook-health-alerts.d.ts.map +1 -0
- package/dist/core/supervisor/hook-health-alerts.js +70 -0
- package/dist/core/supervisor/hook-health-storage.d.ts +5 -0
- package/dist/core/supervisor/hook-health-storage.d.ts.map +1 -0
- package/dist/core/supervisor/hook-health-storage.js +24 -0
- package/dist/core/supervisor/hook-health.d.ts +72 -0
- package/dist/core/supervisor/hook-health.d.ts.map +1 -0
- package/dist/core/supervisor/hook-health.js +203 -0
- package/dist/core/supervisor/hooks.d.ts +10 -0
- package/dist/core/supervisor/hooks.d.ts.map +1 -0
- package/dist/core/supervisor/hooks.js +28 -0
- package/dist/core/supervisor/index.d.ts +15 -0
- package/dist/core/supervisor/index.d.ts.map +1 -0
- package/dist/core/supervisor/index.js +14 -0
- package/dist/core/supervisor/log-feed.d.ts +9 -0
- package/dist/core/supervisor/log-feed.d.ts.map +1 -0
- package/dist/core/supervisor/log-feed.js +103 -0
- package/dist/core/supervisor/service.d.ts +29 -0
- package/dist/core/supervisor/service.d.ts.map +1 -0
- package/dist/core/supervisor/service.js +450 -0
- package/dist/core/supervisor/services.d.ts +11 -0
- package/dist/core/supervisor/services.d.ts.map +1 -0
- package/dist/core/supervisor/services.js +155 -0
- package/dist/core/supervisor/status.d.ts +3 -0
- package/dist/core/supervisor/status.d.ts.map +1 -0
- package/dist/core/supervisor/status.js +48 -0
- package/dist/core/supervisor/storage.d.ts +30 -0
- package/dist/core/supervisor/storage.d.ts.map +1 -0
- package/dist/core/supervisor/storage.js +73 -0
- package/dist/core/supervisor/timeline.d.ts +3 -0
- package/dist/core/supervisor/timeline.d.ts.map +1 -0
- package/dist/core/supervisor/timeline.js +87 -0
- package/dist/core/work/state.d.ts.map +1 -1
- package/dist/core/work/state.js +10 -14
- package/dist/core/workflow/admission.d.ts +23 -0
- package/dist/core/workflow/admission.d.ts.map +1 -0
- package/dist/core/workflow/admission.js +136 -0
- package/dist/core/workflow/engine.d.ts.map +1 -1
- package/dist/core/workflow/engine.js +77 -2
- package/dist/core/workflow/index.d.ts +3 -2
- package/dist/core/workflow/index.d.ts.map +1 -1
- package/dist/core/workflow/index.js +2 -1
- package/dist/core/workflow/live-session-v3.d.ts.map +1 -1
- package/dist/core/workflow/live-session-v3.js +2 -1
- package/dist/core/workflow/proof.d.ts +2 -1
- package/dist/core/workflow/proof.d.ts.map +1 -1
- package/dist/core/workflow/proof.js +39 -1
- package/dist/core/workflow/run-state.d.ts +3 -2
- package/dist/core/workflow/run-state.d.ts.map +1 -1
- package/dist/core/workflow/run-state.js +8 -1
- package/dist/core/workflow/types.d.ts +33 -1
- package/dist/core/workflow/types.d.ts.map +1 -1
- package/dist/core/workflow/types.js +2 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/lazy-commands.d.ts +26 -0
- package/dist/lazy-commands.d.ts.map +1 -0
- package/dist/lazy-commands.js +210 -0
- package/dist/lib/browser/client.d.ts +5 -0
- package/dist/lib/browser/client.d.ts.map +1 -1
- package/dist/lib/browser/client.js +1 -0
- package/dist/lib/browser/index.d.ts +2 -0
- package/dist/lib/browser/index.d.ts.map +1 -1
- package/dist/lib/browser/index.js +2 -0
- package/dist/lib/browser/qa-run-contracts.d.ts +173 -0
- package/dist/lib/browser/qa-run-contracts.d.ts.map +1 -0
- package/dist/lib/browser/qa-run-contracts.js +226 -0
- package/dist/lib/browser/qa-run.d.ts +51 -0
- package/dist/lib/browser/qa-run.d.ts.map +1 -0
- package/dist/lib/browser/qa-run.js +684 -0
- package/dist/lib/coord-root-id.d.ts +9 -0
- package/dist/lib/coord-root-id.d.ts.map +1 -0
- package/dist/lib/coord-root-id.js +17 -0
- package/dist/lib/docs-lint.d.ts +2 -0
- package/dist/lib/docs-lint.d.ts.map +1 -1
- package/dist/lib/docs-lint.js +45 -80
- package/dist/lib/docs-metadata-audit.d.ts +3 -0
- package/dist/lib/docs-metadata-audit.d.ts.map +1 -1
- package/dist/lib/docs-metadata-audit.js +13 -23
- package/dist/lib/docs-metadata-sync.d.ts +1 -0
- package/dist/lib/docs-metadata-sync.d.ts.map +1 -1
- package/dist/lib/docs-metadata-sync.js +28 -10
- package/dist/lib/docs-repository-view.d.ts +22 -0
- package/dist/lib/docs-repository-view.d.ts.map +1 -0
- package/dist/lib/docs-repository-view.js +185 -0
- package/dist/lib/http/client.d.ts +11 -5
- package/dist/lib/http/client.d.ts.map +1 -1
- package/dist/lib/http/client.js +22 -4
- package/dist/lib/http/index.d.ts +1 -1
- package/dist/lib/http/index.d.ts.map +1 -1
- package/dist/lib/http/index.js +1 -1
- package/dist/lib/indexer-exclusions.d.ts +27 -0
- package/dist/lib/indexer-exclusions.d.ts.map +1 -0
- package/dist/lib/indexer-exclusions.js +176 -0
- package/dist/lib/instructions/apply.d.ts +3 -1
- package/dist/lib/instructions/apply.d.ts.map +1 -1
- package/dist/lib/instructions/apply.js +74 -3
- package/dist/lib/instructions/templates.d.ts.map +1 -1
- package/dist/lib/instructions/templates.js +11 -0
- package/dist/lib/local-file-url.d.ts +9 -0
- package/dist/lib/local-file-url.d.ts.map +1 -0
- package/dist/lib/local-file-url.js +20 -0
- package/dist/lib/web-performance.d.ts +118 -0
- package/dist/lib/web-performance.d.ts.map +1 -0
- package/dist/lib/web-performance.js +192 -0
- package/package.json +40 -2
- package/schemas/config.schema.json +58 -0
- package/schemas/event-v3.schema.json +324 -112
- package/src/commander.ts +488 -95
- package/src/commands/agents.ts +617 -237
- package/src/commands/artifacts.ts +40 -2
- package/src/commands/backup.ts +18 -14
- package/src/commands/browse-session.ts +12 -0
- package/src/commands/browse.ts +21 -7
- package/src/commands/conversations.ts +279 -0
- package/src/commands/deinit.ts +6 -0
- package/src/commands/diagnostics.ts +271 -0
- package/src/commands/docs.ts +25 -6
- package/src/commands/doctor.ts +75 -9
- package/src/commands/fetch.ts +7 -6
- package/src/commands/files.ts +243 -0
- package/src/commands/governor.ts +21 -12
- package/src/commands/inbox.ts +61 -0
- package/src/commands/init.ts +78 -16
- package/src/commands/ledger-v3.ts +503 -1
- package/src/commands/logs.ts +224 -0
- package/src/commands/messages.ts +61 -0
- package/src/commands/outline.ts +6 -2
- package/src/commands/qa-run.ts +184 -0
- package/src/commands/read.ts +6 -2
- package/src/commands/resources.ts +38 -0
- package/src/commands/semantic.ts +66 -1
- package/src/commands/storage.ts +310 -0
- package/src/commands/supervisor.ts +141 -0
- package/src/commands/tunnel.ts +66 -52
- package/src/commands/web.ts +96 -7
- package/src/commands/work.ts +3 -3
- package/src/commands/workflow.ts +21 -13
- package/src/core/agents/cli.ts +265 -55
- package/src/core/agents/health.ts +142 -0
- package/src/core/agents/live-authority-v3.ts +341 -10
- package/src/core/agents/live-lifecycle-v3.ts +6 -1
- package/src/core/agents/live-observation-v3.ts +6 -1
- package/src/core/agents/mailbox.ts +373 -0
- package/src/core/agents/reconcile-coordination-v3.ts +77 -0
- package/src/core/agents/render/prompt-context.ts +66 -15
- package/src/core/agents/render/session-context.ts +37 -3
- package/src/core/agents/rules/commit-conflict.ts +58 -1
- package/src/core/agents/rules/stop-hook.ts +105 -20
- package/src/core/agents/rules/verdict.ts +1 -0
- package/src/core/agents/session-events.ts +4 -0
- package/src/core/agents/session-finalization-state-v3.ts +1 -1
- package/src/core/agents/session-finalizer-v3.ts +8 -2
- package/src/core/agents/state/activity-log.ts +7 -2
- package/src/core/agents/state/heartbeat-writer.ts +27 -0
- package/src/core/agents/state/live-coordination-view.ts +16 -105
- package/src/core/agents/state/live-coordination-writer.ts +141 -0
- package/src/core/artifacts/index.ts +260 -11
- package/src/core/config.ts +235 -5
- package/src/core/conversations/archive.ts +237 -0
- package/src/core/conversations/catalog.ts +79 -0
- package/src/core/conversations/context-pack.ts +72 -0
- package/src/core/conversations/contract.ts +178 -0
- package/src/core/conversations/evaluation.ts +30 -0
- package/src/core/conversations/index.ts +9 -0
- package/src/core/conversations/lifecycle.ts +63 -0
- package/src/core/conversations/normalize.ts +105 -0
- package/src/core/conversations/query.ts +318 -0
- package/src/core/conversations/search-index.ts +48 -0
- package/src/core/diagnostics/advice.ts +147 -0
- package/src/core/diagnostics/bundle.ts +1142 -0
- package/src/core/diagnostics/comparison.ts +565 -0
- package/src/core/diagnostics/contract.ts +311 -0
- package/src/core/diagnostics/identity.ts +11 -0
- package/src/core/diagnostics/index.ts +7 -0
- package/src/core/diagnostics/replay.ts +314 -0
- package/src/core/diagnostics/sanitize.ts +97 -0
- package/src/core/events/legacy-storage/canary.ts +177 -0
- package/src/core/events/legacy-storage/compression.ts +130 -0
- package/src/core/events/legacy-storage/fence.ts +129 -0
- package/src/core/events/legacy-storage/index.ts +6 -0
- package/src/core/events/legacy-storage/inventory.ts +51 -0
- package/src/core/events/legacy-storage/manifest.ts +136 -0
- package/src/core/events/legacy-storage/reader.ts +178 -0
- package/src/core/events/v3/archive-retention.ts +251 -0
- package/src/core/events/v3/authority-outbox.ts +22 -1
- package/src/core/events/v3/base-contract.ts +17 -7
- package/src/core/events/v3/bootstrap.ts +195 -2
- package/src/core/events/v3/capabilities.ts +5 -3
- package/src/core/events/v3/control-witness.ts +339 -0
- package/src/core/events/v3/control-writer.ts +16 -0
- package/src/core/events/v3/control.ts +54 -18
- package/src/core/events/v3/coordination-transaction-recovery.ts +477 -0
- package/src/core/events/v3/coordination-view.ts +17 -1
- package/src/core/events/v3/generated.ts +1 -1
- package/src/core/events/v3/index.ts +14 -2
- package/src/core/events/v3/live-route-observer.ts +80 -0
- package/src/core/events/v3/live-routing.ts +65 -46
- package/src/core/events/v3/producers/coordination-recorder.ts +95 -10
- package/src/core/events/v3/producers/diagnostic-summaries.ts +593 -0
- package/src/core/events/v3/producers/hook-base.ts +15 -3
- package/src/core/events/v3/producers/intake.ts +31 -2
- package/src/core/events/v3/producers/producer-state-observer.ts +52 -0
- package/src/core/events/v3/producers/recorder.ts +681 -34
- package/src/core/events/v3/reader.ts +243 -2
- package/src/core/events/v3/rotation-config.ts +98 -0
- package/src/core/events/v3/runtime-build.ts +41 -0
- package/src/core/events/v3/runtime-identity.ts +16 -0
- package/src/core/events/v3/runtime-telemetry-capabilities.ts +14 -8
- package/src/core/events/v3/support-storage/classify.ts +209 -0
- package/src/core/events/v3/support-storage/eligibility.ts +58 -0
- package/src/core/events/v3/support-storage/index.ts +9 -0
- package/src/core/events/v3/support-storage/inventory.ts +135 -0
- package/src/core/events/v3/support-storage/logical-authority.ts +117 -0
- package/src/core/events/v3/support-storage/maintenance.ts +501 -0
- package/src/core/events/v3/support-storage/pack-contract.ts +337 -0
- package/src/core/events/v3/support-storage/pack-reader.ts +346 -0
- package/src/core/events/v3/support-storage/pack-writer.ts +352 -0
- package/src/core/events/v3/support-storage/recovery.ts +43 -0
- package/src/core/events/v3/turn-telemetry.ts +58 -7
- package/src/core/events/v3/writer.ts +168 -16
- package/src/core/governor/plan-read.ts +5 -18
- package/src/core/governor/planning.ts +5 -8
- package/src/core/governor/service-read.ts +320 -2
- package/src/core/governor/service.ts +49 -22
- package/src/core/guard/evidence-v3.ts +1 -0
- package/src/core/hooks/adapter/events.ts +1 -0
- package/src/core/hooks/adapter/output.ts +23 -5
- package/src/core/hooks/adapter/runtime-telemetry.ts +408 -13
- package/src/core/hooks/cli.ts +404 -233
- package/src/core/hooks/effects/image-capture.ts +4 -1
- package/src/core/hooks/health.ts +146 -0
- package/src/core/hooks/remediation-cap.ts +12 -6
- package/src/core/hooks/resolve/coord-root.ts +91 -11
- package/src/core/hooks/resolve/owner.ts +4 -0
- package/src/core/hooks/resolve/transcript.ts +18 -0
- package/src/core/inbox/contract.ts +81 -0
- package/src/core/inbox/index.ts +4 -0
- package/src/core/inbox/lifecycle.ts +104 -0
- package/src/core/inbox/service.ts +305 -0
- package/src/core/inbox/watcher.ts +36 -0
- package/src/core/presence/codec-digest.ts +15 -9
- package/src/core/presence/relay-client.ts +55 -7
- package/src/core/resources/contract.ts +98 -0
- package/src/core/resources/index.ts +5 -0
- package/src/core/resources/sampler.ts +458 -0
- package/src/core/resources/service-status.ts +62 -0
- package/src/core/resources/service.ts +337 -0
- package/src/core/resources/storage.ts +44 -0
- package/src/core/semantic/adapters.ts +200 -41
- package/src/core/semantic/contract.ts +135 -3
- package/src/core/semantic/index.ts +76 -2
- package/src/core/semantic/once.ts +93 -7
- package/src/core/semantic/prompt.ts +13 -1
- package/src/core/semantic/review.ts +803 -0
- package/src/core/semantic/routes.ts +30 -0
- package/src/core/semantic/scheduler.ts +49 -5
- package/src/core/semantic/service-status.ts +99 -5
- package/src/core/semantic/service.ts +116 -15
- package/src/core/semantic/soak.ts +638 -0
- package/src/core/semantic/storage.ts +20 -6
- package/src/core/semantic/usage.ts +272 -0
- package/src/core/semantic/validate.ts +31 -0
- package/src/core/storage/atomic-json.ts +15 -0
- package/src/core/storage/buffer.ts +124 -0
- package/src/core/storage/builtins.ts +972 -0
- package/src/core/storage/catalog.ts +467 -0
- package/src/core/storage/config.ts +423 -0
- package/src/core/storage/contract.ts +342 -0
- package/src/core/storage/durable-history.ts +738 -0
- package/src/core/storage/health.ts +76 -0
- package/src/core/storage/index.ts +15 -0
- package/src/core/storage/inventory.ts +859 -0
- package/src/core/storage/jsonl.ts +213 -0
- package/src/core/storage/log-retention.ts +555 -0
- package/src/core/storage/logger.ts +548 -0
- package/src/core/storage/maintenance-providers.ts +200 -0
- package/src/core/storage/maintenance.ts +929 -0
- package/src/core/storage/metrics.ts +199 -0
- package/src/core/storage/policy.ts +141 -0
- package/src/core/storage/process-log.ts +203 -0
- package/src/core/storage/query.ts +418 -0
- package/src/core/storage/receipts.ts +162 -0
- package/src/core/storage/segments.ts +721 -0
- package/src/core/storage/sink-graph.ts +343 -0
- package/src/core/storage/storm-control.ts +91 -0
- package/src/core/supervisor/activity.ts +193 -0
- package/src/core/supervisor/contract.ts +312 -0
- package/src/core/supervisor/explanations.ts +104 -0
- package/src/core/supervisor/findings.ts +788 -0
- package/src/core/supervisor/history.ts +61 -0
- package/src/core/supervisor/hook-health-alerts.ts +108 -0
- package/src/core/supervisor/hook-health-storage.ts +25 -0
- package/src/core/supervisor/hook-health.ts +301 -0
- package/src/core/supervisor/hooks.ts +35 -0
- package/src/core/supervisor/index.ts +14 -0
- package/src/core/supervisor/log-feed.ts +131 -0
- package/src/core/supervisor/service.ts +511 -0
- package/src/core/supervisor/services.ts +203 -0
- package/src/core/supervisor/status.ts +59 -0
- package/src/core/supervisor/storage.ts +126 -0
- package/src/core/supervisor/timeline.ts +133 -0
- package/src/core/work/state.ts +12 -21
- package/src/core/workflow/admission.ts +215 -0
- package/src/core/workflow/engine.ts +93 -1
- package/src/core/workflow/index.ts +10 -0
- package/src/core/workflow/live-session-v3.ts +2 -4
- package/src/core/workflow/proof.ts +54 -1
- package/src/core/workflow/run-state.ts +13 -1
- package/src/core/workflow/types.ts +39 -1
- package/src/index.ts +2 -0
- package/src/lazy-commands.ts +294 -0
- package/src/lib/browser/client.ts +6 -0
- package/src/lib/browser/index.ts +29 -0
- package/src/lib/browser/qa-run-contracts.ts +380 -0
- package/src/lib/browser/qa-run.ts +784 -0
- package/src/lib/coord-root-id.ts +23 -0
- package/src/lib/docs-lint.ts +58 -77
- package/src/lib/docs-metadata-audit.ts +26 -21
- package/src/lib/docs-metadata-sync.ts +32 -9
- package/src/lib/docs-repository-view.ts +220 -0
- package/src/lib/http/client.ts +44 -8
- package/src/lib/http/index.ts +6 -1
- package/src/lib/indexer-exclusions.ts +173 -0
- package/src/lib/instructions/apply.ts +81 -2
- package/src/lib/instructions/templates.ts +11 -0
- package/src/lib/local-file-url.ts +31 -0
- package/src/lib/web-performance.ts +335 -0
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { spawnSync } from "node:child_process";
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
3
|
+
import { existsSync, mkdirSync, readFileSync } from "node:fs";
|
|
4
4
|
import { resolve } from "node:path";
|
|
5
|
-
import {
|
|
5
|
+
import { compressSealedLegacyV1Segments, inventoryLegacyV1Segments, streamLegacyV1Rows, verifyLegacyV1HardFence, writeLegacyV1Canary, } from "../core/events/legacy-storage/index.js";
|
|
6
|
+
import { cleanEventV3Archives, initializeEventLedgerV3, inventoryEventV3Archives, readEventV3ControlState, recoverInvalidEventLedgerV3, sha256V3, } from "../core/events/v3/index.js";
|
|
7
|
+
import { authorizeEventV3SupportReplacement, inventoryEventV3Support, planEventV3SupportReplacement, planEventV3SupportTransaction, readEventV3SupportPackManifest, readEventV3SupportTransaction, streamEventV3SupportPackRecords, unpackEventV3SupportPack, verifyEventV3SupportTransactionShadow, writeEventV3SupportTransactionShadow, } from "../core/events/v3/support-storage/index.js";
|
|
6
8
|
/** Inspect or initialize the universal V3 event ledger. */
|
|
7
9
|
export function registerLedgerV3Command(program, emit, context) {
|
|
8
10
|
const command = program
|
|
@@ -19,6 +21,38 @@ export function registerLedgerV3Command(program, emit, context) {
|
|
|
19
21
|
emitFailure(emit, "ledger_v3_status_failed", error);
|
|
20
22
|
}
|
|
21
23
|
});
|
|
24
|
+
const archives = command
|
|
25
|
+
.command("archives")
|
|
26
|
+
.description("Inventory and enforce bounded retention for complete closed V3 epochs");
|
|
27
|
+
archives
|
|
28
|
+
.command("list")
|
|
29
|
+
.description("Show closed epochs, retention classifications, and planned actions")
|
|
30
|
+
.option("--root <path>", "Explicit coordination root")
|
|
31
|
+
.action((options) => {
|
|
32
|
+
try {
|
|
33
|
+
const rows = inventoryEventV3Archives(resolve(options.root ?? coordRoot(context)));
|
|
34
|
+
emit.data({ rows, meta: summarizeArchiveRows(rows) });
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
emitFailure(emit, "ledger_v3_archive_inventory_failed", error);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
archives
|
|
41
|
+
.command("clean")
|
|
42
|
+
.description("Preview closed-epoch deletion; pass --yes to execute the exact current plan")
|
|
43
|
+
.option("--root <path>", "Explicit coordination root")
|
|
44
|
+
.option("--yes", "Delete only epochs still classified expired or over-budget")
|
|
45
|
+
.action((options) => {
|
|
46
|
+
try {
|
|
47
|
+
const rows = cleanEventV3Archives(resolve(options.root ?? coordRoot(context)), {
|
|
48
|
+
yes: options.yes,
|
|
49
|
+
});
|
|
50
|
+
emit.data({ rows, meta: summarizeArchiveRows(rows) });
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
emitFailure(emit, "ledger_v3_archive_cleanup_failed", error);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
22
56
|
command
|
|
23
57
|
.command("initialize")
|
|
24
58
|
.description("Create V3 control state, or archive and replace the current V3 epoch")
|
|
@@ -64,6 +98,281 @@ export function registerLedgerV3Command(program, emit, context) {
|
|
|
64
98
|
emitFailure(emit, "ledger_v3_recovery_failed", error);
|
|
65
99
|
}
|
|
66
100
|
});
|
|
101
|
+
command
|
|
102
|
+
.command("verify-support")
|
|
103
|
+
.description("Validate one V3 support-pack manifest and every packed source digest")
|
|
104
|
+
.argument("<manifest>", "Support-pack manifest path")
|
|
105
|
+
.action(async (manifest) => {
|
|
106
|
+
try {
|
|
107
|
+
const path = resolve(manifest);
|
|
108
|
+
const supportManifest = await readEventV3SupportPackManifest(path);
|
|
109
|
+
let entries = 0;
|
|
110
|
+
for await (const _record of streamEventV3SupportPackRecords(path))
|
|
111
|
+
entries += 1;
|
|
112
|
+
emit.data({
|
|
113
|
+
valid: true,
|
|
114
|
+
pack_id: supportManifest.pack_id,
|
|
115
|
+
entries,
|
|
116
|
+
source_files_digest: supportManifest.authority.source_files_digest,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
catch (error) {
|
|
120
|
+
emitFailure(emit, "ledger_v3_support_verify_failed", error);
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
command
|
|
124
|
+
.command("unpack-support")
|
|
125
|
+
.description("Unpack one verified support pack into a new explicit destination")
|
|
126
|
+
.argument("<manifest>", "Support-pack manifest path")
|
|
127
|
+
.requiredOption("--out <directory>", "New destination; existing paths are refused")
|
|
128
|
+
.action(async (manifest, options) => {
|
|
129
|
+
try {
|
|
130
|
+
emit.data(await unpackEventV3SupportPack(resolve(manifest), resolve(options.out)));
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
emitFailure(emit, "ledger_v3_support_unpack_failed", error);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
command
|
|
137
|
+
.command("support-transaction-status")
|
|
138
|
+
.description("Read one exact V3 support maintenance transaction")
|
|
139
|
+
.requiredOption("--transaction <id>", "Exact support maintenance transaction")
|
|
140
|
+
.option("--root <path>", "Explicit coordination root")
|
|
141
|
+
.action(async (options) => {
|
|
142
|
+
try {
|
|
143
|
+
const root = resolve(options.root ?? coordRoot(context));
|
|
144
|
+
emit.data(await readEventV3SupportTransaction(transactionRoot(root), options.transaction));
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
emitFailure(emit, "ledger_v3_support_transaction_status_failed", error);
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
command
|
|
151
|
+
.command("support-plan")
|
|
152
|
+
.description("Inventory explicit V3 support evidence and persist a shadow-only transaction")
|
|
153
|
+
.requiredOption("--authority-root <directory>", "Exact active or archived authority root")
|
|
154
|
+
.requiredOption("--authority-state <state>", "Authority state: active or archived")
|
|
155
|
+
.requiredOption("--root-id <id>", "Authority root identifier")
|
|
156
|
+
.requiredOption("--genesis-id <id>", "Authority genesis binding")
|
|
157
|
+
.requiredOption("--evidence <json>", "JSON evidence map keyed by every support relative path")
|
|
158
|
+
.requiredOption("--observed-at <timestamp>", "Explicit ISO-8601 inventory time")
|
|
159
|
+
.requiredOption("--catalog-version <version>", "Storage catalog version used for the plan")
|
|
160
|
+
.requiredOption("--policy-version <version>", "Support classification policy version")
|
|
161
|
+
.option("--source-authority-digest <digest>", "Required archived authority digest")
|
|
162
|
+
.option("--root <path>", "Explicit coordination root for transaction persistence")
|
|
163
|
+
.action(async (options) => {
|
|
164
|
+
try {
|
|
165
|
+
const state = supportAuthorityState(options.authorityState);
|
|
166
|
+
const observedAt = exactIsoTimestamp(options.observedAt);
|
|
167
|
+
const evidence = readSupportEvidence(resolve(options.evidence));
|
|
168
|
+
const entries = await inventoryEventV3Support({
|
|
169
|
+
authority_root: resolve(options.authorityRoot),
|
|
170
|
+
authority: {
|
|
171
|
+
state,
|
|
172
|
+
genesis_id: nonemptyOption(options.genesisId, "genesis-id"),
|
|
173
|
+
},
|
|
174
|
+
now: observedAt,
|
|
175
|
+
evidence,
|
|
176
|
+
});
|
|
177
|
+
if (!sameSortedStrings(Object.keys(evidence), entries.map((entry) => entry.relative_path))) {
|
|
178
|
+
throw new Error("event_v3_support_plan_evidence_paths_mismatch");
|
|
179
|
+
}
|
|
180
|
+
if (entries.some((entry) => entry.disposition !== "pack-eligible")) {
|
|
181
|
+
throw new Error("event_v3_support_transaction_contains_ineligible_source");
|
|
182
|
+
}
|
|
183
|
+
const rootId = nonemptyOption(options.rootId, "root-id");
|
|
184
|
+
const genesisId = nonemptyOption(options.genesisId, "genesis-id");
|
|
185
|
+
const catalogVersion = nonemptyOption(options.catalogVersion, "catalog-version");
|
|
186
|
+
const policyVersion = nonemptyOption(options.policyVersion, "policy-version");
|
|
187
|
+
const authorityDigest = options.sourceAuthorityDigest
|
|
188
|
+
? exactSha256(options.sourceAuthorityDigest)
|
|
189
|
+
: undefined;
|
|
190
|
+
if (state === "archived" && !authorityDigest) {
|
|
191
|
+
throw new Error("event_v3_support_transaction_archive_digest_required");
|
|
192
|
+
}
|
|
193
|
+
if (state === "active" && authorityDigest) {
|
|
194
|
+
throw new Error("event_v3_support_transaction_active_digest_forbidden");
|
|
195
|
+
}
|
|
196
|
+
const root = resolve(options.root ?? coordRoot(context));
|
|
197
|
+
const transactions = transactionRoot(root);
|
|
198
|
+
mkdirSync(transactions, { recursive: true, mode: 0o700 });
|
|
199
|
+
emit.data(await planEventV3SupportTransaction({
|
|
200
|
+
transaction_root: transactions,
|
|
201
|
+
authority_root: resolve(options.authorityRoot),
|
|
202
|
+
root_id: rootId,
|
|
203
|
+
genesis_id: genesisId,
|
|
204
|
+
authority_state: state,
|
|
205
|
+
...(authorityDigest ? { source_authority_digest: authorityDigest } : {}),
|
|
206
|
+
entries,
|
|
207
|
+
catalog_version: catalogVersion,
|
|
208
|
+
policy_version: policyVersion,
|
|
209
|
+
now: observedAt,
|
|
210
|
+
}));
|
|
211
|
+
}
|
|
212
|
+
catch (error) {
|
|
213
|
+
emitFailure(emit, "ledger_v3_support_plan_failed", error);
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
command
|
|
217
|
+
.command("support-shadow")
|
|
218
|
+
.description("Write and verify a shadow pack while preserving every loose source")
|
|
219
|
+
.requiredOption("--transaction <id>", "Exact support maintenance transaction")
|
|
220
|
+
.requiredOption("--genesis-id <id>", "Current authority genesis binding")
|
|
221
|
+
.requiredOption("--minimum-harnery-version <version>", "Minimum pack-aware Harnery version")
|
|
222
|
+
.option("--root <path>", "Explicit coordination root")
|
|
223
|
+
.action(async (options) => {
|
|
224
|
+
try {
|
|
225
|
+
const root = resolve(options.root ?? coordRoot(context));
|
|
226
|
+
const transactions = transactionRoot(root);
|
|
227
|
+
let current = await readEventV3SupportTransaction(transactions, options.transaction);
|
|
228
|
+
if (current.authority.genesis_id !== options.genesisId) {
|
|
229
|
+
throw new Error("event_v3_support_transaction_genesis_mismatch");
|
|
230
|
+
}
|
|
231
|
+
if (current.state === "planned") {
|
|
232
|
+
current = await writeEventV3SupportTransactionShadow({
|
|
233
|
+
transaction_root: transactions,
|
|
234
|
+
transaction_id: current.transaction_id,
|
|
235
|
+
minimum_harnery_version: options.minimumHarneryVersion,
|
|
236
|
+
now: new Date().toISOString(),
|
|
237
|
+
});
|
|
238
|
+
}
|
|
239
|
+
if (current.state === "shadow-written") {
|
|
240
|
+
current = await verifyEventV3SupportTransactionShadow({
|
|
241
|
+
transaction_root: transactions,
|
|
242
|
+
transaction_id: current.transaction_id,
|
|
243
|
+
expected_current_genesis_id: options.genesisId,
|
|
244
|
+
now: new Date().toISOString(),
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
if (current.state !== "shadow-verified") {
|
|
248
|
+
throw new Error(`support shadow cannot resume from ${current.state}`);
|
|
249
|
+
}
|
|
250
|
+
emit.data({
|
|
251
|
+
transaction_id: current.transaction_id,
|
|
252
|
+
state: current.state,
|
|
253
|
+
sources_preserved: true,
|
|
254
|
+
replacement_enabled: false,
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
catch (error) {
|
|
258
|
+
emitFailure(emit, "ledger_v3_support_shadow_failed", error);
|
|
259
|
+
}
|
|
260
|
+
});
|
|
261
|
+
command
|
|
262
|
+
.command("support-replacement")
|
|
263
|
+
.description("Authorize an exact verified canary plan; source replacement remains disabled")
|
|
264
|
+
.requiredOption("--transaction <id>", "Transaction to inspect")
|
|
265
|
+
.requiredOption("--exact-transaction <id>", "Repeat the exact transaction identifier")
|
|
266
|
+
.option("--yes", "Record exact replacement authorization")
|
|
267
|
+
.option("--root <path>", "Explicit coordination root")
|
|
268
|
+
.action(async (options) => {
|
|
269
|
+
try {
|
|
270
|
+
const root = resolve(options.root ?? coordRoot(context));
|
|
271
|
+
const transactions = transactionRoot(root);
|
|
272
|
+
const authorized = await authorizeEventV3SupportReplacement({
|
|
273
|
+
transaction_root: transactions,
|
|
274
|
+
transaction_id: options.transaction,
|
|
275
|
+
exact_transaction_id: options.exactTransaction,
|
|
276
|
+
yes: options.yes === true,
|
|
277
|
+
now: new Date().toISOString(),
|
|
278
|
+
});
|
|
279
|
+
emit.data(await planEventV3SupportReplacement({
|
|
280
|
+
transaction_root: transactions,
|
|
281
|
+
transaction_id: authorized.transaction_id,
|
|
282
|
+
}));
|
|
283
|
+
}
|
|
284
|
+
catch (error) {
|
|
285
|
+
emitFailure(emit, "ledger_v3_support_replacement_failed", error);
|
|
286
|
+
}
|
|
287
|
+
});
|
|
288
|
+
command
|
|
289
|
+
.command("verify-v1-fence")
|
|
290
|
+
.description("Verify the sealed legacy V1 hard fence and terminal digest")
|
|
291
|
+
.option("--root <path>", "Explicit coordination root")
|
|
292
|
+
.action(async (options) => {
|
|
293
|
+
try {
|
|
294
|
+
emit.data(await verifyLegacyV1HardFence(resolve(options.root ?? coordRoot(context))));
|
|
295
|
+
}
|
|
296
|
+
catch (error) {
|
|
297
|
+
emitFailure(emit, "ledger_v1_fence_verify_failed", error);
|
|
298
|
+
}
|
|
299
|
+
});
|
|
300
|
+
command
|
|
301
|
+
.command("legacy-inventory")
|
|
302
|
+
.description("List sealed root events*.ndjson* history after the V1 fence passes")
|
|
303
|
+
.option("--root <path>", "Explicit coordination root")
|
|
304
|
+
.action(async (options) => {
|
|
305
|
+
try {
|
|
306
|
+
const root = resolve(options.root ?? coordRoot(context));
|
|
307
|
+
await verifyLegacyV1HardFence(root);
|
|
308
|
+
emit.data(await inventoryLegacyV1Segments(root));
|
|
309
|
+
}
|
|
310
|
+
catch (error) {
|
|
311
|
+
emitFailure(emit, "ledger_v1_inventory_failed", error);
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
command
|
|
315
|
+
.command("legacy-compress")
|
|
316
|
+
.description("Preview verified gzip replacement of sealed non-terminal V1 shards")
|
|
317
|
+
.option("--root <path>", "Explicit coordination root")
|
|
318
|
+
.option("--yes", "Replace only unchanged shards after exact logical-row parity")
|
|
319
|
+
.action(async (options) => {
|
|
320
|
+
try {
|
|
321
|
+
const rows = await compressSealedLegacyV1Segments(resolve(options.root ?? coordRoot(context)), { yes: options.yes });
|
|
322
|
+
emit.data({
|
|
323
|
+
rows,
|
|
324
|
+
meta: {
|
|
325
|
+
total: rows.length,
|
|
326
|
+
would_compress: rows.filter((row) => row.action === "would-compress").length,
|
|
327
|
+
compressed: rows.filter((row) => row.action === "compressed").length,
|
|
328
|
+
bytes_before: rows.reduce((sum, row) => sum + row.bytes_before, 0),
|
|
329
|
+
bytes_after: rows.reduce((sum, row) => sum + (row.bytes_after ?? row.bytes_before), 0),
|
|
330
|
+
},
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
catch (error) {
|
|
334
|
+
emitFailure(emit, "ledger_v1_compression_failed", error);
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
command
|
|
338
|
+
.command("verify-legacy")
|
|
339
|
+
.description("Stream and validate one loose or manifest-bound gzip legacy segment")
|
|
340
|
+
.argument("<source>", "Loose segment or compressed-segment manifest")
|
|
341
|
+
.action(async (source) => {
|
|
342
|
+
try {
|
|
343
|
+
let rows = 0;
|
|
344
|
+
for await (const row of streamLegacyV1Rows(resolve(source)))
|
|
345
|
+
rows = row.row_number;
|
|
346
|
+
emit.data({ valid: true, rows });
|
|
347
|
+
}
|
|
348
|
+
catch (error) {
|
|
349
|
+
emitFailure(emit, "ledger_v1_segment_verify_failed", error);
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
command
|
|
353
|
+
.command("legacy-canary")
|
|
354
|
+
.description("Write one shadow gzip canary while retaining the sealed loose segment")
|
|
355
|
+
.requiredOption("--source-filename <name>", "Root legacy segment filename")
|
|
356
|
+
.requiredOption("--out <directory>", "Shadow output directory")
|
|
357
|
+
.requiredOption("--minimum-harnery-version <version>", "Minimum canary-aware version")
|
|
358
|
+
.option("--shadow", "Confirm shadow-only compression")
|
|
359
|
+
.option("--root <path>", "Explicit coordination root")
|
|
360
|
+
.action(async (options) => {
|
|
361
|
+
try {
|
|
362
|
+
if (!options.shadow)
|
|
363
|
+
throw new Error("--shadow is required for legacy canary creation");
|
|
364
|
+
emit.data(await writeLegacyV1Canary({
|
|
365
|
+
coord_root: resolve(options.root ?? coordRoot(context)),
|
|
366
|
+
source_filename: options.sourceFilename,
|
|
367
|
+
output_directory: resolve(options.out),
|
|
368
|
+
minimum_harnery_version: options.minimumHarneryVersion,
|
|
369
|
+
created_at: new Date().toISOString(),
|
|
370
|
+
}));
|
|
371
|
+
}
|
|
372
|
+
catch (error) {
|
|
373
|
+
emitFailure(emit, "ledger_v1_canary_failed", error);
|
|
374
|
+
}
|
|
375
|
+
});
|
|
67
376
|
}
|
|
68
377
|
function coordRoot(context) {
|
|
69
378
|
return resolve(context?.resolveCoordRoot?.() ??
|
|
@@ -85,6 +394,112 @@ function configDigest(root) {
|
|
|
85
394
|
const path = resolve(root, ".harnery", "config.jsonc");
|
|
86
395
|
return sha256V3(existsSync(path) ? readFileSync(path) : Buffer.from("{}\n"));
|
|
87
396
|
}
|
|
397
|
+
function transactionRoot(root) {
|
|
398
|
+
return resolve(root, ".harnery", "maintenance", "transactions", "v3-support");
|
|
399
|
+
}
|
|
400
|
+
function supportAuthorityState(value) {
|
|
401
|
+
if (value === "active" || value === "archived")
|
|
402
|
+
return value;
|
|
403
|
+
throw new Error("event_v3_support_plan_authority_state_invalid");
|
|
404
|
+
}
|
|
405
|
+
function exactIsoTimestamp(value) {
|
|
406
|
+
if (!Number.isFinite(Date.parse(value)) || new Date(value).toISOString() !== value) {
|
|
407
|
+
throw new Error("event_v3_support_plan_timestamp_invalid");
|
|
408
|
+
}
|
|
409
|
+
return value;
|
|
410
|
+
}
|
|
411
|
+
function exactSha256(value) {
|
|
412
|
+
if (!/^sha256:[0-9a-f]{64}$/.test(value)) {
|
|
413
|
+
throw new Error("event_v3_support_plan_authority_digest_invalid");
|
|
414
|
+
}
|
|
415
|
+
return value;
|
|
416
|
+
}
|
|
417
|
+
function nonemptyOption(value, name) {
|
|
418
|
+
if (value.trim().length === 0)
|
|
419
|
+
throw new Error(`event_v3_support_plan_${name}_empty`);
|
|
420
|
+
return value;
|
|
421
|
+
}
|
|
422
|
+
function readSupportEvidence(path) {
|
|
423
|
+
let parsed;
|
|
424
|
+
try {
|
|
425
|
+
parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
426
|
+
}
|
|
427
|
+
catch {
|
|
428
|
+
throw new Error("event_v3_support_plan_evidence_invalid");
|
|
429
|
+
}
|
|
430
|
+
if (!isRecord(parsed))
|
|
431
|
+
throw new Error("event_v3_support_plan_evidence_invalid");
|
|
432
|
+
for (const evidence of Object.values(parsed)) {
|
|
433
|
+
if (!isRecord(evidence) || !validSupportEvidence(evidence)) {
|
|
434
|
+
throw new Error("event_v3_support_plan_evidence_invalid");
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
return parsed;
|
|
438
|
+
}
|
|
439
|
+
const supportEvidenceBooleanFields = new Set([
|
|
440
|
+
"recovery_bound",
|
|
441
|
+
"recovery_packing_enabled",
|
|
442
|
+
"epoch_maintenance_enabled",
|
|
443
|
+
"active_session_tee_enabled",
|
|
444
|
+
"active_committed_receipt_enabled",
|
|
445
|
+
"contract_valid",
|
|
446
|
+
"maintenance_owned",
|
|
447
|
+
"terminal",
|
|
448
|
+
"pending",
|
|
449
|
+
"turn_sealed",
|
|
450
|
+
"finalization_complete",
|
|
451
|
+
"event_references_resolved",
|
|
452
|
+
"event_references_same_epoch",
|
|
453
|
+
"lease_live",
|
|
454
|
+
"stale_writer_grace_elapsed",
|
|
455
|
+
"ready_sibling",
|
|
456
|
+
"producer_pending_reference",
|
|
457
|
+
"event_row_digest_matches",
|
|
458
|
+
"transaction_digest_matches",
|
|
459
|
+
"receipt_grace_elapsed",
|
|
460
|
+
"archive_has_ready_transaction",
|
|
461
|
+
]);
|
|
462
|
+
const supportEvidenceStringFields = new Set(["recorded_at", "filename_recorded_at"]);
|
|
463
|
+
const supportEvidenceNumberFields = new Set([
|
|
464
|
+
"maximum_loose_consumer_window_ms",
|
|
465
|
+
"fixed_consumer_grace_ms",
|
|
466
|
+
"writer_tolerance_ms",
|
|
467
|
+
]);
|
|
468
|
+
function validSupportEvidence(evidence) {
|
|
469
|
+
return Object.entries(evidence).every(([key, value]) => {
|
|
470
|
+
if (supportEvidenceBooleanFields.has(key))
|
|
471
|
+
return typeof value === "boolean";
|
|
472
|
+
if (supportEvidenceStringFields.has(key))
|
|
473
|
+
return typeof value === "string";
|
|
474
|
+
if (supportEvidenceNumberFields.has(key)) {
|
|
475
|
+
return typeof value === "number" && Number.isFinite(value) && value >= 0;
|
|
476
|
+
}
|
|
477
|
+
return false;
|
|
478
|
+
});
|
|
479
|
+
}
|
|
480
|
+
function isRecord(value) {
|
|
481
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
482
|
+
}
|
|
483
|
+
function sameSortedStrings(left, right) {
|
|
484
|
+
const leftSorted = [...left].sort();
|
|
485
|
+
const rightSorted = [...right].sort();
|
|
486
|
+
return (leftSorted.length === rightSorted.length &&
|
|
487
|
+
leftSorted.every((value, index) => value === rightSorted[index]));
|
|
488
|
+
}
|
|
489
|
+
function summarizeArchiveRows(rows) {
|
|
490
|
+
const classifications = {};
|
|
491
|
+
for (const row of rows) {
|
|
492
|
+
classifications[row.classification] = (classifications[row.classification] ?? 0) + 1;
|
|
493
|
+
}
|
|
494
|
+
return {
|
|
495
|
+
total: rows.length,
|
|
496
|
+
bytes: rows.reduce((sum, row) => sum + (row.bytes ?? 0), 0),
|
|
497
|
+
classifications,
|
|
498
|
+
would_delete: rows.filter((row) => row.action === "would-delete").length,
|
|
499
|
+
would_delete_bytes: rows.reduce((sum, row) => sum + (row.action === "would-delete" ? (row.bytes ?? 0) : 0), 0),
|
|
500
|
+
deleted: rows.filter((row) => row.action === "deleted").length,
|
|
501
|
+
};
|
|
502
|
+
}
|
|
88
503
|
function emitFailure(emit, code, error) {
|
|
89
504
|
emit.error({ code, message: error instanceof Error ? error.message : String(error) });
|
|
90
505
|
throw error;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { EmitContext, HarneryProgramContext } from "../commander.js";
|
|
3
|
+
export declare function registerLogsCommand(program: Command, emit: EmitContext, context?: HarneryProgramContext): void;
|
|
4
|
+
//# sourceMappingURL=logs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logs.d.ts","sourceRoot":"","sources":["../../src/commands/logs.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAuB1E,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,WAAW,EACjB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CAqFN"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import { resolveCoordRoot as resolveCanonicalCoordRoot } from "../core/agents/coord-client.js";
|
|
3
|
+
import { createStorageCatalog } from "../core/storage/catalog.js";
|
|
4
|
+
import { HARNERY_STRUCTURED_LOG_PROVIDER_ID, } from "../core/storage/contract.js";
|
|
5
|
+
import { inspectStructuredLogRetention } from "../core/storage/log-retention.js";
|
|
6
|
+
import { queryLogs, rotationFollowCursor } from "../core/storage/query.js";
|
|
7
|
+
import { familyLogDirectory } from "../core/storage/segments.js";
|
|
8
|
+
export function registerLogsCommand(program, emit, context) {
|
|
9
|
+
const logs = program.command("logs").description("List and query bounded Harnery log families");
|
|
10
|
+
logs
|
|
11
|
+
.command("list")
|
|
12
|
+
.option("--json", "Emit structured output")
|
|
13
|
+
.action((options) => run(emit, async () => {
|
|
14
|
+
const catalog = catalogFor(context);
|
|
15
|
+
const capturedAt = new Date();
|
|
16
|
+
const rows = logFamilies(catalog.families).map((family) => logFamilyRow(family, capturedAt));
|
|
17
|
+
if (options.json) {
|
|
18
|
+
emit.config({ format: "json" });
|
|
19
|
+
emit.data({
|
|
20
|
+
schema: "harnery.logs-list/v2",
|
|
21
|
+
captured_at: capturedAt.toISOString(),
|
|
22
|
+
diagnostics: catalog.log_storage_diagnostics,
|
|
23
|
+
dormant_families: catalog.dormant_log_storage_families,
|
|
24
|
+
families: rows,
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
else
|
|
28
|
+
emit.rows(rows.map(logFamilyTableRow));
|
|
29
|
+
}));
|
|
30
|
+
const configureQuery = (command) => command
|
|
31
|
+
.option("--family <id...>", "Restrict to named families")
|
|
32
|
+
.option("--level <level>", "Minimum severity")
|
|
33
|
+
.option("--event <event>", "Exact event name")
|
|
34
|
+
.option("--since <timestamp>", "Earliest timestamp")
|
|
35
|
+
.option("--until <timestamp>", "Latest timestamp")
|
|
36
|
+
.option("--max-records <n>", "Global record scan budget", integer, 10_000)
|
|
37
|
+
.option("--max-bytes <n>", "Global byte scan budget", integer, 10 * 1024 * 1024)
|
|
38
|
+
.option("--json", "Emit structured output");
|
|
39
|
+
configureQuery(logs.command("query").description("Query sealed and active log segments")).action((options) => run(emit, async () => {
|
|
40
|
+
const result = await queryLogs(logFamilies(catalogFor(context).families), queryFrom(options));
|
|
41
|
+
if (options.json) {
|
|
42
|
+
emit.config({ format: "json" });
|
|
43
|
+
emit.data({ schema: "harnery.logs-query/v1", ...result });
|
|
44
|
+
}
|
|
45
|
+
else
|
|
46
|
+
emit.rows(result.records);
|
|
47
|
+
}));
|
|
48
|
+
configureQuery(logs.command("export").description("Export matching records as JSONL")).action((options) => run(emit, async () => {
|
|
49
|
+
const result = await queryLogs(logFamilies(catalogFor(context).families), queryFrom(options));
|
|
50
|
+
for (const record of result.records)
|
|
51
|
+
emit.text(JSON.stringify(record));
|
|
52
|
+
if (result.truncated)
|
|
53
|
+
emit.log("log export stopped at the configured global scan budget", "warn");
|
|
54
|
+
}));
|
|
55
|
+
logs
|
|
56
|
+
.command("tail")
|
|
57
|
+
.argument("<family>")
|
|
58
|
+
.description("Read recent records and a rotation-aware follow cursor")
|
|
59
|
+
.option("-n, --lines <n>", "Number of recent records", integer, 50)
|
|
60
|
+
.option("--max-bytes <n>", "Global byte scan budget", integer, 10 * 1024 * 1024)
|
|
61
|
+
.action((familyId, options) => run(emit, async () => {
|
|
62
|
+
const family = catalogFor(context).require(familyId);
|
|
63
|
+
if (!isLogFamily(family))
|
|
64
|
+
throw new Error(`storage family is not a log: ${familyId}`);
|
|
65
|
+
const result = await queryLogs([family], {
|
|
66
|
+
max_records: 10_000,
|
|
67
|
+
max_bytes: options.maxBytes,
|
|
68
|
+
});
|
|
69
|
+
emit.data({
|
|
70
|
+
schema: "harnery.logs-tail-cursor/v1",
|
|
71
|
+
records: result.records.slice(-options.lines),
|
|
72
|
+
truncated: result.truncated,
|
|
73
|
+
cursor: rotationFollowCursor(family),
|
|
74
|
+
});
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
function logFamilyRow(family, now) {
|
|
78
|
+
const inspection = inspectStructuredLogRetention(family, now);
|
|
79
|
+
const effective = family.effective_log_retention;
|
|
80
|
+
return {
|
|
81
|
+
family_id: family.id,
|
|
82
|
+
class: family.storage_class,
|
|
83
|
+
directory: structuredLogDirectory(family),
|
|
84
|
+
registered_roots: family.resolved_roots,
|
|
85
|
+
policy_version: family.policy.policy_version,
|
|
86
|
+
effective_policy: effective
|
|
87
|
+
? {
|
|
88
|
+
state: effective.state,
|
|
89
|
+
max_bytes: effective.max_bytes,
|
|
90
|
+
max_age_days: effective.max_age_days,
|
|
91
|
+
max_age_ms: effective.max_age_ms,
|
|
92
|
+
fingerprint: effective.effective_policy_fingerprint,
|
|
93
|
+
provenance: effective.provenance,
|
|
94
|
+
diagnostics: effective.diagnostics,
|
|
95
|
+
}
|
|
96
|
+
: null,
|
|
97
|
+
usage: inspection.usage,
|
|
98
|
+
pressure: inspection.pressure,
|
|
99
|
+
retention: inspection.retention,
|
|
100
|
+
sealed_segments: inspection.sealed_segments.length,
|
|
101
|
+
obsolete_manifest_snapshots: inspection.obsolete_snapshots.length,
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
function structuredLogDirectory(family) {
|
|
105
|
+
if (family.provider.provider_id !== HARNERY_STRUCTURED_LOG_PROVIDER_ID ||
|
|
106
|
+
family.format !== "jsonl") {
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
const root = family.resolved_roots.find((candidate) => candidate.match === "provider-partition" && candidate.ownership !== "external");
|
|
110
|
+
return root?.partition ? familyLogDirectory(family) : null;
|
|
111
|
+
}
|
|
112
|
+
function logFamilyTableRow(row) {
|
|
113
|
+
return {
|
|
114
|
+
family_id: row.family_id,
|
|
115
|
+
class: row.class,
|
|
116
|
+
max_bytes: row.effective_policy?.max_bytes ?? "unavailable",
|
|
117
|
+
max_age_days: row.effective_policy?.max_age_days ?? "unavailable",
|
|
118
|
+
managed_bytes: row.usage.managed_bytes,
|
|
119
|
+
unmanaged_bytes: row.usage.unmanaged_bytes,
|
|
120
|
+
pressure: row.pressure.state,
|
|
121
|
+
pressure_ratio: row.pressure.ratio === null ? "unavailable" : Number(row.pressure.ratio.toFixed(3)),
|
|
122
|
+
retention: row.retention.state,
|
|
123
|
+
enforcement: row.retention.enforcement,
|
|
124
|
+
reasons: row.retention.reason_codes.join(",") || "none",
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function catalogFor(context) {
|
|
128
|
+
const coordRoot = resolve(context?.resolveCoordRoot?.() ??
|
|
129
|
+
context?.repoRoot ??
|
|
130
|
+
process.env.HARNERY_COORD_ROOT ??
|
|
131
|
+
resolveCanonicalCoordRoot() ??
|
|
132
|
+
process.cwd());
|
|
133
|
+
return createStorageCatalog({ coord_root: coordRoot, project_root: resolve(context?.repoRoot ?? coordRoot) }, context?.storage);
|
|
134
|
+
}
|
|
135
|
+
function logFamilies(families) {
|
|
136
|
+
return families.filter(isLogFamily);
|
|
137
|
+
}
|
|
138
|
+
function isLogFamily(family) {
|
|
139
|
+
return family.storage_class === "operational-log" || family.storage_class === "debug-log";
|
|
140
|
+
}
|
|
141
|
+
function integer(value) {
|
|
142
|
+
const parsed = Number.parseInt(value, 10);
|
|
143
|
+
if (!Number.isSafeInteger(parsed) || parsed <= 0)
|
|
144
|
+
throw new Error(`invalid positive integer: ${value}`);
|
|
145
|
+
return parsed;
|
|
146
|
+
}
|
|
147
|
+
function queryFrom(options) {
|
|
148
|
+
return {
|
|
149
|
+
...(options.family ? { family_ids: options.family } : {}),
|
|
150
|
+
...(options.level ? { minimum_level: options.level } : {}),
|
|
151
|
+
...(options.event ? { event: options.event } : {}),
|
|
152
|
+
...(options.since ? { since: options.since } : {}),
|
|
153
|
+
...(options.until ? { until: options.until } : {}),
|
|
154
|
+
max_records: options.maxRecords,
|
|
155
|
+
max_bytes: options.maxBytes,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
async function run(emit, action) {
|
|
159
|
+
try {
|
|
160
|
+
await action();
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
emit.error({
|
|
164
|
+
code: "logs_query_failed",
|
|
165
|
+
message: error instanceof Error ? error.message : String(error),
|
|
166
|
+
});
|
|
167
|
+
emit.setExitCode(1);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { Command } from "commander";
|
|
2
|
+
import type { EmitContext } from "../commander.js";
|
|
3
|
+
import type { HarneryInboxService } from "../core/inbox/service.js";
|
|
4
|
+
export declare function registerMessagesCommand(program: Command, emit: EmitContext, service?: HarneryInboxService): void;
|
|
5
|
+
//# sourceMappingURL=messages.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../src/commands/messages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,WAAW,EACjB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,IAAI,CA+CN"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export function registerMessagesCommand(program, emit, service) {
|
|
2
|
+
program
|
|
3
|
+
.command("messages")
|
|
4
|
+
.description("Queue a durable coordination message; dry-run unless --yes")
|
|
5
|
+
.requiredOption("--from <instance>")
|
|
6
|
+
.requiredOption("--from-name <name>")
|
|
7
|
+
.requiredOption("--to <instance>")
|
|
8
|
+
.requiredOption("--to-name <name>")
|
|
9
|
+
.requiredOption("--body <text>")
|
|
10
|
+
.option("--yes", "Append and sync the message")
|
|
11
|
+
.option("--json", "Emit stable JSON")
|
|
12
|
+
.action((options) => {
|
|
13
|
+
try {
|
|
14
|
+
const result = options.yes
|
|
15
|
+
? requireInboxService(service).send({
|
|
16
|
+
sender_instance_id: options.from,
|
|
17
|
+
sender_display_name: options.fromName,
|
|
18
|
+
recipient_instance_id: options.to,
|
|
19
|
+
recipient_display_name: options.toName,
|
|
20
|
+
body: options.body,
|
|
21
|
+
})
|
|
22
|
+
: {
|
|
23
|
+
state: "dry-run",
|
|
24
|
+
recipient_instance_id: options.to,
|
|
25
|
+
body_bytes: Buffer.byteLength(options.body),
|
|
26
|
+
writes: false,
|
|
27
|
+
};
|
|
28
|
+
if (options.json)
|
|
29
|
+
emit.config({ format: "json" });
|
|
30
|
+
emit.data({ schema: "harnery.message-send/v1", ...result });
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
emit.error({
|
|
34
|
+
code: "message_send_failed",
|
|
35
|
+
message: error instanceof Error ? error.message : String(error),
|
|
36
|
+
});
|
|
37
|
+
emit.setExitCode(1);
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function requireInboxService(service) {
|
|
42
|
+
if (!service)
|
|
43
|
+
throw new Error("coordination inbox is not configured by this host");
|
|
44
|
+
return service;
|
|
45
|
+
}
|