Repository navigation
fix(javascript): accept retained empty endpoint seeds - #6462
Conversation
896e946 to
930f66b
Compare
930f66b to
d5eb432
Compare
[Medium impact] The PR appears safe to merge; no blocking issues were found. SummaryAllows
Reviews (2) · Last reviewed commit: "fix(javascript): accept retained empty e..." · Reviewed by Greptile |
Codex Review SummaryThis 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. |
|
Thank you for separating these seed cases. I am keeping this PR open: #6458 was closed for empty event names, while main at ca3fd7b still applies |
Application analysis preserves the complete literal request endpoint, including the empty string, and the event seed already accepts a retained empty name. The endpoint seed still required a non-empty value, so trace-javascript-semantics refused to select a retained "" endpoint with invalid_request. The endpoint seed now accepts any string and keeps exact matching. Boundary-field seeds keep their minimum because boundary nodes are only produced from method names. Found while fixing morluto#6458; the event half of that report landed in cf5e4f6. Co-Authored-By: Claude Fable 5.1 <[email protected]>
d5eb432 to
2dd67e4
Compare
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
Summary
trace-javascript-semanticsnow accepts{"kind":"endpoint","value":""}, so a retained empty literal endpoint can be selected by its preserved value instead of being refused withinvalid_request.This is the endpoint half of the defect reported in #6458. The event half (
{"kind":"event","name":""}) landed onmainin cf5e4f6 and that issue is closed. No separate issue covers the endpoint seed; the reproduction is below.Problem and expected behavior
analyze-javascript-applicationpreserves the complete literal request endpoint inproperties.endpoint, including""(requestEndpointreturns the literal unchanged). The seed schema injavascriptSemanticQuerySchemas.tsstill declaresvalue: z.string().min(1)forendpoint, so a seed carrying the retained value fails input validation before matching, while the siblingeventseed already accepts"".Expected: the empty endpoint seed reaches exact matching and selects the retained request node, the same way the empty event seed does.
Change and scope
endpointseed. Matching is unchanged: exact equality against the preserved property, so""matches only empty literal endpoints and never a dynamic (null) endpoint.boundary-fieldkeeps its minimum, because boundary nodes takefieldfrom the boundary method name and never produce an empty value.Contribution scope: ordinary fix within existing boundaries; maintainer scope decision not applicable.
Contract and boundary impact
Semantic owner and earliest changed stage: the semantic query seed schema, shared by CLI and MCP through
applicationWorkflowInputContracts.Contribution scope fit and linked maintainer decision: not applicable (bug fix).
CLI and MCP/tool-catalog contract: the
trace_javascript_semanticsinput schema relaxesminLength: 1on the endpointvalue. Previously valid inputs stay valid.Provider, bridge, target-format, or platform compatibility: none.
Evidence, artifact, provenance, or reconstruction contract: none; trace Evidence shape is unchanged.
Target selection, authority, upstream behavior, and cleanup details: not applicable.
Generated metadata, package, or installation impact: none committed.
npm run docs:checkpasses.Read existing files or captured data.
Evidence and regression coverage
tests/acceptance/applications/javascriptEventPayload.test.tsgains a public CLI workflow. It analyzes an app whose only request isfetch(""), confirms the graph retains a request node withendpoint: "", traces with{"kind":"endpoint","value":""}, and assertsseed_node_idsequal exactly the retained empty-endpoint nodes.e54bf1006;mainat317bf3fe2still declaresvalue: z.string().min(1)for the endpoint seed): the same app and seed through the CLI returninvalid_requestwithissues: [{"path":["query","seed","value"],"reason":"out_of_range","minimum":1}]. On this branch the trace succeeds with the request node as its seed..min(1)restored on the endpoint seed, the new test fails with thatinvalid_request; with the change it passes.For evidence-bearing changes:
Validation performed
Node 24.22.1, macOS 27.0 arm64. Head
2dd67e478on317bf3fe2.npm run check:fast— passed (typecheck, lint 0 errors)npm run knip— exit 1 with 9 findings (unused exports/types, duplicate exports) inanalysisView.ts,artifactGraph.ts,javascriptRpcEndpoints.ts,javascriptSemanticOpaqueEffects.tsandanalysisResourceLimits.ts; the identical 9 findings appear on unmodified317bf3fe2, and none is in a file this PR touchesnpm run docs:check— passednpm run test:focused --onsrc/domain/javascript,src/contracts,tests/conformance/contracts, and every test that references the semantic query ortrace-javascript-semantics— 215 files, 5086 passed, 3 skippednpm run check:pr— not run317bf3fe2, whose push CI is green, to clear the earlier CI failure: ond5eb4321bthe only failure wastests/process-global/pwntoolsStageRetirement.test.ts, which failed identically inmain's own push CI atb675073b7and4557791a2at the time.Compatibility, safety, and release
Author readiness
Human owner: @Lew1sWong
Before merge
type(scope): outcome.🤖 Generated with Claude Code