Skip to content

feat(analysis): add opt-in retained inventory and WASM views - #2122

Merged
N0zoM1z0 merged 23 commits into
mainfrom
feat/compatibility-first-analysis-20261012
Oct 12, 2026
Merged

N0zoM1z0 merged 23 commits into
mainfrom
feat/compatibility-first-analysis-20261012

Conversation

@N0zoM1z0

@N0zoM1z0 N0zoM1z0 commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Let agents read the facts needed for an investigation from retained inventory and WASM Evidence while keeping existing complete CLI/MCP requests usable. Add precise known nested inventory output, explicit summary/path/page delivery, and a small internal static WASM descriptor. Refs #2016.

Problem and expected behavior

A manifest/path question previously delivered the entire inventory. A completed SQLite WASM result can exceed the MCP frame even when the question needs only counts and a few exports. Callers should be able to select those facts without repeating analysis, losing the original Evidence, or changing existing default output.

The post-integration public Obsidian comparison delivers 937,404 compact JSON bytes through the unchanged complete workflow versus 16,322 bytes through explicit summary plus exact path views (about 98.3% less). Selected facts and atomic source identity agree. These are delivery bytes, not exact token counts or a general engine speedup.

Change and scope

  • Specialize current inventory output using its owning schemas while preserving the generic historical Evidence input parser.
  • Add explicit inspect_artifact summary delivery and retained/portable inventory views with exact path selection. Retain complete inspection and atomic source records; delivery selection does not reach the producer.
  • Add typed WASM summaries/facets and Unicode-safe text pages from existing Evidence. Validate decoded WAT digest at its model boundary. Views perform no WABT rerun, WASM execution or implicit fetch.
  • Bind the existing named WASM contract, command, factory and retryable cleanup through one internal static descriptor. Preserve legacy construction and service injection.
  • Preserve current main's HAR API-surface views, capture admission and exact layout/JavaScript summary contracts after integration with c22111eca.
  • Include reproducible cost/model drivers, source-owned artifact inputs and concise Markdown findings. Detailed generated JSON receipts are archived outside the checkout and removed from the final PR tree; historical checkpoint commits remain intact. Token consumption and time to a correct answer are primary objectives; memory/CPU are measured and controlled. The Ghidra experiment found lost callee facts under reduced analysis, so the production default stays unchanged. External plugin SDK/loading and engine-database caching are deferred.

Contract and boundary impact

  • Semantic owner and earliest changed stage: domain inventory/WASM models and pure selected-view projection; MCP artifact delivery owns the explicit summary option.
  • CLI and MCP/tool catalog: existing names, argument meanings and complete defaults remain. Schemas add precise nested output and optional view alternatives; the catalog digest changes intentionally. New capabilities against old servers require schema discovery and supported equivalents; no universal automatic fallback is implemented.
  • Provider/format/platform: caller-selected providers remain; no analyzer-default or engine-protocol change. Real coverage is scoped below.
  • Evidence/provenance: complete source identity and original values remain; derived views have their own IDs and parent links. Source completeness, page coverage, uncertainty and limitations remain distinct. Existing close/retention semantics remain.
  • Process/cleanup: the descriptor shares the existing service owner and retains failed cleanup for retry. No new target execution or mutation authority.
  • Generated/package/install: authored skill references and architecture/contract docs are updated and regenerated. Build outputs, binaries, raw producer tables, credentials and local profiles are excluded. Package version, dependency lock and installer behavior are unchanged relative to main.

Representative opt-in MCP flow:

{"name":"inspect_artifact","arguments":{"detail":"summary"}}

Use its normalized_result.parent_evidence_id as the exact source reference:

{
  "name":"inspect_analysis_view",
  "arguments":{
    "source":{"kind":"retained-evidence","evidence_id":"<parent_evidence_id from receipt>"},
    "view":{"kind":"inventory","collection":"occurrences","logical_paths":["package.json","main.js"],"offset":0,"limit":32}
  }
}

Omitting detail retains the original complete inspection.

Evidence and regression coverage

  • Tests: public SDK-converted schemas, complete/summary delivery, exact/empty path selection, partial-source coverage, portable views after source deletion, authenticated import/export, oversized-response continuation, Unicode paging, invalid digest and cleanup retry.

  • Executed baseline evidence: frozen 42b0ed12 and explicitly recorded candidate runtimes; unchanged target SHA-256, source identities and selected facts. Genuine old SQLite/Obsidian records are imported or passed inline to the integrated runtime with WABT unavailable, then viewed/exported without another producer run; the entire original WASM record is deeply equal.

  • Real artifacts/models: shipped jq, NewPipe, ShareX assemblies, OpenWrt, Obsidian and SQLite; published historical WETH bytecode; owned Excalidraw/Chromium capture. Earlier real Codex CLI trials keep their original revision/configuration fingerprints. One same-question SQLite pair changes calls from 42 to 3 and reported input tokens from 304,698 to 74,387 after exact summary guidance; this is one stochastic pair, not a statistical/general causal claim.

  • Remaining gaps: native PE, DOS, other OS/engine lanes and deeper runtime/firmware questions remain progressive work. JavaScript model output omits full coverage provenance; browser model output loses accessibility metadata to client context clipping. These are incomplete answers, not full model passes. WETH deployment authenticity is unverified.

  • Observed, derived and inferred claims remain distinguishable.

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

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

Validation performed

Post-main-integration verification is pinned independently from the earlier experiments:

  • npm run build:cached, npm run docs:generate, npm run check, npm run docs:check — passed.
  • npm run test:focused -- ten relevant domain/service/parser/MCP/cleanup files — 112/112 passed.
  • npm run test:focused -- tests/boundary/cli/analysisViewCli.test.ts — 10/10 passed.
  • npm run test:focused -- tests/boundary/mcp/contractPresentation.test.ts — 1/1 passed, unchanged deadline, isolated. The earlier pinned combined run's timeout remains recorded.
  • npm run verify:wasm:package — 42 real WABT 1.0.42 CLI/MCP cases passed after actual package creation and private-prefix installation.
  • verify-migration.mjs and a fresh baseline/integrated Obsidian SDK cohort — original records/IDs, default complete output and selected summary/path facts preserved.
  • The two description-related stale text checks are synchronized without production changes; 11/11 focused assertions passed.
  • Formatting/diff checks and final cached pre-push type/lint gate — passed.

Post-integration verification, CI attribution and measured findings. The archived JSON files are byte-verified and indexed locally; reproduction does not depend on local outputs.

CI attribution and current review checkpoint

The first PR run exposed two description-related test mismatches; 00d51e0fc
updated only those expectations. Historical prompt-completion and Darwin package
failures also occurred in main at c22111eca,
with byte-identical affected source/fixtures. Those failures were left for the
team as requested. Main subsequently repaired provider-readiness fixtures in
621cee192 and fe4b94a66; this PR is rebased onto main 60259a91d.

Current head 534a6271e571b925341c93397e8e5f118ca43676 is pushed; required CI is
pending/queued, so the current complete remote gate is not yet verified green.
The maintainer authorized a verified merge. Earlier exact-head merging was
rejected by the required coverage/timing gate; repository protection is unchanged
and auto-merge is disabled. No release or deployment is authorized or performed.

Six substantive review findings have been reproduced and addressed: atomic and
outer inventory subject/digest/format identity, exact WASM source path/digest,
undeclared inherited provider controls, effective provider PATH comparability, and unknown final resource counters.
Missing final counters now remain unverified rather than grading as zero. Related parser/short-command probes and existing-model regrading cover this driver-only correction; unrelated checks were not repeated. Earlier resource receipts retain last-sampled observations and do not prove final counters. Original records and valid source identities remain unchanged. Actual public SDK
before/after probes use original shipped Obsidian and published VS Code grammar
producer data. Boundary assertions cover summary and collection projections.
Fresh differing-PATH Obsidian replays preserve facts but correctly fail settings
comparability. Missing PATH fingerprints also cannot certify equal settings.

The latest three inventory MCP workflows, runtime build, fast static gate and
generated docs pass. An initial negative-case placement exceeded the existing
large ZIP test deadline; checks were moved to the small real format workflow,
retaining the original capacity/retention coverage and deadline. The final scope
records one soft memory-high event, no hard/task-limit abort and no OOM/OOM-kill;
this is static/test verification, not a valid performance trial. Earlier recorded
focused/package/model results keep their original runtime scope.

Compatibility, safety and release

  • Migration: existing users need no new pack, request rewrite or configuration change to retain these capabilities. New delivery is opt-in. This evidence covers the recorded baseline/workflows; it is not an unconditional guarantee for every historical client/platform.
  • Catalog cost: integrated complete catalog JSON is 2,359,082 bytes versus frozen baseline 2,326,609 (about 1.4% larger); this includes intervening main changes. Retained delivery saves context without claiming less upstream analysis or automatic savings on old complete requests.
  • Host/provider scope: Linux x64, real Ghidra native experiment, installed WABT and owned Chromium. IDA/Hopper, Windows/macOS, Harmony and device-backed behavior are not established by recording-port tests.
  • Containment: heavy lanes run serially with one CPU, 4 GiB hard memory, 3 GiB early stop and no swap. Integration scopes have no OOM/OOM-kill or hard-limit abort. The full static scope records three memory.high events and the subsequent cold pre-push scope records 37; neither reaches the hard limit or OOM; the earlier 192-task browser abort and qualified 256-task retry remain recorded. Disposable model profiles/authentication copies are removed; ambient environment is not persisted.
  • Review/release: no version bump, publication or deployment. Full local check:pr and the complete generic package verifier were not run; CI and reviewers own the broader gate. Newly discovered out-of-scope REA findings remain in the separate local team-handoff document rather than being repaired in this change.

Review checklist

  • Concrete agreed enhancement and one focused outcome: on-demand retained Evidence delivery.
  • Conventional Commit title and related issue.
  • Changed observable behavior and meaningful failure paths tested.
  • Owning contracts/docs and generated projections updated.
  • Representative CLI/MCP behavior and output measurements included.
  • Final diff checked for credentials, unrelated cleanup and unsupported claims.

Substantive review fixes and latest-main integration

Three real findings are addressed: atomic inventory views validate the authenticated subject/digest/format; WASM views validate exact original subject path/digest through the same identity rule as the producer; experiment drivers reject undeclared inherited provider controls before server/profile creation. Generic historical Evidence input parsing and valid original records/IDs remain unchanged.

The identity issues have actual public-SDK before/after reproductions with shipped Obsidian data and the published VS Code INI grammar. The related runs pass 37 inventory/view and 26 WASM/service/parser assertions. Genuine baseline SQLite/Obsidian import/view/export still preserves whole original records and source/view identities; fresh Obsidian summary delivery remains 16,322 bytes with identical selected facts. Both contaminated-environment probes reject before output/profile creation without logging values.

Rebased onto main 60259a91d and verified unchanged reviewed code through the three integration resolutions. Upstream provider-readiness tests, managed CLI selection, binary-plist recognition and WABT leading-BOM preservation are retained. Post-rebase build, type/lint, docs and five focused files pass (42 assertions). The previous completion CI failures have since been repaired on main by the team; the earlier red-run attribution stays historical. Current-head CI is running and is not claimed green before completion.

The maintainer authorized a verified merge; no publication/version/deployment is authorized. First-call WASM summary is a separate follow-up branch, with this reviewed runtime as its frozen control. Generated detailed receipts remain outside the final PR tree.

Keep complete inspection output and historical Evidence input parsing intact. Add exact path selection and graph pages with source completeness, distinct view IDs and parent provenance. Verify SDK-converted schemas, portable CLI input and session export/close/import behavior.
…aults

Keep delivery options out of inventory execution, preserve legacy request parameters on omission, and retain both complete inspection and atomic source Evidence. Reuse shared summary projection and advertise only its exact artifact summary carrier. Verify complete, summary, extraction and missing-retention behavior through public MCP contracts.
Share the named contract, factory, command and retryable lifetime across CLI and MCP. Preserve existing constructors, complete output and provider selection. Read retained WASM summaries and exact source forms without rerunning WABT; validate decoded WAT identity at its owning model and reuse Unicode-safe text paging. Verify transport overflow recovery, portable input integrity and cleanup retry through public contracts.
@N0zoM1z0 N0zoM1z0 self-assigned this Oct 12, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

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 ✅ Completed 2026-10-12T12:52:29.447090Z 534a627 New commits
ℹ️ 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 chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8d6f7eb1cc

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ae291b4d83

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@N0zoM1z0

Copy link
Copy Markdown
Collaborator Author

Reviewed head ae291b4d836722503afbe73841955724cc0e1023 against main c22111eca2c4bc84a084f12711f405b3e7422a40. No PR-specific regression was found in the source review or recorded compatibility/package checks. Default complete inputs/output, generic historical Evidence parsing, source IDs, exact selectors, Unicode paging and failed-cleanup ownership remain covered.

The final CI run is complete: 27 checks pass. Apple E2E and test shards 2, 3 and 4 pass. The only originating failures are the existing empty prompt-completion assertion (shard 1) and both Darwin packaged-completion checks; exact logs match main's earlier failed run, and the affected implementation/fixture files are byte-identical. Coverage/timing and CI-required fail because those lanes fail. This is not a green CI gate, and those existing failures remain unfixed as requested.

All 12 generated result JSON receipts were archived and byte-verified outside the checkout. The final PR tree keeps scripts, corpus inputs and Markdown findings instead. The required co-author trailer is on the recent commits and prepared squash message.

The maintainer explicitly authorized a verified merge, with no version publication. Normal merging of this feature branch only updates the release proposal (skip-github-release: true); publication requires a separate reviewed release branch merge or explicit publish workflow. No such operation is requested. Follow-up work will continue on a separate branch rebased onto latest main, with bounded repeated real-artifact/model trials.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 52649c43eb

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

N0zoM1z0 and others added 7 commits October 12, 2026 11:42
Preserve upstream HAR API-surface views, portable capture admission, exact layout/JavaScript summary carriers and existing CLI tests alongside the inventory/WASM pilot. Build, full static checks and generated documentation checks pass after resolving the three conflicts.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Pin post-main-integration verification separately from earlier model trials. Record 123 focused assertions, installed-package WABT cases, genuine old Evidence roundtrips, unchanged Obsidian complete delivery and explicit summary fact conservation. Preserve resource events and remaining coverage limits; keep complete managed producer tables outside Git with curated identities, selected records and payload digests.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Keep complete-graph description checks semantic across capitalization and document why reported WASM execution/network metadata grants no execution authority. Preserve all lifecycle/effects assertions and leave production logic unchanged. Record exact main-versus-PR attribution for pre-existing prompt-completion and Darwin package failures; those remain outside this PR.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Archive all twelve checkpoint JSON files byte-for-byte outside the checkout and ignore generated experiment results. Preserve reproduction inputs, measured findings, exact runtime and migration identities, resource qualifications and public main-versus-PR CI evidence in Markdown. Keep historical checkpoints intact.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
…ction

Preserve the authenticated parent subject and reuse one owning inventory subject/digest/format rule for both carriers. Reject null subjects and inconsistent root identity before summary or page projection. Keep generic historical Evidence parsing and valid source/view identities unchanged.

Verified with 37 focused assertions, full static/docs gates, actual public SDK before/after reproduction using original Obsidian records, genuine old SQLite/Obsidian import/view/export, and unchanged Obsidian summary facts and delivery bytes.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Require explicit declaration of inherited REA/Hopper and Ghidra/Java configuration in both SDK and real-model drivers. Validate string settings and fingerprint the shared declaration policy. Fail before starting a measured server or creating an isolated model profile; never clear caller selections or serialize ambient values. Qualify historical selected-settings receipts.

Both contaminated-environment probes reject before output/profile creation without logging the sentinel value. Source/static/docs checks and a real Obsidian workflow pass.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Require a known original subject with the exact reported WASM path and byte digest before deriving a summary or facet. Share this identity rule with the producer workflow and preserve valid source records and original caller paths.

26 focused assertions and type/lint checks pass. Actual WABT inspection of the published VS Code INI grammar reproduces accepted null/wrong-path records on the frozen runtime; the corrected runtime rejects both with WABT unavailable. Genuine old SQLite/Obsidian records still import/view/export unchanged.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@N0zoM1z0
N0zoM1z0 force-pushed the feat/compatibility-first-analysis-20261012 branch from 52649c4 to 2ef0467 Compare October 12, 2026 11:51

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2ef0467bbd

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Share the owning subject/digest/format validator across atomic and outer inspection carriers. Six additional public MCP assertions reject missing or inconsistent outer subjects. Move identity checks to the small real format workflow while preserving the large ZIP capacity test and its deadline. Actual Obsidian SDK calls reproduce acceptance on the frozen parent and invalid_request after correction. Focused boundary, build, fast static and docs checks pass.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Hash the effective inherited or explicitly selected provider PATH without retaining its value or the ambient environment. Reject different or absent search-path fingerprints in SDK comparisons. Real Obsidian replays preserve facts while a changed inherited PATH is correctly classified as non-comparable. Historical receipt and executable-replacement limits remain explicit.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 18e5d62759

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Attempt a final cgroup event snapshot before wait/cleanup and mark disappearing, incomplete or still-owned scopes unverified. Keep last observations separately. Missing final counters no longer grade as zero; soft/hard/task-limit events cannot establish an unrestricted resource pass. Related parser and actual short-command probes pass; regrading an existing correct SQLite model answer rejects only its unverified resource conditions. No unrelated build, provider, schema or package checks are repeated.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@N0zoM1z0
N0zoM1z0 merged commit 58fb372 into main Oct 12, 2026
31 checks passed
@N0zoM1z0
N0zoM1z0 deleted the feat/compatibility-first-analysis-20261012 branch October 12, 2026 13:17
@github-actions github-actions Bot mentioned this pull request Oct 12, 2026
3 tasks done
N0zoM1z0 added a commit that referenced this pull request Oct 12, 2026
Rebase onto latest main after #2122 merges. Seven relevant WASM MCP workflows and one fresh real-WABT SQLite SDK request pass, preserving selected facts and original source identity. Keep original cohort fingerprints and counter qualifications; do not repeat unrelated provider/model/package tests for this integration.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
@morluto morluto added enhancement New feature or request area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants