feat(delegation): route ready children between turns - #76229
Conversation
bcb6482 to
1d595c0
Compare
|
Thanks for splitting the between-turn delivery work out of the rejected mid-loop injection direction. No blocking issue was found in this review. Current The #74378 maintainer discussion specifically invited this after-turn ready-set extraction and the child-level durable ledger. The implementation depends on the declared foundation commit in #76228; with that stack preserved, the PR is a high-value salvage candidate. Automated hermes-sweeper review. |
a7f8a89 to
9fcc3ee
Compare
|
Rebased onto current Verification: |
4d01304 to
5fa6180
Compare
5fa6180 to
b2c9c3e
Compare
Note
This PR is stacked on #76228. GitHub temporarily shows the foundation commit because a fork branch cannot be used as the upstream base. The code owned by this PR is the single commit
b2c9c3e24; after #76228 merges, this branch will be rebased ontomainand the ancestor diff will disappear.Decision summary
This is the independently useful
after_turnimprovement requested in #74378's close review: completed children become visible at the next existing between-turn boundary without waiting for unfinished siblings.If only #76228 and this PR merge, Hermes still has no same-turn injection mode and no active-loop carrier.
Stack navigation
778dcaab3b2c9c3e24after_turn, no active-loop change9a6293b89The behavior change
Old batch behavior effectively joined every sibling before publishing the aggregate. A fast child could therefore remain invisible behind a slow or stuck sibling.
The new invariant is boundary-based rather than batch-finalization-based:
task:0is ready at a boundary, delivertask:0then;task:1andtask:2become ready before a later boundary, deliver them together then;The envelope is transient. Durable ownership remains child-scoped in #76228.
Why this is one routing policy, not another delivery system
CLI, gateway, TUI, and API-server consumers all use the same:
The bounded routing reservation covers only dequeue → coalesce → ownership/classification → requeue. Formatting, adapter I/O, and model work stay outside the lock.
This gives competing consumers an atomic answer to “who owns this ready set?” without serializing slow work.
Failure and race contracts
putfailure is rescheduled rather than losing the only RAM copy;Intentional exclusions
This PR adds no:
result_deliveryoption;Review focus
The reviewable question in commit
b2c9c3e24is:The ancestor ledger is reviewed in #76228. The model-facing
injectpolicy is reviewed in #76230.Verification
ProcessRegistry.__new__fixture missing the new lock; fixed by initializing the production-required field in that fixture;py_compile, andgit diff --check: passed;b2c9c3e24dd43d990a4eb62c114df2e8b295be01.Coordination graph
after_turnextraction invited by that close reviewHermes triage dashboard graph
Live dashboard neighbourhood: https://hermes-triage.gottz.de/?node=76229
flowchart LR classDef focus fill:#fef3c7,stroke:#b45309,stroke-width:3px,color:#451a03 classDef issue fill:#ede9fe,stroke:#6d28d9,color:#2e1065 classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937 P76229["PR #76229 (open)"] I85647(["issue #85647 (open)"]) P46101["PR #46101 (open)"] P60863["PR #60863 (merged)"] P63133["PR #63133 (open)"] P68950["PR #68950 (open)"] P71898["PR #71898 (open)"] P72301["PR #72301 (open)"] P72620["PR #72620 (closed)"] P74378["PR #74378 (closed)"] P76228["PR #76228 (open)"] P76230["PR #76230 (open)"] P76229 -->|closes| I85647 P76229 -->|related| I85647 P76228 -.->|duplicate of 0.77| P76229 P74378 -.->|duplicate of 0.69| P76229 P76229 -.->|duplicate of 0.67| P76230 P68950 -.->|duplicate of 0.65| P76229 P63133 -.->|duplicate of 0.63| P76229 P72620 -.->|duplicate of 0.63| P76229 P71898 -.->|duplicate of 0.63| P76229 P60863 -.->|duplicate of 0.63| P76229 P46101 -.->|duplicate of 0.62| P76229 P72301 -.->|duplicate of 0.62| P76229 class P76229 focus click P76229 "https://github.com/NousResearch/hermes-agent/pull/76229" class I85647 issue click I85647 "https://github.com/NousResearch/hermes-agent/issues/85647" class P46101 open click P46101 "https://github.com/NousResearch/hermes-agent/pull/46101" class P60863 merged click P60863 "https://github.com/NousResearch/hermes-agent/pull/60863" class P63133 open click P63133 "https://github.com/NousResearch/hermes-agent/pull/63133" class P68950 open click P68950 "https://github.com/NousResearch/hermes-agent/pull/68950" class P71898 open click P71898 "https://github.com/NousResearch/hermes-agent/pull/71898" class P72301 open click P72301 "https://github.com/NousResearch/hermes-agent/pull/72301" class P72620 closed click P72620 "https://github.com/NousResearch/hermes-agent/pull/72620" class P74378 closed click P74378 "https://github.com/NousResearch/hermes-agent/pull/74378" class P76228 open click P76228 "https://github.com/NousResearch/hermes-agent/pull/76228" class P76230 open click P76230 "https://github.com/NousResearch/hermes-agent/pull/76230"Dashboard interpretation:
closes/related);0.88and file overlap0.75;duplicate ofedge below the fold threshold is a similarity lead for review, not an accepted duplicate or merge-order edge;This graph is additive to the hand-audited coordination block above: the dashboard supplies discovery neighbourhoods, while the declared dependency, collision, ownership, and merge-order edges remain the reviewed coordination contract.