Repository navigation
Implement from=, so a page that inlines a program cannot drift from it - #582
Merged
Merged
Conversation
PR #581 hit this: examples/flow_way/README.md inlined the program from swappable_telemetry.flow and renamed a variable to `test`, which is a keyword. The file kept the name that parses, the copy did not, and CI caught it only because the copy stopped compiling. A rename that still compiled would have gone unnoticed. 42 blocks sit next to a link to a .flow file. 34 of them no longer appear in the file they link. Eight are still verbatim copies, and those are now tagged `from=`, so the checker asserts the block appears in the named file and fails with which page and which file disagree. `from=` was listed in docs_blocks as designed but not implemented, alongside a test asserting it must not parse while it does nothing. That test now asserts the opposite, which is the point of having written it that way. Verified by breaking it on purpose: renaming main in examples/book/01_hello.flow fails the gate with "block no longer appears in examples/book/01_hello.flow". The remaining 34 are a content job, not a mechanism job: each needs a human to decide whether the page or the file is the wrong one. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Merged
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.
Why
#581 hit this.
examples/flow_way/README.mdinlines the program fromswappable_telemetry.flowand renamed a variable totest, which is a keyword:The linked file kept the name that parses. CI caught it only because the copy stopped compiling — a rename that still compiled would have gone unnoticed, and the page would quietly describe a program nobody runs.
The measurement
42 blocks sit next to a link to a
.flowfile. 34 of them no longer appear in the file they link. Eight are still verbatim copies.What this adds
from=pathasserts the block still appears in the named file:The eight verbatim copies are tagged, so they are now locked to their files:
docs/book/01-a-complete-program.mdexamples/book/01_hello.flowdocs/book/02-values-and-types.mdexamples/book/02_values.flowdocs/book/03-decisions-and-repetition.mdexamples/book/03_control.flowdocs/book/05-records-and-arrays.mdexamples/book/05_records_arrays.flowdocs/book/06-pipelines-and-results.mdexamples/book/06_pipeline_result.flowdocs/book/07-from-updates-to-flows.mdexamples/book/07_decay.flowdocs/effects-showcase.md(×2)examples/effects/showcase.flowThose files are covered by tier-2, so the page is now covered transitively.
Verified by breaking it
Renaming
maininexamples/book/01_hello.flow:A test that changed sides
from=was listed indocs_blocksas designed but not implemented, with a test asserting it must not parse while it does nothing:That test now asserts the opposite, which is what writing it that way was for.
host=stays unimplemented and still rejected.Not in scope
The other 34 blocks are a content job rather than a mechanism job: each needs a human to decide whether the page or the file is the wrong one. The mechanism is here for when that happens.
Verification
pytest tests/check_doc_examples.py --check-ledgercheck_doc_links.pyCONTRIBUTING.mddocumentsfrom=alongside the other three info-string words, with the reason to reach for it.