perf(r1): slim role profiles with explicit Sol dispatch schema - #43
Conversation
📝 WalkthroughWalkthroughThe PR consolidates Sol, Luna, and Terra routing instructions around the Skill contract, adds Sol budget-schema validation, documents duplication and size reductions, and tests missing production-schema fields. ChangesLean router contract consolidation
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/r1-duplication-map.md`:
- Line 35: Update the envelope PROTOCOL|AGENT|STATUS row in the duplication map
so every literal pipe within the cell is escaped, preserving the intended
single-cell value and matching the table’s eight-column structure.
- Around line 44-54: Label the “文件规模” table in docs/r1-duplication-map.md as
pre-change data, making clear that its values represent the before-reduction
state and align with the later “改前字符” figures. Keep the table contents
unchanged.
In `@scripts/validate_repo.py`:
- Around line 41-48: Replace the bare entries in
BUDGET_FIELDS/SOL_PRODUCTION_SCHEMA with patterns matching required protocol
labels, then validate those patterns within the fenced Sol DISPATCH packet at
scripts/validate_repo.py:169-170 rather than across all instructions. Apply the
shared-schema validation within the root Skill protocol section or template at
scripts/validate_repo.py:449-455. Update tests/test_validate_repo.py:252-274 to
remove a field only from its packet location while retaining narrative
occurrences, ensuring validation rejects the missing packet field.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 94ae6c40-05f2-4b49-b6ff-a6ec0541898a
📒 Files selected for processing (6)
agents/luna-worker.tomlagents/sol-planner.tomlagents/terra-auditor.tomldocs/r1-duplication-map.mdscripts/validate_repo.pytests/test_validate_repo.py
|
@coderabbitai review |
|
Summary R1-info separates four responsibilities instead of assuming a custom Agent receives the root Skill text: - root Skill and variants document the shared v2 protocol; -
sol-planner.tomlkeeps the concise literal DISPATCH/BUDGET producer schema it must emit; - concrete task packets carry runtime IDs, paths, acceptance, constraints, and limits; -runtime_guard.pydeterministically validates and enforces concrete packets, budgets, revisions, repairs, and audits. Luna and Terra remain narrow role-local profiles. They do not duplicate Sol's producer schema or the complete root Skill. - Added duplication map: contract concept occurrences across seven runtime files. - Profile reduction against the pre-R1 baseline: -sol-planner.toml: 5,315 -> 3,541 characters (-33.4%) -luna-worker.toml: 4,247 -> 2,330 characters (-45.1%) -terra-auditor.toml: 4,383 -> 3,114 characters (-28.9%) - total: 13,945 -> 8,985 characters (-35.6%) -validate_repo.pyprotects the full producer schema only in Sol while retaining role-local restrictions for Luna and Terra. - Mutation coverage rejects loss of Sol identity, missing packet-local DISPATCH/BUDGET labels, and ambiguous fenced DISPATCH packets. ## Validation -python -m unittest discover -s tests -v: 67 passed, 1 skipped on Windows -python scripts/validate_repo.py: passed - scope check: passed atf9ebb56f3b1edd07324804e81d945f4f0a8b07f7- independent reverse audit of PR #41 and PR #43: passed after correcting stale duplication-map figures -git diff --check: clean ## Review note #41 is already merged and this PR is based onmain. The earlier blocker was too broad: custom Agents do not need the complete root Skill copied into every profile. Sol does need a closed producer interface because it creates DISPATCH packets; Luna and Terra receive concrete packets and remain protected by deterministic parent/runtime gates. A livefork_turns:noneSol smoke could not be executed from the current desktop shell because the packagedcodex.exeis access-restricted. Static mutation tests, deterministic runtime gates, a real fail-closed Luna repair probe, and independent causal audit passed. Ref #42 ## Summary by CodeRabbit * New Features * Added clearer planning, dispatch, auditing, authorization, scope, budget, and escalation requirements for development workflows. * Added documentation describing protocol responsibilities, duplication, file-size changes, and validation expectations. * Validation * Expanded repository checks to verify required budget and dispatch protocol fields. * Added tests confirming planner profiles include the complete required schema.