Skip to content

fix(etw): retain cleanup authority after original main loss - #972

Merged
antropos17 merged 8 commits into
masterfrom
codex/etw-main-loss-20261018
Oct 18, 2026
Merged

antropos17 merged 8 commits into
masterfrom
codex/etw-main-loss-20261018

Conversation

@antropos17

@antropos17 antropos17 commented Oct 18, 2026 •

Copy link
Copy Markdown
Owner

Description

When original Electron main, broker, collector, guard and fallback all exit, no original process remains to finish ETW cleanup. Protocol v9 now reserves cleanup authority in a temporary elevated custodian before StartTrace. It retains five verified original process objects and can control only the reserved trace after all five exit. Cleanup does not restart the application or capture. Custodian-only loss fails the sensor and uses the existing cleanup path.

A temporary qualification launch host shares one explicit UAC consent across the batch while main and broker remain normal-token. It accepts only fixed-image collector/cleanup-worker requests from authenticated native children of packaged main, under a bounded lifetime and launch count. It holds no reservation or recovery handles. No service, account, global permission or UAC setting changes. A delayed-reader test exposed an unread-pipe disconnect race; startup now waits for acknowledgment of the validated query-only child reference. Capture exit codes and scan-readiness observations are preserved.

Type of change

  • Bug fix
  • Documentation update

Testing

  • PASS: all 28 real packaged captures in one final sweep, frozen runtime 6ede1763: six original-main/custodian cases and all 22 earlier regressions. One host consent, 28 collector launches, two cleanup-worker launches, zero remaining host children. Independent final query returned absence 4201.
  • 100 published native self-tests and 321 focused JS tests passed; all 16 protected GUI Windows tests passed locally. All six CI contexts passed on final head 882e348a, including coverage, witness/count gates and Windows fixtures.
  • All 231 archived main/shared JS/JSON files match frozen runtime source; native publication and full package manifest match. All 40 profiles, including failed attempts, passed bounded content and diagnostic-audit exclusion checks. The seven dirty primary-checkout files and its status are unchanged.
  • Earlier failed receipts remain failures and are retained. Final evidence does not rewrite them into PASS. Local Semgrep is unavailable (ENOENT). No human review is claimed.

The temporary custodian must survive outside the original five-process failure set. Qualification used the one-consent activation host; individual ordinary ShellExecute activation, protected installation, durable recovery, sleep/wake, forced real PID/TID reuse and production/path admission remain separate boundaries. Production ETW stays disabled by default.

See the recovery contract and bounded source-bound evidence. The final commit changes documentation/evidence only; runtime and harness remain frozen.

Checklist

  • Follows code style guidelines (CommonJS main, Svelte 5 renderer)
  • No console.log in production code
  • New files stay focused and follow the applicable AGENTS.md conventions
  • Applicable local, packaged and exact final PR-head CI checks completed
  • This code has been reviewed by a human (not solely AI-generated)

@antropos17
antropos17 marked this pull request as ready for review October 18, 2026 15:32
@antropos17
antropos17 merged commit 5bac592 into master Oct 18, 2026
6 checks passed
@antropos17
antropos17 deleted the codex/etw-main-loss-20261018 branch October 18, 2026 15:35
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