Repository navigation
Harden Trinity ops alert recovery - #886
Closed
erichroepke wants to merge 1 commit into
Closed
erichroepke wants to merge 1 commit into
erichroepke wants to merge 1 commit into
Conversation
vybe
requested changes
May 21, 2026
vybe
left a comment
Contributor
There was a problem hiding this comment.
Nice hardening work — the recovery-with-evidence model and the index.lock recovery path are both well-designed, tests are solid, and the runbook follows the public-repo placeholder convention. Two blockers and a doc nit before merge:
- Retarget base branch from
maintodev. Per the Trinity SDLC, feature work lands ondevfirst;mainonly receives release-cut merges. Same flag I raised on #879 — would be great to makedevthe default for future PRs from this branch family. - Add a GitHub issue link. The Linear IDs (ERI-285/286/288/289) aren't visible here. Either reference existing issues with
Closes #N/Refs #N, or open GitHub issues for the four hardening items. - Update
docs/memory/architecture.md:- Add
operator_queue_recoveredto the WebSocket Events (Operator Queue) list - Add
recoveredto theoperator_queue.statusenum in the schema block - One-line mention of
GIT_INDEX_LOCK_STALE_SECONDS(default 900s) in the agent-server section
- Add
- Verify CI.
mergeStateStatusis UNSTABLE — worth confirming what's failing. Also,npm run buildwasn't run locally and thefrontend-e2eworkflow isui-label-gated; please add theuilabel so the Vue changes get exercised.
Re-approve immediately once base branch and issue link are fixed.
trinity-ability
pushed a commit
that referenced
this pull request
Nov 5, 2026
…lling for it (ent#1102) Checkpoint B of ent#1102: the dispatch, hooked into the one terminal fan-out every CAS-won writer already calls. An async `chat_with_agent` hands back a receipt, not an answer, and before this there was no way to learn the answer had arrived — so agents polled. The retrospective behind ruling D4 priced that: $246 of polling, 13 re-dispatches and 10 operator nudges for runs that had already finished. One push replaces all of it. `_terminal_side_effects` is the hook, as a fourth guarded sibling. It covers all 16 terminal writers without any of them changing, and it is deliberately NOT nested inside `emit_task_terminal_event`, which returns early when no event subscription matches — the common case — so anything inside it would almost never run. Nor is it armed by the MCP client at receipt time: the terminal knows the run ended; the client does not. The wake spends a billed turn on an agent that did not schedule it, so the stand-downs are the design, not the edge cases. No `source_agent_name` (a human's run has nobody to tell); a self-task or a fan-out leg (the #2524 join is the batch's own reaction); any of the four reserved platform triggers — `caller_wake` first, which is the recursion break, so no wake chain can sustain itself, and which also closes Premise P10: an event- loopback row is refused before its vouched `source_agent_name` is read, so the vouching path has no reach here. Then the policy, then the caller's own `agent.task.*` subscription (the emit is already dispatching that turn — one ending, one turn, AC 6), then a stopped container, which is audited rather than dispatched at because nothing auto-starts an agent. Two bounds that make default-ON affordable. The idempotency key is `caller_wake:{caller}:{15s bucket}` and NOT the callee's execution id: a cleanup sweep can terminate hundreds of stale rows in one cycle, and keying per callee would bill a turn for each — so the frame says plainly that other runs may have ended in the same window and names `list_recent_executions`, rather than telling a half-truth. And `chain_depth = callee + 1`, so the wake is governed by the same `inter_agent_max_chain_depth` as the call chain it answers (#2806/#2973) instead of being an unbounded side channel around it. Premise P9 is now verified, not assumed: `dispatch_and_await_terminal` forwards `**execute_kwargs` to `execute_task`, which threads `chain_depth`. The frame carries ids, enums and the sanitized-then-capped summary through the #1578 chokepoint, `request_text=""` and no `source_user_email` — the platform wrote this prompt, not a person (ent#751/#886/#715). It also names any asks the run parked and never got answered (new indexed read `list_pending_ask_ids_for_execution`, ids only): a run can reach a normal terminal with asks still pending, and a caller told only "ended successfully" would read that as finished work. Tests: `tests/unit/test_ent1102_caller_wake.py` — 26 tests through the real `maybe_wake_caller`. Mutation battery, each reverted from a scratch copy and restored byte-identical: deleting the hook call reddens `TestWiring::test_each_sibling_is_guarded_separately`; dropping the reserved- trigger break reddens the P10 loopback test; dropping the replay return reddens `test_a_replayed_claim_produces_no_second_wake`; dropping `chain_depth` reddens `test_a_missing_chain_depth_starts_the_count`; keying the window on the callee reddens `test_one_wake_per_caller_per_bucket`. Regression over the touched seams (#1578/#2523/#2524/#3520/ent#329/ent#611/ #2806/#2973): 509 passed, 1 skipped. Refs: abilityai/trinity-enterprise#1102 Co-Authored-By: Claude Opus 5 <[email protected]>
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.
Summary
Linear
Verification
Note
npm run build in src/frontend could not run because vite is not installed in this checkout (sh: vite: command not found). I did not install dependencies because of the active disk-pressure context.