Repository navigation
Fix runtime-mask parsing and preserve safe-output schemas - #69244
Conversation
Split the secret-parsing and redaction changes from #69235 without backend ownership or path changes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Exercise 7,000 reproducible generated cases across token mutations, escaped nested and mixed records, malformed quotes, and high-precision numeric lexemes; check every truncation boundary for representative quoted tokens. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Design Decision Gate 🏗️Outcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
❌ Ponytail Reviewer failed to deliver outputs. Please review the logs for details.
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
🧪 Test Quality Sentinel Report✅ Test Quality Score: 88/100 — Excellent
📊 Metrics (117 tests)
✨ Highlights
|
There was a problem hiding this comment.
✅ Test Quality Sentinel: 88/100 (Excellent). 24% implementation tests (threshold: 30%). Comprehensive seeded fuzz testing (2,500 iterations), boundary condition coverage, and error recovery paths validated. No violations.
🧪 Test quality analysis by Test Quality Sentinel · copilot · haiku45 · 30.6 AIC · ⌖ 6.83 AIC · ⊞ 9.2K
Comment /review to run again
There was a problem hiding this comment.
Verdict
No blocking correctness issues stood up in the changed scanner/redaction path or the new failure-mode coverage.
Highlights
Reviewed the new transformJSONStrings scanner, the conservative malformed-quote fallback, large-record handling, and the added parser/file-handling tests. I did not find a changed-line bug or regression strong enough to block merge.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 45.7 AIC · ⌖ 8.36 AIC · ⊞ 20.2K
Comment /review to run again
Skills-based review summaryApplied Found one correctness issue worth fixing before merge: the conservative-escape-decode fallback (used when a malformed quote makes pairing ambiguous) unescapes Test coverage itself is excellent — the new scanner-boundary and seeded-fuzz suites are a textbook @copilot please address the review comments above.
|
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs and /tdd (via pr-triage: change_type=bug_fix) to the iterative JSON-token scanner and conservative escape-decoding logic in add_mask_redaction.cjs.
Requesting changes on one confirmed correctness bug in the conservative re-encode path; everything else — the scanner itself, numeric-token matching, and the new test suite — is solid.
📋 Key Themes & Highlights
Key Themes
- Scope bug in conservative unescape: when a malformed quote forces the fallback 'unescape once, then re-mask' path, the unescape regex applies to the entire line, not just the region needed to reveal the hidden mask. Unrelated backslash sequences in plain text (e.g.
\t,\f,\ninside a Windows path) get silently decoded into control bytes, which then survive theJSON.stringifyre-encode as real control characters — a data-corruption regression, not just a redaction miss. - No fuzz/boundary test currently combines a conservative-re-encode trigger with unrelated backslash sequences elsewhere on the line, so the otherwise excellent coverage (444 tests, 7 boundary cases, 20 seeded fuzz runs across 7000+ cases) didn't catch it.
Positive Highlights
- ✅
transformJSONStringscleanly replaces the regex-stack-exhausting alternation with a linear scanner; the boundary/truncation test matrix (only transforms a complete token at every possible truncation boundary) is a model/tddred-green-refactor artifact. - ✅ The new
throwon malformed mixed-log tokens correctly triggers the existing fail-closedprocessFilecleanup path, and that behavior change is directly tested (removes the artifact if decoding...fails). - ✅ Docs (
imports.md) and the changeset accurately describe the byte-preservation guarantee — which makes the one found gap more important to close before merge, since it contradicts that documented guarantee for a narrow case.
See inline comment for a concrete repro and suggested fix (scope the unescape to only the matched mask span, or verify re-encoded output round-trips before accepting it).
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 158.7 AIC · ⌖ 15.1 AIC · ⊞ 11.7K
Comment /matt to run again
There was a problem hiding this comment.
🟡 Changes recommended
Confirmed secret-redaction correctness and malformed-record performance issues remain unresolved.
2 open findings
What changed in this PR
Updates runtime-mask redaction for large and malformed artifacts, separately from the backend-ownership fix in #69235.
Changes:
- Replaces quoted-string regex scanning with an iterative scanner.
- Adds conservative escape decoding and boundary, fuzz, and artifact-handling tests.
- Documents the behavior and adds a patch changeset.
| File | Description |
|---|---|
docs/src/content/docs/reference/imports.md |
Documents malformed-record handling and byte preservation. |
actions/setup/js/redact_secrets.test.cjs |
Adds artifact and fail-closed regression tests. |
actions/setup/js/add_mask_redaction.test.cjs |
Adds scanner boundaries, seeded fuzzing, and large-record coverage. |
actions/setup/js/add_mask_redaction.cjs |
Implements iterative scanning and conservative decoding. |
.changeset/patch-large-record-mask-redaction.md |
Records the redaction patch. |
🧠 Review effort: Max
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
Keep bundled public field names and enum values intact while sanitizing payload data. Protect post-redaction collector configuration, fail closed on unsafe control changes, and cover the short-mask failure through collection and real review handlers with mocked GitHub. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve unrelated escapes, bound rejected-token scanning, and resolve configured, built-in, and runtime masks without encoding or overlap bypasses. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
In reply to this status report: acknowledged as informational; no actionable ADR finding is stated, so no separate ADR change is warranted. The reported no-op is not treated as proof of completion or publication. |
|
In reply to this status report: acknowledged; the reported no-op does not establish completion or publication. The updated redaction behavior is validated separately with local regression tests. |
|
In reply to this completion announcement: no separate code change is needed for the status message. The substantive skills-review findings are addressed with the parser fixes and regression tests. |
|
In reply to this failed-delivery report: investigation located the failure in Process Safe Outputs after successful agent/redaction steps, and commit 116a128 adds schema-safe redaction with synthetic collector/review-handler coverage. No hosted rerun was performed, and the source of the historical runtime mask remains unverified. |
|
In reply to this completion announcement: acknowledged as informational; the corresponding review reported no blocking correctness findings. No additional code change is requested by this status message. |
|
In reply to this test-quality assessment: the positive assessment applies to an earlier revision, not the latest changes. Existing behavioral/fuzz coverage is retained, with added path-preservation, bounded-scanning, configured-secret encoding and overlap regressions validated locally. |
|
In reply to this skills-review summary: accepted and fixed conservative decoding to replace only matching source spans, preserving unrelated Windows paths and escapes in the decoded record. Added focused and seeded regressions while retaining fail-closed decoding behavior. |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
@copilot address the following outstanding work in one pass:
Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI. Sous-chef head: 7106608
|
|
Accept: Regarding this acknowledgment, confirmed: the completion announcement requires no additional code change. |
|
Accept: Regarding this acknowledgment, the earlier score and 463-test run remain revision-specific evidence. They do not prove complete current deployment closure. |
|
Accept: Regarding this acknowledgment, confirmed: matching source spans are replaced without rewriting unrelated paths or escapes. |
|
Accept: Regarding this acknowledgment, confirmed; no additional ADR work is requested. |
|
Accept: Regarding this acknowledgment, the recorded local test result remains historical. Complete current dependency closure is not inferred from it. |
|
Accept: Regarding this acknowledgment, confirmed: the parser finding is already fixed and no additional change is requested. |
|
Accept: Regarding this acknowledgment, agreed: local schema-safe regressions verify the synthetic behavior, not historical mask provenance or hosted publication. |
|
Accept: Regarding this acknowledgment, confirmed; no new code change is requested. |
|
Accept: Regarding this acknowledgment, the earlier 463-test run is useful historical coverage. It is not complete current deployment closure or hosted validation. |
|
Accept: Regarding this acknowledgment, confirmed: the source-span path-preservation fix is already covered. |
|
Partially accept: Regarding this refactor acknowledgment, the module split and direct/runtime coverage remain implemented. The historical bundle checks did not establish complete dependency closure; the newly found JSON omission is handled separately. |
|
Accept: Regarding this acknowledgment, the requested module refactor is already present. Historical deployment-list tests are not proof of complete current closure. |
|
Accept: Regarding this acknowledgment, the earlier JavaScript bundle omission and main update were already addressed. The later diagnostic-test failure was independently reproduced on main in the prior investigation. |
|
Partially accept: Regarding this acknowledgment, the c350350 fix and subsequent shard 4 success remain valid historical evidence. The earlier closure claim was narrower than complete current deployment coverage, and the new JSON omission is handled separately. |
|
Accept: Regarding this acknowledgment, agreed: matching fail-closed boundaries do not prove identical causes or current recovery. |
|
Accept: Regarding this acknowledgment, the historical MCP startup failure remains cause-unverified. No additional defect or current recovery follows from that startup notice. |
|
Accept: Regarding this acknowledgment, confirmed: Copilot Auto succeeded on c350350, not necessarily on later revisions. |
|
Accept: Regarding this acknowledgment, the Pi conclusion reported incomplete work. That historical status does not establish a parser defect. |
|
Accept: Regarding this acknowledgment, confirmed: Gemini exit code 41 alone does not establish a redaction or parser defect. |
|
Accept: Regarding this acknowledgment, agreed: the Codex CLI failure and unknown redaction failure remain distinct historical observations. Neither proves current failure or recovery. |
|
Accept: Regarding this acknowledgment, confirmed: the captured container failure was fail-closed redaction, not demonstrated missing tools. Its root cause and current recovery remain unverified. |
|
Accept: Regarding this acknowledgment, the converter fixture correction and historical main update are already addressed. Those focused checks are not a blanket current deployment guarantee. |
|
Accept: Regarding this acknowledgment, confirmed: the poem requests no code change and the associated smoke success remains historical. |
|
Accept: Regarding this acknowledgment, the converter fixture issue is already corrected. The recorded later diagnostic regression was independently reproduced on main, not newly investigated here. |
|
Accept: Regarding this request, invalid ordinary JSON now uses whole-artifact text-mode matching, including raw and encoded credentials across malformed lines. Valid JSON/JSONL keeps structured handling, while malformed executable safe-output records remain fail-closed. |
|
Partially accept: Regarding this implementation summary, the requested text fallback is present, but 621023d needed subsequent hardening for raw and multiline encoded credentials. ddec951 supplies that coverage while retaining fail-closed executable records. |
|
Accept: Regarding this request, 6446862 uses combined credential matching for safe-output payloads with decodedText mode, preserving literal decoded strings while coalescing overlaps. The main update is already recorded in 176d567; no repeat merge is needed. |
|
Accept: Regarding this completion summary, verified that the combined decoded-text matcher and 176d567 main merge are present. The saved local overlap gate passed 457 tests; this is not a hosted pass or proof of complete deployment closure. |


Summary
Originally split the secret-parsing/redaction portion from #69235 into a standalone PR against
main, transferring the five reviewed files fromb681ac5f07cb0e8f3a6648fc3904c69a250681f7in the initial split commit. Subsequent user requests added parser fuzz tests and the safe-output schema fix investigated on this PR. Backend ownership/path changes remain in #69235; this PR excludes gateway ownership,tools.md, and the ownership changeset.Exact scope
actions/setup/js/add_mask_redaction.cjsactions/setup/js/add_mask_redaction.test.cjsactions/setup/js/redact_secrets.cjsactions/setup/js/redact_secrets.test.cjsactions/setup/js/safe_output_redaction.cjsactions/setup/js/safe_output_redaction.test.cjsactions/setup/js/runtime_mask_publication.test.cjsdocs/src/content/docs/reference/imports.md.changeset/patch-large-record-mask-redaction.mdMarkdown overview
The imports reference documents stack-safe large-record parsing, bounded malformed-token recovery, source-span-preserving escape recovery, combined credential matching, schema-aware safe outputs, and fail-closed conflicts. The patch changeset covers parser reliability, overlapping/encoded credential redaction, and preservation of safe-output schemas/collector configuration. GitHub's step-summary limit remains unchanged.
Validation
Latest review-fix commit:
5ff7b3848c7e879766194b56defb518a0d763ca5.make fmt-cjs,make lint-cjs, and finalmake agent-report-progresspassed. Final gate includes build, scoped lint, JS typecheck, schema freshness, and 441 impacted JavaScript tests; no changed Go files required Go tests. Full lint retains existing warnings, with no errors.RangeErrorfor 10 MiB JSON and mixed records; the revised helper succeeds. A 1 MiB mixed record succeeds with both.Run investigation and evidence limits
Ponytail Reviewer run 38855075860 completed redaction successfully but failed safe-output publication. Published artifact schema metadata showed renamed
body/pull_request_numberfields and an altered review-submission type, explaining missing-body/no-handler failures. Synthetic masks reproduced that structural corruption on both main and the earlier PR revision; the source and legitimacy of the historical mask remain unverified.The separate historical run
38804538442reportedredact/unknown, notEACCES; its removed source artifact and absent exception details prevent definitive attribution to the local stack-failure reproduction. No Docker startup, live workflow validation, workflow dispatch/reruns, secret lookup, or raw-log inspection was performed. Local integration uses temporary files and mocked GitHub, not hosted end-to-end revalidation.