Skip to content

feat(mcp): success bool + real --help; tighten README integrity wording - #117

Merged
luofang34 merged 4 commits into
mainfrom
pr/0.1.4-alpha-agentic-ux
May 1, 2026
Merged

luofang34 merged 4 commits into
mainfrom
pr/0.1.4-alpha-agentic-ux

Conversation

@luofang34

Copy link
Copy Markdown
Owner

Summary

PR α of the 0.1.4 agentic-UX hygiene track. Three small, additive
fixes for review-flagged friction:

  • success: bool on every MCP wire shape — JsonlToolResponse,
    RulesToolResponse, DiffToolResponse gain a top-level boolean
    derived deterministically from exit_code + terminal/error.
    Closes the documented exit_code = 2 collision at the structured-
    field layer: hosts read one canonical field instead of pattern-
    matching on _OK suffix + exit code separately. Existing fields
    unchanged; older agents still work.
  • Real cargo-evidence --help — direct-binary invocation now
    lists every subcommand by reusing clap's EvidenceArgs::command()
    long-help render. The four-line redirect stub is gone. The test's
    EXPECTED_SUBCOMMANDS list guards against drift when a new verb
    is added.
  • README tightening — content_hash section explicitly says it's
    integrity re-check, not DO-178C verification independence, and
    cross-links the existing honesty section.

Trace

  • HLR-067 / LLR-074 / TEST-081 — success bool derivation grid
    (8 unit tests, all four wire shapes × happy + failure paths).
  • HLR-068 / LLR-075 / TEST-082 — direct --help lists every
    subcommand (2 integration tests).

Floors

Dimension Was → Now
trace_hlr 66 → 68
trace_llr 73 → 75
trace_test 78 → 80
per_crate.evidence-mcp.test_count 37 → 45 (+8 unit)
per_crate.cargo-evidence.test_count 134 → 136 (+2 integration)

Test plan

  • cargo fmt --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace --all-targets — 240+ tests pass
  • RUSTDOCFLAGS='-D missing_docs -D rustdoc::broken_intra_doc_links' cargo doc --workspace --no-deps
  • cargo build --release --workspace
  • cargo run -p cargo-evidence -- evidence trace --validate → VERIFY_OK
  • cargo run -p cargo-evidence -- evidence floors --format=jsonl → FLOORS_OK (13/13 dimensions)
  • target/debug/cargo-evidence --help shows banner + all 10 subcommands

🤖 Generated with Claude Code

Sokoly2024 and others added 4 commits May 1, 2026 18:45
Two agentic-UX surfaces:

- HLR-067 / LLR-074 / TEST-081: ToolResponse.success boolean on
  every MCP wire shape, derived deterministically from
  exit_code + terminal/error so hosts no longer need to pattern-
  match on the colliding exit_code = 2.

- HLR-068 / LLR-075 / TEST-082: cargo-evidence --help direct
  invocation lists subcommands by reusing clap's render tree,
  closing the four-line stub friction observed when an agent
  resolves the binary path with `which cargo-evidence` and runs
  --help directly.

cert/floors.toml bumps trace_hlr 66→68, trace_llr 73→75,
trace_test 78→80. Implementation lands in follow-up commits.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Three agentic-UX hygiene fixes for v0.1.4, each closing a friction
the post-0.1.3 review identified:

1. JsonlToolResponse / RulesToolResponse / DiffToolResponse gain a
   top-level `success: bool` field, derived deterministically from
   `exit_code` + `terminal`/`error`. Closes the colliding-exit-code
   ambiguity at the structured-field layer: hosts have one canonical
   field to read, instead of pattern-matching on a `_OK` suffix and
   exit_code 2 separately.

2. `cargo-evidence --help` (direct-binary invocation) now lists every
   subcommand by reusing clap's `EvidenceArgs::command()` long-help
   render. The previous four-line redirect stub is gone. New
   subcommands appear automatically; `EXPECTED_SUBCOMMANDS` in the
   test guards against drift.

3. README's content_hash section explicitly distinguishes integrity
   re-check from DO-178C verification independence and forward-
   references the existing honesty section.

Trace: HLR-067 / LLR-074 / TEST-081 cover the success-bool grid;
HLR-068 / LLR-075 / TEST-082 cover the --help intercept. Floors:
trace_hlr 66→68, trace_llr 73→75, trace_test 78→80,
per_crate.evidence-mcp.test_count 37→45 (+8 unit), per_crate
.cargo-evidence.test_count 134→136 (+2 integration).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Workspace clippy is denied on `let_underscore_must_use`; the
`let _ = cmd.print_long_help();` form trips it. Switch to
`drop(cmd.print_long_help())` — broken-pipe is the only realistic
failure on `--help`, and dropping mirrors how every Unix tool
handles SIGPIPE on `--help` invocation.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
`[`\`success\``]` in field docstrings doesn't resolve under
`-D rustdoc::broken_intra_doc_links` because the field isn't in
the rustdoc item-name scope. Switch to `[`\`Self::success\``]`,
which is the canonical form for sibling-field references.

Why CI caught it but local didn't: the workspace doc gate uses
the broken-intra-doc-links lint at deny level; my local re-run
between trace seed and implementation didn't trip it because the
doc link was added in this same PR — the local doc check only
verifies the prior baseline.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@luofang34
luofang34 merged commit d882a73 into main May 1, 2026
15 checks passed
@luofang34
luofang34 deleted the pr/0.1.4-alpha-agentic-ux branch May 1, 2026 23:40
luofang34 pushed a commit that referenced this pull request May 2, 2026
…rface claim, CHANGELOG

- **Blocker 1**: CONTRIBUTING.md's UUID workflow now points at the
  established `cargo evidence trace --backfill-uuids` policy and
  cross-references `cert/trace/README.md`'s rationale. The
  python3 one-liner the prior draft suggested was the exact
  hand-crafting form the existing policy bans (collision risk,
  weakens the "UUIDs are opaque" contract, tempts reading meaning
  into digits). Two contradictory authority docs on the same
  workflow is a quality-of-process regression — fixed.

- **Blocker 2**: Sharpened the negative dogfood. The previous test
  used `mcdc_2024.rs`, which fails the duplicate regex for two
  independent reasons (no leading space + 4 digits exceeds the
  2-digit cap). A regression that drops only the leading-space
  anchor would still pass. Added `mcdc_24.rs` (2 digits, no
  leading space) so each anchor is isolated by its own fixture.

- **Minor 3**: HLR-069 now claims `surfaces = ["editor-duplicate
  gate"]`, matching the convention HLR-044 / HLR-046 / HLR-047
  established for sibling hygiene gates. New entry in
  `KNOWN_SURFACES`. `cert/floors.toml` known_surfaces 21→22.

- **Minor 5**: 0.1.4 hygiene-track entry added to CHANGELOG. Bundles
  the changes already in main from PRs #115 / #116 / #117 plus the
  changes landing in this PR. Per-PR cadence rather than batched
  release-prep PR.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants