From 8a8e17e46ef094233d82997bd78ea05b892a3d53 Mon Sep 17 00:00:00 2001 From: Michael Uloth Date: Wed, 4 Nov 2026 20:20:44 -0500 Subject: [PATCH 01/11] ci: pin actions by sha and add a dependabot config ooloth/dotfiles#251 CI used actions/checkout, dtolnay/rust-toolchain and Swatinem/rust-cache by floating tag, so a moved tag could change what CI runs, and nothing proposed dependency updates beyond Dependabot's ungrouped security PRs. Each action is now pinned to the full commit SHA its tag points at today, so CI runs the same code as before. dtolnay/rust-toolchain picks the toolchain from its ref, so the pinned SHA comes from master's history, as its README requires, and the workflow passes `toolchain: stable` instead. .github/dependabot.yml covers cargo and github-actions. Version updates arrive monthly for releases at least 7 days old, with minor and patch updates grouped and majors as their own PRs. Security updates get their own group, because they ignore version-update groups and would otherwise open one PR per package. rust-toolchain.toml names the `stable` channel rather than a version, so it has no entry. --- .github/dependabot.yml | 42 ++++++++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 11 ++++++++--- 2 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..c337bce --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,42 @@ +# Keeps the Cargo dependencies and the SHA-pinned actions in .github/workflows current. +# +# Version updates arrive at most monthly, and only for releases at least 7 days old, so a +# compromised release has time to be found and pulled. Minor and patch updates are grouped into +# one PR per ecosystem. Majors open as their own PRs, so one breaking upgrade cannot block the +# rest, and the PR limit leaves room for them beside the group. Security updates ignore the +# version-update groups and would open one PR per package, so they get their own group. +# +# rust-toolchain.toml sets `channel = "stable"` rather than a version, so it has nothing for +# Dependabot to bump and has no entry here. +version: 2 +updates: + - package-ecosystem: cargo + directory: / + schedule: + interval: monthly + cooldown: + default-days: 7 + open-pull-requests-limit: 5 + groups: + cargo: + applies-to: version-updates + patterns: ['*'] + update-types: [minor, patch] + cargo-security: + applies-to: security-updates + patterns: ['*'] + - package-ecosystem: github-actions + directory: / + schedule: + interval: monthly + cooldown: + default-days: 7 + open-pull-requests-limit: 5 + groups: + actions: + applies-to: version-updates + patterns: ['*'] + update-types: [minor, patch] + actions-security: + applies-to: security-updates + patterns: ['*'] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d8b04f..0c433d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,13 +16,18 @@ jobs: os: [macos-latest, ubuntu-latest] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + # Each action is pinned to a full commit SHA, so a moved tag cannot change what CI runs. + # Dependabot proposes new pins (.github/dependabot.yml). + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - - uses: dtolnay/rust-toolchain@stable + # This action picks the toolchain from its ref, so a pinned SHA passes `toolchain` instead. + # Its README requires the SHA to be from master's history. + - uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master with: + toolchain: stable components: rustfmt, clippy - - uses: Swatinem/rust-cache@v2 + - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 - name: install tools run: cargo install cargo-audit cargo-deny cargo-nextest --locked From 91ea9fd908be77531f50f9b8e1ea7cd9e5ce41a8 Mon Sep 17 00:00:00 2001 From: Michael Uloth Date: Wed, 4 Nov 2026 20:41:02 -0500 Subject: [PATCH 02/11] ci: say what the action pins leave unpinned ooloth/dotfiles#251 The ci.yml comment said a pinned SHA meant a moved tag could not change what CI runs, but the stable toolchain and the tools cargo install fetches still follow their latest releases. The comment now says so, and dependabot.yml says those tools are outside what Dependabot sees. The dtolnay/rust-toolchain pin's comment named master. The same commit is also the v1 tag, and Dependabot reads a pin's trailing comment as the version it tracks, so the comment now names v1. --- .github/dependabot.yml | 1 + .github/workflows/ci.yml | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c337bce..7f552ed 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,6 +8,7 @@ # # rust-toolchain.toml sets `channel = "stable"` rather than a version, so it has nothing for # Dependabot to bump and has no entry here. +# The tools CI installs with `cargo install` are in no manifest, so Dependabot does not see them. version: 2 updates: - package-ecosystem: cargo diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c433d3..de188ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,13 +16,14 @@ jobs: os: [macos-latest, ubuntu-latest] runs-on: ${{ matrix.os }} steps: - # Each action is pinned to a full commit SHA, so a moved tag cannot change what CI runs. - # Dependabot proposes new pins (.github/dependabot.yml). + # Each action is pinned to a full commit SHA, so a moved tag cannot change the action code CI + # runs. Dependabot proposes new pins (.github/dependabot.yml). The `stable` toolchain and the + # tools `cargo install` fetches below still follow their latest releases. - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 # This action picks the toolchain from its ref, so a pinned SHA passes `toolchain` instead. - # Its README requires the SHA to be from master's history. - - uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # master + # Its README requires the SHA to be from master's history; this one is master and the v1 tag. + - uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1 with: toolchain: stable components: rustfmt, clippy From b891f1c7c237c6c2168d2f61bcac16b38ee24782 Mon Sep 17 00:00:00 2001 From: Michael Uloth Date: Wed, 4 Nov 2026 20:41:58 -0500 Subject: [PATCH 03/11] ci: group the tui crates that must upgrade together ooloth/dotfiles#251 ui/tui/Cargo.toml pins ratatui, tui-textarea, ansi-to-tui and itertools to versions that build together, and deny.toml rejects duplicate versions. With only the catch-all group, Dependabot would propose a major of one of them as its own PR, which cannot build alone, or put a breaking bump in the grouped PR and fail the whole group. A tui group now holds the four, for every update type, ahead of the catch-all, since Dependabot gives a dependency to the first group that matches. --- .github/dependabot.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 7f552ed..ba75530 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,8 +3,9 @@ # Version updates arrive at most monthly, and only for releases at least 7 days old, so a # compromised release has time to be found and pulled. Minor and patch updates are grouped into # one PR per ecosystem. Majors open as their own PRs, so one breaking upgrade cannot block the -# rest, and the PR limit leaves room for them beside the group. Security updates ignore the -# version-update groups and would open one PR per package, so they get their own group. +# rest, and the PR limit leaves room for them beside the group. The TUI crates that must move +# together are the exception, in a group of their own. Security updates ignore the version-update +# groups and would open one PR per package, so they get their own group. # # rust-toolchain.toml sets `channel = "stable"` rather than a version, so it has nothing for # Dependabot to bump and has no entry here. @@ -19,6 +20,13 @@ updates: default-days: 7 open-pull-requests-limit: 5 groups: + # ui/tui/Cargo.toml pins these four to versions that build together, and deny.toml rejects + # duplicate versions, so one moving alone fails the build. They arrive as one PR, majors + # included. Dependabot gives a dependency to the first group that matches, so this group + # comes before the catch-all. + tui: + applies-to: version-updates + patterns: [ansi-to-tui, itertools, ratatui, tui-textarea] cargo: applies-to: version-updates patterns: ['*'] From 6d710b87f3a4991acd52ce75572af1d0a2ece321 Mon Sep 17 00:00:00 2001 From: Michael Uloth Date: Wed, 4 Nov 2026 20:42:00 -0500 Subject: [PATCH 04/11] ci: check toml formatting and schema on every pull request ooloth/dotfiles#251 Dependabot edits the Cargo.toml files without running prek's hooks, and CI did not run taplo, so a PR could pass CI with TOML that fails just check. CI now installs taplo-cli with the other tools and runs taplo fmt --check and taplo check, as prek.toml does. CI also builds only the configuration without hub-private, so AGENTS.md now says a Dependabot PR is merged only after just check passes on its branch locally. --- .github/workflows/ci.yml | 10 +++++++++- AGENTS.md | 4 ++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de188ad..7f3ba5c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 - name: install tools - run: cargo install cargo-audit cargo-deny cargo-nextest --locked + run: cargo install cargo-audit cargo-deny cargo-nextest taplo-cli --locked # rustfmt resolves mod declarations even behind #[cfg(feature = "private")], # so it fails if the private symlinks (from hub-private) aren't present. @@ -47,6 +47,14 @@ jobs: - name: fmt run: cargo fmt --check + # Dependabot edits the Cargo.toml files without running prek's hooks, so CI checks their + # formatting and schema the way prek.toml does. + - name: taplo fmt + run: taplo fmt --check + + - name: taplo check + run: taplo check + - name: clippy run: cargo clippy --all-targets -- -D warnings diff --git a/AGENTS.md b/AGENTS.md index bd80c6d..9f8e937 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -157,6 +157,10 @@ commits and the `Fixes #N` lines in them are lost, and the issues they fixed sta #384, 2026-10-28). An independent review of the change still runs before the push, and the user sees its findings first. +**A Dependabot PR is merged only after `just check` passes on its branch locally.** CI builds only +the configuration without hub-private, so a dependency update that breaks a hub-private build still +passes CI. `just check` lints every configuration the checkout can build. + ## Verifying TUI changes **Every change that alters what the TUI shows or how it behaves is driven live From 9d1e4c90d43a6b0ff3372784719a5be0a15217c0 Mon Sep 17 00:00:00 2001 From: Michael Uloth Date: Wed, 4 Nov 2026 20:43:32 -0500 Subject: [PATCH 05/11] docs: say which pushes ci checks in decision 031 Decision 031 said CI checks every push, but ci.yml runs on pushes to main and on pull requests, so a pushed branch with no PR gets no CI. The record now names those two triggers, as the build invariant already does. --- docs/decisions/031-hub-builds-and-tests-on-macos-and-linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/decisions/031-hub-builds-and-tests-on-macos-and-linux.md b/docs/decisions/031-hub-builds-and-tests-on-macos-and-linux.md index 9402aa6..0b808ee 100644 --- a/docs/decisions/031-hub-builds-and-tests-on-macos-and-linux.md +++ b/docs/decisions/031-hub-builds-and-tests-on-macos-and-linux.md @@ -21,8 +21,8 @@ date: 2026-11-01 ## Decision Every commit of hub, with or without each hub-private module, builds, passes clippy and passes its -tests on macOS and on Linux. CI builds, lints and tests every push on both, as a matrix of -`macos-latest` and `ubuntu-latest`. +tests on macOS and on Linux. CI builds, lints and tests every push to `main` and every pull +request on both, as a matrix of `macos-latest` and `ubuntu-latest`. hub runs on macOS. What only macOS has stays macOS-only behind `cfg(target_os = "macos")`: the disclaimed spawn of decision 027's addendum of 2026-11-01, launchd, and the notifications the From 238aa18d5da94496151eab419a7b6d516bb15785 Mon Sep 17 00:00:00 2001 From: Michael Uloth Date: Thu, 5 Nov 2026 06:54:56 -0500 Subject: [PATCH 06/11] ui/tui: drop tui-textarea and the direct itertools dependency ooloth/dotfiles#251 hub-tui depended on tui-textarea, which no code used, and on itertools for one with_position() call in the vendored markdown renderer. Both pinned ratatui's neighbours to versions chosen for each other, so the Dependabot group meant to move the TUI crates together could never resolve: tui-textarea has no release for ratatui 0.30, and ratatui 0.30 needs itertools 0.14 while hub held 0.13. The renderer only asked whether a line came after the first, so it now uses enumerate() and i > 0. A new parametrized test pins how a fenced block's lines split (one line, two lines, a blank middle line). It passed against the old code and fails when the condition is broken. Run against the same 71 live signals, the old and new binaries drew identical detail panes. ratatui, crossterm and ansi-to-tui are now the only crates that must move together, and the manifest comments say why. The markdown README, the vendored headers and the Textual question file describe the renderer and the dependencies as they now are. --- Cargo.lock | 13 ---------- .../should-the-tui-be-rebuilt-in-textual.md | 14 +++++------ ui/tui/Cargo.toml | 16 ++++--------- ui/tui/src/markdown/README.md | 9 ++++--- ui/tui/src/markdown/mod.rs | 1 + ui/tui/src/markdown/render.rs | 24 ++++++++++++++++--- 6 files changed, 40 insertions(+), 37 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3894caf..7472889 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -919,7 +919,6 @@ dependencies = [ "domain", "futures", "insta", - "itertools", "open", "proptest", "pulldown-cmark", @@ -931,7 +930,6 @@ dependencies = [ "store", "syntect", "tokio", - "tui-textarea", "two-face", "workflows", ] @@ -2647,17 +2645,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "tui-textarea" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a5318dd619ed73c52a9417ad19046724effc1287fb75cdcc4eca1d6ac1acbae" -dependencies = [ - "crossterm", - "ratatui", - "unicode-width 0.2.0", -] - [[package]] name = "two-face" version = "0.5.1" diff --git a/docs/questions/should-the-tui-be-rebuilt-in-textual.md b/docs/questions/should-the-tui-be-rebuilt-in-textual.md index 83f39fb..eeceaf8 100644 --- a/docs/questions/should-the-tui-be-rebuilt-in-textual.md +++ b/docs/questions/should-the-tui-be-rebuilt-in-textual.md @@ -65,10 +65,10 @@ same discussion and holds regardless of what the spike shows. all. Cost: the browser surface Decision 007 deferred stays expensive to reach, and the hand-drawn chrome plus the 545-line markdown renderer stay hub's to maintain. - **B. Rebuild in Textual.** Strongest case: `textual serve` keeps Decision 007's one reopening - condition cheap; Textual ships the `Markdown` widget, `TextArea` and CSS borders that five - dependencies currently provide (`pulldown-cmark`, `syntect`, `two-face`, `ansi-to-tui`, - `tui-textarea`); and Python is where the Claude Agent SDK lives if hub ever drives investigation - sessions rather than launching them through tmux. Cost: 641 tests and 51 snapshots do not port + condition cheap; Textual ships the `Markdown` widget and CSS borders that four dependencies + currently provide (`pulldown-cmark`, `syntect`, `two-face`, `ansi-to-tui`); and Python is where + the Claude Agent SDK lives if hub ever drives investigation sessions rather than launching them + through tmux. Cost: 641 tests and 51 snapshots do not port mechanically, and the domain newtypes lose compile-time enforcement in exchange for mypy at CI time. - **C. Not yet.** Strongest case: Decisions 021 and 022 are not fully built (the TUI still fetches @@ -91,9 +91,9 @@ into a decision record._ `render/` and `markdown/`, plus `main.rs`; `render/status_bar.rs` imports none of it. - *Measured* (2026-09-16): Textual's latest release is v8.2.8, 30 June 2026, from https://github.com/Textualize/textual/releases. -- *Sourced*: `ui/tui/Cargo.toml` pins ratatui at 0.29 because 0.30 moved `Widget` into a separate - crate, and pins itertools at 0.13 solely to match ratatui's own copy and satisfy `cargo-deny`'s - duplicate-version ban. Both pins carry the reason in a manifest comment. +- *Sourced*: `ui/tui/Cargo.toml` keeps ratatui at 0.29 because `ansi-to-tui` 7 depends on it, and + `ansi-to-tui` 8 moved to `ratatui-core` with ratatui 0.30. `crossterm` follows ratatui's copy to + satisfy `cargo-deny`'s duplicate-version ban. The manifest comments carry both reasons. - *Sourced*: there is no release pipeline. `.github/workflows/ci.yml` runs checks and produces no artifacts; installation is `cargo install --path ui/tui` on the machine that will run it. Neither language has a distribution advantage here until that changes. diff --git a/ui/tui/Cargo.toml b/ui/tui/Cargo.toml index 0e3b664..81f70c1 100644 --- a/ui/tui/Cargo.toml +++ b/ui/tui/Cargo.toml @@ -22,21 +22,16 @@ chrono = "0.4" clients = { path = "../../clients" } config = { path = "../../config" } + # The crossterm version ratatui depends on (0.28 for ratatui 0.29). deny.toml rejects a second + # copy, so this moves with ratatui. crossterm = { version = "0.28", features = ["event-stream"] } domain = { path = "../../domain" } futures = "0.3" - # Pinned to 0.13 to unify with ratatui 0.29, which also depends on itertools 0.13. - # cargo-deny's bans check rejects duplicate versions; only with_position()/Position - # are used here, an API present in both 0.13 and 0.14. Bump in lockstep with ratatui. - itertools = "0.13" open = "5" pulldown-cmark = { version = "0.13", default-features = false } - # Pinned to 0.29 to unify with tui-textarea 0.7, which also depends on 0.29. - # tui-textarea 0.7 implements ratatui 0.29's Widget trait; ratatui 0.30 moved - # Widget into a new ratatui-core crate, making set_block() and direct TextArea - # rendering fail to compile. Before bumping this, check that the target - # tui-textarea version also supports the new ratatui version — and keep - # ansi-to-tui in sync (v8 switched to ratatui-core; v7 uses ratatui 0.29). + # ansi-to-tui must depend on this ratatui version: v7 uses ratatui 0.29, and v8 moved to + # ratatui-core with ratatui 0.30. ratatui, crossterm and ansi-to-tui move together, and + # Dependabot proposes them as one PR (the `tui` group in .github/dependabot.yml). ratatui = "0.29" rusqlite = { version = "0.31", features = ["bundled"] } secrecy = "0.8" @@ -50,7 +45,6 @@ "regex-fancy", ] } tokio = { version = "1", features = ["full"] } - tui-textarea = { version = "0.7", features = ["crossterm"] } two-face = { version = "0.5", default-features = false, features = [ "syntect-fancy", ] } diff --git a/ui/tui/src/markdown/README.md b/ui/tui/src/markdown/README.md index f82e5e4..d9355f0 100644 --- a/ui/tui/src/markdown/README.md +++ b/ui/tui/src/markdown/README.md @@ -4,7 +4,7 @@ Vendored and patched fork of [tui-markdown 0.3.7][tui-markdown] (MIT/Apache-2.0) ## What changed -Two lines in `mod.rs` differ from upstream: +These changes in `render.rs` differ from upstream: 1. **`SYNTAX_SET`** — uses `two_face::syntax::extra_newlines()` instead of `SyntaxSet::load_defaults_newlines()`. This extends the bundled syntax set from @@ -14,6 +14,9 @@ Two lines in `mod.rs` differ from upstream: 2. **`MOCHA_THEME`** — uses `two_face::theme::extra().get(EmbeddedThemeName::CatppuccinMocha)` instead of `base16-ocean.dark`. +3. **`text`** — splits multi-line text with `enumerate()` where upstream uses + `itertools::with_position()`, so hub does not depend on `itertools`. + `style_sheet.rs` adds `CatppuccinStyleSheet`, which the module's `from_str` uses as its default. It styles headings and inline code in Mocha mauve to match `FOCUS_COLOR` in `render/mod.rs`. @@ -24,8 +27,8 @@ avoid the `tracing` dependency. ## Staying in sync with upstream [tui-markdown releases][releases] are infrequent. If a new version ships, diff -`src/lib.rs` from upstream against `mod.rs` here, apply any logic changes, and -re-apply the two patches above. +`src/lib.rs` from upstream against `render.rs` here, apply any logic changes, and +re-apply the patches above. [tui-markdown]: https://github.com/joshka/tui-markdown [releases]: https://github.com/joshka/tui-markdown/releases diff --git a/ui/tui/src/markdown/mod.rs b/ui/tui/src/markdown/mod.rs index c821a18..ada8eaf 100644 --- a/ui/tui/src/markdown/mod.rs +++ b/ui/tui/src/markdown/mod.rs @@ -2,6 +2,7 @@ // - SYNTAX_SET uses two-face's extended syntax set (adds TypeScript, TOML, etc.) // - Theme uses two-face's built-in CatppuccinMocha instead of base16-ocean.dark // - tracing instrumentation removed +// - multi-line text split with enumerate() instead of itertools' with_position() // - pub(crate) visibility throughout pub(crate) mod options; pub(crate) mod render; diff --git a/ui/tui/src/markdown/render.rs b/ui/tui/src/markdown/render.rs index 74676f5..eb44038 100644 --- a/ui/tui/src/markdown/render.rs +++ b/ui/tui/src/markdown/render.rs @@ -2,12 +2,12 @@ // - SYNTAX_SET uses two-face's extended syntax set (adds TypeScript, TOML, etc.) // - Theme uses two-face's built-in CatppuccinMocha instead of base16-ocean.dark // - tracing instrumentation removed +// - multi-line text split with enumerate() instead of itertools' with_position() // - pub(crate) visibility throughout use std::sync::LazyLock; use ansi_to_tui::IntoText; -use itertools::{Itertools, Position}; use pulldown_cmark::{ BlockQuoteKind, CodeBlockKind, CowStr, Event, HeadingLevel, Options as ParseOptions, Parser, Tag, TagEnd, @@ -294,12 +294,12 @@ where return; } - for (position, line) in text.lines().with_position() { + for (i, line) in text.lines().enumerate() { if self.needs_newline { self.push_line(Line::default()); self.needs_newline = false; } - if matches!(position, Position::Middle | Position::Last) { + if i > 0 { self.push_line(Line::default()); } let style = self.inline_styles.last().copied().unwrap_or_default(); @@ -521,6 +521,24 @@ mod tests { ); } + fn line_texts(lines: &[Line]) -> Vec { + lines + .iter() + .map(|l| l.spans.iter().map(|s| s.content.as_ref()).collect()) + .collect() + } + + #[rstest] + #[case::one_line("```\nonly\n```\n", &["```", "only", "```"])] + #[case::two_lines("```\nhello\nworld\n```\n", &["```", "hello", "world", "```"])] + #[case::blank_middle_line("```\na\n\nb\n```\n", &["```", "a", "", "b", "```"])] + fn fence_text_renders_one_line_per_source_line( + #[case] markdown: &str, + #[case] expected: &[&str], + ) { + assert_eq!(line_texts(&from_str(markdown).lines), expected); + } + #[test] fn unlanguaged_fence_delimiters_are_unstyled() { let styles = fence_styles(&from_str("```\nhello\n```\n").lines); From abb3ac17d070586a956bfb537ba3cde638c21894 Mon Sep 17 00:00:00 2001 From: Michael Uloth Date: Thu, 5 Nov 2026 06:55:06 -0500 Subject: [PATCH 07/11] ci: install pinned tool binaries and fix the tui Dependabot group ooloth/dotfiles#251 The tui group listed itertools and tui-textarea, which hub no longer depends on, and left out crossterm, which must match ratatui's copy. It now holds ansi-to-tui, crossterm and ratatui. The header notes that Dependabot counts a 0.x minor bump as a major, as Cargo does. CI installed the toolchain with dtolnay/rust-toolchain, whose only release predates the cooldown and grouping, and compiled cargo-audit, cargo-deny, cargo-nextest and taplo-cli at their latest versions on every run. rustup, already on the runners, now installs the toolchain, and taiki-e/install-action installs prebuilt binaries at exact versions checked against its manifest's checksums. fallback: none makes a missing version fail instead of building. v2.87.32 and nextest 0.9.149 are the newest releases at least 7 days old. Dependabot does not read the tool versions, so they are bumped by hand. The workflow token is limited to reading the repository. The AGENTS.md merge rule now asks for just lint and just test with hub-private linked, since just check rewrites files and runs no tests, and the build invariant lists Dependabot's commits among the gaps its check misses. --- .github/dependabot.yml | 20 ++++++------ .github/workflows/ci.yml | 31 ++++++++++++------- AGENTS.md | 8 +++-- ...ds-with-and-without-each-private-module.md | 5 ++- 4 files changed, 40 insertions(+), 24 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index ba75530..eb9d533 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -3,13 +3,15 @@ # Version updates arrive at most monthly, and only for releases at least 7 days old, so a # compromised release has time to be found and pulled. Minor and patch updates are grouped into # one PR per ecosystem. Majors open as their own PRs, so one breaking upgrade cannot block the -# rest, and the PR limit leaves room for them beside the group. The TUI crates that must move -# together are the exception, in a group of their own. Security updates ignore the version-update -# groups and would open one PR per package, so they get their own group. +# rest, and the PR limit leaves room for them beside the group. For a 0.x crate Dependabot counts +# a minor bump (0.28 to 0.29) as a major, as Cargo does. The TUI crates that must move together are +# the exception, in a group of their own. Security updates ignore the version-update groups and +# would open one PR per package, so they get their own group. # # rust-toolchain.toml sets `channel = "stable"` rather than a version, so it has nothing for # Dependabot to bump and has no entry here. -# The tools CI installs with `cargo install` are in no manifest, so Dependabot does not see them. +# The tools ci.yml installs with taiki-e/install-action are pinned by version in its `tool` input, +# which Dependabot does not read, so those versions are bumped by hand. version: 2 updates: - package-ecosystem: cargo @@ -20,13 +22,13 @@ updates: default-days: 7 open-pull-requests-limit: 5 groups: - # ui/tui/Cargo.toml pins these four to versions that build together, and deny.toml rejects - # duplicate versions, so one moving alone fails the build. They arrive as one PR, majors - # included. Dependabot gives a dependency to the first group that matches, so this group - # comes before the catch-all. + # ansi-to-tui depends on a ratatui version, and ratatui on a crossterm version, that + # ui/tui/Cargo.toml must match. deny.toml rejects duplicate versions, so one moving alone + # fails CI. They arrive as one PR, majors included. Dependabot gives a dependency to the + # first group that matches, so this group comes before the catch-all. tui: applies-to: version-updates - patterns: [ansi-to-tui, itertools, ratatui, tui-textarea] + patterns: [ansi-to-tui, crossterm, ratatui] cargo: applies-to: version-updates patterns: ['*'] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7f3ba5c..51e0367 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,10 @@ on: branches: [main] pull_request: +# CI only reads the repository, so its token can do nothing else, whatever the repo's default is. +permissions: + contents: read + jobs: check: # hub runs on macOS and is also developed in Linux sandboxes, so every push to main and every @@ -17,21 +21,26 @@ jobs: runs-on: ${{ matrix.os }} steps: # Each action is pinned to a full commit SHA, so a moved tag cannot change the action code CI - # runs. Dependabot proposes new pins (.github/dependabot.yml). The `stable` toolchain and the - # tools `cargo install` fetches below still follow their latest releases. + # runs. Dependabot proposes new pins (.github/dependabot.yml). The `stable` toolchain still + # follows the latest Rust release. - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - # This action picks the toolchain from its ref, so a pinned SHA passes `toolchain` instead. - # Its README requires the SHA to be from master's history; this one is master and the v1 tag. - - uses: dtolnay/rust-toolchain@683b588c487a69d01f6c6ddf40f036ff682cc2c8 # v1 - with: - toolchain: stable - components: rustfmt, clippy + # rustup is already on the hosted runners, so no third-party action installs the toolchain. + - name: install toolchain + run: rustup toolchain install stable --profile minimal --component rustfmt,clippy - uses: Swatinem/rust-cache@d1527c8f67ef9af357290475d4af4b0fab8f12e0 # v2.9.3 - - name: install tools - run: cargo install cargo-audit cargo-deny cargo-nextest taplo-cli --locked + # Prebuilt binaries at exact versions, each checked against the checksum in the action's + # manifest, so CI compiles none of them, and a new release reaches CI only through a commit + # that changes its version here. `fallback: none` fails the step rather than building a + # version the manifest lacks. Dependabot does not read `tool`, so these versions are bumped + # by hand. This runs after rust-cache, so binaries the cache restores into ~/.cargo/bin are + # replaced rather than used. + - uses: taiki-e/install-action@5488ac5a951645ce95062214902ac4b6bc1a1037 # v2.87.32 + with: + tool: cargo-audit@0.22.2,cargo-deny@0.20.2,cargo-nextest@0.9.149,taplo@0.10.0 + fallback: none # rustfmt resolves mod declarations even behind #[cfg(feature = "private")], # so it fails if the private symlinks (from hub-private) aren't present. @@ -48,7 +57,7 @@ jobs: run: cargo fmt --check # Dependabot edits the Cargo.toml files without running prek's hooks, so CI checks their - # formatting and schema the way prek.toml does. + # formatting and TOML syntax the way prek.toml does. - name: taplo fmt run: taplo fmt --check diff --git a/AGENTS.md b/AGENTS.md index 9f8e937..9a71cdb 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -157,9 +157,11 @@ commits and the `Fixes #N` lines in them are lost, and the issues they fixed sta #384, 2026-10-28). An independent review of the change still runs before the push, and the user sees its findings first. -**A Dependabot PR is merged only after `just check` passes on its branch locally.** CI builds only -the configuration without hub-private, so a dependency update that breaks a hub-private build still -passes CI. `just check` lints every configuration the checkout can build. +**A Dependabot PR that changes `Cargo.toml` or `Cargo.lock` is merged only after `just lint` and +`just test` pass at its head commit, in a checkout where `just setup-private` has linked +hub-private.** CI builds only the configuration without hub-private, so a dependency update that +breaks a hub-private build still passes CI. `just check` is not enough here: it rewrites files, +runs no tests, and lints only the public configuration in a checkout without the private links. ## Verifying TUI changes diff --git a/docs/invariants/hub-builds-with-and-without-each-private-module.md b/docs/invariants/hub-builds-with-and-without-each-private-module.md index ae5a088..ef1c7e8 100644 --- a/docs/invariants/hub-builds-with-and-without-each-private-module.md +++ b/docs/invariants/hub-builds-with-and-without-each-private-module.md @@ -54,7 +54,7 @@ runs it, `just check` runs `just lint`, and prek runs `just lint` before every c fails, it names the configurations that failed and points here. Public CI checks only the first configuration, because it has no hub-private. It checks it on -both platforms: `.github/workflows/ci.yml` runs fmt, clippy, the tests, audit and deny on +both platforms: `.github/workflows/ci.yml` runs fmt, taplo, clippy, the tests, audit and deny on `macos-latest` and on `ubuntu-latest` for every push to `main` and every pull request. What the check misses: @@ -70,6 +70,9 @@ What the check misses: push, in only the fullest configuration the checkout has, and public CI runs only the one without hub-private. So the private configurations' tests run on Linux only when an orb runs `just test`, and the tests of hub-private without the media module never run on a device that has it. +- **Dependabot's commits.** Dependabot commits on GitHub, where prek never runs `just lint`. + AGENTS.md has a Dependabot PR that changes the Cargo files merged only after `just lint` and + `just test` pass in a checkout with hub-private linked. - **Runtime behaviour.** A stub that compiles can still do the wrong thing. `media_stub.rs` has a test asserting that it returns an error. That test runs only on a device without the media module. From 201c56d324610af4328eb607ea717d158bc23049 Mon Sep 17 00:00:00 2001 From: Michael Uloth Date: Thu, 5 Nov 2026 06:56:48 -0500 Subject: [PATCH 08/11] docs: require every hub-private module for Dependabot merges ooloth/dotfiles#251 The rule asked for a checkout where just setup-private had linked hub-private. A device without the media module satisfies that but never builds the media configuration, so a dependency bump that breaks it could still be merged. The rule now asks for every module to be linked, and drops a reason for not using just check that was just as true of just lint. --- AGENTS.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index 9a71cdb..c159680 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -158,10 +158,10 @@ commits and the `Fixes #N` lines in them are lost, and the issues they fixed sta sees its findings first. **A Dependabot PR that changes `Cargo.toml` or `Cargo.lock` is merged only after `just lint` and -`just test` pass at its head commit, in a checkout where `just setup-private` has linked -hub-private.** CI builds only the configuration without hub-private, so a dependency update that -breaks a hub-private build still passes CI. `just check` is not enough here: it rewrites files, -runs no tests, and lints only the public configuration in a checkout without the private links. +`just test` pass at its head commit, in a checkout where `just setup-private` has linked every +hub-private module.** CI builds only the configuration without hub-private, so a dependency update +that breaks a hub-private build still passes CI. `just check` is not enough here: it rewrites files +and runs no tests. ## Verifying TUI changes From 154304166f1b62c163e58cf0326bea5c7f2355f0 Mon Sep 17 00:00:00 2001 From: Michael Uloth Date: Thu, 5 Nov 2026 06:58:22 -0500 Subject: [PATCH 09/11] docs: match the invariant's Dependabot gap to the AGENTS.md rule ooloth/dotfiles#251 The invariant said a Dependabot PR is merged after the checks pass in a checkout with hub-private linked. AGENTS.md now asks for every hub-private module to be linked, so the invariant says the same. --- .../hub-builds-with-and-without-each-private-module.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/invariants/hub-builds-with-and-without-each-private-module.md b/docs/invariants/hub-builds-with-and-without-each-private-module.md index ef1c7e8..29cf83b 100644 --- a/docs/invariants/hub-builds-with-and-without-each-private-module.md +++ b/docs/invariants/hub-builds-with-and-without-each-private-module.md @@ -72,7 +72,7 @@ What the check misses: and the tests of hub-private without the media module never run on a device that has it. - **Dependabot's commits.** Dependabot commits on GitHub, where prek never runs `just lint`. AGENTS.md has a Dependabot PR that changes the Cargo files merged only after `just lint` and - `just test` pass in a checkout with hub-private linked. + `just test` pass in a checkout with every hub-private module linked. - **Runtime behaviour.** A stub that compiles can still do the wrong thing. `media_stub.rs` has a test asserting that it returns an error. That test runs only on a device without the media module. From 2bf35ab835e9031f3b2d2ad8bd8387740d0a7cf8 Mon Sep 17 00:00:00 2001 From: Michael Uloth Date: Thu, 5 Nov 2026 07:11:33 -0500 Subject: [PATCH 10/11] ci: leave security majors to their own Dependabot PRs ooloth/dotfiles#251 The security groups took every update type, so a security fix that needed a major would land in one PR with every other fix and could hold them all back. cargo-security and actions-security now take minor and patch only, and a security major opens on its own, as version-update majors already do. --- .github/dependabot.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index eb9d533..042bbfc 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,7 +6,8 @@ # rest, and the PR limit leaves room for them beside the group. For a 0.x crate Dependabot counts # a minor bump (0.28 to 0.29) as a major, as Cargo does. The TUI crates that must move together are # the exception, in a group of their own. Security updates ignore the version-update groups and -# would open one PR per package, so they get their own group. +# would open one PR per package, so they get their own group, which also leaves majors to their +# own PRs. # # rust-toolchain.toml sets `channel = "stable"` rather than a version, so it has nothing for # Dependabot to bump and has no entry here. @@ -36,6 +37,7 @@ updates: cargo-security: applies-to: security-updates patterns: ['*'] + update-types: [minor, patch] - package-ecosystem: github-actions directory: / schedule: @@ -51,3 +53,4 @@ updates: actions-security: applies-to: security-updates patterns: ['*'] + update-types: [minor, patch] From b94d42c1c0a25d853fe9acbb27738577888e53ac Mon Sep 17 00:00:00 2001 From: Michael Uloth Date: Thu, 5 Nov 2026 07:18:56 -0500 Subject: [PATCH 11/11] ci: explain how a lone crossterm security fix is caught ooloth/dotfiles#251 Security updates move only the vulnerable crate, so the tui group cannot bring ratatui along with a crossterm fix that needs a newer version than ratatui allows. That PR fails deny, cargo audit fails CI until the advisory is fixed, and the fix is the ratatui upgrade the tui group proposes. The tui group's comment now says so, and the header's sentence on security groups says plainly that they take minor and patch updates and leave a major to its own PR. --- .github/dependabot.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 042bbfc..add689d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -6,8 +6,8 @@ # rest, and the PR limit leaves room for them beside the group. For a 0.x crate Dependabot counts # a minor bump (0.28 to 0.29) as a major, as Cargo does. The TUI crates that must move together are # the exception, in a group of their own. Security updates ignore the version-update groups and -# would open one PR per package, so they get their own group, which also leaves majors to their -# own PRs. +# would open one PR per package, so they get their own group of minor and patch updates, and a +# security major opens on its own. # # rust-toolchain.toml sets `channel = "stable"` rather than a version, so it has nothing for # Dependabot to bump and has no entry here. @@ -27,6 +27,9 @@ updates: # ui/tui/Cargo.toml must match. deny.toml rejects duplicate versions, so one moving alone # fails CI. They arrive as one PR, majors included. Dependabot gives a dependency to the # first group that matches, so this group comes before the catch-all. + # Security updates move only the vulnerable crate, so a fix that needs a newer crossterm + # than ratatui allows arrives alone and fails deny. cargo audit fails CI meanwhile, and the + # fix is the ratatui upgrade this group proposes. tui: applies-to: version-updates patterns: [ansi-to-tui, crossterm, ratatui]