Skip to content

feat(m4): add terminal reports and redacted offline bundles - #4

Merged
Shellghostt merged 5 commits into
mainfrom
feat/m4-implementation
Nov 19, 2026
Merged

Shellghostt merged 5 commits into
mainfrom
feat/m4-implementation

Conversation

@Shellghostt

@Shellghostt Shellghostt commented Nov 18, 2026 •

Copy link
Copy Markdown
Owner

What this changes

Implements ENV-024–ENV-026 in the M4 requirements. diagnose supports 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.

bundle publishes 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-bundle validates 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.

Executed check Result
make test All packages passed, including 172 original built-CLI goldens and M4 format/privacy/archive/offline/atomic tests
Native Windows make race All packages passed using the x64 GCC toolchain
Linux make race All packages passed in golang:1.26.11 with a read-only source mount
make lint 0 issues.
make build and six static targets Passed for Windows/Linux/macOS, amd64/arm64; all below 25 MB
make check-docs Passed; twelve generated rule pages unchanged
govulncheck ./... No vulnerabilities found.
go mod verify All modules verified
Bounded reader fuzz 15 s, two workers, 3,158 executions; passed
Local documentation checks File links and all 40 named evidence functions resolved; git diff --check passed
Native Windows/Ubuntu/macOS GitHub CI All ten jobs passed across the final PR and push workflows on 0ed86f9, including native race/test/build, lint and vulnerability scan

Native 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

  • Tests added or updated for the new behaviour
  • make lint passes
  • Documentation updated (docs/, README.md roadmap, or api/)
  • If a documented decision changed, an ADR was added in docs/adr/
  • No claims of unverified behaviour: status fields still match reality
  • No secrets, tokens or customer data in the diff

@Shellghostt
Shellghostt merged commit a2f101e into main Nov 19, 2026
10 checks passed
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.

1 participant