Skip to content

docs(from-a-loop): Part 2, a software-factory loop that improves - #163

Merged
davidkpiano merged 2 commits into
nextfrom
davidkpiano/from-a-loop-part-2
Oct 19, 2026
Merged

davidkpiano merged 2 commits into
nextfrom
davidkpiano/from-a-loop-part-2

Conversation

@davidkpiano

@davidkpiano davidkpiano commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

This adds Part 2 to Migrating from a hand-rolled loop. It is for a reader whose software-factory loop is a while loop full of awaits.

  • New file examples/code-review-loop/before.ts: the factory as a plain while (round < 3) loop. Its inputs and outputs match the machine's requests and actors one to one. before.test.ts runs it with fakes.
  • Steps 6–11:
    • port the loop, with a table mapping each line to its machine construct;
    • split rules (guards) from judgment calls (a closed-choice decision);
    • write the goal and score;
    • store one trace per task;
    • prove the ship rule with canReach;
    • run an improvement round with run.ts --improve or the improve-machine skill in Claude Code.
  • The weakness test: when the reviewer fails mid-run, the loop throws and loses its progress. The machine keeps the round-2 patch and escalates to a person.

This was pushed to #162 after #162 merged, so it lands separately.

Verification: pnpm run check passes, pnpm docs:check reports 0 failed, and the code-review-loop tests pass (67).


Devin Review

… machine and improved from its traces; examples/code-review-loop/before.ts
@changeset-bot

changeset-bot Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 2847e22

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@statelyai/agent Patch
@statelyai/agent-demo Patch
@statelyai/example-next-host Patch
@statelyai/example-tanstack-ai-stream Patch
@statelyai/example-cloudflare-agent-host Patch
@statelyai/example-cloudflare-workers-ai-host Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@devin-ai-integration devin-ai-integration 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.

Devin Review found 4 potential issues.

Devin Review

Comment thread examples/code-review-loop/before.ts Outdated
Comment thread examples/code-review-loop/before.ts Outdated
Comment thread examples/code-review-loop/before.ts Outdated
Comment thread docs/from-a-loop.md
… person; before.ts matches the machine's rules
@coderabbitai

coderabbitai Bot commented Oct 19, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 370ce347-ee69-4d63-aa43-40a939dcc89d
📥 Commits

Reviewing files that changed from the base of the PR and between 9b692e5 and 2847e22.

📒 Files selected for processing: 8
  • .changeset/code-review-loop-novel-approval.md
  • docs/from-a-loop.md
  • examples/code-review-loop/README.md
  • examples/code-review-loop/before.test.ts
  • examples/code-review-loop/before.ts
  • examples/code-review-loop/environment.test.ts
  • examples/code-review-loop/environment.ts
  • llms.txt
+-------------------------------------------------------------------------------+
| GAST: GPU-Assisted Security Testing. Because SAST is too static for my taste. |
+-------------------------------------------------------------------------------+
  \
   \     /)/)
        ( '')
        /  |
      o(___)
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@davidkpiano
davidkpiano merged commit 5a78380 into next Oct 19, 2026
2 of 3 checks passed
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