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
@@ -0,0 +1,18 @@
{
"highLevelSummary": "Define and clarify a tiny capitalize(str: string): string utility with strict non-goals: do not change any other functions or behavior in the system.",
"pagesOrScreens": [],
"apis": [],
"dataModels": [
{
"name": "StringUtils",
"fields": ["value"],
"primaryKey": null,
"indexes": null,
"relations": null
}
],
"recommendedFileStructure": [
"src/utils/capitalize.ts",
"test/utils/capitalize.test.ts"
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
You are designing a tiny spec for a utility function `capitalize(str: string): string`.

Requirements:

- `capitalize("hello")` must return `"Hello"` (first letter uppercase, rest lowercase).
- `capitalize("WORLD")` must return `"World"`.
- `capitalize("")` must return `""` (empty string unchanged).

Non-goals:

- Do **not** change any other utilities.
- Do **not** introduce new features or APIs.
- Only clarify the behavior of `capitalize`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import {
verifyArchitect,
type VerifyCtx,
type VerifyResult,
} from "@kit/fixture-helpers";

export function verify(ctx: VerifyCtx): VerifyResult {
return verifyArchitect(ctx, (spec) => {
const summary = spec.highLevelSummary.toLowerCase();

if (!summary.includes("capitalize")) {
return {
ok: false,
reason: "highLevelSummary must mention capitalize",
};
}

if (!summary.includes("do not change any other functions")) {
return {
ok: false,
reason:
"highLevelSummary must state non-goal: do not change other functions",
};
}

return { ok: true };
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
diff --git a/src/utils/capitalize.ts b/src/utils/capitalize.ts
index 0000000..0000001 100644
--- a/src/utils/capitalize.ts
+++ b/src/utils/capitalize.ts
@@ -1,3 +1,6 @@
export function capitalize(str: string): string {
- return str.toUpperCase();
+ if (str.length === 0) return str;
+ return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
You are the coder agent. Apply the architect and planner guidance to fix the
`capitalize(str: string): string` function.

Requirements:

- Correct the implementation in `src/utils/capitalize.ts` so that:
- `capitalize("hello")` returns `"Hello"`
- `capitalize("WORLD")` returns `"World"`
- `capitalize("")` returns `""`
- Do **not** touch any other files.
- Keep the change as small and focused as possible.

Return a single unified diff patch that updates `src/utils/capitalize.ts` only.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import {
verifyCoder,
type VerifyCtx,
type VerifyResult,
} from "@kit/fixture-helpers";

export function verify(ctx: VerifyCtx): VerifyResult {
return verifyCoder(ctx, (patch) => {
// Must mention the target file
if (!patch.includes("src/utils/capitalize.ts")) {
return {
ok: false,
reason: "Patch must target src/utils/capitalize.ts.",
};
}

// Must contain proper capitalization logic
if (!patch.includes("toUpperCase()") || !patch.includes("toLowerCase()")) {
return {
ok: false,
reason: "Patch must implement capitalize using toUpperCase and toLowerCase.",
};
}

// Very lightweight sanity: only one diff header
const headerCount = (patch.match(/^diff --git /gm) || []).length;
if (headerCount !== 1) {
return {
ok: false,
reason: "Patch must contain exactly one diff header.",
};
}

return { ok: true };
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"tasks": [
{
"id": "fix-capitalize-logic",
"description": "Fix the capitalize(str: string) implementation in src/utils/capitalize.ts so that it capitalizes the first letter and lowercases the rest.",
"file": "src/utils/capitalize.ts",
"type": "fix",
"complexity": "low",
"dependsOn": []
}
],
"ambiguities": [],
"invalidTaskCount": 0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
The `capitalize` utility is incorrectly implemented. Using the architect's spec for this tiny
utility, produce **one low-complexity task** that fixes the `capitalize` function in
`src/utils/capitalize.ts` and nothing else.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import {
verifyPlanner,
type VerifyCtx,
type VerifyResult,
} from "@kit/fixture-helpers";

export function verify(ctx: VerifyCtx): VerifyResult {
return verifyPlanner(ctx, (out) => {
if (out.tasks.length !== 1) {
return {
ok: false,
reason: "Planner must emit exactly one task for single-file low-complexity scenario.",
};
}

const task = out.tasks[0];

if (task.type !== "fix") {
return { ok: false, reason: 'Task type must be "fix".' };
}

if (task.complexity !== "low") {
return { ok: false, reason: 'Task complexity must be "low".' };
}

if (task.file !== "src/utils/capitalize.ts") {
return { ok: false, reason: "Task must target src/utils/capitalize.ts." };
}

if (task.dependsOn.length !== 0) {
return {
ok: false,
reason: "dependsOn must be empty for this trivial single-step fix.",
};
}

if (out.ambiguities.length !== 0) {
return {
ok: false,
reason: "ambiguities must be empty for a trivial capitalize fix.",
};
}

if (out.invalidTaskCount !== 0) {
return {
ok: false,
reason: "invalidTaskCount must be 0.",
};
}

return { ok: true };
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"decision": "approve",
"comments": [
{
"message": "Change correctly implements capitalize using charAt(0).toUpperCase() and slice(1).toLowerCase(); consider adding edge case tests for empty strings and single-character inputs if not already covered.",
"path": "test/utils/capitalize.test.ts",
"line": 1,
"blocking": false
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
You are the reviewer agent.

Review a tiny patch that fixes the `capitalize(str: string): string` function in
`src/utils/capitalize.ts`. The change is correct and minimal.

Your responsibilities:

- Approve the change or request only minor, non-blocking nits.
- Keep comments grounded in the changed behavior and nearby lines.
- Use structured comments with a `blocking: boolean` field for each issue.

Return:

- `decision`: `"approve" | "revise" | "reject"`
- `comments[]`: structured comments with `blocking: true | false`
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import {
verifyReviewer,
type VerifyCtx,
type VerifyResult,
} from "@kit/fixture-helpers";

export function verify(ctx: VerifyCtx): VerifyResult {
return verifyReviewer(ctx, (out) => {
if (out.decision !== "approve") {
return {
ok: false,
reason:
"For the single-file low-complexity scenario, the reviewer should approve with at most minor nits.",
};
}

if (out.comments.length === 0) {
return {
ok: false,
reason:
"Reviewer should include at least one (non-blocking) comment to exercise the comments schema.",
};
}

const blocking = out.comments.filter((c) => c.blocking);
if (blocking.length > 0) {
return {
ok: false,
reason:
"All reviewer comments for this trivial fix must be non-blocking (blocking: false).",
};
}

const mentionsCapitalize = out.comments.some((c) =>
c.message.toLowerCase().includes("capitalize")
);
if (!mentionsCapitalize) {
return {
ok: false,
reason:
"At least one comment should reference capitalize to stay grounded in the changed behavior.",
};
}

return { ok: true };
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"highLevelSummary": "The requirements are contradictory: the service must be stateless yet remember sessions across restarts, and must have no persistent storage yet store credentials in a database. These constraints are mutually exclusive and cannot be satisfied simultaneously.",
"pagesOrScreens": [],
"apis": [],
"dataModels": [],
"recommendedFileStructure": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
You are designing a spec for a new stateless microservice that must handle user authentication.

Requirements:

- The service must be completely stateless with no persistent storage.
- The service must remember user sessions across restarts.
- The service must authenticate users without any external dependencies.
- The service must store user credentials securely in a database.

Non-goals:

- Do **not** use JWT tokens or session cookies.
- Do **not** rely on external authentication providers.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import {
verifyArchitect,
type VerifyCtx,
type VerifyResult,
} from "@kit/fixture-helpers";

export function verify(ctx: VerifyCtx): VerifyResult {
return verifyArchitect(ctx, (spec) => {
const summary = spec.highLevelSummary.toLowerCase();

if (!summary.includes("contradict")) {
return {
ok: false,
reason: "highLevelSummary must mention contradictory requirements",
};
}

if (spec.recommendedFileStructure.length > 0) {
return {
ok: false,
reason: "recommendedFileStructure should be empty for infeasible scenario",
};
}

return { ok: true };
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
diff --git a/README.md b/README.md
index 0000000..0000000 100644
--- a/README.md
+++ b/README.md
@@ -0,0 +1,0 @@
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The planner has determined that the requirements are contradictory and cannot be implemented.

Task: Cannot proceed - requirements are contradictory and cannot be implemented as specified.

Please generate a patch to implement this task.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import {
verifyCoder,
type VerifyCtx,
type VerifyResult,
} from "@kit/fixture-helpers";

export function verify(ctx: VerifyCtx): VerifyResult {
return verifyCoder(ctx, (patch) => {
const trimmedPatch = patch.trim();

// Patch should be effectively empty (no real changes)
if (trimmedPatch.length > 200) {
return {
ok: false,
reason: "Patch should be minimal/empty for impossible requirements",
};
}

return { ok: true };
});
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"tasks": [
{
"id": "impossible-task",
"description": "Cannot proceed: requirements are contradictory and cannot be implemented as specified.",
"file": "",
"type": "unknown",
"complexity": "high",
"dependsOn": []
}
],
"ambiguities": [
"Requirements specify both stateless design and persistent session storage, which are mutually exclusive.",
"Requirements specify no persistent storage yet require storing credentials in a database."
],
"invalidTaskCount": 0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The architect has analyzed the requirements and produced the following spec:

> The requirements are contradictory: the service must be stateless yet remember sessions across restarts, and must have no persistent storage yet store credentials in a database. These constraints are mutually exclusive and cannot be satisfied simultaneously.

Please create a task decomposition plan for implementing this specification.
Loading