Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions .agents/skills/manage-ci/references/current-inventory.md
Original file line number Diff line number Diff line change
Expand Up @@ -827,19 +827,27 @@ had different CPUs. See [retained evidence](../../../../ci/runtime-seed-evidence

## Console-print product scope

`just no-console-print` keeps exact file/line/macro approvals for product
sources. Its scope excludes test paths, parsed `#[cfg(test)]` modules,
examples, benches, auxiliary `src/bin/` targets and the explicit
`NON_PRODUCT_CRATES` list in `tools/xtask/src/no_console_print/scope.rs`.
Build scripts remain excluded because their output contains Cargo directives.
`mesh-llm/src/main.rs` and `mesh-client` remain in scope.
`just no-console-print` forbids the print macros and direct `io::stdout()` /
`io::stderr()` handles in product sources. There is no allowlist: every
exemption is a category rule, so no individual call site can be approved. Its
scope excludes test paths, parsed `#[cfg(test)]` modules, examples, benches,
auxiliary `src/bin/` targets and the explicit `NON_PRODUCT_CRATES` list in
`tools/xtask/src/no_console_print/scope.rs`. Build scripts remain excluded
because their output contains Cargo directives. `mesh-llm/src/main.rs` and
`mesh-client` remain in scope.

The handle rule exempts only the files that implement the console output
facility, listed as `CONSOLE_OUTPUT_OWNERS` in the same module: the sink-aware
writer and its pre-sink CLI fallback, the inline progress renderers, the TUI
output manager / fd capture / terminal backend, the runtime tracing writer,
skippy-server's stderr telemetry sink, and the CLI presentation surfaces.
A capability probe such as `io::stdout().is_terminal()` reads nothing and is
not a handle.

The gate checks Cargo metadata on every invocation and rejects an exempt crate
that becomes a transitive normal dependency of `mesh-llm`, including optional
and platform-specific dependencies. Tests cover that guard and the scope rules.
The Quality workflow still invokes the same `just no-console-print` gate.
Direct stdout/stderr handle detection and deletion of the remaining product
ratchet belong to later stages of issue #1763.

The CPU native runtime-event gate selects `family-qwen3-dense` from the
`skippy-ci-smoke` manifest for both `pull-request` and `main` cadences. The
Expand Down
16 changes: 9 additions & 7 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -585,13 +585,15 @@ Do not rerun otherwise unchanged validation solely because a commit is about to
- Format Rust files in a way that preserves the owning crate's edition metadata. Prefer `cargo fmt -p <crate> -- path/to/file.rs` for a narrow edit, or `cargo fmt --all` when changes span packages. Do not use `cargo fmt --all -- path/to/file.rs`: workspace-level file arguments can be parsed without the owning crate's Rust 2024 edition metadata and fail on let-chains.
- If you must invoke `rustfmt` directly on a standalone file, pass the edition resolved from that manifest lookup, for example `--edition 2024` for the current workspace default; otherwise use `cargo fmt` through the owning package.
- Before committing Rust changes, ensure the formatting check passes with `cargo fmt --all --check`.
- After Rust changes, run `just no-console-print`. The allowlist records source
locations, so adding or removing unrelated lines can move an existing
approved occurrence and invalidate the ratchet. If the check reports only
moved existing occurrences, regenerate it with
`cargo run -p xtask -- repo-consistency no-console-print --regen`, review the
allowlist diff to confirm that no new console prints were approved, and
commit the regenerated allowlist with the source change.
- After Rust changes, run `just no-console-print`. It forbids `println!` /
`eprintln!` / `print!` / `eprint!` and direct `io::stdout()` / `io::stderr()`
handles in product code. There is no allowlist and no way to approve an
individual call site: route operational output through
`mesh_llm_events::emit_event` or `tracing`, human-facing CLI prose through
`mesh_llm_events::console_out` / `console_err`, and a `--json` command's
payload through `mesh_llm_events::machine_out`. Only the console output
facility itself may hold a terminal handle; that roster is
`CONSOLE_OUTPUT_OWNERS` in `tools/xtask/src/no_console_print/scope.rs`.
- After Rust changes, run `cargo check` and `cargo clippy --all-targets -- -D warnings` for each touched crate (`-p <crate>`), and at least `cargo check -p mesh-llm` plus `cargo clippy -p mesh-llm --all-targets -- -D warnings` if the change is reachable from the shipped binary.
- Treat Clippy as a required local gate, not a CI-only cleanup step. `cargo check`, `just build`, and formatter success do not catch lints such as `clippy::collapsible-if`; run the warning-denying Clippy command before opening or updating a PR.
- If you touched tests, public APIs, routing, inference, gossip, plugin protocol, skippy ABI, or CLI behavior, run the relevant tests before committing.
Expand Down
24 changes: 16 additions & 8 deletions ci/ci.md
Original file line number Diff line number Diff line change
Expand Up @@ -944,19 +944,27 @@ preserve the basis beyond remote artifact expiry.

## Console-print product scope

`just no-console-print` keeps exact file/line/macro approvals for product
sources. Its scope excludes test paths, parsed `#[cfg(test)]` modules,
examples, benches, auxiliary `src/bin/` targets and the explicit
`NON_PRODUCT_CRATES` list in `tools/xtask/src/no_console_print/scope.rs`.
Build scripts remain excluded because their output contains Cargo directives.
`mesh-llm/src/main.rs` and `mesh-client` remain in scope.
`just no-console-print` forbids the print macros and direct `io::stdout()` /
`io::stderr()` handles in product sources. There is no allowlist: every
exemption is a category rule, so no individual call site can be approved. Its
scope excludes test paths, parsed `#[cfg(test)]` modules, examples, benches,
auxiliary `src/bin/` targets and the explicit `NON_PRODUCT_CRATES` list in
`tools/xtask/src/no_console_print/scope.rs`. Build scripts remain excluded
because their output contains Cargo directives. `mesh-llm/src/main.rs` and
`mesh-client` remain in scope.

The handle rule exempts only the files that implement the console output
facility, listed as `CONSOLE_OUTPUT_OWNERS` in the same module: the sink-aware
writer and its pre-sink CLI fallback, the inline progress renderers, the TUI
output manager / fd capture / terminal backend, the runtime tracing writer,
skippy-server's stderr telemetry sink, and the CLI presentation surfaces.
A capability probe such as `io::stdout().is_terminal()` reads nothing and is
not a handle.

The gate checks Cargo metadata on every invocation and rejects an exempt crate
that becomes a transitive normal dependency of `mesh-llm`, including optional
and platform-specific dependencies. Tests cover that guard and the scope rules.
The Quality workflow still invokes the same `just no-console-print` gate.
Direct stdout/stderr handle detection and deletion of the remaining product
ratchet belong to later stages of issue #1763.

The CPU native runtime-event gate selects `family-qwen3-dense` from the
`skippy-ci-smoke` manifest for both `pull-request` and `main` cadences. The
Expand Down
30 changes: 14 additions & 16 deletions crates/mesh-client/src/models/catalog.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use serde::Deserialize;
use std::io::Write;
use std::sync::LazyLock;

#[derive(Clone, Debug, Deserialize)]
Expand Down Expand Up @@ -106,24 +105,23 @@ pub fn huggingface_repo_url(url: &str) -> Option<String> {
Some(format!("https://huggingface.co/{repo}"))
}

pub fn list_models() {
let _ = writeln!(std::io::stderr(), "Available models:");
let _ = writeln!(std::io::stderr());
/// Renders the built-in catalog as human-readable lines. This crate is a
/// library, so it hands the listing back to the caller instead of choosing a
/// stream: only the console output facility knows whether a JSON sink or the
/// interactive dashboard currently owns the terminal.
pub fn render_model_listing() -> String {
let mut listing = String::from("Available models:\n\n");
for m in MODEL_CATALOG.iter() {
let draft_info = if let Some(d) = m.draft.as_deref() {
format!(" (draft: {})", d)
} else {
String::new()
let draft_info = match m.draft.as_deref() {
Some(draft) => format!(" (draft: {draft})"),
None => String::new(),
};
let _ = writeln!(
std::io::stderr(),
" {:40} {:>6} {}{}",
m.name,
m.size,
m.description,
draft_info
);
listing.push_str(&format!(
" {:40} {:>6} {}{}\n",
m.name, m.size, m.description, draft_info
));
}
listing
}

#[cfg(test)]
Expand Down
6 changes: 3 additions & 3 deletions just/ci.just
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ ci-crate-lists:
publish-crates:
just with-lld cargo run -p xtask -- repo-consistency publish-crates

# Ratchet on println!/eprintln!/print!/eprint! in Rust files under crates/
# (excluding tests, non-product crates, helper bins and build.rs): each hit must be
# explicitly listed in tools/xtask/data/console_print_allowlist.json.
# Gate on println!/eprintln!/print!/eprint! and direct io::stdout()/io::stderr()
# handles in Rust files under crates/ (excluding tests, non-product crates, helper
# bins and build.rs). There is no allowlist: route output through mesh-llm-events.
no-console-print:
cargo run -p xtask -- repo-consistency no-console-print

Expand Down
1 change: 0 additions & 1 deletion tools/xtask/data/console_print_allowlist.json

This file was deleted.

2 changes: 1 addition & 1 deletion tools/xtask/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ fn run() -> DynResult<()> {
attestation::inspect_release_attestation(rest)
}
_ => Err(
"usage:\n cargo run -p xtask -- repo-consistency release-targets\n cargo run -p xtask -- repo-consistency ci-crate-lists\n cargo run -p xtask -- repo-consistency publish-crates\n cargo run -p xtask -- repo-consistency test-all-rust-crate-coverage\n cargo run -p xtask -- repo-consistency no-console-print [--regen]\n cargo run -p xtask -- release-attestation generate-keypair --private-key-out <path> --public-key-out <path>\n cargo run -p xtask -- release-attestation stamp --binary <path> --signing-key-file <path> [--node-version <semver>] [--build-id <id>] [--commit <sha>] [--target-triple <triple>] [--protocol-min <n>] [--protocol-max <n>]\n cargo run -p xtask -- release-attestation inspect --binary <path> [--public-key-file <path>] [--json]"
"usage:\n cargo run -p xtask -- repo-consistency release-targets\n cargo run -p xtask -- repo-consistency ci-crate-lists\n cargo run -p xtask -- repo-consistency publish-crates\n cargo run -p xtask -- repo-consistency test-all-rust-crate-coverage\n cargo run -p xtask -- repo-consistency no-console-print\n cargo run -p xtask -- release-attestation generate-keypair --private-key-out <path> --public-key-out <path>\n cargo run -p xtask -- release-attestation stamp --binary <path> --signing-key-file <path> [--node-version <semver>] [--build-id <id>] [--commit <sha>] [--target-triple <triple>] [--protocol-min <n>] [--protocol-max <n>]\n cargo run -p xtask -- release-attestation inspect --binary <path> [--public-key-file <path>] [--json]"
.to_string()
.into(),
),
Expand Down
Loading
Loading