GeezerVison is showing github.com — pm-stack decision sets v2: rich questions, event log, submit API + activity webhook/hook · Issue #9335 · developing-today/code
pm-stack decision sets v2: rich questions, event log, submit API + activity webhook/hook #9335Descriptionpm-stack decision sets v2: rich questions, event log, submit API + activity webhook/hook
Ordered by Drew 2026-11-12 ~23:17 CST in the pending-questions side chat. Drew granted permission to modify anything inside the pending-decisions / decision-set task namespace.
Goal
Upgrade the PM-stack decision-set system so every question set is rich, checkbox-driven, fully event-logged, submittable via an authenticated API that returns the set UUID + token page link, and watched by an activity hook that wakes a Muse processor task on any activity (including typed-but-unsubmitted changes), with events landing in Turso and a Cloudflare Worker + D1 + Durable Object pipeline.
Acceptance criteria
Aggregator schema + page
- Detail floor: every question carries question + rich context/description (background, why it matters, consequences) — at least as detailed as the current enriched infoProvided briefings.
- Answer modes: single-choice AND multi-select checkboxes; bullet option lists render as selectable checkboxes/radio inputs (never plain text bullets); EVERY question always offers a free-text "my own answer" field.
- Option expansion at raise time (schema supports): combination options ("A+B") in addition to each component option; one conventional/enterprise choice; one edge/best-practice choice (whitepaper / open-source / distributed / p2p / local-first / graph / CRDT / redundant as applicable).
- Tags/hints on options and questions (simpler, safer, distributed, portable, performance, recommended) rendered as visible hint chips.
- Preselected recommendation: raiser may mark a recommended/default selection per question; page shows it preselected and offers one-click "submit defaults"; defaults are ACTIVE (shown selected) while unsubmitted, without counting as an answer until submitted.
- Grouping/reordering: sets may group and order questions arbitrarily; the same question may appear in multiple sets (repeats allowed).
- Versioning: question wording may be updated to a better version; ALL versions kept, with a structured event/change log per question and per set.
- Event capture: EVERY interaction is a structured event appended to an event log — submit, defer, request-info, answer edits, AND typed-but-not-submitted changes (draft keystrokes/selections, debounced sensibly). Events carry setId (UUID), question id, type, payload, timestamp.
Submit API
- Authenticated API (fleet CLI/script in aggregator repo) to submit a question set and receive back the set UUID + token page link programmatically. Token link returned only to the authenticated submitter; never logged in plaintext in public places.
Activity hook / processor (pending-decisions goal namespace)
- Hook or small cron (every few minutes) keyed by set UUID wakes a Muse task when a set has ANY new activity — answers, deferrals, info requests, feedback, even typed-but-unsubmitted changes — batched (one batched notification per interval, not per keystroke).
- Processor applies resolutions to the pending-questions ledger (extend/reuse the dropped-thread catcher path, not a duplicate), shards work so one task processes as many pending sets/questions as fits efficiently, and regularly reviews all still-unchosen (unresolved) sets.
- Wired as a proper cron/hook under goal pending-decisions-hourly-questions-for-drew, definition in hatch-personal repo per AGENTS.md cron workflow.
Event pipeline
- Structured event log lands in a Turso database (fleet-platform pattern; cf. code#5690 AGENT_EVENTS_SINK).
- Cloudflare Worker webhook receives/publishes all set events, stores them in D1, with a Durable Object per set coordinating per-set event fan-out.
- If the CF/Turso leg cannot complete (credentials/entitlements), land the aggregator-side event log + an outbox ready to sync, and record exactly what blocks the external leg here — do not fake it.
Hourly task update
- pending-questions-hourly task definition updated (repo file + re-push): every batch message and every set includes the set's page link; questions generated to the new detail floor with checkbox options, custom answer, combination + enterprise + edge/best-practice options, tags, preselected recommended default; big questions broken into smaller sub-questions; sets raised via the new submit API with returned UUID/link recorded in the ledger.
Compatibility + verification
- Existing sets and the current resolution flow keep working (store migrated compatibly); existing tests stay green (no new failures vs main); typecheck no worse than main.
- One real test set raised in the new format from currently-open ledger questions; page renders checkboxes + custom answer + tags + preselected default; submit records events; activity processor picks activity up; token link works (200 with token / 403 without); index lists the set.
Progress and outcome comments will be posted on this issue as phases land. Activitydeveloping-today commented on Nov 13, 2026 dezren39 commented on Nov 13, 2026 Track A (aggregator schema + page + submit API) — work started 2026-11-12.
Plan: branch feat/9335-decision-sets-v2 from origin/main in a dedicated laptop worktree (primary checkout untouched until deploy). Delivering: (1) backward-compatible schema v2 in src/decisions.ts (rich description, single/multi modes, free-text custom answer on every question, option/question tags, combinationOf, recommendedOptionIds preselects, order/group, question versions); (2) append-only decision event log (JSONL) + sync outbox + authenticated read endpoint GET /api/decision-sets/<setId>/events?since=<cursor>; (3) authenticated submit API POST /api/decision-sets + scripts/submit-decision-set.ts returning setId (UUID when not supplied) + token page URL to the submitter only; (4) v2 page rendering (checkbox/radio, tag chips, submit-defaults, draft-event reporting) with v1 sets still rendering/submitting; (5) tests vs pristine-main baseline. PR link follows when opened. dezren39 commented on Nov 13, 2026 Track B (external event pipeline) — investigation findings (early progress)
Investigated before building, per the track brief:
Turso — access EXISTS, fleet-platform pattern identified
- Pattern of record (code#5690,
doc/fleet/agent-events-turso.md, PRs gather-quota: cut quota_records sink from Supabase to Turso (Wave 3, #5690) #6655/fleet-queue: agent.events Turso sink verbs + health terminal counters (#5690) #6762): append-only ledgers land in a Turso DB via the libSQL HTTP pipeline (POST <db-url>/v2/pipeline, typed args, INSERT OR IGNORE on the event PK for idempotence), token resolved by name only via Bitwarden/fleet secrets get.
- Concrete in-repo precedent:
pm-stack/aggregator/scripts/gather-quota.ts writeTursoRecords writes agent_quota_records to Turso DB fleet-platform (https://fleet-platform-dezren39.aws-us-east-1.turso.io) with token name turso.fleet-platform-rw-token, fail-soft, kill-switch env. The github-ci Worker (pkgs/github-ci/worker/src/turso.ts, design: move ci.events webhook ledger from Supabase to Turso staging #5693) uses the same pipeline client from Cloudflare.
- Decision for this track: decision-set events land in the same fleet-platform DB in a new table
decision_set_events (PK event_id), token by the existing name turso.fleet-platform-rw-token — no new Turso DB or credential needed. turso CLI on the sandbox is authenticated (org dezren39) and lists fleet-platform among ~40 fleet DBs; secret names confirmed present by name: turso.fleet-platform-rw-token, turso.fleet-queue-rw-token, turso.general-db-token, plus per-DB atlas tokens.
Cloudflare — access EXISTS
- Account
234b866b… (id verified live via API this pass). Day-to-day token by name cloudflare.api-token-day-to-day carries Workers Scripts/KV/R2/D1/Queues read+write on that account (per fleet secret notes, 2026-10-07/23) — sufficient for wrangler d1 create + wrangler deploy. Account-wide token also exists by name (cloudflare.api-token-account-wide) if a scoped mint were needed; not expected.
- Wrangler 4.147.0 installed (sandbox
~/tools/bin/wrangler, authed-helper pattern ~/tools/cloudflare/wrangler-authed.py pipes the token from stdin, never argv/disk).
- Existing Worker precedents in-repo:
pkgs/github-ci/worker (TS + vitest + wrangler, writes Turso directly), pkgs/id/worker-poc/d1-journal-poc (D1 binding precedent). No existing decision-events Worker/D1 — this track creates pm-stack/decision-events-worker + D1 DB decision-events, Durable Object class keyed by setId.
- Webhook auth: a NEW shared secret will be minted for this Worker and vaulted by name (
cloudflare.decision-events.webhook-secret) — the github-ci Worker precedent (mint + vault by name, wrangler secret put, value never in repo/logs).
Aggregator side
- Current
main: src/decisions.ts (Decisions page: batched decision sets — one push per set, per-item/partial submit, defer-to-orchestrator with leans (extends #8568) #8766 sets, resolutions, per-set token) and scripts/raise-decision-set.ts exist; there is no decision-set event log/outbox on main yet (Track A's local log is the parallel leg). Track B therefore ships (a) the canonical event shape {eventId, setId, questionRef, type, payload, ts} + outbox reader in the aggregator, (b) an idempotent sync script (Turso + Worker webhook legs), and (c) the Worker — the sync consumes a JSONL outbox file (default ~/.local/state/pm-aggregator/decision-events-outbox.jsonl, --file/--outbox-dir overridable) so it works with whatever exact file Track A lands, as long as lines carry that shape.
Building now; outcome comment + PR link to follow. dezren39 commented on Nov 13, 2026 Track C landed: decision-set activity processor (fleet side)
Job: decision-set-activity-processor — cron, interval@10m (America/Chicago), enabled, owner goal:pending-decisions-hourly-questions-for-drew, delivery: pending-questions chat only. First scheduled run 2026-11-12 23:32 CST. Definition (repo copy, committed in hatch-personal): workspace/goals/pending-decisions-hourly-questions-for-drew/crons/minutely/[email protected]; the hourly pending-questions-hourly job was NOT changed by this track.
State file: ~/workspace/goals/pending-decisions-hourly-questions-for-drew/hidden_files/activity-processor-state.json — per-set events-API cursors + last-seen event ids, fallback watermarks (per-set feed-resolution counts, draft fingerprints), stale-review bookkeeping, run log tail. Seeded with a verified baseline so history is never replayed as news.
Division of labor vs the dropped-thread catcher (found at cron dropped-thread-catcher, hourly, goal keep-the-four-repos-healthy, Steps 2B/2C; repo file workspace/goals/keep-the-four-repos-healthy/crons/hourly/[email protected]):
- The catcher stays authoritative for feed-published resolutions: it reads the fleet feed's
answers/decisionResolutions, dedupes in its state (appliedDecisionResolutions, keyed setId:qid), writes ledger resolution/infoRequest, closes items, and unblocks gated queue tasks. The processor never duplicates unblocks and never overwrites a written resolution (conflicts are recorded + surfaced instead).
- The processor covers what the catcher misses or sees late: (1) speed — polls every 10 min and applies resolutions in the catcher's exact shapes, cross-checking the catcher's applied set first; (2) typed-but-unsubmitted draft changes (never reach the feed); (3) feedback/edits the feed's first-resolution-wins republication hides; (4) stale-set review (unresolved >24h, stale drafts >24h, noted once per threshold crossing — no nag spam). Silent unless real activity: one batched summary per run at most. Bounded batches (50 events / 20 questions, oldest first, remainder cursor kept). Never acts on the decisions themselves.
Dependency — aggregator event API: designed against GET /api/decision-sets/<setId>/events?since=<cursor> (events {eventId, setId, questionRef, type, payload, ts}). Probed at build time: 404 — not live yet. The processor therefore runs on its fallback today (laptop decisions store ~/.local/state/pm-aggregator/decisions.json + fleet-feed.json via laptop-ssh) and switches to the API per-set as soon as it answers; the dependency is recorded in the job definition and state file.
Dry sanity pass (manual, no chat message sent): store holds 7 sets / 119 items / 130 questions — the 5 known sets plus needs-drew-2026-11-12 and decisions-2026-11-12-queue-cleanup. Feed carries 73 decisionResolutions (56 answered, 9 request-info, 8 deferred) + 1 push answer; the catcher's state shows 79 appliedDecisionResolutions / 1 appliedPushAnswers — i.e. all submitted activity is already applied; there is no unprocessed backlog. Fully resolved: decisions-2026-11-11 (24/24), needs-drew-2026-11-12 (6/6), decisions-2026-11-12-queue-cleanup (43/43). Still unresolved: decisions-reraise-2026-11-11, decisions-2026-11-11-design-blocked (both already past 24h — baseline-noted so first runs don't nag), decisions-backlog-2026-11-12, decisions-reraise-2026-11-12. Three draft records exist (decisions-2026-11-11, needs-drew-2026-11-12, decisions-2026-11-12-queue-cleanup), all empty — no typed-but-unsubmitted content pending. A live triggered run was deliberately not fired: with the baseline showing zero unprocessed activity, the scheduled runs are the verification path and the chat stays unspammed. dezren39 commented on Nov 13, 2026 Track B (external event pipeline) — DONE, deployed and live-verified
PR: #9341 (branch decision-events/9335-trackb, from a clean worktree off origin/main; the primary checkout's unrelated dirty files were not touched)
What was built and DEPLOYED (not merely deploy-ready)
- Turso leg — fleet-platform pattern (code#5690): table
decision_set_events (PK event_id, indexes on (set_id, ts) and (type, ts)) created in the existing fleet-platform DB; token by name turso.fleet-platform-rw-token. No new DB/credential was needed.
- Cloudflare Worker —
pm-stack/decision-events-worker, deployed to https://decision-events.developing-today.workers.dev (version 9e5607c8-b26d-47d3-b671-d1465e114253):
- D1 database
decision-events (68ade85e-6835-46a8-af6a-a9f2f2d966ae) created; schema.sql applied remotely (same table shape as Turso).
POST /events (alias /webhook): shared-secret auth (constant-time; Bearer or X-Webhook-Secret), batch validation, D1 INSERT OR IGNORE, then fan-out of only-new events to the set's Durable Object.
DecisionSetEvents Durable Object keyed by idFromName(setId): per-set fan-out state + hibernatable WebSocket subscribers via GET /sets/<id>/stream; read-backs GET /sets/<id>/events and GET /sets/<id>/state; fails closed when unconfigured.
WEBHOOK_SECRET set on the Worker from a newly minted secret vaulted in Bitwarden by name cloudflare.decision-events.webhook-secret (value never in repo/logs/chat).
- Aggregator sync —
src/decision-events.ts + scripts/sync-decision-events.ts (strict Design: unknown means stop — one strict argument contract for the repo's operator scripts #3352 arg contract): drains the JSONL event outbox (default ~/.local/state/pm-aggregator/decision-events-outbox.jsonl; --file/--outbox-dir overridable) to both legs independently, idempotent on eventId, per-leg ack state, kill switch DECISION_EVENTS_SYNC=0.
Live verification (two independent reads per sink)
- Smoke via the real sync script on the laptop, 3 events for set
smoke-9335: Turso inserted=1 ×3 and Worker inserted=1 ×3; fresh-state re-run: attempted=3, inserted=0 on both legs (sink-level idempotence proven, not assumed).
- Turso read-back via the pipeline API: all 3 smoke rows present. Worker read-backs:
/sets/smoke-9335/events returns the 3 events; /sets/smoke-9335/state shows D1=3 and the Durable Object at fannedOut=3, last event smoke-9335-e3. Unauthenticated GET/POST → 401. /health → webhookConfigured: true.
- Bug found + fixed by the smoke: libSQL reports inserts as
affected_row_count, not rows_affected — the sync counter and its test fake now match the real envelope.
- Tests: aggregator 11/11 new + neighboring decisions/events suites green (79/79 across the three files); worker 7/7; worker
tsc clean; aggregator typecheck 20 errors = exact origin/main baseline, 0 in new files.
What is NOT done / blockers
- Nothing on the Turso or Cloudflare leg is blocked — both credentials/access existed (by name:
turso.fleet-platform-rw-token, cloudflare.api-token-day-to-day with D1+Workers write on account 234b866b…) and both legs are live.
- Remaining integration, owned outside Track B: Track A's local event-log producer must append to the outbox path above (the sync's
--file default is the contract), and no timer/cron runs the sync yet — wiring a cadence should land with Track A's outbox finalization so the schedule registry update (AGENTS.md) names the real producer. The 3 smoke-9335 rows/events are intentionally left in Turso/D1 as the verification record (fleet sink-proof precedent).
dezren39 commented on Nov 13, 2026 Track A PR opened: #9343 — #9343
Shipped in the PR (details + contracts in the PR body):
- Schema v2 in
src/decisions.ts: description/detail, single|multi modes, always-on "my own answer" (customAnswer), option/question tags, combinationOf, recommendedOptionIds (preselected, NOT a resolution until submitted), order/group, versions[] + currentVersion + appendQuestionVersion. V1 sets/store files unchanged in behavior.
- Event log
src/decision-events.ts: append-only decision-events.jsonl + outbox decision-events-outbox.jsonl beside decisions.json. Event: {eventId, setId, questionRef:{ledgerId,qid,questionIndex}, type, payload, ts}, types set.created|submit|defer|request-info|draft|edit|answer. Outbox record = event + outbox:{status:"pending", enqueuedAt, sink:"turso-cloudflare"}.
- Event read contract for the activity processor:
GET /api/decision-sets/<setId>/events?since=<cursor>&limit=<n> → {setId, events, nextCursor, count}; auth = intake bearer OR per-set token; since = previous nextCursor (eventId) or ISO ts. POST to the same path (or /api/decisions/<setId>/events) reports draft/edit events.
- Submit API:
POST /api/decision-sets (intake bearer) returns {setId, pageUrl, created} — UUID minted when setId omitted; URL only to the authenticated submitter. CLI: bun run scripts/submit-decision-set.ts --payload <file> prints {setId, pageUrl, created} JSON on stdout.
- Tests: 20 new tests; full suite at parity with pristine main (identical named failure sets; +20 passes are the new tests); typecheck 20 errors on both, none in touched files; 27/27 live HTTP contract checks against a spawned server.
Merge + deploy (FF primary clone, restart pm-aggregator, live-verify) follow in the outcome comment. dezren39 commented on Nov 13, 2026 Track A outcome: PR #9343 merged (2026-11-13T05:35Z) and deployed + live-verified.
Deploy note: a whole-clone fast-forward of ~/git/code was blocked by unrelated local work in the primary checkout (opencode-claimant claimant.py/test_claimant.py and .opencode/opencode.jsonc carry local-only changes; the claimant system is live). The staged sentinel-damping files proved byte-identical to origin/main. The aggregator subtree was therefore checked out to origin/main in place, preserving the two in-subtree files with local changes (src/projects.ts, scripts/stack-sentinel.ts — md5-verified before/after, staged state restored) and leaving all other local work untouched. pm-aggregator.service restarted; health 200; the deployed aggregator files are byte-identical to origin/main. A full-clone FF can complete whenever the claimant/opencode local work lands or is cleared.
Live verification (production, 2026-11-12 ~23:40 CST):
- Real test set raised via the new submit CLI from a currently-open ledger question (census-link-system-improvements, keep-parked-or-close):
bun run scripts/submit-decision-set.ts --payload <file> returned setId 3df0fc87-dded-4ecf-be73-c3f51b1c1def (UUID minted server-side), created=true, plus the token page URL (returned only to the submitter; not recorded here). One push rides the raise as designed.
- Page: 200 with token / 403 without / 403 wrong token; renders radio inputs, recommended preselection, tag chips, rich description, "My own answer" field, Submit defaults button.
- Events:
GET /api/decision-sets/<setId>/events with the set token → 200 with the set.created event + nextCursor; without auth → 403. Production decision-events.jsonl and decision-events-outbox.jsonl now exist in ~/.local/state/pm-aggregator/ with the pending turso-cloudflare outbox record.
- Index
GET /decisions lists the new set; a pre-existing v1 set page still returns 200 with its token.
Contracts for Tracks B/C (also in PR #9343 body): event read GET /api/decision-sets/<setId>/events?since=<cursor>&limit=<n> (intake bearer OR set token) → {setId, events, nextCursor, count}; event shape {eventId, setId, questionRef:{ledgerId,qid,questionIndex}, type, payload, ts} with types set.created|submit|defer|request-info|draft|edit|answer; outbox record = event + outbox:{status:"pending", enqueuedAt, sink:"turso-cloudflare"} in ~/.local/state/pm-aggregator/decision-events-outbox.jsonl; submit API POST /api/decision-sets (intake bearer) → {setId, pageUrl, created}, CLI scripts/submit-decision-set.ts --payload <file> prints the same as stdout JSON.
Tests: full suite branch 2218 pass / 18 fail / 1 error vs pristine main 2198 pass / 18 fail / 1 error (identical named failure sets; +20 passes are the new decisions-v2 tests). Typecheck 20 errors on both, none in touched files. Pre-deploy HTTP contract suite against a spawned server: 27/27 checks passed. dezren39 commented on Nov 13, 2026 Decision Sets v2 — reconciliation complete: both tracks now landed ✅
PR #9341 (Track B) has been reconciled with current main, merged, deployed, and wired to a periodic sync. The two tracks are no longer parallel implementations — they are the two halves of one pipeline.
Reconciliation approach
The only merge conflict was the expected add/add collision on pm-stack/aggregator/src/decision-events.ts. Resolved by role, not by interleaving:
- Track A's module is canonical for
src/decision-events.ts — the append-only event log + outbox writer (appendDecisionEvents, readDecisionEvents, DecisionEventOutboxRecord) is byte-identical to what PR feat(pm-aggregator): decision sets v2 — rich schema, event log + outbox, submit API (#9335) #9343 merged (verified by sha256 after deploy).
- Track B's sync-side code moved to
src/decision-events-sync.ts (wire shape, outbox reader, Turso pipeline client, Worker webhook client, per-leg ack state). scripts/sync-decision-events.ts and test/decision-events.test.ts now import from the sync module.
- Contract adaptation — the sync now consumes Track A's actual outbox format, which Track B was written against a draft of:
- Outbox lines are the canonical event plus an
outbox:{status, enqueuedAt, sink} envelope; the reader unwraps it (validation returns the bare wire event).
- Track A's
questionRef is an object {ledgerId, qid, questionIndex?}; the sync maps it onto the wire/sink string form (the qid, "<ledgerId>#<index>"). String-form refs from earlier producers are still accepted.
- Track B's legacy type-slug list was renamed
LEGACY_DECISION_EVENT_TYPES so it can't shadow Track A's canonical DECISION_EVENT_TYPES (set.created, submit, …); validation still accepts any slug-shaped type, so Track A events pass unchanged.
- The sync's default outbox path now falls back to Track A's resolver (
defaultDecisionOutboxFile), so producer and sync agree on the path by construction.
- Worker's
events.ts header comment updated to point at the sync module. No other worker changes — no contract drift found.
Two regression tests were added for exactly this seam (Track A envelope line reads clean; object questionRef maps to the qid string).
Verification (pre-merge, in the reconciled worktree)
bun test test/decision-events.test.ts test/decisions-v2.test.ts test/decisions.test.ts test/events.test.ts — 101 pass / 0 fail (13 sync tests: Track B's original 11 + the 2 reconciliation tests above; Track A's decisions-v2 suite green).
- Worker:
bun test 7/7, tsc --noEmit clean.
- Aggregator typecheck: 20 errors = exact origin/main baseline, 0 in touched files.
- PR merged as a merge commit (same convention as feat(pm-aggregator): decision sets v2 — rich schema, event log + outbox, submit API (#9335) #9343): merge commit
aad1d3602adb5b832f78d18ed4d8fd3e0e09f899, merged 2026-11-13T05:45:31Z. Note: the repo's generic CI checks (fleet-search/mcpx/scripts basics — none touch this subsystem) were still queued at merge time; the PR was MERGEABLE with no conflicts and all local verification above was green.
Deploy (aggregator, same pattern as Track A)
- Only the
pm-stack/aggregator subtree of the primary checkout was updated to the new origin/main in place; the local-only files src/projects.ts and scripts/stack-sentinel.ts were preserved untouched (they remain the only diff vs origin/main in that subtree).
pm-aggregator.service restarted, active/healthy: GET / → 200; the pre-existing test set page GET /decisions/3df0fc87-dded-4ecf-be73-c3f51b1c1def → 200 with its token, 403 without; GET /api/decision-sets/<id>/events → 200 with token / 403 without.
Sync cadence (new)
- systemd user timer
pm-decision-events-sync.timer, every ~5 min (OnBootSec=2min, OnUnitActiveSec=5min), running pm-decision-events-sync.service (oneshot, bun run scripts/sync-decision-events.ts from the primary checkout, DECISION_EVENTS_WEBHOOK_URL set to the Worker's /events endpoint so both legs run). Enabled; next trigger confirmed in list-timers.
- Secrets are resolved by name only, exactly as the script does manually:
src/secrets.ts → bws + the laptop token file, for turso.fleet-platform-rw-token and cloudflare.decision-events.webhook-secret. No secret values in the unit files (no env files, no credentials in the units at all).
End-to-end read-back (the real Track A test event)
The production outbox held exactly one pending record — set 3df0fc87-dded-4ecf-be73-c3f51b1c1def, event b267f0b9-5861-476c-a849-dfdeb8ed7ac0 (set.created, 2026-11-13T05:37:12.808Z). First timer run:
leg=turso pending=1 attempted=1 inserted=1
leg=webhook pending=1 attempted=1 inserted=1
- Sync state (
decision-events-outbox.jsonl.sync-state.json) now acks that eventId on both legs; a second run reports pending=0 attempted=0 inserted=0 on both (idempotent).
- Turso read-back (pipeline query on
decision_set_events): the row is present — event_id=b267f0b9-…, set_id=3df0fc87-…, question_ref=NULL, type=set.created, payload and ts byte-identical to the outbox record.
- Worker read-back:
GET https://decision-events.developing-today.workers.dev/sets/3df0fc87-dded-4ecf-be73-c3f51b1c1def/events → 200, count: 1, the same event with questionRef: null and the identical payload/ts.
The pipeline Drew ordered is now live end to end: aggregator appends → outbox → 5-minute sync → Turso + Worker/D1/DO, with per-leg idempotent acks. dezren39 commented on Nov 13, 2026 Decision Sets v2 — complete ✅
All acceptance criteria landed and live-verified. Summary by deliverable:
Aggregator schema + page (PR #9343, merged, deployed): schema v2 (backward-compatible) — rich description detail floor, mode: single|multi (radio/checkboxes, never plain-text bullets), always-rendered free-text "my own answer", option/question tags hint chips, combinationOf combination options, recommendedOptionIds preselected defaults + one-click "submit defaults" (defaults active while unsubmitted, NOT a resolution until submitted — tested), group/order fields, repeats across sets allowed, question versions[] with all versions kept. Append-only event log (decision-events.jsonl + outbox twin) covering set creation, submit/defer/request-info, edits, and page draft events (client-debounced 2.5s/question). Full suite vs pristine main: 2218 pass vs 2198 (the +20 are the new v2 tests), failure sets byte-identical to main; typecheck 20 errors = main baseline, 0 in touched files.
Submit API (PR #9343): POST /api/decision-sets (intake-bearer auth) + CLI bun run scripts/submit-decision-set.ts --payload <path> printing {setId, pageUrl, created} — UUID minted when omitted, idempotent re-submit (no second push). Token URL returned only to the authenticated submitter.
Activity processor (fleet cron): new job decision-set-activity-processor (interval@10m, owner goal:pending-decisions-hourly-questions-for-drew, delivery to the pending-questions chat). Extends the existing dropped-thread-catcher (which keeps owning resolution application/unblocking): cursor polling of the events API with store+feed fallback, bounded sharded batches, draft (typed-but-unsubmitted) surfacing, stale-set review at 24h thresholds, silent unless real activity. State: hidden_files/activity-processor-state.json. Dry pass: 7 sets / 130 questions, zero unprocessed activity.
Event pipeline (PR #9341, merged; reconciled with #9343 — sync code moved to src/decision-events-sync.ts): Turso table decision_set_events in fleet-platform; Cloudflare Worker https://decision-events.developing-today.workers.dev with D1 decision-events + Durable Object DecisionSetEvents per set; sync cadence via laptop systemd user timer pm-decision-events-sync.timer (~5 min), secrets by name only. Real production event (test set below) synced to both legs and read back byte-identical from Turso and the Worker.
Hourly task updated: pending-questions-hourly definition (hatch-personal commits 27dae42852 + 21b9e8d4f2, re-pushed via cron.update, schedule/delivery unchanged) — v2 question standard (detail floor, sub-question breakdown, checkbox modes + custom answer, combination + enterprise + edge/best-practice options, tags, preselected defaults), sets raised via the submit API with UUID/link recorded in the ledger, new step 5C raises each chat batch as a set, and step 6 requires the set page link in every batch message.
Live verification test set: setId 3df0fc87-dded-4ecf-be73-c3f51b1c1def ("Decision Sets v2 verification — link system improvements ruling", from the open census-link-system-improvements ledger question) — page 200 with token / 403 without / 403 wrong token, renders radio inputs + preselection + chips + description + own-answer + Submit defaults; events endpoint live; index lists it; its set.created event is in Turso + the Worker. (Token link deliberately not posted here — it rides the submit-API response and the chat/ledger only.)
Known caveat (pre-existing, not from this build): a whole-clone fast-forward of the laptop's ~/git/code is blocked by unrelated local-only claimant work; deploys updated the pm-stack/aggregator subtree in place (byte-identical to origin/main, local files preserved) and the service is healthy.
Closing as complete. dezren39 commented on Nov 24, 2026 Triage verdict (coverage reconciliation pass 2, queue task 21963) — resolved in substance
Verdict: all acceptance criteria remain landed and live. Recommending deliberate close; evidence below.
Why it is open: the 2026-11-13 close by developing-today[bot] was procedural, not substantive — PR #9341's title/body carries no Closes/Fixes/Resolves #9335 keyword (verified 2026-11-24), so the closure-watchdog (#10105) refs-only-merge rule fired and reopened it on 2026-11-22. Correct call by the watchdog; the substance was already done.
Fresh verification (2026-11-24, lane code-g):
- PR feat(pm-aggregator): decision sets v2 — rich schema, event log + outbox, submit API (#9335) #9343 (Track A: schema v2 + submit API + event log) MERGED 2026-11-13; PR feat(pm-stack): decision-set event pipeline — Turso sync + Cloudflare Worker/D1/DO (#9335) #9341 (Track B: Turso + Worker/D1/DO pipeline) MERGED 2026-11-13. Both merge commits present on origin/main.
- Deliverables present on origin/main:
src/decisions.ts (combinationOf, recommendedOptionIds, customAnswer, currentVersion), src/decision-events.ts, src/decision-events-sync.ts, scripts/submit-decision-set.ts, scripts/sync-decision-events.ts, pm-stack/decision-events-worker/src/{index,events}.ts.
- Subsystem actively maintained since merge, not abandoned: outbox-dir/sync fixes (pm-stack: decision-events Worker loses Durable Object fan-out when ingest fails after the D1 commit (PR #9341 Codex P1) #9612–pm-stack: sync-decision-events silently ignores an unreadable --outbox-dir (PR #9341 Codex P2) #9615, fix(pm-stack): don't ack Worker-rejected decision events and align ts validation (#9613) #9633, fix(pm-stack): fail non-zero when --outbox-dir cannot be read (#9615) #9636, pm-stack: sync-decision-events kill switch returns 0 before parseArgs, so invalid args silently succeed (from PR #9341) #9794), composite-cursor read-back (fix(pm-stack): composite (ts, event_id) cursor for decision-events read-back (#9614) #9645), decision-set aging policy (pm-aggregator /decisions: 89 sets from 2026-11-16 still pending — decision sets need an aging policy #14064), CF release workflow (ci(decision-events): add cf release workflow (#9335) #12566, merged 2026-11-24), deploy-version labels (feat(pm-stack): accept target=decision with design 3.4 fields (#10034 S4) #14310).
- Sync cadence live on this laptop right now:
pm-decision-events-sync.timer active, last run exit 0, both legs idempotent no-op (turso pending=0, webhook pending=0).
- No open sub-issues; no open PR against this issue.
Follow-on routed: #14517 (task/small-fix) + queue task 23607 — the live pm-decision-events-sync.timer has no row in `doc/fleet-schedule-registry.md$ (registry defect per AGENTS.md), and the activity-processor cron row needs verifying. Docs-only, no behavior change.
Adjacent observation (not filed, owned elsewhere): #14310 notes the target=decision variant still needs its decision-set production / resolution round-trip / sync-answer path, while #10034 (its design parent) is closed. Flagging here only; filing that belongs to the #10034 line, not this triage. dezren39 commented on Nov 24, 2026
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|