From e50155fed7ad8798b9e71f6abdeab80c52e4e677 Mon Sep 17 00:00:00 2001 From: Vittorio Distefano Date: Sun, 1 Nov 2026 14:33:12 +0100 Subject: [PATCH 1/3] ci(forgejo): pass the pinned channel to rustup toolchain install The runner image's rustup 1.27.1 rejects a bare `rustup toolchain install`; reading the channel from rust-toolchain.toml requires rustup 1.28. Every Forgejo run since d132845a stopped at this step, before any check ran. Read the channel from rust-toolchain.toml and pass it explicitly. The file stays the single source of the channel and its components, which rustup installs when the toolchain is first used. Closes #164 --- .forgejo/workflows/ci.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index cce6c5cf..ec9cb456 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -16,9 +16,15 @@ jobs: steps: - uses: actions/checkout@v4 - # rust-toolchain.toml names the toolchain and its components. + # rust-toolchain.toml names the toolchain and its components. The runner + # image's rustup (1.27) cannot read the channel from that file in + # `rustup toolchain install`, so pass it explicitly; rustup installs the + # file's components when the toolchain is first used. - name: Install Rust toolchain - run: rustup toolchain install + run: | + channel=$(sed -n 's/^channel = "\(.*\)"$/\1/p' rust-toolchain.toml) + rustup toolchain install "$channel" --profile minimal + rustup show active-toolchain # Runner environment overrides workflow-level CARGO_TARGET_DIR. Set it on # each Cargo process so trybuild's generated crate stays under this workspace From 2e7818536b7158e06ef3e9bc42e9c3d66219a7ab Mon Sep 17 00:00:00 2001 From: Vittorio Distefano Date: Sun, 1 Nov 2026 14:36:18 +0100 Subject: [PATCH 2/3] build(release): give refactor commits their own changelog section csemver's default commit types hide refactor, so the 0.24.0 changelog dropped 22 refactor commits and printed the 8 breaking ones as a list with no heading. Declare the types explicitly: feat, fix and refactor are visible; chore, docs, style, perf and test keep the default hidden state. Closes #166 --- csemver.toml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/csemver.toml b/csemver.toml index a7c657a6..4d684d3e 100644 --- a/csemver.toml +++ b/csemver.toml @@ -17,6 +17,21 @@ releaseCommitMessageFormat = "chore(release): {{currentTag}}" commitUrlFormat = "https://github.com/SolverForge/solverforge/commit/{{hash}}" compareUrlFormat = "https://github.com/SolverForge/solverforge/compare/{{previousTag}}...{{currentTag}}" +# Commit types and their changelog sections. Declaring the list replaces +# csemver's default, which hides refactor: refactor commits get their own +# section, and the remaining types keep the default hidden state. This must +# stay above the first table header, or TOML scopes it into that table. +types = [ + { type = "feat", section = "Features" }, + { type = "fix", section = "Bug Fixes" }, + { type = "refactor", section = "Code Refactoring" }, + { type = "chore", hidden = true }, + { type = "docs", hidden = true }, + { type = "style", hidden = true }, + { type = "perf", hidden = true }, + { type = "test", hidden = true }, +] + packageFiles = [ # Reads the workspace version (the single source of truth; every crate # manifest inherits it through version.workspace = true). From 8e8e077f5797bd64a5d1c52c6accb779b520408b Mon Sep 17 00:00:00 2001 From: Vittorio Distefano Date: Sun, 1 Nov 2026 14:37:53 +0100 Subject: [PATCH 3/3] docs(config): drop the nonexistent tolerance field and check wireframe field tables The config WIREFRAME listed tolerance: Option on DiversifiedLateAcceptanceConfig, a field the struct does not have. check-doc-names.py now checks every row of a | Field | table against the fields of the struct named by the table's heading, counting the serialized keys of #[serde(flatten)] fields, so a documented field that does not exist fails the gate. Closes #168 --- crates/solverforge-config/WIREFRAME.md | 1 - scripts/check-doc-names.py | 58 ++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) diff --git a/crates/solverforge-config/WIREFRAME.md b/crates/solverforge-config/WIREFRAME.md index b4695262..4387e045 100644 --- a/crates/solverforge-config/WIREFRAME.md +++ b/crates/solverforge-config/WIREFRAME.md @@ -315,7 +315,6 @@ Derives: `Debug, Clone, Default, Deserialize, Serialize`. | Field | Type | |-------|------| | `late_acceptance_size` | `Option` | -| `tolerance` | `Option` | ### `GreatDelugeConfig` diff --git a/scripts/check-doc-names.py b/scripts/check-doc-names.py index 025ee3f3..77406a2f 100755 --- a/scripts/check-doc-names.py +++ b/scripts/check-doc-names.py @@ -18,6 +18,9 @@ - every multi-hump CamelCase name in a file-map description must be defined, as above. +For each wireframe table headed `| Field |` under a `### `Type`` heading, +every listed field must be a field of that struct in the crate's sources. + For each crate with a public-api.txt snapshot, every public struct, enum, trait, function, type alias and macro in it must be named in the crate's WIREFRAME.md. @@ -126,6 +129,60 @@ def check_file_map(path, types, problems): problems.append(f"{path.relative_to(ROOT)}:{number}: file `{relative}` does not exist") +def struct_fields(crate, name): + """The field names of `struct name { ... }` in the crate, or None.""" + header = re.compile(rf"\bstruct\s+{re.escape(name)}\b[^;{{]*\{{") + field = re.compile(r"^\s*(?:pub(?:\([^)]*\))?\s+)?([a-z_][a-z0-9_]*)\s*:", re.MULTILINE) + for source in crate.glob("src/**/*.rs"): + text = source.read_text(encoding="utf-8") + found = header.search(text) + if not found: + continue + depth, start = 1, found.end() + end = start + while depth and end < len(text): + depth += {"{": 1, "}": -1}.get(text[end], 0) + end += 1 + body = "\n".join( + line for line in text[start:end - 1].splitlines() if not line.lstrip().startswith("//") + ) + names = set(field.findall(body)) + # A `#[serde(flatten)]` field serializes as its own type's fields, and + # wireframes list those serialized keys. + flatten = re.compile(r"#\[serde\(flatten\)\]\s*(?:pub(?:\([^)]*\))?\s+)?\w+\s*:\s*(?:Option<)?([A-Z]\w*)") + for inner in flatten.findall(body): + names.update(struct_fields(crate, inner) or ()) + return names + return None + + +def check_field_tables(path, problems): + heading = re.compile(r"^#{2,4} (?:`([A-Z][A-Za-z0-9]*))?") + row = re.compile(r"^\| `([a-z_][a-z0-9_]*)` \|") + owner, fields, in_table = None, None, False + for number, line in prose_lines(path): + title = heading.match(line) + if title: + owner, fields, in_table = title.group(1), None, False + continue + if line.startswith("| Field |"): + in_table = owner is not None + if in_table: + fields = struct_fields(path.parent, owner) + if fields is None: + problems.append( + f"{path.relative_to(ROOT)}:{number}: no struct `{owner}` for its field table" + ) + in_table = False + continue + if not line.startswith("|"): + in_table = False + continue + cell = row.match(line) + if in_table and cell and cell.group(1) not in fields: + problems.append(f"{path.relative_to(ROOT)}:{number}: `{owner}` has no field `{cell.group(1)}`") + + def check_public_api(path, problems): snapshot = path.parent / "public-api.txt" if not snapshot.exists(): @@ -151,6 +208,7 @@ def main(): for path in sorted(ROOT.glob("crates/*/WIREFRAME.md")): check_inline(path, types, functions, problems) check_file_map(path, types, problems) + check_field_tables(path, problems) check_public_api(path, problems) for path in sorted(ROOT.glob("docs/*.md")): check_inline(path, types, functions, problems)