@cluesmith/codev 3.2.4 → 3.3.1
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-D3XaKpZW.js} +46 -44
- package/dashboard-dist/assets/index-D3XaKpZW.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 +154 -0
- package/dist/agent-farm/cli.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 +34 -0
- package/dist/agent-farm/commands/reset.d.ts.map +1 -0
- package/dist/agent-farm/commands/reset.js +309 -0
- package/dist/agent-farm/commands/reset.js.map +1 -0
- package/dist/agent-farm/commands/send.d.ts.map +1 -1
- package/dist/agent-farm/commands/send.js +49 -8
- package/dist/agent-farm/commands/send.js.map +1 -1
- package/dist/agent-farm/commands/spawn-worktree.d.ts +105 -6
- package/dist/agent-farm/commands/spawn-worktree.d.ts.map +1 -1
- package/dist/agent-farm/commands/spawn-worktree.js +289 -66
- 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 +80 -8
- package/dist/agent-farm/commands/status.js.map +1 -1
- package/dist/agent-farm/commands/tower.d.ts.map +1 -1
- package/dist/agent-farm/commands/tower.js +13 -0
- package/dist/agent-farm/commands/tower.js.map +1 -1
- 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 +64 -0
- package/dist/agent-farm/lib/reconnect-backoff.d.ts.map +1 -0
- package/dist/agent-farm/lib/reconnect-backoff.js +57 -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 +225 -30
- package/dist/agent-farm/lib/tunnel-client.js.map +1 -1
- package/dist/agent-farm/servers/canvas-relay.d.ts +60 -0
- package/dist/agent-farm/servers/canvas-relay.d.ts.map +1 -0
- package/dist/agent-farm/servers/canvas-relay.js +376 -0
- package/dist/agent-farm/servers/canvas-relay.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 +19 -0
- package/dist/agent-farm/servers/overview.d.ts.map +1 -1
- package/dist/agent-farm/servers/overview.js +100 -4
- package/dist/agent-farm/servers/overview.js.map +1 -1
- 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-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/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 +78 -16
- 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 +826 -145
- package/dist/agent-farm/servers/tower-routes.js.map +1 -1
- package/dist/agent-farm/servers/tower-server.js +188 -34
- package/dist/agent-farm/servers/tower-server.js.map +1 -1
- package/dist/agent-farm/servers/tower-terminals.d.ts +23 -2
- package/dist/agent-farm/servers/tower-terminals.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-terminals.js +134 -127
- 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 +64 -1
- package/dist/agent-farm/servers/tower-utils.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-utils.js +168 -1
- package/dist/agent-farm/servers/tower-utils.js.map +1 -1
- package/dist/agent-farm/servers/tower-websocket.d.ts +6 -1
- package/dist/agent-farm/servers/tower-websocket.d.ts.map +1 -1
- package/dist/agent-farm/servers/tower-websocket.js +95 -57
- 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/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/agent-farm/utils/message-format.d.ts +8 -0
- package/dist/agent-farm/utils/message-format.d.ts.map +1 -1
- package/dist/agent-farm/utils/message-format.js +20 -0
- package/dist/agent-farm/utils/message-format.js.map +1 -1
- package/dist/agent-farm/utils/server-utils.d.ts +80 -4
- package/dist/agent-farm/utils/server-utils.d.ts.map +1 -1
- package/dist/agent-farm/utils/server-utils.js +286 -5
- package/dist/agent-farm/utils/server-utils.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/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 +272 -28
- 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.map +1 -1
- package/dist/commands/doctor.js +71 -19
- package/dist/commands/doctor.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.js +21 -28
- 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/lib/config.d.ts +69 -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/forge-contracts.d.ts +9 -0
- package/dist/lib/forge-contracts.d.ts.map +1 -1
- package/dist/lib/forge-contracts.js.map +1 -1
- package/dist/lib/github.d.ts +15 -1
- package/dist/lib/github.d.ts.map +1 -1
- package/dist/lib/github.js +18 -1
- package/dist/lib/github.js.map +1 -1
- 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/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/attach-replay.d.ts +39 -0
- package/dist/terminal/attach-replay.d.ts.map +1 -0
- package/dist/terminal/attach-replay.js +76 -0
- package/dist/terminal/attach-replay.js.map +1 -0
- package/dist/terminal/pty-manager.d.ts +2 -0
- package/dist/terminal/pty-manager.d.ts.map +1 -1
- package/dist/terminal/pty-manager.js +51 -23
- package/dist/terminal/pty-manager.js.map +1 -1
- package/dist/terminal/pty-session.d.ts +201 -1
- package/dist/terminal/pty-session.d.ts.map +1 -1
- package/dist/terminal/pty-session.js +327 -46
- 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 +53 -0
- package/dist/terminal/session-manager.d.ts.map +1 -1
- package/dist/terminal/session-manager.js +94 -9
- package/dist/terminal/session-manager.js.map +1 -1
- package/dist/terminal/session-screen.d.ts +116 -0
- package/dist/terminal/session-screen.d.ts.map +1 -0
- package/dist/terminal/session-screen.js +180 -0
- package/dist/terminal/session-screen.js.map +1 -0
- 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 +17 -8
- package/dist/terminal/shellper-process.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 +13 -8
- package/scripts/forge/gitea/pr-view.sh +4 -1
- package/scripts/forge/github/pr-view.sh +1 -1
- package/scripts/forge/gitlab/pr-view.sh +4 -1
- package/skeleton/.claude/skills/afx/SKILL.md +68 -1
- package/skeleton/.claude/skills/arch-init/SKILL.md +22 -9
- package/skeleton/.claude/skills/arch-save/SKILL.md +183 -0
- package/skeleton/.claude/skills/codev/SKILL.md +31 -0
- package/skeleton/.claude/skills/runnable-worktrees/SKILL.md +119 -0
- package/skeleton/.codex/skills/afx/SKILL.md +68 -1
- package/skeleton/.codex/skills/arch-init/SKILL.md +22 -9
- package/skeleton/.codex/skills/arch-save/SKILL.md +183 -0
- package/skeleton/.codex/skills/codev/SKILL.md +31 -0
- package/skeleton/.codex/skills/runnable-worktrees/SKILL.md +119 -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 +31 -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 +2 -3
- package/skeleton/protocols/pir/prompts/plan.md +1 -4
- package/skeleton/protocols/pir/prompts/review.md +2 -2
- 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 +262 -0
- package/skeleton/resources/commands/consult.md +236 -8
- package/skeleton/resources/commands/overview.md +1 -0
- package/skeleton/roles/architect.md +67 -317
- package/skeleton/roles/builder.md +76 -191
- package/skeleton/templates/AGENTS.md +2 -0
- package/skeleton/templates/CLAUDE.md +2 -0
- package/templates/3d-viewer.html +32 -4
- package/templates/open.html +58 -12
- package/templates/tower.html +65 -9
- package/templates/vendor/three-3MFLoader.js +1478 -0
- package/templates/vendor/three-STLLoader.js +410 -0
- package/templates/vendor/three-TrackballControls.js +828 -0
- package/templates/vendor/three-fflate.module.js +2474 -0
- package/templates/vendor/three.module.js +53044 -0
- 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 -116
- 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
|
@@ -2,47 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
## Context
|
|
4
4
|
|
|
5
|
-
You are reviewing
|
|
5
|
+
You are reviewing a PIR implementation before it reaches the `dev-approval` human gate. A builder has implemented the approved plan and written a dev-approval summary. Verify the implementation matches the plan and is ready for human review.
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## Verify before flagging
|
|
8
8
|
|
|
9
|
-
Before requesting changes for missing configuration,
|
|
10
|
-
1. **Check `package.json`** for actual dependency versions — framework conventions change between major versions
|
|
11
|
-
2. **Read the actual config files** (or confirm their deliberate absence) before flagging missing configs
|
|
12
|
-
3. **Do not assume** your training data reflects the version in use — verify against project files
|
|
13
|
-
4. If "Previous Iteration Context" is provided, read it carefully before re-raising concerns that were already disputed
|
|
9
|
+
Before requesting changes for missing configuration, wrong patterns, or framework issues, confirm the claim against the project rather than your training data:
|
|
14
10
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
- Does the implementation fulfill the approved plan?
|
|
19
|
-
- Are all "Files to Change" actually changed?
|
|
20
|
-
- Are the changes scoped to what the plan described, or has scope crept?
|
|
21
|
-
|
|
22
|
-
2. **Code Quality**
|
|
23
|
-
- Is the code readable and maintainable?
|
|
24
|
-
- Are there obvious bugs?
|
|
25
|
-
- Are error cases handled appropriately?
|
|
26
|
-
- Is the change minimal — no unnecessary refactoring or unrelated tidy-ups?
|
|
27
|
-
|
|
28
|
-
3. **Test Coverage**
|
|
29
|
-
- Are the tests adequate for the changes?
|
|
30
|
-
- Do tests cover both the main path and the edge cases the plan called out?
|
|
31
|
-
- For a bug fix: is there a regression test that would fail without the fix?
|
|
11
|
+
- Check `package.json` for the actual dependency versions — framework conventions change between major versions.
|
|
12
|
+
- Read the actual config files (or confirm their deliberate absence) before flagging a missing config.
|
|
13
|
+
- If "Previous Iteration Context" is provided, read it before re-raising concerns already disputed.
|
|
32
14
|
|
|
33
|
-
|
|
34
|
-
- Does `codev/reviews/<id>-<slug>.md` exist and follow the template?
|
|
35
|
-
- Does it accurately describe what changed?
|
|
36
|
-
- Is "Things to Look At" honest about tricky spots?
|
|
37
|
-
- Is "How to Test Locally" specific enough that the human reviewer can act on it?
|
|
15
|
+
## Focus Areas
|
|
38
16
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
17
|
+
- **Plan Adherence** — the implementation fulfills the approved plan; every "Files to Change" is changed; the change is scoped to the plan, no creep.
|
|
18
|
+
- **Code Quality** — readable and maintainable; no obvious bugs; error cases handled; the change is minimal, with no unrelated refactors.
|
|
19
|
+
- **Test Coverage** — tests are adequate and cover the plan's main path and edge cases; a bug fix has a regression test that would fail without the fix.
|
|
20
|
+
- **Review File Quality** — `codev/reviews/<id>-<slug>.md` exists, follows the template, describes what changed accurately, is honest in "Things to Look At", and specific enough in "How to Test Locally" for the human to act on.
|
|
21
|
+
- **PIR-Specific Concerns** — for UI / mobile / cross-platform changes, the review file explains platform-specific behavior the human should verify; for external integrations, the integration points are documented.
|
|
42
22
|
|
|
43
23
|
## Verdict Format
|
|
44
24
|
|
|
45
|
-
|
|
25
|
+
Provide your verdict in exactly this format — `consult` parses it:
|
|
46
26
|
|
|
47
27
|
```
|
|
48
28
|
---
|
|
@@ -56,23 +36,10 @@ KEY_ISSUES:
|
|
|
56
36
|
...
|
|
57
37
|
```
|
|
58
38
|
|
|
59
|
-
|
|
60
|
-
- `
|
|
61
|
-
- `
|
|
62
|
-
- `COMMENT`: Minor suggestions, can proceed but note feedback
|
|
39
|
+
- `APPROVE`: ready for the human at the `dev-approval` gate.
|
|
40
|
+
- `REQUEST_CHANGES`: issues that must be fixed before reaching the human.
|
|
41
|
+
- `COMMENT`: minor suggestions; can proceed but note the feedback.
|
|
63
42
|
|
|
64
43
|
## Scope
|
|
65
44
|
|
|
66
|
-
|
|
67
|
-
- **DO** flag missing regression tests for bug fixes
|
|
68
|
-
- **DO** flag obvious bugs, code smells, security issues
|
|
69
|
-
- **DO NOT** redesign the approach — that was settled at `plan-approval`
|
|
70
|
-
- **DO NOT** demand changes outside the plan's scope
|
|
71
|
-
- **DO NOT** request architecture-level refactors unless the change introduces a clear new problem
|
|
72
|
-
|
|
73
|
-
## Notes
|
|
74
|
-
|
|
75
|
-
- This is a pre-gate review; the human is the final authority
|
|
76
|
-
- Focus on "is this ready for someone else to test in a browser / simulator"
|
|
77
|
-
- If referencing line numbers, use `file:line` format
|
|
78
|
-
- The builder needs actionable feedback to iterate
|
|
45
|
+
Review the implementation against the approved plan; flag missing regression tests for bug fixes, and obvious bugs, code smells, or security issues. Do **not** redesign the approach (that was settled at `plan-approval`), demand changes outside the plan's scope, or request architecture-level refactors unless the change introduces a clear new problem. This is a pre-gate review — the human is the final authority; focus on "is this ready for someone else to test in a browser / simulator".
|
|
@@ -2,37 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
## Context
|
|
4
4
|
|
|
5
|
-
You are performing the 3-way review of a PIR
|
|
5
|
+
You are performing the 3-way review of a PIR PR. The builder implemented an approved plan, the human approved the `dev-approval` gate (having run and tested the code locally), and the PR is open. This is a single advisory pass (`max_iterations: 1`) — your verdict is surfaced to the human at the `pr` gate, who is the sole remaining reviewer; it is not auto-re-reviewed.
|
|
6
6
|
|
|
7
7
|
## Focus Areas
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
2. **Test Status**
|
|
15
|
-
- Do all tests pass on the branch?
|
|
16
|
-
- Is test coverage adequate for the change?
|
|
17
|
-
- Are there skipped or flaky tests documented?
|
|
18
|
-
|
|
19
|
-
3. **Code Quality**
|
|
20
|
-
- Any debug code left in?
|
|
21
|
-
- Any TODO comments that should be resolved?
|
|
22
|
-
- Any `// REVIEW:` markers that weren't addressed?
|
|
23
|
-
|
|
24
|
-
4. **Branch Hygiene**
|
|
25
|
-
- Is the branch up to date with the default branch? (If not, suggest a rebase. The default branch is whatever `git symbolic-ref --short refs/remotes/origin/HEAD` reports — typically `main`, but may be `dev`, `ci`, etc.)
|
|
26
|
-
- Are commits atomic and well-described?
|
|
27
|
-
- Is the change diff a reasonable size for the issue scope?
|
|
28
|
-
|
|
29
|
-
5. **Issue Linkage**
|
|
30
|
-
- Does the PR body contain `Fixes #<N>` (or `Refs #<N>` for partial fixes)?
|
|
31
|
-
- Without this, GitHub won't auto-close the issue on merge
|
|
9
|
+
- **Completeness** — the PR body is the review-file content plus `Fixes #<N>`; commits are formatted `[PIR #<N>] ...`; the diff matches what the review file describes.
|
|
10
|
+
- **Test Status** — all tests pass on the branch, coverage is adequate, and skipped/flaky tests are documented.
|
|
11
|
+
- **Code Quality** — no debug code, no stray `TODO` or unaddressed `// REVIEW:` markers.
|
|
12
|
+
- **Branch Hygiene** — the branch is up to date with the default branch (whatever `git symbolic-ref --short refs/remotes/origin/HEAD` reports — typically `main`, sometimes `dev`/`ci`); commits are atomic; the diff size is reasonable for the issue.
|
|
13
|
+
- **Issue Linkage** — the PR body carries `Fixes #<N>` (or `Refs #<N>` for a partial fix), without which GitHub won't auto-close the issue on merge.
|
|
32
14
|
|
|
33
15
|
## Verdict Format
|
|
34
16
|
|
|
35
|
-
|
|
17
|
+
Provide your verdict in exactly this format — `consult` parses it:
|
|
36
18
|
|
|
37
19
|
```
|
|
38
20
|
---
|
|
@@ -46,21 +28,10 @@ KEY_ISSUES:
|
|
|
46
28
|
...
|
|
47
29
|
```
|
|
48
30
|
|
|
49
|
-
|
|
50
|
-
- `
|
|
51
|
-
- `
|
|
52
|
-
- `COMMENT`: Minor items, can merge but note feedback
|
|
31
|
+
- `APPROVE`: ready to merge.
|
|
32
|
+
- `REQUEST_CHANGES`: issues to fix before merging.
|
|
33
|
+
- `COMMENT`: minor items; can merge but note the feedback.
|
|
53
34
|
|
|
54
35
|
## Scope
|
|
55
36
|
|
|
56
|
-
|
|
57
|
-
- **DO** flag obvious problems the human reviewer at the gate might have missed
|
|
58
|
-
- **DO NOT** redesign the approach — that was settled at `plan-approval` and validated at `dev-approval`
|
|
59
|
-
- **DO NOT** demand changes the human reviewer already accepted at the `dev-approval` gate (the human ran the code and approved it; you didn't)
|
|
60
|
-
- **DO NOT** flag the syntax of `git diff` examples that appear in review-file prose (e.g., `git diff ci..HEAD` inside a "Files Changed" caption or "How to Test Locally" section). Quoted diff syntax is documentation, not a command. Apply two-dot/three-dot scrutiny only to diffs you compute yourself.
|
|
61
|
-
|
|
62
|
-
## Notes
|
|
63
|
-
|
|
64
|
-
- The human at the `dev-approval` gate is the primary reviewer for behavior; you are the secondary reviewer for hygiene and edge cases
|
|
65
|
-
- Focus on "what would an integration reviewer catch that the gate reviewer missed"
|
|
66
|
-
- If referencing line numbers, use `file:line` format
|
|
37
|
+
Flag a missing `Fixes #<N>` and obvious problems the gate reviewer might have missed. Do **not** redesign the approach (settled at `plan-approval`, validated at `dev-approval`), demand changes the human already accepted at `dev-approval` (they ran the code; you didn't), or flag the syntax of `git diff` examples in review-file prose — quoted diff syntax is documentation, not a command; apply two-dot/three-dot scrutiny only to diffs you compute yourself. You are the secondary reviewer for hygiene and edge cases: "what would an integration reviewer catch that the gate reviewer missed".
|
|
@@ -61,7 +61,7 @@ Follow the plan's "Files to Change" section. Apply the changes.
|
|
|
61
61
|
[PIR #{{issue.number}}] <Concise description of this commit's change>
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
Stage files explicitly:
|
|
65
65
|
|
|
66
66
|
```bash
|
|
67
67
|
git add path/to/changed-file.ts
|
|
@@ -140,10 +140,9 @@ Then **stay in the interactive session**. Do not exit. Wait for the user's next
|
|
|
140
140
|
|
|
141
141
|
- **Don't write `codev/reviews/<id>-<slug>.md` in this phase** — it's the next phase's artifact, with a different shape (retrospective with arch + lessons updates)
|
|
142
142
|
- Don't add features not in the plan — scope creep is a `BLOCKED` signal, not a free expansion
|
|
143
|
-
- Don't run `porch approve`
|
|
143
|
+
- Don't run `porch approve` on your own initiative — only when the architect relays the human's approval
|
|
144
144
|
- Don't push to the default branch — only to your builder branch
|
|
145
145
|
- Don't squash commits — let the merge commit preserve history
|
|
146
|
-
- Don't use `git add .` or `git add -A`
|
|
147
146
|
- Don't open the PR yet — that's the `review` phase
|
|
148
147
|
- Don't exit the interactive session at the gate
|
|
149
148
|
|
|
@@ -87,8 +87,6 @@ git commit -m "[PIR #{{issue.number}}] Plan draft"
|
|
|
87
87
|
git push -u origin "$(git branch --show-current)"
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
-
**Never use `git add .` or `git add -A`.**
|
|
91
|
-
|
|
92
90
|
### 5. Signal Phase Complete
|
|
93
91
|
|
|
94
92
|
```bash
|
|
@@ -116,9 +114,8 @@ Then **stay in the interactive session**. Do not exit. Wait for the user's next
|
|
|
116
114
|
## What NOT to Do
|
|
117
115
|
|
|
118
116
|
- Don't write code — that's the implement phase
|
|
119
|
-
- Don't run `porch approve`
|
|
117
|
+
- Don't run `porch approve` on your own initiative — only when the architect relays the human's approval
|
|
120
118
|
- Don't post the plan content as a GitHub issue comment — the plan lives in the file, not the issue thread. A one-line pointer comment on the issue is fine if you think it helps the discussion.
|
|
121
|
-
- Don't use `git add .` or `git add -A`
|
|
122
119
|
- Don't exit the interactive session at the gate
|
|
123
120
|
|
|
124
121
|
## Handling Feedback
|
|
@@ -238,9 +238,9 @@ Together with the `--pr` record from step 4a and the `--merged` record from step
|
|
|
238
238
|
|
|
239
239
|
## What NOT to Do
|
|
240
240
|
|
|
241
|
-
- **Don't merge before the `pr` gate is approved
|
|
241
|
+
- **Don't merge before the `pr` gate is approved** (steps 8–9). Neither a consultation APPROVE verdict nor user-in-pane prose ("looks good", "lgtm", "merge it") authorizes `gh pr merge` — only porch reporting `gate_status: approved` for the `pr` gate does.
|
|
242
242
|
- Don't skip porch's PR/merge records (steps 4a, 9). The `--pr` record (step 4a) lets the gate-pending state link to the actual PR; the `--merged` record (step 9) closes the lifecycle in porch state. Skipping either leaves `history:` empty and downstream tooling blind.
|
|
243
|
-
- Don't run `porch approve` for any gate
|
|
243
|
+
- Don't run `porch approve` for any gate on your own initiative — only when the architect relays the human's approval
|
|
244
244
|
- Don't push to the default branch — only merge via PR
|
|
245
245
|
- Don't skip the Architecture Updates / Lessons Learned sections — porch checks enforce their presence (the section must exist; explaining "no changes needed" in one line is fine)
|
|
246
246
|
- **Don't run `consult` commands yourself** — porch handles consultations via the `verify` block. Manually invoking `consult` causes the consultation to run twice.
|
|
@@ -1,202 +1,79 @@
|
|
|
1
1
|
# PIR Protocol
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Plan → Implement → Review, driven by a GitHub issue, with **two human gates before any PR
|
|
4
|
+
exists**. The issue is the implicit spec; there is no specify phase.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
Choose PIR when either is true:
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
- **The approach needs review before coding.** Ambiguous root cause, unfamiliar or
|
|
9
|
+
high-blast-radius area, or a design-sensitive change — cheaper to redirect at plan time than
|
|
10
|
+
at PR time.
|
|
11
|
+
- **The implementation must be exercised running, before a PR exists.** Mobile, UI/UX,
|
|
12
|
+
hardware-adjacent behaviour, OAuth or payment integrations, full user journeys, anything
|
|
13
|
+
performance-sensitive. A diff cannot show you these; a running worktree can.
|
|
8
14
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- Area is unfamiliar or high-blast-radius (shared utilities, auth, migrations, public APIs)
|
|
12
|
-
- Design-sensitive (affects conventions, patterns, architecture)
|
|
13
|
-
- Cheaper to redirect at plan time than at PR time
|
|
15
|
+
Lighter than SPIR (no spec phase, one consult at the PR). Stronger than BUGFIX/AIR (two human
|
|
16
|
+
gates *before* a PR, where the human reviews the running code rather than the diff).
|
|
14
17
|
|
|
15
|
-
|
|
16
|
-
The PR diff alone is insufficient; the reviewer must *run* the code:
|
|
17
|
-
- Mobile app changes (needs device testing on Android, iOS, possibly web)
|
|
18
|
-
- UI / UX changes (visual inspection, interaction flow, accessibility)
|
|
19
|
-
- Hardware-adjacent behavior (sensors, camera, permissions, notifications)
|
|
20
|
-
- Integration with external services that don't mock cleanly (OAuth, payments, analytics)
|
|
21
|
-
- User-journey changes that need a full-flow exercise
|
|
22
|
-
- Performance-sensitive changes that need profiling on the running app
|
|
23
|
-
|
|
24
|
-
### Use SPIR / ASPIR / BUGFIX / AIR instead when
|
|
25
|
-
- **SPIR / ASPIR**: the change is complex enough to warrant careful specification, multi-agent consultation at every phase, and the full spec → plan → implement → review ceremony with file artifacts. The driving issue is incidental — what matters is that the design work deserves a formal spec and the implementation deserves consult-driven review at each phase
|
|
26
|
-
- **BUGFIX**: small bug fix, no design review needed, diff-on-PR review is enough
|
|
27
|
-
- **AIR**: small feature from an issue, autonomous, diff-on-PR review is enough
|
|
28
|
-
|
|
29
|
-
## How PIR Differs from SPIR
|
|
30
|
-
|
|
31
|
-
PIR is structurally *SPIR minus the `specify` phase*, with the human dev-approval moved earlier (pre-PR instead of post-PR).
|
|
32
|
-
|
|
33
|
-
| Aspect | SPIR | PIR |
|
|
34
|
-
|---|---|---|
|
|
35
|
-
| Phases | specify → plan → implement → review → verify | plan → implement → review |
|
|
36
|
-
| Spec artifact | `codev/specs/<id>-<slug>.md` | GitHub Issue body (implicit spec) |
|
|
37
|
-
| Plan artifact | `codev/plans/<id>-<slug>.md` | Same — committed on builder branch |
|
|
38
|
-
| Review artifact | `codev/reviews/<id>-<slug>.md` (Summary + Architecture Updates + Lessons Learned, becomes PR body) | **Same shape** — `codev/reviews/<id>-<slug>.md` with the same sections, also becomes PR body |
|
|
39
|
-
| Human gates | spec-approval, plan-approval, pr, verify-approval | plan-approval, dev-approval, pr |
|
|
40
|
-
| Where code is reviewed by the human | On the PR (post-creation) — read the diff | Pre-PR (at the `dev-approval` gate) — read the diff **and run the worktree locally** |
|
|
41
|
-
|
|
42
|
-
The review file always includes Summary, Architecture Updates, and Lessons Learned sections so `codev/reviews/` stays semantically consistent across all protocols. PIR's lightness comes from skipping the `specify` phase (the issue body is the spec), not from cutting corners on the retrospective.
|
|
43
|
-
|
|
44
|
-
The `dev-approval` gate is what makes PIR genuinely different: the human gates the *running implementation* via the worktree before the PR exists, instead of gating the PR after creation.
|
|
45
|
-
|
|
46
|
-
## Phases
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
plan → implement → review
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### Plan (gated by `plan-approval`)
|
|
53
|
-
|
|
54
|
-
The builder:
|
|
55
|
-
1. Reads the GitHub issue and investigates the codebase
|
|
56
|
-
2. Writes `codev/plans/<id>-<slug>.md` with: Understanding / Proposed change / Files to change / Risks & alternatives / Test plan
|
|
57
|
-
3. Commits the plan on the builder branch and pushes
|
|
58
|
-
4. Runs `porch done` and `porch next` — the `plan-approval` gate becomes pending
|
|
59
|
-
5. Sits at the interactive prompt waiting for review
|
|
60
|
-
|
|
61
|
-
**Reviewer paths** (all equivalent):
|
|
62
|
-
- Open `codev/plans/<id>-<slug>.md` in the worktree, read and / or edit directly, save
|
|
63
|
-
- Type feedback into the builder's PTY pane — the builder is alive in interactive mode
|
|
64
|
-
- `afx send <builder-id> "<feedback>"`
|
|
65
|
-
- Comment on the GitHub issue (sidecar discussion)
|
|
66
|
-
|
|
67
|
-
When satisfied, approve via VSCode's "Approve Gate" command (Cmd+K G) or:
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
porch approve <id> plan-approval --a-human-explicitly-approved-this
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### Implement (gated by `dev-approval`)
|
|
74
|
-
|
|
75
|
-
The builder:
|
|
76
|
-
1. Reads the approved plan file
|
|
77
|
-
2. Writes code and tests; runs build + tests via the `checks` block
|
|
78
|
-
3. *No AI consult on this phase* — the human at the `dev-approval` gate is the sole reviewer of the running code. Matches BUGFIX / AIR's pattern of "no consult on implementation, one consult at PR creation".
|
|
79
|
-
4. Pushes the branch
|
|
80
|
-
5. Runs `porch done` and `porch next` — the `dev-approval` gate becomes pending
|
|
81
|
-
6. Outputs a **prose** dev-approval summary in the PTY pane (Summary / Files / Test results / Things to look at / How to test locally). This is a transient message to orient the human reviewer — **not a committed file**. The retrospective file is written in the next phase, after the human approves the running code.
|
|
82
|
-
7. Sits at the interactive prompt
|
|
83
|
-
|
|
84
|
-
**The reviewer's killer move**: run the worktree locally.
|
|
85
|
-
|
|
86
|
-
- VSCode: right-click the builder in the Codev sidebar → **Run Dev** (spawns `afx dev <builder-id>` via Tower)
|
|
87
|
-
- CLI: `afx dev <builder-id>`
|
|
88
|
-
|
|
89
|
-
The dev process uses **the same ports and URLs as main** intentionally (OAuth callbacks, CORS, cookie scoping all depend on consistent origins). Only one dev env runs at a time; stop main's `pnpm dev` before starting the worktree's, or use VSCode's **Stop Dev** to swap.
|
|
90
|
-
|
|
91
|
-
Reviewer tests the change on real devices / browsers / simulators. When satisfied, approves via Cmd+K G or:
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
porch approve <id> dev-approval --a-human-explicitly-approved-this
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### Review (gated by `pr`)
|
|
98
|
-
|
|
99
|
-
The builder:
|
|
100
|
-
1. Writes `codev/reviews/<id>-<slug>.md` with **Summary**, **Architecture Updates**, **Lessons Learned Updates**, plus the supporting sections (Files Changed, Commits, Test Results, Things to Look At, How to Test Locally).
|
|
101
|
-
2. Routes new facts/wisdom by tier (Spec 987) — HOT `codev/resources/arch-critical.md` / `lessons-critical.md` (capped) or COLD `codev/resources/arch.md` / `lessons-learned.md` (reference) — if real changes need recording. If not, the review file's sections state "no changes needed" with a one-line explanation (the porch `checks` block enforces section presence, not content).
|
|
102
|
-
3. Commits the review file (and arch / lessons updates if any) and pushes
|
|
103
|
-
4. Opens a PR with `gh pr create`; PR body is the review file content + `Fixes #<N>`. Records the PR with `porch done <id> --pr <M> --branch <name>`.
|
|
104
|
-
5. Runs `porch done <id>` — porch's `verify` block runs 3-way consultation (Gemini, Codex, Claude; type=impl) as a **single advisory pass** (`max_iterations: 1`); consultation outputs land in `codev/projects/<id>-*/`. There is no iterate-until-APPROVE loop: whatever the verdicts, porch records them and advances to the `pr` gate. A `REQUEST_CHANGES` is not auto-re-reviewed — the builder addresses or rebuts it, adds a regression test if it's a real defect, and escalates it in the architect notification so the human verifies it at the `pr` gate. Outcomes are not auto-appended to the PR body; reviewers with the worktree read them from the projects dir.
|
|
105
|
-
6. The `pr` gate fires (pending) regardless of verdict. Builder notifies the architect once — leading with any `REQUEST_CHANGES` and its disposition (since PIR will not re-review it) rather than burying it in a flat status line.
|
|
106
|
-
7. Builder waits at the `pr` gate. The human reviews the PR on GitHub, then approves the `pr` gate (Cmd+K G or `porch approve <id> pr --a-human-explicitly-approved-this`). Porch wakes the builder.
|
|
107
|
-
8. Builder verifies the gate is genuinely approved via `porch next` (defensive — typed prose can't trigger this branch, only real porch state does), then runs `gh pr merge --merge`, records via `porch done --merged <M>`, and sends the cleanup-ready notification. Protocol complete (`next: null`).
|
|
108
|
-
|
|
109
|
-
## Gates
|
|
110
|
-
|
|
111
|
-
PIR uses porch's existing gate machinery. Gate names are opaque strings; no porch engine changes are needed.
|
|
112
|
-
|
|
113
|
-
- **`plan-approval`** — pre-PR. Human reads the plan file (committed on the builder branch) and approves before any code is written. Gates are keyed by `(project_id, gate_name)` so the name is safe to share with other protocols.
|
|
114
|
-
- **`dev-approval`** — pre-PR. The human reviews the *running* worktree (via `afx dev`) before any PR exists. This is PIR's distinctive gate.
|
|
115
|
-
- **`pr`** — post-PR. Gates the merge step. The human reviews the PR on GitHub and approves this gate; porch wakes the builder, which then runs `gh pr merge`. The gate exists so the merge trigger is structured porch state (binary approved/not), not free-text prose typed into the builder's pane. Eliminates the self-merge bug class: builders can't infer authorization from ambiguous user input.
|
|
116
|
-
|
|
117
|
-
When a gate becomes pending, porch broadcasts `overview-changed` via SSE. The VSCode Builders tree picks up the blocked state and renders it with a bell icon; a toast surfaces the new gate-pending event. Architect notification is *not* automatic — gates surface via the toast/sidebar (for IDE users) or by checking the builder pane / `porch pending` (for CLI users). The builder's job at any gate is to write the artifact, commit, signal completion, and wait — never to invoke `porch approve` itself (Claude refuses the `--a-human-explicitly-approved-this` flag by design).
|
|
118
|
-
|
|
119
|
-
## Rejection / Feedback Model
|
|
120
|
-
|
|
121
|
-
There is no formal `porch reject` command. Rejection works via the feedback-iterate pattern:
|
|
122
|
-
|
|
123
|
-
1. Reviewer provides feedback (edit the plan file in VSCode, type in the builder pane, `afx send`, or issue comment)
|
|
124
|
-
2. Builder reads the feedback on its next turn, revises the artifact, recommits
|
|
125
|
-
3. The gate remains pending — porch doesn't advance until the human runs `porch approve`
|
|
126
|
-
|
|
127
|
-
The same pattern works at both gates.
|
|
128
|
-
|
|
129
|
-
## Builder Session Lifetime
|
|
130
|
-
|
|
131
|
-
The builder is a long-running interactive Claude Code session in a PTY pane managed by Tower. The session is launched as `claude "<prompt>"` (no `--print`) inside a `while true` restart loop. That form starts an interactive Claude REPL with the prompt as the first user message; after Claude finishes the prompted work it sits at the input prompt awaiting next user input. The outer `while true` loop only fires if Claude crashes — it is a crash-recovery safety net, not the gate-wait mechanism.
|
|
132
|
-
|
|
133
|
-
This means typed input in the builder pane reaches the live Claude session immediately, exactly like any other interactive Claude Code conversation. There is no "session ended at gate" state to worry about under normal operation.
|
|
134
|
-
|
|
135
|
-
## Configuration
|
|
136
|
-
|
|
137
|
-
PIR uses the same `.codev/config.json` configuration as other protocols. The `worktree` block (from Issue 689) enables the at-gate dev review flow:
|
|
18
|
+
## The state machine
|
|
138
19
|
|
|
139
20
|
```json
|
|
140
|
-
{
|
|
141
|
-
"worktree": {
|
|
142
|
-
"symlinks": [".env.local", "packages/*/.env"],
|
|
143
|
-
"postSpawn": ["pnpm install --frozen-lockfile"],
|
|
144
|
-
"devCommand": "pnpm dev"
|
|
145
|
-
}
|
|
146
|
-
}
|
|
21
|
+
{{> protocols/pir/protocol.json}}
|
|
147
22
|
```
|
|
148
23
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
## Multi-Agent Consultation
|
|
152
|
-
|
|
153
|
-
- **plan**: human-only review. No AI consultation.
|
|
154
|
-
- **implement**: no AI consult — the human at the `dev-approval` gate is the sole reviewer of the running code.
|
|
155
|
-
- **review**: 3-way consultation (Gemini, Codex, Claude; type=impl) after the PR is opened, as a **single advisory pass** (`max_iterations: 1`). Same consult type (`impl`) as BUGFIX / AIR's PR-creation consult.
|
|
156
|
-
|
|
157
|
-
The consultation at the PR is a single pass — there is **no iterate-until-APPROVE loop**. A `REQUEST_CHANGES` does not block or re-trigger it; the builder addresses or rebuts it and escalates it to the human at the `pr` gate, who is the sole remaining reviewer of any resulting fix (the consultation does not re-check it).
|
|
158
|
-
|
|
159
|
-
Net: PIR's distinguishing features are the two human gates (`plan-approval`, `dev-approval`), not AI-consult density.
|
|
24
|
+
## Gates
|
|
160
25
|
|
|
161
|
-
|
|
26
|
+
Gate names are opaque strings keyed by `(project_id, gate_name)`, so sharing a name with another
|
|
27
|
+
protocol is safe and needs no porch change.
|
|
162
28
|
|
|
163
|
-
|
|
29
|
+
| Gate | When | What the human does |
|
|
30
|
+
|---|---|---|
|
|
31
|
+
| `plan-approval` | pre-PR | Reads the plan committed on the builder branch, before any code exists |
|
|
32
|
+
| `dev-approval` | pre-PR | **PIR's distinctive gate** — reviews the *running* worktree via `afx dev` |
|
|
33
|
+
| `pr` | post-PR | Reviews on GitHub, then approves; porch wakes the builder to merge |
|
|
164
34
|
|
|
165
|
-
|
|
35
|
+
The `pr` gate holds the merge behind porch state: the human approves, the architect relays that
|
|
36
|
+
approval, and the builder records it with `porch approve pr` before porch hands over the merge task.
|
|
166
37
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
38
|
+
**Gates do not notify the architect automatically.** Porch broadcasts `overview-changed` over
|
|
39
|
+
SSE; the VSCode Builders tree renders the blocked state with a bell and raises a toast. CLI
|
|
40
|
+
users see it via the builder pane or `porch pending`. The builder's job at any gate is: write
|
|
41
|
+
the artifact, commit, signal, wait — then run `porch approve` when the architect relays the human's
|
|
42
|
+
approval, never on your own initiative.
|
|
171
43
|
|
|
172
|
-
|
|
44
|
+
## Rejection is iteration, not a command
|
|
173
45
|
|
|
174
|
-
|
|
46
|
+
There is no `porch reject`. Feedback arrives however is convenient — editing the plan file,
|
|
47
|
+
typing in the builder pane, `afx send`, an issue comment — the builder revises and recommits,
|
|
48
|
+
and **the gate stays pending until a human approves it**. The same pattern works at both
|
|
49
|
+
pre-PR gates.
|
|
175
50
|
|
|
176
|
-
|
|
51
|
+
## Artifacts
|
|
177
52
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
[PIR #<N>] Add Android-side regression test
|
|
182
|
-
```
|
|
53
|
+
Plan and review live in `codev/plans/` and `codev/reviews/` on the builder branch and ship to
|
|
54
|
+
the default branch with the merge. The review is shaped like SPIR's (Summary, Architecture
|
|
55
|
+
Updates, Lessons Learned) so `codev/reviews/` stays semantically consistent across protocols.
|
|
183
56
|
|
|
184
|
-
|
|
57
|
+
## Consultation
|
|
185
58
|
|
|
186
|
-
|
|
59
|
+
**One advisory CMAP pass at the PR** (`max_iterations: 1`) — no iterate-until-APPROVE loop. A
|
|
60
|
+
`REQUEST_CHANGES` escalates to the human at the `pr` gate rather than triggering an automatic
|
|
61
|
+
re-review.
|
|
187
62
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
63
|
+
That footprint is a **design invariant, and it is fragile**: porch resolves models as
|
|
64
|
+
*config > protocol*, so a project-wide `porch.consultation.models` (say a SPIR-tuned 3-model
|
|
65
|
+
list) silently inflates PIR's cost. Leave it unset, or scope it per-protocol.
|
|
191
66
|
|
|
192
|
-
|
|
67
|
+
## Builder session
|
|
193
68
|
|
|
194
|
-
|
|
69
|
+
A long-running interactive session in a Tower-managed PTY, launched as `claude "<prompt>"`
|
|
70
|
+
inside a restart loop and pinned to a session id minted at spawn. Typed input reaches the live
|
|
71
|
+
session immediately; the loop is crash recovery, not the gate-wait mechanism. There is no
|
|
72
|
+
"session ended at gate" state. On a crash the loop **resumes the pinned conversation** (context
|
|
73
|
+
intact, plus a re-orientation nudge) rather than replaying the spawn prompt; only an unresumable
|
|
74
|
+
session degrades to a fresh prompt-replay relaunch. A deliberate quit relaunches fresh.
|
|
195
75
|
|
|
196
|
-
|
|
197
|
-
codev/plans/<id>-<slug>.md # written in plan phase, on builder branch
|
|
198
|
-
codev/reviews/<id>-<slug>.md # written in review phase (post-dev-approval-approval), on builder branch; becomes PR body
|
|
199
|
-
codev/projects/<id>-<slug>/status.yaml # porch state, managed automatically
|
|
200
|
-
```
|
|
76
|
+
## Configuration
|
|
201
77
|
|
|
202
|
-
The
|
|
78
|
+
The `worktree` block in `.codev/config.json` is what makes the `dev-approval` gate work — see
|
|
79
|
+
the `runnable-worktrees` skill for `symlinks`, `postSpawn` and `devCommand`.
|
|
@@ -1,91 +1,60 @@
|
|
|
1
1
|
# {{protocol_name}} Builder ({{mode}} mode)
|
|
2
2
|
|
|
3
|
-
You are
|
|
3
|
+
You are implementing {{input_description}}.
|
|
4
4
|
|
|
5
5
|
{{#if mode_soft}}
|
|
6
6
|
## Mode: SOFT
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- The architect monitors your work and verifies you're adhering to the protocol
|
|
10
|
-
- Use `consult` for the 3-way investigation and critique phases
|
|
7
|
+
|
|
8
|
+
You follow the protocol yourself; the architect verifies compliance.
|
|
11
9
|
{{/if}}
|
|
12
10
|
|
|
13
11
|
{{#if mode_strict}}
|
|
14
12
|
## Mode: STRICT
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
- Follow porch signals and gate approvals
|
|
19
|
-
|
|
20
|
-
### ABSOLUTE RESTRICTIONS (STRICT MODE)
|
|
21
|
-
- **NEVER edit `status.yaml` directly** — only porch commands may modify project state
|
|
22
|
-
- **NEVER call `porch approve` without explicit human approval** — only run it after the architect says to
|
|
23
|
-
- **NEVER skip the 3-way consultation** — always follow porch next → porch done cycle
|
|
13
|
+
|
|
14
|
+
Porch orchestrates. `porch next` gives you tasks; `porch done` signals completion. Never
|
|
15
|
+
hand-edit `status.yaml` — only porch commands modify project state.
|
|
24
16
|
{{/if}}
|
|
25
17
|
|
|
26
18
|
## Protocol
|
|
27
|
-
Follow the RESEARCH protocol. Read and internalize the protocol before starting any work. The full protocol text is included below under **## Protocol Reference (full text)**.
|
|
28
19
|
|
|
29
|
-
|
|
20
|
+
The full protocol text is inlined below under **## Protocol Reference (full text)** — you do not
|
|
21
|
+
need to fetch it.
|
|
30
22
|
|
|
31
|
-
|
|
23
|
+
## Research Topic
|
|
32
24
|
|
|
33
|
-
|
|
34
|
-
2. **Investigate** — Dispatch the brief to 3 models (Gemini, Codex, Claude) in parallel. Each investigates independently. No anchoring — they don't see each other's work.
|
|
35
|
-
3. **Synthesize** — Read all 3 reports. Identify consensus, disagreements, and unique contributions. Write a single synthesis report organized by topic (not by model).
|
|
36
|
-
4. **Critique** — Send the synthesis back to all 3 models for critique. Incorporate valid feedback. Document rejected critique. Finalize the report.
|
|
25
|
+
{{task_text}}
|
|
37
26
|
|
|
38
|
-
## Output
|
|
27
|
+
## Output
|
|
39
28
|
|
|
40
|
-
|
|
41
|
-
- `<topic>-brief.md` — the scoped question (Phase 1)
|
|
42
|
-
- `<topic>-gemini.md`, `<topic>-codex.md`, `<topic>-claude.md` — individual investigations (Phase 2)
|
|
43
|
-
- `<topic>.md` — the final synthesis report (Phase 3+4, this is the deliverable)
|
|
44
|
-
- `<topic>-critique-rebuttals.md` — critique responses (Phase 4)
|
|
45
|
-
|
|
46
|
-
{{#if task}}
|
|
47
|
-
## Research Topic
|
|
48
|
-
{{task_text}}
|
|
49
|
-
{{/if}}
|
|
29
|
+
`codev/research/<topic>.md`
|
|
50
30
|
|
|
51
31
|
## Key Principles
|
|
52
32
|
|
|
53
|
-
- **Triangulate**: consensus across
|
|
54
|
-
- **Cite sources
|
|
55
|
-
- **
|
|
56
|
-
- **
|
|
57
|
-
- **
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
## Using consult for 3-way Investigation
|
|
33
|
+
- **Triangulate**: consensus across three models beats any single model's claim
|
|
34
|
+
- **Cite sources**; be candid about uncertainty — "I don't know" beats confabulation
|
|
35
|
+
- **Organize by topic, not by model** — the synthesis is a standalone document
|
|
36
|
+
- **Note surprises**: the most valuable findings are usually the unexpected ones
|
|
37
|
+
- **Preserve disagreement**: smoothing over conflict destroys the signal that made a 3-way
|
|
38
|
+
investigation worth running
|
|
39
|
+
- Keep the synthesis shorter than the sum of its investigations
|
|
61
40
|
|
|
62
|
-
|
|
41
|
+
## Dispatching the investigation
|
|
63
42
|
|
|
64
43
|
```bash
|
|
65
|
-
#
|
|
44
|
+
# investigate — parallel, independent
|
|
66
45
|
consult -m gemini --prompt-file codev/research/<topic>-brief.md --output codev/research/<topic>-gemini.md &
|
|
67
|
-
consult -m codex
|
|
46
|
+
consult -m codex --prompt-file codev/research/<topic>-brief.md --output codev/research/<topic>-codex.md &
|
|
68
47
|
consult -m claude --prompt-file codev/research/<topic>-brief.md --output codev/research/<topic>-claude.md &
|
|
69
48
|
wait
|
|
70
|
-
```
|
|
71
49
|
|
|
72
|
-
|
|
73
|
-
```bash
|
|
74
|
-
# Phase 4: parallel critique
|
|
50
|
+
# critique — same shape, pointed at the synthesis
|
|
75
51
|
consult -m gemini --prompt "Critique this research synthesis for gaps, errors, and bias:" --prompt-file codev/research/<topic>.md --output codev/research/<topic>-critique-gemini.md &
|
|
76
|
-
consult -m codex
|
|
52
|
+
consult -m codex --prompt "Critique this research synthesis for gaps, errors, and bias:" --prompt-file codev/research/<topic>.md --output codev/research/<topic>-critique-codex.md &
|
|
77
53
|
consult -m claude --prompt "Critique this research synthesis for gaps, errors, and bias:" --prompt-file codev/research/<topic>.md --output codev/research/<topic>-critique-claude.md &
|
|
78
54
|
wait
|
|
79
55
|
```
|
|
80
56
|
|
|
81
|
-
##
|
|
82
|
-
1. Read the RESEARCH protocol document
|
|
83
|
-
2. Understand the research question from the architect
|
|
84
|
-
3. Write the research brief (Phase 1)
|
|
85
|
-
4. Wait for scope-approval before proceeding to investigation
|
|
86
|
-
|
|
87
|
-
---
|
|
88
|
-
|
|
89
|
-
## Protocol Reference (full text)
|
|
57
|
+
## Notifications
|
|
90
58
|
|
|
91
|
-
|
|
59
|
+
The architect is not watching. `afx send architect "..."` at each of: gate reached, PR ready, PR
|
|
60
|
+
merged, blocked.
|