Skip to content

ARCH-04E1B-B2: prepare exact post-submit routing sources - #479

Merged
abiorh-claw merged 4 commits into
mainfrom
codex/arch04e1b-routing-handlers
Oct 6, 2026
Merged

abiorh-claw merged 4 commits into
mainfrom
codex/arch04e1b-routing-handlers

Conversation

@Abiorh001

@Abiorh001 Abiorh001 commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Change

TASK can now prepare an exact post-submit routing source from the existing routing reservation, current CHECKERS completion/material custody and historical PROJECTS policy. This replaces the completion port's version-only return and updates its callers. Proposed source facts have no fabricated creation timestamp; persisted manifest facts retain their database-owned timestamp.

This is ARCH-04E1B-B2, a bounded prerequisite within the existing hidden-handler work. It inserts only the existing routing request reservation. It does not publish a manifest/current pointer, issue authority, change TASK status, create REV/CON effects or register a live handler. No compatibility path or migration is added.

Intent, scope and proof.

Design Chosen

  • Caller root transaction; exact TASK/Assignment/Submission locks, historical PROJECTS context, then CHECKERS currentness custody.
  • Complete policy stamps, contributor/contribution lineage and ART material match the retained Submission. Replay recovers the original reservation; caller rollback owns all staged work.
  • True and false remain distinct policy branches. Later false composition must acquire the shared lifecycle fence before TASK; this source preparer grants no authority to invert that order.
  • The existing ART test fixture creates an assignment directly and hidden intake leaves TASK in_progress. New tests explicitly seed the accepted timestamp and future evaluation_pending precondition after proving those absences deny. They prove mechanical source preparation, not live claim/dispatch or false-policy activation.

Evidence

Current head: 778ab120b33d0a4351b897b4d5e10565729cc4d7, reconciled with main 43afa414. Main's CLI-05 and this PR's ARCH-B2 navigation are both preserved; the reported trailing whitespace is removed. Backend code/tests are byte-identical to reviewed 33d7fcf5. Documentation/product-operations reconciliation review passed on 778ab120; links, all stale-wording scans, Commitrail and git diff --check passed.

Fresh Backend run passed on identical merge tree 98268b33f1b237017e993dcf3b07c42cbc2f7a7a: 8,652 unique completed tests, zero skips/deselections, all nine lane exits zero and cleanup confirmed. Task lifecycle B initially reached the unchanged 1,200s limit; its same-head rerun passed in 1,169.804s. The aggregate selects that complete second attempt and the eight successful first attempts, excluding the interrupted one. No timeout or test selection changed. The independent canonical validator passed (test lane evidence valid). CI integrity review passed on this exact head, including attempt selection, complete inventory, artifact hashes and cleanup.

Earlier runtime and internal code-review evidence remains attributed to 33d7fcf5 or its stated producer below:

  • Five exact-head PostgreSQL source tests passed in 620.36s, including a genuine admitted/evaluated version-2 predecessor, independent task-state/claim-timestamp denials, eligible sibling controls, full-value matching, history, replay/rollback and retained locks. Alembic0020 and database cleanup confirmed.
  • 25 expanded PostgreSQL checks passed in 1,297.32s at 700f89aa. The transaction, project-isolation and intermediate currentness paths are unchanged at current head; their execution remains attributed to that earlier commit. The changed source tests were rerun as the five exact-head cases above.
  • Architecture, reuse, QA, test-delta, documentation and product/operations: PASS. Security: PASS WITH LOW RISKS limited to hidden preparation and true-policy runtime proof; false remains value transport only. Guard-removal discrimination was assessed by source/control inspection, not a claimed mutation execution.
  • Hosted Backend run: 8,652 unique completed tests, zero skips/deselections, all nine lanes passed with database cleanup confirmed. Artifact merge 4aa53513 and candidate share tree 77e55ce5d7780b1686017f26e12daa22bdfc3454. Slowest lane 1,116.587s under the unchanged 1,200s cap; the lower diagnostic timing target remains advisory. The superseded candidate run was cancelled.
  • 293 boundary/contract/ownership/lane checks passed; exact new-file ownership registration was then verified by three focused checks. No inventory assertion was weakened.
  • Ruff, stale wording, Markdown links and Commitrail checks passed.
  • Roadmap and current ARCH navigation describe the bounded merged outcome. Remaining handlers, mandatory AUTH/database/audit/outbox closure, live composition and remediation stay deferred. No local spreadsheet exports are present.

Test Delta

New PostgreSQL source-preparation tests cover full stored facts, valid sibling substitution, independent state/accepted-timestamp requirements, historical policies, replay/rollback, retained locks and genuine version-2 predecessor lineage. Existing root-transaction, project isolation and currentness tests now cover the richer completion contract. Both review-policy boolean values retain strict proposal shapes. No tests removed or skipped.

CI And Gate Integrity

No workflows, caps, lint gates, inventory assertions or package scripts weakened. Exact new-file behavior ownership and lane registration are added; scope and boundary guards remain enforced. Coverage is diagnostic only.

External Review

Human review at 33d7fcf5 found no correctness defect and ruled out the suspected deadlock on PostgreSQL (42 focused tests). Both reported documentation/merge corrections are fixed at 778ab120. CodeRabbit completed a fresh substantive review of all 26 changed files at 778ab120, with no actionable comments. Prior CodeRabbit results were rate-limited and remain historical. Fresh hosted CI passed after the same-head rerun; eligible human approval is required for the changed head.

Remaining Risks And Follow-Up Work

This prepares exact facts only. Remaining hidden handlers, mandatory AUTH/database/audit/outbox closure, live composition and remediation are not delivered here. Future false-policy composition must acquire the shared lifecycle fence before TASK. The test's seeded state is not proof of live dispatch or automated acceptance.

Human Review Focus

Check complete historical policy/material matching, TASK-before-CHECKERS custody, and that the proposal cannot be mistaken for published authority. Intent, alternatives, allowed files and acceptance criteria are in the linked bounded change record; no files outside its allowed scope.

Human Merge Ownership

Human review and explicit merge authorization remain required. No merge performed.

@coderabbitai

coderabbitai Bot commented Oct 6, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2e792db3-9ceb-42db-a7e2-1bfd186c1dee
📥 Commits

Reviewing files that changed from the base of the PR and between 43afa41 and 778ab12.

📒 Files selected for processing (26)
  • .ci/behavior-ownership/partition.v1.json
  • .commitrail/INDEX.md
  • .commitrail/initiatives/WS-ARCH-001/OVERVIEW.md
  • .commitrail/initiatives/WS-ARCH-001/WS-ARCH-001-04E1BB2.md
  • .commitrail/initiatives/WS-ARCH-001/planning/CHUNK_MAP.md
  • .commitrail/initiatives/WS-ARCH-001/planning/PLAN.md
  • .commitrail/initiatives/WS-ARCH-001/planning/chunks/WS-ARCH-001-04E-canonical-allow-review.md
  • README.md
  • backend/app/adapters/tasks/__init__.py
  • backend/app/modules/checkers/api/execution.py
  • backend/app/modules/checkers/execution_coordination.py
  • backend/app/modules/tasks/api/__init__.py
  • backend/app/modules/tasks/api/post_submit_routing.py
  • backend/app/modules/tasks/post_submit_routing/requests.py
  • backend/app/modules/tasks/post_submit_routing/source.py
  • backend/scripts/behavior_ownership.py
  • backend/scripts/test_lane_catalogue.py
  • backend/tests/tasks/post_submit_routing/support.py
  • backend/tests/tasks/post_submit_routing/test_contracts.py
  • backend/tests/tasks/post_submit_routing/test_requests.py
  • backend/tests/tasks/post_submit_routing/test_review_admission_currentness.py
  • backend/tests/tasks/post_submit_routing/test_source_preparation.py
  • backend/tests/test_behavior_ownership.py
  • backend/tests/test_ci_lane_catalogue.py
  • docs/roadmap_status.md
  • docs/spec_chunk_4_task_queue_assignment.md

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The change adds verified completion facts and prepares detached routing-source proposals from task, submission, and historical policy data. Preparation stages the existing routing request. It does not insert a source or grant authority.

Changes

Post-submit routing source preparation

Layer / File(s) Summary
Verified completion and routing contracts
backend/app/modules/checkers/..., backend/app/modules/tasks/api/*, backend/app/modules/tasks/post_submit_routing/requests.py, backend/tests/tasks/post_submit_routing/test_contracts.py, backend/tests/tasks/post_submit_routing/test_requests.py, backend/tests/tasks/post_submit_routing/test_review_admission_currentness.py, docs/spec_chunk_4_task_queue_assignment.md
CHECKERS returns the completion, submission version, and verified material. TASK adds proposal and preparation models, validates transaction ownership, and stages request facts with the verified completion.
Source preparation and validation
backend/app/modules/tasks/post_submit_routing/source.py, backend/app/adapters/tasks/__init__.py, backend/tests/tasks/post_submit_routing/*, backend/tests/test_behavior_ownership.py, backend/tests/test_ci_lane_catalogue.py, backend/scripts/*, .ci/behavior-ownership/partition.v1.json, .commitrail/*, README.md, docs/roadmap_status.md, docs/spec_chunk_4_task_queue_assignment.md
The preparer checks task, assignment, submission, and policy lineage, then stages the existing request and returns a detached proposal. Tests cover eligibility, identity matching, custody, replay, rollback, and successor submissions. Project records and ownership registrations describe or include this preparation work; they also state that publication, authority, and handler work remain outstanding.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Preparer as TaskRoutingSourcePreparer
  participant Checkers as EvaluationCoordinationPort
  participant TaskDB as TASK database
  participant Projects as ProjectLockedPolicyContextPort
  participant Staging as routing request staging
  Preparer->>Checkers: verify current completion and material
  Preparer->>TaskDB: lock task, assignment, and submission
  Preparer->>Projects: read locked historical policy context
  Preparer->>Staging: stage existing request and verify identifiers
  Staging-->>Preparer: request facts and verified completion
  Preparer-->>Preparer: build detached source proposal
Loading

Merge Risk: ⚪ Minimal · up to 778ab

No actionable merge-blocking issue remains in the reviewed change; it is ready for normal merge checks.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 47.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 40 functions across 16 files. (10 skipped… 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 clearly and concisely identifies the main change: preparing exact post-submit routing sources.
Description check ✅ Passed The description explains the intent, design, scope limits, evidence, test changes, CI integrity, remaining risks, and human review requirements. Some template headings and structured sections are omit…
Full details: Docstring Coverage

Explanation

Docstring coverage is 47.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 40 functions across 16 files. (10 skipped: 10 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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
Abiorh001 marked this pull request as ready for review October 6, 2026 03:44
@abiorh-claw
abiorh-claw self-requested a review October 6, 2026 07:51
@abiorh-claw
abiorh-claw merged commit c7f91ac into main Oct 6, 2026
28 of 30 checks passed
@abiorh-claw
abiorh-claw deleted the codex/arch04e1b-routing-handlers branch October 6, 2026 08:07
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