Skip to content

Deep Scan omits referenced finding write-up files and fails at completion #1619

Closed

Description

@jurrjensluke

Summary

A Codex Desktop Deep Scan completed its independent Standard scans and aggregation, but finalization failed because the coordinator preserved a finding write-up reference without materializing the referenced Markdown file in the parent scan directory.

The exact completion error was:

findings[26].writeup.reportPath: expected a file inside the scan directory

This occurred after approximately three hours of work and about 30 completed independent scans. The canonical JSON artifacts and a generated report.md were retained, but the scan remained failed/unsealed and its findings could not be displayed through the supported completion workflow.

Environment

  • Codex Desktop
  • macOS 27.0.1 (26A434)
  • Codex Security bundled plugin: 0.1.32
  • Scan mode: Deep
  • Model: Daybreak Blue
  • Target: private Git revision; repository details intentionally omitted

Observed artifact state

Read-only inspection after the failure showed:

  1. The coordinator checkpoint contained a schema-conforming relative path for the rejected finding, shaped as:
    findings/<slug>/<slug>.md
  2. The referenced Markdown file did not exist.
  3. The parent scan directory contained no findings/ directory and no individual finding Markdown files.
  4. The consolidated findings.json contained 49 findings, but none retained a writeup object or writeup.reportPath.
  5. scan-manifest.json, findings.json, coverage.json, report.md, and SARIF output existed.
  6. Completion failed during the write-up existence check, leaving the scan unsealed.

No repository source, finding content, credentials, scan identifiers, or user-specific filesystem paths are included in this report.

Expected behavior

The Deep-scan coordinator should either:

  • materialize each referenced findings/<slug>/<slug>.md file into the authoritative parent scan directory before returning the canonical manifest; or
  • omit the writeup reference consistently if no individual write-up is being produced.

complete_codex_security_scan should then seal the canonical artifacts and publish the supported report.

Actual behavior

Checkpoint data referenced individual write-up files, but those files were not present in the parent scan directory. The final completion validator rejected the scan only after all model work and aggregation had finished.

Impact

  • Long-running Deep Scan cannot be completed or displayed through the supported workflow.
  • Approximately three hours of scan work reached finalization before failing.
  • Retrying the scan would risk repeating expensive work.
  • The preserved findings remain unsealed and cannot be treated as an official completed result.

Related issues

This appears to be a distinct current variant: the parent canonical JSON artifacts exist, but the individual finding write-up files referenced during completion were never materialized.

Activity

  1. mldangelo-oai commented on Oct 14, 2026

    @mldangelo-oai
    Collaborator

    Investigated with synthetic findings. Latest main still reproduces this bug at 55b86d8646822c656fede042d4b00b646b3a6882, rechecked before posting. A finalizer reproduction using that commit's complete source archive produces the exact error:

    findings[26].writeup.reportPath: expected a file inside the scan directory
    

    The worker/reducer pipeline accepts the write-up reference as JSON metadata, but parent publication does not materialize or relocate its target. Deep completion then validates the referenced file and fails. Subsequent failed-scan recovery can remove the broken optional reference, retain the findings, and generate the aggregate report.md. This explains how the checkpoint can retain writeup while canonical findings.json does not. Recovery can also seal a failed result, so failed status alone does not establish that the retained artifacts remain unsealed.

    Relevant open PRs, inspected at their current heads:

    • #939 (b247fdd53d27): addresses the transfer mechanism for new scans by copying child write-ups and supporting files into the parent and rewriting their references.
    • #1103 (2bddd368f8dd): addresses it for new scans by retaining the child files beneath the parent and rewriting references to their actual locations.
    • #907 (9c0f06087c4a): partial mitigation. It checks referenced files earlier and keeps explicitly incomplete drafts recoverable, but does not transfer write-up files or repair an already-complete draft with a missing target.

    Both #939 and #1103 complete Standard child scans before aggregation, allowing missing optional write-up references to be removed with a warning while retaining the findings. Five focused tests passed across those exact heads: three on #1103 and two on #939, covering valid child-file preservation and missing/invalid optional-reference recovery separately. These were synthetic checks, not a replay of the reported scan.

    Existing-scan recovery remains unverified. #939 and #1103 overlap as alternative architectural changes, and both document compatibility limits for older unfinished scan/checkpoint formats. Neither should be treated as a confirmed recovery solution for the already-failed 0.1.32 scan. No new model scans were needed for this investigation.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions