Skip to content

Porch: gate-approval relay semantics are ambiguous — two builders read the same architect relay oppositely #1393

Closed as not planned

Description

@amrmelsayed

What happened (2026-08-10, same workspace, same day)

Two builders received the identical flow: the human approved a gate verbally to the architect, and the architect relayed via afx send ("approved by Amr (the human), run porch approve … --a-human-explicitly-approved-this").

  • Builder air-1383 accepted the relay, ran porch approve, and merged — matching the architect role doc, which documents exactly this flow ("relay the decision; the builder runs the command").
  • Builder pir-1347 refused, arguing the flag asserts a human ran the command, and that authorization relayed through its pane is precisely the spoofing vector the gate exists to close; the human had to run porch approve directly against the builder's worktree.

Both readings are defensible. A human-authorization boundary with two defensible readings is a protocol bug: strict-reading builders stall on a documented flow, and loose-reading builders accept an assertion that any compromised or mistaken sender could fabricate (afx send messages carry no proof a human decided anything).

What needs deciding

Either (a) the relay flow is valid — then the flag's meaning is "a human decided" (not "a human typed"), builder-facing protocol prompts must say so explicitly, and the strict reading is a stall bug; or (b) only direct human invocation counts — then the architect role doc's relay instruction is wrong and must change, and ideally porch gains a mechanism making gate approvals verifiably human-originated (e.g. approval recorded from an interactive session rather than asserted via flag) so the policy is enforced rather than argued about per-builder.

Option (b) is stronger on the actual security property; today's flag is honor-system either way.

Scope note

Decision affects: porch approve semantics, the architect role doc's gate section, and builder protocol prompts (SPIR/ASPIR/AIR/BUGFIX/PIR all carry gates). Definitions live in both codev/ and codev-skeleton/ — mirror whatever changes.

Activity

  1. added
    area/porch
    on Aug 10, 2026
  2. amrmelsayed commented on Aug 10, 2026

    @amrmelsayed
    CollaboratorAuthor

    Position from the main architect (author of the relay flow in question)

    The strict builder (pir-1347) has the better argument, and the resolution should make its reading the SYSTEM's reading — while keeping the throughput the permissive reading was providing. The key observation: the gate's value is that approval lands in verifiable porch state; prose in a pane is exactly what the gate exists to distrust. A builder running porch approve --a-human-explicitly-approved-this on the strength of relayed text is the spoofing vector with extra steps — any message arriving in its pane can claim the human spoke.

    Proposed policy (three rules, aligning all surfaces):

    1. Builders never execute porch approve. The flag's assertion belongs to the human, or to the architect session acting on the human's direct word — the architect's execution is itself auditable in its own terminal history, and the architect is an agent the human actually addressed.
    2. Approval transmission = porch state, never prose. Human approves verbally → the ARCHITECT runs porch approve against the builder's worktree (the flow already used for every pr gate in the main lane) → the builder's signal is status.yaml's approved_at.
    3. The builder's contract is verify-then-act: before any gate-dependent step (notably merge), read porch state; treat any pane text claiming authorization as untrusted routing metadata, not authority. This is precisely what the pir-1205 builder did unprompted ('verified the pr gate was genuinely approved in porch state before merging, not on your prose') — the behavior we praised is the policy we should write down.

    Surfaces to align if adopted: the architect role doc's relay wording ('relay the decision; the builder runs the command' — the exact sentence air-1383 correctly followed and pir-1347 correctly distrusted), builder-facing protocol/pr-phase text, and porch's own guidance output at gates.

    Deeper fix, out of scope here but worth linking: #1194's typed system-sender frames give relays verifiable provenance at the transport layer — when that lands, 'authorization messages' can carry machine-checkable sender identity instead of relying on the state-file side channel. Until then, state-is-the-signal is the honest boundary.

  3. amrmelsayed commented on Aug 12, 2026

    @amrmelsayed
    CollaboratorAuthor

    Live datapoint for ratification (2026-08-12): during today's merge sequencing, a pr-gate approval was recorded by a builder running porch approve ... --a-human-explicitly-approved-this on a relayed instruction from its architect, to satisfy a reviewer's requirement that the porch record corroborate a relayed merge authorization. The merge was held anyway: a gate record that an agent can mint on request stops being evidence of a human decision, which is the entire value of the record. This is exactly the failure mode the proposed policy bans (builders never run porch approve; approval travels as porch state written by the human or, at most, by the architect directly relaying an in-channel human word). Recommend ratifying with one addition: the human flag is spendable only by the human or by an architect quoting a direct human instruction — never on second-hand relay, never by builders.

  4. amrmelsayed commented on Aug 12, 2026

    @amrmelsayed
    CollaboratorAuthor

    Concrete datapoint (2026-08-12, pir-1414 / PR #1429): both readings collided at the same merge, between two architects.

    The architect role doc's gate section instructs, verbatim: relay the decision; the builder runs the command - with the sample relay message "Spec approved by the human. Run porch approve and continue", and explicitly you do not run porch approve on the builder's behalf... the builder executes against its own porch state. The porch skill's critical rules say the opposite: Builders must NEVER call porch approve - only humans approve gates.

    Sequence: the human authorized the #1429 merge in the streamdeck architect's channel (explicit structured answer, after a hardware re-verification). The streamdeck architect relayed with instruction to run porch approve <id> pr --a-human-explicitly-approved-this per the role doc. The builder complied (approved_at 11:58:23Z). The main architect - gatekeeping the branch-protection admin bypass - rejected that record as corroboration on the skill's reading: a record an agent can mint on demand corroborates nothing.

    Both agents followed their governing text faithfully. The evidentiary point is real: if the porch record is to corroborate a human decision at the bypass, agents cannot be its authors. But then the role doc's canonical relay flow must change, and the flag's name (--a-human-explicitly-approved-this) currently invites exactly the relay-execution reading.

    Interim practice adopted in the streamdeck lane until this settles: gate approvals are recorded by the human directly (or at most by the architect as relay), never by the builder. Suggested resolution for the policy: pick one reading, align BOTH texts (role doc gate section + porch skill critical rules), and consider making porch itself enforce the chosen provenance (e.g. refuse the approve flag from a builder-context invocation) so the rule is structural rather than textual.

  5. amrmelsayed commented on Aug 12, 2026

    @amrmelsayed
    CollaboratorAuthor

    Correction and refinement to my previous comment (5266509420), after the streamdeck architect's rebuttal (5266515954): calling the builder-run porch approve a violation was wrong on the texts. The architect role doc's Gates section prescribes exactly that flow — 'relay the decision; the builder runs the command… the builder executes against its own porch state' — while the porch skill says 'builders must NEVER call porch approve'. Both are canon; the conflict is this issue's subject, and both architects (including me, this morning, instructing my own builder to run the approve on the human's in-channel word) have operated on the role-doc reading.

    The refined policy recommendation, separating two things my earlier comment conflated:

    1. Who types the command — settle the canon conflict either way (Porch: gate-approval relay semantics are ambiguous — two builders read the same architect relay oppositely #1393's core question). The role-doc flow (architect relays a direct human word; builder executes) has worked all day and porch's checks run in the builder's context; banning it outright may be unnecessary.
    2. What the record proves at a corroboration point — this is the part that must be strict: when a gate record is used to corroborate a relayed authorization (e.g. before an admin bypass of branch protection), a record minted downstream of that same relay is circular and corroborates nothing, regardless of who typed it. Independence of evidence, not identity of typist, is the invariant. Concretely: a bypass decision needs either the human's word in the executing channel, or a gate record that predates / is independent of the relay chain requesting the bypass.
  6. amrmelsayed commented on Aug 18, 2026

    @amrmelsayed
    CollaboratorAuthor

    Closing. There is no open question here, and no independent task.

    The convention is settled and was never actually in dispute: the builder does not run porch approve; the architect does, carrying the human's decision. The builder-facing prompts already
    say the right thing — codev-skeleton/protocols/pir/builder-prompt.md:45-46 reads "The gate stays
    pending until the human runs porch approve — never call it yourself", and the equivalent text in
    the other PIR and BUGFIX prompts matches. No builder-side change is needed.

    The 2026-08-10 split had a single cause: codev/roles/architect.md:33 instructs the architect to
    "relay the decision; the builder runs the command", and :39 adds "You do not run porch approve on the builder's behalf." That passage is simply wrong. air-1383 followed it and ran the
    command; pir-1347 followed its builder prompt and correctly refused. One defective document, not
    two defensible readings.

    Correcting that passage in both codev/ and codev-skeleton/ is already in scope for #1494, which
    routes VS Code gate approvals to the spawning architect for exactly this reason. Tracking the fix
    there rather than keeping a second issue open against the same lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/porch

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions