chore: clean up argument-comment lint and roll out all-target CI on macOS (#16054)

## Why

`argument-comment-lint` was green in CI even though the repo still had
many uncommented literal arguments. The main gap was target coverage:
the repo wrapper did not force Cargo to inspect test-only call sites, so
examples like the `latest_session_lookup_params(true, ...)` tests in
`codex-rs/tui_app_server/src/lib.rs` never entered the blocking CI path.

This change cleans up the existing backlog, makes the default repo lint
path cover all Cargo targets, and starts rolling that stricter CI
enforcement out on the platform where it is currently validated.

## What changed

- mechanically fixed existing `argument-comment-lint` violations across
the `codex-rs` workspace, including tests, examples, and benches
- updated `tools/argument-comment-lint/run-prebuilt-linter.sh` and
`tools/argument-comment-lint/run.sh` so non-`--fix` runs default to
`--all-targets` unless the caller explicitly narrows the target set
- fixed both wrappers so forwarded cargo arguments after `--` are
preserved with a single separator
- documented the new default behavior in
`tools/argument-comment-lint/README.md`
- updated `rust-ci` so the macOS lint lane keeps the plain wrapper
invocation and therefore enforces `--all-targets`, while Linux and
Windows temporarily pass `-- --lib --bins`

That temporary CI split keeps the stricter all-targets check where it is
already cleaned up, while leaving room to finish the remaining Linux-
and Windows-specific target-gated cleanup before enabling
`--all-targets` on those runners. The Linux and Windows failures on the
intermediate revision were caused by the wrapper forwarding bug, not by
additional lint findings in those lanes.

## Validation

- `bash -n tools/argument-comment-lint/run.sh`
- `bash -n tools/argument-comment-lint/run-prebuilt-linter.sh`
- shell-level wrapper forwarding check for `-- --lib --bins`
- shell-level wrapper forwarding check for `-- --tests`
- `just argument-comment-lint`
- `cargo test` in `tools/argument-comment-lint`
- `cargo test -p codex-terminal-detection`

## Follow-up

- Clean up remaining Linux-only target-gated callsites, then switch the
Linux lint lane back to the plain wrapper invocation.
- Clean up remaining Windows-only target-gated callsites, then switch
the Windows lint lane back to the plain wrapper invocation.
This commit is contained in:
Michael Bolin
2026-03-27 19:00:44 -07:00
committed by GitHub
parent ed977b42ac
commit 61dfe0b86c
307 changed files with 7724 additions and 4710 deletions

View File

@@ -71,14 +71,14 @@ async fn recorder_materializes_only_after_explicit_persist() -> std::io::Result<
&config,
RolloutRecorderParams::new(
thread_id,
None,
/*forked_from_id*/ None,
SessionSource::Exec,
BaseInstructions::default(),
Vec::new(),
EventPersistenceMode::Limited,
),
None,
None,
/*state_db_ctx*/ None,
/*state_builder*/ None,
)
.await?;
@@ -155,7 +155,7 @@ async fn metadata_irrelevant_events_touch_state_db_updated_at() -> std::io::Resu
.await
.expect("state db should initialize");
state_db
.mark_backfill_complete(None)
.mark_backfill_complete(/*last_watermark*/ None)
.await
.expect("backfill should be complete");
@@ -164,14 +164,14 @@ async fn metadata_irrelevant_events_touch_state_db_updated_at() -> std::io::Resu
&config,
RolloutRecorderParams::new(
thread_id,
None,
/*forked_from_id*/ None,
SessionSource::Cli,
BaseInstructions::default(),
Vec::new(),
EventPersistenceMode::Limited,
),
Some(state_db.clone()),
None,
/*state_builder*/ None,
)
.await?;
@@ -257,7 +257,7 @@ async fn metadata_irrelevant_events_fall_back_to_upsert_when_thread_missing() ->
Some(&builder),
items.as_slice(),
config.model_provider_id.as_str(),
None,
/*new_thread_memory_mode*/ None,
)
.await;
@@ -283,13 +283,13 @@ async fn list_threads_db_disabled_does_not_skip_paginated_items() -> std::io::Re
let default_provider = config.model_provider_id.clone();
let page1 = RolloutRecorder::list_threads(
&config,
1,
None,
/*page_size*/ 1,
/*cursor*/ None,
ThreadSortKey::CreatedAt,
&[],
None,
/*model_providers*/ None,
default_provider.as_str(),
None,
/*search_term*/ None,
)
.await?;
assert_eq!(page1.items.len(), 1);
@@ -298,13 +298,13 @@ async fn list_threads_db_disabled_does_not_skip_paginated_items() -> std::io::Re
let page2 = RolloutRecorder::list_threads(
&config,
1,
/*page_size*/ 1,
Some(&cursor),
ThreadSortKey::CreatedAt,
&[],
None,
/*model_providers*/ None,
default_provider.as_str(),
None,
/*search_term*/ None,
)
.await?;
assert_eq!(page2.items.len(), 1);
@@ -330,7 +330,7 @@ async fn list_threads_db_enabled_drops_missing_rollout_paths() -> std::io::Resul
.await
.expect("state db should initialize");
runtime
.mark_backfill_complete(None)
.mark_backfill_complete(/*last_watermark*/ None)
.await
.expect("backfill should be complete");
let created_at = chrono::Utc
@@ -355,13 +355,13 @@ async fn list_threads_db_enabled_drops_missing_rollout_paths() -> std::io::Resul
let default_provider = config.model_provider_id.clone();
let page = RolloutRecorder::list_threads(
&config,
10,
None,
/*page_size*/ 10,
/*cursor*/ None,
ThreadSortKey::CreatedAt,
&[],
None,
/*model_providers*/ None,
default_provider.as_str(),
None,
/*search_term*/ None,
)
.await?;
assert_eq!(page.items.len(), 0);
@@ -392,7 +392,7 @@ async fn list_threads_db_enabled_repairs_stale_rollout_paths() -> std::io::Resul
.await
.expect("state db should initialize");
runtime
.mark_backfill_complete(None)
.mark_backfill_complete(/*last_watermark*/ None)
.await
.expect("backfill should be complete");
let created_at = chrono::Utc
@@ -417,13 +417,13 @@ async fn list_threads_db_enabled_repairs_stale_rollout_paths() -> std::io::Resul
let default_provider = config.model_provider_id.clone();
let page = RolloutRecorder::list_threads(
&config,
1,
None,
/*page_size*/ 1,
/*cursor*/ None,
ThreadSortKey::CreatedAt,
&[],
None,
/*model_providers*/ None,
default_provider.as_str(),
None,
/*search_term*/ None,
)
.await?;
assert_eq!(page.items.len(), 1);