Repository navigation
Conversation
`--check` ignores the `Version:` line so that a new release tag, which changes the stamped version, does not turn main and every pull request red until someone regenerates. The previous implementation stripped every line starting with `Version: `. Both generated files embed the README and the example scripts, so a body line that happens to begin that way is real content. Stripping those too would let genuine drift through the gate unnoticed: a content change that only touched such a line would compare equal and pass. The strip is now limited to the header, defined as the lines before the first `## ` heading, which is where the generator writes its single `Version: ` line. Everything below the first heading is compared as-is. Add test/test_generate_llms.py covering the two directions that matter: a header-only version change still compares equal, and a `Version: ` line appearing in the body now makes the comparison fail. The end-to-end case drives `is_current` against a temporary tree so it exercises the same path the CLI takes rather than only the helper. This closes the observation raised while reviewing #449.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--checkignores theVersion:line so a new release tag — which changes thestamped version — does not turn
mainand every pull request red until someoneregenerates. The previous implementation stripped every line starting with
Version:.This narrows that to the header only.
Why it matters
Both generated files embed the README and the example scripts. A line inside
that embedded content that happens to begin with
Version:is real content,not the version stamp. Stripping those too meant the comparison could not see
them: a content change touching only such a line would compare equal and pass
the gate silently.
Today each file happens to contain exactly one
Version:line, both in theheader, so nothing is currently hidden. The mask would open as soon as embedded
content gained such a line.
The change
The strip now applies only to the header, defined as the lines before the first
##heading, which is where the generator writes its singleVersion:line.Everything from the first heading down is compared as-is.
Tests
test/test_generate_llms.pycovers both directions, because either alone wouldpass under a broken implementation:
Version:line appearing in the body now makes the comparison fail(the regression being fixed).
The body case drives
is_currentagainst a temporary tree, so it exercises thepath the CLI actually takes rather than only the helper.
Verified against the old implementation: it reports the body change as
not drift, confirming the gap was real and is now closed.
Validation
python scripts/generate_llms.py --check→ up to date, exit 0.Version: 9.9.9 in bodyline appended tollms.txt→ exit 1.ruff check photoshop test scriptsandruff format --check→ clean.pytest test_generate_llms.py test_collections.py test_imports.py→ 24 passed.Configuration, generator logic and tests only. No packaging or lockfile
changes, and the generated
llms.txt/llms-full.txtare unchanged.