Commit Graph

1068 Commits

Author SHA1 Message Date
Oliver Kieselbach d391900d6d added stateMachine discrepancy check events for further validation of stateMachine and upcoming final switch 2026-04-14 14:55:05 +02:00
Oliver Kieselbach aa747d4a35 extracted ShellCoreTracker + ProvisioningStatusTracker from EspAndHelloTracker
Completes the composition split: EspAndHelloTracker is now a thin coordinator
(~290 LOC) that forwards events between four focused sub-trackers:

  - HelloTracker              (820 LOC, previously extracted)
  - ModernDeploymentTracker   (480 LOC, previously extracted)
  - ShellCoreTracker          (325 LOC, NEW)
  - ProvisioningStatusTracker (650 LOC, NEW)

ShellCoreTracker owns Shell-Core 62404/62407 handling, ESP-exit + WhiteGlove
fire-once guards, failure classification + backfill. Cross-notifies HelloTracker
on Hello wizard start and ESP exit. Core processing extracted to ProcessEvent
with primitive inputs so tests drive it without EventLogWatcher.

ProvisioningStatusTracker owns registry polling (RegNotifyChangeKeyValue),
category/subcategory parsing for both flat + nested JSON formats, subcategory
transition detection with noise filtering, categorySucceeded resolution,
DeviceSetup fallback timer (5s recheck after 30s for Win 25H2/26200 builds
that never set the boolean), and the public snapshot APIs.

Coordinator's public API (events, properties, methods) preserved byte-for-byte
for CollectorCoordinator + EnrollmentTracker — no integration changes required.

Adds 50 xUnit tests:
  - ShellCoreTrackerTests (20): Hello wizard start notification, WhiteGlove
    fire-once, all 6 failure keywords, ESP exit flow, WhiteGlove-vs-Exiting
    regex precedence, backfill dedup semantics.
  - ProvisioningStatusTrackerTests (30): first-seen / resolved / failure paths,
    flat + nested subcategory formats, state inference, snapshot APIs,
    noise-filtering of notStarted→in_progress transitions, progression to
    succeeded as a transition event, JSON helper edge cases.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 13:21:45 +02:00
Oliver Kieselbach a8f6325ea9 extracted HelloTracker from EspAndHelloTracker
Moves WHfB policy detection, UDR event handling (300/301/358/360/362/376),
HelloForBusiness watcher (3024/6045), Hello wait/completion timers and
HelloOutcome state machine into a dedicated HelloTracker class (820 LOC).

Cross-boundary with ESP (Shell-Core 62404/62407) is narrowed to two
explicit notify methods: NotifyHelloWizardStarted + NotifyEspExited.

Public API of EspAndHelloTracker is unchanged — IsPolicyConfigured,
IsHelloCompleted, HelloOutcome, StartHelloWaitTimer, ForceMarkHelloCompleted,
ResetForEspResumption and the HelloCompleted event now delegate to the
composed HelloTracker. CollectorCoordinator + EnrollmentTracker integration
requires no changes.

Adds 29 xUnit tests covering: UDR terminal events, 6045 skip HRESULT,
wait/completion timer paths (policy-enabled extended wait, policy-disabled
immediate completion, wizard-started vs wizard-not-started outcomes),
cross-boundary notifications, ForceMarkHelloCompleted semantics and
ResetForEspResumption state reset.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 13:05:15 +02:00
Oliver Kieselbach 97fb112c00 extracted ModernDeploymentTracker 2026-04-14 12:54:52 +02:00
Oliver Kieselbach 4fbcfb51b4 refactor web structure (progress page using hooks) 2026-04-14 12:23:27 +02:00
Oliver Kieselbach 95949abdd3 refactor web structure (session details page uses hooks) 2026-04-14 12:09:53 +02:00
Oliver Kieselbach ebc588c460 refactor web structure (re-org to utils) 2026-04-14 11:29:55 +02:00
Oliver Kieselbach a3e8e0449a refactor web structure (re-org to utils) 2026-04-14 11:29:22 +02:00
Oliver Kieselbach 7f38026cf1 refactor web dashboard (hook sessions) 2026-04-14 11:00:42 +02:00
Oliver Kieselbach cbe13da680 refactor web dashboard (filter hooks) 2026-04-14 10:41:47 +02:00
Oliver Kieselbach 29cacac1c6 refactor web project structure 2026-04-14 10:26:13 +02:00
Oliver Kieselbach fbfcfed667 updated skill 2026-04-14 10:16:00 +02:00
Oliver Kieselbach cfc412d5ff added SLA telemetry 2026-04-14 10:15:01 +02:00
Oliver Kieselbach eb0df61b47 refactor web project structure 2026-04-14 10:02:16 +02:00
Oliver Kieselbach 8a3e3c4550 refactor web project structure 2026-04-14 10:02:02 +02:00
Oliver Kieselbach 91ba78c19b refactor web project structure 2026-04-14 09:49:02 +02:00
Oliver Kieselbach 665a9a14cc better agent self-update observability 2026-04-14 09:33:44 +02:00
Oliver Kieselbach 000f7e390d more parallel fetches for better performance 2026-04-14 02:30:38 +02:00
Oliver Kieselbach fa1128212f added agent core tests 2026-04-14 01:39:48 +02:00
Oliver Kieselbach bb3efae5dc refactor CollectorCoordinator (method logic extraction) 2026-04-14 01:00:24 +02:00
Oliver Kieselbach 918d6c0ee7 Refactor MonitoringService for better reliability and testability 2026-04-13 23:51:24 +02:00
Oliver Kieselbach f2bbee6aa7 agent feat: added CompletionStateMachine enhance reliability and testability 2026-04-13 22:14:44 +02:00
Oliver Kieselbach 559167863c fix SLA page layout 2026-04-13 21:08:42 +02:00
Oliver Kieselbach 8ab14f0d0a fix immediate view of SLA config creation 2026-04-13 20:54:15 +02:00
Oliver Kieselbach 0ced90850a fixed styling 2026-04-13 20:41:23 +02:00
Oliver Kieselbach c415872e46 feat: SLA tracking dashboard with notifications 2026-04-13 20:19:24 +02:00
Oliver Kieselbach 17c39dd1b1 better failure logging 2026-04-13 16:39:55 +02:00
Oliver Kieselbach bba1d55860 added more usage metrics (apps/scripts) 2026-04-13 15:54:56 +02:00
Oliver Kieselbach 2342acf5a6 new aggregated usage metrics for apps and scripts
bugfix scroll to analyze rule (top X rules firing listing card)
2026-04-13 15:32:27 +02:00
Oliver Kieselbach 96a383bb38 bug fix rule stats and chagned stats to be more useful 2026-04-13 15:12:29 +02:00
Oliver Kieselbach 565c5faa16 Merge branch 'main' of https://github.com/okieselbach/Autopilot-Monitor 2026-04-13 14:12:23 +02:00
Oliver Kieselbach 62918c9cbf added rule stats 2026-04-13 14:12:19 +02:00
Oliver Kieselbach ef8d027877 Merge pull request #42 from okieselbach/claude/add-event-backfill-0cjfb 2026-04-12 18:33:49 +02:00
Oliver Kieselbach 37cc7540bf sanitize appname rowkey 2026-04-12 18:32:01 +02:00
Claude 4d73c86641 feat: add event backfill for targeted ModernDeployment events (Event 509)
Solves the timing gap where WhiteGlove Event 509 fires during OOBE
before the agent starts (pre MDM-enroll). On startup the agent now
scans the ManagementService event log for targeted events within a
configurable lookback window (default 30 min) and emits them with
a backfilled=true marker for trace analysis.

Key changes:
- Extract ProcessModernDeploymentRecord from live handler for reuse
  by both EventLogWatcher callback and EventLogReader backfill
- Add BackfillTargetedModernDeploymentEvents() with persisted state
  (whiteglove-backfill.json) so subsequent agent restarts skip the
  scan and avoid duplicate emissions
- Add config fields ModernDeploymentBackfillEnabled and
  ModernDeploymentBackfillLookbackMinutes to CollectorConfiguration
- Wire up stateDirectory and config in MonitoringService
- All emitted events now carry Data["backfilled"] = true/false

https://claude.ai/code/session_01ToApHGezTGcSkA6NVbVZkG
2026-04-12 10:11:19 +00:00
Oliver Kieselbach 7220020a55 bug fix in CVE cache chunking 2026-04-11 11:17:48 +02:00
Oliver Kieselbach 1a5ab674b0 more whitglove detection logic (event 509) 2026-04-11 00:41:45 +02:00
Oliver Kieselbach 074de590dd Merge branch 'main' of https://github.com/okieselbach/Autopilot-Monitor 2026-04-10 18:28:35 +02:00
Oliver Kieselbach e5c53eb772 enrich event data for analyze rules 2026-04-10 18:28:31 +02:00
okieselbach 32bc9da60c chore: regenerate rules/dist from individual files 2026-04-10 16:13:38 +00:00
Oliver Kieselbach 625809423f Better app failure detection and reporting 2026-04-10 18:12:30 +02:00
Oliver Kieselbach 1ff614221a Fix PropertyValueTooLarge in Table Storage 2026-04-10 17:37:20 +02:00
Oliver Kieselbach d55775999d probe collector enhancements 2026-04-10 17:29:04 +02:00
Oliver Kieselbach f26f72642b added search to OpsEvents 2026-04-10 12:32:52 +02:00
Oliver Kieselbach 08c6575107 updated commands 2026-04-10 11:21:53 +02:00
Oliver Kieselbach 24b3849f5c SelfUpdate timeout version check bump to 2500ms 2026-04-09 22:08:51 +02:00
Oliver Kieselbach 62c07239a1 added TOT comment for StallProbeCollector 2026-04-09 20:46:04 +02:00
Oliver Kieselbach e9fcb85797 feat: added LatestVersions api and bootstrapper version handling and hints (badge, docs) 2026-04-09 19:50:13 +02:00
Oliver Kieselbach 3f7fcbc684 feat: added StallProbeCollector to detect stalled sessions and identify ESP failure better
added Bootstrapper script version
2026-04-09 19:31:54 +02:00
Oliver Kieselbach f33aadbe0e more stats on dashboard 2026-04-08 18:39:10 +02:00