-
Notifications
You must be signed in to change notification settings - Fork 6
plan(auth): split guide activation gates #213
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
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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
63 changes: 0 additions & 63 deletions
63
...tives/WS-XINT-002-art-auth-end-to-end/chunks/WS-XINT-002-04-guide-activation.md
This file was deleted.
Oops, something went wrong.
85 changes: 85 additions & 0 deletions
85
...-XINT-002-art-auth-end-to-end/chunks/WS-XINT-002-04A-guide-ingest-activation.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,85 @@ | ||
| # Chunk Contract: WS-XINT-002-04A Guide Ingest Authorization Activation | ||
|
|
||
| ## Goal | ||
|
|
||
| Activate only `artifact.guide_source.ingest` after merged ART-03A evidence uses | ||
| the one opaque, transaction-bound PREP interface from WS-XINT-002-02. | ||
|
|
||
| ## Risk class | ||
|
|
||
| L1. | ||
|
|
||
| ## Entry gate | ||
|
|
||
| - ART-03A is rebased onto current `main`, merged, and reviewed. | ||
| - Its durable mutation request carries `PreparedAuthorizationHandle`; raw | ||
| `AuthorizationContext` and an ART-local alternate authority protocol are not | ||
| mutation authority. | ||
| - The hidden route remains deny-only until this chunk installs the exact AUTH | ||
| adapter and changes only guide ingest availability. | ||
|
|
||
| ## Allowed files | ||
|
|
||
| ```text | ||
| backend/app/modules/authorization/catalogue.py | ||
| backend/app/modules/authorization/kernel.py | ||
| backend/app/modules/authorization/prepared.py | ||
| backend/app/modules/authorization/repository.py | ||
| backend/app/modules/authorization/runtime.py | ||
| backend/app/modules/artifacts/authorization.py | ||
| backend/tests/test_authorization.py | ||
| backend/tests/test_guide_artifacts.py | ||
| backend/tests/test_artifact_admission.py | ||
| docs/spec_authorization_service.md | ||
| docs/spec_artifact_storage_service.md | ||
| .agent-loop/initiatives/WS-XINT-002-art-auth-end-to-end/reviews/WS-XINT-002-04A-internal-review.md | ||
| .agent-loop/initiatives/WS-XINT-002-art-auth-end-to-end/reviews/WS-XINT-002-04A-pr-trust-bundle.md | ||
| .agent-loop/initiatives/WS-XINT-002-art-auth-end-to-end/reviews/WS-XINT-002-04A-external-review-response.md | ||
| ``` | ||
|
|
||
| ## Not allowed | ||
|
|
||
| ART byte/admission implementation, project routes or lifecycle behavior, | ||
| guide binding/read, submission/review behavior, provider redesign, token roles, | ||
| generic guide download, new catalogue values, or a second authority protocol. | ||
| This contract, the chunk map, and other planning files are not editable by the | ||
| 04A implementation PR; any required scope change returns to planning review. | ||
|
|
||
| ## Acceptance criteria | ||
|
|
||
| - Initial authority requires the exact active Project Manager grant for the | ||
| project and occurs before scratch or request-body byte intake. | ||
| - Final PREP consumption recomposes and locks actor/link, grant, project, draft | ||
| guide, snapshot/item, operation identity, request digest, and server-computed | ||
| digest, byte count, and media type in the caller-owned root transaction. | ||
| - Consumption occurs before capacity/put-intent commit and provider I/O; | ||
| authorization evidence and the protected mutation commit atomically once. | ||
| - Revoked actor/link/grant, cross-project lineage, stale guide/snapshot/item, | ||
| replay, copied or serialized handle, cross-session/root/action/resource use, | ||
| and replaced transaction deny atomically without capacity, put, provider, or | ||
| allowed-audit effects. | ||
| - Only `artifact.guide_source.ingest` becomes active. Guide read and binding | ||
| remain planned until WS-XINT-002-04B consumes merged ART-03B evidence. | ||
|
|
||
| ## Verification | ||
|
|
||
| ```bash | ||
| (cd backend && .venv/bin/python -m ruff check app tests scripts) | ||
| (cd backend && WORKSTREAM_TEST_DATABASE_URL=<test-db> .venv/bin/pytest tests/test_authorization.py tests/test_guide_artifacts.py tests/test_artifact_admission.py -q --cov=app.modules.authorization --cov=app.modules.artifacts --cov=app.modules.projects --cov-report=term-missing --cov-fail-under=90) | ||
| python3 scripts/check_stale_authorization_docs.py | ||
| python3 scripts/check_stale_artifact_contracts.py | ||
| python3 scripts/check_markdown_links.py | ||
| git diff --check | ||
| ``` | ||
|
|
||
| The exact PR head must pass `Backend / test` and `Agent Gates / agent-gates`. | ||
|
|
||
| ## Required reviewers | ||
|
|
||
| Senior engineering, QA/test, security/auth, product/ops, architecture, CI | ||
| integrity, docs, reuse/dedup, and test delta. | ||
|
|
||
| ## Human review focus | ||
|
|
||
| Manager-only ingest, one opaque PREP seam, final locked lineage and byte facts, | ||
| denial atomicity, and ingest-only availability. | ||
84 changes: 84 additions & 0 deletions
84
...002-art-auth-end-to-end/chunks/WS-XINT-002-04B-guide-read-binding-activation.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,84 @@ | ||
| # Chunk Contract: WS-XINT-002-04B Guide Read And Binding Authorization Activation | ||
|
|
||
| ## Goal | ||
|
|
||
| Activate fixed-service guide binding and guide read only after merged ART-03B | ||
| evidence, without weakening the ART-03C clean cut. | ||
|
|
||
| ## Risk class | ||
|
|
||
| L1. | ||
|
|
||
| ## Entry gate | ||
|
|
||
| - WS-XINT-002-04A is merged. | ||
| - ART-03B hidden binding/materialization behavior and exact resource manifest | ||
| are merged and reviewed. | ||
|
|
||
| ## Allowed files | ||
|
|
||
| ```text | ||
| backend/app/modules/authorization/catalogue.py | ||
| backend/app/modules/authorization/kernel.py | ||
| backend/app/modules/authorization/prepared.py | ||
| backend/app/modules/authorization/repository.py | ||
| backend/app/modules/authorization/runtime.py | ||
| backend/app/modules/artifacts/authorization.py | ||
| backend/tests/test_authorization.py | ||
| backend/tests/test_guide_artifacts.py | ||
| docs/spec_authorization_service.md | ||
| docs/spec_artifact_storage_service.md | ||
| .agent-loop/initiatives/WS-XINT-002-art-auth-end-to-end/reviews/WS-XINT-002-04B-internal-review.md | ||
| .agent-loop/initiatives/WS-XINT-002-art-auth-end-to-end/reviews/WS-XINT-002-04B-pr-trust-bundle.md | ||
| .agent-loop/initiatives/WS-XINT-002-art-auth-end-to-end/reviews/WS-XINT-002-04B-external-review-response.md | ||
| ``` | ||
|
|
||
| ## Not allowed | ||
|
|
||
| Human ingest behavior, ART byte/admission implementation, project lifecycle | ||
| changes, submission/review behavior, provider redesign, token roles, generic | ||
| guide download, new catalogue values, or ART-03C legacy removal. | ||
| This contract, the chunk map, and other planning files are not editable by the | ||
| 04B implementation PR; any required scope change returns to planning review. | ||
|
|
||
| ## Acceptance criteria | ||
|
|
||
| - `artifact.guide_source.binding.create` is available only to the fixed | ||
| artifact-binding identity for exact verified content, binding role, guide | ||
| source item, and setup generation. | ||
| - `artifact.guide_source.read` is available only to the fixed guide-reader | ||
| identity for the exact bound guide content and setup generation. | ||
| - Both actions require exact prepared-authority validation and single-use | ||
| consumption before any provider read or binding write. Stale, replayed, | ||
| revoked, mismatched, cross-session, cross-action, or cross-resource authority | ||
| denies before I/O. | ||
| - Successful binding state and bounded authorization evidence commit atomically | ||
| in the caller-owned root transaction before later provider reads. | ||
| - Replaced binding, stale setup generation, wrong identity, cross-guide, | ||
| cross-project, replay, and revoked service authority deny atomically. | ||
| - No generic artifact-download permission or human-to-service authority | ||
| inheritance is introduced. | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| - ART-03C remains a separate clean-cut gate. | ||
|
|
||
| ## Verification | ||
|
|
||
| ```bash | ||
| (cd backend && .venv/bin/python -m ruff check app tests scripts) | ||
| (cd backend && WORKSTREAM_TEST_DATABASE_URL=<test-db> .venv/bin/pytest tests/test_authorization.py tests/test_guide_artifacts.py -q --cov=app.modules.authorization --cov=app.modules.artifacts --cov=app.modules.projects --cov-report=term-missing --cov-fail-under=90) | ||
| python3 scripts/check_stale_authorization_docs.py | ||
| python3 scripts/check_stale_artifact_contracts.py | ||
| python3 scripts/check_markdown_links.py | ||
| git diff --check | ||
| ``` | ||
|
|
||
| The exact PR head must pass `Backend / test` and `Agent Gates / agent-gates`. | ||
|
|
||
| ## Required reviewers | ||
|
|
||
| Senior engineering, QA/test, security/auth, product/ops, architecture, CI | ||
| integrity, docs, reuse/dedup, and test delta. | ||
|
|
||
| ## Human review focus | ||
|
|
||
| Separate fixed identities, exact verified-content and generation binding, | ||
| least privilege, and preservation of the ART-03C clean cut. | ||
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
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.