Repository navigation
feat(tasks): compose admission-backed submissions #325
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 9 commits into
main
from
codex/ws-arch-001-02f-task-submission-composition
Aug 12, 2026
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
28281e0
feat(tasks): compose admission-backed submissions
Abiorh001 4de33d9
fix(tasks): harden submission composition contracts
Abiorh001 d1d4fbe
test(tasks): prove composed submission rollback
Abiorh001 e81ebaf
Merge remote-tracking branch 'origin/main' into codex/ws-arch-001-02f…
Abiorh001 6315f9e
fix(tasks): remove private composition edge
Abiorh001 608fa29
fix(migrations): preserve lineage constraint name
Abiorh001 9e45101
test(schema): lock current migration fingerprint
Abiorh001 d2ae913
test(tasks): open rollback proof transaction cleanly
Abiorh001 bad8ff2
fix(review): address PR 325 feedback
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
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
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
50 changes: 50 additions & 0 deletions
50
...01-modular-monolith-boundaries/evidence/WS-ARCH-001-02F-transaction-manifest.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,50 @@ | ||
| # WS-ARCH-001-02F Transaction Manifest | ||
|
|
||
| ## Capability | ||
|
|
||
| The hidden `SubmissionCreationCommand` creates one TASK-owned immutable | ||
| Submission from one already-ready ART admission. It remains route-unreachable | ||
| and production authorization remains deny-only. | ||
|
|
||
| ## Transaction and lock order | ||
|
|
||
| 1. The TASK adapter opens one root SQLAlchemy transaction. | ||
| 2. Human `submission.create` authority is checked through the TASK-owned typed | ||
| authority port before TASK state is revealed. | ||
| 3. TASK locks the task, active assignment, and latest predecessor. | ||
| 4. TASK allocates the Submission UUID and version. | ||
| 5. TASK inserts and flushes the provisional Submission identity/version. | ||
| 6. ART consumes the exact admission and fixed binding authority through its | ||
| public port, locking ART lineage and binding scope. | ||
| 7. TASK completes and flushes the immutable Submission with admission, binding, | ||
| content, assignment, predecessor, and locked policy references. | ||
| 8. TASK consumes final human authority using the allocated identity/version. | ||
| 9. The adapter commits once; every exception or cancellation rolls back all | ||
| participants. | ||
|
|
||
| ## Public facts and ports | ||
|
|
||
| - `SubmissionCreationRequest` carries contributor-authored summary and | ||
| attestation plus server-selected TASK/assignment/admission/predecessor IDs. | ||
| - `SubmissionCreationAuthorizationPort` exposes only preliminary and final | ||
| TASK facts; no AUTH handle, context, repository, or session crosses TASK. | ||
| - `SubmissionArtifactAdmissionPort` is the TASK-owned participant protocol; | ||
| the composition adapter translates it to ART's public | ||
| `SubmissionAdmissionConsumptionPort`. | ||
| - `SubmissionCreationResult` returns only Submission, admission, binding, and | ||
| content identities. | ||
|
|
||
| ## Protected mutations | ||
|
|
||
| - TASK: one immutable `submissions` row. | ||
| - ART: one admission terminal transition and one generic artifact binding. | ||
| - AUTH: transaction-local decision evidence only after later activation. | ||
|
|
||
| Pre-submit checker evidence is an immutable prerequisite and is not mutated by | ||
| this command. | ||
|
|
||
| ## Deny-only state | ||
|
|
||
| `DenySubmissionCreationAuthorization` rejects before TASK locks or mutation. | ||
| No route, action catalogue entry, or production AUTH adapter is activated by | ||
| 02F. Positive complete-effect and concurrency proof remains owned by 02H. |
29 changes: 29 additions & 0 deletions
29
...modular-monolith-boundaries/reviews/WS-ARCH-001-02F-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,29 @@ | ||
| # WS-ARCH-001-02F External Review Response | ||
|
|
||
| ## Comments addressed | ||
|
|
||
| - Added every changed planning, state, and PostgreSQL proof file to the chunk's | ||
| allowed mutation scope. | ||
| - Restricted every new Alembic metadata assertion to the `public` schema. | ||
| - Preserved the canonical physical check-constraint name with `op.f(...)`; | ||
| hosted schema-contract tests prove it matches the ORM convention. | ||
| - Configured the PostgreSQL rollback proof without leaving an implicit | ||
| transaction open before the transaction-owning command. | ||
|
|
||
| ## Comments deferred | ||
|
|
||
| None. | ||
|
|
||
| ## Human decisions needed | ||
|
|
||
| None. | ||
|
|
||
| ## Commands rerun | ||
|
|
||
| - Ruff on the changed migration and tests. | ||
| - Focused TASK, architecture, and behavior-ownership tests. | ||
| - GitHub Backend semantic lanes and Agent Gates on the exact PR head. | ||
|
|
||
| ## Remaining risks | ||
|
|
||
| None identified from the CodeRabbit review threads. |
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
49 changes: 49 additions & 0 deletions
49
backend/alembic/versions/0003_submission_artifact_lineage.py
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,49 @@ | ||
| """Add canonical admission and artifact lineage to TASK Submissions.""" | ||
|
|
||
| from alembic import op | ||
| import sqlalchemy as sa | ||
|
|
||
| revision = "0003_submission_lineage" | ||
| down_revision = "0002_admission_version" | ||
| branch_labels = None | ||
| depends_on = None | ||
|
|
||
|
|
||
| def upgrade() -> None: | ||
| op.alter_column("submissions", "package_hash", existing_type=sa.String(128), nullable=True) | ||
| op.add_column("submissions", sa.Column("task_assignment_id", sa.String(36))) | ||
| op.add_column("submissions", sa.Column("submission_bundle_admission_id", sa.String(36))) | ||
| op.add_column("submissions", sa.Column("artifact_binding_id", sa.String(36))) | ||
| op.add_column("submissions", sa.Column("artifact_content_id", sa.String(36))) | ||
| op.create_foreign_key( | ||
| "fk_submissions_task_assignment_id_task_assignments", | ||
| "submissions", | ||
| "task_assignments", | ||
| ["task_assignment_id"], | ||
| ["id"], | ||
| ) | ||
| op.create_index("ix_submissions_task_assignment_id", "submissions", ["task_assignment_id"]) | ||
| op.create_index( | ||
| "ix_submissions_submission_bundle_admission_id", | ||
| "submissions", | ||
| ["submission_bundle_admission_id"], | ||
| unique=True, | ||
| ) | ||
| op.create_unique_constraint( | ||
| "uq_submissions_artifact_binding_id", "submissions", ["artifact_binding_id"] | ||
| ) | ||
| op.create_check_constraint( | ||
| op.f("ck_submissions_artifact_lineage_shape"), | ||
| "submissions", | ||
| "(task_assignment_id is null and submission_bundle_admission_id is null " | ||
| "and artifact_binding_id is null and artifact_content_id is null) or " | ||
| "(task_assignment_id is not null and submission_bundle_admission_id is not null " | ||
| "and artifact_binding_id is not null and artifact_content_id is not null)", | ||
| ) | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| op.create_index("ix_submissions_artifact_content_id", "submissions", ["artifact_content_id"]) | ||
|
|
||
|
|
||
| def downgrade() -> None: | ||
| raise RuntimeError( | ||
| "Workstream v0.1 migrations cannot be downgraded; recreate the database" | ||
| ) | ||
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.