Multi-level SCOUT V1 (first slice)#109
Merged
Merged
Conversation
Adds TimelineWindow (fixed | rolling | openEnded | cumulative) type, TimelineWindowKind utility type, and four isXxxWindow type guards. Barrel exported from ./timeline and re-exported from core root. TDD: test written first, confirmed failing, then passing after impl. Co-Authored-By: ruflo <ruv@ruv.net>
Co-Authored-By: ruflo <ruv@ruv.net>
…Mappings cardinality Implements scope detection per §2 of the investigation-scope-and-drill-semantics spec. Accepts ProcessHubInvestigation (the actual type carrying nodeMappings via metadata), not a nonexistent Investigation envelope. 4 tests: absent/empty → b0, length===1 → b2, length>1 → b1. Co-Authored-By: ruflo <ruv@ruv.net>
The original Decision #1 referenced a fictitious Investigation envelope with processContext.nodeMappings. The actual codebase models hub-attached investigations as ProcessHubInvestigation with metadata.nodeMappings. Updating to put TimelineWindow on ProcessHubInvestigationMetadata alongside nodeMappings — the intent (window separate from scope, co-located with mappings) is preserved. Caught during V1 Task 3 (detectScope) implementation when the implementer needed to operate against the actual type. Co-Authored-By: ruflo <ruv@ruv.net>
Implements Task 5 of multi-level SCOUT V1. Adds WindowContext type to Finding (optional, backward-compatible) and computeFindingWindowDrift() which compares stats-at-creation vs current-window stats using relative change with a default 0.20 threshold. 4 tests pass. Interleaved doc section added to statistics-reference.md. Co-Authored-By: ruflo <ruv@ruv.net>
Adds packages/core/src/throughput/ mirroring defect/yamazumi shape. computeOutputRate buckets rows by time granularity and emits ratePerHour; computeBottleneck ranks steps by rate and flags the slowest. 3/3 tests pass. Re-exported from core barrel; statistics-reference Part 17 added. Co-Authored-By: ruflo <ruv@ruv.net>
…window) routing Adds RouterScope, RouterPhase, RouterArgs, RouterResult, RouterHook and ChartSlots types to analysisStrategy.ts. Extends AnalysisModeStrategy with an optional dataRouter field (backward compat). All 5 registered strategies implement it with locked routing decisions: investigation→useFilteredData, hub→useProductionLineGlanceData (where supported). Process Flow mode has no strategy registration in V1. Co-Authored-By: ruflo <ruv@ruv.net>
The original Task 8 spec invented a 5th module-level Zustand store in @variscout/hooks keyed by investigationId. Three issues with that: 1. Wrong layer — CLAUDE.md invariant locks 4 domain Zustand stores; window selection is viewer state, not a 5th domain store. 2. Memory leak by design — module-level Map<id, window> has no eviction in a long-lived PWA session. 3. Decision #1 already located the window on ProcessHubInvestigationMetadata alongside nodeMappings (see commit f059c59). The original plan's parallel cache ignored that, same class of mismatch the Decision #1 revision already corrected once. Revised: useTimelineWindow becomes a thin pure projection. Caller passes the investigation envelope and an onChange callback wired to its existing persistInvestigation flow (canonical pattern at apps/azure/src/features/ processHub/useHubMigrationState.ts:67-114). Window persists where the investigation persists (IndexedDB / Blob per ADR-059). No new Zustand store, no zustand dep added to @variscout/hooks, package flow stays clean. Adds timelineWindow?: TimelineWindow to ProcessHubInvestigationMetadata in core (the type-level half of Decision #1's intent that was previously documented but not yet wired into the type). Note for Tasks 11/14: app-level wiring now hangs onChange off persistInvestigation alongside the nodeMappings flow. Co-Authored-By: ruflo <ruv@ruv.net>
…etadata Co-Authored-By: ruflo <ruv@ruv.net>
Per code-review nit on 4adae8b: the returned `window` memoizes on `metadata.timelineWindow` identity, so a parent passing a fresh object literal each render would thrash the memo. Future Task 9 callers (useDataRouter) read `window` from this hook, so calling out the contract on the arg itself prevents the footgun. JSDoc-only; no behavior change. Co-Authored-By: ruflo <ruv@ruv.net>
…tionLineGlanceData Co-Authored-By: ruflo <ruv@ruv.net>
…dary inputs Co-Authored-By: ruflo <ruv@ruv.net>
…rd chrome Co-Authored-By: ruflo <ruv@ruv.net>
Co-Authored-By: ruflo <ruv@ruv.net>
…ads window Co-Authored-By: ruflo <ruv@ruv.net>
Plan Task 14 V1 interpretation. Original plan used the old
useTimelineWindow({ investigationId, defaultKind }) signature that
Task 8's revision (commit cf5daaa) already replaced with a pure
projection over an investigation envelope. The investigation Dashboards
(Azure + PWA) don't receive a ProcessHubInvestigation envelope today —
they read from useProjectStore — so the persistence-aware hook can't
be used there in V1. Local useState is the correct V1 fit, with a
documented V2 follow-up to make the dashboards investigation-aware.
Hub Capability tab already had local window state from Task 13; this
commit extends the destructure to expose the setter and renders
TimelineWindowPicker above the dashboard composition. Cadence-default
override (rolling matched to hub.cadence on first mount) is deferred
to V1.5 per the plan revision.
Plan-file Task 14 body replaced with a V1-interpretation note.
Co-Authored-By: ruflo <ruv@ruv.net>
Co-Authored-By: ruflo <ruv@ruv.net>
Closes Task 16 (Steps 16.1–16.6, 16.8) of the Multi-level SCOUT V1 plan. Created (3): - docs/03-features/analysis/timeline-window-investigations.md - docs/03-features/analysis/multi-level-dashboard.md - docs/05-technical/architecture/timeline-window-architecture.md Modified (16): - Vision: methodology.md temporal-scope paragraph; eda-mental-model.md SCOUT-loops note - Glossary: docs glossary + packages/core/src/glossary/terms.ts (timeline window, output rate, bottleneck, finding drift, hub-time, investigation-time) - Journeys: USER-JOURNEYS.md + USER-JOURNEYS-CAPABILITY.md timeline-picker mentions - Agent map: docs/llms.txt new entry points - Per-package CLAUDE.md: core (timeline/throughput/findings), hooks (useTimelineWindow + useDataRouter), ui (TimelineWindowPicker), apps/azure + apps/pwa (multi-level integration) - Lifecycle: spec status draft → delivered, last-reviewed 2026-04-30; decision-log V1 row + SCOUT journey row updated; ADR-074 strikes the 'to be added' note (boundary script ships in 6c68218) - Plan-file checkboxes for Steps 16.1–16.6 + 16.8 ticked; 16.7/16.9 left for orchestrator Step 16.7 (memory updates) handled separately by orchestrator. Step 16.9 (push + open PR) deferred to user-authorized step. Co-Authored-By: ruflo <ruv@ruv.net>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
12 tasks
Pre-merge code review on PR #109 caught a hard-rule violation in the defect strategy registration. packages/core/CLAUDE.md forbids .toFixed on exported stat values; consumers should call formatStatistic from @variscout/core/i18n. The line itself predates this PR (commit 69eca5a) but the PR added dataRouter to the same strategy block, so folding the fix in pre-merge per feedback_bundle_followups_pre_merge.md. Replaces v.toFixed(1) with Math.round(v * 10) / 10 — same numeric output, no toFixed. Mirrors the yamazumi strategy's Math.round(v * 100) pattern. Co-Authored-By: ruflo <ruv@ruv.net>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Lands the first delivery slice of the Multi-level SCOUT design (
docs/superpowers/specs/2026-04-29-multi-level-scout-design.md, nowstatus: delivered).Engine layer (Tasks 0–7):
TimelineWindowdiscriminated union + type guardsapplyWindowfilters rows by timeline window over a parser-detected timeColumndetectScopeclassifies investigations as b0/b1/b2 bynodeMappingscardinalitymergeRowsfor append-mode re-upload (dedupe / correction / add)computeFindingWindowDrift+WindowContexton Findingthroughput/module:computeOutputRate+computeBottleneckAnalysisModeStrategy.dataRouterfor(scope, phase, window)routingHooks layer (Tasks 8–9):
useTimelineWindow— pure projection overProcessHubInvestigationMetadata.timelineWindow(no new Zustand store; persistence via caller's existingpersistInvestigationflow)useDataRouter— sanity-check wrapper over the strategy router (no runtime hook switching)useFilteredDataanduseProductionLineGlanceDataaccept optionalwindowargUI layer (Tasks 10–12):
TimelineWindowPicker— four-kind window selector with secondary inputsDashboardLayoutBaseexposes the picker in dashboard chrome (data-export-hide region)FindingCardrenders window-context footer whenwindowContextis presentApp layer (Tasks 13–14):
ProcessHubCapabilityTabconsultsuseDataRouterand threads window intouseProductionLineGlanceDataBoundary policy (Task 15): ADR-074 boundary check script + pre-commit wiring.
Docs (Task 16): three new docs (timeline-window-investigations, multi-level-dashboard, timeline-window-architecture); vision/glossary/journey/CLAUDE.md updates; spec status flipped to
delivered.Plan-spec drifts caught and resolved during execution
Three Task specs needed substantive revision against codebase reality — all revisions are committed in the plan file:
<strategy.chartSlots.slot1 />JSX impossible (ChartSlots carries strings, not components); V1 routes at call site instead.useTimelineWindow({ investigationId })signature stale after Task 8 revision; dashboards use local state for V1 (V2 makes them investigation-aware).V2 / V1.5 follow-ups (named-future)
hub.cadenceon first mount)useTimelineWindowcan persist the choiceTest plan
pnpm --filter @variscout/ui buildclean (cross-package type-export check perfeedback_ui_build_before_merge.md)bash scripts/pr-ready-check.sh✓ all checks passedCommits (12)
Engine (8): TimelineWindow types, applyWindow, detectScope, mergeRows (bundled into f059c59), drift, throughput, dataRouter, decisions doc.
Hooks (2): useTimelineWindow + JSDoc nit, useDataRouter + window-aware sibling hooks.
UI (3): TimelineWindowPicker, DashboardLayoutBase chrome slot, FindingCard footer.
Apps (1): Dashboard + Hub Capability picker wiring.
Refactor (1): ProcessHubCapabilityTab dataRouter consultation.
Chore (1): ADR-074 boundary check + pre-commit wiring.
Docs (3): plan revisions + completeness sweep.
🤖 Generated with ruflo