[AZ-485] Add Public API barrels + STC-ARCH-01 (F4 close)

Closes architecture baseline finding F4. Every component now exposes
its Public API through `src/<component>/index.ts`; cross-component
imports go through the barrel. `scripts/check-arch-imports.mjs` plus
`STC-ARCH-01` in the static profile enforce the rule; tests in
`tests/architecture_imports.test.ts` cover AC-4/AC-5 + 2 exemption
cases. One F3-pending exemption (`classColors`) is documented in 5
places (barrel, consumer, script, doc, test) to avoid a circular
import.

Phase B cycle 1 batch 1 of 2 (epic AZ-447). Batch 2 is AZ-486
(endpoint builders) — blocked on this commit landing.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-05-11 10:33:30 +03:00
parent 2071a24391
commit 23746ec61d
56 changed files with 455 additions and 101 deletions
+20 -19
View File
@@ -2,9 +2,9 @@
**Status**: derived-from-code
**Language**: typescript (React 19 + Vite + Tailwind)
**Layout Convention**: custom (flat-features under `src/`; no per-component barrels)
**Layout Convention**: custom (flat-features under `src/`; per-component barrels at `src/<component>/index.ts` since AZ-485)
**Root**: `src/`
**Last Updated**: 2026-05-10
**Last Updated**: 2026-05-11
> Authoritative file-ownership map for the React UI workspace. Derived from
> `_docs/02_document/00_discovery.md` (dependency graph) and the Step 2
@@ -16,7 +16,7 @@
1. Each component owns ONE OR MORE top-level directories (or top-level files) under `src/`. The mapping is NOT 1:1 — `00_foundation` owns three sibling directories (`src/types/`, `src/hooks/`, `src/i18n/`), `05_flights` spans `src/features/flights/` AND a separate `mission-planner/` port-source root, and `10_app-shell` owns top-level files (`App.tsx`, `main.tsx`, `index.css`, `vite-env.d.ts`).
2. Shared code does **not** live under `src/shared/` today — there is no `shared/` directory. Two helper modules (`11_class-colors/classColors.ts` and `06_annotations/CanvasEditor.tsx`) are physically misplaced and consumed across components; both are flagged in the `## Verification Needed` block. A `src/shared/` directory is a Step 4 testability candidate.
3. Public API per component: NO barrel `index.ts` exists at any component root. The only `index.ts` files are `src/types/index.ts` (a re-export hub for type aliases used as the de-facto public API for `00_foundation` types) and `mission-planner/src/types/index.ts`. Until Step 4 introduces barrels, Public API is approximated as "every named export from any file under the component's owned directories". Cross-component imports ARE happening at file-name granularity (`import { api } from '../api/client'`, `import { CanvasEditor } from '../annotations/CanvasEditor'`).
3. **Public API per component is the barrel `src/<component>/index.ts`** (AZ-485 / F4). Every component except `10_app-shell` (which is a top-level file collection — `App.tsx`, `main.tsx`, etc., never imported as a unit) exposes its Public API through a root barrel. Cross-component imports MUST go through the barrel — `import { api } from '../api'`, not `from '../api/client'`. The `STC-ARCH-01` static gate (`scripts/check-arch-imports.mjs`, wired into `scripts/run-tests.sh --static-only`) fails the build on cross-component deep imports. Intra-component imports (relative `./`) remain free. **One F3-pending exemption**: `src/features/annotations/classColors` is imported directly because the file is logically owned by `11_class-colors` but physically lives under `06_annotations`; re-exporting it through the `06_annotations` barrel creates a circular import (AnnotationsPage → DetectionClasses → 06_annotations barrel → AnnotationsPage). The exemption disappears when F3 moves the file.
4. Cross-cutting concerns (logging, config, error handling, telemetry): no dedicated infrastructure today. `console.error` / silent catches are the closest thing — recorded in module findings.
5. Tests: there are **zero tests** under `src/`. The only test file is `mission-planner/src/test/jsonImport.test.ts`, which can't run because Jest isn't installed (00_discovery.md §11.5). Test layout is therefore TBD; suggest `src/<component>/__tests__/` per the standard React convention when tests are added (autodev Step 56).
@@ -26,7 +26,7 @@
- **Epic**: TBD (set during autodev Step 4 / Decompose)
- **Directories**: `src/types/`, `src/hooks/`, `src/i18n/`
- **Public API** (de-facto, no barrel):
- **Public API** (no `src/<component>/index.ts` barrel — `00_foundation` spans three sibling directories; the existing `src/types/index.ts` is the type-alias barrel and `src/hooks/` + `src/i18n/` are imported directly per file):
- `src/types/index.ts` — every exported type alias (`Detection`, `Flight`, `MediaItem`, `User`, etc.)
- `src/hooks/useDebounce.ts``useDebounce`
- `src/hooks/useResizablePanel.ts``useResizablePanel`
@@ -40,7 +40,7 @@
- **Epic**: TBD
- **Directories**: (none today — physical file lives at `src/features/annotations/classColors.ts`, which is owned by `06_annotations` on disk). Logical owner is this component; physical move to `src/shared/classColors.ts` (or `src/components/detection/classColors.ts`) is a Step 4 testability task.
- **Public API**: `src/features/annotations/classColors.ts` exports `getClassColor`, `getClassNameFallback`, `getPhotoModeSuffix`, `FALLBACK_CLASS_NAMES`.
- **Public API**: `getClassColor`, `getClassNameFallback`, `getPhotoModeSuffix`, `FALLBACK_CLASS_NAMES` — exported from `src/features/annotations/classColors.ts`. **No barrel** today because the file is physically inside `06_annotations`; consumers import the path directly under the F3-pending exemption documented in Layout Rule #3 and enforced by STC-ARCH-01. When F3 moves the file to its own component directory, a `src/<new-home>/index.ts` barrel will replace the direct path import and the STC-ARCH-01 exemption will be removed.
- **Internal**: module-private `CLASS_COLORS` constant.
- **Owns**: pending — see Verification Needed item #1.
- **Imports from**: (none — Layer 0/1, no internal imports)
@@ -50,7 +50,7 @@
- **Epic**: TBD
- **Directory**: `src/api/`
- **Public API** (de-facto): `src/api/client.ts` exports `api` (fetch wrapper); `src/api/sse.ts` exports `subscribeSSE` / equivalent helper.
- **Public API** (via `src/api/index.ts` barrel): `api`, `setToken`, `getToken`, `getApiBase`, `setNavigateToLogin`, `createSSE`.
- **Internal**: none (both files are externally consumed)
- **Owns**: `src/api/**`
- **Imports from**: `00_foundation` (types)
@@ -60,7 +60,7 @@
- **Epic**: TBD
- **Directory**: `src/auth/`
- **Public API**: `src/auth/AuthContext.tsx` exports `AuthProvider`, `useAuth`. `src/auth/ProtectedRoute.tsx` exports `ProtectedRoute`.
- **Public API** (via `src/auth/index.ts` barrel): `AuthProvider`, `useAuth`, `ProtectedRoute`.
- **Internal**: none
- **Owns**: `src/auth/**`
- **Imports from**: `00_foundation`, `01_api-transport`
@@ -70,7 +70,7 @@
- **Epic**: TBD
- **Directory**: `src/components/`
- **Public API** (de-facto, all are externally consumed):
- **Public API** (via `src/components/index.ts` barrel — all symbols externally consumed):
- `Header.tsx``Header`
- `HelpModal.tsx``HelpModal`
- `ConfirmDialog.tsx``ConfirmDialog`
@@ -85,7 +85,7 @@
- **Epic**: TBD
- **Directory**: `src/features/login/`
- **Public API**: `LoginPage.tsx` `LoginPage`
- **Public API** (via `src/features/login/index.ts` barrel): `LoginPage`.
- **Internal**: none (single-page component)
- **Owns**: `src/features/login/**`
- **Imports from**: `00_foundation`, `01_api-transport`, `02_auth`
@@ -97,7 +97,7 @@
- **Directories** (TWO physical roots):
- `src/features/flights/` — deployed target tree (15 modules)
- `mission-planner/` — port-source, NOT deployed (37 modules under `mission-planner/src/`). Documented inside this component per the user's Step 2 BLOCKING-gate decision (`_docs/02_document/state.json::component_05_flights_merge_2026-05-10`). The port direction is `mission-planner/``src/features/flights/`; module-layout treats both trees as owned by this component but only the target tree is in the layering table below.
- **Public API** (target tree, de-facto): `FlightsPage.tsx` `FlightsPage` (route component). Internal sub-components (`FlightMap`, `FlightParamsPanel`, `FlightListSidebar`, `WaypointList`, `AltitudeChart`, `AltitudeDialog`, `WindEffect`, `MiniMap`, `MapPoint`, `DrawControl`, `JsonEditorDialog`, `mapIcons`, `flightPlanUtils`, `types`) are NOT consumed outside the component.
- **Public API** (target tree, via `src/features/flights/index.ts` barrel): `FlightsPage` (route component). Internal sub-components (`FlightMap`, `FlightParamsPanel`, `FlightListSidebar`, `WaypointList`, `AltitudeChart`, `AltitudeDialog`, `WindEffect`, `MiniMap`, `MapPoint`, `DrawControl`, `JsonEditorDialog`, `mapIcons`, `flightPlanUtils`, `types`) are NOT re-exported through the barrel.
- **Public API** (port-source `mission-planner/`): not consumed at all by `src/` today (separate Vite entrypoint, `main.tsx` of its own). Effectively a private vendored sibling.
- **Internal** (target tree): every file under `src/features/flights/` except `FlightsPage.tsx`
- **Internal** (port-source): every file under `mission-planner/`
@@ -109,9 +109,10 @@
- **Epic**: TBD
- **Directory**: `src/features/annotations/`
- **Public API** (de-facto):
- `AnnotationsPage.tsx``AnnotationsPage` (route component)
- `CanvasEditor.tsx``CanvasEditor`**also imported by `07_dataset`** (cross-feature edge, see Verification Needed #3)
- **Public API** (via `src/features/annotations/index.ts` barrel):
- `AnnotationsPage` (route component)
- `CanvasEditor`**also imported by `07_dataset`** (cross-feature edge, see `architecture_compliance_baseline.md` F2). The barrel re-exports `CanvasEditor` to keep the consumer compliant with STC-ARCH-01 until F2 closes the edge.
- **NOT re-exported** through this barrel: `classColors` symbols (`getClassColor`, `getClassNameFallback`, `getPhotoModeSuffix`, `FALLBACK_CLASS_NAMES`). Re-exporting them would create a circular barrel import (`AnnotationsPage → DetectionClasses → 06_annotations barrel → AnnotationsPage`). Consumers import `src/features/annotations/classColors` directly under the F3-pending exemption recorded in Layout Rule #3 and in STC-ARCH-01.
- **Internal**: `MediaList.tsx`, `VideoPlayer.tsx`, `AnnotationsSidebar.tsx`
- **Owns**: `src/features/annotations/**` EXCEPT `classColors.ts` (logically owned by `11_class-colors`; physical home pending refactor)
- **Imports from**: `00_foundation`, `11_class-colors`, `01_api-transport`, `03_shared-ui`
@@ -121,7 +122,7 @@
- **Epic**: TBD
- **Directory**: `src/features/dataset/`
- **Public API**: `DatasetPage.tsx` `DatasetPage`
- **Public API** (via `src/features/dataset/index.ts` barrel): `DatasetPage`.
- **Internal**: none (single-page)
- **Owns**: `src/features/dataset/**`
- **Imports from**: `00_foundation`, `11_class-colors` (only when class-distribution chart is added — not in code yet), `01_api-transport`, `03_shared-ui`, **`06_annotations` (CanvasEditor cross-feature edge)**
@@ -131,7 +132,7 @@
- **Epic**: TBD
- **Directory**: `src/features/admin/`
- **Public API**: `AdminPage.tsx` `AdminPage`
- **Public API** (via `src/features/admin/index.ts` barrel): `AdminPage`.
- **Internal**: none (single-page)
- **Owns**: `src/features/admin/**`
- **Imports from**: `00_foundation`, `01_api-transport`, `03_shared-ui`
@@ -141,7 +142,7 @@
- **Epic**: TBD
- **Directory**: `src/features/settings/`
- **Public API**: `SettingsPage.tsx` `SettingsPage`
- **Public API** (via `src/features/settings/index.ts` barrel): `SettingsPage`.
- **Internal**: none (single-page)
- **Owns**: `src/features/settings/**`
- **Imports from**: `00_foundation`, `01_api-transport`, `03_shared-ui`
@@ -151,7 +152,7 @@
- **Epic**: TBD
- **Files** (no dedicated directory): `src/App.tsx`, `src/main.tsx`, `src/index.css`, `src/vite-env.d.ts`
- **Public API**: `main.tsx` is the Vite entrypoint (no symbols are externally imported). `App.tsx` exports `App`.
- **Public API**: `main.tsx` is the Vite entrypoint (no symbols are externally imported). `App.tsx` exports `App`. **No barrel** — the component is a top-level file collection, never imported as a unit. STC-ARCH-01's component allowlist intentionally omits `10_app-shell`.
- **Internal**: `index.css` (global Tailwind base + `az-*` design-token CSS variables), `vite-env.d.ts` (type shim)
- **Owns**: `src/App.tsx`, `src/main.tsx`, `src/index.css`, `src/vite-env.d.ts`
- **Imports from**: every other component (it is the composition root)
@@ -224,7 +225,7 @@ The following inferences could not be made cleanly from code alone. They are sur
2. **Physical home of `CanvasEditor.tsx`**. Same shape: it lives under `06_annotations` and is consumed cross-feature by `07_dataset`. Proposed: `src/components/canvas/CanvasEditor.tsx` (or a new `06b_canvas` component). **Decision needed**: keep the same-layer cross-feature edge, or schedule the lift?
3. **No barrel exports anywhere**. The codebase imports cross-component at file-name granularity (`import { api } from '../api/client'`). This means every internal file is *de-facto* Public API. Recommendation: Step 4 testability task to add `src/<component>/index.ts` barrels per component, locking the public surface. **Decision needed**: add barrels now or stay file-import?
3. ~~No barrel exports anywhere~~**resolved by AZ-485 (F4)**. Every component now exposes a `src/<component>/index.ts` barrel; cross-component imports go through it; `STC-ARCH-01` enforces it. One F3-pending exemption (`classColors`) remains documented in Layout Rule #3 above and in `architecture_compliance_baseline.md`.
4. **`mission-planner/` is owned by `05_flights` but lives at the repo root** (not under `src/`). Layout rule #1 says one component owns one or more top-level directories — this satisfies the rule (it owns two: `src/features/flights/` AND `mission-planner/`). Implement-skill consumers must include `mission-planner/**` in `05_flights`'s OWNED glob. **Decision needed**: confirm the implement skill should treat `mission-planner/**` as OWNED by 05_flights (otherwise it's FORBIDDEN by default).
@@ -240,4 +241,4 @@ The following inferences could not be made cleanly from code alone. They are sur
| Language | Root | Per-component path | Public API file | Test path |
|----------|------|-------------------|-----------------|-----------|
| TypeScript / React | `src/` | `src/<component>/` (this codebase deviates: features under `src/features/<feature>/`, shared chrome under `src/components/`) | `src/<component>/index.ts` (barrel — none exist today) | `src/<component>/__tests__/` (none exist today) |
| TypeScript / React | `src/` | `src/<component>/` (this codebase deviates: features under `src/features/<feature>/`, shared chrome under `src/components/`) | `src/<component>/index.ts` (barrel; present for every component except `10_app-shell` — see Layout Rule #3) | `src/<component>/__tests__/` (none exist today) |
@@ -0,0 +1,82 @@
# Batch Report
**Batch**: 09 (Phase B cycle 1, batch 1 of 2)
**Tasks**: AZ-485 (Public API barrels + STC-ARCH-01)
**Date**: 2026-05-11
**Cycle**: Phase B feature cycle, Step 10 — Implement
**Total complexity**: 5 pts
**Epic**: AZ-447 (`01-testability-refactoring`)
**Closes**: architecture baseline finding **F4** (`_docs/02_document/architecture_compliance_baseline.md`)
## Task Results
| Task | Status | Files Modified / Added | Tests | AC Coverage | Issues |
|------|--------|------------------------|-------|-------------|--------|
| AZ-485_refactor_public_api_barrels | Done | **11 new barrels** (`src/{api,auth,components,hooks,i18n}/index.ts`, `src/features/{login,flights,annotations,dataset,admin,settings}/index.ts`); **1 new script** (`scripts/check-arch-imports.mjs`); **1 new test** (`tests/architecture_imports.test.ts`); **1 modified runner** (`scripts/run-tests.sh``STC-ARCH-01` wired in); **17 production import sites** migrated to barrel paths (App.tsx + every feature page + every `src/components/` consumer); **22 test/colocated test import sites** migrated; **1 doc** (`_docs/02_document/module-layout.md`) — Layout Rules #3 rewritten, Verification Needed #3 closed, every component's Public API line points to its barrel | 4 new architecture tests in `tests/architecture_imports.test.ts` (AC-4 / AC-5 + 2 exemption cases); fast profile re-baselined from 163 → 167 passes (no regressions) | 7 / 7 ACs covered | One **F3-pending exemption** carried forward: `src/features/annotations/classColors` is imported directly (not through the `06_annotations` barrel) to avoid a circular import; documented in the barrel, the consumers, the static check, the module-layout doc, and the new test |
## AC Test Coverage: All 7 ACs covered
| AC | Where | Profile | Status |
|----|-------|---------|--------|
| AC-1 — Every component has a barrel exposing only its Public API | `src/<component>/index.ts` × 11 vs `module-layout.md` Per-Component Mapping → Public API | static (manual cross-check in self-review) | PASS — each barrel's re-export list matches the documented Public API line one-for-one; no internal-only symbol leaks |
| AC-2 — No cross-component deep imports remain in production code | `scripts/check-arch-imports.mjs` scanning `src/` | static (`STC-ARCH-01`) | PASS — 0 deep imports outside the documented F3 exemption |
| AC-3 — No cross-component deep imports remain in tests | same script scanning `tests/` + `e2e/` | static (`STC-ARCH-01`) | PASS — 0 deep imports outside the documented F3 exemption |
| AC-4 — Static gate fails on a newly-introduced deep import | `tests/architecture_imports.test.ts` `AC-4: FAILS when a deep import...` + `AC-4: deep imports inside line comments do not trip the gate` | fast | PASS — the synthetic fixture (`tests/_arch_fixtures/synthetic_deep_import.ts`) flips the script to exit non-zero and emits `STC-ARCH-01 — ...` on stderr |
| AC-5 — Static gate passes on the migrated codebase | `tests/architecture_imports.test.ts` `AC-5: passes on the migrated codebase` + `STC-ARCH-01` run in the static profile | fast + static | PASS — exit code 0, stderr empty |
| AC-6 — Fast profile remains green | `bash scripts/run-tests.sh` (static + fast) | static + fast | PASS — 167 / 13 / 0 (baseline was 163 / 13 / 0 + 4 new architecture tests); 0 regressions |
| AC-7 — module-layout.md reflects the new convention | `_docs/02_document/module-layout.md` Layout Rules #3 + Verification Needed #3 + Conventions table + every component's Public API line | manual review | PASS — Rule #3 names the barrel as the Public API, names `STC-ARCH-01` as the enforcing gate, and the F3-pending exemption is documented inline; Verification Needed #3 marked closed by AZ-485 |
## Design Decisions
1. **Single source of truth for the static check**`scripts/check-arch-imports.mjs` mirrors the existing `scripts/check-banned-deps.mjs` pattern (AZ-482). The bash function `static_check_no_cross_component_deep_imports` in `scripts/run-tests.sh` is a one-line delegate. The new unit test invokes the script directly with `spawnSync`, so a regex regression in the script trips the test even if the bash glue still reports PASS.
2. **classColors exemption is structural, not stylistic** — Re-exporting `classColors` symbols through the `06_annotations` barrel creates a runtime circular import (`AnnotationsPage → DetectionClasses → 06_annotations barrel → AnnotationsPage`) that materializes as `FALLBACK_CLASS_NAMES === undefined` inside `DetectionClasses`. The exemption is documented in five places (the barrel file, the consumer file, the static-check script's `EXEMPT_RE` comment, `module-layout.md` Layout Rule #3, and the architecture test) so it cannot be forgotten when F3 lands.
3. **`10_app-shell` intentionally has no barrel** — The component is a collection of root-level files (`App.tsx`, `main.tsx`, `index.css`, `vite-env.d.ts`) never imported as a unit. STC-ARCH-01's component allowlist (`api|auth|components|features/[a-z-]+|hooks|i18n`) intentionally omits app-shell; the doc records this explicitly.
4. **Test-file deep-import string concatenation**`tests/architecture_imports.test.ts` builds its synthetic offending strings via concatenation (`'fr' + 'om'`, `'..' + '/..'`) so the scanner does not flag the test source itself when it walks `tests/`. The fixtures created at runtime go under `tests/_arch_fixtures/` and are torn down in `afterEach`.
## Code Review Verdict: PASS
Self-review (implement skill Step 9 / 10), applied to the 13 new + 17 production + 22 test + 1 runner + 1 doc + 1 script changes:
- **0 Critical, 0 High, 0 Medium, 0 Low findings.**
- **Scope discipline**: every modified file is one of (barrel author, deep-import consumer, static-check author, doc author). The 4 originally-untracked-and-edited test files (`annotations_endpoint`, `destructive_ux`, `form_hygiene`, `overlay_membership`) are pre-existing committed test files where the only edit is import-path migration.
- **No silent error suppression**: `check-arch-imports.mjs` writes the full hit list to stderr before exiting non-zero; the bash delegate propagates the exit code; `run-tests.sh` records the failure into the static CSV.
- **Single-responsibility**: each barrel re-exports its component's documented Public API only. `check-arch-imports.mjs` has one job (detect cross-component deep imports). The new test exercises only that script.
- **No new dependencies**: `check-arch-imports.mjs` uses Node stdlib (`fs`, `path`, `url`) only. The architecture test uses Vitest + Node stdlib.
- **Architecture compliance (Phase 7)**: no layer-direction violations introduced; the only cross-feature edge (`07_dataset → 06_annotations` for `CanvasEditor`, F2) is grandfathered exactly as before — `CanvasEditor` is intentionally re-exported through the `06_annotations` barrel so the consumer is barrel-compliant. STC-ARCH-01 confirms no new cyclic dependencies.
## Auto-Fix Attempts: 1
One auto-fix loop entered during Phase 3 (test import migration):
- **Symptom**: `tests/detection_classes.test.tsx` failed with `TypeError: Cannot read properties of undefined (reading 'map')` after `FALLBACK_CLASS_NAMES` was migrated to import through the `06_annotations` barrel.
- **Diagnosis**: barrel-induced circular import — `AnnotationsPage → DetectionClasses → 06_annotations barrel → AnnotationsPage`. The barrel module evaluated before `classColors` exports were bound, so the symbol resolved to `undefined`.
- **Fix**: remove `classColors` re-exports from the `06_annotations` barrel, document the F3-pending exemption in five places (see Design Decision #2), point the consumer + the test back at the direct path `src/features/annotations/classColors`.
- **Validation**: fast profile back to green; STC-ARCH-01 unit test added an exemption case (`AC-4: still PASSES when only the classColors F3-pending exemption is used`) so the carve-out is regression-tested.
## Stuck Agents: None
No multi-pass investigations beyond the auto-fix above.
## Test Run Summary
- `bun run test:fast` (via `bash scripts/run-tests.sh`) — 27 files / 167 passed / 13 skipped / 21.11 s wall (+4 new tests vs Phase A close at 163; 0 regressions).
- `bash scripts/run-tests.sh --static-only` — 30 / 30 static checks PASS (added `STC-ARCH-01`; no regressions in the existing 29).
- `node scripts/check-arch-imports.mjs` (direct invocation) — exit 0, stderr empty on the migrated codebase; exit 1 on every synthetic fixture in the architecture test.
- `ReadLints` — clean on all 13 new files.
- `git diff --stat` — 41 modified + 13 new files; +113 / -99 net lines; mostly mechanical one-line import path edits.
## Documented Drifts (cumulative across batch)
| Drift | Where | Spec/AC affected | Resolves when |
|-------|-------|------------------|---------------|
| `classColors` symbols cannot flow through the `06_annotations` barrel due to a circular import | `src/features/annotations/index.ts` (export omitted by design); 5 cross-doc mentions | F3 (Medium / Architecture) — `architecture_compliance_baseline.md` | F3 moves `classColors.ts` out of `06_annotations` into its own component directory (`src/shared/classColors.ts` or a dedicated `11_class-colors` directory); F3 closes by adding a `src/<new-home>/index.ts` barrel and removing the STC-ARCH-01 exemption |
(No other drifts surfaced.)
## Phase B Cycle 1 Status
This is **batch 1 of 2** in Phase B cycle 1 (the cycle covers baseline findings F4 + F7 under epic AZ-447). Batch 2 will implement **AZ-486** — endpoint builders in `src/api/endpoints.ts` + `STC-ARCH-02` for hardcoded `/api/<service>/…` paths — which depends on this batch landing first (`endpoints` ships through the new `src/api` barrel; Jira "Blocks" link AZ-485 → AZ-486).
## Next Batch
**AZ-486** (5 pts) — endpoint builders + STC-ARCH-02. Spec already in `_docs/02_tasks/todo/AZ-486_refactor_endpoint_builders.md`.
+11 -6
View File
@@ -4,11 +4,11 @@
flow: existing-code
step: 10
name: Implement
status: not_started
status: in_progress
sub_step:
phase: 0
name: awaiting-invocation
detail: "Step 9 closed; AZ-485 (F4 barrels) + AZ-486 (F7 endpoints) ready in todo/; AZ-485 first (AZ-486 depends on barrel)"
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"
retry_count: 0
cycle: 1
tracker: jira
@@ -23,7 +23,7 @@ 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..8}_report.md`.
`_docs/03_implementation/batch_0{1..9}_report.md` (batch 09 = AZ-485 cycle-1 batch-1).
- 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`,
@@ -33,4 +33,9 @@ step_3_ac_gap_handling: rollback-to-6c (option A)
- 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) starts with AZ-485 — `Blackbox Tests` owns the static-check addition and the `tests/**` import-path migration; production component teams own their barrel files per `module-layout.md`.
- 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.