fix(hooks): a gitignored bake is not the repository's own content #1063

Merged
coilysiren merged 1 commit from aos/claude/wy58-build-output-not-content into main 2026-08-15 16:20:40 +00:00
Member

The upstream half of coilyco-gaming/sirens-echo#800. The consumer-side unblock is coilyco-gaming/sirens-echo#805.

The problem

Tree-walking hooks run always_run: true with pass_filenames: false and do their own walks, so pre-commit's file list and its exclude: directive are both bypassed. After ward exec compose-bundles, sirens-echo's gate reported 75 documentation-layout violations and 8 dead links on an otherwise clean main, every one inside the gitignored agent/bundles/ bake of upstream agent-compose skills that repository does not own.

The fix

agentic_os.config.is_build_output asks git instead of guessing:

git ls-files -z --cached --others --exclude-standard

Tracked plus untracked-but-not-ignored is git's own definition of what a repository holds, so this needs no pattern list and no per-repo opt-out. documentation-layout (and its catalog-doc-size alias) and dead-cross-links consult it.

Three properties are deliberate, each with a test:

  • Fails open. No checkout, no git, a failed call, or an empty answer all mean "this is content", so a tarball or a machine without git is checked exactly as before. Failing closed would silently retire the whole suite.
  • A directory is content when anything under it is. Directories never appear in git's file list, so a naive check would retire docs/ flatness.
  • Untracked is not ignored. Unstaged source stays checked.

Verification

Against the real failure, not a fixture. sirens-echo with bundles baked on disk:

before   75 documentation layout violation(s) / 8 dead link(s)
after    documentation-layout check: OK / dead-link check: OK

Control, same tree, same run: a non-ignored agent/notignored/SKILL.md beside the bake still fails both hooks. So the hooks did not simply stop looking.

Suite: 532 pytest passing (7 new in tests/test_build_output.py, four of them controls proving the hooks still fail on tracked content), plus pre-commit run --all-files green.

Scope

Two hooks, the two that fired. Eleven other tree-walkers are left to #1062 rather than converted blind: each carries its own walk, and check_agent_compose_size / check_agent_compose_dedup exist to measure composed sources, so whether a bake is in scope for them is a real question rather than a mechanical edit. That issue also notes the thirteen drifted copies of SKIP_DIR_NAMES a shared walker would collapse.

Not done

No FEATURES.md entry - this is validation hardening on shipped hooks, not a new or reshaped capability.

Reasoning and the fail-open contract: docs/build-output-is-not-content.md.

🤖 Generated with Claude Code

The upstream half of coilyco-gaming/sirens-echo#800. The consumer-side unblock is coilyco-gaming/sirens-echo#805. ## The problem Tree-walking hooks run `always_run: true` with `pass_filenames: false` and do their own walks, so pre-commit's file list and its `exclude:` directive are both bypassed. After `ward exec compose-bundles`, sirens-echo's gate reported **75 documentation-layout violations and 8 dead links** on an otherwise clean `main`, every one inside the gitignored `agent/bundles/` bake of upstream agent-compose skills that repository does not own. ## The fix `agentic_os.config.is_build_output` asks git instead of guessing: ``` git ls-files -z --cached --others --exclude-standard ``` Tracked plus untracked-but-not-ignored is git's own definition of what a repository holds, so this needs no pattern list and no per-repo opt-out. `documentation-layout` (and its `catalog-doc-size` alias) and `dead-cross-links` consult it. Three properties are deliberate, each with a test: - **Fails open.** No checkout, no git, a failed call, or an empty answer all mean "this is content", so a tarball or a machine without git is checked exactly as before. Failing closed would silently retire the whole suite. - **A directory is content when anything under it is.** Directories never appear in git's file list, so a naive check would retire `docs/` flatness. - **Untracked is not ignored.** Unstaged source stays checked. ## Verification Against the real failure, not a fixture. sirens-echo with bundles baked on disk: ``` before 75 documentation layout violation(s) / 8 dead link(s) after documentation-layout check: OK / dead-link check: OK ``` Control, same tree, same run: a non-ignored `agent/notignored/SKILL.md` beside the bake still fails both hooks. So the hooks did not simply stop looking. Suite: 532 pytest passing (7 new in `tests/test_build_output.py`, four of them controls proving the hooks still fail on tracked content), plus `pre-commit run --all-files` green. ## Scope Two hooks, the two that fired. Eleven other tree-walkers are left to #1062 rather than converted blind: each carries its own walk, and `check_agent_compose_size` / `check_agent_compose_dedup` exist to measure composed sources, so whether a bake is in scope for them is a real question rather than a mechanical edit. That issue also notes the thirteen drifted copies of `SKIP_DIR_NAMES` a shared walker would collapse. ## Not done No FEATURES.md entry - this is validation hardening on shipped hooks, not a new or reshaped capability. Reasoning and the fail-open contract: `docs/build-output-is-not-content.md`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
fix(hooks): a gitignored bake is not the repository's own content
All checks were successful
ci / ward-doctor (pull_request) Successful in 14s
ci / aos-cli-tests (pull_request) Successful in 10m51s
ci / gate (pull_request) Successful in 11m45s
51761cd992
Tree-walking hooks run always_run with pass_filenames false and do their own
walks, so pre-commit's file list and its exclude directive are both bypassed.
After `compose-bundles`, sirens-echo's gate reported 75 documentation-layout
violations and 8 dead links, every one of them inside a gitignored bake of
upstream agent-compose skills the repository does not own.

`agentic_os.config.is_build_output` asks git rather than guessing:
`git ls-files --cached --others --exclude-standard` is git's own definition of
what the repository holds, so this needs no pattern list and no per-repo
opt-out. `documentation-layout` (with its `catalog-doc-size` alias) and
`dead-cross-links` now consult it.

It fails open. No checkout, no git, a failed call, or an empty answer all mean
"this is content", so a tarball or a machine without git is checked exactly as
before. A directory counts as content when anything under it does, keeping
docs/ flatness alive. Untracked is not ignored, so unstaged source stays
checked.

Verified against the real failure: sirens-echo with bundles baked goes from
75 + 8 violations to zero, while a non-ignored file beside the bake still
fails both hooks.

The other eleven tree-walking hooks are left for #1062, where the
agent-compose pair needs a decision rather than a mechanical edit.

Closes coilyco-gaming/sirens-echo#800

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: Kai Siren <coilysiren@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
coilysiren deleted branch aos/claude/wy58-build-output-not-content 2026-08-15 16:20:40 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-flight-deck/agentic-os!1063
No description provided.