Skip to content

fix(javascript): omit dynamic key names from structural fingerprints - #2968

Closed
rudycelekli wants to merge 3 commits into
morluto:mainfrom
rudycelekli:candidate/rea-next10-fingerprint-20261013
Closed

rudycelekli wants to merge 3 commits into
morluto:mainfrom
rudycelekli:candidate/rea-next10-fingerprint-20261013

Conversation

@rudycelekli

@rudycelekli rudycelekli commented Oct 13, 2026 •

Copy link
Copy Markdown

Renaming a local key in value[key] currently changes its advertised rename-resistant bundle fingerprint; computed and fixed member access can also collide. Keep computed access syntax, omit the dynamic binding spelling, and retain template contents through their own AST tokens. Introduce one shared babel-ast-v2 identity for producer, static types and worker admission. Retained v1/v2 values cannot structurally match; re-analyze both snapshots for v2 comparison. Exact factory source digests remain distinct. AI-assisted implementation and verification with OpenAI Codex; no linked issue because this came from a reproduced source audit.

Verified against base 8fef2aa6: npm run check, test discovery and 43 focused/boundary/owned-worker tests pass; generated documentation checks also passed for the unchanged production contract. The committed worker-schema regression round-trips actual producer v2 facts and rejects v1 at the algorithm field; a mutant permitting v1 fails this test. The affected artifact graph boundary now expects v2 and passes after reproducing the stale v1 failure. Whole-repository version search leaves v1 only in intentional incompatibility documentation and the negative test. Actual compiled CLI and SDK stdio MCP comparisons show distinct source digests and matching v2 fingerprints for renamed keys, with Evidence parity, subsequent ping and cleanup. This is static JavaScript workflow verification, not human approval or an external-provider claim.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T18:48:56.448372Z 7fe73a0 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 30a450f7f6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

import type { ElectronStaticFindings } from "./electronStaticAnalysisTypes.js";

/** Token semantics shared by bundle producers and worker admission. */
export const JAVASCRIPT_AST_FINGERPRINT_ALGORITHM = "babel-ast-v2";

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update the boundary expectation to babel-ast-v2

With this constant, every recovered module now reaches JavaScriptArtifactGraphBundlers.ts as babel-ast-v2, but the boundary case in tests/boundary/filesystem/javascript-applications/javascriptArtifactReconstruction.test.ts:364 still requires babel-ast-v1. That case is included by Vitest's boundary project, so npm run check:pr and the boundary suite deterministically fail after this version bump; update the boundary expectation as part of this change.

AGENTS.md reference: AGENTS.md:L25-L25

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 7fe73a0: the boundary expectation in javascriptArtifactReconstruction.test.ts now requires babel-ast-v2.

@greptile-apps

greptile-apps Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Low impact] This test-only change appears safe to merge.

Summary

Adds a regression test for fingerprint compatibility across the worker schema.

  • A worker-boundary test checks JavaScript fingerprint versions.

The previous unnumbered finding is addressed. No new correctness or security issues were found. The merge-base checks differed, so the full PR diff was reviewed. Replacement-PR status could not be checked because GitHub authentication was unavailable. Tests were not run during this review.

Reviews (3) · Last reviewed commit: "Merge remote-tracking branch 'origin/mai..." · Reviewed by Greptile

@morluto morluto added area: domain Domain logic, errors, and pure functions bug Something isn't working labels Oct 14, 2026
morluto added a commit that referenced this pull request Oct 14, 2026
Preserve CommonJS literal paths and confined ESM URL semantics, including package main fallback, directory intent, Unicode identity, and present opaque modules. Parse extraction inputs at their AST/source owner, retain skipped HTML and source-map coverage, and distinguish endpoint candidates from proven receiver facts. Version structural fingerprints with computed literal contents and propagate them through worker contracts.

Reviewed fixes include #1810, #1840, #2642, #2700, #2702, #2714, #2803, #2960, #2968, #2986, #3035, and #3036.

Validation: 158 resolver tests passed; public CLI/MCP module lookup controls, package-main/Unicode workflows, and six builtin workflows passed in the current compiled lane. Worker schema/fingerprint regressions passed. Large public pdf.js completion and real Electron analysis remain unverified.
@kaoru0822-kitauji kaoru0822-kitauji added the ci-fix-wip Claimed by the CI-fix track label Oct 14, 2026
# Conflicts:
#	src/domain/javascript/javascriptAstFingerprint.test.ts
#	src/domain/javascript/javascriptAstFingerprint.ts
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@kaoru0822-kitauji

Copy link
Copy Markdown
Collaborator

CI-fix track: the Windows lane failure (inspection conformance probe.mjs retry, "Missing expected exception") isn't from this PR; unrelated PRs failed it the same way. I merged main to clear the conflicts. Main already shipped this fingerprint change in b58adaf (computed-key tokens, template contents), so javascriptAstFingerprint.ts and its unit test now match main. What's left is this PR's boundary test: the worker schema admits producer babel-ast-v2 fingerprints and rejects v1. It passes against main, along with the fingerprint unit tests (34 total), and check:fast is clean. Main is currently red for unrelated reasons; #3080 fixes that.

@kaoru0822-kitauji kaoru0822-kitauji removed the ci-fix-wip Claimed by the CI-fix track label Oct 14, 2026
@CassieFox23

Copy link
Copy Markdown
Contributor

Heads up: main covers this in its own way in b58adaf. The code is in src/domain/javascript/javascriptStaticAnalysisTypes.ts, and versions fingerprints through the worker schema and rejects v1 shows it. It is listed on tracker #3582. If this PR still adds something main doesn't have, please say so here and I'll take it off the list. Thanks for the fix!

🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊

@rudycelekli

Copy link
Copy Markdown
Author

Closing: main already contains this change, so this PR is superseded. Thanks for the review.

@morluto

morluto commented Oct 15, 2026

Copy link
Copy Markdown
Owner

@rudycelekli, thanks for identifying that dynamic binding names should not destabilize rename-resistant fingerprints while computed access syntax must remain distinct from fixed access. The current versioned fingerprint representation carries the semantic form through worker admission and comparison (main).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: domain Domain logic, errors, and pure functions bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants