fix(delivery): quarantine review bodies per comment - #2203
Conversation
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dab8c4d960
ℹ️ 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".
| { | ||
| Err(StructuredTextParseFailureV1::Malformed) | ||
| } else { | ||
| Ok(None) |
There was a problem hiding this comment.
Scan later fields before falling back to prose
When a label-like first line is followed by colonless prose or a blank line, this closure checks only fields parsed before that boundary and immediately downgrades the entire body to the raw scanner. For example, Note: intro\nsome prose\nX-Vault_Passphrase:ordinary-value returns Ok(None) before inspecting the sensitive third-line key; the no-space header syntax also avoids the YAML mapping probe, and a low-entropy credential may not match any raw regex, so sanitize_provider_metadata_text can persist a value that the structured key detector would redact or quarantine. Inspect the remaining lines for sensitive field names before allowing this fallback.
AGENTS.md reference: AGENTS.md:L189-L190
Useful? React with 👍 / 👎.
Fixes #2158
Root cause
Two defects combined, so that rust-lang/log#741 never published a review generation.
Nit: ...body was actually caught by the HTTP-header lane.parse_http_header_documentaccepted the first lineNit: the job short name is check, …as a header field (Nitis a legal field name). The second lineView changes since the reviewhas no colon, so the lane returnedMalformed.sanitize_provider_metadata_textthen quarantined the body. The same thing happened toNote: …prose followed by a blank line and a paragraph.graphql_comment_draft/rest_comment_draftusedretained_review_body(body)?, so one unretainable body turned the whole read intoNone. That becameGitHubReviewReadPortOutcomeV1::Unavailable, thenGitHubReviewRefreshOutcomeV1::Unavailable, and nothing was stored, so the Delivery pull-request lane readnot_published.What changed
Name: valueline is weak evidence. If such a document stops being a header block (a line with no field, or content after the blank line), it is now prose for the raw credential scan. It stays a fail-closedMalformedquarantine only when a field it already exposed has a sensitive name. Requests with a start line keep the old behavior.GitHubReviewIngressResultV1has a new fieldquarantined: Vec<GitHubReviewQuarantinedItemV1 { comment_id, reason }>. The reason isprivacy_sanitizerorbody_out_of_bounds. The list is ordered and disjoint fromitems.Deletedlifecycle for a comment that is now quarantined.ProjectDeliveryGitHubOperationSnapshotV1.quarantined). The dashboard wire hasDeliveryGitHubOperationSnapshotV1.quarantined(contracts regenerated). The Journey pull-request lane shows1 quarantined (privacy sanitizer)on the read that withheld the comment.advisory/fixtures/rust_lang_log_741_review_threads.graphql.jsonis the production review-threads query as GitHub served it for Split MSRV used to build from MSRV used to test rust-lang/log#741. It has three bodies, one of them theNit:literal.Fail before / pass after
delivery::tests::one_quarantined_review_body_leaves_the_rest_of_the_pull_request_publishedreplays the #741 capture through the production decoder, runtime transport, refresh coordinator, project store and Delivery read. The reply body is replaced by one the sanitizer must refuse (vault_passphrase: …\n broken: [unclosed). Result: two bodies ingested (4069686687,4069691901= theNit:body), andquarantined == [{4069777906, PrivacySanitizer}]on aReadylane.Before (decoder and classifier fixes reverted):
After:
ok.structured_text_tests::code_shape::review_prose_opening_with_a_label_is_retained_as_prose(literal fixture). On master:After:
ok. The same test also asserts thatNote: …\n\nSee …prose is retained and thatX-Vault_Passphrase: ordinary-value\nsee …is still quarantined.journey.test.ts› "counts a quarantined review comment on its provider read with the reason" asserts the lane detailcomplete · complete · 1 quarantined (privacy sanitizer) · head ….Checks
cargo test -p tracedecay-privacy -p tracedecay-domain -p tracedecay-application -p tracedecay-dashboard-api --libafter rebase: 127 + 222 + 472 + 172 passed.application_suite: 64 passed.domain_suite: 170 passed.pr_tracking: 7 passed.cargo test -p tracedecay --features test-transport --test dashboard_api_test -- delivery: 4 passed.contracts_suite: 275 passed, 1 failed. The failure,doctor_report_coverage_statement_is_truthful_about_unavailable_families, is pre-existing on master: feat(daemon): free retained state through one memory authority #2194 added an eighth doctor family and the test still expects1/7.cargo clippy -p tracedecay-privacy -p tracedecay-domain -p tracedecay-contracts -p tracedecay-application -p tracedecay-dashboard-api --all-targets -- -D warnings: clean.cargo fmt --all -- --check: clean.typecheckclean,pnpm test2029 passed,contracts:checkup to date.The built-binary journey for rust-lang/log#741 (discovery
foundplus a populated Journey lane) needs the GitHub source binding provisioning from #2159, so it runs in that PR.