feat(config): load-config verb, partial-load rendering, demo examples#106
Merged
Conversation
Three coupled additions: 1. **VERB_LOAD_CONFIG** — new verb + `SESSION_CONFIG_OVERRIDE_KEY`: a click writes a per-session config-file path into SessionState; the render path reads it at the cache-lookup boundary so the next request uses the overridden file without restarting the daemon. 2. **Partial-load rendering** — variable declaration failures accumulate as `loadWarnings` (non-fatal) rather than aborting the config load; segment render wraps in try/catch and returns a ⚠ error cell for any segment that fails, keeping the rest of the bar alive. Together these let a config switch succeed even when the new config has broken variables — working segments render, broken ones show an error cell. 3. **`coerceToType` for git var defaults** — string "0" is coerced to number 0 for number-typed git fields, matching the behaviour of the live-fetch projection path. Also adds `examples/demo-actions.json5` and `examples/demo-variables.json5` — comprehensive demo configs exercising the full surface of each subsystem, with `CC_CANDYBAR_CONFIG=examples/… pnpm demo` instructions inline.
brandon-fryslie
commented
Jun 12, 2026
brandon-fryslie
left a comment
Contributor
Author
There was a problem hiding this comment.
Adversarial review
The diff introduces VERB_LOAD_CONFIG, partial-load rendering via loadWarnings accumulation, coerceToType for git-var defaults, and two demo configs. The architecture is sound: the verb handler validates its wire value at the boundary, the render-time try/catch correctly isolates broken segments, and the warning reset in reloadInto (entry.lastWarning = detectConfigCollisions(...) at line 207) fires before the new append block so stale warnings do not persist across reloads. VERBS is constructed via spread of LEAF_VERBS so the new verb is automatically dispatched. No correctness defects were found after checking callers and contracts.
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.
Summary
VERB_LOAD_CONFIG— new click verb that stores a per-session config-file path inSessionState; the daemon reads it at the render cache-lookup boundary so the override takes effect on the next tick without a daemon restart.registerDslConfignow accumulate asloadWarnings(non-fatal advisory warnings) instead of aborting the load; segment render bodies wrap in try/catch and return a⚠ name: …error cell for any segment that fails at render time, keeping all other segments alive. Together these make config switching graceful: a broken new config renders what it can, surfaces what it can't.coerceToTypefor git var defaults — fixes type coercion forstringdefaults onnumber-typed git fields ("0"→0), matching the live-fetch projection path.examples/directory —demo-actions.json5anddemo-variables.json5: comprehensive demo configs exercising the full surface of actions/layout/groups and all variable source kinds respectively, usable standalone viaCC_CANDYBAR_CONFIG=examples/… pnpm demo.Test plan
pnpm test— 1172 passing (including updateddsl-actions.test.tscycle arity test, now asserts the⚠ bar: cycles 3 memberserror cell form)pnpm typecheck— cleanpnpm lint— clean (1 pre-existing unused-var warning in layout.ts, unrelated)CC_CANDYBAR_CONFIG=examples/demo-actions.json5 pnpm demorenders and all actions function