-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Labels
automationAutomation-generated direction and planningAutomation-generated direction and planning
Description
Last generated: 2026-02-12T07:05:08.781Z
Provider: openai
Model: gpt-5.2
Summary
Automate a repeatable “regen + verify” pipeline for generated CDP bindings, tighten CI around formatting/type-checking, and stop committing machine-local artifacts (.bish*, .sqlite, stray backups). This reduces drift between generator/ output and cdp/, prevents noisy diffs, and makes releases/PRs safer.
Direction (what and why)
- Make regeneration deterministic and enforced
- This repo’s core value is generated protocol bindings (
generator/generate.py→cdp/). CI should be able to regenerate from a pinned input and confirm the working tree is clean. That prevents “forgot to run generator” and accidental manual edits.
- This repo’s core value is generated protocol bindings (
- Standardize a single CI entrypoint
- There are many ad-hoc scripts (
quick_check.py,basic_check.sh,env_check.sh,minimal_test.py, etc.). Consolidate into a small set ofmaketargets that CI runs. This reduces maintenance and ambiguity about “what is green”.
- There are many ad-hoc scripts (
- Remove/ignore non-source artifacts
.bish-index,.bish.sqlite, andbfg-1.15.0.jarin-repo are high-risk for churn and supply-chain concerns, and they bloat the repo/CI. They should not be tracked unless there is a strong documented reason.
Plan (next 1–3 steps)
1) Add a generation verification workflow (CI)
Create: .github/workflows/ci.yml (or extend an existing “main” workflow if present) with jobs:
- Setup Python (matrix e.g. 3.10–3.12, align with
pyproject.toml) poetry install(orpip install -e .if you prefer; repo already haspoetry.lock)- Run:
make format-check(or equivalent)make type-checkmake testmake regen-check(new): run generator and assert no git diff
Concrete implementation:
- Add to
Makefile:regen:runspython generator/generate.py(with any required args)regen-check:runsregenthengit diff --exit-code -- cdp(and any other generated outputs)
- In workflow:
git config --global --add safe.directory "$GITHUB_WORKSPACE"- After
make regen-check, also rungit status --porcelainand fail if non-empty (optional but useful).
2) Add repo hygiene: ignore and remove local artifacts from version control
- Update
.gitignoreto include (at minimum):**/.bish-index**/.bish.sqlite*.sqlite*.jar(or specificallybfg-1.15.0.jarif you must keep other jars)- editor backups like
*~(you currently have.github/copilot-instructions.md~)
- Remove from git history going forward (in a normal PR; don’t rewrite history unless required):
- Delete tracked files:
.bish-index,.bish.sqlite.github/.bish-index,.github/.bish.sqlite.github/workflows/.bish-index,.github/workflows/.bish.sqlitecdp/.bish-index,cdp/.bish.sqlitedocs/.bish-index,docs/.bish.sqliteexamples/.bish-index,examples/.bish.sqlitegenerator/.bish-index,generator/.bish.sqlitetest/.bish-index,test/.bish.sqlite.github/copilot-instructions.md~
- Decide on
bfg-1.15.0.jar:- Prefer removing it and documenting how to obtain it in
docs/orSECURITY_SETUP.md(download link + checksum), or store it as a release asset if truly needed.
- Prefer removing it and documenting how to obtain it in
- Delete tracked files:
3) Consolidate checks into explicit Make targets used by CI
In Makefile, standardize:
lint:run ruff (add if not present)format-check:ruff format --check .(orblack --check .)type-check:mypyusing existingmypy.initest:pytest -q(if tests are pytest-based; otherwise wrap existingtest_*.pyscripts)ci:depends onformat-check type-check test regen-check
Then update workflows to call only make ci.
Risks/unknowns
- Generator inputs/pinning:
generator/generate.pymay download protocol JSON or depend on a local copy. If it fetches “latest”, regen-check will be flaky. If so, pin the protocol revision:- Commit the protocol JSON snapshot under e.g.
generator/protocol/<version>.json - Or add a lockfile/constant in
generator/generate.pyand cache the download by version.
- Commit the protocol JSON snapshot under e.g.
- Non-idempotent generation: If generation includes timestamps, random ordering, or environment-dependent formatting,
regen-checkwill fail. Fix by:- Sorting keys/collections during emit
- Removing timestamps from headers
- Enforcing UTF-8 and newline normalization
- Existing workflows noise: The repo has many synced “auto-*” workflows. Ensure the new CI workflow is not redundant/conflicting and is marked as required in branch protection (if used).
Suggested tests
- Local:
make regen-check(should produce no diff)make ci
- CI validation (PR):
- Confirm workflow runs on
pull_requestandpushtomaster - Add a small “canary” edit: modify a generated file in
cdp/manually; ensureregen-checkfails (proves it’s enforced)
- Confirm workflow runs on
- Repo hygiene:
git ls-files | grep -E '\.bish-|\.sqlite|~$'should return nothing after cleanup
Checklist to verify progress:
-
.gitignoreupdated and tracked.bish*/backup files removed -
make ciexists and is the only command CI calls -
make regen-checkfails when generated output is out of date - CI green on supported Python versions and stable across reruns
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
automationAutomation-generated direction and planningAutomation-generated direction and planning