Skip to content

fix: report recovered horizon answers as uncertain and name the direct-destination operations - #2538

Merged
jeremi merged 2 commits into
mainfrom
fix/connector-recovery-horizon
Nov 1, 2026
Merged

jeremi merged 2 commits into
mainfrom
fix/connector-recovery-horizon

Conversation

@jeremi

@jeremi jeremi commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

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 as refused, 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.md sections 17.1 and 17.3). breg::job_direct_admits names those operations, and the breg module 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 before job_direct_admits existed)

  • cargo clippy -p registry-adapter-connectors --all-targets --all-features -- -D warnings: clean, and without features; cargo doc with -D warnings: clean

  • check_dependency_direction.py: pass

  • products/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

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>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-01T12:59:36.564501Z ea1e591 New commits
ℹ️ 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" or "@codex security review".

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>
@jeremi jeremi changed the title fix: report a recovered keyed exchange's horizon answer as uncertain fix: report recovered horizon answers as uncertain and name the direct-destination operations Nov 1, 2026
@jeremi
jeremi added this pull request to the merge queue Nov 1, 2026
Merged via the queue into main with commit 4e57b08 Nov 1, 2026
56 checks passed
@jeremi
jeremi deleted the fix/connector-recovery-horizon branch November 1, 2026 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant