Repository navigation
fix: report recovered horizon answers as uncertain and name the direct-destination operations - #2538
Merged
Merged
Conversation
Recovery repeats an attempt whose first answer was lost. BReg answers idempotency.expired to an exact retry whose first attempt committed, and idempotency.key-reused to a retry whose held response a retention erase removed, whose first attempt committed under another activation, profile, or claims, or (for a guarded Action) whose body was rebuilt after the first attempt moved its target. The connector reported both as a refusal, a terminal category, so a caller could skip as refused an item whose write had committed. Every keyed operation's recovery (record create, patch, tombstone, batch, Action invoke, Proposal start and submit) now reports those two answers as uncertain, keeping the problem word, with a note to settle by reading the destination. A first send keeps the refusal. The ingestion run family sends no destination key and is unchanged. Signed-off-by: Jeremi Joslin <jeremi@joslin.fr>
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. |
The connector implements every BReg operation family, but the direct destination admits only an item that maps to one BReg operation with no lookup: an immediate Action, or a Proposal start and submit (CONCEPT sections 17.1 and 17.3). Keeping the other families implemented made it easy to wire record create, batch, or ingestion into a job later for convenience, and with it the broader grants those need. `breg::job_direct_admits` names the admitted operations, the module documentation states the rule, and a test pins the split, so the job's destination wiring has one check to apply when it lands. 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.
What this fixes
The BReg connector's keyed operations recover a lost answer by repeating the attempt under the same key. On that repeat, BReg can answer:
idempotency.expired(410): an exact retry whose first attempt committed before the receipt horizon passed;idempotency.key-reused(409): a retry whose held response a retention erase removed, whose first attempt committed under another package activation, access profile, or claims, or (for a guarded Action) whose body was rebuilt from conditions the first attempt itself moved.In each case the first attempt may have committed. The connector reported both answers as
refused, a terminal category, so a caller could skip as refused an item whose write had landed.Recovery of every keyed operation (record create, patch and tombstone, batch, Action invoke, Proposal start and submit) now reports these two answers as
uncertain. It keeps the problem word and adds a note to settle the outcome by reading the destination. A first send still reports them asrefused, because its key carried no earlier attempt. The ingestion run family sends no destination key and is unchanged.The guarded Action path also gets an accurate comment: it rebuilds its body from freshly read conditions, so it does not re-arm the saved bytes.
Naming what a job may send directly
The connector implements every BReg operation family, but the direct destination admits only an item that maps to one BReg operation with no lookup: an immediate Action, or a Proposal start and submit (
products/adapter/CONCEPT.mdsections 17.1 and 17.3).breg::job_direct_admitsnames those operations, and thebregmodule documentation states the rule. A test pins the split: record create, patch and tombstone, batch, and the ingestion run family are not admitted. Nothing wires a job to the connector yet, so the job's destination wiring will apply this check when it lands.Verification
New tests, each seen failing before the fix: recovery under a spent key is uncertain for create, patch, tombstone, batch, guarded and unguarded Action invoke, and Proposal start; Proposal submit recovery past the receipt horizon is uncertain. Two controls still report a first send under a spent key as refused (create, guarded Action).
cargo test -p registry-adapter-connectors --all-features: pass, including the admission test (seen failing to compile beforejob_direct_admitsexisted)cargo clippy -p registry-adapter-connectors --all-targets --all-features -- -D warnings: clean, and without features;cargo docwith-D warnings: cleancheck_dependency_direction.py: passproducts/adapter/scripts/test-connector-native.py(the BReg connector journeys against a real BReg runtime and a disposable PostgreSQL): pass (7 tests). The immediate-Action journey now asserts uncertain on recovery under a spent key.products/adapter/scripts/check-contracts.sh: pass (3,630 tests, run on the first commit; the second adds one connector test and docs)I reviewed the submitted changes