Skip to content

feat(components): kit-change propagation delivery — auto-record edges + drain to rails (#2277) - #2400

Merged
kevinthelago merged 5 commits into
developfrom
2277-kit-delivery
Jul 6, 2026
Merged

feat(components): kit-change propagation delivery — auto-record edges + drain to rails (#2277)#2400
kevinthelago merged 5 commits into
developfrom
2277-kit-delivery

Conversation

@kevinthelago

Copy link
Copy Markdown
Owner

Completes the delivery for kit-change propagation (#2277). Slices 1–3 (#2291/#2292/#2293) built the decision spine, the kit_usage consumer index, and the change origin (setComponent queues kitDispatches). This finishes it: the index self-fills, and the queue reaches consumers.

Slice A — the consumer index self-fills

  • Blueprint.kit field; declared kit: "react-ui" on the UI-generating built-ins (default / complete / ui-kit).
  • Binding a blueprint files the project→kit edge via addKitUsage at both bind points (setProjectBlueprintId creation + applyBlueprintToProject switch). Kit-less blueprints are a no-op.

Slice B — the delivery

  • planKitDrain — pure delivery core mirroring planFaultDispatch: GATE (per-project toggle off ⇒ nothing), DEDUP ((consumer, change) once), RATE-LIMIT (maxPerCycle). Only breaking changes auto-fire; rail = live ? assign : issue. Plus kitDispatchPrompt + kitUpdateIssue.
  • useKitDispatch — poll+deliver hook (copies useFaultTriage), mounted in ConsoleWorkspace. Live consumer → injectPrompt the director (bsc-issuebsc-assign); dormant → github_post a kit-update issue in the consumer repo. Deduped, rate-limited, auto-dismissed on delivery.
  • autoKitDispatch per-project toggle mirroring autoTriage: default OFF = notify-only, persisted, purged on project delete.
  • KitChangesCard — the notify surface in Design Studio (changes grouped, per-consumer toggle + dismiss), renders only when the queue is non-empty.
  • kitDispatches persisted so the queue survives a restart.

The outward-facing rails (GitHub issues, director injects) fire only when a consumer opts in via the toggle; the default is safe.

Verification

  • npm run typecheck clean · npm run lint 0 errors.
  • Tests: drain gate/dedup/rate-limit + only-breaking + rail selection; the rail messages; the toggle action; the blueprint→kit auto-record (bind records edge, kit-less no-op, switch idempotent).
  • Not yet exercised in the running app.

Closes #2277.

🤖 Generated with Claude Code

kevinthelago and others added 3 commits July 5, 2026 19:47
…#2277)

The kit-change propagation consumer index (kit_usage) never filled itself: a
project's use of a kit was only recordable by hand. Now a blueprint can DECLARE
the component kit an app seeded from it is built on (`Blueprint.kit`), and binding
that blueprint to a project files the project→kit consumer edge automatically — so
the index self-fills at planning and a later kit change fans out to real consumers.

- Add `Blueprint.kit` (a `bsc component` kit id); declare `kit: "react-ui"` on the
  UI-generating built-ins (default, complete, ui-kit).
- Record the edge at both bind points in the plan slice — `setProjectBlueprintId`
  (creation) and `applyBlueprintToProject` (switch) — via `addKitUsage`
  (idempotent by (projectKey, kitId), write-through to `bsc component usage`).
  A kit-less blueprint (authoring, transform) is a no-op.

Advances #2277 delivery (remaining: drain kitDispatches to the notify/issue/assign
rails). Tests: bind records the edge; kit-less bind records nothing; switch stays
idempotent.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…sue rails (#2277)

Completes the kit-change propagation delivery: the queued fan-out (kitDispatches,
from setComponent's change origin) now reaches consumers. A pure drain planner
decides what to fire; a thin actuator hook fires it; a card surfaces the rest.

- planKitDrain (propagation.ts): the pure delivery core mirroring planFaultDispatch
  — GATE (per-project toggle off ⇒ nothing), DEDUP ((consumer,change) once), and
  RATE-LIMIT (maxPerCycle). Only BREAKING changes auto-fire; additive/fix stay
  surface-only. Rail = live ? assign : issue. Plus kitDispatchPrompt (director
  message) + kitUpdateIssue (GitHub issue title/body).
- useKitDispatch: the poll+deliver hook (copies useFaultTriage). Per consumer with
  the toggle ON: live fleet → injectPrompt the director (bsc-issue → bsc-assign);
  no live fleet → GhApi github_post a kit-update issue in the consumer repo.
  Deduped + rate-limited; delivered entries are dismissed. Mounted in ConsoleWorkspace.
- autoKitDispatch per-project toggle (projects slice), mirroring autoTriage:
  default OFF (notify-only), persisted, purged on project delete.
- KitChangesCard: the notify surface in Design Studio — pending changes grouped by
  change, per-consumer auto toggle + dismiss. Renders only when the queue is non-empty.
- kitDispatches is now persisted so the queue survives a restart until delivered.

Tests: drain gate/dedup/rate-limit + only-breaking + rail selection; the rail
messages; the toggle store action. Closes #2277.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kevinthelago
kevinthelago merged commit 223754d into develop Jul 6, 2026
7 checks passed
@kevinthelago
kevinthelago deleted the 2277-kit-delivery branch July 6, 2026 19:04
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