Repository navigation
Commit 9bfbbad
refactor(contracts): finish the judge disclosure, and stop a sentence becoming eighteen
Review on #495 (LivXue), at 3a1bf07. Five of its findings; two it raised are
answered rather than taken, below.
The judge disclosure had reached two of its four homes. The two it had not are
``ActionModule.ask_judge`` on the paper and ``DefaultAction.ask_judge``, and
those are the ones a reader of the role protocol meets first. They survived
because they phrase the claim without naming anything the earlier fix touched:
"composed from each participant's judge", "asked after whatever the caller
passes". There is one caller and it passes nothing. Both now say so.
The test meant to pin that could not fail for the reason it was written. It
collected what the participant was asked and then asserted only that the
Charter still refused -- true before this PR and true after any wiring anyone
might add -- and it built a ``ParticipantHook`` it then dropped, so the factory
never ran and the collection could not have been non-empty whatever the
production code did. It now asserts the argument the registry hands the role,
which is the fact the three docstrings rest on. Mutation-checked by wiring a
participant through ``_verifier_refusals``: the old assertion stays green, the
new one turns red.
``compose_judge`` exploded a one-sentence refusal into one refusal per
character: a bare ``str`` satisfies ``Sequence[str]`` structurally, so nothing
in the annotation or a type checker objects. ``charter_code.run_judge`` coerced
it where this composition used to live and moving the composition out a layer
did not bring the handling along. Unreachable today -- the Charter path is
normalised before it arrives and no bundled plugin implements the verb -- but
this is the seam meant to carry generated judgements, and a bare string is a
plausible thing for one to answer. Coerced, with a test, mutation-checked.
Two records corrected. The type-only ``raven.contracts`` -> ``raven.agent``
edge, the first in the tree, is the price of moving ``Verdict`` and ``Intake``
off the paper; it costs nothing at import time and lint-imports does not see it
through ``exclude_type_checking_imports``, so it is now written beside the
contract it bends rather than left to be discovered. And the ledger entry for
the 3,200 -> 3,410 bump had been renamed but not refreshed, so it read as a
present-tense description of a file whose line count and exported names had
both moved; it is restored to the names it was written with, with a line saying
an entry is a dated record and not a description of today.
CONTEXT.md said a verb answers with "a list of names". None does --
``select_tools`` answers with definitions, which the paper spends a paragraph
insisting on.
Not taken, with reasons. The suggestion to read ``step.phase`` at
research_flow/flow.py:1000 instead of reconstructing from ``step.tools_ran``:
the two vocabularies coincide on ``after_iteration`` only.
gate chain (_phase keys) StepView.phase
before_user_inbound user_inbound
before_iteration iteration
before_execute_tools execute_tools
after_iteration after_iteration <- the only member they share
terminal_answerless answerless
after_send sent
That call site wants ``before_execute_tools``, the key ``_phase`` dispatches on,
where ``StepView.phase`` says ``execute_tools``, so substituting would route it
to a key with no gate behind it. The table is the reviewer's, built while
checking the reason rather than taking it. Two phase vocabularies overlapping on
exactly one member is a nasty shape: the shared member is the one a reader
samples, and it makes the two look like one vocabulary. The salvage narrowing belongs in
the PR description's Risk section and has been added there, not here.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent 2081f48 commit 9bfbbad
8 files changed
Lines changed: 104 additions & 22 deletions
File tree
- raven
- agent/harness
- contracts
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
175 | | - | |
| 174 | + | |
| 175 | + | |
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
606 | 606 | | |
607 | 607 | | |
608 | 608 | | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
609 | 622 | | |
610 | 623 | | |
611 | 624 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
49 | 51 | | |
50 | 52 | | |
51 | 53 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
175 | 183 | | |
176 | 184 | | |
177 | 185 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
49 | 55 | | |
50 | 56 | | |
51 | 57 | | |
| |||
350 | 356 | | |
351 | 357 | | |
352 | 358 | | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
353 | 367 | | |
354 | 368 | | |
355 | 369 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
144 | | - | |
| 143 | + | |
| 144 | + | |
145 | 145 | | |
146 | | - | |
147 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
148 | 151 | | |
149 | 152 | | |
150 | 153 | | |
| |||
221 | 224 | | |
222 | 225 | | |
223 | 226 | | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
224 | 242 | | |
225 | 243 | | |
226 | 244 | | |
| |||
231 | 249 | | |
232 | 250 | | |
233 | 251 | | |
234 | | - | |
| 252 | + | |
235 | 253 | | |
236 | 254 | | |
237 | 255 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
324 | 329 | | |
325 | 330 | | |
326 | 331 | | |
327 | 332 | | |
328 | | - | |
| 333 | + | |
329 | 334 | | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
334 | 339 | | |
335 | | - | |
336 | | - | |
| 340 | + | |
337 | 341 | | |
338 | 342 | | |
339 | 343 | | |
| 344 | + | |
340 | 345 | | |
341 | | - | |
342 | 346 | | |
343 | 347 | | |
344 | 348 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
451 | 474 | | |
452 | 475 | | |
453 | 476 | | |
| |||
0 commit comments