Learn why a green working tree is not a green commit
Status: Ready
Article ID: 119
Truth label: Historical
Audience: Contributor and release reviewer
Reader outcome: Verify committed source separately in a shared worktree.
Related articles: 089, 110, 117
Target week: 48
Last verified: 2026-09-13
Technical reviewer: Codex incident evidence audit
Editorial reviewer: Codex editorial audit
Problem
Several sessions edited one worktree. Commits omitted untracked dependencies or carried only part of a shared file, leaving HEAD unable to import or serve a route while the working tree still contained the missing code.
Misleading success signal
Every local test passed because Python and the test runner read the combined
working tree. git add <path> also staged every hunk in that file, including
changes the committing session did not write.
Evidence
The repository instructions record five affected commits from two sessions and the two mechanical checks that would have caught them: inspect every staged hunk and exercise an archive of HEAD.
Correction
Contributors inspect per-file diffs before staging, sweep git status --short
for untracked dependencies, and extract git archive HEAD to a temporary
directory for import and critical test checks.
Mechanical prevention
CI should build from the commit object, not a developer worktree. A pre-push or release gate can archive HEAD, install from the locked environment, import the services, and run the required suite. Reviewers compare staged and unstaged diffs explicitly.
Current status
The repository now documents the shared-worktree rule, and the Academy applies
the same check to its own commits by extracting HEAD and running its gate
there. The verification lesson applies to any commit and to CI.
Current limits
An archived commit test still may not match packaging, deployment configuration, or external services. It also cannot identify authorship of mixed hunks without coordination evidence.
Next lesson
Continue with Build your own local-first agent control plane.
Derivative map
- Weekly package: WEEK-48
- Long video: VIDEO-W48-LONG
- Shorts: SHORT-W48-PROBLEM, SHORT-W48-MECHANISM, SHORT-W48-WARNING
- Email: EMAIL-W48
- LinkedIn: LI-W48-A, LI-W48-B
- X: X-W48-A, X-W48-B
- Visual: VISUAL-W48
Review record
- Historical shared-tree failures and current instructions remain distinct.
- Green working tree and broken HEAD mechanism is explicit.
- Staged-hunk, untracked-dependency, and archive checks included.
- Package, deployment, and authorship limits remain explicit.
Review completed: 2026-08-27
Re-audited against the running product: 2026-09-13