Repository navigation
fix(evidence): answer inputs-schema selector refusals as request.selector-invalid and fix evidencectl authoring diagnostics - #2610
Merged
Merged
Conversation
…lector-invalid on the relying routes Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…penapi fixture passes check target new --local now carries the project extract bindings alongside its connections. Bare file and directory names in target new resolve against the current directory. The init --openapi fixture is written in the coequal grammar its flag selects. Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…n shape in the BReg tutorial Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
… pack or route, and an unbound extract Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…tation Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…c fixes in the changelogs Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
Codex Review Summary: ✅ CompletedThis 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. |
…hema and the no-fixture action Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…project is found Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
…tor refusal in the request order Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
… change Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
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.
Summary
Two follow-ups to the public certificate check.
1. Inputs-schema selector refusals on the relying routes
On the single and batch evaluate routes, a selector value that passes its profile but that the requirement's Source inputs schema refuses now answers
400 request.selector-invalid, as a profile refusal does, instead of503 service.unavailable(categorysource-inputs).refuse_selector_the_source_inputs_reject), before any audit entry, credential acquisition or source request.503 source.unavailableafter the access-attempt audit entry; the guidance inevidence-problems.mdxand the contracts now say which case is which.2.
evidencectlauthoring defectsEach known authoring defect was re-checked against
main; the live ones are fixed here:target new --localdropped the project's source extract bindings, socheck --targetrefused a fresh SQLite-extract project withsource-extract-unboundextractsbesideconnections, and the command names bothtarget newfailed on a bare file or directory name (--settings local-target.yaml, or a destination with no separator)init --openapiwrote a starter fixture its own README'scheckrefusedcheckandtestendpoints.registryshapeevidence.yamlfailed with exit 3, a generic message and a private snapshot pathevidence.project.not-found, naming the path given and pointing toevidencectl initpack.yaml, or a Sourceroutethe pack does not declare, gave the generic inspection failureevidence.pack.route-missingat/sources/<id>/route, naming the declared routessourceExtractsextracts, the target's keycheckpassed a fixture withoutcommonorprivacyExpectation, andtestthen refused it without a locationcheckand bundle loading refuse it asevidence.fixture.missing-block, located in the fixture; a coequal acceptance fixture needs onlyprivacyExpectation. The fixture JSON Schema lists the blocks as required, and theevidencectl.fixtures.no-fixtureaction names themerrororpublicProblemsaid only "reference failing case has no exact expectation"Compatibility note on the fixture rule:
evidencectl packagealready runs every fixture throughbundle-evaluate, so any packaged bundle carries both blocks. Only a hand-assembled bundle without them is now refused at load. The two in-repo conformance bundles were such bundles; they gain empty blocks and refreshedSHA256SUMS.Left as is:
check --jsonreportsstatus: completewhiledeploymentInputs.completeis false (only when.generated/secrets/is absent, as in a fresh clone). The human output already says the compiled-target check was skipped; changingstatusis a contract change for script readers, so it is not done here.dev start --detach: removed on purpose in 0.42.0.evidence-configuration.mdxrenders empty untilnpm run generateruns indocs/site; that is a vendoring step, not a defect here.assuranceProfile: local, any fixture case can be removed andcheckandteststay green. This is by design and stated inproducts/evidence/reference/request-adapter/deployment-projects/FIXTURES.md.Tests
Each fix has a regression test seen failing before the fix:
runtime_tests::a_selector_value_the_source_inputs_schema_refuses_is_an_invalid_selector(single, batch, budget, no audit entry)tests/scaffold.rs:a_new_local_target_carries_the_projects_extract_bindings,target_new_accepts_bare_settings_and_destination_names,the_generated_openapi_starter_passes_check_and_test(ignored; needsEVIDENCE_BIN)tests/project_diagnostics.rs(new): missing project forcheckandtest, unparseable pack, unknown pack key, unknown routeauthored::tests::an_unbound_extract_names_the_authored_extracts_key_in_path_and_actionfixture::tests::refuses_each_rule_at_its_member_without_the_value: three rows for the missing blocksschema::tests::the_fixture_schema_accepts_what_the_reader_accepts_and_refuses_what_it_refuses(--features schema): reader and schema both refuse a fixture missing either blocktests/fixtures.rs:a_project_with_no_fixture_file_says_so_and_where_one_goeschecks that the action names both blockstests/cli.rs:a_derivation_output_the_definition_does_not_declare_is_named_as_the_causeChecks run
Locally on macOS, at the branch head:
cargo fmt --checkforregistry-evidence,registry-evidence-authoringandregistry-evidencectlproducts/evidence/scripts/check-contracts.shcargo clippy --locked -p registry-evidence -p registry-evidencectl -p registry-evidence-authoring --all-targets -- -D warnings, and forregistry-evidencewith--features schemacargo test --lockedforregistry-evidence,registry-evidencectlandregistry-evidence-authoringcargo test --locked -p registry-evidence --features schema --lib schema::testsEVIDENCE_BINset:cargo test --locked -p registry-evidencectl --test public_check -- --include-ignoredand--test scaffold -- --include-ignorednode --test products/evidence/examples/public-check/page/check.test.mjsnpm testandnpm run checkindocs/siteproducts/breg/evidence/tests/verify-composition.pyagainst debugbregctl,evidencectlandevidence: passed (offline boundary; 37 fixture cases, 3 definitions, 2 sources; tampered import and renamed fact refused)Notes for review
registry-evidenceschema-feature tests (schema::tests) do not run on pull requests. The fixture rule broke three of them, which pull-request CI did not show; they are fixed and were run locally.Review follow-ups
Changed after review:
commonandprivacyExpectation(reference) andprivacyExpectation(coequal) as required, through a struct-level schema transform so the block definitions stay in$defs. The Rust fields stayOptionso the reader refuses a missing block at its own location.evidencectl testaccepts (one holdingruntime.yaml).<block>mapping to the fixture file."IMPLEMENTATION.mdstates where in the request order the selector refusal is returned.Not changed:
target new --localwrites is a placeholder resolved against the target directory;check --target targets/localpasses on a fresh project, and no file is generated at that path.validate_reference_errorstay&'static str: the error type takes one in about 250 places, and changing it is out of scope here.