Repository navigation
feat!: replace workflow engine with skills-first kernel - #329
Draft
rochecompaan wants to merge 56 commits into
Draft
rochecompaan wants to merge 56 commits into
rochecompaan wants to merge 56 commits into
Conversation
Replace the deterministic workflow engine with a five-responsibility kernel: supervise one Pi process, claim and release an issue, derive the phase from git and the host, verify the outcome against the host, and keep stable names. All judgment moves into skills. Workflow state is never persisted.
The kernel assumes a repository that has never run Patchmill. Remove the transition section, the old run-directory rename in init, the removed-key list, the base-branch fallback for spec and plan discovery, and every clause that ports or keeps existing code. Replace them with a no-upgrade-path section and a matching acceptance criterion.
BREAKING CHANGE: the planning state machine, recovery, todo contract, and the run, skills, set-spec, and set-plan commands are gone. A skills-first kernel replaces them in the following commits.
Apply the user-approved limit to the design and implementation plan. Keep the counting method, both host adapters, and all production behavior unchanged.
Restore readable run summaries and progress while keeping agent protocol output in the logs. Keep planning pull requests from closing issues before implementation is complete.
tea has no atomic label swap. Removing first could leave an issue with no workflow label when the addition failed. A failed removal after a successful addition now reports the partial transition.
Title-derived names let a title edit reclassify an existing plan as the spec when both live in one directory. Specs now use YYYY-MM-DD-issue-N-design.md and plans use YYYY-MM-DD-issue-N-plan.md, generated and recognized only in names.ts. The canonicalPlan title exception is gone; hardlink identity checks remain.
A comment failure after completion labeling rewrote the result to stopped/needsInfo while the issue stayed agent-done. Finalization now builds one outcome from the verified label and summary, records label and comment failures as publicationErrors, and attempts the comment even when the label update fails. result.json, console output, and the return value share that outcome. The CLI exits 1 when publication fails.
collectFacts created or repaired the worktree for every caller, so a fresh --dry-run made a local branch and registered worktree before taking the issue lock. Observation now reads artifacts from the existing worktree, or else from the ref provisioning would check out, via the read-only workspaceSource. provisionWorkspace creates the worktree and is called only inside the claimed, locked run loop. Dry runs and post-phase verification only observe.
PullRequest now carries headRepository and baseBranch, and hosts list every same-named head instead of picking one by branch name. The kernel's findPullRequest is the one matcher for selection, gates, verification, and cost publication: the head must be the issue branch in origin's repository, so same-named branches from other forks are ignored while a PR from an origin fork still counts. The base is checked separately with wrongTarget. A PR open against or merged into another branch stops for a person and cannot pass a gate or finish the issue. Head commits are not part of the identity, so new pushes keep the same PR. Forgejo's origin parser moves to host/origin.ts and also accepts SSH host aliases.
Specs use YYYY-MM-DD-issue-N-<slug>-design.md and plans use YYYY-MM-DD-issue-N-<slug>-plan.md, so file names say what they are for. Recognition reads only the issue number and the final -design or -plan suffix, so a title edit cannot swap roles, even when both kinds share a directory. Earlier specs still match; earlier plans need a -plan suffix.
Takes pi-subagents 0.78.0 from #325 with the matching Nix npm hash. Drops the run-admission code from #324, because the kernel's per-issue lock replaces it, and keeps its spec as history. Drops the mockup checks from #323, because they depend on the removed workflow engine, and ports its skill parts: the vendored frontend-design and patchmill-frontend-review skills with their licenses and notices, the frontend design and mockup steps in patchmill-planning, and the frontend review step in patchmill-implementation. The installer, pack metadata, and docs list both new skills. The kernel does not check mockups or their spec links; the planning skill tells the agent to fix them before it finishes.
The kernel's init writes Patchmill paths to .git/info/exclude, so it fails outside a Git repository. The plan requires the smoke fixture to be a repository before it calls init, and the Nix smoke step now runs git init first.
rochecompaan
force-pushed
the
architecture/skills-first-kernel
branch
from
October 26, 2026 10:20
4182611 to
c43203e
Compare
This branch has not been deployed
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
Breaking changes
This is a breaking replacement, not an upgrade path. Old configuration, persisted workflow state, commands and labels have no compatibility layer. Use the new configuration and workflow documented in the README.
Size reduction
These counts compare the branch point
e422162with head437d667. They cover TypeScript insrc/andbin/and include comments and blank lines. The production count excludes.test.tsfiles and includes both host adapters.Recorded local verification
The saved integration results apply to head
437d667. The committed source matches the validated source hashes. No successful test or integration gate was rerun merely to prepare this PR.npm test: 537 passed, zero failures, cancellations or skips.npm run lint.npm run build.node scripts/smoke-packed-artifact.mjs.npm --prefix site run build: 16 pages built.nix build .#default --no-link.The final source corrections are accepted locally. A minor test-diagnostic cleanup remains deferred. Expected error-path diagnostics, packed-smoke dependency/authentication notices and site i18n/404 warnings remain disclosed, not treated as absent.
Pending acceptance
This PR is a draft because the live acceptance walkthrough remains unperformed. Creating this PR does not authorize the walkthrough or a merge. The following items remain open:
setup-test-repo,init,labels setup,triage,run-oncetospec-review, approve the spec and requeue, thenrun-oncetoagent-done.mainbranch.Full-flake checks, packaged-Nix runtime extension loading, Bun, other platforms/browser behavior and an exhaustive dependency security audit are not claimed. Default Nix building and offline extension loading prove only their named checks. Local review reports and validation logs remain Git-ignored and are not included in this PR.
Design and plan