harnery 0.38.0 → 0.40.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/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +32 -8
- package/dist/commands/artifacts.d.ts.map +1 -1
- package/dist/commands/artifacts.js +97 -6
- package/dist/commands/backup.d.ts +16 -0
- package/dist/commands/backup.d.ts.map +1 -1
- package/dist/commands/backup.js +239 -33
- package/dist/commands/browse.d.ts +8 -0
- package/dist/commands/browse.d.ts.map +1 -1
- package/dist/commands/browse.js +466 -231
- package/dist/commands/diagnostics.d.ts.map +1 -1
- package/dist/commands/diagnostics.js +6 -3
- package/dist/commands/ledger-v3.d.ts.map +1 -1
- package/dist/commands/ledger-v3.js +20 -4
- package/dist/commands/qa-run.d.ts.map +1 -1
- package/dist/commands/qa-run.js +26 -3
- package/dist/commands/qa-status.d.ts.map +1 -1
- package/dist/commands/qa-status.js +7 -2
- package/dist/commands/resources.d.ts.map +1 -1
- package/dist/commands/resources.js +23 -3
- package/dist/commands/review-pack.d.ts.map +1 -1
- package/dist/commands/review-pack.js +98 -23
- package/dist/commands/tunnel.d.ts.map +1 -1
- package/dist/commands/tunnel.js +2 -2
- package/dist/core/adapters/profiles.d.ts +1 -1
- package/dist/core/agents/canonical-emit.d.ts +3 -2
- package/dist/core/agents/canonical-emit.d.ts.map +1 -1
- package/dist/core/agents/canonical-emit.js +2 -0
- package/dist/core/agents/cli.js +13 -6
- package/dist/core/agents/live-authority-v3.d.ts.map +1 -1
- package/dist/core/agents/live-authority-v3.js +5 -3
- package/dist/core/agents/live-lifecycle-v3.d.ts +2 -2
- package/dist/core/agents/live-lifecycle-v3.d.ts.map +1 -1
- package/dist/core/agents/render/prompt-context.d.ts +7 -5
- package/dist/core/agents/render/prompt-context.d.ts.map +1 -1
- package/dist/core/agents/render/prompt-context.js +63 -8
- package/dist/core/agents/session-finalizer-v3.d.ts +2 -2
- package/dist/core/agents/session-finalizer-v3.d.ts.map +1 -1
- package/dist/core/agents/state/live-coordination-view.d.ts +3 -3
- package/dist/core/agents/state/live-coordination-view.d.ts.map +1 -1
- package/dist/core/agents/state/live-coordination-view.js +2 -1
- package/dist/core/agents/state/names.d.ts +35 -2
- package/dist/core/agents/state/names.d.ts.map +1 -1
- package/dist/core/agents/state/names.js +80 -5
- package/dist/core/agents/state/stale-sweep.d.ts +2 -1
- package/dist/core/agents/state/stale-sweep.d.ts.map +1 -1
- package/dist/core/agents/state/stale-sweep.js +23 -6
- package/dist/core/agents/turn-elapsed.d.ts +51 -0
- package/dist/core/agents/turn-elapsed.d.ts.map +1 -0
- package/dist/core/agents/turn-elapsed.js +91 -0
- package/dist/core/artifacts/activity.d.ts +14 -0
- package/dist/core/artifacts/activity.d.ts.map +1 -0
- package/dist/core/artifacts/activity.js +52 -0
- package/dist/core/artifacts/delivery-card.d.ts +39 -0
- package/dist/core/artifacts/delivery-card.d.ts.map +1 -0
- package/dist/core/artifacts/delivery-card.js +282 -0
- package/dist/core/artifacts/index.d.ts +42 -7
- package/dist/core/artifacts/index.d.ts.map +1 -1
- package/dist/core/artifacts/index.js +288 -76
- package/dist/core/artifacts/mutation-lock.d.ts +2 -0
- package/dist/core/artifacts/mutation-lock.d.ts.map +1 -0
- package/dist/core/artifacts/mutation-lock.js +91 -0
- package/dist/core/backup/host-snapshot.d.ts +18 -0
- package/dist/core/backup/host-snapshot.d.ts.map +1 -0
- package/dist/core/backup/host-snapshot.js +64 -0
- package/dist/core/config.d.ts +20 -5
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +44 -10
- package/dist/core/diagnostics/advice.d.ts +38 -3
- package/dist/core/diagnostics/advice.d.ts.map +1 -1
- package/dist/core/diagnostics/advice.js +103 -99
- package/dist/core/diagnostics/bundle.d.ts.map +1 -1
- package/dist/core/diagnostics/bundle.js +111 -47
- package/dist/core/diagnostics/comparison.d.ts.map +1 -1
- package/dist/core/diagnostics/comparison.js +3 -2
- package/dist/core/diagnostics/contract.d.ts +15 -31
- package/dist/core/diagnostics/contract.d.ts.map +1 -1
- package/dist/core/diagnostics/contract.js +2 -5
- package/dist/core/diagnostics/index.d.ts +2 -0
- package/dist/core/diagnostics/index.d.ts.map +1 -1
- package/dist/core/diagnostics/index.js +2 -0
- package/dist/core/diagnostics/pressure-contract.d.ts +260 -0
- package/dist/core/diagnostics/pressure-contract.d.ts.map +1 -0
- package/dist/core/diagnostics/pressure-contract.js +70 -0
- package/dist/core/diagnostics/pressure.d.ts +25 -0
- package/dist/core/diagnostics/pressure.d.ts.map +1 -0
- package/dist/core/diagnostics/pressure.js +1138 -0
- package/dist/core/diagnostics/replay.d.ts.map +1 -1
- package/dist/core/diagnostics/replay.js +90 -10
- package/dist/core/events/v3/adapter-id.d.ts +6 -0
- package/dist/core/events/v3/adapter-id.d.ts.map +1 -0
- package/dist/core/events/v3/adapter-id.js +7 -0
- package/dist/core/events/v3/archive-retention.d.ts.map +1 -1
- package/dist/core/events/v3/archive-retention.js +3 -2
- package/dist/core/events/v3/bootstrap.d.ts +41 -4
- package/dist/core/events/v3/bootstrap.d.ts.map +1 -1
- package/dist/core/events/v3/bootstrap.js +120 -17
- package/dist/core/events/v3/capabilities.d.ts +16 -9
- package/dist/core/events/v3/capabilities.d.ts.map +1 -1
- package/dist/core/events/v3/capabilities.js +37 -2
- package/dist/core/events/v3/capability-drift.d.ts +2 -2
- package/dist/core/events/v3/capability-drift.d.ts.map +1 -1
- package/dist/core/events/v3/control-witness.d.ts +48 -5
- package/dist/core/events/v3/control-witness.d.ts.map +1 -1
- package/dist/core/events/v3/control-witness.js +91 -36
- package/dist/core/events/v3/control.d.ts.map +1 -1
- package/dist/core/events/v3/control.js +22 -2
- package/dist/core/events/v3/index.d.ts +2 -1
- package/dist/core/events/v3/index.d.ts.map +1 -1
- package/dist/core/events/v3/index.js +2 -1
- package/dist/core/events/v3/live-feed.d.ts +7 -1
- package/dist/core/events/v3/live-feed.d.ts.map +1 -1
- package/dist/core/events/v3/live-feed.js +21 -3
- package/dist/core/events/v3/live-routing.d.ts.map +1 -1
- package/dist/core/events/v3/live-routing.js +10 -2
- package/dist/core/events/v3/producers/command-recorder.d.ts +2 -2
- package/dist/core/events/v3/producers/command-recorder.d.ts.map +1 -1
- package/dist/core/events/v3/producers/command-recorder.js +2 -1
- package/dist/core/events/v3/producers/coordination-recorder.d.ts +2 -2
- package/dist/core/events/v3/producers/coordination-recorder.d.ts.map +1 -1
- package/dist/core/events/v3/producers/coordination-recorder.js +2 -1
- package/dist/core/events/v3/producers/hook-base.d.ts +2 -2
- package/dist/core/events/v3/producers/hook-base.d.ts.map +1 -1
- package/dist/core/events/v3/producers/hook-base.js +15 -5
- package/dist/core/events/v3/producers/hook.d.ts.map +1 -1
- package/dist/core/events/v3/producers/hook.js +17 -4
- package/dist/core/events/v3/producers/intake.d.ts +4 -4
- package/dist/core/events/v3/producers/intake.d.ts.map +1 -1
- package/dist/core/events/v3/producers/intake.js +3 -2
- package/dist/core/events/v3/producers/producer-state-observer.d.ts.map +1 -1
- package/dist/core/events/v3/producers/producer-state-observer.js +2 -1
- package/dist/core/events/v3/producers/recorder.d.ts +16 -5
- package/dist/core/events/v3/producers/recorder.d.ts.map +1 -1
- package/dist/core/events/v3/producers/recorder.js +31 -9
- package/dist/core/events/v3/reader.d.ts.map +1 -1
- package/dist/core/events/v3/reader.js +10 -13
- package/dist/core/events/v3/runtime-build.d.ts.map +1 -1
- package/dist/core/events/v3/runtime-build.js +3 -2
- package/dist/core/events/v3/runtime-telemetry-capabilities.d.ts +2 -2
- package/dist/core/events/v3/runtime-telemetry-capabilities.d.ts.map +1 -1
- package/dist/core/events/v3/turn-telemetry.d.ts +2 -2
- package/dist/core/events/v3/turn-telemetry.d.ts.map +1 -1
- package/dist/core/hooks/adapter/output.d.ts +16 -14
- package/dist/core/hooks/adapter/output.d.ts.map +1 -1
- package/dist/core/hooks/adapter/output.js +36 -38
- package/dist/core/hooks/backup-schedule.d.ts +34 -0
- package/dist/core/hooks/backup-schedule.d.ts.map +1 -0
- package/dist/core/hooks/backup-schedule.js +114 -0
- package/dist/core/hooks/cli.js +61 -18
- package/dist/core/hooks/codex-wsl-bridge.d.ts +2 -0
- package/dist/core/hooks/codex-wsl-bridge.d.ts.map +1 -1
- package/dist/core/hooks/codex-wsl-bridge.js +18 -4
- package/dist/core/hooks/index.d.ts +1 -0
- package/dist/core/hooks/index.d.ts.map +1 -1
- package/dist/core/hooks/index.js +1 -0
- package/dist/core/hooks/prompt-context/contract.d.ts +61 -0
- package/dist/core/hooks/prompt-context/contract.d.ts.map +1 -0
- package/dist/core/hooks/prompt-context/contract.js +102 -0
- package/dist/core/hooks/prompt-context/index.d.ts +5 -0
- package/dist/core/hooks/prompt-context/index.d.ts.map +1 -0
- package/dist/core/hooks/prompt-context/index.js +2 -0
- package/dist/core/hooks/prompt-context/runner.d.ts +24 -0
- package/dist/core/hooks/prompt-context/runner.d.ts.map +1 -0
- package/dist/core/hooks/prompt-context/runner.js +249 -0
- package/dist/core/qa-artifacts.d.ts +3 -0
- package/dist/core/qa-artifacts.d.ts.map +1 -1
- package/dist/core/qa-artifacts.js +25 -3
- package/dist/core/resources/contract.d.ts +69 -3
- package/dist/core/resources/contract.d.ts.map +1 -1
- package/dist/core/resources/contract.js +1 -1
- package/dist/core/resources/index.d.ts +1 -0
- package/dist/core/resources/index.d.ts.map +1 -1
- package/dist/core/resources/index.js +1 -0
- package/dist/core/resources/native.d.ts +36 -0
- package/dist/core/resources/native.d.ts.map +1 -0
- package/dist/core/resources/native.js +418 -0
- package/dist/core/resources/sampler.d.ts +2 -0
- package/dist/core/resources/sampler.d.ts.map +1 -1
- package/dist/core/resources/sampler.js +31 -1
- package/dist/core/resources/status.d.ts +61 -0
- package/dist/core/resources/status.d.ts.map +1 -0
- package/dist/core/resources/status.js +536 -0
- package/dist/core/resources/system.d.ts +27 -0
- package/dist/core/resources/system.d.ts.map +1 -0
- package/dist/core/resources/system.js +439 -0
- package/dist/core/semantic/contract.d.ts +13 -13
- package/dist/core/semantic/service.d.ts +2 -0
- package/dist/core/semantic/service.d.ts.map +1 -1
- package/dist/core/semantic/service.js +27 -4
- package/dist/core/storage/builtins.js +41 -0
- package/dist/core/supervisor/contract.d.ts +41 -3
- package/dist/core/supervisor/contract.d.ts.map +1 -1
- package/dist/core/supervisor/contract.js +3 -2
- package/dist/core/supervisor/findings.d.ts +3 -0
- package/dist/core/supervisor/findings.d.ts.map +1 -1
- package/dist/core/supervisor/findings.js +88 -0
- package/dist/core/supervisor/history.d.ts.map +1 -1
- package/dist/core/supervisor/history.js +14 -0
- package/dist/core/supervisor/ledger-state.d.ts +55 -0
- package/dist/core/supervisor/ledger-state.d.ts.map +1 -0
- package/dist/core/supervisor/ledger-state.js +0 -0
- package/dist/core/supervisor/service.d.ts.map +1 -1
- package/dist/core/supervisor/service.js +120 -7
- package/dist/core/supervisor/storage.d.ts +3 -1
- package/dist/core/supervisor/storage.d.ts.map +1 -1
- package/dist/core/supervisor/storage.js +4 -0
- package/dist/core/workflow/admission.d.ts +3 -0
- package/dist/core/workflow/admission.d.ts.map +1 -1
- package/dist/core/workflow/admission.js +28 -16
- package/dist/core/workflow/engine.js +2 -2
- package/dist/core/workflow/live-session-v3.d.ts.map +1 -1
- package/dist/core/workflow/live-session-v3.js +6 -1
- package/dist/core/workflow/proof.d.ts.map +1 -1
- package/dist/core/workflow/proof.js +4 -3
- package/dist/lib/browser/capture-fidelity.d.ts +7 -0
- package/dist/lib/browser/capture-fidelity.d.ts.map +1 -1
- package/dist/lib/browser/capture-fidelity.js +17 -0
- package/dist/lib/browser/client.d.ts +9 -0
- package/dist/lib/browser/client.d.ts.map +1 -1
- package/dist/lib/browser/client.js +85 -37
- package/dist/lib/browser/index.d.ts +3 -1
- package/dist/lib/browser/index.d.ts.map +1 -1
- package/dist/lib/browser/index.js +2 -1
- package/dist/lib/browser/page-review-budget.d.ts +13 -0
- package/dist/lib/browser/page-review-budget.d.ts.map +1 -0
- package/dist/lib/browser/page-review-budget.js +251 -0
- package/dist/lib/browser/page-review-contracts.d.ts +127 -0
- package/dist/lib/browser/page-review-contracts.d.ts.map +1 -0
- package/dist/lib/browser/page-review-contracts.js +5 -0
- package/dist/lib/browser/page-review-evidence.d.ts +48 -0
- package/dist/lib/browser/page-review-evidence.d.ts.map +1 -0
- package/dist/lib/browser/page-review-evidence.js +340 -0
- package/dist/lib/browser/page-review-judge.d.ts +1 -1
- package/dist/lib/browser/page-review-judge.d.ts.map +1 -1
- package/dist/lib/browser/page-review-judge.js +46 -38
- package/dist/lib/browser/page-review-pack.d.ts +44 -22
- package/dist/lib/browser/page-review-pack.d.ts.map +1 -1
- package/dist/lib/browser/page-review-pack.js +116 -36
- package/dist/lib/browser/page-review-source.d.ts +12 -0
- package/dist/lib/browser/page-review-source.d.ts.map +1 -0
- package/dist/lib/browser/page-review-source.js +22 -0
- package/dist/lib/browser/qa-run-contracts.d.ts +35 -9
- package/dist/lib/browser/qa-run-contracts.d.ts.map +1 -1
- package/dist/lib/browser/qa-run-contracts.js +48 -14
- package/dist/lib/browser/qa-run.d.ts.map +1 -1
- package/dist/lib/browser/qa-run.js +215 -68
- package/dist/lib/browser/qa-snapshot.d.ts +6 -0
- package/dist/lib/browser/qa-snapshot.d.ts.map +1 -1
- package/dist/lib/browser/qa-snapshot.js +259 -48
- package/dist/lib/browser/review-capture-transaction.d.ts +13 -0
- package/dist/lib/browser/review-capture-transaction.d.ts.map +1 -0
- package/dist/lib/browser/review-capture-transaction.js +79 -0
- package/dist/lib/browser/standalone-html.d.ts.map +1 -1
- package/dist/lib/browser/standalone-html.js +4 -2
- package/dist/lib/browser/thumbnail-association.d.ts +34 -0
- package/dist/lib/browser/thumbnail-association.d.ts.map +1 -0
- package/dist/lib/browser/thumbnail-association.js +158 -0
- package/dist/lib/browser/tiling.d.ts +30 -0
- package/dist/lib/browser/tiling.d.ts.map +1 -1
- package/dist/lib/browser/tiling.js +38 -0
- package/dist/lib/docs-metadata-managed.d.ts.map +1 -1
- package/dist/lib/docs-metadata-managed.js +4 -1
- package/dist/lib/identities/assume.d.ts.map +1 -1
- package/dist/lib/identities/assume.js +7 -1
- package/dist/lib/instructions/templates.d.ts.map +1 -1
- package/dist/lib/instructions/templates.js +1 -0
- package/dist/lib/local-file-url.d.ts +12 -0
- package/dist/lib/local-file-url.d.ts.map +1 -1
- package/dist/lib/local-file-url.js +16 -2
- package/dist/lib/tunnel/state.d.ts +19 -4
- package/dist/lib/tunnel/state.d.ts.map +1 -1
- package/dist/lib/tunnel/state.js +53 -13
- package/package.json +7 -4
- package/schemas/config.schema.json +69 -2
- package/src/commands/agents.ts +42 -9
- package/src/commands/artifacts.ts +130 -6
- package/src/commands/backup.ts +287 -34
- package/src/commands/browse.ts +564 -267
- package/src/commands/diagnostics.ts +6 -3
- package/src/commands/ledger-v3.ts +20 -3
- package/src/commands/qa-run.ts +37 -3
- package/src/commands/qa-status.ts +11 -2
- package/src/commands/resources.ts +23 -3
- package/src/commands/review-pack.ts +165 -62
- package/src/commands/tunnel.ts +2 -1
- package/src/core/agents/canonical-emit.ts +4 -2
- package/src/core/agents/cli.ts +14 -6
- package/src/core/agents/live-authority-v3.ts +7 -3
- package/src/core/agents/live-lifecycle-v3.ts +2 -2
- package/src/core/agents/render/prompt-context.ts +68 -14
- package/src/core/agents/session-finalizer-v3.ts +2 -2
- package/src/core/agents/state/live-coordination-view.ts +4 -4
- package/src/core/agents/state/names.ts +92 -7
- package/src/core/agents/state/stale-sweep.ts +22 -8
- package/src/core/agents/turn-elapsed.ts +135 -0
- package/src/core/artifacts/activity.ts +71 -0
- package/src/core/artifacts/delivery-card.ts +375 -0
- package/src/core/artifacts/index.ts +385 -91
- package/src/core/artifacts/mutation-lock.ts +106 -0
- package/src/core/backup/host-snapshot.ts +76 -0
- package/src/core/config.ts +66 -13
- package/src/core/diagnostics/advice.ts +148 -120
- package/src/core/diagnostics/bundle.ts +138 -52
- package/src/core/diagnostics/comparison.ts +6 -2
- package/src/core/diagnostics/contract.ts +39 -42
- package/src/core/diagnostics/index.ts +2 -0
- package/src/core/diagnostics/pressure-contract.ts +294 -0
- package/src/core/diagnostics/pressure.ts +1361 -0
- package/src/core/diagnostics/replay.ts +116 -11
- package/src/core/events/v3/adapter-id.ts +12 -0
- package/src/core/events/v3/archive-retention.ts +3 -6
- package/src/core/events/v3/bootstrap.ts +163 -16
- package/src/core/events/v3/capabilities.ts +75 -25
- package/src/core/events/v3/capability-drift.ts +2 -2
- package/src/core/events/v3/control-witness.ts +172 -41
- package/src/core/events/v3/control.ts +34 -2
- package/src/core/events/v3/index.ts +3 -0
- package/src/core/events/v3/live-feed.ts +23 -5
- package/src/core/events/v3/live-routing.ts +14 -2
- package/src/core/events/v3/producers/command-recorder.ts +4 -4
- package/src/core/events/v3/producers/coordination-recorder.ts +4 -4
- package/src/core/events/v3/producers/hook-base.ts +21 -16
- package/src/core/events/v3/producers/hook.ts +21 -4
- package/src/core/events/v3/producers/intake.ts +6 -6
- package/src/core/events/v3/producers/producer-state-observer.ts +2 -1
- package/src/core/events/v3/producers/recorder.ts +50 -21
- package/src/core/events/v3/reader.ts +14 -13
- package/src/core/events/v3/runtime-build.ts +3 -2
- package/src/core/events/v3/runtime-telemetry-capabilities.ts +3 -3
- package/src/core/events/v3/turn-telemetry.ts +4 -4
- package/src/core/hooks/adapter/output.ts +50 -36
- package/src/core/hooks/backup-schedule.ts +147 -0
- package/src/core/hooks/cli.ts +65 -14
- package/src/core/hooks/codex-wsl-bridge.ts +21 -5
- package/src/core/hooks/index.ts +1 -0
- package/src/core/hooks/prompt-context/contract.ts +177 -0
- package/src/core/hooks/prompt-context/index.ts +22 -0
- package/src/core/hooks/prompt-context/runner.ts +303 -0
- package/src/core/qa-artifacts.ts +29 -3
- package/src/core/resources/contract.ts +76 -3
- package/src/core/resources/index.ts +1 -0
- package/src/core/resources/native.ts +481 -0
- package/src/core/resources/sampler.ts +46 -1
- package/src/core/resources/status.ts +717 -0
- package/src/core/resources/system.ts +530 -0
- package/src/core/semantic/service.ts +37 -3
- package/src/core/storage/builtins.ts +41 -0
- package/src/core/supervisor/contract.ts +45 -3
- package/src/core/supervisor/findings.ts +159 -0
- package/src/core/supervisor/history.ts +15 -0
- package/src/core/supervisor/ledger-state.ts +0 -0
- package/src/core/supervisor/service.ts +133 -5
- package/src/core/supervisor/storage.ts +7 -0
- package/src/core/workflow/admission.ts +33 -17
- package/src/core/workflow/engine.ts +2 -2
- package/src/core/workflow/live-session-v3.ts +6 -8
- package/src/core/workflow/proof.ts +4 -3
- package/src/lib/browser/capture-fidelity.ts +23 -0
- package/src/lib/browser/client.ts +96 -44
- package/src/lib/browser/index.ts +15 -1
- package/src/lib/browser/page-review-budget.ts +309 -0
- package/src/lib/browser/page-review-contracts.ts +129 -0
- package/src/lib/browser/page-review-evidence.ts +465 -0
- package/src/lib/browser/page-review-judge.ts +56 -40
- package/src/lib/browser/page-review-pack.ts +181 -43
- package/src/lib/browser/page-review-source.ts +30 -0
- package/src/lib/browser/qa-run-contracts.ts +62 -18
- package/src/lib/browser/qa-run.ts +259 -71
- package/src/lib/browser/qa-snapshot.ts +289 -48
- package/src/lib/browser/review-capture-transaction.ts +106 -0
- package/src/lib/browser/standalone-html.ts +4 -2
- package/src/lib/browser/thumbnail-association.ts +190 -0
- package/src/lib/browser/tiling.ts +63 -0
- package/src/lib/docs-metadata-managed.ts +4 -1
- package/src/lib/identities/assume.ts +12 -4
- package/src/lib/instructions/templates.ts +1 -0
- package/src/lib/local-file-url.ts +17 -2
- package/src/lib/tunnel/state.ts +70 -13
|
@@ -37,7 +37,6 @@ import {
|
|
|
37
37
|
} from "../supervisor/contract.ts";
|
|
38
38
|
import { readWorkflowProof } from "../workflow/proof.ts";
|
|
39
39
|
import {
|
|
40
|
-
DIAGNOSTIC_ADVICE_LIMITS,
|
|
41
40
|
DIAGNOSTIC_ADVICE_SCHEMA_VERSION,
|
|
42
41
|
DIAGNOSTIC_BUNDLE_FILES,
|
|
43
42
|
DIAGNOSTIC_BUNDLE_SCHEMA_VERSION,
|
|
@@ -53,6 +52,8 @@ import {
|
|
|
53
52
|
type DiagnosticSelection,
|
|
54
53
|
type DiagnosticSummary,
|
|
55
54
|
type DiagnosticThresholds,
|
|
55
|
+
PRESSURE_ASSESSMENT_SCHEMA_VERSION,
|
|
56
|
+
PRESSURE_POLICY,
|
|
56
57
|
type ValidatedDiagnosticBundle,
|
|
57
58
|
} from "./contract.ts";
|
|
58
59
|
import { pseudonymousMachineId } from "./identity.ts";
|
|
@@ -71,6 +72,7 @@ const SOURCE_SPECS = [
|
|
|
71
72
|
["supervisor.snapshot", ".harnery/supervisor/snapshot.json"],
|
|
72
73
|
["supervisor.history", ".harnery/supervisor/history.json"],
|
|
73
74
|
["supervisor.findings", ".harnery/supervisor/findings.json"],
|
|
75
|
+
["supervisor.pressure", ".harnery/supervisor/pressure.json"],
|
|
74
76
|
["supervisor.activity", ".harnery/supervisor/activity.json"],
|
|
75
77
|
["supervisor.timelines", ".harnery/supervisor/timelines"],
|
|
76
78
|
["supervisor.explanations", ".harnery/supervisor/explanations"],
|
|
@@ -147,6 +149,9 @@ export function captureDiagnosticBundle(
|
|
|
147
149
|
diagnostic_limits: SUPERVISOR_DIAGNOSTIC_LIMITS,
|
|
148
150
|
finding_policy: SUPERVISOR_FINDING_POLICY,
|
|
149
151
|
resource_budget: SUPERVISOR_RESOURCE_BUDGET,
|
|
152
|
+
// Every numeric pressure threshold is part of the digest, so tuning one
|
|
153
|
+
// invalidates a frozen replay instead of silently changing its result.
|
|
154
|
+
pressure_policy: PRESSURE_POLICY,
|
|
150
155
|
},
|
|
151
156
|
};
|
|
152
157
|
const expected = deriveCapturedExpected(observations, thresholds);
|
|
@@ -513,8 +518,10 @@ function readShadowAdmissionSource(
|
|
|
513
518
|
...(admission.reason_code ? { reason_code: admission.reason_code } : {}),
|
|
514
519
|
...(admission.observation
|
|
515
520
|
? {
|
|
516
|
-
pressure: admission.observation.advice.
|
|
517
|
-
|
|
521
|
+
pressure: admission.observation.advice.assessment.state,
|
|
522
|
+
recommended_action: admission.observation.advice.assessment.recommended_action,
|
|
523
|
+
scope: admission.observation.advice.assessment.scope,
|
|
524
|
+
limiting_resource: admission.observation.advice.assessment.limiting_resource,
|
|
518
525
|
freshness: admission.observation.freshness,
|
|
519
526
|
service_state: admission.observation.service_state,
|
|
520
527
|
wait_ms: admission.observation.wait_ms,
|
|
@@ -1036,16 +1043,12 @@ function validateAdvice(advice: ValidatedDiagnosticBundle["expected"]["advice"])
|
|
|
1036
1043
|
[
|
|
1037
1044
|
"schema_version",
|
|
1038
1045
|
"evaluated_at",
|
|
1039
|
-
"pressure",
|
|
1040
|
-
"fan_out_recommendation",
|
|
1041
1046
|
"observer_only",
|
|
1042
|
-
"
|
|
1047
|
+
"assessment",
|
|
1048
|
+
"prior_hysteresis",
|
|
1043
1049
|
"source_capability",
|
|
1044
1050
|
"active_finding_count",
|
|
1045
|
-
"
|
|
1046
|
-
"omitted_contributing_finding_count",
|
|
1047
|
-
"contributing_findings",
|
|
1048
|
-
"reasons",
|
|
1051
|
+
"summary",
|
|
1049
1052
|
],
|
|
1050
1053
|
[],
|
|
1051
1054
|
"diagnostic advice",
|
|
@@ -1053,73 +1056,156 @@ function validateAdvice(advice: ValidatedDiagnosticBundle["expected"]["advice"])
|
|
|
1053
1056
|
if (
|
|
1054
1057
|
advice.schema_version !== DIAGNOSTIC_ADVICE_SCHEMA_VERSION ||
|
|
1055
1058
|
!validIso(advice.evaluated_at) ||
|
|
1056
|
-
!["normal", "elevated", "critical", "unknown"].includes(advice.pressure) ||
|
|
1057
|
-
!["proceed", "use-caution", "avoid-new-fan-out", "unknown"].includes(
|
|
1058
|
-
advice.fan_out_recommendation,
|
|
1059
|
-
) ||
|
|
1060
1059
|
advice.observer_only !== true ||
|
|
1061
1060
|
typeof advice.summary !== "string" ||
|
|
1062
|
-
advice.summary.length > SUPERVISOR_DIAGNOSTIC_LIMITS.max_summary_chars
|
|
1061
|
+
advice.summary.length > SUPERVISOR_DIAGNOSTIC_LIMITS.max_summary_chars ||
|
|
1062
|
+
!boundedInteger(advice.active_finding_count, 0, SUPERVISOR_DIAGNOSTIC_LIMITS.max_findings)
|
|
1063
1063
|
) {
|
|
1064
1064
|
throw new Error("invalid diagnostic advice contract");
|
|
1065
1065
|
}
|
|
1066
1066
|
validateCapabilities([advice.source_capability], "diagnostic advice capability");
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1067
|
+
validateAssessment(advice.assessment);
|
|
1068
|
+
if (advice.prior_hysteresis !== null) validateHysteresis(advice.prior_hysteresis);
|
|
1069
|
+
}
|
|
1070
|
+
|
|
1071
|
+
function validateAssessment(assessment: unknown): void {
|
|
1072
|
+
if (!assessment || typeof assessment !== "object" || Array.isArray(assessment))
|
|
1073
|
+
throw new Error("invalid pressure assessment");
|
|
1074
|
+
const value = assessment as Record<string, unknown>;
|
|
1075
|
+
assertKeys(
|
|
1076
|
+
value,
|
|
1077
|
+
[
|
|
1078
|
+
"schema_version",
|
|
1079
|
+
"observer_only",
|
|
1080
|
+
"state",
|
|
1081
|
+
"scope",
|
|
1082
|
+
"limiting_resource",
|
|
1083
|
+
"trend",
|
|
1084
|
+
"observed_at",
|
|
1085
|
+
"sample_age_ms",
|
|
1086
|
+
"evidence_state",
|
|
1087
|
+
"evidence",
|
|
1088
|
+
"reasons",
|
|
1089
|
+
"contributors",
|
|
1090
|
+
"omitted_contributor_count",
|
|
1091
|
+
"unattributed_memory_percent",
|
|
1092
|
+
"recommended_action",
|
|
1093
|
+
"summary",
|
|
1094
|
+
"guidance",
|
|
1095
|
+
"hysteresis",
|
|
1096
|
+
"policy_version",
|
|
1097
|
+
],
|
|
1098
|
+
[],
|
|
1099
|
+
"pressure assessment",
|
|
1100
|
+
);
|
|
1075
1101
|
if (
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
!
|
|
1079
|
-
|
|
1102
|
+
value.schema_version !== PRESSURE_ASSESSMENT_SCHEMA_VERSION ||
|
|
1103
|
+
value.observer_only !== true ||
|
|
1104
|
+
!["normal", "elevated", "critical", "unknown"].includes(value.state as string) ||
|
|
1105
|
+
!["guest", "native", "windows-host"].includes(value.scope as string) ||
|
|
1106
|
+
!["memory", "cpu", "io", "storage", "none", "unknown"].includes(
|
|
1107
|
+
value.limiting_resource as string,
|
|
1108
|
+
) ||
|
|
1109
|
+
!["rising", "steady", "falling", "unknown"].includes(value.trend as string) ||
|
|
1110
|
+
!validIso(value.observed_at) ||
|
|
1111
|
+
!(value.sample_age_ms === null || boundedInteger(value.sample_age_ms, 0, 86_400_000)) ||
|
|
1112
|
+
!["complete", "partial", "unavailable"].includes(value.evidence_state as string) ||
|
|
1113
|
+
!["proceed", "limit-heavy-work", "avoid-new-heavy-work", "unknown"].includes(
|
|
1114
|
+
value.recommended_action as string,
|
|
1115
|
+
) ||
|
|
1116
|
+
typeof value.summary !== "string" ||
|
|
1117
|
+
value.summary.length > SUPERVISOR_DIAGNOSTIC_LIMITS.max_summary_chars ||
|
|
1118
|
+
!boundedInteger(value.policy_version, 0, 10_000) ||
|
|
1119
|
+
!boundedInteger(
|
|
1120
|
+
value.omitted_contributor_count,
|
|
1121
|
+
0,
|
|
1122
|
+
SUPERVISOR_DIAGNOSTIC_LIMITS.max_findings,
|
|
1123
|
+
) ||
|
|
1124
|
+
!(
|
|
1125
|
+
value.unattributed_memory_percent === null ||
|
|
1126
|
+
(typeof value.unattributed_memory_percent === "number" &&
|
|
1127
|
+
value.unattributed_memory_percent >= 0 &&
|
|
1128
|
+
value.unattributed_memory_percent <= 100)
|
|
1129
|
+
)
|
|
1080
1130
|
) {
|
|
1081
|
-
throw new Error("
|
|
1131
|
+
throw new Error("invalid pressure assessment contract");
|
|
1132
|
+
}
|
|
1133
|
+
for (const [key, max] of [
|
|
1134
|
+
["evidence", PRESSURE_POLICY.limits.max_evidence],
|
|
1135
|
+
["reasons", PRESSURE_POLICY.limits.max_reasons],
|
|
1136
|
+
["contributors", PRESSURE_POLICY.limits.max_contributors],
|
|
1137
|
+
["guidance", 8],
|
|
1138
|
+
] as const) {
|
|
1139
|
+
const rows = value[key];
|
|
1140
|
+
if (!Array.isArray(rows) || rows.length > max)
|
|
1141
|
+
throw new Error("pressure assessment entries exceed the limit");
|
|
1082
1142
|
}
|
|
1083
|
-
for (const
|
|
1143
|
+
for (const row of value.contributors as Record<string, unknown>[]) {
|
|
1084
1144
|
assertKeys(
|
|
1085
|
-
|
|
1145
|
+
row,
|
|
1086
1146
|
[
|
|
1087
1147
|
"finding_id",
|
|
1088
1148
|
"finding_kind",
|
|
1149
|
+
"finding_class",
|
|
1089
1150
|
"severity",
|
|
1090
1151
|
"summary",
|
|
1091
1152
|
"scope_kind",
|
|
1092
1153
|
"scope_id",
|
|
1093
1154
|
"occurrence_count",
|
|
1155
|
+
"attribution_state",
|
|
1156
|
+
"attribution_confidence",
|
|
1094
1157
|
],
|
|
1095
1158
|
["owner_kind", "owner_id", "workload_relationship"],
|
|
1096
|
-
"
|
|
1159
|
+
"pressure contributor",
|
|
1097
1160
|
);
|
|
1098
1161
|
if (
|
|
1099
|
-
!["
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
!
|
|
1162
|
+
!["contention", "attribution", "diagnostic"].includes(row.finding_class as string) ||
|
|
1163
|
+
!["info", "warning", "critical"].includes(row.severity as string) ||
|
|
1164
|
+
!["attributed", "unattributed", "unknown"].includes(row.attribution_state as string) ||
|
|
1165
|
+
!["exact", "none"].includes(row.attribution_confidence as string) ||
|
|
1166
|
+
typeof row.finding_id !== "string" ||
|
|
1167
|
+
typeof row.summary !== "string" ||
|
|
1168
|
+
!boundedInteger(row.occurrence_count, 0, 50_000)
|
|
1103
1169
|
) {
|
|
1104
|
-
throw new Error("invalid
|
|
1170
|
+
throw new Error("invalid pressure contributor");
|
|
1105
1171
|
}
|
|
1106
1172
|
}
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1173
|
+
validateHysteresis(value.hysteresis);
|
|
1174
|
+
}
|
|
1175
|
+
|
|
1176
|
+
function validateHysteresis(hysteresis: unknown): void {
|
|
1177
|
+
if (!hysteresis || typeof hysteresis !== "object" || Array.isArray(hysteresis))
|
|
1178
|
+
throw new Error("invalid pressure hysteresis state");
|
|
1179
|
+
const value = hysteresis as Record<string, unknown>;
|
|
1180
|
+
assertKeys(
|
|
1181
|
+
value,
|
|
1182
|
+
[
|
|
1183
|
+
"state",
|
|
1184
|
+
"state_since",
|
|
1185
|
+
"consecutive_clear_samples",
|
|
1186
|
+
"dimension_streaks",
|
|
1187
|
+
"oom_baseline_total_kills",
|
|
1188
|
+
"oom_hold_until",
|
|
1189
|
+
"observer_generation",
|
|
1190
|
+
],
|
|
1191
|
+
[],
|
|
1192
|
+
"pressure hysteresis state",
|
|
1193
|
+
);
|
|
1194
|
+
if (
|
|
1195
|
+
!["normal", "elevated", "critical", "unknown"].includes(value.state as string) ||
|
|
1196
|
+
!validIso(value.state_since) ||
|
|
1197
|
+
!boundedInteger(value.consecutive_clear_samples, 0, 100_000) ||
|
|
1198
|
+
!value.dimension_streaks ||
|
|
1199
|
+
typeof value.dimension_streaks !== "object" ||
|
|
1200
|
+
Array.isArray(value.dimension_streaks) ||
|
|
1201
|
+
!(
|
|
1202
|
+
value.oom_baseline_total_kills === null ||
|
|
1203
|
+
boundedInteger(value.oom_baseline_total_kills, 0, Number.MAX_SAFE_INTEGER)
|
|
1204
|
+
) ||
|
|
1205
|
+
!(value.oom_hold_until === null || validIso(value.oom_hold_until)) ||
|
|
1206
|
+
!(value.observer_generation === null || typeof value.observer_generation === "string")
|
|
1207
|
+
) {
|
|
1208
|
+
throw new Error("invalid pressure hysteresis state");
|
|
1123
1209
|
}
|
|
1124
1210
|
}
|
|
1125
1211
|
|
|
@@ -112,7 +112,10 @@ export function compareValidatedDiagnosticBundles(
|
|
|
112
112
|
advice: {
|
|
113
113
|
before: before.expected.advice,
|
|
114
114
|
after: after.expected.advice,
|
|
115
|
-
direction: adviceDirection(
|
|
115
|
+
direction: adviceDirection(
|
|
116
|
+
before.expected.advice.assessment.state,
|
|
117
|
+
after.expected.advice.assessment.state,
|
|
118
|
+
),
|
|
116
119
|
},
|
|
117
120
|
findings: {
|
|
118
121
|
total: rows.length,
|
|
@@ -138,6 +141,7 @@ export function renderDiagnosticBundleComparison(comparison: DiagnosticBundleCom
|
|
|
138
141
|
const lines = [
|
|
139
142
|
`diagnostic comparison: ${comparison.before.artifact_id} -> ${comparison.after.artifact_id}`,
|
|
140
143
|
`comparability: ${comparison.comparability}; pressure: ${comparison.before.pressure} -> ${comparison.after.pressure} (${comparison.advice.direction})`,
|
|
144
|
+
`recommended action: ${comparison.advice.before.assessment.recommended_action} -> ${comparison.advice.after.assessment.recommended_action}; limiting resource: ${comparison.advice.before.assessment.limiting_resource} -> ${comparison.advice.after.assessment.limiting_resource}`,
|
|
141
145
|
`findings: ${comparison.findings.regressions} regression, ${comparison.findings.worsened} worsened, ${comparison.findings.changed} changed, ${comparison.findings.improved} improved, ${comparison.findings.recoveries} recovery, ${comparison.findings.unchanged} unchanged`,
|
|
142
146
|
];
|
|
143
147
|
if (comparison.warnings.length > 0) {
|
|
@@ -170,7 +174,7 @@ function bundleRef(bundle: ValidatedDiagnosticBundle): DiagnosticBundleCompariso
|
|
|
170
174
|
engine_version: bundle.manifest.engine_version,
|
|
171
175
|
threshold_digest: bundle.manifest.threshold_digest,
|
|
172
176
|
finding_count: bundle.expected.findings.length,
|
|
173
|
-
pressure: bundle.expected.advice.
|
|
177
|
+
pressure: bundle.expected.advice.assessment.state,
|
|
174
178
|
};
|
|
175
179
|
}
|
|
176
180
|
|
|
@@ -4,63 +4,60 @@ import type {
|
|
|
4
4
|
SupervisorFindingExplanation,
|
|
5
5
|
SupervisorTimeline,
|
|
6
6
|
} from "../supervisor/contract.ts";
|
|
7
|
+
import type {
|
|
8
|
+
PressureAssessment,
|
|
9
|
+
PressureHysteresisState,
|
|
10
|
+
PressureState,
|
|
11
|
+
} from "./pressure-contract.ts";
|
|
12
|
+
|
|
13
|
+
export type {
|
|
14
|
+
PressureAssessment,
|
|
15
|
+
PressureContributor,
|
|
16
|
+
PressureDimension,
|
|
17
|
+
PressureEvidenceDimension,
|
|
18
|
+
PressureHysteresisState,
|
|
19
|
+
PressureLimitingResource,
|
|
20
|
+
PressureReason,
|
|
21
|
+
PressureReasonCode,
|
|
22
|
+
PressureRecommendedAction,
|
|
23
|
+
PressureScope,
|
|
24
|
+
PressureState,
|
|
25
|
+
PressureTrend,
|
|
26
|
+
PressureUnit,
|
|
27
|
+
PressureWorkloadClass,
|
|
28
|
+
PressureWorkloadGuidance,
|
|
29
|
+
} from "./pressure-contract.ts";
|
|
30
|
+
export {
|
|
31
|
+
PRESSURE_ASSESSMENT_SCHEMA_VERSION,
|
|
32
|
+
PRESSURE_POLICY,
|
|
33
|
+
} from "./pressure-contract.ts";
|
|
7
34
|
|
|
8
35
|
export const DIAGNOSTIC_BUNDLE_SCHEMA_VERSION = 3 as const;
|
|
9
36
|
export const DIAGNOSTIC_COMMAND_SCHEMA_VERSION = 1 as const;
|
|
10
37
|
export const DIAGNOSTIC_INPUT_SCHEMA_VERSION = 2 as const;
|
|
11
38
|
export const DIAGNOSTIC_EXPECTED_SCHEMA_VERSION = 3 as const;
|
|
12
39
|
export const DIAGNOSTIC_SUMMARY_SCHEMA_VERSION = 1 as const;
|
|
13
|
-
export const DIAGNOSTIC_ADVICE_SCHEMA_VERSION =
|
|
40
|
+
export const DIAGNOSTIC_ADVICE_SCHEMA_VERSION = 2 as const;
|
|
14
41
|
export const DIAGNOSTIC_COMPARISON_SCHEMA_VERSION = 1 as const;
|
|
15
42
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
max_reasons: 4,
|
|
19
|
-
} as const;
|
|
20
|
-
|
|
21
|
-
export type DiagnosticPressure = "normal" | "elevated" | "critical" | "unknown";
|
|
22
|
-
export type DiagnosticFanOutRecommendation =
|
|
23
|
-
| "proceed"
|
|
24
|
-
| "use-caution"
|
|
25
|
-
| "avoid-new-fan-out"
|
|
26
|
-
| "unknown";
|
|
27
|
-
|
|
28
|
-
export interface DiagnosticAdviceFinding {
|
|
29
|
-
finding_id: string;
|
|
30
|
-
finding_kind: string;
|
|
31
|
-
severity: "warning" | "critical";
|
|
32
|
-
summary: string;
|
|
33
|
-
scope_kind: string;
|
|
34
|
-
scope_id: string;
|
|
35
|
-
occurrence_count: number;
|
|
36
|
-
owner_kind?: "agent" | "service";
|
|
37
|
-
owner_id?: string;
|
|
38
|
-
workload_relationship?: "active-work" | "unexpected-idle-growth" | "unknown";
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export interface DiagnosticAdviceReason {
|
|
42
|
-
code:
|
|
43
|
-
| "critical_findings_active"
|
|
44
|
-
| "warning_findings_active"
|
|
45
|
-
| "findings_source_unavailable"
|
|
46
|
-
| "no_active_pressure_findings";
|
|
47
|
-
summary: string;
|
|
48
|
-
finding_ids: readonly string[];
|
|
49
|
-
}
|
|
43
|
+
/** Retained name for the pressure state union; `PressureState` is canonical. */
|
|
44
|
+
export type DiagnosticPressure = PressureState;
|
|
50
45
|
|
|
46
|
+
/**
|
|
47
|
+
* Advice v2 is a thin envelope. The assessment carries the state, its evidence,
|
|
48
|
+
* its reasons, and its contributors; `prior_hysteresis` is the carried-forward
|
|
49
|
+
* input that produced this sample's transition, so a frozen bundle replays
|
|
50
|
+
* deterministically. There is no v1 reader.
|
|
51
|
+
*/
|
|
51
52
|
export interface DiagnosticAdvice {
|
|
52
53
|
schema_version: typeof DIAGNOSTIC_ADVICE_SCHEMA_VERSION;
|
|
53
54
|
evaluated_at: string;
|
|
54
|
-
pressure: DiagnosticPressure;
|
|
55
|
-
fan_out_recommendation: DiagnosticFanOutRecommendation;
|
|
56
55
|
observer_only: true;
|
|
57
|
-
|
|
56
|
+
assessment: PressureAssessment;
|
|
57
|
+
prior_hysteresis: PressureHysteresisState | null;
|
|
58
58
|
source_capability: SupervisorCapability;
|
|
59
59
|
active_finding_count: number;
|
|
60
|
-
|
|
61
|
-
omitted_contributing_finding_count: number;
|
|
62
|
-
contributing_findings: readonly DiagnosticAdviceFinding[];
|
|
63
|
-
reasons: readonly DiagnosticAdviceReason[];
|
|
60
|
+
summary: string;
|
|
64
61
|
}
|
|
65
62
|
|
|
66
63
|
export const DIAGNOSTIC_BUNDLE_FILES = [
|