docs(comments): rewrite comments across all crates to the guidelines
Sweep every first-party crate source (1956 .rs files) to the project comment guidelines: delete redundant restatements, decorative banners, change narration, and end-of-line comments; keep and tighten the crucial ones (invariants, bug rationale, SAFETY blocks, ported-source attribution). No functional code changed. Every edit is proven comment-only against the prior tree by a comment-stripping lexer (string/char/raw-string aware) plus a separate doctest-fence check. Where removing a comment made rustfmt or clippy want to re-lay-out adjacent code, the minimal triggering comment is restored so code tokens stay byte-identical. Gates green: cargo fmt --all --check (0 diffs), cargo check and cargo clippy --workspace --all-targets (0 warnings). Adds scripts/check_codegen_comment_guidelines.py — the enforcement gate for these guidelines (flags banners, end-of-line comments, change narration, and commented-out code).
This commit is contained in:
+2
-2
@@ -77,7 +77,7 @@ async fn campaign_leader_mode_remote_dismiss_on_model_pick() {
|
||||
.unwrap_or(false)
|
||||
};
|
||||
|
||||
// ── Phase 1+2: nudge on a new session; a pick records the dismissal in
|
||||
// Phase 1+2: nudge on a new session; a pick records the dismissal in
|
||||
// the TUI process. Retries fresh TUI spawns (same leader) so a missed
|
||||
// 2s prefetch window on a loaded runner can't wedge the test.
|
||||
let mut recorded = false;
|
||||
@@ -116,7 +116,7 @@ async fn campaign_leader_mode_remote_dismiss_on_model_pick() {
|
||||
"leader-mode TUI must record the remote campaign dismissal in {state_path:?}"
|
||||
);
|
||||
|
||||
// ── Phase 3: the dismissal is durable and the pick is persisted. The
|
||||
// Phase 3: the dismissal is durable and the pick is persisted. The
|
||||
// user's choice must be in config.toml (campaign value never laundered
|
||||
// in), and the dismissed id on disk is what every future resolution —
|
||||
// leader or not — filters on (`dismissed_id_is_dropped_from_override`
|
||||
|
||||
@@ -26,12 +26,9 @@ pub(crate) const PROMPT: &str = "go";
|
||||
/// Response sentinel the mock server streams back.
|
||||
pub(crate) const MOCK_RESPONSE_SENTINEL: &str = "MOCKRESPONSE";
|
||||
|
||||
/// Cold leader-client bring-up budget. History: 60s → 120s → 240s while these
|
||||
/// cases ran interleaved with the full `pty_e2e` suite (each leader case
|
||||
/// spawns multiple full pager processes; suite-wide contention pushed cold
|
||||
/// bring-up past two minutes). Now that the leader cases run in their own
|
||||
/// serialized target the budget can come back down after a green soak week —
|
||||
/// tracked in the leader test-infra plan.
|
||||
/// Cold leader-client bring-up budget, generous because each leader case
|
||||
/// spawns multiple full pager processes; can come back down after a green
|
||||
/// soak week — tracked in the leader test-infra plan.
|
||||
pub(crate) const LEADER_TIMEOUT: Duration = Duration::from_secs(240);
|
||||
|
||||
/// Streamed-turn deadline in leader mode (same contention rationale).
|
||||
|
||||
@@ -28,7 +28,6 @@ async fn leader_n_clients_shared_session() {
|
||||
.content()
|
||||
.set_response(format!("{} first turn payload.", turn_sentinel(1)));
|
||||
|
||||
// The driver spawns the leader and runs turn 1.
|
||||
let mut a = cluster.spawn_leader(&[]).expect("spawn driver");
|
||||
a.wait_for_text(WELCOME_SCREEN_SENTINEL, LEADER_TIMEOUT)
|
||||
.expect("driver welcome");
|
||||
@@ -60,7 +59,6 @@ async fn leader_n_clients_shared_session() {
|
||||
viewers.push(v);
|
||||
}
|
||||
|
||||
// Turn 2 driven from the driver streams live into EVERY viewer (fan-out).
|
||||
cluster
|
||||
.content()
|
||||
.set_response(format!("{} second turn payload.", turn_sentinel(2)));
|
||||
|
||||
+1
-2
@@ -40,8 +40,7 @@ async fn leader_reattach_cancellation_roundtrips_durable_log() {
|
||||
.expect("A welcome");
|
||||
a.inject_keys(format!("{PROMPT}\r").as_bytes())
|
||||
.expect("A submit turn");
|
||||
// Wait until the turn is clearly streaming (sentinel visible); this also
|
||||
// closes the leader's rewind window so cancel is not confused with rewind.
|
||||
// Also closes the leader's rewind window, so cancel is not confused with rewind.
|
||||
a.wait_for_text(&turn_sentinel(1), STREAM_TIMEOUT)
|
||||
.expect("A turn streaming");
|
||||
|
||||
|
||||
-3
@@ -20,7 +20,6 @@ async fn leader_reattach_completion_roundtrips_durable_log() {
|
||||
.content()
|
||||
.set_response(format!("{} completed turn payload.", turn_sentinel(1)));
|
||||
|
||||
// A elects the leader and drives one turn to completion.
|
||||
let mut a = cluster.spawn_leader(&[]).expect("spawn leader client A");
|
||||
a.wait_for_text(WELCOME_SCREEN_SENTINEL, LEADER_TIMEOUT)
|
||||
.expect("A welcome");
|
||||
@@ -53,8 +52,6 @@ async fn leader_reattach_completion_roundtrips_durable_log() {
|
||||
// must see no new inference request while C catches up.
|
||||
let inference_before_reattach = inference_request_count(cluster.content());
|
||||
|
||||
// Fresh reattach AFTER A exits: it replays the completed transcript via the
|
||||
// durable rail through the surviving leader.
|
||||
drop(a);
|
||||
let mut c = cluster.attach(&[]).expect("spawn fresh reattach client C");
|
||||
c.wait_for_text(&turn_sentinel(1), LEADER_TIMEOUT)
|
||||
|
||||
@@ -46,7 +46,6 @@ async fn leader_two_clients_shared_session() {
|
||||
"A's turn must appear in B exactly once (duplicated replay?)\nB screen:\n{b_screen}"
|
||||
);
|
||||
|
||||
// Turn 2 driven from A streams live into the attached viewer B.
|
||||
cluster
|
||||
.content()
|
||||
.set_response(format!("{} second turn payload.", turn_sentinel(2)));
|
||||
|
||||
Reference in New Issue
Block a user