openpencil/apps
Fini 6bcdd92213 fix(ai): seedDocVariablesFromStyleGuide overwrites stale plan-derived keys
Prior version skipped seeding when doc.variables had any entry, which left
the second brief in a session resolving `$color-*` refs to the FIRST brief's
palette while the prompt's ref + (hex) instruction advertised the new one.

Fix:
- Define PLAN_DERIVED_VARIABLE_NAMES (the 7 v1 token names this function
  manages) and always (re-)write them from the current plan.
- Stale-key guard: if the new palette doesn't carry a name (e.g. ai-generated
  plan.styleGuide has no textMuted but a prior catalog brief seeded one),
  remove the stale entry so refs fall back to the default palette consistently
  with the new prompt.
- design.md path bypasses this function entirely; user-set variables outside
  the 7-key set are never touched.
2026-04-29 09:50:36 +08:00
..
cli chore(release): bump to v0.8.0 2026-04-27 08:20:00 +08:00
desktop chore(release): bump to v0.8.0 2026-04-27 08:20:00 +08:00
web fix(ai): seedDocVariablesFromStyleGuide overwrites stale plan-derived keys 2026-04-29 09:50:36 +08:00