Skip to content

chore(git): ignore .worktrees/ so a session worktree cannot dirty the tree - #1200

Merged
github-actions[bot] merged 3 commits into
mainfrom
feat/ignore-worktrees
Nov 18, 2026
Merged

github-actions[bot] merged 3 commits into
mainfrom
feat/ignore-worktrees

Conversation

@aitrawog

@aitrawog aitrawog commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

charly task verify fails today, and the cause is an untracked directory that neither placement rule forbids.

Measured:

$ ./charly/bin/charly task verify
  [fail] check — the pin contract holds — every distro-* gitlink equals charly's own box/* gitlink (the EDGE), and every submodule
        [fail] run — run git-submodules in the selected mode
            verify: 1 failure(s): charly: dirty working tree

And the working tree:

$ git -C charly status --short
?? .worktrees/

.worktrees/ is not a change. It is where a session worktree lives — and two sanctioned placements exist: the subrepo's own .worktrees/ (charly's rulebook) and the umbrella's .worktrees/<slug>/<repo>/ (the umbrella's Part II #2). Neither is wrong; the tree just has to be blind to both.

The change

One line in .gitignore:

# Session worktrees. A subrepo's own rulebook puts them under `<repo>/.worktrees/`, and
# the umbrella's Part II #2 puts them under `<umbrella>/.worktrees/<slug>/<repo>/`. Both
# are sanctioned, so the directory must be invisible to `git status` from either side --
# an untracked `.worktrees/` made `charly task verify` fail with "charly: dirty working
# tree" on 2026-11-18, and the tree was clean by every other measure.
.worktrees/

Head

$ git rev-parse HEAD
3fc24b24f4e0bda793879b56f0a0984900d05c1e

How tested

$ git status --short          # rule REMOVED, a file inside .worktrees/
?? .worktrees/
$ git check-ignore -q .worktrees/x/f; echo $?
1

The same directory, with the rule in place:

$ git status --short | grep -c worktrees
0
$ git check-ignore -v .worktrees/x/f
.gitignore:169:.worktrees/	.worktrees/x/f

check-ignore names the exact line that matches, and its exit code flips from 1 to 0.

A count taken after the directory was already gone would have proven nothing: an EMPTY directory is
invisible to git whether or not the rule exists
, so the first version of this evidence could not fail.
A file inside it is what makes the directory visible, and that is what the stale session worktrees held.

Change-class gate: none exists for a .gitignore rule. charly task verify is the gate that was FAILING
before this change on exactly this directory, and it is re-run on the final tree.

Rulebook compliance

  • R0 — /charly-internals:git-workflow (a git-hygiene change) loaded.
  • R1 — the anomaly is task verify's "dirty working tree" over a tree git status calls clean apart from one untracked directory. Root cause: neither placement rule's directory is gitignored. The missed control: task verify treats ANY untracked path as dirt, which is correct for a build artifact and wrong for a sanctioned worktree location.
  • R2 — one line, in the file that owns ignore rules.
  • R3 — no workaround: the worktree is not moved to an unsanctioned location, and task verify is not told to skip.
  • R4 — the product here is the git hygiene that lets the gate run.
  • R5 — nothing deleted; the stale directories were removed because they were merged or empty, not because the rule needed them gone.
  • R6 — the worktree lives at /tmp/goal/charly-wt, outside both sanctioned locations, so it cannot itself dirty the tree it is editing. git status stated first; no force-push.
  • R7 — the plant is pasted, and it fails WITHOUT the rule.
  • R8 — N/A — no live service is crossed by an ignore rule.
  • R9 — N/A — no binary is built or shipped by a .gitignore rule.
  • R10 — no bed exists for a .gitignore change. The gate that owns it is charly task verify, RED before this change on exactly this directory.

Change classification

Kind: one .gitignore rule.

Breaking change + rollback: none — and here is why it breaks nothing. No file becomes untracked by this rule; it only stops git status reporting a directory that holds worktrees. Reverting restores the failure.

Filed issues

None — this is the fix for the failure it names.

Files changed

file what changed
.gitignore one rule: .worktrees/

Agent: lead
Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)

… tree

Two sanctioned placements exist for a session worktree: the subrepo's own .worktrees/ (charly's
rulebook) and the umbrella's .worktrees/<slug>/<repo>/ (Part II #2). Both leave an untracked
.worktrees/ inside charly when the first is used, and charly task verify then fails with
'charly: dirty working tree' -- measured 2026-11-18, with the tree clean by every other measure.

One line. Neither placement is wrong; the tree just has to be blind to both.

Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (documentation reviewed)
@github-actions

Copy link
Copy Markdown
Contributor

Review — BLOCK

Head SHA: 74c1c2ca1dba4edfc7698d80657cdbd7cbc8652f (branch: feat/ignore-worktrees)

Change class: config — one functional .gitignore rule (not docs-only, not runtime/code). No bed is applicable, but the non-runtime standards still apply.

Blocks

  1. A3 — illegal attribution tier. The body ends with *Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (documentation reviewed)*. A3 permits documentation reviewed only when the whole diff is documentation (*.md / comment-only / all-doc submodule bump). .gitignore is a config file, and the diff adds a real functional rule line (.worktrees/), not a comment-only change — so documentation reviewed is forbidden here. Fix: re-tier to a defensible tier (e.g. analysed on a live system) backed by the actual proof, or supply the runtime proof that justifies a higher tier. syntax check only / theoretical suggestion are not shippable.

  2. R7 / R10 — the "How tested" evidence does not prove the change. The pasted git -C charly status --short | wc -l → 0 was taken after the stale worktrees were removed, so it returns 0 with or without the new .gitignore rule — it never exercises .worktrees/. There is no test/hook in the diff and no demonstration that the new rule actually hides a worktree. A change whose new behavior has no test that would fail without it is an R10 block. Fix: with a .worktrees/ directory present (or created), paste git -C charly status --short showing it is ignored — or git check-ignore -v .worktrees/ confirming the rule matches — and name the change-class gate (with N/A items stated explicitly per A1) rather than relying on a post-cleanup count.

Verdict: BLOCK


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

aitrawog and others added 2 commits November 18, 2026 12:11
…d on a live system

Two BLOCKs.

A3 -- documentation reviewed is forbidden: .gitignore is a config file and the diff adds a functional rule
line, not a comment. Re-tiered to analysed on a live system, backed by the demonstration below.

R7 -- the pasted 'git status --short | wc -l -> 0' was taken AFTER the stale worktrees were removed, so it
returned 0 with or without the rule. It never exercised .worktrees/ and could not fail.

The plant now discriminates, with the rule REMOVED and a file inside the directory:

  $ git status --short
  ?? .worktrees/
  $ git check-ignore -q .worktrees/x/f; echo $?
  1

and with the rule in place:

  $ git status --short | grep -c worktrees
  0
  $ git check-ignore -v .worktrees/x/f
  .gitignore:169:.worktrees/	.worktrees/x/f

An EMPTY directory is invisible to git whether or not the rule exists -- that is why the first evidence was
vacuous. A file inside it is what makes the directory visible, and that is what the stale session worktrees
held.

Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (analysed on a live system)
@github-actions

Copy link
Copy Markdown
Contributor

Review — PASS

Head SHA: d59ee5a616eaffeb38189a33c88a5ea2d32fdd74 (branch: feat/ignore-worktrees)

Change class: config — one functional .gitignore rule (+6 explanatory comment lines). No bed applies; non-runtime standards enforced.
Security screen: PASS — no secrets, no network/egress, no dependency/CI/guardrail edits, no instruction-shaped PR content; .gitignore is not on the T3 security-machinery list.
Checklist: A1–A3, R0–R10, PIL, ARCH (placement: CORRECT — root-level ignore rule, nothing moved into core/sdk/candy), DISP, QUAL, COORD, CONC/HC all PASS or NA with stated reasons.
Comment dispositions: comment 6976400768 (@github-actions[bot], head 74c1c2c) — both findings stale-superseded against the CURRENT state: (1) A3 tier is now analysed on a live system, no longer the forbidden documentation reviewed; (2) R7/R10 evidence now carries a falsifiable plant — git check-ignore -q exit 1 without the rule, 0 with it, and check-ignore -v names .gitignore:169:.worktrees/, which is internally consistent with the @@ -160,3 +160,10 @@ hunk (added rule is line 169 of the 169-line file). The round's fresh RCA and named missed control are in the body.
Non-blocking note: the body's ## Head paste (3fc24b2) predates the current head (d59ee5a, a merge of main); the diff is unchanged by that merge (same hunk/line 169), so the evidence still reproduces — worth re-pasting on the next push, not a compliance breach under any listed check.

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) November 18, 2026 11:25
@github-actions
github-actions Bot merged commit 990569f into main Nov 18, 2026
4 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Nov 18, 2026
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.

1 participant