Pulse/internal
rcourtman 3b6fc3ef31 Audit chat-package Chat/ChatStream callers for cost recording
The parent-package audit (TestCostRecordingCoverage in
internal/ai/cost_recording_audit_test.go) only walks
internal/ai/*.go — sub-packages were unguarded, which is the gap
that let the chat cost-recording bug land in the first place (the
agentic loop in internal/ai/chat/ called ChatStream without anyone
recording cost; fixed in a0b3bc7ed).

Adds a parallel audit at internal/ai/chat/cost_recording_audit_test.go
covering both .Chat() and .ChatStream() callers. Same shape as the
parent audit but extended to include the streaming variant, since
the chat package is built around the agentic loop's ChatStream
call site.

The chat package's orchestrator/loop split means recording lives
in chat.Service.recordChatTurnCost — the orchestrator that owns
the loop — rather than inside the loop methods that call
ChatStream. Two doc-comment exemptions cover that:
  - AgenticLoop.ExecuteWithTools / executeWithTools (agentic.go)
  - AgenticLoop.ensureFinalTextResponse (agentic_final.go)
Both name the orchestrator that records, so a future contributor
moving recording elsewhere has a clear pointer to update.

A new ChatStream caller added to the chat package without either
recording or an exemption marker will now fail this audit, the
same way the parent audit would have caught QuickAnalysis or
Narrate if they had been written without recording.
2026-05-11 09:16:26 +01:00
..
actionplanner Fail closed dry-run action execution 2026-05-05 09:22:04 +01:00
agentexec Align Patrol prober with agent command policy 2026-05-01 20:28:11 +01:00
agenttls Add fingerprint-pinned TLS mode for unified agent 2026-04-22 01:36:46 +01:00
agentupdate Harden unified agent runtime and installer 2026-04-23 23:04:18 +01:00
ai Audit chat-package Chat/ChatStream callers for cost recording 2026-05-11 09:16:26 +01:00
alerts Skip agent-sourced alerts in node-presence cleanup 2026-05-10 23:12:31 +01:00
api Record user-chat token usage to the cost ledger 2026-05-10 23:15:53 +01:00
bootstrap
cloudcp Remove monitored-system volume caps 2026-05-05 12:59:59 +01:00
config Keep direct DeepSeek Patrol models selectable 2026-05-08 11:57:04 +01:00
crypto Harden secure local key file handling 2026-04-22 05:13:01 +01:00
deploy Remove monitored-system volume caps 2026-05-05 12:59:59 +01:00
discovery
dockeragent Allow insecure dev HTTP agent runtime URLs 2026-04-23 13:48:54 +01:00
hostagent Fix PVE version detection on agent hosts 2026-05-08 15:30:08 +01:00
hosted Canonicalize legacy hosted signup principals 2026-05-04 22:52:00 +01:00
hostmetrics
kubernetesagent Allow insecure dev HTTP agent runtime URLs 2026-04-23 13:48:54 +01:00
license Remove monitored-system volume caps 2026-05-05 12:59:59 +01:00
logging
metrics
mock Drive agent host profiles from platform manifest 2026-05-07 23:42:15 +01:00
mockmode
mockmodel
mockruntime
models Fix platform identity source contracts 2026-05-08 14:54:08 +01:00
monitoring Mark failed PBS poll as failure and lock down with regression tests 2026-05-08 19:53:03 +01:00
notifications Fix notification queue race test 2026-05-01 22:26:01 +01:00
platformsupport Show platform versions in system badges 2026-05-08 15:07:09 +01:00
recovery
relay Fix RC3 backend release blockers 2026-05-01 21:36:28 +01:00
remoteconfig Allow insecure dev HTTP agent runtime URLs 2026-04-23 13:48:54 +01:00
repoctl Retire product upgrade metrics runtime 2026-04-30 12:24:22 +01:00
securityutil Allow insecure dev HTTP agent runtime URLs 2026-04-23 13:48:54 +01:00
sensors
servicediscovery Fix silent fingerprint loss for LXC and VMs 2026-05-10 20:31:46 +01:00
ssh/knownhosts
storagehealth Fix Unraid storage health explanations 2026-05-08 12:18:09 +01:00
system
telemetry
testutil
truenas
unifiedresources Merge duplicate map keys in TestActionExecutionContractStaysAPIOwned 2026-05-09 15:08:51 +01:00
updates Verify SSHSIG on in-app update artifacts 2026-05-09 23:14:07 +01:00
updatesignature Fix v6 demo release signing key deployment 2026-05-05 21:40:14 +01:00
utils
vmware
websocket Fix RC3 backend release blockers 2026-05-01 21:36:28 +01:00