Skip to content

A member a rule stopped tells its lead what it had already done - #48

Merged
jithinAB merged 1 commit into
masterfrom
pact-kernel/member-stop-receipts
Nov 21, 2026
Merged

jithinAB merged 1 commit into
masterfrom
pact-kernel/member-stop-receipts

Conversation

@jithinAB

Copy link
Copy Markdown
Contributor

What

A team member whose run a rule stopped (stop-the-run) now tells its lead what it had already done.

  • harness.stopped_by_rule(member, out, keys): <member> was stopped by a rule: <the rule's words>, then, when the run had completed calls holding a same-request-key:, the heading harness.COMPLETED_CALLS_HEADING ("It completed these calls before the stop; their results are tool output:") and one line per such call with what it returned, once per key and in the order they ran. A call that failed (error: ...) or was withheld (not done: ...) is left out; the results are what the member's model read, so a hidden value stays its placeholder.
  • delegate_by_running's asker raises it as the member's failure, so Handoff.said hands the lead error: cashier could not answer: cashier was stopped by a rule: ... with the completed calls.
  • tests/test_a_stopped_member_says_what_it_already_did.py: a cashier charges one order, then a counting rule stops it before a second; the lead reads the rule's words and the first charge's receipt. A cashier whose charge failed reads only the rule's words.
  • CHANGELOG entry and headline counts (scripts/sync-counts.sh's edits: rust 1733, adapter 3661).

Why

The member's reply was cashier stopped: stopped-by-rule: neither the rule's words nor the payment the member had already made reached the lead. In a live Bud Meta Harness run (serve profile, gpt-5-mini, a card desk lead and cashier, one-charge-per-request stopping a second charge after a restart), the lead then told the customer an order was "not charged" after its money had moved. BMH builds the same hand-off from its at-most-once ledger, with the same heading, so a lead reads one hand-off on each runtime.

Evidence

On this branch's head (master 535a28e):

  • New file: 2 passed; with the stopped-by-rule branch removed from the asker, both fail (the lead read cashier stopped: stopped-by-rule).
  • Python adapter suite, full: 3490 passed, 144 skipped, and the 27 TypeScript-port cases that need Node 22.6 or later (--experimental-strip-types) passed on a rerun under Node 24 (83 passed, 1 skipped). test_the_headline_test_count_is_the_count.py passed.
  • No Rust or TypeScript change; the TypeScript port has no delegation.

Purpose checklist (§0.2)

  1. P1 Declared: the hand-off reports what the document's same-request-key: actions did, nothing the runtime invents.
  2. P2 No hidden divergence: the reference and BMH write the same heading and the same one line per completed call.
  3. P3 Honest gaps: only calls holding a key are listed; an effectful call with no key is not, and the docstring says so.
  4. P4 Host choices recorded: none.
  5. P5 Model-visible ⟺ logged: the lines are the member's own tool results, already in its transcript.
  6. P6 Cross-runtime evidence: BMH's completedCallsText (action-effects) is held to the same words.
  7. P7 Versioned and checked: no schema change.
  8. P8 Reusable: any runtime's hand-off can call stopped_by_rule or write its heading.
  9. P9 Platform rules: pure function over the member's RunResult.
  10. P10 Justified: a lead that reports a completed payment as not made breaks the one promise same-request-key: exists for.
  11. P11 Lane hygiene: CHANGELOG and counts in the PR.

A team member whose run a rule stopped reached its lead as "cashier stopped: stopped-by-rule",
without the rule's words or the payment the member had already made. `stopped_by_rule` now
writes the rule's words, then the heading `COMPLETED_CALLS_HEADING` and one line per call holding a
`same-request-key:` that the run completed, with what it returned.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jithinAB
jithinAB marked this pull request as ready for review November 21, 2026 09:59
@jithinAB
jithinAB merged commit 4dc05fd into master Nov 21, 2026
1 of 2 checks passed
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