Skip to content

WS-ARCH-001-02C: expose CHECKER pre-submit public API - #320

Merged
abiorh-claw merged 8 commits into
mainfrom
codex/ws-arch-001-02c-checker-pre-submit-api
Aug 11, 2026
Merged

WS-ARCH-001-02C: expose CHECKER pre-submit public API#320
abiorh-claw merged 8 commits into
mainfrom
codex/ws-arch-001-02c-checker-pre-submit-api

Conversation

@Abiorh001

@Abiorh001 Abiorh001 commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Chunk

WS-ARCH-001-02C — CHECKER Pre-Submit Public API

Goal

Expose dependency-safe CHECKER planning and bounded execution-result contracts so later ART preparation work can stop importing CHECKER internals.

Human-approved intent

Repair modular-monolith boundaries incrementally while continuing the existing product path. Use the canonical ARCH numbering, one active implementation worktree, and no broad rewrite.

What changed

  • Added app.modules.checkers.api with immutable plan lineage, plan, entry, packet, bounded result, error, and planning-port contracts.
  • Made the existing PreSubmissionCheckerCatalogue implement the public planning port while retaining the sole existing compiler.
  • Moved plan contract definitions out of the private compiler; no compatibility copy or second compiler was created.
  • Migrated the touched TASK and ART admission imports to app.modules.checkers.api.
  • Added a bounded execution projection that excludes ART custody, storage, scratch, and evidence-persistence facts.
  • Removed exactly four repaired private-import ledger entries.
  • Added architecture and behavior tests, an exact capability manifest, and architecture documentation.

Why it changed

TASK and ART admission imported CHECKER catalogue, compiler, and execution internals. That coupling would make later ART/AUTH activation unsafe and prevent module extraction.

Design chosen

CHECKERS owns one typed planning port. TASK supplies exact locked lineage and policy values; the existing CHECKER catalogue delegates to the existing compiler. ART retains custody and evidence ownership. Public result facts expose only checker outcomes.

Alternatives rejected

  • Re-exporting private implementations: violates the public API boundary.
  • A second catalogue/compiler: creates divergent policy truth.
  • Moving custody/evidence into CHECKERS: transfers ART ownership.
  • Bulk repository refactor: exceeds the bounded capability and review surface.

Scope control and product behavior

No route, action, permission, durable job, persistence, schema, migration, provider operation, or authorization activation changed. Remaining ART materialization/evidence private CHECKER edges remain frozen for 02D.

Acceptance criteria proof

  • One public planning port compiles the unchanged effective platform-plus-project plan.
  • Public execution facts omit custody and storage fields.
  • ART retains evidence and admission ownership.
  • Four touched ledger edges are removed with no new edge.
  • The exact public surface and ownership are recorded in the 02C manifest.

Tests and checks

  • Ruff: passed.
  • Protected-base module-boundary validation: passed.
  • Focused catalogue/effective-plan/submission-admission suite: 61 passed.
  • Dedicated focused public planning-port/result tests: 2 passed in a new CHECKER-owned file.
  • The frozen oversized legacy execution test file remains unchanged.
  • Public API coverage: 94.96% locally.
  • Markdown links, stale wording/auth/artifact scans, JSON validation, and diff integrity: passed.
  • The contract-wide local DB test had 75 passed plus one setup error because this shell lacks WORKSTREAM_TEST_DATABASE_URL; hosted isolated DB lanes own final database-backed proof.

Test delta and CI integrity

No test was removed, skipped, xfailed, or weakened. No workflow, dependency, timeout, lane, or coverage threshold changed.

Reviewer results

  • Architecture: pass with low risks.
  • Security/auth: pass; no findings.
  • Product/operations: initial staging reproducibility finding fixed; re-review pass.
  • QA: pass with low risks.
  • Senior engineering: pass with low risks.
  • CI integrity: pass with local DB evidence caveat documented.
  • Docs: two evidence/scope overstatements fixed; final pass.
  • Reuse/dedup: pass.
  • Test delta: public-port coverage gap fixed; final pass.

Base reconciliation and external review

Merged current main to adopt the atomic chunk-state gate, then recorded the 02C contract, chunk map, initiative status, and current-state projection together. The first reconciled-head Backend preflight exposed a missing behavior-ownership partition entry for the new public API target; that exact target and its deterministic partition digest are now registered without weakening any gate. Hosted lane collection then rejected the new standalone test module, so its two focused tests were preserved in the already-canonical architecture lane without changing lane topology. CodeRabbit’s initial four findings and follow-up coverage/review-evidence findings were fixed: CHECKER-specific lifecycle names, exact dotted namespace enforcement, repeated deterministic public-port proof, independently allowlisted non-negative metadata projection, coverage proof for every changed CHECKERS module, and exact review-round SHAs. Fresh GitHub Actions and CodeRabbit are running on exact head 61f76043.

Remaining risks and follow-up

Closed result vocabularies remain string-typed because production construction is validated by the private executor. Later consumers may tighten these to closed public aliases. ARCH-02D must migrate the remaining ART materialization/evidence consumers to this public surface.

Human review focus

Confirm single CHECKER ownership, exact ledger reduction, custody exclusion, unchanged behavior, and that 02D—not AUTH activation—is the next boundary.

Human merge ownership

Human maintainers retain merge authority. The agent will not merge without explicit approval.

Summary by CodeRabbit

  • New Features

    • Added a public pre-submission checker API for deterministic planning and validated execution results.
    • Added immutable plan, lineage, submission-packet, and execution-facts contracts with stable hashing.
    • Added bounded execution facts that exclude artifact custody and storage details.
  • Architecture

    • Updated artifact and task flows to use the checker planning API.
    • Removed private module-boundary dependencies while preserving runtime behavior.
  • Documentation

    • Documented checker ownership, public boundaries, and metadata visibility rules.
  • Tests

    • Added architecture coverage for namespace boundaries, deterministic plans, stable hashes, and metadata filtering.

@coderabbitai

coderabbitai Bot commented Aug 11, 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: 10 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: 5b9f2e25-a3d3-41f8-aac6-a9bd38614238

📥 Commits

Reviewing files that changed from the base of the PR and between ad3237f and 9bd4b56.

📒 Files selected for processing (4)
  • .agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/chunks/WS-ARCH-001-02C-checker-pre-submit-api.md
  • .agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/reviews/WS-ARCH-001-02C-external-review-response.md
  • .agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/TEST_STRUCTURE_DEBT.json
  • backend/tests/test_default_pre_submit_execution.py
📝 Walkthrough

Walkthrough

The PR adds a public CHECKERS pre-submit API with immutable planning and execution contracts. It routes ART and TASK callers through the planning port, removes private module edges, adds bounded execution facts, and records boundary validation and completion state.

Changes

CHECKERS pre-submit boundary

Layer / File(s) Summary
Public pre-submit contracts
backend/app/modules/checkers/api/*
Adds immutable lineage, plan, execution, packet, result, hashing, and JSON serialization contracts.
Planning implementation and execution facts
backend/app/modules/checkers/catalogue.py, backend/app/modules/checkers/effective_plan.py, backend/app/modules/checkers/pre_submit_execution.py
Routes plan compilation through shared API models and adds bounded execution-fact projection.
Consumer migration to the public port
backend/app/modules/artifacts/submission_admission.py, backend/app/modules/tasks/pre_submit_context.py, .ci/module-boundaries/private-edge-debt.v1.json
Replaces private catalogue and compiler dependencies with EffectivePreSubmissionPlanningPort.
Boundary validation and ownership registration
backend/tests/architecture/test_module_boundaries.py, backend/tests/test_checker_catalogue.py, docs/architecture_lockdown.md, .ci/behavior-ownership/*, backend/scripts/behavior_ownership.py, .agent-loop/.../evidence/*
Adds namespace, deterministic-plan, bounded-facts, ownership, and boundary documentation coverage.
Completion and review records
.agent-loop/CURRENT_STATE.md, .agent-loop/.../CHUNK_MAP.md, .agent-loop/.../STATUS.md, .agent-loop/.../chunks/*, .agent-loop/.../reviews/*
Records completed acceptance criteria, merge state, validation commands, and review responses.

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

Sequence Diagram(s)

sequenceDiagram
  participant PreSubmitContext
  participant EffectivePreSubmissionPlanningPort
  participant PreSubmissionCheckerCatalogue
  participant PreSubmissionExecutionResult
  PreSubmitContext->>EffectivePreSubmissionPlanningPort: compile_effective_plan(lineage, policy, bundle)
  EffectivePreSubmissionPlanningPort->>PreSubmissionCheckerCatalogue: compile_effective_plan(...)
  PreSubmissionCheckerCatalogue-->>PreSubmitContext: EffectivePreSubmissionExecutionPlan
  PreSubmitContext->>PreSubmissionExecutionResult: bounded_facts()
  PreSubmissionExecutionResult-->>PreSubmitContext: PreSubmissionExecutionFacts
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 58.62% 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 clearly and concisely identifies the primary change: exposing the CHECKER pre-submit public API.
Description check ✅ Passed The description covers the change, intent, scope, behavior, tests, review results, risks, follow-up work, and merge ownership in sufficient detail.
✨ 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-02c-checker-pre-submit-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.

@Abiorh001
Abiorh001 force-pushed the codex/ws-arch-001-02c-checker-pre-submit-api branch from 77157e1 to 5e4f04b Compare August 11, 2026 18:44

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

🤖 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/api/pre_submit.py`:
- Around line 91-94: Rename the vague lifecycle fields in the CHECKERS
pre-submit models to checker-specific names, such as checker_definition_state
and checker_execution_status, and propagate those names consistently through
EffectivePreSubmissionPlanEntry.as_dict(), _entry_from_definition(), and
PreSubmissionExecutionResult.bounded_facts(). Update the related public API
tests to assert the renamed fields while preserving their existing behavior.

In `@backend/tests/architecture/test_module_boundaries.py`:
- Around line 243-246: Update the import boundary assertion to match the exact
`app.modules.checkers.api` namespace, allowing the module itself or descendants
with a following dot, while rejecting names such as `api_private` and `apix`.

In `@backend/tests/checkers/test_pre_submit_public_api.py`:
- Around line 46-71: Update
test_public_planning_port_compiles_the_canonical_plan to assign
build_pre_submission_checker_catalogue() to an
EffectivePreSubmissionPlanningPort reference before invoking
compile_effective_plan. Compile the same lineage, effective_policy, and
compiled_bundle twice through that public-port reference, then assert both
plans’ as_dict() results and plan_sha256 values are equal while preserving the
existing type, lineage, and self-hash checks.
- Around line 87-118: The test around bounded_facts() should include forbidden
custody, archive, scratch, provider, and evidence metadata in the execution
result, then assert those fields are absent from the returned public facts. Also
verify that only the allowlisted metadata keys entry_count, finding_count, and
matched_category_count are exposed, while preserving the existing plan,
eligibility, and entry assertions.
🪄 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: be7f710c-e920-4a98-88b5-74dda6368c08

📥 Commits

Reviewing files that changed from the base of the PR and between 378244b and 5e4f04b.

📒 Files selected for processing (13)
  • .agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/chunks/WS-ARCH-001-02C-checker-pre-submit-api.md
  • .agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/evidence/WS-ARCH-001-02C-checker-manifest.md
  • .ci/module-boundaries/private-edge-debt.v1.json
  • backend/app/modules/artifacts/submission_admission.py
  • backend/app/modules/checkers/api/__init__.py
  • backend/app/modules/checkers/api/pre_submit.py
  • backend/app/modules/checkers/catalogue.py
  • backend/app/modules/checkers/effective_plan.py
  • backend/app/modules/checkers/pre_submit_execution.py
  • backend/app/modules/tasks/pre_submit_context.py
  • backend/tests/architecture/test_module_boundaries.py
  • backend/tests/checkers/test_pre_submit_public_api.py
  • docs/architecture_lockdown.md
💤 Files with no reviewable changes (1)
  • .ci/module-boundaries/private-edge-debt.v1.json

Comment on lines +91 to +94
classification: str
state: str
disabled_behavior: str
dispatch_kind: str

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 | 🟠 Major | 🏗️ Heavy lift

Use CHECKER-specific lifecycle field names.

state and status are vague outside the CHECKERS module. Rename them to names such as checker_definition_state and checker_execution_status.

Update EffectivePreSubmissionPlanEntry.as_dict(), _entry_from_definition(), PreSubmissionExecutionResult.bounded_facts(), and public API tests in the same change.

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

Also applies to: 192-195

🤖 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/checkers/api/pre_submit.py` around lines 91 - 94, Rename
the vague lifecycle fields in the CHECKERS pre-submit models to checker-specific
names, such as checker_definition_state and checker_execution_status, and
propagate those names consistently through
EffectivePreSubmissionPlanEntry.as_dict(), _entry_from_definition(), and
PreSubmissionExecutionResult.bounded_facts(). Update the related public API
tests to assert the renamed fields while preserving their existing behavior.

Source: Coding guidelines

Comment thread backend/tests/architecture/test_module_boundaries.py
Comment on lines +46 to +71
def test_public_planning_port_compiles_the_canonical_plan() -> None:
"""The public port delegates to the sole deterministic CHECKER compiler."""
policy = _effective_policy()
policy_hash = canonical_json_hash(policy)
compiled = compile_effective_project_submission_artifact_policy(policy, policy_hash)
lineage = EffectivePreSubmissionPlanLineage(
project_id=uuid4(),
guide_id=uuid4(),
guide_version=1,
source_snapshot_id=uuid4(),
source_snapshot_hash="sha256:" + "1" * 64,
effective_policy_id=uuid4(),
effective_policy_hash=policy_hash,
pre_submit_policy_id=uuid4(),
pre_submit_policy_bundle_hash=compiled.compiled_bundle_hash,
)

plan = build_pre_submission_checker_catalogue().compile_effective_plan(
lineage=lineage,
effective_policy=policy,
compiled_bundle=compiled.compiled_bundle,
)

assert type(plan) is EffectivePreSubmissionExecutionPlan
assert plan.lineage is lineage
assert plan.plan_sha256 == canonical_json_hash(plan.as_dict())

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

Exercise the public deterministic planning contract.

The test imports EffectivePreSubmissionPlanningPort but invokes compile_effective_plan on the concrete catalogue. A catalogue that no longer conforms to the public port could still pass. Bind and validate the catalogue through EffectivePreSubmissionPlanningPort.

The self-hash assertion checks only one output. Compile identical inputs twice through the public port and compare both as_dict() and plan_sha256.

🤖 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/checkers/test_pre_submit_public_api.py` around lines 46 - 71,
Update test_public_planning_port_compiles_the_canonical_plan to assign
build_pre_submission_checker_catalogue() to an
EffectivePreSubmissionPlanningPort reference before invoking
compile_effective_plan. Compile the same lineage, effective_policy, and
compiled_bundle twice through that public-port reference, then assert both
plans’ as_dict() results and plan_sha256 values are equal while preserving the
existing type, lineage, and self-hash checks.

Comment thread backend/tests/checkers/test_pre_submit_public_api.py Outdated

@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

🤖 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-ARCH-001-modular-monolith-boundaries/chunks/WS-ARCH-001-02C-checker-pre-submit-api.md:
- Around line 91-92: Extend the coverage command in the pre-submit verification
block to include app.modules.checkers.catalogue,
app.modules.checkers.effective_plan, and
app.modules.checkers.pre_submit_execution alongside app.modules.checkers.api,
and add tests/test_checker_catalogue.py and
tests/test_effective_pre_submit_execution.py to the pytest targets while
preserving the 90% coverage threshold.

In
@.agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/reviews/WS-ARCH-001-02C-external-review-response.md:
- Around line 5-17: Update the review-response entry to identify the four
CodeRabbit requests as findings from the earlier review and label the
no-actionable-comments result as the follow-up exact-head review. Use the
repository history to record the full commit SHA for each referenced review
round, including the commits associated with the preflight and hosted-lane
outcomes where they are referenced.
🪄 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: daf2eb8f-21f3-4e2e-aaf3-347efbe6b30c

📥 Commits

Reviewing files that changed from the base of the PR and between 5e4f04b and ad3237f.

📒 Files selected for processing (12)
  • .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/STATUS.md
  • .agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/chunks/WS-ARCH-001-02C-checker-pre-submit-api.md
  • .agent-loop/initiatives/WS-ARCH-001-modular-monolith-boundaries/reviews/WS-ARCH-001-02C-external-review-response.md
  • .ci/behavior-ownership/partition.v1.json
  • backend/app/modules/checkers/api/pre_submit.py
  • backend/app/modules/checkers/effective_plan.py
  • backend/app/modules/checkers/pre_submit_execution.py
  • backend/scripts/behavior_ownership.py
  • backend/tests/architecture/test_module_boundaries.py
  • backend/tests/test_checker_catalogue.py
🚧 Files skipped from review as they are similar to previous changes (2)
  • backend/app/modules/checkers/api/pre_submit.py
  • backend/app/modules/checkers/pre_submit_execution.py

@Abiorh001
Abiorh001 force-pushed the codex/ws-arch-001-02c-checker-pre-submit-api branch from 72013b4 to 9bd4b56 Compare August 11, 2026 20:43
@abiorh-claw
abiorh-claw self-requested a review August 11, 2026 21:58
@abiorh-claw
abiorh-claw merged commit 29dbca7 into main Aug 11, 2026
11 checks passed
@abiorh-claw
abiorh-claw deleted the codex/ws-arch-001-02c-checker-pre-submit-api branch August 11, 2026 22:02
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