Repository navigation
fix(environment): retain conflicting scenario MIME uncertainty - #7357
ShuaixinHuang wants to merge 30 commits into
Conversation
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. |
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Low impact] The PR appears safe to merge, with one remaining non-blocking test-coverage suggestion. Findings
Fix with agent prompt### Issue 1
src/domain/analysisView/scenarioCaptureRecords.test.ts:35-39
The new cases do not protect the distinction between exact agreement and different declarations of the same MIME type. Add a header-only case with `application/json` and `application/json; charset=utf-8`, and expect an unknown MIME type and no tool. Otherwise, comparing normalized MIME types instead of the original strings could pass every new test while breaking the intended behavior.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.SummaryThe PR keeps header-only scenario MIME types unknown when Content-Type declarations disagree or contain an excluded value.
Reviews (13) · Last reviewed commit: "merge: retain Hermes ancestor policy in ..." · Reviewed by Greptile |
| ["application/json", "application/octet-stream"], | ||
| ["application/octet-stream", "application/json"], | ||
| ["application/json", null], | ||
| [null, "application/json"], | ||
| ["application/json", "application/octet-stream", "application/json"], |
There was a problem hiding this comment.
Exact agreement lacks coverage
The new cases do not protect the distinction between exact agreement and different declarations of the same MIME type. Add a header-only case with application/json and application/json; charset=utf-8, and expect an unknown MIME type and no tool. Otherwise, comparing normalized MIME types instead of the original strings could pass every new test while breaking the intended behavior.
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/domain/analysisView/scenarioCaptureRecords.test.ts
Line: 35-39
Comment:
**Exact agreement lacks coverage**
The new cases do not protect the distinction between exact agreement and different declarations of the same MIME type. Add a header-only case with `application/json` and `application/json; charset=utf-8`, and expect an unknown MIME type and no tool. Otherwise, comparing normalized MIME types instead of the original strings could pass every new test while breaking the intended behavior.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Superseded by #7786 at the author's request. The replacement retains only the original scenario MIME feature on refreshed upstream; the original discussion and evidence remain preserved.
Latest-head CI completed successfully
Verified at 2026-10-27T14:45:34.7335937Z, head
c37ba3e2018e4465aab032bac8eac13786e39854: complete CI workflow 40520561853 and its CI required gate both finished success. This is evidence for this exact current head. Title and human author-declaration checks were also successful before this evidence-only body update; their fresh metadata checks may run again. Earlier queued/failed stages below are retained as historical records, not the current result. Local validation limitations remain disclosed. CI success does not establish maintainer approval or permission to merge.Earlier shared Hermes preview correction (2026-10-27)
Current head
c37ba3e2018e4465aab032bac8eac13786e39854corrects the two Hermes CLI preview cases actually observed in this branch's preceding CI. Upstreamddb53376resolves existing directory ancestors even when the final directory is absent; the fixture now expects native sticky routing for the symlinked default root and external routing for an escaping prefix in both missing/existing states. It retains both iterations, exact config/skill targets, unchanged profile bytes, no backups and no dry-run writes. The correction is exactly one expectation line relative to pinned main79d2fc05.Because these cases were newly introduced upstream, changing their block required a normal merge of that same fixed upstream rather than repeated patch-only conflict resolution. Normal hooks also applied behavior-equivalent import, spread and regex formatting. These normalizations were inspected; no new provider capability, resource budget, retry, skip or runtime policy is introduced.
Shared validation executed once on the actual PCK-plus-main producer: the complete Hermes CLI acceptance file passed 22 tests / 1 existing Windows named-user skip, including both formerly failing cases and all five nested-home cases. The combined acceptance/boundary command was 52 passed / 5 existing skips / 3 failed; the remaining boundary failures compare POSIX path spellings on Windows. The complete combined command is not green and was not repeated on every branch. All normal pre-push typecheck/lint tasks passed 2/2 for this branch. Latest-head CI 40520561853 has been created and must complete independently; earlier green runs are historical.
Earlier conflict alignment (2026-10-27)
Head
78e68123183eeccc21a4e3d79714dcbdb9c91d95resolves exactly five conflicting test/fixture files against fixed main79d2fc05. It adopts the maintainer-reviewed structured error and launcher assertions, preserves unknown ownership, exact configuration paths and unchanged bytes, and retains nonempty remediation checks. The Windows tshark fixture adds the missing raw-DNS branch while retaining flat packets, version and invalid-argument handling. No feature/production file or dependency is changed by this follow-up; no skips, retries or timeouts are added. Read-only merge-tree exited 0, and GitHub reported no merge conflicts after the normal push.Shared Windows verification was executed once on the actual PCK-plus-main merge
b2a3c27f: 47 passed / 11 existing skips / 4 failed across four complete focused files. Browser cleanup 8/8 and MCP limitations 4/4 passed. The remaining client-registration cases use POSIX launcher paths (3 failures) and an unavailable Windows symlink privilege (1 failure); the complete command is not green. The standalone PCK command had previously recorded 45 passed / 11 existing skips / 6 failed; the actual merged producer resolved the two cleanup-structure mismatches. The Windows stub probe passed version, 3 flat packets, the 49-byte raw DNS packet and invalid-argument exit 2; this is fixture validation, not a real tshark engine claim. These shared results were not rerun on every branch.Normal push hooks passed typecheck/lint 2/2 on each branch. Latest-head CI 40516928700 has been created and still needs its own full result; earlier green heads do not qualify this head. Any older host-dependent DMG/CLI timeout failure is not claimed fixed by these assertion-only conflict alignments.
Earlier Android contract precondition (2026-10-27)
Earlier head
99ec3b7ff8c585d0b6e1b413e9b5b6f367fd3eb1adds 4 lines in one test file. The MCP contract loop now explicitly requestsdetail: "complete"only when that contract declares the field, matching the test's requirement for inline Evidence instead of the JNI contract's summary default. Named-operation, raw Evidence, Ajv schema and cleanup assertions remain intact. This follow-up changes no feature implementation or other tests. Normal pre-commit formatting/lint and pre-push typecheck/lint 2/2 passed (24.613 s), with hooks enabled.Shared isolated evidence used actual failed CI merge
423db9eplus the patch: the existing JNI owner MCP proof passed 1 selected / 4 unselected (35.66 s), and typecheck passed (17.157 s). This is shared diagnostic evidence, not a complete POSIX test-file run or current-branch CI pass. This head's own main CI 40501976552 is queued (checked 2026-10-27 12:14:50 UTC); its required conclusion is pending. Original feature and engine-validation limitations below retain their scope.Earlier upstream test compatibility (2026-10-27)
Historical head
5e004ed58cf9c53851e6a8ee892345bc1064a87caligned only the two native artifact tests and their shared fixture with merged upstream #7479 (740c0f56, fixed main570abe95). This commit leaves the existing feature/production source and all other tests unchanged. All three Git blobs match that upstream revision; merge-tree against it is clean. Normal pre-commit formatting/lint and pre-push typecheck/lint 2/2 passed (29.303 s), with hooks enabled.The 24/24 loader/verifier check was shared validation executed on #7062 at
a2161f78; it was not this branch's full verification. Historical main CI 40496378430 subsequently failed the Android MCP inline-Evidence contract case corrected above. The earlier green head and this native-fixture head are superseded. The dated checks and limitations below remain evidence for their named revisions.Summary
Keep a header-only browser scenario's media type unknown when repeated Content-Type declarations disagree or one value was excluded. Previously, selecting the first header made an environment manifest include a JSON tool for
[application/json, application/octet-stream]but exclude it when the same declarations were reversed. A retained JSON header followed by an excluded value also became an unjustified certain MIME type.Aggregate the declarations at the existing scenario-record owner. All matching values must be retained and exactly agree before forwarding a single source value. No new MIME parser is introduced; downstream media-type interpretation remains with its current owner. Identical repeats remain usable, independently captured body media metadata keeps its existing precedence, and original capture headers are retained unchanged.
Scope
Existing environment-manifest/replay projections and their CLI handler only; no new browser interaction, execution, write authority, operation, schema or dependency. Distinct source values, even if a consumer might consider their essences equivalent, are conservatively unknown rather than selecting one spelling or parameter set.
Feature verification (before CI synchronization)
Windows, Node 24.22.1 / npm 11.16.0; based on
0ddde829.npm run check:fast,git diff --check, normal pre-commit/pre-push hooks: passed. The initial lint rejection on an oversized test group was corrected by separating the new scenario group; no lint rule was disabled.The CLI verification invokes the production registered handler in-process. No live browser, separate compiled executable CLI/MCP session, Linux/macOS run or complete local gate was exercised. Current-head hosted CI status is recorded above. The separate shared CI repairs are described below.
Earlier CI repair evidence (2026-10-27)
Historical head:
ffe27cd37961063eb6ebb8b69d7bd715d69b63b7. Normal commit hooks and pre-push typecheck/lint 2/2 tasks passed (28.184 seconds for the final pre-push check). The last full upstream synchronization remains pinned0d1d6e85; those follow-ups changed tests only.Two follow-ups update nine test files: admitted bundle bytes and owned launcher aliases; an isolated real-
psprerequisite while retaining the leading empty PATH component; exact DNS query labels; TOML integer-range and registration facts; native-provider refusal expectations; retained browser cleanup diagnostics; and authentication-before-import controls. Existing admission, nonexecution, retry, partial-observation and transaction-atomicity checks remain enforced.Shared hosted evidence on root repair head
57136e6f21b68849d2f949622151ff1eaafcdb3e: complete CI 40469048903 and independent packet-capture verification 40469048779 both completed successfully. These validate the shared repair revision, not this PR's new head.The corrected-fixture diagnostic against actual CI merge
b0d706apassed 9 selected cases / 116 unselected. This was a focused diagnostic, not a complete #7357 test run. The Ghidra PATH probe on Windows used the production lookup owner with inert files; it did not run the POSIX doctor case or a real Ghidra engine. Earlier broad Windows client and alias commands were not uniformly green, and their platform-specific gaps are not reported as passing.Historical snapshot at 2026-10-27 16:30 CST: superseded head
ffe27cd37961063eb6ebb8b69d7bd715d69b63b7had completed successful hosted CI: main CI 40471250775, including CI required, and the separate real-packet/tshark run 40471250744. That revision's Conventional PR title and PR readiness checks passed; GitHub reported that head mergeable without conflict at that time. These are this PR's own results for superseded headffe27cd3, independent of the earlier shared root evidence. The original feature-verification scope, focused 9-case/116-unselected diagnostic and non-green local Windows limitations above remain unchanged.The scenario-record, registered CLI handler and timing files passed 36/36 at
9c02ff6a; all three feature-file blobs remain unchanged by these test repairs. This feature verification invokes the registered handler in-process. No live browser or separate compiled executable CLI/MCP scenario session was exercised locally; the original feature-validation scope and limitations above remain in force.Author readiness
Human owner: @ShuaixinHuang
The human owner explicitly confirmed that review of this published PR was complete in this chat on 2026-10-27. The prior ownership and responsibility confirmation remains in force. This records initial readiness for the published change; subsequent validation remains documented above.