Skip to content

Add port snapshots and offline evidence diffs - #1

Merged
nisconder merged 1 commit into
mainfrom
feat/snapshot-diff
Nov 7, 2026
Merged

nisconder merged 1 commit into
mainfrom
feat/snapshot-diff

Conversation

@nisconder

Copy link
Copy Markdown
Owner

Previously portdoc could capture one inventory or diagnosis, but comparing two environments required manually reading JSON. This adds snapshot [port] --out <new-file.json> and offline diff <before.json> <after.json> to show listener/project identity, Docker/Compose mappings, reachability and exclusion changes.

Snapshots preserve scan v1 or diagnosis v3 inside a versioned envelope and refuse overwrites. Diffs retain incomplete collectors, missing source identity, lost process metadata and failed probes as unknown evidence; they do not claim a service disappeared or a fault was fixed. Exit 2 takes precedence over observed changes. English/Chinese help, JSON schemas and examples are included.

Validation:

  • Windows full test suite: 137 passed, 1 POSIX-only skip.
  • Windows standalone EXE build and smoke checks passed in an isolated directory without Node/npm on PATH, including snapshot/diff and overwrite protection.
  • Real Windows x64 / Node 24.22.1 listener lifecycle: independent IPv4 reachability true to false; CLI diff reported listener removal and endpoint change. Windows/WSL collectors succeeded, Docker remained unavailable, and both snapshots/diff correctly returned 2.
  • Live snapshot/diff outputs validated against the new JSON schemas; git diff --check passed.
  • Real IPv6, Docker lifecycle and WSL network-mode transitions remain unverified by that single-host case. Raw local paths/command lines were not committed.

@nisconder
nisconder merged commit 0052f8e into main Nov 7, 2026
7 checks passed
@nisconder
nisconder deleted the feat/snapshot-diff branch November 13, 2026 02:43
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