Skip to content

feat: add retained managed-epoch reference execution - #16

Merged
piotr-blue merged 41 commits into
nextfrom
feat/retained-managed-epoch-reference-execution
Sep 1, 2026
Merged

feat: add retained managed-epoch reference execution#16
piotr-blue merged 41 commits into
nextfrom
feat/retained-managed-epoch-reference-execution

Conversation

@piotr-blue

Copy link
Copy Markdown
Contributor

Summary

  • add retained authored-initial, epoch-zero and managed-epoch catch-up
  • preserve occurrence-specific cursors, ownership and transitive readiness
  • add proof-aware cyclic exact-node resolution
  • support lazy reference-transparent reads and copy-on-write patch semantics
  • normalize same-BlueId historical invocation evidence
  • bind Coordination 3.0.0-rc.5 to published Blue Language 3.1.0-rc.23
  • add release documentation, dependency isolation and staged-consumer evidence

Verification

  • unit: 604/604
  • integration: 91/91
  • consumer: 9/9
  • scenario: 14/14
  • Java 17 readiness and staging: green
  • Java 21 clean release gate: green
  • isolated staged consumer: green
  • dependency, POM, source archive and structural gates: green

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 06c810909d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +1362 to +1364
if (sourceEpoch == -1L) {
return lineage.authoredInitialBlueId();
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Read the current representation during selector preflight

When an indirect cyclic-component rebind changes a lineage's authoritative currentBlueId without adding an epoch, its last retainedStates() entry still contains the immutable revision BlueId. A ManagedEpochSelector that explicitly selects that current epoch and authoritative BlueId is therefore rejected during operation submission with MANAGED_EPOCH_SELECTOR_STATE_MISMATCH, even though ManagedOccurrenceResolver.blueIdAt explicitly supports this same current-epoch selection. Check lineage.currentEpoch() and return lineage.currentBlueId() before scanning retained states.

Useful? React with 👍 / 👎.

Comment on lines +89 to +94
diagnostic,
drained.managedEpochApplications().stream()
.map(SdkDrainResultMapper
::managedEpochApplicationReceipt)
.toList(),
drained.managedEpochApplicationAttempts().stream()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include managed application gas in drain statistics

When a drain performs managed-epoch work without completing a journal entry, such as drainManagedEpochApplication, entries is empty and aggregateDrainStats reports zero gas even though the newly attached managed attempt contains a complete ClosureProcessResult with nonzero totalGas and the receipt may report a committed transition. Mixed journal/managed drains similarly undercount gas. Fold the managed application attempts' processor results into ProcessingStats before constructing the result.

Useful? React with 👍 / 👎.

Comment on lines +2093 to +2098
boolean remainingWork = activeCatchUp || !journalQuiescent;
boolean budgetExhausted = committedTransitions
>= limits.maxCommittedProcessTransitions()
|| selectedEntries >= limits.maxSelectedEntries();
boolean quiescent = !remainingWork;
boolean paused = remainingWork && budgetExhausted;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Report terminal managed failures as blocked

When the last permitted selection produces a terminal managed evidence or publication failure, the plan's due row is removed and its barrier becomes durably BLOCKED, but selectedEntries also reaches the budget. This calculation consequently returns paused=true and blocked=false—notably from the one-selection targeted managed drain—even though no deterministic work remains and the next processing selection is NONE. Distinguish runnable remaining work from an active blocked barrier before letting budget exhaustion select the paused state.

Useful? React with 👍 / 👎.

Comment on lines +111 to +119
if (!selected.equals(selectionsByPath.keySet())) {
LinkedHashSet<String> missing = new LinkedHashSet<>(
selectionsByPath.keySet());
missing.removeAll(selected);
LinkedHashSet<String> unexpected = new LinkedHashSet<>(selected);
unexpected.removeAll(selectionsByPath.keySet());
throw new IllegalArgumentException(
"MANAGED_EPOCH_SELECTOR_PATH_MISMATCH: missing="
+ missing + ", unexpected=" + unexpected);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Make an unused selector a terminal operation failure

If a submitted selector names a syntactically valid path but the selected handler never produces a managed-occurrence demand for that path, Contracts can complete its attempt and this check throws IllegalArgumentException. The exception occurs before ContractsRootFeederWindow.record, so the appended journal entry remains nonterminal and every subsequent drain retries and throws on the same entry, preventing the contiguous processing frontier from advancing. Reject the path before append when possible, or publish a terminal non-commit outcome instead of throwing from the drain.

Useful? React with 👍 / 👎.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4f044b8c14

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +376 to +379
for (ManagedLineageIndex.RetainedState state
: lineage.retainedStates()) {
if (state.epoch() == sourceEpoch) {
return state.blueId();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the current representation in static selector preflight

After an indirect cyclic-component rebind changes a lineage's authoritative currentBlueId without appending an epoch, the retained state for currentEpoch() still contains the immutable revision BlueId. Consequently, a static admission whose selector names that current epoch and its authoritative BlueId is rejected with MANAGED_EPOCH_SELECTOR_STATE_MISMATCH. This static-admission preflight has its own lookup separate from the operation path; return lineage.currentBlueId() when sourceEpoch == lineage.currentEpoch() before scanning historical retained states.

Useful? React with 👍 / 👎.

Comment on lines 552 to +553
blue.coordination.api.DocumentSnapshot snapshot =
engine.auditDocument(id);
engine.document(id);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve not-ready errors when selecting a target by ID

When operations().on(DocumentId) selects an existing document that is BLOCKED or otherwise has no application-readable head, engine.document(id) throws DOCUMENT_NOT_READY, but the surrounding catch handles every CoordinationException as if the document did not exist. The call is then built with presentAtSelection=false and can be appended through the missing-target path, producing a misleading zero-attempt/not-managed outcome; this also differs from selecting the same document through a DocumentHandle, which propagates the readiness failure. Only convert DOCUMENT_NOT_FOUND into the absent-target selection and preserve other typed failures.

Useful? React with 👍 / 👎.

@piotr-blue
piotr-blue merged commit d80e3cb into next Sep 1, 2026
2 checks passed
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