Commit Graph
1 Commits
Author SHA1 Message Date
James 462bdf48ee refactor(scripts): extract shared sync helpers into scripts/lib/sync.ts
Both sync-schemas.ts and packages/codex-plugin/build.mts were hand-rolling
the same "compare source to target, print drift, exit 1 in --check mode"
pattern with slightly different output shapes. Extract:

- walkFiles(root, filter?) — recursive relative-path lister shared with
  the codex-plugin drift checker
- reportAndExit(drifted, { checkMode, label, fixCommand }) — prints a
  unified ✓/✗ summary, caps drift list, exits non-zero in check mode

Both callers now produce the same output shape so contributors see the
same UI whether they're syncing schemas or the codex plugin:

  ✗ <label> is out of sync:
    changed <path>
    missing <path>
    extra   <path>
  Run `<fix command>` and commit the result.

Verified: lint, format:check, sync-schemas:check, check:codex-plugin all
pass. Drift injection tests pass on both sync paths. Pre-commit hook still
auto-rebuilds the plugin skills/ copy on source changes and correctly
skips when only the plugin copy is edited (no clobber cycle).
2026-04-21 19:36:52 +00:00