Commit Graph

7111 Commits

Author SHA1 Message Date
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
rcourtman caf1e4afe5 Make live Assistant tool evidence inspectable 2026-06-07 05:16:28 +01:00
rcourtman b8ad2ae1af Make skipped Assistant tool evidence inspectable 2026-06-07 05:03:25 +01:00
rcourtman ab2e2bc69c Show live Assistant retry countdowns 2026-06-07 04:49:59 +01:00
rcourtman 59e23a8030 Bound Assistant fallback startup latency 2026-06-07 04:33:37 +01:00
rcourtman 0ec94e6f6a Pace fast Assistant tool completions 2026-06-07 04:20:25 +01:00
rcourtman eda53f0b1a Suppress compacted Assistant artifact text 2026-06-07 04:09:45 +01:00
rcourtman b04a7f5938 Show skipped Assistant tools in transcript 2026-06-07 03:59:52 +01:00
rcourtman 52c6f0b60b Show Assistant selected model at turn start 2026-06-07 03:44:44 +01:00
rcourtman 3b6ab98616 Add Assistant tool detail copy actions 2026-06-07 03:30:30 +01:00
rcourtman 4412763489 Show hidden Assistant tool output metadata 2026-06-07 03:14:32 +01:00