Skip to content

Add intermesh debug report command - #175

Merged
ejj merged 9 commits into
NetSys:mainfrom
pcnofelt:report-debug-cp
Aug 5, 2026
Merged

Add intermesh debug report command#175
ejj merged 9 commits into
NetSys:mainfrom
pcnofelt:report-debug-cp

Conversation

@pcnofelt

Copy link
Copy Markdown
Collaborator

Summary

  • Adds intermesh debug report, which writes a single shareable text file with a node's trust state, environment info, and recent log output for troubleshooting.
  • The report includes a couple of hashes so two reports (or two nodes) can be compared at a glance.
  • Degrades gracefully when optional data isn't available (no log file, interception off, permissions issues) instead of failing outright.

Test plan

  • cargo local
  • Manual smoke test: bare daemon, joined mesh, log tail, daemon down, interception on/off
  • Two-node test: fingerprints match on converged nodes, diff between reports stays small, inputs differ per node as expected

pcnofeltand others added 8 commits July 21, 2026 15:33
Teach the daemon to report its own build hash and start time over the admin socket. The daemon may be running an older binary than the one on disk, so the CLI's version can't stand in for it.
First piece of `intermesh debug report` (IM-16 Phase 1). Older daemons leave the fields empty; old TOML dumps still parse fine.
The report is assembled first, rendered second: collectors fill an in-memory Report, and rendering is a pure function of it, so the whole artifact is unit-tested without a daemon or network. Includes the state fingerprint ("do these two nodes agree?") and the per-node inputs digest, plus a proxy helper describing expected listeners. Part of `intermesh debug report` (IM-16 Phase 1).
One command, one file: fetch the trust snapshot over the admin socket, probe the environment (uname, nftables, resolver), tail the daemon log if configured, and write a single shareable report.
If the daemon is unreachable, exit with an error instead of writing a near-empty file; all other probes degrade into notes in the report.
Capture interface addresses and the routing table, and keep the nftables rules the report was already fetching instead of throwing them away. Most "wrong self-IP" and "peer unreachable" questions can now be answered by eyeballing the report: the IPs the host actually has sit right next to the ones the mesh believes.
Probe output is clipped to the first 25 lines so the report stays a report — a "… (+N lines)" marker says what was left out. The full inventories can live in a future debug archive.
Give the report a real header, clean up the summary legend, put
environment info before the event log, and add a closing line so
it's clear where the report ends. Also explain what the state and
inputs hashes mean, both in the report itself and in --help.
sha256_short only renders the first 8 bytes, so a u64 round-trip
through {:016x} produces the same string without pulling hex back
into the tree (upstream had already removed it).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Removed language that felt overly verbose or confusing.
@pcnofelt

Copy link
Copy Markdown
CollaboratorAuthor

As an example/reference, uploaded the generated node reports for two connected nodes. The reports do not include log output.

node-a-report.txt
node-b-report.txt

@pcnofelt

pcnofelt commented Jul 22, 2026

Copy link
Copy Markdown
CollaboratorAuthor

One thing I realized, this report uses a few utf8 characters (check mark and the like), so the report is not pure ASCII.

The result of having utf-8 characters, in some text viewers or on some systems the characters will not render correctly (instead showing a three-letter code, like" âœ" in place of the utf-8 symbol ✓).

The upside of using utf-8: it looks nice and we get a couple fun, concise symbols.
The downside: render issues in a format (txt) that people generally assume to be issue-free.

What is Intermesh's opinion on utf-8 symbols for display and text output?

@ejj
ejj merged commit efdce02 into NetSys:mainAug 5, 2026
1 check passed
Sign up for freeto 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

@pcnofelt@ejj