feat(ci): add ci_checks.py sanity gate and a worktree-safe hook installer#75
Open
marcoaperez wants to merge 2 commits into
Open
feat(ci): add ci_checks.py sanity gate and a worktree-safe hook installer#75marcoaperez wants to merge 2 commits into
marcoaperez wants to merge 2 commits into
Conversation
agentic-fm
requested changes
Jul 15, 2026
agentic-fm
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for this, @marcoaperez — the intent is exactly right, and I confirmed the value: check_catalogs() catches invalid catalog JSON before it reaches collaborators, which is precisely the failure that recently broke the linter for everyone. I want this in.
One structural change before merge — placement:
agent/scripts/is reserved for agent/LLM-operation scripts (e.g.analyze.py,clipboard.py,companion_server.py,deploy.py). Repo-level CI / developer tooling like this doesn't belong there.- Please move all three into a new top-level
scripts/folder at the repo root:scripts/ci_checks.pyscripts/hooks/pre-pushscripts/install-hooks.sh
- Add a
scripts/AGENTS.mdthat documents what each script does and, importantly, how to wire the hooks up —install-hooks.shusage, whatpre-pushgates on, and the--no-verifyemergency bypass. Please write it as actionable setup instructions: in most cases it will be an agent wiring this up in a collaborator's clone, and without that doc the scripts just sit there unused. (Folder-scopedAGENTS.mdis picked up by AGENTS.md-aware tools; note the repo-rootAGENTS.mdis a symlink to the canonical instructions, so keep this one specific to thescripts/folder.)
Once relocated with that AGENTS.md, this is good to merge. Appreciate you closing the gap that bit us. 🙏
…ller Motivated by a real incident: a single missing comma silently turned step-catalog-en.json into invalid JSON, and nothing caught it before it reached collaborators — every tool that loads the catalog broke at once. - agent/scripts/ci_checks.py validates that every agent/catalogs/*.json parses, then runs the converter tests and the fmlint test suite. Exit 0/1, --quick for the catalog-only fast path. Runnable by hand, from a git hook, or from CI. - agent/scripts/hooks/pre-push runs ci_checks.py automatically whenever a push touches a critical artifact (a catalog, the SaXML/HR converters, or fmlint itself), and blocks the push if anything fails. - agent/scripts/install-hooks.sh installs the hooks, resolving the directory via `git rev-parse --git-common-dir` instead of assuming `.git/hooks` — a plain `.git` assumption fails inside a git worktree, where `.git` is a pointer file and the real hooks directory lives in the main checkout. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…NTS.md Per maintainer review: agent/scripts/ is reserved for agent/LLM-operation scripts (companion_server.py, deploy.py, clipboard.py); repo-level CI and developer tooling doesn't belong there. Moves: agent/scripts/ci_checks.py → scripts/ci_checks.py agent/scripts/hooks/pre-push → scripts/hooks/pre-push agent/scripts/install-hooks.sh → scripts/install-hooks.sh Updates every internal path reference accordingly (REPO_ROOT depth in ci_checks.py, the hook's own self-reference, install-hooks.sh's HOOKS_SRC). Adds scripts/AGENTS.md with actionable setup instructions — what each file does, the one-command install, what the hook gates on, and the emergency bypass — written for an agent wiring this up in a collaborator's clone, per the review request. Also hardens ci_checks.py while verifying it against a real upstream/main checkout: the "converter tests" and "fmlint tests" steps referenced agent/scripts/test_fm_xml_to_snippet.py and agent/fmlint/tests/, neither of which exists on main yet (the fmlint suite ships in petrowsky#72, still open; the converter test file was never proposed upstream). Both steps now check for their target path first and report SKIP instead of a hard FAIL when it's absent, so the checks stay usable standalone rather than red out of the box on a checkout that doesn't have those suites yet. Co-Authored-By: Claude Opus 4.8 <[email protected]>
marcoaperez
force-pushed
the
feat/ci-checks-and-worktree-hook-fix
branch
from
July 16, 2026 16:03
ec703fc to
53b8253
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivated by a real incident: a single missing comma silently turned
step-catalog-en.jsoninto invalid JSON, and nothing caught it before it reached collaborators — every tool that loads the catalog broke at once.What this adds
agent/scripts/ci_checks.pyvalidates that everyagent/catalogs/*.jsonparses, then runs the converter tests and the fmlint test suite. Exit 0/1,--quickfor the catalog-only fast path. Runnable by hand, from a git hook, or from CI.agent/scripts/hooks/pre-pushrunsci_checks.pyautomatically whenever a push touches a critical artifact (a catalog, the SaXML/HR converters, or fmlint itself), and blocks the push if anything fails. Emergency bypass viagit push --no-verify.agent/scripts/install-hooks.shinstalls the hooks, resolving the hooks directory viagit rev-parse --git-common-dirinstead of assuming.git/hooks— a plain.gitassumption fails inside a git worktree, where.gitis a pointer file and the real hooks directory lives in the main checkout.Test plan
ci_checks.py --quickcorrectly flags the catalog JSON bug currently onmain(see feat(fmlint): add param-fidelity rules to catch silent-discard params (X001-X003) #72) asFAILci_checks.py(full) runs converter + fmlint test suitesinstall-hooks.shrun from inside agit worktreecorrectly installs into the main checkout's.git/hooks/, not a worktree-local pathpre-pushcorrectly no-ops when the push doesn't touch a critical path, and triggersci_checks.pywhen it does