Repository navigation
fix(baseline): match the empty check of core check-corrections.mjs - #19
Merged
Merged
Conversation
The B2 port refused a blank scope, correction or evidence with str.strip(), whose white-space set differs from JavaScript trim, which core check-corrections.mjs uses: it removes U+0085 and U+001C to U+001F and keeps U+FEFF. The port now strips the JavaScript set, and refuses NaN and Infinity as invalid JSON, as JSON.parse does (core ADR-0081).
Core check-corrections.mjs fails a symbolic link at .memory before it reads either form (linkedMemory). The B2 port checked links only at .memory/corrections and its entries, so it followed a linked .memory. Also add the cases for an escaped U+2029 and U+007F, a lone trail surrogate, and Infinity and -Infinity.
This was referenced Nov 14, 2026
Merged
Merged
bketelsen
approved these changes
Nov 14, 2026
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
The B2 baseline check (
tests/test_baseline.py,check_b2) ports core'sscripts/check-corrections.mjs(core ADR-0081). Its empty check forscope,correctionandevidenceusedstr.strip(). Core uses JavaScripttrim, and the 2 white-space sets differ:The check now strips the JavaScript set (
JS_WHITESPACE). It also refusesNaN,Infinityand-Infinityas invalid JSON, asJSON.parsedoes.canonical_correctionalready followed the ADR-0081 byte rules; new cases now pin them (raw U+2028 and U+2029, lowercase lone surrogate, escaped pair,\u003c,\^_).Risk tier
Risk tier: 3 — the label
risk:highcomes fromtests/**(L2, "governance: the checks of the verification policy and of the workflows"). Matched path:tests/test_baseline.py. Why safe: only the B2 check (check_correction) and its cases change; the checks of the verification policy and of the workflows,scripts/,apps.jsonand the workflows do not change. The record file is not a risk path.Verification
make verifygreen (189 tests).check-corrections.mjsat3d3d5c703fc24db3734408765171938a97840f4c(the same file in a temporary tree,node check-corrections.mjs --root <tree>): U+FEFF, U+2028, spaces → fail; U+0085,\^_, U+180E → pass; NaN → fail; the canonical cases as listed above..strip()andjson.loads, the U+FEFF, U+0085, U+001F and NaN cases fail..memory/corrections/.Cross-review
openai/gpt-6.1-sol; coderanthropic/claude-opus-5-5. 1 batch review of the 5 ports of this fix (fix(baseline): build the canonical corrections form as JSON.stringify does repogen#108, fix(baseline): build the canonical corrections form as JSON.stringify does clix#122, fix(baseline): build the canonical corrections form as JSON.stringify does std#109, fix(baseline): match the empty check of core check-corrections.mjs homebrew-tap#47, fix(baseline): match the empty check of core check-corrections.mjs #19), plus re-review 1 of the fixes.Blocking: none, at head405aba1b50d7b651c0b52ebe9c62434f2404cafd(first review atc0e78eb1ab53519cc1ed20bec4698e2dafa3a7cb)..memory; core'scheck-corrections.mjsfails it before it reads either form (linkedMemory). This was there before this PR. Guard: the case ".memorylinks toinbox, which holds a good record" expects.memory: symbolic link, not followed(core gives exit 1 and the same message); it fails without the fix. Record:.memory/corrections/2026-11-14-pr-19-memory-link.json.\udc00,Infinityand-Infinity; each agrees with core.