Repository navigation
refactor: GE-JS-SKILL captureJsImportFacts + scanSkillTextOn tangle (byte-identical) - #708
Conversation
…atement form captureJsImportFacts (tangle S 21.6: nest 6, deep 78, 193 lines, cx 65, ccx 145) walked the ES import specifiers and every export form inline inside its statement loop. The loop now reads as one named step per statement form: captureJsImportStatement (the default / named / namespace specifier walk, L614..L656 of the census), the declaration step (object literals and CommonJS module aliases, unchanged), and captureJsExportStatement (clause and declaration forms) with captureJsDefaultExport (`export default …`). The shared `record` lambda becomes JsBindRecorder::add, which returns the record it appended instead of every caller reaching for binds.back(). Byte-identical by construction: the same records in the same order with the same fields; only where the code that fills them lives moved. Tangle after: captureJsImportFacts S 0 (nest 3, deep 0, cx 15, ccx 22); the new steps S 0 / 0.4 / 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…racker; each line check is a named step scanSkillTextOn (tangle S 23.7: nest 6, deep 83, steer 3, 402 lines, cx 92, ccx 194) carried the inFence / inExampleFence steering flags across its line loop and toggled them inline. The fence state is now detail::SkillFenceTracker with its two named transitions (open, close) and readLine, which answers a line's membership (SkillLineFence) before its marker toggles it; a shell script's line is SkillFenceTracker::kScriptLine. The isExampleFenceLang lambda is a detail:: function. The addFinding / isHit lambdas become SkillFindingSink, and each line check is a named step: scanFrontmatterLine, scanBodyInjectionLine, appendJoinedBodyLine (the joined- body feed), scanBodyExfilLine, scanScopeCreepLine. The loop now reads as: fence membership, then the frontmatter or body checks the line's place calls for. Byte-identical by construction: the same regex searches in the same order per line, the same findings pushed in the same order, the same joined body. Tangle after: scanSkillTextOn S 2.4 (nest 4, deep 2, steer 0, 202 lines, cx 38, ccx 67); every new step S 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
add() appends to the binds vector it holds by reference, so a const recorder that writes was a const-correctness lie (the GE-PREWARM QD-CONST-REF-WRITE smell). The recorder and the steps that take it are now non-const. No code change: the __text section of the binary is byte-identical to the previous commit's build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both append findings through the sink's reference member, so the sink and the line steps that take it are now non-const (the GE-PREWARM QD-CONST-REF-WRITE smell). No code change: the __text section of the binary is byte-identical to the previous commit's build. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… leaveFence The two transitions were spelled open() and close(); crashsweepcheck's raw-site scan reads every `open(` in src/ as a file open, so the method counted as a new unregistered opener in skillscan.h (prereview CI5). The names now say what they change. No behaviour change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
GE-JS-SKILL: byte-identical tangle refactor of two functions
The tangle census ranked these two functions #10 and #8.
Card 1,
captureJsImportFacts(src/ingest_jsimports.h): tangle S 21.6 -> 0, ccx 145 -> 22. One named step per import/export form.Card 2,
scanSkillTextOn(src/skillscan.h): S 23.7 -> 2.4, ccx 194 -> 67. ASkillFenceTrackerwith named transitions (enterFence/leaveFence), plus named per-line check steps.Also: const -> non-const fixes (
JsBindRecorder::add,SkillFindingSink) and theenterFence/leaveFencerename.Byte identity: fire321 321/321 identical, md5 6/6, skill identity set 577/577.
Perf flat: hono cold instructions +0.3 % (inside the base spread), vscode +0.05 %, skill scan equal.
Checks: 42 gates pass. qd: 0 gating, both functions credited under improved.
Branch is 5 commits on e71db70; main has since moved (#704, #705, ...) in other files, merge-tree is clean. Not rebased (ci-gate is strict=false).
🤖 Generated with Claude Code
Summary by CodeRabbit