Repository navigation
feat(decision-events): the answer write path at the edge (#13491) - #17083
Merged
Merged
Conversation
The decision-events Worker now records answers itself: POST /sets/<setId>/answers judges a submission batch against the set's stored definitions (src/answers.ts mirrors the laptop's recordResolutions rules), writes each applied ruling into the stored definitions as the question's resolution summary, and appends it to the set's events in D1 with fan-out to the set's Durable Object — so a question can be answered while the laptop is away, and the laptop reads the answer back from the event log when it returns. The console edge gains submitQuestionAnswers, the client for that endpoint, and the Questions discovery note now says an answer is recorded by the Worker itself where definitions were read (a set without definitions still needs the laptop, and cannot be answered at the edge).
|
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 49 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. |
This was referenced Nov 30, 2026
Member
Author
|
Verification (lane 2347-R-F), remote dispatch via fleet-run.yml:
Merging on this verification (full diff read; CI is not a gate). agent=xaltha lane=2347-R-F |
dezren39
added a commit
that referenced
this pull request
Nov 30, 2026
…17084) The decision-events sync gains an inbound half on its webhook leg: before the definitions publish, each stored set's events are read back from the Worker and the answers recorded at the edge (PR #17083) that the local event log does not hold are applied to the local store through recordResolutions — the laptop's own recording rules, via edge-answer, first resolution wins — and taken into the local event log verbatim (log only, never the outbox), which makes the pull idempotent. Applying before the publish matters: the publish projects from the local file, so an edge ruling the file never learned would have its summary reverted in the Worker's stored definitions by the next publish. Now the same run settles it everywhere.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #13491 — the answer write path at the edge, the first named remainder from the definitions slice (#16778, comment 7256475432 on #13491).
What changed
decision-events Worker
POST /sets/<setId>/answers(shared-secret auth, like every data route): accepts{submissions: [...]}, the laptop submit endpoint's shape, and judges the batch against the set's stored definitions. 404 when no definitions are stored for the set — without the questions there is nothing to judge an answer against.src/answers.tsmirrors the aggregator's own rules (recordResolutions/parseDecisionSubmissions): first resolution wins, each submission judged independently with the laptop's outcome reasons (unknown-question, already-resolved, bad-option, too-many-options, empty-answer, bad-lean), guided defers, multi-mode picks.console edge
submitQuestionAnswersinedge/src/questions.ts: the edge client for the answers endpoint, returning the Worker's per-submission outcomes and recorded event ids; a failed POST throws and nothing is recorded.Verification
Remote dispatch via fleet-run.yml against head d7885d3:
bun install && bun test && bunx tsc --noEmit— run 46363330264bun test test/questions.test.ts— run 46363360768(Conclusions recorded on the PR / issue when the runs land; CI is not a merge gate.)
Still open on #13491 after this slice
agent=xaltha lane=2347-R-F
{ "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-30T06:00:59Z", "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": "c36a28d672723b085b14125996bcd72b1931e09d" }, "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.