CodeRabbit Results Implementation Plan

For Claude: REQUIRED SUB-SKILL: Use superpowers:executing-plans to implement this plan task-by-task.

Goal: Complete all tasks listed in tmp/coderabbit_results.md with spec-first changes, updated handlers/adapters/tools, tests, and just ci passing.

Architecture: Apply spec-first updates to SDS/SEA-DSL where required, then regenerate artifacts via the pipeline. Implement handwritten logic in adapters and application handlers to use transactions/outbox, safe parsing, and defensive response handling. Update IR→manifest merging to preserve IR metadata and handle mixed input shapes. Align documentation instructions and policies with the repository conventions. Follow TDD for every behavioral change.

Tech Stack: Python (handlers/tools), pytest, SDS/SEA-DSL pipeline (just pipeline llm-provider), Markdown documentation.

Task 1: Reproduce and Plan CodeRabbit Items

Files:

Step 1: Review tasks and classify generated vs handwritten

Step 2: Note spec-first items

Task 2: IR → Manifest Merge Logic (TDD)

Files:

Step 1: Write failing test for command merge + nullable type parsing

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
from tools.ir_to_manifest import merge_sds_cqrs

def test_merge_commands_preserves_existing_input_and_parses_nullable_types():
    cqrs = {
        "commands": {
            "CreateThing": {
                "input": {
                    "existing": {"type": "string", "required": True, "validation": {"min": 1}}
                }
            }
        },
        "queries": {},
    }
    sds = {
        "cqrs": {
            "commands": [
                {
                    "name": "CreateThing",
                    "input": {
                        "existing": {"type": "string"},
                        "optional_field": "number | null",
                    },
                }
            ]
        }
    }

    merged = merge_sds_cqrs(cqrs, sds, "ctx")
    cmd_input = merged["commands"]["CreateThing"]["input"]

    assert cmd_input["existing"]["validation"] == {"min": 1}
    assert cmd_input["optional_field"]["type"] == "number"
    assert cmd_input["optional_field"]["required"] is False

Step 2: Run test to verify it fails Run: python -m pytest tools/tests/test_ir_to_manifest.py::test_merge_commands_preserves_existing_input_and_parses_nullable_types -v Expected: FAIL (merge or nullable parsing missing).

Step 3: Write failing test for list inputs and query merge

1
2
3
4
5
6
7
8
9
10
11
12
13
14
def test_merge_queries_accepts_list_inputs_and_merges():
    cqrs = {
        "commands": {},
        "queries": {"FindThing": {"input": {"pre": {"type": "string", "required": True}}}},
    }
    sds = {"cqrs": {"queries": [{"name": "FindThing", "input": ["id", "scope"]}]}}

    merged = merge_sds_cqrs(cqrs, sds, "ctx")
    qry_input = merged["queries"]["FindThing"]["input"]

    assert qry_input["pre"]["type"] == "string"
    assert qry_input["id"]["type"] == "string"
    assert qry_input["scope"]["required"] is True

Step 4: Run test to verify it fails Run: python -m pytest tools/tests/test_ir_to_manifest.py::test_merge_queries_accepts_list_inputs_and_merges -v Expected: FAIL.

Step 5: Implement minimal merge + parsing in tools/ir_to_manifest.py

Step 6: Run tests Run: python -m pytest tools/tests/test_ir_to_manifest.py -v Expected: PASS.

Task 3: SDS Updates for LLM Provider (Spec-First)

Files:

Step 1: Update nullable fields

Step 2: Update QRY-002 output and description

Step 3: Validate and regenerate Run:

Task 4: LLM Provider Handler + Adapter Changes (TDD)

Files:

Step 1: Update/extend unit tests (RED)

Step 2: Run each test to verify failure Run each pytest target individually and confirm expected failures.

Step 3: Implement minimal fixes (GREEN)

Step 4: Run updated tests Run pytest for each updated module; confirm all green.

Task 5: Documentation Updates

Files:

Step 1: Write/update text per CodeRabbit tasks

Step 2: No tests required

Task 6: Checklist + CI

Files:

Step 1: Check off all tasks

Step 2: Run targeted tests

Step 3: Run full CI Run: just ci Expected: PASS.

Step 4: Summarize changes