[AZ-485] [AZ-486] Cycle 1 docs refresh (Step 13)
ci/woodpecker/push/build-arm Pipeline was successful

Phase B cycle 1 was a structural refactor only: F4 (barrel imports +
STC-ARCH-01) and F7 (endpoint builders + STC-ARCH-02). This commit
brings docs in line with source after the cycle, no code changes.

Module docs (12 consumers): swap every /api/<service>/... literal in
code snippets and integration tables for the matching endpoints.*
builder; note the barrel import migration in Dependencies.

New module doc: src__api__endpoints.md (public surface, F4 barrel
re-export note, STC-ARCH-02 enforcement, contract-test reference).

Architecture compliance baseline: mark F4 + F7 CLOSED with commit
hashes (23746ec, 8a461a2).

01_api-transport component description: add endpoints.ts + barrel to
Internal Interfaces, close the F7 caveat, extend Module Inventory.

ripple_log_cycle1.md: Task Step 0.5 reverse-dep analysis records the
import-graph closure (no extra docs needed beyond the direct set).

Carry-over reports landed alongside the docs:
- test_run_report_phase_b_cycle1.md (Step 11 outcome)
- implementation_report_refactor_phase_b_cycle1.md (cycle summary)

State file: trimmed to the autodev <30-line target; Steps 14 + 15
recorded as SKIPPED with rationale (no security or perf surface
changed in this cycle); pointer moved to Step 16 (Deploy).

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Oleksandr Bezdieniezhnykh
2026-05-12 00:01:04 +03:00
parent 8a461a2051
commit 17d5bb45e7
17 changed files with 456 additions and 172 deletions
@@ -0,0 +1,53 @@
# Implementation Report — Phase B Cycle 1 (Refactoring)
**Cycle**: Phase B, cycle 1 (`state.cycle = 1`)
**Date close**: 2026-05-11
**Epic**: AZ-447 (`01-testability-refactoring`)
**Findings closed**: F4 (Public API barrels) + F7 (Endpoint builders) — both from `_docs/02_document/architecture_compliance_baseline.md`
**Total complexity**: 10 pts (5 + 5)
**Verdict**: PASS
## Tasks
| Task | Spec | Batch | Commit | Verdict | AC Coverage |
|------|------|-------|--------|---------|-------------|
| AZ-485 — Public API barrels + STC-ARCH-01 | `_docs/02_tasks/done/AZ-485_refactor_public_api_barrels.md` | batch 9 | `23746ec` | PASS | 7 / 7 |
| AZ-486 — Endpoint builders + STC-ARCH-02 | `_docs/02_tasks/done/AZ-486_refactor_endpoint_builders.md` | batch 10 | `8a461a2` | PASS | 7 / 7 |
Batch reports: `_docs/03_implementation/batch_09_report.md`, `_docs/03_implementation/batch_10_report.md` (canonical per-batch source of truth — design decisions, modified-files inventory, AC test mapping).
## Architecture Outcome
After cycle 1, the `src/` codebase has two coupled static gates that lock in the architecture vision:
1. **`STC-ARCH-01`** (`scripts/check-arch-imports.mjs --mode=arch-imports`) — every cross-component import MUST go through the component's barrel (`src/<component>/index.ts`). Closes F4. One F3-pending exemption (`features/annotations/classColors`) documented in 5 places.
2. **`STC-ARCH-02`** (`scripts/check-arch-imports.mjs --mode=api-literals`) — no hardcoded `/api/<service>/<...>` literals in production source. The single source of truth is `src/api/endpoints.ts`, re-exported via the `01_api-transport` barrel. Closes F7. Exemptions: the contract owner (`endpoints.ts`) and `*.test.tsx?` files under `src/`.
The two gates are symmetric (single shared script, side-by-side `--mode` flags, identical fixture-driven test harness in `tests/architecture_imports.test.ts`). Adding a future STC-ARCH-03 / -04 follows the same pattern.
## Test Suite Delta
| Metric | End of Phase A (Step 7) | End of cycle 1 (Step 11) | Delta |
|--------|-------------------------|---------------------------|-------|
| Fast profile PASS | 163 | **209** | +46 |
| Fast profile SKIP | 13 | 13 | 0 |
| Fast profile FAIL | 0 | 0 | 0 |
| Static profile gates | 29 / 29 PASS | **31 / 31 PASS** | +2 (STC-ARCH-01, STC-ARCH-02) |
No regressions. All 46 new fast tests are additive — 4 new STC-ARCH-01 architecture cases (AZ-485), 6 new STC-ARCH-02 architecture cases (AZ-486), 36 new endpoint contract assertions (AZ-486).
## Code Review Trace
- Per-batch self-review: PASS (0 Critical / 0 High / 0 Medium / 0 Low on both batches).
- Cumulative review (K=3 trigger): not fired — cycle 1 had only 2 batches. Next cumulative review at the next 3-batch window close.
## Productivity Notes (Retro Input)
- **Single script, two modes** (Design Decision #1 in batch 10 report) replaced the obvious-but-wrong choice of forking `check-arch-imports.mjs` into a second script. Saved ~150 LOC of duplicated walker/comment-skip machinery and eliminated a drift surface.
- **All-quote-style regex** (`[`'"]/api/<service>/`) caught a class of regressions the spec's illustrative single-quote ripgrep would have missed. Locked in with 3 quote-style-specific test cases.
- **Resume of in-progress AZ-486 work** at the start of this session: the user's prior session left the working tree with most of AZ-486 done but unrecorded. The autodev orchestrator detected the state/working-tree disagreement and surfaced it as a Choose block before continuing — this is exactly what the state-reconciliation rule in `state.md` is for.
## Next
Auto-chain → Step 12 (Test-Spec Sync, `test-spec/SKILL.md` cycle-update mode).
@@ -0,0 +1,49 @@
# Test Run Report — Phase B Cycle 1 (Step 11)
**Date**: 2026-05-11
**Mode**: functional
**Runner**: `scripts/run-tests.sh` (default profiles: static + fast; e2e env-blocked, see Step 7 report)
**Verdict**: PASS_WITH_DOCUMENTED_GATE
**Handoff**: re-uses the suite run performed under Step 10 batch 10 (implement skill Step 16: avoid duplicate full runs when next flow step is Run Tests). Source state at run-time === source state at commit `8a461a2`.
## Profile Outcomes
| Profile | Status | Counts | Wall-clock | Report file |
|---------|--------|--------|------------|-------------|
| static | PASS | **31 / 31** including new `STC-ARCH-02` | ~14 s | `test-output/summary.csv` |
| fast | PASS | 28 files / **209 PASS / 13 SKIP / 0 FAIL** | ~22.6 s | `test-output/fast-report.xml` |
| e2e | env-blocked (deferred — same registry-access block as Step 7) | n/a | n/a | n/a |
## Delta vs Step 7 baseline
- Fast: 163 / 13 → 209 / 13 (+46 over Phase A close, +42 over end-of-batch-9):
- +4 STC-ARCH-01 architecture tests (added in batch 9 / AZ-485)
- +36 STC-ARCH-02 contract assertions in `src/api/endpoints.test.ts` (this cycle / AZ-486)
- +6 STC-ARCH-02 architecture tests in `tests/architecture_imports.test.ts` (this cycle / AZ-486)
- Static: 29 / 29 → 31 / 31 (+2 new gates: `STC-ARCH-01` AZ-485, `STC-ARCH-02` AZ-486)
- Skip count unchanged at 13 — no new skips introduced this cycle.
## System-Under-Test Reality Gate
PASS (same shape as Step 7):
- `_docs/00_problem/input_data/expected_results/results_report.md` still exists; `_docs/02_document/tests/traceability-matrix.md` still maps every AC. No internal product module was faked, monkeypatched, or replaced with a deterministic fallback by this cycle's batches — verified by self-review for batch 9 and batch 10.
- The refactor surface this cycle (`endpoints.*` + STC-ARCH-02) is pure rewrite-of-string-literals through a typed accessor object; no behavior change, no external system replaced.
- CSV report inspected — all 31 static rows PASS; fast profile rolled-up PASS row points at the JUnit XML.
## Skipped Tests — Same 13 As Step 7, Still Legitimate
The 13 skips are byte-for-byte the same set documented in `test_run_report.md`'s "Skipped Tests — All 13 Accepted as Legitimate" section. None of this cycle's two tasks (AZ-485, AZ-486) touched any of the skip conditions: F4 (barrels) and F7 (URL builders) are pure mechanical refactors of the import path and string-literal layer; they do not change which features ship to production. The user-approved acceptance from Step 7 still applies.
## Environment Block — e2e Profile
Same as Step 7: registry-access block on `azaion/{admin,flights,annotations,detect,loader,resource}:test` images. F4 / F7 changes do not affect Docker images or compose configuration (no Dockerfile or compose edits this cycle), so re-running e2e would not produce different results. Defer to the merge-lane CI per Step 7's user-approved option A.
## Outcome
Step 11 **passes**. Auto-chain to Step 12 (Test-Spec Sync).
## Open Items
Unchanged from Step 7:
- F-CUM-5 production-drift backlog — Phase B / Step 9 work continues into cycle 2.
- F-CUM-4 long-running-soak Playwright config tag — recommended fold-in to merge-lane config.