DOB-4: Delete syncBuiltinsFromRepo + JSON-Schema validators + deprecation-warning branches #796

Closed
opened 2026-05-03 18:05:19 +00:00 by claude-desktop · 1 comment
Collaborator

As a platform engineer, I want every code path that reads config/*.json at boot removed, so that the loader becomes a pure DB-only path — no file I/O, no schema validation, no deprecation-warning branches that scan disk for operator edits.

By the time this ships, DOB-1 has rerouted resolvers to code defaults, DOB-2 has migrated the rows, and DOB-3 has rewired the setup wizard. syncBuiltinsFromRepo and friends become dead code.

Acceptance criteria

Code removal

  • Delete apps/server/src/infrastructure/agent-env-sync/builtin-sync.ts (and split files like builtin-sync-mcp.ts, builtin-sync-labels.ts, … if any). Drop the corresponding tests.
  • Drop the syncBuiltinsFromRepo() call from main.ts and the boot order comment that references it.
  • Remove JSON-Schema validators: agents-config-schema.ts, service-config-schema.ts, labels-config-schema.ts, mcp-builtin-schema.ts (whatever the actual filenames are — grep for JSONSchema / Ajv / JsonSchemaType and clear the dependents).
  • Remove the deprecation-warning branches in webhook-config.ts / service-config-resolver.ts that fire when an operator edits agents.json or service.json post-deploy. The files no longer exist; the branches are unreachable.

Boot smoke

  • Service boots from an empty DB without throwing. Resolvers return code-side defaults (DOB-1).
  • Service boots from a populated DB without re-reading any JSON file. Verify by strace -f -e openat … bun run main.ts | grep config/.*\\.json returning empty (or by adding a one-shot test that asserts no readFile happens for those paths during boot).

Tests

  • Existing boot tests pass without syncBuiltinsFromRepo being importable.
  • grep -r 'syncBuiltinsFromRepo\\|builtin-sync' apps/ packages/ returns zero hits post-PR.

Out of scope

  • Deleting the config/*.json files themselves — DOB-5. (After this story, the files exist but nothing reads them; DOB-5 is the actual rm.)
  • Removing builtin_hash columns — DOB-2.

References

  • Code: apps/server/src/infrastructure/agent-env-sync/builtin-sync.ts, apps/server/src/main.ts boot path, apps/server/src/shared/config/*-schema.ts.
  • Depends on: DOB-1 (#793), DOB-2 (#794), DOB-3 (#795).
As a platform engineer, I want every code path that reads `config/*.json` at boot removed, so that the loader becomes a pure DB-only path — no file I/O, no schema validation, no deprecation-warning branches that scan disk for operator edits. By the time this ships, DOB-1 has rerouted resolvers to code defaults, DOB-2 has migrated the rows, and DOB-3 has rewired the setup wizard. `syncBuiltinsFromRepo` and friends become dead code. ## Acceptance criteria ### Code removal - [ ] Delete `apps/server/src/infrastructure/agent-env-sync/builtin-sync.ts` (and split files like `builtin-sync-mcp.ts`, `builtin-sync-labels.ts`, … if any). Drop the corresponding tests. - [ ] Drop the `syncBuiltinsFromRepo()` call from `main.ts` and the boot order comment that references it. - [ ] Remove JSON-Schema validators: `agents-config-schema.ts`, `service-config-schema.ts`, `labels-config-schema.ts`, `mcp-builtin-schema.ts` (whatever the actual filenames are — grep for `JSONSchema` / `Ajv` / `JsonSchemaType` and clear the dependents). - [ ] Remove the deprecation-warning branches in `webhook-config.ts` / `service-config-resolver.ts` that fire when an operator edits `agents.json` or `service.json` post-deploy. The files no longer exist; the branches are unreachable. ### Boot smoke - [ ] Service boots from an empty DB without throwing. Resolvers return code-side defaults (DOB-1). - [ ] Service boots from a populated DB without re-reading any JSON file. Verify by `strace -f -e openat … bun run main.ts | grep config/.*\\.json` returning empty (or by adding a one-shot test that asserts no `readFile` happens for those paths during boot). ### Tests - [ ] Existing boot tests pass without `syncBuiltinsFromRepo` being importable. - [ ] `grep -r 'syncBuiltinsFromRepo\\|builtin-sync' apps/ packages/` returns zero hits post-PR. ## Out of scope - Deleting the `config/*.json` files themselves — DOB-5. (After this story, the files exist but nothing reads them; DOB-5 is the actual `rm`.) - Removing `builtin_hash` columns — DOB-2. ## References - Code: `apps/server/src/infrastructure/agent-env-sync/builtin-sync.ts`, `apps/server/src/main.ts` boot path, `apps/server/src/shared/config/*-schema.ts`. - Depends on: DOB-1 (#793), DOB-2 (#794), DOB-3 (#795).
Collaborator

🤖 Auto-assigned to code-lead (heuristic: default → code-lead (no specific label match; safer than code)). Reply /unassign to reroute.

🤖 Auto-assigned to **code-lead** (heuristic: default → code-lead (no specific label match; safer than code)). Reply `/unassign` to reroute.
Sign in to join this conversation.
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.

Reference
charles/claude-hooks#796
No description provided.