Skip to content

fix(engine): stop reading prerequisites out of sentences - #240

Merged
Kuldeep2822k merged 2 commits into
feat/73-tier0-hygienefrom
fix/adopt-prereq-prose-scope
Sep 30, 2026
Merged

Kuldeep2822k merged 2 commits into
feat/73-tier0-hygienefrom
fix/adopt-prereq-prose-scope

Conversation

@Kuldeep2822k

@Kuldeep2822k Kuldeep2822k commented Sep 30, 2026 •

Copy link
Copy Markdown
Owner

Summary

palee adopt --auto-chain reads a note's own prerequisites, and it now reads them only where they are stated unambiguously: a wikilink or a markdown link under a ## Prerequisites heading. The prose scan — requires X, requires knowledge of X anywhere 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-run over two real curricula, 11,168 notes:

corpus planned edges from links from prose
ML-For-Beginners 93 88 (all numbered) 0 0
Web-Dev-For-Beginners 84 74 4 declared 0

The 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 plan permanently, 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_PHRASE scan and the whole negation/clause apparatus it needed. DeclaredPrereqRef['form'] narrows to 'wikilink' | 'mdlink', and adopt'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; declared replacing the inferred edge; fenced examples, escaped links and task checkboxes still declined; cycles still refused pre-write with exit 3.

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.
  • Proven load-bearing by injecting a naive prose scanner back into extractDeclaredPrerequisites: both named tests fail. Not by reasoning.
  • Full suite 1231 pass / 0 fail; typecheck and lint clean.

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, branch fix/adopt-prereq-prose-scope off the PAL-205 stack tip (feat/73-tier0-hygiene, #214). Builds on #232. Windows 10 / Node 24 — npm test, npm run check.

RetriggerConfidence Score: 5/5

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..."

`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.
@Kuldeep2822k Kuldeep2822k added bug Something isn't working core Core source code changes tests Test suite changes labels Sep 30, 2026
@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 603843b8-7918-46f2-ab1c-cc8acfca88d6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Sep 30, 2026
Comment thread test/engine-prereq-text.test.ts
…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.
@Kuldeep2822k
Kuldeep2822k merged commit 0d222bf into feat/73-tier0-hygiene Sep 30, 2026
6 checks passed
@Kuldeep2822k
Kuldeep2822k deleted the fix/adopt-prereq-prose-scope branch October 1, 2026 11:42
Kuldeep2822k added a commit that referenced this pull request Oct 12, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working core Core source code changes documentation Improvements or additions to documentation tests Test suite changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant