M3 — Stage 1: Implement #13
Loading…
Reference in a new issue
No description provided.
Delete branch "issue-4/stage-1-implement"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Implements M3 — Stage 1: Implement (#4): turns
jira-context.jsoninto animplementation.diffby running a fresh, least-privilege pi agent session inside the target repo, bracketed by a deterministic git preflight and diff capture.Closes #4.
Changes
src/shared/git(new cross-cutting module; reused by Remediate/M5):makeGitRunner— injectableGitRunneroverexecFilewith a largemaxBufferfor big diffs.isWorkingTreeClean/assertCleanWorkingTree(throwsGitError) /captureBaseRef(git rev-parse HEAD).captureDiff—git diff -- . ':(exclude).pi-loop', enforcing the artifact-exclusion invariant.src/artifacts:writeImplementationDiff/readImplementationDiff/implementationDiffPath(verbatim round-trip).src/implement(new module):buildImplementWrapper()— thin pipeline-contract wrapper (inputs, artifact target, exit condition, no.pi-loop/, no commit).buildImplementUserPrompt(context)— rendersJiraContext(handles null/blank acceptance criteria & empty lists).IMPLEMENT_TOOLSallowlist (read, bash, edit, write, grep, find, ls) +DEFAULT_IMPLEMENT_SKILL_BODY.runImplementStage(...)— preflight → compose prompt (skill body + degrade-to-default) → run pi session → capture + persist diff. All external effects are injectable seams.Testing
tsc --noEmit,eslint .,prettier --check .clean.pi-loop/out of the diff; preflight reads clean once.pi-loop/is in.git/info/excludeChecklist
Notes / scope
runImplementStageinto the CLI/end-to-end orchestration is M8, not this milestone.