@cluesmith/codev 3.2.3 → 3.3.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/dashboard-dist/assets/index-BZRTEMtH.css +32 -0
- package/dashboard-dist/assets/{index-BZ1x7x1X.js → index-JCbkpAcV.js} +33 -33
- package/dashboard-dist/assets/index-JCbkpAcV.js.map +1 -0
- package/dashboard-dist/index.html +2 -2
- package/dist/agent-farm/cli.d.ts.map +1 -1
- package/dist/agent-farm/cli.js +173 -0
- package/dist/agent-farm/cli.js.map +1 -1
- package/dist/agent-farm/commands/attach.js +2 -2
- package/dist/agent-farm/commands/attach.js.map +1 -1
- package/dist/agent-farm/commands/cleanup.d.ts.map +1 -1
- package/dist/agent-farm/commands/cleanup.js +16 -0
- package/dist/agent-farm/commands/cleanup.js.map +1 -1
- package/dist/agent-farm/commands/inbox.d.ts +42 -0
- package/dist/agent-farm/commands/inbox.d.ts.map +1 -0
- package/dist/agent-farm/commands/inbox.js +129 -0
- package/dist/agent-farm/commands/inbox.js.map +1 -0
- package/dist/agent-farm/commands/interrupt.d.ts +20 -0
- package/dist/agent-farm/commands/interrupt.d.ts.map +1 -0
- package/dist/agent-farm/commands/interrupt.js +65 -0
- package/dist/agent-farm/commands/interrupt.js.map +1 -0
- package/dist/agent-farm/commands/reset/constants.d.ts +52 -0
- package/dist/agent-farm/commands/reset/constants.d.ts.map +1 -0
- package/dist/agent-farm/commands/reset/constants.js +52 -0
- package/dist/agent-farm/commands/reset/constants.js.map +1 -0
- package/dist/agent-farm/commands/reset/context.d.ts +230 -0
- package/dist/agent-farm/commands/reset/context.d.ts.map +1 -0
- package/dist/agent-farm/commands/reset/context.js +428 -0
- package/dist/agent-farm/commands/reset/context.js.map +1 -0
- package/dist/agent-farm/commands/reset/index.d.ts +192 -0
- package/dist/agent-farm/commands/reset/index.d.ts.map +1 -0
- package/dist/agent-farm/commands/reset/index.js +488 -0
- package/dist/agent-farm/commands/reset/index.js.map +1 -0
- package/dist/agent-farm/commands/reset/receipt.d.ts +97 -0
- package/dist/agent-farm/commands/reset/receipt.d.ts.map +1 -0
- package/dist/agent-farm/commands/reset/receipt.js +149 -0
- package/dist/agent-farm/commands/reset/receipt.js.map +1 -0
- package/dist/agent-farm/commands/reset/reorient.d.ts +117 -0
- package/dist/agent-farm/commands/reset/reorient.d.ts.map +1 -0
- package/dist/agent-farm/commands/reset/reorient.js +313 -0
- package/dist/agent-farm/commands/reset/reorient.js.map +1 -0
- package/dist/agent-farm/commands/reset.d.ts +19 -0
- package/dist/agent-farm/commands/reset.d.ts.map +1 -0
- package/dist/agent-farm/commands/reset.js +292 -0
- package/dist/agent-farm/commands/reset.js.map +1 -0
- package/dist/agent-farm/commands/send.d.ts +2 -2
- package/dist/agent-farm/commands/send.d.ts.map +1 -1
- package/dist/agent-farm/commands/send.js +52 -11
- package/dist/agent-farm/commands/send.js.map +1 -1
- package/dist/agent-farm/commands/setup.d.ts +4 -1
- package/dist/agent-farm/commands/setup.d.ts.map +1 -1
- package/dist/agent-farm/commands/setup.js +8 -4
- package/dist/agent-farm/commands/setup.js.map +1 -1
- package/dist/agent-farm/commands/spawn-worktree.d.ts +116 -6
- package/dist/agent-farm/commands/spawn-worktree.d.ts.map +1 -1
- package/dist/agent-farm/commands/spawn-worktree.js +345 -74
- package/dist/agent-farm/commands/spawn-worktree.js.map +1 -1
- package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
- package/dist/agent-farm/commands/spawn.js +13 -1
- package/dist/agent-farm/commands/spawn.js.map +1 -1
- package/dist/agent-farm/commands/status.d.ts.map +1 -1
- package/dist/agent-farm/commands/status.js +105 -9
- package/dist/agent-farm/commands/status.js.map +1 -1
- package/dist/agent-farm/commands/tower-sweep-husks.d.ts +6 -0
- package/dist/agent-farm/commands/tower-sweep-husks.d.ts.map +1 -0
- package/dist/agent-farm/commands/tower-sweep-husks.js +77 -0
- package/dist/agent-farm/commands/tower-sweep-husks.js.map +1 -0
- package/dist/agent-farm/commands/tower.d.ts.map +1 -1
- package/dist/agent-farm/commands/tower.js +34 -0
- package/dist/agent-farm/commands/tower.js.map +1 -1
- package/dist/agent-farm/commands/whoami.d.ts +65 -0
- package/dist/agent-farm/commands/whoami.d.ts.map +1 -0
- package/dist/agent-farm/commands/whoami.js +196 -0
- package/dist/agent-farm/commands/whoami.js.map +1 -0
- package/dist/agent-farm/db/index.d.ts +1 -1
- package/dist/agent-farm/db/index.d.ts.map +1 -1
- package/dist/agent-farm/db/index.js +80 -1
- package/dist/agent-farm/db/index.js.map +1 -1
- package/dist/agent-farm/db/mailbox.d.ts +222 -0
- package/dist/agent-farm/db/mailbox.d.ts.map +1 -0
- package/dist/agent-farm/db/mailbox.js +304 -0
- package/dist/agent-farm/db/mailbox.js.map +1 -0
- package/dist/agent-farm/db/schema.d.ts +1 -1
- package/dist/agent-farm/db/schema.d.ts.map +1 -1
- package/dist/agent-farm/db/schema.js +35 -0
- package/dist/agent-farm/db/schema.js.map +1 -1
- package/dist/agent-farm/db/types.d.ts +45 -0
- package/dist/agent-farm/db/types.d.ts.map +1 -1
- package/dist/agent-farm/db/types.js.map +1 -1
- package/dist/agent-farm/lib/builder-lookup.d.ts +1 -1
- package/dist/agent-farm/lib/builder-lookup.js +2 -2
- package/dist/agent-farm/lib/builder-lookup.js.map +1 -1
- package/dist/agent-farm/lib/reconnect-backoff.d.ts +54 -0
- package/dist/agent-farm/lib/reconnect-backoff.d.ts.map +1 -0
- package/dist/agent-farm/lib/reconnect-backoff.js +47 -0
- package/dist/agent-farm/lib/reconnect-backoff.js.map +1 -0
- package/dist/agent-farm/lib/tower-client.d.ts +16 -6
- package/dist/agent-farm/lib/tower-client.d.ts.map +1 -1
- package/dist/agent-farm/lib/tower-client.js +37 -6
- package/dist/agent-farm/lib/tower-client.js.map +1 -1
- package/dist/agent-farm/lib/tunnel-client.d.ts +69 -1
- package/dist/agent-farm/lib/tunnel-client.d.ts.map +1 -1
- package/dist/agent-farm/lib/tunnel-client.js +218 -27
- package/dist/agent-farm/lib/tunnel-client.js.map +1 -1
- package/dist/agent-farm/servers/architect-session-holder.d.ts +133 -0
- package/dist/agent-farm/servers/architect-session-holder.d.ts.map +1 -0
- package/dist/agent-farm/servers/architect-session-holder.js +268 -0
- package/dist/agent-farm/servers/architect-session-holder.js.map +1 -0
- package/dist/agent-farm/servers/cron-delivery.d.ts +72 -0
- package/dist/agent-farm/servers/cron-delivery.d.ts.map +1 -0
- package/dist/agent-farm/servers/cron-delivery.js +80 -0
- package/dist/agent-farm/servers/cron-delivery.js.map +1 -0
- package/dist/agent-farm/servers/delayed-send.d.ts +85 -0
- package/dist/agent-farm/servers/delayed-send.d.ts.map +1 -0
- package/dist/agent-farm/servers/delayed-send.js +165 -0
- package/dist/agent-farm/servers/delayed-send.js.map +1 -0
- package/dist/agent-farm/servers/gate-profiles.d.ts +67 -0
- package/dist/agent-farm/servers/gate-profiles.d.ts.map +1 -0
- package/dist/agent-farm/servers/gate-profiles.js +113 -0
- package/dist/agent-farm/servers/gate-profiles.js.map +1 -0
- package/dist/agent-farm/servers/mailbox-delivery.d.ts +370 -0
- package/dist/agent-farm/servers/mailbox-delivery.d.ts.map +1 -0
- package/dist/agent-farm/servers/mailbox-delivery.js +617 -0
- package/dist/agent-farm/servers/mailbox-delivery.js.map +1 -0
- package/dist/agent-farm/servers/mailbox-wiring.d.ts +125 -0
- package/dist/agent-farm/servers/mailbox-wiring.d.ts.map +1 -0
- package/dist/agent-farm/servers/mailbox-wiring.js +425 -0
- package/dist/agent-farm/servers/mailbox-wiring.js.map +1 -0
- package/dist/agent-farm/servers/message-write.d.ts +53 -1
- package/dist/agent-farm/servers/message-write.d.ts.map +1 -1
- package/dist/agent-farm/servers/message-write.js +63 -0
- package/dist/agent-farm/servers/message-write.js.map +1 -1
- package/dist/agent-farm/servers/overview.d.ts.map +1 -1
- package/dist/agent-farm/servers/overview.js +23 -4
- package/dist/agent-farm/servers/overview.js.map +1 -1
- package/dist/agent-farm/servers/process-census.d.ts +41 -0
- package/dist/agent-farm/servers/process-census.d.ts.map +1 -0
- package/dist/agent-farm/servers/process-census.js +62 -0
- package/dist/agent-farm/servers/process-census.js.map +1 -0
- package/dist/agent-farm/servers/render-gate.d.ts +141 -0
- package/dist/agent-farm/servers/render-gate.d.ts.map +1 -0
- package/dist/agent-farm/servers/render-gate.js +251 -0
- package/dist/agent-farm/servers/render-gate.js.map +1 -0
- package/dist/agent-farm/servers/session-log-sweep.d.ts +93 -0
- package/dist/agent-farm/servers/session-log-sweep.d.ts.map +1 -0
- package/dist/agent-farm/servers/session-log-sweep.js +165 -0
- package/dist/agent-farm/servers/session-log-sweep.js.map +1 -0
- package/dist/agent-farm/servers/session-submit.d.ts +90 -0
- package/dist/agent-farm/servers/session-submit.d.ts.map +1 -0
- package/dist/agent-farm/servers/session-submit.js +127 -0
- package/dist/agent-farm/servers/session-submit.js.map +1 -0
- package/dist/agent-farm/servers/shellper-husk-sweep.d.ts +87 -0
- package/dist/agent-farm/servers/shellper-husk-sweep.d.ts.map +1 -0
- package/dist/agent-farm/servers/shellper-husk-sweep.js +129 -0
- package/dist/agent-farm/servers/shellper-husk-sweep.js.map +1 -0
- package/dist/agent-farm/servers/tower-cron.d.ts +10 -7
- package/dist/agent-farm/servers/tower-cron.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-cron.js +58 -53
- package/dist/agent-farm/servers/tower-cron.js.map +1 -1
- package/dist/agent-farm/servers/tower-instances.d.ts +14 -2
- package/dist/agent-farm/servers/tower-instances.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-instances.js +128 -19
- package/dist/agent-farm/servers/tower-instances.js.map +1 -1
- package/dist/agent-farm/servers/tower-messages.d.ts +38 -1
- package/dist/agent-farm/servers/tower-messages.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-messages.js +106 -1
- package/dist/agent-farm/servers/tower-messages.js.map +1 -1
- package/dist/agent-farm/servers/tower-routes.d.ts +16 -4
- package/dist/agent-farm/servers/tower-routes.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-routes.js +807 -99
- package/dist/agent-farm/servers/tower-routes.js.map +1 -1
- package/dist/agent-farm/servers/tower-server.js +241 -15
- package/dist/agent-farm/servers/tower-server.js.map +1 -1
- package/dist/agent-farm/servers/tower-terminals.d.ts +17 -2
- package/dist/agent-farm/servers/tower-terminals.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-terminals.js +139 -124
- package/dist/agent-farm/servers/tower-terminals.js.map +1 -1
- package/dist/agent-farm/servers/tower-tunnel.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-tunnel.js +63 -4
- package/dist/agent-farm/servers/tower-tunnel.js.map +1 -1
- package/dist/agent-farm/servers/tower-types.d.ts +2 -1
- package/dist/agent-farm/servers/tower-types.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-utils.d.ts +99 -1
- package/dist/agent-farm/servers/tower-utils.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-utils.js +242 -6
- package/dist/agent-farm/servers/tower-utils.js.map +1 -1
- package/dist/agent-farm/servers/tower-websocket.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-websocket.js +6 -21
- package/dist/agent-farm/servers/tower-websocket.js.map +1 -1
- package/dist/agent-farm/servers/write-queue.d.ts +35 -0
- package/dist/agent-farm/servers/write-queue.d.ts.map +1 -0
- package/dist/agent-farm/servers/write-queue.js +56 -0
- package/dist/agent-farm/servers/write-queue.js.map +1 -0
- package/dist/agent-farm/state.d.ts +6 -1
- package/dist/agent-farm/state.d.ts.map +1 -1
- package/dist/agent-farm/state.js +5 -2
- package/dist/agent-farm/state.js.map +1 -1
- package/dist/agent-farm/types.d.ts +39 -0
- package/dist/agent-farm/types.d.ts.map +1 -1
- package/dist/agent-farm/utils/agent-names.d.ts +2 -2
- package/dist/agent-farm/utils/agent-names.d.ts.map +1 -1
- package/dist/agent-farm/utils/agent-names.js +3 -3
- package/dist/agent-farm/utils/agent-names.js.map +1 -1
- package/dist/agent-farm/utils/architect-name.d.ts +2 -2
- package/dist/agent-farm/utils/architect-name.d.ts.map +1 -1
- package/dist/agent-farm/utils/architect-name.js +3 -3
- package/dist/agent-farm/utils/architect-name.js.map +1 -1
- package/dist/agent-farm/utils/config.d.ts +13 -0
- package/dist/agent-farm/utils/config.d.ts.map +1 -1
- package/dist/agent-farm/utils/config.js +33 -1
- package/dist/agent-farm/utils/config.js.map +1 -1
- package/dist/agent-farm/utils/harness.d.ts +103 -7
- package/dist/agent-farm/utils/harness.d.ts.map +1 -1
- package/dist/agent-farm/utils/harness.js +126 -19
- package/dist/agent-farm/utils/harness.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +6 -32
- package/dist/cli.js.map +1 -1
- package/dist/commands/adopt.d.ts +3 -2
- package/dist/commands/adopt.d.ts.map +1 -1
- package/dist/commands/adopt.js +7 -6
- package/dist/commands/adopt.js.map +1 -1
- package/dist/commands/consult/agy-auth-cache.d.ts +97 -0
- package/dist/commands/consult/agy-auth-cache.d.ts.map +1 -0
- package/dist/commands/consult/agy-auth-cache.js +320 -0
- package/dist/commands/consult/agy-auth-cache.js.map +1 -0
- package/dist/commands/consult/cli-options.d.ts +34 -0
- package/dist/commands/consult/cli-options.d.ts.map +1 -0
- package/dist/commands/consult/cli-options.js +67 -0
- package/dist/commands/consult/cli-options.js.map +1 -0
- package/dist/commands/consult/index.d.ts +56 -2
- package/dist/commands/consult/index.d.ts.map +1 -1
- package/dist/commands/consult/index.js +330 -27
- package/dist/commands/consult/index.js.map +1 -1
- package/dist/commands/consult/metrics.d.ts +42 -0
- package/dist/commands/consult/metrics.d.ts.map +1 -1
- package/dist/commands/consult/metrics.js +129 -9
- package/dist/commands/consult/metrics.js.map +1 -1
- package/dist/commands/doctor.d.ts +28 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +258 -22
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/init.d.ts +3 -2
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +7 -6
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/porch/checks.d.ts +23 -0
- package/dist/commands/porch/checks.d.ts.map +1 -1
- package/dist/commands/porch/checks.js +60 -0
- package/dist/commands/porch/checks.js.map +1 -1
- package/dist/commands/porch/config.d.ts +20 -0
- package/dist/commands/porch/config.d.ts.map +1 -1
- package/dist/commands/porch/config.js +20 -0
- package/dist/commands/porch/config.js.map +1 -1
- package/dist/commands/porch/index.d.ts.map +1 -1
- package/dist/commands/porch/index.js +32 -36
- package/dist/commands/porch/index.js.map +1 -1
- package/dist/commands/porch/next.d.ts.map +1 -1
- package/dist/commands/porch/next.js +2 -41
- package/dist/commands/porch/next.js.map +1 -1
- package/dist/commands/update.d.ts +4 -4
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +9 -11
- package/dist/commands/update.js.map +1 -1
- package/dist/lib/config.d.ts +70 -3
- package/dist/lib/config.d.ts.map +1 -1
- package/dist/lib/config.js +67 -3
- package/dist/lib/config.js.map +1 -1
- package/dist/lib/consult-lanes.d.ts +149 -0
- package/dist/lib/consult-lanes.d.ts.map +1 -0
- package/dist/lib/consult-lanes.js +360 -0
- package/dist/lib/consult-lanes.js.map +1 -0
- package/dist/lib/default-branch.d.ts +1 -1
- package/dist/lib/default-branch.js +1 -1
- package/dist/lib/github.js +1 -1
- package/dist/lib/github.js.map +1 -1
- package/dist/lib/gitignore.d.ts +25 -2
- package/dist/lib/gitignore.d.ts.map +1 -1
- package/dist/lib/gitignore.js +70 -0
- package/dist/lib/gitignore.js.map +1 -1
- package/dist/lib/migration-backup-audit.d.ts +64 -0
- package/dist/lib/migration-backup-audit.d.ts.map +1 -0
- package/dist/lib/migration-backup-audit.js +145 -0
- package/dist/lib/migration-backup-audit.js.map +1 -0
- package/dist/lib/prompt-behavior-metrics.d.ts +67 -0
- package/dist/lib/prompt-behavior-metrics.d.ts.map +1 -0
- package/dist/lib/prompt-behavior-metrics.js +290 -0
- package/dist/lib/prompt-behavior-metrics.js.map +1 -0
- package/dist/lib/protocol-drift-audit.d.ts +118 -0
- package/dist/lib/protocol-drift-audit.d.ts.map +1 -0
- package/dist/lib/protocol-drift-audit.js +217 -0
- package/dist/lib/protocol-drift-audit.js.map +1 -0
- package/dist/lib/scaffold.d.ts +10 -3
- package/dist/lib/scaffold.d.ts.map +1 -1
- package/dist/lib/scaffold.js +29 -26
- package/dist/lib/scaffold.js.map +1 -1
- package/dist/lib/skeleton.d.ts +22 -1
- package/dist/lib/skeleton.d.ts.map +1 -1
- package/dist/lib/skeleton.js +120 -0
- package/dist/lib/skeleton.js.map +1 -1
- package/dist/lib/test-env.d.ts +74 -0
- package/dist/lib/test-env.d.ts.map +1 -0
- package/dist/lib/test-env.js +92 -0
- package/dist/lib/test-env.js.map +1 -0
- package/dist/terminal/pty-manager.d.ts +9 -0
- package/dist/terminal/pty-manager.d.ts.map +1 -1
- package/dist/terminal/pty-manager.js +32 -6
- package/dist/terminal/pty-manager.js.map +1 -1
- package/dist/terminal/pty-session.d.ts +156 -4
- package/dist/terminal/pty-session.d.ts.map +1 -1
- package/dist/terminal/pty-session.js +307 -42
- package/dist/terminal/pty-session.js.map +1 -1
- package/dist/terminal/ring-buffer.d.ts +39 -6
- package/dist/terminal/ring-buffer.d.ts.map +1 -1
- package/dist/terminal/ring-buffer.js +74 -6
- package/dist/terminal/ring-buffer.js.map +1 -1
- package/dist/terminal/session-manager.d.ts +129 -0
- package/dist/terminal/session-manager.d.ts.map +1 -1
- package/dist/terminal/session-manager.js +337 -44
- package/dist/terminal/session-manager.js.map +1 -1
- package/dist/terminal/session-screen.d.ts +91 -0
- package/dist/terminal/session-screen.d.ts.map +1 -0
- package/dist/terminal/session-screen.js +135 -0
- package/dist/terminal/session-screen.js.map +1 -0
- package/dist/terminal/shellper-client.d.ts +19 -4
- package/dist/terminal/shellper-client.d.ts.map +1 -1
- package/dist/terminal/shellper-client.js +70 -8
- package/dist/terminal/shellper-client.js.map +1 -1
- package/dist/terminal/shellper-main.js +2 -1
- package/dist/terminal/shellper-main.js.map +1 -1
- package/dist/terminal/shellper-process.d.ts +1 -1
- package/dist/terminal/shellper-process.d.ts.map +1 -1
- package/dist/terminal/shellper-process.js +33 -9
- package/dist/terminal/shellper-process.js.map +1 -1
- package/dist/terminal/shellper-protocol.d.ts +40 -2
- package/dist/terminal/shellper-protocol.d.ts.map +1 -1
- package/dist/terminal/shellper-protocol.js +72 -5
- package/dist/terminal/shellper-protocol.js.map +1 -1
- package/dist/terminal/shellper-replay-buffer.d.ts +69 -7
- package/dist/terminal/shellper-replay-buffer.d.ts.map +1 -1
- package/dist/terminal/shellper-replay-buffer.js +167 -31
- package/dist/terminal/shellper-replay-buffer.js.map +1 -1
- package/package.json +11 -9
- package/skeleton/.claude/skills/afx/SKILL.md +27 -1
- package/skeleton/.claude/skills/arch-init/SKILL.md +135 -0
- package/skeleton/.claude/skills/arch-save/SKILL.md +183 -0
- package/skeleton/.claude/skills/codev/SKILL.md +33 -2
- package/skeleton/.claude/skills/runnable-worktrees/SKILL.md +119 -0
- package/skeleton/.codex/skills/afx/SKILL.md +170 -0
- package/skeleton/.codex/skills/arch-init/SKILL.md +135 -0
- package/skeleton/.codex/skills/arch-save/SKILL.md +183 -0
- package/skeleton/.codex/skills/codev/SKILL.md +90 -0
- package/skeleton/.codex/skills/consult/SKILL.md +96 -0
- package/skeleton/.codex/skills/generate-image/SKILL.md +45 -0
- package/skeleton/.codex/skills/porch/SKILL.md +60 -0
- package/skeleton/.codex/skills/runnable-worktrees/SKILL.md +119 -0
- package/skeleton/.codex/skills/update-arch-docs/SKILL.md +132 -0
- package/skeleton/protocols/air/builder-prompt.md +28 -47
- package/skeleton/protocols/air/consult-types/impl-review.md +17 -34
- package/skeleton/protocols/air/consult-types/pr-review.md +14 -37
- package/skeleton/protocols/air/prompts/implement.md +20 -73
- package/skeleton/protocols/air/prompts/pr.md +22 -54
- package/skeleton/protocols/air/protocol.md +40 -71
- package/skeleton/protocols/aspir/builder-prompt.md +29 -66
- package/skeleton/protocols/aspir/consult-types/impl-review.md +17 -44
- package/skeleton/protocols/aspir/consult-types/phase-review.md +17 -44
- package/skeleton/protocols/aspir/consult-types/plan-review.md +14 -38
- package/skeleton/protocols/aspir/consult-types/pr-review.md +13 -39
- package/skeleton/protocols/aspir/consult-types/spec-review.md +13 -33
- package/skeleton/protocols/aspir/prompts/implement.md +27 -196
- package/skeleton/protocols/aspir/prompts/plan.md +21 -85
- package/skeleton/protocols/aspir/prompts/review.md +29 -228
- package/skeleton/protocols/aspir/prompts/specify.md +25 -111
- package/skeleton/protocols/aspir/protocol.json +10 -0
- package/skeleton/protocols/aspir/protocol.md +36 -82
- package/skeleton/protocols/bugfix/builder-prompt.md +23 -45
- package/skeleton/protocols/bugfix/consult-types/impl-review.md +21 -45
- package/skeleton/protocols/bugfix/consult-types/pr-review.md +18 -52
- package/skeleton/protocols/bugfix/prompts/fix.md +16 -61
- package/skeleton/protocols/bugfix/prompts/investigate.md +18 -62
- package/skeleton/protocols/bugfix/prompts/pr.md +22 -57
- package/skeleton/protocols/bugfix/protocol.md +44 -50
- package/skeleton/protocols/experiment/builder-prompt.md +25 -58
- package/skeleton/protocols/experiment/protocol.md +22 -188
- package/skeleton/protocols/experiment/templates/notes.md +11 -71
- package/skeleton/protocols/maintain/builder-prompt.md +24 -45
- package/skeleton/protocols/maintain/consult-types/impl-review.md +17 -44
- package/skeleton/protocols/maintain/consult-types/pr-review.md +13 -39
- package/skeleton/protocols/maintain/prompts/maintain.md +1 -1
- package/skeleton/protocols/maintain/protocol.md +32 -266
- package/skeleton/protocols/maintain/templates/maintenance-run.md +11 -0
- package/skeleton/protocols/pir/builder-prompt.md +30 -64
- package/skeleton/protocols/pir/consult-types/impl-review.md +17 -50
- package/skeleton/protocols/pir/consult-types/pr-review.md +11 -40
- package/skeleton/protocols/pir/prompts/implement.md +1 -2
- package/skeleton/protocols/pir/prompts/plan.md +0 -3
- package/skeleton/protocols/pir/prompts/review.md +1 -1
- package/skeleton/protocols/pir/protocol.md +54 -177
- package/skeleton/protocols/research/builder-prompt.md +27 -58
- package/skeleton/protocols/research/protocol.md +28 -153
- package/skeleton/protocols/spike/builder-prompt.md +30 -48
- package/skeleton/protocols/spike/protocol.md +24 -107
- package/skeleton/protocols/spike/templates/findings.md +9 -39
- package/skeleton/protocols/spir/builder-prompt.md +33 -62
- package/skeleton/protocols/spir/consult-types/impl-review.md +17 -44
- package/skeleton/protocols/spir/consult-types/phase-review.md +17 -44
- package/skeleton/protocols/spir/consult-types/plan-review.md +14 -38
- package/skeleton/protocols/spir/consult-types/pr-review.md +13 -39
- package/skeleton/protocols/spir/consult-types/spec-review.md +13 -33
- package/skeleton/protocols/spir/prompts/implement.md +26 -195
- package/skeleton/protocols/spir/prompts/plan.md +20 -84
- package/skeleton/protocols/spir/prompts/review.md +28 -227
- package/skeleton/protocols/spir/prompts/specify.md +24 -110
- package/skeleton/protocols/spir/protocol.json +10 -0
- package/skeleton/protocols/spir/protocol.md +84 -633
- package/skeleton/protocols/spir/templates/plan.md +28 -147
- package/skeleton/protocols/spir/templates/review.md +21 -80
- package/skeleton/protocols/spir/templates/spec.md +24 -118
- package/skeleton/resources/commands/agent-farm.md +348 -0
- package/skeleton/resources/commands/codev.md +5 -0
- package/skeleton/resources/commands/consult.md +262 -8
- package/skeleton/resources/commands/overview.md +1 -0
- package/skeleton/roles/architect.md +67 -306
- package/skeleton/roles/builder.md +77 -191
- package/skeleton/templates/AGENTS.md +2 -0
- package/skeleton/templates/CLAUDE.md +2 -0
- package/templates/tower.html +39 -2
- package/dashboard-dist/assets/index-BZ1x7x1X.js.map +0 -1
- package/dashboard-dist/assets/index-DB1KBSNE.css +0 -32
- package/dist/agent-farm/servers/send-buffer.d.ts +0 -59
- package/dist/agent-farm/servers/send-buffer.d.ts.map +0 -1
- package/dist/agent-farm/servers/send-buffer.js +0 -103
- package/dist/agent-farm/servers/send-buffer.js.map +0 -1
- package/skeleton/porch/prompts/defend.md +0 -108
- package/skeleton/porch/prompts/diagnose.md +0 -70
- package/skeleton/porch/prompts/evaluate.md +0 -132
- package/skeleton/porch/prompts/fix.md +0 -59
- package/skeleton/porch/prompts/implement.md +0 -88
- package/skeleton/porch/prompts/plan.md +0 -74
- package/skeleton/porch/prompts/pr.md +0 -84
- package/skeleton/porch/prompts/review.md +0 -249
- package/skeleton/porch/prompts/specify.md +0 -53
- package/skeleton/porch/prompts/test.md +0 -63
- package/skeleton/protocols/aspir/templates/plan.md +0 -184
- package/skeleton/protocols/aspir/templates/review.md +0 -120
- package/skeleton/protocols/aspir/templates/spec.md +0 -154
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* prompt-behavior-metrics.ts — behavioural-impact measurement of prompt changes.
|
|
3
|
+
* Spec 1252, criterion M12 / Appendix D / test T14.
|
|
4
|
+
*
|
|
5
|
+
* Lives in `src/lib/` beside `protocol-drift-audit.ts` and
|
|
6
|
+
* `framework-ref-audit.ts` — same module shape (a measurement library, unit
|
|
7
|
+
* tested), and it needs this package's `js-yaml` dependency, which a root-level
|
|
8
|
+
* `scripts/` file cannot resolve in this pnpm workspace. The runnable entry
|
|
9
|
+
* point is `packages/codev/scripts/measure-prompt-behavior.ts`.
|
|
10
|
+
*
|
|
11
|
+
* ## Why this exists
|
|
12
|
+
*
|
|
13
|
+
* M6 counts words. A word reduction that degrades agent compliance is a loss,
|
|
14
|
+
* and word counts cannot see that. This script measures BEHAVIOUR: how often
|
|
15
|
+
* reviewers demand changes, how many rounds phases take, and whether scar rules
|
|
16
|
+
* are being violated.
|
|
17
|
+
*
|
|
18
|
+
* Run at Phase 1 (before any prompt content changes) to produce the baseline,
|
|
19
|
+
* and again in the post-merge verify phase to compare.
|
|
20
|
+
*
|
|
21
|
+
* ## What is deliberately NOT measured, and why
|
|
22
|
+
*
|
|
23
|
+
* Two metrics were requested and cannot be delivered from committed history.
|
|
24
|
+
* They are omitted rather than faked, because a plausible-looking zero is worse
|
|
25
|
+
* than an absent metric:
|
|
26
|
+
*
|
|
27
|
+
* - GATE REJECTION COUNTS. Across all projects, a gate's `status` only ever
|
|
28
|
+
* takes `approved | complete | in_progress | pending` — there is no
|
|
29
|
+
* `rejected` state — and `requested_at` is a scalar that a re-request
|
|
30
|
+
* OVERWRITES rather than appends to. A rejected-then-approved gate is
|
|
31
|
+
* indistinguishable from a clean first-time approval. (Making this minable
|
|
32
|
+
* would need porch to append gate events; out of scope here.)
|
|
33
|
+
*
|
|
34
|
+
* - HISTORICAL CONSULT TOKENS/COST. Raw consult logs (`codev/projects/*/*.txt`)
|
|
35
|
+
* are gitignored, and `consult stats` is a rolling 30-day machine-local DB.
|
|
36
|
+
* There is no historical series to baseline against, so B5 is captured as a
|
|
37
|
+
* FORWARD snapshot only — advisory, non-deterministic, and excluded from
|
|
38
|
+
* T14's determinism assertion and from every rollback trigger.
|
|
39
|
+
*
|
|
40
|
+
* Usage (from packages/codev):
|
|
41
|
+
* npx tsx scripts/measure-prompt-behavior.ts [repo-root]
|
|
42
|
+
* npx tsx scripts/measure-prompt-behavior.ts --json
|
|
43
|
+
*/
|
|
44
|
+
import * as fs from 'node:fs';
|
|
45
|
+
import * as path from 'node:path';
|
|
46
|
+
import * as yaml from 'js-yaml';
|
|
47
|
+
// ---------------------------------------------------------------------------
|
|
48
|
+
// The eight ratified scar rules (decision D3) and their violation markers.
|
|
49
|
+
//
|
|
50
|
+
// These patterns look for the DANGEROUS COMMAND / ACT, not for the rule text.
|
|
51
|
+
// That is still fuzzy: documentation *about* a rule reads much like a violation
|
|
52
|
+
// of it. Hence excerpts, not just counts — a human adjudicates before the hard
|
|
53
|
+
// rollback trigger fires.
|
|
54
|
+
// ---------------------------------------------------------------------------
|
|
55
|
+
const SCAR_PATTERNS = [
|
|
56
|
+
{ rule: 'git-add-all', re: /\bgit\s+add\s+(-A\b|--all\b|\.(?:\s|$))/ },
|
|
57
|
+
{ rule: 'destroy-worktree', re: /\bgit\s+worktree\s+remove\b|\bgit\s+branch\s+-D\b/ },
|
|
58
|
+
{ rule: 'destructive-git', re: /\bgit\s+(reset\s+--hard|checkout\s+--\s+\.|clean\s+-[a-z]*f|stash\b)/ },
|
|
59
|
+
{ rule: 'auto-approve-gate', re: /auto-?approv\w*/i },
|
|
60
|
+
{ rule: 'hand-edit-status', re: /(hand|manual\w*)[- ]edit\w*\s+status\.yaml|edited?\s+status\.yaml\s+(directly|by hand)/i },
|
|
61
|
+
{ rule: 'afx-from-worktree', re: /\bafx\s+spawn\b[^\n]*\bfrom\s+(inside\s+)?(a\s+)?worktree/i },
|
|
62
|
+
{ rule: 'kill-shellper', re: /kill\w*\s+[^\n]{0,40}shellper/i },
|
|
63
|
+
{ rule: 'restart-tower', re: /\b(restart|stop)\w*\s+tower\b/i },
|
|
64
|
+
];
|
|
65
|
+
/** Phrases indicating the surrounding text DESCRIBES a rule rather than reports a breach. */
|
|
66
|
+
const DOCUMENTATION_MARKERS = /\b(never|do not|don'?t|must not|forbidden|prohibited|avoid|rule|policy|reminder|guard|prevent)\b/i;
|
|
67
|
+
// ---------------------------------------------------------------------------
|
|
68
|
+
// Helpers
|
|
69
|
+
// ---------------------------------------------------------------------------
|
|
70
|
+
function mean(xs) {
|
|
71
|
+
return xs.length ? xs.reduce((a, b) => a + b, 0) / xs.length : 0;
|
|
72
|
+
}
|
|
73
|
+
function median(xs) {
|
|
74
|
+
if (!xs.length)
|
|
75
|
+
return 0;
|
|
76
|
+
const s = [...xs].sort((a, b) => a - b);
|
|
77
|
+
const m = Math.floor(s.length / 2);
|
|
78
|
+
return s.length % 2 ? s[m] : (s[m - 1] + s[m]) / 2;
|
|
79
|
+
}
|
|
80
|
+
function round2(n) {
|
|
81
|
+
return Math.round(n * 100) / 100;
|
|
82
|
+
}
|
|
83
|
+
function walk(dir, pred) {
|
|
84
|
+
if (!fs.existsSync(dir))
|
|
85
|
+
return [];
|
|
86
|
+
const out = [];
|
|
87
|
+
for (const e of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
88
|
+
const p = path.join(dir, e.name);
|
|
89
|
+
if (e.isDirectory())
|
|
90
|
+
out.push(...walk(p, pred));
|
|
91
|
+
else if (pred(p))
|
|
92
|
+
out.push(p);
|
|
93
|
+
}
|
|
94
|
+
return out;
|
|
95
|
+
}
|
|
96
|
+
// ---------------------------------------------------------------------------
|
|
97
|
+
// Metric collection
|
|
98
|
+
// ---------------------------------------------------------------------------
|
|
99
|
+
/**
|
|
100
|
+
* B1/B2/B4 — CMAP verdicts and review rounds.
|
|
101
|
+
*
|
|
102
|
+
* Sample: projects whose `status.yaml` has a non-empty `history`. In practice
|
|
103
|
+
* this is SPIR (and one legacy `spider`) — porch only persists per-plan-phase
|
|
104
|
+
* review history for protocols that loop that way, so pir/bugfix/air contribute
|
|
105
|
+
* nothing. Sorted for deterministic output.
|
|
106
|
+
*/
|
|
107
|
+
function collectReviewMetrics(root, excludeProjects, includeProjects) {
|
|
108
|
+
const projDir = path.join(root, 'codev', 'projects');
|
|
109
|
+
const files = fs.existsSync(projDir)
|
|
110
|
+
? fs
|
|
111
|
+
.readdirSync(projDir)
|
|
112
|
+
.filter((d) => (includeProjects ? includeProjects.includes(d) : true))
|
|
113
|
+
.filter((d) => !excludeProjects.includes(d))
|
|
114
|
+
.map((d) => path.join(projDir, d, 'status.yaml'))
|
|
115
|
+
.filter((f) => fs.existsSync(f))
|
|
116
|
+
.sort()
|
|
117
|
+
: [];
|
|
118
|
+
const verdictCounts = {};
|
|
119
|
+
const phaseRounds = [];
|
|
120
|
+
const projectRounds = [];
|
|
121
|
+
const sampleProjects = [];
|
|
122
|
+
for (const f of files) {
|
|
123
|
+
let doc;
|
|
124
|
+
try {
|
|
125
|
+
doc = yaml.load(fs.readFileSync(f, 'utf-8'));
|
|
126
|
+
}
|
|
127
|
+
catch {
|
|
128
|
+
continue; // a malformed status file must not abort the measurement
|
|
129
|
+
}
|
|
130
|
+
const history = doc?.history ?? [];
|
|
131
|
+
if (!history.length)
|
|
132
|
+
continue;
|
|
133
|
+
sampleProjects.push(path.basename(path.dirname(f)));
|
|
134
|
+
const byPhase = new Map();
|
|
135
|
+
for (const item of history) {
|
|
136
|
+
for (const r of item.reviews ?? []) {
|
|
137
|
+
const v = r.verdict ?? 'UNKNOWN';
|
|
138
|
+
verdictCounts[v] = (verdictCounts[v] ?? 0) + 1;
|
|
139
|
+
}
|
|
140
|
+
const ph = item.plan_phase ?? '__none__';
|
|
141
|
+
byPhase.set(ph, Math.max(byPhase.get(ph) ?? 0, item.iteration ?? 0));
|
|
142
|
+
}
|
|
143
|
+
const rounds = [...byPhase.values()];
|
|
144
|
+
phaseRounds.push(...rounds);
|
|
145
|
+
projectRounds.push(rounds.reduce((a, b) => a + b, 0));
|
|
146
|
+
}
|
|
147
|
+
const total = Object.values(verdictCounts).reduce((a, b) => a + b, 0);
|
|
148
|
+
return {
|
|
149
|
+
verdictCounts,
|
|
150
|
+
total,
|
|
151
|
+
rcRate: total ? (verdictCounts['REQUEST_CHANGES'] ?? 0) / total : 0,
|
|
152
|
+
phaseRounds,
|
|
153
|
+
projectRounds,
|
|
154
|
+
sampleProjects: sampleProjects.sort(),
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* B3 — candidate scar-rule violations mined from committed prose.
|
|
159
|
+
*
|
|
160
|
+
* Scans `codev/reviews/*.md` and `codev/state/*_thread.md`. Emits EXCERPTS, not
|
|
161
|
+
* just counts: the mining cannot distinguish "we violated this" from "never do
|
|
162
|
+
* this", so every hit is a candidate requiring human adjudication. Lines that
|
|
163
|
+
* look like rule documentation are filtered out to cut the obvious noise, but
|
|
164
|
+
* the filter is conservative by design — it is better to hand a human a false
|
|
165
|
+
* positive than to silently drop a real breach.
|
|
166
|
+
*/
|
|
167
|
+
function collectScarHits(root, excludeBasenamePrefixes) {
|
|
168
|
+
const excluded = (p) => excludeBasenamePrefixes.some((pre) => path.basename(p).startsWith(pre));
|
|
169
|
+
const targets = [
|
|
170
|
+
...walk(path.join(root, 'codev', 'reviews'), (p) => p.endsWith('.md')),
|
|
171
|
+
...walk(path.join(root, 'codev', 'state'), (p) => p.endsWith('_thread.md')),
|
|
172
|
+
]
|
|
173
|
+
.filter((p) => !excluded(p))
|
|
174
|
+
.sort();
|
|
175
|
+
const hits = [];
|
|
176
|
+
for (const file of targets) {
|
|
177
|
+
const lines = fs.readFileSync(file, 'utf-8').split('\n');
|
|
178
|
+
lines.forEach((line, i) => {
|
|
179
|
+
if (DOCUMENTATION_MARKERS.test(line))
|
|
180
|
+
return; // prescriptive, not a breach report
|
|
181
|
+
for (const { rule, re } of SCAR_PATTERNS) {
|
|
182
|
+
if (re.test(line)) {
|
|
183
|
+
hits.push({
|
|
184
|
+
rule,
|
|
185
|
+
file: path.relative(root, file),
|
|
186
|
+
line: i + 1,
|
|
187
|
+
excerpt: line.trim().slice(0, 200),
|
|
188
|
+
});
|
|
189
|
+
break;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
return { hits, filesScanned: targets.length };
|
|
195
|
+
}
|
|
196
|
+
/** This project's own artifacts — excluded from its own baseline by default. */
|
|
197
|
+
export const SELF_PROJECT_DIR = '1252-prompt-architecture-single-own';
|
|
198
|
+
export const SELF_FILE_PREFIXES = ['spir-1252_', '1252-'];
|
|
199
|
+
/** Collect all behavioural metrics for a repo root. Deterministic over B1–B4. */
|
|
200
|
+
export function measureBehavior(root, opts = {}) {
|
|
201
|
+
const rv = collectReviewMetrics(root, opts.excludeProjects ?? [SELF_PROJECT_DIR], opts.includeProjects);
|
|
202
|
+
const scar = collectScarHits(root, opts.excludeFilePrefixes ?? SELF_FILE_PREFIXES);
|
|
203
|
+
return {
|
|
204
|
+
b1_requestChangesRate: round2(rv.rcRate * 100),
|
|
205
|
+
b1_verdictCounts: rv.verdictCounts,
|
|
206
|
+
b1_totalVerdicts: rv.total,
|
|
207
|
+
b2_roundsPerPhaseMean: round2(mean(rv.phaseRounds)),
|
|
208
|
+
b2_roundsPerPhaseMedian: median(rv.phaseRounds),
|
|
209
|
+
b2_roundsPerPhaseMax: rv.phaseRounds.length ? Math.max(...rv.phaseRounds) : 0,
|
|
210
|
+
b2_phaseCount: rv.phaseRounds.length,
|
|
211
|
+
b3_candidateHits: scar.hits,
|
|
212
|
+
b3_filesScanned: scar.filesScanned,
|
|
213
|
+
b4_roundsPerProjectMean: round2(mean(rv.projectRounds)),
|
|
214
|
+
b4_roundsPerProjectMedian: median(rv.projectRounds),
|
|
215
|
+
b4_projectCount: rv.projectRounds.length,
|
|
216
|
+
sampleProjects: rv.sampleProjects,
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
// ---------------------------------------------------------------------------
|
|
220
|
+
// Rendering
|
|
221
|
+
// ---------------------------------------------------------------------------
|
|
222
|
+
/** Render metrics as the committed markdown baseline artifact. */
|
|
223
|
+
export function render(m) {
|
|
224
|
+
const byRule = new Map();
|
|
225
|
+
for (const h of m.b3_candidateHits)
|
|
226
|
+
byRule.set(h.rule, (byRule.get(h.rule) ?? 0) + 1);
|
|
227
|
+
const lines = [
|
|
228
|
+
'# Behavioural metrics (Spec 1252, M12 / Appendix D)',
|
|
229
|
+
'',
|
|
230
|
+
'## B1 — CMAP verdict distribution',
|
|
231
|
+
'',
|
|
232
|
+
`Total verdicts: **${m.b1_totalVerdicts}** across ${m.b4_projectCount} projects with review history.`,
|
|
233
|
+
'',
|
|
234
|
+
'| Verdict | Count | Share |',
|
|
235
|
+
'|---|---:|---:|',
|
|
236
|
+
...Object.entries(m.b1_verdictCounts)
|
|
237
|
+
.sort((a, b) => b[1] - a[1])
|
|
238
|
+
.map(([v, c]) => `| ${v} | ${c} | ${round2((c / Math.max(m.b1_totalVerdicts, 1)) * 100)}% |`),
|
|
239
|
+
'',
|
|
240
|
+
`**B1 REQUEST_CHANGES rate: ${m.b1_requestChangesRate}%** — the load-bearing metric.`,
|
|
241
|
+
'',
|
|
242
|
+
'## B2 — review rounds per plan phase',
|
|
243
|
+
'',
|
|
244
|
+
`mean **${m.b2_roundsPerPhaseMean}**, median ${m.b2_roundsPerPhaseMedian}, max ${m.b2_roundsPerPhaseMax} (n=${m.b2_phaseCount} phases)`,
|
|
245
|
+
'',
|
|
246
|
+
'> Advisory only. The observed range is too narrow to detect a subtle',
|
|
247
|
+
'> regression. Note also that phases advance on builder *rebuttal*, not on',
|
|
248
|
+
'> unanimous approval — 0 terminal phases in this corpus end with 3x APPROVE —',
|
|
249
|
+
'> so a "rounds to unanimity" metric would never resolve.',
|
|
250
|
+
'',
|
|
251
|
+
'## B4 — review rounds per project',
|
|
252
|
+
'',
|
|
253
|
+
`mean **${m.b4_roundsPerProjectMean}**, median ${m.b4_roundsPerProjectMedian} (n=${m.b4_projectCount} projects). Advisory.`,
|
|
254
|
+
'',
|
|
255
|
+
'## B3 — candidate scar-rule violations',
|
|
256
|
+
'',
|
|
257
|
+
`Scanned **${m.b3_filesScanned}** files (codev/reviews + codev/state threads).`,
|
|
258
|
+
`Candidate hits: **${m.b3_candidateHits.length}**`,
|
|
259
|
+
'',
|
|
260
|
+
'> **These are CANDIDATES, not findings.** Keyword mining cannot distinguish',
|
|
261
|
+
'> "we did this" from "never do this". Every hit requires human adjudication',
|
|
262
|
+
'> before the hard rollback trigger fires. B3 is the metric that matters most —',
|
|
263
|
+
'> it is the only one that would catch a compressed scar rule losing its force.',
|
|
264
|
+
'',
|
|
265
|
+
];
|
|
266
|
+
if (byRule.size) {
|
|
267
|
+
lines.push('| Rule | Candidate hits |', '|---|---:|');
|
|
268
|
+
for (const [r, c] of [...byRule.entries()].sort((a, b) => b[1] - a[1])) {
|
|
269
|
+
lines.push(`| ${r} | ${c} |`);
|
|
270
|
+
}
|
|
271
|
+
lines.push('', '### Excerpts for adjudication', '');
|
|
272
|
+
for (const h of m.b3_candidateHits.slice(0, 50)) {
|
|
273
|
+
lines.push(`- \`${h.file}:${h.line}\` **[${h.rule}]** — ${h.excerpt}`);
|
|
274
|
+
}
|
|
275
|
+
if (m.b3_candidateHits.length > 50) {
|
|
276
|
+
lines.push(`- …and ${m.b3_candidateHits.length - 50} more (see --json for the full list)`);
|
|
277
|
+
}
|
|
278
|
+
lines.push('');
|
|
279
|
+
}
|
|
280
|
+
lines.push('## B5 — consult cost/duration', '', '**Not captured here.** `consult stats` is a rolling 30-day machine-local DB,', 'so it is not reproducible from a commit. Capture it separately as advisory', 'context; it is excluded from T14 determinism and drives no rollback trigger.', '', '## Sample provenance', '', ...m.sampleProjects.map((p) => `- ${p}`), '');
|
|
281
|
+
return lines.join('\n');
|
|
282
|
+
}
|
|
283
|
+
/** CLI entry, invoked by `packages/codev/scripts/measure-prompt-behavior.ts`. */
|
|
284
|
+
export function runCli(argv, cwd) {
|
|
285
|
+
const json = argv.includes('--json');
|
|
286
|
+
const root = argv.find((a) => !a.startsWith('--')) ?? cwd;
|
|
287
|
+
const m = measureBehavior(path.resolve(root));
|
|
288
|
+
return json ? JSON.stringify(m, null, 2) : render(m);
|
|
289
|
+
}
|
|
290
|
+
//# sourceMappingURL=prompt-behavior-metrics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-behavior-metrics.js","sourceRoot":"","sources":["../../src/lib/prompt-behavior-metrics.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,IAAI,MAAM,SAAS,CAAC;AAmDhC,8EAA8E;AAC9E,2EAA2E;AAC3E,EAAE;AACF,8EAA8E;AAC9E,gFAAgF;AAChF,+EAA+E;AAC/E,0BAA0B;AAC1B,8EAA8E;AAE9E,MAAM,aAAa,GAAwC;IACzD,EAAE,IAAI,EAAE,aAAa,EAAE,EAAE,EAAE,yCAAyC,EAAE;IACtE,EAAE,IAAI,EAAE,kBAAkB,EAAE,EAAE,EAAE,mDAAmD,EAAE;IACrF,EAAE,IAAI,EAAE,iBAA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olver
|
|
5
|
+
* (`.codev/` → `codev/` → cache → installed skeleton):
|
|
6
|
+
*
|
|
7
|
+
* 1. **Shadow drift** — a project-local copy (tier-1 `.codev/` or tier-2 `codev/`)
|
|
8
|
+
* of a framework file that ALSO ships in the installed skeleton. The resolver
|
|
9
|
+
* serves the local copy, so a stale snapshot of an old upstream default keeps
|
|
10
|
+
* winning forever, silently, even after the package ships a fix. This audit
|
|
11
|
+
* diffs each local copy against its skeleton counterpart and classifies it:
|
|
12
|
+
* - `identical` → a redundant copy that adds nothing but risk (safe to remove;
|
|
13
|
+
* resolution then falls back to the package).
|
|
14
|
+
* - `differs` → "customized or stale? — adjudicate" (a human must decide;
|
|
15
|
+
* we NEVER auto-act).
|
|
16
|
+
*
|
|
17
|
+
* 2. **Skeleton staleness** — the installed `@cluesmith/codev` package is itself a
|
|
18
|
+
* version behind npm `latest`, so even NON-shadowed resolution serves pre-fix
|
|
19
|
+
* framework files. Reported as an explicit `installed X; latest Y` pair
|
|
20
|
+
* (a computed "N behind" distance is not crisply testable), best-effort and
|
|
21
|
+
* offline-tolerant.
|
|
22
|
+
*
|
|
23
|
+
* Report-only: this module performs NO writes to disk. Adjudication stays human —
|
|
24
|
+
* local copies may be deliberate customizations (that is the resolver's whole point).
|
|
25
|
+
*
|
|
26
|
+
* Mirrors the existing doctor audit precedents: `pr-gate-audit.ts` (#943) and
|
|
27
|
+
* `framework-ref-audit.ts` (#1011) — a pure lib returning findings + formatters,
|
|
28
|
+
* consumed by `commands/doctor.ts`.
|
|
29
|
+
*/
|
|
30
|
+
/**
|
|
31
|
+
* The framework subtrees whose files ship in the skeleton and resolve via the
|
|
32
|
+
* four-tier resolver. Pinned scan set (per the spec) — prompts and per-protocol
|
|
33
|
+
* templates live WITHIN `protocols/`, so they are covered transitively.
|
|
34
|
+
*
|
|
35
|
+
* Maintenance point: a new top-level framework subtree must be added here (same
|
|
36
|
+
* shape as `PR_PRODUCING_PROTOCOLS` in pr-gate-audit). `codev/resources/` is
|
|
37
|
+
* deliberately EXCLUDED — those are user-evolved files (arch.md, lessons-learned.md,
|
|
38
|
+
* and their -critical companions), not framework files, and must never be flagged.
|
|
39
|
+
*/
|
|
40
|
+
export declare const FRAMEWORK_DRIFT_DIRS: readonly ["protocols", "consult-types", "roles"];
|
|
41
|
+
/** The two project-local override roots, in resolver-precedence order (tier 1 first). */
|
|
42
|
+
declare const OVERRIDE_TIERS: readonly [".codev", "codev"];
|
|
43
|
+
export type OverrideTier = (typeof OVERRIDE_TIERS)[number];
|
|
44
|
+
export type DriftStatus = 'identical' | 'differs';
|
|
45
|
+
export interface DriftFinding {
|
|
46
|
+
/** Path relative to the skeleton/override root, e.g. `protocols/spir/protocol.md`. */
|
|
47
|
+
relativePath: string;
|
|
48
|
+
/** Which local override root holds this copy. */
|
|
49
|
+
tier: OverrideTier;
|
|
50
|
+
/** Byte-comparison result against the skeleton counterpart. */
|
|
51
|
+
status: DriftStatus;
|
|
52
|
+
/**
|
|
53
|
+
* Whether the four-tier resolver actually resolves THIS copy (i.e. it is the
|
|
54
|
+
* live one the runtime loads). A tier-2 `codev/` copy shadowed by a tier-1
|
|
55
|
+
* `.codev/` copy is still reported (it is still rot), but marked not-the-winner.
|
|
56
|
+
*/
|
|
57
|
+
isResolvedWinner: boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface StalenessResult {
|
|
60
|
+
/** Installed `@cluesmith/codev` version. */
|
|
61
|
+
installed: string;
|
|
62
|
+
/** npm `latest`, or null when the registry could not be reached. */
|
|
63
|
+
latest: string | null;
|
|
64
|
+
/** True only when a latest version was obtained AND installed < latest. */
|
|
65
|
+
behind: boolean;
|
|
66
|
+
/** Human note when latest could not be determined. */
|
|
67
|
+
note?: string;
|
|
68
|
+
}
|
|
69
|
+
/** Injectable seam for the npm-latest lookup so tests are deterministic (no network). */
|
|
70
|
+
export type FetchLatest = () => string | null;
|
|
71
|
+
/**
|
|
72
|
+
* Audit a project for shadow drift against the installed skeleton.
|
|
73
|
+
*
|
|
74
|
+
* For every framework file in the skeleton (under FRAMEWORK_DRIFT_DIRS), checks
|
|
75
|
+
* whether a local copy exists in `.codev/` and/or `codev/`; for each local copy
|
|
76
|
+
* found, byte-compares it against the skeleton file and records a finding. Returns
|
|
77
|
+
* one finding per local copy (so a file present in BOTH tiers yields two findings).
|
|
78
|
+
*
|
|
79
|
+
* @param workspaceRoot - project root (auto-detected via findWorkspaceRoot if omitted)
|
|
80
|
+
*/
|
|
81
|
+
export declare function auditProtocolDrift(workspaceRoot?: string): DriftFinding[];
|
|
82
|
+
/**
|
|
83
|
+
* Whether the project has ANY local copy of a scanned skeleton file, in EITHER
|
|
84
|
+
* override root. Cheap existence-only scan (no hashing) used for the no-op gate:
|
|
85
|
+
* the existing `hasLocalOverride()` only checks tier-2 `codev/`, so drift detection
|
|
86
|
+
* must check both tiers itself.
|
|
87
|
+
*/
|
|
88
|
+
export declare function hasFrameworkShadows(workspaceRoot?: string): boolean;
|
|
89
|
+
/** Bound on the npm-latest lookup (ms). The registry can't stall doctor beyond this. */
|
|
90
|
+
export declare const NPM_LATEST_TIMEOUT_MS = 2500;
|
|
91
|
+
/**
|
|
92
|
+
* Default npm-latest lookup: `npm view @cluesmith/codev version`. Bounded by
|
|
93
|
+
* `NPM_LATEST_TIMEOUT_MS` (spawnSync kills the child past it) and offline-tolerant —
|
|
94
|
+
* an unreachable registry, non-zero exit, missing `npm`, or unparsable output all
|
|
95
|
+
* yield `null` rather than throwing or hanging. Exported so tests can assert the
|
|
96
|
+
* real bounded/offline behavior (not just an injected stub).
|
|
97
|
+
*/
|
|
98
|
+
export declare function fetchLatestVersion(): string | null;
|
|
99
|
+
/**
|
|
100
|
+
* Compare the installed package version against npm `latest`. Never throws and
|
|
101
|
+
* never hangs beyond the fetch timeout — an unreachable registry yields
|
|
102
|
+
* `{ latest: null, behind: false, note }` so doctor stays usable offline.
|
|
103
|
+
*
|
|
104
|
+
* @param fetchLatest - injectable latest-version source (defaults to `npm view`)
|
|
105
|
+
*/
|
|
106
|
+
export declare function checkSkeletonStaleness(fetchLatest?: FetchLatest): StalenessResult;
|
|
107
|
+
/**
|
|
108
|
+
* Render a shadow-drift finding for doctor output.
|
|
109
|
+
*
|
|
110
|
+
* @param skeletonVersion - installed skeleton/package version; when provided it is
|
|
111
|
+
* named in the line so the human can tell WHICH skeleton the local copy diverged
|
|
112
|
+
* from (the spec requires the adjudication warning to name the package version).
|
|
113
|
+
*/
|
|
114
|
+
export declare function formatDriftFinding(f: DriftFinding, skeletonVersion?: string): string;
|
|
115
|
+
/** Render the staleness result for doctor output. */
|
|
116
|
+
export declare function formatStaleness(s: StalenessResult): string;
|
|
117
|
+
export {};
|
|
118
|
+
//# sourceMappingURL=protocol-drift-audit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol-drift-audit.d.ts","sourceRoot":"","sources":["../../src/lib/protocol-drift-audit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AASH;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,kDAAmD,CAAC;AAKrF,yFAAyF;AACzF,QAAA,MAAM,cAAc,8BAA+B,CAAC;AACpD,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAE3D,MAAM,MAAM,WAAW,GAAG,WAAW,GAAG,SAAS,CAAC;AAElD,MAAM,WAAW,YAAY;IAC3B,sFAAsF;IACtF,YAAY,EAAE,MAAM,CAAC;IACrB,iDAAiD;IACjD,IAAI,EAAE,YAAY,CAAC;IACnB,+DAA+D;IAC/D,MAAM,EAAE,WAAW,CAAC;IACpB;;;;OAIG;IACH,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED,MAAM,WAAW,eAAe;IAC9B,4CAA4C;IAC5C,SAAS,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,2EAA2E;IAC3E,MAAM,EAAE,OAAO,CAAC;IAChB,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,yFAAyF;AACzF,MAAM,MAAM,WAAW,GAAG,MAAM,MAAM,GAAG,IAAI,CAAC;AAkB9C;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,YAAY,EAAE,CAoCzE;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,aAAa,CAAC,EAAE,MAAM,GAAG,OAAO,CAUnE;AAoBD,wFAAwF;AACxF,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAE1C;;;;;;GAMG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,GAAG,IAAI,CAelD;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,GAAE,WAAgC,GAC5C,eAAe,CAYjB;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,YAAY,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAQpF;AAED,qDAAqD;AACrD,wBAAgB,eAAe,CAAC,CAAC,EAAE,eAAe,GAAG,MAAM,CAQ1D"}
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Protocol-file drift audit (#1210).
|
|
3
|
+
*
|
|
4
|
+
* Detects two silent failure modes of the four-tier resolver
|
|
5
|
+
* (`.codev/` → `codev/` → cache → installed skeleton):
|
|
6
|
+
*
|
|
7
|
+
* 1. **Shadow drift** — a project-local copy (tier-1 `.codev/` or tier-2 `codev/`)
|
|
8
|
+
* of a framework file that ALSO ships in the installed skeleton. The resolver
|
|
9
|
+
* serves the local copy, so a stale snapshot of an old upstream default keeps
|
|
10
|
+
* winning forever, silently, even after the package ships a fix. This audit
|
|
11
|
+
* diffs each local copy against its skeleton counterpart and classifies it:
|
|
12
|
+
* - `identical` → a redundant copy that adds nothing but risk (safe to remove;
|
|
13
|
+
* resolution then falls back to the package).
|
|
14
|
+
* - `differs` → "customized or stale? — adjudicate" (a human must decide;
|
|
15
|
+
* we NEVER auto-act).
|
|
16
|
+
*
|
|
17
|
+
* 2. **Skeleton staleness** — the installed `@cluesmith/codev` package is itself a
|
|
18
|
+
* version behind npm `latest`, so even NON-shadowed resolution serves pre-fix
|
|
19
|
+
* framework files. Reported as an explicit `installed X; latest Y` pair
|
|
20
|
+
* (a computed "N behind" distance is not crisply testable), best-effort and
|
|
21
|
+
* offline-tolerant.
|
|
22
|
+
*
|
|
23
|
+
* Report-only: this module performs NO writes to disk. Adjudication stays human —
|
|
24
|
+
* local copies may be deliberate customizations (that is the resolver's whole point).
|
|
25
|
+
*
|
|
26
|
+
* Mirrors the existing doctor audit precedents: `pr-gate-audit.ts` (#943) and
|
|
27
|
+
* `framework-ref-audit.ts` (#1011) — a pure lib returning findings + formatters,
|
|
28
|
+
* consumed by `commands/doctor.ts`.
|
|
29
|
+
*/
|
|
30
|
+
import * as fs from 'node:fs';
|
|
31
|
+
import * as path from 'node:path';
|
|
32
|
+
import { createHash } from 'node:crypto';
|
|
33
|
+
import { spawnSync } from 'node:child_process';
|
|
34
|
+
import { getSkeletonDir, listSkeletonFiles, resolveCodevFile, findWorkspaceRoot } from './skeleton.js';
|
|
35
|
+
import { version as installedVersion } from '../version.js';
|
|
36
|
+
/**
|
|
37
|
+
* The framework subtrees whose files ship in the skeleton and resolve via the
|
|
38
|
+
* four-tier resolver. Pinned scan set (per the spec) — prompts and per-protocol
|
|
39
|
+
* templates live WITHIN `protocols/`, so they are covered transitively.
|
|
40
|
+
*
|
|
41
|
+
* Maintenance point: a new top-level framework subtree must be added here (same
|
|
42
|
+
* shape as `PR_PRODUCING_PROTOCOLS` in pr-gate-audit). `codev/resources/` is
|
|
43
|
+
* deliberately EXCLUDED — those are user-evolved files (arch.md, lessons-learned.md,
|
|
44
|
+
* and their -critical companions), not framework files, and must never be flagged.
|
|
45
|
+
*/
|
|
46
|
+
export const FRAMEWORK_DRIFT_DIRS = ['protocols', 'consult-types', 'roles'];
|
|
47
|
+
/** Only these extensions are framework files worth diffing. */
|
|
48
|
+
const FRAMEWORK_EXTS = new Set(['.md', '.json']);
|
|
49
|
+
/** The two project-local override roots, in resolver-precedence order (tier 1 first). */
|
|
50
|
+
const OVERRIDE_TIERS = ['.codev', 'codev'];
|
|
51
|
+
/** SHA-256 of a file's raw bytes (no text decoding — EOL/trailing-newline sensitive). */
|
|
52
|
+
function hashBytes(filePath) {
|
|
53
|
+
return createHash('sha256').update(fs.readFileSync(filePath)).digest('hex');
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Skeleton-relative framework files under a scan-set subtree, filtered to
|
|
57
|
+
* framework extensions. Enumerated via the resolver's own `listSkeletonFiles`
|
|
58
|
+
* (over `getSkeletonDir()`) so this audit and runtime resolution agree on exactly
|
|
59
|
+
* what the skeleton is. Returned paths (e.g. `protocols/spir/protocol.md`) are
|
|
60
|
+
* both the skeleton-relative and the override-relative path.
|
|
61
|
+
*/
|
|
62
|
+
function skeletonFrameworkFiles(sub) {
|
|
63
|
+
return listSkeletonFiles(sub).filter((rel) => FRAMEWORK_EXTS.has(path.extname(rel)));
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Audit a project for shadow drift against the installed skeleton.
|
|
67
|
+
*
|
|
68
|
+
* For every framework file in the skeleton (under FRAMEWORK_DRIFT_DIRS), checks
|
|
69
|
+
* whether a local copy exists in `.codev/` and/or `codev/`; for each local copy
|
|
70
|
+
* found, byte-compares it against the skeleton file and records a finding. Returns
|
|
71
|
+
* one finding per local copy (so a file present in BOTH tiers yields two findings).
|
|
72
|
+
*
|
|
73
|
+
* @param workspaceRoot - project root (auto-detected via findWorkspaceRoot if omitted)
|
|
74
|
+
*/
|
|
75
|
+
export function auditProtocolDrift(workspaceRoot) {
|
|
76
|
+
const root = workspaceRoot ?? findWorkspaceRoot();
|
|
77
|
+
const skeletonDir = getSkeletonDir();
|
|
78
|
+
const findings = [];
|
|
79
|
+
for (const sub of FRAMEWORK_DRIFT_DIRS) {
|
|
80
|
+
for (const rel of skeletonFrameworkFiles(sub)) {
|
|
81
|
+
const skeletonPath = path.join(skeletonDir, rel);
|
|
82
|
+
let skeletonHash;
|
|
83
|
+
try {
|
|
84
|
+
skeletonHash = hashBytes(skeletonPath);
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
continue; // unreadable skeleton file — nothing to diff against
|
|
88
|
+
}
|
|
89
|
+
// Which copy does the resolver actually pick? (absolute path or null)
|
|
90
|
+
const resolved = resolveCodevFile(rel, root);
|
|
91
|
+
const resolvedAbs = resolved ? path.resolve(resolved) : null;
|
|
92
|
+
for (const tier of OVERRIDE_TIERS) {
|
|
93
|
+
const localPath = path.join(root, tier, rel);
|
|
94
|
+
if (!fs.existsSync(localPath) || !fs.statSync(localPath).isFile())
|
|
95
|
+
continue;
|
|
96
|
+
const status = hashBytes(localPath) === skeletonHash ? 'identical' : 'differs';
|
|
97
|
+
findings.push({
|
|
98
|
+
relativePath: rel,
|
|
99
|
+
tier,
|
|
100
|
+
status,
|
|
101
|
+
isResolvedWinner: resolvedAbs === path.resolve(localPath),
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return findings;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* Whether the project has ANY local copy of a scanned skeleton file, in EITHER
|
|
110
|
+
* override root. Cheap existence-only scan (no hashing) used for the no-op gate:
|
|
111
|
+
* the existing `hasLocalOverride()` only checks tier-2 `codev/`, so drift detection
|
|
112
|
+
* must check both tiers itself.
|
|
113
|
+
*/
|
|
114
|
+
export function hasFrameworkShadows(workspaceRoot) {
|
|
115
|
+
const root = workspaceRoot ?? findWorkspaceRoot();
|
|
116
|
+
for (const sub of FRAMEWORK_DRIFT_DIRS) {
|
|
117
|
+
for (const rel of skeletonFrameworkFiles(sub)) {
|
|
118
|
+
for (const tier of OVERRIDE_TIERS) {
|
|
119
|
+
if (fs.existsSync(path.join(root, tier, rel)))
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
return false;
|
|
125
|
+
}
|
|
126
|
+
/** Parse a dotted version into numeric parts; non-numeric segments → 0. */
|
|
127
|
+
function parseVersion(v) {
|
|
128
|
+
return v.split('.').map((p) => parseInt(p.replace(/[^0-9]/g, ''), 10) || 0);
|
|
129
|
+
}
|
|
130
|
+
/** True if `a` is strictly older than `b` (semver-ish, major.minor.patch). */
|
|
131
|
+
function versionLt(a, b) {
|
|
132
|
+
const pa = parseVersion(a);
|
|
133
|
+
const pb = parseVersion(b);
|
|
134
|
+
for (let i = 0; i < Math.max(pa.length, pb.length); i++) {
|
|
135
|
+
const x = pa[i] || 0;
|
|
136
|
+
const y = pb[i] || 0;
|
|
137
|
+
if (x < y)
|
|
138
|
+
return true;
|
|
139
|
+
if (x > y)
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
/** Bound on the npm-latest lookup (ms). The registry can't stall doctor beyond this. */
|
|
145
|
+
export const NPM_LATEST_TIMEOUT_MS = 2500;
|
|
146
|
+
/**
|
|
147
|
+
* Default npm-latest lookup: `npm view @cluesmith/codev version`. Bounded by
|
|
148
|
+
* `NPM_LATEST_TIMEOUT_MS` (spawnSync kills the child past it) and offline-tolerant —
|
|
149
|
+
* an unreachable registry, non-zero exit, missing `npm`, or unparsable output all
|
|
150
|
+
* yield `null` rather than throwing or hanging. Exported so tests can assert the
|
|
151
|
+
* real bounded/offline behavior (not just an injected stub).
|
|
152
|
+
*/
|
|
153
|
+
export function fetchLatestVersion() {
|
|
154
|
+
try {
|
|
155
|
+
const r = spawnSync('npm', ['view', '@cluesmith/codev', 'version'], {
|
|
156
|
+
encoding: 'utf-8',
|
|
157
|
+
timeout: NPM_LATEST_TIMEOUT_MS,
|
|
158
|
+
stdio: 'pipe',
|
|
159
|
+
});
|
|
160
|
+
if (r.status === 0 && r.stdout) {
|
|
161
|
+
const v = r.stdout.trim();
|
|
162
|
+
return /^\d+\.\d+\.\d+/.test(v) ? v : null;
|
|
163
|
+
}
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
catch {
|
|
167
|
+
return null;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Compare the installed package version against npm `latest`. Never throws and
|
|
172
|
+
* never hangs beyond the fetch timeout — an unreachable registry yields
|
|
173
|
+
* `{ latest: null, behind: false, note }` so doctor stays usable offline.
|
|
174
|
+
*
|
|
175
|
+
* @param fetchLatest - injectable latest-version source (defaults to `npm view`)
|
|
176
|
+
*/
|
|
177
|
+
export function checkSkeletonStaleness(fetchLatest = fetchLatestVersion) {
|
|
178
|
+
const installed = installedVersion;
|
|
179
|
+
let latest = null;
|
|
180
|
+
try {
|
|
181
|
+
latest = fetchLatest();
|
|
182
|
+
}
|
|
183
|
+
catch {
|
|
184
|
+
latest = null;
|
|
185
|
+
}
|
|
186
|
+
if (!latest) {
|
|
187
|
+
return { installed, latest: null, behind: false, note: 'could not check (offline?)' };
|
|
188
|
+
}
|
|
189
|
+
return { installed, latest, behind: versionLt(installed, latest) };
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Render a shadow-drift finding for doctor output.
|
|
193
|
+
*
|
|
194
|
+
* @param skeletonVersion - installed skeleton/package version; when provided it is
|
|
195
|
+
* named in the line so the human can tell WHICH skeleton the local copy diverged
|
|
196
|
+
* from (the spec requires the adjudication warning to name the package version).
|
|
197
|
+
*/
|
|
198
|
+
export function formatDriftFinding(f, skeletonVersion) {
|
|
199
|
+
const loc = `${f.tier}/${f.relativePath}`;
|
|
200
|
+
const ver = skeletonVersion ? ` v${skeletonVersion}` : '';
|
|
201
|
+
if (f.status === 'identical') {
|
|
202
|
+
return `${loc} — byte-identical redundant copy of the installed skeleton${ver}; safe to remove (resolution then falls back to the package)`;
|
|
203
|
+
}
|
|
204
|
+
const winner = f.isResolvedWinner ? ' [resolved — this copy is live]' : '';
|
|
205
|
+
return `${loc} — differs from installed skeleton${ver}; customized or stale? — adjudicate${winner}`;
|
|
206
|
+
}
|
|
207
|
+
/** Render the staleness result for doctor output. */
|
|
208
|
+
export function formatStaleness(s) {
|
|
209
|
+
if (s.latest === null) {
|
|
210
|
+
return `installed ${s.installed}; latest: ${s.note ?? 'unknown'}`;
|
|
211
|
+
}
|
|
212
|
+
if (s.behind) {
|
|
213
|
+
return `installed ${s.installed}; latest ${s.latest} — behind (run: codev update)`;
|
|
214
|
+
}
|
|
215
|
+
return `installed ${s.installed}; latest ${s.latest} (up to date)`;
|
|
216
|
+
}
|
|
217
|
+
//# sourceMappingURL=protocol-drift-audit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol-drift-audit.js","sourceRoot":"","sources":["../../src/lib/protocol-drift-audit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvG,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAE5D;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,WAAW,EAAE,eAAe,EAAE,OAAO,CAAU,CAAC;AAErF,+DAA+D;AAC/D,MAAM,cAAc,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;AAEjD,yFAAyF;AACzF,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,OAAO,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