Skip to content

fix(index): a gitignored view is not stale, and one rule set decides - #92

Merged
dmarx merged 1 commit into
mainfrom
fix/ignored-views-are-not-stale
Aug 16, 2026
Merged

fix(index): a gitignored view is not stale, and one rule set decides#92
dmarx merged 1 commit into
mainfrom
fix/ignored-views-are-not-stale

Conversation

@dmarx

@dmarx dmarx commented Aug 16, 2026

Copy link
Copy Markdown
Owner

Independent of #91 — branched from main, merges in either order.

The failure

strata-g points [luria.paths] reports at build/doc-reports/ and publishes the result as a CI artifact rather than committing it. build/ is in .gitignore. Its docs job checks out clean, git clean -ffdx removes build/, and:

luria: 2 violation(s)
  build/doc-reports/reference-status.md: stale — regenerate and commit the result …
  build/doc-reports/pending-decisions.md: stale — regenerate and commit the result …

A fresh clone never has the file, so missing reads as stale, and the remedy the failure prints is the one thing .gitignore forbids. That job has been red on every commit since 2026-08-15T06:42Z on a check nothing can satisfy — DP-1 wearing a green hat: the tool refused and its explanation was impossible to act on.

--check now excludes gitignored outputs from all three staleness kinds. Writing is unchangedluria index still renders an ignored view, because not committed is not not wanted; that report is precisely what the artifact upload publishes.

Fixing it once wasn't enough, and that's the more interesting half

The exemption went into adr_index.run(check=True). luria index --check then said current on the tree — and luria lint went on rejecting the identical tree.

lint.check_generated_index had its own copy of the same three rules (stale view / orphan in a view directory / drifted README badges). Two code paths asking one question, so a fix reaches one of them. That is the fixer-linter split this package exists to prevent, reproduced inside the packagedoc_refs is a shared module for exactly this reason, and the staleness rules never got the same treatment.

adr_index.staleness() is now the single answer both consume. Only the wording stayed with the linter, because a build log and a --check want different sentences.

Tests

Three, in tests/test_doc_reports.py:

test what it pins mutation
test_a_gitignored_report_dir_is_not_stale an ignored view is written but never gated skip = set() → fails
test_a_tracked_report_dir_still_gates the exemption is .gitignore, not the reports dir guard — passes either way, by design
test_lint_and_index_check_agree_about_staleness both commands, one verdict, both directions re-inline lint's own rules → fails

418 pass. luria lint clean on this repo.

Verified against the real downstream tree: rm -rf build && luria lint in strata-g goes from exit 1 with 2 violations to exit 0.


Generated by Claude Code

A project can point `[luria.paths] reports` at a build directory and publish
the result as a CI artifact rather than committing it. A fresh clone then
never has the file, so missing read as stale — and the remedy the failure
printed, "regenerate and commit the result", is the one thing `.gitignore`
forbids. Downstream that was a docs job red on every commit for a day, on a
check nothing could satisfy. `--check` now excludes gitignored outputs from
all three staleness kinds; writing is unchanged, since "not committed" is not
"not wanted" and that report is what the artifact upload publishes.

Fixing it once was not enough, which is the more interesting half. `luria
lint` and `luria index --check` each carried their own copy of the same three
rules, so the exemption landed in the generator and the linter went on
rejecting the tree the generator had just called current — the fixer/linter
split this package exists to prevent, reproduced inside it.
`adr_index.staleness()` is now the one answer both consume, with only the
wording left in the linter, and a test pins the agreement from outside.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012AWc5urqmvaJUhcvy1VWLM
@dmarx
dmarx force-pushed the fix/ignored-views-are-not-stale branch from b51988d to a1cd697 Compare August 16, 2026 06:19
@dmarx
dmarx merged commit f61282e into main Aug 16, 2026
6 checks passed
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