-
Notifications
You must be signed in to change notification settings - Fork 7
feat(pol): add hidden guide compilation custody #307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
abiorh-claw
merged 7 commits into
main
from
codex/ws-pol-003-03a-hidden-compilation-resume
Aug 10, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
627f8b7
docs(pol): activate modular compilation foundation
Abiorh001 e6b7ac4
feat(pol): add hidden guide compilation custody
Abiorh001 b124efe
fix(pol): document compilation custody callables
Abiorh001 40bfb07
test(pol): reconcile historical migration roundtrip
Abiorh001 5c3af98
fix(ci): preserve migration test zero-growth gate
Abiorh001 c77ff2b
fix(pol): address compilation custody review
Abiorh001 d8f8555
test(pol): tighten compilation review proof
Abiorh001 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
15 changes: 8 additions & 7 deletions
15
.agent-loop/initiatives/WS-AUTH-003-module-boundary-recovery/STATUS.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,14 @@ | ||
| # Status | ||
|
|
||
| - Initiative state: AUTH module-boundary recovery active | ||
| - Current branch: `codex/ws-auth-003-01-boundary-foundation` | ||
| - Base: `origin/main` at `aa0854ad` | ||
| - Current consumer repair branch: `codex/ws-pol-003-03a-hidden-compilation-resume` | ||
| - Foundation merge: PR #305 at `3c260e20` | ||
| - Current chunk: `WS-AUTH-003-01` boundary foundation | ||
| - Chunk state: AUTH boundary foundation awaiting human merge | ||
| - Implementation: focused deterministic proof, required internal/external | ||
| review repairs, and exact-head hosted CI passed | ||
| - Chunk state: AUTH boundary foundation merged through PR #305 | ||
| - Implementation: public boundary foundation is merged; incremental capability | ||
| repair is active through POL-03A | ||
| - Current import debt: inventoried in `IMPORT_LEDGER.md` | ||
| - POL-03A: preserved separately at `1a7242f2`; first incremental repair after foundation merge | ||
| - POL-03A: active on a fresh branch from merged main; preserved WIP `1a7242f2` | ||
| is reference evidence only and will not be replayed wholesale | ||
| - REV rule: no private AUTH/ART import exception at `allow_reviews` | ||
| - Human approval required: review and merge the completed foundation PR after hosted gates pass | ||
| - Human approval required: review and merge each incremental capability repair |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
366 changes: 344 additions & 22 deletions
366
...roject-guide-compilation/chunks/WS-POL-003-03A-hidden-compilation-foundation.md
Large diffs are not rendered by default.
Oops, something went wrong.
73 changes: 73 additions & 0 deletions
73
...ed-project-guide-compilation/reviews/WS-POL-003-03A-external-review-response.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| # WS-POL-003-03A External Review Response | ||
|
|
||
| ## Comments addressed | ||
|
|
||
| - All five substantive CodeRabbit threads were validated and corrected: | ||
| compilation attempt states are subsystem-specific; repository failures expose | ||
| one domain hierarchy with a retryable lineage-race subtype; the canonical | ||
| execute digest has explicit behavior ownership; deny-only coroutines are | ||
| created inside their assertion scopes; and local PostgreSQL uses CI's exact | ||
| image digest. | ||
| - Valid review-body findings were also corrected: explicit public-fact test | ||
| construction, canonical-result equality, shared component-hash constraint | ||
| composition, full-result-hash coverage, fresh ORM reloads, fixed-service | ||
| narrowing, migration cleanup safety and schema-scoped trigger inspection, | ||
| and application/database terminal-code parity. | ||
| - Initial exact-head GitHub backend lanes all stopped at the shared docstring | ||
| gate before test execution. The nine new repository callables and six | ||
| deny-only authorization methods now document their exact responsibilities; | ||
| repository-wide docstring coverage is 80.4 percent, above the unchanged 80 | ||
| percent docstring gate. This is distinct from the 78 percent repository test | ||
| coverage floor. | ||
| - On the corrected head, four semantic lanes passed. `schema_contracts_a` | ||
| exposed a stale 0049 round-trip assertion: it stripped only 0049 action | ||
| tokens before comparing the current head to 0048. The assertion now also | ||
| strips 0062's exact, independently tested compilation action token. Migration | ||
| behavior and database guards are unchanged. | ||
| - The first assertion-fix head was rejected by the zero-growth preflight because | ||
| it expanded the already oversized historical migration test. The correction | ||
| was reformatted to shrink that file from 14,096 to 14,093 lines; the debt | ||
| ledger records only that exact shrink and new content hash. CI-integrity | ||
| re-review and canonical structure validation pass with no exception or new | ||
| debt. | ||
|
|
||
| ## Comments deferred | ||
|
|
||
| - The suggested `NOT VALID` rewrite for the three `audit_events` constraints was | ||
| not applied. Migration 0062 deliberately locks and rewrites all three closed | ||
| registries in one transaction so no observer can see a partial catalogue. | ||
| PostgreSQL retains the `ACCESS EXCLUSIVE` lock until that transaction commits, | ||
| so adding and validating `NOT VALID` constraints inside the same transaction | ||
| would not shorten the lock and would weaken the single atomic registry change. | ||
| - Test-only fixture consolidation suggestions are recorded as non-functional | ||
| cleanup, not mixed into this security correction; every affected test retains | ||
| explicit engine cleanup and focused behavior ownership. | ||
| - The request to express internal engineering reviewer results as | ||
| `accept`/`needs_revision`/`reject` was not applied. Those values are reserved | ||
| for Workstream product review decisions; engineering review evidence remains | ||
| pass/fail with residual risk recorded separately, as required by `AGENTS.md`. | ||
|
|
||
| ## Human decisions needed | ||
|
|
||
| - None for this correction. Human merge approval remains required after all | ||
| exact-head checks and external review complete. | ||
|
|
||
| ## Commands rerun | ||
|
|
||
| - Scoped Ruff for both corrected modules. | ||
| - Repository `docstr-coverage --config .docstr.yaml`. | ||
| - Test-structure validation and diff integrity. | ||
| - Focused 0062 migration-contract tests: 2 passed against PostgreSQL. | ||
| - Final isolated guide-compilation suite: 31 passed with 93.08 percent package | ||
| coverage against the unchanged 90 percent floor. | ||
| - Structure, behavior-ownership, and lane-inventory regression bundle: 161 | ||
| passed. | ||
| - Test-delta re-review: pass; the historical assertion still requires both the | ||
| 0049 and 0062 additions exactly twice and rejects all other definition drift. | ||
| - Hosted schema lane on the corrected head. | ||
|
|
||
| ## Remaining risks | ||
|
|
||
| - GitHub must rerun every backend lane and coverage gate on the corrected head. | ||
| - CodeRabbit must receive the corrective head and every resolved thread must be | ||
| verified through the thread-aware API before merge readiness. |
70 changes: 70 additions & 0 deletions
70
...ed-project-guide-compilation/reviews/WS-POL-003-03A-internal-review-evidence.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| # WS-POL-003-03A Internal Review Evidence | ||
|
|
||
| Date: 2026-08-10. Risk: L1. | ||
|
|
||
| ## Deterministic evidence | ||
|
|
||
| - Real-PostgreSQL focused compilation suite: 31 passed after external-review | ||
| corrections. | ||
| - New guide-compilation subsystem coverage: 93.08 percent, above the required | ||
| 90 percent floor. | ||
| - Focused AUTH boundary, structure, behavior-ownership, and public contract | ||
| proof: passed; reviewer run recorded 184 passing tests. | ||
| - Structure-boundary regression suite: 25 passed after explicitly placing | ||
| every POL-03A production and test file inside the zero-growth/skip gate. | ||
| - Hosted-style semantic-lane collection: 3,764 tests collected and exact lane | ||
| evidence validated; lane inventory regression suite: 34 passed. | ||
| - Empty upgrade/downgrade, non-empty downgrade refusal, real trigger, | ||
| concurrency, replay, immutability, and crash-recovery tests passed. | ||
| - Scoped Ruff, authorization boundary, test structure, behavior ownership, | ||
| stale wording, Markdown links, and diff integrity checks passed. | ||
| - GitHub now preserves the repository-wide 78 percent gate and adds an exact | ||
| 90 percent guide-compilation subsystem gate. No workflow failure policy or | ||
| threshold was weakened. | ||
|
|
||
| ## Review results | ||
|
|
||
| - Architecture: pass; the new Projects package depends only on the | ||
| dependency-free AUTH public API and creates no competing protocol or live | ||
| cross-module path. | ||
| - Security/authorization: pass after exact canonical resource-context digest, | ||
| fixed service profile/link, action, permission, project, attempt, and audit | ||
| evidence binding were enforced at the database boundary. | ||
| - QA: pass; exact attempt identity, crash replay, append-only root/child CAS, | ||
| concurrent fork prevention, stale predecessor denial, state shapes, guarded | ||
| downgrade, and hidden deny-only behavior are covered. | ||
| - Product/operations: pass; `provider_result_accepted` remains provider-result custody only and | ||
| creates no approval, activation, review, payment, contribution, or reputation | ||
| truth. | ||
| - Senior engineering: pass; package files remain below structural limits and | ||
| the unsafe evidence-fixture default was removed. | ||
| - Test delta: pass; tests are additive, behavior-focused, and contain no skip, | ||
| xfail, or weakened assertion path. | ||
| - CI integrity: pass after all focused tests entered the semantic-lane and | ||
| structure inventories and the hosted 90 percent coverage gate was added. | ||
| - Docs: pass after documenting that downgrade is empty-only and otherwise | ||
| requires forward recovery or separately reviewed destructive cleanup. | ||
| - Reuse/dedup: pass; keeping the public digest implementation dependency-light | ||
| and the fixed service literal inside the boundary avoids introducing a | ||
| private cross-module dependency. | ||
|
|
||
| Fresh corrective reviews after the CodeRabbit findings: | ||
|
|
||
| - Architecture: pass with low risks; the suggested distinction for unexpected | ||
| storage failures was implemented as `GuideCompilationStorageError` while one | ||
| repository-domain base remains catchable. | ||
| - Security: pass; state, authority evidence, lineage, migration, and deny-only | ||
| behavior remain fail closed. | ||
| - QA: pass with low risks; the required PostgreSQL suite subsequently passed | ||
| locally against a runner-owned isolated database. | ||
| - Test delta: initial fail was corrected, then pass with low risks after live | ||
| migrated-vocabulary proof, deterministic DB-error classification, and | ||
| trigger-cause plus durable-state assertions were added. | ||
| - CI integrity: pass with low risks; no threshold, failure policy, lane, lint, | ||
| or test gate was weakened, and local PostgreSQL now matches CI's exact image. | ||
| - Senior engineering: pass with low risks; its live-migration parity concern is | ||
| covered by the new `pg_get_constraintdef` and direct rejection test. | ||
|
|
||
| All valid findings were corrected and re-reviewed. No internal reviewer session | ||
| remains open; external CodeRabbit thread verification is tracked separately in | ||
| the external review response. | ||
57 changes: 57 additions & 0 deletions
57
...003-unified-project-guide-compilation/reviews/WS-POL-003-03A-pr-trust-bundle.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| # WS-POL-003-03A PR Trust Bundle | ||
|
|
||
| ## Goal and design | ||
|
|
||
| Install hidden, immutable custody for one logical unified project-guide | ||
| compilation attempt per exact setup generation. Reservation persists before any | ||
| future provider I/O, uncertainty retains the same provider key, accepted output | ||
| survives a crash before projection, and append-only predecessor CAS prevents a | ||
| current-compilation fork. | ||
|
|
||
| The new Projects package is isolated from broad legacy project services. Its | ||
| only authorization dependency is a dependency-free public AUTH facts/port | ||
| module. The project-side adapter denies every operation in this chunk; no | ||
| action is activated and no route, worker, provider call, policy projection, or | ||
| live product behavior is added. | ||
|
|
||
| ## Protected custody | ||
|
|
||
| - Exact attempt identity binds project, guide, source, setup generation, | ||
| canonical inputs, catalogue snapshots, agent/instruction versions, operation, | ||
| request, and one derived provider idempotency key. | ||
| - Accepted output is canonical, bounded, and revalidated against complete and | ||
| component hashes before immutable persistence. | ||
| - A compilation requires matching allowed audit evidence for the exact actor, | ||
| active fixed service profile/link, execute action, permission, attempt, | ||
| project, and canonical resource-context digest. | ||
| - Database triggers reject illegal state transitions, mutation, deletion, | ||
| truncation, stale predecessor use, concurrent forks, unrelated evidence, and | ||
| non-empty downgrade. | ||
|
|
||
| ## Scope and non-goals | ||
|
|
||
| The change adds migration 0062, focused ORM/contracts/repository/validation, | ||
| the public deny-only AUTH seam, behavior ownership records, structural and lane | ||
| registration, and tests. It does not call the compilation agent, enable AUTH | ||
| runtime actions, start Celery work, expose an API, approve or activate policy, | ||
| or alter submission/checker/review/contribution/compensation behavior. | ||
|
|
||
| ## Evidence and reviews | ||
|
|
||
| - 26 focused PostgreSQL tests passed with 93.83 percent subsystem coverage. | ||
| - Boundary, behavior ownership, test structure, stale wording, links, Ruff, and | ||
| diff checks passed. | ||
| - The unchanged repository docstring gate passes after documenting every new | ||
| repository and deny-only authorization callable. | ||
| - Hosted-style inventory collected 3,764 tests with exact lane evidence; the | ||
| new package has an additive hosted 90 percent coverage gate. | ||
| - Architecture, security, QA, product/operations, senior engineering, | ||
| test-delta, CI-integrity, docs, and reuse/dedup reviews passed after fixes. | ||
|
|
||
| ## Remaining risk and human focus | ||
|
|
||
| Full repository coverage and all backend lanes must pass in GitHub Actions. | ||
| Human review should focus on whether any setup generation can acquire a second | ||
| provider key, whether accepted output can become policy accidentally, whether | ||
| append-only supersession can fork, whether audit evidence is exactly bound, | ||
| and whether the new authorization surface remains inactive and dependency-safe. |
24 changes: 24 additions & 0 deletions
24
.ci/behavior-ownership/auth/project-guide-compilation-facts.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| { | ||
| "behavior_id": "auth.project_guide_compilation.facts", | ||
| "boundaries": [], | ||
| "callables": [ | ||
| "app.modules.authorization.api.project_guide_compilation.ProjectGuideCompilationAuthorizationPort.authorize_execute_preflight", | ||
| "app.modules.authorization.api.project_guide_compilation.ProjectGuideCompilationAuthorizationPort.consume_execute_persist", | ||
| "app.modules.authorization.api.project_guide_compilation.ProjectGuideCompilationAuthorizationPort.consume_request", | ||
| "app.modules.authorization.api.project_guide_compilation.ProjectGuideCompilationAuthorizationPort.prepare_execute_persist", | ||
| "app.modules.authorization.api.project_guide_compilation.ProjectGuideCompilationAuthorizationPort.prepare_request", | ||
| "app.modules.authorization.api.project_guide_compilation.ProjectGuideCompilationRequestFacts.__post_init__", | ||
| "app.modules.authorization.api.project_guide_compilation._validate_common", | ||
| "app.modules.authorization.api.project_guide_compilation.project_guide_compilation_execute_resource_digest" | ||
| ], | ||
| "group": "auth", | ||
| "outcomes": ["return", "mapped_error"], | ||
| "reviewed_by": ["WS-POL-003-03A required reviewers"], | ||
| "schema": "workstream.behavior-ownership.v1", | ||
| "status": "reviewed", | ||
| "target": "backend/app/modules/authorization/api/project_guide_compilation.py", | ||
| "tests": [ | ||
| "backend/tests/projects/guide_compilation/test_public_authorization.py::test_public_facts_reject_wrong_uuid_and_unbounded_token", | ||
| "backend/tests/projects/guide_compilation/test_repository_persistence.py::test_wrong_resource_authority_leaves_accepted_attempt_unpersisted" | ||
| ] | ||
| } |
21 changes: 21 additions & 0 deletions
21
.ci/behavior-ownership/lifecycle/project-guide-compilation-authorization.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "behavior_id": "lifecycle.project_guide_compilation.authorization", | ||
| "boundaries": [], | ||
| "callables": [ | ||
| "app.modules.projects.guide_compilation.authorization.DenyProjectGuideCompilationAuthorization._deny", | ||
| "app.modules.projects.guide_compilation.authorization.DenyProjectGuideCompilationAuthorization.authorize_execute_preflight", | ||
| "app.modules.projects.guide_compilation.authorization.DenyProjectGuideCompilationAuthorization.consume_execute_persist", | ||
| "app.modules.projects.guide_compilation.authorization.DenyProjectGuideCompilationAuthorization.consume_request", | ||
| "app.modules.projects.guide_compilation.authorization.DenyProjectGuideCompilationAuthorization.prepare_execute_persist", | ||
| "app.modules.projects.guide_compilation.authorization.DenyProjectGuideCompilationAuthorization.prepare_request" | ||
| ], | ||
| "group": "lifecycle", | ||
| "outcomes": ["denial"], | ||
| "reviewed_by": ["WS-POL-003-03A required reviewers"], | ||
| "schema": "workstream.behavior-ownership.v1", | ||
| "status": "reviewed", | ||
| "target": "backend/app/modules/projects/guide_compilation/authorization.py", | ||
| "tests": [ | ||
| "backend/tests/projects/guide_compilation/test_public_authorization.py::test_hidden_authorization_denies_before_touching_product_state" | ||
| ] | ||
| } |
22 changes: 22 additions & 0 deletions
22
.ci/behavior-ownership/lifecycle/project-guide-compilation-contracts.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "behavior_id": "lifecycle.project_guide_compilation.contracts", | ||
| "boundaries": [], | ||
| "callables": [ | ||
| "app.modules.projects.guide_compilation.contracts.AcceptedCompilationResult.validate_hashes", | ||
| "app.modules.projects.guide_compilation.contracts.CompilationAttemptIdentity.from_context", | ||
| "app.modules.projects.guide_compilation.contracts.CompilationAttemptIdentity.provider_idempotency_key", | ||
| "app.modules.projects.guide_compilation.contracts.accepted_compilation_result", | ||
| "app.modules.projects.guide_compilation.contracts.validate_accepted_compilation_result" | ||
| ], | ||
| "group": "lifecycle", | ||
| "outcomes": ["return", "mapped_error"], | ||
| "reviewed_by": ["WS-POL-003-03A required reviewers"], | ||
| "schema": "workstream.behavior-ownership.v1", | ||
| "status": "reviewed", | ||
| "target": "backend/app/modules/projects/guide_compilation/contracts.py", | ||
| "tests": [ | ||
| "backend/tests/projects/guide_compilation/test_contracts.py::test_attempt_provider_key_is_deterministic_and_context_bound", | ||
| "backend/tests/projects/guide_compilation/test_contracts.py::test_accepted_result_rejects_component_or_full_hash_drift", | ||
| "backend/tests/projects/guide_compilation/test_contracts.py::test_accepted_result_revalidates_against_fresh_context" | ||
| ] | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.