Problem
Runner-workspace publication can deterministically fail when an unchanged patch context line contains the name of a configured secret. Artifact redaction rewrites that identifier before the canonical patch reaches host application, so git apply receives a patch that no longer matches the byte-identical target workspace.
Observed in Build with WordPress manual Docs Agent acceptance:
The rejected patch replaced an existing literal secret identifier in an unchanged context line with [REDACTED:configured-secret-name]. The target checkout still contained the original identifier, so the redacted patch could not apply. The agent otherwise produced the intended documentation correction.
Root cause
packages/runtime-playground/src/artifact-bundle-builder.ts constructs files/patch.diff by passing the canonical workspace patch through ArtifactRedactor. ArtifactRedactor registers configured secret names as literal replacements. packages/runtime-core/src/runner-workspace-apply.ts subsequently treats that reviewer-safe redacted artifact as the machine-applicable canonical patch.
This conflates two contracts:
- A byte-preserving internal patch used for trusted host application.
- A redacted reviewer/upload artifact safe for durable publication.
Acceptance criteria
- Host application consumes a byte-preserving patch whose context still matches the verified seed identity.
- Reviewer-facing and uploaded artifacts retain secret redaction; no configured secret values leak.
- Any unredacted apply material is transient, bounded to the trusted apply path, and absent from uploaded/durable artifacts.
- Deterministic coverage modifies a file whose unchanged patch context contains a configured secret name, then proves host apply and publication preparation succeed.
- Existing artifact-redaction and runner-workspace integrity tests remain green.
Reproduction
- Configure a runtime secret named
OPENAI_API_KEY.
- Mount a tracked repository containing the literal text
OPENAI_API_KEY in a line adjacent to an intended edit.
- Produce a sandbox edit so the literal appears as unchanged patch context.
- Apply the emitted canonical patch through
applyRunnerWorkspacePatch.
- Observe that the artifact contains
[REDACTED:configured-secret-name] and git apply rejects it against the unchanged seed.
Problem
Runner-workspace publication can deterministically fail when an unchanged patch context line contains the name of a configured secret. Artifact redaction rewrites that identifier before the canonical patch reaches host application, so
git applyreceives a patch that no longer matches the byte-identical target workspace.Observed in Build with WordPress manual Docs Agent acceptance:
2e26a61da8a6148c80a0211f9839996be3817b7729348b2d39d8371d18dee0067dbae045a0e378c735b9b3800370dd69105eed26.Host git apply failed: patch failed: docs/contributor-workflows.md:151.The rejected patch replaced an existing literal secret identifier in an unchanged context line with
[REDACTED:configured-secret-name]. The target checkout still contained the original identifier, so the redacted patch could not apply. The agent otherwise produced the intended documentation correction.Root cause
packages/runtime-playground/src/artifact-bundle-builder.tsconstructsfiles/patch.diffby passing the canonical workspace patch throughArtifactRedactor.ArtifactRedactorregisters configured secret names as literal replacements.packages/runtime-core/src/runner-workspace-apply.tssubsequently treats that reviewer-safe redacted artifact as the machine-applicable canonical patch.This conflates two contracts:
Acceptance criteria
Reproduction
OPENAI_API_KEY.OPENAI_API_KEYin a line adjacent to an intended edit.applyRunnerWorkspacePatch.[REDACTED:configured-secret-name]andgit applyrejects it against the unchanged seed.