Skip to content

fix(validate): restore the Cf block and walk() refactor dropped by the #78 squash#79

Merged
astrapi69 merged 2 commits into
mainfrom
fix/cf-block-missed-by-squash
Jul 22, 2026
Merged

fix(validate): restore the Cf block and walk() refactor dropped by the #78 squash#79
astrapi69 merged 2 commits into
mainfrom
fix/cf-block-missed-by-squash

Conversation

@astrapi69

Copy link
Copy Markdown
Owner

#78 was squash-merged while I was still pushing to its branch. The squash captured the branch as it stood at that moment, which was the first review round; the two commits that landed afterwards never reached main.

What is missing from main

Commit Content
47ffc46 second review round: the walk() refactor and the U+2060-206F Cf block
7b7892f scope note on why Map/Set need no handling

Verified rather than assumed:

main:  grep -c '0x206f' src/invisible-chars.ts   ->  0
main:  grep -c 'function walk'                    ->  0

main still carries the per-node new Set(ancestors) copy and covers only U+2060 of the format block.

Why this matters right now

main is already at version 0.13.3. Publishing from it would have put a 0.13.3 on npm without the Cf block, while the changelog and the PR discussion describe it as included. Caught by checking the merged state before publishing rather than after.

This PR

The two commits cherry-picked onto current main. No new work, no version change: 0.13.3 is correct once this lands, and the release then matches what #78 was reviewed as.

Verification

  • 24 tests pass
  • make release-check green
  • Same 528 real lessons across seven content repositories: 4 findings, 0 false positives, with the wider range in scope

Note for the sequence

The two re-pin PRs (adaptive-learner-content#156, alc-psychology#4) should move from 0.13.2 to 0.13.3 after this lands and 0.13.3 is published, so the content repos pick up the full range in one step instead of two.

astrapisixtynine and others added 2 commits July 22, 2026 12:35
Three of Qwen's four points adopted, one extended well past what it asked
for.

- Cycle tracking allocated a fresh Set per object node. One mutable set
  is now extended on the way down and restored in a finally on the way
  back up, so a pasted chapter no longer produces thousands of
  short-lived sets. The public signature loses its internal third
  parameter; the recursion moved into a private walk().

- The format block was covered only at U+2060. Verified against the
  build: U+2061-2064 (the invisible math operators a formula editor
  pastes), U+2066-2069 (the bidi isolates modern editors emit in place of
  the older embeddings) and U+206A-206F (deprecated format characters)
  all slipped through. The review named the four isolates; the actual
  hole was the whole U+2060-206F range, which is general category Cf in
  full, so that is what the rule now carries.

- The numeric sort of codepoint labels had no test. It turned out to be
  correct, but untested logic is only accidentally correct; a test now
  pins that U+00AD, U+FEFF and a five-digit U+10000 come out in numeric
  rather than lexicographic order.

Declined again: nothing. The remaining point was praise for using
Object.entries over for..in, which is now stated as a reason in the code
so it survives a future edit.

Provenance recorded in the header: the starting set came from the
sanitizer of manuscript-tools, whose own checker had the very gap this
module closed (fixed there in manuscript-tools#1).

Same 528 lessons, still 4 findings, still 0 false positives with the
wider range in scope. 24 tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Third review round raised two points; neither needs code.

The Map/Set observation is correct in isolation and unreachable in
practice, verified rather than argued: validateLesson returns early when
the structural check fails, so the lint only ever sees a schema-valid
lesson, and a Map is rejected with E-SCHEMA before it. On top of that
this module is not exported from the package entry. Both would have to
change before the gap opens, so the reasoning is recorded in the header
instead of speculative handling being added for a path that cannot
execute.

The second point asked for a test of the numeric codepoint sort. That
test was added in the previous round and passes; the review was reading
the earlier version.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@astrapi69
astrapi69 merged commit 4905739 into main Jul 22, 2026
4 checks passed
@astrapi69
astrapi69 deleted the fix/cf-block-missed-by-squash branch July 22, 2026 12:00
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.

2 participants