Skip to content

perf(r1): slim role profiles with explicit Sol dispatch schema - #43

Merged
GhostXia merged 5 commits into
mainfrom
codex/issue-42-r1-info
Aug 12, 2026
Merged

perf(r1): slim role profiles with explicit Sol dispatch schema#43
GhostXia merged 5 commits into
mainfrom
codex/issue-42-r1-info

Conversation

@GhostXia

@GhostXia GhostXia commented Aug 12, 2026

Copy link
Copy Markdown
Owner

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.toml keeps the concise literal DISPATCH/BUDGET producer schema it must emit; - concrete task packets carry runtime IDs, paths, acceptance, constraints, and limits; - runtime_guard.py deterministically 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.py protects 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 at f9ebb56f3b1edd07324804e81d945f4f0a8b07f7 - 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 on main. 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 live fork_turns:none Sol smoke could not be executed from the current desktop shell because the packaged codex.exe is 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.

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The 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.

Changes

Lean router contract consolidation

Layer / File(s) Summary
Role contract consolidation
agents/*.toml, docs/r1-duplication-map.md
Sol, Luna, and Terra profiles now use concise shared-contract rules for dispatch, auditing, repair, escalation, budgets, and result envelopes. The duplication map records contract ownership, size changes, validation commands, and preserved anchors.
Production schema validation
scripts/validate_repo.py, tests/test_validate_repo.py
Validation adds budget fields to the Sol production schema, checks the root Skill document for all required fields, and tests missing-field reporting for the Sol profile.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

  • GhostXia/lean-dev-router issue 42 — The PR implements the contract deduplication described by this issue.

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main changes: slimming role profiles and defining an explicit Sol dispatch schema.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/issue-42-r1-info

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@GhostXia
GhostXia changed the base branch from codex/issue-40-contract-dedup to main August 12, 2026 11:30
@GhostXia GhostXia changed the title perf(r1): slim agent profiles and validate contract schema at root skill perf(r1): slim role profiles with explicit Sol dispatch schema Aug 12, 2026
@GhostXia
GhostXia marked this pull request as ready for review August 12, 2026 12:41

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3f7d19e and f9ebb56.

📒 Files selected for processing (6)
  • agents/luna-worker.toml
  • agents/sol-planner.toml
  • agents/terra-auditor.toml
  • docs/r1-duplication-map.md
  • scripts/validate_repo.py
  • tests/test_validate_repo.py

Comment thread docs/r1-duplication-map.md Outdated
Comment thread docs/r1-duplication-map.md Outdated
Comment thread scripts/validate_repo.py
@GhostXia

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@GhostXia
GhostXia merged commit c701006 into main Aug 12, 2026
2 checks passed
@GhostXia
GhostXia deleted the codex/issue-42-r1-info branch August 12, 2026 14:58
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