chore: upgrade to Vitest 5.1 and align with j4k-align 18.3.1 #23

Merged
jercik merged 2 commits from chore/vitest-5-1 into main 2026-11-05 17:41:41 +00:00
Owner

Upgrades the tests to Vitest 5.1 and brings the repository to j4k-align 18.3.1.

  • vitest (and @vitest/coverage-v8 where present) moves to ^5.1.0. The tests needed no changes.
  • A new test:affected script runs pnpm run test --since-last-run: the same suite as test, limited to files affected by changes since the last run.
  • Align 18.3.1 refreshes the managed workflows and commit-message check. The baked-Node step now runs under bash, and the PR commit check now rejects unsquashed fixup!, squash! and amend! commits; the local hook still accepts them.

The commit hook ran the full local checks on both commits, and j4k-align audits clean.

Upgrades the tests to Vitest 5.1 and brings the repository to j4k-align 18.3.1. - `vitest` (and `@vitest/coverage-v8` where present) moves to `^5.1.0`. The tests needed no changes. - A new `test:affected` script runs `pnpm run test --since-last-run`: the same suite as `test`, limited to files affected by changes since the last run. - Align 18.3.1 refreshes the managed workflows and commit-message check. The baked-Node step now runs under bash, and the PR commit check now rejects unsquashed `fixup!`, `squash!` and `amend!` commits; the local hook still accepts them. The commit hook ran the full local checks on both commits, and `j4k-align` audits clean.
chore: align with j4k-align 18.3.1
All checks were successful
Checks / reuse (pull_request) Has been skipped
commit-msg / same-repo-pr (pull_request) Has been skipped
commit-msg / commitlint (pull_request) Successful in 4s
Dedupe check / dedupe-check (pull_request) Successful in 19s
Checks / quality-checks (pull_request) Successful in 50s
Checks / qc-result (pull_request) Has been skipped
Review / Review (pull_request_target) Successful in 5m24s
dffa6d2be5

Review 01M6PB9126ZF5HSS1XYM3X6S74 — head dffa6d2be5d7e955d6c81f3b6967d9b289112b82

Review — j4k-oss/fta-check @ 13f397a082

Scope: diff against base tree e1861c6bb51d
Review finished: 8 succeeded, 0 failed, 4 skipped by dispatch
Triage: settled
Facts: current review-wide projection

Computed under:

{
  "abandonment": "abandonment-v1",
  "anchor_recipe": 1,
  "batch_policy": "batch-v1",
  "coverage": "coverage-v3",
  "dispatch_policy": "dispatch-v2",
  "grounder_version": 1,
  "grounding_read_rule": "grounding-read-v1",
  "promotion_policy": "promotion-v1",
  "report": "report-v5",
  "tally": "tally-v1",
  "triage_settle": "triage-settle-v2"
}

Findings (1)

low — check-msg.sh now has three validation modes, but nothing in its interface says what each mode accepts

  • claim: 01M6PBE0WN1CDH0ZE9AVVG7RK9
  • anchor: scripts/check-msg.sh (snippet)
printf '%s\n' 'usage: check-msg.sh [--title | --draft] < message' >&2
  • lens: aposd-plain · arm: default
  • verdicts: 1 valid / 0 invalid / 0 uncertain
    • pass 01M6PBEMHXVC63R57DZ8Z3NP0S · valid: Grounded (exact) anchor confirms the script's only interface text is the usage line 'check-msg.sh [--title | --draft] < message'. The body supplies a coherent static trace of the case block: --title skips exemptions ('if '), the default mode exempts merge/revert/reapply but rejects fixup!/squash!/amend! with a quoted error, and --draft additionally admits autosquash prefixes via a nested 'if '. It names the three callers (two CI calls in .forgejo/workflows/commit-msg.yml, the hook in .githooks/commit-msg) and reports that AGENTS.md and README.md never mention check-msg. This establishes APoSD principle 13 and the Nonobvious Code / Vague Name red flags: what each flag accepts, including the intended split where a fixup! message passes the local hook and fails CI, can only be learned by reading nested conditionals. The claim is about interface documentation and naming, not observable CLI behavior, so the unix-cli-contracts skill does not decide it. That skill treats help layout as a design default, and the claim alleges no caller-visible failure. A short interface comment stating each mode's contract is accepted-values interface documentation, not an unnecessary restated set. No refuting safeguard or document appears in the batch. Low severity is appropriate.
  • disposition: none

This change adds a third mode to scripts/check-msg.sh. Each mode exempts a different set of headers, and nothing documents which. To pick a flag, a caller has to read the case block. The new name --draft does not say that its one effect is to let autosquash markers through.

The usage line, check-msg.sh [--title | --draft] < message, is all the interface the script has, and it has no comments. The behavior is in the code: --title skips every exemption (if [[ "$mode" != title ]]). The default mode, which CI runs on each commit a rebase would land (bash scripts/check-msg.sh < "$pr_fields/message" in .forgejo/workflows/commit-msg.yml), exempts merge, revert and reapply headers but rejects fixup! , squash! and amend! with "autosquash commit must be squashed before it lands". --draft, which .githooks/commit-msg passes, has the same exemptions and also accepts the autosquash prefixes. So the same fixup! x message passes the local hook and fails CI by design, and only the nested if [[ "$mode" == draft ]] shows it.

Correction: put a short interface comment at the top of the script that states the three contracts. For example: no flag checks a commit that will land on the target branch, and accepts merge, revert and reapply headers but not autosquash commits; --draft checks a local commit that may still be autosquashed, and also accepts fixup!/squash!/amend!; --title checks a squash subject with no exemptions. A name such as --allow-autosquash would carry the difference at the call site, but the comment is enough without a rename. No other document covers this. AGENTS.md and README.md never mention check-msg, so the comment would be the only place these rules are written down.

What I examined: I read scripts/check-msg.sh in full, both CI call sites in .forgejo/workflows/commit-msg.yml (--title for the PR title, no flag for each commit), the hook call in .githooks/commit-msg, and searched AGENTS.md and README.md for any description of the modes. I did not run the script. The mode behavior above comes from reading the case statement. If a repository document I missed describes the three modes, this claim does not hold.

Other claims

  • grounding-pending (0)
  • ungrounded (0)
  • rejected (0)
  • duplicate-of (0)
  • unadjudicated (0)

Coverage

Coverage pass: 01M6PB912AXZY2GAW36YQW8VQ6
Accounting: complete (all slots terminal; see slot results for failures)
Slot health: healthy

lens part arm unit status runs loss
general-bug ci-workflows default no-claims 1 no
general-bug commit-msg-tooling default no-claims 1 no
general-bug vitest-upgrade default no-claims 1 no
writing-quality whole default no-claims 1 no
restated-sets commit-msg-tooling default no-claims 1 no
unix-cli commit-msg-tooling default no-claims 1 no
module-design whole default no-claims 1 no
aposd-plain whole default claims-emitted 1 no
  • test-trimming — skipped-by-dispatch: no tests changed
  • project-docs — skipped-by-dispatch: no project documentation changed
  • use-effect — skipped-by-dispatch: no React code changed
  • react — skipped-by-dispatch: no React code changed
<!-- review:summary --> **Review** `01M6PB9126ZF5HSS1XYM3X6S74` — head `dffa6d2be5d7e955d6c81f3b6967d9b289112b82` # Review — j4k-oss/fta-check @ 13f397a0823d Scope: diff against base tree `e1861c6bb51d` Review finished: 8 succeeded, 0 failed, 4 skipped by dispatch Triage: settled Facts: current review-wide projection Computed under: ```json { "abandonment": "abandonment-v1", "anchor_recipe": 1, "batch_policy": "batch-v1", "coverage": "coverage-v3", "dispatch_policy": "dispatch-v2", "grounder_version": 1, "grounding_read_rule": "grounding-read-v1", "promotion_policy": "promotion-v1", "report": "report-v5", "tally": "tally-v1", "triage_settle": "triage-settle-v2" } ``` ## Findings (1) ### low — check-msg.sh now has three validation modes, but nothing in its interface says what each mode accepts - claim: `01M6PBE0WN1CDH0ZE9AVVG7RK9` - anchor: `scripts/check-msg.sh` (snippet) ``` printf '%s\n' 'usage: check-msg.sh [--title | --draft] < message' >&2 ``` - lens: aposd-plain · arm: default - verdicts: 1 valid / 0 invalid / 0 uncertain - pass `01M6PBEMHXVC63R57DZ8Z3NP0S` · valid: Grounded (exact) anchor confirms the script's only interface text is the usage line 'check-msg.sh [--title | --draft] < message'. The body supplies a coherent static trace of the case block: --title skips exemptions ('if [[ "$mode" != title ]]'), the default mode exempts merge/revert/reapply but rejects fixup!/squash!/amend! with a quoted error, and --draft additionally admits autosquash prefixes via a nested 'if [[ "$mode" == draft ]]'. It names the three callers (two CI calls in .forgejo/workflows/commit-msg.yml, the hook in .githooks/commit-msg) and reports that AGENTS.md and README.md never mention check-msg. This establishes APoSD principle 13 and the Nonobvious Code / Vague Name red flags: what each flag accepts, including the intended split where a fixup! message passes the local hook and fails CI, can only be learned by reading nested conditionals. The claim is about interface documentation and naming, not observable CLI behavior, so the unix-cli-contracts skill does not decide it. That skill treats help layout as a design default, and the claim alleges no caller-visible failure. A short interface comment stating each mode's contract is accepted-values interface documentation, not an unnecessary restated set. No refuting safeguard or document appears in the batch. Low severity is appropriate. - disposition: none > This change adds a third mode to `scripts/check-msg.sh`. Each mode exempts a different set of headers, and nothing documents which. To pick a flag, a caller has to read the `case` block. The new name `--draft` does not say that its one effect is to let autosquash markers through. > > The usage line, `check-msg.sh [--title | --draft] < message`, is all the interface the script has, and it has no comments. The behavior is in the code: `--title` skips every exemption (`if [[ "$mode" != title ]]`). The default mode, which CI runs on each commit a rebase would land (`bash scripts/check-msg.sh < "$pr_fields/message"` in `.forgejo/workflows/commit-msg.yml`), exempts merge, revert and reapply headers but rejects `fixup! `, `squash! ` and `amend! ` with "autosquash commit must be squashed before it lands". `--draft`, which `.githooks/commit-msg` passes, has the same exemptions and also accepts the autosquash prefixes. So the same `fixup! x` message passes the local hook and fails CI by design, and only the nested `if [[ "$mode" == draft ]]` shows it. > > Correction: put a short interface comment at the top of the script that states the three contracts. For example: no flag checks a commit that will land on the target branch, and accepts merge, revert and reapply headers but not autosquash commits; `--draft` checks a local commit that may still be autosquashed, and also accepts `fixup!`/`squash!`/`amend!`; `--title` checks a squash subject with no exemptions. A name such as `--allow-autosquash` would carry the difference at the call site, but the comment is enough without a rename. No other document covers this. `AGENTS.md` and `README.md` never mention `check-msg`, so the comment would be the only place these rules are written down. > > What I examined: I read `scripts/check-msg.sh` in full, both CI call sites in `.forgejo/workflows/commit-msg.yml` (`--title` for the PR title, no flag for each commit), the hook call in `.githooks/commit-msg`, and searched `AGENTS.md` and `README.md` for any description of the modes. I did not run the script. The mode behavior above comes from reading the `case` statement. If a repository document I missed describes the three modes, this claim does not hold. ## Other claims - grounding-pending (0) - ungrounded (0) - rejected (0) - duplicate-of (0) - unadjudicated (0) ## Coverage Coverage pass: 01M6PB912AXZY2GAW36YQW8VQ6 Accounting: complete (all slots terminal; see slot results for failures) Slot health: healthy | lens | part | arm | unit status | runs | loss | | --- | --- | --- | --- | --- | --- | | general-bug | ci-workflows | default | no-claims | 1 | no | | general-bug | commit-msg-tooling | default | no-claims | 1 | no | | general-bug | vitest-upgrade | default | no-claims | 1 | no | | writing-quality | whole | default | no-claims | 1 | no | | restated-sets | commit-msg-tooling | default | no-claims | 1 | no | | unix-cli | commit-msg-tooling | default | no-claims | 1 | no | | module-design | whole | default | no-claims | 1 | no | | aposd-plain | whole | default | claims-emitted | 1 | no | - test-trimming — skipped-by-dispatch: no tests changed - project-docs — skipped-by-dispatch: no project documentation changed - use-effect — skipped-by-dispatch: no React code changed - react — skipped-by-dispatch: no React code changed
@ -8,2 +9,3 @@
mode=draft
elif [[ "$#" -ne 0 ]]; then
printf '%s\n' 'usage: check-msg.sh [--title] < message' >&2
printf '%s\n' 'usage: check-msg.sh [--title | --draft] < message' >&2

low — check-msg.sh now has three validation modes, but nothing in its interface says what each mode accepts

This change adds a third mode to scripts/check-msg.sh. Each mode exempts a different set of headers, and nothing documents which. To pick a flag, a caller has to read the case block. The new name --draft does not say that its one effect is to let autosquash markers through.

The usage line, check-msg.sh [--title | --draft] < message, is all the interface the script has, and it has no comments. The behavior is in the code: --title skips every exemption (if [[ "$mode" != title ]]). The default mode, which CI runs on each commit a rebase would land (bash scripts/check-msg.sh < "$pr_fields/message" in .forgejo/workflows/commit-msg.yml), exempts merge, revert and reapply headers but rejects fixup! , squash! and amend! with "autosquash commit must be squashed before it lands". --draft, which .githooks/commit-msg passes, has the same exemptions and also accepts the autosquash prefixes. So the same fixup! x message passes the local hook and fails CI by design, and only the nested if [[ "$mode" == draft ]] shows it.

Correction: put a short interface comment at the top of the script that states the three contracts. For example: no flag checks a commit that will land on the target branch, and accepts merge, revert and reapply headers but not autosquash commits; --draft checks a local commit that may still be autosquashed, and also accepts fixup!/squash!/amend!; --title checks a squash subject with no exemptions. A name such as --allow-autosquash would carry the difference at the call site, but the comment is enough without a rename. No other document covers this. AGENTS.md and README.md never mention check-msg, so the comment would be the only place these rules are written down.

What I examined: I read scripts/check-msg.sh in full, both CI call sites in .forgejo/workflows/commit-msg.yml (--title for the PR title, no flag for each commit), the hook call in .githooks/commit-msg, and searched AGENTS.md and README.md for any description of the modes. I did not run the script. The mode behavior above comes from reading the case statement. If a repository document I missed describes the three modes, this claim does not hold.

lens aposd-plain · arm default · tally 1 valid / 0 invalid / 0 uncertain
claim 01M6PBE0WN1CDH0ZE9AVVG7RK9 of review 01M6PB9126ZF5HSS1XYM3X6S74

<!-- review:claim:01M6PBE0WN1CDH0ZE9AVVG7RK9 --> **low** — check-msg.sh now has three validation modes, but nothing in its interface says what each mode accepts > This change adds a third mode to `scripts/check-msg.sh`. Each mode exempts a different set of headers, and nothing documents which. To pick a flag, a caller has to read the `case` block. The new name `--draft` does not say that its one effect is to let autosquash markers through. > > The usage line, `check-msg.sh [--title | --draft] < message`, is all the interface the script has, and it has no comments. The behavior is in the code: `--title` skips every exemption (`if [[ "$mode" != title ]]`). The default mode, which CI runs on each commit a rebase would land (`bash scripts/check-msg.sh < "$pr_fields/message"` in `.forgejo/workflows/commit-msg.yml`), exempts merge, revert and reapply headers but rejects `fixup! `, `squash! ` and `amend! ` with "autosquash commit must be squashed before it lands". `--draft`, which `.githooks/commit-msg` passes, has the same exemptions and also accepts the autosquash prefixes. So the same `fixup! x` message passes the local hook and fails CI by design, and only the nested `if [[ "$mode" == draft ]]` shows it. > > Correction: put a short interface comment at the top of the script that states the three contracts. For example: no flag checks a commit that will land on the target branch, and accepts merge, revert and reapply headers but not autosquash commits; `--draft` checks a local commit that may still be autosquashed, and also accepts `fixup!`/`squash!`/`amend!`; `--title` checks a squash subject with no exemptions. A name such as `--allow-autosquash` would carry the difference at the call site, but the comment is enough without a rename. No other document covers this. `AGENTS.md` and `README.md` never mention `check-msg`, so the comment would be the only place these rules are written down. > > What I examined: I read `scripts/check-msg.sh` in full, both CI call sites in `.forgejo/workflows/commit-msg.yml` (`--title` for the PR title, no flag for each commit), the hook call in `.githooks/commit-msg`, and searched `AGENTS.md` and `README.md` for any description of the modes. I did not run the script. The mode behavior above comes from reading the `case` statement. If a repository document I missed describes the three modes, this claim does not hold. lens `aposd-plain` · arm `default` · tally 1 valid / 0 invalid / 0 uncertain claim `01M6PBE0WN1CDH0ZE9AVVG7RK9` of review `01M6PB9126ZF5HSS1XYM3X6S74`
Author
Owner

Not a defect in this PR. scripts/check-msg.sh is rendered by j4k-align from templates/repo/check-msg.sh.hbs, and j4k-align --fix overwrites hand edits, so a comment added here would be removed on the next alignment. The three modes are documented where the contract is owned, in Align's managed workflows guide. That guide names commit, draft and title modes, says what each accepts, and says why autosquash commits pass the local hook but fail the PR check.

<!-- gh-feedback:reply-to:239623 --> Not a defect in this PR. `scripts/check-msg.sh` is rendered by j4k-align from [`templates/repo/check-msg.sh.hbs`](https://code.j4k.dev/j4k/align/src/branch/main/templates/repo/check-msg.sh.hbs), and `j4k-align --fix` overwrites hand edits, so a comment added here would be removed on the next alignment. The three modes are documented where the contract is owned, in Align's [managed workflows guide](https://code.j4k.dev/j4k/align/src/branch/main/docs/managed-workflows.md#the-commit-msg-githook-and-workflow). That guide names commit, draft and title modes, says what each accepts, and says why autosquash commits pass the local hook but fail the PR check.
jercik marked this conversation as resolved
jercik merged commit b798a06f1b into main 2026-11-05 17:41:41 +00:00
jercik deleted branch chore/vitest-5-1 2026-11-05 17:41:41 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
j4k-oss/fta-check!23
No description provided.