Skip to content

feat(core): IM-2 — Measurement-Plan-as-DCP fields#252

Merged
jukka-matti merged 5 commits into
mainfrom
im-2-measurement-plan-dcp
May 30, 2026
Merged

feat(core): IM-2 — Measurement-Plan-as-DCP fields#252
jukka-matti merged 5 commits into
mainfrom
im-2-measurement-plan-dcp

Conversation

@jukka-matti
Copy link
Copy Markdown
Owner

IM-2 (ADR-085/087, spec §7.1). Extends MeasurementPlan to the Data-Collection-Plan shape.

What changed

  • Renamed factorprimaryFactor; dropped msaRequired.
  • Added outcome, neededFactors[] (= dataset column names, the IM-3 join contract), scope: ConditionLeaf[] (a copy of the WHERE leaves, distinct from ProblemStatementScope), processLocation (ProcessMap node id; '' allowed), opDef?, msaNote?.
  • AddPlanForm reworked (new inputs; msaRequired checkbox removed); stepOptions/defaultScope/defaultOutcome threaded through WallCanvas→HypothesisCardWithPlans→AddPlanForm (app-level sourcing of scope/outcome deferred — call sites pass undefined).
  • hypothesisId stays required+immutable; no IDB version bump (no table/index change); ConditionLeaf reused (not redefined).
  • New L3 doc measurement-plan-dcp.md; decision-log entry for hypothesisId-exclusivity (§11 chore(deps): bump actions/upload-artifact from 4.6.2 to 7.0.0 #2).

Verification

  • Full pr-ready-check green (re-confirmed after review fixes).
  • 4-dimension adversarial review (fix-then-merge): fixed the FORM_H foreignObject clip (form was unsubmittable — raised to 660 + overflow:visible matching LinkFindingPicker) and closed the WallCanvas-planningProps / msaNote / neededFactors test-coverage gaps. Data layer was clean (no rename orphans, ConditionLeaf reused, L3 doc with inbound links).

🤖 Generated with Claude Code

jukka-matti and others added 5 commits May 30, 2026 15:15
Rename factor→primaryFactor, drop msaRequired, add outcome/neededFactors[]/
scope:ConditionLeaf[]/processLocation/opDef?/msaNote? per spec §7.1.
ConditionLeaf imported from findings/hypothesisCondition (not redefined).
Reducer in actions.ts is unchanged (pure spread-merge auto-widens).
Update types.test.ts to assert the DCP shape + hypothesisId immutability guard.
Update actions.test.ts basePlan fixture to the new shape.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…Form DCP fields

Task 2 (mechanical rename): factor→primaryFactor in AddPlanForm, MeasurementPlanChip,
and all test fixtures (HypothesisCardWithPlans, WallCanvas, MeasurementPlanChip, both
apps' applyAction makeMeasurementPlan helpers).

Task 3 (AddPlanForm DCP rework): remove msaRequired checkbox/state; add outcome,
neededFactors[] (comma-split), processLocation (select from stepOptions), opDef?,
msaNote? textareas; new props defaultScope?/defaultOutcome?/stepOptions?. Update
AddPlanForm.test.tsx with 15 tests covering all new fields + scope/stepOptions/outcome
prop threading.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…Canvas→HypothesisCardWithPlans→AddPlanForm

WallCanvasPlanningProps gains optional defaultScope?/defaultOutcome? fields.
WallCanvas derives stepOptions (StepOption[]) from processMap via deriveProcessSteps
at render time (useMemo); passes undefined when processMap absent (AddPlanForm
hides the step picker). defaultScope + defaultOutcome forwarded as-is — call sites
that cannot source them cheaply pass undefined (form defaults to []/''). Thread
through DraggableHypothesisCard automatically via the existing Omit<> type derivation.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Create docs/03-features/workflows/measurement-plan-dcp.md — full DCP field
reference (neededFactors[]=column-names contract, processLocation non-strict join,
scope=snapshot/not-ProblemStatementScope, opDef+msaNote informational notes not gates,
persistence spread-through / no IDB bump, UI threading diagram). Inbound link added in
specifications.md (updates the stale "factor + msaRequired" sentence to the IM-2 DCP shape).
Log the §11 #2 hypothesisId-exclusive resolution to decision-log.md (hypothesisId required
+ immutable; neededFactors[]=dataset-column-names contract pinned for IM-3).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…te/neededFactors (review)

BLOCKER 1: raise FORM_H 280→660 to cover 8-field + 2-textarea form; add
overflow:visible on plans-section foreignObject (mirrors LinkFindingPicker)
so textareas + Save/Cancel are not clipped and remain interactive in the
real SVG canvas.

MINOR 5: fix outcome-reclear regression — stop re-substituting defaultOutcome
in handleSave (outcome.trim() || defaultOutcome would prevent user from
clearing a prefilled outcome). State is already seeded from defaultOutcome
at mount; trimmed value is now used directly.

MAJOR 2: add two WallCanvas planningProps tests — (a) renders step select
with derived 'Fill' option when processMap present; (b) hides step select
when processMap absent (undefined fallback path).

MAJOR 3: add msaNote save/omit tests mirroring the opDef pair.

MINOR 4: add neededFactors comma-parse tests — whitespace/empty-segment
happy path + blank-input empty-array assertion.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 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 May 30, 2026 2:11pm
variscout_website Ready Ready Preview, Comment May 30, 2026 2:11pm

@jukka-matti jukka-matti merged commit f6f27c9 into main May 30, 2026
0 of 2 checks passed
@jukka-matti jukka-matti deleted the im-2-measurement-plan-dcp branch May 30, 2026 14:03
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