-
Notifications
You must be signed in to change notification settings - Fork 6
Cut backend CI runtime 66%: 16m → 5m with isolated semantic test lanes #180
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
Closed
Konan69
wants to merge
2
commits into
Flow-Research:main
from
Konan69:codex/ws-ci-001-02-runtime-stabilization
Closed
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
15 changes: 8 additions & 7 deletions
15
.agent-loop/initiatives/WS-CI-001-backend-ci-acceleration/CHUNK_MAP.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,12 +1,13 @@ | ||
| # CHUNK MAP: WS-CI-001 | ||
|
|
||
| | Chunk | Title | Risk | Status | | ||
| |---|---|---:|---| | ||
| | --- | --- | ---: | --- | | ||
| | `WS-CI-001-01` | Parallel Full-Suite Coverage | L1 | Completed and merged in PR #163 | | ||
| | `WS-CI-001-01R1` | Timeout Cleanup Repair | L1 | Implemented and internally reviewed; awaiting hosted repair PR proof/human review | | ||
| | `WS-CI-001-02` | Safe Routing, Cache, and Timing Refinement | L1 | Future; not started and requires separate approval | | ||
| | `WS-CI-001-01R1` | Timeout Cleanup Repair | L1 | Completed and merged in PR #164 | | ||
| | `WS-CI-001-02` | Migrate-Once Backend Test Runtime | L1 | Source-level fixture consolidation in local verification; canonical start required before PR | | ||
|
|
||
| Each chunk maps to one PR. Chunk 01 preserves the full suite and every coverage | ||
| gate. Chunk 01R1 is the bounded post-merge response to CodeRabbit's timeout | ||
| cleanup finding. Chunk 02 may be planned only from measured 01 evidence and | ||
| cannot be activated without separate human approval. | ||
| Each chunk maps to one PR. Chunk 01 introduced parallel coverage and chunk 01R1 | ||
| repaired timeout cleanup. Measured evidence later proved that repeated per-test | ||
| migrations—not module assignment—were the primary bottleneck. The user directed | ||
| chunk 02 to fix that source problem locally and remove redundant sharding. It | ||
| must not be pushed or opened as a PR before canonical start and internal review. |
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
29 changes: 14 additions & 15 deletions
29
.agent-loop/initiatives/WS-CI-001-backend-ci-acceleration/RISKS.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,18 +1,17 @@ | ||
| # RISKS: WS-CI-001 - Backend CI Acceleration | ||
|
|
||
| | ID | Risk | Severity | Mitigation | | ||
| |---|---|---:|---| | ||
| | R1 | A test is omitted or duplicated | Critical | Filesystem modules plus stable preflight cardinality signatures and exact same-process collection/completion validation | | ||
| | R2 | Coverage is combined from incomplete, foreign, or altered evidence | Critical | Bind fixed artifacts and coverage SHA-256 to checked-out tree, shard ID, schema, and manifest digest | | ||
| | R3 | Upstream failure is hidden by dependency skipping | Critical | Always-run final check explicitly validates every dependency result | | ||
| | R4 | Shards interfere through shared database state | Critical | One isolated migrated database and role per shard process | | ||
| | R5 | Coverage thresholds are weakened | Critical | Preserve exact 78/90 commands and add workflow regression assertions | | ||
| | R6 | MinIO tests run without a real provider | High | Start pinned MinIO in all shards initially or prove a safe module map before narrowing | | ||
| | R7 | One large module controls wall time | Medium | Measure hosted shard duration; consider reviewed node-level split only later | | ||
| | R8 | Parallel jobs cost more runner minutes | Medium | Begin with four shards and compare aggregate minutes with PR #161 | | ||
| | R9 | Artifact names collide | High | Per-commit/per-shard names and strict unique-set fan-in | | ||
| | R10 | Untrusted paths reach shell execution | High | Canonical path validation and argument-array execution in repository script | | ||
| | R11 | Required check identity changes | Critical | Preserve final Backend `test` job and verify in workflow tests/GitHub PR | | ||
| | R12 | Plan scope expands into path-based skipping | High | Defer routing to separately approved 02 contract | | ||
| | R13 | Mutable PostgreSQL tag changes CI behavior | High | Replace `postgres:16` with a reviewed digest pin in 01 | | ||
| | R14 | Parameter display values change across pytest processes | Critical | Execute whole modules; compare exact collection/completion within one process and bind only stable test-base cardinalities across processes | | ||
| | --- | --- | ---: | --- | | ||
| | R1 | A test is omitted or duplicated | Critical | One ordinary pytest process discovers and executes the complete suite exactly once | | ||
| | R2 | Reset leaks data between tests | Critical | Truncate every mutable public table in one transaction before each database-backed test | | ||
| | R3 | Reset damages schema or migration evidence | Critical | Preserve `alembic_version` and actor migration evidence; run destructive migration proofs separately | | ||
| | R4 | Immutable triggers block reset or remain disabled | Critical | Disable only five reviewed truncate guards and re-enable them in the same transaction | | ||
| | R5 | Coverage thresholds are weakened | Critical | Preserve the exact 78/90 commands and workflow regression assertions | | ||
| | R6 | MinIO tests run without a real provider | High | Start one pinned MinIO service before the complete suite | | ||
| | R7 | The child hangs silently | High | Emit a secret-free heartbeat every 60 seconds and enforce a 20-minute child bound | | ||
| | R8 | PGlite diverges from production PostgreSQL | High | Keep asyncpg, locks, triggers, migrations, and concurrency proofs on real PostgreSQL | | ||
| | R9 | Parallel infrastructure returns without evidence | High | Regression-test that the workflow has one job and no matrix, shard tool, or fan-in artifacts | | ||
| | R10 | API drill state contaminates pytest | High | Run the API drill in a sequential isolated-runner invocation | | ||
| | R11 | Required check identity changes | Critical | Preserve the single `Backend / test` job and verify it in workflow tests | | ||
| | R12 | Fixture consolidation changes application behavior | High | Limit implementation to tests, runner supervision, workflow, and documentation | | ||
| | R13 | Mutable PostgreSQL tag changes CI behavior | High | Retain the reviewed digest-pinned PostgreSQL service image | | ||
21 changes: 14 additions & 7 deletions
21
.agent-loop/initiatives/WS-CI-001-backend-ci-acceleration/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,9 +1,16 @@ | ||
| # STATUS: WS-CI-001 - Backend CI Acceleration | ||
|
|
||
| - Phase: post-merge timeout cleanup repair | ||
| - Active implementation chunk: `WS-CI-001-01R1` | ||
| - Proposed first chunk: `WS-CI-001-01` | ||
| - Human direction: prioritize full-suite CI acceleration before | ||
| `WS-ENG-001-04B` | ||
| - Current gate: exact rebased-head review, repair PR CI, and human review | ||
| - `WS-ENG-001-04B`: remains inactive | ||
| - Phase: local implementation and verification complete; hosted proof pending | ||
| - Canonical active implementation chunk: none for this initiative | ||
| - Local candidate chunk: `WS-CI-001-02` | ||
| - Human direction: keep production code unchanged; optimize only tests, | ||
| fixtures, runners, CI, and test documentation | ||
| - Verified runtime wins: projects 706–729s to 179.53s; tasks 535–798s to | ||
| 145.89s; converted database modules 534 tests in 124.21s | ||
| - Complete local proof: four dependency lanes executed all 1,826 tests once in | ||
| 314.40s and 330.70s wall, down from 975.62s wall; real API contract passed; | ||
| global coverage 87.58%; protected reports 90.90–100%; no temporary database or | ||
| role remained; agent workflow gates and Ruff passed | ||
| - Remaining environment proof: exact checked-out commit on hosted `Backend / test` | ||
| - Current repository gate: `WS-CI-001-02` requires an explicit signed start | ||
| before push or PR |
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.
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.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
R1 mitigation text describes the old single-process design, not the shipped 4-lane model.
The rest of the table (and
PLAN.md/run_test_lanes.py) describes four concurrent semantic-lane processes with exact module-inventory validation, not "one ordinary pytest process." As written, R1 misdescribes the actual mitigation (validate_lane_inventoryensuring exactly-once assignment across the four lanes) and could mislead a reader auditing risk coverage.✏️ Suggested wording
📝 Committable suggestion
🤖 Prompt for AI Agents