feat(reason): R3 VERDICT-driven dispatch + feedback close-the-loop (#645) - #665
Conversation
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Sorry @robotrocketscience, you have reached your weekly rate limit of 2500000 diff characters.
Please try again later or upgrade to continue using Sourcery
PR-size soft capThis PR is over the advisory size threshold:
Bigger PRs collide with more open work, which under the parallel-session workflow tends to produce repeated This is advisory only — nothing is blocked. If the size is intentional (large refactor, module removal, generated code), apply the |
Pure-derivation helpers consumed by /aelf:reason's slash skill: dispatch_policy(verdict, impasses) maps each impasse to a typed DispatchItem (Verifier / Gap-filler / Fork-resolver), and suggested_updates(verdict, impasses, hops) emits the (belief_id, direction) rows for the SUGGESTED UPDATES section. Direction is +1 (confident hop on chain), ? (impasse locus), or -1 (deferred until R2 ships fork-path data; never emitted by this surface).
…R3) Augments the --json payload from R1 with two additive top-level keys: `dispatch` (one row per impasse, role-tagged Verifier / Gap-filler / Fork-resolver) and `suggested_updates` (belief_id, direction, note rows). The slash skill consumes both from one payload instead of re-running the policy off-band.
… R3) Expand the slash markdown from a verbatim CLI wrapper to a three-step dispatch script: invoke `aelf reason --json`, fan out one Task subagent per `payload.dispatch[i]` with role-tagged prompt scaffolds (Verifier / Gap-filler / Fork-resolver), then emit SUGGESTED UPDATES from `payload.suggested_updates`. Adds Task to allowed-tools. The Python side (R3 commit 1+2) owns the contract; the markdown only describes how the host agent acts.
…R3) - Drop unused 'import pytest' (CodeQL py/unused-import note). - Iterate list(Verdict) instead of Verdict directly so CodeQL's py/non-iterable-in-for-loop heuristic doesn't trip on the str-Enum subclass. Behavior is unchanged.
2d8c9ba to
03c7d23
Compare
|
Rebased on
Pytest failures on the prior run were |
|
[claim:review:pascal:2026-05-11T18:44:53Z] |
|
LGTM — implements #659 R3 cleanly. Four signed atomic commits, all CI green, FF-clean against current Acceptance (vs #659):
Design observations:
R2 interaction (#658): R3 correctly avoids consuming Test coverage: 14 unit tests (every verdict × impasse mapping, dedup, low-evidence gate, FF against main — adding |
|
[release:review:pascal:2026-05-11T18:46:14Z] |
|
merge-train: merged 03c7d23 → |
Closes #659 (R3 sub-task of wonder/reason umbrella #645).
What ships
The slash-layer behavior that closes the loop on
aelf reason's verdict + impasse derivation (R1, #660). Four atomic commits:feat(reason): dispatch policy + suggested-updates derivation— adds two pure functions tosrc/aelfrice/reason.py:dispatch_policy(verdict, impasses) -> list[DispatchItem]maps each impasse to a typedDispatchItemwhoseroleis one ofVerifier/Gap-filler/Fork-resolver(mapping:CONSTRAINT_FAILURE → Verifier,GAP / NO_CHANGE → Gap-filler,TIE → Fork-resolver).suggested_updates(verdict, impasses, hops) -> list[SuggestedUpdate]emits(belief_id, direction, note)rows with direction+1(confident hop not on any impasse),?(impasse locus), or-1(reserved for R2 fork-path data; never emitted from this surface).feat(cli): aelf reason --json emits dispatch + suggested_updates— augments the existing R1--jsonpayload with two additive top-level keys.feat(slash): /aelf:reason VERDICT-driven dispatch + feedback loop— expandsslash_commands/reason.mdfrom a verbatim CLI wrapper into a three-step dispatch script: present chain, fan out oneTasksubagent perdispatch[i]with role-tagged prompt scaffolds in parallel, then print SUGGESTED UPDATES fromsuggested_updates. AddsTasktoallowed-tools.docs(changelog): unreleased entry for #659 R3 dispatch + feedback loop.Dispatch policy
SUFFICIENTPARTIALUNCERTAININSUFFICIENTCONTRADICTORYWithin each verdict, role is derived from impasse kind, not verdict — so a
PARTIALverdict with bothCONSTRAINT_FAILUREandGAPimpasses dispatches one Verifier and one Gap-filler.SUGGESTED UPDATES direction rules
+1— confident hop (alpha + beta ≥ CONFIDENT_TRIALS_MIN) that is not the locus of any impasse. Suppressed entirely underINSUFFICIENT(no chain to vote on).?— belief appears in any impasse'sbelief_ids. Surfaced for manual review, never auto-piped.-1— deferred to a follow-up after R2 (feat(reason): R2 — compound confidence decay + CONTRADICTS fork (#645 sub-task) #658) ships fork-path data; this surface emits zero-1rows.If a belief is both confident-on-chain and on an impasse, the
?row wins (impasse evidence takes precedence; the caller's manual review is the right path).Concurrency with R2 (#658)
R2 adds
ConsequencePathwithcompound_confidence,weakest_link_belief_id,fork_from. None of those fields appear in this PR — R3 consumes R1's surface only. When R2 lands, the slash skill's Fork-resolver prompts can be sharpened to use compound-decay scores instead of raw posterior means; that wiring is a small follow-up that doesn't churn R3's external contract.Acceptance check
slash_commands/reason.mdreads the structured payload, branches dispatch onverdict, and emits role-tagged subagent prompts (Taskin allowed-tools).SUGGESTED UPDATESsection emits(belief_id, direction)triples on every call where the policy yields rows.aelf reason --json→ payload containsdispatchandsuggested_updateswith the right shape and role labels.?-wins-over-+1tie-breaker.Test plan
uv run pytest tests/test_reason_dispatch.py tests/test_reason_classify.py tests/test_cli_reason_wonder.py -v→ 50+ passed (R1 untouched, R3 unit + CLI tests).uv run pytest tests/ --ignore=tests/bench_gate -q→ 3402 passed, 30 skipped, 0 failed.github/mainis clean.Out of scope
-1SUGGESTED UPDATES rows (depends on R2 fork-path data).+1rows intoaelf feedback(the slash skill surfaces the rows; the caller / operator decides whether to apply them).