Skip to content

fix: audit batch 2 — locale-reset bug, config unification, legacy cleanup, 1M statusline#69

Merged
hapo-nghialuu merged 6 commits into
devfrom
fix/audit-batch-2
Jul 19, 2026
Merged

fix: audit batch 2 — locale-reset bug, config unification, legacy cleanup, 1M statusline#69
hapo-nghialuu merged 6 commits into
devfrom
fix/audit-batch-2

Conversation

@hapo-nghialuu

Copy link
Copy Markdown
Member

Summary

Second fix batch from the 2026-07 audit (docs/audit-cafekit-vs-claude-code-2026-07.md) plus the bugs discovered while dogfooding the 0.14.x upgrades. Six commits, one concern each. Full suite: PASS 152 tests on the final tree.

🐛 Dogfood bug: upgrade reset the configured language (10fa843)

Reproduced twice in the field (0.14.0 and 0.14.1 upgrades): every non-interactive upgrade reset locale.responseLanguage ("Tiếng Việt") to en.
Root cause: selectLanguage returned before its saved-locale restore whenever !ctx.interactive — so --yes runs never learned the configured label, the runtime.json copy overwrote it with template nulls, and patchRuntimeLocale then wrote the en default.
Fix: hoist the saved-locale restore above the interactivity check + a no-downgrade guard in patchRuntimeLocale. Proof: new live installer regression fixture — fails on the unpatched code (responseLanguage became "en"), passes after the fix.

Config unification (1b450ad) — closes PR #67 follow-up #1

runtime.json documents spec.{scaffold_guard, completion_gate, tollgate}; Claude spec-state.cjs now honors spec.tollgate: false (same key as the OpenCode plugin — one semantic across platforms). Dead skills.research.useGemini removed (research uses native WebSearch); paths.plans documented. (plugins/.logs/ gitignore — follow-up #3 — was already covered by the delegate-branch hardening; verified.)

Legacy cleanup (ec7948c, c83659f) — audit §3.3 leftovers + §3.4.7/8

  • archive-command/ removed (1,680 dead lines; pre-skill command workflow, never installed by the manifest). Vestigial sourceSubdir + self-test assertion cleaned; zero references remain.
  • Legacy Task-tool prose → Agent tool in develop/test/hotfix text (deliberate backward-compat notes kept).
  • inspector/debugger agents gain memory: user (researcher pattern).

Statusline 1M-context (e28d6e1) — audit §3.4.3/4

Autocompact reserve was hard-coded 45000 (22.5% of a 200k window) — 1M windows rendered misleading percentages. Now proportional to the payload's context_window_size; 200k behavior unchanged (smoke-tested: 100k used → 73% on 200k, 33% on 1M). usage.cjs OAuth endpoint marked experimental with its degradation contract.

New guardrail (c83659f) — audit §3.4.6

Self-test consistency check: settings-template hooks ↔ manifest runtime.files ↔ payload files must agree (11 hooks verified) — schema drift now fails the suite.

Verification

  • npm test: PASS 152 (151 after archive-command assertion removal + locale fixture + consistency check)
  • Locale regression fixture proven red on unpatched code (stash-fix → fail → restore → pass)
  • Statusline smoke-tested with fake 200k/1M payloads
  • grep sweeps: zero archive-command / useGemini references

Out of scope (tracked)

  • §3.4.5 develop parallel wave — feature-sized; goes through /hapo:specs next
  • §3.4.2 PreCompact/PostCompact — resolved-as-is: SessionStart(compact) in session.cjs already fires the post-compact warning; new events add no capability here
  • Vestigial DEFAULT_CONFIG.hooks name map in config.cjs — cosmetic, deferred

@hapo-nghialuu
hapo-nghialuu merged commit 72d03ca into dev Jul 19, 2026
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