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,146 @@
|
|
|
1
|
+
import type { Adapter } from "../adapter.ts";
|
|
2
|
+
import { processLogger } from "../storage/logger.ts";
|
|
3
|
+
|
|
4
|
+
export const HOOK_HEALTH_EVENT = "agent_hook.completed" as const;
|
|
5
|
+
export const HOOK_HEALTH_RECEIPT_VERSION = 1 as const;
|
|
6
|
+
export const HOOK_HEALTH_ERROR_PHASE_LIMIT = 8;
|
|
7
|
+
|
|
8
|
+
export type HookHealthOutcome = "completed" | "skipped" | "degraded" | "faulted";
|
|
9
|
+
|
|
10
|
+
export interface HookHealthState {
|
|
11
|
+
readonly started_at_ms: number;
|
|
12
|
+
readonly started_rss_bytes: number;
|
|
13
|
+
readonly event_name: string | null;
|
|
14
|
+
readonly adapter: Adapter | null;
|
|
15
|
+
readonly payload_bytes: number;
|
|
16
|
+
coord_root: string | null;
|
|
17
|
+
owner_id?: string;
|
|
18
|
+
skipped_reason?: string;
|
|
19
|
+
v3_state?: string;
|
|
20
|
+
error_phases: string[];
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface HookHealthReceipt {
|
|
24
|
+
receipt_version: typeof HOOK_HEALTH_RECEIPT_VERSION;
|
|
25
|
+
hook_name: string;
|
|
26
|
+
adapter: Adapter | "unknown";
|
|
27
|
+
outcome: HookHealthOutcome;
|
|
28
|
+
exit_contract: "always-zero";
|
|
29
|
+
exit_code: 0;
|
|
30
|
+
duration_ms: number;
|
|
31
|
+
payload_bytes: number;
|
|
32
|
+
pid: number;
|
|
33
|
+
rss_start_bytes: number;
|
|
34
|
+
rss_end_bytes: number;
|
|
35
|
+
rss_delta_bytes: number;
|
|
36
|
+
retry_worker: boolean;
|
|
37
|
+
error_count: number;
|
|
38
|
+
error_phases: readonly string[];
|
|
39
|
+
owner_id?: string;
|
|
40
|
+
skipped_reason?: string;
|
|
41
|
+
v3_state?: string;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function beginHookHealth(input: {
|
|
45
|
+
started_at_ms: number;
|
|
46
|
+
started_rss_bytes: number;
|
|
47
|
+
event_name: string | null;
|
|
48
|
+
adapter: Adapter | null;
|
|
49
|
+
payload_bytes: number;
|
|
50
|
+
}): HookHealthState {
|
|
51
|
+
return {
|
|
52
|
+
...input,
|
|
53
|
+
coord_root: null,
|
|
54
|
+
error_phases: [],
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function observeHookDebug(
|
|
59
|
+
state: HookHealthState | undefined,
|
|
60
|
+
entry: Readonly<Record<string, unknown>>,
|
|
61
|
+
): void {
|
|
62
|
+
if (!state) return;
|
|
63
|
+
const skipped = safeToken(entry.skipped);
|
|
64
|
+
if (skipped) state.skipped_reason = skipped;
|
|
65
|
+
const v3State = safeToken(entry.event_v3_state);
|
|
66
|
+
if (v3State) state.v3_state = v3State;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function observeHookError(state: HookHealthState | undefined, phase: unknown): void {
|
|
70
|
+
if (!state || state.error_phases.length >= HOOK_HEALTH_ERROR_PHASE_LIMIT) return;
|
|
71
|
+
state.error_phases.push(safeToken(phase) ?? "unknown");
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function finalizeHookHealth(
|
|
75
|
+
state: HookHealthState,
|
|
76
|
+
input: {
|
|
77
|
+
finished_at_ms: number;
|
|
78
|
+
finished_rss_bytes: number;
|
|
79
|
+
pid: number;
|
|
80
|
+
faulted?: boolean;
|
|
81
|
+
},
|
|
82
|
+
): HookHealthReceipt {
|
|
83
|
+
const duration = Math.max(0, Math.floor(input.finished_at_ms - state.started_at_ms));
|
|
84
|
+
const rssStart = boundedInteger(state.started_rss_bytes);
|
|
85
|
+
const rssEnd = boundedInteger(input.finished_rss_bytes);
|
|
86
|
+
const hookName = safeToken(state.event_name) ?? "unknown";
|
|
87
|
+
return {
|
|
88
|
+
receipt_version: HOOK_HEALTH_RECEIPT_VERSION,
|
|
89
|
+
hook_name: hookName,
|
|
90
|
+
adapter: state.adapter ?? "unknown",
|
|
91
|
+
outcome: input.faulted
|
|
92
|
+
? "faulted"
|
|
93
|
+
: state.error_phases.length > 0
|
|
94
|
+
? "degraded"
|
|
95
|
+
: state.skipped_reason
|
|
96
|
+
? "skipped"
|
|
97
|
+
: "completed",
|
|
98
|
+
exit_contract: "always-zero",
|
|
99
|
+
exit_code: 0,
|
|
100
|
+
duration_ms: duration,
|
|
101
|
+
payload_bytes: boundedInteger(state.payload_bytes),
|
|
102
|
+
pid: boundedInteger(input.pid),
|
|
103
|
+
rss_start_bytes: rssStart,
|
|
104
|
+
rss_end_bytes: rssEnd,
|
|
105
|
+
rss_delta_bytes: rssEnd - rssStart,
|
|
106
|
+
retry_worker: hookName === "runtime-context-retry",
|
|
107
|
+
error_count: state.error_phases.length,
|
|
108
|
+
error_phases: [...state.error_phases],
|
|
109
|
+
...(state.owner_id ? { owner_id: state.owner_id } : {}),
|
|
110
|
+
...(state.skipped_reason ? { skipped_reason: state.skipped_reason } : {}),
|
|
111
|
+
...(state.v3_state ? { v3_state: state.v3_state } : {}),
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export function writeHookHealthCompletion(
|
|
116
|
+
state: HookHealthState | undefined,
|
|
117
|
+
input: {
|
|
118
|
+
finished_at_ms: number;
|
|
119
|
+
finished_rss_bytes: number;
|
|
120
|
+
pid: number;
|
|
121
|
+
faulted?: boolean;
|
|
122
|
+
},
|
|
123
|
+
): HookHealthReceipt | undefined {
|
|
124
|
+
if (!state?.coord_root) return undefined;
|
|
125
|
+
const receipt = finalizeHookHealth(state, input);
|
|
126
|
+
try {
|
|
127
|
+
processLogger(state.coord_root, "agent-hook").info(HOOK_HEALTH_EVENT, { ...receipt });
|
|
128
|
+
} catch {
|
|
129
|
+
// Hook health is observer-only. Logging can never change adapter behavior.
|
|
130
|
+
}
|
|
131
|
+
return receipt;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function safeToken(value: unknown): string | undefined {
|
|
135
|
+
if (typeof value !== "string") return undefined;
|
|
136
|
+
const normalized = value
|
|
137
|
+
.trim()
|
|
138
|
+
.slice(0, 128)
|
|
139
|
+
.replace(/[^a-zA-Z0-9._:/+-]+/g, "-");
|
|
140
|
+
return /^[a-zA-Z0-9]/.test(normalized) ? normalized : undefined;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
function boundedInteger(value: number): number {
|
|
144
|
+
if (!Number.isFinite(value)) return 0;
|
|
145
|
+
return Math.max(0, Math.min(Number.MAX_SAFE_INTEGER, Math.floor(value)));
|
|
146
|
+
}
|
|
@@ -167,9 +167,16 @@ export function inspectSessionNameDisplayImmediately(
|
|
|
167
167
|
awaitingReply = false;
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
170
|
+
// Some adapter transcripts persist assistant messages and tool requests but
|
|
171
|
+
// omit tool-result rows entirely. A readable file with no mint result cannot
|
|
172
|
+
// establish the ordered verification boundary, so it is unavailable evidence
|
|
173
|
+
// rather than proof that the agent displayed the title incorrectly. Only a
|
|
174
|
+
// transcript that contains the mint followed by a non-matching assistant
|
|
175
|
+
// reply can safely deny the next tool.
|
|
176
|
+
if (!sawMintResult || awaitingReply) {
|
|
177
|
+
return { state: "unavailable", reason: "transcript_not_ready" };
|
|
178
|
+
}
|
|
179
|
+
return { state: "absent" };
|
|
173
180
|
}
|
|
174
181
|
|
|
175
182
|
/**
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
* Never throws: coordination telemetry must not take down a hook.
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
|
+
import { sessionNameDisplayAcceptedNames } from "../agents/session-name-display.ts";
|
|
25
26
|
import { stampSessionNameSeen } from "../agents/state/heartbeat-writer.ts";
|
|
26
27
|
import { readLiveCoordinationRow } from "../agents/state/live-coordination-view.ts";
|
|
27
28
|
|
|
@@ -42,7 +43,11 @@ export function sessionNamePresence(
|
|
|
42
43
|
if (row?.session_name_seen_for === name) {
|
|
43
44
|
return { session_name_present: true, session_name_present_for: name };
|
|
44
45
|
}
|
|
45
|
-
|
|
46
|
+
// A display of the title Harnery last asked for counts here too, so Stop
|
|
47
|
+
// and the PreToolUse gate cannot disagree about the same reply.
|
|
48
|
+
const present = sessionNameDisplayAcceptedNames(row).some((candidate) =>
|
|
49
|
+
scanAssistantText(candidate),
|
|
50
|
+
);
|
|
46
51
|
if (present) stampSessionNameSeen(coordRoot, instanceId, name);
|
|
47
52
|
return { session_name_present: present, session_name_present_for: name };
|
|
48
53
|
} catch {
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Managed output workspaces for page-QA commands.
|
|
3
|
+
*
|
|
4
|
+
* An implicit qa-run/qa-record output is working evidence, not project source.
|
|
5
|
+
* Keep it in the bounded artifact store. Callers that pass --out-dir retain
|
|
6
|
+
* full control of that explicit destination.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { existsSync, readdirSync, readFileSync } from "node:fs";
|
|
10
|
+
import { join, resolve } from "node:path";
|
|
11
|
+
import type { HarneryProgramContext } from "../commander.ts";
|
|
12
|
+
import { monorepoRoot } from "./agents/index.ts";
|
|
13
|
+
import {
|
|
14
|
+
ARTIFACT_MANIFEST,
|
|
15
|
+
type ArtifactManifestV2,
|
|
16
|
+
artifactsRoot,
|
|
17
|
+
configuredArtifactRetentionDays,
|
|
18
|
+
createArtifact,
|
|
19
|
+
parseArtifactManifest,
|
|
20
|
+
} from "./artifacts/index.ts";
|
|
21
|
+
|
|
22
|
+
export type QaArtifactKind = "qa-run" | "qa-record" | "review-pack";
|
|
23
|
+
|
|
24
|
+
export function resolveQaRepoRoot(context?: HarneryProgramContext): string {
|
|
25
|
+
return resolve(context?.repoRoot ?? monorepoRoot() ?? process.cwd());
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function createManagedQaOutParent(
|
|
29
|
+
repoRoot: string,
|
|
30
|
+
kind: QaArtifactKind,
|
|
31
|
+
opts: { retentionMinutes?: number } = {},
|
|
32
|
+
): string {
|
|
33
|
+
return createArtifact(repoRoot, {
|
|
34
|
+
slug: kind,
|
|
35
|
+
purpose:
|
|
36
|
+
kind === "qa-run"
|
|
37
|
+
? "Page QA run evidence"
|
|
38
|
+
: kind === "review-pack"
|
|
39
|
+
? "Page review pack"
|
|
40
|
+
: "Hand-recorded page QA evidence",
|
|
41
|
+
retentionDays: configuredArtifactRetentionDays(repoRoot),
|
|
42
|
+
// A standalone review-pack workspace IS the pack, so the artifact store's
|
|
43
|
+
// own expiry follows the pack's (90 minutes by default, ruled 2026-09-02).
|
|
44
|
+
...(opts.retentionMinutes !== undefined ? { retentionMinutes: opts.retentionMinutes } : {}),
|
|
45
|
+
}).path;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Find the newest run in a valid managed QA workspace. This keeps no-path
|
|
50
|
+
* `qa-status` useful even though every implicit invocation gets an isolated
|
|
51
|
+
* artifact workspace instead of sharing one root-level `.qa-run` directory.
|
|
52
|
+
*/
|
|
53
|
+
export function latestManagedQaRun(repoRoot: string): string | null {
|
|
54
|
+
const root = artifactsRoot(repoRoot);
|
|
55
|
+
if (!existsSync(root)) return null;
|
|
56
|
+
|
|
57
|
+
let workspaceNames: string[];
|
|
58
|
+
try {
|
|
59
|
+
workspaceNames = readdirSync(root).sort();
|
|
60
|
+
} catch {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
let latest: { path: string; startedAtMs: number } | null = null;
|
|
65
|
+
for (const workspaceName of workspaceNames) {
|
|
66
|
+
const workspace = join(root, workspaceName);
|
|
67
|
+
const manifest = readQaManifest(join(workspace, ARTIFACT_MANIFEST));
|
|
68
|
+
if (!manifest) continue;
|
|
69
|
+
|
|
70
|
+
let runNames: string[];
|
|
71
|
+
try {
|
|
72
|
+
runNames = readdirSync(workspace)
|
|
73
|
+
.filter((name) => name.startsWith("run-"))
|
|
74
|
+
.sort();
|
|
75
|
+
} catch {
|
|
76
|
+
continue;
|
|
77
|
+
}
|
|
78
|
+
for (const runName of runNames) {
|
|
79
|
+
const runDir = join(workspace, runName);
|
|
80
|
+
const startedAtMs = readStartedAtMs(runDir);
|
|
81
|
+
if (startedAtMs === null) continue;
|
|
82
|
+
if (
|
|
83
|
+
latest === null ||
|
|
84
|
+
startedAtMs > latest.startedAtMs ||
|
|
85
|
+
(startedAtMs === latest.startedAtMs && runDir > latest.path)
|
|
86
|
+
) {
|
|
87
|
+
latest = { path: runDir, startedAtMs };
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
return latest?.path ?? null;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function readQaManifest(path: string): ArtifactManifestV2 | null {
|
|
95
|
+
try {
|
|
96
|
+
const parsed = parseArtifactManifest(JSON.parse(readFileSync(path, "utf8")));
|
|
97
|
+
if (!parsed.ok) return null;
|
|
98
|
+
if (parsed.manifest.slug !== "qa-run" && parsed.manifest.slug !== "qa-record") return null;
|
|
99
|
+
return parsed.manifest;
|
|
100
|
+
} catch {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function readStartedAtMs(runDir: string): number | null {
|
|
106
|
+
for (const file of ["run-status.json", "page-qa-result.json"]) {
|
|
107
|
+
try {
|
|
108
|
+
const value = JSON.parse(readFileSync(join(runDir, file), "utf8")) as Record<string, unknown>;
|
|
109
|
+
const run = value.run;
|
|
110
|
+
const startedAt =
|
|
111
|
+
typeof value.started_at === "string"
|
|
112
|
+
? value.started_at
|
|
113
|
+
: run &&
|
|
114
|
+
typeof run === "object" &&
|
|
115
|
+
typeof (run as Record<string, unknown>).started_at === "string"
|
|
116
|
+
? ((run as Record<string, unknown>).started_at as string)
|
|
117
|
+
: null;
|
|
118
|
+
if (!startedAt) continue;
|
|
119
|
+
const parsed = Date.parse(startedAt);
|
|
120
|
+
if (!Number.isNaN(parsed)) return parsed;
|
|
121
|
+
} catch {
|
|
122
|
+
// Try the other authoritative run document.
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
export const RESOURCE_SNAPSHOT_SCHEMA_VERSION = 1;
|
|
2
|
+
export const RESOURCE_SERVICE_STATUS_SCHEMA_VERSION = 1;
|
|
3
|
+
|
|
4
|
+
export type ResourceSupportState = "supported" | "partial" | "unsupported" | "error";
|
|
5
|
+
|
|
6
|
+
export interface ResourceProcessSample {
|
|
7
|
+
pid: number;
|
|
8
|
+
ppid: number;
|
|
9
|
+
start_id: string;
|
|
10
|
+
state: string;
|
|
11
|
+
name: string;
|
|
12
|
+
command: string;
|
|
13
|
+
cpu_percent: number | null;
|
|
14
|
+
rss_bytes: number;
|
|
15
|
+
age_seconds: number;
|
|
16
|
+
owner_kind: "agent" | "service" | "unattributed";
|
|
17
|
+
owner_id: string | null;
|
|
18
|
+
owner_root_pid: number | null;
|
|
19
|
+
owner_source?: "pid-map" | "session-environment" | "service";
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface ResourceProcessGroup {
|
|
23
|
+
kind: ResourceProcessSample["owner_kind"];
|
|
24
|
+
id: string;
|
|
25
|
+
process_count: number;
|
|
26
|
+
cpu_percent: number | null;
|
|
27
|
+
rss_bytes: number;
|
|
28
|
+
root_pids: number[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface ResourceMachineSample {
|
|
32
|
+
cpu_percent: number | null;
|
|
33
|
+
cpu_logical_count: number;
|
|
34
|
+
load_average: [number, number, number] | null;
|
|
35
|
+
memory_total_bytes: number | null;
|
|
36
|
+
memory_available_bytes: number | null;
|
|
37
|
+
memory_used_bytes: number | null;
|
|
38
|
+
memory_percent: number | null;
|
|
39
|
+
swap_total_bytes: number | null;
|
|
40
|
+
swap_used_bytes: number | null;
|
|
41
|
+
process_count: number;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface ResourceSnapshot {
|
|
45
|
+
schema_version: typeof RESOURCE_SNAPSHOT_SCHEMA_VERSION;
|
|
46
|
+
sampled_at: string;
|
|
47
|
+
interval_ms: number | null;
|
|
48
|
+
sample_duration_ms: number;
|
|
49
|
+
collector_cpu_ms: number;
|
|
50
|
+
platform: NodeJS.Platform;
|
|
51
|
+
namespace: "host" | "wsl" | "unknown";
|
|
52
|
+
support: {
|
|
53
|
+
state: ResourceSupportState;
|
|
54
|
+
sampler: "procfs" | "unsupported";
|
|
55
|
+
reason?: string;
|
|
56
|
+
};
|
|
57
|
+
machine: ResourceMachineSample;
|
|
58
|
+
groups: ResourceProcessGroup[];
|
|
59
|
+
processes: ResourceProcessSample[];
|
|
60
|
+
visible_process_count: number;
|
|
61
|
+
omitted_process_count: number;
|
|
62
|
+
unattributed_process_count: number;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface ResourceServiceStatusRecord {
|
|
66
|
+
schema_version: typeof RESOURCE_SERVICE_STATUS_SCHEMA_VERSION;
|
|
67
|
+
pid: number;
|
|
68
|
+
start_token?: string;
|
|
69
|
+
host: string;
|
|
70
|
+
nonce: string;
|
|
71
|
+
state: "starting" | "running" | "stopping" | "stopped" | "error";
|
|
72
|
+
started_at: string;
|
|
73
|
+
heartbeat_at: string;
|
|
74
|
+
stopped_at?: string;
|
|
75
|
+
interval_ms: number;
|
|
76
|
+
sample_count: number;
|
|
77
|
+
last_sample_at?: string;
|
|
78
|
+
last_error_code?: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface ResourceServiceStatus {
|
|
82
|
+
running: boolean;
|
|
83
|
+
stale: boolean;
|
|
84
|
+
record?: ResourceServiceStatusRecord;
|
|
85
|
+
status_path: string;
|
|
86
|
+
snapshot_path: string;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export interface ResourceSamplerState {
|
|
90
|
+
sampled_at_ms: number;
|
|
91
|
+
cpu_total_ticks: number;
|
|
92
|
+
cpu_idle_ticks: number;
|
|
93
|
+
process_ticks: Map<string, number>;
|
|
94
|
+
process_owners: Map<string, ResourceProcessOwnerProof>;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export interface ResourceProcessOwnerProof {
|
|
98
|
+
session_id: string;
|
|
99
|
+
instance_id: string;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface ResourceSampleResult {
|
|
103
|
+
snapshot: ResourceSnapshot;
|
|
104
|
+
state?: ResourceSamplerState;
|
|
105
|
+
}
|