Commit Graph

11 Commits

Author SHA1 Message Date
Joel Hooks 97f4f80cec fix(gateway): skip session prompt for passive intel Slack messages
Recreate this by adding a passiveIntel guard in packages/gateway/src/command-queue.ts, emitting queue.passive_intel.logged, acking passive intel without calling session.prompt(), and fixing the gateway package TypeScript blockers needed for bunx tsc --noEmit -p packages/gateway/tsconfig.json to pass.
2026-03-09 06:55:45 -07:00
Joel Hooks a42fe42326 Ship joelclaw workload run and queue family workload/requested so approved workload artifacts can enter the runtime without hand-rolled queue emit payloads 2026-03-08 15:08:36 -07:00
Joel Hooks e46b4a7e18 Derive queue stats from stored messages so ADR-0217 dogfood sees truthful ages and priorities 2026-03-07 19:13:02 -08:00
Joel Hooks d637c12dc7 Implement ADR-0217 Phase 3 Story 4 with a cron-driven queue observer, include active pause state in the snapshot so resume suggestions are honest, and clamp automatic control to content/updated while reporting via queue.control OTEL 2026-03-07 18:22:47 -08:00
Joel Hooks 7d50d389d0 Ship ADR-0217 Phase 3 Story 3 with deterministic queue control state, manual pause/resume CLI surfaces, a pause-aware drainer, and canonical localhost Redis truth for queue operators 2026-03-07 17:21:08 -08:00
Joel Hooks c4a9dc8172 Define ADR-0217 Phase 3 Story 1 with canonical queue observation contracts, a bounded Sonnet observer, queue.observe OTEL vocabulary, and focused docs/tests 2026-03-07 16:22:28 -08:00
Joel Hooks 51255ff57c Define the ADR-0217 Story 1 queue triage contract, add bounded Haiku triage parsing plus queue.triage OTEL vocabulary, and document the model-free queue boundary 2026-03-07 14:46:05 -08:00
Joel Hooks f4186fc7d8 Widen the queue pilots to subscriptions, fix drainer event targets, and surface queue next actions in subscribe check 2026-03-07 08:41:31 -08:00
Joel Hooks a3bbed4d62 Promote the proven Story 6 sandbox artifact onto main, then harden the queue CLI so it exits cleanly, parses optional flags correctly, and emits queryable queue.enqueue OTEL from the real operator path 2026-03-06 23:19:03 -08:00
Joel Hooks 725425d2ea Fix @joelclaw/queue aging-priority ordering and add coverage 2026-03-06 11:16:00 -08:00
Joel Hooks b8c1dc3a48 Extract reusable queue core from message-store into @joelclaw/queue (ADR-0217 Phase 1 Story 1)
## Overview
Extracted generic Redis stream + priority index primitives from @joelclaw/message-store into a new @joelclaw/queue package. This separates the reusable queue mechanics from gateway-specific logic.

## Changes

### New Package: @joelclaw/queue
- Generic Redis stream + consumer group management
- Priority-based sorted set indexing (P0-P3)
- Functions: init(), persist(), ack(), getUnacked(), drainByPriority(), indexMessagesByPriority(), trimOld()
- Configurable via QueueConfig (streamKey, priorityKey, consumerGroup, consumerName)
- No gateway-specific dedup, classification, or coalescing
- Exported via @joelclaw/queue for reuse

### Updated: @joelclaw/message-store (Gateway Adapter)
- Now depends on @joelclaw/queue
- Preserved public API (init, persist, ack, drainByPriority, etc.)
- Retained gateway-specific behaviors:
  - classifyPriority() for Telegram/iMessage/heartbeat classification
  - Dedup hashing with 30s window
  - P0 drain streak (allow lower priority after 3 P0s)
  - P3 coalescing (combine multiple P3s within 60s)
  - Channel context stripping
- Wraps queue functions for composition

### Testing
- message-store: 10 tests passing
- queue: 5 tests passing
- TypeScript: no errors
- Biome: no formatting issues

## Files
Created:
- packages/queue/package.json
- packages/queue/src/index.ts
- packages/queue/src/store.ts
- packages/queue/src/types.ts
- packages/queue/__tests__/store.test.ts

Modified:
- packages/message-store/package.json
- packages/message-store/src/store.ts
- packages/message-store/src/types.ts
- packages/message-store/src/index.ts
- pnpm-lock.yaml

## Architecture
This implements hexagonal architecture by:
- Moving pure queue mechanics into a reusable interface
- Keeping gateway adapters thin (composition, not inheritance)
- Enabling future queue consumers (workflows, memory, etc.) without gateway coupling

## Next Steps (ADR-0217 Phase 1 Story 2)
- Add queue registry for named queue instances
- CLI for queue introspection and management
2026-03-06 11:09:42 -08:00