fix(codegen): per-category summary + hint when WIT requested but none emitted#242
Merged
Conversation
Rivet verification gate✅ 20/20 passed
Filter: Failed artifacts(none) Updated automatically by |
3c24fb3 to
b1858ea
Compare
avrabe
added a commit
that referenced
this pull request
May 26, 2026
The codegen stdout now reads codegen: wrote N files (… .rs, … .wit, … workspace) (format: both) to <dir>/ instead of the prior bare `Generated N files in <dir>/`. The roundtrip test asserted on the old prefix; update it to assert on the new shape (`codegen: wrote` + `(format:`) so the per-category summary line is locked in. Caught by CI before the release tag; should have been caught locally by running `cargo test -p spar --test roundtrip` before opening #242. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
avrabe
added a commit
that referenced
this pull request
May 26, 2026
Workspace bump from 0.10.0 → 0.11.0 across all 22 spar crates (via
[workspace.package].version), plus the VS Code extension's
package.json — the two version surfaces the release workflow's
check-versions job compares against the tag.
What v0.11.0 ships, since v0.10.0:
trace-topology reconciliation engine (incremental rollout):
#239 IdentityUnknown check (PR 3a — component-borne MAC + chassis-id)
#241 GptpOutOfBudget check (PR 3b — single-budget case)
trace-topology fixture pipeline:
#233 Rust gen-fixtures tool (netns + TSN, RAII teardown)
#234 NixOS guest + QEMU harness for fixture generation
#238 corrected nixos/nix container digest (fd7a5c67…, multi-arch index)
#240 podman runner label so workflows schedule on the only
rootless-podman-capable runner in the fleet (runner9)
codegen:
#232 --format wit emits only WIT (strict-filter; no Rust/Bazel
workspace leakage)
#242 per-category file-count summary + hint when WIT was
requested but the model has no `process` subcomponents
(in-flight at bump time; auto-merge armed)
release flow:
#244 standardise on the synth reference — actions/attest-build-
provenance@v2 + sigstore cosign sign-blob (v2.4.1) over
SHA256SUMS.txt, build-env.txt; the v0.11.0 release is the
first one to exercise the standardised cosign + SLSA chain.
Verification after release:
cosign verify-blob \\
--certificate-identity-regexp \\
'https://github.com/pulseengine/spar/.github/workflows/release.yml@.*' \\
--certificate-oidc-issuer 'https://token.actions.githubusercontent.com' \\
--bundle SHA256SUMS.txt.cosign.bundle SHA256SUMS.txt
gh attestation verify spar-v0.11.0-<triple>.tar.gz --repo pulseengine/spar
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
… emitted
`spar codegen` previously printed a bare `Generated N files in <dir>/`,
which silently hid the most common confusing case: a model with
threads but no `process` subcomponents run under the default
`--format both` emits Rust + Cargo.toml + BUILD.bazel and zero `.wit`
files (because WIT generation is per-process). Operators and agents
read the output as "the other files but no wit" with no clue why.
Replace the summary with a per-category breakdown and add a focused
hint when WIT was requested but none came out:
codegen: wrote 3 files (1 .rs, 2 workspace) (format: both) to gen/
hint: --format both emits one .wit interface per AADL `process`
subcomponent; this model has 0 processes — add `process`
declarations to the system implementation, or pass --format
rust for thread skeletons only.
The format label answers "did spar honour my --format?"; the
per-category count answers "what got produced?"; the hint answers
"why didn't I get what I asked for?" The dry-run path gets the same
shape (without writing files). Three smoke cases cover the matrix:
threads + default => hint; process + --format wit => no hint; threads
+ --format rust => no hint (user did not request WIT).
Helpers are pure functions of `&[GeneratedFile]` + `OutputFormat`,
suitable for promotion to golden tests if the stdout shape is later
contracted.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The codegen stdout now reads codegen: wrote N files (… .rs, … .wit, … workspace) (format: both) to <dir>/ instead of the prior bare `Generated N files in <dir>/`. The roundtrip test asserted on the old prefix; update it to assert on the new shape (`codegen: wrote` + `(format:`) so the per-category summary line is locked in. Caught by CI before the release tag; should have been caught locally by running `cargo test -p spar --test roundtrip` before opening #242. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
eda1368 to
7bbc9b8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
spar codegenpreviously printed a bareGenerated N files in <dir>/,which silently hid the most common confusing case: a model with
threads but no
processsubcomponents run under the default--format bothemits Rust +Cargo.toml+BUILD.bazeland zero.witfiles (because WIT generation is per-process). Operators andagents read the output as "the other files but no wit" with no clue
why.
This is a no-functional-change diagnostic improvement: replace the
summary with a per-category breakdown and add a focused hint when WIT
was requested but none came out.
Before
After
The hint fires only when WIT was requested (
--format witor thedefault
--format both) and zero.witfiles came out.Smoke matrix
both(default)(1 .rs, 2 workspace)--format witwit(1 .wit), no hint--format rustrust(1 .rs, 2 workspace), no hint (user didn't ask for WIT)Files
crates/spar-cli/src/main.rs—cmd_codegencalls two new helpers:summarise_codegen_outputandmaybe_print_empty_wit_hint. Bothare pure functions of
&[GeneratedFile]+OutputFormat, suitablefor golden-test promotion later if the stdout shape is contracted.
REQ-CODEGEN-SUMMARY+TEST-CODEGEN-SUMMARY-HINT.Test plan
cargo clippy -p spar --all-targets— cleancargo fmt --check— cleanrivet validate— 0 broken cross-refs; totals byte-identical to baseline🤖 Generated with Claude Code