fix(knowledge): reject malformed record proposals before writing - #213
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Knowledge 17.0.2 release proofPR #213 is merged and the registry package passed its changed-behavior check.
Local verification before mergeThe complete Linux suite passed: 90 files passed, three skipped; 894 tests passed, 12 skipped. Exact registry artifactThe tarball was downloaded independently and its SHA-512 and SHA-1 matched registry metadata at The publishing log records signed provenance at https://search.sigstore.dev/?logIndex=2854716174. Published behaviorA fresh Linux arm64 container installed the exact registry package, not local
The consumer exited zero. This proves package admission and retrieval behavior, not production Runtime adoption or a second research director's decision. Related system issue: SYS-006 — outcome: fixes — proof: #213 and registry |
Change
Make knowledge_record describe the complete FILE grammar and reject malformed, unsafe, or empty proposals before any page write. The shared parser no longer absorbs a later page into an unterminated earlier block. Direct applyKnowledgeWriteBlocks retains its explicit partial-result API.
Reproduction and proof
The retained mech-interp-foundations-pi-20260915k run made 13 knowledge_record calls. Twelve completed with no written pages; the partial probe swallowed the next page into the first. All 13 exact inputs replayed against the original published Knowledge 16.0.0 matched the original results. Two short public arguments are retained in src/knowledge-record.test-fixture.ts, identifying immutable result blob sha256:0cce0601a94050e27acd4c918b2b7bb9037265f43bfc5a38408140b3a177882b.
Original implementation: focused regression run 8 failed / 8 passed.
Fixed: 38/38 focused tests on macOS and Linux. Correcting only the required closer saves the intended page.
Verification
Earlier failed local samples remain disclosed: macOS has 49 Linux-directory-descriptor failures, reproduced unchanged on base; first container archive included AppleDouble metadata; an init-less container retained a killed descendant as a zombie, reproduced on base; concurrent overlay I/O caused 16 timeouts. The final Linux run uses clean committed source, proper init, isolated Linux test directories, and serialized workers without weakened assertions or timeouts.
Version: 17.0.2. Scope: two production files plus tests/docs/package version.
Rollback: revert this commit and publish a new patch; do not overwrite an existing npm version.
Related system issue: SYS-006 — outcome: fixes — proof: b9b590e (malformed shared-memory admission path; not a claim that all memory issues are closed).