repositories / smith

smith

There are many coding harnesses - but this one is fast

owned by bugabinga

Switch the merge method to squash (#26)

468ec5d68a6187c3ad00344c06b94ecf45475c3f

Oliver Jan Krylow <oliver@bugabinga.net> ·

SSH signature · not checked

Browse filesCompare with HEAD

## What forced this
`require signed commits` + `rebase-merge` cannot coexist: GitHub
re-parents commits on a rebase, invalidating their signatures, and won't
re-sign — so a rebase-merge can never satisfy a signed-commits rule (the
block you hit). It also broke `adw-automerge`, which armed auto-merge
with `--rebase` against a now squash-only repo.

## The call
Squash is the method. GitHub signs the single commit it creates on a
squash, so signed-commits + linear history are both satisfied; and since
the ADW enforces one issue → one PR → one decision, a squash is
one-commit-per-decision — the granularity §7 protected is preserved, not
lost.

## What we deliberately didn't do
Not merge-commits (signed, but breaks linear history) and not dropping
enforced signing (weaker). Squash is the only method that keeps all
three of signed + linear + decision-granular.

## Evidence
The `main` ruleset (`required_signatures` + `required_linear_history`)
is satisfied by a squash commit; a rebase commit cannot be, per GitHub's
own "rebase merges cannot be automatically signed" error.

## Surface touched
`.github/workflows/adw-automerge.yml` (`--rebase`→`--squash`),
PROJECT-INVARIANTS §7 + Change Log, and the merge/signing prose +
diagram in `docs/plans/AGENTIC-DEVELOPMENT.md`.

## If this ages badly
If GitHub ever signs rebase-merges, revisit §7; the merge-method setting
and this rule move together.

---
_Generated by [Claude
Code](https://claude.ai/code/session_01LABEHeVpg74oyZNtWLUWpB)_

Co-authored-by: Claude <noreply@anthropic.com>

Changed files (3)

+34 / −25 text lines

Diff layout

.github/workflows/adw-automerge.yml

Modified

+2 / −2 text lines

11# ADW auto-merge — turns on GitHub's native auto-merge for agent-authored PRs.
22# Deterministic, no Claude: it does not merge, it *arms* auto-merge, and GitHub
3# then merges the PR by rebase the instant the ruleset's gate is satisfied
3# then merges the PR by squash the instant the ruleset's gate is satisfied
44# (required checks green — including `merge-gate` — and any code-owner review).
55# A blocking label keeps `merge-gate` red, so nothing merges until the reviewers
66# have cleared it. High severity (`risk:high`) holds it for the owner.
3232 private-key: ${{ secrets.APP_PRIVATE_KEY }}
3333 - env:
3434 GH_TOKEN: ${{ steps.token.outputs.token }}
35 run: gh pr merge ${{ github.event.pull_request.number }} --auto --rebase --repo ${{ github.repository }}
35 run: gh pr merge ${{ github.event.pull_request.number }} --auto --squash --repo ${{ github.repository }}

docs/PROJECT-INVARIANTS.md

Modified

+17 / −12 text lines

338338 canonical and load-bearing.
339339- **Integration is by pull request.** Every change lands through a PR — the ADW
340340 spine. Direct pushes to `main` are reserved for the owner (the spec touchpoint).
341- **Preserve per-commit history — merge by rebase.** One commit, one decision
342 (CLAUDE.md, "Writing commits and PRs"). PRs integrate with **rebase-merge**,
343 which keeps history linear *and* keeps every commit meaningful for `bisect` and
344 `blame`. **Squash-merge is forbidden** — it destroys the per-decision commits
345 the message discipline exists to produce. Merge commits are avoided; enforce
346 this by allowing only rebase-merge in the repo's merge-method settings.
341- **One PR, one commit — merge by squash.** One issue → one PR → one decision, so
342 a squash lands exactly **one commit per decision** on `main`: history stays
343 linear and every commit is still meaningful for `bisect` and `blame`. This
344 reverses the earlier rebase-only rule for a hard reason: **GitHub cannot sign a
345 rebase-merge** (it re-parents each commit, invalidating any signature, and won't
346 re-sign), so *rebase-merge + required signed commits is impossible*. GitHub
347 **does** sign the single commit it creates on a **squash**, so squash is the only
348 method that satisfies signed-commits *and* linear history at once. Merge commits
349 stay disallowed (they break linearity). Enforce by allowing only squash-merge in
350 the repo's merge-method settings.
347351- **Commits on `main` are signed.** Every commit that lands on `main` must be
348 **Verified**. Agents commit through GitHub's API under the App installation
349 token (`use_commit_signing`), which signs automatically; owner edits from the
350 GitHub web UI are auto-signed; GitHub signs the rebase-merge commits it creates.
351 Enforced by the `main` branch ruleset (`.github/rulesets/main.json`, *Require
352 signed commits*). A local unsigned commit (bare git/`jj` without a signing key)
353 is rejected on `main` — sign it or route it through the web UI.
352 **Verified**. GitHub signs the squash commit it creates on merge, so a PR merges
353 Verified regardless of whether its branch commits were signed. Agents also sign
354 at creation via `use_commit_signing` (branch commits show Verified too); owner
355 edits made through the GitHub **website** are auto-signed. Enforced by the `main`
356 branch ruleset (`.github/rulesets/main.json`, *Require signed commits*). Caveat:
357 the GitHub **mobile app does not sign** — commit from a browser, not the app.
354358- **Commit messages:** plain imperative subject naming the decision or its
355359 effect; no required type prefix; argue *why*, not *what*; no AI attribution.
356360- **Branch naming:** `feature/description`, `fix/description`, or the ADW's
520524| Date | Change | Author |
521525|------|--------|--------|
526| 2026-07-19 | §7 switch rebase→squash merge: rebase-merge can't be signed, so squash is the only method that satisfies signed-commits + linear history; one-PR-one-decision keeps squash = one-commit-per-decision (user-directed) | smith-spec |
522527| 2026-07-18 | §1 scope note: Astro site exempt from the package.json ban, confined to `site/`; book stays mdBook (cargo-native) (user-directed) | smith-spec |
523528| 2026-07-18 | §7 require signed commits on `main`, enforced by the branch ruleset (unlocked by going public) (user-approved) | smith-spec |
524529| 2026-07-18 | §7 reconciled to git/GitHub reality (rebase-merge, squash forbidden, jj optional); §1 CI-as-orchestration note; §2 plans tree + ADW-encoding note; §5 ADW config protected; §8a release-lifecycle pointer (user-directed audit) | smith-spec |

docs/plans/AGENTIC-DEVELOPMENT.md

Modified

+15 / −11 text lines

180180 alt reviewed + security-cleared, no blocking label
181181 Note over PR,Trunk: native auto-merge, gated by merge-gate
182 PR->>Trunk: rebase-merge (signed) — card→Done
182 PR->>Trunk: squash-merge (signed) — card→Done
183183 Trunk-->>Sur: front clears → next slice
184184 else risk:high / sev:high
185185 Note over PR,Owner: Touchpoint 3 — PR review
253253Nothing needs a bespoke merge robot. The close of the loop is **GitHub's native
254254auto-merge**, armed for every agent PR and released by the ruleset's gate:
2561. `adw-automerge` arms auto-merge (rebase) on each bot-authored, non-Dependabot
2561. `adw-automerge` arms auto-merge (squash) on each bot-authored, non-Dependabot
257257 PR the moment it opens. GitHub now merges it *itself* the instant its gate is
258258 green — no agent watches, polls, or clicks.
2592592. The gate is the ruleset's **required status checks** plus its code-owner rule.
482482 lands **Verified**, signed by `agent-smith-bugabinga-adc` — no keys to manage,
483483 no local GPG. The owner's own edits from the GitHub web UI are auto-signed too,
484484 so the phone-only path stays Verified.
485- **Enforce it — now possible.** A branch **ruleset** on `main` with *Require
486 signed commits* + *Require a pull request before merging* (CODEOWNERS review) +
487 *Require linear history* makes only Verified, reviewed, rebase-merged commits
488 land. This was blocked while the repo was private on the free plan; going public
489 removed the block. It is the one owner enable-step (issue #14), and a proposed
490 upgrade to the PROJECT-INVARIANTS §7 version-control rule — pending owner
491 approval before that invariant is edited.
485- **Enforce it.** A branch **ruleset** on `main` with *Require signed commits* +
486 *Require a pull request before merging* (CODEOWNERS review) + *Require linear
487 history* makes only Verified, reviewed, squash-merged commits land. This was
488 blocked while the repo was private on the free plan; going public removed the
489 block, and PROJECT-INVARIANTS §7 now enforces it.
490 **Merge method: squash, not rebase.** GitHub *cannot* sign a rebase-merge (it
491 re-parents commits, invalidating signatures, and won't re-sign) — so
492 rebase-merge + required-signed-commits is impossible. GitHub signs the single
493 commit it creates on a **squash**, and because one PR = one decision, a squash is
494 one-commit-per-decision. So squash is the method (§7).
493496The cost of enforcement is that a local unsigned commit (bare git/jj with no
494497signing key) would be rejected on `main` — acceptable for a mostly-agent +
508511the workflows, the agent files, the invariants — still requires the owner's
509512review. That is touchpoints 1 and 3, expressed as one rule: the spec and the
510513machinery are gated to the human; everything the spec already implies flows on
511its own. GitHub signs the rebase-merge commits it creates on merge, so
512`required_signatures` is satisfied without the App holding a key.
514its own. GitHub signs the **squash** commit it creates on merge, so
515`required_signatures` is satisfied even when a PR's branch commits were unsigned —
516which is exactly why the merge method must be squash, not rebase (§7).
514518The ruleset also lists the **`merge-gate`** status check as required (that is what
515519native auto-merge waits on — see *Merging*) and grants the **repository-admin role