Skip to content

WS-ARCH-001-02D: expose ART preparation public boundary - #322

Merged
abiorh-claw merged 27 commits into
mainfrom
codex/ws-arch-001-02d-art-preparation-public-api
Aug 12, 2026
Merged

WS-ARCH-001-02D: expose ART preparation public boundary#322
abiorh-claw merged 27 commits into
mainfrom
codex/ws-arch-001-02d-art-preparation-public-api

Conversation

@Abiorh001

@Abiorh001 Abiorh001 commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

Chunk

WS-ARCH-001-02D — ART hidden preparation public API migration.

Goal and approved intent

Make the complete hidden submission-bundle preparation command consume only AUTH, TASKS, PROJECTS, and CHECKERS public capabilities while preserving deny-only availability and exact ART custody. No action is activated by this PR.

What changed

  • Added the dependency-safe artifacts.api preparation request/result/error/command surface and moved the hidden route out of TASKS.
  • Composed owner capabilities through exact owner adapter roots and removed repaired private-edge debt.
  • Kept prepared authorization opaque, process-local, single-use, session/transaction/resource bound, with post-byte authority and lineage revalidation.
  • Centralized bounded checker-result validation under the CHECKERS public API; ART retains custody facts.
  • Narrowed the CI composition exemption to exact same-owner adapter init.py roots; nested and cross-owner private imports remain blocked.
  • Updated canonical architecture/artifact docs, initiative state, resource manifest, and test-structure evidence.

Scope and product behavior

The route remains hidden and artifact.submission_bundle.prepare remains planned/unavailable. This PR creates no Submission, activates no action, performs no successful production materialization, and adds no migration, provider semantic change, compatibility path, or serialized handle.

Acceptance proof

  • Preflight precedes packet semantics and byte reads; denial reads zero bytes.
  • Final authority remains inside the durable transaction before capacity, put attempt, or provider I/O.
  • Post-byte authority denial precedes TASK/PROJECT relock.
  • TASK predecessor ID/version and PROJECT policy lineage are re-locked before evidence persistence.
  • Stale TASK relock produces no evidence persistence and no pass capability.
  • Public CHECKER facts exclude ART custody and unbounded metadata.

Tests and checks

  • Ruff: passed.
  • Module-boundary and test-structure gates: passed; no new debt key.
  • Focused architecture/ART/admission/effective/relock/AUTH tests: 98 passed.
  • Additional non-DB default pre-submit tests: 24 passed, 1 DB-backed test deselected locally.
  • Stale authorization wording, stale artifact contract, Markdown links, and diff checks: passed.
  • Full Postgres/MinIO suite and coverage are delegated to GitHub Backend lanes.

Test delta and CI integrity

No test or coverage gate was weakened, skipped, or removed. New regressions cover concealment before semantics, post-byte AUTH ordering, predecessor-version advancement, stale relock zero effects, conflict mapping, and exact adapter-root enforcement. CI integrity passed after unchanged debt was restored and the exception narrowed.

Internal reviewer results

Architecture, security/auth, product/ops, QA, senior engineering, CI integrity, docs, reuse/dedup, and test-delta reviews all passed after their valid findings were fixed.

Remaining risks and follow-up

The CHECKER adapter retains a temporary broadly typed bridge and existing CHECKER-to-ART executor debt; WS-ARCH-001-04 owns that split. WS-ARCH-001-02E is next but is not started here.

Human review focus

Review authorization ordering, exact resource/lineage binding, the owner-adapter-root exception, and proof that production availability remains deny-only.

Human merge ownership

This PR must not be merged without the repository owners explicit approval.

Summary by CodeRabbit

  • New Features

    • Added a dedicated submission-bundle preparation API with validation, replay handling, bounded status responses, and clear error outcomes.
    • Improved pre-submission processing with stronger task, project, authorization, evidence, and checker validation.
    • Added safeguards against stale context, invalid metadata, mismatched evidence, and unauthorized submissions.
  • Bug Fixes

    • Corrected submission preparation routing and dependency handling.
    • Preserved deny-only behavior when required services are unavailable.
  • Documentation

    • Updated architecture and operational guidance for module boundaries and adapter composition.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@Abiorh001, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 21 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1418f172-16bb-4c48-b293-9f1522e9c60b

📥 Commits

Reviewing files that changed from the base of the PR and between c04935b and bfe0ea3.

📒 Files selected for processing (3)
  • backend/app/modules/checkers/pre_submit_execution.py
  • backend/tests/test_effective_pre_submit_execution.py
  • backend/tests/test_submission_bundle_admission.py

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 1cbb5077-0f7e-4e53-b26f-4b5d03ba36d9

📥 Commits

Reviewing files that changed from the base of the PR and between 54c3d64 and c04935b.

📒 Files selected for processing (3)
  • .agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/TEST_STRUCTURE_DEBT.json
  • backend/tests/test_default_pre_submit_execution.py
  • backend/tests/test_submission_bundle_admission.py
🚧 Files skipped from review as they are similar to previous changes (3)
  • .agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/TEST_STRUCTURE_DEBT.json
  • backend/tests/test_default_pre_submit_execution.py
  • backend/tests/test_submission_bundle_admission.py

📝 Walkthrough

Walkthrough

The change completes the ART submission-preparation boundary. It adds public preparation contracts, moves the hidden route, wires TASK, PROJECT, and CHECKER adapters, narrows authorization handles, validates execution facts, relocks evidence context, and updates boundary tracking.

Changes

ART submission preparation boundary

Layer / File(s) Summary
Boundary rules and tracking
.agent-loop/..., backend/scripts/*, backend/tests/architecture/*, docs/*
Same-owner adapter roots may construct typed public ports. Nested and cross-owner private imports remain restricted. Boundary ledgers, ownership partitions, initiative records, and tests are updated.
Public contracts and delivery wiring
backend/app/modules/artifacts/api/*, backend/app/api/*, backend/app/adapters/*, backend/app/interfaces/artifact_operations.py
Submission preparation uses a dedicated public command, request, result, status, and bounded errors. The hidden route is registered under /api/v1. Legacy artifact operation contracts are removed.
Admission, materialization, and evidence flow
backend/app/modules/artifacts/*, backend/app/modules/checkers/*
Admission consumes public TASK, PROJECT, CHECKER, and AUTH contracts. Materialization returns custody and checker facts. Evidence relocks context and validates lineage, plans, execution data, and result schemas before persistence.
Migration validation and regression coverage
backend/tests/*, .agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/TEST_STRUCTURE_DEBT.json
Tests migrate to the new contracts and cover ordering, replay, denial, context drift, checker validation, cleanup, and evidence persistence.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Client
  participant ArtifactSubmissionsRoute
  participant SubmissionBundlePreparationCommand
  participant TaskAndProjectContexts
  participant CheckerExecutionAdapter
  participant PreSubmitEvidenceService

  Client->>ArtifactSubmissionsRoute: Submit streamed bundle and metadata
  ArtifactSubmissionsRoute->>SubmissionBundlePreparationCommand: prepare(SubmissionBundlePreparationRequest)
  SubmissionBundlePreparationCommand->>TaskAndProjectContexts: Lock task and project facts
  SubmissionBundlePreparationCommand->>CheckerExecutionAdapter: Build checker processor
  CheckerExecutionAdapter-->>SubmissionBundlePreparationCommand: PreSubmissionExecutionFacts
  SubmissionBundlePreparationCommand->>PreSubmitEvidenceService: Relock context and persist evidence
  PreSubmitEvidenceService-->>SubmissionBundlePreparationCommand: Admission and replay result
  SubmissionBundlePreparationCommand-->>ArtifactSubmissionsRoute: SubmissionBundlePreparationResult
  ArtifactSubmissionsRoute-->>Client: HTTP 202 response
Loading

Possibly related PRs

Suggested reviewers: abiorh-claw

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 42.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
Title check ✅ Passed The title clearly and concisely identifies the primary change: exposing the ART preparation public boundary.
Description check ✅ Passed The description explains the goal, changes, behavior limits, evidence, tests, risks, follow-up work, and human review focus.
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.
✨ Finishing Touches 💡 1
📝 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-arch-001-02d-art-preparation-public-api

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.

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

🧹 Nitpick comments (7)
backend/app/adapters/checkers/__init__.py (1)

18-26: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider typing the adapter surface instead of Any.

_ExecutionRequest declares every field as Any, and archive_inspector is Any. The adapter then forwards these values into DefaultPreSubmissionExecutionInput, so a field-type mismatch is only detected at runtime. The concrete types already exist in app.modules.checkers.api (EffectivePreSubmissionExecutionPlan, SubmissionPacketView) and in the ART request type. Typing the protocol members restores static checking at the composition root without changing behavior.

Also applies to: 50-52

🤖 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/app/adapters/checkers/__init__.py` around lines 18 - 26, The
_ExecutionRequest protocol and archive_inspector adapter surface are overly
broad; replace their Any annotations with the existing concrete types from
app.modules.checkers.api and the ART request type, including the appropriate
types for each forwarded field and storage_scheme. Preserve the existing
DefaultPreSubmissionExecutionInput composition and runtime behavior while
enabling static type checking.
backend/tests/test_effective_pre_submit_execution.py (1)

96-125: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add the remaining validate_predecessor_lineage branches.

This test covers only the version-mismatch branch. The helper has two other rejection paths that are now public API and are untested here:

  • Presence mismatch: task_context.predecessor is set but predecessor_submission_id is None, and the reverse.
  • Identifier mismatch: predecessor.submission_id differs from predecessor_submission_id.

A passing case with a matching id and version is also worth asserting, because the helper must not raise on the normal path.

The coding guidelines require at least 90% test coverage for new or materially changed backend subsystems, and this helper is part of the new ART preparation boundary. As per coding guidelines: "New or materially changed backend subsystems must maintain at least 90% test coverage".

🤖 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_effective_pre_submit_execution.py` around lines 96 - 125,
Expand test_post_byte_relock_rejects_advanced_predecessor_version with cases for
both predecessor presence mismatches and an identifier mismatch, asserting each
raises PreSubmitEvidenceConflict with the appropriate reason. Add a matching
predecessor ID/version case that completes without raising, covering all
validate_predecessor_lineage branches.

Source: Coding guidelines

backend/tests/test_pre_submit_evidence_relock.py (1)

26-38: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add the project-context drift case.

PreSubmitEvidenceService.persist catches TaskSubmissionContextUnavailable and ProjectLockedPolicyContextUnavailable in one except clause and maps both to pre_submit_locked_context_changed. This test exercises only the task-side failure. Add a second test where lock_submission_context succeeds and lock_locked_policy_context raises ProjectLockedPolicyContextUnavailable. Assert the same conflict, that _repository.persist is not awaited, and that _live_pass_bindings stays empty.

That case also covers the PROJECT half of the relock guard, which the file name claims to prove.

The coding guidelines require at least 90% test coverage for new or materially changed backend subsystems. As per coding guidelines: "New or materially changed backend subsystems must maintain at least 90% test coverage".

Also applies to: 60-69

🤖 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_pre_submit_evidence_relock.py` around lines 26 - 38, Add a
second test alongside the existing task-context failure test for
PreSubmitEvidenceService.persist, making lock_submission_context succeed and
lock_locked_policy_context raise ProjectLockedPolicyContextUnavailable. Assert
the same pre_submit_locked_context_changed conflict, verify _repository.persist
is not awaited, and confirm _live_pass_bindings remains empty; ensure the added
coverage contributes to the required 90% coverage for the relock guard.

Source: Coding guidelines

backend/app/modules/artifacts/pre_submit_evidence.py (1)

430-439: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Remove unused context ports from _PreSubmitEvidenceRepository. The repository stores _task_contexts and _project_contexts but never reads them. Remove these constructor parameters and the corresponding arguments at the service call site.

🤖 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/app/modules/artifacts/pre_submit_evidence.py` around lines 430 - 439,
Remove the unused task_contexts and project_contexts parameters and assignments
from _PreSubmitEvidenceRepository.__init__. Update the repository construction
call site to stop passing those arguments, while preserving the session
dependency and all other behavior.
.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/chunks/WS-ARCH-001-02D-art-preparation-public-api.md (1)

69-71: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Remove the duplicate allowed-file entry.

.agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/TEST_STRUCTURE_DEBT.json appears twice in the allowed-file list. Keep one entry so exact chunk scope remains unambiguous.

Remove the duplicate path
 .ci/behavior-ownership/**
 .agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/TEST_STRUCTURE_DEBT.json
-.agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/TEST_STRUCTURE_DEBT.json
 .agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/chunks/WS-ARCH-001-02D-art-preparation-public-api.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-ARCH-001-modular-monolith-boundaries/chunks/WS-ARCH-001-02D-art-preparation-public-api.md
around lines 69 - 71, Remove the duplicate
`.agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/TEST_STRUCTURE_DEBT.json`
entry from the allowed-file list, keeping exactly one occurrence alongside the
existing `.ci/behavior-ownership/**` entry.
.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/CHUNK_MAP.md (1)

11-12: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use ART-specific lifecycle state names.

The State column uses Complete; production remains deny-only and Next durable boundary. Use explicit values such as ART-02D hidden-preparation boundary complete; production deny-only and ART-02E ready-admission boundary next. This prevents confusion between planning state and product activation.

As per coding guidelines, use subsystem- or actor-specific names for workflow states and lifecycle names instead of vague labels.

Proposed state labels
-| `WS-ARCH-001-02D` | ART hidden preparation public API and private-edge migration | L1 | Complete; production remains deny-only |
-| `WS-ARCH-001-02E` | ART ready-admission consumption and binding public capability | L1 | Next durable boundary |
+| `WS-ARCH-001-02D` | ART hidden preparation public API and private-edge migration | L1 | ART-02D hidden-preparation boundary complete; production deny-only |
+| `WS-ARCH-001-02E` | ART ready-admission consumption and binding public capability | L1 | ART-02E ready-admission boundary next |
🤖 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-ARCH-001-modular-monolith-boundaries/CHUNK_MAP.md
around lines 11 - 12, Update the State entries for WS-ARCH-001-02D and
WS-ARCH-001-02E in the chunk map to use explicit ART-specific lifecycle names:
identify 02D as the hidden-preparation boundary being complete while production
remains deny-only, and 02E as the ready-admission boundary being next. Replace
the vague existing labels without changing the milestone descriptions or
ordering.

Source: Coding guidelines

backend/tests/architecture/test_module_boundaries.py (1)

111-130: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Add a nested-adapter negative case.

The test covers backend/app/adapters/tasks/worker.py, but not backend/app/adapters/tasks/nested/__init__.py. The scanner grants the exception only when the adapter path has exactly two components after backend/app/adapters/. Add the nested __init__.py fixture and assert that its same-owner private dependency remains visible.

🤖 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/architecture/test_module_boundaries.py` around lines 111 - 130,
The test test_non_root_adapter_keeps_same_owner_private_debt_visible currently
covers only a two-component adapter path. Add a nested
backend/app/adapters/tasks/nested/__init__.py fixture importing TaskRepository,
then include the corresponding boundary.PrivateEdge in the private assertion so
same-owner private debt remains visible for nested adapters.
🤖 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 `@backend/app/adapters/checkers/__init__.py`:
- Around line 38-44: Update process_blocking to catch the private base execution
error, DefaultPreSubmissionExecutionError, rather than only
PreSubmissionInfrastructureUnavailable, and translate it to the public
PreSubmissionInfrastructureUnavailableError while preserving exception chaining.

In `@backend/app/modules/artifacts/api/submission_preparation.py`:
- Around line 39-45: Replace the generic status: str field in
SubmissionBundlePreparationResult with an ART-specific
submission_bundle_preparation_status field backed by a closed type enumerating
the permitted preparation states. Update all construction and consumption sites,
including the route response, to use the renamed field and type, and revise the
corresponding API documentation to expose the ART-specific enum contract.

In `@backend/app/modules/artifacts/pre_submit_evidence.py`:
- Around line 318-319: The exception handler in _validate_execution should
preserve the original PreSubmissionInfrastructureUnavailableError by chaining it
when raising PreSubmitEvidenceConflict. Bind the caught exception and use
explicit exception chaining, matching the existing chained error handling in
_validate_execution and persist.

In `@backend/app/modules/artifacts/submission_materialization.py`:
- Around line 77-84: Update the PreSubmitCheckerProcessor protocol to expose an
awaitable processor operation instead of process_blocking, and revise its
documentation to describe asynchronous CHECKER execution. Keep any synchronous
or blocking work encapsulated within the CHECKER adapter rather than the ART
boundary.

In `@backend/scripts/module_boundaries.py`:
- Around line 125-133: Align module_boundaries.scan() with
authorization_boundary.scan_edges() for exact adapter composition roots
identified by _source_owner_adapter, including imports from
backend/app/adapters/authorization/__init__.py. Add a fixture covering that
import and update the boundary-scanning logic so both scanners return identical
edge sets without changing unrelated adapter paths.

In `@docs/spec_artifact_storage_service.md`:
- Around line 388-392: Update the description of
PreparedBundleMaterializationRequest to include its effective plan, inspection,
manifest, change gate, and packet alongside the existing fields, or remove the
exclusive “only” wording. Preserve the statements that the request is internal,
process-local, opaque, and prohibited from crossing public boundaries.

---

Nitpick comments:
In
@.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/CHUNK_MAP.md:
- Around line 11-12: Update the State entries for WS-ARCH-001-02D and
WS-ARCH-001-02E in the chunk map to use explicit ART-specific lifecycle names:
identify 02D as the hidden-preparation boundary being complete while production
remains deny-only, and 02E as the ready-admission boundary being next. Replace
the vague existing labels without changing the milestone descriptions or
ordering.

In
@.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/chunks/WS-ARCH-001-02D-art-preparation-public-api.md:
- Around line 69-71: Remove the duplicate
`.agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/TEST_STRUCTURE_DEBT.json`
entry from the allowed-file list, keeping exactly one occurrence alongside the
existing `.ci/behavior-ownership/**` entry.

In `@backend/app/adapters/checkers/__init__.py`:
- Around line 18-26: The _ExecutionRequest protocol and archive_inspector
adapter surface are overly broad; replace their Any annotations with the
existing concrete types from app.modules.checkers.api and the ART request type,
including the appropriate types for each forwarded field and storage_scheme.
Preserve the existing DefaultPreSubmissionExecutionInput composition and runtime
behavior while enabling static type checking.

In `@backend/app/modules/artifacts/pre_submit_evidence.py`:
- Around line 430-439: Remove the unused task_contexts and project_contexts
parameters and assignments from _PreSubmitEvidenceRepository.__init__. Update
the repository construction call site to stop passing those arguments, while
preserving the session dependency and all other behavior.

In `@backend/tests/architecture/test_module_boundaries.py`:
- Around line 111-130: The test
test_non_root_adapter_keeps_same_owner_private_debt_visible currently covers
only a two-component adapter path. Add a nested
backend/app/adapters/tasks/nested/__init__.py fixture importing TaskRepository,
then include the corresponding boundary.PrivateEdge in the private assertion so
same-owner private debt remains visible for nested adapters.

In `@backend/tests/test_effective_pre_submit_execution.py`:
- Around line 96-125: Expand
test_post_byte_relock_rejects_advanced_predecessor_version with cases for both
predecessor presence mismatches and an identifier mismatch, asserting each
raises PreSubmitEvidenceConflict with the appropriate reason. Add a matching
predecessor ID/version case that completes without raising, covering all
validate_predecessor_lineage branches.

In `@backend/tests/test_pre_submit_evidence_relock.py`:
- Around line 26-38: Add a second test alongside the existing task-context
failure test for PreSubmitEvidenceService.persist, making
lock_submission_context succeed and lock_locked_policy_context raise
ProjectLockedPolicyContextUnavailable. Assert the same
pre_submit_locked_context_changed conflict, verify _repository.persist is not
awaited, and confirm _live_pass_bindings remains empty; ensure the added
coverage contributes to the required 90% coverage for the relock guard.
🪄 Autofix

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: e76a56a6-0f72-453e-a8d5-2827c43087a8

📥 Commits

Reviewing files that changed from the base of the PR and between ab7ce68 and e6aa3ab.

📒 Files selected for processing (43)
  • .agent-loop/CURRENT_STATE.md
  • .agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/CHUNK_MAP.md
  • .agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/INTENT.md
  • .agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/PLAN.md
  • .agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/STATUS.md
  • .agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/chunks/WS-ARCH-001-02D-art-preparation-public-api.md
  • .agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/evidence/WS-ARCH-001-02D-resource-manifest.md
  • .agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/IMPORT_LEDGER.md
  • .agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/TEST_STRUCTURE_DEBT.json
  • .agent-loop/policies/architecture-boundaries.md
  • .ci/module-boundaries/private-edge-debt.v1.json
  • backend/app/adapters/README.md
  • backend/app/adapters/artifacts/__init__.py
  • backend/app/adapters/checkers/__init__.py
  • backend/app/adapters/projects/__init__.py
  • backend/app/adapters/tasks/__init__.py
  • backend/app/api/deps/authorization.py
  • backend/app/api/router.py
  • backend/app/api/routes/artifact_submissions.py
  • backend/app/interfaces/artifact_operations.py
  • backend/app/modules/artifacts/api/__init__.py
  • backend/app/modules/artifacts/api/submission_preparation.py
  • backend/app/modules/artifacts/authorization.py
  • backend/app/modules/artifacts/pre_submit_evidence.py
  • backend/app/modules/artifacts/submission_admission.py
  • backend/app/modules/artifacts/submission_authorization.py
  • backend/app/modules/artifacts/submission_materialization.py
  • backend/app/modules/checkers/api/__init__.py
  • backend/app/modules/checkers/api/pre_submit.py
  • backend/app/modules/checkers/pre_submit_execution.py
  • backend/app/modules/tasks/router.py
  • backend/scripts/module_boundaries.py
  • backend/tests/architecture/test_module_boundaries.py
  • backend/tests/pre_submit_test_helpers.py
  • backend/tests/test_artifact_architecture.py
  • backend/tests/test_authorization.py
  • backend/tests/test_default_pre_submit_execution.py
  • backend/tests/test_effective_pre_submit_execution.py
  • backend/tests/test_pre_submit_evidence_relock.py
  • backend/tests/test_submission_bundle_admission.py
  • docs/architecture_lockdown.md
  • docs/operations_backend_testing.md
  • docs/spec_artifact_storage_service.md
💤 Files with no reviewable changes (4)
  • .ci/module-boundaries/private-edge-debt.v1.json
  • backend/tests/test_authorization.py
  • .agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/IMPORT_LEDGER.md
  • backend/app/interfaces/artifact_operations.py

Comment thread backend/app/adapters/checkers/__init__.py Outdated
Comment thread backend/app/modules/artifacts/api/submission_preparation.py
Comment thread backend/app/modules/artifacts/pre_submit_evidence.py Outdated
Comment thread backend/app/modules/artifacts/submission_materialization.py
Comment thread backend/scripts/module_boundaries.py
Comment thread docs/spec_artifact_storage_service.md

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

🤖 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 `@backend/app/modules/checkers/pre_submit_execution.py`:
- Around line 589-599: Validate result.metadata entries before the metadata_keys
comprehension in the PreSubmissionResult validation block: require a tuple
containing exactly two-item tuples whose keys are str and values are int,
rejecting malformed entries through the existing
PreSubmissionInfrastructureUnavailable path. Only derive metadata_keys and
perform duplicate/allowed-key checks after structural validation, while
preserving the existing non-negative value validation.
🪄 Autofix

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: 38c6c9dc-0893-400b-819a-6bf70c846598

📥 Commits

Reviewing files that changed from the base of the PR and between e6aa3ab and 54c3d64.

📒 Files selected for processing (22)
  • .agent-loop/CURRENT_STATE.md
  • .agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/chunks/WS-ARCH-001-02D-art-preparation-public-api.md
  • .agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/TEST_STRUCTURE_DEBT.json
  • .ci/behavior-ownership/partition.v1.json
  • backend/app/adapters/checkers/__init__.py
  • backend/app/api/routes/artifact_submissions.py
  • backend/app/modules/artifacts/api/__init__.py
  • backend/app/modules/artifacts/api/submission_preparation.py
  • backend/app/modules/artifacts/pre_submit_evidence.py
  • backend/app/modules/artifacts/preparation.py
  • backend/app/modules/artifacts/submission_admission.py
  • backend/app/modules/artifacts/submission_materialization.py
  • backend/app/modules/checkers/pre_submit_execution.py
  • backend/scripts/behavior_ownership.py
  • backend/scripts/module_boundaries.py
  • backend/scripts/run_test_lanes.py
  • backend/tests/architecture/test_module_boundaries.py
  • backend/tests/test_behavior_ownership.py
  • backend/tests/test_default_pre_submit_execution.py
  • backend/tests/test_effective_pre_submit_execution.py
  • backend/tests/test_submission_bundle_admission.py
  • docs/spec_artifact_storage_service.md
🚧 Files skipped from review as they are similar to previous changes (13)
  • backend/app/modules/artifacts/api/init.py
  • backend/scripts/module_boundaries.py
  • backend/tests/architecture/test_module_boundaries.py
  • .agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/TEST_STRUCTURE_DEBT.json
  • .agent-loop/CURRENT_STATE.md
  • docs/spec_artifact_storage_service.md
  • backend/tests/test_effective_pre_submit_execution.py
  • .agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/chunks/WS-ARCH-001-02D-art-preparation-public-api.md
  • backend/app/adapters/checkers/init.py
  • backend/tests/test_submission_bundle_admission.py
  • backend/tests/test_default_pre_submit_execution.py
  • backend/app/modules/artifacts/pre_submit_evidence.py
  • backend/app/modules/artifacts/submission_admission.py

Comment thread backend/app/modules/checkers/pre_submit_execution.py Outdated
@abiorh-claw
abiorh-claw self-requested a review August 12, 2026 05:21
@abiorh-claw
abiorh-claw merged commit 1350dac into main Aug 12, 2026
11 checks passed
@abiorh-claw
abiorh-claw deleted the codex/ws-arch-001-02d-art-preparation-public-api branch August 12, 2026 07:01
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