Skip to content

fix(baton): inventory only live work — skip nested checkouts, ignore follow-up examples (#434, #431) - #435

Merged
montfort merged 1 commit into
mainfrom
fix/baton-inventory-hygiene
Sep 18, 2026
Merged

montfort merged 1 commit into
mainfrom
fix/baton-inventory-hygiene

Conversation

@montfort

Copy link
Copy Markdown
Contributor

Closes #434. Fixes the Baton half of #431; the CLI half (straymark validate warning on the template's example line) ships with the follow-up writer work for #432.

What changes

  • Nested checkouts (Baton walkers descend into nested git checkouts (.worktrees/), duplicating units and contracts #434). A sub-directory with its own .git entry is another checkout: a linked worktree (.git file), a submodule, or a nested clone (.git directory). All three Baton walkers now stop there: units::find_files (tasks and batch ledgers), coherence::Inventory::scan and codescan::walk_code. They share one helper, scan::is_nested_checkout. The check is structural, so it needs no gitignore parsing and adds nothing for adopters to configure.
  • Follow-up examples ([adopter] Baton inventories the commented FU-NNN template as real work #431). read_followups changes in three ways:
    • it ignores HTML comments (including inline and multi-line ones) and fenced blocks;
    • it requires the canonical FU-<digits> ID that straymark followups also uses;
    • it attaches - **Label**: lines only to the entry heading directly above them. Before, a line under an unrelated ### heading or inside an example could fill an earlier entry's field.

Impact, measured read-only (git status unchanged)

Corpus main this branch
Estoa (local, one worktree under .worktrees/) task 1946 · batch 22 · follow-up 6 · 1839 duplicated IDs task 79 · batch 11 · follow-up 5 · 0 duplicated IDs
LNXDrive follow-up 18 follow-up 17 (template placeholder removed)
Sentinel — unchanged

Validation

  • cargo test -p straymark-baton --locked: 90 passed (84 existing + 6 new in tests/inventory_hygiene.rs).
  • cargo clippy -p straymark-baton --all-targets --locked -- -D warnings is clean. straymark validate reports 0 errors.
  • AILOG: .straymark/07-ai-audit/agent-logs/AILOG-2026-09-17-002-baton-inventory-hygiene.md.

Not in scope

  • straymark_core::architecture::collect_source_files has the same blind spot. Fixing it needs a core bump that also touches the CLI and Loom.
  • Copies of specs/ inside the main tree, such as evidence snapshots, are still inventoried. Handling them would need an explicit exclude setting. That only makes sense if an adopter actually needs it.

Independent of #430: it branches from main, touches different functions, and uses a different AILOG ID.

🤖 Generated with Claude Code

…follow-up examples (#434, #431)

- Every Baton walker (unit inventory, coherence inventory, code scan) now
  stops at a sub-directory with its own .git entry: a linked worktree, a
  submodule or a nested clone is another checkout. On Estoa's local
  checkout one worktree under .worktrees/ inflated the inventory from 79
  to 1946 tasks with 1839 duplicated unit ids (#434).
- read_followups ignores HTML comments and fenced blocks, requires the
  canonical FU-<digits> id, and attaches metadata lines only to the entry
  heading right above them, so the shipped registry's commented FU-NNN
  example is no longer a unit (#431).

Closes #434. Fixes the Baton half of #431; the CLI validator half ships with the
follow-up writer work (#432).

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@montfort
montfort merged commit 5754534 into main Sep 18, 2026
1 check passed
montfort added a commit that referenced this pull request Sep 18, 2026
…supported writer for follow-up work classification (#432)

Track C asks follow-ups to declare Work verb / Design provenance, but the
registry is CLI-owned and no verb could write those bullets (Estoa, #432).

- `straymark followups declare FU-NNN --work-verb <v> [--design-provenance <p>]`
  writes an entry's declaration as one validated unit (provenance only with
  implement; omitting it removes a stale one; unchanged = no-op).
- `followups new` takes the same flags; `followups status FU-NNN` shows them.
- `straymark validate` stops warning on the registry template's commented
  example line (the CLI half of #431).
- Skill (all mirrors), FOLLOW-UPS-BACKLOG-PATTERN x3, template note,
  CLI-REFERENCE x3, BATON.md x3 and the Track C kit document the writer.

Closes #432. Closes #431 together with the Baton half in #435.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
montfort added a commit that referenced this pull request Sep 18, 2026
…supported writer for follow-up work classification (#432) (#436)

Track C asks follow-ups to declare Work verb / Design provenance, but the
registry is CLI-owned and no verb could write those bullets (Estoa, #432).

- `straymark followups declare FU-NNN --work-verb <v> [--design-provenance <p>]`
  writes an entry's declaration as one validated unit (provenance only with
  implement; omitting it removes a stale one; unchanged = no-op).
- `followups new` takes the same flags; `followups status FU-NNN` shows them.
- `straymark validate` stops warning on the registry template's commented
  example line (the CLI half of #431).
- Skill (all mirrors), FOLLOW-UPS-BACKLOG-PATTERN x3, template note,
  CLI-REFERENCE x3, BATON.md x3 and the Track C kit document the writer.

Closes #432. Closes #431 together with the Baton half in #435.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@montfort montfort mentioned this pull request Sep 18, 2026
montfort added a commit that referenced this pull request Sep 18, 2026
Release the Track C fixes that landed after baton-0.2.0: task inheritance
(#430), batch inheritance (#437) and inventory hygiene (#435). 0.3.0 rather
than 0.2.1: the adopter already measured a from-source "0.2.1" without them,
so reusing that number would blur its telemetry. The Track C kit now asks
for baton >= 0.3.0 (and CLI >= 3.49 to declare follow-ups).

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
montfort added a commit that referenced this pull request Sep 18, 2026
…ject-wide walker skips nested checkouts (#434) (#440)

Follow-up to #435 (Baton half). straymark-core's source scanner and two
CLI walkers also read another checkout nested in the project — a linked
worktree (`.worktrees/<name>/`), a submodule, a nested clone — as the
project's own code: on an adopter repo, `architecture generate` invented
a `.worktrees` component holding a full copy of it.

- core: `walk::is_nested_checkout` (a sub-directory with its own `.git`)
  used by `architecture::collect_source_files` → architecture generate /
  sync / validate, status --where, Loom's architecture view + Intent
  plane, Baton's overlay.
- cli: tree_grep (followups verify --claims, analyze declared-vs-wired)
  and the analyze walker use the same rule.
- baton: reuses the core rule (behavior unchanged, no release).
- straymark-core bound moved to 0.10.1 in cli, loom AND baton together.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.

Baton walkers descend into nested git checkouts (.worktrees/), duplicating units and contracts

1 participant