Skip to content

feat: plan-time complexity stamps + delegate_model routing for delegated runs - #29

Merged
moui72 merged 15 commits into
mainfrom
feat/complexity-model-routing
Jul 27, 2026
Merged

feat: plan-time complexity stamps + delegate_model routing for delegated runs#29
moui72 merged 15 commits into
mainfrom
feat/complexity-model-routing

Conversation

@moui72

@moui72 moui72 commented Jul 26, 2026

Copy link
Copy Markdown
Owner

Implements the slate bundle plan-time-complexity-stamps + delegate-model-routing (plan plan-feat-complexity-model-routing-2026-07-25-fd96.md, approved; tasks tasks-feat-complexity-model-routing-884c.md, completed 9/9 by a delegated worktree run).

What

  • complexity: tasks-frontmatter stamp/ardd-plan stamps simple|moderate|complex at generation (same write as status: generating), surfaces it at the approval checkpoint, corrections via ardd-state.sh stamp <tasks-file> complexity <value>. Absent stays legal (all pre-feature files). Enum validated in lint-project.sh + ardd-state.sh, red-first fixture/regression coverage.
  • delegate_model constitution workflow field — single tier alias (haiku|sonnet|opus) or comma map simple=…,moderate=…,complex=…; validated in lint-project.sh and stamp (shared grammar), removable via unstamp. /ardd-implement's delegation step resolves it into the worktree Agent dispatch's model override: absent → inherit; alias → always; map → keyed by the tasks file's complexity:, unmapped/absent → inherit (asymmetric — nothing routes down implicitly). Fan-out resolves per selected file.
  • Docs: configuration.md delegate_model section; scripts.md stamp/unstamp inventories; ardd-plan reference page.
  • Register: both features tasked → implemented rides this branch.

Suites: test-ardd-state 158 ok, test-lint-project 29 ok (43 expected findings), lint-project + lint-docs clean; full suite green on every commit via the pre-commit hook.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added task plan complexity ratings (simple, moderate, complex) with approval-time review and correction.
    • Added delegated-run model routing via delegate_model, supporting either a single model alias or a complexity-to-model map.
    • Enabled setting and removing complexity and delegate_model through project state commands.
  • Documentation
    • Updated planning, implementation, configuration, and command/script references to reflect the new routing and approval workflow.
  • Bug Fixes
    • Strengthened validation to reject invalid complexity values, model aliases, malformed/duplicate mappings, and incorrect frontmatter.
  • Tests
    • Added regression coverage for the new stamping and linting behavior.

…outing

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 26, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

This PR records implementation plans for complexity stamps and delegated model routing, documents their workflows, adds frontmatter stamping and lint validation, updates delegation guidance, expands regression coverage, and records decisions about collaborative STATUS refresh behavior.

Changes

Complexity and delegate model routing

Layer / File(s) Summary
Feature plan and task definitions
.project/STATUS.md, .project/features/*, .project/plans/*, .project/tasks/*
Feature metadata is marked implemented, while plan and task documents define complexity stamps, delegate_model grammar, dispatch rules, phases, and verification work.
Plan approval and complexity stamping
skills/ardd-plan/SKILL.md, docs/reference/skills/ardd-plan.md
Plan approval now displays a complexity grade, revision can re-stamp it, and generated tasks files include complexity: simple|moderate|complex.
Stamping, linting, and regression coverage
scripts/ardd-state.sh, scripts/lint-project.sh, scripts/test-*.sh, tests/fixtures/*
State stamping and project linting validate the new fields, with tests covering replacement, removal, invalid values, duplicate mappings, and fixture findings.
Routing configuration and delegation behavior
docs/reference/configuration.md, docs/reference/scripts.md, skills/ardd-implement/SKILL.md
Documentation defines delegate_model, its aliases and maps, inheritance behavior, and per-tasks-file model resolution during delegation fan-out.

Collaborative STATUS workflow

Layer / File(s) Summary
STATUS refresh research and decision
.project/features/ci-status-refresh-on-main-coll.md, .project/plans/research-ci-status-refresh-on-main-coll-2026-07-27-0c1d.md
The main-branch STATUS regeneration proposal is marked rejected, and research documents the evaluated alternatives and recommended workflow.
Collaborative refresh invariant
.project/feedback/feedback-collab-status-refresh-before-pr-a28b.md
The planned feedback entry requires a terminal collaborative STATUS refresh on the feature branch before pushing a PR or draft PR.

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

Sequence Diagram(s)

sequenceDiagram
  participant Plan as /ardd-plan
  participant Tasks as Tasks file
  participant Lint as lint-project.sh
  participant Implement as /ardd-implement
  participant Agent as Delegated Agent
  Plan->>Tasks: Stamp complexity grade
  Lint->>Tasks: Validate complexity metadata
  Implement->>Tasks: Resolve complexity against delegate_model
  Implement->>Agent: Pass resolved model or inherit session model
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main changes: complexity stamps and delegate_model routing for delegated runs.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/complexity-model-routing

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

CI and others added 11 commits July 26, 2026 16:59
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…rogress

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…er (T003)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…mmar (T005)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…mmar (T006)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…atch (T007)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…s (T008)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…atures implemented (T009)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@moui72
moui72 marked this pull request as ready for review July 27, 2026 14:16

@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: 2

🤖 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 @.project/plans/plan-feat-complexity-model-routing-2026-07-25-fd96.md:
- Around line 111-120: Update the “Open Questions” section to record the
approved decisions: use haiku|sonnet|opus as tier aliases, and make absent
complexity inherit rather than route down even when simple= is present. Remove
wording that presents either choice as awaiting approval, while preserving the
implementation guidance.

In @.project/STATUS.md:
- Line 3: Refresh the status entry in STATUS.md to reflect the completed
complexity-model-routing implementation: replace the “planned + tasked” and 0/9
references with the supplied implemented feature records and completed tasks
file showing 9/9 tasks, update the register counts accordingly, and remove the
`/ardd-implement` recommendation in favor of the current next step.
🪄 Autofix (Beta)

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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 9150b9eb-d958-4747-a37e-145e05e6c7f2

📥 Commits

Reviewing files that changed from the base of the PR and between 7e45e6a and 07faa44.

📒 Files selected for processing (18)
  • .project/STATUS.md
  • .project/features/delegate-model-routing.md
  • .project/features/plan-time-complexity-stamps.md
  • .project/plans/plan-feat-complexity-model-routing-2026-07-25-fd96.md
  • .project/tasks/tasks-feat-complexity-model-routing-884c.md
  • docs/reference/configuration.md
  • docs/reference/scripts.md
  • docs/reference/skills/ardd-plan.md
  • scripts/ardd-state.sh
  • scripts/lint-project.sh
  • scripts/test-ardd-state.sh
  • scripts/test-lint-project.sh
  • skills/ardd-implement/SKILL.md
  • skills/ardd-plan/SKILL.md
  • tests/fixtures/bad-project/.project/artifacts/constitution.md
  • tests/fixtures/bad-project/.project/tasks/tasks-foo-aaaa.md
  • tests/fixtures/good-project/.project/artifacts/constitution.md
  • tests/fixtures/good-project/.project/tasks/tasks-foo-aaaa.md

Comment thread .project/STATUS.md
CI and others added 3 commits July 27, 2026 10:24
…ting

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… status-refresh-before-PR feedback, refresh STATUS

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@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: 2

🤖 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 @.project/feedback/feedback-collab-status-refresh-before-pr-a28b.md:
- Around line 1-4: Update the feedback item frontmatter status from open to
planned, and remove or revise the stale inline transition comment so it
accurately reflects the current planned state.

In @.project/plans/research-ci-status-refresh-on-main-coll-2026-07-27-0c1d.md:
- Around line 11-15: Update the referenced feature state in the research note so
it matches the `status: rejected` value recorded for
`ci-status-refresh-on-main-coll.md`, replacing the obsolete `backlogged` wording
while preserving the feature reference and date.
🪄 Autofix (Beta)

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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 4bf1685e-ad93-4f4d-91a5-6d9f23b19d2c

📥 Commits

Reviewing files that changed from the base of the PR and between 07faa44 and 191bea3.

📒 Files selected for processing (4)
  • .project/STATUS.md
  • .project/features/ci-status-refresh-on-main-coll.md
  • .project/feedback/feedback-collab-status-refresh-before-pr-a28b.md
  • .project/plans/research-ci-status-refresh-on-main-coll-2026-07-27-0c1d.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • .project/STATUS.md

Comment thread .project/feedback/feedback-collab-status-refresh-before-pr-a28b.md
@moui72
moui72 merged commit f79abe9 into main Jul 27, 2026
53 checks passed
moui72 pushed a commit that referenced this pull request Jul 30, 2026
…le base)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HnmhbSPHnwMVrxfVT3pTjy
moui72 pushed a commit that referenced this pull request Jul 30, 2026
…le base)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HnmhbSPHnwMVrxfVT3pTjy
moui72 added a commit that referenced this pull request Jul 31, 2026
… push (#30)

* chore(project): plan + tasks for collab status-refresh-before-PR invariant

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* chore(project): flip tasks-feat-collab-status-refresh in-progress

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat: collaborative coordinator refreshes STATUS.md before push (T001)

Re-scope the delegated-no-status note's trapped-write rationale to solo
mode and add the collaborative report-back sequence: side-effect checks,
ff feature branch onto the reported branch, mandatory /ardd-status
refresh + prune + commit before any push/PR offer.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat: inline collaborative refresh satisfies push invariant (T002)

Step 8's inline terminal /ardd-status is what satisfies the invariant in
collaborative mode; push/PR offers must follow it, never precede it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat: ardd-plan collaborative push waits for terminal status refresh (T003)

The terminal /ardd-status (refresh + prune) runs on the feature branch
and is committed before any terminal-state push/draft-PR offer, so a
plan-only PR's STATUS.md matches the plan/tasks state it carries.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* feat: scope ardd-status worktree prohibition, name collaborative norm (T004)

Feature-branch runs in the primary checkout are the required norm in
collaborative mode; the prohibition targets delegated worktrees (all
modes) plus solo mode's trapped-write case. States the shared invariant.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* docs: sync collaborative status-refresh invariant into CLAUDE.md + reference pages (T005)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* chore(project): complete tasks-feat-collab-status-refresh (T006 lint pass)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* chore(project): STATUS.md refresh before collab-status-refresh PR push

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HnmhbSPHnwMVrxfVT3pTjy

* chore(project): correct STATUS.md PR facts (#29 merged, #30 open, stale base)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HnmhbSPHnwMVrxfVT3pTjy

* chore(project): record PR #30 rebase onto main in STATUS.md

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HnmhbSPHnwMVrxfVT3pTjy

* docs(project): record the approved mid-run-push exemption in the plan

Addresses CodeRabbit review on PR #30: the Open Questions section still
asked for confirmation of a scoping decision that was approved at the
checkpoint and shipped in T001. Records the resolution instead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HnmhbSPHnwMVrxfVT3pTjy

---------

Co-authored-by: CI <ci@example.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
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