Skip to content

Commit f6eb079

Browse files
Merge pull request #196 from jumbocontext/goal-start-include-issues
Render rejected goal issues on start
2 parents a465602 + 54c666e commit f6eb079

2 files changed

Lines changed: 23 additions & 0 deletions

File tree

src/presentation/cli/commands/goals/start/GoalStartOutputBuilder.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ export class GoalStartOutputBuilder {
4040
"INSTRUCTION: Your (the developer's) purpose for this goal is to fulfill this objective."
4141
);
4242

43+
// Review Issues section (if rejected goal is being restarted)
44+
if (goal.reviewIssues) {
45+
this.builder.addPrompt(
46+
heading("Review Issues") + "\n" +
47+
wrapContent(goal.reviewIssues).map(line => Colors.warning(line)).join('\n') + "\n\n" +
48+
"INSTRUCTION: This goal was rejected during QA review. You (the developer) MUST address these issues before submitting the goal again."
49+
);
50+
}
51+
4352
// Success Criteria section
4453
const successCriteriaLines = goal.successCriteria.flatMap(c => wrapBulletContinuation(c));
4554
this.builder.addPrompt(

tests/presentation/cli/commands/goals/start/GoalStartOutputBuilder.test.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import { GoalContext } from "../../../../../../src/application/context/goals/get
1616
import { ComponentView } from "../../../../../../src/application/context/components/ComponentView.js";
1717
import { DecisionView } from "../../../../../../src/application/context/decisions/DecisionView.js";
1818
import { InvariantView } from "../../../../../../src/application/context/invariants/InvariantView.js";
19+
import { stripAnsi } from "../../../../../../src/presentation/cli/rendering/StyleConfig.js";
1920

2021
describe("GoalStartOutputBuilder", () => {
2122
let builder: GoalStartOutputBuilder;
@@ -106,6 +107,19 @@ describe("GoalStartOutputBuilder", () => {
106107
expect(text).toContain("Completed step 2");
107108
});
108109

110+
it("should render review issues when restarting a rejected goal", () => {
111+
const view = makeView({
112+
status: "doing",
113+
reviewIssues: "Missing test coverage for rejected goal rework",
114+
});
115+
const output = builder.build(view);
116+
const text = stripAnsi(output.toHumanReadable());
117+
118+
expect(text).toContain("Review Issues");
119+
expect(text).toContain("Missing test coverage for rejected goal rework");
120+
expect(text).toContain("MUST address these issues before submitting the goal again");
121+
});
122+
109123
it("should include submit instruction with goal ID", () => {
110124
const view = makeView({ goalId: "goal_abc" });
111125
const output = builder.build(view);

0 commit comments

Comments
 (0)