fix(config): sync MetaConfigSchema version default with package.json#275
fix(config): sync MetaConfigSchema version default with package.json#275xlabtg merged 2 commits intoxlabtg:mainfrom
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: xlabtg#273
Previously `MetaConfigSchema.version` defaulted to the hardcoded string "1.0.0", which disagreed with the actual package version (0.8.10). Configs written without an explicit `meta.version` would therefore carry a misleading version string in logs and migrations. Fix: import `pkg.version` from package.json (resolveJsonModule is already enabled) and use it as the Zod default so the two sources stay in sync automatically on every release. Also adds a unit test asserting that `loadConfig` on a minimal config (no `meta` block) returns `meta.version === pkg.version`, per the acceptance criteria in issue xlabtg#273.
Solution summaryDone. Here's a summary of what was done: Root cause: Fix (2 files changed):
PR: #275 This summary was automatically extracted from the AI working session output. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost: $1.028432📊 Context and tokens usage:
Total: (43.4K + 2.4M cached) input tokens, 9.5K output tokens, $1.028432 cost 🤖 Models used:
📎 Log file uploaded as Gist (1546KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
Summary
Fixes #273.
MetaConfigSchema.versionpreviously defaulted to the hardcoded string"1.0.0", which disagreed with the actual package version (0.8.10). Any config file without an explicitmeta.versionfield would carry this misleading version string in logs and migrations.Changes
src/config/schema.ts: Importpkg.versionfrompackage.json(JSON import —resolveJsonModulewas already enabled) and use it as the Zod default, so the schema version stays in sync withpackage.jsonautomatically on every release.src/config/__tests__/loader.test.ts: Add acceptance-criteria unit test asserting thatloadConfigon a minimal config (nometablock) returnsmeta.version === pkg.version.How to reproduce the issue
Before the fix:
After the fix:
Test plan
should default meta.version to the package.json versioninloader.test.ts— fails before fix, passes after.src/config/__tests__/loader.test.tscontinue to pass.tsc --noEmitpasses with no new errors.