harnery 0.33.0 → 0.34.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.map +1 -1
- package/dist/commander.js +4 -0
- package/dist/commands/adapter.js +2 -2
- package/dist/commands/agents.d.ts +144 -1
- package/dist/commands/agents.d.ts.map +1 -1
- package/dist/commands/agents.js +1220 -588
- package/dist/commands/artifacts.d.ts.map +1 -1
- package/dist/commands/artifacts.js +7 -6
- package/dist/commands/backup.d.ts +1 -1
- package/dist/commands/backup.d.ts.map +1 -1
- package/dist/commands/backup.js +29 -16
- package/dist/commands/browse.d.ts.map +1 -1
- package/dist/commands/browse.js +234 -12
- package/dist/commands/checkpoint.d.ts.map +1 -1
- package/dist/commands/checkpoint.js +3 -2
- package/dist/commands/claude-desktop.d.ts +1 -1
- package/dist/commands/claude-desktop.d.ts.map +1 -1
- package/dist/commands/claude-desktop.js +3 -74
- package/dist/commands/context.js +1 -6
- package/dist/commands/decision.d.ts.map +1 -1
- package/dist/commands/decision.js +22 -38
- package/dist/commands/docs.d.ts.map +1 -1
- package/dist/commands/docs.js +91 -28
- package/dist/commands/doctor.js +10 -1
- package/dist/commands/events.d.ts +5 -0
- package/dist/commands/events.d.ts.map +1 -0
- package/dist/commands/events.js +189 -0
- package/dist/commands/governor.d.ts.map +1 -1
- package/dist/commands/governor.js +13 -4
- package/dist/commands/init.d.ts +9 -2
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +223 -51
- package/dist/commands/journal.d.ts.map +1 -1
- package/dist/commands/journal.js +4 -13
- package/dist/commands/ledger-v3.d.ts +5 -0
- package/dist/commands/ledger-v3.d.ts.map +1 -0
- package/dist/commands/ledger-v3.js +91 -0
- package/dist/commands/presence.d.ts.map +1 -1
- package/dist/commands/presence.js +11 -5
- package/dist/commands/sync.d.ts +1 -1
- package/dist/commands/sync.js +1 -1
- package/dist/commands/web.d.ts +6 -0
- package/dist/commands/web.d.ts.map +1 -1
- package/dist/commands/web.js +67 -7
- package/dist/commands/work.d.ts.map +1 -1
- package/dist/commands/work.js +22 -5
- package/dist/core/adapter.d.ts +5 -0
- package/dist/core/adapter.d.ts.map +1 -0
- package/dist/core/adapter.js +1 -0
- package/dist/core/adapters/attest.d.ts +5 -2
- package/dist/core/adapters/attest.d.ts.map +1 -1
- package/dist/core/adapters/attest.js +8 -3
- package/dist/core/adapters/profiles.d.ts +6 -6
- package/dist/core/adapters/profiles.d.ts.map +1 -1
- package/dist/core/adapters/profiles.js +4 -4
- package/dist/core/agents/canonical-emit.d.ts +17 -15
- package/dist/core/agents/canonical-emit.d.ts.map +1 -1
- package/dist/core/agents/canonical-emit.js +22 -22
- package/dist/core/agents/cli.js +207 -234
- package/dist/core/agents/codex-archive-v3.d.ts +14 -0
- package/dist/core/agents/codex-archive-v3.d.ts.map +1 -0
- package/dist/core/agents/codex-archive-v3.js +110 -0
- package/dist/core/agents/coord-client.d.ts +19 -81
- package/dist/core/agents/coord-client.d.ts.map +1 -1
- package/dist/core/agents/coord-client.js +65 -155
- package/dist/core/agents/finalization.d.ts +4 -1
- package/dist/core/agents/finalization.d.ts.map +1 -1
- package/dist/core/agents/finalization.js +89 -32
- package/dist/core/agents/index.d.ts +4 -5
- package/dist/core/agents/index.d.ts.map +1 -1
- package/dist/core/agents/index.js +4 -5
- package/dist/core/agents/live-authority-v3.d.ts +59 -0
- package/dist/core/agents/live-authority-v3.d.ts.map +1 -0
- package/dist/core/agents/live-authority-v3.js +233 -0
- package/dist/core/agents/live-lifecycle-v3.d.ts +20 -0
- package/dist/core/agents/live-lifecycle-v3.d.ts.map +1 -0
- package/dist/core/agents/live-lifecycle-v3.js +91 -0
- package/dist/core/agents/live-observation-v3.d.ts +25 -0
- package/dist/core/agents/live-observation-v3.d.ts.map +1 -0
- package/dist/core/agents/live-observation-v3.js +157 -0
- package/dist/core/agents/render/prompt-context.d.ts +4 -4
- package/dist/core/agents/render/prompt-context.d.ts.map +1 -1
- package/dist/core/agents/render/prompt-context.js +23 -58
- package/dist/core/agents/render/session-context.d.ts +1 -1
- package/dist/core/agents/render/session-context.d.ts.map +1 -1
- package/dist/core/agents/render/session-context.js +8 -32
- package/dist/core/agents/rules/claim-conflict.d.ts +3 -3
- package/dist/core/agents/rules/claim-conflict.d.ts.map +1 -1
- package/dist/core/agents/rules/claim-conflict.js +79 -127
- package/dist/core/agents/rules/commit-conflict.d.ts.map +1 -1
- package/dist/core/agents/rules/commit-conflict.js +3 -18
- package/dist/core/agents/rules/stop-hook.d.ts +9 -50
- package/dist/core/agents/rules/stop-hook.d.ts.map +1 -1
- package/dist/core/agents/rules/stop-hook.js +193 -236
- package/dist/core/agents/session-events.d.ts +5 -7
- package/dist/core/agents/session-events.d.ts.map +1 -1
- package/dist/core/agents/session-events.js +127 -95
- package/dist/core/agents/session-finalization-state-v3.d.ts +30 -0
- package/dist/core/agents/session-finalization-state-v3.d.ts.map +1 -0
- package/dist/core/agents/session-finalization-state-v3.js +40 -0
- package/dist/core/agents/session-finalizer-v3.d.ts +107 -0
- package/dist/core/agents/session-finalizer-v3.d.ts.map +1 -0
- package/dist/core/agents/session-finalizer-v3.js +734 -0
- package/dist/core/agents/session-name-display.d.ts +40 -0
- package/dist/core/agents/session-name-display.d.ts.map +1 -0
- package/dist/core/agents/session-name-display.js +119 -0
- package/dist/core/agents/state/activity-log.d.ts +3 -3
- package/dist/core/agents/state/activity-log.d.ts.map +1 -1
- package/dist/core/agents/state/activity-log.js +7 -16
- package/dist/core/agents/state/heartbeat-writer.d.ts +23 -55
- package/dist/core/agents/state/heartbeat-writer.d.ts.map +1 -1
- package/dist/core/agents/state/heartbeat-writer.js +56 -228
- package/dist/core/agents/state/live-coordination-view.d.ts +31 -0
- package/dist/core/agents/state/live-coordination-view.d.ts.map +1 -0
- package/dist/core/agents/state/live-coordination-view.js +209 -0
- package/dist/core/agents/state/session-state.d.ts +4 -3
- package/dist/core/agents/state/session-state.d.ts.map +1 -1
- package/dist/core/agents/state/session-state.js +18 -9
- package/dist/core/agents/state/stale-sweep.d.ts +1 -1
- package/dist/core/agents/state/stale-sweep.d.ts.map +1 -1
- package/dist/core/agents/state/stale-sweep.js +26 -15
- package/dist/core/artifacts/index.d.ts.map +1 -1
- package/dist/core/artifacts/index.js +5 -7
- package/dist/core/config.d.ts +33 -2
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +98 -2
- package/dist/core/context/index.d.ts +1 -4
- package/dist/core/context/index.d.ts.map +1 -1
- package/dist/core/context/index.js +9 -9
- package/dist/core/events/span-parent.d.ts +15 -0
- package/dist/core/events/span-parent.d.ts.map +1 -0
- package/dist/core/events/span-parent.js +34 -0
- package/dist/core/events/v3/advance.d.ts +14 -0
- package/dist/core/events/v3/advance.d.ts.map +1 -0
- package/dist/core/events/v3/advance.js +134 -0
- package/dist/core/events/v3/authority-outbox.d.ts +78 -0
- package/dist/core/events/v3/authority-outbox.d.ts.map +1 -0
- package/dist/core/events/v3/authority-outbox.js +399 -0
- package/dist/core/events/v3/base-builder.d.ts +20 -0
- package/dist/core/events/v3/base-builder.d.ts.map +1 -0
- package/dist/core/events/v3/base-builder.js +29 -0
- package/dist/core/events/v3/base-contract.d.ts +7576 -0
- package/dist/core/events/v3/base-contract.d.ts.map +1 -0
- package/dist/core/events/v3/base-contract.js +647 -0
- package/dist/core/events/v3/bootstrap.d.ts +34 -0
- package/dist/core/events/v3/bootstrap.d.ts.map +1 -0
- package/dist/core/events/v3/bootstrap.js +175 -0
- package/dist/core/events/v3/builder.d.ts +20 -0
- package/dist/core/events/v3/builder.d.ts.map +1 -0
- package/dist/core/events/v3/builder.js +28 -0
- package/dist/core/events/v3/canonical.d.ts +31 -0
- package/dist/core/events/v3/canonical.d.ts.map +1 -0
- package/dist/core/events/v3/canonical.js +100 -0
- package/dist/core/events/v3/capabilities.d.ts +31 -0
- package/dist/core/events/v3/capabilities.d.ts.map +1 -0
- package/dist/core/events/v3/capabilities.js +107 -0
- package/dist/core/events/v3/capability-drift.d.ts +22 -0
- package/dist/core/events/v3/capability-drift.d.ts.map +1 -0
- package/dist/core/events/v3/capability-drift.js +134 -0
- package/dist/core/events/v3/catalog.d.ts +38 -0
- package/dist/core/events/v3/catalog.d.ts.map +1 -0
- package/dist/core/events/v3/catalog.js +135 -0
- package/dist/core/events/v3/clock-order.d.ts +34 -0
- package/dist/core/events/v3/clock-order.d.ts.map +1 -0
- package/dist/core/events/v3/clock-order.js +35 -0
- package/dist/core/events/v3/contract.d.ts +171 -0
- package/dist/core/events/v3/contract.d.ts.map +1 -0
- package/dist/core/events/v3/contract.js +180 -0
- package/dist/core/events/v3/control.d.ts +111 -0
- package/dist/core/events/v3/control.d.ts.map +1 -0
- package/dist/core/events/v3/control.js +419 -0
- package/dist/core/events/v3/coordination-view.d.ts +69 -0
- package/dist/core/events/v3/coordination-view.d.ts.map +1 -0
- package/dist/core/events/v3/coordination-view.js +119 -0
- package/dist/core/events/v3/economics.d.ts +77 -0
- package/dist/core/events/v3/economics.d.ts.map +1 -0
- package/dist/core/events/v3/economics.js +274 -0
- package/dist/core/events/v3/finalization-view.d.ts +26 -0
- package/dist/core/events/v3/finalization-view.d.ts.map +1 -0
- package/dist/core/events/v3/finalization-view.js +37 -0
- package/dist/core/events/v3/fingerprint-keys.d.ts +25 -0
- package/dist/core/events/v3/fingerprint-keys.d.ts.map +1 -0
- package/dist/core/events/v3/fingerprint-keys.js +217 -0
- package/dist/core/events/v3/generated.d.ts +4 -0
- package/dist/core/events/v3/generated.d.ts.map +1 -0
- package/dist/core/events/v3/generated.js +47 -0
- package/dist/core/events/v3/ids.d.ts +9 -0
- package/dist/core/events/v3/ids.d.ts.map +1 -0
- package/dist/core/events/v3/ids.js +25 -0
- package/dist/core/events/v3/index.d.ts +35 -0
- package/dist/core/events/v3/index.d.ts.map +1 -0
- package/dist/core/events/v3/index.js +33 -0
- package/dist/core/events/v3/latency.d.ts +63 -0
- package/dist/core/events/v3/latency.d.ts.map +1 -0
- package/dist/core/events/v3/latency.js +412 -0
- package/dist/core/events/v3/live-feed.d.ts +45 -0
- package/dist/core/events/v3/live-feed.d.ts.map +1 -0
- package/dist/core/events/v3/live-feed.js +246 -0
- package/dist/core/events/v3/live-observation.d.ts +35 -0
- package/dist/core/events/v3/live-observation.d.ts.map +1 -0
- package/dist/core/events/v3/live-observation.js +1 -0
- package/dist/core/events/v3/live-routing.d.ts +57 -0
- package/dist/core/events/v3/live-routing.d.ts.map +1 -0
- package/dist/core/events/v3/live-routing.js +107 -0
- package/dist/core/events/v3/producers/command-recorder.d.ts +67 -0
- package/dist/core/events/v3/producers/command-recorder.d.ts.map +1 -0
- package/dist/core/events/v3/producers/command-recorder.js +477 -0
- package/dist/core/events/v3/producers/command.d.ts +50 -0
- package/dist/core/events/v3/producers/command.d.ts.map +1 -0
- package/dist/core/events/v3/producers/command.js +135 -0
- package/dist/core/events/v3/producers/coordination-recorder.d.ts +53 -0
- package/dist/core/events/v3/producers/coordination-recorder.d.ts.map +1 -0
- package/dist/core/events/v3/producers/coordination-recorder.js +376 -0
- package/dist/core/events/v3/producers/coordination.d.ts +90 -0
- package/dist/core/events/v3/producers/coordination.d.ts.map +1 -0
- package/dist/core/events/v3/producers/coordination.js +229 -0
- package/dist/core/events/v3/producers/hook-base.d.ts +54 -0
- package/dist/core/events/v3/producers/hook-base.d.ts.map +1 -0
- package/dist/core/events/v3/producers/hook-base.js +424 -0
- package/dist/core/events/v3/producers/hook.d.ts +29 -0
- package/dist/core/events/v3/producers/hook.d.ts.map +1 -0
- package/dist/core/events/v3/producers/hook.js +71 -0
- package/dist/core/events/v3/producers/intake.d.ts +65 -0
- package/dist/core/events/v3/producers/intake.d.ts.map +1 -0
- package/dist/core/events/v3/producers/intake.js +244 -0
- package/dist/core/events/v3/producers/recorder.d.ts +240 -0
- package/dist/core/events/v3/producers/recorder.d.ts.map +1 -0
- package/dist/core/events/v3/producers/recorder.js +2176 -0
- package/dist/core/events/v3/projection.d.ts +101 -0
- package/dist/core/events/v3/projection.d.ts.map +1 -0
- package/dist/core/events/v3/projection.js +479 -0
- package/dist/core/events/v3/reader.d.ts +75 -0
- package/dist/core/events/v3/reader.d.ts.map +1 -0
- package/dist/core/events/v3/reader.js +778 -0
- package/dist/core/events/v3/recovery-record.d.ts +47 -0
- package/dist/core/events/v3/recovery-record.d.ts.map +1 -0
- package/dist/core/events/v3/recovery-record.js +167 -0
- package/dist/core/events/v3/recovery.d.ts +22 -0
- package/dist/core/events/v3/recovery.d.ts.map +1 -0
- package/dist/core/events/v3/recovery.js +227 -0
- package/dist/core/events/v3/span-state.d.ts +52 -0
- package/dist/core/events/v3/span-state.d.ts.map +1 -0
- package/dist/core/events/v3/span-state.js +142 -0
- package/dist/core/events/v3/targets.d.ts +23 -0
- package/dist/core/events/v3/targets.d.ts.map +1 -0
- package/dist/core/events/v3/targets.js +134 -0
- package/dist/core/events/v3/turn-telemetry.d.ts +41 -0
- package/dist/core/events/v3/turn-telemetry.d.ts.map +1 -0
- package/dist/core/events/v3/turn-telemetry.js +168 -0
- package/dist/core/events/v3/validate.d.ts +9 -0
- package/dist/core/events/v3/validate.d.ts.map +1 -0
- package/dist/core/events/v3/validate.js +281 -0
- package/dist/core/events/v3/writer.d.ts +56 -0
- package/dist/core/events/v3/writer.d.ts.map +1 -0
- package/dist/core/events/v3/writer.js +335 -0
- package/dist/core/governor/index.d.ts +1 -1
- package/dist/core/governor/index.d.ts.map +1 -1
- package/dist/core/governor/index.js +1 -1
- package/dist/core/governor/plan-api.d.ts +2 -1
- package/dist/core/governor/plan-api.d.ts.map +1 -1
- package/dist/core/governor/plan-api.js +6 -3
- package/dist/core/governor/read.d.ts +1 -1
- package/dist/core/governor/read.d.ts.map +1 -1
- package/dist/core/governor/read.js +1 -1
- package/dist/core/governor/state.d.ts +9 -0
- package/dist/core/governor/state.d.ts.map +1 -1
- package/dist/core/governor/state.js +40 -3
- package/dist/core/guard/config.d.ts +5 -0
- package/dist/core/guard/config.d.ts.map +1 -0
- package/dist/core/guard/config.js +157 -0
- package/dist/core/guard/coordinator.d.ts +14 -0
- package/dist/core/guard/coordinator.d.ts.map +1 -0
- package/dist/core/guard/coordinator.js +173 -0
- package/dist/core/guard/evaluator.d.ts +4 -0
- package/dist/core/guard/evaluator.d.ts.map +1 -0
- package/dist/core/guard/evaluator.js +242 -0
- package/dist/core/guard/evidence-v3.d.ts +15 -0
- package/dist/core/guard/evidence-v3.d.ts.map +1 -0
- package/dist/core/guard/evidence-v3.js +171 -0
- package/dist/core/guard/index.d.ts +10 -0
- package/dist/core/guard/index.d.ts.map +1 -0
- package/dist/core/guard/index.js +6 -0
- package/dist/core/guard/live-source-v3.d.ts +40 -0
- package/dist/core/guard/live-source-v3.d.ts.map +1 -0
- package/dist/core/guard/live-source-v3.js +128 -0
- package/dist/core/guard/storage.d.ts +27 -0
- package/dist/core/guard/storage.d.ts.map +1 -0
- package/dist/core/guard/storage.js +140 -0
- package/dist/core/guard/types.d.ts +119 -0
- package/dist/core/guard/types.d.ts.map +1 -0
- package/dist/core/guard/types.js +1 -0
- package/dist/core/hooks/adapter/detect.d.ts +18 -1
- package/dist/core/hooks/adapter/detect.d.ts.map +1 -1
- package/dist/core/hooks/adapter/detect.js +29 -0
- package/dist/core/hooks/adapter/events.d.ts +7 -4
- package/dist/core/hooks/adapter/events.d.ts.map +1 -1
- package/dist/core/hooks/adapter/events.js +12 -4
- package/dist/core/hooks/adapter/output.d.ts +2 -2
- package/dist/core/hooks/adapter/output.d.ts.map +1 -1
- package/dist/core/hooks/adapter/parse.d.ts +7 -4
- package/dist/core/hooks/adapter/parse.d.ts.map +1 -1
- package/dist/core/hooks/adapter/parse.js +63 -25
- package/dist/core/hooks/adapter/wiring.d.ts +30 -4
- package/dist/core/hooks/adapter/wiring.d.ts.map +1 -1
- package/dist/core/hooks/adapter/wiring.js +89 -11
- package/dist/core/hooks/cli.d.ts +1 -1
- package/dist/core/hooks/cli.js +305 -444
- package/dist/core/hooks/effects/image-capture.d.ts +20 -34
- package/dist/core/hooks/effects/image-capture.d.ts.map +1 -1
- package/dist/core/hooks/effects/image-capture.js +212 -221
- package/dist/core/hooks/effects/index.d.ts +1 -9
- package/dist/core/hooks/effects/index.d.ts.map +1 -1
- package/dist/core/hooks/effects/index.js +1 -24
- package/dist/core/hooks/events/input-hash.d.ts +7 -0
- package/dist/core/hooks/events/input-hash.d.ts.map +1 -0
- package/dist/core/hooks/events/input-hash.js +43 -0
- package/dist/core/hooks/index.d.ts +4 -3
- package/dist/core/hooks/index.d.ts.map +1 -1
- package/dist/core/hooks/index.js +2 -3
- package/dist/core/hooks/resolve/coord-root.d.ts +1 -1
- package/dist/core/hooks/resolve/coord-root.js +1 -1
- package/dist/core/hooks/resolve/owner.d.ts +16 -15
- package/dist/core/hooks/resolve/owner.d.ts.map +1 -1
- package/dist/core/hooks/resolve/owner.js +51 -42
- package/dist/core/hooks/resolve/transcript.d.ts +33 -3
- package/dist/core/hooks/resolve/transcript.d.ts.map +1 -1
- package/dist/core/hooks/resolve/transcript.js +155 -14
- package/dist/core/hooks/session-name-presence.d.ts +9 -10
- package/dist/core/hooks/session-name-presence.d.ts.map +1 -1
- package/dist/core/hooks/session-name-presence.js +15 -15
- package/dist/core/hooks/unsafe-cross-shell.d.ts +1 -1
- package/dist/core/hooks/unsafe-cross-shell.d.ts.map +1 -1
- package/dist/core/journal/index.d.ts +2 -2
- package/dist/core/journal/index.d.ts.map +1 -1
- package/dist/core/journal/index.js +9 -22
- package/dist/core/presence/blob.d.ts +4 -3
- package/dist/core/presence/blob.d.ts.map +1 -1
- package/dist/core/presence/blob.js +45 -44
- package/dist/core/presence/codec-digest.d.ts +29 -0
- package/dist/core/presence/codec-digest.d.ts.map +1 -0
- package/dist/core/presence/codec-digest.js +170 -0
- package/dist/core/presence/relay-client.d.ts +1 -1
- package/dist/core/presence/relay-client.d.ts.map +1 -1
- package/dist/core/presence/relay-client.js +5 -5
- package/dist/core/work/index.d.ts +1 -1
- package/dist/core/work/index.d.ts.map +1 -1
- package/dist/core/work/index.js +1 -1
- package/dist/core/work/read.d.ts +1 -1
- package/dist/core/work/read.d.ts.map +1 -1
- package/dist/core/work/read.js +1 -1
- package/dist/core/work/runner.d.ts.map +1 -1
- package/dist/core/work/runner.js +6 -0
- package/dist/core/work/state.d.ts +9 -0
- package/dist/core/work/state.d.ts.map +1 -1
- package/dist/core/work/state.js +17 -3
- package/dist/core/workflow/engine.js +24 -25
- package/dist/core/workflow/live-session-v3.d.ts +19 -0
- package/dist/core/workflow/live-session-v3.d.ts.map +1 -0
- package/dist/core/workflow/live-session-v3.js +86 -0
- package/dist/core/workflow/scope-id.d.ts +3 -0
- package/dist/core/workflow/scope-id.d.ts.map +1 -0
- package/dist/core/workflow/scope-id.js +5 -0
- package/dist/core/workflow/workspaces/leases.d.ts +4 -0
- package/dist/core/workflow/workspaces/leases.d.ts.map +1 -1
- package/dist/core/workflow/workspaces/leases.js +53 -19
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/browser/client.d.ts +41 -0
- package/dist/lib/browser/client.d.ts.map +1 -1
- package/dist/lib/browser/client.js +203 -0
- package/dist/lib/browser/critique.d.ts +28 -2
- package/dist/lib/browser/critique.d.ts.map +1 -1
- package/dist/lib/browser/critique.js +74 -18
- package/dist/lib/browser/geometry.d.ts +1 -1
- package/dist/lib/browser/geometry.d.ts.map +1 -1
- package/dist/lib/browser/geometry.js +130 -6
- package/dist/lib/browser/index.d.ts +3 -0
- package/dist/lib/browser/index.d.ts.map +1 -1
- package/dist/lib/browser/index.js +3 -0
- package/dist/lib/browser/qa-plan.d.ts +174 -0
- package/dist/lib/browser/qa-plan.d.ts.map +1 -0
- package/dist/lib/browser/qa-plan.js +321 -0
- package/dist/lib/browser/qa-reuse.d.ts +99 -0
- package/dist/lib/browser/qa-reuse.d.ts.map +1 -0
- package/dist/lib/browser/qa-reuse.js +222 -0
- package/dist/lib/browser/qa-snapshot.d.ts +64 -0
- package/dist/lib/browser/qa-snapshot.d.ts.map +1 -0
- package/dist/lib/browser/qa-snapshot.js +171 -0
- package/dist/lib/browser/runts.d.ts.map +1 -1
- package/dist/lib/browser/runts.js +22 -1
- package/dist/lib/browser/tiling.d.ts +71 -0
- package/dist/lib/browser/tiling.d.ts.map +1 -0
- package/dist/lib/browser/tiling.js +118 -0
- package/dist/lib/claude-desktop.d.ts +0 -47
- package/dist/lib/claude-desktop.d.ts.map +1 -1
- package/dist/lib/claude-desktop.js +1 -169
- package/dist/lib/context/index.d.ts +0 -3
- package/dist/lib/context/index.d.ts.map +1 -1
- package/dist/lib/context/index.js +20 -42
- package/dist/lib/council/index.d.ts +2 -2
- package/dist/lib/council/index.d.ts.map +1 -1
- package/dist/lib/council/index.js +9 -20
- package/dist/lib/docs-frontmatter.d.ts +1 -6
- package/dist/lib/docs-frontmatter.d.ts.map +1 -1
- package/dist/lib/docs-frontmatter.js +12 -78
- package/dist/lib/docs-index.d.ts +9 -0
- package/dist/lib/docs-index.d.ts.map +1 -1
- package/dist/lib/docs-index.js +32 -3
- package/dist/lib/docs-lint.d.ts.map +1 -1
- package/dist/lib/docs-lint.js +14 -30
- package/dist/lib/docs-metadata-audit.d.ts +19 -0
- package/dist/lib/docs-metadata-audit.d.ts.map +1 -0
- package/dist/lib/docs-metadata-audit.js +132 -0
- package/dist/lib/docs-metadata-managed.d.ts +23 -0
- package/dist/lib/docs-metadata-managed.d.ts.map +1 -0
- package/dist/lib/docs-metadata-managed.js +78 -0
- package/dist/lib/docs-metadata-sync.d.ts +20 -0
- package/dist/lib/docs-metadata-sync.d.ts.map +1 -0
- package/dist/lib/docs-metadata-sync.js +222 -0
- package/dist/lib/docs-metadata-v2-schema.d.ts +273 -0
- package/dist/lib/docs-metadata-v2-schema.d.ts.map +1 -0
- package/dist/lib/docs-metadata-v2-schema.js +134 -0
- package/dist/lib/docs-metadata-v2.d.ts +21 -0
- package/dist/lib/docs-metadata-v2.d.ts.map +1 -0
- package/dist/lib/docs-metadata-v2.js +424 -0
- package/dist/lib/docs-new.d.ts +11 -0
- package/dist/lib/docs-new.d.ts.map +1 -0
- package/dist/lib/docs-new.js +52 -0
- package/dist/lib/docs-sweep.d.ts.map +1 -1
- package/dist/lib/docs-sweep.js +45 -29
- package/dist/lib/headless/index.d.ts +98 -0
- package/dist/lib/headless/index.d.ts.map +1 -0
- package/dist/lib/headless/index.js +211 -0
- package/dist/lib/identities/assume.d.ts +4 -4
- package/dist/lib/identities/assume.d.ts.map +1 -1
- package/dist/lib/identities/assume.js +52 -68
- package/dist/lib/instructions/apply.d.ts +5 -4
- package/dist/lib/instructions/apply.d.ts.map +1 -1
- package/dist/lib/instructions/apply.js +32 -20
- package/dist/lib/instructions/bundle.d.ts +1 -1
- package/dist/lib/instructions/bundle.d.ts.map +1 -1
- package/dist/lib/instructions/bundle.js +1 -1
- package/dist/lib/instructions/splice.d.ts +0 -1
- package/dist/lib/instructions/splice.d.ts.map +1 -1
- package/dist/lib/instructions/splice.js +22 -6
- package/dist/lib/instructions/templates.d.ts +7 -5
- package/dist/lib/instructions/templates.d.ts.map +1 -1
- package/dist/lib/instructions/templates.js +79 -9
- package/package.json +26 -5
- package/schemas/config.schema.json +120 -2
- package/schemas/docs-metadata-v2.schema.json +441 -0
- package/schemas/event-v3.schema.json +24472 -0
- package/src/commander.ts +4 -0
- package/src/commands/adapter.ts +2 -2
- package/src/commands/agents.ts +1512 -592
- package/src/commands/artifacts.ts +7 -6
- package/src/commands/backup.ts +29 -21
- package/src/commands/browse.ts +349 -8
- package/src/commands/checkpoint.ts +4 -3
- package/src/commands/claude-desktop.ts +2 -101
- package/src/commands/context.ts +1 -6
- package/src/commands/decision.ts +27 -44
- package/src/commands/docs.ts +100 -33
- package/src/commands/doctor.ts +14 -1
- package/src/commands/events.ts +256 -0
- package/src/commands/governor.ts +18 -4
- package/src/commands/init.ts +253 -57
- package/src/commands/instructions.ts +1 -1
- package/src/commands/journal.ts +4 -13
- package/src/commands/ledger-v3.ts +111 -0
- package/src/commands/presence.ts +11 -10
- package/src/commands/sync.ts +1 -1
- package/src/commands/web.ts +67 -8
- package/src/commands/work.ts +28 -5
- package/src/core/adapter.ts +5 -0
- package/src/core/adapters/attest.ts +8 -3
- package/src/core/adapters/profiles.ts +4 -6
- package/src/core/agents/canonical-emit.ts +34 -25
- package/src/core/agents/cli.ts +236 -262
- package/src/core/agents/codex-archive-v3.ts +138 -0
- package/src/core/agents/coord-client.ts +75 -188
- package/src/core/agents/finalization.ts +120 -38
- package/src/core/agents/index.ts +4 -5
- package/src/core/agents/live-authority-v3.ts +375 -0
- package/src/core/agents/live-lifecycle-v3.ts +140 -0
- package/src/core/agents/live-observation-v3.ts +216 -0
- package/src/core/agents/render/prompt-context.ts +29 -60
- package/src/core/agents/render/session-context.ts +10 -31
- package/src/core/agents/rules/claim-conflict.ts +85 -126
- package/src/core/agents/rules/commit-conflict.ts +3 -14
- package/src/core/agents/rules/stop-hook.ts +239 -293
- package/src/core/agents/session-events.ts +137 -104
- package/src/core/agents/session-finalization-state-v3.ts +90 -0
- package/src/core/agents/session-finalizer-v3.ts +953 -0
- package/src/core/agents/session-name-display.ts +149 -0
- package/src/core/agents/state/activity-log.ts +6 -14
- package/src/core/agents/state/heartbeat-writer.ts +82 -277
- package/src/core/agents/state/live-coordination-view.ts +290 -0
- package/src/core/agents/state/session-state.ts +24 -12
- package/src/core/agents/state/stale-sweep.ts +40 -17
- package/src/core/artifacts/index.ts +4 -5
- package/src/core/config.ts +148 -3
- package/src/core/context/index.ts +9 -17
- package/src/core/events/span-parent.ts +46 -0
- package/src/core/events/v3/advance.ts +168 -0
- package/src/core/events/v3/authority-outbox.ts +548 -0
- package/src/core/events/v3/base-builder.ts +60 -0
- package/src/core/events/v3/base-contract.ts +882 -0
- package/src/core/events/v3/bootstrap.ts +226 -0
- package/src/core/events/v3/builder.ts +59 -0
- package/src/core/events/v3/canonical.ts +153 -0
- package/src/core/events/v3/capabilities.ts +171 -0
- package/src/core/events/v3/capability-drift.ts +177 -0
- package/src/core/events/v3/catalog.ts +202 -0
- package/src/core/events/v3/clock-order.ts +41 -0
- package/src/core/events/v3/contract.ts +365 -0
- package/src/core/events/v3/control.ts +576 -0
- package/src/core/events/v3/coordination-view.ts +193 -0
- package/src/core/events/v3/economics.ts +384 -0
- package/src/core/events/v3/finalization-view.ts +67 -0
- package/src/core/events/v3/fingerprint-keys.ts +260 -0
- package/src/core/events/v3/generated.ts +48 -0
- package/src/core/events/v3/ids.ts +33 -0
- package/src/core/events/v3/index.ts +322 -0
- package/src/core/events/v3/latency.ts +551 -0
- package/src/core/events/v3/live-feed.ts +319 -0
- package/src/core/events/v3/live-observation.ts +39 -0
- package/src/core/events/v3/live-routing.ts +135 -0
- package/src/core/events/v3/producers/command-recorder.ts +631 -0
- package/src/core/events/v3/producers/command.ts +201 -0
- package/src/core/events/v3/producers/coordination-recorder.ts +538 -0
- package/src/core/events/v3/producers/coordination.ts +355 -0
- package/src/core/events/v3/producers/hook-base.ts +578 -0
- package/src/core/events/v3/producers/hook.ts +119 -0
- package/src/core/events/v3/producers/intake.ts +319 -0
- package/src/core/events/v3/producers/recorder.ts +2805 -0
- package/src/core/events/v3/projection.ts +653 -0
- package/src/core/events/v3/reader.ts +1127 -0
- package/src/core/events/v3/recovery-record.ts +244 -0
- package/src/core/events/v3/recovery.ts +271 -0
- package/src/core/events/v3/span-state.ts +187 -0
- package/src/core/events/v3/targets.ts +182 -0
- package/src/core/events/v3/turn-telemetry.ts +259 -0
- package/src/core/events/v3/validate.ts +361 -0
- package/src/core/events/v3/writer.ts +419 -0
- package/src/core/governor/index.ts +3 -0
- package/src/core/governor/plan-api.ts +10 -2
- package/src/core/governor/read.ts +3 -0
- package/src/core/governor/state.ts +52 -5
- package/src/core/guard/config.ts +206 -0
- package/src/core/guard/coordinator.ts +227 -0
- package/src/core/guard/evaluator.ts +343 -0
- package/src/core/guard/evidence-v3.ts +227 -0
- package/src/core/guard/index.ts +35 -0
- package/src/core/guard/live-source-v3.ts +204 -0
- package/src/core/guard/storage.ts +188 -0
- package/src/core/guard/types.ts +152 -0
- package/src/core/hooks/adapter/detect.ts +28 -1
- package/src/core/hooks/adapter/events.ts +14 -6
- package/src/core/hooks/adapter/output.ts +7 -2
- package/src/core/hooks/adapter/parse.ts +80 -38
- package/src/core/hooks/adapter/wiring.ts +119 -13
- package/src/core/hooks/cli.ts +351 -466
- package/src/core/hooks/effects/image-capture.ts +228 -238
- package/src/core/hooks/effects/index.ts +1 -36
- package/src/core/hooks/events/input-hash.ts +47 -0
- package/src/core/hooks/index.ts +4 -11
- package/src/core/hooks/resolve/coord-root.ts +1 -1
- package/src/core/hooks/resolve/owner.ts +52 -45
- package/src/core/hooks/resolve/transcript.ts +165 -14
- package/src/core/hooks/session-name-presence.ts +14 -15
- package/src/core/hooks/unsafe-cross-shell.ts +1 -1
- package/src/core/journal/index.ts +15 -22
- package/src/core/presence/blob.ts +48 -41
- package/src/core/presence/codec-digest.ts +215 -0
- package/src/core/presence/relay-client.ts +5 -5
- package/src/core/work/index.ts +3 -0
- package/src/core/work/read.ts +3 -0
- package/src/core/work/runner.ts +6 -0
- package/src/core/work/state.ts +27 -3
- package/src/core/workflow/engine.ts +24 -24
- package/src/core/workflow/live-session-v3.ts +126 -0
- package/src/core/workflow/scope-id.ts +6 -0
- package/src/core/workflow/workspaces/leases.ts +56 -19
- package/src/index.ts +1 -1
- package/src/lib/browser/client.ts +230 -0
- package/src/lib/browser/critique.ts +104 -27
- package/src/lib/browser/geometry.ts +143 -14
- package/src/lib/browser/index.ts +34 -0
- package/src/lib/browser/qa-plan.ts +501 -0
- package/src/lib/browser/qa-reuse.ts +306 -0
- package/src/lib/browser/qa-snapshot.ts +223 -0
- package/src/lib/browser/runts.ts +27 -2
- package/src/lib/browser/tiling.ts +164 -0
- package/src/lib/claude-desktop.ts +1 -232
- package/src/lib/context/index.ts +22 -46
- package/src/lib/council/index.ts +9 -21
- package/src/lib/docs-frontmatter.ts +8 -79
- package/src/lib/docs-index.ts +33 -3
- package/src/lib/docs-lint.ts +15 -29
- package/src/lib/docs-metadata-audit.ts +166 -0
- package/src/lib/docs-metadata-managed.ts +83 -0
- package/src/lib/docs-metadata-sync.ts +262 -0
- package/src/lib/docs-metadata-v2-schema.ts +138 -0
- package/src/lib/docs-metadata-v2.ts +646 -0
- package/src/lib/docs-new.ts +63 -0
- package/src/lib/docs-sweep.ts +42 -28
- package/src/lib/headless/index.ts +287 -0
- package/src/lib/identities/assume.ts +67 -86
- package/src/lib/instructions/apply.ts +33 -20
- package/src/lib/instructions/bundle.ts +2 -2
- package/src/lib/instructions/splice.ts +21 -7
- package/src/lib/instructions/templates.ts +85 -13
- package/dist/core/agents/cli-emit.d.ts +0 -27
- package/dist/core/agents/cli-emit.d.ts.map +0 -1
- package/dist/core/agents/cli-emit.js +0 -57
- package/dist/core/agents/codex-replay.d.ts +0 -29
- package/dist/core/agents/codex-replay.d.ts.map +0 -1
- package/dist/core/agents/codex-replay.js +0 -138
- package/dist/core/agents/events/consume.d.ts +0 -82
- package/dist/core/agents/events/consume.d.ts.map +0 -1
- package/dist/core/agents/events/consume.js +0 -195
- package/dist/core/agents/events/emit.d.ts +0 -42
- package/dist/core/agents/events/emit.d.ts.map +0 -1
- package/dist/core/agents/events/emit.js +0 -75
- package/dist/core/agents/events/ulid.d.ts +0 -11
- package/dist/core/agents/events/ulid.d.ts.map +0 -1
- package/dist/core/agents/events/ulid.js +0 -47
- package/dist/core/agents/state/heartbeat-projector.d.ts +0 -76
- package/dist/core/agents/state/heartbeat-projector.d.ts.map +0 -1
- package/dist/core/agents/state/heartbeat-projector.js +0 -581
- package/dist/core/hooks/events/emit.d.ts +0 -31
- package/dist/core/hooks/events/emit.d.ts.map +0 -1
- package/dist/core/hooks/events/emit.js +0 -93
- package/dist/core/hooks/events/rotate.d.ts +0 -43
- package/dist/core/hooks/events/rotate.d.ts.map +0 -1
- package/dist/core/hooks/events/rotate.js +0 -142
- package/dist/core/hooks/events/schema.d.ts +0 -341
- package/dist/core/hooks/events/schema.d.ts.map +0 -1
- package/dist/core/hooks/events/schema.js +0 -12
- package/dist/core/hooks/events/ulid.d.ts +0 -10
- package/dist/core/hooks/events/ulid.d.ts.map +0 -1
- package/dist/core/hooks/events/ulid.js +0 -47
- package/dist/lib/docs-frontmatter-migrate.d.ts +0 -33
- package/dist/lib/docs-frontmatter-migrate.d.ts.map +0 -1
- package/dist/lib/docs-frontmatter-migrate.js +0 -364
- package/src/core/agents/cli-emit.ts +0 -64
- package/src/core/agents/codex-replay.ts +0 -163
- package/src/core/agents/events/consume.ts +0 -254
- package/src/core/agents/events/emit.ts +0 -115
- package/src/core/agents/events/ulid.ts +0 -51
- package/src/core/agents/state/heartbeat-projector.ts +0 -645
- package/src/core/hooks/events/emit.ts +0 -125
- package/src/core/hooks/events/rotate.ts +0 -151
- package/src/core/hooks/events/schema.ts +0 -582
- package/src/core/hooks/events/ulid.ts +0 -51
- package/src/lib/docs-frontmatter-migrate.ts +0 -427
|
@@ -0,0 +1,653 @@
|
|
|
1
|
+
import type { EventV3 } from "./contract.ts";
|
|
2
|
+
import type { PositionedEventV3, ReadLedgerV3Result } from "./reader.ts";
|
|
3
|
+
|
|
4
|
+
export const EVENT_V3_SAFETY_REDUCER_BUILD = "event-v3-safety-reducer-v2" as const;
|
|
5
|
+
const MAX_PROJECTION_DIAGNOSTICS = 256;
|
|
6
|
+
|
|
7
|
+
interface GenerationScopeViewV3 {
|
|
8
|
+
instance_id: string;
|
|
9
|
+
session_id: string;
|
|
10
|
+
generation_id: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type SafetyProjectionDiagnosticCodeV3 =
|
|
14
|
+
| "ledger_incomplete"
|
|
15
|
+
| "duplicate_session_start"
|
|
16
|
+
| "terminal_without_start"
|
|
17
|
+
| "event_after_terminal"
|
|
18
|
+
| "transition_without_live_subject"
|
|
19
|
+
| "transition_prior_mismatch"
|
|
20
|
+
| "authority_attribution_unverified"
|
|
21
|
+
| "wait_end_without_start"
|
|
22
|
+
| "claim_acquire_conflict"
|
|
23
|
+
| "claim_release_without_acquire"
|
|
24
|
+
| "decision_prior_mismatch"
|
|
25
|
+
| "delegation_duplicate_start"
|
|
26
|
+
| "delegation_complete_without_start"
|
|
27
|
+
| "delegation_identity_mismatch";
|
|
28
|
+
|
|
29
|
+
export interface SafetyProjectionDiagnosticV3 {
|
|
30
|
+
code: SafetyProjectionDiagnosticCodeV3;
|
|
31
|
+
event_id?: string;
|
|
32
|
+
generation_id?: string;
|
|
33
|
+
subject_instance_id?: string;
|
|
34
|
+
source_code?: string;
|
|
35
|
+
authority_blocking: boolean;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface WaitProjectionV3 {
|
|
39
|
+
wait_id: string;
|
|
40
|
+
kind: string;
|
|
41
|
+
started_event_id: string;
|
|
42
|
+
started_at: string;
|
|
43
|
+
authority_reference?: string;
|
|
44
|
+
wake_at?: string;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface GenerationSafetyStateV3 {
|
|
48
|
+
generation_id: string;
|
|
49
|
+
instance_id: string;
|
|
50
|
+
session_id: string;
|
|
51
|
+
started_event_id: string;
|
|
52
|
+
started_at: string;
|
|
53
|
+
last_observed_at: string;
|
|
54
|
+
attestation_id: string;
|
|
55
|
+
phase: "live" | "terminal";
|
|
56
|
+
activity: "working" | "needs_input" | "idle" | "terminal";
|
|
57
|
+
last_event_id: string;
|
|
58
|
+
last_segment_ordinal: number;
|
|
59
|
+
last_byte_offset: number;
|
|
60
|
+
task_state?: string;
|
|
61
|
+
task_state_updated_at?: string;
|
|
62
|
+
lifecycle_state?: string;
|
|
63
|
+
lifecycle_state_updated_at?: string;
|
|
64
|
+
presence_state?: string;
|
|
65
|
+
presence_state_updated_at?: string;
|
|
66
|
+
provisional_termination?: {
|
|
67
|
+
observation: string;
|
|
68
|
+
event_id: string;
|
|
69
|
+
observed_at: string;
|
|
70
|
+
};
|
|
71
|
+
terminal?: {
|
|
72
|
+
event_id: string;
|
|
73
|
+
observed_at: string;
|
|
74
|
+
outcome: string;
|
|
75
|
+
authority: "native" | "approved";
|
|
76
|
+
reason: string;
|
|
77
|
+
};
|
|
78
|
+
waits: Record<string, WaitProjectionV3>;
|
|
79
|
+
progress_event_ids: string[];
|
|
80
|
+
last_context_event_id?: string;
|
|
81
|
+
resume_count: number;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface ClaimProjectionV3 {
|
|
85
|
+
key: string;
|
|
86
|
+
subject_instance_id: string;
|
|
87
|
+
actor_instance_id: string;
|
|
88
|
+
target_digest: string;
|
|
89
|
+
target_kind: string;
|
|
90
|
+
target_display?: string;
|
|
91
|
+
access: "read" | "write";
|
|
92
|
+
acquired_event_id: string;
|
|
93
|
+
transaction_id: string;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface DelegationProjectionV3 {
|
|
97
|
+
delegation_id: string;
|
|
98
|
+
parent_generation_id: string;
|
|
99
|
+
child_generation_id: string;
|
|
100
|
+
role: string;
|
|
101
|
+
started_event_id: string;
|
|
102
|
+
completed_event_id?: string;
|
|
103
|
+
outcome?: string;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export interface SafetyProjectionV3 {
|
|
107
|
+
reducer_build_id: typeof EVENT_V3_SAFETY_REDUCER_BUILD;
|
|
108
|
+
evidence_complete: boolean;
|
|
109
|
+
history_complete: boolean;
|
|
110
|
+
authority_safe: boolean;
|
|
111
|
+
diagnostics: SafetyProjectionDiagnosticV3[];
|
|
112
|
+
generations: Record<string, GenerationSafetyStateV3>;
|
|
113
|
+
current_generation_by_instance: Record<string, string>;
|
|
114
|
+
claims: Record<string, ClaimProjectionV3>;
|
|
115
|
+
delegations: Record<string, DelegationProjectionV3>;
|
|
116
|
+
decisions: Record<string, string>;
|
|
117
|
+
identities: Record<string, string>;
|
|
118
|
+
health: Record<string, { severity: string; condition: string; event_id: string }>;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Deterministically fold only contract-validated V3 rows. Physical ledger
|
|
123
|
+
* order is authoritative; wall-clock values are display evidence, never the
|
|
124
|
+
* conflict-resolution key. An incomplete source makes authority reads fail
|
|
125
|
+
* closed even when the unaffected portions can still be shown diagnostically.
|
|
126
|
+
*/
|
|
127
|
+
export function reduceSafetyProjectionV3(read: ReadLedgerV3Result): SafetyProjectionV3 {
|
|
128
|
+
const projection: SafetyProjectionV3 = {
|
|
129
|
+
reducer_build_id: EVENT_V3_SAFETY_REDUCER_BUILD,
|
|
130
|
+
evidence_complete: read.complete,
|
|
131
|
+
history_complete: true,
|
|
132
|
+
authority_safe: true,
|
|
133
|
+
diagnostics: [],
|
|
134
|
+
generations: {},
|
|
135
|
+
current_generation_by_instance: {},
|
|
136
|
+
claims: {},
|
|
137
|
+
delegations: {},
|
|
138
|
+
decisions: {},
|
|
139
|
+
identities: {},
|
|
140
|
+
health: {},
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
for (const diagnostic of read.diagnostics) {
|
|
144
|
+
const authorityBlocking = authorityBlockingLedgerDiagnostic(diagnostic.code);
|
|
145
|
+
if (authorityBlocking) projection.history_complete = false;
|
|
146
|
+
projection.diagnostics.push({
|
|
147
|
+
code: "ledger_incomplete",
|
|
148
|
+
source_code: diagnostic.code,
|
|
149
|
+
event_id: diagnostic.event_id,
|
|
150
|
+
authority_blocking: authorityBlocking,
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
for (const positioned of read.events) applyEvent(projection, positioned);
|
|
154
|
+
projection.authority_safe =
|
|
155
|
+
projection.history_complete &&
|
|
156
|
+
!projection.diagnostics.some((diagnostic) => diagnostic.authority_blocking);
|
|
157
|
+
return projection;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function applyEvent(projection: SafetyProjectionV3, positioned: PositionedEventV3): void {
|
|
161
|
+
const event = positioned.event;
|
|
162
|
+
if (event.event_type === "session.started") {
|
|
163
|
+
applySessionStart(projection, positioned, event);
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
switch (event.event_type) {
|
|
168
|
+
case "ledger.genesis":
|
|
169
|
+
case "ledger.activated":
|
|
170
|
+
case "ledger.schema_advanced":
|
|
171
|
+
case "ledger.comparability_advanced":
|
|
172
|
+
return;
|
|
173
|
+
case "coord.task_changed":
|
|
174
|
+
applySubjectTransition(projection, positioned, event, "task_state");
|
|
175
|
+
return;
|
|
176
|
+
case "coord.lifecycle_changed":
|
|
177
|
+
applySubjectTransition(projection, positioned, event, "lifecycle_state");
|
|
178
|
+
return;
|
|
179
|
+
case "coord.presence_changed":
|
|
180
|
+
applySubjectTransition(projection, positioned, event, "presence_state");
|
|
181
|
+
return;
|
|
182
|
+
case "coord.claim_changed":
|
|
183
|
+
applyClaim(projection, event);
|
|
184
|
+
return;
|
|
185
|
+
case "decision.state_changed":
|
|
186
|
+
if (!authorityAttributionVerified(event)) {
|
|
187
|
+
addDiagnostic(projection, {
|
|
188
|
+
code: "authority_attribution_unverified",
|
|
189
|
+
event_id: event.event_id,
|
|
190
|
+
});
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
if (
|
|
194
|
+
event.payload.prior_state !== undefined &&
|
|
195
|
+
projection.decisions[event.payload.decision_id] !== event.payload.prior_state
|
|
196
|
+
) {
|
|
197
|
+
addDiagnostic(projection, {
|
|
198
|
+
code: "decision_prior_mismatch",
|
|
199
|
+
event_id: event.event_id,
|
|
200
|
+
});
|
|
201
|
+
return;
|
|
202
|
+
}
|
|
203
|
+
projection.decisions[event.payload.decision_id] = event.payload.new_state;
|
|
204
|
+
return;
|
|
205
|
+
case "coord.identity_attested":
|
|
206
|
+
if (!authorityAttributionVerified(event, event.payload.subject_instance_id)) {
|
|
207
|
+
addDiagnostic(projection, {
|
|
208
|
+
code: "authority_attribution_unverified",
|
|
209
|
+
event_id: event.event_id,
|
|
210
|
+
subject_instance_id: event.payload.subject_instance_id,
|
|
211
|
+
});
|
|
212
|
+
return;
|
|
213
|
+
}
|
|
214
|
+
projection.identities[event.payload.subject_instance_id] = event.payload.identity_id;
|
|
215
|
+
return;
|
|
216
|
+
case "health.observed":
|
|
217
|
+
projection.health[event.payload.subsystem] = {
|
|
218
|
+
severity: event.payload.severity,
|
|
219
|
+
condition: event.payload.condition,
|
|
220
|
+
event_id: event.event_id,
|
|
221
|
+
};
|
|
222
|
+
return;
|
|
223
|
+
case "health.capability_drift":
|
|
224
|
+
// Emitted after session.ended on purpose (payload.generation_ended).
|
|
225
|
+
// Must not take the generation-scoped event_after_terminal path, which
|
|
226
|
+
// fail-closes the whole ledger and blocks every agent from editing files.
|
|
227
|
+
projection.health[`capability:${event.payload.signal}`] = {
|
|
228
|
+
severity: "warning",
|
|
229
|
+
condition: event.payload.signal,
|
|
230
|
+
event_id: event.event_id,
|
|
231
|
+
};
|
|
232
|
+
return;
|
|
233
|
+
case "session.termination_observed":
|
|
234
|
+
applyProvisionalTermination(projection, event);
|
|
235
|
+
return;
|
|
236
|
+
case "lifecycle.sweep_observed":
|
|
237
|
+
applySweepObservation(projection, event);
|
|
238
|
+
return;
|
|
239
|
+
case "agent.started":
|
|
240
|
+
applyAgentStarted(projection, event);
|
|
241
|
+
return;
|
|
242
|
+
case "agent.completed":
|
|
243
|
+
applyAgentCompleted(projection, event);
|
|
244
|
+
return;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
const generationId = generationIdOf(event);
|
|
248
|
+
if (!generationId) return;
|
|
249
|
+
const state = projection.generations[generationId];
|
|
250
|
+
if (!state) {
|
|
251
|
+
if (event.event_type === "session.ended") {
|
|
252
|
+
addDiagnostic(projection, {
|
|
253
|
+
code: "terminal_without_start",
|
|
254
|
+
event_id: event.event_id,
|
|
255
|
+
generation_id: generationId,
|
|
256
|
+
});
|
|
257
|
+
}
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
if (state.phase === "terminal") {
|
|
261
|
+
addDiagnostic(projection, {
|
|
262
|
+
code: "event_after_terminal",
|
|
263
|
+
event_id: event.event_id,
|
|
264
|
+
generation_id: generationId,
|
|
265
|
+
});
|
|
266
|
+
return;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
touch(state, positioned);
|
|
270
|
+
switch (event.event_type) {
|
|
271
|
+
case "session.ended":
|
|
272
|
+
if (!authorityAttributionVerified(event, state.instance_id)) {
|
|
273
|
+
addDiagnostic(projection, {
|
|
274
|
+
code: "authority_attribution_unverified",
|
|
275
|
+
event_id: event.event_id,
|
|
276
|
+
generation_id: generationId,
|
|
277
|
+
subject_instance_id: state.instance_id,
|
|
278
|
+
});
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
state.phase = "terminal";
|
|
282
|
+
state.activity = "terminal";
|
|
283
|
+
state.terminal = {
|
|
284
|
+
event_id: event.event_id,
|
|
285
|
+
observed_at: event.time.observed_at,
|
|
286
|
+
outcome: event.payload.outcome,
|
|
287
|
+
authority: event.payload.authority,
|
|
288
|
+
reason: event.payload.reason,
|
|
289
|
+
};
|
|
290
|
+
state.waits = {};
|
|
291
|
+
retargetCurrentGeneration(projection, state.instance_id, generationId);
|
|
292
|
+
return;
|
|
293
|
+
case "session.resumed":
|
|
294
|
+
state.provisional_termination = undefined;
|
|
295
|
+
state.resume_count += 1;
|
|
296
|
+
state.activity = "working";
|
|
297
|
+
return;
|
|
298
|
+
case "session.attestation_changed":
|
|
299
|
+
state.attestation_id = event.attestation_id;
|
|
300
|
+
return;
|
|
301
|
+
case "wait.started":
|
|
302
|
+
if (!authorityAttributionVerified(event, state.instance_id)) {
|
|
303
|
+
addDiagnostic(projection, {
|
|
304
|
+
code: "authority_attribution_unverified",
|
|
305
|
+
event_id: event.event_id,
|
|
306
|
+
generation_id: generationId,
|
|
307
|
+
subject_instance_id: state.instance_id,
|
|
308
|
+
});
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
state.waits[event.payload.wait_id] = {
|
|
312
|
+
wait_id: event.payload.wait_id,
|
|
313
|
+
kind: event.payload.kind,
|
|
314
|
+
started_event_id: event.event_id,
|
|
315
|
+
started_at: event.time.observed_at,
|
|
316
|
+
authority_reference: event.payload.authority_reference,
|
|
317
|
+
wake_at: event.payload.wake_at,
|
|
318
|
+
};
|
|
319
|
+
state.activity = "needs_input";
|
|
320
|
+
return;
|
|
321
|
+
case "wait.ended":
|
|
322
|
+
if (!authorityAttributionVerified(event, state.instance_id)) {
|
|
323
|
+
addDiagnostic(projection, {
|
|
324
|
+
code: "authority_attribution_unverified",
|
|
325
|
+
event_id: event.event_id,
|
|
326
|
+
generation_id: generationId,
|
|
327
|
+
subject_instance_id: state.instance_id,
|
|
328
|
+
});
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
if (!state.waits[event.payload.wait_id]) {
|
|
332
|
+
addDiagnostic(projection, {
|
|
333
|
+
code: "wait_end_without_start",
|
|
334
|
+
event_id: event.event_id,
|
|
335
|
+
generation_id: generationId,
|
|
336
|
+
});
|
|
337
|
+
return;
|
|
338
|
+
}
|
|
339
|
+
delete state.waits[event.payload.wait_id];
|
|
340
|
+
state.activity = Object.keys(state.waits).length === 0 ? "working" : "needs_input";
|
|
341
|
+
return;
|
|
342
|
+
case "turn.started":
|
|
343
|
+
case "tool.requested":
|
|
344
|
+
case "command.started":
|
|
345
|
+
state.activity = "working";
|
|
346
|
+
return;
|
|
347
|
+
case "turn.completed":
|
|
348
|
+
state.activity = "idle";
|
|
349
|
+
return;
|
|
350
|
+
case "progress.observed":
|
|
351
|
+
state.progress_event_ids.push(event.event_id);
|
|
352
|
+
return;
|
|
353
|
+
case "context.observed":
|
|
354
|
+
case "context.compaction_started":
|
|
355
|
+
case "context.compaction_completed":
|
|
356
|
+
case "context.checkpointed":
|
|
357
|
+
case "context.recovery_injected":
|
|
358
|
+
state.last_context_event_id = event.event_id;
|
|
359
|
+
return;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
function applySessionStart(
|
|
364
|
+
projection: SafetyProjectionV3,
|
|
365
|
+
positioned: PositionedEventV3,
|
|
366
|
+
event: Extract<EventV3, { event_type: "session.started" }>,
|
|
367
|
+
): void {
|
|
368
|
+
const scope = event.scope as GenerationScopeViewV3;
|
|
369
|
+
const generationId = scope.generation_id;
|
|
370
|
+
if (projection.generations[generationId]) {
|
|
371
|
+
addDiagnostic(projection, {
|
|
372
|
+
code: "duplicate_session_start",
|
|
373
|
+
event_id: event.event_id,
|
|
374
|
+
generation_id: generationId,
|
|
375
|
+
});
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
projection.generations[generationId] = {
|
|
379
|
+
generation_id: generationId,
|
|
380
|
+
instance_id: scope.instance_id,
|
|
381
|
+
session_id: scope.session_id,
|
|
382
|
+
started_event_id: event.event_id,
|
|
383
|
+
started_at: event.time.observed_at,
|
|
384
|
+
last_observed_at: event.time.observed_at,
|
|
385
|
+
attestation_id: event.attestation_id,
|
|
386
|
+
phase: "live",
|
|
387
|
+
activity: "idle",
|
|
388
|
+
last_event_id: event.event_id,
|
|
389
|
+
last_segment_ordinal: positioned.position.segment_ordinal,
|
|
390
|
+
last_byte_offset: positioned.position.byte_offset,
|
|
391
|
+
waits: {},
|
|
392
|
+
progress_event_ids: [],
|
|
393
|
+
resume_count: 0,
|
|
394
|
+
};
|
|
395
|
+
projection.current_generation_by_instance[scope.instance_id] = generationId;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
function applySubjectTransition(
|
|
399
|
+
projection: SafetyProjectionV3,
|
|
400
|
+
positioned: PositionedEventV3,
|
|
401
|
+
event: Extract<
|
|
402
|
+
EventV3,
|
|
403
|
+
{
|
|
404
|
+
event_type: "coord.task_changed" | "coord.lifecycle_changed" | "coord.presence_changed";
|
|
405
|
+
}
|
|
406
|
+
>,
|
|
407
|
+
field: "task_state" | "lifecycle_state" | "presence_state",
|
|
408
|
+
): void {
|
|
409
|
+
const subject = event.payload.subject_instance_id;
|
|
410
|
+
if (!authorityAttributionVerified(event, subject)) {
|
|
411
|
+
addDiagnostic(projection, {
|
|
412
|
+
code: "authority_attribution_unverified",
|
|
413
|
+
event_id: event.event_id,
|
|
414
|
+
subject_instance_id: subject,
|
|
415
|
+
});
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
const generationId = projection.current_generation_by_instance[subject];
|
|
419
|
+
const state = generationId ? projection.generations[generationId] : undefined;
|
|
420
|
+
if (state?.phase !== "live") {
|
|
421
|
+
addDiagnostic(projection, {
|
|
422
|
+
code: "transition_without_live_subject",
|
|
423
|
+
event_id: event.event_id,
|
|
424
|
+
subject_instance_id: subject,
|
|
425
|
+
generation_id: generationId,
|
|
426
|
+
});
|
|
427
|
+
return;
|
|
428
|
+
}
|
|
429
|
+
if (event.payload.prior_state !== undefined && event.payload.prior_state !== state[field]) {
|
|
430
|
+
addDiagnostic(projection, {
|
|
431
|
+
code: "transition_prior_mismatch",
|
|
432
|
+
event_id: event.event_id,
|
|
433
|
+
subject_instance_id: subject,
|
|
434
|
+
generation_id: generationId,
|
|
435
|
+
});
|
|
436
|
+
return;
|
|
437
|
+
}
|
|
438
|
+
state[field] = event.payload.new_state;
|
|
439
|
+
if (field === "task_state") state.task_state_updated_at = event.time.observed_at;
|
|
440
|
+
if (field === "lifecycle_state") state.lifecycle_state_updated_at = event.time.observed_at;
|
|
441
|
+
if (field === "presence_state") state.presence_state_updated_at = event.time.observed_at;
|
|
442
|
+
touch(state, positioned);
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
function applyClaim(
|
|
446
|
+
projection: SafetyProjectionV3,
|
|
447
|
+
event: Extract<EventV3, { event_type: "coord.claim_changed" }>,
|
|
448
|
+
): void {
|
|
449
|
+
if (event.payload.operation === "denied") return;
|
|
450
|
+
if (!authorityAttributionVerified(event, event.payload.subject_instance_id)) {
|
|
451
|
+
addDiagnostic(projection, {
|
|
452
|
+
code: "authority_attribution_unverified",
|
|
453
|
+
event_id: event.event_id,
|
|
454
|
+
subject_instance_id: event.payload.subject_instance_id,
|
|
455
|
+
});
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
const key = [
|
|
459
|
+
event.payload.subject_instance_id,
|
|
460
|
+
event.payload.target.fingerprint.digest,
|
|
461
|
+
event.payload.access,
|
|
462
|
+
].join("\0");
|
|
463
|
+
if (event.payload.operation === "released") {
|
|
464
|
+
if (!projection.claims[key]) {
|
|
465
|
+
addDiagnostic(projection, {
|
|
466
|
+
code: "claim_release_without_acquire",
|
|
467
|
+
event_id: event.event_id,
|
|
468
|
+
subject_instance_id: event.payload.subject_instance_id,
|
|
469
|
+
});
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
delete projection.claims[key];
|
|
473
|
+
return;
|
|
474
|
+
}
|
|
475
|
+
const generationId = projection.current_generation_by_instance[event.payload.subject_instance_id];
|
|
476
|
+
const subject = generationId ? projection.generations[generationId] : undefined;
|
|
477
|
+
if (subject?.phase !== "live") {
|
|
478
|
+
addDiagnostic(projection, {
|
|
479
|
+
code: "transition_without_live_subject",
|
|
480
|
+
event_id: event.event_id,
|
|
481
|
+
subject_instance_id: event.payload.subject_instance_id,
|
|
482
|
+
generation_id: generationId,
|
|
483
|
+
});
|
|
484
|
+
return;
|
|
485
|
+
}
|
|
486
|
+
const held = projection.claims[key];
|
|
487
|
+
if (held && held.subject_instance_id !== event.payload.subject_instance_id) {
|
|
488
|
+
addDiagnostic(projection, {
|
|
489
|
+
code: "claim_acquire_conflict",
|
|
490
|
+
event_id: event.event_id,
|
|
491
|
+
subject_instance_id: event.payload.subject_instance_id,
|
|
492
|
+
});
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
495
|
+
// A re-acquire by the current holder is idempotent (the guard may re-assert
|
|
496
|
+
// a holding it cannot see across an epoch boundary): refresh, never conflict.
|
|
497
|
+
projection.claims[key] = {
|
|
498
|
+
key,
|
|
499
|
+
subject_instance_id: event.payload.subject_instance_id,
|
|
500
|
+
actor_instance_id: event.payload.actor_instance_id,
|
|
501
|
+
target_digest: event.payload.target.fingerprint.digest,
|
|
502
|
+
target_kind: event.payload.target.kind,
|
|
503
|
+
target_display: event.payload.target.display,
|
|
504
|
+
access: event.payload.access,
|
|
505
|
+
acquired_event_id: event.event_id,
|
|
506
|
+
transaction_id: event.payload.authority.transaction_id!,
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
function applyProvisionalTermination(
|
|
511
|
+
projection: SafetyProjectionV3,
|
|
512
|
+
event: Extract<EventV3, { event_type: "session.termination_observed" }>,
|
|
513
|
+
): void {
|
|
514
|
+
const generationId = projection.current_generation_by_instance[event.payload.subject_instance_id];
|
|
515
|
+
const state = generationId ? projection.generations[generationId] : undefined;
|
|
516
|
+
if (state?.phase !== "live") return;
|
|
517
|
+
state.provisional_termination = {
|
|
518
|
+
observation: event.payload.observation,
|
|
519
|
+
event_id: event.event_id,
|
|
520
|
+
observed_at: event.time.observed_at,
|
|
521
|
+
};
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
function applySweepObservation(
|
|
525
|
+
projection: SafetyProjectionV3,
|
|
526
|
+
event: Extract<EventV3, { event_type: "lifecycle.sweep_observed" }>,
|
|
527
|
+
): void {
|
|
528
|
+
const generationId = projection.current_generation_by_instance[event.payload.subject_instance_id];
|
|
529
|
+
const state = generationId ? projection.generations[generationId] : undefined;
|
|
530
|
+
if (state?.phase !== "live") return;
|
|
531
|
+
state.provisional_termination = {
|
|
532
|
+
observation: event.payload.observation,
|
|
533
|
+
event_id: event.event_id,
|
|
534
|
+
observed_at: event.time.observed_at,
|
|
535
|
+
};
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
function applyAgentStarted(
|
|
539
|
+
projection: SafetyProjectionV3,
|
|
540
|
+
event: Extract<EventV3, { event_type: "agent.started" }>,
|
|
541
|
+
): void {
|
|
542
|
+
if (projection.delegations[event.payload.delegation_id]) {
|
|
543
|
+
addDiagnostic(projection, {
|
|
544
|
+
code: "delegation_duplicate_start",
|
|
545
|
+
event_id: event.event_id,
|
|
546
|
+
generation_id: generationIdOf(event),
|
|
547
|
+
});
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
projection.delegations[event.payload.delegation_id] = {
|
|
551
|
+
delegation_id: event.payload.delegation_id,
|
|
552
|
+
parent_generation_id: generationIdOf(event)!,
|
|
553
|
+
child_generation_id: event.payload.child_generation_id,
|
|
554
|
+
role: event.payload.role,
|
|
555
|
+
started_event_id: event.event_id,
|
|
556
|
+
};
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
function applyAgentCompleted(
|
|
560
|
+
projection: SafetyProjectionV3,
|
|
561
|
+
event: Extract<EventV3, { event_type: "agent.completed" }>,
|
|
562
|
+
): void {
|
|
563
|
+
const delegation = projection.delegations[event.payload.delegation_id];
|
|
564
|
+
if (!delegation) {
|
|
565
|
+
addDiagnostic(projection, {
|
|
566
|
+
code: "delegation_complete_without_start",
|
|
567
|
+
event_id: event.event_id,
|
|
568
|
+
generation_id: generationIdOf(event),
|
|
569
|
+
});
|
|
570
|
+
return;
|
|
571
|
+
}
|
|
572
|
+
if (delegation.child_generation_id !== event.payload.child_generation_id) {
|
|
573
|
+
addDiagnostic(projection, {
|
|
574
|
+
code: "delegation_identity_mismatch",
|
|
575
|
+
event_id: event.event_id,
|
|
576
|
+
generation_id: generationIdOf(event),
|
|
577
|
+
});
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
580
|
+
delegation.completed_event_id = event.event_id;
|
|
581
|
+
delegation.outcome = event.payload.outcome;
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
function generationIdOf(event: EventV3): string | undefined {
|
|
585
|
+
return "generation_id" in event.scope ? event.scope.generation_id : undefined;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
function touch(state: GenerationSafetyStateV3, positioned: PositionedEventV3): void {
|
|
589
|
+
state.last_event_id = positioned.event.event_id;
|
|
590
|
+
state.last_observed_at = positioned.event.time.observed_at;
|
|
591
|
+
state.last_segment_ordinal = positioned.position.segment_ordinal;
|
|
592
|
+
state.last_byte_offset = positioned.position.byte_offset;
|
|
593
|
+
}
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* A superseded twin (same instance, later generation, then session.ended)
|
|
597
|
+
* must not leave `current_generation_by_instance` pointing at the terminal
|
|
598
|
+
* row. The surviving live sibling stays the instance's current generation so
|
|
599
|
+
* whoami/set-task can still see it.
|
|
600
|
+
*/
|
|
601
|
+
function retargetCurrentGeneration(
|
|
602
|
+
projection: SafetyProjectionV3,
|
|
603
|
+
instanceId: string,
|
|
604
|
+
endedGenerationId: string,
|
|
605
|
+
): void {
|
|
606
|
+
if (projection.current_generation_by_instance[instanceId] !== endedGenerationId) return;
|
|
607
|
+
const survivor = Object.values(projection.generations)
|
|
608
|
+
.filter(
|
|
609
|
+
(generation) =>
|
|
610
|
+
generation.instance_id === instanceId &&
|
|
611
|
+
generation.phase === "live" &&
|
|
612
|
+
generation.generation_id !== endedGenerationId,
|
|
613
|
+
)
|
|
614
|
+
.sort(
|
|
615
|
+
(left, right) =>
|
|
616
|
+
right.last_observed_at.localeCompare(left.last_observed_at) ||
|
|
617
|
+
right.generation_id.localeCompare(left.generation_id),
|
|
618
|
+
)[0];
|
|
619
|
+
if (survivor) {
|
|
620
|
+
projection.current_generation_by_instance[instanceId] = survivor.generation_id;
|
|
621
|
+
return;
|
|
622
|
+
}
|
|
623
|
+
delete projection.current_generation_by_instance[instanceId];
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
function addDiagnostic(
|
|
627
|
+
projection: SafetyProjectionV3,
|
|
628
|
+
diagnostic: Omit<SafetyProjectionDiagnosticV3, "authority_blocking">,
|
|
629
|
+
): void {
|
|
630
|
+
projection.history_complete = false;
|
|
631
|
+
projection.authority_safe = false;
|
|
632
|
+
if (projection.diagnostics.length < MAX_PROJECTION_DIAGNOSTICS) {
|
|
633
|
+
projection.diagnostics.push({ ...diagnostic, authority_blocking: true });
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
function authorityBlockingLedgerDiagnostic(code: string): boolean {
|
|
638
|
+
return (
|
|
639
|
+
code !== "unresolved_attestation" &&
|
|
640
|
+
code !== "wall_clock_regression_unmarked" &&
|
|
641
|
+
code !== "monotonic_clock_regression"
|
|
642
|
+
);
|
|
643
|
+
}
|
|
644
|
+
|
|
645
|
+
function authorityAttributionVerified(event: EventV3, subjectInstanceId?: string): boolean {
|
|
646
|
+
const attribution = event.provenance.attribution;
|
|
647
|
+
return (
|
|
648
|
+
attribution.state === "verified" &&
|
|
649
|
+
(attribution.subject_instance_id === undefined ||
|
|
650
|
+
subjectInstanceId === undefined ||
|
|
651
|
+
attribution.subject_instance_id === subjectInstanceId)
|
|
652
|
+
);
|
|
653
|
+
}
|