PR 2: Convert self-improvement loops to deterministic command+gate - #39
Merged
Conversation
PR 2 of deterministic workflow conversion. Updates self-test, self-perf, and self-improve workflows to use `command` steps for baseline/verify and `gate` on improvement loops (matching self-lint proof of concept). Creates new self-migrate.yml workflow. Converts all 5 commands to thin wrappers. Workflows: baseline prompt → command step, loop gains gate check - self-test.yml: prompt baseline → command, add gate (max 8) - self-perf.yml: prompt baseline → command, add gate (max 5) - self-improve.yml: prompt baseline → command, add gate (max 10) - self-migrate.yml: new file with command+gate (max 20) - self-lint.yml: unchanged (already done in PR #34) Commands: 5 files, ~643 lines removed
- Update README.md and ROADMAP.md: 15 → 16 workflows (new self-migrate.yml) - Document exit-code semantics for self-perf: benchmark must exit non-zero when target not met - Document gate semantics for self-migrate: use composite gate command for migration completeness detection - Clarify self-improve: metric command must exit non-zero when needed
The engine checks `until` against the LLM's text output (engine.go:460), not the gate command's exit code. Since all prompts instruct the LLM to "say DONE", the until condition must be "DONE" — not "exit code: 0" which never appears in LLM output. Without this fix, all self-improvement loops run to max iterations even after the gate passes, wasting tokens. Affects: self-lint, self-test, self-perf, self-improve, self-migrate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Second PR of the deterministic workflow conversion project.
commandsteps for baseline/verify andgateon improvement loops — matching theself-lint.ymlproof of concept from PR Add deterministic command steps and loop gates to workflow engine #34self-test.yml: prompt baseline → command step, loop gains gate (max 8)self-perf.yml: prompt baseline → command step, loop gains gate (max 5)self-improve.yml: prompt baseline → command step, loop gains gate (max 10)self-migrate.yml: new file with command+gate pattern (max 20)self-lint.yml: unchanged (already deterministic)Net: -643 lines of markdown command logic, +140 lines of deterministic YAML + thin wrappers. All 5 self-improvement workflows now enforce step sequence via the Go engine.
Test plan
devkit workflow run self-test "npm test"— engine runs baseline command, gates fix loopdevkit workflow run self-lint "npx eslint ."— existing proof of concept still worksdevkit workflow run self-improve "go vet ./..."— engine gates improvement loopdevkit workflow run self-perf "go test -bench=."— engine gates optimization loopdevkit workflow run self-migrate "npm test"— new workflow runs migration loop