-
Notifications
You must be signed in to change notification settings - Fork 7
ART PLAN5: resequence legacy precheck clean cut #273
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,67 +1,43 @@ | ||
| # Chunk Contract: WS-ART-001-04A4 - Legacy Standalone Precheck Removal | ||
|
|
||
| Initiative: `WS-ART-001` | Risk: L1 | Status: Proposed after PLAN4 approval | ||
| Initiative: `WS-ART-001` | Risk: L1 | Status: Superseded by PLAN5 | ||
|
|
||
| Artifact contract phase: `upload_admission` | ||
|
|
||
| ## Goal | ||
|
|
||
| Remove the independently invocable caller-owned submission-precheck API before | ||
| the authoritative server-derived catalogue path is installed. This is a clean | ||
| cut with no replacement route in this chunk. | ||
| Historical contract only. PLAN5 proved that removing the shared precheck service | ||
| before admission-backed Submission creation exists would create an unchecked | ||
| legacy Submission path or force a forbidden compatibility seam. No runtime work | ||
| is authorized by this contract. Complete removal is reassigned to 05B. | ||
|
|
||
| ## Allowed Files | ||
|
|
||
| - checker router/service/schema removal for | ||
| `/api/v1/tasks/{task_id}/submission-precheck`; | ||
| - removal of pre-submit-only legacy request/response helpers and registry | ||
| membership after proof that no durable/post-submit caller uses them; | ||
| - OpenAPI, route-negative, import/reachability, docs, and focused tests; | ||
| - CI only to preserve exact existing coverage gates. | ||
| - none; this contract is retained only as durable planning history. | ||
|
|
||
| ## Not Allowed | ||
|
|
||
| - new catalogue, checker execution, ZIP/scratch changes, provider I/O, durable | ||
| evidence/admission/Submission, compatibility alias, redirect, or fallback; | ||
| - removal of compiler primitives or durable/post-submit checker behavior needed | ||
| by 04B1/04B3 and later ART-06; | ||
| - AUTH availability/grant changes or public replacement endpoints. | ||
| - any runtime implementation under the 04A4 identifier; | ||
| - partial route-only or service-only removal; | ||
| - a private compatibility replacement for the shared legacy guard. | ||
|
|
||
| ## Acceptance Criteria | ||
|
|
||
| - route and OpenAPI schema are absent and return the canonical not-found result; | ||
| - caller-owned `artifact_hash_manifest`, package/provider references, and legacy | ||
| packet shape cannot reach a pre-submit service through HTTP or internal public | ||
| methods; | ||
| - no alias, redirect, compatibility parser, or second registry survives; | ||
| - constrained compiler primitives and durable post-submit runner behavior remain | ||
| available for 04B1 reuse; | ||
| - import/reachability tests prove no product composition root exposes the old | ||
| path; | ||
| - no artifact, task, Submission, checker-run, audit, or AUTH behavior is added; | ||
| - focused subsystem coverage is at least 90 percent and repository coverage | ||
| remains at least 78 percent. | ||
| - canonical PLAN, CHUNK_MAP, DECISIONS, RISKS, STATUS, and 05B contract assign | ||
| the complete clean cut to 05B; | ||
| - 04B1 follows PLAN5 without an intervening partial-removal implementation. | ||
|
|
||
| ## Verification | ||
|
|
||
| ```bash | ||
| (cd backend && .venv/bin/pytest tests/test_submission_precheck_removal.py tests/test_openapi_contract.py tests/test_checker_runner.py -q) | ||
| (metadata_dir="$(mktemp -d)" && trap 'rm -rf "$metadata_dir"' EXIT && (cd backend && WORKSTREAM_TEST_ADMIN_DATABASE_URL=postgresql+asyncpg://workstream:workstream@localhost:5433/postgres .venv/bin/python scripts/run_isolated_tests.py --metadata-json "$metadata_dir/result.json" --timeout-seconds 12600 -- .venv/bin/python -m pytest -q --ignore=tests/test_isolated_database_runner.py --cov=app --cov-report=term-missing --cov-fail-under=78)) | ||
| (cd backend && .venv/bin/coverage report --include='app/modules/checkers/*,app/api/router.py' --precision=2 --fail-under=90) | ||
| (cd backend && .venv/bin/ruff check app tests) | ||
| python3 scripts/check_stale_artifact_contracts.py | ||
| python3 scripts/check_stale_workstream_wording.py | ||
| python3 scripts/check_markdown_links.py | ||
| PYTHONPATH=. python3 scripts/test_lightweight_agent_gates.py | ||
| ``` | ||
| Documentation gates only; no application tests are authorized by this | ||
| superseded contract. | ||
|
|
||
| ## Required Reviewers | ||
|
|
||
| Senior engineering, architecture, QA/test, security/auth, product/ops, | ||
| reuse/dedup, CI integrity, test delta, and docs. | ||
| Architecture, security/auth, product/ops, senior engineering, QA/test, docs, | ||
| reuse/dedup, CI integrity, and test delta review PLAN5. | ||
|
|
||
| ## Human Review Focus | ||
|
|
||
| - Is the old API truly unreachable rather than hidden behind an alias? | ||
| - Were reusable compiler/post-submit capabilities preserved? | ||
| - Does this chunk introduce no replacement behavior? | ||
| - Does the resequencing prevent both unchecked legacy Submission creation and a | ||
| long-lived compatibility seam? |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,13 +4,16 @@ Parent initiative: `WS-ART-001` | Risk: L1 | Status: Proposed after XINT-05B | |
|
|
||
| ## Goal | ||
|
|
||
| Make verified admission consumption the only contributor Submission path and | ||
| dispatch post-submit work using immutable identifiers rather than package data. | ||
| Make verified admission consumption the only contributor Submission path, | ||
| dispatch post-submit work using immutable identifiers rather than package data, | ||
| and remove the complete legacy standalone and internal precheck path once and | ||
| for all. | ||
|
|
||
| ## Allowed Files | ||
|
|
||
| Submission schemas/router/service, exact legacy field migration/removal, | ||
| post-submit dispatch payloads, API examples, focused tests/docs/CI evidence. | ||
| Submission and checker schemas/routers/services, exact legacy field and precheck | ||
| removal, post-submit dispatch payloads, API examples, focused tests/docs/CI | ||
| evidence. | ||
|
|
||
| ## Not Allowed Changes | ||
|
|
||
|
|
@@ -21,14 +24,37 @@ generic artifact download, AUTH catalogue/availability, or compatibility paths. | |
|
|
||
| - the public request accepts an admission identity, not URI/hash/manifest facts; | ||
| - caller-owned package identity fields are unreachable and removed safely; | ||
| - `/api/v1/tasks/{task_id}/submission-precheck`, its OpenAPI schemas, and its | ||
| public service entry point are absent and return canonical not-found; | ||
| - the legacy internal `TaskService.create_submission` precheck guard is removed | ||
| in the same cutover because Submission creation can consume only an exact | ||
| verified ready admission; | ||
| - no alias, redirect, fallback, private compatibility service, caller-owned | ||
| manifest input, or second checker registry survives; | ||
| - pending, failed, expired, stale, consumed, cross-task, cross-project, and | ||
| otherwise non-ready admissions cannot create a Submission or dispatch work; | ||
| - mixed admission-plus-legacy package requests fail closed rather than choosing | ||
| one authority source; | ||
| - concurrent consumption of one ready admission creates exactly one Submission, | ||
| one binding, one admission transition, and one downstream dispatch; | ||
| - exact idempotent replay returns the original business effect while conflicting | ||
| replay fails with the stable domain conflict; | ||
|
Comment on lines
+38
to
+41
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
rg -n -C 5 \
'idempot|replay|SubmissionVersionConflict|admission.*(consume|consumed)|submission_bundle_admission' \
--glob '*.py' --glob '*.md' --glob '*.sql'Repository: Flow-Research/workstream Length of output: 162 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf 'Tracked agent-loop files matching WS-ART-001:\n'
git ls-files .agent-loop | rg 'WS-ART-001' || true
printf '\nTarget file lines 1-120:\n'
sed -n '1,120p' .agent-loop/initiatives/WS-ART-001-immutable-artifact-storage/chunks/WS-ART-001-05B-submission-api-cutover.md
printf '\nDirectory contents:\n'
find .agent-loop -maxdepth 4 -type f | sort | sed -n '1,200p'Repository: Flow-Research/workstream Length of output: 42417 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf 'Agent-loop idempotency/replay/consumption mentions:\n'
rg -n -C 3 \
'idempot|replay|consumed|consume|submission_bundle_admission|Submission.*Conflict|conflict|unique|uniqueness|summary|attestation|idempotency' \
--glob '*.md' --glob '*.json' .agent-loop || true
printf '\nRepository idempotency/replay/consumption mentions (focused files only):\n'
rg -n -C 3 \
'idempot|replay|consumed|consume|submission_bundle_admission|Submission.*Conflict|conflict|unique|uniqueness|summary|attestation|idempotency' \
--glob '*.py' --glob '*.md' --glob '*.sql' --glob '*.json' . \
--glob '!node_modules/**' --glob '!dist/**' --glob '!build/**' || true
printf '\nCandidate schema/API evidence:\n'
git ls-files | rg -E '(^|/)(schemas?|api|task|submission|admission|model|migration|sql)$|.*\.(py|md|sql|json)$' | rg -E 'submission|admission|precheck|task|schema|migration' | sort | sed -n '1,200p'Repository: Flow-Research/workstream Length of output: 50381 🏁 Script executed: #!/bin/bash
set -euo pipefail
printf 'Focused agent-loop submission/admission/idempotency files:\n'
git ls-files .agent-loop | rg -E 'agent-loop/.*(submission|admission|idempot|replay|precheck|artifact|conflict|cutover).*\.md|submission|intent|status|risk|review' || true
printf '\nExact targeted searches in agent-loop markdown:\n'
rg -n -C 2 \
'Exact idempotent replay|exact idempotent replay|submission_bundle_admission|SubmissionVersionConflict|consumed|consume.*ready admission|conflict' \
.agent-loop/initiatives/WS-ART-001-immutable-artifact-storage --glob '*.md' || true
printf '\nFocused Python/SQL schema around submission/admission/idempotency:\n'
rg -n -C 4 \
'class .*Submission|submission_bundle_admission|SubmissionVersionConflict|idempot|replay|summary|worker_attestation|package_hash|artifact_hash_manifest|unique.*submission|UNIQUE|UniqueConstraint' \
backend/app backend/alembic --glob '*.py' --glob '*.sql' --glob '!backend/alembic/versions/*' | sed -n '1,260p'Repository: Flow-Research/workstream Length of output: 50383 Specify exact submission replay semantics. This contract defines exact replay and conflicting replay for Consumption/Submission creation, but no chunk defines the submission idempotency key, equality comparison fields, or stable conflict code. Add that definition so retries with changed summary or worker attestation cannot produce inconsistent Submission creation or dispatch behavior. 🤖 Prompt for AI Agents |
||
| - response exposes immutable Submission/binding identities without provider URLs; | ||
| - Celery payloads contain durable identifiers/version facts only; | ||
| - old and new paths cannot coexist or create duplicate business effects. | ||
|
|
||
| ## Verification Commands | ||
|
|
||
| Focused API, schema, migration, dispatch, replay, stale-field, coverage, and | ||
| hosted Backend/Agent Gates. | ||
| - focused API/schema tests prove admission-only creation and reject legacy | ||
| `package_uri`, `package_hash`, `artifact_hash_manifest`, and mixed requests; | ||
| - PostgreSQL state-matrix and concurrency tests prove non-ready/cross-resource | ||
| rejection, exact replay, one consumption, one Submission, and one dispatch; | ||
| - route/OpenAPI/import-reachability tests prove the removed | ||
| `/api/v1/tasks/{task_id}/submission-precheck` route, schemas, public service | ||
| method, aliases, redirects, fallbacks, compatibility path, and second registry | ||
| are absent; | ||
| - migration, stale-field, focused 90 percent subsystem coverage, repository 78 | ||
| percent coverage, and hosted Backend/Agent Gates pass. | ||
|
|
||
| ## Required Reviewers | ||
|
|
||
|
|
@@ -37,4 +63,6 @@ reuse/dedup, test delta, and docs. | |
|
|
||
| ## Human Review Focus And Stop Conditions | ||
|
|
||
| Review the clean cut and API compatibility impact. Stop before checker changes. | ||
| Review the complete clean cut, proof that unchecked Submission creation is | ||
| impossible, and API compatibility impact. Do not change authoritative catalogue | ||
| definitions or checker semantics in this cutover. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
Separate HTTP behavior from static removal.
Only the route can return canonical not-found. OpenAPI schemas and a public service entry point must be removed. The verification list checks static absence and import reachability, but it does not prove that the exact legacy URL returns the canonical not-found response. Split these requirements and add a request-level assertion.
Proposed wording
Also applies to: 52-55
🤖 Prompt for AI Agents