Skip to content

fix: preserve accepted coverage through publication and recovery - #921

Open
mldangelo-oai wants to merge 16 commits into
mdangelo/codex/retain-source-remediationsfrom
mdangelo/codex/deep-coverage-review
Open

mldangelo-oai wants to merge 16 commits into
mdangelo/codex/retain-source-remediationsfrom
mdangelo/codex/deep-coverage-review

Conversation

@mldangelo-oai

@mldangelo-oai mldangelo-oai commented Sep 12, 2026

Copy link
Copy Markdown
Collaborator

Summary

Preserve accepted audit coverage through Deep scan reduction, publication and recovery. Deferred work and unknown coverage must survive a completed reducer. This change depends on #905.

Changes

  • Combine coverage in host code, retaining worker, attempt and receipt provenance.
  • Preserve descriptive metadata and independently unresolved candidates through completion and recovery. Host-owned identifiers remain authoritative; Standard-scan metadata cannot resolve a different candidate.
  • Reconstruct legacy coverage in memory without rewriting accepted files. Persist coverage only when the existing versioned writer requests it.

Testing

At 5f36ad8e5ce630463a6769fd76f1237bd0af67b3:

  • 234 affected Python tests and eight MCP test files passed, along with all five required portable checks, SDK types and formatting.
  • All four live/reconstructed × completion/recovery projection cases fail on the parent and pass after the fix. Standard candidate-identity regressions and existing Deep replay controls also pass.
  • Stock package checks, installed SDK and physically detached plugin controls passed. Public result checks preserve two unresolved candidates and all 16 accepted input files unchanged.
  • Three native source reviews and a distinct verifier found no actionable issues against the current stacked base.
  • Publication CI and ready-for-review CI passed, including Windows and macOS. Each run initially hit a Windows npm-install timeout before product assertions; one targeted retry per run passed with unchanged source and settings. Both original failures remain recorded.
Supporting results and limits

Independent verification of this change and its matching reader/writer ports passed 12 publication/recovery cases, 197 Python checks and 36 projection comparisons. These are separate source-bound results.

Two earlier full SDK orders each passed 3,008 tests with 50 skips at f3a30dc8; they do not qualify the final head. Original fixture and setup failures remain recorded. Deterministic checks do not establish scan quality, cost or latency equivalence.

Risk and rollout

Review host projection and stopped recovery together. #905 must land first. Accepted legacy files retain their bytes and shape; this change adds no migration or writer activation. A later writer integration requires separate reader-before-writer compatibility checks.

Public disclosure review

  • No customer, partner, prospect, or user identities, data, or identifying details are included.
  • No credentials, personal data, private source, scan findings, or nonpublic links or tickets are included.
  • I reviewed the branch name, title, description, commits, changes, comments, logs, screenshots, attachments, and links for public disclosure.

mldangelo-oai and others added 16 commits September 12, 2026 19:07
Update the package version to 0.1.28 and refresh release notes.
* fix(logs): stream large saved scan JSON output

* test(logs): isolate installed skill state

* test(logs): simplify saved log fixtures
* fix(logs): retain complete saved rollout copies

* fix(logs): compare copies only for selected sessions

* fix(logs): pass the iterator cleanup return value

* test: give copied-log boolean cases unique names
@mldangelo-oai
mldangelo-oai marked this pull request as ready for review September 16, 2026 17:11
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 16, 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-09-16T17:18:21.322170Z 5f36ad8 Draft marked ready
🔒 Security Review Completed 2026-09-16T17:18:01.024227Z 5f36ad8 Draft marked ready
ℹ️ 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: 5f36ad8e5c

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

Comment on lines +255 to +258
for (const key of ["workerId", "attempt", "sourceId", "candidateId"]) delete projected[key];
result.provenance = {
...projected,
...provenance,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the originating retry attempt in coverage

When a discovery's first attempt saves coverage and is archived before a later attempt succeeds, readArchivedWorkerCheckpoints merges those records into the successful result, but this projection deletes any existing attempt and stamps every record with the successful worker's latest attempt. Consequently, evidence whose receipt points into attempt-01 is reported as originating from attempt 2, and the generated reviews list omits attempt 1 entirely. Preserve or attach attempt provenance while loading each archived checkpoint instead of assigning one attempt to the combined result.

Useful? React with 👍 / 👎.

Comment on lines +1140 to +1142
for field in ("surfaces", "explicitExclusions", "deferred", "openQuestions", "reviews"):
items = draft["coverage"].get(field, [])
if not isinstance(items, list):
if not isinstance(items, list) or (field == "reviews" and not items):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Ignore worker-supplied review summaries during recovery

When a Deep discovery result contains a nonempty coverage.reviews extension, stopped-scan recovery now copies those rows directly into canonical coverage. Unlike the other coverage collections, reviews is explicitly excluded from project_missing_record, so model-controlled workerId, attempt, and completeness values are published beside the host-generated review records and can falsely attribute a review to another worker or attempt. Recovery should derive this collection only from accepted worker state or a validated host projection, not merge it from the discovery payload.

AGENTS.md reference: AGENTS.md:L42-L43

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant