From 9701725c800e24fd47d118711bc4f0f7bb7ffd6b Mon Sep 17 00:00:00 2001 From: Vivswan Shah <58091053+Vivswan@users.noreply.github.com> Date: Mon, 5 Oct 2026 04:00:27 -0400 Subject: [PATCH] refactor(sections): move the plan lockstep types beside KeyErasedPlan and name FamilyPlan KeyedPlan FamilyPlan, WidePlan, WidePlanAt, Invariant, and PlanMisfits lived in src/sections/shared/keyed-values.ts, the secrets and variables family scaffolding, and the setup factory in setup-section.ts had to import a "Family" vocabulary from a family module to prove its one plan the same way. The five types now sit after KeyErasedPlan in src/sections/contract/plan.ts, the module that already owns PlanContext, PlannedOp, SectionPlan, and the key-erasure the lockstep compares through. FamilyPlan is renamed KeyedPlan: one section's plan() under its own key brand, the counterpart KeyErasedPlan strips. The other four keep their names and bodies. keyed-values.ts keeps no re-export and drops the imports only the moved types used. repo-secrets.ts, repo-variables.ts, and setup-section.ts import the three public types from the contract. KeyErasedPlan loses its export keyword since nothing outside plan.ts reads it now. --- src/sections/contract/plan.ts | 51 ++++++++++++++++++++++- src/sections/shared/keyed-values.ts | 58 +++------------------------ src/sections/shared/repo-secrets.ts | 13 +++--- src/sections/shared/repo-variables.ts | 13 +++--- src/sections/shared/setup-section.ts | 6 ++- 5 files changed, 74 insertions(+), 67 deletions(-) diff --git a/src/sections/contract/plan.ts b/src/sections/contract/plan.ts index 6207cb19..ce12f52f 100644 --- a/src/sections/contract/plan.ts +++ b/src/sections/contract/plan.ts @@ -24,7 +24,13 @@ import type { GraphqlVariablesOf, } from "./graphql.js"; import { parseLive } from "./live.js"; -import type { EndpointDict, GraphqlDict, SectionContext, SectionMeta } from "./module.js"; +import type { + EndpointDict, + GraphqlDict, + SectionContext, + SectionMeta, + ValidatedInput, +} from "./module.js"; import { call, callGraphql, @@ -358,13 +364,54 @@ export interface PlanContext< * A plan handler with its context's key brand erased: a shared handler serving several sections is * compared to each branded per-key signature through this (repo-secrets, repo-variables, setup-section). */ -export type KeyErasedPlan
= P extends ( +type KeyErasedPlan
= P extends (
ctx: PlanContext