Skip to content

feat: yamazumi reporting with mode-specific KPIs and activity breakdown#19

Merged
jukka-matti merged 13 commits into
mainfrom
feat/yamazumi-reporting
Mar 21, 2026
Merged

feat: yamazumi reporting with mode-specific KPIs and activity breakdown#19
jukka-matti merged 13 commits into
mainfrom
feat/yamazumi-reporting

Conversation

@jukka-matti
Copy link
Copy Markdown
Owner

Summary

  • Add yamazumi-specific report view with ReportYamazumiKPIGrid, ReportActivityBreakdown, and lean improvement tooltips
  • Wire yamazumi mode into ReportViewBase with finding-driven Step 2 and mode-specific section titles
  • Generalize ReportCpkLearningLoop for multi-metric support (Cpk + cycle time)
  • Add time-based subgrouping for capability mode (ADR-038)
  • Add lean improvement principle and reporting section to yamazumi documentation

Test Plan

  • All 568+ vitest tests pass across all packages
  • Verify yamazumi report renders correct KPIs and activity breakdown
  • Verify capability mode time-based subgrouping works correctly
  • Verify standard report mode is unaffected by changes

jukka-matti and others added 13 commits March 21, 2026 00:31
…ng CI

Update pnpm.overrides to pin patched versions of flatted (3.4.2),
h3 (1.15.9), and fast-xml-parser (5.5.8) to resolve 3 high-severity
CVEs in eslint/astro/azure-sdk dependency chains.

Co-Authored-By: ruflo <ruv@ruv.net>
Update pnpm.overrides for devalue from 5.6.3 to 5.6.4 to fix
prototype pollution in devalue.parse and devalue.unflatten.

Co-Authored-By: ruflo <ruv@ruv.net>
Implement ADR-038: calculate short-term Cp and Cpk per subgroup,
plot dual series on I-Chart with separate control limits, and show
capability distribution on Boxplot. The gap between Cp and Cpk
visualizes centering loss — key for supplier capability stability.

Core: subgroupCapability.ts (grouping, calculation, control limits)
Hooks: useCapabilityIChartData, useCapabilityBoxplotData
Charts: IChartBase dual series support (secondary data/stats/legend)
UI: CapabilityMetricToggle, SubgroupConfigPopover
State: standardIChartMetric + subgroupConfig with full persistence
Wiring: both PWA and Azure dashboards with toggle + config

Co-Authored-By: ruflo <ruv@ruv.net>
…dology

Add capability stability awareness to CoScout so it can reason about
per-subgroup Cp/Cpk data, centering loss, and out-of-control subgroups.
Includes new glossary concept, AIContext field, system prompt instructions,
app-level wiring, unit tests, and documentation updates across 5 docs.

Co-Authored-By: ruflo <ruv@ruv.net>
Design spec for adapting the 6-section report structure for yamazumi
mode with mode-specific titles, KPI grid, finding-driven Step 2
across all modes, activity breakdown with lean tooltips, and VA Ratio
learning loop.

Co-Authored-By: ruflo <ruv@ruv.net>
Design spec for extending subgroup capability with time-interval
grouping (minute/hour/day/week) using existing time column detection
infrastructure. Includes new use case for capability stability over time.

Co-Authored-By: ruflo <ruv@ruv.net>
Third subgrouping method alongside column/fixed-size: group by time
intervals (5/15/30 min, hourly, daily, weekly) using detected timestamp
columns. Smart UI filtering hides minute/hour options for date-only data.

Co-Authored-By: ruflo <ruv@ruv.net>
- Step 1: yamazumi shows YamazumiKPIGrid + chart; standard unchanged
- Step 2: finding-driven for all modes; yamazumi shows activity breakdown
- Step 6: learning loop uses VA Ratio metric for yamazumi mode
- Pass analysisMode to useReportSections for mode-specific titles

Co-Authored-By: ruflo <ruv@ruv.net>
@vercel
Copy link
Copy Markdown

vercel Bot commented Mar 21, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
mean-beoynd-lite-pwa Ready Ready Preview, Comment Mar 21, 2026 10:03am
variscout_website Ready Ready Preview, Comment Mar 21, 2026 10:03am

@jukka-matti jukka-matti merged commit a380961 into main Mar 21, 2026
3 checks passed
@jukka-matti jukka-matti deleted the feat/yamazumi-reporting branch March 21, 2026 11:09
jukka-matti added a commit that referenced this pull request May 14, 2026
- investigations.md "8f followups" entry: STATUS → RESOLVED 2026-05-14, PR
  #166 squash-merged as cd93691. LOW #16 (Canvas/index.tsx 1122-line
  refactor) + LOW #19 (brand ProcessHubId) explicitly carried forward.
- investigations.md gains two new entries from the --chrome walk:
  (1) pre-existing setState-in-render warning from AppMain across canvas
  transitions (App.tsx untouched by #166), (2) designer-lens canvas
  journey-clarity observations (9 UX items: Frame→Canvas rename, desktop
  LODSwitcher parity, Lock-canvas mode-toggle relabeling, L1 capability
  empty-state copy, L3 CTA visual weight, etc.).
- decision-log.md "8f canvas viewport SHIPPED" entry: Amendment 2026-05-14
  followups complete block prepended; original 2026-05-13 amendment retained
  as history.

Co-Authored-By: ruflo <ruv@ruv.net>
jukka-matti added a commit that referenced this pull request May 14, 2026
…emoval

Define `ProcessHubId = string & { readonly __brand: 'ProcessHubId' }` in
`packages/core/src/processHub.ts` (the only definition point). Add
`asProcessHubId()` (throws on empty) and `isProcessHubId()` predicate;
update `DEFAULT_PROCESS_HUB_ID` and `normalizeProcessHubId` to return
`ProcessHubId`. Re-export from stores for back-compat consumption.

Replace `hubId ?? '__wall-canvas-unbound__'` sentinel in WallCanvas with
`hubId ?? null`; update `useCanvasViewportInput` to accept `ProcessHubId | null`
with a null short-circuit (no store writes when hub is absent).

25-file sweep across packages/hooks/ui/apps: all `string`-typed hub slots
at store boundaries cast/narrowed to `ProcessHubId`; test fixtures use
`const h = (id: string) => id as ProcessHubId` helper. Both app lifecycle
hooks (PWA + Azure) use `normalizeProcessHubId(hubId)` → `boundHubId` so
the raw `string | null | undefined` param never reaches store calls.

Closes LOW #19 from the 8f retrospective (docs/investigations.md updated).

Co-Authored-By: ruflo <ruv@ruv.net>
jukka-matti added a commit that referenced this pull request May 14, 2026
… Canvas decomposition + tsc hygiene (#168)

* fix(pwa): eliminate setState-in-render warning by replacing bare usePanelsStore() with individual field selectors

The bare `const store = usePanelsStore()` whole-store subscription in
`useAppPanels` violated the CLAUDE.md/ADR-078 "Never bare useStore()" rule.
In React 19 Strict Mode + Zustand 5 (useSyncExternalStore), the whole-store
snapshot causes tearing detection to fire on every panelsStore update
(panel-state transitions co-incident with LOD switches, frame-tab activation,
Lock canvas toggle), producing 8+ "Cannot update a component (AppMain) while
rendering" warnings per interaction.

Fix: rewrite useAppPanels.ts to use 24 individual usePanelsStore(s => s.field)
selectors — one per state field and action. useEffect dependency arrays cleaned
accordingly (no more `store` object in deps). App.tsx return interface unchanged.

Regression test added in apps/pwa/src/__tests__/App.test.tsx: mounts App,
exercises showFrame() panel transition, asserts zero setState-in-render warnings.
All 40 PWA test files green; pwa build green.

Co-Authored-By: ruflo <ruv@ruv.net>

* docs(investigations): add commit hash + correct rule attribution

Spec-review followup: add commit hash 6c5bc1a to the setState-in-render
resolution paragraph, and correct rule attribution from "CLAUDE.md / ADR-078"
to "packages/stores/CLAUDE.md:18 (cites ADR-041)" — ADR-078 covers the
6-stores-across-3-layers model, not selector discipline.

Co-Authored-By: ruflo <ruv@ruv.net>

* refactor(pwa): extract openDataTableAtRow compound action + drop dead _vi import

Code-review followup: per feedback_fix_absorbed_violations_at_seam, lift the
two bare usePanelsStore.setState() calls in useAppPanels.openDataTableAtRow
into a single store-action openDataTableAtRow(index, isDesktop). Drops the
last bare-setState seam violation in the hook. Also removes a dead `vi as _vi`
import from App.test.tsx.

Co-Authored-By: ruflo <ruv@ruv.net>

* feat(cleanup): brand ProcessHubId opaque type + WallCanvas sentinel removal

Define `ProcessHubId = string & { readonly __brand: 'ProcessHubId' }` in
`packages/core/src/processHub.ts` (the only definition point). Add
`asProcessHubId()` (throws on empty) and `isProcessHubId()` predicate;
update `DEFAULT_PROCESS_HUB_ID` and `normalizeProcessHubId` to return
`ProcessHubId`. Re-export from stores for back-compat consumption.

Replace `hubId ?? '__wall-canvas-unbound__'` sentinel in WallCanvas with
`hubId ?? null`; update `useCanvasViewportInput` to accept `ProcessHubId | null`
with a null short-circuit (no store writes when hub is absent).

25-file sweep across packages/hooks/ui/apps: all `string`-typed hub slots
at store boundaries cast/narrowed to `ProcessHubId`; test fixtures use
`const h = (id: string) => id as ProcessHubId` helper. Both app lifecycle
hooks (PWA + Azure) use `normalizeProcessHubId(hubId)` → `boundHubId` so
the raw `string | null | undefined` param never reaches store calls.

Closes LOW #19 from the 8f retrospective (docs/investigations.md updated).

Co-Authored-By: ruflo <ruv@ruv.net>

* fix(cleanup): move h() cast helper after imports in mapwall test

Prettier placed the const between two import statements during the
pre-commit format pass. Move it after all imports to keep ES module
import grouping clean.

Co-Authored-By: ruflo <ruv@ruv.net>

* chore(stores): sweep ProcessHubId imports to @variscout/core

Removes the back-compat re-export shim at canvasViewportStore.ts:16 per
feedback_no_backcompat_clean_architecture; 7 consumers now import the
branded type directly from @variscout/core/processHub. Barrel index.ts
updated to re-export ProcessHubId from @variscout/core/processHub directly
(not via the store file) so existing code that happens to pull from the
barrel continues to compile.

Co-Authored-By: ruflo <ruv@ruv.net>

* chore(cleanup): finish ProcessHubId import sweep to @variscout/core

Sweep the remaining ~15 consumers missed by the earlier pass; barrel
shim removal exposed the gaps via TS error. All ProcessHubId imports
now go directly to @variscout/core/processHub.

Co-Authored-By: ruflo <ruv@ruv.net>

* test(core, hooks): cover asProcessHubId/isProcessHubId + useCanvasViewportInput null short-circuit

Two Important test gaps from PR2 code review: factory throw-on-empty
(asProcessHubId, isProcessHubId) and the new hubId:null no-op path in
useCanvasViewportInput. Both verify load-bearing contracts that were
shipped without exercise.

Co-Authored-By: ruflo <ruv@ruv.net>

* refactor(canvas): extract useCanvasHypothesisDrawing hook

Moves all drawing-mode pointer/keyboard event handlers and the
reset effect out of Canvas/index.tsx into a dedicated hook. The
hook returns stable handler refs plus endpointLabel and
parseEndpointElement helpers — 12 vitest tests cover all branches.

Co-Authored-By: ruflo <ruv@ruv.net>

* refactor(canvas): extract useCanvasHypothesisArrows hook

Moves arrowSegments state, cardElements ref, and both useLayoutEffects
(ResizeObserver setup + DOM measurement) out of Canvas/index.tsx into a
dedicated hook. Measurement is stable equality-guarded to avoid needless
re-renders. 8 vitest tests cover empty, ResizeObserver attach/detach, and
remeasure-on-viewport-change paths.

Co-Authored-By: ruflo <ruv@ruv.net>

* refactor(canvas): extract CanvasLevelRouter sub-component

Moves the lens-validity gate and all l1/l2/l3 content composition
out of Canvas/index.tsx into an internal sub-component. Canvas drops
from 1135 to 848 lines. CanvasAuthoringMode and CanvasL3Archetype are
defined in CanvasLevelRouter and re-exported from Canvas to avoid a
circular import. 10 vitest tests cover the routing, lens-invalid empty
state, archetype switching, and mode-toggle visibility. Barrel updates
and CanvasWorkspace.test.tsx mock additions for the two new hooks land
in this commit.

Co-Authored-By: ruflo <ruv@ruv.net>

* chore(types): add vite-env.d.ts + trivial tsc fixes in core/hooks (pre-existing)

Category A — add minimal ImportMeta.env / ImportMeta.glob augmentation .d.ts
files to packages/core/src/ and packages/hooks/src/ so that import.meta.env.DEV
and import.meta.glob(...) resolve without requiring vite as a direct dep.
Overloaded signatures distinguish eager (→ T) from lazy (→ () => Promise<T>)
so calls into registerLocaleLoaders (which expects LocaleLoaderMap) type-check.

Category C — two trivial fixes:
  - packages/hooks/src/__tests__/setup.ts: cast (window as unknown as Record...)
    to satisfy TS2352 (neither type sufficiently overlaps).
  - packages/hooks/src/__tests__/findingSourceLensCapture.test.ts: add _filters
    param to the vi.fn mock that takes one argument; was inferred as 0-arg.
  - packages/hooks/src/__tests__/setup.ts: /// <reference types="vitest/globals" />
    so beforeEach is recognised by standalone tsc (globals:true is vitest-only).

All pre-existing; unrelated to PR1/PR2/PR3 logic.

Co-Authored-By: ruflo <ruv@ruv.net>

* chore(test): cast DataRow fixtures + log deferred tsc errors (pre-existing)

Category B — cast Record<string,unknown>[] test fixtures to DataRow[] at the
constant definition site so useParetoChartData and useYamazumiChartData calls
type-check without changing test behaviour:
  - packages/hooks/src/__tests__/timeLensWiring.test.ts: add DataRow import +
    cast PARETO_100 at buildParetoRows(100) assignment.
  - packages/hooks/src/__tests__/useYamazumiChartData.test.ts: add DataRow
    import + change EMPTY_DATA type annotation from Record<string,unknown>[] to
    DataRow[].

docs/investigations.md — new entry "Pre-existing tsc errors deferred from
PR #168" listing the 3 remaining items that are out of scope for a trivial-cast
pass: d3 type deps (useCanvasViewportInput.ts:2-4), tuple-mock fetch typing
(useHubCommentStream.test.ts:274-277), and beforeEach globals in
responsesApi.test.ts:862.

All pre-existing; unrelated to PR1/PR2/PR3 logic.

Co-Authored-By: ruflo <ruv@ruv.net>

* chore(test): import beforeEach in responsesApi.test.ts

One-line addendum to the pre-existing-tsc-error cleanup commit: the
responsesApi.test.ts file uses beforeEach at line 862 but the vitest
import on line 1 omits it. Same category as the other ImportMeta /
test-globals fixes in afd8c8b.

Co-Authored-By: ruflo <ruv@ruv.net>

* docs(investigations): close item #3 + log item #4 (core fixture-shape mismatches)

The beforeEach import fix in e73fca6 closes the responsesApi.test.ts
item from the deferred-tsc-errors entry. Adds item #4 capturing the
9 newly-surfaced SustainmentRecord + ProcessMap fixture-shape mismatches
that became visible once responsesApi.test.ts was unblocked.

Co-Authored-By: ruflo <ruv@ruv.net>

---------

Co-authored-by: ruflo <ruv@ruv.net>
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