Skip to content

Add shared transactional outbox persistence#155

Merged
abiorh-claw merged 44 commits into
mainfrom
codex/ws-con-001-02a-shared-outbox-persistence
Jul 20, 2026
Merged

Add shared transactional outbox persistence#155
abiorh-claw merged 44 commits into
mainfrom
codex/ws-con-001-02a-shared-outbox-persistence

Conversation

@Abiorh001

@Abiorh001 Abiorh001 commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

PR Trust Bundle: WS-CON-001-02A

Chunk

WS-CON-001-02A - Shared Transactional Outbox Persistence.

Goal

Land feature-neutral shared PostgreSQL outbox truth and a caller-transaction
append participant, with enough persistence shape for 02B to add dispatcher
mechanics without another migration.

Risk: L1 infrastructure/data boundary; SLA P1.

Human-Approved Intent

The human explicitly started 02A after CON-01 merged. This chunk must remain
generic and authorization-neutral: AUTH owns every action, permission,
evaluator, service admission, and activation decision, while 02B and later
feature chunks own execution behavior.

Why It Changed

REV-owned lifecycle transactions need one generic durable event participant
that can flush into the caller's transaction without publishing, committing,
or inheriting feature authority. No such shared persistence boundary existed on
trusted main.

What Changed

  • Added one linear 0029_shared_transactional_outbox migration after the
    ART-owned 0028_artifact_admission revision.
  • Added the generic outbox model, strict append schemas, reservation repository,
    and flush-only service.
  • Registered the model in shared SQLAlchemy metadata.
  • Added PostgreSQL migration, concurrency, replay, privacy, custody, rollback,
    and state-shape tests.
  • Updated the WS-CON chunk ledger and added exactly one schema-v2 merge intent
    naming 02B with a separate explicit start.

Design Chosen

  • Immutable event truth and mutable operational delivery state are separate.
  • PostgreSQL, not the caller, owns producer, occurrence time, initial state,
    counters, and initial eligibility time.
  • Event ID and global idempotency key are independent identities; exact replay
    requires every immutable fact to match.
  • The repository inserts with conflict suppression, locks matching identities
    deterministically, and uses only the supplied AsyncSession.
  • The service reuses the existing repository-wide app.core.hashing canonical
    JSON helper, takes one defensive deep payload snapshot before its first await,
    and emits only stable input, conflict, or persistence errors with detached
    payload-bearing validation/database exception contexts.
  • Retention is one-way terminal archival; event truth cannot be deleted or
    truncated.
  • No route, dispatcher, delivery executor, broker, Celery task, handler,
    authorization identifier, or product-domain mutation is present.

Scope Control

The committed diff is limited to the reviewed 02A migration, outbox module,
metadata registration, focused tests, initiative evidence, and one merge
intent. The user-owned local PDF deletion is excluded. No 02B dispatcher work
or protected product behavior is included.

Product Behavior

There is no new public or protected product surface. Existing review,
contribution, compensation, authorization, artifact, task, and project behavior
is unchanged; the new participant is infrastructure for later callers.

Alternatives Rejected

  • A new canonicalizer or generic idempotency framework.
  • An outbox-owned session, commit, enqueue, publish, or post-commit repair.
  • Event identity inferred only from the idempotency key.
  • Mutable payload/envelope facts or physical retention deletion.
  • A schema too small for 02B that would force a second delivery-state migration.
  • Dispatcher authority inherited by protected feature handlers.

Acceptance Criteria Proof

  • Current PR Clean-cut contributor attribution to canonical human actors #153 reconciliation: 43 passed, 32 deselected in 177.40 seconds
    on the exact bounded isolated outbox/migration row; outbox coverage is 95.73
    percent against the 90 percent subsystem floor.
  • Current helper regression suite: 8 passed in 0.21 seconds. A Pydantic opaque
    mapping compatibility repair preserves fail-closed secret graph inspection.
  • Current AUTH revision-specific lifecycle proof: 1 passed in 63.77 seconds,
    preserving AUTH's exact 0026 downgrade/reupgrade behavior independently of
    repository head.
  • Alembic reports exactly one head at 0029_shared_transactional_outbox, with
    parent 0028_artifact_admission.
  • The exact ART 0028 / CON 0029 bounded row passes 73 tests with 32
    deselected after the Proxy repair and 95.90 percent focused outbox coverage.
  • REV-02A PR docs(rev): split guide chronology and task locking contracts #156 is reconciled at trusted main 3b1d6379; it changes planning
    contracts only and adds no migration, runtime outbox seam, or CON authority.
  • The following 0027 rows are retained as historical pre-PR Clean-cut contributor attribution to canonical human actors #153 evidence;
    they do not replace the current 0028 proof above or GitHub CI.
  • Post-review exact bounded row: 43 passed, 30 deselected in 60.22 seconds,
    with 95.73% outbox coverage against the 90% subsystem floor.
  • Reconciled exact contract selector: 8 passed, 56 deselected.
  • Current-main outbox plus migration/lifecycle-guard suite: 36 passed in
    156.17 seconds; the reconciled outbox implementation retains 95.43% focused
    coverage.
  • After ART-02B1 merged, the combined outbox/migration plus real-MinIO S3
    focused suite passed 76 tests in 243.28 seconds on the current tree.
  • After AUTH-09D-B merged, the combined outbox/migration, real-MinIO S3, and
    identity-link lifecycle/concurrency suite passed 78 tests in 378.36 seconds.
  • Affected AUTH lifecycle downgrade tests: 2 passed, including atomic rollback
    to the full 0027 head when AUTH refuses 0026 -> 0025.
  • Alembic historically reported exactly one head: 0027_shared_transactional_outbox.
  • Isolated database runner self-tests: 16 passed in 102.10 seconds with the
    required admin URL.
  • Real API contract end-to-end on the 0027 chain: passed.
  • Pre-reconciliation exact isolated PostgreSQL full suite: 1347 passed in 17741.96 seconds
    (4:55:41), with 85.35% repository coverage against the 78% floor.
  • The pre-reconciliation isolated evidence records tree f72bb6e, database
    workstream_test_d513fb2f03b1, and the superseded Alembic head
    0026_shared_transactional_outbox; the superseded 0027 focused proof is
    retained above and GitHub CI must supply repository-wide proof after publication.
  • Agent-loop gates: 88 passed after AUTH-09D-B.
  • Ruff, 90.4% docstring coverage, Markdown links, stale Workstream/AUTH/ART/REV
    scans, and diff hygiene pass.
  • AUTH-09D-A reconciliation historically moved the migration to 0027; PR Clean-cut contributor attribution to canonical human actors #153
    supersedes that revision with the current 0028 proof above, and GitHub CI
    must pass after publication.
  • REV PLAN2 PR docs(rev): reconcile runtime-readiness planning #150 then advanced trusted main to 983b9e53. It changes only
    planning/specification files, preserves the 02A runtime boundary, and updates
    future CON/REV child gates. A two-hour suite on the prior head was stopped,
    discarded, and is not counted.
  • ART-02B1 PR Add S3-compatible artifact storage with MinIO proof #151 then advanced trusted main to 1b5422fc. It adds the real
    S3-compatible adapter, MinIO service, SDK pins, CI gates, and a substantial
    backend test delta without changing 02A code or migration. The 3-hour
    7-minute run on the prior tree was stopped and discarded.
  • AUTH-09D-B PR Add identity-link lifecycle authorization #152 then advanced trusted main to 93dd3924. It activates
    only identity-link revoke/reactivate and adds AUTH route/test coverage, with
    no migration or 02A boundary change. The one-hour run on the prior tree was
    stopped and discarded.
  • Contributor-foundation PR Clean-cut contributor attribution to canonical human actors #153 then advanced trusted main to 8d5eb15b. It
    clean-cuts TaskAssignment/Submission attribution to canonical human
    contributor_id, adds writer revalidation, and owns 0027. It changes no
    CON authority or outbox behavior; CON's migration is now the linear 0028
    child. Fresh bounded proof and exact-SHA internal review supersede the older
    publication evidence, while the full suite remains GitHub CI-owned.
  • A fourth local run on the frozen current head was stopped after approximately
    4 hours 15 minutes by human direction that repository-wide suites must run in
    GitHub CI. Its metadata was removed and it is not counted. The existing
    Backend full-suite job is the required exact-head repository proof.

Tests And Checks Run

The exact isolated PostgreSQL selector covers migration custody, rollback,
replay, collision races, payload privacy, and delivery-state constraints. The
separate helper suite covers deep secret-retention assertions. Ruff, Alembic
head, Markdown links, stale-contract scans, agent-loop tests, docstrings, and
git diff --check also pass.

Test Delta

No existing test was deleted, skipped, weakened, or rewritten to accept broken
behavior.

Internal-review repairs add regression proof for one detached Pydantic
core-schema boundary across model methods and TypeAdapter, valid Python/JSON/
string-mode parity, hostile top-level and nested dict/list/string subclasses,
payload-free outbox traceback locals including idempotency conflicts, nested
payload mutation while reservation is blocked, payload-free database failures,
and caller rollback after an injected post-reservation failure. The shared deep-
retention assertion now inspects dict/list/string subclasses and slotted
dataclass state without invoking the tested hostile overrides. The exact
documented focused command generates fresh coverage before enforcing the
subsystem floor.

CI Integrity

No workflow, dependency, package script, test runner, lint/typecheck command,
coverage threshold, or CI configuration changed.

Repository-wide tests and the 78 percent repository coverage floor run only in
the existing GitHub Backend full-suite job. Local proof is bounded to focused
real-service tests, the 90 percent outbox coverage floor, Ruff, migrations, and
static gates. This changes execution location only: no test, assertion,
isolation control, or coverage threshold is waived.

Reviewer Results

  • Exact repair candidate 9be9c88a19c4301f2b7ac606b6782604a48472bb
    passed senior engineering, QA/test, security/auth, product/ops,
    architecture, docs, reuse/dedup, test-delta, and CI-integrity review against
    trusted main 3b1d63796c086f53fc2b0aeefe096387b82485ec with no open findings and no
    open reviewer sessions.
  • The pre-PR Clean-cut contributor attribution to canonical human actors #153 implementation passed all nine tracks at historical code SHA
    460573287270965d730c83f5f1e52f3acf1c0671.
  • That historical review is superseded by the current exact-SHA result above.

External Review

CodeRabbit review 8be695bd-33ce-4847-8bf1-905a130804ec posted five actionable
documentation-consistency threads. The repair adds explicit reviewer tracks,
aligns AUTH counts, defines REV parent/child aliases, fixes REV-13C release
ownership, and fixes the REV-04B prerequisite. Its physical-purge suggestion is
deferred to separately started 02B because 02A forbids retention behavior and
its custody contract prohibits physical delete/truncate. GitHub Backend remains
in progress; external review does not replace internal review.

Remaining Risks

  • GitHub still must prove the full backend suite and repository-wide 78 percent
    coverage floor on the published exact head.
  • The Pydantic string-mode wrapper supports the model's fixed strict/default
    contract; arbitrary per-call runtime option overrides are not a 02A API.
  • Dispatcher mechanics, service authority, and recovery remain excluded and
    require a separately started 02B chunk.
  • Sustained-volume archival/retention behavior remains a reviewed 02B concern;
    no trigger-disable purge path is introduced into immutable 02A event truth.

Human Review Focus

  1. Is the immutable/operational schema complete for migration-free 02B without
    implementing dispatcher behavior early?
  2. Do global idempotency and event-ID collisions fail closed under concurrent
    commit and rollback orders?
  3. Are payload bounds and secret-key rejection sufficient for a generic event
    envelope?
  4. Do database custody, archival, and guarded downgrade preserve durable event
    truth?
  5. Does append remain entirely inside the caller-owned transaction with no AUTH
    or product-domain boundary expansion?

Follow-Up Work

The same-initiative successor is WS-CON-001-02B, Shared Outbox Dispatcher And
Recovery. It requires a separate explicit start after this PR merges and after
its AUTH/service prerequisites refresh from trusted main.

Human Merge Ownership

Only the human owner may approve and merge the specific 02A PR. Passing
reviewers, CI, or CodeRabbit do not authorize merge or the next chunk.

Summary by CodeRabbit

  • New Features

    • Added shared transactional outbox persistence with append/replay support within existing transactions.
    • Introduced strict outbox event and payload validation plus stable idempotency handling for consistent event creation.
  • Bug Fixes

    • Enforced stronger delivery-state correctness and immutability guarantees via database trigger constraints, including safer downgrade/write protection.
  • Tests

    • Added end-to-end outbox tests and a migration schema/downgrade race test for the shared outbox table.
  • Documentation

    • Updated WS-CON-001 planning, verification requirements, and coverage-gate guidance.

Abiorh001 added 27 commits July 18, 2026 03:18
…to codex/ws-con-001-02a-shared-outbox-persistence
…to codex/ws-con-001-02a-shared-outbox-persistence
…to codex/ws-con-001-02a-shared-outbox-persistence
…to codex/ws-con-001-02a-shared-outbox-persistence
…to codex/ws-con-001-02a-shared-outbox-persistence
…to codex/ws-con-001-02a-shared-outbox-persistence
…to codex/ws-con-001-02a-shared-outbox-persistence
…to codex/ws-con-001-02a-shared-outbox-persistence
@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR reconciles the WS-CON-001 trusted baseline and implements CON-02A shared transactional outbox persistence. It adds strict payload validation, PostgreSQL schema custody, caller-owned transactional append/replay behavior, migration safeguards, concurrency handling, and focused verification documentation and tests.

Changes

CON-02A shared transactional outbox

Layer / File(s) Summary
Baseline and execution gates
.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/*
Updates trusted-main reconciliation, authorization baselines, dependency ordering, verification rules, migration lineage, chunk status, and explicit CON-02A stop conditions.
Outbox contract and review evidence
.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/reviews/*, .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/DISCOVERY.md
Defines the feature-neutral outbox contract, payload privacy and idempotency rules, custody transitions, migration guarantees, review evidence, and follow-up boundary for CON-02B.
Schema and append implementation
backend/app/modules/outbox/*, backend/app/db/models.py, backend/alembic/versions/0029_shared_transactional_outbox.py
Adds OutboxEvent, strict append schemas, canonical payload hashing, caller-session reservation, replay/conflict handling, PostgreSQL constraints, indexes, triggers, and guarded downgrade behavior.
Security, migration, and concurrency verification
backend/tests/*
Adds tests for payload validation and secrecy, hostile object traversal, append rollback and snapshotting, replay/idempotency races, delivery-state custody, migration schema exactness, downgrade writer locking, and forbidden dispatch surfaces.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Caller
  participant OutboxService
  participant OutboxRepository
  participant PostgreSQL
  Caller->>OutboxService: append validated event
  OutboxService->>OutboxRepository: reserve event and payload digest
  OutboxRepository->>PostgreSQL: insert, flush, lock conflicts
  PostgreSQL-->>OutboxRepository: created or existing event
  OutboxRepository-->>OutboxService: reservation result
  OutboxService-->>Caller: CREATED, REPLAYED, or conflict
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 41.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately summarizes the main change: shared transactional outbox persistence.
Description check ✅ Passed The description covers nearly all required template sections and includes the main scope, design, evidence, risks, and review status.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/ws-con-001-02a-shared-outbox-persistence

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Abiorh001

Copy link
Copy Markdown
Collaborator Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai 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.

Actionable comments posted: 5

🧹 Nitpick comments (1)
backend/alembic/versions/0027_shared_transactional_outbox.py (1)

176-184: 🧹 Nitpick | 🔵 Trivial

Plan a retention/purge path before production load.

ix_outbox_events_retention and archived_at establish the retention surface, but nothing in v0.1 archives or purges terminal rows, so outbox_events grows unbounded as delivery volume accumulates. This is out of scope for 02A (dispatch/retention is later work), but ensure a background archival/purge job — coordinated with the custody triggers via the disable/enable pattern already used in tests — lands before this reaches sustained traffic.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@backend/alembic/versions/0027_shared_transactional_outbox.py` around lines
176 - 184, Plan and implement a background archival/purge job for terminal
outbox rows using ix_outbox_events_retention and archived_at, so outbox_events
does not grow without bound under sustained traffic. Coordinate archival and
deletion with the custody triggers using the existing disable/enable pattern
from the tests, and ensure this retention path lands before production load
while keeping the current migration scope unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
@.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/chunks/WS-CON-001-02A-shared-outbox-persistence.md:
- Around line 38-58: Add an explicit required-reviewers section to the
“Verification and reviewers” content, naming the reviewer roles or identities
required before implementation begins. Keep the existing verification commands
and acceptance criteria unchanged, and ensure the section clearly identifies
reviewer requirements alongside the other chunk prerequisites.

In
@.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/DISCOVERY.md:
- Around line 179-186: Reconcile the AUTH catalogue count terminology across
DISCOVERY.md and the referenced PLAN.md, SOURCE_MANIFEST.md, and STATUS.md
materials: replace or explicitly mark the stale “15 active” and “50 planned”
observation so the baseline consistently uses the established 17/48 counts.
Preserve the existing 74/65/17/48 breakdown and align wording with README.md,
docs/glossary.md, and docs/architecture_lockdown.md.
- Line 159: Reconcile all REV lifecycle-gate terminology so every durable record
uses the authoritative REV-12A1/12A3 sequence, with REV-12A3 retained as the
drain-observation prerequisite and any REV-12A parent/child alias explicitly
defined. Update
.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/DISCOVERY.md
lines 159 and 223, align the shared-fence hook naming in
JOINT_RELEASE_HANDOFF.md lines 115-118, and update the rollout gate in STATUS.md
lines 172-173; keep terminology consistent with README.md, docs/glossary.md, and
docs/architecture_lockdown.md.

In
@.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/JOINT_RELEASE_HANDOFF.md:
- Around line 157-159: Update the release-ownership wording in the planning
documents so it matches the handoff’s designation of REV-13C as the sole public
product release owner, or explicitly define REV-13 as its parent initiative.
Keep terminology consistent with README.md, docs/glossary.md, and
docs/architecture_lockdown.md, and ensure ownership is unambiguous.

In
@.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/SOURCE_MANIFEST.md:
- Around line 45-52: Update the later runtime-observation text in
SOURCE_MANIFEST.md to refer to REV-04B instead of REV-04, keeping the
FinalAcceptance prerequisite identifier consistent with the existing normative
description and repository terminology.

---

Nitpick comments:
In `@backend/alembic/versions/0027_shared_transactional_outbox.py`:
- Around line 176-184: Plan and implement a background archival/purge job for
terminal outbox rows using ix_outbox_events_retention and archived_at, so
outbox_events does not grow without bound under sustained traffic. Coordinate
archival and deletion with the custody triggers using the existing
disable/enable pattern from the tests, and ensure this retention path lands
before production load while keeping the current migration scope unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 8be695bd-33ce-4847-8bf1-905a130804ec

📥 Commits

Reviewing files that changed from the base of the PR and between 93dd392 and 21b3b16.

📒 Files selected for processing (27)
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/ACTIVE_DOC_INVENTORY.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/AUTHORIZATION_HANDOFF.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/CHUNK_MAP.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/DECISIONS.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/DISCOVERY.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/INTENT.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/JOINT_RELEASE_HANDOFF.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/PLAN.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/RUNTIME_VERIFICATION.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/SOURCE_MANIFEST.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/STATUS.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/chunks/WS-CON-001-02A-shared-outbox-persistence.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/reviews/WS-CON-001-02A-internal-review-evidence.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/reviews/WS-CON-001-02A-pr-trust-bundle.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/reviews/WS-CON-001-02A-preimplementation-plan-review.md
  • .agent-loop/merge-intents/WS-CON-001-02A.json
  • backend/alembic/versions/0027_shared_transactional_outbox.py
  • backend/app/db/models.py
  • backend/app/modules/outbox/__init__.py
  • backend/app/modules/outbox/models.py
  • backend/app/modules/outbox/repository.py
  • backend/app/modules/outbox/schemas.py
  • backend/app/modules/outbox/service.py
  • backend/tests/assertion_helpers.py
  • backend/tests/test_alembic.py
  • backend/tests/test_assertion_helpers.py
  • backend/tests/test_outbox.py

Comment on lines +157 to +159
CON-11 publishes the hidden dependency manifest but registers no route.
REV-13A consumes it in preflight and REV-13C owns the sole public product
release and final HTTP proof. This handoff starts no chunk automatically.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Synchronize the final release owner across planning documents.

This handoff now identifies REV-13C as the sole public release owner, while PLAN.md still says REV-13 owns final public release. Update the companion wording or explicitly define REV-13 as the parent so release ownership is unambiguous.

As per coding guidelines, keep terminology consistent with README.md, docs/glossary.md, and docs/architecture_lockdown.md.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
@.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/JOINT_RELEASE_HANDOFF.md
around lines 157 - 159, Update the release-ownership wording in the planning
documents so it matches the handoff’s designation of REV-13C as the sole public
product release owner, or explicitly define REV-13 as its parent initiative.
Keep terminology consistent with README.md, docs/glossary.md, and
docs/architecture_lockdown.md, and ensure ownership is unambiguous.

Source: Coding guidelines

@coderabbitai coderabbitai 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.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/reviews/WS-CON-001-02A-preimplementation-plan-review.md (1)

120-131: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Keep the active migration lineage consistent with the shipped PR.

These review-plan passages still identify CON’s migration as 0028_shared_transactional_outbox, but the current lineage is 0028_artifact_admission0029_shared_transactional_outbox:

  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/reviews/WS-CON-001-02A-preimplementation-plan-review.md#L120-L131: update the implementation target or label it historical.
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/reviews/WS-CON-001-02A-preimplementation-plan-review.md#L355-L362: update the closing reconciliation or label it superseded evidence.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
@.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/reviews/WS-CON-001-02A-preimplementation-plan-review.md
around lines 120 - 131, Update the implementation target in
.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/reviews/WS-CON-001-02A-preimplementation-plan-review.md
lines 120-131 to use the active 0028_artifact_admission →
0029_shared_transactional_outbox lineage, or explicitly label the
0028_shared_transactional_outbox reference as historical. Apply the same update
or superseded-evidence label to the closing reconciliation at lines 355-362.
🧹 Nitpick comments (1)
backend/tests/test_alembic.py (1)

122-219: 🩺 Stability & Availability | 🔵 Trivial | 💤 Low value

Solid concurrency/schema contract test — schema/index/trigger assertions cross-checked cleanly against the migration.

One minor robustness note: the await asyncio.sleep(0.1) followed by assert not downgrade.done() (used inside _outbox_downgrade_writer_race, exercised here) is a fixed-timing assumption about how fast the downgrade thread reaches the LOCK TABLE ... ACCESS EXCLUSIVE statement. Under CI contention this could theoretically flake. A polling loop (e.g., poll pg_locks or retry with backoff) would be more robust than a fixed sleep, though the current approach is a common and generally acceptable pattern for this kind of test.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@backend/tests/test_alembic.py` around lines 122 - 219, Improve the
synchronization in _outbox_downgrade_writer_race by replacing the fixed
asyncio.sleep(0.1) and immediate downgrade.done() assertion with polling, such
as checking pg_locks or retrying with bounded backoff, until the downgrade
reaches the expected lock-wait state. Preserve the existing concurrency
assertions and ensure the test fails clearly if the state is not reached within
a timeout.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
@.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/AUTHORIZATION_HANDOFF.md:
- Around line 8-9: Prevent wrapped PR references from being parsed as Markdown
headings by keeping each PR reference inline with its preceding text or escaping
the leading hash. Update AUTHORIZATION_HANDOFF.md lines 8-9 to keep PR `#139`
inline, DECISIONS.md lines 225-226 to keep PR `#146` and PR `#153` inline, STATUS.md
line 55 to keep PR `#153` inline, and STATUS.md line 69 to keep PR `#156` inline.

In
@.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/INTENT.md:
- Around line 13-19: Update the active trusted-main baseline from 8d5eb15b to
3b1d6379 and refresh the merged-PR list in INTENT.md lines 13-19; update the
proposed-approach baseline in PLAN.md lines 5-10 and the authorization-boundary
baseline in PLAN.md lines 167-184. Keep all three sites aligned, or explicitly
mark them historical if they must retain the prior SHA.

---

Outside diff comments:
In
@.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/reviews/WS-CON-001-02A-preimplementation-plan-review.md:
- Around line 120-131: Update the implementation target in
.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/reviews/WS-CON-001-02A-preimplementation-plan-review.md
lines 120-131 to use the active 0028_artifact_admission →
0029_shared_transactional_outbox lineage, or explicitly label the
0028_shared_transactional_outbox reference as historical. Apply the same update
or superseded-evidence label to the closing reconciliation at lines 355-362.

---

Nitpick comments:
In `@backend/tests/test_alembic.py`:
- Around line 122-219: Improve the synchronization in
_outbox_downgrade_writer_race by replacing the fixed asyncio.sleep(0.1) and
immediate downgrade.done() assertion with polling, such as checking pg_locks or
retrying with bounded backoff, until the downgrade reaches the expected
lock-wait state. Preserve the existing concurrency assertions and ensure the
test fails clearly if the state is not reached within a timeout.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4a9de043-29dd-45b0-98b6-535a8b80a787

📥 Commits

Reviewing files that changed from the base of the PR and between 21b3b16 and 2fba5ba.

📒 Files selected for processing (24)
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/ACTIVE_DOC_INVENTORY.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/AUTHORIZATION_HANDOFF.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/CHUNK_MAP.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/CONFORMANCE_MATRIX.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/DECISIONS.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/DISCOVERY.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/INTENT.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/JOINT_RELEASE_HANDOFF.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/PLAN.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/RUNTIME_VERIFICATION.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/SOURCE_MANIFEST.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/STATUS.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/chunks/WS-CON-001-02A-shared-outbox-persistence.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/chunks/WS-CON-001-11-hidden-release-readiness.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/reviews/WS-CON-001-02A-external-review-response.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/reviews/WS-CON-001-02A-internal-review-evidence.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/reviews/WS-CON-001-02A-pr-trust-bundle.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/reviews/WS-CON-001-02A-preimplementation-plan-review.md
  • backend/alembic/versions/0029_shared_transactional_outbox.py
  • backend/app/modules/outbox/schemas.py
  • backend/tests/assertion_helpers.py
  • backend/tests/test_alembic.py
  • backend/tests/test_assertion_helpers.py
  • backend/tests/test_outbox.py
🚧 Files skipped from review as they are similar to previous changes (11)
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/JOINT_RELEASE_HANDOFF.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/SOURCE_MANIFEST.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/ACTIVE_DOC_INVENTORY.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/chunks/WS-CON-001-02A-shared-outbox-persistence.md
  • backend/tests/assertion_helpers.py
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/reviews/WS-CON-001-02A-internal-review-evidence.md
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/RUNTIME_VERIFICATION.md
  • backend/app/modules/outbox/schemas.py
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/DISCOVERY.md
  • backend/tests/test_outbox.py
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/CHUNK_MAP.md

Comment on lines +8 to +9
merged REV planning PR #128, AUTH-09A/AUTH PR #140, and the earlier WS-XINT PR
#139 boundary. The runtime catalogue contains 74 PermissionIds and 65 ActionIds:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Prevent wrapped PR references from becoming Markdown headings.

Leading references such as #139, #146, #153, and #156 are parsed as malformed ATX headings. Keep PR #<number> on the preceding line or escape the leading #.

🧰 Tools
🪛 markdownlint-cli2 (0.23.0)

[warning] 9-9: No space after hash on atx style heading

(MD018, no-missing-space-atx)

📍 Affects 3 files
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/AUTHORIZATION_HANDOFF.md#L8-L9 (this comment)
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/DECISIONS.md#L225-L226
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/STATUS.md#L55-L55
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/STATUS.md#L69-L69
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
@.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/AUTHORIZATION_HANDOFF.md
around lines 8 - 9, Prevent wrapped PR references from being parsed as Markdown
headings by keeping each PR reference inline with its preceding text or escaping
the leading hash. Update AUTHORIZATION_HANDOFF.md lines 8-9 to keep PR `#139`
inline, DECISIONS.md lines 225-226 to keep PR `#146` and PR `#153` inline, STATUS.md
line 55 to keep PR `#153` inline, and STATUS.md line 69 to keep PR `#156` inline.

Source: Linters/SAST tools

Comment on lines +13 to +19
current main `8d5eb15b`, including the contributor foundation in AUTH PR #153,
AUTH-09D-B PR #152, ART-02B1 PR #151, REV PLAN2 PR #150, AUTH-09D-A PR #148,
REV-02 PR #147, REV-01 PR #145, AUTH-09C PR #146, ART PR #141, AUTH-09B PR
#143, REV planning PR #128, AUTH PR #140, and the underlying WS-XINT-001
boundary from PR #139. PR #153 establishes canonical human `contributor_id`
lineage for TaskAssignment and Submission; it does not add CON authority,
service admission, review behavior, or outbox execution.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Keep all active trusted-main references on one baseline.

The active intent and plan still use 8d5eb15b, while the current trust bundle records 3b1d6379 after PR #156. Refresh or explicitly historical-label every affected site:

  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/INTENT.md#L13-L19: update the active SHA and merged-PR list.
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/PLAN.md#L5-L10: update the proposed-approach baseline.
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/PLAN.md#L167-L184: update the authorization-boundary baseline.
🧰 Tools
🪛 markdownlint-cli2 (0.23.0)

[warning] 16-16: No space after hash on atx style heading

(MD018, no-missing-space-atx)

📍 Affects 2 files
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/INTENT.md#L13-L19 (this comment)
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/PLAN.md#L5-L10
  • .agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/PLAN.md#L167-L184
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
@.agent-loop/initiatives/WS-CON-001-contribution-compensation-boundary/INTENT.md
around lines 13 - 19, Update the active trusted-main baseline from 8d5eb15b to
3b1d6379 and refresh the merged-PR list in INTENT.md lines 13-19; update the
proposed-approach baseline in PLAN.md lines 5-10 and the authorization-boundary
baseline in PLAN.md lines 167-184. Keep all three sites aligned, or explicitly
mark them historical if they must retain the prior SHA.

@abiorh-claw
abiorh-claw self-requested a review July 19, 2026 21:45
@abiorh-claw
abiorh-claw merged commit cb9d5f9 into main Jul 20, 2026
5 checks passed
@abiorh-claw
abiorh-claw deleted the codex/ws-con-001-02a-shared-outbox-persistence branch July 20, 2026 03:58
github-actions Bot pushed a commit that referenced this pull request Jul 20, 2026
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