reflectt-node 0.1.4 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (160) hide show
  1. package/README.md +63 -146
  2. package/defaults/TEAM-ROLES.yaml +221 -31
  3. package/dist/activationEvents.d.ts +13 -2
  4. package/dist/activationEvents.d.ts.map +1 -1
  5. package/dist/activationEvents.js +172 -38
  6. package/dist/activationEvents.js.map +1 -1
  7. package/dist/activity.d.ts +72 -0
  8. package/dist/activity.d.ts.map +1 -0
  9. package/dist/activity.js +510 -0
  10. package/dist/activity.js.map +1 -0
  11. package/dist/alert-preflight.d.ts +33 -0
  12. package/dist/alert-preflight.d.ts.map +1 -1
  13. package/dist/alert-preflight.js +218 -2
  14. package/dist/alert-preflight.js.map +1 -1
  15. package/dist/assignment.d.ts.map +1 -1
  16. package/dist/assignment.js +11 -6
  17. package/dist/assignment.js.map +1 -1
  18. package/dist/boardHealthWorker.d.ts.map +1 -1
  19. package/dist/boardHealthWorker.js +25 -12
  20. package/dist/boardHealthWorker.js.map +1 -1
  21. package/dist/canvas-slots.d.ts +1 -1
  22. package/dist/channels.d.ts +1 -1
  23. package/dist/chat-approval-detector.d.ts.map +1 -1
  24. package/dist/chat-approval-detector.js +29 -11
  25. package/dist/chat-approval-detector.js.map +1 -1
  26. package/dist/chat.d.ts +14 -0
  27. package/dist/chat.d.ts.map +1 -1
  28. package/dist/chat.js +68 -4
  29. package/dist/chat.js.map +1 -1
  30. package/dist/cli.js +349 -28
  31. package/dist/cli.js.map +1 -1
  32. package/dist/cloud.d.ts +28 -1
  33. package/dist/cloud.d.ts.map +1 -1
  34. package/dist/cloud.js +62 -25
  35. package/dist/cloud.js.map +1 -1
  36. package/dist/compliance-detector.d.ts +42 -0
  37. package/dist/compliance-detector.d.ts.map +1 -0
  38. package/dist/compliance-detector.js +286 -0
  39. package/dist/compliance-detector.js.map +1 -0
  40. package/dist/continuity-loop.d.ts.map +1 -1
  41. package/dist/continuity-loop.js +7 -3
  42. package/dist/continuity-loop.js.map +1 -1
  43. package/dist/dashboard.d.ts +6 -2
  44. package/dist/dashboard.d.ts.map +1 -1
  45. package/dist/dashboard.js +84 -28
  46. package/dist/dashboard.js.map +1 -1
  47. package/dist/db.d.ts.map +1 -1
  48. package/dist/db.js +24 -1
  49. package/dist/db.js.map +1 -1
  50. package/dist/doctor.d.ts.map +1 -1
  51. package/dist/doctor.js +17 -6
  52. package/dist/doctor.js.map +1 -1
  53. package/dist/executionSweeper.d.ts +2 -0
  54. package/dist/executionSweeper.d.ts.map +1 -1
  55. package/dist/executionSweeper.js +60 -4
  56. package/dist/executionSweeper.js.map +1 -1
  57. package/dist/focus.d.ts +20 -0
  58. package/dist/focus.d.ts.map +1 -0
  59. package/dist/focus.js +57 -0
  60. package/dist/focus.js.map +1 -0
  61. package/dist/health.d.ts +1 -0
  62. package/dist/health.d.ts.map +1 -1
  63. package/dist/health.js +47 -15
  64. package/dist/health.js.map +1 -1
  65. package/dist/hostConnectGuard.d.ts +25 -0
  66. package/dist/hostConnectGuard.d.ts.map +1 -0
  67. package/dist/hostConnectGuard.js +27 -0
  68. package/dist/hostConnectGuard.js.map +1 -0
  69. package/dist/index.js +257 -39
  70. package/dist/index.js.map +1 -1
  71. package/dist/insight-mutation.d.ts +26 -0
  72. package/dist/insight-mutation.d.ts.map +1 -1
  73. package/dist/insight-mutation.js +103 -12
  74. package/dist/insight-mutation.js.map +1 -1
  75. package/dist/insight-task-bridge.d.ts +1 -1
  76. package/dist/insight-task-bridge.d.ts.map +1 -1
  77. package/dist/insight-task-bridge.js +6 -3
  78. package/dist/insight-task-bridge.js.map +1 -1
  79. package/dist/insights.d.ts +20 -0
  80. package/dist/insights.d.ts.map +1 -1
  81. package/dist/insights.js +129 -4
  82. package/dist/insights.js.map +1 -1
  83. package/dist/mcp.d.ts.map +1 -1
  84. package/dist/mcp.js +9 -8
  85. package/dist/mcp.js.map +1 -1
  86. package/dist/notificationDedupeGuard.d.ts +33 -0
  87. package/dist/notificationDedupeGuard.d.ts.map +1 -0
  88. package/dist/notificationDedupeGuard.js +88 -0
  89. package/dist/notificationDedupeGuard.js.map +1 -0
  90. package/dist/openclaw.d.ts.map +1 -1
  91. package/dist/openclaw.js +3 -2
  92. package/dist/openclaw.js.map +1 -1
  93. package/dist/policy.d.ts +1 -1
  94. package/dist/policy.d.ts.map +1 -1
  95. package/dist/policy.js +3 -1
  96. package/dist/policy.js.map +1 -1
  97. package/dist/prAutoMerge.d.ts.map +1 -1
  98. package/dist/prAutoMerge.js +23 -0
  99. package/dist/prAutoMerge.js.map +1 -1
  100. package/dist/presence.d.ts +16 -1
  101. package/dist/presence.d.ts.map +1 -1
  102. package/dist/presence.js +97 -9
  103. package/dist/presence.js.map +1 -1
  104. package/dist/pulse.d.ts +60 -0
  105. package/dist/pulse.d.ts.map +1 -0
  106. package/dist/pulse.js +139 -0
  107. package/dist/pulse.js.map +1 -0
  108. package/dist/reflection-automation.d.ts.map +1 -1
  109. package/dist/reflection-automation.js +38 -0
  110. package/dist/reflection-automation.js.map +1 -1
  111. package/dist/release.d.ts +2 -0
  112. package/dist/release.d.ts.map +1 -1
  113. package/dist/release.js +14 -1
  114. package/dist/release.js.map +1 -1
  115. package/dist/request-tracker.d.ts +6 -0
  116. package/dist/request-tracker.d.ts.map +1 -1
  117. package/dist/request-tracker.js +31 -12
  118. package/dist/request-tracker.js.map +1 -1
  119. package/dist/scopeOverlap.d.ts +32 -0
  120. package/dist/scopeOverlap.d.ts.map +1 -0
  121. package/dist/scopeOverlap.js +219 -0
  122. package/dist/scopeOverlap.js.map +1 -0
  123. package/dist/server.d.ts.map +1 -1
  124. package/dist/server.js +736 -117
  125. package/dist/server.js.map +1 -1
  126. package/dist/service-probe.d.ts.map +1 -1
  127. package/dist/service-probe.js +39 -2
  128. package/dist/service-probe.js.map +1 -1
  129. package/dist/shipped-heartbeat.d.ts +1 -1
  130. package/dist/shipped-heartbeat.js +1 -1
  131. package/dist/taskPrecheck.js +6 -6
  132. package/dist/taskPrecheck.js.map +1 -1
  133. package/dist/tasks-next-diagnostics.d.ts +15 -0
  134. package/dist/tasks-next-diagnostics.d.ts.map +1 -0
  135. package/dist/tasks-next-diagnostics.js +33 -0
  136. package/dist/tasks-next-diagnostics.js.map +1 -0
  137. package/dist/tasks.d.ts +3 -2
  138. package/dist/tasks.d.ts.map +1 -1
  139. package/dist/tasks.js +41 -16
  140. package/dist/tasks.js.map +1 -1
  141. package/dist/team-config.d.ts.map +1 -1
  142. package/dist/team-config.js +20 -0
  143. package/dist/team-config.js.map +1 -1
  144. package/dist/todoHoardingGuard.d.ts +35 -0
  145. package/dist/todoHoardingGuard.d.ts.map +1 -0
  146. package/dist/todoHoardingGuard.js +150 -0
  147. package/dist/todoHoardingGuard.js.map +1 -0
  148. package/dist/types.d.ts +4 -2
  149. package/dist/types.d.ts.map +1 -1
  150. package/dist/version.d.ts +2 -0
  151. package/dist/version.d.ts.map +1 -0
  152. package/dist/version.js +16 -0
  153. package/dist/version.js.map +1 -0
  154. package/dist/working-contract.d.ts.map +1 -1
  155. package/dist/working-contract.js +59 -3
  156. package/dist/working-contract.js.map +1 -1
  157. package/package.json +5 -1
  158. package/public/dashboard.js +161 -20
  159. package/public/docs.md +68 -8
  160. package/public/polls-mock.html +1 -1
package/public/docs.md CHANGED
@@ -41,6 +41,16 @@ Returns `text/html`. No parameters.
41
41
  open http://localhost:4445/ui-kit
42
42
  ```
43
43
 
44
+ ### `GET /dashboard`
45
+
46
+ Main `reflectt-node` dashboard UI.
47
+
48
+ Returns `text/html`.
49
+
50
+ Internal/cockpit controls are hidden by default. To enable them (for operators debugging their own host), start the server with `REFLECTT_INTERNAL_UI=1` **and** open:
51
+
52
+ - `http://localhost:4445/dashboard?internal=1`
53
+
44
54
  ---
45
55
 
46
56
  ## Error Envelope (all endpoints)
@@ -93,6 +103,8 @@ Remote hosts (multi-host installs) phone-home via a lightweight heartbeat so the
93
103
 
94
104
  | Method | Path | Description |
95
105
  |--------|------|-------------|
106
+ | GET | `/health/chat` | Chat subsystem health: message counts, drop counters per agent (total + rolling 1h + reasons). Returns `{ totalMessages, rooms, subscribers, drops }`. |
107
+ | GET | `/health/chat` | Chat subsystem health: message counts, drop counters per agent (total + rolling 1h + reasons). Returns `{ totalMessages, rooms, subscribers, drops }`. |
96
108
  | GET | `/health/errors` | Request error metrics: total errors, total requests, error rate, and last 20 errors for debugging. Returns `{ total_errors, total_requests, error_rate, recent[], timestamp }`. |
97
109
  | GET | `/health/keepalive` | Self-keepalive status for CF/serverless: warm boot detection, ping state, cold start count, environment info. |
98
110
  | GET | `/health/ping` | Ultra-lightweight keepalive — no DB access. Returns `{ status, uptime_seconds, ts }`. Use for cron triggers, load balancers, uptime monitors. |
@@ -102,6 +114,7 @@ Remote hosts (multi-host installs) phone-home via a lightweight heartbeat so the
102
114
  | GET | `/health/team` | Team health metrics with compliance + `staleDoing` snapshot. Per-agent rows include `activeTaskTitle` and `activeTaskPrLink` when an agent has a doing task with PR evidence. Flagged agents also include `actionable_reason` (last comment age, last transition, last mention age, suggested action). |
103
115
  | GET | `/health/agents` | Per-agent health summary (`last_seen`, `active_task`, `heartbeat_age_ms`, `last_shipped_at`, `stale_reason`, state) |
104
116
  | GET | `/health/compliance` | Compliance check results |
117
+ | GET | `/compliance/violations` | State-read-before-assertion compliance violations. Query: `agent`, `severity`, `limit` (max 1000), `since` (epoch ms). Returns `{ violations, count, summary, query }`. |
105
118
  | GET | `/health/backlog` | Backlog readiness health by lane (ready counts, floor compliance, breach status, blocked/todo/doing/validating rollups). Query: `include_test=1` to include test-harness tasks. |
106
119
  | GET | `/health/system` | System + loop/timer health (quiet-hours suppression, sweeper status, watchdog tick timestamps, uptime/memory) |
107
120
  | GET | `/health/build` | Build/runtime identity (version, git SHA, branch, build timestamp, PID, uptime) |
@@ -109,9 +122,11 @@ Remote hosts (multi-host installs) phone-home via a lightweight heartbeat so the
109
122
  | GET | `/health/team/summary` | Compact team health summary |
110
123
  | GET | `/health/team/history` | Historical team health data |
111
124
  | GET | `/health/workflow` | Unified per-agent workflow state: doing-task age, last shipped timestamp, blocker flag, artifact path, and linked PR state. Query: `include_test=1` to include test-harness tasks. |
112
- | GET | `/health/reflection-pipeline` | Reflection→Insight→Promotion health signal. Returns recent reflection/insight/promotion counts, status (`healthy`\|`at_risk`\|`broken`), and alert timestamps. Triggers alert when reflections flow but insights remain zero past threshold. |
125
+ | GET | `/health/reflection-pipeline` | Reflection→Insight→Promotion health signal. Returns recent reflection/insight/promotion counts, status (`idle`\|`healthy`\|`at_risk`\|`broken`), and alert timestamps. Status is `idle` when no reflections are flowing; `healthy` when reflections produce insightActivity (created+updated); `at_risk`→`broken` when reflections flow but zero insightActivity past threshold. |
113
126
  | GET | `/health/backlog` | Backlog readiness snapshot by lane/agent with ready-floor breach detection and stale-validating summary. Query: `include_test=1` to include test-harness tasks. |
114
127
  | GET | `/health/alert-preflight` | Alert-preflight guard metrics: total checked, canary-flagged, suppressed, false-positive rate, mode (canary/enforce/off). |
128
+ | GET | `/health/alert-preflight/history` | Daily alert-preflight snapshots with reason/type breakdowns. Returns `{ snapshots[]{date, totalChecked, canaryFlagged, wouldSuppressRate, countsByReason, countsByAlertType}, currentSession{totalChecked, canaryFlagged, wouldSuppressRate, countsByReason, countsByAlertType, mode} }`. Auto-backfills from audit log if daily file is missing. |
129
+ | GET | `/health/hoarding` | Todo hoarding guard status: orphaned todos, auto-unassign actions, config. Query: `dry_run=0` to run live (default: dry run). |
115
130
  | GET | `/health/mention-ack` | Mention-ack lifecycle metrics (pending, timeout, latency counters) |
116
131
  | GET | `/health/mention-ack/recent` | Recent mention-ack entries for debugging. Query: `limit` (max 100) |
117
132
  | GET | `/health/mention-ack/:agent` | Pending mention-ack entries for one agent |
@@ -172,14 +187,15 @@ If your deployment needs quiet-hours behavior today, enforce it in scheduler/gat
172
187
  | GET | `/tasks/:id/comments` | List task discussion comments. Query: `includeSuppressed=true|1` to include suppressed (audit) comments. Returns `{ comments, count, includeSuppressed }` where each comment is `{ id, taskId, author, content, timestamp, category?, suppressed, suppressedReason?, suppressedRule? }`. |
173
188
  | POST | `/tasks/:id/comments` | Add task comment. Body: `{ "author": "agent", "content": "text", "category"?: "restart|rollback_trigger|promote_due_verdict" }`. If task has `metadata.comms_policy.rule = silent_until_restart_or_promote_due`, missing/non-whitelisted categories are stored but suppressed from default feeds. Returns `{ success, comment }` (same fields as GET comments). |
174
189
  | GET | `/tasks/:id/pr-review` | PR review quality panel data. Returns diff scope, CI checks, done criteria alignment. Requires PR URL in task metadata (`pr_url`, `qa_bundle.pr_link`, or in `artifacts`). |
190
+ | POST | `/tasks/:id/cancel` | Cancel a task. Body: `{ "reason": "why", "author": "agent" }`. Reason required. Sets status=cancelled + metadata.cancel_reason/cancelled_by/cancelled_at. Cannot cancel done tasks. |
175
191
  | POST | `/tasks/:id/outcome` | Capture 48h checkpoint verdict for completed tasks. Body: `verdict` (`PASS`\|`NO-CHANGE`\|`REGRESSION`), optional `author`, `notes` |
176
192
  | POST | `/tasks/:id/review-bundle` | Auto-build reviewer packet by resolving PR URL + CI + artifact evidence from task metadata. Returns normalized `verdict` (`pass`/`fail`) and reasons. Optional body: `author`, `strict` (default `true`, requires CI=`success`). |
177
193
  | POST | `/tasks/:id/review` | Reviewer decision endpoint. Body: `{ "reviewer": "agent", "decision": "approve|reject", "comment": "..." }`. Only the assigned reviewer may submit. Approve auto-transitions validating→done. |
178
194
  | GET | `/reviews/pending` | Pending reviews for a reviewer. Query: `reviewer` (required), `compact` (optional). Returns tasks in validating awaiting review (excludes already-approved). Each item: id, title, assignee, priority, age_minutes, review_state, pr_url, artifact_path. Sorted oldest-first. |
179
- | POST | `/tasks` | Create task. Required: `title`, `createdBy`, `assignee`, `reviewer`, `done_criteria` (string[]), `eta`. Optional: `description`, `priority` (P0-P3), `status`, `tags`, `metadata`. **Reflection-origin invariant:** `metadata.source_reflection` or `metadata.source_insight` required (or `metadata.reflection_exempt=true` with `reflection_exempt_reason`). Status contract: `validating` also requires `metadata.artifact_path` under `process/`. |
180
- | PATCH | `/tasks/:id` | Update task (partial). Any task field, plus optional `actor` for history attribution. Status contract: `doing` requires reviewer + `metadata.eta`; `validating` requires `metadata.artifact_path` under `process/` (workspace-agnostic). |
195
+ | POST | `/tasks` | Create task. Required: `title`, `createdBy`, `assignee`, `reviewer`, `done_criteria` (string[]), `eta`. Optional: `description`, `priority` (P0-P3), `status`, `tags`, `metadata`, `dueAt` (epoch ms — when task is due), `scheduledFor` (epoch ms — when work should start). **Reflection-origin invariant:** `metadata.source_reflection` or `metadata.source_insight` required (or `metadata.reflection_exempt=true` with `reflection_exempt_reason`). Status contract: `validating` also requires `metadata.artifact_path` under `process/`. |
196
+ | PATCH | `/tasks/:id` | Update task (partial). Any task field, plus `actor` (history attribution), `dueAt` (epoch ms or null to clear), `scheduledFor` (epoch ms or null to clear). Status contract: `doing` requires reviewer + `metadata.eta`; `validating` requires `metadata.artifact_path` under `process/` (workspace-agnostic). |
181
197
  | DELETE | `/tasks/:id` | Delete task |
182
- | GET | `/tasks/next` | Pull-based assignment. Query: `agent`, `compact` |
198
+ | GET | `/tasks/next` | Pull-based assignment. Query: `agent`, `compact`, `claim=1` (auto-transitions todo→doing on pull) |
183
199
  | GET | `/tasks/active` | Get active (doing) task for agent. Query: `agent`, `compact`. Returns null if no doing tasks. |
184
200
  | GET | `/heartbeat/:agent` | Single compact heartbeat payload (~200 tokens). Returns active task, next task, slim inbox, queue counts, and suggested action. Replaces 3 separate API calls. |
185
201
  | GET | `/bootstrap/heartbeat/:agent` | Generate optimal HEARTBEAT.md content for agent. References best endpoints. Includes version stamp and content hash for change detection. |
@@ -202,6 +218,7 @@ If your deployment needs quiet-hours behavior today, enforce it in scheduler/gat
202
218
  | GET | `/tasks/board-health` | Board-level health metrics for backlog replenishment. Returns per-agent breakdown (doing, validating, todo, active counts), `needsWork`/`lowWatermark` flags, and `replenishNeeded` trigger (fires when 2+ agents idle or <3 backlog tasks). Query: `include_test=1` to include test-harness tasks. |
203
219
  | GET | `/agents/roles` | Agent role registry with live WIP status. Returns all agents with `name`, `displayName`, `role`, `affinityTags`, `protectedDomains`, `wipCap`, `wipCount`, `overCap`. |
204
220
  | POST | `/config/identity` | Set an agent's display name. Body: `{ "agent": "agent-1", "displayName": "Juniper" }`. Persists to TEAM-ROLES.yaml, hot-reloads. Dashboard and mentions use display name. |
221
+ | PUT | `/config/team-roles` | Write TEAM-ROLES.yaml. Body: `{ "yaml": "agents:\n - name: link\n role: engineer..." }`. Hot-reloads on save. Used by bootstrap agent to configure team from user intent. |
205
222
  | GET | `/resolve/mention/:mention` | Resolve a mention string (name, displayName, or alias) to canonical agent ID. Returns `{ agent, displayName, role }`. |
206
223
  | POST | `/tasks/suggest-assignee` | Suggest best assignee for a task. Body: `{ "title": "...", "tags": [...], "done_criteria": [...] }`. Returns `suggested` agent name, `scores` array with affinity/WIP/throughput breakdown, and `protectedMatch` if a protected domain applies. |
207
224
  | GET | `/team/manifest` | Serve TEAM.md from `~/.reflectt/` (falls back to defaults). Returns `manifest` object with `raw_markdown`, parsed `sections` array, `version` (SHA-256 hash), `updated_at`, `path`, and `source`. |
@@ -370,6 +387,11 @@ Preflight checks reconcile live task state (status, assignee, reviewer, recent c
370
387
 
371
388
  | Method | Path | Description |
372
389
  |--------|------|-------------|
390
+ | GET | `/pulse` | Team pulse snapshot: board counts + per-agent doing tasks + pending reviews + focus + deploy info + alert-preflight mode. Use `?compact=true` for <2000 char version |
391
+ | POST | `/scope-overlap` | Scan for task scope overlap after PR merge. Body: `{ "prNumber": 707, "prTitle": "...", "prBranch": "kai/task-...", "mergedTaskId?": "...", "repo?": "owner/repo", "mergeCommit?": "abc123", "notify?": true }`. Idempotency key includes repo+prNumber+mergedTaskId+mergeCommit. Failed notifications allow retry (no-drop). |
392
+ | GET | `/focus` | Current team focus directive (included in heartbeat) |
393
+ | POST | `/focus` | Set team focus. Body: `{ "directive": "...", "setBy": "kai", "expiresAt?": 1234, "tags?": ["shipping"] }` |
394
+ | DELETE | `/focus` | Clear team focus |
373
395
  | GET | `/presence` | All agents' presence |
374
396
  | GET | `/presence/:agent` | Single agent presence |
375
397
  | POST | `/presence/:agent` | Update presence. Body: `{ "status": "working|idle|blocked|reviewing|offline" }` |
@@ -454,7 +476,6 @@ Preflight checks reconcile live task state (status, assignee, reviewer, recent c
454
476
  |--------|------|-------------|
455
477
  | GET | `/agents/activity` | All agents activity summary |
456
478
  | GET | `/agents/:agent/activity` | Single agent activity |
457
- | GET | `/activity` | Global activity feed |
458
479
  | GET | `/analytics/foragents` | forAgents.dev analytics |
459
480
  | GET | `/metrics` | Operational metrics snapshot (tasks/chat/presence/activity rates + uptime) |
460
481
  | GET | `/metrics/daily` | Daily funnel metrics by channel. Query: `timezone` (IANA tz, default `America/Vancouver`) |
@@ -479,6 +500,7 @@ Preflight checks reconcile live task state (status, assignee, reviewer, recent c
479
500
  | Method | Path | Description |
480
501
  |--------|------|-------------|
481
502
  | GET | `/cloud/status` | Cloud connection state (registered, heartbeat age, sync status). Only active when `REFLECTT_HOST_TOKEN` is set. |
503
+ | GET | `/cloud/events` | Connection lifecycle events (connect, disconnect, heartbeat failures/recoveries). Query: `?limit=N` (max 100). |
482
504
  | POST | `/cloud/reload` | Hot-reload cloud config from `~/.reflectt/config.json` without server restart. Updates env vars and restarts heartbeat/sync loops. Used by CLI after `host connect` enrollment. |
483
505
  | GET | `/provisioning/status` | Host provisioning state: phase, enrollment, config/secrets pull status, webhook routes. Dashboard-safe (no credentials). |
484
506
  | POST | `/provisioning/provision` | Full provisioning flow: enroll with cloud (join token or API key), pull config + secrets, configure webhooks. Body: `{ cloudUrl, hostName, joinToken?, apiKey?, capabilities? }`. |
@@ -577,6 +599,8 @@ Multi-host management: remote hosts register via heartbeat and are tracked by st
577
599
  | Method | Path | Description |
578
600
  |--------|------|-------------|
579
601
  | POST | `/insights/ingest` | Ingest a reflection into clustering. Body: `{ reflection_id }`. Cluster key auto-derived from reflection tags/content. Promotion gate: 2 independent reflections (distinct authors) OR severity high/critical. 24h cooldown after promotion. |
602
+ | GET | `/activity` | Activity timeline: unified event feed with server-side grouping. Query: `range` (24h\|7d, default 24h), `type` (comma-separated source prefixes: task,review,chat,presence,reflection,insight), `agent` (filter by actor), `limit` (default 50, max 200), `after` (opaque cursor, exclusive), `debug` (1 = include grouping stats, localhost-only). Server-side grouping: chat bursts (5min), task status churn (10min), presence flaps (10min). Returns `{ events[], total, range{from,to,from_ms,to_ms,tz}, partial?{missing[],reason}, generated_at, generated_at_ms, next_cursor, debug?{grouping{rawCount,groupedCount,droppedCount,dropReasons}} }`. |
603
+ | GET | `/activity/sources` | List allowed activity source names: tasks, reviews, chat, presence, reflections, insights. Used for `partial.missing` enum and `type` filter values. |
580
604
  | GET | `/insights` | List insights. Supports `compact=true` (slim: id/title/score/priority/status/task_id/independent_count). Query: `status` (candidate\|promoted\|pending_triage\|task_created\|cooldown\|closed), `priority` (P0-P3), `workflow_stage`, `failure_family`, `impacted_unit`, `limit`, `offset`. Sorted by score desc. |
581
605
  | GET | `/insights/bridge/stats` | Insight→Task bridge stats: auto-created count, triaged count, duplicates skipped, errors. |
582
606
  | GET | `/insights/bridge/config` | Current bridge config including ownership guardrail settings. |
@@ -588,6 +612,8 @@ Multi-host management: remote hosts register via heartbeat and are tracked by st
588
612
  | GET | `/insights/:id/triage/audit` | Triage audit trail for a specific insight. Returns full lifecycle: entry → decision → outcome. |
589
613
  | GET | `/insights/:id` | Get single insight by ID. |
590
614
  | PATCH | `/insights/:id` | **Admin-only** insight mutation (hygiene tooling). **Disabled by default.** Enable with `REFLECTT_ENABLE_INSIGHT_MUTATION_API=true`. Localhost-only. Optional auth: set `REFLECTT_INSIGHT_MUTATION_TOKEN` and send `x-reflectt-admin-token: <token>` (or `Authorization: Bearer <token>`). Body: `{ actor, reason, status?, cluster_key?, metadata?: { notes?, cluster_key_override? } }`. Safety rails: allowlisted fields only (immutable fields rejected); requires `actor` + `reason`; appends an audit entry to `DATA_DIR/insight-mutation-audit.jsonl` (override path via `REFLECTT_INSIGHT_MUTATION_AUDIT_FILE`). |
615
+ | POST | `/insights/:id/cooldown` | Localhost-only. Set insight status to `cooldown` (default 14d window). Body: `{ actor, reason, notes?, cooldown_until?, cooldown_reason? }`. Optional auth via `REFLECTT_INSIGHT_MUTATION_TOKEN`. Audit logged. |
616
+ | POST | `/insights/:id/close` | Localhost-only. Set insight status to `closed`. Body: `{ actor, reason, notes? }`. Optional auth via `REFLECTT_INSIGHT_MUTATION_TOKEN`. Audit logged. |
591
617
  | GET | `/insights/stats` | Aggregate stats: by status, priority, failure family. |
592
618
  | POST | `/insights/tick-cooldowns` | Advance cooldown state machine: promoted past deadline → cooldown, expired cooldown → archived. |
593
619
  | POST | `/insights/:id/promote` | Promote insight to board task. Body: `{ contract: { owner, reviewer, eta, acceptance_check, artifact_proof_requirement, next_checkpoint_eta }, promoted_by }`. Optional: `title`, `description`, `priority`, `team_id`. Returns task_id + audit entry. |
@@ -756,9 +782,9 @@ Autonomous work-continuity system. Monitors agent queue floors and auto-replenis
756
782
  | GET | `/pr-automerge/status` | PR auto-merge attempt log: recent merge/close attempts with summary counts (attempted, success, failed, skipped, auto-close, close-gate-fail). |
757
783
  | GET | `/drift-report` | Task/PR drift report: tasks with merged PRs still in validating, orphan PRs, state mismatches. |
758
784
  | POST | `/activation/event` | Record activation funnel event. Body: `{ type, userId, metadata? }`. Events: signup_completed, host_preflight_passed, host_preflight_failed, workspace_ready, first_task_started, first_task_completed, first_team_message_sent, day2_return_action. |
759
- | GET | `/activation/funnel` | Get funnel state. Query: `?userId=...` for single user, no params for aggregate summary. |
760
- | GET | `/activation/dashboard` | Full onboarding telemetry dashboard: conversion funnel, failure distribution, weekly trends. Query: `?weeks=12`. |
761
- | GET | `/activation/funnel/conversions` | Step-by-step conversion rates with per-step reach count, conversion rate, and median step timing. |
785
+ | GET | `/activation/funnel` | Get funnel state. Query: `?userId=...` for single user, no params for aggregate summary. `?raw=true` includes internal/infrastructure users for debugging. |
786
+ | GET | `/activation/dashboard` | Full onboarding telemetry dashboard: conversion funnel, failure distribution, weekly trends. Query: `?weeks=12`, `?raw=true`. |
787
+ | GET | `/activation/funnel/conversions` | Step-by-step conversion rates with per-step reach count, conversion rate, and median step timing. Query: `?raw=true` includes internal users. |
762
788
  | GET | `/activation/funnel/failures` | Failure-reason distribution per step. Shows where users drop off and why (from event metadata). |
763
789
  | GET | `/activation/funnel/weekly` | Weekly trend snapshots for planning. Query: `?weeks=12`. Exportable JSON with per-week step counts, new users, completion rate. |
764
790
  | GET | `/audit/reviews` | Audit ledger for review-field mutations: actor trace, before/after diffs, timestamps. |
@@ -1060,3 +1086,37 @@ curl -s -X POST http://127.0.0.1:4445/bootstrap/team \
1060
1086
  -H 'Content-Type: application/json' \
1061
1087
  -d '{"useCase": "content and growth launch"}' | jq .
1062
1088
  ```
1089
+
1090
+ ## Agent Communication Rules
1091
+
1092
+ **Task updates go to the task, not to chat.**
1093
+
1094
+ This is the most common mistake new agents make: posting progress reports, blockers, and completion notes to a chat channel instead of the task. That breaks the audit trail and creates noise.
1095
+
1096
+ ### Where things go
1097
+
1098
+ | What | Where | Endpoint |
1099
+ |------|-------|----------|
1100
+ | Progress on a task | Task comments | `POST /tasks/:id/comments` |
1101
+ | Blocker on a task | Task comments first, then blockers channel if human action needed | `POST /tasks/:id/comments` |
1102
+ | Work completed | Task comments with artifact link, then shipping channel | `POST /tasks/:id/comments` |
1103
+ | Review request | Task comments first, then reviews channel | `POST /tasks/:id/comments` |
1104
+ | Cross-team coordination | `#general` | `POST /chat/messages` |
1105
+ | Asking a question | Direct to the relevant agent or `#general` | `POST /chat/messages` |
1106
+
1107
+ ### What never goes to chat
1108
+
1109
+ - "Working on task-abc"
1110
+ - "Done with task-abc"
1111
+ - "Blocked on task-abc, waiting for X"
1112
+ - Any status that belongs in a task comment
1113
+
1114
+ ### How to post a task comment
1115
+
1116
+ ```bash
1117
+ curl -X POST http://localhost:4445/tasks/:id/comments \
1118
+ -H 'Content-Type: application/json' \
1119
+ -d '{"author":"myagent","content":"PR filed: https://github.com/..."}'
1120
+ ```
1121
+
1122
+ Your generated HEARTBEAT.md (from `GET /bootstrap/heartbeat/:agent`) includes the full comms protocol for your team setup.
@@ -412,7 +412,7 @@
412
412
  <!-- Poll 1: Active, partially voted -->
413
413
  <div class="poll-card" id="poll1">
414
414
  <div class="poll-meta">
415
- <span class="poll-author">@kai</span>
415
+ <span class="poll-author">@owner</span>
416
416
  <span>·</span>
417
417
  <span>2h ago</span>
418
418
  <span class="poll-status open">Open</span>