[PR #3078] [CLOSED] fix(javascript): retain directive literals in semantic function fingerprints #5598

Closed
opened 2026-10-31 01:07:52 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3078
Author: @To3akaRin
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: codex/semantic-fingerprint-syntax


📝 Commits (10+)

  • 2330e12 fix(javascript): preserve yield and update forms in fingerprints
  • 4450463 fix(javascript): restore read-site ambient aliases and string config reads
  • c023db3 Merge remote-tracking branch 'origin/main' into fix/main-red-ida-javascript-tests
  • 828ccc3 test: cover config value escapes and source-map edge pairing
  • c0e4aa9 Merge remote-tracking branch 'origin/main' into fix/main-red-ida-javascript-tests
  • aff46f5 test(docs): retarget translated readme link drift at current links
  • deeb362 chore: merge current upstream main
  • a1756dc fix(javascript): retain directive literals in function fingerprints
  • 0fdac09 fix(javascript): admit candidate endpoint interpretation in worker output
  • 59c71be Merge remote-tracking branch 'origin/main' into fix/main-red-ida-javascript-tests

📊 Changes

18 files changed (+465 additions, -41 deletions)

View changed files

📝 docs/javascript-application-workflows.md (+13 -1)
📝 docs/mcp-contracts.md (+12 -7)
📝 docs/web-network-captures.md (+5 -1)
📝 src/browser/CdpCaptureDocuments.test.ts (+2 -0)
📝 src/contracts/inputSchemaPresentation.ts (+2 -2)
➕ src/domain/javascript/javascriptSemanticAnalysis.fingerprints.test.ts (+65 -0)
📝 src/domain/javascript/javascriptSemanticAnalysis.native_bindings.test.ts (+23 -0)
📝 src/domain/javascript/javascriptSemanticFingerprints.ts (+3 -0)
📝 src/domain/javascript/javascriptSemanticMemberMutations.ts (+18 -9)
📝 src/domain/jsonValue.test.ts (+12 -0)
📝 src/javascript/analysis/JavaScriptAnalysisWorkerSchemas.test.ts (+26 -0)
📝 tests/acceptance/applications/javascriptCancellationCli.test.ts (+29 -3)
📝 tests/acceptance/applications/javascriptConfigurationReadsCli.test.ts (+21 -0)
➕ tests/acceptance/applications/javascriptFunctionFingerprintsCli.test.ts (+127 -0)
📝 tests/acceptance/applications/runtime.test.ts (+60 -11)
📝 tests/boundary/browser/sazWebCapture.test.ts (+26 -2)
📝 tests/boundary/mcp/browserComparisonInput.test.ts (+2 -2)
📝 tests/boundary/mcp/enhancedTools.callPathsAndBatches.test.ts (+19 -3)

📄 Description

Summary

Include directive literals in semantic function fingerprints. Otherwise-identical strict, ordinary, asm, custom and escaped-directive functions previously received the same literal-set commitment, so a strict-function query could return all seven candidates.

DirectiveLiteral now enters the existing literal collector with its raw Babel value and a directive tag. Quote style, formatting and local names still normalize; "use\x20strict" remains different from "use strict", nested directives belong to their own callable, and genuine duplicates remain ambiguous. Existing AST traversal and fingerprint projection retain ownership.

Contract and authority

This is inert static analysis with existing CLI/MCP inputs, schemas and algorithm families. Newly analyzed fingerprints reflect directive text; affected callers should reanalyze and obtain fresh seeds. Stored Evidence remains authenticated and queryable with its original components, without rewriting it. Caller source bytes, provenance and ranges are preserved. No provider, target execution, installation or dependency capability is added.

Integration and shared boundary fixes

Merged main through 29d3dcb7ea85b3be37cd81e977ae4e09cebdd2fc normally, preserving upstream commits and authors. The conflict resolution keeps main's dedicated README-facts test owner and its current schema/graph assertions, while retaining invalid DOM-index, SAZ CLI/MCP parity, source-byte preservation and caveat-isolation coverage. No assertion threshold, CI selection, retry or timeout was loosened.

The shared process-effect correction skips an escape only for known primitive configuration slots. Unknown/inherited selections may expose a mutable prototype, so the producer records a wildcard effect for that configuration container; earlier top-level reads and unrelated configuration containers remain independent. The reported counterexamples were reproduced and the Greptile thread was answered and resolved.

Upstream's plain catalog-identity serialization, aborting JSON validation and exact PCAP-output/cleanup fixes are incorporated. The extra JSON regression prevents rejected data from reaching enclosing semantic consumers. Late graph/hash cancellation now uses a controlled progress boundary inside the owned CLI child to invoke the real signal handler, avoiding an external stderr-delivery race; the two early-phase cases still send real OS SIGINT. Typed exit 130 and partial-result assertions remain. Generated runtime, test catalogs and distribution outputs stay uncommitted.

Validation

Final candidate: 237d5d491aceb6b6f3dafd4f2093c3593bdfa503.

  • Original directive regressions: 6 failures / 2 passes before correction. The public compiled CLI/stdio MCP test separates seven functions into six fingerprint classes, retains the intended two strict duplicates, and preserves historical Evidence query results. Existing fingerprint/query tests pass 38 cases.
  • Process-selection repair: original dynamic/prototype counterexamples fail before repair; 151 related mutation/origin tests and 771 semantic-analysis tests pass (overlapping coverage), plus 10 compiled CLI/stdio MCP configuration/builtin cases.
  • Latest merged selection covering JSON/Evidence, process CLI depth errors, cancellation and native configuration: 72 passed, no skips.
  • npm run check, npm run docs:check (including five README consistency checks), dependency validation and git diff --check pass.

Final-head CI at 237d5d491aceb6b6f3dafd4f2093c3593bdfa503: all 21 reported checks successful, including CI required, Portable tests, all five test shards, source/static checks, docs, build, native package validation and the enabled compatibility/recovery lanes. Fourteen provider/capability lanes are skipped by the repository's unchanged scope rules. Greptile succeeds and every review thread is resolved. GitHub reports MERGEABLE / CLEAN; this PR remains open and has not been merged.

Verification limits

The final remote run establishes the repository-selected Linux CI coverage; scope-disabled lanes are reported as skipped. Local verification used macOS arm64 with pinned Node 24.18.0/npm 11.16.0. A Ghidra fixture rejects this host's universal Mach-O Node executable under its simulated Linux provider, so the complete macOS/provider suite is not claimed green. No production Ghidra/IDA/Frida or Windows host execution was performed locally. No current performance, memory or token improvement is claimed.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/3078 **Author:** [@To3akaRin](https://github.com/To3akaRin) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `codex/semantic-fingerprint-syntax` --- ### 📝 Commits (10+) - [`2330e12`](https://github.com/morluto/rea/commit/2330e122591ba6eef74887e502c016c2e159a719) fix(javascript): preserve yield and update forms in fingerprints - [`4450463`](https://github.com/morluto/rea/commit/44504630193253978d1de919bcbb0645652c7b32) fix(javascript): restore read-site ambient aliases and string config reads - [`c023db3`](https://github.com/morluto/rea/commit/c023db356f14fe8cc5ebee7aa2cc2d497677d8c8) Merge remote-tracking branch 'origin/main' into fix/main-red-ida-javascript-tests - [`828ccc3`](https://github.com/morluto/rea/commit/828ccc36b65c0ea373cddc227998b5b9bcef7b28) test: cover config value escapes and source-map edge pairing - [`c0e4aa9`](https://github.com/morluto/rea/commit/c0e4aa91bb72411adfc4d5c5cf8d4d7ad892998f) Merge remote-tracking branch 'origin/main' into fix/main-red-ida-javascript-tests - [`aff46f5`](https://github.com/morluto/rea/commit/aff46f51fdb38f3c1c481af59099c1c4de837161) test(docs): retarget translated readme link drift at current links - [`deeb362`](https://github.com/morluto/rea/commit/deeb36240fdef476c2a7486557b24ebb419923b0) chore: merge current upstream main - [`a1756dc`](https://github.com/morluto/rea/commit/a1756dc0e192b9b8e66b1f62700978571b7dc431) fix(javascript): retain directive literals in function fingerprints - [`0fdac09`](https://github.com/morluto/rea/commit/0fdac09259eabafc7f852723c20d034e324590c2) fix(javascript): admit candidate endpoint interpretation in worker output - [`59c71be`](https://github.com/morluto/rea/commit/59c71be89e9e524e67931d3750ebd3367d715598) Merge remote-tracking branch 'origin/main' into fix/main-red-ida-javascript-tests ### 📊 Changes **18 files changed** (+465 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `docs/javascript-application-workflows.md` (+13 -1) 📝 `docs/mcp-contracts.md` (+12 -7) 📝 `docs/web-network-captures.md` (+5 -1) 📝 `src/browser/CdpCaptureDocuments.test.ts` (+2 -0) 📝 `src/contracts/inputSchemaPresentation.ts` (+2 -2) ➕ `src/domain/javascript/javascriptSemanticAnalysis.fingerprints.test.ts` (+65 -0) 📝 `src/domain/javascript/javascriptSemanticAnalysis.native_bindings.test.ts` (+23 -0) 📝 `src/domain/javascript/javascriptSemanticFingerprints.ts` (+3 -0) 📝 `src/domain/javascript/javascriptSemanticMemberMutations.ts` (+18 -9) 📝 `src/domain/jsonValue.test.ts` (+12 -0) 📝 `src/javascript/analysis/JavaScriptAnalysisWorkerSchemas.test.ts` (+26 -0) 📝 `tests/acceptance/applications/javascriptCancellationCli.test.ts` (+29 -3) 📝 `tests/acceptance/applications/javascriptConfigurationReadsCli.test.ts` (+21 -0) ➕ `tests/acceptance/applications/javascriptFunctionFingerprintsCli.test.ts` (+127 -0) 📝 `tests/acceptance/applications/runtime.test.ts` (+60 -11) 📝 `tests/boundary/browser/sazWebCapture.test.ts` (+26 -2) 📝 `tests/boundary/mcp/browserComparisonInput.test.ts` (+2 -2) 📝 `tests/boundary/mcp/enhancedTools.callPathsAndBatches.test.ts` (+19 -3) </details> ### 📄 Description ## Summary Include directive literals in semantic function fingerprints. Otherwise-identical strict, ordinary, asm, custom and escaped-directive functions previously received the same literal-set commitment, so a strict-function query could return all seven candidates. `DirectiveLiteral` now enters the existing literal collector with its raw Babel value and a directive tag. Quote style, formatting and local names still normalize; `"use\x20strict"` remains different from `"use strict"`, nested directives belong to their own callable, and genuine duplicates remain ambiguous. Existing AST traversal and fingerprint projection retain ownership. ## Contract and authority This is inert static analysis with existing CLI/MCP inputs, schemas and algorithm families. Newly analyzed fingerprints reflect directive text; affected callers should reanalyze and obtain fresh seeds. Stored Evidence remains authenticated and queryable with its original components, without rewriting it. Caller source bytes, provenance and ranges are preserved. No provider, target execution, installation or dependency capability is added. ## Integration and shared boundary fixes Merged main through `29d3dcb7ea85b3be37cd81e977ae4e09cebdd2fc` normally, preserving upstream commits and authors. The conflict resolution keeps main's dedicated README-facts test owner and its current schema/graph assertions, while retaining invalid DOM-index, SAZ CLI/MCP parity, source-byte preservation and caveat-isolation coverage. No assertion threshold, CI selection, retry or timeout was loosened. The shared process-effect correction skips an escape only for known primitive configuration slots. Unknown/inherited selections may expose a mutable prototype, so the producer records a wildcard effect for that configuration container; earlier top-level reads and unrelated configuration containers remain independent. The reported counterexamples were reproduced and the Greptile thread was answered and resolved. Upstream's plain catalog-identity serialization, aborting JSON validation and exact PCAP-output/cleanup fixes are incorporated. The extra JSON regression prevents rejected data from reaching enclosing semantic consumers. Late graph/hash cancellation now uses a controlled progress boundary inside the owned CLI child to invoke the real signal handler, avoiding an external stderr-delivery race; the two early-phase cases still send real OS SIGINT. Typed exit 130 and partial-result assertions remain. Generated runtime, test catalogs and distribution outputs stay uncommitted. ## Validation Final candidate: `237d5d491aceb6b6f3dafd4f2093c3593bdfa503`. - Original directive regressions: **6 failures / 2 passes before correction**. The public compiled CLI/stdio MCP test separates seven functions into six fingerprint classes, retains the intended two strict duplicates, and preserves historical Evidence query results. Existing fingerprint/query tests pass **38 cases**. - Process-selection repair: original dynamic/prototype counterexamples fail before repair; **151** related mutation/origin tests and **771** semantic-analysis tests pass (overlapping coverage), plus **10** compiled CLI/stdio MCP configuration/builtin cases. - Latest merged selection covering JSON/Evidence, process CLI depth errors, cancellation and native configuration: **72 passed**, no skips. - `npm run check`, `npm run docs:check` (including five README consistency checks), dependency validation and `git diff --check` pass. [Final-head CI](https://github.com/morluto/rea/actions/runs/38526311592) at `237d5d491aceb6b6f3dafd4f2093c3593bdfa503`: **all 21 reported checks successful**, including `CI required`, `Portable tests`, all five test shards, source/static checks, docs, build, native package validation and the enabled compatibility/recovery lanes. Fourteen provider/capability lanes are skipped by the repository's unchanged scope rules. Greptile succeeds and every review thread is resolved. GitHub reports `MERGEABLE` / `CLEAN`; this PR remains open and has not been merged. ## Verification limits The final remote run establishes the repository-selected Linux CI coverage; scope-disabled lanes are reported as skipped. Local verification used macOS arm64 with pinned Node 24.18.0/npm 11.16.0. A Ghidra fixture rejects this host's universal Mach-O Node executable under its simulated Linux provider, so the complete macOS/provider suite is not claimed green. No production Ghidra/IDA/Frida or Windows host execution was performed locally. No current performance, memory or token improvement is claimed. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:07:52 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5598
No description provided.