Files
zopu-code/packages/backend/convex
-Puter 1324316fee fix(signals): source order follows agent selection, not chronological timestamps
Remove the OutOfOrderSource constraint from composeSignal. The agent's
selection order is authoritative for source ordinals; timestamps remain
as per-source provenance metadata. This resolves the contract conflict
where reversed message selections (valid agent compositions) were
rejected by the primitive.

Each source still retains its original createdAt, so chronological
provenance is preserved exactly. The sourceKey includes ordered message
IDs, so different orderings produce distinct signals with deterministic
idempotency.

Coverage added:
- Primitive: non-chronological order accepted, timestamps preserved
- Backend: reversed selection preserves ordinals and exact raw text
2026-07-24 20:32:48 +05:30
..
2026-07-19 02:46:47 +05:30
2026-07-19 02:46:47 +05:30
2026-07-19 02:46:47 +05:30
2026-07-19 02:46:47 +05:30
2026-07-19 02:46:47 +05:30
2026-07-19 02:46:47 +05:30

Convex Backend

This directory contains the Convex control plane for the app and daemon runtime. Generated files under _generated/ are maintained by Convex and should not be edited by hand.

Daemon Control Plane

  • schema.ts defines daemon definitions, high-churn daemon presence, leased daemon commands, append-only command events, and the sample todos table.
  • daemons.ts manages stable daemon definitions with upsert, get, and list.
  • daemonRuntime.ts records daemon session lifecycle: connect, heartbeat, disconnect, recordEvent, and bounded event listing.
  • daemonCommands.ts owns the command queue: enqueue, available, claim, start, succeed, fail, cancel, and bounded command listing.

Commands are claimed by daemon session. Preserve the claimedBySessionId ownership checks, leaseExpiresAt expiry semantics, terminal statuses, and bounded query results when changing this flow.

Usage

Convex functions are exposed by file path through the generated api object, for example api.daemonCommands.enqueue or api.daemonRuntime.connect. Run bun run dev:server from the repository root to start the development deployment, and bun run dev:setup when configuring Convex for the first time.