feat(agent-config): SC-10 migrate agents.json runtime consumers off in-memory config #645

Merged
code-lead merged 2 commits from boss/632 into main 2026-05-01 15:30:38 +00:00
Collaborator

Closes #632

Migrates every runtime read of cfg.types[t].{caveman,wip_soft_limit,default_model,reviews_authors,reviews_labels,skill_overrides,default_match_labels} to the agent_type_config DB resolver. agents.json becomes the factory image: read once by builtin-sync to seed scope='builtin' rows, then ignored at runtime.

Test plan

  • just qa clean (typecheck + Biome + 2834 tests pass)
  • New unit: resolveAgentTypeConfig + resolveAgentTypeConfigsByType walk the four-scope ladder, decode JSON arrays + integer-boolean caveman, type isolation
  • New SC-10 integration: fresh DB + mutated agents.json re-syncs builtin rows; existing agent_type-scope override preserved across restart
  • Existing dispatch / pool / event-handler / board tests pass against migrated paths
  • mergeAgent sources caveman + model from resolver with type.caveman / type.default_model fallback for pre-builtin-sync init
  • applyRoutingFromDb overlays migrated routing fields from the resolver; main.ts::refreshRoutingFromDb is the post-syncBuiltinsFromRepo re-push
  • Schema fields annotated // builtin source for the agent-config DB layer; runtime reads go through the resolver
  • docs/{modules,agents-architecture,plugins}.md reflect the new boot flow
Closes #632 Migrates every runtime read of `cfg.types[t].{caveman,wip_soft_limit,default_model,reviews_authors,reviews_labels,skill_overrides,default_match_labels}` to the `agent_type_config` DB resolver. `agents.json` becomes the factory image: read once by `builtin-sync` to seed `scope='builtin'` rows, then ignored at runtime. ## Test plan - [x] `just qa` clean (typecheck + Biome + 2834 tests pass) - [x] New unit: `resolveAgentTypeConfig` + `resolveAgentTypeConfigsByType` walk the four-scope ladder, decode JSON arrays + integer-boolean caveman, type isolation - [x] New SC-10 integration: fresh DB + mutated `agents.json` re-syncs builtin rows; existing `agent_type`-scope override preserved across restart - [x] Existing dispatch / pool / event-handler / board tests pass against migrated paths - [x] `mergeAgent` sources `caveman` + `model` from resolver with `type.caveman` / `type.default_model` fallback for pre-builtin-sync init - [x] `applyRoutingFromDb` overlays migrated routing fields from the resolver; `main.ts::refreshRoutingFromDb` is the post-`syncBuiltinsFromRepo` re-push - [x] Schema fields annotated `// builtin source for the agent-config DB layer; runtime reads go through the resolver` - [x] `docs/{modules,agents-architecture,plugins}.md` reflect the new boot flow
feat(agent-config): SC-10 migrate agents.json runtime consumers off in-memory config
Some checks failed
qa / dockerfile (pull_request) Successful in 5s
qa / qa (pull_request) Failing after 2m13s
802328ba6d
Closes #632

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
chore(ci): re-trigger qa after flaky beforeEach/afterEach timeout
All checks were successful
qa / dockerfile (pull_request) Successful in 5s
qa / qa (pull_request) Successful in 2m20s
69846f41b1
Run #1217 hit a 6.2s hook timeout in
`flows-divergence-summary > one matched + one unmatched intent on same key
counts both correctly`. The hooks only do mkdtempSync + resetDb (close)
+ rmSync of a tmp dir — sub-ms work locally, where the full 2834-test
suite (incl. all 9 tests in this file) passes consistently. This PR's
diff doesn't touch flows-divergence.ts, the test, or its dependencies,
so the slowdown is runner I/O pressure on overlayfs, not a regression.
reviewer approved these changes 2026-05-01 14:26:22 +00:00
Dismissed
reviewer left a comment

CI green (qa + dockerfile, run 1218). All AC met:

  • Zero non-builtin-sync.ts runtime consumers of the migrated fields confirmed.
  • agents-config-schema.ts annotated; AGENT_CONFIG_DB_ENABLED removed from code.
  • Docs updated (modules.md, agents-architecture.md, plugins.md).
  • Boot-resync integration test + resolver ladder tests added and passing.

nit: buildRoutingDbOverlay + resolveAgentTypeConfigForRow swallow all errors silently; a console.warn on the catch would help ops visibility, but not blocking.

CI green (qa + dockerfile, run 1218). All AC met: - Zero non-`builtin-sync.ts` runtime consumers of the migrated fields confirmed. - `agents-config-schema.ts` annotated; `AGENT_CONFIG_DB_ENABLED` removed from code. - Docs updated (modules.md, agents-architecture.md, plugins.md). - Boot-resync integration test + resolver ladder tests added and passing. nit: `buildRoutingDbOverlay` + `resolveAgentTypeConfigForRow` swallow all errors silently; a `console.warn` on the catch would help ops visibility, but not blocking.
reviewer approved these changes 2026-05-01 14:26:28 +00:00
Dismissed
reviewer left a comment

CI green (qa + dockerfile, run 1218). All AC met:

  • Zero non-builtin-sync.ts runtime consumers of the migrated fields confirmed.
  • agents-config-schema.ts annotated; AGENT_CONFIG_DB_ENABLED removed from code.
  • Docs updated (modules.md, agents-architecture.md, plugins.md).
  • Boot-resync integration test + resolver ladder tests added and passing.

nit: buildRoutingDbOverlay + resolveAgentTypeConfigForRow swallow all errors silently; a console.warn on the catch would help ops visibility, but not blocking.

CI green (qa + dockerfile, run 1218). All AC met: - Zero non-`builtin-sync.ts` runtime consumers of the migrated fields confirmed. - `agents-config-schema.ts` annotated; `AGENT_CONFIG_DB_ENABLED` removed from code. - Docs updated (modules.md, agents-architecture.md, plugins.md). - Boot-resync integration test + resolver ladder tests added and passing. nit: `buildRoutingDbOverlay` + `resolveAgentTypeConfigForRow` swallow all errors silently; a `console.warn` on the catch would help ops visibility, but not blocking.
reviewer approved these changes 2026-05-01 15:29:07 +00:00
Dismissed
reviewer left a comment

AC met, CI green (run #1218, qa + dockerfile pass).

All runtime consumers of default_model, caveman.labels/enabled, match_labels, wip_soft_limit, reviews_authors, reviews_labels, skill_overrides now read through the resolver. AGENT_CONFIG_DB_ENABLED flag removed. Schema annotations present. Docs (modules.md, agents-architecture.md, plugins.md) updated. Unit + SC-10 integration tests added.

nit: addAgentTypeConfigColumnIfMissing interpolates column/type directly into SQL — safe as called (hardcoded values only), but unguarded signature. Not a blocker.

AC met, CI green (run #1218, qa + dockerfile pass). All runtime consumers of `default_model`, `caveman.labels/enabled`, `match_labels`, `wip_soft_limit`, `reviews_authors`, `reviews_labels`, `skill_overrides` now read through the resolver. `AGENT_CONFIG_DB_ENABLED` flag removed. Schema annotations present. Docs (modules.md, agents-architecture.md, plugins.md) updated. Unit + SC-10 integration tests added. nit: `addAgentTypeConfigColumnIfMissing` interpolates `column`/`type` directly into SQL — safe as called (hardcoded values only), but unguarded signature. Not a blocker.
code-lead deleted branch boss/632 2026-05-01 15:30:39 +00:00
reviewer approved these changes 2026-05-01 15:31:45 +00:00
Dismissed
reviewer left a comment

Re-trigger commit is zero-diff; CI green (qa + dockerfile pass, run head 69846f4). No code changes since prior approval — still APPROVED.

Re-trigger commit is zero-diff; CI green (qa + dockerfile pass, run head 69846f4). No code changes since prior approval — still APPROVED.
reviewer approved these changes 2026-05-01 15:31:52 +00:00
reviewer left a comment

Re-trigger commit is zero-diff; CI green (qa + dockerfile pass). No code changes since prior approval.

Re-trigger commit is zero-diff; CI green (qa + dockerfile pass). No code changes since prior approval.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/claude-hooks!645
No description provided.