v1 intake: Pulse posts become ledger items + dispatched kanban tasks

- new top-level non-bridge posts in the activity channel -> shre-items
  pipeline item (tag pulse-intake) + hermes kanban task (idempotency-key
  pulse-<post id>, created-by pulse-bridge) + ack comment
- outbound dedupe: ledger->post map seeded with the user's post id before
  the op:add hits the feed, so the mirror adopts the post
- status tracking via one 'kanban list --json' per poll: running/blocked/
  done comments on the post, ledger stage build -> done
- cap 3 concurrent intake tasks; overflow queued with a comment and
  promoted when slots free; intake state in the same atomic state.json
- first intake run only sets the checkpoint (no history ingestion)

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YECpkAwQUwgu7NVy91R8fW
This commit is contained in:
Nirav Patel
2026-08-22 15:00:35 -04:00
co-authored by Claude Fable 5
parent e005931cb5
commit 54b705b073
3 changed files with 220 additions and 2 deletions
+28 -1
View File
@@ -62,7 +62,34 @@ cp ai.shre.pulse-bridge.plist ~/Library/LaunchAgents/
launchctl bootstrap gui/$(id -u) ~/Library/LaunchAgents/ai.shre.pulse-bridge.plist
```
## v0 limitations
## v1 intake (reverse direction)
New top-level posts in the `activity` channel written by a human (not the
bridge, not agent accounts, not `🤖`-prefixed, not mirror posts carrying a
`ledger:` tag line) become executed, tracked background work:
1. **Ledger item** — `shre-items add --kind pipeline --stage queued
--tag pulse-intake`, title = first 80 chars of the post, detail = full
post + post id. The ledger→post map is seeded with the USER'S post id
*before* the item's `op:add` reaches the feed, so the outbound mirror
adopts the user's post instead of creating a duplicate.
2. **Kanban task** — `hermes kanban create … --created-by pulse-bridge
--idempotency-key pulse-<post id> --json` on the default board; the
Hermes embedded-gateway dispatcher picks it up (~60 s). Cap: max
**3** concurrent intake-spawned tasks; overflow posts get
`⏳ queued behind N tasks` and start when a slot frees.
3. **Acknowledgment** — comment `🤖 picked up — ledger <id>, kanban <task>`
on the user's post.
4. **Tracking** — each poll reads `kanban list --json` once; on a status
change it comments (`▶️ running` / `⛔ blocked` / `✅ completed — <result>`)
and advances the ledger item (running → stage build; done → closed with
`--why "kanban <id> completed"`).
Intake state (`intake_checkpoint` epoch-ms + post↔ledger↔task map) lives in
the same atomically-written state.json. First intake run only sets the
checkpoint to the newest existing post — history is never ingested.
## v0/v1 limitations
- **No real user-mention primitive.** mib007 comms has *agent* @mentions
only (the first `@handle` in a message that matches a workspace agent