Skip to content

fix(environment): retain conflicting scenario MIME uncertainty - #7357

Closed
ShuaixinHuang wants to merge 30 commits into
morluto:mainfrom
ShuaixinHuang:codex/fix-scenario-content-type-ambiguity
Closed

ShuaixinHuang wants to merge 30 commits into
morluto:mainfrom
ShuaixinHuang:codex/fix-scenario-content-type-ambiguity

Conversation

@ShuaixinHuang

@ShuaixinHuang ShuaixinHuang commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

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 c37ba3e2018e4465aab032bac8eac13786e39854 corrects the two Hermes CLI preview cases actually observed in this branch's preceding CI. Upstream ddb53376 resolves 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 main 79d2fc05.

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 78e68123183eeccc21a4e3d79714dcbdb9c91d95 resolves exactly five conflicting test/fixture files against fixed main 79d2fc05. 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 99ec3b7ff8c585d0b6e1b413e9b5b6f367fd3eb1 adds 4 lines in one test file. The MCP contract loop now explicitly requests detail: "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 423db9e plus 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 5e004ed58cf9c53851e6a8ee892345bc1064a87c aligned only the two native artifact tests and their shared fixture with merged upstream #7479 (740c0f56, fixed main 570abe95). 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.

  • Corrected regression set against the unchanged producer: 5 failed / 21 passed, demonstrating first-header selection in both the producer and registered public CLI handler.
  • Fixed scenario-record, registered CLI manifest-coverage and scenario-timing files: 36 passed.
  • Coverage includes conflicting orders, an excluded value in either position, a later repeat after a conflict, mixed-case header names, identical repeated values, retained body metadata, manifest/replay consistency and unchanged parent capture bytes.
  • 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 pinned 0d1d6e85; those follow-ups changed tests only.

Two follow-ups update nine test files: admitted bundle bytes and owned launcher aliases; an isolated real-ps prerequisite 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 b0d706a passed 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 ffe27cd37961063eb6ebb8b69d7bd715d69b63b7 had 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 head ffe27cd3, 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

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

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.

@chatgpt-codex-connector

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 ⚠️ Failed 2026-10-27T01:06:47.959668Z
We couldn’t complete this review. Comment @codex review to try again.
3d589f4 PR opened
ℹ️ 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

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.

@greptile-apps

greptile-apps Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge, with one remaining non-blocking test-coverage suggestion.

Findings

  1. P2 Exact agreement lacks coverage ▶
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.

Summary

The PR keeps header-only scenario MIME types unknown when Content-Type declarations disagree or contain an excluded value.

  • Scenario manifests keep MIME type unknown when Content-Type headers conflict.
  • Android analysis and setup helpers keep their existing runtime behavior.

Reviews (13) · Last reviewed commit: "merge: retain Hermes ancestor policy in ..." · Reviewed by Greptile

Comment on lines +35 to +39
["application/json", "application/octet-stream"],
["application/octet-stream", "application/json"],
["application/json", null],
[null, "application/json"],
["application/json", "application/octet-stream", "application/json"],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 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!

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

Labels

area: setup Setup, packaging, upgrade, install, Doctor, and client registration bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants