feat(orchestrator): record surface-tool replies as 'delivered', not 'silent' - #623
Open
yzxcj797 wants to merge 2 commits into
Open
feat(orchestrator): record surface-tool replies as 'delivered', not 'silent'#623yzxcj797 wants to merge 2 commits into
yzxcj797 wants to merge 2 commits into
Conversation
…silent' "silent" meant two opposite things in runs.result: the ambient gate declining to answer (suppression), and a turn whose reply went out through a surface tool — which is how every ordinary Slack answer is delivered. A delivered answer and a suppressed turn were indistinguishable in the durable record, so any operator, dashboard, or alert scoring turns was wrong by default (yc-software#609). - TurnResult gains "delivered": the surface-tool branch (the ordinary Slack-answer shape) records it; gate suppression and poll-silence keep "silent", each now meaning exactly one thing. - The metrics sink mirrors the finalResult branches (same primitives, same order, including collect-mode's ok-with-approvals) instead of hardcoding "ok" — delivered answers, silent polls, and approval pauses now land in turn_metrics as what they are. - Consumers taught the new value: the Slack turn handler settles the ack and stands down (the reply already posted — delivering it again would double-post, exactly the pre-split silent behavior), and the trigger runner treats "delivered" as a success shape both for failure classification and for destination forwarding (the surface tool already posted at the destination). Suggestions (2) and (4) from the issue — metrics rows for gate-declined early returns and persisting the detection call's model request — are larger changes to the early-return path and are not included. Fixes yc-software#609
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.
Fixes #609 — suggestions (1) and (3) from the issue, which the reporter identified as "small and would do most of the work".
What changes
TurnResultgains"delivered". The surface-tool branch — the ordinary shape of a Slack answer, where the reply goes out through theposttool rather than the TurnResult reply field — previously recordedstatus: "silent", the same value the ambient gate writes when it declines to answer. A delivered answer and a suppressed turn were indistinguishable inruns.result; the reporter's harness scored a correct in-thread reply as a failure three times running because of it. Now:silent(unchanged — means exactly this)silent(unchanged)delivered(wassilent)ok(unchanged)The metrics sink stops hardcoding
"ok".turn_metrics.statusnow mirrors the finalResult branches (same primitives, same order — including collect-mode'sok-with-approvals, pinned by the existing test): delivered turns land asdelivered, silent polls assilent, approval pauses aspaused/pending_approval. Previously ALL of them landed as"ok"(the reporter's 1,200-turn dump:capture 600 | ok 600, nothing else).Consumers taught the new value (audited: every
status === "silent"/!== "ok"site):deliveredsettles the ack and stands down — the reply already posted, delivering again would double-post (exactly the pre-split silent behavior).deliveredcounts as a success in failure classification, and stands down on forwarding (the surface tool already posted at the destination).Suggestions (2) and (4) — metrics rows for gate-declined early returns, persisting the detection call's model request — are larger changes to the early-return path and are deliberately not included.
Tests
a surface-tool turn records status 'delivered', not 'silent'— fails onmain(silent).the metrics sink carries the turn's outcome instead of hardcoding 'ok'— theturn_metricsrow for a surface-tool turn readsdelivered. Fails onmain(ok).a gate-declined ambient turn still records 'silent'— pins that the split doesn't blur suppression.Full
orchestrator.test.ts: 69 passed / 60 pre-existing environment failures, identical set on cleanmain(where the two new tests fail); trigger suites 39/39;tsc --noEmitclean.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.