[AZ-486] F7 endpoint builders + STC-ARCH-02 (cycle 1 close)

Single source of truth for every /api/<service>/... URL the UI talks to:
src/api/endpoints.ts (25 typed builders) re-exported via the F4 barrel.
Migrates 13 production callsites in admin / annotations / flights /
settings / dataset / auth / api-client / FlightContext / DetectionClasses
to endpoints.* . Adds the STC-ARCH-02 static gate (--mode=api-literals
in scripts/check-arch-imports.mjs, wired into scripts/run-tests.sh)
that fails any new hardcoded /api/<service>/ literal in src/ outside
endpoints.ts and *.test.tsx? files.

Tests: +36 contract assertions in src/api/endpoints.test.ts (every
builder, character-identical), +6 STC-ARCH-02 architecture cases in
tests/architecture_imports.test.ts (single / double / template literal
fail paths, *.test.* exemption, line-comment skip, migrated codebase
pass). Fast profile 167 -> 209 PASS / 13 SKIP / 0 FAIL, +42 new,
0 regressions. Static profile 31 / 31 PASS.

Closes architecture baseline finding F7. Cycle 1 of Phase B closed.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-05-11 23:03:45 +03:00
parent 23746ec61d
commit 8a461a2051
23 changed files with 777 additions and 127 deletions
+30 -13
View File
@@ -7,8 +7,8 @@ name: Implement
status: in_progress
sub_step:
phase: 7
name: batch-9-cycle1-az485-complete
detail: "AZ-485 (F4 barrels) implemented + reviewed; batch_09_report saved; archive done; AZ-486 is the next batch in cycle 1"
name: batch-10-cycle1-az486-complete
detail: "AZ-486 (F7 endpoint builders + STC-ARCH-02) implemented + reviewed; batch_10_report saved; archive done; awaiting user approval to commit and then auto-chain to Step 11"
retry_count: 0
cycle: 1
tracker: jira
@@ -23,19 +23,36 @@ step_3_ac_gap_handling: rollback-to-6c (option A)
`glossary.md`, plus `_docs/01_solution/solution.md` and
`_docs/00_problem/{problem,acceptance_criteria,restrictions,security_approach}.md`.
- Implement-skill batch reports at
`_docs/03_implementation/batch_0{1..9}_report.md` (batch 09 = AZ-485 cycle-1 batch-1).
`_docs/03_implementation/batch_0{1..9}_report.md` + `batch_10_report.md`
(batch 09 = AZ-485 cycle-1 batch-1; batch 10 = AZ-486 cycle-1 batch-2).
- Cumulative reviews PASS_WITH_WARNINGS at
`_docs/03_implementation/cumulative_review_batches_01-03_report.md`,
`_docs/03_implementation/cumulative_review_batches_04-06_cycle1_report.md`,
`_docs/03_implementation/cumulative_review_batches_07-08_cycle1_report.md`
(cycle close — Phase A wrap, no batch 9).
- Phase B started. Step 9 (New Task) cycle 1 closed:
- AZ-485 (F4 — Public API barrels + STC-ARCH-01, 5 pts, no deps)
- AZ-486 (F7 — Endpoint builders + STC-ARCH-02, 5 pts, blocked by AZ-485)
- F1 (mission-planner convergence) deliberately not created — needs `/decompose` for 7+ port-group cycles in its own Epic.
- Step 10 (Implement) batch 9 (AZ-485) done:
- 11 new barrels, ~40 production deep imports migrated, ~22 test deep imports migrated.
- `scripts/check-arch-imports.mjs` + `STC-ARCH-01` static gate added (mirrors the `check-banned-deps.mjs` pattern).
- `tests/architecture_imports.test.ts` covers AC-4 / AC-5 + 2 exemption cases (4 new fast tests; total 167 PASS / 13 SKIP / 0 FAIL).
- One F3-pending exemption: `src/features/annotations/classColors` is imported directly (circular-barrel avoidance), documented in 5 places.
- Next: AZ-486 (endpoint builders) — depends on AZ-485 commits landing first.
- Phase B cycle 1 closed (2 batches, both AC + static + fast green):
- AZ-485 (F4 — Public API barrels + STC-ARCH-01, 5 pts) — committed 23746ec
- AZ-486 (F7 — Endpoint builders + STC-ARCH-02, 5 pts) — batch 10 done,
uncommitted, awaiting user approval.
- Step 10 (Implement) batch 10 (AZ-486) done:
- 2 new files (`src/api/endpoints.ts` 25 builders, `src/api/endpoints.test.ts` 36 cases).
- 1 barrel update (`src/api/index.ts` re-exports `endpoints`).
- 13 production files migrated to `endpoints.*` (admin, annotations,
flights, settings, dataset, auth, client, FlightContext,
DetectionClasses, CanvasEditor, VideoPlayer, MediaList,
AnnotationsSidebar, AnnotationsPage).
- `scripts/check-arch-imports.mjs` extended with `--mode=api-literals`
(STC-ARCH-02) alongside `--mode=arch-imports` (STC-ARCH-01);
`scripts/run-tests.sh` wires both modes.
- `tests/architecture_imports.test.ts` extended with 6 STC-ARCH-02 cases
(single/double/template-literal fail paths, *.test.* exemption,
line-comment skip, migrated-codebase pass).
- `_docs/02_document/module-layout.md` `01_api-transport` Public API now
lists `endpoints`; Verification Needed item #3a records F7 resolution.
- Test counts: 167 → 209 PASS / 13 SKIP / 0 FAIL (+42).
- Static: 31 / 31 PASS including new STC-ARCH-02.
- Cumulative code review (K=3): no trigger — Phase B cycle 1 had only 2
batches (9, 10).
- Next on commit of batch 10: auto-chain to Step 11 (Run Tests) via
`test-run/SKILL.md`. Final cycle-1 implementation report (`implementation_report_phase_b_cycle1.md`) is written at that point per
implement skill Step 16 handoff rule.