Commit Graph

1126 Commits

Author SHA1 Message Date
Oliver Kieselbach 710504549b refactor(agent): V2-Agent-Split skeleton + infrastructure copy (M2)
Three new projects as a clean-slate V2 fork of the Legacy Agent:

  AutopilotMonitor.Agent.V2         — net48 exe, minimal Program.cs,
                                      buildcounter 2.0.N, version-v2.json
  AutopilotMonitor.Agent.V2.Core    — net48 library, 94 files copied from
                                      Agent.Core via bulk sed namespace
                                      rewrite; same folder layout
  AutopilotMonitor.DecisionCore.Tests — xUnit net8.0 with ReplayHarness
                                        + 13 smoke/harness tests

V2 isolation is build-time-enforced via V2Isolation.targets imported from
both V2 csproj files — any Legacy ProjectReference fails the build with a
clear error. Grep-verified at commit time: zero `using
AutopilotMonitor.Agent.Core` statements and zero Legacy ProjectReferences
in the V2 tree.

Per plan §2.11, kernel items (CompletionStateMachine, CompletionGuards,
EnrollmentTracker*, Flows/*, WhiteGloveClassifier, WhiteGloveSignals,
EnrollmentStatePersistence) are transitionally retained so the V2 tree
compiles; M4 removes them when SignalAdapters + V2Orchestrator take over.

Per user direction (feedback_v2_kernel_only_refactor): the V2 refactor
replaces only the decision kernel. All peripheral capabilities — gather
rules, analyzers, diagnostics upload, timezone, server-driven actions,
summary dialog launch, env-var resolution, version checks, registry
watchers, network/DO/performance telemetry, self-update, bootstrap→cert
handover, self-destruct — are preserved verbatim via the bulk copy.

Supporting M3 bring-up platform:
 - ReplayHarness (empty-stream deterministic, SHA256 hash over terminal
   state fields) in DecisionCore.Tests/Harness/
 - Fixture scaffold under tests/fixtures/: committed anonymized directory
   with commit-policy README, plus gitignored enrollment-sessions-local/
   for raw exports
 - tools/export-session-fixture.mjs with --help / --dry-run / --validate
   modes; real MCP wiring marked TODO(v2-m3)

V2 bootstrap scripts scripts/Bootstrap/Install-AutopilotMonitor-v2(.|-dev).ps1
(committed, pure ASCII verified per feedback_ps1_ascii_only). V2 deployment
scripts under scripts/Deployment/V2/ are gitignored (analog to Legacy).

Test totals at M2 gate: 13 DecisionCore + 507 Agent.Core (unchanged) +
557 Functions (unchanged) = 1077 green.

Plan: plans/REFACTOR_AGENT_V2.md §4 M2 + §2.16 V2-Agent-Split.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 13:31:30 +02:00
Oliver Kieselbach 830a27bb70 refactor(decisioncore): add DecisionCore shared library scaffolding (M1)
New netstandard2.0 project src/Shared/AutopilotMonitor.DecisionCore/ with
14 scaffolding types across Signals/, State/, Classifiers/, Engine/.
Agent.Core and Functions reference the library without call-sites; the
full solution builds 0 errors, 0 warnings. DecisionEngine.Reduce is an
intentional NotImplementedException stub — M3 fills in the partial-class
reducer.

Invariants wired into the scaffolding:
 - Immutable DTOs (sealed + get-only + With-methods) per L.3
 - Pflicht-Evidence validation in Evidence ctor per L.5
 - KindSchemaVersion enforcement per L.6
 - AssemblyVersion 2.0.0.0 as ReducerVersion source per §2.10

Architecture principles L.1–L.18 extracted to
.claude/architecture-principles.md as persistent Claude-session context.

Plan: plans/REFACTOR_AGENT_V2.md §4 M1. Zero runtime risk.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 13:29:19 +02:00
Oliver Kieselbach 6f758ea0f1 late-aadj fix 2026-04-17 14:47:16 +02:00
Oliver Kieselbach 4851a7dfa4 updated buidlcounter.txt 2026-04-17 13:34:28 +02:00
Oliver Kieselbach 3008ba69f6 chore 2026-04-17 13:34:25 +02:00
Oliver Kieselbach 6719464f34 fix WhiteGloveClassifier and Completion logic, fix Phase Timeline 2026-04-17 12:59:38 +02:00
Oliver Kieselbach 6efae2c709 feat(agent): WhiteGlove Detection Classifier and late-AADJ support 2026-04-17 12:35:25 +02:00
Oliver Kieselbach 64240249ac dashboard performance and more coding safety checks in integrity analyser 2026-04-17 11:16:41 +02:00
Oliver Kieselbach ef1d57f32b fix wording 2026-04-17 00:36:27 +02:00
Oliver Kieselbach 9d2d6c3ae7 run integrity analyzer only on startup 2026-04-17 00:29:19 +02:00
Oliver Kieselbach 2eb6d87b4d feat(agent): added IntegrityBypassAnalyzer 2026-04-17 00:20:24 +02:00
Oliver Kieselbach 2faba55b46 Known Issues also in Navbar 2026-04-16 23:37:10 +02:00
Oliver Kieselbach 8d661bbd70 whiteglove event 509 wording 2026-04-16 23:16:54 +02:00
Oliver Kieselbach 4d4a95e58b updated Changelog 2026-04-16 23:04:27 +02:00
Oliver Kieselbach fd73f5abfb prevent doubel completion_decision_process events, fix phase timeline 2026-04-16 22:31:35 +02:00
Oliver Kieselbach bda52df517 update known issues 2026-04-16 21:55:34 +02:00
Oliver Kieselbach f046a5c8d8 update known issues 2026-04-16 20:27:12 +02:00
Oliver Kieselbach d38bd14721 update known issues 2026-04-16 20:20:39 +02:00
Oliver Kieselbach 4b3db3a1cd whiteglove completion logic and orphan events handling 2026-04-16 20:06:28 +02:00
Oliver Kieselbach 7b8a242d44 fix HybridJoin detection 2026-04-16 14:37:22 +02:00
Oliver Kieselbach bb320e0ec8 added additional foouser detection (soft WhiteGlove Indicator) 2026-04-16 14:30:35 +02:00
Oliver Kieselbach aba8df6572 agent StateMachine fixes 2026-04-16 14:15:40 +02:00
Oliver Kieselbach 6e991b5ca8 update known-issues with agent work and interruptions based on this 2026-04-16 13:40:04 +02:00
Oliver Kieselbach 3cb3df2b16 completion logix fix 2026-04-16 12:52:38 +02:00
Oliver Kieselbach 21937fa950 whiteglove session timeline fix 2026-04-16 11:54:31 +02:00
Oliver Kieselbach 0fe7748684 agent metrics session limit bump to 500 2026-04-16 11:31:56 +02:00
Oliver Kieselbach 9fd2cba424 fix(agent): prevent WhiteGlove sessions from being misclassified as self-deploying
WhiteGlove (Pre-Provisioning) sessions were incorrectly classified as
self-deploying because OnDeviceSetupProvisioningComplete and the esp_exiting
handler both race ahead of the signal-correlated WhiteGlove detector (30s
timer + 10min stability window). Two WhiteGlove signals existed but were
never consumed by completion logic:

1. EventID 509 (whiteglove_started) — already detected by
   ModernDeploymentTracker but not exposed to EnrollmentTracker
2. SaveWhiteGloveSuccessResult=succeeded in DeviceSetup registry JSON —
   present in esp_provisioning_raw but invisible to ParseSubcategories
   (no *Subcategory suffix)

Adds WhiteGlove guards at both device-only completion paths:
- OnDeviceSetupProvisioningComplete (registry polling path)
- OnFinalizingSetupPhaseTriggered esp_exiting + SkipUserStatusPage path

Exposes IsWhiteGloveStartDetected and HasSaveWhiteGloveSuccessResult
through EspAndHelloTracker. Mirrors guards in CompletionStateMachine.
Backend safety net: classifies whiteglove_started events and sets
IsPreProvisioned=true early as fallback for older agents.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 10:51:22 +02:00
Oliver Kieselbach 1c633b9c4d feat(backend): enriched EventTypeIndex + index-based event search endpoint
Enrich EventTypeIndex with MaxSeverity/Sources for server-side pre-filtering,
add GetSessionEventsByTypeAsync for OData-filtered event fetch (eliminates N+1),
and new /api/raw/events/search endpoint for MCP search tool pre-filtering.

- EventTypeIndex now stores MaxSeverity, MaxSeverityName, Sources per session-eventType
- GetSessionEventsByTypeAsync: OData filter on EventType within a session partition
- SearchEventsByTypesAsync: combines index lookup + filtered fetch across sessions
- SearchEventsFunction: GET /api/raw/events/search + global variant
- QueryRawEventsFunction: uses filtered fetch instead of full partition scan
- Routes registered in EndpointAccessPolicyCatalog (MemberRead + GlobalAdminOnly)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 10:34:21 +02:00
Oliver Kieselbach fee6909ec6 feat(mcp): add tool-call telemetry for production observability
Track MCP tool invocations in App Insights and UserUsageLog:
- Add ClientSource + McpToolName custom dimensions to RequestTelemetry
- Propagate tool name via X-MCP-Tool-Name header from MCP server
- Wrap all 26 tool handlers with withToolTelemetry for context propagation
- Add MCP_TOOL_LOGGING env var (default false) for optional stderr logging
- Add toolLoggingEnabled param to Bicep template for persistence

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 10:30:41 +02:00
Oliver Kieselbach 2503439585 fix(web): hide welcome message during dashboard loading to prevent flash
Gate WelcomeMessage on !loading so it only appears when sessions are
truly empty, not while the initial fetch is still in progress.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 09:51:38 +02:00
Oliver Kieselbach a544235ab7 feat(web): auto-load all sessions on search for better search UX
When search is active with <8 local results, automatically loads all
remaining sessions progressively (batch by batch) so the local search
can find matches across ALL fields (country, city, model, etc.).
Bottom button shows "Search all sessions..." with progress spinner
when search is active, keeps "Load 100 more..." for manual browsing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 09:07:31 +02:00
Oliver Kieselbach 8454aaeb97 allow excessiveeventcount threshold config in alert 2026-04-16 04:20:11 +02:00
Oliver Kieselbach 8a231352d9 admin alert UI excessiveSession 2026-04-16 04:10:57 +02:00
Oliver Kieselbach a0bfffcbd4 bulk delete speedup, session runaway alarm, Autopilot validation permissions sentance docs 2026-04-16 03:58:05 +02:00
Oliver Kieselbach 9447e3c9d8 refactor(agent): move StallProbeCollector + drop empty legacy folders
Part 5 of 5 in Monitoring/ bounded-context restructure. StallProbeCollector
lands in Enrollment/SystemSignals/. Empty Core/Tracking/Collectors/Network/
Analyzers/Flows/Replay/ directories removed. No behavior change.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 01:49:24 +02:00
Oliver Kieselbach 6d2b06d004 refactor(agent): move enrollment domain into Enrollment/ feature subfolders
Part 4 of 5 in Monitoring/ bounded-context restructure. Feature-based split:
Enrollment/ (orchestrator+persistence), Flows/, Ime/ (log parsing, parser,
positions, app/script state, replay, process watcher), SystemSignals/
(ESP/Hello/ShellCore/ModernDeployment/Provisioning/DesktopArrival), and
Completion/ (state machine, guards, handler). Pure folder move +
namespace update; no behavior change.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 01:44:46 +02:00
Oliver Kieselbach 9f053279f5 refactor(agent): move telemetry collectors/analyzers/gather into Telemetry/
Part 3 of 5 in Monitoring/ bounded-context restructure. Split by purpose
(periodic metrics, hardcoded analyzers, backend-driven gather rules,
device info). Pure folder move + namespace update; no behavior change.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 01:38:47 +02:00
Oliver Kieselbach 317677abf6 refactor(agent): move Network/ + Core upload internals to Transport/
Part 2 of 5 in Monitoring/ bounded-context restructure. Network/* plus
Core/EventSpool + Core/EventUploadOrchestrator moved into Monitoring/Transport/.
Pure folder move + namespace update; no behavior change.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 01:33:48 +02:00
Oliver Kieselbach e1117d7db8 refactor(agent): move Core orchestrators to Runtime/, flatten Interop/
Part 1 of 5 in Monitoring/ bounded-context restructure. Moves Monitoring/Core/*
(minus EventSpool/EventUploadOrchestrator/DeviceInfoProvider/EnrollmentCompletionHandler
which belong to later PRs) into Monitoring/Runtime/. Interop/ stays on
Monitoring root. Pure folder move + namespace update; no behavior change.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-16 01:30:05 +02:00
Oliver Kieselbach c460a9f528 optimizations, DO timeout and PerfCollector WMI to SysCall 2026-04-16 00:36:05 +02:00
Oliver Kieselbach 2e68d15978 nicer agent version string in timeline 2026-04-15 17:56:29 +02:00
Oliver Kieselbach 4d40cdf3c0 fix completion state machine (esp state wasn't tracked all the time) 2026-04-15 14:52:53 +02:00
Oliver Kieselbach 4da1540f8c added hardware hash command to guardrails 2026-04-15 01:46:32 +02:00
Oliver Kieselbach 1026f53482 fix rule state save 2026-04-15 01:26:21 +02:00
Oliver Kieselbach d178fa4ef3 consistent switcher everywhere 2026-04-15 01:18:14 +02:00
Oliver Kieselbach 47a73c08d5 changed SLA metrics to be more useful 2026-04-15 01:07:13 +02:00
Oliver Kieselbach 66587b76d3 geo report drill down has now DO usage stats as well 2026-04-15 00:52:44 +02:00
Oliver Kieselbach a3d37c67ac added more http compression (responses also) 2026-04-15 00:34:18 +02:00
Oliver Kieselbach 9b2f801530 feat: lazy loading sessions (faster page load) 2026-04-15 00:08:56 +02:00
Oliver Kieselbach 01e29da0f2 feat: Server SessionActions and action signal consolidation on agent side 2026-04-14 23:42:10 +02:00