Skip to content

refactor: split verify modules and main.rs into commands/, add release hygiene - #17

Merged
nordicnode merged 2 commits into
mainfrom
main-split-refactor
Aug 15, 2026
Merged

nordicnode merged 2 commits into
mainfrom
main-split-refactor

Conversation

@nordicnode

Copy link
Copy Markdown
Owner

What

Follow-up to the module-per-language / module-per-target refactors: eliminate the remaining monoliths and add release-hygiene fixes identified in the review.

Code structure

  • src/verify/discovery.rs (1,349 lines) → discovery/: claude.rs (Claude-specific checks), skill_md.rs (generic SKILL.md checks), mod.rs (shared infra + tests).
  • src/verify/invocation.rs (1,000+ lines) → invocation/: parse.rs (pure extraction fns), drift.rs (subcommand/version drift checks), mod.rs (run/spawn infra + tests).
  • src/main.rs (2,536 → 148 lines): each subcommand handler moved into src/commands/ (init, verify_cmd, doctor, update, diff, add, remove, config) behind a thin dispatcher.

Release hygiene

  • Branch protection on main (ruleset): requires a PR + CI checks for all pushes. This blocks the old direct push from the Homebrew re-pin job, so that job now opens an auto-merged PR instead.
  • Stale release-plz-* branch cleanup: 11 merged branches deleted; release-plz.yml now prunes merged branches post-release so they can't accumulate.
  • Prerelease rehearsal: new release-rehearsal.ymlworkflow_dispatch job that builds release binaries and smoke-tests --version without publishing (dry-run upload).

Docs / tooling

  • docs/format-compat.md: format-version compatibility matrix (which agents read which files, version tolerance, --format-version mapping).
  • Benchmark n-value: run.sh default --runs 1 → 5, with statistical rationale documented in docs/benchmark.md.

Verification

  • 260 tests pass; cargo fmt --check + clippy -D warnings clean; self-dogfood verify 100/100 (all 22 files byte-identical).
  • End-to-end smoke battery across all subcommands on a scratch repo.
  • Branch protection confirmed working: direct push to main is now rejected (which is why this lands via PR).

nordicnode and others added 2 commits August 15, 2026 12:16
…mmands/

The two remaining monoliths from the earlier refactors are gone. Adding an
agent ecosystem or a subcommand no longer means editing a 1.3–2.5k-line file.

verify/discovery.rs (1,349 lines) -> discovery/: the Claude Code checks
(marketplace/plugin.json) moved to claude.rs, the SKILL.md parsing + per-skill
structural checks to skill_md.rs, and mod.rs keeps the run() dispatcher,
shared helpers (rel_unix/strip_bom/find_kv_colon/is_valid_kebab) and the
existing per-ecosystem submodules. verify/invocation.rs (1,365 lines) ->
invocation/: parse.rs holds the pure text-extraction fns, drift.rs the
set-diff checks, mod.rs the spawn/orchestration + InvocationInput.

main.rs (2,536 lines) -> src/commands/ with one module per subcommand
(init/verify/doctor/update/diff/add/remove/config) plus shared helpers
(Confirm overrides, print_profile, compute_candidates, target detection) in
the module root; main.rs is now a thin clap dispatch (148 lines). The
confirm_tests module moved to commands/mod.rs; the panic_message test stays
in main.rs.

Behavior-neutral: all 260 tests pass, fmt + clippy -D warnings clean,
self-dogfood verify 100/100 with all 22 files byte-identical.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
…oading

The prune step's GitHub expression `(steps.release-plz.outputs.pr |
fromJSON).head_branch` is rejected by GitHub's expression grammar
(property access on a parenthesized filter chain), so the whole
release-plz.yml failed to load and every triggering run died with 0 jobs
("This run likely failed because of a workflow file issue").

Parse the raw output with jq from an env var instead — same information,
no expression-gym syntax.
@nordicnode
nordicnode merged commit 7dd3c8b into main Aug 15, 2026
11 checks passed
@nordicnode
nordicnode deleted the main-split-refactor branch August 15, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant