Skip to content

refactor: deepen six architecture candidates - #9

Merged
codewiththiha merged 1 commit into
mainfrom
refactor/architecture-deepening
Aug 4, 2026
Merged

refactor: deepen six architecture candidates#9
codewiththiha merged 1 commit into
mainfrom
refactor/architecture-deepening

Conversation

@codewiththiha

Copy link
Copy Markdown
Owner

Implements the six deepening candidates from the architecture review (built-in identity, scan pipeline, retry budget, settings persist, process teardown + per-session registry, journal_mode/worker deltas).

  • Built-in config identity: BuiltinConfig::from_path + display_name own the path-layout parse; export_name and both recent displays route through them instead of re-parsing the file stem in three places.
  • Scan pipeline: scan::scan_pipeline is shared by scan and all; all keeps only the connect half; the report format is unified (was already drifting).
  • Retry budget: a pure RetryBudget type drives the retry/drop rules in ConnectService::run — the policy is now directly unit-testable without spawning subprocesses.
  • Settings persist: persist_scan/persist_connect live beside the resolvers in UserSettings; the command-layer apply helpers are deleted.
  • Process teardown: OpenVpnHandle owns kill_graceful; kill_handle is deleted; the kill registry becomes a per-session ProcessRegistry threaded through the spawn path — hiding the global and fixing a real test-isolation bug (one test's cleanup was killing another's live processes).
  • Pool guest + worker deltas: journal_mode moves to db::pool; ScanProgress reports deltas instead of workers reading absolute counters back.

Also fixes the flaky custom_retry_count test (per-session registry + longer handshake timeout). Full suite is now stable across repeated runs.

- #1 builtin identity: BuiltinConfig::from_path + display_name centralize the
  path-layout parse; export_name and recent route through them (3 inline
  file_stem parses deleted)
- #2 scan pipeline: scan::scan_pipeline shared by scan and all; all.rs keeps
  only the connect half; report format unified
- #3 retry budget: pure RetryBudget type drives the retry/drop rules;
  ConnectService::run consults it instead of inline counters
- #4 settings persist: persist_scan/persist_connect live beside the resolvers
  in UserSettings; command-layer apply helpers deleted
- #5 process teardown: OpenVpnHandle owns kill_graceful; kill_handle deleted;
  the kill registry becomes a per-session ProcessRegistry threaded through
  spawn sites (hides the global, fixes cross-test killing)
- #6a/6b: journal_mode moves to db::pool; ScanProgress reports deltas

Flaky custom_retry_count test fixed (per-session registry + 30s handshake
timeout); full suite now stable across repeated runs.
@codewiththiha
codewiththiha merged commit 21b1b34 into main Aug 4, 2026
1 check passed
@codewiththiha
codewiththiha deleted the refactor/architecture-deepening branch August 4, 2026 07:28
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