Repository navigation
feat(m4): add terminal reports and redacted offline bundles - #4
Merged
Merged
Conversation
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.
What this changes
Implements ENV-024–ENV-026 in the M4 requirements.
diagnosesupports explicit text, Markdown and JSON formats,--plain, and a scrolling Bubble Tea viewer with plain fallback and terminal restoration. Markdown escapes dynamic content and bounds its output.bundlepublishes a versioned, redacted ZIP using a separate typed sharing model. Paths and hosts become capture-local aliases; Git identity becomes presence facts; unsupported evidence has explicit omissions and degradation. Optional diagnostics contain structured statuses/timings.diagnose --from-bundlevalidates the capture and recomputes findings with the current builtin rules offline, preserving capture/evaluator provenance.Why
Ordinary JSON intentionally retains effective Git identity. Portable diagnostic evidence needs a documented sharing policy that preserves equality and missing-evidence semantics. Accepted ADR 0006 defines these contracts.
The reader validates ZIP structure, streamed sizes, CRC/digests, exact typed JSON and cross-member metadata without extraction. Compressed input must be below 2,000,000 bytes; independent decompression, member and JSON-work limits apply. Private atomic staging preserves the prior destination on failure. Offline evaluation uses sanitized evidence, with saved verdicts/advice retained only as reference data.
How it was verified
Implementation:
c532dc3; local validation documentation:5eff1dd; published CI record and final branch head:0ed86f9.make testmake racemake racegolang:1.26.11with a read-only source mountmake lint0 issues.make buildand six static targetsmake check-docsgovulncheck ./...No vulnerabilities found.go mod verifygit diff --checkpassed0ed86f9, including native race/test/build, lint and vulnerability scanNative Windows PTY checks covered quit, Ctrl+C, injected output failure and resizing 40×18 → 96×28; terminal modes and cursor state were restored. The README capture uses synthetic evidence. All 172 captures round-trip with applicable results preserved; an actual Windows bundle was diagnosed in network-disabled Linux. Repeated bundle/viewer lifecycles returned to their original goroutine counts. Ten warm Windows diagnoses completed in 236.06–561.36 ms with peak working sets of 13,213,696–14,782,464 bytes.
Existing collector and rule behavior, all original golden fixtures, generated pages and the accepted ADR are preserved. Ordinary JSON/fixture behavior is preserved; optional bundle-source metadata appears in offline reports.
Final native M4 Windows/Ubuntu/macOS CI passed in both the PR workflow and push workflow on
0ed86f9d86b90347a134814f8244f0073a702194. All five jobs succeeded in each run. Native macOS interactive observation, cold-host performance and release packaging remain separate work. Full evidence, commands and limits are in M4 validation and the dependency review.Checklist
make lintpassesdocs/,README.mdroadmap, orapi/)docs/adr/