Commit Graph

7121 Commits

Author SHA1 Message Date
rcourtman e58df998ef Keep fast Assistant tool activity visible 2026-06-07 13:51:53 +01:00
rcourtman d7f0de0ba2 Add data directories to remediation context
FormatForRemediation surfaced config and log paths but not data paths,
while FormatForAIContext (chat) does. For remediation those matter —
backup targets, disk-full triage, restore points (e.g. a database data
dir or HA's /config/.storage). Add a Data Directories section, matching
the chat pack. Extends the remediation test to assert a data path
reaches it; teeth-checked. Full servicediscovery package green.
2026-06-07 13:36:09 +01:00
rcourtman db28d8bcc3 Grow Discovery scenario oracle: nginx + mosquitto cells
Add two common-service cells to the context oracle. Beyond documenting
nginx and MQTT, they pin two code paths the existing cells did not cover:
the read-only bind-mount marker (nginx config mounted read-only) and
security-category fact surfacing (mosquitto auth). Both pass against the
current formatters (no production gap) — regression protection for the
iter4/iter5 mount + fact-filter work. Corpus now 6 cells (HA-LXC,
HA-Docker, postgres, frigate, nginx, mosquitto). Full package green.
2026-06-07 13:26:30 +01:00
rcourtman 8a06f98906 Expose Assistant command entry in composer 2026-06-07 13:24:18 +01:00
rcourtman 0d69411e9d Move Assistant stop control into activity dock 2026-06-07 13:08:52 +01:00
rcourtman 35ae43ca48 Give remediation context the same actionable detail as chat
FormatForRemediation (the discovery context Patrol/remediation consume)
surfaced CLI access, config/log paths and ONLY hardware facts — so the
context meant for fixing a workload never told you how to restart it or
where to edit its files on the host, the two core fix actions. Add a
'Service Control' section (service-category facts: systemd unit / restart
command) and a 'Bind Mounts (host -> container)' section, matching the
parity FormatForAIContext already has after iters 4-7.

New test asserts the restart command and host bind-mount source reach the
remediation context; teeth-checked. Build + vet + gofmt clean, full
servicediscovery package green.
2026-06-07 13:03:32 +01:00
rcourtman af78b1431a Make Assistant startup status feel active 2026-06-07 13:00:53 +01:00
rcourtman 3fa33448a7 Render Docker bind mounts in the Discovery tab
The backend captures DockerMounts (and now surfaces them to the
assistant), but the human-facing DiscoveryTab showed config/data/log
paths and ports while dropping the host<->container bind mounts — so a
user could not see where a container path like /config actually lives on
the host to edit or back up files. Add docker_mounts to the frontend
ResourceDiscovery type and render a 'Bind Mounts' card (host source
copyable, '-> destination in container', read-only marker), consistent
with the Ports card.

Test renders an app-container discovery with a bind mount and asserts
the host source is visible. Type-check + full lint + prettier clean;
full suite green (2 pre-existing guardrail failures unrelated).
2026-06-07 12:55:56 +01:00
rcourtman 2440138858 Preserve Assistant tool identity on completion 2026-06-07 12:44:56 +01:00
rcourtman b3dc0d1573 Rank facts by actionability so the cap never drops service-control
Iter 5 added service+storage to the surfaced fact categories but the
context pack still capped at the first 5 facts by insertion order — so a
trailing service-control fact (how to restart the workload, the most
actionable one we just started capturing) could be silently dropped,
undermining iter 5-6.

Sort the priority facts by actionability (service > security >
dependency > hardware > version > storage, stable within category)
before capping, and raise the cap 5 -> 8 (still under the analyzer's
12-fact limit). The most useful facts now always survive.

Corpus: add a fact-heavy Frigate cell (6 priority facts, service-control
last). Filter test now asserts cap=8 and that a trailing service fact
sorts first and survives. Both teeth-checked. Full package green.
2026-06-07 12:39:04 +01:00
rcourtman 063fdbadee Keep Assistant persisted tools before answers 2026-06-07 12:36:34 +01:00
rcourtman bc864074d6 Ask the analyzer to capture service control + key files
Iterations 4-5 made the context pack SURFACE Docker mounts and
service/storage facts; this closes the CAPTURE side so the analyzer
actually produces them. The workload analysis prompt asked for config
dirs but never for how to restart/reload the service or the specific
files a user edits. Add: (q9) how the service is managed/restarted; an
instruction to put specific key files (configuration.yaml,
automations.yaml, postgresql.conf) in config_paths rather than just the
parent dir; and an instruction to record the service-control mechanism
as a 'service'-category fact. Directly serves the 'reload my automation'
case.

Test pins both instructions in the built deep prompt; teeth-checked.
Build + vet + gofmt clean, full servicediscovery package green.
2026-06-07 12:28:26 +01:00
rcourtman 93bf32dfcf Keep Assistant status rows event-scoped 2026-06-07 12:26:50 +01:00
rcourtman b216e38304 Surface service + storage facts in the AI context pack
filterImportantFacts kept only hardware/dependency/security/version
facts, dropping 'service' and 'storage'. But a service fact (e.g. the
systemd unit) is exactly how the Assistant restarts/reloads a workload,
and a storage fact (the backing dataset/disk) is where its data lives —
neither is redundant with the CLI/path sections, and both are what a
real question like 'the database is slow, restart it' needs. Add both to
the priority categories.

Corpus: add a postgresql LXC cell whose required context includes the
systemd unit and data filesystem. Teeth-checked — the case fails without
the filter change. Build + vet + gofmt clean, full servicediscovery
package green.
2026-06-07 12:19:02 +01:00
rcourtman 65cf18a8cf Pace Assistant activity dock updates 2026-06-07 12:13:33 +01:00
rcourtman a256742ab5 Surface Docker bind mounts in the AI context pack + seed Discovery scenario oracle
Two-part start of the Discovery->Assistant context-completeness work.

1. FormatForAIContext (the context pack Chat/Patrol consume) dropped
   DockerMounts, even though the model captures them. A container path
   like /config is meaningless for editing or backing up persistent files
   without its host source, so the Assistant could not act on a real
   request like 'edit my blinds automation on the host'. Surface the
   host -> container mapping (with read-only marker).

2. Add scenario_corpus_test.go — the verifiable oracle for the goal:
   given a realistic discovered workload, the context pack must surface
   everything the Assistant needs to answer a concrete user question with
   zero re-explanation. Seeded with Home Assistant (LXC: pct exec +
   automations.yaml + log; Docker: docker exec + bind-mount source). The
   corpus grows one service-type cell at a time; a missing substring is a
   concrete gap to close in the analyzer or formatter.

Teeth-checked: the Docker case fails without change #1. Build + vet clean,
full servicediscovery package green.
2026-06-07 12:09:27 +01:00
rcourtman 7675397b8f Tighten Assistant tool output badges 2026-06-07 12:01:46 +01:00
rcourtman 4aae6151ad Gate Discovery run actions on a configured provider
The tab-wide banner says 'configure a provider before scanning', yet all
four 'Run Discovery' affordances stayed clickable into a guaranteed
failure (discovery uses the AI to analyze evidence). Route every run
button through canTriggerDiscovery, now also requiring a configured
provider, so the action matches the banner. Command/connectivity gaps
are surfaced separately and intentionally not blocked here.

Tests: existing manual-run test configures a provider so its button
stays enabled; new test asserts the run action is disabled (and trigger
never fires) without a provider. Also hardened afterEach to reset
getDiscoveryInfo between tests — clearAllMocks does not reset
mockResolvedValue impls, so a provider mock would otherwise bleed into
later no-provider cases. Discovery 16/16, type-check + lint + prettier
clean; full suite 6018 pass (2 pre-existing guardrail failures).
2026-06-07 11:57:39 +01:00
rcourtman bc6ea8a8eb Tighten Assistant session picker keyboard ownership 2026-06-07 11:47:05 +01:00
rcourtman 36b291acc6 Tighten model picker keyboard ownership 2026-06-07 11:43:00 +01:00
rcourtman 9414e764b8 Surface Discovery provider prerequisite tab-wide
The AI-provider prerequisite only rendered inside the agent-only
connection-status trio, so opening Discovery on a VM/container with no
provider configured gave no hint the feature could not run — the
silently on-but-useless dead end. Promote it to a tab-wide banner driven
by the same canonical readiness verdict, styled to match the sibling
'disabled' banner, shown for every resource type. Remove the now-
redundant provider banner from the agent trio (which keeps commands ->
connectivity).

Test: new case asserts a non-agent resource surfaces the provider
prerequisite. Discovery 15/15, type-check + full lint clean; the 2
unrelated guardrail failures pre-exist on the branch.
2026-06-07 11:38:03 +01:00
rcourtman 8e1b1b803c Format DiscoveryTab condition (prettier)
Pure formatting: prettier collapses the readiness-trio Show condition to
a single line. No behavior change; follow-up to c2c5ce048 (eslint passed
at commit time but prettier format was not enforced by the hook).
2026-06-07 11:28:05 +01:00
rcourtman c2c5ce0488 Unify Discovery readiness onto a single verdict
Discovery re-derived its prerequisite state (disabled / provider /
commands / connectivity) ad hoc across surfaces, so the agent
connection-status banners could nag about commands while the more
fundamental gap — no AI provider configured — went unsaid.

Wire the (previously orphaned, unwired) computeDiscoveryReadiness module
in as the canonical verdict: useDiscoveryTabState now derives
aiProviderConfigured + a single discoveryReadiness memo, and the
DiscoveryTab connection-status block renders from readiness().status,
surfacing the most-fundamental missing prerequisite first. Adds the
missing needs_ai_provider banner. The green 'connected' banner stays
literal by design (the verdict treats unknown command state as ready).

Tests: existing command-state cases now configure a provider to reach
those states; new case asserts the provider prerequisite precedes
command guidance. Full frontend suite + type-check + lint green (the 2
unrelated guardrail failures pre-exist on the branch, proven via scoped
stash).
2026-06-07 11:25:19 +01:00
rcourtman 93420de157 Tighten Assistant prompt history boundaries 2026-06-07 11:23:58 +01:00
rcourtman 6eb51aab86 Show all Assistant slash commands 2026-06-07 11:05:14 +01:00
rcourtman 50d9fcd021 Add Assistant session compaction 2026-06-07 10:55:13 +01:00
rcourtman 8b46324277 Consolidate Assistant status rail 2026-06-07 10:22:17 +01:00
rcourtman 1fc36a790b Show Assistant context tools as activity rows 2026-06-07 10:02:29 +01:00
rcourtman 7618d46697 Add command palette keyboard selection 2026-06-07 09:42:57 +01:00
rcourtman 9022b01bc3 Improve Assistant queued follow-up keyboard handling 2026-06-07 09:25:28 +01:00
rcourtman fc24ac0aee Add Assistant queue-drain fixture 2026-06-07 09:12:46 +01:00
rcourtman 4974da7267 Fix Assistant completed tool status 2026-06-07 08:56:58 +01:00
rcourtman 67444c3fb9 Restore Assistant session model route 2026-06-07 08:43:10 +01:00
rcourtman e9aa084f6b Pause Assistant queued follow-ups on stop 2026-06-07 08:28:18 +01:00
rcourtman 18bf936ab6 Surface Assistant readiness route adoption 2026-06-07 08:15:46 +01:00
rcourtman c37c899e3e Surface Assistant fallback route adoption 2026-06-07 08:04:21 +01:00
rcourtman 427cf57df4 Dock Assistant activity above composer 2026-06-07 07:55:28 +01:00
rcourtman c12e044285 Promote queued Assistant follow-ups 2026-06-07 07:49:22 +01:00
rcourtman c5a4b6591a Group Assistant context tool activity 2026-06-07 07:35:23 +01:00
rcourtman 3395433210 Scope Assistant model recovery to provider failures 2026-06-07 07:14:40 +01:00
rcourtman 50c0b68adc Keep Assistant dev fixtures local 2026-06-07 07:04:49 +01:00
rcourtman acae3aae28 Show Assistant stream idle progress 2026-06-07 06:52:04 +01:00
rcourtman 2ca17bf184 Normalize Assistant answer tool identifiers 2026-06-07 06:43:07 +01:00
rcourtman 752aa979db Use operator summaries in Assistant context footer 2026-06-07 06:34:38 +01:00
rcourtman 89ff200fce Prioritize Assistant workflow status over route evidence 2026-06-07 06:28:38 +01:00
rcourtman 6e46dcbab0 Normalize Assistant workflow status labels 2026-06-07 06:19:10 +01:00
rcourtman 2a59f44dc0 Replace provisional Assistant model route rows 2026-06-07 06:09:50 +01:00
rcourtman 459ac0b1ee Improve Assistant autocomplete keyboard flow 2026-06-07 05:46:57 +01:00
rcourtman cb735105ab Improve Assistant model picker keyboard navigation 2026-06-07 05:39:51 +01:00
rcourtman bfe888b70b Add fast Assistant model route commands 2026-06-07 05:27:16 +01:00