harnery 0.32.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/README.md +2 -0
- package/dist/commander.d.ts.map +1 -1
- package/dist/commander.js +7 -1
- 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 +1408 -565
- 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 +2 -2
- package/dist/commands/claude-desktop.d.ts.map +1 -1
- package/dist/commands/claude-desktop.js +2 -2
- 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.d.ts +4 -2
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +55 -7
- 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 +10 -2
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +233 -51
- package/dist/commands/instructions.d.ts +4 -0
- package/dist/commands/instructions.d.ts.map +1 -0
- package/dist/commands/instructions.js +100 -0
- 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 +15 -6
- 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 +27 -25
- package/dist/core/agents/cli.js +212 -235
- 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 -70
- 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 +5 -5
- package/dist/core/agents/index.d.ts.map +1 -1
- package/dist/core/agents/index.js +5 -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 +10 -4
- package/dist/core/agents/render/prompt-context.d.ts.map +1 -1
- package/dist/core/agents/render/prompt-context.js +61 -55
- 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 +15 -33
- 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 +29 -46
- package/dist/core/agents/state/heartbeat-writer.d.ts.map +1 -1
- package/dist/core/agents/state/heartbeat-writer.js +59 -199
- 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 +45 -0
- package/dist/core/agents/state/session-state.d.ts.map +1 -0
- package/dist/core/agents/state/session-state.js +90 -0
- 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 +13 -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 +64 -24
- 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 +345 -400
- package/dist/core/hooks/codex-authorization.d.ts +30 -0
- package/dist/core/hooks/codex-authorization.d.ts.map +1 -0
- package/dist/core/hooks/codex-authorization.js +199 -0
- 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 +8 -3
- package/dist/core/presence/blob.d.ts.map +1 -1
- package/dist/core/presence/blob.js +54 -41
- 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/index.js +15 -1
- 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/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 +33 -0
- package/dist/lib/instructions/bundle.d.ts.map +1 -0
- package/dist/lib/instructions/bundle.js +149 -0
- 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 +27 -6
- 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 +7 -1
- package/src/commands/adapter.ts +2 -2
- package/src/commands/agents.ts +1737 -570
- 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 +7 -5
- 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 +73 -8
- package/src/commands/events.ts +256 -0
- package/src/commands/governor.ts +18 -4
- package/src/commands/init.ts +264 -57
- package/src/commands/instructions.ts +129 -0
- package/src/commands/journal.ts +4 -13
- package/src/commands/ledger-v3.ts +111 -0
- package/src/commands/presence.ts +18 -11
- 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 +39 -28
- package/src/core/agents/cli.ts +242 -263
- package/src/core/agents/codex-archive-v3.ts +138 -0
- package/src/core/agents/coord-client.ts +75 -177
- package/src/core/agents/finalization.ts +120 -38
- package/src/core/agents/index.ts +5 -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 +89 -55
- package/src/core/agents/render/session-context.ts +23 -32
- 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 +98 -242
- package/src/core/agents/state/live-coordination-view.ts +290 -0
- package/src/core/agents/state/session-state.ts +143 -0
- 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 +15 -6
- package/src/core/hooks/adapter/output.ts +7 -2
- package/src/core/hooks/adapter/parse.ts +81 -36
- package/src/core/hooks/adapter/wiring.ts +119 -13
- package/src/core/hooks/cli.ts +398 -422
- package/src/core/hooks/codex-authorization.ts +253 -0
- 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 +63 -38
- package/src/core/presence/codec-digest.ts +215 -0
- package/src/core/presence/index.ts +18 -1
- 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/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 +199 -0
- 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 -65
- package/dist/core/agents/state/heartbeat-projector.d.ts.map +0 -1
- package/dist/core/agents/state/heartbeat-projector.js +0 -527
- 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 -312
- 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 -582
- 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 -538
- package/src/core/hooks/events/ulid.ts +0 -51
- package/src/lib/docs-frontmatter-migrate.ts +0 -427
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
// Content-aware band placement for the vision critique tiler.
|
|
2
|
+
//
|
|
3
|
+
// Fixed-height bands cut whatever sits at the boundary — half a heading, a
|
|
4
|
+
// sliced table row, the middle of an image — and the critique rubric then has
|
|
5
|
+
// to tell the model to ignore slice-edge clipping, which costs sensitivity on
|
|
6
|
+
// every tile. This module snaps each cut into nearby content gaps instead:
|
|
7
|
+
// the caller extracts "visual atoms" (text line boxes, replaced elements,
|
|
8
|
+
// small bordered boxes) from the live page, and `snappedBandRects` places
|
|
9
|
+
// each seam at the cheapest cut inside a bounded search window above the
|
|
10
|
+
// fixed target. A clean seam (nothing straddles it) needs only a token
|
|
11
|
+
// overlap; a dirty seam (unavoidable content, e.g. an element taller than
|
|
12
|
+
// the band) keeps the caller's full overlap so the rubric mitigation still
|
|
13
|
+
// applies there.
|
|
14
|
+
//
|
|
15
|
+
// Measured on a mixed fixture (prose, cards, 60-row table, an 1800px chart):
|
|
16
|
+
// hard-atom slices per page dropped 9 → 1 on desktop and 4 → 2 on mobile at
|
|
17
|
+
// an unchanged tile count, with every band height within [50%, 100%] of the
|
|
18
|
+
// budget. The remaining slice was inside the over-tall chart, where no clean
|
|
19
|
+
// cut exists — exactly the case the dirty-seam fallback covers.
|
|
20
|
+
//
|
|
21
|
+
// Pure math, no DOM access: atoms come in as plain rect spans so the module
|
|
22
|
+
// stays testable and portable. Atom extraction lives on the browser client.
|
|
23
|
+
|
|
24
|
+
export interface VisualAtom {
|
|
25
|
+
/** hard: cutting through it visibly breaks content. soft: looks untidy. */
|
|
26
|
+
kind: "text-line" | "replaced" | "box";
|
|
27
|
+
/** Document-space vertical span (CSS px scaled to image px by the caller). */
|
|
28
|
+
top: number;
|
|
29
|
+
bottom: number;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface SnapSeam {
|
|
33
|
+
/** Document-space y of the cut. */
|
|
34
|
+
y: number;
|
|
35
|
+
/** Weighted atoms the cut passes through; 0 = clean. */
|
|
36
|
+
cost: number;
|
|
37
|
+
/** Hard atoms (text lines, replaced elements) the cut passes through. */
|
|
38
|
+
hard: number;
|
|
39
|
+
clean: boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface SnapOptions {
|
|
43
|
+
bandHeight: number;
|
|
44
|
+
/** Overlap applied below a dirty seam (the legacy constant, e.g. 120). */
|
|
45
|
+
overlap: number;
|
|
46
|
+
/** Overlap applied below a clean seam. Default 16. */
|
|
47
|
+
cleanOverlap?: number;
|
|
48
|
+
/** Fraction of bandHeight the seam may move up from its target. Default 0.3. */
|
|
49
|
+
slackRatio?: number;
|
|
50
|
+
/** Minimum band height as a fraction of bandHeight. Default 0.5. */
|
|
51
|
+
minBandRatio?: number;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const HARD_WEIGHT = 10;
|
|
55
|
+
const SOFT_WEIGHT = 1;
|
|
56
|
+
const EDGE_MARGIN = 4; // grazing an atom edge this closely counts as crossing
|
|
57
|
+
const CANDIDATE_STEP = 2; // px between scored cut candidates
|
|
58
|
+
|
|
59
|
+
/** Weighted cost of a horizontal cut at document-space y. */
|
|
60
|
+
export function cutCost(atoms: VisualAtom[], y: number): { cost: number; hard: number } {
|
|
61
|
+
let cost = 0;
|
|
62
|
+
let hard = 0;
|
|
63
|
+
for (const a of atoms) {
|
|
64
|
+
if (y > a.top - EDGE_MARGIN && y < a.bottom + EDGE_MARGIN) {
|
|
65
|
+
if (a.kind === "box") {
|
|
66
|
+
cost += SOFT_WEIGHT;
|
|
67
|
+
} else {
|
|
68
|
+
cost += HARD_WEIGHT;
|
|
69
|
+
hard++;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return { cost, hard };
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Cut the vertical span [top, bottom) into bands whose seams snap into
|
|
78
|
+
* content gaps. Seams only move UP from their fixed target (never down), so
|
|
79
|
+
* band height is bounded by `bandHeight` above and `minBandRatio` below.
|
|
80
|
+
* Returns full-width rects in the caller's coordinate space plus the seam
|
|
81
|
+
* record for logging/telemetry.
|
|
82
|
+
*/
|
|
83
|
+
export function snappedBandRects(
|
|
84
|
+
top: number,
|
|
85
|
+
bottom: number,
|
|
86
|
+
x: number,
|
|
87
|
+
width: number,
|
|
88
|
+
atoms: VisualAtom[],
|
|
89
|
+
opts: SnapOptions,
|
|
90
|
+
): {
|
|
91
|
+
rects: Array<{ index: number; x: number; y: number; width: number; height: number }>;
|
|
92
|
+
seams: SnapSeam[];
|
|
93
|
+
} {
|
|
94
|
+
const rects: Array<{ index: number; x: number; y: number; width: number; height: number }> = [];
|
|
95
|
+
const seams: SnapSeam[] = [];
|
|
96
|
+
const span = bottom - top;
|
|
97
|
+
if (span <= 0 || width <= 0) return { rects, seams };
|
|
98
|
+
|
|
99
|
+
const cleanOverlap = opts.cleanOverlap ?? 16;
|
|
100
|
+
const slack = Math.round(opts.bandHeight * (opts.slackRatio ?? 0.3));
|
|
101
|
+
const minBand = Math.round(opts.bandHeight * (opts.minBandRatio ?? 0.5));
|
|
102
|
+
|
|
103
|
+
let bandTop = top;
|
|
104
|
+
let index = 0;
|
|
105
|
+
while (bandTop + opts.bandHeight < bottom) {
|
|
106
|
+
const target = bandTop + opts.bandHeight;
|
|
107
|
+
const lo = Math.max(bandTop + minBand, target - slack);
|
|
108
|
+
|
|
109
|
+
// Score candidates, find the minimal cost in the window.
|
|
110
|
+
const costs: Array<{ y: number; cost: number; hard: number }> = [];
|
|
111
|
+
let minCost = Number.POSITIVE_INFINITY;
|
|
112
|
+
for (let y = lo; y <= target; y += CANDIDATE_STEP) {
|
|
113
|
+
const c = cutCost(atoms, y);
|
|
114
|
+
costs.push({ y, ...c });
|
|
115
|
+
if (c.cost < minCost) minCost = c.cost;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// Snap to the center of the widest minimal-cost run; ties resolve toward
|
|
119
|
+
// the target (later run wins on >=) so bands stay as tall as possible.
|
|
120
|
+
let runStart = -1;
|
|
121
|
+
let best = { start: 0, end: costs.length - 1, len: 0 };
|
|
122
|
+
for (let i = 0; i <= costs.length; i++) {
|
|
123
|
+
const inRun = i < costs.length && costs[i].cost === minCost;
|
|
124
|
+
if (inRun && runStart === -1) runStart = i;
|
|
125
|
+
if (!inRun && runStart !== -1) {
|
|
126
|
+
const len = i - runStart;
|
|
127
|
+
if (len >= best.len) best = { start: runStart, end: i - 1, len };
|
|
128
|
+
runStart = -1;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
const pick = costs[Math.floor((best.start + best.end) / 2)];
|
|
132
|
+
const clean = pick.cost === 0;
|
|
133
|
+
seams.push({ y: pick.y, cost: pick.cost, hard: pick.hard, clean });
|
|
134
|
+
rects.push({ index, x, y: bandTop, width, height: pick.y - bandTop });
|
|
135
|
+
index++;
|
|
136
|
+
bandTop = pick.y - (clean ? cleanOverlap : opts.overlap);
|
|
137
|
+
}
|
|
138
|
+
rects.push({ index, x, y: bandTop, width, height: bottom - bandTop });
|
|
139
|
+
return { rects, seams };
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Split one element rect into internally-banded sub-rects when it is taller
|
|
144
|
+
* than the band budget. Selector-mode tiles previously shipped over-tall
|
|
145
|
+
* elements as one giant tile that the vision provider downscales; banding
|
|
146
|
+
* inside the element keeps every sub-tile at full resolution. Elements within
|
|
147
|
+
* 1.25x of the budget stay whole — a slightly-over tile beats a degenerate
|
|
148
|
+
* split.
|
|
149
|
+
*/
|
|
150
|
+
export function bandOversizedRect(
|
|
151
|
+
rect: { label: string; x: number; y: number; width: number; height: number },
|
|
152
|
+
atoms: VisualAtom[],
|
|
153
|
+
opts: SnapOptions,
|
|
154
|
+
): Array<{ label: string; x: number; y: number; width: number; height: number }> {
|
|
155
|
+
if (rect.height <= opts.bandHeight * 1.25) return [rect];
|
|
156
|
+
const { rects } = snappedBandRects(rect.y, rect.y + rect.height, rect.x, rect.width, atoms, opts);
|
|
157
|
+
return rects.map((r, i) => ({
|
|
158
|
+
label: `${rect.label} (${i + 1}/${rects.length})`,
|
|
159
|
+
x: r.x,
|
|
160
|
+
y: r.y,
|
|
161
|
+
width: r.width,
|
|
162
|
+
height: r.height,
|
|
163
|
+
}));
|
|
164
|
+
}
|
package/src/lib/context/index.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { existsSync
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
2
|
import { resolve } from "node:path";
|
|
3
|
+
import { monorepoRoot, resolveOwner } from "../../core/agents/index.ts";
|
|
3
4
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
resolveOwner,
|
|
8
|
-
} from "../../core/agents/index.ts";
|
|
5
|
+
readLiveCoordinationRow,
|
|
6
|
+
readLiveCoordinationRows,
|
|
7
|
+
} from "../../core/agents/state/live-coordination-view.ts";
|
|
9
8
|
import { exec } from "../exec.ts";
|
|
10
9
|
import { NO_DATA } from "../format.ts";
|
|
11
10
|
|
|
@@ -78,8 +77,6 @@ export interface SelfSection {
|
|
|
78
77
|
instance_id: string;
|
|
79
78
|
session_age_secs: number;
|
|
80
79
|
task: string | null;
|
|
81
|
-
last_tool: string | null;
|
|
82
|
-
last_tool_target: string | null;
|
|
83
80
|
files_held: string[];
|
|
84
81
|
}
|
|
85
82
|
|
|
@@ -113,7 +110,6 @@ export interface PeersSection {
|
|
|
113
110
|
instance_id_short: string;
|
|
114
111
|
age_min: number;
|
|
115
112
|
files: number;
|
|
116
|
-
last_tool: string | null;
|
|
117
113
|
task: string | null;
|
|
118
114
|
}[];
|
|
119
115
|
}
|
|
@@ -155,19 +151,14 @@ export async function buildContext(opts: ContextOptions = {}): Promise<ContextRe
|
|
|
155
151
|
function buildSelf(): SelfSection {
|
|
156
152
|
const owner = resolveOwner();
|
|
157
153
|
if (!owner) throw new Error("not in an agent session (no pid-map entry)");
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
//
|
|
161
|
-
//
|
|
162
|
-
// heartbeat no reader ever resolves — so the session still looks unhealable
|
|
163
|
-
// and now has a junk file shadowing it. Same rule as `noHeartbeatMessage` in
|
|
164
|
-
// the agents command.
|
|
154
|
+
const root = monorepoRoot();
|
|
155
|
+
const hb = root ? readLiveCoordinationRow(root, owner) : null;
|
|
156
|
+
// Full id, never abbreviated: command surfaces pass this identity back to
|
|
157
|
+
// the authority-safe V3 coordination projection.
|
|
165
158
|
if (!hb) {
|
|
166
|
-
throw new Error(
|
|
167
|
-
`pid-map resolved owner=${owner} but no heartbeat exists at .harnery/active/${owner}.json`,
|
|
168
|
-
);
|
|
159
|
+
throw new Error(`pid-map resolved owner=${owner} but no live V3 generation exists for it`);
|
|
169
160
|
}
|
|
170
|
-
const startedMs = Date.parse(hb.started_at);
|
|
161
|
+
const startedMs = Date.parse(hb.started_at ?? "");
|
|
171
162
|
const ageSecs = Number.isFinite(startedMs)
|
|
172
163
|
? Math.max(0, Math.floor((Date.now() - startedMs) / 1000))
|
|
173
164
|
: 0;
|
|
@@ -176,8 +167,6 @@ function buildSelf(): SelfSection {
|
|
|
176
167
|
instance_id: hb.instance_id,
|
|
177
168
|
session_age_secs: ageSecs,
|
|
178
169
|
task: hb.task ?? null,
|
|
179
|
-
last_tool: hb.last_tool ?? null,
|
|
180
|
-
last_tool_target: hb.last_tool_target ?? null,
|
|
181
170
|
files_held: hb.files_touched ?? [],
|
|
182
171
|
};
|
|
183
172
|
}
|
|
@@ -296,32 +285,19 @@ async function statusFor(name: string, cwd: string): Promise<SubmoduleStatus> {
|
|
|
296
285
|
function buildPeers(): PeersSection {
|
|
297
286
|
const root = monorepoRoot();
|
|
298
287
|
if (!root) throw new Error("coord_root() returned null");
|
|
299
|
-
const activeDir = resolve(root, ".harnery", "active");
|
|
300
|
-
if (!existsSync(activeDir)) return { rows: [] };
|
|
301
288
|
const myOwner = resolveOwner();
|
|
302
|
-
// No freshness filter; matches the SessionStart/UserPromptSubmit snapshot.
|
|
303
|
-
// Stale entries get swept by the SessionStart janitor on the next session start.
|
|
304
289
|
const rows: PeersSection["rows"] = [];
|
|
305
|
-
for (const
|
|
306
|
-
if (
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
instance_id_short: hb.instance_id.slice(0, 8),
|
|
317
|
-
age_min: ageMin,
|
|
318
|
-
files: hb.files_touched?.length ?? 0,
|
|
319
|
-
last_tool: hb.last_tool ?? null,
|
|
320
|
-
task: hb.task ?? null,
|
|
321
|
-
});
|
|
322
|
-
} catch {
|
|
323
|
-
// skip
|
|
324
|
-
}
|
|
290
|
+
for (const row of readLiveCoordinationRows(root)) {
|
|
291
|
+
if (row.instance_id === myOwner || row.kind === "transient") continue;
|
|
292
|
+
const startedMs = Date.parse(row.started_at ?? row.last_heartbeat);
|
|
293
|
+
const ageMin = Number.isFinite(startedMs) ? Math.floor((Date.now() - startedMs) / 60000) : 0;
|
|
294
|
+
rows.push({
|
|
295
|
+
name: row.name ?? "unknown",
|
|
296
|
+
instance_id_short: row.instance_id.slice(0, 8),
|
|
297
|
+
age_min: ageMin,
|
|
298
|
+
files: row.files_touched.length,
|
|
299
|
+
task: row.task ?? null,
|
|
300
|
+
});
|
|
325
301
|
}
|
|
326
302
|
// Sort: file-holders first (more activity), then by recency (younger age first).
|
|
327
303
|
rows.sort((a, b) => b.files - a.files || a.age_min - b.age_min);
|
package/src/lib/council/index.ts
CHANGED
|
@@ -19,6 +19,7 @@ import {
|
|
|
19
19
|
import { basename, resolve } from "node:path";
|
|
20
20
|
|
|
21
21
|
import { monorepoRoot } from "../../core/agents/index.ts";
|
|
22
|
+
import { readLiveCoordinationRows } from "../../core/agents/state/live-coordination-view.ts";
|
|
22
23
|
import { resolveBinName } from "../../core/config.ts";
|
|
23
24
|
import { ensureIdentity, lookupById as lookupIdentityById } from "../identities/index.js";
|
|
24
25
|
|
|
@@ -241,7 +242,7 @@ export function setCouncilSteward(councilId: string, steward: string | null): Co
|
|
|
241
242
|
export interface KnownAgent {
|
|
242
243
|
/** `agent-<Name>` canonical handle. */
|
|
243
244
|
name: string;
|
|
244
|
-
/** `active` = currently has
|
|
245
|
+
/** `active` = currently has an authority-eligible V3 generation. `stale` =
|
|
245
246
|
* recently ended (journal archived within the lookback window). */
|
|
246
247
|
state: "active" | "stale";
|
|
247
248
|
/** ISO timestamp of the most-recent signal. */
|
|
@@ -253,35 +254,22 @@ export interface KnownAgent {
|
|
|
253
254
|
const KNOWN_AGENT_STALE_WINDOW_MS = 30 * 24 * 60 * 60 * 1000;
|
|
254
255
|
|
|
255
256
|
/**
|
|
256
|
-
* Active
|
|
257
|
+
* Active V3 generations + recently-archived journals, deduped by name.
|
|
257
258
|
* Used by `agents council set-steward` to refuse arbitrary names;
|
|
258
259
|
* pass `--allow-unknown` to bypass when bootstrapping a new agent.
|
|
259
260
|
*/
|
|
260
261
|
export function listKnownAgents(): KnownAgent[] {
|
|
261
262
|
const root = monorepoRoot();
|
|
262
263
|
if (!root) return [];
|
|
263
|
-
const activeDir = resolve(root, ".harnery", "active");
|
|
264
264
|
const archiveDir = resolve(root, ".harnery", "journal", "archived");
|
|
265
265
|
const byName = new Map<string, KnownAgent>();
|
|
266
266
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
last_heartbeat?: string;
|
|
274
|
-
};
|
|
275
|
-
if (!hb.name) continue;
|
|
276
|
-
const name = hb.name.startsWith("agent-") ? hb.name : `agent-${hb.name}`;
|
|
277
|
-
const last_seen = hb.last_heartbeat ?? new Date().toISOString();
|
|
278
|
-
const existing = byName.get(name);
|
|
279
|
-
if (existing?.state !== "active") {
|
|
280
|
-
byName.set(name, { name, state: "active", last_seen });
|
|
281
|
-
}
|
|
282
|
-
} catch {
|
|
283
|
-
/* skip unreadable */
|
|
284
|
-
}
|
|
267
|
+
for (const row of readLiveCoordinationRows(root)) {
|
|
268
|
+
if (!row.name) continue;
|
|
269
|
+
const name = row.name.startsWith("agent-") ? row.name : `agent-${row.name}`;
|
|
270
|
+
const existing = byName.get(name);
|
|
271
|
+
if (existing?.state !== "active") {
|
|
272
|
+
byName.set(name, { name, state: "active", last_seen: row.last_heartbeat });
|
|
285
273
|
}
|
|
286
274
|
}
|
|
287
275
|
|
|
@@ -45,85 +45,12 @@ export function parseFrontmatter(text: string): ParsedFrontmatter {
|
|
|
45
45
|
return { data, body: text.slice(m[0].length), raw: m[1]! };
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
/**
|
|
49
|
-
* Kind-independent token normalization (spacing / casing / punctuation
|
|
50
|
-
* variants). Kind-specific collapses (done -> shipped vs resolved) are applied
|
|
51
|
-
* in `normalizeStatus`.
|
|
52
|
-
*/
|
|
53
|
-
const GENERIC_NORMALIZE: Record<string, string> = {
|
|
54
|
-
in_progress: "in-progress",
|
|
55
|
-
inprogress: "in-progress",
|
|
56
|
-
"in progress": "in-progress",
|
|
57
|
-
"in-progress": "in-progress",
|
|
58
|
-
wip: "in-progress",
|
|
59
|
-
"wont-fix": "wontfix",
|
|
60
|
-
wontfix: "wontfix",
|
|
61
|
-
proposed: "proposed",
|
|
62
|
-
abandoned: "abandoned",
|
|
63
|
-
open: "open",
|
|
64
|
-
resolved: "resolved",
|
|
65
|
-
shipped: "shipped",
|
|
66
|
-
};
|
|
67
|
-
|
|
68
|
-
// "done"-family tokens collapse to different canonical values per kind.
|
|
69
|
-
const DONE_FAMILY = new Set(["done", "complete", "completed", "finished"]);
|
|
70
|
-
const KIND_NORMALIZE: Record<DocKind, Record<string, string>> = {
|
|
71
|
-
plan: {
|
|
72
|
-
planning: "proposed",
|
|
73
|
-
draft: "proposed",
|
|
74
|
-
approved: "proposed",
|
|
75
|
-
plan: "proposed",
|
|
76
|
-
open: "proposed",
|
|
77
|
-
deferred: "proposed",
|
|
78
|
-
implemented: "shipped",
|
|
79
|
-
resolved: "shipped",
|
|
80
|
-
fixed: "shipped",
|
|
81
|
-
archived: "shipped",
|
|
82
|
-
shelved: "abandoned",
|
|
83
|
-
},
|
|
84
|
-
issue: {
|
|
85
|
-
"in progress": "open",
|
|
86
|
-
in_progress: "open",
|
|
87
|
-
"in-progress": "open",
|
|
88
|
-
blocked: "open",
|
|
89
|
-
mitigated: "open",
|
|
90
|
-
fixed: "resolved",
|
|
91
|
-
shipped: "resolved",
|
|
92
|
-
},
|
|
93
|
-
handoff: {
|
|
94
|
-
"in progress": "open",
|
|
95
|
-
in_progress: "open",
|
|
96
|
-
"in-progress": "open",
|
|
97
|
-
blocked: "open",
|
|
98
|
-
fixed: "resolved",
|
|
99
|
-
shipped: "resolved",
|
|
100
|
-
},
|
|
101
|
-
};
|
|
102
48
|
const ALLOWED_BY_KIND: Record<DocKind, ReadonlySet<string>> = {
|
|
103
49
|
plan: new Set(["proposed", "in-progress", "shipped", "abandoned"]),
|
|
104
50
|
issue: new Set(["open", "resolved", "wontfix"]),
|
|
105
51
|
handoff: new Set(["open", "resolved", "abandoned"]),
|
|
106
52
|
};
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Normalize a raw status token to the canonical enum for its kind.
|
|
111
|
-
* Returns null when the token can't be mapped (caller may fail loud).
|
|
112
|
-
*/
|
|
113
|
-
export function normalizeStatus(raw: string, kind?: DocKind): string | null {
|
|
114
|
-
const t = raw.trim().toLowerCase();
|
|
115
|
-
if (!t) return null;
|
|
116
|
-
if (DONE_FAMILY.has(t)) {
|
|
117
|
-
// plans ship; issues/handoffs resolve. Default to "shipped" when unknown.
|
|
118
|
-
return kind === "issue" || kind === "handoff" ? "resolved" : "shipped";
|
|
119
|
-
}
|
|
120
|
-
const normalized = (kind ? KIND_NORMALIZE[kind][t] : undefined) ?? GENERIC_NORMALIZE[t];
|
|
121
|
-
if (!normalized) return null;
|
|
122
|
-
const allowed = kind ? ALLOWED_BY_KIND[kind] : ALL_CANONICAL;
|
|
123
|
-
return allowed.has(normalized) ? normalized : null;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
/** Read and normalize a doc's YAML lifecycle status, or null when absent/invalid. */
|
|
53
|
+
/** Read a canonical v2 lifecycle status, or null when absent or invalid. */
|
|
127
54
|
export function readDocStatus(filePath: string, kind?: DocKind): string | null {
|
|
128
55
|
let content: string;
|
|
129
56
|
try {
|
|
@@ -137,11 +64,13 @@ export function readDocStatus(filePath: string, kind?: DocKind): string | null {
|
|
|
137
64
|
/** Same as {@link readDocStatus} but from an in-memory string (testable). */
|
|
138
65
|
export function readDocStatusFromText(content: string, kind?: DocKind): string | null {
|
|
139
66
|
const { data } = parseFrontmatter(content);
|
|
140
|
-
|
|
141
|
-
if (
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
return
|
|
67
|
+
if (data.schema !== "harnery-doc/v2") return null;
|
|
68
|
+
if (kind && data.type !== kind) return null;
|
|
69
|
+
if (typeof data.status !== "string") return null;
|
|
70
|
+
if (kind) return ALLOWED_BY_KIND[kind].has(data.status) ? data.status : null;
|
|
71
|
+
return Object.values(ALLOWED_BY_KIND).some((allowed) => allowed.has(data.status as string))
|
|
72
|
+
? data.status
|
|
73
|
+
: null;
|
|
145
74
|
}
|
|
146
75
|
|
|
147
76
|
/** Whether a doc carries a non-empty status in leading YAML frontmatter. */
|
package/src/lib/docs-index.ts
CHANGED
|
@@ -30,6 +30,10 @@ import { readDocStatusFromText } from "./docs-frontmatter.ts";
|
|
|
30
30
|
* Idempotent: safe to run on every commit. Reads the first ~30 lines of
|
|
31
31
|
* each dated file to extract title and (for issues) status.
|
|
32
32
|
*
|
|
33
|
+
* Targets: the host root, every initialized git submodule, and first-level
|
|
34
|
+
* in-tree packages that keep `docs/audits` or `docs/issues` without being
|
|
35
|
+
* git submodules. Marker rules are unchanged.
|
|
36
|
+
*
|
|
33
37
|
* Preserves hand-written preambles. The command updates only the section
|
|
34
38
|
* between `<!-- BEGIN INDEX -->` and `<!-- END INDEX -->` markers. If a
|
|
35
39
|
* README exists without markers, the command refuses to overwrite it and
|
|
@@ -165,12 +169,38 @@ function buildNewReadme(kind: "audits" | "issues", body: string): string {
|
|
|
165
169
|
return `${defaultPreamble(kind)}\n${BEGIN_MARKER}\n${body}${END_MARKER}\n`;
|
|
166
170
|
}
|
|
167
171
|
|
|
168
|
-
|
|
169
|
-
|
|
172
|
+
const SKIP_NESTED_DIR_NAMES = new Set(["node_modules", "dist", "target"]);
|
|
173
|
+
|
|
174
|
+
function hasIndexableDocs(path: string): boolean {
|
|
175
|
+
return existsSync(join(path, "docs", "audits")) || existsSync(join(path, "docs", "issues"));
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/** Root + initialized submodules + first-level in-tree packages with docs indexes. */
|
|
179
|
+
export function collectIndexTargets(): { name: string; path: string }[] {
|
|
180
|
+
const byPath = new Map<string, { name: string; path: string }>();
|
|
181
|
+
const add = (name: string, path: string) => {
|
|
182
|
+
byPath.set(path, { name, path });
|
|
183
|
+
};
|
|
184
|
+
add("(root)", REPO_ROOT);
|
|
170
185
|
for (const name of SUBMODULES) {
|
|
171
186
|
if (!isSubmoduleInitialized(name)) continue;
|
|
172
|
-
|
|
187
|
+
add(name, submodulePath(name));
|
|
173
188
|
}
|
|
189
|
+
if (!existsSync(REPO_ROOT)) return [...byPath.values()];
|
|
190
|
+
for (const ent of readdirSync(REPO_ROOT, { withFileTypes: true })) {
|
|
191
|
+
if (!ent.isDirectory() && !ent.isSymbolicLink()) continue;
|
|
192
|
+
if (ent.name.startsWith(".")) continue;
|
|
193
|
+
if (SKIP_NESTED_DIR_NAMES.has(ent.name)) continue;
|
|
194
|
+
if (isSubmoduleInitialized(ent.name)) continue;
|
|
195
|
+
const child = join(REPO_ROOT, ent.name);
|
|
196
|
+
if (!hasIndexableDocs(child)) continue;
|
|
197
|
+
add(ent.name, child);
|
|
198
|
+
}
|
|
199
|
+
return [...byPath.values()];
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export async function runIndex(opts: IndexOpts): Promise<IndexResult[]> {
|
|
203
|
+
const targets = collectIndexTargets();
|
|
174
204
|
|
|
175
205
|
const filter = opts.repo === "." ? "(root)" : opts.repo;
|
|
176
206
|
const filtered = filter ? targets.filter((t) => t.name === filter) : targets;
|
package/src/lib/docs-lint.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { existsSync as __existsSyncForDocs } from "node:fs";
|
|
2
2
|
import { resolve as __resolveForDocs } from "node:path";
|
|
3
3
|
import { hasYamlStatus } from "./docs-frontmatter.ts";
|
|
4
|
+
import { initDocsMetadataAuditContext, runDocsMetadataAudit } from "./docs-metadata-audit.ts";
|
|
4
5
|
import { sh } from "./exec.ts";
|
|
5
6
|
|
|
6
7
|
// Module-level docs context, initialized by initDocsContext() before any
|
|
@@ -22,6 +23,7 @@ export function initDocsContext(opts: {
|
|
|
22
23
|
SUBMODULES = opts.submodules;
|
|
23
24
|
EXTRA_EXCLUDED_PREFIXES = opts.extraExcludedPrefixes ?? [];
|
|
24
25
|
DOCS_ROOT_ALLOWLIST = opts.docsRootAllowlist ?? [];
|
|
26
|
+
initDocsMetadataAuditContext({ repoRoot: opts.repoRoot, submodules: opts.submodules });
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
function submodulePath(name: string): string {
|
|
@@ -380,34 +382,6 @@ function checkChangelogNames(repoName: string, _repoPath: string, files: string[
|
|
|
380
382
|
return violations;
|
|
381
383
|
}
|
|
382
384
|
|
|
383
|
-
/** Plans, issues, and handoffs must carry YAML lifecycle status (content check, slow). */
|
|
384
|
-
function checkStatusHeaders(repoName: string, repoPath: string, files: string[]): Violation[] {
|
|
385
|
-
const violations: Violation[] = [];
|
|
386
|
-
const targetDirs = ["docs/plans/", "docs/issues/", "docs/handoffs/"];
|
|
387
|
-
for (const rel of files) {
|
|
388
|
-
const dirMatch = targetDirs.some((d) => rel.startsWith(d));
|
|
389
|
-
if (!dirMatch) continue;
|
|
390
|
-
const name = basename(rel);
|
|
391
|
-
if (name === "README.md") continue;
|
|
392
|
-
const full = join(repoPath, rel);
|
|
393
|
-
if (!hasStatusHeader(full)) {
|
|
394
|
-
const kind = rel.startsWith("docs/plans/")
|
|
395
|
-
? "plan"
|
|
396
|
-
: rel.startsWith("docs/issues/")
|
|
397
|
-
? "issue"
|
|
398
|
-
: "handoff";
|
|
399
|
-
violations.push({
|
|
400
|
-
severity: "error",
|
|
401
|
-
repo: repoName,
|
|
402
|
-
path: join(repoName === "(root)" ? "" : repoName, rel),
|
|
403
|
-
rule: "missing-status-header",
|
|
404
|
-
message: `${kind} missing status in leading YAML frontmatter`,
|
|
405
|
-
});
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
return violations;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
385
|
/** Intentional monoliths >30KB need a declaration banner */
|
|
412
386
|
function checkMonolithDeclaration(
|
|
413
387
|
repoName: string,
|
|
@@ -462,10 +436,22 @@ export async function runLint(opts: LintOpts): Promise<Violation[]> {
|
|
|
462
436
|
violations.push(...checkChangelogNames(name, path, files));
|
|
463
437
|
|
|
464
438
|
if (!opts.fast) {
|
|
465
|
-
violations.push(...checkStatusHeaders(name, path, files));
|
|
466
439
|
violations.push(...checkMonolithDeclaration(name, path, files));
|
|
467
440
|
}
|
|
468
441
|
}
|
|
469
442
|
|
|
443
|
+
const metadataRows = await runDocsMetadataAudit({ repo: opts.repo });
|
|
444
|
+
for (const row of metadataRows) {
|
|
445
|
+
for (const issue of row.issues.filter((entry) => entry.severity === "error")) {
|
|
446
|
+
violations.push({
|
|
447
|
+
severity: "error",
|
|
448
|
+
repo: row.repo,
|
|
449
|
+
path: row.path,
|
|
450
|
+
rule: `metadata-v2:${issue.code}`,
|
|
451
|
+
message: issue.field ? `${issue.field}: ${issue.message}` : issue.message,
|
|
452
|
+
});
|
|
453
|
+
}
|
|
454
|
+
}
|
|
455
|
+
|
|
470
456
|
return violations;
|
|
471
457
|
}
|