Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ The command writes:
- `.kaizen/builder/self-review.json`
- `.kaizen/builder/build-result.json`
- `.kaizen/builder/iterations/<n>/implementation-summary.json`
- `.kaizen/builder/iterations/<n>/changed-files.json`
- `.kaizen/builder/iterations/<n>/discovered-issues.json`
- `.kaizen/builder/iterations/<n>/self-review.json`
- `.kaizen/builder/iterations/<n>/improvement-instructions.json`
- `.kaizen/builder/iterations/<n>/residual-notes.json`
Expand Down
2 changes: 1 addition & 1 deletion dist/artifacts.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions dist/artifacts.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ export async function writeBuildArtifacts(outDir, result) {
await mkdir(iterationDir, { recursive: true });
const paths = {
implementationSummaryPath: join(iterationDir, "implementation-summary.json"),
changedFilesPath: join(iterationDir, "changed-files.json"),
discoveredIssuesPath: join(iterationDir, "discovered-issues.json"),
selfReviewPath: join(iterationDir, "self-review.json"),
improvementInstructionsPath: join(iterationDir, "improvement-instructions.json"),
residualNotesPath: join(iterationDir, "residual-notes.json")
};
await writeJson(paths.implementationSummaryPath, { summary: artifact.implementationSummary });
await writeJson(paths.changedFilesPath, artifact.changedFiles);
await writeJson(paths.discoveredIssuesPath, artifact.discoveredIssues);
await writeJson(paths.selfReviewPath, artifact.review);
await writeJson(paths.improvementInstructionsPath, artifact.improvementInstructions);
await writeJson(paths.residualNotesPath, artifact.residualNotes);
Expand Down
2 changes: 2 additions & 0 deletions dist/builder/BuilderAgent.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ function createIterationArtifact({ iteration, implementation, review, improvemen
return {
iteration,
implementationSummary: summarizeImplementation(implementation),
changedFiles: extractChangedFiles(implementation),
discoveredIssues: extractDiscoveredIssues(implementation),
review: cloneJsonValue(review),
improvementInstructions: cloneJsonValue(improvementInstructions),
residualNotes: extractResidualNotes(implementation)
Expand Down
4 changes: 4 additions & 0 deletions dist/types/contracts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ export interface BuilderAdapter {
export interface IterationArtifact {
iteration: number;
implementationSummary: string;
changedFiles: string[];
discoveredIssues: DiscoveredIssue[];
review: SelfReviewResult;
improvementInstructions: string[];
residualNotes: string[];
Expand All @@ -126,6 +128,8 @@ export interface BuildArtifactPaths {
iterationArtifactPaths: Array<{
iteration: number;
implementationSummaryPath: string;
changedFilesPath: string;
discoveredIssuesPath: string;
selfReviewPath: string;
improvementInstructionsPath: string;
residualNotesPath: string;
Expand Down
2 changes: 1 addition & 1 deletion dist/types/contracts.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/artifacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ export async function writeBuildArtifacts(outDir: string, result: BuildResult):

const paths = {
implementationSummaryPath: join(iterationDir, "implementation-summary.json"),
changedFilesPath: join(iterationDir, "changed-files.json"),
discoveredIssuesPath: join(iterationDir, "discovered-issues.json"),
selfReviewPath: join(iterationDir, "self-review.json"),
improvementInstructionsPath: join(iterationDir, "improvement-instructions.json"),
residualNotesPath: join(iterationDir, "residual-notes.json")
};

await writeJson(paths.implementationSummaryPath, { summary: artifact.implementationSummary });
await writeJson(paths.changedFilesPath, artifact.changedFiles);
await writeJson(paths.discoveredIssuesPath, artifact.discoveredIssues);
await writeJson(paths.selfReviewPath, artifact.review);
await writeJson(paths.improvementInstructionsPath, artifact.improvementInstructions);
await writeJson(paths.residualNotesPath, artifact.residualNotes);
Expand Down
2 changes: 2 additions & 0 deletions src/builder/BuilderAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,8 @@ function createIterationArtifact({ iteration, implementation, review, improvemen
return {
iteration,
implementationSummary: summarizeImplementation(implementation),
changedFiles: extractChangedFiles(implementation),
discoveredIssues: extractDiscoveredIssues(implementation),
review: cloneJsonValue(review),
improvementInstructions: cloneJsonValue(improvementInstructions),
residualNotes: extractResidualNotes(implementation)
Expand Down
4 changes: 4 additions & 0 deletions src/types/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ export interface BuilderAdapter {
export interface IterationArtifact {
iteration: number;
implementationSummary: string;
changedFiles: string[];
discoveredIssues: DiscoveredIssue[];
review: SelfReviewResult;
improvementInstructions: string[];
residualNotes: string[];
Expand All @@ -137,6 +139,8 @@ export interface BuildArtifactPaths {
iterationArtifactPaths: Array<{
iteration: number;
implementationSummaryPath: string;
changedFilesPath: string;
discoveredIssuesPath: string;
selfReviewPath: string;
improvementInstructionsPath: string;
residualNotesPath: string;
Expand Down
14 changes: 12 additions & 2 deletions test/builder-agent.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,8 @@ export default {
return {
summary: "Implemented the first version.",
changedFiles: ["src/feature.js"],
residualNotes: ["Tests still need to be added."]
residualNotes: ["Tests still need to be added."],
discoveredIssues: [{ title: "Verifier warning needs follow-up", repo: "verifier" }]
};
},
async selfReview() {
Expand All @@ -529,7 +530,8 @@ export default {
return {
summary: "Added targeted regression coverage.",
changedFiles: [...implementation.changedFiles, "test/feature.test.js"],
residualNotes: []
residualNotes: [],
discoveredIssues: [{ title: "Builder docs need a note", repo: "builder-agent" }]
};
}
};
Expand All @@ -552,21 +554,29 @@ export default {
const result = JSON.parse(resultText);
const latestReview = JSON.parse(await readFile(join(outDir, "self-review.json"), "utf8"));
const iteration1Summary = JSON.parse(await readFile(join(outDir, "iterations", "1", "implementation-summary.json"), "utf8"));
const iteration1ChangedFiles = JSON.parse(await readFile(join(outDir, "iterations", "1", "changed-files.json"), "utf8"));
const iteration1DiscoveredIssues = JSON.parse(await readFile(join(outDir, "iterations", "1", "discovered-issues.json"), "utf8"));
const iteration1Review = JSON.parse(await readFile(join(outDir, "iterations", "1", "self-review.json"), "utf8"));
const iteration1Instructions = JSON.parse(await readFile(join(outDir, "iterations", "1", "improvement-instructions.json"), "utf8"));
const iteration1ResidualNotes = JSON.parse(await readFile(join(outDir, "iterations", "1", "residual-notes.json"), "utf8"));
const iteration2Summary = JSON.parse(await readFile(join(outDir, "iterations", "2", "implementation-summary.json"), "utf8"));
const iteration2ChangedFiles = JSON.parse(await readFile(join(outDir, "iterations", "2", "changed-files.json"), "utf8"));
const iteration2DiscoveredIssues = JSON.parse(await readFile(join(outDir, "iterations", "2", "discovered-issues.json"), "utf8"));
const iteration2Review = JSON.parse(await readFile(join(outDir, "iterations", "2", "self-review.json"), "utf8"));

assert.equal(output.status, "ready");
assert.equal(result.status, "ready");
assert.equal(result.iterations, 2);
assert.equal(latestReview.passed, true);
assert.equal(iteration1Summary.summary, "Implemented the first version.");
assert.deepEqual(iteration1ChangedFiles, ["src/feature.js"]);
assert.deepEqual(iteration1DiscoveredIssues, [{ title: "Verifier warning needs follow-up", repo: "verifier" }]);
assert.equal(iteration1Review.passed, false);
assert.deepEqual(iteration1Instructions, ["Add targeted tests for the requested behavior."]);
assert.deepEqual(iteration1ResidualNotes, ["Tests still need to be added."]);
assert.equal(iteration2Summary.summary, "Added targeted regression coverage.");
assert.deepEqual(iteration2ChangedFiles, ["src/feature.js", "test/feature.test.js"]);
assert.deepEqual(iteration2DiscoveredIssues, [{ title: "Builder docs need a note", repo: "builder-agent" }]);
assert.equal(iteration2Review.passed, true);
assert.equal(Object.hasOwn(result, "iterationArtifacts"), false);
await assert.rejects(readFile(join(outDir, "iterations", "3", "stale.json"), "utf8"));
Expand Down
Loading