Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9179f9d
Implement post-submit setup derivation
Abiorh001 Jul 10, 2026
76232cc
Record post-submit derivation review evidence
Abiorh001 Jul 10, 2026
851249e
Fix post-submit e2e setup fixtures
Abiorh001 Jul 10, 2026
e50c046
Clarify post-submit CI bridge scope
Abiorh001 Jul 10, 2026
c6deb5c
Normalize post-submit worker results
Abiorh001 Jul 10, 2026
fa7afaf
Clarify temporary post-submit approval bridge
Abiorh001 Jul 10, 2026
9c0b861
Refresh post-submit derivation review evidence
Abiorh001 Jul 10, 2026
fd96d22
Address post-submit external review cleanup
Abiorh001 Jul 10, 2026
26efde4
Add setup queue config regression proof
Abiorh001 Jul 10, 2026
36bc553
Rebind post-submit derivation evidence to final head
Abiorh001 Jul 10, 2026
bc1e7e5
Auto-enqueue pre-review gate after submission
Abiorh001 Jul 11, 2026
89cc0d1
Clarify accepted submission dispatch failures
Abiorh001 Jul 11, 2026
9dfbbaf
Guard eager pre-review gate dispatch failures
Abiorh001 Jul 11, 2026
4abbf0e
Attribute gate dispatch failures to system actor
Abiorh001 Jul 11, 2026
67fea34
Make pre-review gate repair outcomes explicit
Abiorh001 Jul 11, 2026
7917d48
Document pre-review gate repair outcomes
Abiorh001 Jul 11, 2026
f3d3d41
Validate gate requester provenance before audit
Abiorh001 Jul 11, 2026
833066e
Align post-submit repair documentation
Abiorh001 Jul 11, 2026
10d9815
Share pre-review gate provenance helpers
Abiorh001 Jul 11, 2026
8f76f38
Fence pre-review enqueue failure audits
Abiorh001 Jul 11, 2026
0318bec
Document execution-failure gate repair
Abiorh001 Jul 11, 2026
3098e95
Rebind post-submit gate review evidence
Abiorh001 Jul 11, 2026
67fb3ca
Address post-submit gate review feedback
Abiorh001 Jul 11, 2026
5d2c002
Rebind post-submit review evidence
Abiorh001 Jul 11, 2026
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
25 changes: 15 additions & 10 deletions .agent-loop/LOOP_STATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@

- Active initiative: `WS-POL-002` - Post-Submit Checker Foundation
- Active planning chunk: none
- Active implementation chunk: `WS-POL-002-01` - Post-Submit Compiler Contract
- Branch: `codex/ws-pol-002-01-post-submit-compiler`
- Status: `WS-POL-002-01` started after the user's explicit start signal.
Pre-implementation plan review narrowed the chunk to compiler/body/hash
behavior only; persistence, setup-run fields, approval, and activation
enforcement remain in later chunks.
- Last merged implementation SHA: `be2d5ec`
- Last merge commit: `3fc1a68`
- Current gate: implementation for `WS-POL-002-01`.
- Next chunk: inactive until `WS-POL-002-01` is implemented, reviewed,
- Active implementation chunk: `WS-POL-002-02` - Post-Submit Derivation Agent
And Resumable Setup Integration
- Branch: `codex/ws-pol-002-02-post-submit-derivation`
- Status: `WS-POL-002-01` merged through PR #87 as `ed52c21` on 2026-07-09.
`WS-POL-002-02` started after the user's explicit start signal.
- Last merged implementation SHA: `438361a`
- Last merge commit: `ed52c21`
- Current gate: PR #88 for `WS-POL-002-02` is open. Internal review,
evidence, and external-review response are recorded; human merge review
requires green current-head GitHub checks and explicit user approval.
- Next chunk: inactive until `WS-POL-002-02` is implemented, reviewed,
externally checked, merged by explicit human approval, and followed by memory
update.

Expand Down Expand Up @@ -131,3 +132,7 @@ blockchain, frontend, or agent-runtime behavior.
PDF report proving the current lifecycle through HTTP-visible APIs.
- PR #85 merged into `main` as `3fc1a68`; it completed `WS-POL-002-PLAN`
planning for project-guide-derived post-submit checker setup.
- PR #87 merged into `main` as `ed52c21`; it implemented `WS-POL-002-01`
Post-Submit Compiler Contract with version-stamped default-checker snapshots,
canonical policy hashing, compiler-boundary validation, and default-drift
regression tests.
30 changes: 30 additions & 0 deletions .agent-loop/REVIEW_LOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Review Log

## WS-POL-002-01

Status: merged through PR #87 on 2026-07-09.

Merge commit: `ed52c21`

Reviewed implementation SHA: `438361a`

Required reviewer tracks:

- senior engineering
- QA/test
- security/auth
- product/ops
- architecture
- CI integrity
- docs
- reuse/dedup
- test delta

Result: PASS after fixes; PR #87 external review addressed; GitHub checks passed.

Scope: trusted post-submit compiler contract, version-stamped default-checker
snapshots, canonical policy hashing, compile/parse validation, and regression
tests around default-drift safety.

Evidence: `.agent-loop/initiatives/WS-POL-002-post-submit-checker-foundation/reviews/WS-POL-002-01-internal-review-evidence.md`

External review response: `.agent-loop/initiatives/WS-POL-002-post-submit-checker-foundation/reviews/WS-POL-002-01-external-review-response.md`

## WS-ENG-001-01

Status: merged through PR #23 on 2026-06-20.
Expand Down
5 changes: 3 additions & 2 deletions .agent-loop/WORK_QUEUE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

| Chunk | Title | Risk | Status |
|---|---|---:|---|
| `WS-POL-002-01` | Post-Submit Compiler Contract | L1 | Active on `codex/ws-pol-002-01-post-submit-compiler` |
| `WS-POL-002-02` | Post-Submit Derivation Agent And Resumable Setup Integration | L1 | Active on `codex/ws-pol-002-02-post-submit-derivation` |

## Completed

Expand All @@ -30,10 +30,11 @@
| `WS-POL-001-15` | Agent Derivation Policy Conflict Hardening | L1 | Merged through PR #81 as `b1a9851` on 2026-07-08 |
| `WS-POL-001-16` | Terminal Benchmark Live API Drill | L1 | Merged through PR #84 as `a3d2a3f` on 2026-07-09 |
| `WS-POL-002-PLAN` | Post-Submit Checker Foundation Planning | L1 | Merged through PR #85 as `3fc1a68` on 2026-07-09 |
| `WS-POL-002-01` | Post-Submit Compiler Contract | L1 | Merged through PR #87 as `ed52c21` on 2026-07-09 |

## Proposed Next

Do not start the next chunk until `WS-POL-002-01` is implemented, reviewed,
Do not start the next chunk until `WS-POL-002-02` is implemented, reviewed,
externally checked, merged by explicit human approval, and followed by memory
update.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ reviewed, merged by explicit human approval, and followed by a memory update.

| Chunk | Title | Risk | Status |
|---|---|---:|---|
| `WS-POL-002-01` | Post-Submit Compiler Contract | L1 | Active |
| `WS-POL-002-02` | Post-Submit Derivation Agent And Resumable Setup Integration | L1 | Proposed |
| `WS-POL-002-01` | Post-Submit Compiler Contract | L1 | Merged |
| `WS-POL-002-02` | Post-Submit Derivation Agent And Resumable Setup Integration | L1 | Active |
| `WS-POL-002-03` | Server-Owned Policy Approval And Visibility APIs | L1 | Proposed |
| `WS-POL-002-04` | Locked Runtime Execution And Routing Hardening | L1 | Proposed |
| `WS-POL-002-05` | Terminal Benchmark Post-Submit Live API Proof | L1 | Proposed |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,22 @@ ProjectGuide

## Current Baseline

The runtime gate already exists:
The runtime gate exists, but this initiative tightened the happy path during
`WS-POL-002-02` so manager action is not required after a contributor submits:

```text
finalize submission
contributor creates submission
-> Workstream reruns pre-submit against the exact payload
-> Workstream locks the submission packet
-> automatic Celery pre-review gate
-> evaluation_pending
-> CheckerRun
-> review_pending | needs_revision | internal repair route
```

This initiative strengthens the project setup side so the policy feeding that
gate is no longer manually assembled in guide create/update payloads.
gate is no longer manually assembled in guide create/update payloads. The
`finalize` route is a repair/requeue surface for locked submissions only; it is
not the normal contributor submission handoff.

## Design

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,36 @@
Planning completed and merged through PR #85 as
`3fc1a688743f13476d6092078d40792592823d27`.

`WS-POL-002-01` is active after the user's explicit start signal. A
pre-implementation plan review narrowed the chunk to compiler/body/hash
behavior only; durable persistence, setup-run fields, approval, and activation
enforcement remain in later chunks.
`WS-POL-002-01` merged through PR #87 as `ed52c21` on 2026-07-09. It
implemented the version-stamped trusted post-submit compiler contract,
default-checker snapshot validation, canonical policy hashing, and tests around
default-drift safety.

`WS-POL-002-02` is active after the user's explicit start signal. Its
implementation, deterministic proof, internal reviewer fanout, internal review
evidence, PR trust bundle, and external-review response are recorded. PR #88 is
open; the current gate is current-head GitHub checks and human checkpoint.

## Active Planning Chunk

None.

## Active Implementation Chunk

`WS-POL-002-01` - Post-Submit Compiler Contract.
`WS-POL-002-02` - Post-Submit Derivation Agent And Resumable Setup Integration.

## Current Implementation Branch

`codex/ws-pol-002-01-post-submit-compiler`
`codex/ws-pol-002-02-post-submit-derivation`

## Chunk Status

| Chunk | Status | Branch | PR | Notes |
|---|---|---|---:|---|
| `WS-POL-002-PLAN` | Merged | `codex/ws-pol-002-post-submit-checker-planning` | #85 | Defines intent, discovery, design, risks, decisions, and implementation chunks. |
| `WS-POL-002-01` | Active | `codex/ws-pol-002-01-post-submit-compiler` | - | Post-Submit Compiler Contract. |
| `WS-POL-002-02` | Proposed | - | - | Post-submit derivation agent and resumable setup integration after pre-submit approval/compile. |
| `WS-POL-002-03` | Proposed | - | - | Server-owned approval and setup visibility APIs; remove manual guide payload. |
| `WS-POL-002-01` | Merged | `codex/ws-pol-002-01-post-submit-compiler` | #87 | Post-Submit Compiler Contract; merged as `ed52c21`. |
| `WS-POL-002-02` | Active | `codex/ws-pol-002-02-post-submit-derivation` | #88 | Post-submit derivation agent and resumable setup integration after pre-submit approval/compile; current-head checks and human merge review remain the active gate. |
| `WS-POL-002-03` | Proposed | - | - | Server-owned approval and setup visibility APIs for compiled post-submit policies. |
| `WS-POL-002-04` | Proposed | - | - | Runtime hardening for locked post-submit policy execution and routing. |
| `WS-POL-002-05` | Proposed | - | - | Terminal Benchmark-style live API proof and report. |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,31 +45,109 @@ and compiled project pre-submit checker bundle.
checker catalog.
- Agent output is a constrained spec, not executable runtime code.
- Unsupported required checks are recorded as setup blockers.
- Successful derivation passes through the trusted compiler.
- Successful derivation passes through the trusted compiler and creates a
compiled project post-submit policy pending setup approval.
- Setup run status makes post-submit derivation/compile state visible.
- Hostile guide/source instructions that attempt to weaken Workstream defaults,
roles, routing, authorization, or review decisions are ignored or rejected.
- Persisted derivation summaries are bounded and redacted; raw source text,
local paths, secrets, signed refs, and exact source hashes are not returned in
setup APIs by default.

## Contract Amendment

During implementation review, the chunk was explicitly kept as one L1
implementation slice rather than split because post-submit derivation cannot be
made durable without the project-agent interface contract and the database
provenance migration. The allowed files therefore include
`backend/app/interfaces/project_agents.py` and `backend/alembic/versions/**`.
Those files may only be changed for this chunk's derivation contract,
setup-run output state, and generated post-submit policy provenance; they must
not introduce runtime submission judgment or per-task checker generation.
Internal docs review also required README and glossary alignment after the
post-submit continuation became part of automatic project setup. Those docs may
only be changed to describe the new setup continuation at a high level.

Post-review CI repair exposed stale task/checker fixtures and real API drill
setup bridges that still assumed manual guide-body post-submit policy fields.
The allowed scope therefore also includes the test and e2e files listed below,
but only to remove that legacy request-body shape, keep activation fixtures
aligned with generated post-submit setup output, and make the temporary CI
activation bridge explicit until `WS-POL-002-03` adds the server-owned approval
API. These files must not introduce product runtime shortcuts or skip the
project setup continuation tests in `backend/tests/test_projects.py`.

During the post-submit API drill review, the user rejected a manual
manager-owned submission handoff. The normal product flow is now: assigned
contributor submits a packet, Workstream reruns pre-submit authoritatively
against that exact payload, Workstream stamps the immutable submission
boundary, and the server-owned pre-review gate runs through Celery. The allowed
scope therefore also includes the narrow task/checker runtime files needed to
keep manager action out of the happy path. This amendment must not add runtime
agent judgment, reviewer lifecycle behavior, or payment/reputation behavior.
Internal architecture review also required the automatic pre-review gate's
compare-and-set persistence primitives to sit behind the checker repository
boundary instead of inside the checker service. The allowed scope therefore
includes `backend/app/modules/checkers/repository.py`, but only for atomic
automatic pre-review gate persistence methods. Lifecycle decisions remain in
`CheckerService`.
Product/ops review found stale architecture wording that still described
artifact locking and `/finalize` as the normal submission handoff. The allowed
scope therefore also includes `docs/architecture_system_architecture.md`, but
only to align lifecycle wording with the implemented contributor-owned
submission lock and repair-only automatic gate finalization boundary.
Reuse/dedup review required that requester-provenance and Celery task-setting
helpers be shared so the task enqueue path, checker worker validation path,
and setup queue path do not drift. The allowed scope therefore also includes
`backend/app/modules/checkers/pre_review_gate.py` and
`backend/app/workers/task_settings.py`, limited to shared automatic-gate
provenance and worker task-setting contracts.

## Allowed Files

```text
backend/app/adapters/project_agents/**
backend/app/interfaces/project_agents.py
backend/app/modules/checkers/gate_queue.py
backend/app/modules/checkers/pre_review_gate.py
backend/app/workers/project_setup.py
backend/app/workers/async_runner.py
backend/app/workers/checkers.py
backend/app/workers/celery_app.py
backend/app/workers/task_settings.py
backend/app/modules/projects/setup_queue.py
backend/app/modules/projects/router.py (docstring-only stale OpenAPI wording cleanup)
backend/app/modules/projects/service.py
backend/app/modules/projects/schemas.py
backend/app/modules/projects/models.py
backend/app/modules/projects/repository.py
backend/app/modules/tasks/service.py
backend/app/modules/tasks/router.py (docstring-only stale OpenAPI wording cleanup)
backend/app/modules/checkers/service.py
backend/app/modules/checkers/compiler.py
backend/app/modules/checkers/repository.py
backend/alembic/versions/**
backend/tests/test_projects.py
backend/tests/test_agent_runtime.py
backend/tests/test_alembic.py
backend/tests/test_tasks.py
backend/tests/test_checkers.py
backend/scripts/api_contract_e2e.py
backend/scripts/week2_api_e2e.py
examples/terminal_benchmark/terminal_benchmark_api_e2e.py
README.md
docs/architecture_checker_framework.md
docs/architecture_data_model.md
docs/architecture_system_architecture.md
docs/glossary.md
docs/operations_project_operating_manual.md
docs/operations_roles_permissions.md
docs/spec_chunk_5_submission_packet_foundation.md
docs/spec_chunk_9_pre_review_gate.md
docs/spec_week2_checker_framework.md
docs/roadmap_day_by_day_execution_plan.md
docs/roadmap_status.md
docs/diagrams/task_lifecycle_sequence.md
.agent-loop/initiatives/WS-POL-002-post-submit-checker-foundation/**
.agent-loop/LOOP_STATE.md
.agent-loop/WORK_QUEUE.md
Expand All @@ -79,8 +157,8 @@ docs/operations_project_operating_manual.md
## Not Allowed

```text
backend/app/modules/tasks/**
backend/app/modules/checkers/service.py
backend/app/modules/tasks/** except backend/app/modules/tasks/service.py
backend/app/modules/checkers/** except backend/app/modules/checkers/service.py, backend/app/modules/checkers/gate_queue.py, backend/app/modules/checkers/pre_review_gate.py, backend/app/modules/checkers/compiler.py, and backend/app/modules/checkers/repository.py
frontend or demo UI work
payment/reputation/blockchain settlement
per-task checker generation
Expand All @@ -94,7 +172,14 @@ runtime agent-based submission judgment
submission artifact policy and compiled project pre-submit checker bundle.
- Blocked guide sufficiency prevents post-submit derivation.
- Unsupported required checker gaps block setup and are visible to operators.
- Successful derivation creates a compiled project `PostSubmitCheckerPolicy`.
- Successful derivation creates a compiled project `PostSubmitCheckerPolicy`
without treating compilation as setup approval.
- Guide activation rejects compiled-only post-submit checker policies until a
server-owned setup approval path records approval provenance.
- The compiled `PostSubmitCheckerPolicy` is bound to guide id, source snapshot
id/hash, effective project policy id/hash, and pre-submit checker policy
id/hash; setup-run and activation validation reject project/version-only
matches.
- Agent prompt/instructions explicitly forbid arbitrary checker code and
per-task checker generation.
- Tests include malicious guide/source excerpts and prove source text is treated
Expand All @@ -109,6 +194,11 @@ runtime agent-based submission judgment
- Implementation extends the existing project setup queue/worker boundary in
`setup_queue.py` and `project_setup.py`; it must not create a disconnected
post-submit-only queue or parallel pipeline.
- Assigned contributor submission creation locks the submitted packet after
authoritative server-side pre-submit validation and enqueues the Celery
pre-review checker gate with requester provenance.
- The existing finalize route remains idempotent/manual-repair only; repeated
calls must not create duplicate checker runs or audit events.

## Verification Commands

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ there is one authoritative policy path.

## Goal

Expose generated post-submit policy setup state through APIs and remove manual
guide request-body policy creation for post-submit checkers.
Expose generated post-submit policy setup state through APIs and add the
server-owned approval/correction path for compiled post-submit checker policies.

## Target Behavior

Expand All @@ -36,7 +36,7 @@ guide request-body policy creation for post-submit checkers.
policy hash under the current v0.1 bootstrap authorization boundary.
- Setup-authorized admin or project_manager can approve or request setup
correction for the generated project post-submit policy.
- Guide create/update no longer accepts `post_submit_checker_policy` from
- Guide create/update continues to reject `post_submit_checker_policy` from
clients.
- Guide activation requires the approved compiled project
`PostSubmitCheckerPolicy`.
Expand Down Expand Up @@ -80,8 +80,8 @@ compatibility aliases for removed guide payload fields

- Project setup APIs show generated post-submit policy status without database
inspection.
- Guide create/update rejects obsolete manual `post_submit_checker_policy`
payload fields.
- Guide create/update request-body rejection for obsolete
`post_submit_checker_policy` payload fields remains covered.
- Activation blocks unless the compiled post-submit policy is approved and
matches the guide/source context.
- Approval provenance is immutable and records actor id, role, timestamp,
Expand Down
Loading
Loading