feat: live per-agent terminal activity with real scripts/SQL

Agent terminals were idle (one-shot probe) while agents were busy in the
background. Now every agent streams what it is actually doing:

- agent_terminal: emit_threadsafe() so background threads can stream lines.
- agent_ops: Data Custodian DML loop logs the real INSERT/UPDATE/DELETE SQL
  (+ Mongo ops) and Hadoop-offload Trino CTAS/INSERT to its terminal; ETL
  Guardian announces each orchestrated movement.
- movements: trigger_and_watch streams the Airflow DAG / API call, conf,
  before/after Trino counts and result to the owning agent terminal.
- etl_offload: per-dataset read + pyarrow->S3 parquet writes and cycle
  summaries stream to the ETL Guardian terminal.
- agent_activity (new): round-robin live probes for Lakehouse Ops, Hadoop
  Ranger (NameNode JMX + YARN), Infra Sentinel (Dockhand inventory + host
  load) and Network Watcher (VLAN 20/21 path checks).
- fix: YARN ResourceManager runs on 10.0.21.62:8088 (was .61).
- ui: terminal dock merges the selected agent ops stream with the node probe.
This commit is contained in:
mo
2026-06-29 12:54:46 +00:00
parent b6d7d3dc74
commit 1e2cfe80f2
9 changed files with 388 additions and 52 deletions
+16 -1
View File
@@ -313,7 +313,22 @@ export function useCommandCenter() {
const inspectorLines = useMemo(() => {
if (!terminalSubjectId) return []
const probeId = resolveProbeId(terminalSubjectId)
return terminals[probeId] || terminals[terminalSubjectId] || terminals[selectedAgentId || ''] || []
const nodeLines = terminals[probeId] || terminals[terminalSubjectId] || []
const agentLines = selectedAgentId ? terminals[selectedAgentId] || [] : []
// When an agent is selected we also show its own autonomous ops stream
// (DML/ETL/probes) merged chronologically with the node probe output, so
// the terminal reflects what the agent is doing in the background — not just
// a one-shot probe.
if (!agentLines.length) return nodeLines
if (!nodeLines.length) return agentLines
const seen = new Set<string>()
const merged = [...nodeLines, ...agentLines].filter((l) => {
if (seen.has(l.id)) return false
seen.add(l.id)
return true
})
merged.sort((a, b) => ((a.ts || '') < (b.ts || '') ? -1 : (a.ts || '') > (b.ts || '') ? 1 : 0))
return merged.slice(-300)
}, [terminalSubjectId, terminals, selectedAgentId])
const focusApprovals = useCallback(() => {