Skip to content

feat(cli): add report, schema, config, doctor, and agent commands - #203

Merged
avidianity merged 13 commits into
mainfrom
feat/172-ci-agent-ergonomics
Nov 23, 2026
Merged

avidianity merged 13 commits into
mainfrom
feat/172-ci-agent-ergonomics

Conversation

@avidianity

@avidianity avidianity commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

Adds five offline CI and coding-agent workflow commands to codeint: codeint report (single-pass re-rendering of saved check/diff JSON to SARIF, Markdown, TOON, JSON, or text), codeint schema (live machine-readable CLI/MCP/Metric capability manifest), codeint config --resolved (merged configuration with per-field provenance), codeint doctor (read-only environment/config/Wasm Plugin diagnostics), and codeint agent status/install (safe atomic idempotent MCP registration with --dry-run and --client).

Closes #172
Closes #185
Closes #186
Closes #187
Closes #188
Closes #189

Tier

Tier 3 from the tier check: crates/cli/tests/config.rs triggers the test-timeout pattern rule because it tests the --plugin-timeout-ms CLI flag and plugin_limits.timeout_ms provenance.

Task

Spec #172 and sub-issues #185, #186, #187, #188, #189:

Fail-first test

  • Test: crates/cli/tests/report.rs (rerenders_check_json_from_stdin_and_file_with_full_format_parity), crates/cli/tests/schema.rs (schema_matches_live_cli_commands_flags_metrics_formats_mcp_tools_version_and_exit_codes), crates/cli/tests/config.rs (config_resolved_merges_file_and_cli_overrides_with_per_field_provenance), crates/cli/tests/doctor.rs (doctor_reports_healthy_repo_in_text_json_and_toon_and_is_strictly_read_only), and crates/cli/tests/agent.rs (agent_status_reports_detected_clients_and_registration_state)
  • Before the change: failed with exit code 2 (error: unrecognized subcommand 'report', 'schema', 'config', 'doctor', 'agent')
  • After the change: passed (all workspace unit, integration, reference, and doc tests green)

Checks

Check Result
cargo test --workspace --locked passed
cargo clippy --workspace --all-targets -- -D warnings passed
cargo fmt --check passed
codeint diff fce5585 passed (0 regressions, 4 resolved clones)
lefthook pre-commit and commit-msg passed
Merged-result check (cargo run --package xtask -- merged-result) passed

Safety proof

  • Safety fact: All existing commands (check, diff, trend, init, mcp, guard, trace, impact) remain backward-compatible, doctor performs strictly read-only offline checks, and agent install --dry-run performs zero filesystem writes while agent install uses atomic temp-file writes preserving unrelated MCP servers and keys.
  • Proof: crates/cli/tests/doctor.rs snapshots repo and cache trees before/after runs; crates/cli/tests/agent.rs verifies --dry-run, atomic writes, unrelated-key preservation, and idempotency in isolated temporary home directories; crates/cli/tests/report.rs verifies exact output parity with direct check/diff invocations.
  • interrogate: Round 1 found 7 verified edge cases (file permission downgrade on agent install, symlink replacement instead of updating canonical target, integer overflow in Markdown left_out totals, partial write before multi-client validation, broken symlink misdiagnosis in doctor/config --resolved, boundaries provenance & validation in config --resolved, and schema exit code 1 description). All 7 were fixed with dedicated regression tests in 4a4e223 and merged cleanly with main (9171c0d) at 51bc6bb; clean rerun running on 51bc6bb.

Runtime evidence

End-to-end CLI integration tests executed the compiled codeint binary on revision 0142dcd across all five new subcommands (report, schema, config, doctor, agent) and existing reference/mcp/check/diff suites (all passed, and codeint diff fce5585 exited 0 with zero regressions).

Gaps

  • Deferred coverage: none
  • Pre-existing failures: none
  • Environmental failures: none

Add the codeint schema subcommand to emit a deterministic JSON or TOON capability manifest derived directly from clap command metadata, built-in Metric definitions, built-in Language plugins, live MCP tool definitions, and CLI exit codes.

Closes #186
Track default, file, and CLI provenance inside the configuration loader during merge and expose codeint config --resolved across text, JSON, and TOON formats.

Closes #187
Add read-only offline diagnostics for Git repository status, codeint.json validity, $schema version compatibility, detected Language plugins, Workspace packages, and external Wasm Plugin paths and SHA-256 digests across text, JSON, and TOON formats.

Closes #188
Add codeint report <INPUT> --format <toon|json|sarif|markdown|text> (supporting file paths and stdin via -) to re-render saved check and diff JSON reports losslessly without re-running analysis, failing with exit code 2 on malformed JSON or unsupported schema versions.

Closes #185
Add codeint agent status and codeint agent install (--dry-run, --client, --config-root, --format text|toon|json) for Claude Code, Cursor, and Codex using atomic temp-file-then-rename updates that preserve existing settings and unrelated MCP servers.

Closes #189
@github-actions github-actions Bot added the tier-3 Tier 3 from the tier check label Nov 23, 2026
# Conflicts:
#	crates/cli/src/check.rs
#	crates/cli/src/lib.rs
#	crates/cli/src/mcp.rs
#	crates/config/src/lib.rs
#	crates/report/src/diff.rs
#	crates/report/src/lib.rs
#	docs/reference.md
@avidianity
avidianity merged commit 0e8977e into main Nov 23, 2026
13 of 14 checks passed
@avidianity
avidianity deleted the feat/172-ci-agent-ergonomics branch November 23, 2026 05:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment