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
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { buildDiagnosticAdvice } from "../diagnostics/advice.ts";
|
|
1
|
+
import { buildDiagnosticAdvice, unknownPressureAssessment } from "../diagnostics/advice.ts";
|
|
2
2
|
import type { DiagnosticAdvice } from "../diagnostics/contract.ts";
|
|
3
|
+
import { type PublishedPressure, readPublishedPressure } from "../resources/status.ts";
|
|
3
4
|
import {
|
|
4
5
|
type EnsureSupervisorResult,
|
|
5
6
|
ensureSupervisorRunning,
|
|
@@ -25,6 +26,8 @@ export interface WorkflowDiagnosticAdmissionRuntime {
|
|
|
25
26
|
ensureSupervisor: (coordRoot: string) => Promise<EnsureSupervisorResult>;
|
|
26
27
|
readStatus: (coordRoot: string, nowMs?: number) => SupervisorStatus;
|
|
27
28
|
readFindings: (coordRoot: string) => SupervisorFindings | undefined;
|
|
29
|
+
/** The observer's published assessment. Admission never computes one itself. */
|
|
30
|
+
readPressure: (coordRoot: string, nowMs?: number) => PublishedPressure;
|
|
28
31
|
}
|
|
29
32
|
|
|
30
33
|
export interface ObserveWorkflowDiagnosticAdmissionInput {
|
|
@@ -77,6 +80,7 @@ export async function observeWorkflowDiagnosticAdmission(
|
|
|
77
80
|
);
|
|
78
81
|
}
|
|
79
82
|
const observedAt = runtime.now().toISOString();
|
|
83
|
+
const published = runtime.readPressure(input.coordRoot, runtime.now().getTime());
|
|
80
84
|
return {
|
|
81
85
|
requested_at: requestedAt,
|
|
82
86
|
observed_at: observedAt,
|
|
@@ -85,8 +89,12 @@ export async function observeWorkflowDiagnosticAdmission(
|
|
|
85
89
|
freshness: "fresh",
|
|
86
90
|
sampled_at: sampledAt,
|
|
87
91
|
advice: buildDiagnosticAdvice({
|
|
88
|
-
|
|
89
|
-
|
|
92
|
+
assessment: published.assessment,
|
|
93
|
+
priorHysteresis: published.prior_hysteresis,
|
|
94
|
+
sourceCapability: published.capability,
|
|
95
|
+
activeFindingCount: mergeFindings(report).filter(
|
|
96
|
+
(finding) => finding.state === "opened",
|
|
97
|
+
).length,
|
|
90
98
|
evaluatedAt: observedAt,
|
|
91
99
|
}),
|
|
92
100
|
};
|
|
@@ -139,14 +147,29 @@ export function failedWorkflowDiagnosticAdmissionObservation(
|
|
|
139
147
|
wait_ms: Math.max(0, observedAt.getTime() - requestedAt.getTime()),
|
|
140
148
|
service_state: "unavailable",
|
|
141
149
|
freshness: "unavailable",
|
|
142
|
-
advice:
|
|
143
|
-
findings: [],
|
|
144
|
-
sourceCapability: capability,
|
|
145
|
-
evaluatedAt: observedAt.toISOString(),
|
|
146
|
-
}),
|
|
150
|
+
advice: unavailableAdvice(capability, observedAt.toISOString()),
|
|
147
151
|
};
|
|
148
152
|
}
|
|
149
153
|
|
|
154
|
+
/**
|
|
155
|
+
* Shadow admission records what the observer published. When it published
|
|
156
|
+
* nothing, the record carries `unknown` with the gap stated, never a state the
|
|
157
|
+
* observer did not measure. Either way no value reaches a dispatch decision.
|
|
158
|
+
*/
|
|
159
|
+
function unavailableAdvice(capability: SupervisorCapability, observedAt: string): DiagnosticAdvice {
|
|
160
|
+
return buildDiagnosticAdvice({
|
|
161
|
+
assessment: unknownPressureAssessment({
|
|
162
|
+
observedAt,
|
|
163
|
+
reasonCode: "evidence_unavailable",
|
|
164
|
+
summary: `Local resource pressure cannot be determined because the assessment source is ${capability.state}${capability.reason_code ? ` (${capability.reason_code})` : ""}.`,
|
|
165
|
+
}),
|
|
166
|
+
priorHysteresis: null,
|
|
167
|
+
sourceCapability: capability,
|
|
168
|
+
activeFindingCount: 0,
|
|
169
|
+
evaluatedAt: observedAt,
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
|
|
150
173
|
function unavailableObservation(
|
|
151
174
|
runtime: WorkflowDiagnosticAdmissionRuntime,
|
|
152
175
|
requestedAt: string,
|
|
@@ -163,11 +186,7 @@ function unavailableObservation(
|
|
|
163
186
|
reason_code: reasonCode,
|
|
164
187
|
...(detail ? { detail: detail.slice(0, 500) } : {}),
|
|
165
188
|
};
|
|
166
|
-
const advice: DiagnosticAdvice =
|
|
167
|
-
findings: [],
|
|
168
|
-
sourceCapability: capability,
|
|
169
|
-
evaluatedAt: observedAt,
|
|
170
|
-
});
|
|
189
|
+
const advice: DiagnosticAdvice = unavailableAdvice(capability, observedAt);
|
|
171
190
|
return {
|
|
172
191
|
requested_at: requestedAt,
|
|
173
192
|
observed_at: observedAt,
|
|
@@ -185,10 +204,6 @@ function mergeFindings(report: SupervisorFindings): SupervisorFinding[] {
|
|
|
185
204
|
return [...byId.values()];
|
|
186
205
|
}
|
|
187
206
|
|
|
188
|
-
function supportedCapability(): SupervisorCapability {
|
|
189
|
-
return { source_kind: "supervisor.findings", state: "supported" };
|
|
190
|
-
}
|
|
191
|
-
|
|
192
207
|
function normalizeWait(value: number | undefined): number {
|
|
193
208
|
if (value === undefined) return DEFAULT_FRESH_CYCLE_WAIT_MS;
|
|
194
209
|
if (!Number.isFinite(value) || value < 0) return DEFAULT_FRESH_CYCLE_WAIT_MS;
|
|
@@ -210,6 +225,7 @@ function admissionRuntime(
|
|
|
210
225
|
ensureSupervisor: ensureSupervisorRunning,
|
|
211
226
|
readStatus: readSupervisorStatus,
|
|
212
227
|
readFindings: readSupervisorFindings,
|
|
228
|
+
readPressure: readPublishedPressure,
|
|
213
229
|
...overrides,
|
|
214
230
|
};
|
|
215
231
|
}
|
|
@@ -652,8 +652,8 @@ async function executeWorkflow(
|
|
|
652
652
|
observation,
|
|
653
653
|
});
|
|
654
654
|
log(
|
|
655
|
-
`[admission] shadow pressure=${observation.advice.
|
|
656
|
-
`
|
|
655
|
+
`[admission] shadow pressure=${observation.advice.assessment.state} ` +
|
|
656
|
+
`action=${observation.advice.assessment.recommended_action}; dispatch unchanged`,
|
|
657
657
|
);
|
|
658
658
|
})();
|
|
659
659
|
await diagnosticAdmissionPromise;
|
|
@@ -8,6 +8,8 @@ import {
|
|
|
8
8
|
} from "../agents/state/heartbeat-writer.ts";
|
|
9
9
|
import { readLiveCoordinationRow } from "../agents/state/live-coordination-view.ts";
|
|
10
10
|
import { ensureLiveCoordinationHeartbeat } from "../agents/state/live-coordination-writer.ts";
|
|
11
|
+
import { assignName } from "../agents/state/names.ts";
|
|
12
|
+
import { coordFreshnessSeconds } from "../config.ts";
|
|
11
13
|
import { ensureEventLedgerV3 } from "../events/v3/bootstrap.ts";
|
|
12
14
|
import {
|
|
13
15
|
recordLiveHookSignalV3,
|
|
@@ -58,6 +60,9 @@ export function startWorkflowChildSessionV3(input: WorkflowChildSessionV3Input):
|
|
|
58
60
|
input.model,
|
|
59
61
|
);
|
|
60
62
|
if (!cache) throw new Error("workflow_child_v3_cache_missing");
|
|
63
|
+
const name = assignName(input.coordRoot, input.instanceId, "workflow-child", {
|
|
64
|
+
freshnessSecs: coordFreshnessSeconds(input.coordRoot),
|
|
65
|
+
});
|
|
61
66
|
if (input.label) {
|
|
62
67
|
recordLiveTaskChangeV3({
|
|
63
68
|
coordRoot: input.coordRoot,
|
|
@@ -67,14 +72,7 @@ export function startWorkflowChildSessionV3(input: WorkflowChildSessionV3Input):
|
|
|
67
72
|
task: input.label,
|
|
68
73
|
});
|
|
69
74
|
}
|
|
70
|
-
if (
|
|
71
|
-
!setIdentityCache(
|
|
72
|
-
input.coordRoot,
|
|
73
|
-
input.instanceId,
|
|
74
|
-
input.label ?? input.agentId,
|
|
75
|
-
input.agentId,
|
|
76
|
-
)
|
|
77
|
-
) {
|
|
75
|
+
if (!setIdentityCache(input.coordRoot, input.instanceId, name, input.agentId)) {
|
|
78
76
|
throw new Error("workflow_child_v3_identity_cache_failed");
|
|
79
77
|
}
|
|
80
78
|
const projected = readLiveCoordinationRow(input.coordRoot, input.instanceId);
|
|
@@ -2,6 +2,7 @@ import { createHash } from "node:crypto";
|
|
|
2
2
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
4
|
import type { RepoSnapshot } from "../context/index.ts";
|
|
5
|
+
import { DIAGNOSTIC_ADVICE_SCHEMA_VERSION } from "../diagnostics/contract.ts";
|
|
5
6
|
import type {
|
|
6
7
|
NormalizedPolicy,
|
|
7
8
|
PolicyDecision,
|
|
@@ -445,7 +446,7 @@ function validDiagnosticAdmissionProof(
|
|
|
445
446
|
["running", "started", "unavailable"].includes(observation.service_state) &&
|
|
446
447
|
["fresh", "unavailable"].includes(observation.freshness) &&
|
|
447
448
|
(observation.sampled_at === undefined || validTimestamp(observation.sampled_at)) &&
|
|
448
|
-
observation.advice?.schema_version ===
|
|
449
|
+
observation.advice?.schema_version === DIAGNOSTIC_ADVICE_SCHEMA_VERSION &&
|
|
449
450
|
observation.advice.observer_only === true
|
|
450
451
|
);
|
|
451
452
|
}
|
|
@@ -506,8 +507,8 @@ export function renderWorkflowProof(proof: WorkflowProof): string {
|
|
|
506
507
|
const observation = proof.diagnostic_admission.observation;
|
|
507
508
|
lines.push(
|
|
508
509
|
observation
|
|
509
|
-
? `admission: shadow ${observation.advice.
|
|
510
|
-
`${observation.advice.
|
|
510
|
+
? `admission: shadow ${observation.advice.assessment.state}; ` +
|
|
511
|
+
`${observation.advice.assessment.recommended_action}; action none`
|
|
511
512
|
: "admission: shadow not needed; no real child dispatch",
|
|
512
513
|
);
|
|
513
514
|
}
|
|
@@ -96,3 +96,26 @@ export function stitchPngRows(pieces: readonly Buffer[]): Buffer {
|
|
|
96
96
|
export function pngDimensions(buffer: Buffer): { width: number; height: number } {
|
|
97
97
|
return { width: buffer.readUInt32BE(16), height: buffer.readUInt32BE(20) };
|
|
98
98
|
}
|
|
99
|
+
|
|
100
|
+
/** Crop already decoded native pixels; callers reuse one decode across all selected rectangles. */
|
|
101
|
+
export function cropNativePng(
|
|
102
|
+
png: PNG,
|
|
103
|
+
rect: { x: number; y: number; width: number; height: number },
|
|
104
|
+
): Buffer {
|
|
105
|
+
if (
|
|
106
|
+
![rect.x, rect.y, rect.width, rect.height].every(Number.isSafeInteger) ||
|
|
107
|
+
rect.x < 0 ||
|
|
108
|
+
rect.y < 0 ||
|
|
109
|
+
rect.width <= 0 ||
|
|
110
|
+
rect.height <= 0 ||
|
|
111
|
+
rect.x + rect.width > png.width ||
|
|
112
|
+
rect.y + rect.height > png.height
|
|
113
|
+
)
|
|
114
|
+
throw new Error("Native capture rectangle lies outside the image.");
|
|
115
|
+
const out = new PNG({ width: rect.width, height: rect.height });
|
|
116
|
+
for (let y = 0; y < rect.height; y++) {
|
|
117
|
+
const start = ((rect.y + y) * png.width + rect.x) * 4;
|
|
118
|
+
png.data.copy(out.data, y * rect.width * 4, start, start + rect.width * 4);
|
|
119
|
+
}
|
|
120
|
+
return PNG.sync.write(out);
|
|
121
|
+
}
|
|
@@ -625,6 +625,31 @@ export class Browser {
|
|
|
625
625
|
return await this.currentPage.screenshot({ type: "png", fullPage: true });
|
|
626
626
|
}
|
|
627
627
|
|
|
628
|
+
/** Wait for font-driven DOM/layout initialization, with a bounded convergence check. */
|
|
629
|
+
async waitForReviewReady(timeoutMs = 15_000): Promise<void> {
|
|
630
|
+
if (!Number.isInteger(timeoutMs) || timeoutMs < 1 || timeoutMs > 60_000)
|
|
631
|
+
throw new RangeError("waitForReviewReady timeoutMs must be an integer from 1 to 60000");
|
|
632
|
+
const settled = await this.currentPage.evaluate(async (timeoutMs) => {
|
|
633
|
+
await document.fonts.ready;
|
|
634
|
+
const deadline = performance.now() + timeoutMs;
|
|
635
|
+
let previous = "";
|
|
636
|
+
let consecutive = 0;
|
|
637
|
+
while (performance.now() < deadline) {
|
|
638
|
+
await new Promise<void>((resolve) => requestAnimationFrame(() => resolve()));
|
|
639
|
+
const geometry = `${document.documentElement.scrollWidth},${document.documentElement.scrollHeight},${document.body?.scrollWidth},${document.body?.scrollHeight}`;
|
|
640
|
+
const current = geometry + document.documentElement.outerHTML;
|
|
641
|
+
consecutive = current === previous ? consecutive + 1 : 0;
|
|
642
|
+
if (consecutive >= 8) return true;
|
|
643
|
+
previous = current;
|
|
644
|
+
}
|
|
645
|
+
return false;
|
|
646
|
+
}, timeoutMs);
|
|
647
|
+
if (!settled)
|
|
648
|
+
throw new Error(
|
|
649
|
+
"Page review source or layout did not settle; rerun when page initialization completes.",
|
|
650
|
+
);
|
|
651
|
+
}
|
|
652
|
+
|
|
628
653
|
/** Base64 PNG of a document-space clip rect. Used to capture one critique tile. */
|
|
629
654
|
async screenshotClipBase64(rect: {
|
|
630
655
|
x: number;
|
|
@@ -670,12 +695,22 @@ export class Browser {
|
|
|
670
695
|
width: number;
|
|
671
696
|
height: number;
|
|
672
697
|
}): Promise<Buffer> {
|
|
698
|
+
const [image] = await this.captureRegionsByScroll([rect]);
|
|
699
|
+
return image;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
/** Capture a document-ordered group with one pinned-element inventory and restore. */
|
|
703
|
+
async captureRegionsByScroll(
|
|
704
|
+
rects: Array<{ x: number; y: number; width: number; height: number }>,
|
|
705
|
+
): Promise<Buffer[]> {
|
|
706
|
+
if (!rects.length) return [];
|
|
673
707
|
const page = this.currentPage;
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
708
|
+
for (const rect of rects)
|
|
709
|
+
if (!(rect.width > 0) || !(rect.height > 0)) {
|
|
710
|
+
throw new Error(
|
|
711
|
+
`captureRegionByScroll: rect must have a positive size (got ${rect.width}×${rect.height})`,
|
|
712
|
+
);
|
|
713
|
+
}
|
|
679
714
|
const settle = (top: number) =>
|
|
680
715
|
page.evaluate(async (target: number) => {
|
|
681
716
|
window.scrollTo({ left: window.scrollX, top: target, behavior: "instant" });
|
|
@@ -695,7 +730,7 @@ export class Browser {
|
|
|
695
730
|
};
|
|
696
731
|
}, top);
|
|
697
732
|
const original = await page.evaluate(() => ({ x: window.scrollX, y: window.scrollY }));
|
|
698
|
-
const
|
|
733
|
+
const captures: Buffer[] = [];
|
|
699
734
|
// Viewport-pinned candidates, measured at scroll 0 so each later capture
|
|
700
735
|
// can tell "still where the full page shows it" from "riding along".
|
|
701
736
|
await settle(0);
|
|
@@ -713,10 +748,19 @@ export class Browser {
|
|
|
713
748
|
priorTransition: string;
|
|
714
749
|
priorTransitionPriority: string;
|
|
715
750
|
}> = [];
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
751
|
+
// Fixed controls can live inside a static shadow host. Walk open roots
|
|
752
|
+
// without hiding their ordinary content or exceeding the total node cap.
|
|
753
|
+
const walkers = [document.createTreeWalker(document.body, NodeFilter.SHOW_ELEMENT)];
|
|
754
|
+
let visited = 0;
|
|
755
|
+
while (walkers.length && visited < 20_000) {
|
|
756
|
+
const el = walkers[walkers.length - 1].nextNode() as HTMLElement | null;
|
|
757
|
+
if (!el) {
|
|
758
|
+
walkers.pop();
|
|
759
|
+
continue;
|
|
760
|
+
}
|
|
761
|
+
visited++;
|
|
762
|
+
if (el.shadowRoot)
|
|
763
|
+
walkers.push(document.createTreeWalker(el.shadowRoot, NodeFilter.SHOW_ELEMENT));
|
|
720
764
|
const position = getComputedStyle(el).position;
|
|
721
765
|
if (position !== "fixed" && position !== "sticky") continue;
|
|
722
766
|
out.push({
|
|
@@ -735,7 +779,11 @@ export class Browser {
|
|
|
735
779
|
async ([entries, action]) => {
|
|
736
780
|
for (const entry of entries) {
|
|
737
781
|
const restore = () => {
|
|
782
|
+
// Restore opacity while transitions are still disabled. Restoring both
|
|
783
|
+
// declarations in one style flush starts a new fade from zero.
|
|
784
|
+
entry.el.style.setProperty("transition", "none", "important");
|
|
738
785
|
entry.el.style.setProperty("opacity", entry.priorOpacity, entry.priorOpacityPriority);
|
|
786
|
+
void getComputedStyle(entry.el).opacity;
|
|
739
787
|
entry.el.style.setProperty(
|
|
740
788
|
"transition",
|
|
741
789
|
entry.priorTransition,
|
|
@@ -760,41 +808,45 @@ export class Browser {
|
|
|
760
808
|
[pinned, mode] as const,
|
|
761
809
|
);
|
|
762
810
|
try {
|
|
763
|
-
const
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
view = await settle(
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
811
|
+
for (const rect of rects) {
|
|
812
|
+
const pieces: Buffer[] = [];
|
|
813
|
+
const bottom = rect.y + rect.height;
|
|
814
|
+
let cursor = rect.y;
|
|
815
|
+
let first = true;
|
|
816
|
+
while (cursor < bottom) {
|
|
817
|
+
const remaining = bottom - cursor;
|
|
818
|
+
// Top-align the piece; a final partial piece is then re-anchored to
|
|
819
|
+
// the viewport bottom once the viewport height is known.
|
|
820
|
+
let view = await settle(cursor);
|
|
821
|
+
if (!first && remaining < view.innerHeight) {
|
|
822
|
+
view = await settle(Math.max(0, bottom - view.innerHeight));
|
|
823
|
+
}
|
|
824
|
+
await syncPinned("hide-moved");
|
|
825
|
+
const offset = cursor - view.scrollY;
|
|
826
|
+
if (offset < 0 || offset >= view.innerHeight) {
|
|
827
|
+
throw new Error(
|
|
828
|
+
`captureRegionByScroll: document y ${cursor} is not reachable in the viewport ` +
|
|
829
|
+
`(scrollY ${view.scrollY}, innerHeight ${view.innerHeight})`,
|
|
830
|
+
);
|
|
831
|
+
}
|
|
832
|
+
const pieceHeight = Math.min(remaining, view.innerHeight - offset);
|
|
833
|
+
const clipX = Math.max(0, rect.x - view.scrollX);
|
|
834
|
+
const clipWidth = Math.min(rect.width, view.innerWidth - clipX);
|
|
835
|
+
if (!(clipWidth > 0)) {
|
|
836
|
+
throw new Error(
|
|
837
|
+
`captureRegionByScroll: document x ${rect.x} is outside the viewport (innerWidth ${view.innerWidth})`,
|
|
838
|
+
);
|
|
839
|
+
}
|
|
840
|
+
pieces.push(
|
|
841
|
+
await page.screenshot({
|
|
842
|
+
type: "png",
|
|
843
|
+
clip: { x: clipX, y: offset, width: clipWidth, height: pieceHeight },
|
|
844
|
+
}),
|
|
788
845
|
);
|
|
846
|
+
cursor += pieceHeight;
|
|
847
|
+
first = false;
|
|
789
848
|
}
|
|
790
|
-
|
|
791
|
-
await page.screenshot({
|
|
792
|
-
type: "png",
|
|
793
|
-
clip: { x: clipX, y: offset, width: clipWidth, height: pieceHeight },
|
|
794
|
-
}),
|
|
795
|
-
);
|
|
796
|
-
cursor += pieceHeight;
|
|
797
|
-
first = false;
|
|
849
|
+
captures.push(stitchPngRows(pieces));
|
|
798
850
|
}
|
|
799
851
|
} finally {
|
|
800
852
|
try {
|
|
@@ -808,7 +860,7 @@ export class Browser {
|
|
|
808
860
|
);
|
|
809
861
|
}
|
|
810
862
|
}
|
|
811
|
-
return
|
|
863
|
+
return captures;
|
|
812
864
|
}
|
|
813
865
|
|
|
814
866
|
/** Document-space rects + labels for each element matching `selector` (semantic tiling). */
|
package/src/lib/browser/index.ts
CHANGED
|
@@ -86,6 +86,20 @@ export {
|
|
|
86
86
|
serializeNetscapeCookies,
|
|
87
87
|
writeNetscapeCookieFile,
|
|
88
88
|
} from "./netscape-cookies.js";
|
|
89
|
+
export type {
|
|
90
|
+
PageReviewBudgetCoverage,
|
|
91
|
+
PageReviewCandidate,
|
|
92
|
+
PageReviewCapturePlan,
|
|
93
|
+
PageReviewContextAllocation,
|
|
94
|
+
PageReviewDecisionSlot,
|
|
95
|
+
PageReviewDurableDecision,
|
|
96
|
+
PageReviewEvidenceContext,
|
|
97
|
+
PageReviewNativeEvidence,
|
|
98
|
+
PageReviewNativeTile,
|
|
99
|
+
PageReviewRect,
|
|
100
|
+
PageReviewTileBudgetAllocation,
|
|
101
|
+
} from "./page-review-contracts.js";
|
|
102
|
+
export { nativePixelDigest } from "./page-review-evidence.js";
|
|
89
103
|
export {
|
|
90
104
|
type JudgedContext,
|
|
91
105
|
type JudgePageReviewPackOptions,
|
|
@@ -112,8 +126,8 @@ export {
|
|
|
112
126
|
packPaths,
|
|
113
127
|
readPackContext,
|
|
114
128
|
readPackDom,
|
|
115
|
-
readPackFullPage,
|
|
116
129
|
readPackManifest,
|
|
130
|
+
readPackOverview,
|
|
117
131
|
readPackSignature,
|
|
118
132
|
readPackTiles,
|
|
119
133
|
renderReviewMarkdown,
|