Skip to content

feat(pm-stack): question definitions readable at the edge via the decision-events Worker - #16778

Merged
dezren39 merged 1 commit into
mainfrom
xaltha/13491-question-definitions
Nov 29, 2026
Merged

dezren39 merged 1 commit into
mainfrom
xaltha/13491-question-definitions

Conversation

@dezren39

@dezren39 dezren39 commented Nov 29, 2026 •

Copy link
Copy Markdown
Member

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:

  • Worker (pm-stack/decision-events-worker): new definitions store. PUT /sets/<id>/definitions publishes one sanitized document per set into D1 (decision_set_definitions); GET /sets/<id>/definitions reads it back (404 when unpublished). src/definitions.ts is the contract and its sanitizer keeps known fields only — the set's page token and 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.
  • Aggregator: src/decision-definitions.ts projects a stored DecisionSet into that document (same deliberate omissions) and scripts/sync-decision-events.ts publishes every stored set's definitions on the webhook leg, after the event legs — content-derived publishedAt keeps 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-file flag under the script's strict argument contract.
  • Edge (pm-stack/console): readQuestionSets also 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 becomes definitions: "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-bot with what you need.

…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.
@coderabbitai

coderabbitai Bot commented Nov 29, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You'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.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: e7d22d42-cff1-4bfd-a0f8-efa76826a90e
Commits

Reviewing files that changed from the base of the PR and between 5b48d26 and 45d222c.

Files selected for processing: 12

  • pm-stack/aggregator/scripts/sync-decision-events.ts
  • pm-stack/aggregator/src/decision-definitions.ts
  • pm-stack/aggregator/src/decisions.ts
  • pm-stack/aggregator/test/decision-definitions.test.ts
  • pm-stack/console/edge/src/questions.ts
  • pm-stack/console/public/app.js
  • pm-stack/console/test/questions.test.ts
  • pm-stack/decision-events-worker/README.md
  • pm-stack/decision-events-worker/schema.sql
  • pm-stack/decision-events-worker/src/definitions.ts
  • pm-stack/decision-events-worker/src/index.ts
  • pm-stack/decision-events-worker/test/definitions.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

@dezren39

Copy link
Copy Markdown
Member Author

Verification at exact head 45d222c84988fb47f61e558a0b69e848c1dd90de (fleet-command workflow, repo developing-today/fleet; in each run the "Execute target command" step concluded success — the runs' post-steps are hanging, a known fleet-command pattern, so the Execute step is the evidence):

  • Worker — run 46264885358: bun install && bunx tsc --noEmit && bun test (full worker suite incl. the new test/definitions.test.ts) — Execute success.
  • Aggregator — run 46264890282: bun test test/decision-definitions.test.ts test/decision-events.test.ts test/sync-decision-events.test.ts test/decisions.test.ts — Execute success.
  • Console — run 46264895257: bun test test/questions.test.ts test/direct.test.ts test/edge.test.ts test/docs.test.ts — Execute success.

PR state at merge time: OPEN, MERGEABLE, CLEAN, head unchanged. Merging (merge commit).

agent=xaltha lane=0647-L01 state=verified

@dezren39
dezren39 merged commit 7d65a28 into main Nov 29, 2026
2 checks passed
@dezren39
dezren39 deleted the xaltha/13491-question-definitions branch November 29, 2026 13:21
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