Repository navigation
fix(config): omit rejected provider payloads from shape receipts - #1644
Merged
Merged
Conversation
Contributor
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 59 minutes. View limit details
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Defect (#1427)
sanitize_providers_sectioninterpolated the whole rejected TOML value intoPolicyError.detail(six format sites, including src/config.rs:1154 and the policy-value site at src/config.rs:1188 pre-diff).policy_errorsserializes intoeffective-config.json— written for plan (src/plan_artifacts.rs:105) and for the run (src/main.rs:4581 passes the raw config, unlikecmd_planwhich redacts viadiagnostic_artifact_config, src/main.rs:4501) — andbuild_gate_outcomecopies each detail verbatim into gate reasons (src/gate.rs:584-588). A pasted API key under any rejected provider key therefore published into uploaded artifacts, whilepreflight_diagnostics::config_diagnostic(src/preflight_diagnostics.rs:10) already treats details as secret-bearing and never renders them.Fix
rejected_value_shapehelper (src/config.rs:1138): describes a rejected value's TOML type plus length for string/array/table, never its text.sanitize_providers_sectionnow embed the shape instead of the value; field paths, section IDs, expected-shape text, and one fail-closed receipt per malformed value are unchanged.preflight_diagnosticsbehavior is unchanged and stays aligned:config_diagnosticnever renders detail;diagnostic_artifact_configstill overwrites details defensively for plan artifacts.Regression tests
config::tests::provider_receipts_describe_shape_and_omit_rejected_payload: canarysk-SYNTHETIC-PRIVATE-CANARYunder a top-level scalarproviders, non-table arrays for both minimax and opencode, and under[providers].policy— asserts each receipt names its field and the shape, andserde_json::to_string(&Config)(the effective-config.json form) contains no canary bytes; valid siblings (e.g.policy = "minimax-only") survive.gate::tests::invalid_provider_shape_fails_gate_without_serializing_payload: same sentinel; gate still fails with two policy reasons pointing ateffective-config.json, and the serializedGateOutcomecontains no canary.providers_section_parses_policy_and_receipts_invalid_values,providers_section_receipts_invalid_table_shapes_and_keeps_valid_siblings,providers_section_receipts_invalid_max_concurrency,providers_section_receipts_invalid_prompt_cache).tests::providers_policy_config_parses_resolves_and_receipts_invalid_values(src/main.rs:8144) asserts only theinvalid [providers] policy valueprefix and needed no change.Validation
From F:/Temp/fix-1427 at ab18e6e:
cargo fmt --allthencargo fmt --all --check— clean.cargo clippy --locked --workspace --all-targets— no warnings from this diff; three pre-existing warnings in files untouched here (tests/common/executable_fixture.rs:26 unusedfixture_statuson Windows, tests/pr_context_hydration.rs:40 unneededmut, src/proof/red_green.rs:385 unused import — the tolerated one).cargo test --locked --bin ub-review -- <11 named tests> --exact— 11 passed; 0 failed (both new tests plus all provider/gate receipt tests).cargo test --locked --bin ub-review provider— 41 passed; 0 failed.Known gaps
[impact]at src/config.rs:1101, plus gate/tools/proof/review_body key receipts) and in the Windows-vs-Linux gated test surface; Unix-gated tests are covered by the Linux gate, not locally.ub-reviewfingerprint keys, producing a fresh-looking artifact without this branch's code (verified by grepping the binary for the test names). Artifact fidelity required the private dir.Fixes #1427