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
package/src/core/config.ts
CHANGED
|
@@ -137,12 +137,31 @@ interface HarneryConfig {
|
|
|
137
137
|
* (default 32 MiB; `0` disables rotation). Read via
|
|
138
138
|
* `eventLedgerRotateActiveBytes()`.
|
|
139
139
|
*/
|
|
140
|
-
events?: {
|
|
140
|
+
events?: {
|
|
141
|
+
rotate_active_bytes?: number;
|
|
142
|
+
archive_max_bytes?: number;
|
|
143
|
+
archive_max_age_days?: number;
|
|
144
|
+
archive_keep_min?: number;
|
|
145
|
+
archive_auto_clean?: boolean;
|
|
146
|
+
};
|
|
141
147
|
/**
|
|
142
148
|
* Managed working-artifact defaults. `default_retention_days` is the
|
|
143
149
|
* create-time TTL when the caller does not pass `artifacts create --days`.
|
|
144
150
|
*/
|
|
145
|
-
artifacts?: {
|
|
151
|
+
artifacts?: {
|
|
152
|
+
default_retention_days?: number;
|
|
153
|
+
auto_clean?: boolean;
|
|
154
|
+
max_bytes?: number;
|
|
155
|
+
max_unit_bytes?: number;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Page review packs. `auto_clean` lets `qa-run` and `review-pack create`
|
|
159
|
+
* delete expired packs in the artifact store before they start. Read via
|
|
160
|
+
* `reviewPackAutoCleanEnabled()`; ships off.
|
|
161
|
+
*/
|
|
162
|
+
review_pack?: {
|
|
163
|
+
auto_clean?: boolean;
|
|
164
|
+
};
|
|
146
165
|
/**
|
|
147
166
|
* `harn backup` (restic) defaults: `repo` path/URL, `password_file`, and the
|
|
148
167
|
* `keep_daily`/`keep_weekly`/`keep_monthly` prune policy. Read via `backupConfig()`.
|
|
@@ -622,6 +641,51 @@ export function eventLedgerRotateActiveBytes(coordRoot?: string | null): number
|
|
|
622
641
|
return resolveEventLedgerRotateActiveBytesV3(root);
|
|
623
642
|
}
|
|
624
643
|
|
|
644
|
+
const DEFAULT_EVENT_ARCHIVE_MAX_BYTES = 1024 * 1024 * 1024;
|
|
645
|
+
const DEFAULT_EVENT_ARCHIVE_MAX_AGE_DAYS = 7;
|
|
646
|
+
const DEFAULT_EVENT_ARCHIVE_KEEP_MIN = 2;
|
|
647
|
+
|
|
648
|
+
export interface EventLedgerArchivePolicy {
|
|
649
|
+
maxBytes: number;
|
|
650
|
+
maxAgeDays: number;
|
|
651
|
+
keepMin: number;
|
|
652
|
+
autoClean: boolean;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
/** Bounded retention for closed V3 epochs under `ledgers/v3-archives`. */
|
|
656
|
+
export function eventLedgerArchivePolicy(coordRoot?: string | null): EventLedgerArchivePolicy {
|
|
657
|
+
const root = coordRoot ?? findCoordRoot();
|
|
658
|
+
const configured = root ? readConfig(root).events : undefined;
|
|
659
|
+
return {
|
|
660
|
+
maxBytes: integerSetting(
|
|
661
|
+
coordEnv("EVENT_V3_ARCHIVE_MAX_BYTES"),
|
|
662
|
+
configured?.archive_max_bytes,
|
|
663
|
+
64 * 1024 * 1024,
|
|
664
|
+
1024 * 1024 * 1024 * 1024,
|
|
665
|
+
DEFAULT_EVENT_ARCHIVE_MAX_BYTES,
|
|
666
|
+
),
|
|
667
|
+
maxAgeDays: integerSetting(
|
|
668
|
+
coordEnv("EVENT_V3_ARCHIVE_MAX_AGE_DAYS"),
|
|
669
|
+
configured?.archive_max_age_days,
|
|
670
|
+
1,
|
|
671
|
+
3650,
|
|
672
|
+
DEFAULT_EVENT_ARCHIVE_MAX_AGE_DAYS,
|
|
673
|
+
),
|
|
674
|
+
keepMin: integerSetting(
|
|
675
|
+
coordEnv("EVENT_V3_ARCHIVE_KEEP_MIN"),
|
|
676
|
+
configured?.archive_keep_min,
|
|
677
|
+
1,
|
|
678
|
+
1000,
|
|
679
|
+
DEFAULT_EVENT_ARCHIVE_KEEP_MIN,
|
|
680
|
+
),
|
|
681
|
+
autoClean: booleanSetting(
|
|
682
|
+
coordEnv("EVENT_V3_ARCHIVE_AUTO_CLEAN"),
|
|
683
|
+
configured?.archive_auto_clean,
|
|
684
|
+
true,
|
|
685
|
+
),
|
|
686
|
+
};
|
|
687
|
+
}
|
|
688
|
+
|
|
625
689
|
function parseWebPort(value: unknown, source: string): number {
|
|
626
690
|
const port = typeof value === "number" ? value : Number(value);
|
|
627
691
|
if (!Number.isInteger(port) || port < 1024 || port > 65535) {
|
|
@@ -703,6 +767,33 @@ export function artifactDefaultRetentionDays(coordRoot?: string | null): number
|
|
|
703
767
|
: 3;
|
|
704
768
|
}
|
|
705
769
|
|
|
770
|
+
const DEFAULT_ARTIFACT_MAX_BYTES = 20 * 1024 * 1024 * 1024;
|
|
771
|
+
const DEFAULT_ARTIFACT_MAX_UNIT_BYTES = 1024 * 1024 * 1024;
|
|
772
|
+
|
|
773
|
+
/** Soft repository budget for managed working artifacts. */
|
|
774
|
+
export function artifactMaxBytes(coordRoot?: string | null): number {
|
|
775
|
+
const root = coordRoot ?? findCoordRoot();
|
|
776
|
+
return integerSetting(
|
|
777
|
+
coordEnv("ARTIFACT_MAX_BYTES"),
|
|
778
|
+
root ? readConfig(root).artifacts?.max_bytes : undefined,
|
|
779
|
+
64 * 1024 * 1024,
|
|
780
|
+
1024 * 1024 * 1024 * 1024,
|
|
781
|
+
DEFAULT_ARTIFACT_MAX_BYTES,
|
|
782
|
+
);
|
|
783
|
+
}
|
|
784
|
+
|
|
785
|
+
/** Size at which one bundle requires an explicit `artifacts create --big` acknowledgement. */
|
|
786
|
+
export function artifactMaxUnitBytes(coordRoot?: string | null): number {
|
|
787
|
+
const root = coordRoot ?? findCoordRoot();
|
|
788
|
+
return integerSetting(
|
|
789
|
+
coordEnv("ARTIFACT_MAX_UNIT_BYTES"),
|
|
790
|
+
root ? readConfig(root).artifacts?.max_unit_bytes : undefined,
|
|
791
|
+
16 * 1024 * 1024,
|
|
792
|
+
1024 * 1024 * 1024 * 1024,
|
|
793
|
+
DEFAULT_ARTIFACT_MAX_UNIT_BYTES,
|
|
794
|
+
);
|
|
795
|
+
}
|
|
796
|
+
|
|
706
797
|
/**
|
|
707
798
|
* Whether the daily SessionStart sweep of expired artifact workspaces runs.
|
|
708
799
|
* Precedence: `HARNERY_ARTIFACT_AUTO_CLEAN` (0/false disables) ->
|
|
@@ -718,6 +809,21 @@ export function artifactAutoCleanEnabled(coordRoot?: string | null): boolean {
|
|
|
718
809
|
return readConfig(root).artifacts?.auto_clean !== false;
|
|
719
810
|
}
|
|
720
811
|
|
|
812
|
+
/**
|
|
813
|
+
* Whether `qa-run` and `review-pack create` sweep expired page review packs
|
|
814
|
+
* out of the artifact store before starting. Precedence:
|
|
815
|
+
* `HARNERY_REVIEW_PACK_AUTO_CLEAN` (1/true enables, 0/false disables) ->
|
|
816
|
+
* `review_pack.auto_clean` -> disabled. The sweep deletes only packs whose
|
|
817
|
+
* manifest says `managed: true` with `retention.expires_at` in the past.
|
|
818
|
+
*/
|
|
819
|
+
export function reviewPackAutoCleanEnabled(coordRoot?: string | null): boolean {
|
|
820
|
+
const env = coordEnv("REVIEW_PACK_AUTO_CLEAN");
|
|
821
|
+
if (env !== undefined) return env === "1" || env.toLowerCase() === "true";
|
|
822
|
+
const root = coordRoot ?? findCoordRoot();
|
|
823
|
+
if (!root) return false;
|
|
824
|
+
return readConfig(root).review_pack?.auto_clean === true;
|
|
825
|
+
}
|
|
826
|
+
|
|
721
827
|
/**
|
|
722
828
|
* Sweep cadence in hours. Env-only (`HARNERY_ARTIFACT_AUTO_CLEAN_INTERVAL_HOURS`,
|
|
723
829
|
* mainly for tests): the cadence is an implementation detail, not policy, and
|
|
@@ -733,6 +839,32 @@ export function artifactAutoCleanIntervalHours(): number {
|
|
|
733
839
|
return 24;
|
|
734
840
|
}
|
|
735
841
|
|
|
842
|
+
function integerSetting(
|
|
843
|
+
envValue: string | undefined,
|
|
844
|
+
configured: unknown,
|
|
845
|
+
minimum: number,
|
|
846
|
+
maximum: number,
|
|
847
|
+
fallback: number,
|
|
848
|
+
): number {
|
|
849
|
+
for (const value of [envValue, configured]) {
|
|
850
|
+
const parsed = typeof value === "number" ? value : Number(value);
|
|
851
|
+
if (Number.isSafeInteger(parsed) && parsed >= minimum && parsed <= maximum) return parsed;
|
|
852
|
+
}
|
|
853
|
+
return fallback;
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
function booleanSetting(
|
|
857
|
+
envValue: string | undefined,
|
|
858
|
+
configured: unknown,
|
|
859
|
+
fallback: boolean,
|
|
860
|
+
): boolean {
|
|
861
|
+
if (envValue !== undefined) {
|
|
862
|
+
if (envValue === "1" || envValue.toLowerCase() === "true") return true;
|
|
863
|
+
if (envValue === "0" || envValue.toLowerCase() === "false") return false;
|
|
864
|
+
}
|
|
865
|
+
return typeof configured === "boolean" ? configured : fallback;
|
|
866
|
+
}
|
|
867
|
+
|
|
736
868
|
/** Resolved `harn backup` defaults (restic repo/password + prune policy). */
|
|
737
869
|
export interface BackupConfig {
|
|
738
870
|
repo: string;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import type { SupervisorCapability, SupervisorFinding } from "../supervisor/contract.ts";
|
|
2
|
+
import {
|
|
3
|
+
DIAGNOSTIC_ADVICE_LIMITS,
|
|
4
|
+
DIAGNOSTIC_ADVICE_SCHEMA_VERSION,
|
|
5
|
+
type DiagnosticAdvice,
|
|
6
|
+
type DiagnosticAdviceFinding,
|
|
7
|
+
type DiagnosticAdviceReason,
|
|
8
|
+
} from "./contract.ts";
|
|
9
|
+
|
|
10
|
+
export interface BuildDiagnosticAdviceInput {
|
|
11
|
+
findings: readonly SupervisorFinding[];
|
|
12
|
+
sourceCapability: SupervisorCapability;
|
|
13
|
+
evaluatedAt: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const SEVERITY_RANK: Readonly<Record<SupervisorFinding["severity"], number>> = {
|
|
17
|
+
info: 0,
|
|
18
|
+
warning: 1,
|
|
19
|
+
critical: 2,
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export function buildDiagnosticAdvice(input: BuildDiagnosticAdviceInput): DiagnosticAdvice {
|
|
23
|
+
const sourceAvailable = input.sourceCapability.state === "supported";
|
|
24
|
+
const active = sourceAvailable
|
|
25
|
+
? input.findings.filter((finding) => finding.state === "opened").sort(compareFindings)
|
|
26
|
+
: [];
|
|
27
|
+
const pressureFindings = active.filter(
|
|
28
|
+
(finding): finding is SupervisorFinding & { severity: "warning" | "critical" } =>
|
|
29
|
+
finding.severity === "warning" || finding.severity === "critical",
|
|
30
|
+
);
|
|
31
|
+
const critical = pressureFindings.filter((finding) => finding.severity === "critical");
|
|
32
|
+
const warning = pressureFindings.filter((finding) => finding.severity === "warning");
|
|
33
|
+
const pressure = critical.length
|
|
34
|
+
? "critical"
|
|
35
|
+
: warning.length
|
|
36
|
+
? "elevated"
|
|
37
|
+
: sourceAvailable
|
|
38
|
+
? "normal"
|
|
39
|
+
: "unknown";
|
|
40
|
+
const fanOutRecommendation =
|
|
41
|
+
pressure === "critical"
|
|
42
|
+
? "avoid-new-fan-out"
|
|
43
|
+
: pressure === "elevated"
|
|
44
|
+
? "use-caution"
|
|
45
|
+
: pressure === "normal"
|
|
46
|
+
? "proceed"
|
|
47
|
+
: "unknown";
|
|
48
|
+
const contributing = pressureFindings.slice(
|
|
49
|
+
0,
|
|
50
|
+
DIAGNOSTIC_ADVICE_LIMITS.max_contributing_findings,
|
|
51
|
+
);
|
|
52
|
+
return {
|
|
53
|
+
schema_version: DIAGNOSTIC_ADVICE_SCHEMA_VERSION,
|
|
54
|
+
evaluated_at: input.evaluatedAt,
|
|
55
|
+
pressure,
|
|
56
|
+
fan_out_recommendation: fanOutRecommendation,
|
|
57
|
+
observer_only: true,
|
|
58
|
+
summary: summaryFor(pressure),
|
|
59
|
+
source_capability: input.sourceCapability,
|
|
60
|
+
active_finding_count: active.length,
|
|
61
|
+
contributing_finding_count: pressureFindings.length,
|
|
62
|
+
omitted_contributing_finding_count: Math.max(0, pressureFindings.length - contributing.length),
|
|
63
|
+
contributing_findings: contributing.map(adviceFinding),
|
|
64
|
+
reasons: reasonsFor(critical, warning, input.sourceCapability),
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function adviceFinding(
|
|
69
|
+
finding: SupervisorFinding & { severity: "warning" | "critical" },
|
|
70
|
+
): DiagnosticAdviceFinding {
|
|
71
|
+
return {
|
|
72
|
+
finding_id: finding.id,
|
|
73
|
+
finding_kind: finding.finding_kind,
|
|
74
|
+
severity: finding.severity,
|
|
75
|
+
summary: finding.summary,
|
|
76
|
+
scope_kind: finding.scope_kind,
|
|
77
|
+
scope_id: finding.scope_id,
|
|
78
|
+
occurrence_count: finding.occurrence_count,
|
|
79
|
+
owner_kind: finding.attribution?.owner_kind,
|
|
80
|
+
owner_id: finding.attribution?.owner_id,
|
|
81
|
+
workload_relationship: finding.workload_context?.relationship,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function reasonsFor(
|
|
86
|
+
critical: readonly SupervisorFinding[],
|
|
87
|
+
warning: readonly SupervisorFinding[],
|
|
88
|
+
capability: SupervisorCapability,
|
|
89
|
+
): DiagnosticAdviceReason[] {
|
|
90
|
+
const reasons: DiagnosticAdviceReason[] = [];
|
|
91
|
+
if (critical.length) {
|
|
92
|
+
reasons.push({
|
|
93
|
+
code: "critical_findings_active",
|
|
94
|
+
summary: `${critical.length} active critical finding${critical.length === 1 ? "" : "s"} ${critical.length === 1 ? "requires" : "require"} attention.`,
|
|
95
|
+
finding_ids: boundedIds(critical),
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
if (warning.length) {
|
|
99
|
+
reasons.push({
|
|
100
|
+
code: "warning_findings_active",
|
|
101
|
+
summary: `${warning.length} active warning finding${warning.length === 1 ? "" : "s"} ${warning.length === 1 ? "indicates" : "indicate"} elevated pressure.`,
|
|
102
|
+
finding_ids: boundedIds(warning),
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
if (capability.state !== "supported") {
|
|
106
|
+
reasons.push({
|
|
107
|
+
code: "findings_source_unavailable",
|
|
108
|
+
summary: `The findings source is ${capability.state}${capability.reason_code ? ` (${capability.reason_code})` : ""}.`,
|
|
109
|
+
finding_ids: [],
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
if (!critical.length && !warning.length && capability.state === "supported") {
|
|
113
|
+
reasons.push({
|
|
114
|
+
code: "no_active_pressure_findings",
|
|
115
|
+
summary: "No active warning or critical findings were observed.",
|
|
116
|
+
finding_ids: [],
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
return reasons.slice(0, DIAGNOSTIC_ADVICE_LIMITS.max_reasons);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function boundedIds(findings: readonly SupervisorFinding[]): string[] {
|
|
123
|
+
return findings
|
|
124
|
+
.slice(0, DIAGNOSTIC_ADVICE_LIMITS.max_contributing_findings)
|
|
125
|
+
.map((finding) => finding.id);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function summaryFor(pressure: DiagnosticAdvice["pressure"]): string {
|
|
129
|
+
switch (pressure) {
|
|
130
|
+
case "critical":
|
|
131
|
+
return "Critical local pressure is active. Avoid starting additional agent work until the findings change.";
|
|
132
|
+
case "elevated":
|
|
133
|
+
return "Elevated local pressure is active. Limit new fan-out and inspect the contributing findings.";
|
|
134
|
+
case "normal":
|
|
135
|
+
return "No active warning or critical findings were observed. Diagnostics do not restrict new fan-out.";
|
|
136
|
+
case "unknown":
|
|
137
|
+
return "Local pressure cannot be determined because the findings source is unavailable.";
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function compareFindings(left: SupervisorFinding, right: SupervisorFinding): number {
|
|
142
|
+
return (
|
|
143
|
+
SEVERITY_RANK[right.severity] - SEVERITY_RANK[left.severity] ||
|
|
144
|
+
right.observed_at.localeCompare(left.observed_at) ||
|
|
145
|
+
left.id.localeCompare(right.id)
|
|
146
|
+
);
|
|
147
|
+
}
|