Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ stopped.
| `WS-AUTH-001-12F` | Submission Artifact Policy Planning Parent | L1 | Split after failed L1 pre-start review; zero activation |
| `WS-AUTH-001-12F1` | Submission Policy Authority Foundation | L1 | Merged through PR #286; zero activation |
| `WS-AUTH-001-12F2` | Manual Submission Policy Drafts | L1 | Merged through PR #292 as `81f281bd` |
| `WS-AUTH-001-12F3` | Fixed-Service Policy Derivation | L1 | Proposed after 12F2 |
| `WS-AUTH-001-12F3` | Fixed-Service Policy Derivation | L1 | PR #295; external checks pending |
| `WS-AUTH-001-12F4` | Submission Policy Approval Chain | L1 | Proposed after 12F3 |
| `WS-AUTH-001-12G` | Post-Submit Checker Policy Mutation Cutover | L1 | Proposed after 12F4 |
| `WS-AUTH-001-12H` | Guide Activation Cutover | L1 | Proposed after 12B2 and the owning CON clean cut |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,14 @@ setup-run binding findings were repaired.

## Active implementation chunk

`WS-XINT-002-06A`; the user started the fixed pre-submit materializer
activation after ART-04B3 and AUTH-12F2 merged. This cross-initiative chunk
activates only `artifact.pre_submit.checker_input.materialize` before ART-04C1.
AUTH-12F3 remains the next AUTH-12 successor and resumes while ART proceeds
through 04C1/04C2 after 06A merges.
`WS-AUTH-001-12F3`; implementation and required internal reviews are complete.
The fixed setup-service derivation cutover is ready for hosted CI and external
review. `WS-AUTH-001-12F4` remains proposed and must not start before 12F3 is
human-merged.

## Current review branch

`codex/ws-xint-002-06a-pre-submit-materialization`.
`codex/ws-auth-001-12f3-service-derivation`.

## Chunk status

Expand Down Expand Up @@ -184,7 +183,7 @@ through 04C1/04C2 after 06A merges.
| `WS-AUTH-001-12F` | Planning split | `codex/ws-auth-001-12f-submission-artifact-policy` | - | Combined contract failed required L1 pre-start review; parent now activates nothing and delegates to 12F1-12F4. |
| `WS-AUTH-001-12F1` | Merged | `codex/ws-auth-001-12f1-submission-policy-foundation` | #286 | Submission-policy PREP, replay, provenance, and audit custody foundation merged as `5a4186cc`; zero activation. |
| `WS-AUTH-001-12F2` | Merged | `codex/ws-auth-001-12f2-manual-submission-policy` | #292 | Governed Project Manager append-only manual-draft create/update cutover merged as `81f281bd`. |
| `WS-AUTH-001-12F3` | Proposed | - | - | Fixed setup-service derivation and asynchronous executor cutover. |
| `WS-AUTH-001-12F3` | External checks | `codex/ws-auth-001-12f3-service-derivation` | #295 | Fixed setup-service derivation and asynchronous executor cutover; internal L1 reviews passed. |
| `WS-AUTH-001-12F4` | Proposed | - | - | Project Manager approval and atomic effective/pre-submit policy chain. |
| `WS-AUTH-001-12G` | Proposed | - | - | Post-submit checker policy approval/correction cutover after 12F4. |
| `WS-AUTH-001-12H` | Proposed | - | - | Terminal guide activation after 12B2 and the owning CON clean cut. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

## Status and prerequisite

Proposed and inactive after merged 12F2. Risk: L1.
Implementation complete in PR #295; hosted CI/external review is pending after
merged 12F2. Risk: L1. Human merge remains required.

## Goal

Expand All @@ -24,9 +25,14 @@ backend/app/modules/projects/service.py
backend/app/modules/projects/setup_queue.py
backend/app/modules/projects/submission_policy_mutation_service.py
backend/app/modules/projects/submission_policy_mutation_repository.py
backend/app/modules/projects/models.py
backend/app/modules/projects/sufficiency_mutation_service.py
backend/app/workers/project_setup.py
backend/tests/test_authorization.py
backend/tests/test_alembic.py
backend/tests/test_projects.py
backend/tests/conftest.py
backend/alembic/versions/0059_submission_policy_execution_claim.py
backend/scripts/api_contract_e2e.py
docs/spec_authorization_service.md
docs/operations_authorization_service.md
Expand Down Expand Up @@ -58,6 +64,10 @@ mutation, post-submit policy, generic service authority, or ART behavior.
and be `passed`, or `passed_with_warnings` with its warnings acknowledged.
Missing, blocked, stale, diagnostic-only or unacknowledged-warning output
denies before material or agent I/O.
- After an authorized warning acknowledgement, the same setup generation is
deterministically requeued and resumes derivation without rerunning
sufficiency; repeated recovery does not duplicate material access, agent
invocation or the policy draft.
- Before material or agent I/O, the service acquires a deterministic execution
fence and proves current fixed-service admission. No prepared handle crosses
rollback, external material/agent work, Celery, serialization or transaction.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# External Review Response: WS-AUTH-001-12F3

## Comments addressed

- CodeRabbit reported no actionable review comments.
- Hosted Backend exposed stale OpenAPI inventory expectations after removal of
the public derivation route; the exact route and protected-route inventories
now describe the intended hidden fixed-service surface.
- Hosted Backend exposed stale active-action audit parity; the newly active
fixed-service derivation action is now part of the exact allowed-action set.
- Hosted Backend exposed historical migration selectors that lost the derive
action when its catalogue owner moved from `AUTH_12F` to `AUTH_12F3`; the
frozen project-mutation owner set now includes the successor owner so all
eighteen migration-0041 action pairs and downgrade exclusions remain exact.
- The next hosted run passed all five semantic lanes, then the real-API drill
exposed stale test composition: its deterministic project-agent runtime was
not installed in the new 12F3 policy-derivation owner. The drill now installs
that runtime in `submission_policy_mutation_service` as well; production
fail-closed adapter behavior is unchanged.

## Comments deferred

None.

## Human decisions needed

None before review. Human approval remains required to merge PR #295.

## Commands rerun

- Ruff on the three corrected test modules.
- Focused OpenAPI and action-aware audit parity tests.
- Four focused PostgreSQL migration regressions covering migration-0041 action
parity, downgrade custody, authorization-action evidence, and bootstrap
authority passed.
- The API-contract support module selector passed (17 tests), together with
Ruff and compile validation of the real-API drill.
- Full repository coverage remains assigned to exact-head GitHub Actions.

## Remaining risks

None identified from the external findings. The corrections change only exact
contract expectations; they do not weaken authorization or CI.
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
# PR Trust Bundle: WS-AUTH-001-12F3

## Chunk

`WS-AUTH-001-12F3` — Fixed-Service Policy Derivation (L1).

## Goal

Activate submission-policy derivation only for `workstream.project.setup`, run
it through fresh fixed-service PREP in Celery, and remove public inline agent
derivation.

## Human-approved intent

Complete AUTH-12F3 end to end without weakening authorization, tests, or CI;
use GitHub Actions for the full suite and coverage proof.

## What changed

- Activated only `project.submission_artifact_policy.derive` for the fixed
project-setup service.
- Removed the public derive endpoint and role-based product-service seam.
- Added exact setup/lineage/provenance validation, fresh pre-I/O and final PREP,
total lock ordering, atomic decision/product evidence, and exact replay.
- Added a DB-enforced `reserved -> pending -> committed` execution-claim state
machine so process loss cannot repeat material or agent I/O.
- Made warning-acknowledgement replay retry a failed same-generation enqueue
without rerunning sufficiency.
- Updated migration parity, schema fingerprint, tests, specifications, and ops
guidance.

## Why it changed

Automatic setup derivation needed a closed fixed-service boundary, exact
transactional evidence, and crash-safe replay before it could be activated.

## Design chosen

Reuse the opaque `PreparedAuthorizationHandle` protocol and fixed-service
composition. Commit only a deterministic `reserved` execution claim before
external I/O; after I/O, reload and lock the complete lineage, consume fresh
transaction-bound authority, then atomically bind and complete replay with the
policy and setup output.

## Alternatives rejected

- Public or human inline agent invocation.
- Raw authorization context, serialized handles, or an ART-local evaluator.
- Advisory locking alone; it cannot survive process loss.
- Deleting durable reservations during downgrade.

## Scope control

No approval/effective/pre-submit mutation, post-submit policy activation, ART
behavior, generic service authority, frontend work, or CI changes are included.

## Product behavior

An authoritative same-generation sufficiency result permits only the fixed
setup service to derive one immutable draft. Exact committed redelivery returns
that draft without external I/O. A failed post-reservation execution remains
durably fenced. Project Managers may create manual drafts but cannot invoke the
derivation agent inline.

## Acceptance criteria proof

- Fixed service/action isolation and PREP integrity: authorization tests.
- Exact running/completed custody and stale-output denial: focused project tests.
- Real commit, immutable provenance/defaults, exact replay, durable failure
reservation, and zero-I/O redelivery: PostgreSQL integration test.
- Migration upgrade/downgrade and single-head integrity: isolated Alembic test.
- Removed route: OpenAPI/import-reachability project tests.

## Tests/checks run

- Ruff and Python compile checks passed.
- AUTH selector: 2 passed.
- Worker/replay/custody selector: 8 passed.
- CI lane integrity: 33 passed.
- PostgreSQL service/replay/crash test: 1 passed.
- Isolated Alembic round trip: 1 passed.
- Stale authorization wording, Markdown links, and `git diff --check` passed.
- Full repository coverage is intentionally delegated to hosted GitHub Actions.

## Test delta

Added fixed-service PREP, worker composition, stale custody, exact completed
replay, real PostgreSQL success/replay/crash recovery, route removal, catalogue
activation, migration-head, provenance, immutable-manual-update, and default
policy-floor assertions. No tests were skipped or weakened.

## CI integrity

No workflow, lane, lint, coverage, or package-script changes. Repository-wide
78% and changed-subsystem 90% requirements remain intact.

## Reviewer results

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

## External review

CodeRabbit reported no actionable comments. The first hosted Backend run found
three stale contract expectations after the fixed-service cutover; they were
corrected without changing authorization behavior or CI. Fresh exact-head
GitHub Actions checks are required after the corrective push.

The corrective local evidence passed: Ruff, two focused OpenAPI/audit tests,
and four focused PostgreSQL migration regressions. CI-integrity re-review passed
with no required fixes.

The following hosted run passed every semantic lane, then found that the
real-API drill had not injected its deterministic agent into the new 12F3
policy-derivation module. Test composition was corrected without adding a
production fallback; the API-contract support selector passes locally.

## Remaining risks

Low: execution-fence and worker composition scaffolding parallels sufficiency;
extract a shared helper only if a third boundary establishes a stable pattern.

## Follow-up work

After human merge, reassess and start `WS-AUTH-001-12F4` as its own bounded
chunk. Do not start it automatically from this PR.

## Human review focus

Review migration 0059's one-way guards, the pre-I/O commit boundary, final
atomic PREP/evidence transaction, exact completed replay, and fixed-service-only
catalogue activation.

## Human merge ownership

Only the user may authorize merge of the specific PR.
Loading
Loading