Skip to content

THOTH-ASYNC-01-ADR-01: ADR-0012 shared async architecture (Amendment 13 approved) - #960

Open
ja573 wants to merge 49 commits into
feature/workerfrom
feature/async/adr-0012
Open

ja573 wants to merge 49 commits into
feature/workerfrom
feature/async/adr-0012

Conversation

@ja573

@ja573 ja573 commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

THOTH-ASYNC-01-ADR-01 - ADR-0012 shared asynchronous architecture (Amendment 13)

Programme: THOTH-ASYNC-01 #957
Owning task and decision ledger: THOTH-ASYNC-01-ADR-01 #958
Repository: thoth-pub/thoth
Risk / owner: CRITICAL / CTO
Scope: Cross-programme architecture and documentation only. No shared-engine implementation, migration or runtime activation.
Approval route: Repository decision-doctrine Route B - PR-first staged approval, with the expressly authorized transitional task branch feature/async/adr-0012 targeting feature/worker.

Current source decision (reconciled 2026-10-21): Amendment 13, including Revisions 1 and 2, has CTO architecture-content approval, an APPROVED ADR-0012 status, CTO approval of the exact final ADR Git blob, and a fresh independent CRITICAL final-source-head review: APPROVED, no blocking source findings. This does not grant a configured GitHub PR approval, Draft-to-Ready transition, merge authorization, repository authority or operational activation. PR #960 remains DRAFT and UNMERGED; merge readiness is HOLD.

Exact current source / authority identity

repository: thoth-pub/thoth
programme: THOTH-ASYNC-01 (#957)
owning issue: THOTH-ASYNC-01-ADR-01 (#958)
PR: #960
task branch: feature/async/adr-0012
PR base: feature/worker
base and develop SHA at reconciliation: b44303c214498baf76c9d9a0a7cab374377f9cbe
EXACT INDEPENDENTLY APPROVED FINAL SOURCE HEAD:
2d01255c24f68cd03666cfa05518bb9f4ae76667
EXACT SOURCE TREE:
cf59907583a2bc0c0ded24ef66f1d0d041bb8456
CONTENT-APPROVED CANDIDATE / SOLE PARENT:
18ffbf7d8b39755abfe84b64af29bc47ca7550b5
CONTENT-APPROVED PROPOSED CANDIDATE ADR BLOB:
0b5fb2d7ef30f156a13bf6f195ef8b34e807d239
CTO-APPROVED EXACT FINAL APPROVED-STATE ADR-0012 BLOB:
69f9ec9017ffe39d865bbe3ae67522c6917dc857
ADR path:
docs/engineering/decisions/ADR-0012-shared-asynchronous-event-and-job-execution.md
ADR Status: APPROVED
ADR approver: Javi, CTO
content-approval date carried in ADR: 2026-10-20
separate final-Git-blob CTO approval date: 2026-10-21
fresh independent final-head review: 2026-10-21

SHA-bound evidence applies only to these exact objects. Any source commit invalidates final-head review, and a later material ADR byte change invalidates this exact-final-blob approval.

Amendment 13 - effective approved specification and Route-B evidence

The effective material correction is original Amendment 13 + Revision 1 + Revision 2, with R2 controlling overlapping R1/original text and R1 controlling overlapping original text. Unaffected prior approved amendments remain binding. GitHub owns lifecycle evidence; the committed ADR and report do not self-pin approval comment IDs.

Gate Decision and owning issue receipt
Original Amendment 13 / revisions Original 6221879811, R1 6237231089, R2 6238676946
Independent CRITICAL specification review APPROVED 6266733934
CTO specification approval, material correction and Route B APPROVED 6273281867
Independent exact PROPOSED candidate source review APPROVED 6292032387
CTO exact candidate architecture-content approval APPROVED 6292834146, dated 2026-10-20
Bounded one-commit approval-state authorization AUTHORIZED 6295994615
Independent approval-state source review APPROVED 6300067378
CTO exact final ADR Git blob approval APPROVED 6320987636, dated 2026-10-21
Fresh independent CRITICAL exact-final-source-head review APPROVED 6321202855, dated 2026-10-21; source only
PR review-thread/metadata reconciliation Separate bounded control stage, recorded on owning issue #958; does not imply configured PR approval
Configured GitHub review, Ready, exact-head CTO merge authorization, merge, develop integration and activation NOT GRANTED; each has distinct gates

Selected correction: Each event has an immutable original-epoch classification for every logical route. Every first (event_id, route_key) disposition writer must prove classification, path-specific eligibility and authorization inside its database-consistent admission transaction. An in-epoch contract mismatch may obtain a disposition only through compatible explicitly authorized first historical enrollment and a canonical terminal ENROLLED anomaly.

Detection, first mismatch enrollment and authorized reconciliation/divergence share a database-enforced canonical anomaly creation/terminal-decision order, including when no anomaly row existed at the first read. Detection-first creates OPEN; compatible enrollment-first atomically creates a born-terminal ENROLLED anomaly, the unique route disposition and required job/attachment facts. Later detection converges without reopening it. Divergence is lawful only from a previously committed OPEN anomaly, with explicit authority and covering/compensation evidence; it creates no route disposition or job. Contradictory existing durable state fails closed for separately authorized incident recovery, never invented automatic repair.

Preserved architecture: activation epochs and immutable route-contract revisions; selection/withdrawal and strand-safety ordering; transactional business event emission; event/route/job distinction and durable backlog; atomic routed-job/disposition/input creation; coalescing attachment versus first-claim seal; deterministic post-seal successors with distinct effect identities; revision-bound/current-state semantics; target-scoped idempotency and effect fencing; at-least-once execution, checkpoints, ambiguous provider-effect reconciliation, trust-separated worker pools, authorization/audit and BE-04 expand/migrate/retire/contract compatibility. The final ADR includes 47 numbered invariants, 30 active Amendment-13 validation cases (A13-T01-T24 and A13-T26-T31), with T25 expressly retired, and the earlier Amendment-12 post-seal validation requirements. These are implementation acceptance specifications, not tests executed by this documentation PR.

Historical Amendment 12: The prior approved correction resolved R-21E-01 (post-seal recovery) by requiring distinct, deterministic and atomically materialized successor generations instead of retrying a permanently sealed identity; it retains its own independent reviews, candidate/approval-state history and exact blob approval in issue #958. Its 2026-10-15 approved ADR blob 1c98ce0cca1eeb4bf46bbfc526a3826c534f637e and former PR head a913232a6623936855d635885d513d4c778c4b25 are historical only and must not be treated as approvals of Amendment 13.

Scope, owning boundaries and validation

Against feature/worker @ b44303c214498baf76c9d9a0a7cab374377f9cbe, PR #960 is 49 commits ahead, 0 behind, exactly six documentation paths:

CHANGELOG.md
docs/engineering/ai-delivery/implementation-reports/THOTH-ASYNC-01-ADR-01-implementation-report.md
docs/engineering/decisions/ADR-0008-machine-roles-and-durable-job-primitives.md
docs/engineering/decisions/ADR-0010-staff-operations-console.md
docs/engineering/decisions/ADR-0012-shared-asynchronous-event-and-job-execution.md
docs/engineering/decisions/decision-register.md

The final source commit changes four existing documentation paths (ADR-0012, register, changelog and implementation report); it leaves architecture sections 3, 7 and 11 byte-identical to the content-approved candidate. ADR-0008 and ADR-0010 are superseded in part only under ADR-0012's authority condition; unaffected machine-role, least-privilege, staff/audit and service-operation seams remain binding. ADR-0013 programme-local exact-version reliance is distinct and not automatically granted.

The approved architecture assigns thoth-pub/thoth the shared PostgreSQL durable engine and trusted worker contract; thoth-pub/thoth-dissemination dissemination-specific executors; thoth-pub/thoth-app the released BE-04 read-surface compatibility/migration obligation; and thoth-pub/infrastructure the separately authorized runtime/IAM substrate. This PR implements none of those later executable changes.

GitHub Actions at the exact head: check-changelog run 39463029745 succeeded; runs 39463029561 (build-test-and-check), 39463029491 (run-migrations) and 39463029529 (publish-to-dockerhub) completed with successful classify steps and the actual build/test/lint/format, migration and image-publication jobs SKIPPED. Workflow-level success is not a runtime or database-test pass. No Rust, SQL, data, provider/IAM or infrastructure source change is part of this PR.

Historical review findings, configured review and remaining controls

The five historical PR review findings are source-level corrected by the current approved architecture but require explicit, separately recorded GitHub-thread disposition: R-E41F-01 (withdrawal/strand predicate); R-576A-01 (atomic job/disposition); R-576A-02 (mutually exclusive anomaly terminal outcomes); R-21E-01 (post-seal successor); R-960-A12-DET-ENR-01 (detector versus first-enrollment with no initial anomaly). A thread-resolution UI state is not a configured GitHub APPROVED review and does not suppress new findings. The owning issue records the authoritative adjudication; use live GitHub thread status rather than a historical count in this description.

As of 2026-10-21 preflight, PR #960 had 38 COMMENTED review submissions and zero APPROVED, no explicitly requested reviewers or teams, and remained DRAFT. The independent source review recorded on issue #958 does not constitute a formal GitHub PR-review submission. The live branch protection / configured reviewer requirements must be checked at the Ready/configured-review gate; do not assume a clean mergeability status proves those permissions.

Next separately authorized gate: reconcile any outstanding PR-thread effects; identify configured reviewer/check requirements and authorize Draft -> Ready, accounting for potential automatic reviewer/CI side effects; obtain configured exact-head review and adjudicate any new findings, then secure a separate CTO CRITICAL exact-reviewed-head merge authorization before guarded merge into feature/worker. Subsequent feature/worker -> develop integration, ADR repository authority or a separately pinned ADR-0013 reliance route, implementation, migration, provider action, deployment and production activation remain independent controls.

Not authorized by this PR metadata: source edits, commits or pushes; review requests, Ready transition or configured PR-review submission; issue-body replacement; merge, rebasing or target change; manual CI; data/schema migration; provider/IAM/runtime reads or writes; Docker publication; release; deployment; production activation. PR metadata and historical thread-source dispositions do not grant those permissions.

Tracks #957 and #958.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 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-10-22T10:45:45.371203Z 2d01255 Draft marked ready
ℹ️ 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.

@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: bd5223deee

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ja573
ja573 marked this pull request as draft October 7, 2026 21:09
@ja573
ja573 marked this pull request as ready for review October 8, 2026 18:27

@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: e41f377202

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ja573
ja573 marked this pull request as draft October 8, 2026 19:47
@ja573
ja573 marked this pull request as ready for review October 12, 2026 11:40

@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: 576a860be4

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ja573
ja573 marked this pull request as draft October 12, 2026 13:30
@ja573
ja573 marked this pull request as ready for review October 13, 2026 13:25

@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: 21e19e81d0

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ja573
ja573 marked this pull request as draft October 13, 2026 17:45
@ja573 ja573 changed the title THOTH-ASYNC-01-ADR-01: approve ADR-0012 shared async architecture THOTH-ASYNC-01-ADR-01: ADR-0012 shared async architecture (Amendment 12) Oct 16, 2026
@ja573
ja573 marked this pull request as ready for review October 16, 2026 16:16

@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: a913232a66

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ja573
ja573 marked this pull request as draft October 16, 2026 18:04
@ja573 ja573 changed the title THOTH-ASYNC-01-ADR-01: ADR-0012 shared async architecture (Amendment 12) THOTH-ASYNC-01-ADR-01: ADR-0012 shared async architecture (Amendment 13 approved) Oct 21, 2026
@ja573
ja573 marked this pull request as ready for review October 22, 2026 10:42

@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: 2d01255c24

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +1640 to +1644
only before its first successful execution claim/start transition linearizes;
while it is open, a new materialized route disposition may still be attached to
it under the kind's explicit coalescing rule. The first successful committed
claim/start transition makes the logical job **coalescing-sealed**,
permanently: no new route disposition may be attached to it afterwards. The

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Close coalescing before pre-start cancellation

When a pending coalescing job is cancelled before its first claim—a transition explicitly allowed in section 3.4—this definition does not seal it because only the first successful claim/start does so. A later router can therefore either attach a new disposition to a terminal CANCELLED job, silently losing that obligation, or refuse the attachment but remain unable to use the post-seal successor path because the job was never sealed and its idempotency key remains reserved. Make pre-start cancellation atomically close coalescing, serialize it against attachment, and define both race orders.

AGENTS.md reference: AGENTS.md:L350-L361

Useful? React with 👍 / 👎.

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.

2 participants