Repository navigation
fix(engine): stop reading prerequisites out of sentences - #240
Conversation
`extractDeclaredPrerequisites` scanned prose for `requires X` phrases and gated on whatever it found. Measured over 11,168 notes in two Azure curricula, every edge the feature produced came from a link in a `## Prerequisites` section and the prose branch produced none — while generating the entire defect list for it: "requires patience and practice", "requires more complex implementation", and a run of negations that each needed another rule to reject. That rule-chains are now gone with it: the clause boundary set, the aside removal, the subject test, the verbal-negation and negative-subject screens, and the capitalization screen. The last two review findings on this feature — "no longer requires X" and the chained-aside shape — were the same bug wearing different sentences, and the honest fix for a scanner whose measured yield is zero and whose failure mode is a permanent gate is to stop scanning. What remains is the unambiguous form: a wikilink or a markdown link under a prerequisites heading. `- Setup` as plain text names nothing the engine can resolve without guessing at a basename, so it declares nothing either. Two new tests pin the sentences to silence; both fail if a prose scanner is re-added, proven by injecting one.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…d to end Review finding on #240: the extractor's tests show sentences are ignored, but nothing showed what `adopt --auto-chain` writes for a note named only in prose. A scan re-added downstream in the adoption path would have kept every unit assertion green while the false gate came back. So the case runs the CLI over the exact shape that used to lock a learner out — one real, uniquely resolvable note named in a sentence and linked nowhere — and asserts the report claims no declared edge, the note keeps the numbered predecessor, and the prose-named note is not among its dependencies. Proven to bite the way the finding asks: injecting a naive prose scanner back into the extractor fails the new CLI test as well as the two extractor tests, and removing it restores all nine.
The count appears in no source — PR #240's body says nothing of the kind, and the pre-removal test file holds 39 inputs, not 35. State the documented finding (fixing one negation case broke the other; only verb scope tells them apart) without the unverifiable number.
Summary
palee adopt --auto-chainreads a note's own prerequisites, and it now reads them only where they are stated unambiguously: a wikilink or a markdown link under a## Prerequisitesheading. The prose scan —requires X,requires knowledge of Xanywhere in the body — is removed, along with the clause analysis that existed to stop it inventing gates.Why: the measurement
Read-only
adopt --all --auto-chain --dry-runover two real curricula, 11,168 notes:numbered)declaredThe prose branch produced no edges at all on either corpus, and before the capitalization screen it produced nine counted misses. Zero yield is half the case; the other half is that the shapes it would have turned into edges on a vault with capitalized note names are exactly the review findings:
"requires patience and practice","requires more complex implementation","does not require X","no longer requires X", and the chained-aside shape still open. Each was answered by another rule (CLAUSE_BOUNDARY,PAREN_ASIDE,CLAUSE_SUBJECT,VERBAL_NEGATION,NEGATIVE_SUBJECT), and each rule carried its own counterexample.So the claim here is deliberately narrow: the prose branch's measured yield was zero, and its demonstrated failure mode is a permanent gate. It is not a claim that every false edge in this feature came from prose — two of the P1s on #232 were index bugs that affected links too, and remain fixed.
The asymmetry settles it. A missed prerequisite costs an edge and leaves whatever the numbered tree justified. A false one hides the note from
palee planpermanently, because mastery only falls and nothing lifts the gate. A scanner with a measured yield of zero cannot pay for that failure mode.What was removed
~300 lines of module plus test: the
REQUIRES_PHRASEscan and the whole negation/clause apparatus it needed.DeclaredPrereqRef['form']narrows to'wikilink' | 'mdlink', andadopt's per-form lookup loses its third branch.What still works
Links under
## Prerequisites/## Requires/## Required knowledge/## Depends on; exact vault-relative paths and unique basenames; fan-in;declaredreplacing the inferred edge; fenced examples, escaped links and task checkboxes still declined; cycles still refused pre-write with exit3.Test evidence
test/engine-prereq-text.test.ts— two new tests pin the sentence shapes (including every negation string from the removed analysis) to declaring nothing, in prose and under a prerequisites heading.extractDeclaredPrerequisites: both named tests fail. Not by reasoning.typecheckandlintclean.On the open review finding
This closes the last open thread on #232 (
"does not, under any circumstances, when it is hard, require Setup"). That finding could not be fixed inside the prose model without regressing a case the suite pins —"does not need a calculator and requires Setup"is the same shape to any segment test, and only verb scope tells them apart. Removing the prose scan closes it by construction rather than with another rule.Two earlier findings on #232 were also prose-only in mechanism:
"does not require X"inventing a gate, and"no longer requires X"doing the same. The other two P1s there — basename collapse and reading through an--excluded note — were index bugs and stay fixed regardless: they affected the link form too. The claim "a sentence cannot be told apart from a description" is about the prose branch alone.Environment
Repo
Kuldeep2822k/cli, branchfix/adopt-prereq-prose-scopeoff the PAL-205 stack tip (feat/73-tier0-hygiene, #214). Builds on #232. Windows 10 / Node 24 —npm test,npm run check.The PR appears safe to merge.
Summary
The PR limits declared prerequisites to links under a prerequisite heading, removes sentence-based extraction and its clause analysis, and adds an end-to-end test that a prose mention does not become a dependency.
Reviews (2) · Last reviewed commit: "test(adopt): prove a prose-named note ne..."