M15.1: tracing infra + LogTracer bridge (FR-65, FR-69)#19
Merged
Conversation
Adds the structured-tracing scaffold for the M15 verbose / JSONL debug surface (PRD §5.8.4). Anvil itself does NOT install a subscriber — the consumer (Gitway CLI in M15.4) decides whether output is human-formatted, JSONL, file-rotated, etc. M15.1 just provides the category constants + the log/tracing bridge so a single subscriber sees both the ~59 existing log::*! calls (from Anvil + russh + ssh-key) AND the new structured tracing events M15.2 will add. Cargo.toml: - `tracing = 0.1` and `tracing-log = 0.2` (MSRV-1.88-clean). src/log.rs (new, ~140 lines): - pub const CAT_KEX = anvil_ssh::kex - pub const CAT_AUTH = anvil_ssh::auth - pub const CAT_CHANNEL = anvil_ssh::channel - pub const CAT_CONFIG = anvil_ssh::config - pub const CATEGORIES: &[&str] — used by Gitway's --debug-categories flag to validate user input. - pub fn install_log_bridge() -> Result<(), SetLoggerError> wraps tracing_log::LogTracer::init() with module-level documentation about the `log::*!` -> tracing forwarding, idempotency semantics, and the must-call-before-Cli::parse() ordering trap. - 4 unit tests: prefix invariant, slice/constants consistency, uniqueness, idempotency. src/lib.rs: - pub mod log; Public API audit: only additions (new pub mod, no breaking changes). Bumps to 0.6.0 land in M15.3. Plan: M15.1 of anvil-gitway-milestone-plan.md. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 4, 2026
UnbreakableMJ
added a commit
that referenced
this pull request
May 4, 2026
…instrumentation) (#21) Bumps anvil-ssh from 0.5.0 to 0.6.0 to publish the M15.1 + M15.2 work as a single crates.io release. M15 is a multi-PR milestone (PRD §5.8.4 — `-vv`/`-vvv`/JSONL debug, FR-65..FR-69); this release ships the library-side scaffold (categories + `tracing-log` bridge + FR-66 instrumentation across session/auth/resolver/proxy modules) and the Gitway-side flag wiring (FR-65, FR-67, FR-68, FR-69) lands in M15.4 + M15.5 against this 0.6.0. Highlights (full text in CHANGELOG.md): - new public module `anvil_ssh::log` with category constants (CAT_KEX, CAT_AUTH, CAT_CHANNEL, CAT_CONFIG) and the `install_log_bridge()` entry point that wraps `tracing_log::LogTracer::init()`; - structured `tracing::*!` events across the host-key / authentication / ssh_config-resolution / proxy-jump paths. Every applied `~/.ssh/config` directive emits a `(file, line, directive, value)` event under CAT_CONFIG; every check_server_key outcome emits a same-shaped `{host, fp, verdict, ...}` event under CAT_KEX/CAT_AUTH so JSONL consumers can group/count; - `log::*!` call sites preserved verbatim — the bridge funnels them through the consumer's tracing subscriber so M15.4 sees one event stream regardless of macro flavor. Anvil does NOT install a subscriber — that policy belongs to the consumer (Gitway CLI in M15.4). The bridge stays in place permanently for russh and other reverse-deps that stay on `log`. Public-API additions only. Existing `log::*!` consumers keep working unchanged. Lib tests: 207 passed, 5 ignored (pre-existing). Integration tests: 4 (test_known_hosts_cert.rs). Plan: M15.3 of anvil-gitway-milestone-plan.md. Stacked after M15.1 (#19), M15.2 (#20), both merged to main. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
First slice of M15 (PRD §5.8.4 —
-vv/-vvv/ JSONL debug). Adds thestructured-tracing scaffold so M15.2 can layer FR-66 instrumentation
on top, and so M15.4 (Gitway-side) can wire one subscriber that sees
both the new structured events and the ~59 existing
log::*!calls.tracing = 0.1,tracing-log = 0.2(MSRV-1.88-clean).anvil_ssh::log: category constants (CAT_KEX,CAT_AUTH,CAT_CHANNEL,CAT_CONFIG) +pub fn install_log_bridge()wrappingtracing_log::LogTracer::init().Anvil itself does NOT install a subscriber — that policy belongs to the consumer (Gitway CLI in M15.4). The bridge stays in place permanently for russh and other reverse-deps that stay on
log.Public API: pure additions. Version bump to 0.6.0 lands in M15.3.
Test plan
cargo fmt --all -- --checkcargo clippy --all-targets --all-features --locked -- -D warningscargo test --lib --tests --locked— all green, including 4 newlog::*tests🤖 Generated with Claude Code