Repository navigation
feat(pm-stack): question definitions readable at the edge via the decision-events Worker - #16778
Conversation
…ision-events Worker (#13491) The Worker gains a definitions store: PUT/GET /sets/<id>/definitions (one sanitized document per set in D1; src/definitions.ts is the contract — the set's page token and answer free text never cross). The aggregator projects each stored set into that document (src/decision-definitions.ts) and its event sync publishes every set's definitions on the webhook leg, content-derived and idempotent. The console edge reads definitions beside each set's state, and the Questions screen shows a set's questions — open or answered — with no machine report in the path. Refs #13491: the answer write path and Sessions reporting across machines remain open on the issue.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 56 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Verification at exact head
PR state at merge time: OPEN, MERGEABLE, CLEAN, head unchanged. Merging (merge commit). agent=xaltha lane=0647-L01 state=verified |
Refs #13491 — the definitions slice of the remainder (slices 1–3 landed: #14616, #15804, #16085).
What this does. A decision set's questions — text, options, recommendations, and a compact resolution summary per question — are now readable at the edge with no machine in the path:
pm-stack/decision-events-worker): new definitions store.PUT /sets/<id>/definitionspublishes one sanitized document per set into D1 (decision_set_definitions);GET /sets/<id>/definitionsreads it back (404 when unpublished).src/definitions.tsis the contract and its sanitizer keeps known fields only — the set's pagetokenand a resolution's free text (freeText/customAnswer/comment/note) can never cross, by construction and by test. Re-publishing identical content is a no-op.src/decision-definitions.tsprojects a storedDecisionSetinto that document (same deliberate omissions) andscripts/sync-decision-events.tspublishes every stored set's definitions on the webhook leg, after the event legs — content-derivedpublishedAtkeeps the document byte-stable across runs, so the Worker's no-op fires; a failed push fails the run with the set named. New--decisions-fileflag under the script's strict argument contract.pm-stack/console):readQuestionSetsalso reads each set's definitions; an unpublished set (404) reads as activity only, exactly as slice 2 left it, and a failed definitions read leaves the set listed with the reason. The section marker becomesdefinitions: "worker"when any set's questions were read from the Worker, and the Questions screen renders each set's questions — open (with options/recommendation) or answered (with the chosen label).Still open on #13491 (named remainder, not in this PR): the answer write path at the edge, and Sessions reporting across machines.
Verification: remote dispatch at exact head to follow in a PR comment (worker + aggregator + console test suites).
{ "direct_parent": null, "links": [], "lineage": { "design": null, "roadmap_item": null, "priority": null }, "pm_meta": 1, "provenance": { "queue_id": null, "scheduled_start": null, "picked_up_at": null, "work_started_at": null, "created_at": "2026-11-29T12:56:31Z", "session_id": null, "lane": null, "host": "htch-runtime", "worktree": "/home/hatch", "model": null, "lane_start_issues": [], "workspace_ref": { "kind": "worktree", "id": "/home/hatch", "repo": "developing-today/code", "branch": "main", "sha": "aa5a503c40005914ca3676c21a1da732e7aeb3d7" }, "auth_subject": "xaltha", "stamped_by": "fleet 0.1.0 (native)" } }Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.