Skip to content

Commit a654521

Browse files
authored
docs: harden cold-start branch lifecycle (#12)
Harden cold-start branch lifecycle and post-merge evidence flow.
1 parent 3e72133 commit a654521

3 files changed

Lines changed: 48 additions & 16 deletions

File tree

AGENTS.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,20 @@ proves only its own evidence layer. Never invent or mock missing evidence.
2525
checks pass and its squash merge is present on `origin/main`. Any alternate
2626
disposition requires explicit user authorization and must not advance `dev`
2727
until the accepted commit is present on `origin/main`.
28-
- With a clean worktree, fetch `origin`, switch to `main`, fast-forward it with
29-
`git merge --ff-only origin/main`, switch to `dev`, fast-forward it with
30-
`git merge --ff-only main`, and finish with `dev` checked out. Cleanup is
31-
complete only when the worktree is clean and local `main`, local `dev`, and
32-
`origin/main` resolve to the same commit.
33-
- Never reset, discard work, force-update refs, delete branches, or push `dev`
34-
merely to complete this cleanup. If fetching fails, the worktree is dirty,
35-
either fast-forward is impossible, or the three final refs differ, stop and
36-
report the exact state instead of forcing synchronization.
28+
- With a clean worktree, fetch `origin`, switch to `main`, and fast-forward it
29+
with `git merge --ff-only origin/main`. Require the worktree to remain clean
30+
and `main` to equal `origin/main` before handling `dev`. If local `dev`
31+
exists, require it to be an ancestor of `main`, switch to it, and fast-forward
32+
it with `git merge --ff-only main`; if it does not exist, create it with
33+
`git switch -c dev` only from that checked-out, clean, synchronized `main`.
34+
Finish with `dev` checked out. Cleanup is complete only when the worktree is
35+
clean and `HEAD`, local `main`, local `dev`, and `origin/main` resolve to the
36+
same commit.
37+
- Never reset, discard work, force-update refs, delete branches, or push `dev`.
38+
If fetching fails, the worktree is dirty, `main` cannot fast-forward to
39+
`origin/main`, an existing `dev` cannot fast-forward to `main`, or the four
40+
final refs differ, stop and report the exact state instead of forcing
41+
synchronization.
3742

3843
## Current milestone: Public Preview
3944

@@ -58,9 +63,9 @@ The accepted identity is:
5863

5964
Before changing repository visibility:
6065

61-
1. Resolve or explicitly defer every open dependency pull request that is not
62-
ready to merge. Dependabot PR #2 must not merge while its credential-free CI
63-
is failing; record its disposition in `ROADMAP.md`.
66+
1. Resolve or explicitly defer every dependency disposition that `ROADMAP.md`
67+
still records as unresolved; its pre-visibility dependency disposition table
68+
is the durable source of truth.
6469
2. Keep `.github/CODEOWNERS` absent until a real multi-maintainer model exists.
6570
3. Keep scheduled and manually dispatched live smoke fail-closed behind
6671
`LIVE_SMOKE_ENABLED=true`, and keep `RELEASE_PLEASE_ENABLED` disabled through

RELEASING.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,37 @@ and an offline mocked call.
9090
Record every command, outcome, skipped check, and unavailable tool in the
9191
verification record.
9292

93+
## Final post-merge evidence
94+
95+
After a pre-visibility pull request is squash-merged, complete its evidence
96+
record against the resulting default-branch commit:
97+
98+
1. Fetch `origin`, obtain the pull request's squash-merge SHA, verify that it is
99+
an ancestor of `origin/main`, and capture the current `origin/main` commit as
100+
the final `main` SHA.
101+
2. Wait for the credential-free default-branch `CI` run for that final `main`
102+
SHA and require every blocking job to pass. Record the run URL; pull-request
103+
CI is not a substitute for this post-merge run.
104+
3. Perform a read-only authorization-boundary audit. Record the repository's
105+
observed current visibility and other relevant observable state separately
106+
from the lifecycle attestation that this workflow made no visibility,
107+
settings, rules, secrets, or environments mutation and performed no live API,
108+
tag, release, or PyPI operation. Do not treat state hidden by permissions as
109+
affirmative evidence.
110+
4. Follow the `AGENTS.md` branch lifecycle using only fast-forward updates, then
111+
require a clean worktree on `dev` with `HEAD`, local `main`, local `dev`, and
112+
`origin/main` equal to the final `main` SHA. Never push `dev`.
113+
5. Add a timeline comment to the merged pull request containing its squash-merge
114+
SHA, the verified ancestry from that commit to the final `main` SHA, the final
115+
`main` SHA, default-branch CI result and URL, observed boundary-audit state,
116+
lifecycle attestation, and local worktree and ref state. Use that comment as
117+
the durable final evidence record and retain its URL.
118+
119+
If any required evidence fails or is unavailable, stop and report the exact
120+
state instead of claiming completion. A commit cannot truthfully record its own
121+
future squash-merge SHA, post-merge CI, or final comment URL; do not create
122+
another commit to chase that circular record.
123+
93124
## Workflow validation
94125

95126
The repository wrapper pins `actionlint` 1.7.12 and verifies the release

ROADMAP.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,6 @@ Failed or unavailable checks:
231231
not replacement evidence for PR #9. An earlier intentional offline actionlint
232232
probe in a fresh detached worktree failed closed before the verified cache was
233233
populated; it is not final-candidate validation evidence.
234-
- The execution environment rejected `rm -rf dist` before it ran, so no file was
235-
removed. The final candidate instead used the newly created empty
236-
`dist/previsibility-20260723` directory and completed the equivalent clean
237-
build, inspection, and two-artifact install gates there.
238234

239235
Remote evidence:
240236

0 commit comments

Comments
 (0)