Skip to content

worktree_drift: path-test claims, dedupe symlinked dirt, respect parked.md (fixes #123) - #124

Merged
Jammy2211 merged 1 commit into
mainfrom
feature/worktree-drift-fixes
Jul 30, 2026
Merged

Jammy2211 merged 1 commit into
mainfrom
feature/worktree-drift-fixes

Conversation

@Jammy2211

Copy link
Copy Markdown
Contributor

Fixes #123 — CI/release-audit series task 5 (monitoring-only check; not a readiness reason).

The three noise mechanisms, fixed:

  1. False MISSING — claims are now path-tested directly (~ expanded), wherever they point; existing claims outside the wt root (e.g. .codex-worktrees/<task>) are tracked, not orphaned/missed. Claim parsing accepts only path-shaped values (parked.md carries prose like worktree: none (…)).
  2. Symlink double-counting — the task-dirt scan skips symlinked children; dirty canonical checkouts reached via symlinks are deduped by resolved path into a new canonical_dirty category (counted once, rendered as a WARN — a user's canonical working state is not task drift). This was the source of "66 dirty".
  3. Parked orphans — parked.md-claimed dirs get their own parked label, excluded from orphans.

Shape: the heredoc python moves to heart/checks/worktree_drift.py (pure scan() + main() — the repo's testable-check pattern); worktree_drift.sh is a thin shim so tick.sh and the sourced-function contract keep working; capabilities.yaml impl updated; dashboard section renders canonical_dirty/parked.

Live run on this box (real state): missing names only the genuinely-absent vacuous-jax-assertions claim (its worktree really was removed while awaiting merge); the .codex-worktrees/python-312-floor claim no longer false-flags; task dirt is real (a concurrent session's multiband-pyloop-batching uncommitted work + this in-flight branch); 7 dirty canonical checkouts appear once each instead of once per worktree.

Tests: 328 passed (8 new in tests/test_worktree_drift.py over synthetic git trees: outside-root claims, missing claims, symlink dedupe, real-dirt attribution, parked labelling, prose-value filtering, tilde expansion).

🤖 Generated with Claude Code

…t parked.md

Three noise mechanisms produced misleading totals like '2 orphan / 2 missing /
66 dirty' (PyAutoHeart#123): claims outside ~/Code/PyAutoLabs-wt were compared
against the wt-root listing (never path-tested) so an existing
.codex-worktrees claim read missing forever; the dirty scan followed the
symlinks worktree_create installs, counting one dirty canonical checkout once
per task worktree linking it; parked.md worktrees read as orphans.

The heredoc python moves to heart/checks/worktree_drift.py (pure scan() +
main(); the .sh becomes a thin shim so tick.sh keeps working). scan()
path-tests claims wherever they point (accepting only path-shaped values —
parked.md carries prose like 'none (…)'), tracks existing claims outside the
wt root, skips symlinked children in the task-dirt scan and dedupes dirty
canonical checkouts into their own canonical_dirty category (yellow, never
red — a user's canonical working state is not task drift), and labels
parked.md dirs instead of orphaning them. Dashboard renders the new shape.

Live run on this box: missing now names only the genuinely-absent
vacuous-jax-assertions claim; task dirt is real (concurrent-session work +
this branch); 7 canonical checkouts counted once each. Suite: 328 passed
(8 new tests).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@Jammy2211
Jammy2211 merged commit 7d852a7 into main Jul 30, 2026
4 checks passed
@Jammy2211
Jammy2211 deleted the feature/worktree-drift-fixes branch July 30, 2026 14:09
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.

worktree_drift: false missing, symlink double-counted dirt, parked orphans

1 participant