Skip to content

fix!: restore caching, preserve failures, and verify fixture claims - #1211

Merged
N0zoM1z0 merged 5 commits into
morluto:mainfrom
Y0UW1SH:fix/analysis-cache-cleanup
Oct 9, 2026
Merged

N0zoM1z0 merged 5 commits into
morluto:mainfrom
Y0UW1SH:fix/analysis-cache-cleanup

Conversation

@Y0UW1SH

@Y0UW1SH Y0UW1SH commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Repeated Ghidra analysis bypassed reusable snapshots, one-shot cleanup discarded failures, and answer keyword/citation matching could accept fabricated claims. This PR fixes those paths and adds evidence-backed correctness checks for configured benchmark fixtures.

Based on main at 5b769d3a, including its xrefs resolution and cleanup updates.

Changes

  • Enable snapshots for explicitly deterministic Ghidra reads while retaining live-state, mutation, permission, document and cursor exclusions. Preserve annotation invalidation and composed workflow replay.
  • Preserve completed native Evidence, managed execution results, and primary errors when session cleanup also fails.
  • Grade packaged desktop and parser-comparison answers against known fixture values and complete Evidence returned by successful REA calls.
  • Require a closed JSON claim manifest with exact claim IDs, values, citations, confidence and authority. Reject missing, duplicate, extra, contradictory or unsupported claims, altered Evidence, conflicting result aliases, and malformed manifests.
  • Bind desktop claims to the artifact path and SHA-256. Bind parser claims to the requested module/export selectors and the two delivered source analyses.
  • Keep golden values outside the prompts. Keep routing checks and text heuristics separate from factual assessment.
  • Require managed member inspection for the existing public-type question.

Assessment scope and output

The desktop rubric covers the bridge API, members, world, IPC operations and resolved preload. The parser rubric covers the exact heading depth addition, discriminator, comparison coverage, and limits on runtime conclusions.

A factual pass establishes only these configured fixture claims. Native, managed, browser, navigation-context and address-context scenarios remain not_assessed. Their routing and text checks remain active.

Scenario results contain factualCorrectness and per-claim failure diagnostics. Factual failures fail the benchmark gate even when all keyword and citation heuristics pass. Correct structured claims do not need superficial prose cues to pass.

CLI/MCP tool names and schemas are unchanged. Cleanup failures use the existing cleanup_incomplete envelope and retain observations or primary diagnostics. No bridge, installation, dependency, or generated-output changes.

Tested

  • 209 tests passed across 19 affected files, covering evaluator regressions, report/exit gating, actual MCP desktop/parser producers, CLI/MCP boundaries, managed cleanup, xrefs, snapshots and client cleanup.
  • Packaged desktop and parser fixtures exercised through actual MCP calls. Correct claims pass; wrong values, extra claims, unrelated citations, changed artifact identity, missing source links and runtime overclaims fail.
  • npm run build:cached: passed.
  • npm run check:fast: build, strict typecheck and lint passed.
  • Oxfmt checks, whitespace checks and runner syntax check: passed.
  • Independent grader and fixture/report reviews: approved.

Additional Ghidra client socket fixture suite: 5 passed, 19 failed, 1 skipped. The failed cases report listen EPERM. The client, socket fixture and test code are unchanged by the evaluation fix.

Not tested

  • Live-agent benchmark execution.
  • Real Ghidra or Hopper engine execution.

Compatibility and migration

BREAKING CHANGE: evaluation reports use schema version 3. Top-level factualCorrectness changes from a constant string to a summary containing status, scope and scenario counts. Per-scenario correctness is passed, failed or not_assessed, with configured_fixture_claims scope.

Report consumers must also migrate the earlier renamed fields: completionQuality → answerHeuristicsMet, authorityHonesty → epistemicCuePresent, contentCriteriaMet → answerTermCoverageMet, and qualityCriteria → requiredAnswerTermGroups. These remain diagnostic heuristics, not factual assessments. Migration and benchmark scope are documented in docs/testing.md.

Review

  • Meaningful failure paths and producer representations covered.
  • Artifact identity, source provenance, observations and primary failures preserved.
  • Unsupported and unassessed conclusions remain explicit.
  • Final diff reviewed for unrelated changes and unsupported claims.

Retain native and managed observations when provider cleanup fails, preserve primary diagnostics, and correct the agent evaluator's claims and export-shape fixture.

BREAKING CHANGE: agent evaluation report schema version 2 replaces completionQuality, authorityHonesty, contentCriteriaMet and qualityCriteria with explicitly named heuristic fields. Factual correctness is reported as not_assessed.
Allow explicit snapshot policy for deterministic reads that write private provider files while retaining mutation and live-state exclusions. Cover Ghidra profile binding, annotation invalidation, and composed workflow replay.
@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.

@N0zoM1z0

N0zoM1z0 commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Thanks for tracing these failures and adding the regression coverage. I’m reviewing the cache boundaries and cleanup paths, and adding a small real Ghidra cache/replay check. I’ve integrated current main so this also exercises the recent cleanup fix.

Require closed known-answer manifests for packaged desktop and parser fixtures. Validate claim values and scope against intact successful tool Evidence, target identity, source selectors, and linked analyses. Keep routing and text heuristics separate, and reject factual failures in the evaluation gate.

BREAKING CHANGE: evaluation reports use schema version 3. The top-level factualCorrectness is now a scoped summary, and scenario correctness can be passed, failed, or not_assessed.
@Y0UW1SH Y0UW1SH changed the title fix!: restore snapshot caching and preserve analysis failures fix!: restore caching, preserve failures, and verify fixture claims Oct 9, 2026
@N0zoM1z0

N0zoM1z0 commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

The real Windows x64 Ghidra 12.1.4 MCP check passed on the unchanged cache/cleanup code: inventory 30.9 → 6.4 ms and function analysis 146.8 → 17.5 ms on repeat. A new MCP connection replayed the saved results in 7.6 / 28.4 ms without creating another Ghidra runtime. Target bytes were unchanged and both sessions cleaned up. Two-core affinity, 512 MiB JVM heap, sampled family peak 946 MiB.

Local cache/cleanup/evaluation regressions passed (76 tests), and CI passed all 22 jobs on the integration head. I’ve now picked up the fixture-grading follow-up and approved its workflow; I’m reviewing that new scope before merging the final head.

The evaluation runner imports its fixture helpers from compiled dist. Declare the matching source module as an entry so Knip recognizes that external use without weakening unused-export checks.

@N0zoM1z0 N0zoM1z0 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed the cache eligibility, mutation invalidation, one-shot cleanup composition, and the added fixture-grading boundaries. The grading distinguishes configured facts from routing/text heuristics and checks the delivered Evidence, source identity, selectors, authority, and linked analyses.

Verified 126 distinct local tests across the two focused suites, build/typecheck/lint, and the real Windows Ghidra MCP repeat/export/import workflow. The later grading commit leaves the tested native code unchanged. The full live Codex agent evaluation and real Hopper/macOS annotation workflows were not run.

Added 4488557 to declare the compiled fixture module's source entry for Knip; the previously failing check now passes locally. Final-head CI is approved and running. Thanks for the thorough regression coverage.

@N0zoM1z0
N0zoM1z0 merged commit 27a9cea into morluto:main Oct 9, 2026
22 checks passed
darsrc pushed a commit to darsrc/rea that referenced this pull request Oct 10, 2026
…orluto#1211)

Restore profile-bound Ghidra snapshot reuse, preserve direct-analysis results through cleanup failures, and grade configured agent fixture claims against returned evidence.

Register the compiled agent-evaluation fixture entry for static analysis.

Co-authored-by: YouWish <29498139+Y0UW1SH@users.noreply.github.com>
Co-authored-by: N0zoM1z0 <161784452+N0zoM1z0@users.noreply.github.com>
@morluto morluto added the bug Something isn't working label Oct 14, 2026
@morluto morluto added the area: tests Test suite and verification label Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: tests Test suite and verification bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants