Skip to content

refactor(sections): move the plan lockstep types beside KeyErasedPlan and name FamilyPlan KeyedPlan - #467

Merged
Vivswan merged 1 commit into
mainfrom
refactor/plan-lockstep-home
Oct 5, 2026
Merged

Vivswan merged 1 commit into
mainfrom
refactor/plan-lockstep-home

Conversation

@Vivswan

@Vivswan Vivswan commented Oct 5, 2026

Copy link
Copy Markdown
Owner

What this changes

// src/sections/shared/setup-section.ts, before
import type { FamilyPlan, PlanMisfits, WidePlan } from "./keyed-values.js";

// after
import { type KeyedPlan, type PlanMisfits, type WidePlan, ... } from "../contract/plan.js";

A pure move with one rename. The setup factory is not a family, yet it imported a "Family" vocabulary from the secrets and variables module.

How

  • Five types move from shared/keyed-values.ts to contract/plan.ts, right after KeyErasedPlan, the erasure they compare through.
  • FamilyPlan becomes KeyedPlan: one section's plan() under its own key brand, the counterpart KeyErasedPlan strips.
  • Three importers repoint to the contract, and keyed-values.ts keeps no re-export.
  • KeyErasedPlan turns private since nothing outside plan.ts reads it now.

Proof

  • Drift pins alive: two TS2344 controls on PlanMisfits (a mismatched Table, an extra GET role) fail on the pin and pass once restored.
  • Tests: 199 green across the secrets, variables, setup, registry, and public-surface files.
  • Gates: tsc, biome, lint:arch, knip clean.
Technical details
  • Line accounting: plan.ts +49 -2, keyed-values.ts +5 -53, repo-secrets.ts +8 -5, repo-variables.ts +8 -5, setup-section.ts +4 -2.
  • Move census, KeyedPlan: body identical to FamilyPlan, name and doc comment changed.
  • Move census, WidePlan: body identical, doc comment reworded from family to section vocabulary.
  • Move census, WidePlanAt: byte-identical.
  • Move census, Invariant: byte-identical.
  • Move census, PlanMisfits: body identical apart from FamilyPlan -> KeyedPlan, doc comment unchanged.
  • tsc instantiations: 2588330 against 2588314 on main, types 932616 on both.
  • Kept: the local pin aliases _WidePlanIsEveryFamilyPlan in the two family files, since there the plan is a family's.
  • Layering: contract and shared share the sections layer, and plan.ts draws no new import from shared.
  • Files: src/sections/contract/plan.ts, src/sections/shared/{keyed-values,repo-secrets,repo-variables,setup-section}.ts.

Copilot AI balanced review requested due to automatic review settings October 5, 2026 08:01
@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

File size check

0 over a hard cap (fails), 10 warning(s).

File Size Tier Cap
.github/scripts/gen-inputs-table.ts:54 11 comment lines warn 10
.github/scripts/release-pipeline.ts:1 34 comment lines (header) warn 25
.github/scripts/release-pipeline.ts:453 14 comment lines warn 10
docs/upgrading/v2-to-v3.md 1292 lines warn 1040
src/github/secret-scan.ts:45 11 comment lines warn 10
src/sections/contract/errors.ts:13 14 comment lines warn 10
src/sections/shared/roles.ts:43 13 comment lines warn 10
test/e2e/generators.ts 2634 lines warn 2560
test/e2e/generators.ts:1667 12 comment lines warn 10
test/sections/refusal-messages.test.ts:61 19 comment lines warn 10

Split the file, wrap the line, shorten or exempt the comment, or list the path in .file-size-allow.local with a # reason.

5 managed file(s) skipped; repo-platform owns them.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The type-only move and rename are complete and preserve the existing lockstep behavior.

Review effort: Balanced
Findings: None

What changed in this PR

Moves shared plan lockstep types into the plan contract and renames FamilyPlan to KeyedPlan.

Changes:

  • Relocates plan type utilities beside KeyErasedPlan.
  • Updates three section factories to import and use KeyedPlan.
  • Removes obsolete plan types from keyed-values.ts.
File Description
src/​sections/​contract/​plan.ts Defines the relocated plan types and makes KeyErasedPlan private.
src/​sections/​shared/​keyed-values.ts Removes relocated types and updates module documentation.
src/​sections/​shared/​repo-secrets.ts Uses plan types from the contract module.
src/​sections/​shared/​repo-variables.ts Uses plan types from the contract module.
src/​sections/​shared/​setup-section.ts Renames FamilyPlan usage to KeyedPlan.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Vivswan
Vivswan marked this pull request as ready for review October 5, 2026 09:26
@Vivswan Vivswan added the merge-when-green Owner approved: merge once every gate is green label Oct 5, 2026
@Vivswan Vivswan closed this Oct 5, 2026
@Vivswan Vivswan reopened this Oct 5, 2026
… 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.
@Vivswan
Vivswan force-pushed the refactor/plan-lockstep-home branch from 2aa0a4b to 9701725 Compare October 5, 2026 10:58
@Vivswan Vivswan closed this Oct 5, 2026
@Vivswan Vivswan reopened this Oct 5, 2026
@Vivswan
Vivswan merged commit aece693 into main Oct 5, 2026
51 of 53 checks passed
@Vivswan
Vivswan deleted the refactor/plan-lockstep-home branch October 5, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-when-green Owner approved: merge once every gate is green

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants