Skip to content

feat: sync routing suggestions to cloud for smart routing UX#264

Merged
itskai-dev merged 2 commits into
mainfrom
link/routing-suggestions
Feb 23, 2026
Merged

feat: sync routing suggestions to cloud for smart routing UX#264
itskai-dev merged 2 commits into
mainfrom
link/routing-suggestions

Conversation

@itskai-dev

Copy link
Copy Markdown
Collaborator

Adds getRoutingSuggestions() output to the cloud usage sync payload. The node already computes smart routing suggestions (cheaper models for low-stakes categories like heartbeat/reflection/chat). This syncs those suggestions to the cloud dashboard.

Part of Monetization Test #1 Day-5: smart routing suggestion UX.

Task: task-1771470941394-632fjzxiq
Reviewer: @Sage

Root cause: Working contract stale threshold (90m) was higher than
Kai's manual check (60m), so the product never enforced first.
Enforcement messages lacked explicit product-automation labeling,
causing leadership agents to feel compelled to intervene manually.

Changes:
- Tighten stale auto-requeue: 90m → 45m warning, 15m → 10m grace
  (product enforces at 45+10=55m, before any 60m manual check)
- All enforcement messages now labeled [Product Enforcement] with
  explicit 'no leadership action needed' note
- Watchdog stale-working alerts updated: product-driven, not @kai-driven
- Follow-up reflection submitted confirming fix

Task: task-1771800349310-938b6ebrn
@itskai-dev
itskai-dev merged commit 6655bb4 into main Feb 23, 2026
7 of 8 checks passed
itskai-dev added a commit that referenced this pull request May 4, 2026
#1333)

Replaces drain.ts's inline if/else dispatch with a registry lookup so
adding a new verb is one entry in registry.ts plus one file in
handlers/. Behavior-zero per kai+link locks (msg-1777932028252 /
msg-1777932030625):
  - same poll cadence
  - same ack contract
  - same unknown-skip semantics
  - no auth / intake churn
  - no new verbs (the two existing verbs become the first two registry
    entries — no scope creep)

New files:
  src/commands/types.ts                     — PendingCommand, CommandContext, CommandHandler
  src/commands/registry.ts                  — COMMAND_REGISTRY (context_sync, run_approve)
  src/commands/handlers/context-sync.ts     — relocated from drain.ts
  src/commands/handlers/run-approve.ts      — relocated from drain.ts

drain.ts is now ~80 LOC (down from ~200): poll + error tracking + dispatch
via registry with the existing unknown-skip ack fallback. Net diff +206/-136.

Closes §11e step 2 of reflectt-cloud/docs/COMMAND_PLUGIN_SKILL_ARCHITECTURE.md.
Step 3 (routes/canvas extraction) and step 4 (routes/chat extraction) are
explicitly out of scope for this PR.

Proof:
  - typecheck green
  - 244/244 test files pass (2647 tests, 1 skipped)
  - canonical staging command-queue smoke planned post-merge (poll, ack-complete, ack-fail)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant