Skip to content

Generated coverage/build scratch enters workspace patches and can terminally fail the secret gate #1308

Open

Description

@aviggiano

Problem

A coverage producer can capture generated build, coverage, and corpus scratch in workspace.patch, then fail terminally at the artifact secret gate even though its authored changes are valid and the configured credential is absent.

Observed on a retained workspace: approximately 16.6 MB of captured data included .cov-work/, .recon/, lcov.info, and generated compiler/build JSON. Credential-shaped text in generated JSON triggered ARTIFACT_SECRET_GATE_REJECTED. Moving the scratch outside the workspace and rebuilding a coherent source-only patch reduced the handoff to 1,364 bytes and allowed verification to proceed.

This is a capture-classification defect. The secret gate should continue to fail closed on every publication it actually receives.

Current behavior on unstable

Reviewed origin/unstable at 809b702f60417d04b03e27746b52327b947d892c, plus all open and closed issue records.

stageableWorkspacePaths in packages/runtime/src/workspace-handoff.ts excludes a fixed set of untracked roots (recon-corpus, echidna, magic, out, and dependency/runtime roots). Agent-selected and nested scratch destinations escape those exclusions. Measured diff-overflow recovery runs only after the 16 MiB patch limit is exceeded, so it cannot prevent below-limit generated content from reaching the secret gate or entering a downstream baseline.

Reproduction

  1. Create a minimal Git fixture with an authored harness/test source change.
  2. Produce untracked coverage scratch under .cov-work/ and .recon/, an LCOV report, and generated build JSON containing a synthetic credential-shaped value that is not the configured credential.
  3. Capture a workspace patch whose total size remains below the patch limit.
  4. Run the normal artifact secret check on that patch.

The generated bytes are captured and the patch is rejected, preventing this producer and dependent work from completing.

Expected behavior

  • Classify and exclude generated build/coverage/corpus output before it enters a workspace patch, including the observed scratch destinations and nested output layouts.
  • Preserve authored harness/test sources, configuration, and tracked edits; do not drop an entire mixed source/scratch tree based on size or a broad prefix.
  • Keep capture/replay Git trees and patch manifests coherent.
  • Keep security fail-closed: actual configured credentials or credential-shaped content in included authored files must still reject publication. Declared evidence artifacts must still pass their normal secret checks.
  • Add below-limit regression fixtures for generated-artifact contamination and authored-source preservation.

Related issues and priority

P1: normal coverage/build work can terminally block a producer and its downstream run; the current workaround requires manually removing scratch and rebuilding an authenticated handoff. All details above are repository-neutral and reproducible with synthetic fixtures.

Activity

  1. added
    bugSomething isn't working
    P1Significant bug with a workaround, or a removal that eliminates a class of failures
    on Oct 15, 2026
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

    P1Significant bug with a workaround, or a removal that eliminates a class of failuresbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions