Skip to content

D239 — branches up to date before merging: what was checked is what lands (G22) - #435

Merged
napkinstack-agent[bot] merged 1 commit into
mainfrom
d239-branches-up-to-date
Nov 18, 2026
Merged

napkinstack-agent[bot] merged 1 commit into
mainfrom
d239-branches-up-to-date

Conversation

@napkinstack-agent

Copy link
Copy Markdown
Contributor

Closes #430.

Why

On #430's project, two pull requests of one deliverable each turned green on their own base:

  • A: the consumer module reads contract minutes/v4;
  • B: the producer module provides minutes/v4.

They merged green one after the other. Together, B1 failed on main: it fires only once a manifest provides v4. No check ever judged the two together. The pre-push hook then refused every push of every contributor for forty minutes.

What

The decider chose the first of three options: G22 is blocking, and nstack settings asks for it.

flowchart LR
  A[PR A merges] --> M[main moves]
  M --> B{PR B up to date with main?}
  B -->|no: G22 refuses the merge| U[B takes main in, by a merge;<br/>its checks run on main + A + B]
  U -->|B1 fails in B, main stays green| F[fix in B]
  U -->|green| G[B merges]
  B -->|yes| G
Loading

Legend: what G22 changes once A has merged; only B waits, and only when B and A clash.

  • nstack doctor G22: branches up to date before merging. It reads the ruleset's strict_required_status_checks_policy, or a merge queue, from every ruleset GitHub layers on the branch. G4 now also reads every layer. G22 is blocking and in the private plan's reach list.
  • nstack settings asks for the required checks up to date. It asked for them not up to date before. On a project whose ruleset is older, it adds a ruleset with the strict rule, and doctor reads both.
  • 05-workflow.md, Up to date before merging: three habits that keep it cheap.
    • Update at the last moment. Only the pull request about to merge takes main in. That is one update per merge, not N²/2.
    • Update by merging main in, never by a rebase. Where stale approvals are dismissed, the forge may ask for the approval again, and the approver reads only what main brought.
    • One merge at a time. Where checks are attested, the next pull request is attested again on the updated head. D223 keeps a module's checks while nothing they read moved.
  • Docs: RULES.md G22; 07-governance.md §7 (the row replaces the merge queue's); INSTALL.md's checklist; platform/README.md G1–G22. Register row D239.
  • Existing projects see a gap in doctor, never a red CI.
  • Not taken:
    • pr-check judging the merge again: the forge's Fitness job already runs on the merge at its event, and no run starts when the base moves;
    • a bot updating every pull request;
    • a queue of our own;
    • a workflow that re-checks every open pull request on each push to main, which needs a write permission and leaves a race window.
  • To measure on the pilot: the updates in chain, and whether GitHub keeps an approval through a clean update.

Tests

  • test_up_to_date.py (red on main):
    • G22 read: strict, not strict, absent;
    • a merge queue;
    • every layered ruleset;
    • blocking, and named in the checklist;
    • asked by the planned ruleset, alone or with G4.
  • run.sh: the compliant fake forge carries strict. The counts follow: OK 28/27, out of reach 11, 21 checklist lines. G22 is among the gaps of a bare repository.
  • Oracle: platform tests OK. Fitness compliant.
  • Independent verifier. Its findings are fixed:
    • doctor read one required-checks rule, so a project's older ruleset hid the strict one nstack settings adds. G4 and G22 now read every rule, and a test covers it.
    • the refusal message named G4 when only G22 was asked.
    • the handbook claimed GitHub keeps an approval through an update. GitHub's own page does not promise it where stale approvals are dismissed. It now says "may", and the pilot measures it.
    • the re-attest after an update, and the merge queue's reach (organisation repositories), are now said.

🤖 Generated with Claude Code

…ands (G22)

Closes #430.

Agent-Session: nstack-os-d239

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@napkinstack-agent
napkinstack-agent Bot requested a review from a team as a code owner November 18, 2026 11:35
@napkinstack-agent
napkinstack-agent Bot merged commit e1079f1 into main Nov 18, 2026
3 checks passed
@napkinstack-agent
napkinstack-agent Bot deleted the d239-branches-up-to-date branch November 18, 2026 11:46
napkinstack-agent Bot added a commit that referenced this pull request Nov 18, 2026
… refusals said (#436)

D234–D239 (#425, #426, #431–#435).

Agent-Session: nstack-os-v0320

Co-authored-by: napkinstack-agent[bot] <330339777+napkinstack-agent[bot]@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Two pull requests each attested green turn the default branch red together: B1 sees the base of the record, not of the merge

1 participant