chore(schema): fork $id + regen schema + CI drift guard (#66)
* chore(schema): fork $id to Vacbo/oh-my-opencode + regen schema + CI drift guard
Three fixes, one PR:
1. script/build-schema-document.ts - $id was still
https://raw.githubusercontent.com/code-yeongyu/oh-my-openagent/dev/assets/...
left over from the original fork. Updated to point at
https://raw.githubusercontent.com/Vacbo/oh-my-opencode/master/assets/...
so downstream consumers that key on $id see the correct origin.
2. assets/oh-my-opencode.schema.json regenerated. Absorbs two fields that
were in Zod source but missing from the published schema:
- experimental.subagent_recursion (from #65, v3.19.0)
- skills.hide_nested_by_default (from #54)
Plus the updated $id, and a few enum/minLength contractions that
reflect the current Zod source (the generator stopped emitting those
constraints; old schema had stale values).
3. .github/workflows/ci.yml:
- New 'Fail PR on schema drift' step: PRs fail if
assets/oh-my-opencode.schema.json is out of sync with the Zod
sources. Catches the drift before it lands on dev.
- Auto-commit expanded from master-only to master OR dev. Previously
only master pushes triggered the auto-commit, so accumulated
drift on dev sat until a release force-pushed master. Now dev
stays clean too.
Root cause of the long-running drift: previous PRs (e.g. #54, #65)
changed src/config/schema/*.ts but did not run 'bun run build:schema'
before committing. The CI auto-commit was gated to master-only, so
dev accumulated drift invisibly. The PR-level check added here
prevents repeats.
Verification:
- bun run build:schema (deterministic regen)
- bun run typecheck: clean
- bun test: 5636 pass / 0 fail
* fix(ci): schema drift guard detects deletions + draft-release targets post-auto-commit SHA
Addresses reviewer feedback on PR #66:
1. P2 (codex): Detect schema deletions in drift guard
Before: 'git diff --quiet' ignores untracked files. If a PR deletes
assets/oh-my-opencode.schema.json, the 'bun run build' step
regenerates it as untracked, drift check passes silently, and the
merge resurrects the file without it being tracked.
After: explicit '[ -f ... ]' existence check runs first, then
'git status --porcelain' (which DOES catch untracked paths) replaces
'git diff --quiet'. Same fix applied to the auto-commit path for
consistency.
2. Copilot: draft-release targets pre-auto-commit SHA
Before: draft-release used 'github.sha' which is the commit that
triggered the workflow. When auto-commit extension to 'dev' runs
(in this PR), it creates a new commit that draft-release won't
include, producing a release draft that doesn't reflect the actual
tip of 'dev'.
After:
- Build job exposes 'committed_sha' output (the auto-committed
SHA, or the original SHA when no commit was made).
- draft-release checkout now uses '${{ needs.build.outputs.committed_sha || github.sha }}' for both 'ref' and 'TARGET_SHA'.
- Fallback to github.sha preserves behavior when auto-commit
didn't run (PR CI, no schema drift, etc.).
Both fixes keep the two-path design (PR drift fails, push drift
auto-commits) and only tighten correctness edges. V
Vacbo committed
e27a96c25e400da89508d8075025544b7907da40
Parent: dba43ee
Committed by GitHub <noreply@github.com>
on 4/22/2026, 4:09:50 AM