Skip to content

AIG-631 Add M0 agentic TDD workflow and README positioning#46

Merged
blackms merged 1 commit into
mainfrom
codex/m0-agentic-tdd-workflow
May 29, 2026
Merged

AIG-631 Add M0 agentic TDD workflow and README positioning#46
blackms merged 1 commit into
mainfrom
codex/m0-agentic-tdd-workflow

Conversation

@blackms
Copy link
Copy Markdown
Owner

@blackms blackms commented May 29, 2026

Summary

  • Add an M0 agentic TDD workflow template with intake, parallel discovery, red-first tests, implementation, adversarial review, peer review, and release handoff.
  • Update README positioning for AIG-631 with a short outcome tagline, three proof-backed above-fold pillars, and who should/should not use aistack.
  • Fix workflow DSL parallel fan-out error propagation so failed child steps fail the parent gate.
  • Add guard tests for README claims and M0 workflow retry handoffs.

Verification

  • npm run test:unit
  • npm run typecheck
  • npm run lint
  • npm run build
  • npx vitest run --config vitest.integration.config.ts --reporter=dot

Linear

Refs AIG-631. Related M0 workflow/process hardening for AIG-629 follow-up.

Summary by CodeRabbit

  • New Features

    • Introduced M0 TDD agentic workflow template for iterative, verdict-gated delivery.
    • Improved parallel-step error reporting to surface aggregated child failures.
  • Documentation

    • Rewrote README hero, positioning, examples, and proof grid; clarified programmatic and REST/web API usage and removed prior CLI snippets.
    • Expanded DSL quick start and workflow guidance; updated project/tooling counts and MCP tools note.
  • Tests

    • Added README positioning validation and comprehensive workflow-template/unit tests; tightened parallel-failure assertions.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 71eff925-5938-4ca4-95ac-7a68a1e49b8a

📥 Commits

Reviewing files that changed from the base of the PR and between 08f16ee and e08586d.

📒 Files selected for processing (9)
  • README.md
  • docs/API.md
  • docs/HLD.md
  • docs/WORKFLOW_DSL.md
  • src/workflows/dsl/executor.ts
  • templates/workflows/m0-agentic-tdd.yaml
  • tests/unit/readme-positioning.test.ts
  • tests/unit/workflows/dsl/executor.test.ts
  • tests/unit/workflows/dsl/templates.test.ts
✅ Files skipped from review due to trivial changes (1)
  • docs/API.md
🚧 Files skipped from review as they are similar to previous changes (8)
  • tests/unit/workflows/dsl/executor.test.ts
  • tests/unit/readme-positioning.test.ts
  • docs/HLD.md
  • src/workflows/dsl/executor.ts
  • templates/workflows/m0-agentic-tdd.yaml
  • docs/WORKFLOW_DSL.md
  • tests/unit/workflows/dsl/templates.test.ts
  • README.md

📝 Walkthrough

Walkthrough

This PR adds an M0 agentic TDD workflow template and quick-start docs, aggregates parallel child errors into parent step errors in the DSL executor, updates README/API/HLD positioning and usage examples to emphasize local adversarial review loops, and adds unit tests for the workflow and README content.

Changes

M0 TDD Workflow Feature

Layer / File(s) Summary
Parallel execution error aggregation
src/workflows/dsl/executor.ts, tests/unit/workflows/dsl/executor.test.ts
Executor aggregates errors from parallel child steps into the parent step's error field; unit test asserts the error message includes parallel child failed.
M0 TDD workflow template and DSL documentation
templates/workflows/m0-agentic-tdd.yaml, docs/WORKFLOW_DSL.md, tests/unit/workflows/dsl/templates.test.ts
Adds m0-agentic-tdd.yaml orchestration (intake, parallel discovery, red-first TDD plan, iterative red-tests→implement→verify loops, adversarial & peer review gates, docs-and-status, release-check). WORKFLOW_DSL quickstart and runner-metadata docs updated. Tests validate template structure and deterministic execution including rejection-driven looping and propagation of prior outputs into subsequent implement attempts.
M0 marketing and positioning content
README.md, docs/API.md, docs/HLD.md, tests/unit/readme-positioning.test.ts
README hero and feature grid rewritten to emphasize an adversarial review loop and local multi-agent delivery; Example snippets updated (TypeScript logging and REST/web API), clarified review loops aren't MCP tools; API/HLD notes updated to reference REST/web API; new README positioning tests added.

Sequence Diagram(s)

sequenceDiagram
  participant Issue
  participant Intake
  participant Discovery
  participant TestPlan
  participant RedTests
  participant Implement
  participant Verify
  participant AdversarialReview
  participant PeerReview
  participant Docs
  participant ReleaseCheck
  Issue->>Intake: scope M0 issue
  Intake->>Discovery: emit contract
  par ParallelDiscovery
    Discovery->>Discovery: product brief
    Discovery->>Discovery: technical map
    Discovery->>Discovery: test brief
  end
  Discovery->>TestPlan: merge outputs
  TestPlan->>RedTests: emit TDD plan
  loop Red-first cycle
    RedTests->>TestPlan: on_reject
    RedTests->>Implement: failing tests
  end
  loop Verify-implement loop
    Implement->>Verify: code changes
    Verify->>Implement: on_reject
  end
  Implement->>AdversarialReview: implementation
  loop Adversarial loop
    AdversarialReview->>Implement: on_reject
  end
  AdversarialReview->>PeerReview: results
  loop Peer loop
    PeerReview->>Implement: on_reject
  end
  PeerReview->>Docs: approval
  Docs->>ReleaseCheck: handoff notes
  ReleaseCheck->>Issue: final checklist
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

A rabbit hops through M0 gates so tight,
Red tests first, then code shines bright.
Adversarial foes must lose their fight,
Peers nod as loops converge just right,
Handoff complete — the release feels light. 🐰✨

🚥 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main changes: adding an M0 agentic TDD workflow template and updating README positioning to reflect the project's positioning for that workflow.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/m0-agentic-tdd-workflow

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

tests/unit/readme-positioning.test.ts

Parsing error: "parserOptions.project" has been provided for @typescript-eslint/parser.
The file was not found in any of the provided project(s): tests/unit/readme-positioning.test.ts

tests/unit/workflows/dsl/executor.test.ts

Parsing error: "parserOptions.project" has been provided for @typescript-eslint/parser.
The file was not found in any of the provided project(s): tests/unit/workflows/dsl/executor.test.ts

tests/unit/workflows/dsl/templates.test.ts

Parsing error: "parserOptions.project" has been provided for @typescript-eslint/parser.
The file was not found in any of the provided project(s): tests/unit/workflows/dsl/templates.test.ts


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 and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@tests/unit/readme-positioning.test.ts`:
- Line 9: The current computation of aboveFold (const aboveFold =
readme.slice(0, readme.indexOf('---'))) misbehaves when readme.indexOf('---')
=== -1; explicitly compute const sepIndex = readme.indexOf('---') and then set
aboveFold = readme.slice(0, sepIndex === -1 ? readme.length : sepIndex) (or use
the full readme as the fallback) so the slice doesn't drop the last character
when the separator is missing; update the aboveFold declaration to use sepIndex
and add a brief comment explaining the fallback.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: d0d95637-10cb-4b71-abe4-606d95e69925

📥 Commits

Reviewing files that changed from the base of the PR and between d1b64a2 and ef1b73b.

📒 Files selected for processing (9)
  • README.md
  • docs/API.md
  • docs/HLD.md
  • docs/WORKFLOW_DSL.md
  • src/workflows/dsl/executor.ts
  • templates/workflows/m0-agentic-tdd.yaml
  • tests/unit/readme-positioning.test.ts
  • tests/unit/workflows/dsl/executor.test.ts
  • tests/unit/workflows/dsl/templates.test.ts

Comment thread tests/unit/readme-positioning.test.ts Outdated
@blackms blackms force-pushed the codex/m0-agentic-tdd-workflow branch from ef1b73b to 8c80029 Compare May 29, 2026 07:32
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
README.md (2)

71-81: 💤 Low value

Consider specifying language for fenced code block.

The code fence at line 71 lacks a language identifier. While this is a text example rather than code, specifying text or leaving it as plain backticks improves markdown consistency.

📝 Proposed fix
-```
+```text
 You ask: "Create a login API endpoint with tests"
🤖 Prompt for 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.

In `@README.md` around lines 71 - 81, The fenced code block containing the line
You ask: "Create a login API endpoint with tests" should include a language
identifier for consistency; update the opening fence from ``` to ```text so the
block is explicitly marked as plain text (search for the exact quoted line to
find the block and change the opening backticks only).

523-530: ⚡ Quick win

Clarify relationship between MCP note and DSL workflow example.

The note at lines 523-524 states that review loops aren't MCP tools and directs users to TypeScript/REST APIs. However, the DSL template example immediately following (lines 526-530) shows a third way to run review loops via workflow templates. While technically correct, this sequencing might confuse readers about which approach to use.

Consider either:

  1. Moving the DSL example before the MCP note, or
  2. Updating the note to acknowledge DSL workflows as a third option
📝 Proposed clarification
 Review loops are not registered as MCP tools yet. Use MCP for agents, memory, tasks,
-identity, consensus, sessions, system status, and GitHub tools.
+identity, consensus, sessions, system status, and GitHub tools. For review loops,
+use the TypeScript API, REST/web API, or DSL workflow templates.
🤖 Prompt for 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.

In `@README.md` around lines 523 - 530, The README's sequencing is potentially
confusing: the MCP note ("review loops are not registered as MCP tools") appears
before a DSL workflow example ("npx `@blackms/aistack` workflow run
templates/workflows/adversarial-review.yaml..."), which can mislead readers;
update the README so the relationship is explicit by either moving the DSL
example above the MCP note or by editing the MCP note to explicitly acknowledge
a third option — DSL workflow templates — and briefly state when to choose MCP
vs DSL vs TypeScript/REST APIs; refer to the MCP note text and the DSL example
command string to locate and update the content.
🤖 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.

Nitpick comments:
In `@README.md`:
- Around line 71-81: The fenced code block containing the line You ask: "Create
a login API endpoint with tests" should include a language identifier for
consistency; update the opening fence from ``` to ```text so the block is
explicitly marked as plain text (search for the exact quoted line to find the
block and change the opening backticks only).
- Around line 523-530: The README's sequencing is potentially confusing: the MCP
note ("review loops are not registered as MCP tools") appears before a DSL
workflow example ("npx `@blackms/aistack` workflow run
templates/workflows/adversarial-review.yaml..."), which can mislead readers;
update the README so the relationship is explicit by either moving the DSL
example above the MCP note or by editing the MCP note to explicitly acknowledge
a third option — DSL workflow templates — and briefly state when to choose MCP
vs DSL vs TypeScript/REST APIs; refer to the MCP note text and the DSL example
command string to locate and update the content.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 695115bd-9814-493d-9d3c-4fc3c2b65f25

📥 Commits

Reviewing files that changed from the base of the PR and between ef1b73b and 8c80029.

📒 Files selected for processing (9)
  • README.md
  • docs/API.md
  • docs/HLD.md
  • docs/WORKFLOW_DSL.md
  • src/workflows/dsl/executor.ts
  • templates/workflows/m0-agentic-tdd.yaml
  • tests/unit/readme-positioning.test.ts
  • tests/unit/workflows/dsl/executor.test.ts
  • tests/unit/workflows/dsl/templates.test.ts
✅ Files skipped from review due to trivial changes (2)
  • docs/WORKFLOW_DSL.md
  • docs/HLD.md
🚧 Files skipped from review as they are similar to previous changes (6)
  • docs/API.md
  • templates/workflows/m0-agentic-tdd.yaml
  • src/workflows/dsl/executor.ts
  • tests/unit/workflows/dsl/templates.test.ts
  • tests/unit/workflows/dsl/executor.test.ts
  • tests/unit/readme-positioning.test.ts

@blackms blackms force-pushed the codex/m0-agentic-tdd-workflow branch from 8c80029 to 08f16ee Compare May 29, 2026 09:16
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@README.md`:
- Line 5: The README uses an h3 heading "Claude Code's adversarial layer for
code that survives review." immediately after the h1, causing a heading-level
jump (MD001); update that line by changing the leading "###" to "##" (or convert
the line to plain paragraph text) so the heading level increments properly and
satisfies the markdown lint rule.
🪄 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: defaults

Review profile: CHILL

Plan: Pro

Run ID: fd0f1cad-0469-43a9-a0a9-15d059996826

📥 Commits

Reviewing files that changed from the base of the PR and between 8c80029 and 08f16ee.

📒 Files selected for processing (9)
  • README.md
  • docs/API.md
  • docs/HLD.md
  • docs/WORKFLOW_DSL.md
  • src/workflows/dsl/executor.ts
  • templates/workflows/m0-agentic-tdd.yaml
  • tests/unit/readme-positioning.test.ts
  • tests/unit/workflows/dsl/executor.test.ts
  • tests/unit/workflows/dsl/templates.test.ts
✅ Files skipped from review due to trivial changes (2)
  • docs/HLD.md
  • docs/API.md
🚧 Files skipped from review as they are similar to previous changes (6)
  • tests/unit/readme-positioning.test.ts
  • docs/WORKFLOW_DSL.md
  • src/workflows/dsl/executor.ts
  • tests/unit/workflows/dsl/executor.test.ts
  • templates/workflows/m0-agentic-tdd.yaml
  • tests/unit/workflows/dsl/templates.test.ts

Comment thread README.md Outdated
@blackms blackms force-pushed the codex/m0-agentic-tdd-workflow branch from 08f16ee to e08586d Compare May 29, 2026 09:20
Copy link
Copy Markdown
Owner Author

@blackms blackms left a comment

Choose a reason for hiding this comment

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

Reviewed current head e08586d after the iterative fixes. No active findings remain. The remaining CodeRabbit inline comments are outdated on previous commits (line=null), and current CI is green.

@blackms blackms merged commit 1753441 into main May 29, 2026
6 checks passed
@blackms blackms deleted the codex/m0-agentic-tdd-workflow branch May 29, 2026 09:23
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