Repository navigation
feat(javascript): keep syntax facts for a source whose member-mutation phase is refused - #11187
Conversation
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
[Medium impact] The PR appears safe to merge, with no outstanding actionable findings. SummaryRefused JavaScript sources now retain syntax-level facts without presenting missing findings as examined.
Reviews (2) · Last reviewed commit: "test(javascript): compare the reference-..." · Reviewed by Greptile |
dd3de83 to
7bfd08e
Compare
0e901bc to
063dd30
Compare
…n phase is refused A source refused by the member-mutation work allowance during static analysis lost every fact, so the application graph counted it as skipped. Reference-source import failed outright on such a file. Checkpoint the parser, comment and text facts the static owner can still state, with parse status partial, examination not-examined and refused_phase member-mutations, before reporting the refusal; the semantic phase is not started because it indexes the same mutations. Reference-source import keeps the file's declaration-level imports and records that its CommonJS require calls were not examined. Refs #8294
7bfd08e to
9e121ad
Compare
|
@greptileai please review the latest commit (9e121ad). Issue 1 from the previous review, which flagged the frozen refusal wording in |
49ec3f6
into
feat/javascript-member-mutation-setting
…etting (#11181) * feat(javascript): make the member-mutation work allowance a runtime setting The member-mutation alias-state allowance from #11144 was a fixed constant, so a refused source could not be admitted without a code change. Register javascript.member_mutation_alias_states (default 524288, 1 to 8388608 alias states) with the launch seed REA_JAVASCRIPT_MEMBER_MUTATION_ALIAS_STATES. The application, web bundle and reference-source boundaries resolve it from the accepted operation snapshot and launch environment, refuse a malformed seed before analysis, and send it to the workers with each source. A refusal names the setting, its effective value, source and range, and the recovery; worker parents rebuild it from the allowance they sent. Refs #8294 * fix(javascript): keep the setting and recovery of a refused web script A web bundle script refused by the member-mutation allowance kept only its reason and reported limits, so the public unknown lost the setting, value, source and recovery. Carry the refusal's structured limit and remediation on the per-script result and its javascript_analysis unknown, grouping scripts only when that recovery agrees. Assert structured limit facts and the owning formatter's recovery instead of fixed wording. * fix(browser): keep only registered setting limits on a refused web script * feat(javascript): keep syntax facts for a source whose member-mutation phase is refused (#11187) * feat(javascript): keep syntax facts for a source whose member-mutation phase is refused A source refused by the member-mutation work allowance during static analysis lost every fact, so the application graph counted it as skipped. Reference-source import failed outright on such a file. Checkpoint the parser, comment and text facts the static owner can still state, with parse status partial, examination not-examined and refused_phase member-mutations, before reporting the refusal; the semantic phase is not started because it indexes the same mutations. Reference-source import keeps the file's declaration-level imports and records that its CommonJS require calls were not examined. Refs #8294 * test(javascript): compare the reference-source refusal with its owning formatter * feat(javascript): keep a refused web script's parse and text facts A captured script whose member-mutation phase was refused lost every fact in analyze_web_bundle, so it was neither counted as parsed nor kept its vendor markers. The analyzer now returns the script as unavailable with partial facts: refused phase, parse status and the inferences read from script text alone. Findings gathered before the refusal are dropped, because they may have read an incomplete mutation index. The worker parent states the refusal and its setting recovery from the allowance it sent, through the same helper the isolated analyzer uses for every unavailable script. The bundle counts the script as parsed, keeps its text inferences, and its javascript_analysis unknown carries refused_phase. Refs #8294 * chore(mcp): record the member-mutation setting in the advertised summary * fix(javascript): rebuild a parked source worker when the member-mutation allowance changes A worker parked on a resource scope was reused when heap, timeout and precision matched, but its requests carry the allowance it was built with. After update_analysis_settings accepted a new allowance, the next analysis on that scope kept the old one. The reuse check now compares the allowance's value and source, so a changed setting gets a worker built with it. The web bundle worker already takes the allowance per script.
Summary
When the member-mutation work allowance refused a source during static analysis, the source lost every fact. The application graph then counted it as skipped (
parsed_javascript_files: 0), which is the #8294 symptom.import-reference-sourcefailed entirely on such a file. With this PR, a refused source keeps the syntax-level facts that earlier phases produced, and those facts are marked with the phase that was refused. #8294 asks for this: "a bounded partial result (syntax-level inventory) would be preferable to skipping the whole file."Stacked on #11181, which makes the allowance a runtime setting.
Refs #8294
Problem and expected behavior
analyze_javascript_application: if the static phase was refused, the worker threw before its static checkpoint, so only the per-sourceanalysis_failureremained.import-reference-source: the refusal escapedparseReferenceSourceImportsand aborted the import.analyze_javascript_application:memberMutationRefusedJavaScriptStaticAnalysisand then reports the same refusal.partial, the syntax coverage with error count, source map directives (from comment tokens) and vendor markers (from source text).analysis_coverage.examination.status: "not-examined",refused_phase: "member-mutations", anunexamined_reasonand a limitation.import-reference-source: the file keeps its declaration-level and dynamic imports. A limitation records that its CommonJS require calls were not examined, with the setting's recovery.Change and scope
javascriptStaticAnalysis.tsowns the syntax-only result builder.javascriptStaticCoverage.ts:examination.refused_phasefield.javaScriptStaticParseStatusnow reportspartialwhen examination isnot-examined. That state was previously unreachable for parsed syntax.javascriptSemanticWorkAllowance.tsaddsisJavaScriptMemberMutationRefusal.analyze_web_bundle. A refused script there is still reported as unavailable (reason: resource). Returning a partialWebBundleScriptAnalysisneeds its own schema decision and is listed as follow-up.Contract and boundary impact
Semantic owner and earliest changed stage: the static analysis owner (
analyzeParsedJavaScriptStaticSourceStepsfamily) andparseReferenceSourceImports. Consumers: the application graph builder (unchanged), which now receives a checkpoint where it previously received none.Contribution scope fit and linked maintainer decision: the coordinator approved this for plan W10. No new authority.
CLI and MCP/tool-catalog contract: one additive optional output field,
analysis_coverage.examination.refused_phase. No input change.Provider, bridge, target-format, or platform compatibility: none.
Evidence, artifact, provenance, or reconstruction contract:
parse_status: "partial"and counts inparsed_javascript_files.Target selection, authority, upstream behavior, and cleanup details: not applicable.
Generated metadata, package, or installation impact: none.
Read existing files or captured data.
Evidence and regression coverage
Tests added or updated:
tests/boundary/javascript/javascriptMemberMutationAllowance.test.tsruns the real application workflow with allowance 8, using both a seed and a runtime override. The refusedmain.jshasparse_status: "partial", complete syntax coverage,examination.status: "not-examined"andrefused_phase: "member-mutations", andparsed_javascript_filesis 1. With an admitting allowance there is no refused record.src/domain/referenceSourceImportParsing.test.ts(new): with the default allowance,require.call(null, "./other")andimport("./lazy")both become relationships. With allowance 1 only the dynamic import is kept,parse_failuresis empty, and a limitation names the refused phase and the setting's value and source.Base reproduction:
parseReferenceSourceImportscallingreferenceSourceRequireCallsdirectly (the base behavior), the new reference test fails withResource constraint during analyze_javascript_semantics: JavaScript member-mutation analysis scheduled more than 1 alias states for one source.Remaining proof gaps:
Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.
Validation performed
npm run typecheckpassed.npm run check:fastpassed (2/2 tasks).node scripts/verify/architecture-guards.mjspassed.npm run docs:checkpassed.npm run test:focused -- tests/boundary/javascript/javascriptMemberMutationAllowance.test.ts: 2 passed.npm run test:local -- src/domain/referenceSourceImportParsing.test.ts: 1 passed. With the fix reverted locally it failed as described above.npm run test:local -- src/domain/javascript/javascriptStaticCoverage.test.ts src/domain/javascript/javascriptMemberMutationCoverage.test.ts src/application/ReferenceSourceImportEntries.test.ts: 49 passed.Compatibility, safety, and release
Author readiness
Human owner:
Before merge
type(scope): outcome.