Skip to content

feat(ci): select checks by semantic mise config changes (shadow mode) - #194

Merged
DamianReeves merged 14 commits into
mainfrom
DamianReeves/ci-semantic-mise-selection
Oct 21, 2026
Merged

DamianReeves merged 14 commits into
mainfrom
DamianReeves/ci-semantic-mise-selection

Conversation

@DamianReeves

Copy link
Copy Markdown
Member

Problem

Any change to .config/mise/config.toml selects full installation and platform qualification, even when the change only adds an opt-in task. In 9 of the 17 config changes since #125, the config path was the only reason for full qualification. Those PR runs took a median of 27 min, against 13 min for focused runs.

Tracked in beads: morphir-ukvn.5.62 (design stored in the bead), plan epic morphir-ukvn.5.62.1, under the CI landing-speed epic morphir-ukvn.5.90.

What this PR does (shadow mode)

  • Adds scripts/ci-mise-impact.mbtx. It compares the mise configuration at two revisions and prints one JSON impact (full, checks, reasons).
    • Settings ([tools], [env], [hooks], [settings]) are parsed with the pinned bobzhang/[email protected] and mapped to checks by a rule table. An unknown key selects full.
    • Tasks come from mise tasks ls --json, run in an isolated copy of the revision, plus each task's raw TOML. A task change selects the checks of the workflow-called tasks that reach it through depends, depends_post, wait_for or mise run. Shadowing by name or alias counts as a change. A task named in a script or file task selects full.
    • A task table maps every workflow-called mise task to its checks. An unmapped workflow call at head fails (test:ci also fails on unmapped or stale entries).
    • Any read, parse or resolve failure, an unresolvable call, or a timeout selects full with a reason.
  • scripts/ci-changes.mbtx runs it only when the config path changed and logs on stderr what it would select. The selection CI uses does not change: stdout and GITHUB_OUTPUT stay byte-identical, the child has a 120 s timeout, and any child failure is logged and ignored.
  • test:ci runs the new self-test.

Enforcement is a separate one-line PR (morphir-ukvn.5.62.1.8). It waits until at least 5 merged config PRs have shadow logs in which no dropped check failed.

Validation

This PR changes scripts/ci-changes.mbtx, so its own CI runs full qualification.

Scan workflow and action run steps for mise task calls, map each to the
checks it selects, and fail the self-test when a call has no table entry
or an entry has no call. Config tasks named in scripts or file tasks are
Full roots. All table rows were confirmed against the job conditions; none
changed.
load_ci_inputs now returns CiInputs with roots and forced Full reasons for
unresolved calls, roots absent from the task graph and template prefixes
that match no task. Backslash-continued run lines are joined before the
scan.
load_revision copies .config/mise, .github and scripts of a revision out of the checkout and lists its tasks with mise isolated from the developer's global, system and environment config. impact compares two revisions: head drift exits 1, every other failure selects full with a config reason. The raw TOML table of each config task joins its body, so a run_windows-only edit counts.
…ables

--lenient reads head workflow calls without a task_table entry as Full roots, for the replay of historical commits only; CI never passes it. The isolated mise run also sets MISE_PROFILE, MISE_OVERRIDE_CONFIG_FILENAMES and MISE_DEFAULT_CONFIG_FILENAME empty, so a developer's own values cannot change the result.
When .config/mise/config.toml changes, ci-changes runs
ci-mise-impact.mbtx from the merge base (pull_request, merge_group and
the local BASE HEAD form) or PUSH_BASE (push) to head, and logs each
reason and the selection it would make on stderr. The path rule still
decides while mise_selection_enforced is false, so the key=value output
and GITHUB_OUTPUT do not change.

select takes an optional MiseImpact. With it, the config path leaves the
path rules and the impact adds its checks; a full impact or an unknown
check name selects every check. When enforced, table drift fails and any
other child failure selects full.
Exit 1 of ci-mise-impact.mbtx counts as table drift only when stderr
has the drift message; a crash, a compile failure or another uncaught
error that also exits 1 now gives a full impact. The child run has a
120 s timeout that gives a full impact; @process.run stops the child
before it returns. The shadow event test now compares stdout and the
appended GITHUB_OUTPUT with the path-only rendering.
- setup:llvm runs only in a macOS step, which no focused job has, so it
  is Full. The task table comment now says that step-level if: counts.
- The mention scan skips ci-mise-impact.mbtx: its fixtures named the real
  opt-in task test:codec-adapter-mck and made it a Full root. The fixtures
  now use names that are not in the config.
- Git reads each revision from the top level of the work tree, with
  ls-tree --full-tree, so a run from a subdirectory sees the config. A
  config absent at both revisions is Full.
- shell_words splits on < and > and reads a trailing backslash as white
  space. A CI-reached task that calls a name which is a task at neither
  revision is Full.

Tests: redirection and backslash calls, unknown calls, a run from a
subdirectory, a config absent at both revisions, setup:llvm Full, and
real-config opt-in edits and an add that select nothing.
Before the reason lines, ci-changes prints on stderr which revisions the
impact compared and the mise version the child reported. Stdout and
GITHUB_OUTPUT do not change. The shadow test checks the header line and
its order.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-21T05:35:37.107025Z 4046644 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@DamianReeves
DamianReeves added this pull request to the merge queue Oct 21, 2026
Merged via the queue into main with commit 5b710a2 Oct 21, 2026
63 checks passed
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