Skip to content

POL-04B: wire unified guide setup to Celery and replace old inference paths - #393

Draft
Abiorh001 wants to merge 24 commits into
mainfrom
codex/pol04b-unified-live-cutover
Draft

POL-04B: wire unified guide setup to Celery and replace old inference paths#393
Abiorh001 wants to merge 24 commits into
mainfrom
codex/pol04b-unified-live-cutover

Conversation

@Abiorh001

@Abiorh001 Abiorh001 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

Change

Verified guide material now triggers one authorized compilation through Celery. It produces sufficiency findings and distinct pre-submission and post-submission draft policy proposals, then stops. Insufficient guides stop at findings. Replay does not start another provider invocation.

POL-04B change record records intent, scope, decisions, replacement tests and remaining boundaries. Its adopted planning link is preserved.

  • Remove the three superseded inference methods, prompts, worker continuations, manual run endpoint and affected obsolete tests/examples together.
  • Configure runtime, model/provider, instructions and limits independently; bind the non-secret configuration immutably to the attempt. Reuse the typed project-agent adapter factory root.
  • Reuse existing request, execution, projection and finalization owners under fresh fixed-service authority. Reject malformed setup state before inference. Reclaim stale queued deliveries using the same task and attempt; exclude invalid, uncertain and finalized outcomes.
  • Preserve authorization, locked lineage, immutable source/output evidence and retained data. Generic approval of unified drafts remains unavailable.
  • Advance navigation to POL-05A → AUTH-12F4 → POL-05B for complete proposal review, correction, approval and explicit manager rerun. Post-policy approval and guide activation remain separate work.

Verification and review

Real model inference has not been verified. Automated tests use controlled agent/provider responses. The HTTP/PostgreSQL/MinIO evidence proves integration and lifecycle behavior, not a successful external model request or proposal quality. No provider API key is configured in the current execution environment. A live provider smoke test remains outstanding. The user has scheduled this immediately after the current PR, using .env configuration, before further manager-review implementation.

Current reviewable head: 98f9c416, reconciled with main c69ff853 (#394). The merge preserves main's API-drill coverage and bounded authority-envelope/traceback repairs. Runtime configuration migration 0015_guide_runtime_configuration follows main's project-role migration.

The preceding reviewed head passed 5,870 tests with 92.02% coverage. The focused correction now preserves known SDK parser rejection as compilation_invalid_terminal rather than an unresolved provider outcome. It translates only the SDK error with a validation-error cause; unrelated failures retain the existing uncertainty fence. The installed parser is exercised for valid JSON, malformed JSON, schema-invalid values and unsafe text. Three real PostgreSQL cases prove exact persisted failure codes and replay without another invocation. Removing the translation makes all three negative parser cases fail while valid JSON still passes.

backend/.env.example now uses current independent runtime/model/instruction settings, removes obsolete configuration names, and explains uv run --env-file .env for both API and worker credentials. No real credential was added. Focused tests pass: 40 adapter cases and four PostgreSQL cases with cleanup complete. Fresh Backend 34440212292 and Agent Gates 34440212323 are pending.

Focused proof covers immutable configuration, authorization, same-attempt replay, scan-to-lock recovery races, and exclusion of invalid, uncertain and finalized generations across all four queue representations. Removing only the finalized guard made its real PostgreSQL test fail at the intended assertion. The corrected concurrent human replay test passes with all concurrency assertions intact. Static boundary mutants cover imported, assigned and typed aliases. No coverage floor, skip rule, lane completeness check or failure propagation was weakened.

Focused reviewer replay is in progress for this repair; previous-head results are historical until rebound. The final documentation correction reconciles two stale lifecycle-scoreboard rows with the current cutover and remaining work. Architecture retains one documented low risk: the bounded Celery delivery result is an untyped dictionary. Fresh CI-integrity custody is pending.

The PR is ready for human review. External CodeRabbit review is not fresh: it skipped the final head because 142 files exceed its 100-file limit and review capacity is unavailable. No review threads are open. A green skipped status is not substantive review.

Human review focus

Review fixed-service authority, immutable configuration and evidence, same-attempt recovery without reinference, both distinct phase proposals, and physical removal of superseded paths. The large deletion is intentional and belongs to this single live-path cutover. No retained data is deleted. Eligible human approval and an explicit decision to merge this PR remain required.

@coderabbitai

coderabbitai Bot commented Sep 9, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 145 files, which is 45 over the limit of 100.

To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch.

Upgrade to a paid plan to raise the limit.

This review couldn't start because sufficient usage credits or metered capacity aren't available. Add credits or update usage-based reviews in the billing tab, then retry.

Check out review usage here.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: b14e5914-ffaf-4807-af81-28bdb133093d

📥 Commits

Reviewing files that changed from the base of the PR and between c69ff85 and 836aaec.

⛔ Files ignored due to path filters (1)
  • backend/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (145)
  • .ci/auth-boundaries/IMPORT_LEDGER.md
  • .ci/auth-boundaries/TEST_STRUCTURE_DEBT.json
  • .ci/behavior-ownership/lifecycle/pol04a2-setup-identity.json
  • .ci/behavior-ownership/lifecycle/project-guide-compilation-orchestrator.json
  • .ci/behavior-ownership/lifecycle/project-guide-compilation-projections.json
  • .ci/behavior-ownership/partition.v1.json
  • .ci/module-boundaries/private-edge-debt.v1.json
  • .commitrail/INDEX.md
  • .commitrail/initiatives/WS-AUTH-001/OVERVIEW.md
  • .commitrail/initiatives/WS-POL-003/OVERVIEW.md
  • .commitrail/initiatives/WS-POL-003/WS-POL-003-04B.md
  • .commitrail/initiatives/WS-POL-003/planning/chunks/WS-POL-003-04B-live-unified-setup-cutover.md
  • .github/workflows/backend.yml
  • README.md
  • backend/.env.example
  • backend/alembic/env.py
  • backend/alembic/versions/0015_guide_runtime_configuration.py
  • backend/app/adapters/auth/__init__.py
  • backend/app/adapters/checkers/__init__.py
  • backend/app/adapters/project_agents/__init__.py
  • backend/app/adapters/project_agents/openai_agent_sdk.py
  • backend/app/adapters/projects/__init__.py
  • backend/app/core/config.py
  • backend/app/core/project_agents.py
  • backend/app/core/project_guide_instructions.py
  • backend/app/interfaces/project_agents.py
  • backend/app/interfaces/project_guide_runtime.py
  • backend/app/modules/checkers/api/pre_submit_catalogue.py
  • backend/app/modules/checkers/catalogue.py
  • backend/app/modules/projects/api/__init__.py
  • backend/app/modules/projects/api/guide_compilation.py
  • backend/app/modules/projects/api/setup_identity.py
  • backend/app/modules/projects/guide_compilation/automatic_request.py
  • backend/app/modules/projects/guide_compilation/context.py
  • backend/app/modules/projects/guide_compilation/contracts.py
  • backend/app/modules/projects/guide_compilation/diagnostics.py
  • backend/app/modules/projects/guide_compilation/finalization_payloads.py
  • backend/app/modules/projects/guide_compilation/live.py
  • backend/app/modules/projects/guide_compilation/models.py
  • backend/app/modules/projects/guide_compilation/orchestrator.py
  • backend/app/modules/projects/guide_compilation/projections.py
  • backend/app/modules/projects/guide_compilation/repository.py
  • backend/app/modules/projects/guide_compilation/service.py
  • backend/app/modules/projects/guide_compilation/source_state.py
  • backend/app/modules/projects/guide_mutation_service.py
  • backend/app/modules/projects/guide_setup_continuation.py
  • backend/app/modules/projects/post_submit_policy.py
  • backend/app/modules/projects/repository.py
  • backend/app/modules/projects/router.py
  • backend/app/modules/projects/service.py
  • backend/app/modules/projects/setup_queue.py
  • backend/app/modules/projects/submission_policy_mutation_repository.py
  • backend/app/modules/projects/submission_policy_mutation_service.py
  • backend/app/modules/projects/sufficiency_mutation_service.py
  • backend/app/workers/project_setup.py
  • backend/pyproject.toml
  • backend/scripts/api_contract_e2e.py
  • backend/scripts/behavior_ownership.py
  • backend/scripts/guide_compilation_e2e.py
  • backend/scripts/test_lane_catalogue.py
  • backend/scripts/week2_api_e2e.py
  • backend/tests/architecture/test_module_boundaries.py
  • backend/tests/architecture_ast.py
  • backend/tests/authorization/contribution_policies/test_migration.py
  • backend/tests/authorization/guide_compilation/test_migration_contract.py
  • backend/tests/authorization/setup_finalization/test_structure.py
  • backend/tests/checkers/post_submit/test_compiled_policy.py
  • backend/tests/checkers/post_submit/test_requirement_dispositions.py
  • backend/tests/conftest.py
  • backend/tests/projects/client_fixtures.py
  • backend/tests/projects/execution_fence_fixtures.py
  • backend/tests/projects/guide_compilation/finalization/pg_generations.py
  • backend/tests/projects/guide_compilation/finalization/pg_prerequisites.py
  • backend/tests/projects/guide_compilation/finalization/pg_support.py
  • backend/tests/projects/guide_compilation/finalization/support.py
  • backend/tests/projects/guide_compilation/finalization/test_guards_postgresql.py
  • backend/tests/projects/guide_compilation/finalization/test_structure.py
  • backend/tests/projects/guide_compilation/helpers.py
  • backend/tests/projects/guide_compilation/test_authorized_concurrency_postgresql.py
  • backend/tests/projects/guide_compilation/test_authorized_execution_service.py
  • backend/tests/projects/guide_compilation/test_authorized_recovery_postgresql.py
  • backend/tests/projects/guide_compilation/test_authorized_request_service.py
  • backend/tests/projects/guide_compilation/test_automatic_request.py
  • backend/tests/projects/guide_compilation/test_context_builder.py
  • backend/tests/projects/guide_compilation/test_database_guards.py
  • backend/tests/projects/guide_compilation/test_durable_dispatch_handoff.py
  • backend/tests/projects/guide_compilation/test_hidden_orchestrator.py
  • backend/tests/projects/guide_compilation/test_hidden_orchestrator_postgresql.py
  • backend/tests/projects/guide_compilation/test_live_cutover_postgresql.py
  • backend/tests/projects/guide_compilation/test_live_worker.py
  • backend/tests/projects/guide_compilation/test_migration_authorized_persistence.py
  • backend/tests/projects/guide_compilation/test_migration_contract.py
  • backend/tests/projects/guide_compilation/test_projection_call_graph.py
  • backend/tests/projects/guide_compilation/test_projection_contracts.py
  • backend/tests/projects/guide_compilation/test_projection_migration.py
  • backend/tests/projects/guide_compilation/test_projection_postgresql.py
  • backend/tests/projects/guide_compilation/test_repository_attempts.py
  • backend/tests/projects/guide_compilation/test_repository_persistence.py
  • backend/tests/projects/guide_compilation/test_request_operation_postgresql.py
  • backend/tests/projects/guide_compilation/test_runtime_configuration_migration.py
  • backend/tests/projects/guide_compilation/test_runtime_configuration_postgresql.py
  • backend/tests/projects/post_submit_fixtures.py
  • backend/tests/projects/submission_policy_mutations/rows.py
  • backend/tests/projects/submission_policy_mutations/test_authority.py
  • backend/tests/projects/submission_policy_mutations/test_repository.py
  • backend/tests/projects/sufficiency_mutations/commands.py
  • backend/tests/projects/sufficiency_mutations/rows.py
  • backend/tests/projects/sufficiency_mutations/test_acknowledgement.py
  • backend/tests/projects/sufficiency_mutations/test_acknowledgement_postgresql.py
  • backend/tests/projects/sufficiency_mutations/test_authority.py
  • backend/tests/projects/sufficiency_mutations/test_dispatch.py
  • backend/tests/projects/sufficiency_mutations/test_lineage.py
  • backend/tests/projects/sufficiency_mutations/test_public_routes.py
  • backend/tests/projects/sufficiency_mutations/test_replay.py
  • backend/tests/projects/sufficiency_mutations/test_report_create.py
  • backend/tests/projects/test_execution_fence_binding.py
  • backend/tests/projects/test_execution_fence_lifetime.py
  • backend/tests/test_agent_runtime.py
  • backend/tests/test_alembic.py
  • backend/tests/test_api_contract_e2e.py
  • backend/tests/test_api_controls.py
  • backend/tests/test_artifact_architecture.py
  • backend/tests/test_behavior_ownership.py
  • backend/tests/test_ci_lane_catalogue.py
  • backend/tests/test_guide_bindings.py
  • backend/tests/test_guide_setup.py
  • backend/tests/test_project_guide_compilation_contracts.py
  • backend/tests/test_projects.py
  • backend/tests/test_tasks.py
  • docker-compose.yml
  • docs/architecture_data_model.md
  • docs/decision_0011_submission_artifact_policy_drives_pre_submit.md
  • docs/glossary.md
  • docs/operations_authorization_service.md
  • docs/operations_project_operating_manual.md
  • docs/product_first_user_flows.md
  • docs/roadmap_status.md
  • docs/spec_artifact_storage_service.md
  • docs/spec_authorization_service.md
  • docs/spec_chunk_3_project_guide_foundation.md
  • examples/terminal_benchmark/LOCAL_VALIDATION_NOTES.md
  • examples/terminal_benchmark/README.md
  • examples/terminal_benchmark/terminal_benchmark_api_e2e.py
  • scripts/check_stale_artifact_contracts.py
  • scripts/check_stale_workstream_wording.py

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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.

Commitrail Probe added 9 commits September 9, 2026 23:02
…live-cutover

# Conflicts:
#	.ci/auth-boundaries/TEST_STRUCTURE_DEBT.json
#	.ci/behavior-ownership/partition.v1.json
#	backend/alembic/env.py
#	backend/scripts/behavior_ownership.py
#	backend/tests/authorization/contribution_policies/test_migration.py
#	backend/tests/authorization/guide_compilation/test_migration_contract.py
#	backend/tests/conftest.py
#	backend/tests/projects/guide_compilation/test_automatic_request.py
#	backend/tests/projects/guide_compilation/test_migration_authorized_persistence.py
#	backend/tests/projects/guide_compilation/test_migration_contract.py
#	backend/tests/projects/guide_compilation/test_projection_migration.py
#	backend/tests/test_alembic.py
#	backend/tests/test_behavior_ownership.py
@Abiorh001 Abiorh001 changed the title POL-04B: run unified guide setup once and stop at draft policies POL-04B: wire unified guide setup to Celery and replace old inference paths Sep 9, 2026
@abiorh-claw
abiorh-claw self-requested a review September 9, 2026 23:57
@Abiorh001
Abiorh001 marked this pull request as ready for review September 10, 2026 00:20
@Abiorh001
Abiorh001 marked this pull request as draft September 10, 2026 05:56
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