Skip to content

Phase 1 + Phase 2: M1 stabilize, M2 build — 13 defects closed, 48/48 E2E green#1

Merged
riccardofresi merged 4 commits into
mainfrom
phase-1-m1-stabilize-document
Apr 27, 2026
Merged

Phase 1 + Phase 2: M1 stabilize, M2 build — 13 defects closed, 48/48 E2E green#1
riccardofresi merged 4 commits into
mainfrom
phase-1-m1-stabilize-document

Conversation

@riccardofresi

@riccardofresi riccardofresi commented Apr 27, 2026

Copy link
Copy Markdown
Owner

Summary

Delivers Phase 1 (M1) and Phase 2 (M2) of the Meridian engagement (RFP MC-2026-0417) on a single branch.

Milestone RFP track Status
M1 End of Phase 1 R1 stabilize · R3 framework · R4 documentation
M2 End of Phase 2 R2 Restocking · R3 critical-flow coverage complete · D2 partial (Reports + Backlog i18n)

13 of 16 logged defects closed. 48 / 48 Playwright E2E tests green. All 8 critical flows from the proposal R3 plan shipped.

Commit-by-commit

R1 — Reports module remediation

R2 — Restocking recommendations (new)

  • Backend: `GET /api/restocking/recommendations` with (s, S)-style policy (Silver, Pyke & Thomas, 2017). Greedy budget allocation. Service-level z-score parameterized.
  • Frontend: `/restocking` view with budget input, service-level slider, summary cards, 11-column table with operator-overridable quantities (live cost recompute).
  • 6 E2E tests covering recommendation invariants and operator override propagation.
  • Documented limitation: only the 9 SKUs with active forecasts in `server/data/demand_forecasts.json` get scored.

R3 — Browser test framework + 8 critical flows

# Flow File Tests
1 Login & navigation `01-smoke-navigation.spec.js` 8
2 Inventory filtering `02-inventory-filters.spec.js` 5
3 Orders drill-down `03-orders-drilldown.spec.js` 4
4 Reports + R1 regression contract `04-reports.spec.js` 9
5 Demand forecasts `05-demand.spec.js` 4
6 Backlog + i18n contract `06-backlog.spec.js` 7
7 Spending `07-spending.spec.js` 6
8 Restocking `08-restocking.spec.js` 6

Self-contained in `tests/e2e/` (own `package.json`, no impact on `client/` or `server/`). Sample CI workflow in `tests/e2e/README.md`.

R4 — Architecture documentation

`proposal/architecture.html` — single self-contained file with Mermaid diagrams. 9 sections: system overview, topology, request lifecycle (sequence diagram), API reference, frontend / backend patterns, data layer, technical-debt catalogue (10 items), 5 ADRs.

D2 — i18n (partial — Reports + Backlog)

Reports and Backlog now translate fully into Japanese, joining Inventory / Orders / Demand / Spending which were already done. Remaining D2 work (other small surfaces) can be picked up as a stretch.

Defect log status — 16 logged, 13 closed

Closed: #1, lindsey-anthropic#4, lindsey-anthropic#5, lindsey-anthropic#6, lindsey-anthropic#7, lindsey-anthropic#8, lindsey-anthropic#9, lindsey-anthropic#10, lindsey-anthropic#11 (R1 rewrite + W7 Backlog) · lindsey-anthropic#12, lindsey-anthropic#13, lindsey-anthropic#15, lindsey-anthropic#16 (W3 cleanup) · #DEBT-05 (route registered)
⏸️ Deferred: #2 `/api/tasks` (awaits Tanaka decision); #3 + lindsey-anthropic#14 (PO endpoint absorbed into R2)
⏸️ Open: lindsey-anthropic#17 (Spending percentages sum to ~124% — discovered while writing Flow lindsey-anthropic#7; needs Operations input on intended denominator)
⏸️ Pending: Q1 (filter persistence design intent)

Test plan

  • `cd tests/e2e && npm install && npx playwright install chromium`
  • `cd tests/e2e && npm test` — 48 / 48 green
  • Manual probe via Playwright MCP for every changed surface
  • Backend filter integration verified end-to-end on Reports + Inventory + Orders
  • R2 Restocking exercised with budget tightening and operator overrides
  • Locale switch (EN ↔ JA) verified on Reports and Backlog
  • (Reviewer) Open `proposal/architecture.html` in a browser; confirm Mermaid renders
  • (Reviewer) Run the suite locally to confirm

Out of scope (Phase 3 stretch)

  • D1 — UI modernization (gated by Tanaka co-design)
  • D3 — Dark mode (clean candidate for a separate feature branch / worktree)
  • D2 — extension to remaining minor surfaces
  • Production data layer changes (clarifying question Q3 still open with procurement)
  • Deployment beyond first-launch knowledge transfer to IT

🤖 Generated with Claude Code

riccardofresi and others added 2 commits April 27, 2026 13:43
… E2E

Delivers the Phase 1 milestone (M1) of the Meridian engagement (RFP MC-2026-0417):
the foundation for every subsequent change — Reports module remediation,
current-state architecture documentation, and a Playwright E2E framework that
gates future regressions.

R1 — Reports module remediation (closes 9 of 15 logged defects)
  - Reports.vue rewritten in Composition API (was Options API)
  - Filters now wired through useFilters composable + watch reload
  - Backend /api/reports/* endpoints accept warehouse, category, status, month
  - i18n integration via new reports.* namespace (English + Japanese)
  - api.js centralises calls (no more direct axios from views)
  - Stable v-for keys, console-log spam removed
  - W3 cleanup: brand corrected to Meridian Components, "1 day" pluralization
    helper, Spending alert() removed and toLocaleString -> formatCurrency

R3 — Browser test framework (Playwright, standalone)
  - tests/e2e/ self-contained: package.json, config, 17 specs across 2 files
  - Flow #1 smoke (shell + 6 routes + interactive nav)
  - Flow lindsey-anthropic#4 Reports (existing-behaviour + R1 regression contract)
  - Trace/screenshot/video on failure for IT debuggability
  - README documents stack, conventions, sample CI

R4 — Architecture documentation
  - proposal/architecture.html: 9 sections covering system overview, request
    lifecycle, API reference, frontend/backend patterns, data layer, 10-item
    technical-debt catalogue, and 5 ADRs

Act 1 proposal package (was already produced; included in this milestone for
repo coherence): executive summary, technical approach, timeline + Gantt,
pricing, relevant-experience scaffold, clarifying questions, capabilities deck.

Verification
  - 17/17 Playwright tests pass against the running app
  - Manual snapshot via Playwright MCP confirms brand, pluralization, no
    Reports console noise
  - Defect log (docs/r1-defect-log.md) updated with disposition for all 15
    findings; remaining 6 are deferred (4 await Tanaka decisions, 2 absorbed
    into R2 build) — within the +50% pricing trigger, no T&M conversion

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds Playwright specs for the four remaining non-gated critical flows in the
proposal's R3 plan, raising suite coverage from 17 to 35 green tests.

R3 — Critical flow coverage (4 new flows)
  - Flow #2 Inventory: Category and Location filtering, intersection,
    Reset-button behaviour. 5 tests.
  - Flow #3 Orders: status stat cards, header/row-count consistency,
    items <details> drill-down, Status + Time Period intersection. 4 tests.
  - Flow lindsey-anthropic#5 Demand: three trend cards (increasing/stable/decreasing),
    forecasts table columns, per-row trend value validation, summary-vs-table
    consistency check. 4 tests.
  - Flow lindsey-anthropic#7 Spending: 4 KPI cards with currency values, Revenue vs Costs
    chart bar groups, 4 cost categories with name/amount/percentage,
    Recent Transactions structure, post-cleanup non-clickability. 6 tests.

Tooling
  - Authoring convention reinforced: page.waitForRequest must be armed
    BEFORE the action; selectOption fires synchronously and the request is
    gone by the time a post-action listener attaches.

Defect log
  - lindsey-anthropic#17 added (Low): Spending category percentages labelled "% of total" but
    sum to ~124%. Discovered while writing the Flow lindsey-anthropic#7 spec. Open; resolution
    requires Operations input on the intended denominator.

Verification
  - 35/35 Playwright tests pass against the running app (was 17/17)
  - Defect-log severity counts and disposition table updated to reflect lindsey-anthropic#17
    and the four newly-shipped flows in tests/e2e/README.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@riccardofresi riccardofresi changed the title Phase 1 M1: stabilize Reports, document architecture, baseline E2E Phase 1 M1 + Phase 2 W4-W5: stabilize Reports, baseline E2E, extend coverage Apr 27, 2026
@riccardofresi

Copy link
Copy Markdown
Owner Author

Update — Phase 2 W4–W5 added (commit c1b954a)

Continuing on the same branch since the work is a natural extension of M1 (the R3 framework matures from baseline → broad coverage).

What changed

E2E suite: 17 → 35 green tests. Four new specs covering the remaining non-gated critical flows from the proposal:

Flow Spec Tests
#2 Inventory filtering tests/e2e/specs/02-inventory-filters.spec.js 5
#3 Orders drill-down tests/e2e/specs/03-orders-drilldown.spec.js 4
lindsey-anthropic#5 Demand forecasts tests/e2e/specs/05-demand.spec.js 4
lindsey-anthropic#7 Spending tests/e2e/specs/07-spending.spec.js 6

Flows still pending: lindsey-anthropic#6 Backlog (gated by #DEBT-05 — view not registered in the router) and lindsey-anthropic#8 Restocking (Phase 2 R2 build).

New defect logged

lindsey-anthropic#17 (Low) — Spending category percentages display "% of total" but sum to ~124%. Surfaced while writing the 07-spending.spec.js consistency test. Resolution requires Operations input on the intended denominator (% of overall spend vs % of own bucket).

Verification

  • cd tests/e2e && npm test35 / 35 green
  • Defect log + E2E README status table updated

The R2 deliverable from RFP §3.1: a new Restocking view that recommends
purchase orders given current stock, demand forecast, and an operator-supplied
budget ceiling. Built without a Discovery session (Tanaka unavailable in the
workshop simulation), using the assumptions from the proposal — (s, S) policy
with newsvendor service-level calibration (Silver, Pyke & Thomas, 2017).

Backend (server/main.py)
  - GET /api/restocking/recommendations?budget=&service_level=&warehouse=&category=
  - For each inventory item with a matching demand forecast:
      shortfall = max(0, forecast - on_hand)
      qty       = shortfall (or reorder_point - on_hand if below ROP)
      cost      = qty * unit_cost
      criticality = shortfall * unit_cost  (urgency × value at stake)
  - Greedy budget allocation: sort by criticality desc, mark in_budget while
    cumulative cost <= ceiling.
  - Service level snaps to the closest tabulated z-score (0.80 .. 0.99). Today
    z is informational; when forecasts add σ_LT, it moves into the formula.
  - Documented limitation: only SKUs with a forecast in
    server/data/demand_forecasts.json get scored (currently 9 of 32).

Frontend (client/src/views/Restocking.vue)
  - Operator controls: budget input, service-level slider (80–99%),
    "Generate" button.
  - Five summary cards: Candidates / In budget / Out of budget /
    Total selected cost / Budget remaining.
  - Recommendations table: 11 columns including operator-overridable Qty
    input. Editing Qty recomputes Est. Cost client-side; status badges
    distinguish in-budget vs out-of-budget rows.
  - Auto-loads on mount; integrates with useFilters? — no, this is a
    single-purpose tool that uses its own controls (budget/service-level)
    rather than the global filter bar.
  - Composition API throughout, useI18n for all strings.

Routing (client/src/main.js, App.vue)
  - /restocking route registered.
  - "Restocking" added to the top nav after "Reports".

Internationalisation
  - Full restocking.* namespace added to en.js and ja.js (37 keys × 2 locales).

Browser tests (tests/e2e/specs/08-restocking.spec.js)
  - 6 specs covering: page render, table columns, summary↔table consistency,
    sort-by-criticality invariant, budget-tightening behaviour, operator
    override propagation.

Verification
  - 41/41 Playwright tests pass (was 35/35; +6 for Flow lindsey-anthropic#8).
  - Manual probe via Playwright MCP confirms: 4 candidates ranked by Est.
    Cost desc, all in budget at $100k ($65,965 total, $34,035 remaining),
    overrides update the table in real time.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@riccardofresi riccardofresi changed the title Phase 1 M1 + Phase 2 W4-W5: stabilize Reports, baseline E2E, extend coverage Phase 1 + Phase 2: stabilize, document, baseline E2E, ship R2 Restocking Apr 27, 2026
@riccardofresi

Copy link
Copy Markdown
Owner Author

Update — Phase 2 W5–W7: R2 Restocking shipped (commit `09bbbe5`)

The new Restocking capability from RFP §3.1, end-to-end.

Backend

`GET /api/restocking/recommendations` accepts `budget`, `service_level`, `warehouse`, `category`. For each SKU with an active demand forecast, computes shortfall, recommended quantity, estimated cost, and criticality. Greedy budget allocation marks rows in/out of budget. Service-level z-score is informational today; moves into the formula when σ_LT is added to the forecast data.

Frontend

New `/restocking` view with budget input, service-level slider, summary cards, and an 11-column recommendations table. Quantities are operator-overridable — editing the Qty input recomputes the cost cell live. Composition API + `useI18n` (37 keys × 2 locales).

E2E

Flow lindsey-anthropic#8 `tests/e2e/specs/08-restocking.spec.js` — 6 tests covering page render, columns, summary/table consistency, sort-by-criticality invariant, budget-tightening behaviour, operator-override propagation.

Suite status

41 / 41 green (was 35).

Documented limitation

Only the 9 SKUs in `server/data/demand_forecasts.json` get scored. Operations can extend forecast coverage without code changes; the engine handles the new SKUs automatically.

Built-without-Discovery caveat

The proposal had R2 gated by a W4 Discovery session with VP Operations. The workshop simulation didn't run that session, so the build follows the proposal's documented assumptions:

  • (s, S) policy with newsvendor calibration (Silver, Pyke & Thomas, 2017)
  • Service level default 95%, configurable via UI slider
  • Operator override is a first-class feature, not an afterthought

If a real Discovery session were held, the calibration parameters and ranking heuristic would adjust — that's the T&M cap's purpose.

…ropic#6

Closes the last gated R1 cleanup items by registering a route for the
Backlog view (which had been dead code in the previous vendor's handoff)
and translating it through the same useI18n + pluralize plumbing used
elsewhere.

Routing
  - /backlog route registered in main.js
  - "Backlog" link added to App.vue nav after "Restocking"

Backlog.vue rewrite
  - Adds useI18n; all hardcoded English strings move to a new backlog.*
    namespace (en + ja, 21 keys)
  - Days Delayed renders via pluralize() — "1 day" vs "n days"
  - Priority badges use t(`priority.${item.priority}`) so the lowercase
    raw value never reaches the DOM (defect lindsey-anthropic#9)
  - Empty-state copy moved out of inline styles into scoped CSS
  - useFilters integration preserved (Backlog already had this part right)

Browser tests
  - tests/e2e/specs/06-backlog.spec.js — 7 specs covering routing,
    priority stats, table structure, translated badges, "1 day"
    pluralization, EN→JA translation contract
  - Locale-leak fix: tests that switch the language now reset
    localStorage in afterEach (specs 04 + 06). Without this the JP UI
    leaks across worker boundaries and breaks subsequent tests that
    assert English text — surfaced by a flaky run during this commit's
    development.

Defect log + README
  - lindsey-anthropic#8, lindsey-anthropic#9 marked closed (were gated by #DEBT-05)
  - #DEBT-05 closed implicitly (route now exists)
  - Flow lindsey-anthropic#6 status flipped to shipped in tests/e2e/README.md

Verification
  - 48/48 Playwright tests pass (was 41)
  - Manual probe via Playwright MCP confirms: page reachable from nav,
    "1 day" vs "5 days" rendered correctly, priority badges translated,
    JA switch translates the title to バックログ管理

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@riccardofresi

Copy link
Copy Markdown
Owner Author

Update — W7 closes the last gated R1 items (commit `3a0eadd`)

Backlog routing + i18n

Flow lindsey-anthropic#6 — Backlog E2E

`tests/e2e/specs/06-backlog.spec.js` — 7 tests: routing reachability, priority stat cards, table columns, translated badge contract, "1 day" pluralization contract, EN → JA title contract.

Bonus: locale-leak fix

The JA-switch tests in Flow lindsey-anthropic#4 (Reports) and Flow lindsey-anthropic#6 (Backlog) used to leak `localStorage['app-locale'] = 'ja'` to subsequent tests on the same Playwright worker. Surfaced as a flaky failure during this commit's development. Fixed via `afterEach` that clears the key.

Suite status

48 / 48 green, all eight critical flows shipped. R3 coverage complete.

@riccardofresi riccardofresi changed the title Phase 1 + Phase 2: stabilize, document, baseline E2E, ship R2 Restocking Phase 1 + Phase 2: M1 stabilize, M2 build — 13 defects closed, 48/48 E2E green Apr 27, 2026
@riccardofresi riccardofresi merged commit 7e7fe86 into main Apr 27, 2026
@riccardofresi riccardofresi deleted the phase-1-m1-stabilize-document branch April 27, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant