Repository navigation
Fix #1903: PIR prompts match porch; porch renders {{issue.number}}/{{issue.title}} - #1904
Merged
Merged
Conversation
…ext no longer claims the architect was notified
substituteVariables matched \w+ only, so the dotted tags in PIR, AIR and
BUGFIX phase prompts reached builders literally. Porch now derives the issue
id from the porch id (bare number, bugfix-<N>, tracker key) via
issueNumberFromPorchId (moved to lib/issue-id.ts), fetches the issue once,
and feeds both the tags and the Goal header — which for BUGFIX showed the
slug because fetchIssue("bugfix-N") never matched.
The gate-pending task said "The architect has already been notified"; porch
does not notify the architect (notify.ts). It now tells the builder to
afx send the architect and how to record the relayed approval.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s, pr gate, merge - protocol.json: review verify type impl -> pr (loads pr-review.md, not the pre-dev-approval impl-review.md), three reviewers by default. - Delete pir/consult-types/impl-review.md: nothing loads it any more. - review.md: builder runs the consult commands porch emits; verdicts come from porch's output (the old grep read UNKNOWN on every VERDICT: line); REQUEST_CHANGES -> rebuttal file + porch done -> pr gate; re-running porch done at the gate does not re-consult; architect relays approval, builder runs porch approve and merges with gh pr merge --merge; verify via porch next status complete; PR number from pr_history. - plan/implement/builder-prompt: builder notifies the architect at each gate (porch does not); approval wording aligned; signals informational. - Baked Decisions added to protocol.md, builder-prompt, plan, implement, pr-review. - Minor: merge-base not hardcoded main, View Diff, artifact name instead of dangling <slug>, implement.md no longer cites a null verify block. Both trees byte-identical. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…onsult shape; prompt nits
- Codex: fetchIssue was called without the workspace, so a configured
Linear/Jira/GitLab forge was ignored for {{issue.title}} and the Goal
header (the same gap pre-existed in getProjectSummary's own lookup). Pass
cwd: workspaceRoot in both. New unmocked test runs a configured
issue-view override; it fails without the fix.
- Codex: guard the shipped PIR protocol.json (review verify type "pr",
three reviewers, pr-review.md present) and byte-identity of both trees.
- Claude: review.md/builder-prompt account for porch's own "Gate X
approved" wake-up when the human approves directly; step 6 says use
porch done (not porch next) after the rebuttal, to avoid a misleading
force_advanced record.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
Author
|
Excellent work, thank you. Walking a real PIR project through porch in a scratch workspace is exactly the right check for this bug class, and the configured-forge fix was a good catch. Independent integration reviews: codex APPROVE (no issues), claude APPROVE (no blockers). CI is 8/8 green. I read the porch changes myself and agree. Before merge I would like four small things folded in here rather than filed as follow-ups (owner's fix-in-place rule; you have the context now):
Not asking for: propagating the relay sentence into the other protocols' prompts. The sibling builder on the prompt-sweep issue owns those files. |
…d}}, docstring, globbed test
1. Pin the PIR prompts. spec-1280-prompt-deletion-guard: pir joins the
builder-prompt guard; new block guards pir plan/implement/review/
pr-review on baselines captured from this PR (anti-vacuity: the Baked
Decisions carveout, and for review.md the pr-gate rule plus both forge
concepts). baked-decisions: PIR's builder-prompt, plan/implement,
pr-review and protocol.md join Phases 1-4, mirror parity and the smoke
renders (baselineName null: PIR postdates Spec 746). PIR plan/implement
contradiction clause now says "pause, flag ... and wait" like AIR's.
No retirement entry: nothing was removed.
2. porch substitutes {{pr_merge_command}} (forge pr-merge concept, failing
form when disabled), sharing one resolver with {{pr_create_command}}.
review.md step 9 runs it with CODEV_PR_NUMBER; no gh command in the
runnable block.
3. issueNumberFromPorchId docstring states the real mapping, including
that another protocol's <prefix>-<N> (secfix-1234) reads as a tracker
key, and how the prompt renderer tolerates that.
4. The shipped-prompt test lists {codev,codev-skeleton}/protocols/
{pir,air,bugfix}/prompts/*.md instead of a hand-kept list.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
9 tasks done
waleedkadous
added a commit
that referenced
this pull request
Nov 16, 2026
waleedkadous
added a commit
that referenced
this pull request
Nov 16, 2026
Conflict in porch/prompts.ts: both sides added a substituteVariables parameter (main: issue,
for {{issue.number}}; this branch: consultation). Kept both, consultation after issue, and
main's dotted-name regex now feeds this branch's unrendered-consult-token check.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PIR's prompts (mostly
prompts/review.md) disagreed withpir/protocol.jsonand with what porch does, so a builder following them literally stalled or skipped steps. Separately, porch never substituted{{issue.number}}/{{issue.title}}, so PIR, AIR and BUGFIX prompts reached builders with the literal tags. This fixes porch once and rewrites the PIR files (both trees, byte-identical) against porch's actual behavior.Fixes #1903
Problem → Root Cause → Fix
{{issue.number}}/{{issue.title}}render literallyporch/prompts.tsmatched\{\{(\w+)\}\}only; and BUGFIX's porch id isbugfix-<N>, sofetchIssue(state.id)never found the issue (BUGFIX Goal header showed the slug)issueNumberFromPorchId, moved tolib/issue-id.ts), fetches it once through the workspace's configured forge, substitutes dotted names. Unknown names are still left as written;issue.titlestays visibly unrendered if the fetch fails. No AIR/BUGFIX prompt edits needed.verifywastype: impl,["gemini","codex"]→ loadedimpl-review.md(a pre-dev-approval review)type: pr(loadspr-review.md;consult --type prfinds the PR for the branch, which exists by then), three models. Deletedimpl-review.md, which nothing loads now. Docs say how to reduce viaporch.consultation.byProtocol.pir.models.consult … --output <id>-review-iter1-<model>.txtas a task (next.ts); REQUEST_CHANGES requires a rebuttal file, thenporch donefires the gate; re-runningporch doneat a pending gate does not re-consult;gate_statusis only inporch status --json; PR numbers arepr_history[].pr_numberreview.mdsteps 4a–10 rewritten to that flow. Verdicts come from porch's own output (the oldgrep '^approve'returned UNKNOWN on a realVERDICT: REQUEST_CHANGESfile). After approval,porch nextmust returnstatus: complete+ the merge task.porch approve <id> <gate> --a-human-explicitly-approved-this→ builder merges withgh pr merge --merge. Removed "wait for porch wake-up", "human merges on GitHub", and "approve with Cmd+K G" from the builder-facing summaries.notify.ts: architect-bound gate notifications were removed on purposeafx send architect …) in plan, implement, review and builder-prompt. Porch's own gate-pending text (next.ts, "The architect has already been notified") now says porch does not notify and how to record the relayed approval.protocol.md,builder-prompt.md,plan.md,implement.md,consult-types/pr-review.md(AIR's wording, adapted for no spec).git log "$MERGE_BASE"..HEADnotmain..HEAD; View Diff (the VS Code command's name);{{artifact_name}}instead of a dangling<slug>;implement.mdno longer cites a null verify block; PR title[PIR #N] …to match the commit prefix.Testing
porch/__tests__/bugfix-1903-issue-variables.test.ts(goes throughbuildPhasePrompt): PIR id,bugfix-<N>, tracker key, failed fetch, no-issue id, plus every shipped PIR/AIR/BUGFIX prompt in both trees rendered with no{{issue.*}}left. With the porch change reverted, 20 of 21 fail (the 21st is the no-issue guard).porch/__tests__/bugfix-1903-issue-forge.test.ts(no mock): a.codev/config.jsonissue-viewoverride really runs and its title reaches{{issue.title}}and the Goal header. Fails without passing the workspace tofetchIssue.protocol.jsonreview verify istype: prwith three reviewers andpr-review.mdexists, in both trees; the two PIR trees are byte-identical.npm run buildpasses.porch, the edited PIR protocol). Plan → plan-approval → implement → dev-approval → review → consult task → simulated reviews (2× APPROVE, 1× REQUEST_CHANGES) → rebuttal task →porch done→prgate →porch donere-run at the gate (no re-consult) →porch approve→porch next= complete + merge task →porch done --merged→pr_historymarked merged. Every command and fieldreview.mdnames was checked against what porch emitted at each step. Consult itself was simulated by writing the review files, not run against live models.CMAP
fetchIssueignored a configured non-GitHub forge (also pre-existing ingetProjectSummary's lookup): it now passes the workspace. (2) Nothing pinned the PIRprotocol.jsonchange: guard added.porch done(notporch next) after the rebuttal to avoid a misleadingforce_advancedrecord.Things to look at
issueNumberFromPorchIdmoved fromagent-farm/commands/reset/context.tstolib/issue-id.ts, with a re-export so existing importers are unchanged.impl-review.mddeletion was staged early and landed in the porch commit rather than the PIR commit.ERR_INTERNAL_ASSERTIONfromagent-farm/__tests__/tunnel-edge-cases.test.tsteardown (Node http2), with every test green. bugfix-1898's builder recorded the same flake. Clean on re-run.consultskill's--protocollist omitspir.🤖 Generated with Claude Code