Skip to content

feat(pcap)!: read capture Evidence through the current result schema only - #10879

Merged
morluto merged 1 commit into
feat/evidence-format-revisionfrom
feat/pcap-evidence-current-format
Nov 15, 2026
Merged

morluto merged 1 commit into
feat/evidence-format-revisionfrom
feat/pcap-evidence-current-format

Conversation

@morluto

@morluto morluto commented Nov 15, 2026

Copy link
Copy Markdown
Owner

Summary

Delete the pcap Evidence read-compatibility schema. Analysis views now read inspect_pcap_capture Evidence through the same result schema the provider writes, and DNS query_labels_hex is required (null when wire identity is unknown).

Refs #10510. Stacked on #10861 (per-site decision row pcap/pcapAnalysis.ts legacyClientIdentity / pcapEvidenceSchemas, analysisView/pcapCaptureView.ts:44).

Problem and expected behavior

pcapEvidenceSchemas.inspect_pcap_capture existed only to default tshark_*/capinfos_* identity fields (resolved_path, sha256, identity_status) for capture Evidence written before executable identity was recorded, and query_labels_hex was optional so historical DNS rows without it stayed readable. #10861 makes the bundle format owner refuse earlier-format bundles, so this per-field compatibility no longer has a reader to serve.

Expected after this PR:

  • pcapCaptureView parses with pcapResultSchemas.inspect_pcap_capture; a record missing executable identity fields is reported as malformed (AnalysisInputError at source.normalized_result.client.*) instead of defaulted to unresolved.
  • query_labels_hex is required and nullable in results; a row omitting it is malformed. The dns-addresses view selector stays optional (omit to match any identity, null selects unknown identity).

Change and scope

  • src/domain/pcap/pcapAnalysis.ts: delete legacyClientIdentity and pcapEvidenceSchemas; query_labels_hex drops .optional().
  • src/domain/analysisView/pcapCaptureView.ts: read with the result schema; the selector applies .optional() itself; matching no longer maps omission to null.
  • src/pcap/PcapOutput.ts: TsharkFields row type requires query_labels_hex (the producer already writes it, null when labels are unknown).
  • Producer check: PcapOutput.ts is the only producer of dns_queries rows and always writes query_labels_hex; PcapProvider always writes all twelve client identity fields through pcapResultSchemas.

Not included: the other per-site decisions from #10861 (separate slices); the historical-reference authority on pcap Evidence (an authority about the capture, not a format compatibility).

Contract and boundary impact

  • Semantic owner and earliest changed stage: pcapResultSchemas (domain) is now the only pcap capture shape; pcapCaptureView consumes it. Superseded: pcapEvidenceSchemas, legacyClientIdentity.
  • Contribution scope fit and linked maintainer decision: Phase 5 / D4 of the approved plan, tracker [Design] Version Evidence bundles and own historical format compatibility in one place #10510.
  • CLI and MCP/tool-catalog contract: inspect_pcap_capture output schema now requires dns_queries[].query_labels_hex; inspect_analysis_view pcap selector description no longer mentions historical records.
  • Provider, bridge, target-format, or platform compatibility: none.
  • Evidence, artifact, provenance, or reconstruction contract: pcap capture records missing these fields are refused as malformed rather than defaulted.
  • Target selection, authority, upstream behavior, and cleanup details: not applicable.
  • Generated metadata, package, or installation impact: catalog digests change with the output schema.

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated: pcapCaptureView.test.ts replaces the two "historical" read tests with a refusal test for a record omitting client.tshark_identity_status or dns_queries[0].query_labels_hex (issue path asserted); fixtures in pcapMcp.test.ts and pcapParentIssuePath.test.ts now write what the provider writes.

  • Base reproduction or other evidence: executed — with the two source files restored to the base, both new refusal cases fail (the base defaults identity and admits the omitted labels).

  • User-visible CLI/MCP output: inspect_analysis_view returns invalid_request with the issue path under source.normalized_result for a malformed retained record.

  • Remaining proof gaps: tshark-gated acceptance tests skipped locally (no tshark on this machine).

  • Observed, derived, and inferred claims remain distinguishable.

  • Artifact identity, source provenance, and failed attempts remain preserved.

  • Unsupported, incomplete, unavailable, or uncertain outcomes remain visible.

Validation performed

  • npm run check:fast — passes.
  • npm run docs:check — passes.
  • npm run test:focused over every test file referencing pcap capture Evidence (24 files) — all pass after fixture updates; tshark-gated cases skipped locally.

Compatibility, safety, and release

  • Breaking changes or migration steps: a retained inspect_pcap_capture record without tshark_resolved_path/tshark_sha256/tshark_identity_status (and capinfos equivalents) or without query_labels_hex was previously read with defaults; it is now refused as malformed. Such records come only from REA 6.x bundles, which feat(evidence)!: give Evidence bundles a format revision owned by one module #10861 already refuses; recreate the capture observation with the current release.
  • Real Hopper/Ghidra, browser, or OS coverage: none; no provider behavior changes.
  • Package or release metadata impact: breaking marker on the commit.
  • Security, privacy, process, or containment review: none.

Author readiness

Human owner:

  • 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.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

…only

Delete the pcap read-compatibility schema that defaulted executable identity for historical capture Evidence, and require query_labels_hex (null when unknown) now that every producer writes it. Evidence from an earlier format is refused at the bundle format owner; a record that omits these fields is reported as malformed instead of defaulted.

BREAKING CHANGE: inspect_pcap_capture results always carry query_labels_hex, and analysis views no longer default missing tshark/capinfos identity fields.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T07:44:54.749403Z 97db28b 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.

@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The PR appears safe to merge with the stated breaking change for older capture records.

Summary

This PR makes pcapResultSchemas the sole schema for reading capture Evidence.

  • Capture views reject saved records missing required identity fields.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  P[PcapProvider] --> S[pcapResultSchemas]
  E[Retained or inline Evidence] --> S
  S -->|Valid current shape| V[Summary or fact page]
  S -->|Missing required fields| X[AnalysisInputError]
Loading

Reviews (1) · Last reviewed commit: "feat(pcap)!: read capture Evidence throu..." · Reviewed by Greptile

@morluto
morluto merged commit 7768c91 into feat/evidence-format-revision Nov 15, 2026
1 check passed
@morluto
morluto deleted the feat/pcap-evidence-current-format branch November 15, 2026 07:54
morluto added a commit that referenced this pull request Nov 15, 2026
…only (#10879)

Delete the pcap read-compatibility schema that defaulted executable identity for historical capture Evidence, and require query_labels_hex (null when unknown) now that every producer writes it. Evidence from an earlier format is refused at the bundle format owner; a record that omits these fields is reported as malformed instead of defaulted.

BREAKING CHANGE: inspect_pcap_capture results always carry query_labels_hex, and analysis views no longer default missing tshark/capinfos identity fields.
morluto added a commit that referenced this pull request Nov 15, 2026
… module (#10861)

* feat(evidence)!: give Evidence bundles a format revision owned by one module

`src/domain/evidenceFormat.ts` owns Evidence format evolution. Bundles now
carry `evidence_format: 1`; every bundle reader admits only the current
revision and refuses an unmarked or other-revision bundle once, with the
single recreate-observations guidance, instead of admitting earlier shapes
one optional field at a time.

The 6.7-era artifact inventory summary identities are no longer rebuilt:
compare_artifacts checks the current projection only and reports a mismatch
with the owner's guidance. The pre-6.6 identity diagnosis uses the same
guidance. SQLite `worker_timeout_ms` and Dart AOT `string_pool.policy`,
optional only for historical Evidence, are now required.

BREAKING CHANGE: Evidence bundles written by REA 6.x (no `evidence_format`)
are refused by import, comparison, reconstruction and analysis-snapshot
readers as an integrity mismatch telling the caller to recreate the
observations; re-exporting an earlier bundle does not update its format or
identities. Bundles constructed by hand must include `"evidence_format": 1`.
6.7-era artifact summaries are refused by compare_artifacts, and SQLite and
Dart AOT Evidence without the newly required fields fails validation.

* fix(evidence): let the ledger application admit its bundle's format

build_reconstruction_obligation_ledger registered the full bundle schema with the SDK, so an unmarked or other-revision bundle was refused as invalid_request before the format owner ran. Register it like coverage: the application parses the request envelope and admits the bundle.

* feat(pcap)!: read capture Evidence through the current result schema only (#10879)

Delete the pcap read-compatibility schema that defaulted executable identity for historical capture Evidence, and require query_labels_hex (null when unknown) now that every producer writes it. Evidence from an earlier format is refused at the bundle format owner; a record that omits these fields is reported as malformed instead of defaulted.

BREAKING CHANGE: inspect_pcap_capture results always carry query_labels_hex, and analysis views no longer default missing tshark/capinfos identity fields.

* feat(desktop)!: require the effective view policy in desktop state Evidence (#10886)

inspect_desktop_application_state always records the complete policy it used, including sqlite_view_bytes. Drop the optional historical shape and the task draft's absent-policy branch.

BREAKING CHANGE: desktop application state results without effective_view_policy, or with a policy missing sqlite_view_bytes, are refused as malformed.

* feat(android)!: require component declaration facets and reference aggregates in Android Evidence (#10904)

* feat(android)!: require component declaration facets and reference aggregates in Android Evidence

The JADX producers always write the manifest component projection with every declaration facet, target_definition and direct_invokes_coverage. Require them, delete the duplicate observed component schema, drop the unknown declaration coverage that only described historical omission, and give manifest view results their explicit facet.

BREAKING CHANGE: Android package, component and reference results missing these fields are refused as malformed; component declaration_coverage and its summary counts no longer include unknown; manifest view results always carry facet manifest.

* refactor(android): parse package results with the domain schema directly

* feat(browser)!: require the DOM length unit and redirect-scoped prior-hop facts (#10897)

* feat(browser)!: require the DOM length unit and redirect-scoped prior-hop facts

Both CDP producers always declare node_value_length_unit, and the observation session writes redirect_response on every redirect event and no other. Require the unit, drop the diff's absent-unit branch, and admit redirect_response exactly on redirect rows.

BREAKING CHANGE: DOM snapshots without node_value_length_unit and redirect timeline rows without redirect_response are refused as malformed, including inline inspections passed to compare_web_captures.

* docs(browser): drop the historical redirect_response omission note

* feat(native)!: require native Evidence fields that were optional only for historical Evidence (#10946)

Mach-O encryption, slice malformed cause, symbol runtime names and import
facts; ELF export encoding facts and visibility; value-flow limits; load-image
permissions and relocation symbols; Swift type-reference kind and GPU AMD
target metadata are required. Legacy enum values (unrecorded, unknown
visibility, undecodable, modinfo_field_exceeds_limit) and the retained
schemas, view defaults and reinterpretations that served historical Evidence
are deleted.

BREAKING CHANGE: native records missing these fields are refused as
malformed; recreate the observation.
@morluto morluto added area: domain Domain logic, errors, and pure functions enhancement New feature or request provider: pcap Analysis provider / engine: pcap labels Nov 22, 2026
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 enhancement New feature or request provider: pcap Analysis provider / engine: pcap

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant