Skip to content

CI guards (#1, #3) + schema-reference docs (#4.1, #4.3) - #16

Merged
jbeda merged 2 commits into
mainfrom
improve-ci-and-docs
Jul 21, 2026
Merged

CI guards (#1, #3) + schema-reference docs (#4.1, #4.3)#16
jbeda merged 2 commits into
mainfrom
improve-ci-and-docs

Conversation

@jbeda

@jbeda jbeda commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Four small, independent improvements. First run through the new review-loop process (.claude/rules/agent-workflow.md): implemented inline, one adversarial review round (Opus), one reliability fix applied, round record kept in .scratch/reviews/ (gitignored).

Closes #1.
Closes #3.
Addresses #4sub-items 1 and 3 only (the other five stay open).

#1 — release tags must be cut from main

release.yml's v* trigger can't be branch-filtered, so a tag off any branch would fire a public release. Added a runtime guard right after the full-history checkout: git merge-base --is-ancestor "$GITHUB_SHA" FETCH_HEAD fails the release unless the tagged commit is contained in main's history. Verified in review against a scratch repo: on-main (incl. main's tip) passes, off-main fails, no false-pass in the dangerous direction.

#3 — action.yml version pin can't silently go stale

action.yml pins a modelith release as its version default; bumping it post-release is a manual step nothing caught. New lightweight action-version.yml workflow compares the pinned default (yq) against the latest release (gh) and fails on drift. Triggers: action.yml changes (PR + push to main) for fast feedback, plus a weekly schedule so a forgotten post-release bump is caught within ~7 days without needing an action.yml PR.

Design note: chose the CI-gate over the auto-bump-PR option from the issue — simpler, no write permissions, and the failure mode (red check) is the reminder. Easily revisited later; not ADR-worthy.

#4.1 — document what the format deliberately leaves out

New "What this format deliberately leaves out" section in docs/06-schema-reference.md covering aggregates, value objects, domain events, and bounded contexts — each with why it's out of scope and any roadmap pointer (value types → #11). Turns hidden gaps into a credibility signal for a DDD-literate reader. Verified against the schema/lint that none of these constructs actually exist.

#4.3 — stop pressuring newcomers into filler invariants

Softened the "entity has no invariants" completeness message and added a note that genuinely rule-free entities are fine, so the warning reads as "check" not "fill". Message keeps the has no invariants substring the lint test anchors on; go test ./internal/lint/ passes.

Review round

One reduced round (Opus reviewer). Only finding: gh release view ... || true masked a genuine gh failure as "no release yet", silently no-opping the guard (false-negative). Fixed by switching to gh release list (empty on no-releases, non-zero on real error). Full record: .scratch/reviews/improve-ci-and-docs.md.

No Go behavior changed beyond one diagnostic string; go build + lint tests green locally.

🤖 Generated with Claude Code

jbeda added 2 commits July 21, 2026 14:54
…ions doc, softer invariant nudge

Closes #1, #3, and #4 sub-items 1 and 3.

- #1: guard that release tags are cut from main. release.yml's v* trigger
  can't be branch-filtered, so add a runtime step that fails unless the
  tagged commit is contained in main's history (git merge-base --is-ancestor).
- #3: add a lightweight action-version workflow that fails when action.yml's
  pinned `version` default drifts from the latest published release. Runs on
  action.yml changes and weekly, catching a forgotten post-release bump.
- #4.1: document what the format deliberately leaves out (aggregates, value
  objects, domain events, bounded contexts) in the schema reference.
- #4.3: soften the "entity has no invariants" completeness message and
  document that genuinely rule-free entities are fine, so newcomers stop
  inventing filler invariants.

Signed-off-by: Joe Beda <joe@stacklok.com>
… guard

Round 1 review (Opus) flagged that 'gh release view ... || true' masks a
genuine gh API failure as 'no release yet', silently no-opping the drift
guard. Use 'gh release list' instead: empty array (exit 0) means no releases,
non-zero exit on a real error fails the step under set -e.

Signed-off-by: Joe Beda <joe@stacklok.com>
@jbeda
jbeda merged commit f25dd78 into main Jul 21, 2026
2 checks passed
@jbeda
jbeda deleted the improve-ci-and-docs branch July 26, 2026 22:45
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.

CI guard: action.yml's pinned version should match the latest release release.yml: guard that releases only cut from main

1 participant