feat(components): kit-change propagation delivery — auto-record edges + drain to rails (#2277) - #2400
Merged
Merged
Conversation
…#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>
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.
Completes the delivery for kit-change propagation (#2277). Slices 1–3 (#2291/#2292/#2293) built the decision spine, the
kit_usageconsumer index, and the change origin (setComponentqueueskitDispatches). This finishes it: the index self-fills, and the queue reaches consumers.Slice A — the consumer index self-fills
Blueprint.kitfield; declaredkit: "react-ui"on the UI-generating built-ins (default / complete / ui-kit).addKitUsageat both bind points (setProjectBlueprintIdcreation +applyBlueprintToProjectswitch). Kit-less blueprints are a no-op.Slice B — the delivery
planKitDrain— pure delivery core mirroringplanFaultDispatch: GATE (per-project toggle off ⇒ nothing), DEDUP ((consumer, change) once), RATE-LIMIT (maxPerCycle). Only breaking changes auto-fire; rail =live ? assign : issue. PluskitDispatchPrompt+kitUpdateIssue.useKitDispatch— poll+deliver hook (copiesuseFaultTriage), mounted in ConsoleWorkspace. Live consumer →injectPromptthe director (bsc-issue→bsc-assign); dormant →github_postakit-updateissue in the consumer repo. Deduped, rate-limited, auto-dismissed on delivery.autoKitDispatchper-project toggle mirroringautoTriage: 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.kitDispatchespersisted 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 typecheckclean ·npm run lint0 errors.Closes #2277.
🤖 Generated with Claude Code