harnery 0.36.0 → 0.38.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 +9 -0
- package/dist/commander.d.ts.map +1 -1
- package/dist/commander.js +10 -1
- package/dist/commands/admission.d.ts +21 -0
- package/dist/commands/admission.d.ts.map +1 -0
- package/dist/commands/admission.js +565 -0
- package/dist/commands/agents.d.ts +7 -0
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +148 -47
- package/dist/commands/artifacts.d.ts.map +1 -1
- package/dist/commands/artifacts.js +73 -2
- package/dist/commands/browse-ai.d.ts +2 -2
- package/dist/commands/browse-ai.d.ts.map +1 -1
- package/dist/commands/browse-ai.js +6 -4
- package/dist/commands/browse.d.ts.map +1 -1
- package/dist/commands/browse.js +360 -21
- 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/fetch.js +1 -0
- package/dist/commands/files.d.ts +12 -0
- package/dist/commands/files.d.ts.map +1 -1
- package/dist/commands/files.js +54 -1
- package/dist/commands/governor.d.ts.map +1 -1
- package/dist/commands/governor.js +4 -0
- package/dist/commands/ledger-v3.d.ts.map +1 -1
- package/dist/commands/ledger-v3.js +71 -2
- package/dist/commands/qa-record.d.ts +144 -0
- package/dist/commands/qa-record.d.ts.map +1 -0
- package/dist/commands/qa-record.js +0 -0
- package/dist/commands/qa-run.d.ts +8 -0
- package/dist/commands/qa-run.d.ts.map +1 -0
- package/dist/commands/qa-run.js +396 -0
- package/dist/commands/qa-status.d.ts +71 -0
- package/dist/commands/qa-status.d.ts.map +1 -0
- package/dist/commands/qa-status.js +490 -0
- package/dist/commands/qa-verify.d.ts +40 -0
- package/dist/commands/qa-verify.d.ts.map +1 -0
- package/dist/commands/qa-verify.js +180 -0
- 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/review-pack.d.ts +4 -0
- package/dist/commands/review-pack.d.ts.map +1 -0
- package/dist/commands/review-pack.js +1001 -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/web.d.ts.map +1 -1
- package/dist/commands/web.js +17 -0
- package/dist/commands/workflow.d.ts.map +1 -1
- package/dist/commands/workflow.js +4 -0
- package/dist/core/agents/cli.js +7 -3
- 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/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/qa-signal.d.ts +111 -0
- package/dist/core/agents/qa-signal.d.ts.map +1 -0
- package/dist/core/agents/qa-signal.js +231 -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 +5 -0
- package/dist/core/agents/render/prompt-context.d.ts.map +1 -1
- package/dist/core/agents/render/prompt-context.js +34 -13
- 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.map +1 -1
- package/dist/core/agents/rules/stop-hook.js +6 -10
- package/dist/core/agents/session-finalizer-v3.js +4 -1
- package/dist/core/agents/session-name-display.d.ts +20 -5
- package/dist/core/agents/session-name-display.d.ts.map +1 -1
- package/dist/core/agents/session-name-display.js +67 -7
- package/dist/core/agents/state/heartbeat-reader.d.ts +7 -0
- package/dist/core/agents/state/heartbeat-reader.d.ts.map +1 -1
- package/dist/core/agents/state/heartbeat-writer.d.ts +11 -0
- package/dist/core/agents/state/heartbeat-writer.d.ts.map +1 -1
- package/dist/core/agents/state/heartbeat-writer.js +17 -0
- package/dist/core/agents/state/live-coordination-view.d.ts.map +1 -1
- package/dist/core/agents/state/live-coordination-view.js +1 -0
- package/dist/core/agents/state/live-coordination-writer.js +5 -0
- package/dist/core/artifacts/constants.d.ts +1 -1
- package/dist/core/artifacts/constants.js +1 -1
- package/dist/core/artifacts/index.d.ts +82 -6
- package/dist/core/artifacts/index.d.ts.map +1 -1
- package/dist/core/artifacts/index.js +410 -15
- package/dist/core/config.d.ts +20 -0
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +59 -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 +51 -0
- package/dist/core/diagnostics/bundle.d.ts.map +1 -0
- package/dist/core/diagnostics/bundle.js +968 -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/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/index.d.ts +1 -0
- package/dist/core/events/legacy-storage/index.d.ts.map +1 -1
- package/dist/core/events/legacy-storage/index.js +1 -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/bootstrap.d.ts.map +1 -1
- package/dist/core/events/v3/bootstrap.js +10 -0
- 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 +1 -0
- package/dist/core/events/v3/coordination-view.d.ts +3 -0
- package/dist/core/events/v3/coordination-view.d.ts.map +1 -1
- package/dist/core/events/v3/coordination-view.js +69 -8
- package/dist/core/events/v3/index.d.ts +1 -0
- package/dist/core/events/v3/index.d.ts.map +1 -1
- package/dist/core/events/v3/index.js +1 -0
- package/dist/core/events/v3/live-routing.d.ts.map +1 -1
- package/dist/core/events/v3/live-routing.js +1 -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 +13 -2
- package/dist/core/events/v3/producers/intake.d.ts.map +1 -1
- package/dist/core/events/v3/producers/intake.js +10 -2
- package/dist/core/events/v3/producers/recorder.d.ts +39 -0
- package/dist/core/events/v3/producers/recorder.d.ts.map +1 -1
- package/dist/core/events/v3/producers/recorder.js +350 -17
- package/dist/core/hooks/adapter/output.d.ts +8 -0
- package/dist/core/hooks/adapter/output.d.ts.map +1 -1
- package/dist/core/hooks/adapter/output.js +11 -1
- package/dist/core/hooks/cli.js +303 -219
- 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/resolve/transcript.d.ts.map +1 -1
- package/dist/core/hooks/resolve/transcript.js +10 -3
- package/dist/core/hooks/session-name-presence.d.ts.map +1 -1
- package/dist/core/hooks/session-name-presence.js +4 -1
- package/dist/core/qa-artifacts.d.ts +20 -0
- package/dist/core/qa-artifacts.d.ts.map +1 -0
- package/dist/core/qa-artifacts.js +110 -0
- package/dist/core/resources/contract.d.ts +96 -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 +34 -0
- package/dist/core/resources/sampler.d.ts.map +1 -0
- package/dist/core/resources/sampler.js +458 -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/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/builtins.d.ts.map +1 -1
- package/dist/core/storage/builtins.js +45 -6
- package/dist/core/storage/logger.d.ts +2 -0
- package/dist/core/storage/logger.d.ts.map +1 -1
- package/dist/core/storage/logger.js +2 -0
- package/dist/core/storage/query.d.ts +14 -0
- package/dist/core/storage/query.d.ts.map +1 -1
- package/dist/core/storage/query.js +51 -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/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/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/lib/admission.d.ts +71 -0
- package/dist/lib/admission.d.ts.map +1 -0
- package/dist/lib/admission.js +264 -0
- package/dist/lib/agent-browser/client.d.ts +1 -1
- package/dist/lib/agent-browser/client.d.ts.map +1 -1
- package/dist/lib/agent-browser/client.js +1 -5
- package/dist/lib/browser/capture-fidelity.d.ts +39 -0
- package/dist/lib/browser/capture-fidelity.d.ts.map +1 -0
- package/dist/lib/browser/capture-fidelity.js +84 -0
- package/dist/lib/browser/client.d.ts +46 -1
- package/dist/lib/browser/client.d.ts.map +1 -1
- package/dist/lib/browser/client.js +168 -9
- package/dist/lib/browser/critique.d.ts +38 -1
- package/dist/lib/browser/critique.d.ts.map +1 -1
- package/dist/lib/browser/critique.js +34 -6
- package/dist/lib/browser/index.d.ts +5 -1
- package/dist/lib/browser/index.d.ts.map +1 -1
- package/dist/lib/browser/index.js +4 -0
- package/dist/lib/browser/page-review-judge.d.ts +64 -0
- package/dist/lib/browser/page-review-judge.d.ts.map +1 -0
- package/dist/lib/browser/page-review-judge.js +270 -0
- package/dist/lib/browser/page-review-pack.d.ts +613 -0
- package/dist/lib/browser/page-review-pack.d.ts.map +1 -0
- package/dist/lib/browser/page-review-pack.js +1751 -0
- package/dist/lib/browser/qa-run-contracts.d.ts +377 -0
- package/dist/lib/browser/qa-run-contracts.d.ts.map +1 -0
- package/dist/lib/browser/qa-run-contracts.js +361 -0
- package/dist/lib/browser/qa-run.d.ts +141 -0
- package/dist/lib/browser/qa-run.d.ts.map +1 -0
- package/dist/lib/browser/qa-run.js +1283 -0
- package/dist/lib/browser/request-diagnostics.d.ts +13 -0
- package/dist/lib/browser/request-diagnostics.d.ts.map +1 -0
- package/dist/lib/browser/request-diagnostics.js +18 -0
- package/dist/lib/browser/tiling.d.ts +19 -0
- package/dist/lib/browser/tiling.d.ts.map +1 -1
- package/dist/lib/browser/tiling.js +28 -0
- package/dist/lib/cookies/client.d.ts +9 -0
- package/dist/lib/cookies/client.d.ts.map +1 -1
- package/dist/lib/cookies/client.js +197 -44
- package/dist/lib/cookies/extra.d.ts +18 -0
- package/dist/lib/cookies/extra.d.ts.map +1 -0
- package/dist/lib/cookies/extra.js +14 -0
- package/dist/lib/cookies/index.d.ts +2 -1
- package/dist/lib/cookies/index.d.ts.map +1 -1
- package/dist/lib/cookies/index.js +2 -1
- 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/durable-job.d.ts +124 -0
- package/dist/lib/durable-job.d.ts.map +1 -0
- package/dist/lib/durable-job.js +296 -0
- package/dist/lib/http/client.d.ts +7 -1
- package/dist/lib/http/client.d.ts.map +1 -1
- package/dist/lib/http/client.js +2 -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 -2
- package/package.json +19 -2
- package/src/commander.ts +75 -1
- package/src/commands/admission.ts +699 -0
- package/src/commands/agents.ts +189 -50
- package/src/commands/artifacts.ts +132 -18
- package/src/commands/browse-ai.ts +10 -5
- package/src/commands/browse.ts +496 -20
- package/src/commands/diagnostics.ts +271 -0
- package/src/commands/fetch.ts +1 -0
- package/src/commands/files.ts +102 -2
- package/src/commands/governor.ts +8 -0
- package/src/commands/ledger-v3.ts +82 -0
- package/src/commands/qa-record.ts +682 -0
- package/src/commands/qa-run.ts +503 -0
- package/src/commands/qa-status.ts +608 -0
- package/src/commands/qa-verify.ts +238 -0
- package/src/commands/resources.ts +38 -0
- package/src/commands/review-pack.ts +1281 -0
- package/src/commands/supervisor.ts +141 -0
- package/src/commands/web.ts +19 -0
- package/src/commands/workflow.ts +8 -0
- package/src/core/agents/cli.ts +7 -3
- package/src/core/agents/health.ts +142 -0
- package/src/core/agents/mailbox.ts +373 -0
- package/src/core/agents/qa-signal.ts +261 -0
- package/src/core/agents/reconcile-coordination-v3.ts +77 -0
- package/src/core/agents/render/prompt-context.ts +42 -12
- 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 +6 -12
- package/src/core/agents/session-finalizer-v3.ts +4 -1
- package/src/core/agents/session-name-display.ts +78 -7
- package/src/core/agents/state/heartbeat-reader.ts +7 -0
- package/src/core/agents/state/heartbeat-writer.ts +23 -0
- package/src/core/agents/state/live-coordination-view.ts +1 -0
- package/src/core/agents/state/live-coordination-writer.ts +5 -0
- package/src/core/artifacts/constants.ts +1 -1
- package/src/core/artifacts/index.ts +565 -30
- package/src/core/config.ts +134 -2
- package/src/core/diagnostics/advice.ts +147 -0
- package/src/core/diagnostics/bundle.ts +1250 -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/compression.ts +130 -0
- package/src/core/events/legacy-storage/index.ts +1 -0
- package/src/core/events/v3/archive-retention.ts +251 -0
- package/src/core/events/v3/bootstrap.ts +10 -0
- package/src/core/events/v3/capabilities.ts +2 -0
- package/src/core/events/v3/coordination-view.ts +100 -11
- package/src/core/events/v3/index.ts +9 -0
- package/src/core/events/v3/live-routing.ts +1 -0
- package/src/core/events/v3/producers/hook-base.ts +14 -2
- package/src/core/events/v3/producers/intake.ts +10 -2
- package/src/core/events/v3/producers/recorder.ts +420 -17
- package/src/core/hooks/adapter/output.ts +12 -1
- package/src/core/hooks/cli.ts +332 -247
- package/src/core/hooks/health.ts +146 -0
- package/src/core/hooks/resolve/transcript.ts +10 -3
- package/src/core/hooks/session-name-presence.ts +6 -1
- package/src/core/qa-artifacts.ts +126 -0
- package/src/core/resources/contract.ts +105 -0
- package/src/core/resources/index.ts +5 -0
- package/src/core/resources/sampler.ts +590 -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/storage/atomic-json.ts +15 -0
- package/src/core/storage/builtins.ts +62 -6
- package/src/core/storage/logger.ts +2 -0
- package/src/core/storage/query.ts +58 -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/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/proof.ts +54 -1
- package/src/core/workflow/run-state.ts +13 -1
- package/src/core/workflow/types.ts +39 -1
- package/src/lib/admission.ts +347 -0
- package/src/lib/agent-browser/client.ts +2 -10
- package/src/lib/browser/capture-fidelity.ts +98 -0
- package/src/lib/browser/client.ts +212 -10
- package/src/lib/browser/critique.ts +62 -7
- package/src/lib/browser/index.ts +65 -0
- package/src/lib/browser/page-review-judge.ts +360 -0
- package/src/lib/browser/page-review-pack.ts +2384 -0
- package/src/lib/browser/qa-run-contracts.ts +743 -0
- package/src/lib/browser/qa-run.ts +1462 -0
- package/src/lib/browser/request-diagnostics.ts +27 -0
- package/src/lib/browser/tiling.ts +32 -0
- package/src/lib/cookies/client.ts +228 -42
- package/src/lib/cookies/extra.ts +28 -0
- package/src/lib/cookies/index.ts +2 -0
- package/src/lib/coord-root-id.ts +23 -0
- package/src/lib/durable-job.ts +407 -0
- package/src/lib/http/client.ts +13 -1
- package/src/lib/instructions/apply.ts +81 -2
- package/src/lib/instructions/templates.ts +11 -2
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
// `qa-verify <path>`: assess whether a qa-run result document is fresh
|
|
2
|
+
// evidence for the invocation the caller has in mind. The assessment itself
|
|
3
|
+
// is the pure assessQaRunEvidence contract; this command owns path
|
|
4
|
+
// resolution (result file, run directory, or run parent via latest.json),
|
|
5
|
+
// expectation collection from flags, and exit-code mapping.
|
|
6
|
+
//
|
|
7
|
+
// Toolkit tier: this module must not import src/core (layering check).
|
|
8
|
+
|
|
9
|
+
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
10
|
+
import { dirname, join, resolve } from "node:path";
|
|
11
|
+
import type { Command } from "commander";
|
|
12
|
+
import type { EmitContext } from "../commander.ts";
|
|
13
|
+
import { QA_RUN_LATEST_FILENAME, QA_RUN_RESULT_FILENAME } from "../lib/browser/qa-run.ts";
|
|
14
|
+
import {
|
|
15
|
+
assessQaRunEvidence,
|
|
16
|
+
computeJobDigest,
|
|
17
|
+
type QaEvidenceAssessment,
|
|
18
|
+
type QaEvidenceExpectations,
|
|
19
|
+
validateQaRunJob,
|
|
20
|
+
} from "../lib/browser/qa-run-contracts.ts";
|
|
21
|
+
|
|
22
|
+
export interface QaVerifyOptions {
|
|
23
|
+
/** Exact run ID the evidence must carry (`--run-id`). */
|
|
24
|
+
runId?: string;
|
|
25
|
+
/** Revision the evidence must have tested (`--revision`). */
|
|
26
|
+
revision?: string;
|
|
27
|
+
/** Job file to reconstruct and digest-match (`--job`). */
|
|
28
|
+
job?: string;
|
|
29
|
+
/** Maximum age of completed_at, in minutes (`--max-age`). */
|
|
30
|
+
maxAge?: string;
|
|
31
|
+
/** Emit the assessment as JSON (`--json`). */
|
|
32
|
+
json?: boolean;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface QaVerifyDeps {
|
|
36
|
+
/** Evaluation instant for --max-age (ISO-8601). Default: current time. */
|
|
37
|
+
now?: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface QaVerifyOutcome {
|
|
41
|
+
/** 0 evidence fresh · 3 stale or unverifiable · 1 usage/unreadable/invalid job. */
|
|
42
|
+
exit: 0 | 1 | 3;
|
|
43
|
+
/** Present whenever the document was resolved and assessed. */
|
|
44
|
+
assessment?: QaEvidenceAssessment;
|
|
45
|
+
/** Absolute path of the result document that was (or would be) assessed. */
|
|
46
|
+
resultPath?: string;
|
|
47
|
+
/** Human-readable failure for exit-1 outcomes. */
|
|
48
|
+
error?: string;
|
|
49
|
+
/** Individual job-validation errors when --job failed validation. */
|
|
50
|
+
jobErrors?: string[];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function describeError(err: unknown): string {
|
|
54
|
+
return err instanceof Error ? err.message : String(err);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
type JsonRead = { ok: true; value: unknown } | { ok: false; error: string };
|
|
58
|
+
|
|
59
|
+
function readJsonFile(path: string): JsonRead {
|
|
60
|
+
let raw: string;
|
|
61
|
+
try {
|
|
62
|
+
raw = readFileSync(path, "utf8");
|
|
63
|
+
} catch (err: unknown) {
|
|
64
|
+
return { ok: false, error: `cannot read ${path}: ${describeError(err)}` };
|
|
65
|
+
}
|
|
66
|
+
try {
|
|
67
|
+
return { ok: true, value: JSON.parse(raw) };
|
|
68
|
+
} catch (err: unknown) {
|
|
69
|
+
return { ok: false, error: `${path} is not valid JSON: ${describeError(err)}` };
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
type PathResolution = { ok: true; path: string } | { ok: false; error: string };
|
|
74
|
+
|
|
75
|
+
/** Resolve `<path>` to a result document: a file is the document itself; a
|
|
76
|
+
* directory is a run PARENT when it carries latest.json (follow the pointer's
|
|
77
|
+
* `result` path, relative to the directory) or a run directory when it
|
|
78
|
+
* carries the result file directly. */
|
|
79
|
+
function resolveResultPath(inputPath: string): PathResolution {
|
|
80
|
+
const abs = resolve(inputPath);
|
|
81
|
+
let stats: ReturnType<typeof statSync>;
|
|
82
|
+
try {
|
|
83
|
+
stats = statSync(abs);
|
|
84
|
+
} catch (err: unknown) {
|
|
85
|
+
return { ok: false, error: `cannot access ${abs}: ${describeError(err)}` };
|
|
86
|
+
}
|
|
87
|
+
if (stats.isFile()) return { ok: true, path: abs };
|
|
88
|
+
if (!stats.isDirectory()) {
|
|
89
|
+
return { ok: false, error: `${abs} is neither a file nor a directory` };
|
|
90
|
+
}
|
|
91
|
+
const pointerPath = join(abs, QA_RUN_LATEST_FILENAME);
|
|
92
|
+
if (existsSync(pointerPath)) {
|
|
93
|
+
const pointer = readJsonFile(pointerPath);
|
|
94
|
+
if (!pointer.ok) return pointer;
|
|
95
|
+
const record =
|
|
96
|
+
pointer.value && typeof pointer.value === "object" && !Array.isArray(pointer.value)
|
|
97
|
+
? (pointer.value as Record<string, unknown>)
|
|
98
|
+
: {};
|
|
99
|
+
const rel = record.result;
|
|
100
|
+
if (typeof rel !== "string" || rel.length === 0) {
|
|
101
|
+
return { ok: false, error: `${pointerPath} carries no "result" path to follow` };
|
|
102
|
+
}
|
|
103
|
+
return { ok: true, path: resolve(abs, rel) };
|
|
104
|
+
}
|
|
105
|
+
const direct = join(abs, QA_RUN_RESULT_FILENAME);
|
|
106
|
+
if (existsSync(direct)) return { ok: true, path: direct };
|
|
107
|
+
return {
|
|
108
|
+
ok: false,
|
|
109
|
+
error:
|
|
110
|
+
`${abs} is a directory but contains neither ${QA_RUN_LATEST_FILENAME} ` +
|
|
111
|
+
`(expected for a run parent directory) nor ${QA_RUN_RESULT_FILENAME} ` +
|
|
112
|
+
"(expected for a run directory)",
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Pure core of qa-verify: resolve `<path>` to a result document, collect the
|
|
118
|
+
* expectations the flags express, and assess. The commander action is a thin
|
|
119
|
+
* wrapper over this so the resolution and expectation paths test without a
|
|
120
|
+
* CLI harness.
|
|
121
|
+
*/
|
|
122
|
+
export function resolveAndAssess(
|
|
123
|
+
inputPath: string,
|
|
124
|
+
opts: QaVerifyOptions = {},
|
|
125
|
+
deps: QaVerifyDeps = {},
|
|
126
|
+
): QaVerifyOutcome {
|
|
127
|
+
const resolved = resolveResultPath(inputPath);
|
|
128
|
+
if (!resolved.ok) return { exit: 1, error: resolved.error };
|
|
129
|
+
const resultPath = resolved.path;
|
|
130
|
+
|
|
131
|
+
const documentRead = readJsonFile(resultPath);
|
|
132
|
+
if (!documentRead.ok) return { exit: 1, error: documentRead.error, resultPath };
|
|
133
|
+
const document = documentRead.value;
|
|
134
|
+
|
|
135
|
+
// The directory the document was actually read from. assessQaRunEvidence
|
|
136
|
+
// compares it against the recorded run.out_dir, so a moved or copied
|
|
137
|
+
// result never verifies in its new home.
|
|
138
|
+
const expectations: QaEvidenceExpectations = { found_in_dir: dirname(resultPath) };
|
|
139
|
+
if (opts.runId !== undefined) expectations.run_id = opts.runId;
|
|
140
|
+
if (opts.revision !== undefined) expectations.tested_revision = opts.revision;
|
|
141
|
+
if (opts.maxAge !== undefined) {
|
|
142
|
+
const minutes = Number(opts.maxAge);
|
|
143
|
+
if (!Number.isFinite(minutes) || minutes <= 0) {
|
|
144
|
+
return { exit: 1, error: "--max-age must be a positive number of minutes", resultPath };
|
|
145
|
+
}
|
|
146
|
+
expectations.max_age_ms = Math.round(minutes * 60_000);
|
|
147
|
+
if (deps.now !== undefined) expectations.now = deps.now;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
if (opts.job !== undefined) {
|
|
151
|
+
const jobRead = readJsonFile(opts.job);
|
|
152
|
+
if (!jobRead.ok) return { exit: 1, error: jobRead.error, resultPath };
|
|
153
|
+
let jobDocument = jobRead.value;
|
|
154
|
+
if (jobDocument && typeof jobDocument === "object" && !Array.isArray(jobDocument)) {
|
|
155
|
+
// Reconstruct the EFFECTIVE job the way qa-run does: the invocation's
|
|
156
|
+
// target and mode are authoritative over the job file's, and the
|
|
157
|
+
// result document is the record of that invocation.
|
|
158
|
+
const resultRecord =
|
|
159
|
+
document && typeof document === "object" && !Array.isArray(document)
|
|
160
|
+
? (document as Record<string, unknown>)
|
|
161
|
+
: {};
|
|
162
|
+
jobDocument = {
|
|
163
|
+
...(jobDocument as Record<string, unknown>),
|
|
164
|
+
target: resultRecord.target,
|
|
165
|
+
mode: resultRecord.mode,
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
const validation = validateQaRunJob(jobDocument);
|
|
169
|
+
if (!validation.ok) {
|
|
170
|
+
return {
|
|
171
|
+
exit: 1,
|
|
172
|
+
error: `--job file ${opts.job} does not reconstruct a valid job for this result`,
|
|
173
|
+
jobErrors: validation.errors,
|
|
174
|
+
resultPath,
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
expectations.job_digest = computeJobDigest(validation.job);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const assessment = assessQaRunEvidence(document, expectations);
|
|
181
|
+
return { exit: assessment.fresh ? 0 : 3, assessment, resultPath };
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export function registerQaVerifyCommand(program: Command, emit: EmitContext): void {
|
|
185
|
+
program
|
|
186
|
+
.command("qa-verify <path>")
|
|
187
|
+
.description(
|
|
188
|
+
"Verify that a qa-run result is fresh evidence for a specific invocation: " +
|
|
189
|
+
"match its run identity (run_id, job digest, tested revision, age, and " +
|
|
190
|
+
"recorded output directory) against what the caller expects. Fail-closed: " +
|
|
191
|
+
"a document without a verifiable identity block is stale by definition.",
|
|
192
|
+
)
|
|
193
|
+
.option("--run-id <id>", "Exact run ID the evidence must carry.")
|
|
194
|
+
.option(
|
|
195
|
+
"--revision <sha>",
|
|
196
|
+
"Revision the evidence must have tested. A result whose revision source is " +
|
|
197
|
+
"unknown cannot satisfy this expectation.",
|
|
198
|
+
)
|
|
199
|
+
.option(
|
|
200
|
+
"--job <file>",
|
|
201
|
+
"Job document (JSON) to digest-match. Reconstructed the way qa-run builds the " +
|
|
202
|
+
"effective job: the result's target and mode overlay the file's before " +
|
|
203
|
+
"validation and digesting.",
|
|
204
|
+
)
|
|
205
|
+
.option("--max-age <minutes>", "Maximum age of the run's completed_at, in minutes.")
|
|
206
|
+
.option("--json", "Print the assessment (plus result_path) as JSON.")
|
|
207
|
+
.addHelpText(
|
|
208
|
+
"after",
|
|
209
|
+
"\n<path> may be a result file, a run directory (containing " +
|
|
210
|
+
`${QA_RUN_RESULT_FILENAME}), or a run parent directory (its ` +
|
|
211
|
+
`${QA_RUN_LATEST_FILENAME} pointer is followed).` +
|
|
212
|
+
"\n\nExit codes: 0 evidence fresh · 1 usage, unreadable input, or invalid job · " +
|
|
213
|
+
"3 evidence stale or unverifiable.",
|
|
214
|
+
)
|
|
215
|
+
.action((path: string, opts: QaVerifyOptions) => {
|
|
216
|
+
const outcome = resolveAndAssess(path, opts);
|
|
217
|
+
if (outcome.exit === 1 || !outcome.assessment) {
|
|
218
|
+
for (const message of outcome.jobErrors ?? []) emit.log(`job: ${message}`, "error");
|
|
219
|
+
emit.error({
|
|
220
|
+
code: "qa_verify_error",
|
|
221
|
+
message: outcome.error ?? "qa-verify could not assess the result",
|
|
222
|
+
});
|
|
223
|
+
process.exitCode = 1;
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
const assessment = outcome.assessment;
|
|
227
|
+
if (opts.json) emit.data({ ...assessment, result_path: outcome.resultPath });
|
|
228
|
+
const runId = assessment.run?.run_id ?? "(no identity)";
|
|
229
|
+
const verdict = assessment.verdict ?? "(no verdict)";
|
|
230
|
+
emit.log(
|
|
231
|
+
`run ${runId}: verdict ${verdict} — evidence ${assessment.fresh ? "fresh" : "stale"} ` +
|
|
232
|
+
`(${outcome.resultPath})`,
|
|
233
|
+
assessment.fresh ? "info" : "warn",
|
|
234
|
+
);
|
|
235
|
+
for (const reason of assessment.reasons) emit.log(`stale: ${reason}`, "warn");
|
|
236
|
+
if (!assessment.fresh) process.exitCode = 3;
|
|
237
|
+
});
|
|
238
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { resolve } from "node:path";
|
|
2
|
+
import type { Command } from "commander";
|
|
3
|
+
import type { EmitContext, HarneryProgramContext } from "../commander.ts";
|
|
4
|
+
import { sampleResources } from "../core/resources/index.ts";
|
|
5
|
+
|
|
6
|
+
export function registerResourcesCommand(
|
|
7
|
+
program: Command,
|
|
8
|
+
emit: EmitContext,
|
|
9
|
+
context?: HarneryProgramContext,
|
|
10
|
+
): void {
|
|
11
|
+
const resources = program
|
|
12
|
+
.command("resources")
|
|
13
|
+
.description("Observe local CPU and memory pressure by agent and process tree");
|
|
14
|
+
|
|
15
|
+
resources
|
|
16
|
+
.command("snapshot")
|
|
17
|
+
.description("Capture one machine and process-resource snapshot")
|
|
18
|
+
.option("--root <path>", "Explicit coordination root")
|
|
19
|
+
.action((options: { root?: string }) => {
|
|
20
|
+
try {
|
|
21
|
+
emit.data(sampleResources(resolve(options.root ?? coordRoot(context))).snapshot);
|
|
22
|
+
} catch (error) {
|
|
23
|
+
fail(emit, "resource_snapshot_failed", error);
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function coordRoot(context?: HarneryProgramContext): string {
|
|
29
|
+
return context?.resolveCoordRoot?.() ?? context?.repoRoot ?? process.cwd();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function fail(emit: EmitContext, code: string, error: unknown): void {
|
|
33
|
+
emit.error({
|
|
34
|
+
code,
|
|
35
|
+
message: error instanceof Error ? error.message : String(error),
|
|
36
|
+
});
|
|
37
|
+
emit.setExitCode(1);
|
|
38
|
+
}
|