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
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ export class GoalStartOutputBuilder {
"INSTRUCTION: Your (the developer's) purpose for this goal is to fulfill this objective."
);

// Review Issues section (if rejected goal is being restarted)
if (goal.reviewIssues) {
this.builder.addPrompt(
heading("Review Issues") + "\n" +
wrapContent(goal.reviewIssues).map(line => Colors.warning(line)).join('\n') + "\n\n" +
"INSTRUCTION: This goal was rejected during QA review. You (the developer) MUST address these issues before submitting the goal again."
);
}

// Success Criteria section
const successCriteriaLines = goal.successCriteria.flatMap(c => wrapBulletContinuation(c));
this.builder.addPrompt(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import { GoalContext } from "../../../../../../src/application/context/goals/get
import { ComponentView } from "../../../../../../src/application/context/components/ComponentView.js";
import { DecisionView } from "../../../../../../src/application/context/decisions/DecisionView.js";
import { InvariantView } from "../../../../../../src/application/context/invariants/InvariantView.js";
import { stripAnsi } from "../../../../../../src/presentation/cli/rendering/StyleConfig.js";

describe("GoalStartOutputBuilder", () => {
let builder: GoalStartOutputBuilder;
Expand Down Expand Up @@ -106,6 +107,19 @@ describe("GoalStartOutputBuilder", () => {
expect(text).toContain("Completed step 2");
});

it("should render review issues when restarting a rejected goal", () => {
const view = makeView({
status: "doing",
reviewIssues: "Missing test coverage for rejected goal rework",
});
const output = builder.build(view);
const text = stripAnsi(output.toHumanReadable());

expect(text).toContain("Review Issues");
expect(text).toContain("Missing test coverage for rejected goal rework");
expect(text).toContain("MUST address these issues before submitting the goal again");
});

it("should include submit instruction with goal ID", () => {
const view = makeView({ goalId: "goal_abc" });
const output = builder.build(view);
Expand Down
Loading