From ff13ee53fc7bf8ab18ad600efd05ebf86f002a2b Mon Sep 17 00:00:00 2001 From: PM Palles Date: Fri, 5 Dec 2025 10:36:07 -0500 Subject: [PATCH 1/2] feat: devinai fixtures --- .../architect/expected.json | 7 ++ .../architect/prompt.md | 15 +++++ .../architect/verify.ts | 20 ++++++ .../coder/expected.patch | 11 +++ .../coder/prompt.md | 7 ++ .../coder/verify.ts | 18 +++++ .../planner/expected.json | 18 +++++ .../planner/prompt.md | 8 +++ .../planner/verify.ts | 26 +++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 14 ++++ .../reviewer/verify.ts | 30 +++++++++ .../architect/expected.json | 7 ++ .../architect/prompt.md | 15 +++++ .../architect/verify.ts | 20 ++++++ .../coder/expected.patch | 13 ++++ .../coder/prompt.md | 9 +++ .../coder/verify.ts | 18 +++++ .../planner/expected.json | 17 +++++ .../planner/prompt.md | 10 +++ .../planner/verify.ts | 36 ++++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 16 +++++ .../reviewer/verify.ts | 30 +++++++++ .../architect/expected.json | 7 ++ .../architect/prompt.md | 15 +++++ .../architect/verify.ts | 20 ++++++ .../coder/expected.patch | 13 ++++ .../task-503-missing-context/coder/prompt.md | 9 +++ .../task-503-missing-context/coder/verify.ts | 18 +++++ .../planner/expected.json | 17 +++++ .../planner/prompt.md | 9 +++ .../planner/verify.ts | 26 +++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 15 +++++ .../reviewer/verify.ts | 31 +++++++++ .../architect/expected.json | 20 ++++++ .../architect/prompt.md | 17 +++++ .../architect/verify.ts | 35 ++++++++++ .../coder/expected.patch | 49 ++++++++++++++ .../coder/prompt.md | 12 ++++ .../coder/verify.ts | 35 ++++++++++ .../planner/expected.json | 38 +++++++++++ .../planner/prompt.md | 13 ++++ .../planner/verify.ts | 51 ++++++++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 17 +++++ .../reviewer/verify.ts | 47 +++++++++++++ .../architect/expected.json | 26 +++++++ .../architect/prompt.md | 18 +++++ .../architect/verify.ts | 27 ++++++++ .../coder/expected.patch | 41 ++++++++++++ .../coder/prompt.md | 10 +++ .../coder/verify.ts | 32 +++++++++ .../planner/expected.json | 30 +++++++++ .../planner/prompt.md | 11 +++ .../planner/verify.ts | 67 +++++++++++++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 14 ++++ .../reviewer/verify.ts | 46 +++++++++++++ .../architect/expected.json | 19 ++++++ .../architect/prompt.md | 22 ++++++ .../architect/verify.ts | 27 ++++++++ .../coder/expected.patch | 41 ++++++++++++ .../coder/prompt.md | 10 +++ .../coder/verify.ts | 45 +++++++++++++ .../planner/expected.json | 30 +++++++++ .../planner/prompt.md | 12 ++++ .../planner/verify.ts | 33 +++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 18 +++++ .../reviewer/verify.ts | 47 +++++++++++++ .../architect/expected.json | 19 ++++++ .../architect/prompt.md | 15 +++++ .../architect/verify.ts | 36 ++++++++++ .../coder/expected.patch | 51 ++++++++++++++ .../coder/prompt.md | 10 +++ .../coder/verify.ts | 40 +++++++++++ .../planner/expected.json | 30 +++++++++ .../planner/prompt.md | 11 +++ .../planner/verify.ts | 36 ++++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 16 +++++ .../reviewer/verify.ts | 33 +++++++++ .../architect/expected.json | 10 +++ .../architect/prompt.md | 14 ++++ .../architect/verify.ts | 34 ++++++++++ .../coder/expected.patch | 40 +++++++++++ .../coder/prompt.md | 9 +++ .../coder/verify.ts | 29 ++++++++ .../planner/expected.json | 22 ++++++ .../planner/prompt.md | 9 +++ .../planner/verify.ts | 38 +++++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 19 ++++++ .../reviewer/verify.ts | 33 +++++++++ .../architect/expected.json | 19 ++++++ .../architect/prompt.md | 15 +++++ .../architect/verify.ts | 34 ++++++++++ .../coder/expected.patch | 60 +++++++++++++++++ .../coder/prompt.md | 10 +++ .../coder/verify.ts | 40 +++++++++++ .../planner/expected.json | 30 +++++++++ .../planner/prompt.md | 11 +++ .../planner/verify.ts | 52 ++++++++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 15 +++++ .../reviewer/verify.ts | 33 +++++++++ .../architect/expected.json | 10 +++ .../architect/prompt.md | 16 +++++ .../architect/verify.ts | 36 ++++++++++ .../coder/expected.patch | 37 ++++++++++ .../coder/prompt.md | 10 +++ .../coder/verify.ts | 40 +++++++++++ .../planner/expected.json | 14 ++++ .../planner/prompt.md | 12 ++++ .../planner/verify.ts | 31 +++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 18 +++++ .../reviewer/verify.ts | 46 +++++++++++++ .../architect/expected.json | 10 +++ .../architect/prompt.md | 16 +++++ .../architect/verify.ts | 37 ++++++++++ .../coder/expected.patch | 25 +++++++ .../coder/prompt.md | 10 +++ .../coder/verify.ts | 32 +++++++++ .../planner/expected.json | 22 ++++++ .../planner/prompt.md | 9 +++ .../planner/verify.ts | 34 ++++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 15 +++++ .../reviewer/verify.ts | 33 +++++++++ .../architect/expected.json | 10 +++ .../architect/prompt.md | 15 +++++ .../architect/verify.ts | 36 ++++++++++ .../coder/expected.patch | 28 ++++++++ .../coder/prompt.md | 9 +++ .../coder/verify.ts | 35 ++++++++++ .../planner/expected.json | 22 ++++++ .../planner/prompt.md | 9 +++ .../planner/verify.ts | 35 ++++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 15 +++++ .../reviewer/verify.ts | 33 +++++++++ .../architect/expected.json | 10 +++ .../architect/prompt.md | 14 ++++ .../architect/verify.ts | 27 ++++++++ .../coder/expected.patch | 16 +++++ .../coder/prompt.md | 9 +++ .../coder/verify.ts | 28 ++++++++ .../planner/expected.json | 14 ++++ .../planner/prompt.md | 9 +++ .../planner/verify.ts | 31 +++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 15 +++++ .../reviewer/verify.ts | 33 +++++++++ .../architect/expected.json | 9 +++ .../architect/prompt.md | 15 +++++ .../architect/verify.ts | 27 ++++++++ .../coder/expected.patch | 21 ++++++ .../task-307-safe-file-delete/coder/prompt.md | 9 +++ .../task-307-safe-file-delete/coder/verify.ts | 28 ++++++++ .../planner/expected.json | 22 ++++++ .../planner/prompt.md | 9 +++ .../planner/verify.ts | 30 +++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 15 +++++ .../reviewer/verify.ts | 33 +++++++++ .../architect/expected.json | 12 ++++ .../architect/prompt.md | 15 +++++ .../architect/verify.ts | 27 ++++++++ .../coder/expected.patch | 50 ++++++++++++++ .../coder/prompt.md | 10 +++ .../coder/verify.ts | 26 +++++++ .../planner/expected.json | 38 +++++++++++ .../planner/prompt.md | 11 +++ .../planner/verify.ts | 34 ++++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 17 +++++ .../reviewer/verify.ts | 18 +++++ .../architect/expected.json | 11 +++ .../architect/prompt.md | 15 +++++ .../architect/verify.ts | 27 ++++++++ .../coder/expected.patch | 30 +++++++++ .../coder/prompt.md | 10 +++ .../coder/verify.ts | 29 ++++++++ .../planner/expected.json | 30 +++++++++ .../planner/prompt.md | 6 ++ .../planner/verify.ts | 26 +++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 16 +++++ .../reviewer/verify.ts | 18 +++++ .../architect/expected.json | 12 ++++ .../architect/prompt.md | 15 +++++ .../architect/verify.ts | 27 ++++++++ .../coder/expected.patch | 49 ++++++++++++++ .../task-703-sequential-chain/coder/prompt.md | 10 +++ .../task-703-sequential-chain/coder/verify.ts | 26 +++++++ .../planner/expected.json | 38 +++++++++++ .../planner/prompt.md | 8 +++ .../planner/verify.ts | 34 ++++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 14 ++++ .../reviewer/verify.ts | 18 +++++ .../architect/expected.json | 10 +++ .../architect/prompt.md | 15 +++++ .../architect/verify.ts | 20 ++++++ .../coder/expected.patch | 65 ++++++++++++++++++ .../task-713-cycle-detection/coder/prompt.md | 8 +++ .../task-713-cycle-detection/coder/verify.ts | 25 +++++++ .../planner/expected.json | 22 ++++++ .../planner/prompt.md | 7 ++ .../planner/verify.ts | 30 +++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 12 ++++ .../reviewer/verify.ts | 18 +++++ .../architect/expected.json | 10 +++ .../architect/prompt.md | 15 +++++ .../architect/verify.ts | 20 ++++++ .../coder/expected.patch | 42 ++++++++++++ .../coder/prompt.md | 8 +++ .../coder/verify.ts | 25 +++++++ .../planner/expected.json | 22 ++++++ .../planner/prompt.md | 7 ++ .../planner/verify.ts | 30 +++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 12 ++++ .../reviewer/verify.ts | 18 +++++ .../architect/expected.json | 10 +++ .../architect/prompt.md | 15 +++++ .../architect/verify.ts | 20 ++++++ .../coder/expected.patch | 51 ++++++++++++++ .../coder/prompt.md | 8 +++ .../coder/verify.ts | 25 +++++++ .../planner/expected.json | 22 ++++++ .../planner/prompt.md | 7 ++ .../planner/verify.ts | 30 +++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 12 ++++ .../reviewer/verify.ts | 18 +++++ .../architect/expected.json | 10 +++ .../architect/prompt.md | 15 +++++ .../architect/verify.ts | 20 ++++++ .../coder/expected.patch | 56 ++++++++++++++++ .../coder/prompt.md | 8 +++ .../coder/verify.ts | 25 +++++++ .../planner/expected.json | 22 ++++++ .../planner/prompt.md | 7 ++ .../planner/verify.ts | 32 +++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 12 ++++ .../reviewer/verify.ts | 18 +++++ .../architect/expected.json | 10 +++ .../architect/prompt.md | 15 +++++ .../architect/verify.ts | 20 ++++++ .../coder/expected.patch | 61 +++++++++++++++++ .../coder/prompt.md | 8 +++ .../coder/verify.ts | 25 +++++++ .../planner/expected.json | 22 ++++++ .../planner/prompt.md | 7 ++ .../planner/verify.ts | 32 +++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 12 ++++ .../reviewer/verify.ts | 18 +++++ .../architect/expected.json | 10 +++ .../architect/prompt.md | 15 +++++ .../architect/verify.ts | 20 ++++++ .../coder/expected.patch | 58 ++++++++++++++++ .../coder/prompt.md | 8 +++ .../coder/verify.ts | 25 +++++++ .../planner/expected.json | 22 ++++++ .../planner/prompt.md | 7 ++ .../planner/verify.ts | 32 +++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 12 ++++ .../reviewer/verify.ts | 18 +++++ .../architect/expected.json | 10 +++ .../architect/prompt.md | 15 +++++ .../architect/verify.ts | 20 ++++++ .../coder/expected.patch | 50 ++++++++++++++ .../coder/prompt.md | 8 +++ .../coder/verify.ts | 25 +++++++ .../planner/expected.json | 22 ++++++ .../planner/prompt.md | 7 ++ .../planner/verify.ts | 32 +++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 12 ++++ .../reviewer/verify.ts | 18 +++++ .../architect/expected.json | 10 +++ .../architect/prompt.md | 15 +++++ .../architect/verify.ts | 20 ++++++ .../coder/expected.patch | 52 ++++++++++++++ .../coder/prompt.md | 8 +++ .../coder/verify.ts | 25 +++++++ .../planner/expected.json | 22 ++++++ .../planner/prompt.md | 7 ++ .../planner/verify.ts | 30 +++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 12 ++++ .../reviewer/verify.ts | 18 +++++ .../architect/expected.json | 10 +++ .../task-906-file-locking/architect/prompt.md | 15 +++++ .../task-906-file-locking/architect/verify.ts | 20 ++++++ .../coder/expected.patch | 67 +++++++++++++++++++ .../task-906-file-locking/coder/prompt.md | 8 +++ .../task-906-file-locking/coder/verify.ts | 25 +++++++ .../planner/expected.json | 22 ++++++ .../task-906-file-locking/planner/prompt.md | 7 ++ .../task-906-file-locking/planner/verify.ts | 30 +++++++++ .../reviewer/expected.json | 11 +++ .../task-906-file-locking/reviewer/prompt.md | 12 ++++ .../task-906-file-locking/reviewer/verify.ts | 18 +++++ .../architect/expected.json | 9 +++ .../task-907-atomic-write/architect/prompt.md | 15 +++++ .../task-907-atomic-write/architect/verify.ts | 20 ++++++ .../coder/expected.patch | 45 +++++++++++++ .../task-907-atomic-write/coder/prompt.md | 8 +++ .../task-907-atomic-write/coder/verify.ts | 25 +++++++ .../planner/expected.json | 14 ++++ .../task-907-atomic-write/planner/prompt.md | 7 ++ .../task-907-atomic-write/planner/verify.ts | 30 +++++++++ .../reviewer/expected.json | 11 +++ .../task-907-atomic-write/reviewer/prompt.md | 12 ++++ .../task-907-atomic-write/reviewer/verify.ts | 18 +++++ .../architect/expected.json | 11 +++ .../architect/prompt.md | 15 +++++ .../architect/verify.ts | 27 ++++++++ .../coder/expected.patch | 34 ++++++++++ .../coder/prompt.md | 10 +++ .../coder/verify.ts | 26 +++++++ .../planner/expected.json | 30 +++++++++ .../planner/prompt.md | 8 +++ .../planner/verify.ts | 38 +++++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 14 ++++ .../reviewer/verify.ts | 18 +++++ .../architect/expected.json | 11 +++ .../architect/prompt.md | 15 +++++ .../architect/verify.ts | 27 ++++++++ .../coder/expected.patch | 52 ++++++++++++++ .../coder/prompt.md | 9 +++ .../coder/verify.ts | 33 +++++++++ .../planner/expected.json | 30 +++++++++ .../planner/prompt.md | 9 +++ .../planner/verify.ts | 30 +++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 15 +++++ .../reviewer/verify.ts | 18 +++++ .../architect/expected.json | 11 +++ .../architect/prompt.md | 15 +++++ .../architect/verify.ts | 27 ++++++++ .../coder/expected.patch | 26 +++++++ .../coder/prompt.md | 9 +++ .../coder/verify.ts | 26 +++++++ .../planner/expected.json | 30 +++++++++ .../planner/prompt.md | 8 +++ .../planner/verify.ts | 30 +++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 14 ++++ .../reviewer/verify.ts | 18 +++++ .../architect/expected.json | 9 +++ .../task-401-trace-origin/architect/prompt.md | 15 +++++ .../task-401-trace-origin/architect/verify.ts | 20 ++++++ .../coder/expected.patch | 15 +++++ .../task-401-trace-origin/coder/prompt.md | 9 +++ .../task-401-trace-origin/coder/verify.ts | 18 +++++ .../planner/expected.json | 14 ++++ .../task-401-trace-origin/planner/prompt.md | 8 +++ .../task-401-trace-origin/planner/verify.ts | 24 +++++++ .../reviewer/expected.json | 11 +++ .../task-401-trace-origin/reviewer/prompt.md | 14 ++++ .../task-401-trace-origin/reviewer/verify.ts | 25 +++++++ .../architect/expected.json | 10 +++ .../architect/prompt.md | 15 +++++ .../architect/verify.ts | 20 ++++++ .../coder/expected.patch | 27 ++++++++ .../coder/prompt.md | 9 +++ .../coder/verify.ts | 25 +++++++ .../planner/expected.json | 22 ++++++ .../planner/prompt.md | 6 ++ .../planner/verify.ts | 23 +++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 12 ++++ .../reviewer/verify.ts | 25 +++++++ .../architect/expected.json | 11 +++ .../architect/prompt.md | 15 +++++ .../architect/verify.ts | 20 ++++++ .../coder/expected.patch | 21 ++++++ .../coder/prompt.md | 9 +++ .../coder/verify.ts | 18 +++++ .../planner/expected.json | 14 ++++ .../planner/prompt.md | 6 ++ .../planner/verify.ts | 23 +++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 12 ++++ .../reviewer/verify.ts | 25 +++++++ .../architect/expected.json | 9 +++ .../architect/prompt.md | 15 +++++ .../architect/verify.ts | 27 ++++++++ .../coder/expected.patch | 16 +++++ .../coder/prompt.md | 9 +++ .../coder/verify.ts | 25 +++++++ .../planner/expected.json | 14 ++++ .../planner/prompt.md | 8 +++ .../planner/verify.ts | 32 +++++++++ .../reviewer/expected.json | 11 +++ .../reviewer/prompt.md | 15 +++++ .../reviewer/verify.ts | 26 +++++++ .../architect/expected.json | 9 +++ .../architect/prompt.md | 15 +++++ .../architect/verify.ts | 27 ++++++++ .../coder/expected.patch | 13 ++++ .../coder/prompt.md | 9 +++ .../coder/verify.ts | 18 +++++ .../planner/expected.json | 14 ++++ .../planner/prompt.md | 8 +++ .../planner/verify.ts | 24 +++++++ .../reviewer/expected.json | 17 +++++ .../reviewer/prompt.md | 15 +++++ .../reviewer/verify.ts | 36 ++++++++++ package-lock.json | 1 + 421 files changed, 8514 insertions(+) create mode 100644 fixtures/ambiguity/task-501-unclear-requirements/architect/expected.json create mode 100644 fixtures/ambiguity/task-501-unclear-requirements/architect/prompt.md create mode 100644 fixtures/ambiguity/task-501-unclear-requirements/architect/verify.ts create mode 100644 fixtures/ambiguity/task-501-unclear-requirements/coder/expected.patch create mode 100644 fixtures/ambiguity/task-501-unclear-requirements/coder/prompt.md create mode 100644 fixtures/ambiguity/task-501-unclear-requirements/coder/verify.ts create mode 100644 fixtures/ambiguity/task-501-unclear-requirements/planner/expected.json create mode 100644 fixtures/ambiguity/task-501-unclear-requirements/planner/prompt.md create mode 100644 fixtures/ambiguity/task-501-unclear-requirements/planner/verify.ts create mode 100644 fixtures/ambiguity/task-501-unclear-requirements/reviewer/expected.json create mode 100644 fixtures/ambiguity/task-501-unclear-requirements/reviewer/prompt.md create mode 100644 fixtures/ambiguity/task-501-unclear-requirements/reviewer/verify.ts create mode 100644 fixtures/ambiguity/task-502-conflicting-constraints/architect/expected.json create mode 100644 fixtures/ambiguity/task-502-conflicting-constraints/architect/prompt.md create mode 100644 fixtures/ambiguity/task-502-conflicting-constraints/architect/verify.ts create mode 100644 fixtures/ambiguity/task-502-conflicting-constraints/coder/expected.patch create mode 100644 fixtures/ambiguity/task-502-conflicting-constraints/coder/prompt.md create mode 100644 fixtures/ambiguity/task-502-conflicting-constraints/coder/verify.ts create mode 100644 fixtures/ambiguity/task-502-conflicting-constraints/planner/expected.json create mode 100644 fixtures/ambiguity/task-502-conflicting-constraints/planner/prompt.md create mode 100644 fixtures/ambiguity/task-502-conflicting-constraints/planner/verify.ts create mode 100644 fixtures/ambiguity/task-502-conflicting-constraints/reviewer/expected.json create mode 100644 fixtures/ambiguity/task-502-conflicting-constraints/reviewer/prompt.md create mode 100644 fixtures/ambiguity/task-502-conflicting-constraints/reviewer/verify.ts create mode 100644 fixtures/ambiguity/task-503-missing-context/architect/expected.json create mode 100644 fixtures/ambiguity/task-503-missing-context/architect/prompt.md create mode 100644 fixtures/ambiguity/task-503-missing-context/architect/verify.ts create mode 100644 fixtures/ambiguity/task-503-missing-context/coder/expected.patch create mode 100644 fixtures/ambiguity/task-503-missing-context/coder/prompt.md create mode 100644 fixtures/ambiguity/task-503-missing-context/coder/verify.ts create mode 100644 fixtures/ambiguity/task-503-missing-context/planner/expected.json create mode 100644 fixtures/ambiguity/task-503-missing-context/planner/prompt.md create mode 100644 fixtures/ambiguity/task-503-missing-context/planner/verify.ts create mode 100644 fixtures/ambiguity/task-503-missing-context/reviewer/expected.json create mode 100644 fixtures/ambiguity/task-503-missing-context/reviewer/prompt.md create mode 100644 fixtures/ambiguity/task-503-missing-context/reviewer/verify.ts create mode 100644 fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/architect/expected.json create mode 100644 fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/architect/prompt.md create mode 100644 fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/architect/verify.ts create mode 100644 fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/coder/expected.patch create mode 100644 fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/coder/prompt.md create mode 100644 fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/coder/verify.ts create mode 100644 fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/planner/expected.json create mode 100644 fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/planner/prompt.md create mode 100644 fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/planner/verify.ts create mode 100644 fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/reviewer/expected.json create mode 100644 fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/reviewer/prompt.md create mode 100644 fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/reviewer/verify.ts create mode 100644 fixtures/chains-and-small-dags/task-203-circular-dependency-trap/architect/expected.json create mode 100644 fixtures/chains-and-small-dags/task-203-circular-dependency-trap/architect/prompt.md create mode 100644 fixtures/chains-and-small-dags/task-203-circular-dependency-trap/architect/verify.ts create mode 100644 fixtures/chains-and-small-dags/task-203-circular-dependency-trap/coder/expected.patch create mode 100644 fixtures/chains-and-small-dags/task-203-circular-dependency-trap/coder/prompt.md create mode 100644 fixtures/chains-and-small-dags/task-203-circular-dependency-trap/coder/verify.ts create mode 100644 fixtures/chains-and-small-dags/task-203-circular-dependency-trap/planner/expected.json create mode 100644 fixtures/chains-and-small-dags/task-203-circular-dependency-trap/planner/prompt.md create mode 100644 fixtures/chains-and-small-dags/task-203-circular-dependency-trap/planner/verify.ts create mode 100644 fixtures/chains-and-small-dags/task-203-circular-dependency-trap/reviewer/expected.json create mode 100644 fixtures/chains-and-small-dags/task-203-circular-dependency-trap/reviewer/prompt.md create mode 100644 fixtures/chains-and-small-dags/task-203-circular-dependency-trap/reviewer/verify.ts create mode 100644 fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/architect/expected.json create mode 100644 fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/architect/prompt.md create mode 100644 fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/architect/verify.ts create mode 100644 fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/coder/expected.patch create mode 100644 fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/coder/prompt.md create mode 100644 fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/coder/verify.ts create mode 100644 fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/planner/expected.json create mode 100644 fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/planner/prompt.md create mode 100644 fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/planner/verify.ts create mode 100644 fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/reviewer/expected.json create mode 100644 fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/reviewer/prompt.md create mode 100644 fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/reviewer/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/architect/expected.json create mode 100644 fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/architect/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/architect/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/coder/expected.patch create mode 100644 fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/coder/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/coder/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/planner/expected.json create mode 100644 fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/planner/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/planner/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/reviewer/expected.json create mode 100644 fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/reviewer/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/reviewer/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/architect/expected.json create mode 100644 fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/architect/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/architect/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/coder/expected.patch create mode 100644 fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/coder/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/coder/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/planner/expected.json create mode 100644 fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/planner/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/planner/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/reviewer/expected.json create mode 100644 fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/reviewer/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/reviewer/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/architect/expected.json create mode 100644 fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/architect/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/architect/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/coder/expected.patch create mode 100644 fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/coder/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/coder/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/planner/expected.json create mode 100644 fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/planner/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/planner/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/reviewer/expected.json create mode 100644 fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/reviewer/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/reviewer/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/architect/expected.json create mode 100644 fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/architect/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/architect/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/coder/expected.patch create mode 100644 fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/coder/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/coder/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/planner/expected.json create mode 100644 fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/planner/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/planner/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/reviewer/expected.json create mode 100644 fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/reviewer/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/reviewer/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-304-scope-constraints/architect/expected.json create mode 100644 fixtures/core-semantics-and-tests/task-304-scope-constraints/architect/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-304-scope-constraints/architect/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-304-scope-constraints/coder/expected.patch create mode 100644 fixtures/core-semantics-and-tests/task-304-scope-constraints/coder/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-304-scope-constraints/coder/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-304-scope-constraints/planner/expected.json create mode 100644 fixtures/core-semantics-and-tests/task-304-scope-constraints/planner/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-304-scope-constraints/planner/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-304-scope-constraints/reviewer/expected.json create mode 100644 fixtures/core-semantics-and-tests/task-304-scope-constraints/reviewer/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-304-scope-constraints/reviewer/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-305-create-new-file-safe/architect/expected.json create mode 100644 fixtures/core-semantics-and-tests/task-305-create-new-file-safe/architect/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-305-create-new-file-safe/architect/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-305-create-new-file-safe/coder/expected.patch create mode 100644 fixtures/core-semantics-and-tests/task-305-create-new-file-safe/coder/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-305-create-new-file-safe/coder/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-305-create-new-file-safe/planner/expected.json create mode 100644 fixtures/core-semantics-and-tests/task-305-create-new-file-safe/planner/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-305-create-new-file-safe/planner/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-305-create-new-file-safe/reviewer/expected.json create mode 100644 fixtures/core-semantics-and-tests/task-305-create-new-file-safe/reviewer/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-305-create-new-file-safe/reviewer/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/architect/expected.json create mode 100644 fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/architect/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/architect/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/coder/expected.patch create mode 100644 fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/coder/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/coder/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/planner/expected.json create mode 100644 fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/planner/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/planner/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/reviewer/expected.json create mode 100644 fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/reviewer/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/reviewer/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-307-safe-file-delete/architect/expected.json create mode 100644 fixtures/core-semantics-and-tests/task-307-safe-file-delete/architect/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-307-safe-file-delete/architect/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-307-safe-file-delete/coder/expected.patch create mode 100644 fixtures/core-semantics-and-tests/task-307-safe-file-delete/coder/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-307-safe-file-delete/coder/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-307-safe-file-delete/planner/expected.json create mode 100644 fixtures/core-semantics-and-tests/task-307-safe-file-delete/planner/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-307-safe-file-delete/planner/verify.ts create mode 100644 fixtures/core-semantics-and-tests/task-307-safe-file-delete/reviewer/expected.json create mode 100644 fixtures/core-semantics-and-tests/task-307-safe-file-delete/reviewer/prompt.md create mode 100644 fixtures/core-semantics-and-tests/task-307-safe-file-delete/reviewer/verify.ts create mode 100644 fixtures/dag-topology/task-701-diamond-dependency/architect/expected.json create mode 100644 fixtures/dag-topology/task-701-diamond-dependency/architect/prompt.md create mode 100644 fixtures/dag-topology/task-701-diamond-dependency/architect/verify.ts create mode 100644 fixtures/dag-topology/task-701-diamond-dependency/coder/expected.patch create mode 100644 fixtures/dag-topology/task-701-diamond-dependency/coder/prompt.md create mode 100644 fixtures/dag-topology/task-701-diamond-dependency/coder/verify.ts create mode 100644 fixtures/dag-topology/task-701-diamond-dependency/planner/expected.json create mode 100644 fixtures/dag-topology/task-701-diamond-dependency/planner/prompt.md create mode 100644 fixtures/dag-topology/task-701-diamond-dependency/planner/verify.ts create mode 100644 fixtures/dag-topology/task-701-diamond-dependency/reviewer/expected.json create mode 100644 fixtures/dag-topology/task-701-diamond-dependency/reviewer/prompt.md create mode 100644 fixtures/dag-topology/task-701-diamond-dependency/reviewer/verify.ts create mode 100644 fixtures/dag-topology/task-702-parallel-independent/architect/expected.json create mode 100644 fixtures/dag-topology/task-702-parallel-independent/architect/prompt.md create mode 100644 fixtures/dag-topology/task-702-parallel-independent/architect/verify.ts create mode 100644 fixtures/dag-topology/task-702-parallel-independent/coder/expected.patch create mode 100644 fixtures/dag-topology/task-702-parallel-independent/coder/prompt.md create mode 100644 fixtures/dag-topology/task-702-parallel-independent/coder/verify.ts create mode 100644 fixtures/dag-topology/task-702-parallel-independent/planner/expected.json create mode 100644 fixtures/dag-topology/task-702-parallel-independent/planner/prompt.md create mode 100644 fixtures/dag-topology/task-702-parallel-independent/planner/verify.ts create mode 100644 fixtures/dag-topology/task-702-parallel-independent/reviewer/expected.json create mode 100644 fixtures/dag-topology/task-702-parallel-independent/reviewer/prompt.md create mode 100644 fixtures/dag-topology/task-702-parallel-independent/reviewer/verify.ts create mode 100644 fixtures/dag-topology/task-703-sequential-chain/architect/expected.json create mode 100644 fixtures/dag-topology/task-703-sequential-chain/architect/prompt.md create mode 100644 fixtures/dag-topology/task-703-sequential-chain/architect/verify.ts create mode 100644 fixtures/dag-topology/task-703-sequential-chain/coder/expected.patch create mode 100644 fixtures/dag-topology/task-703-sequential-chain/coder/prompt.md create mode 100644 fixtures/dag-topology/task-703-sequential-chain/coder/verify.ts create mode 100644 fixtures/dag-topology/task-703-sequential-chain/planner/expected.json create mode 100644 fixtures/dag-topology/task-703-sequential-chain/planner/prompt.md create mode 100644 fixtures/dag-topology/task-703-sequential-chain/planner/verify.ts create mode 100644 fixtures/dag-topology/task-703-sequential-chain/reviewer/expected.json create mode 100644 fixtures/dag-topology/task-703-sequential-chain/reviewer/prompt.md create mode 100644 fixtures/dag-topology/task-703-sequential-chain/reviewer/verify.ts create mode 100644 fixtures/dag-topology/task-713-cycle-detection/architect/expected.json create mode 100644 fixtures/dag-topology/task-713-cycle-detection/architect/prompt.md create mode 100644 fixtures/dag-topology/task-713-cycle-detection/architect/verify.ts create mode 100644 fixtures/dag-topology/task-713-cycle-detection/coder/expected.patch create mode 100644 fixtures/dag-topology/task-713-cycle-detection/coder/prompt.md create mode 100644 fixtures/dag-topology/task-713-cycle-detection/coder/verify.ts create mode 100644 fixtures/dag-topology/task-713-cycle-detection/planner/expected.json create mode 100644 fixtures/dag-topology/task-713-cycle-detection/planner/prompt.md create mode 100644 fixtures/dag-topology/task-713-cycle-detection/planner/verify.ts create mode 100644 fixtures/dag-topology/task-713-cycle-detection/reviewer/expected.json create mode 100644 fixtures/dag-topology/task-713-cycle-detection/reviewer/prompt.md create mode 100644 fixtures/dag-topology/task-713-cycle-detection/reviewer/verify.ts create mode 100644 fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/architect/expected.json create mode 100644 fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/architect/prompt.md create mode 100644 fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/architect/verify.ts create mode 100644 fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/coder/expected.patch create mode 100644 fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/coder/prompt.md create mode 100644 fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/coder/verify.ts create mode 100644 fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/planner/expected.json create mode 100644 fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/planner/prompt.md create mode 100644 fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/planner/verify.ts create mode 100644 fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/reviewer/expected.json create mode 100644 fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/reviewer/prompt.md create mode 100644 fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/reviewer/verify.ts create mode 100644 fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/architect/expected.json create mode 100644 fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/architect/prompt.md create mode 100644 fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/architect/verify.ts create mode 100644 fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/coder/expected.patch create mode 100644 fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/coder/prompt.md create mode 100644 fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/coder/verify.ts create mode 100644 fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/planner/expected.json create mode 100644 fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/planner/prompt.md create mode 100644 fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/planner/verify.ts create mode 100644 fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/reviewer/expected.json create mode 100644 fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/reviewer/prompt.md create mode 100644 fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/reviewer/verify.ts create mode 100644 fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/architect/expected.json create mode 100644 fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/architect/prompt.md create mode 100644 fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/architect/verify.ts create mode 100644 fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/coder/expected.patch create mode 100644 fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/coder/prompt.md create mode 100644 fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/coder/verify.ts create mode 100644 fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/planner/expected.json create mode 100644 fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/planner/prompt.md create mode 100644 fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/planner/verify.ts create mode 100644 fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/reviewer/expected.json create mode 100644 fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/reviewer/prompt.md create mode 100644 fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/reviewer/verify.ts create mode 100644 fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/architect/expected.json create mode 100644 fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/architect/prompt.md create mode 100644 fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/architect/verify.ts create mode 100644 fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/coder/expected.patch create mode 100644 fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/coder/prompt.md create mode 100644 fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/coder/verify.ts create mode 100644 fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/planner/expected.json create mode 100644 fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/planner/prompt.md create mode 100644 fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/planner/verify.ts create mode 100644 fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/reviewer/expected.json create mode 100644 fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/reviewer/prompt.md create mode 100644 fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/reviewer/verify.ts create mode 100644 fixtures/large-file-and-integrity/task-901-large-file-handling/architect/expected.json create mode 100644 fixtures/large-file-and-integrity/task-901-large-file-handling/architect/prompt.md create mode 100644 fixtures/large-file-and-integrity/task-901-large-file-handling/architect/verify.ts create mode 100644 fixtures/large-file-and-integrity/task-901-large-file-handling/coder/expected.patch create mode 100644 fixtures/large-file-and-integrity/task-901-large-file-handling/coder/prompt.md create mode 100644 fixtures/large-file-and-integrity/task-901-large-file-handling/coder/verify.ts create mode 100644 fixtures/large-file-and-integrity/task-901-large-file-handling/planner/expected.json create mode 100644 fixtures/large-file-and-integrity/task-901-large-file-handling/planner/prompt.md create mode 100644 fixtures/large-file-and-integrity/task-901-large-file-handling/planner/verify.ts create mode 100644 fixtures/large-file-and-integrity/task-901-large-file-handling/reviewer/expected.json create mode 100644 fixtures/large-file-and-integrity/task-901-large-file-handling/reviewer/prompt.md create mode 100644 fixtures/large-file-and-integrity/task-901-large-file-handling/reviewer/verify.ts create mode 100644 fixtures/large-file-and-integrity/task-904-checksum-validation/architect/expected.json create mode 100644 fixtures/large-file-and-integrity/task-904-checksum-validation/architect/prompt.md create mode 100644 fixtures/large-file-and-integrity/task-904-checksum-validation/architect/verify.ts create mode 100644 fixtures/large-file-and-integrity/task-904-checksum-validation/coder/expected.patch create mode 100644 fixtures/large-file-and-integrity/task-904-checksum-validation/coder/prompt.md create mode 100644 fixtures/large-file-and-integrity/task-904-checksum-validation/coder/verify.ts create mode 100644 fixtures/large-file-and-integrity/task-904-checksum-validation/planner/expected.json create mode 100644 fixtures/large-file-and-integrity/task-904-checksum-validation/planner/prompt.md create mode 100644 fixtures/large-file-and-integrity/task-904-checksum-validation/planner/verify.ts create mode 100644 fixtures/large-file-and-integrity/task-904-checksum-validation/reviewer/expected.json create mode 100644 fixtures/large-file-and-integrity/task-904-checksum-validation/reviewer/prompt.md create mode 100644 fixtures/large-file-and-integrity/task-904-checksum-validation/reviewer/verify.ts create mode 100644 fixtures/large-file-and-integrity/task-905-binary-file-detection/architect/expected.json create mode 100644 fixtures/large-file-and-integrity/task-905-binary-file-detection/architect/prompt.md create mode 100644 fixtures/large-file-and-integrity/task-905-binary-file-detection/architect/verify.ts create mode 100644 fixtures/large-file-and-integrity/task-905-binary-file-detection/coder/expected.patch create mode 100644 fixtures/large-file-and-integrity/task-905-binary-file-detection/coder/prompt.md create mode 100644 fixtures/large-file-and-integrity/task-905-binary-file-detection/coder/verify.ts create mode 100644 fixtures/large-file-and-integrity/task-905-binary-file-detection/planner/expected.json create mode 100644 fixtures/large-file-and-integrity/task-905-binary-file-detection/planner/prompt.md create mode 100644 fixtures/large-file-and-integrity/task-905-binary-file-detection/planner/verify.ts create mode 100644 fixtures/large-file-and-integrity/task-905-binary-file-detection/reviewer/expected.json create mode 100644 fixtures/large-file-and-integrity/task-905-binary-file-detection/reviewer/prompt.md create mode 100644 fixtures/large-file-and-integrity/task-905-binary-file-detection/reviewer/verify.ts create mode 100644 fixtures/large-file-and-integrity/task-906-file-locking/architect/expected.json create mode 100644 fixtures/large-file-and-integrity/task-906-file-locking/architect/prompt.md create mode 100644 fixtures/large-file-and-integrity/task-906-file-locking/architect/verify.ts create mode 100644 fixtures/large-file-and-integrity/task-906-file-locking/coder/expected.patch create mode 100644 fixtures/large-file-and-integrity/task-906-file-locking/coder/prompt.md create mode 100644 fixtures/large-file-and-integrity/task-906-file-locking/coder/verify.ts create mode 100644 fixtures/large-file-and-integrity/task-906-file-locking/planner/expected.json create mode 100644 fixtures/large-file-and-integrity/task-906-file-locking/planner/prompt.md create mode 100644 fixtures/large-file-and-integrity/task-906-file-locking/planner/verify.ts create mode 100644 fixtures/large-file-and-integrity/task-906-file-locking/reviewer/expected.json create mode 100644 fixtures/large-file-and-integrity/task-906-file-locking/reviewer/prompt.md create mode 100644 fixtures/large-file-and-integrity/task-906-file-locking/reviewer/verify.ts create mode 100644 fixtures/large-file-and-integrity/task-907-atomic-write/architect/expected.json create mode 100644 fixtures/large-file-and-integrity/task-907-atomic-write/architect/prompt.md create mode 100644 fixtures/large-file-and-integrity/task-907-atomic-write/architect/verify.ts create mode 100644 fixtures/large-file-and-integrity/task-907-atomic-write/coder/expected.patch create mode 100644 fixtures/large-file-and-integrity/task-907-atomic-write/coder/prompt.md create mode 100644 fixtures/large-file-and-integrity/task-907-atomic-write/coder/verify.ts create mode 100644 fixtures/large-file-and-integrity/task-907-atomic-write/planner/expected.json create mode 100644 fixtures/large-file-and-integrity/task-907-atomic-write/planner/prompt.md create mode 100644 fixtures/large-file-and-integrity/task-907-atomic-write/planner/verify.ts create mode 100644 fixtures/large-file-and-integrity/task-907-atomic-write/reviewer/expected.json create mode 100644 fixtures/large-file-and-integrity/task-907-atomic-write/reviewer/prompt.md create mode 100644 fixtures/large-file-and-integrity/task-907-atomic-write/reviewer/verify.ts create mode 100644 fixtures/multi-file-refactors/task-600-rename-across-files/architect/expected.json create mode 100644 fixtures/multi-file-refactors/task-600-rename-across-files/architect/prompt.md create mode 100644 fixtures/multi-file-refactors/task-600-rename-across-files/architect/verify.ts create mode 100644 fixtures/multi-file-refactors/task-600-rename-across-files/coder/expected.patch create mode 100644 fixtures/multi-file-refactors/task-600-rename-across-files/coder/prompt.md create mode 100644 fixtures/multi-file-refactors/task-600-rename-across-files/coder/verify.ts create mode 100644 fixtures/multi-file-refactors/task-600-rename-across-files/planner/expected.json create mode 100644 fixtures/multi-file-refactors/task-600-rename-across-files/planner/prompt.md create mode 100644 fixtures/multi-file-refactors/task-600-rename-across-files/planner/verify.ts create mode 100644 fixtures/multi-file-refactors/task-600-rename-across-files/reviewer/expected.json create mode 100644 fixtures/multi-file-refactors/task-600-rename-across-files/reviewer/prompt.md create mode 100644 fixtures/multi-file-refactors/task-600-rename-across-files/reviewer/verify.ts create mode 100644 fixtures/multi-file-refactors/task-601-extract-shared-module/architect/expected.json create mode 100644 fixtures/multi-file-refactors/task-601-extract-shared-module/architect/prompt.md create mode 100644 fixtures/multi-file-refactors/task-601-extract-shared-module/architect/verify.ts create mode 100644 fixtures/multi-file-refactors/task-601-extract-shared-module/coder/expected.patch create mode 100644 fixtures/multi-file-refactors/task-601-extract-shared-module/coder/prompt.md create mode 100644 fixtures/multi-file-refactors/task-601-extract-shared-module/coder/verify.ts create mode 100644 fixtures/multi-file-refactors/task-601-extract-shared-module/planner/expected.json create mode 100644 fixtures/multi-file-refactors/task-601-extract-shared-module/planner/prompt.md create mode 100644 fixtures/multi-file-refactors/task-601-extract-shared-module/planner/verify.ts create mode 100644 fixtures/multi-file-refactors/task-601-extract-shared-module/reviewer/expected.json create mode 100644 fixtures/multi-file-refactors/task-601-extract-shared-module/reviewer/prompt.md create mode 100644 fixtures/multi-file-refactors/task-601-extract-shared-module/reviewer/verify.ts create mode 100644 fixtures/multi-file-refactors/task-602-move-file-update-imports/architect/expected.json create mode 100644 fixtures/multi-file-refactors/task-602-move-file-update-imports/architect/prompt.md create mode 100644 fixtures/multi-file-refactors/task-602-move-file-update-imports/architect/verify.ts create mode 100644 fixtures/multi-file-refactors/task-602-move-file-update-imports/coder/expected.patch create mode 100644 fixtures/multi-file-refactors/task-602-move-file-update-imports/coder/prompt.md create mode 100644 fixtures/multi-file-refactors/task-602-move-file-update-imports/coder/verify.ts create mode 100644 fixtures/multi-file-refactors/task-602-move-file-update-imports/planner/expected.json create mode 100644 fixtures/multi-file-refactors/task-602-move-file-update-imports/planner/prompt.md create mode 100644 fixtures/multi-file-refactors/task-602-move-file-update-imports/planner/verify.ts create mode 100644 fixtures/multi-file-refactors/task-602-move-file-update-imports/reviewer/expected.json create mode 100644 fixtures/multi-file-refactors/task-602-move-file-update-imports/reviewer/prompt.md create mode 100644 fixtures/multi-file-refactors/task-602-move-file-update-imports/reviewer/verify.ts create mode 100644 fixtures/provenance/task-401-trace-origin/architect/expected.json create mode 100644 fixtures/provenance/task-401-trace-origin/architect/prompt.md create mode 100644 fixtures/provenance/task-401-trace-origin/architect/verify.ts create mode 100644 fixtures/provenance/task-401-trace-origin/coder/expected.patch create mode 100644 fixtures/provenance/task-401-trace-origin/coder/prompt.md create mode 100644 fixtures/provenance/task-401-trace-origin/coder/verify.ts create mode 100644 fixtures/provenance/task-401-trace-origin/planner/expected.json create mode 100644 fixtures/provenance/task-401-trace-origin/planner/prompt.md create mode 100644 fixtures/provenance/task-401-trace-origin/planner/verify.ts create mode 100644 fixtures/provenance/task-401-trace-origin/reviewer/expected.json create mode 100644 fixtures/provenance/task-401-trace-origin/reviewer/prompt.md create mode 100644 fixtures/provenance/task-401-trace-origin/reviewer/verify.ts create mode 100644 fixtures/provenance/task-402-attribution-chain/architect/expected.json create mode 100644 fixtures/provenance/task-402-attribution-chain/architect/prompt.md create mode 100644 fixtures/provenance/task-402-attribution-chain/architect/verify.ts create mode 100644 fixtures/provenance/task-402-attribution-chain/coder/expected.patch create mode 100644 fixtures/provenance/task-402-attribution-chain/coder/prompt.md create mode 100644 fixtures/provenance/task-402-attribution-chain/coder/verify.ts create mode 100644 fixtures/provenance/task-402-attribution-chain/planner/expected.json create mode 100644 fixtures/provenance/task-402-attribution-chain/planner/prompt.md create mode 100644 fixtures/provenance/task-402-attribution-chain/planner/verify.ts create mode 100644 fixtures/provenance/task-402-attribution-chain/reviewer/expected.json create mode 100644 fixtures/provenance/task-402-attribution-chain/reviewer/prompt.md create mode 100644 fixtures/provenance/task-402-attribution-chain/reviewer/verify.ts create mode 100644 fixtures/provenance/task-403-dependency-tracking/architect/expected.json create mode 100644 fixtures/provenance/task-403-dependency-tracking/architect/prompt.md create mode 100644 fixtures/provenance/task-403-dependency-tracking/architect/verify.ts create mode 100644 fixtures/provenance/task-403-dependency-tracking/coder/expected.patch create mode 100644 fixtures/provenance/task-403-dependency-tracking/coder/prompt.md create mode 100644 fixtures/provenance/task-403-dependency-tracking/coder/verify.ts create mode 100644 fixtures/provenance/task-403-dependency-tracking/planner/expected.json create mode 100644 fixtures/provenance/task-403-dependency-tracking/planner/prompt.md create mode 100644 fixtures/provenance/task-403-dependency-tracking/planner/verify.ts create mode 100644 fixtures/provenance/task-403-dependency-tracking/reviewer/expected.json create mode 100644 fixtures/provenance/task-403-dependency-tracking/reviewer/prompt.md create mode 100644 fixtures/provenance/task-403-dependency-tracking/reviewer/verify.ts create mode 100644 fixtures/reviewer-behavior/task-406-blocking-comment-required/architect/expected.json create mode 100644 fixtures/reviewer-behavior/task-406-blocking-comment-required/architect/prompt.md create mode 100644 fixtures/reviewer-behavior/task-406-blocking-comment-required/architect/verify.ts create mode 100644 fixtures/reviewer-behavior/task-406-blocking-comment-required/coder/expected.patch create mode 100644 fixtures/reviewer-behavior/task-406-blocking-comment-required/coder/prompt.md create mode 100644 fixtures/reviewer-behavior/task-406-blocking-comment-required/coder/verify.ts create mode 100644 fixtures/reviewer-behavior/task-406-blocking-comment-required/planner/expected.json create mode 100644 fixtures/reviewer-behavior/task-406-blocking-comment-required/planner/prompt.md create mode 100644 fixtures/reviewer-behavior/task-406-blocking-comment-required/planner/verify.ts create mode 100644 fixtures/reviewer-behavior/task-406-blocking-comment-required/reviewer/expected.json create mode 100644 fixtures/reviewer-behavior/task-406-blocking-comment-required/reviewer/prompt.md create mode 100644 fixtures/reviewer-behavior/task-406-blocking-comment-required/reviewer/verify.ts create mode 100644 fixtures/reviewer-behavior/task-408-grounded-comments/architect/expected.json create mode 100644 fixtures/reviewer-behavior/task-408-grounded-comments/architect/prompt.md create mode 100644 fixtures/reviewer-behavior/task-408-grounded-comments/architect/verify.ts create mode 100644 fixtures/reviewer-behavior/task-408-grounded-comments/coder/expected.patch create mode 100644 fixtures/reviewer-behavior/task-408-grounded-comments/coder/prompt.md create mode 100644 fixtures/reviewer-behavior/task-408-grounded-comments/coder/verify.ts create mode 100644 fixtures/reviewer-behavior/task-408-grounded-comments/planner/expected.json create mode 100644 fixtures/reviewer-behavior/task-408-grounded-comments/planner/prompt.md create mode 100644 fixtures/reviewer-behavior/task-408-grounded-comments/planner/verify.ts create mode 100644 fixtures/reviewer-behavior/task-408-grounded-comments/reviewer/expected.json create mode 100644 fixtures/reviewer-behavior/task-408-grounded-comments/reviewer/prompt.md create mode 100644 fixtures/reviewer-behavior/task-408-grounded-comments/reviewer/verify.ts diff --git a/fixtures/ambiguity/task-501-unclear-requirements/architect/expected.json b/fixtures/ambiguity/task-501-unclear-requirements/architect/expected.json new file mode 100644 index 0000000..8b9fc04 --- /dev/null +++ b/fixtures/ambiguity/task-501-unclear-requirements/architect/expected.json @@ -0,0 +1,7 @@ +{ + "highLevelSummary": "The request 'make the app better' is ambiguous and lacks specific requirements. Clarification is needed on what aspects should be improved, which files to modify, and what success criteria to use.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [] +} diff --git a/fixtures/ambiguity/task-501-unclear-requirements/architect/prompt.md b/fixtures/ambiguity/task-501-unclear-requirements/architect/prompt.md new file mode 100644 index 0000000..abc1b43 --- /dev/null +++ b/fixtures/ambiguity/task-501-unclear-requirements/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for a task with unclear or ambiguous requirements. + +The request is vague: +- "Make the app better" +- No specific files or features mentioned +- No clear success criteria + +Requirements: +- Acknowledge the ambiguity in the request +- Emit an "unknown" task type where appropriate +- Document what clarification would be needed + +Non-goals: +- Do not invent specific requirements +- Do not assume what "better" means diff --git a/fixtures/ambiguity/task-501-unclear-requirements/architect/verify.ts b/fixtures/ambiguity/task-501-unclear-requirements/architect/verify.ts new file mode 100644 index 0000000..372afd8 --- /dev/null +++ b/fixtures/ambiguity/task-501-unclear-requirements/architect/verify.ts @@ -0,0 +1,20 @@ +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("ambiguous") && !summary.includes("unclear") && !summary.includes("clarification")) { + return { + ok: false, + reason: "highLevelSummary must acknowledge ambiguity or need for clarification", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/ambiguity/task-501-unclear-requirements/coder/expected.patch b/fixtures/ambiguity/task-501-unclear-requirements/coder/expected.patch new file mode 100644 index 0000000..b2c7725 --- /dev/null +++ b/fixtures/ambiguity/task-501-unclear-requirements/coder/expected.patch @@ -0,0 +1,11 @@ +diff --git a/TODO.md b/TODO.md +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/TODO.md +@@ -0,0 +1,5 @@ ++# Clarification Needed ++ ++The request "make the app better" requires clarification: ++- Which specific files or features should be improved? ++- What are the success criteria for "better"? diff --git a/fixtures/ambiguity/task-501-unclear-requirements/coder/prompt.md b/fixtures/ambiguity/task-501-unclear-requirements/coder/prompt.md new file mode 100644 index 0000000..a63785e --- /dev/null +++ b/fixtures/ambiguity/task-501-unclear-requirements/coder/prompt.md @@ -0,0 +1,7 @@ +You are the coder agent. The request is ambiguous: "Make the app better" + +Requirements: +- Cannot produce a meaningful patch without clarification +- The request lacks specific files, features, and success criteria + +Return an empty or minimal patch acknowledging the ambiguity. diff --git a/fixtures/ambiguity/task-501-unclear-requirements/coder/verify.ts b/fixtures/ambiguity/task-501-unclear-requirements/coder/verify.ts new file mode 100644 index 0000000..d562754 --- /dev/null +++ b/fixtures/ambiguity/task-501-unclear-requirements/coder/verify.ts @@ -0,0 +1,18 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("clarification") && !patch.includes("Clarification")) { + return { + ok: false, + reason: "Patch must acknowledge the need for clarification.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/ambiguity/task-501-unclear-requirements/planner/expected.json b/fixtures/ambiguity/task-501-unclear-requirements/planner/expected.json new file mode 100644 index 0000000..ee83846 --- /dev/null +++ b/fixtures/ambiguity/task-501-unclear-requirements/planner/expected.json @@ -0,0 +1,18 @@ +{ + "tasks": [ + { + "id": "clarify-requirements", + "description": "Clarify what 'make the app better' means - need specific files, features, and success criteria", + "file": "", + "type": "unknown", + "complexity": "low", + "dependsOn": [] + } + ], + "ambiguities": [ + "No specific files mentioned", + "No clear definition of 'better'", + "No success criteria provided" + ], + "invalidTaskCount": 0 +} diff --git a/fixtures/ambiguity/task-501-unclear-requirements/planner/prompt.md b/fixtures/ambiguity/task-501-unclear-requirements/planner/prompt.md new file mode 100644 index 0000000..f60fd68 --- /dev/null +++ b/fixtures/ambiguity/task-501-unclear-requirements/planner/prompt.md @@ -0,0 +1,8 @@ +Using the architect's spec for an ambiguous request, produce a task list +that acknowledges the unclear requirements. + +The request is vague: "Make the app better" + +Requirements: +- Emit "unknown" task type for ambiguous areas +- Document what clarification would be needed diff --git a/fixtures/ambiguity/task-501-unclear-requirements/planner/verify.ts b/fixtures/ambiguity/task-501-unclear-requirements/planner/verify.ts new file mode 100644 index 0000000..15e16eb --- /dev/null +++ b/fixtures/ambiguity/task-501-unclear-requirements/planner/verify.ts @@ -0,0 +1,26 @@ +import { + verifyPlanner, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyPlanner(ctx, (out) => { + const hasUnknownTask = out.tasks.some((t) => t.type === "unknown"); + if (!hasUnknownTask) { + return { + ok: false, + reason: "Planner must emit an 'unknown' task type for ambiguous requirements.", + }; + } + + if (out.ambiguities.length === 0) { + return { + ok: false, + reason: "Planner must document ambiguities in the request.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/ambiguity/task-501-unclear-requirements/reviewer/expected.json b/fixtures/ambiguity/task-501-unclear-requirements/reviewer/expected.json new file mode 100644 index 0000000..6aca250 --- /dev/null +++ b/fixtures/ambiguity/task-501-unclear-requirements/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Correctly identifies that the request is ambiguous and clarification is needed before proceeding.", + "path": "TODO.md", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/ambiguity/task-501-unclear-requirements/reviewer/prompt.md b/fixtures/ambiguity/task-501-unclear-requirements/reviewer/prompt.md new file mode 100644 index 0000000..f0f1035 --- /dev/null +++ b/fixtures/ambiguity/task-501-unclear-requirements/reviewer/prompt.md @@ -0,0 +1,14 @@ +You are the reviewer agent. + +Review a patch that acknowledges ambiguous requirements. + +The original request was vague: "Make the app better" + +Your responsibilities: +- Acknowledge that the patch correctly identifies the ambiguity +- Note that clarification is needed before meaningful work can proceed +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/ambiguity/task-501-unclear-requirements/reviewer/verify.ts b/fixtures/ambiguity/task-501-unclear-requirements/reviewer/verify.ts new file mode 100644 index 0000000..3149e02 --- /dev/null +++ b/fixtures/ambiguity/task-501-unclear-requirements/reviewer/verify.ts @@ -0,0 +1,30 @@ +import { + verifyReviewer, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyReviewer(ctx, (out) => { + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer must include at least one comment about the ambiguity.", + }; + } + + const acknowledgesAmbiguity = out.comments.some( + (c) => + c.message.toLowerCase().includes("ambiguous") || + c.message.toLowerCase().includes("clarification") + ); + if (!acknowledgesAmbiguity) { + return { + ok: false, + reason: "Reviewer must acknowledge the ambiguity in the request.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/ambiguity/task-502-conflicting-constraints/architect/expected.json b/fixtures/ambiguity/task-502-conflicting-constraints/architect/expected.json new file mode 100644 index 0000000..5c32ec6 --- /dev/null +++ b/fixtures/ambiguity/task-502-conflicting-constraints/architect/expected.json @@ -0,0 +1,7 @@ +{ + "highLevelSummary": "The request contains conflicting constraints: add a feature to src/api/handler.ts while not modifying any files in src/api/. These constraints are mutually exclusive and require clarification before proceeding.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [] +} diff --git a/fixtures/ambiguity/task-502-conflicting-constraints/architect/prompt.md b/fixtures/ambiguity/task-502-conflicting-constraints/architect/prompt.md new file mode 100644 index 0000000..ae9357e --- /dev/null +++ b/fixtures/ambiguity/task-502-conflicting-constraints/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for a task with conflicting constraints. + +The request has contradictory requirements: +- "Add a new feature to src/api/handler.ts" +- "Do not modify any files in src/api/" +- These constraints cannot both be satisfied + +Requirements: +- Acknowledge the conflicting constraints +- Document the contradiction +- Suggest resolution approaches + +Non-goals: +- Do not ignore either constraint +- Do not proceed without resolving the conflict diff --git a/fixtures/ambiguity/task-502-conflicting-constraints/architect/verify.ts b/fixtures/ambiguity/task-502-conflicting-constraints/architect/verify.ts new file mode 100644 index 0000000..602b3bb --- /dev/null +++ b/fixtures/ambiguity/task-502-conflicting-constraints/architect/verify.ts @@ -0,0 +1,20 @@ +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("conflict") && !summary.includes("contradict") && !summary.includes("mutually exclusive")) { + return { + ok: false, + reason: "highLevelSummary must acknowledge conflicting or contradictory constraints", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/ambiguity/task-502-conflicting-constraints/coder/expected.patch b/fixtures/ambiguity/task-502-conflicting-constraints/coder/expected.patch new file mode 100644 index 0000000..8109baf --- /dev/null +++ b/fixtures/ambiguity/task-502-conflicting-constraints/coder/expected.patch @@ -0,0 +1,13 @@ +diff --git a/CONFLICT.md b/CONFLICT.md +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/CONFLICT.md +@@ -0,0 +1,7 @@ ++# Constraint Conflict ++ ++Cannot proceed due to conflicting constraints: ++1. Requirement: Add a feature to src/api/handler.ts ++2. Constraint: Do not modify any files in src/api/ ++ ++These requirements are mutually exclusive. Please clarify which constraint takes priority. diff --git a/fixtures/ambiguity/task-502-conflicting-constraints/coder/prompt.md b/fixtures/ambiguity/task-502-conflicting-constraints/coder/prompt.md new file mode 100644 index 0000000..602b3d7 --- /dev/null +++ b/fixtures/ambiguity/task-502-conflicting-constraints/coder/prompt.md @@ -0,0 +1,9 @@ +You are the coder agent. The request has conflicting constraints: +- Add a feature to src/api/handler.ts +- Do not modify any files in src/api/ + +Requirements: +- Cannot produce a meaningful patch due to conflicting constraints +- Document the conflict + +Return a patch acknowledging the constraint conflict. diff --git a/fixtures/ambiguity/task-502-conflicting-constraints/coder/verify.ts b/fixtures/ambiguity/task-502-conflicting-constraints/coder/verify.ts new file mode 100644 index 0000000..5efa13e --- /dev/null +++ b/fixtures/ambiguity/task-502-conflicting-constraints/coder/verify.ts @@ -0,0 +1,18 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("conflict") && !patch.includes("Conflict")) { + return { + ok: false, + reason: "Patch must acknowledge the constraint conflict.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/ambiguity/task-502-conflicting-constraints/planner/expected.json b/fixtures/ambiguity/task-502-conflicting-constraints/planner/expected.json new file mode 100644 index 0000000..5f904df --- /dev/null +++ b/fixtures/ambiguity/task-502-conflicting-constraints/planner/expected.json @@ -0,0 +1,17 @@ +{ + "tasks": [ + { + "id": "resolve-conflict", + "description": "Resolve conflicting constraints: cannot add feature to src/api/handler.ts while also not modifying src/api/", + "file": "", + "type": "unknown", + "complexity": "low", + "dependsOn": [] + } + ], + "ambiguities": [ + "Constraint conflict: must add feature to src/api/handler.ts but cannot modify src/api/", + "These requirements are mutually exclusive" + ], + "invalidTaskCount": 0 +} diff --git a/fixtures/ambiguity/task-502-conflicting-constraints/planner/prompt.md b/fixtures/ambiguity/task-502-conflicting-constraints/planner/prompt.md new file mode 100644 index 0000000..21227e2 --- /dev/null +++ b/fixtures/ambiguity/task-502-conflicting-constraints/planner/prompt.md @@ -0,0 +1,10 @@ +Using the architect's spec for conflicting constraints, produce a task list +that acknowledges the contradiction. + +Conflicting requirements: +- Add a feature to src/api/handler.ts +- Do not modify any files in src/api/ + +Requirements: +- Emit "unknown" task type for the conflicting area +- Document the conflict in ambiguities diff --git a/fixtures/ambiguity/task-502-conflicting-constraints/planner/verify.ts b/fixtures/ambiguity/task-502-conflicting-constraints/planner/verify.ts new file mode 100644 index 0000000..d7993f6 --- /dev/null +++ b/fixtures/ambiguity/task-502-conflicting-constraints/planner/verify.ts @@ -0,0 +1,36 @@ +import { + verifyPlanner, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyPlanner(ctx, (out) => { + const hasUnknownTask = out.tasks.some((t) => t.type === "unknown"); + if (!hasUnknownTask) { + return { + ok: false, + reason: "Planner must emit an 'unknown' task type for conflicting constraints.", + }; + } + + if (out.ambiguities.length === 0) { + return { + ok: false, + reason: "Planner must document the conflicting constraints in ambiguities.", + }; + } + + const documentsConflict = out.ambiguities.some( + (a) => a.toLowerCase().includes("conflict") || a.toLowerCase().includes("mutually") + ); + if (!documentsConflict) { + return { + ok: false, + reason: "Planner must explicitly document the constraint conflict.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/ambiguity/task-502-conflicting-constraints/reviewer/expected.json b/fixtures/ambiguity/task-502-conflicting-constraints/reviewer/expected.json new file mode 100644 index 0000000..639f289 --- /dev/null +++ b/fixtures/ambiguity/task-502-conflicting-constraints/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Correctly identifies the conflicting constraints and requests clarification before proceeding.", + "path": "CONFLICT.md", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/ambiguity/task-502-conflicting-constraints/reviewer/prompt.md b/fixtures/ambiguity/task-502-conflicting-constraints/reviewer/prompt.md new file mode 100644 index 0000000..2d81d96 --- /dev/null +++ b/fixtures/ambiguity/task-502-conflicting-constraints/reviewer/prompt.md @@ -0,0 +1,16 @@ +You are the reviewer agent. + +Review a patch that acknowledges conflicting constraints. + +Conflicting requirements: +- Add a feature to src/api/handler.ts +- Do not modify any files in src/api/ + +Your responsibilities: +- Acknowledge that the patch correctly identifies the conflict +- Note that clarification is needed before proceeding +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/ambiguity/task-502-conflicting-constraints/reviewer/verify.ts b/fixtures/ambiguity/task-502-conflicting-constraints/reviewer/verify.ts new file mode 100644 index 0000000..d6eeb8c --- /dev/null +++ b/fixtures/ambiguity/task-502-conflicting-constraints/reviewer/verify.ts @@ -0,0 +1,30 @@ +import { + verifyReviewer, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyReviewer(ctx, (out) => { + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer must include at least one comment about the conflict.", + }; + } + + const acknowledgesConflict = out.comments.some( + (c) => + c.message.toLowerCase().includes("conflict") || + c.message.toLowerCase().includes("clarification") + ); + if (!acknowledgesConflict) { + return { + ok: false, + reason: "Reviewer must acknowledge the conflicting constraints.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/ambiguity/task-503-missing-context/architect/expected.json b/fixtures/ambiguity/task-503-missing-context/architect/expected.json new file mode 100644 index 0000000..e6e9375 --- /dev/null +++ b/fixtures/ambiguity/task-503-missing-context/architect/expected.json @@ -0,0 +1,7 @@ +{ + "highLevelSummary": "Cannot proceed with updating UserService class as it does not exist in the codebase. Need clarification on whether to create a new UserService or if the reference is to a different class.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [] +} diff --git a/fixtures/ambiguity/task-503-missing-context/architect/prompt.md b/fixtures/ambiguity/task-503-missing-context/architect/prompt.md new file mode 100644 index 0000000..89ab9d7 --- /dev/null +++ b/fixtures/ambiguity/task-503-missing-context/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for a task with missing context. + +The request references things that don't exist: +- "Update the UserService class" +- But there is no UserService class in the codebase +- The referenced file or class cannot be found + +Requirements: +- Acknowledge the missing context +- Document what information is needed +- Do not invent the missing code + +Non-goals: +- Do not create a UserService from scratch +- Do not assume what the UserService should look like diff --git a/fixtures/ambiguity/task-503-missing-context/architect/verify.ts b/fixtures/ambiguity/task-503-missing-context/architect/verify.ts new file mode 100644 index 0000000..7f61a43 --- /dev/null +++ b/fixtures/ambiguity/task-503-missing-context/architect/verify.ts @@ -0,0 +1,20 @@ +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("not exist") && !summary.includes("missing") && !summary.includes("cannot")) { + return { + ok: false, + reason: "highLevelSummary must acknowledge missing context or non-existent reference", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/ambiguity/task-503-missing-context/coder/expected.patch b/fixtures/ambiguity/task-503-missing-context/coder/expected.patch new file mode 100644 index 0000000..0a14536 --- /dev/null +++ b/fixtures/ambiguity/task-503-missing-context/coder/expected.patch @@ -0,0 +1,13 @@ +diff --git a/MISSING_CONTEXT.md b/MISSING_CONTEXT.md +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/MISSING_CONTEXT.md +@@ -0,0 +1,7 @@ ++# Missing Context ++ ++Cannot proceed with the request: ++- Referenced: UserService class ++- Status: Does not exist in the codebase ++ ++Please clarify: Should a new UserService be created, or was a different class intended? diff --git a/fixtures/ambiguity/task-503-missing-context/coder/prompt.md b/fixtures/ambiguity/task-503-missing-context/coder/prompt.md new file mode 100644 index 0000000..4553aee --- /dev/null +++ b/fixtures/ambiguity/task-503-missing-context/coder/prompt.md @@ -0,0 +1,9 @@ +You are the coder agent. The request references a non-existent class: +- "Update the UserService class" +- But UserService does not exist in the codebase + +Requirements: +- Cannot produce a meaningful patch for non-existent code +- Document the missing context + +Return a patch acknowledging the missing context. diff --git a/fixtures/ambiguity/task-503-missing-context/coder/verify.ts b/fixtures/ambiguity/task-503-missing-context/coder/verify.ts new file mode 100644 index 0000000..7f87713 --- /dev/null +++ b/fixtures/ambiguity/task-503-missing-context/coder/verify.ts @@ -0,0 +1,18 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("Missing") && !patch.includes("missing") && !patch.includes("not exist")) { + return { + ok: false, + reason: "Patch must acknowledge the missing context.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/ambiguity/task-503-missing-context/planner/expected.json b/fixtures/ambiguity/task-503-missing-context/planner/expected.json new file mode 100644 index 0000000..ea0354a --- /dev/null +++ b/fixtures/ambiguity/task-503-missing-context/planner/expected.json @@ -0,0 +1,17 @@ +{ + "tasks": [ + { + "id": "clarify-userservice", + "description": "Clarify UserService reference - class does not exist in codebase. Need to know if it should be created or if a different class was intended.", + "file": "", + "type": "unknown", + "complexity": "low", + "dependsOn": [] + } + ], + "ambiguities": [ + "UserService class does not exist in the codebase", + "Need clarification on whether to create new class or reference different existing class" + ], + "invalidTaskCount": 0 +} diff --git a/fixtures/ambiguity/task-503-missing-context/planner/prompt.md b/fixtures/ambiguity/task-503-missing-context/planner/prompt.md new file mode 100644 index 0000000..8845441 --- /dev/null +++ b/fixtures/ambiguity/task-503-missing-context/planner/prompt.md @@ -0,0 +1,9 @@ +Using the architect's spec for missing context, produce a task list +that acknowledges the non-existent reference. + +The request references: UserService class +But: UserService does not exist in the codebase + +Requirements: +- Emit "unknown" task type for the missing context +- Document what information is needed diff --git a/fixtures/ambiguity/task-503-missing-context/planner/verify.ts b/fixtures/ambiguity/task-503-missing-context/planner/verify.ts new file mode 100644 index 0000000..b628ce0 --- /dev/null +++ b/fixtures/ambiguity/task-503-missing-context/planner/verify.ts @@ -0,0 +1,26 @@ +import { + verifyPlanner, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyPlanner(ctx, (out) => { + const hasUnknownTask = out.tasks.some((t) => t.type === "unknown"); + if (!hasUnknownTask) { + return { + ok: false, + reason: "Planner must emit an 'unknown' task type for missing context.", + }; + } + + if (out.ambiguities.length === 0) { + return { + ok: false, + reason: "Planner must document the missing context in ambiguities.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/ambiguity/task-503-missing-context/reviewer/expected.json b/fixtures/ambiguity/task-503-missing-context/reviewer/expected.json new file mode 100644 index 0000000..79e7f7a --- /dev/null +++ b/fixtures/ambiguity/task-503-missing-context/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Correctly identifies that UserService does not exist and requests clarification before proceeding.", + "path": "MISSING_CONTEXT.md", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/ambiguity/task-503-missing-context/reviewer/prompt.md b/fixtures/ambiguity/task-503-missing-context/reviewer/prompt.md new file mode 100644 index 0000000..a170371 --- /dev/null +++ b/fixtures/ambiguity/task-503-missing-context/reviewer/prompt.md @@ -0,0 +1,15 @@ +You are the reviewer agent. + +Review a patch that acknowledges missing context. + +The request referenced: UserService class +But: UserService does not exist in the codebase + +Your responsibilities: +- Acknowledge that the patch correctly identifies the missing context +- Note that clarification is needed before proceeding +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/ambiguity/task-503-missing-context/reviewer/verify.ts b/fixtures/ambiguity/task-503-missing-context/reviewer/verify.ts new file mode 100644 index 0000000..beb14eb --- /dev/null +++ b/fixtures/ambiguity/task-503-missing-context/reviewer/verify.ts @@ -0,0 +1,31 @@ +import { + verifyReviewer, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyReviewer(ctx, (out) => { + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer must include at least one comment about the missing context.", + }; + } + + const acknowledgesMissing = out.comments.some( + (c) => + c.message.toLowerCase().includes("not exist") || + c.message.toLowerCase().includes("missing") || + c.message.toLowerCase().includes("clarification") + ); + if (!acknowledgesMissing) { + return { + ok: false, + reason: "Reviewer must acknowledge the missing context.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/architect/expected.json b/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/architect/expected.json new file mode 100644 index 0000000..5fb25bb --- /dev/null +++ b/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/architect/expected.json @@ -0,0 +1,20 @@ +{ + "highLevelSummary": "Define a sequential data processing pipeline with four stages (reader, parser, transformer, writer) where each stage depends on the previous one in a strict linear chain with no circular dependencies.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [ + { + "name": "PipelineStage", + "fields": ["input", "output", "process"], + "primaryKey": null, + "indexes": null, + "relations": null + } + ], + "recommendedFileStructure": [ + "src/pipeline/reader.ts", + "src/pipeline/parser.ts", + "src/pipeline/transformer.ts", + "src/pipeline/writer.ts" + ] +} diff --git a/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/architect/prompt.md b/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/architect/prompt.md new file mode 100644 index 0000000..e7b9302 --- /dev/null +++ b/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/architect/prompt.md @@ -0,0 +1,17 @@ +You are designing a spec for a data processing pipeline with sequential dependencies. + +The pipeline consists of four stages that must execute in order: +1. `src/pipeline/reader.ts` - Reads raw data from input +2. `src/pipeline/parser.ts` - Parses the raw data into structured format +3. `src/pipeline/transformer.ts` - Transforms the parsed data +4. `src/pipeline/writer.ts` - Writes the final output + +Requirements: +- Each stage depends on the output of the previous stage +- The chain must be strictly linear: reader -> parser -> transformer -> writer +- No circular dependencies are allowed + +Non-goals: +- Do not add parallel processing +- Do not modify any configuration files +- Do not add new pipeline stages diff --git a/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/architect/verify.ts b/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/architect/verify.ts new file mode 100644 index 0000000..d4a6b9c --- /dev/null +++ b/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/architect/verify.ts @@ -0,0 +1,35 @@ +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("pipeline") && !summary.includes("sequential")) { + return { + ok: false, + reason: "highLevelSummary must mention pipeline or sequential processing", + }; + } + + if (!summary.includes("chain") && !summary.includes("depends")) { + return { + ok: false, + reason: "highLevelSummary must mention dependency chain", + }; + } + + const files = spec.recommendedFileStructure; + if (files.length < 4) { + return { + ok: false, + reason: "recommendedFileStructure must include at least 4 pipeline stages", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/coder/expected.patch b/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/coder/expected.patch new file mode 100644 index 0000000..952b22b --- /dev/null +++ b/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/coder/expected.patch @@ -0,0 +1,49 @@ +diff --git a/src/pipeline/reader.ts b/src/pipeline/reader.ts +index 0000000..0000001 100644 +--- a/src/pipeline/reader.ts ++++ b/src/pipeline/reader.ts +@@ -1,3 +1,5 @@ +-export function read(): string { +- return ""; ++export function read(source: string): string { ++ if (!source) { ++ throw new Error("Source is required"); ++ } ++ return source; + } +diff --git a/src/pipeline/parser.ts b/src/pipeline/parser.ts +index 0000000..0000001 100644 +--- a/src/pipeline/parser.ts ++++ b/src/pipeline/parser.ts +@@ -1,3 +1,5 @@ +-export function parse(raw: string): object { +- return {}; ++export function parse(raw: string): Record { ++ if (!raw) { ++ throw new Error("Raw data is required"); ++ } ++ return JSON.parse(raw); + } +diff --git a/src/pipeline/transformer.ts b/src/pipeline/transformer.ts +index 0000000..0000001 100644 +--- a/src/pipeline/transformer.ts ++++ b/src/pipeline/transformer.ts +@@ -1,3 +1,5 @@ +-export function transform(data: object): object { +- return data; ++export function transform(data: Record): Record { ++ return { ++ ...data, ++ transformed: true, ++ }; + } +diff --git a/src/pipeline/writer.ts b/src/pipeline/writer.ts +index 0000000..0000001 100644 +--- a/src/pipeline/writer.ts ++++ b/src/pipeline/writer.ts +@@ -1,3 +1,3 @@ +-export function write(data: object): void { +- // no-op ++export function write(data: Record): string { ++ return JSON.stringify(data, null, 2); + } diff --git a/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/coder/prompt.md b/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/coder/prompt.md new file mode 100644 index 0000000..ddbdde3 --- /dev/null +++ b/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/coder/prompt.md @@ -0,0 +1,12 @@ +You are the coder agent. Apply the architect and planner guidance to implement +changes across the four pipeline stages in order. + +Requirements: +- Update each stage file in dependency order +- reader.ts must be updated first (no dependencies) +- parser.ts depends on reader.ts changes +- transformer.ts depends on parser.ts changes +- writer.ts depends on transformer.ts changes +- Keep changes minimal and focused on each stage's responsibility + +Return a unified diff patch that updates all four pipeline files in order. diff --git a/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/coder/verify.ts b/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/coder/verify.ts new file mode 100644 index 0000000..c5344f9 --- /dev/null +++ b/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/coder/verify.ts @@ -0,0 +1,35 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + const requiredFiles = [ + "src/pipeline/reader.ts", + "src/pipeline/parser.ts", + "src/pipeline/transformer.ts", + "src/pipeline/writer.ts", + ]; + + for (const file of requiredFiles) { + if (!patch.includes(file)) { + return { + ok: false, + reason: `Patch must include changes to ${file}.`, + }; + } + } + + const headerCount = (patch.match(/^diff --git /gm) || []).length; + if (headerCount < 4) { + return { + ok: false, + reason: "Patch must contain at least 4 diff headers for the pipeline chain.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/planner/expected.json b/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/planner/expected.json new file mode 100644 index 0000000..bb3529d --- /dev/null +++ b/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/planner/expected.json @@ -0,0 +1,38 @@ +{ + "tasks": [ + { + "id": "update-reader", + "description": "Update the reader stage to read raw data from input source", + "file": "src/pipeline/reader.ts", + "type": "fix", + "complexity": "low", + "dependsOn": [] + }, + { + "id": "update-parser", + "description": "Update the parser stage to parse raw data into structured format", + "file": "src/pipeline/parser.ts", + "type": "fix", + "complexity": "low", + "dependsOn": ["update-reader"] + }, + { + "id": "update-transformer", + "description": "Update the transformer stage to transform parsed data", + "file": "src/pipeline/transformer.ts", + "type": "fix", + "complexity": "low", + "dependsOn": ["update-parser"] + }, + { + "id": "update-writer", + "description": "Update the writer stage to write final output", + "file": "src/pipeline/writer.ts", + "type": "fix", + "complexity": "low", + "dependsOn": ["update-transformer"] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/planner/prompt.md b/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/planner/prompt.md new file mode 100644 index 0000000..1e20785 --- /dev/null +++ b/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/planner/prompt.md @@ -0,0 +1,13 @@ +Using the architect's spec for a sequential data processing pipeline, produce a task list +that implements changes across the four pipeline stages in the correct dependency order. + +The pipeline stages are: +1. reader.ts - Reads raw data +2. parser.ts - Parses data (depends on reader) +3. transformer.ts - Transforms data (depends on parser) +4. writer.ts - Writes output (depends on transformer) + +Requirements: +- Build a linear dependsOn chain with no cycles +- Each task must depend on the previous task in the chain +- Use correct ordering: reader -> parser -> transformer -> writer diff --git a/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/planner/verify.ts b/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/planner/verify.ts new file mode 100644 index 0000000..0afcc99 --- /dev/null +++ b/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/planner/verify.ts @@ -0,0 +1,51 @@ +import { + verifyPlanner, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyPlanner(ctx, (out) => { + if (out.tasks.length < 4) { + return { + ok: false, + reason: "Planner must emit at least 4 tasks for the pipeline chain.", + }; + } + + const taskIds = out.tasks.map((t) => t.id); + for (let i = 1; i < out.tasks.length; i++) { + const task = out.tasks[i]; + if (task.dependsOn.length === 0) { + return { + ok: false, + reason: `Task ${task.id} must depend on a previous task in the chain.`, + }; + } + const depId = task.dependsOn[0]; + if (!taskIds.includes(depId)) { + return { + ok: false, + reason: `Task ${task.id} depends on unknown task ${depId}.`, + }; + } + } + + const firstTask = out.tasks[0]; + if (firstTask.dependsOn.length !== 0) { + return { + ok: false, + reason: "First task in chain must have no dependencies.", + }; + } + + if (out.ambiguities.length !== 0) { + return { + ok: false, + reason: "ambiguities must be empty for a clear pipeline chain.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/reviewer/expected.json b/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/reviewer/expected.json new file mode 100644 index 0000000..f76e4cc --- /dev/null +++ b/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Pipeline chain correctly implements sequential dependencies from reader through writer with no circular dependencies.", + "path": "src/pipeline/reader.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/reviewer/prompt.md b/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/reviewer/prompt.md new file mode 100644 index 0000000..c8236c9 --- /dev/null +++ b/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/reviewer/prompt.md @@ -0,0 +1,17 @@ +You are the reviewer agent. + +Review a patch that updates four pipeline stages in a sequential dependency chain: +1. reader.ts - Updated to read raw data +2. parser.ts - Updated to parse data (depends on reader) +3. transformer.ts - Updated to transform data (depends on parser) +4. writer.ts - Updated to write output (depends on transformer) + +Your responsibilities: +- Validate that each step logically depends on the previous edits +- Ensure the dependency chain is maintained correctly +- Check that no circular dependencies are introduced +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/reviewer/verify.ts b/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/reviewer/verify.ts new file mode 100644 index 0000000..e8b4bd0 --- /dev/null +++ b/fixtures/chains-and-small-dags/task-201-deep-acyclic-chain/reviewer/verify.ts @@ -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: "Reviewer should approve a correctly implemented pipeline chain.", + }; + } + + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer should include at least one comment about the chain structure.", + }; + } + + const blocking = out.comments.filter((c) => c.blocking); + if (blocking.length > 0) { + return { + ok: false, + reason: "All comments should be non-blocking for a correct pipeline implementation.", + }; + } + + const mentionsChain = out.comments.some( + (c) => + c.message.toLowerCase().includes("chain") || + c.message.toLowerCase().includes("pipeline") || + c.message.toLowerCase().includes("sequential") || + c.message.toLowerCase().includes("dependencies") + ); + if (!mentionsChain) { + return { + ok: false, + reason: "At least one comment should reference the pipeline chain or dependencies.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/architect/expected.json b/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/architect/expected.json new file mode 100644 index 0000000..13cd63b --- /dev/null +++ b/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/architect/expected.json @@ -0,0 +1,26 @@ +{ + "highLevelSummary": "Resolve apparent circular dependency between auth and user modules by introducing a shared interface or dependency injection pattern to break the cycle while maintaining both modules' functionality.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [ + { + "name": "AuthContext", + "fields": ["userId", "permissions", "token"], + "primaryKey": null, + "indexes": null, + "relations": null + }, + { + "name": "UserContext", + "fields": ["id", "name", "role"], + "primaryKey": null, + "indexes": null, + "relations": null + } + ], + "recommendedFileStructure": [ + "src/modules/auth.ts", + "src/modules/user.ts", + "src/modules/types.ts" + ] +} diff --git a/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/architect/prompt.md b/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/architect/prompt.md new file mode 100644 index 0000000..290cd7d --- /dev/null +++ b/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/architect/prompt.md @@ -0,0 +1,18 @@ +You are designing a spec for a module system where two modules appear to have circular dependencies. + +Scenario: +- `src/modules/auth.ts` provides authentication utilities +- `src/modules/user.ts` provides user management utilities +- Auth needs user data for validation +- User needs auth for permission checks + +This could be misinterpreted as A depends on B and B depends on A (circular). + +Requirements: +- Identify the apparent circular dependency +- Propose a solution that breaks the cycle (e.g., shared interface, dependency injection) +- The system must remain acyclic + +Non-goals: +- Do not merge the modules into one file +- Do not remove either module's functionality diff --git a/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/architect/verify.ts b/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/architect/verify.ts new file mode 100644 index 0000000..3b58547 --- /dev/null +++ b/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/architect/verify.ts @@ -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("circular") && !summary.includes("cycle")) { + return { + ok: false, + reason: "highLevelSummary must mention circular dependency or cycle", + }; + } + + if (!summary.includes("break") && !summary.includes("resolve")) { + return { + ok: false, + reason: "highLevelSummary must mention breaking or resolving the cycle", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/coder/expected.patch b/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/coder/expected.patch new file mode 100644 index 0000000..3c0935a --- /dev/null +++ b/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/coder/expected.patch @@ -0,0 +1,41 @@ +diff --git a/src/modules/types.ts b/src/modules/types.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/modules/types.ts +@@ -0,0 +1,11 @@ ++export interface AuthContext { ++ userId: string; ++ permissions: string[]; ++ token: string; ++} ++ ++export interface UserContext { ++ id: string; ++ name: string; ++ role: string; ++} +diff --git a/src/modules/auth.ts b/src/modules/auth.ts +index 0000000..0000001 100644 +--- a/src/modules/auth.ts ++++ b/src/modules/auth.ts +@@ -1,5 +1,5 @@ +-import { User } from "./user"; ++import { UserContext } from "./types"; + +-export function validateUser(user: User): boolean { ++export function validateUser(user: UserContext): boolean { + return user.id !== undefined && user.role !== undefined; + } +diff --git a/src/modules/user.ts b/src/modules/user.ts +index 0000000..0000001 100644 +--- a/src/modules/user.ts ++++ b/src/modules/user.ts +@@ -1,5 +1,5 @@ +-import { Auth } from "./auth"; ++import { AuthContext } from "./types"; + +-export function checkPermission(auth: Auth, permission: string): boolean { ++export function checkPermission(auth: AuthContext, permission: string): boolean { + return auth.permissions.includes(permission); + } diff --git a/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/coder/prompt.md b/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/coder/prompt.md new file mode 100644 index 0000000..92d3871 --- /dev/null +++ b/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/coder/prompt.md @@ -0,0 +1,10 @@ +You are the coder agent. Apply the architect and planner guidance to break the +circular dependency between auth and user modules. + +Requirements: +- Create a shared types module to hold common interfaces +- Update auth.ts to import from shared types instead of user.ts +- Update user.ts to import from shared types instead of auth.ts +- Do not introduce new circular dependencies + +Return a unified diff patch that resolves the circular dependency. diff --git a/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/coder/verify.ts b/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/coder/verify.ts new file mode 100644 index 0000000..117ca1a --- /dev/null +++ b/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/coder/verify.ts @@ -0,0 +1,32 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("types.ts") && !patch.includes("shared")) { + return { + ok: false, + reason: "Patch must introduce a shared types module to break the cycle.", + }; + } + + if (!patch.includes("auth.ts")) { + return { + ok: false, + reason: "Patch must update auth.ts to use shared types.", + }; + } + + if (!patch.includes("user.ts")) { + return { + ok: false, + reason: "Patch must update user.ts to use shared types.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/planner/expected.json b/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/planner/expected.json new file mode 100644 index 0000000..94ad3c0 --- /dev/null +++ b/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/planner/expected.json @@ -0,0 +1,30 @@ +{ + "tasks": [ + { + "id": "create-shared-types", + "description": "Create shared types module to break circular dependency between auth and user", + "file": "src/modules/types.ts", + "type": "refactor", + "complexity": "low", + "dependsOn": [] + }, + { + "id": "update-auth-module", + "description": "Update auth module to use shared types instead of importing from user", + "file": "src/modules/auth.ts", + "type": "refactor", + "complexity": "medium", + "dependsOn": ["create-shared-types"] + }, + { + "id": "update-user-module", + "description": "Update user module to use shared types instead of importing from auth", + "file": "src/modules/user.ts", + "type": "refactor", + "complexity": "medium", + "dependsOn": ["create-shared-types"] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/planner/prompt.md b/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/planner/prompt.md new file mode 100644 index 0000000..f5f31da --- /dev/null +++ b/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/planner/prompt.md @@ -0,0 +1,11 @@ +Using the architect's spec for resolving circular dependencies between auth and user modules, +produce a task list that breaks the cycle without creating an illegal dependency graph. + +The apparent circular dependency: +- auth.ts needs user data +- user.ts needs auth checks + +Requirements: +- Must avoid emitting a cycle in dependsOn +- Either break the cycle with 'unknown' tasks or introduce a shared types module +- The final task graph must be acyclic diff --git a/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/planner/verify.ts b/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/planner/verify.ts new file mode 100644 index 0000000..3fbe07c --- /dev/null +++ b/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/planner/verify.ts @@ -0,0 +1,67 @@ +import { + verifyPlanner, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyPlanner(ctx, (out) => { + if (out.tasks.length < 2) { + return { + ok: false, + reason: "Planner must emit at least 2 tasks to break the circular dependency.", + }; + } + + const taskIds = new Set(out.tasks.map((t) => t.id)); + for (const task of out.tasks) { + for (const dep of task.dependsOn) { + if (dep === task.id) { + return { + ok: false, + reason: `Task ${task.id} cannot depend on itself.`, + }; + } + if (!taskIds.has(dep)) { + return { + ok: false, + reason: `Task ${task.id} depends on unknown task ${dep}.`, + }; + } + } + } + + const visited = new Set(); + const recursionStack = new Set(); + const taskMap = new Map(out.tasks.map((t) => [t.id, t])); + + function hasCycle(taskId: string): boolean { + if (recursionStack.has(taskId)) return true; + if (visited.has(taskId)) return false; + + visited.add(taskId); + recursionStack.add(taskId); + + const task = taskMap.get(taskId); + if (task) { + for (const dep of task.dependsOn) { + if (hasCycle(dep)) return true; + } + } + + recursionStack.delete(taskId); + return false; + } + + for (const task of out.tasks) { + if (hasCycle(task.id)) { + return { + ok: false, + reason: "Task graph contains a cycle, which is not allowed.", + }; + } + } + + return { ok: true }; + }); +} diff --git a/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/reviewer/expected.json b/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/reviewer/expected.json new file mode 100644 index 0000000..adb64dc --- /dev/null +++ b/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Shared types module correctly breaks the circular dependency between auth and user modules.", + "path": "src/modules/types.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/reviewer/prompt.md b/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/reviewer/prompt.md new file mode 100644 index 0000000..a13954f --- /dev/null +++ b/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/reviewer/prompt.md @@ -0,0 +1,14 @@ +You are the reviewer agent. + +Review a patch that resolves a circular dependency between auth and user modules +by introducing a shared types module. + +Your responsibilities: +- Flag any introduced or unresolved cycles as issues +- Verify the shared types module correctly breaks the dependency +- Ensure no new circular dependencies are created +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/reviewer/verify.ts b/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/reviewer/verify.ts new file mode 100644 index 0000000..872610f --- /dev/null +++ b/fixtures/chains-and-small-dags/task-203-circular-dependency-trap/reviewer/verify.ts @@ -0,0 +1,46 @@ +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: "Reviewer should approve a correctly resolved circular dependency.", + }; + } + + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer should include at least one comment about the cycle resolution.", + }; + } + + const blocking = out.comments.filter((c) => c.blocking); + if (blocking.length > 0) { + return { + ok: false, + reason: "All comments should be non-blocking for a correct cycle resolution.", + }; + } + + const mentionsCycle = out.comments.some( + (c) => + c.message.toLowerCase().includes("circular") || + c.message.toLowerCase().includes("cycle") || + c.message.toLowerCase().includes("dependency") + ); + if (!mentionsCycle) { + return { + ok: false, + reason: "At least one comment should reference the circular dependency resolution.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/architect/expected.json b/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/architect/expected.json new file mode 100644 index 0000000..b236728 --- /dev/null +++ b/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/architect/expected.json @@ -0,0 +1,19 @@ +{ + "highLevelSummary": "Refactor legacy codebase with explicit constraints: maximum 3 tasks, no high-complexity work, prioritizing critical database and API layers over lower priority configuration and logging.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [ + { + "name": "LegacyModule", + "fields": ["name", "priority", "complexity"], + "primaryKey": null, + "indexes": null, + "relations": null + } + ], + "recommendedFileStructure": [ + "src/legacy/database.ts", + "src/legacy/api.ts", + "src/legacy/utils.ts" + ] +} diff --git a/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/architect/prompt.md b/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/architect/prompt.md new file mode 100644 index 0000000..5b4ec93 --- /dev/null +++ b/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/architect/prompt.md @@ -0,0 +1,22 @@ +You are designing a spec for a large refactoring project with explicit constraints. + +The project involves updating a legacy codebase with many files, but the scope is constrained: +- Maximum 3 tasks allowed (maxTasks: 3) +- Maximum complexity: medium (no high-complexity tasks) +- Focus on the most critical files only + +Files that could be updated: +- `src/legacy/database.ts` - Critical database layer +- `src/legacy/api.ts` - Critical API layer +- `src/legacy/utils.ts` - Utility functions +- `src/legacy/config.ts` - Configuration (lower priority) +- `src/legacy/logging.ts` - Logging (lower priority) + +Requirements: +- Respect the maxTasks constraint of 3 +- Do not emit high-complexity tasks +- Prioritize critical files over lower priority ones + +Non-goals: +- Do not plan more than 3 tasks +- Do not include high-complexity work diff --git a/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/architect/verify.ts b/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/architect/verify.ts new file mode 100644 index 0000000..9173da6 --- /dev/null +++ b/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/architect/verify.ts @@ -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("constraint") && !summary.includes("maximum") && !summary.includes("limit")) { + return { + ok: false, + reason: "highLevelSummary must mention constraints or limits", + }; + } + + if (!summary.includes("3") && !summary.includes("three")) { + return { + ok: false, + reason: "highLevelSummary must mention the maxTasks constraint of 3", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/coder/expected.patch b/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/coder/expected.patch new file mode 100644 index 0000000..3e8124e --- /dev/null +++ b/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/coder/expected.patch @@ -0,0 +1,41 @@ +diff --git a/src/legacy/database.ts b/src/legacy/database.ts +index 0000000..0000001 100644 +--- a/src/legacy/database.ts ++++ b/src/legacy/database.ts +@@ -1,5 +1,8 @@ +-export function query(sql: string): any { +- // legacy implementation +- return null; ++export interface QueryResult { ++ data: T[]; ++ count: number; ++} ++ ++export function query(sql: string): QueryResult { ++ return { data: [], count: 0 }; + } +diff --git a/src/legacy/api.ts b/src/legacy/api.ts +index 0000000..0000001 100644 +--- a/src/legacy/api.ts ++++ b/src/legacy/api.ts +@@ -1,5 +1,7 @@ +-import { query } from "./database"; ++import { query, QueryResult } from "./database"; + +-export function fetchData(): any { +- return query("SELECT * FROM data"); ++export function fetchData(): QueryResult { ++ return query("SELECT * FROM data"); + } +diff --git a/src/legacy/utils.ts b/src/legacy/utils.ts +index 0000000..0000001 100644 +--- a/src/legacy/utils.ts ++++ b/src/legacy/utils.ts +@@ -1,3 +1,5 @@ +-export function formatData(data: any): string { +- return JSON.stringify(data); ++import { QueryResult } from "./database"; ++ ++export function formatData(result: QueryResult): string { ++ return JSON.stringify(result.data); + } diff --git a/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/coder/prompt.md b/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/coder/prompt.md new file mode 100644 index 0000000..44cf0f0 --- /dev/null +++ b/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/coder/prompt.md @@ -0,0 +1,10 @@ +You are the coder agent. Apply the architect and planner guidance to implement +the constrained refactoring of the legacy codebase. + +Requirements: +- Implement only the constrained subset of tasks (max 3) +- Do not expand scope beyond what the planner outputs +- Focus on database.ts, api.ts, and utils.ts only +- Do not touch config.ts or logging.ts (out of scope due to constraints) + +Return a unified diff patch that implements the constrained refactoring. diff --git a/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/coder/verify.ts b/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/coder/verify.ts new file mode 100644 index 0000000..6f6faea --- /dev/null +++ b/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/coder/verify.ts @@ -0,0 +1,45 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + const allowedFiles = ["database.ts", "api.ts", "utils.ts"]; + const forbiddenFiles = ["config.ts", "logging.ts"]; + + for (const file of forbiddenFiles) { + if (patch.includes(file)) { + return { + ok: false, + reason: `Patch must not touch ${file} due to scope constraints.`, + }; + } + } + + let touchedCount = 0; + for (const file of allowedFiles) { + if (patch.includes(file)) { + touchedCount++; + } + } + + if (touchedCount === 0) { + return { + ok: false, + reason: "Patch must touch at least one of the allowed files.", + }; + } + + const headerCount = (patch.match(/^diff --git /gm) || []).length; + if (headerCount > 3) { + return { + ok: false, + reason: "Patch must not exceed 3 file changes due to maxTasks constraint.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/planner/expected.json b/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/planner/expected.json new file mode 100644 index 0000000..c009483 --- /dev/null +++ b/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/planner/expected.json @@ -0,0 +1,30 @@ +{ + "tasks": [ + { + "id": "refactor-database", + "description": "Refactor the legacy database layer to improve maintainability", + "file": "src/legacy/database.ts", + "type": "refactor", + "complexity": "medium", + "dependsOn": [] + }, + { + "id": "refactor-api", + "description": "Refactor the legacy API layer to align with updated database", + "file": "src/legacy/api.ts", + "type": "refactor", + "complexity": "medium", + "dependsOn": ["refactor-database"] + }, + { + "id": "update-utils", + "description": "Update utility functions to support refactored modules", + "file": "src/legacy/utils.ts", + "type": "refactor", + "complexity": "low", + "dependsOn": ["refactor-api"] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/planner/prompt.md b/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/planner/prompt.md new file mode 100644 index 0000000..bf0230e --- /dev/null +++ b/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/planner/prompt.md @@ -0,0 +1,12 @@ +Using the architect's spec for a constrained legacy refactoring project, produce a task list +that respects the explicit constraints. + +Constraints: +- maxTasks: 3 (do not emit more than 3 tasks) +- Maximum complexity: medium (no high-complexity tasks allowed) +- Prioritize critical files: database.ts, api.ts over config.ts, logging.ts + +Requirements: +- Produce a trimmed task list that respects maxTasks +- Avoid emitting tasks beyond the allowed complexity cap +- Deliberately leave some clearly-remaining work unplanned when it exceeds the cap diff --git a/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/planner/verify.ts b/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/planner/verify.ts new file mode 100644 index 0000000..6261bdd --- /dev/null +++ b/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/planner/verify.ts @@ -0,0 +1,33 @@ +import { + verifyPlanner, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyPlanner(ctx, (out) => { + if (out.tasks.length > 3) { + return { + ok: false, + reason: "Planner must respect maxTasks constraint of 3.", + }; + } + + const highComplexity = out.tasks.filter((t) => t.complexity === "high"); + if (highComplexity.length > 0) { + return { + ok: false, + reason: "Planner must not emit high-complexity tasks due to complexity cap.", + }; + } + + if (out.tasks.length === 0) { + return { + ok: false, + reason: "Planner must emit at least one task.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/reviewer/expected.json b/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/reviewer/expected.json new file mode 100644 index 0000000..3182b4e --- /dev/null +++ b/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Patch correctly respects the maxTasks constraint of 3 and only touches the prioritized critical files.", + "path": "src/legacy/database.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/reviewer/prompt.md b/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/reviewer/prompt.md new file mode 100644 index 0000000..69c23c3 --- /dev/null +++ b/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/reviewer/prompt.md @@ -0,0 +1,18 @@ +You are the reviewer agent. + +Review a patch that implements a constrained refactoring of a legacy codebase. + +Constraints that were applied: +- maxTasks: 3 (only 3 files should be changed) +- Maximum complexity: medium (no high-complexity changes) +- Only critical files were touched (database.ts, api.ts, utils.ts) + +Your responsibilities: +- Flag any code changes that exceed the architect's or planner's explicit caps +- Verify the patch respects the maxTasks constraint +- Ensure no out-of-scope files were modified +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/reviewer/verify.ts b/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/reviewer/verify.ts new file mode 100644 index 0000000..e209611 --- /dev/null +++ b/fixtures/chains-and-small-dags/task-204-max-tasks-and-complexity-caps/reviewer/verify.ts @@ -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: "Reviewer should approve a patch that respects constraints.", + }; + } + + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer should include at least one comment about constraint compliance.", + }; + } + + const blocking = out.comments.filter((c) => c.blocking); + if (blocking.length > 0) { + return { + ok: false, + reason: "All comments should be non-blocking for a constraint-compliant patch.", + }; + } + + const mentionsConstraint = out.comments.some( + (c) => + c.message.toLowerCase().includes("constraint") || + c.message.toLowerCase().includes("maxtasks") || + c.message.toLowerCase().includes("limit") || + c.message.toLowerCase().includes("cap") + ); + if (!mentionsConstraint) { + return { + ok: false, + reason: "At least one comment should reference the constraints or limits.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/architect/expected.json b/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/architect/expected.json new file mode 100644 index 0000000..80aa84b --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/architect/expected.json @@ -0,0 +1,19 @@ +{ + "highLevelSummary": "Add a string formatting utility with proper decomposition: utility function in src/utils/format.ts, integration in src/main.ts, and comprehensive tests in test/format.test.ts.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [ + { + "name": "FormatOptions", + "fields": ["prefix", "suffix", "uppercase"], + "primaryKey": null, + "indexes": null, + "relations": null + } + ], + "recommendedFileStructure": [ + "src/utils/format.ts", + "src/main.ts", + "test/format.test.ts" + ] +} diff --git a/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/architect/prompt.md b/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/architect/prompt.md new file mode 100644 index 0000000..a81ab8c --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for a change that naturally splits into utility, main code, and tests. + +The change involves adding a string formatting utility: +- `src/utils/format.ts` - New utility function for string formatting +- `src/main.ts` - Main code that uses the utility +- `test/format.test.ts` - Tests for the utility + +Requirements: +- Define the utility function signature and behavior +- Specify how main code should use the utility +- Require tests for the new functionality + +Non-goals: +- Do not modify existing utilities +- Do not change the project structure diff --git a/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/architect/verify.ts b/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/architect/verify.ts new file mode 100644 index 0000000..e81e590 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/architect/verify.ts @@ -0,0 +1,36 @@ +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("utility") && !summary.includes("format")) { + return { + ok: false, + reason: "highLevelSummary must mention utility or format", + }; + } + + const files = spec.recommendedFileStructure; + if (files.length < 2) { + return { + ok: false, + reason: "recommendedFileStructure must include at least 2 files for decomposition", + }; + } + + const hasTest = files.some((f) => f.includes("test")); + if (!hasTest) { + return { + ok: false, + reason: "recommendedFileStructure must include a test file", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/coder/expected.patch b/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/coder/expected.patch new file mode 100644 index 0000000..b4e1395 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/coder/expected.patch @@ -0,0 +1,51 @@ +diff --git a/src/utils/format.ts b/src/utils/format.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/utils/format.ts +@@ -0,0 +1,11 @@ ++export interface FormatOptions { ++ prefix?: string; ++ suffix?: string; ++ uppercase?: boolean; ++} ++ ++export function formatString(input: string, options: FormatOptions = {}): string { ++ let result = options.prefix ? options.prefix + input : input; ++ result = options.suffix ? result + options.suffix : result; ++ return options.uppercase ? result.toUpperCase() : result; ++} +diff --git a/src/main.ts b/src/main.ts +index 0000000..0000001 100644 +--- a/src/main.ts ++++ b/src/main.ts +@@ -1,3 +1,7 @@ +-export function main(): void { +- console.log("Hello"); ++import { formatString } from "./utils/format"; ++ ++export function main(): void { ++ const formatted = formatString("Hello", { prefix: "[", suffix: "]" }); ++ console.log(formatted); + } +diff --git a/test/format.test.ts b/test/format.test.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/test/format.test.ts +@@ -0,0 +1,15 @@ ++import { formatString } from "../src/utils/format"; ++ ++describe("formatString", () => { ++ it("should return input unchanged with no options", () => { ++ expect(formatString("test")).toBe("test"); ++ }); ++ ++ it("should add prefix and suffix", () => { ++ expect(formatString("test", { prefix: "[", suffix: "]" })).toBe("[test]"); ++ }); ++ ++ it("should uppercase when option is set", () => { ++ expect(formatString("test", { uppercase: true })).toBe("TEST"); ++ }); ++}); diff --git a/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/coder/prompt.md b/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/coder/prompt.md new file mode 100644 index 0000000..7972f84 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/coder/prompt.md @@ -0,0 +1,10 @@ +You are the coder agent. Apply the architect and planner guidance to implement +the string formatting utility with proper decomposition. + +Requirements: +- Create the utility function in src/utils/format.ts +- Update main code in src/main.ts to use the utility +- Add tests in test/format.test.ts +- Ensure all affected parts are updated consistently + +Return a unified diff patch that implements the decomposed changes. diff --git a/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/coder/verify.ts b/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/coder/verify.ts new file mode 100644 index 0000000..190cbcf --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/coder/verify.ts @@ -0,0 +1,40 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("format.ts") && !patch.includes("utils")) { + return { + ok: false, + reason: "Patch must include the utility file.", + }; + } + + if (!patch.includes("main.ts")) { + return { + ok: false, + reason: "Patch must include main code update.", + }; + } + + if (!patch.includes("test")) { + return { + ok: false, + reason: "Patch must include test file.", + }; + } + + const headerCount = (patch.match(/^diff --git /gm) || []).length; + if (headerCount < 2) { + return { + ok: false, + reason: "Patch must contain at least 2 diff headers for decomposition.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/planner/expected.json b/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/planner/expected.json new file mode 100644 index 0000000..e0b5e19 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/planner/expected.json @@ -0,0 +1,30 @@ +{ + "tasks": [ + { + "id": "create-format-utility", + "description": "Create the string formatting utility function in src/utils/format.ts", + "file": "src/utils/format.ts", + "type": "feature", + "complexity": "low", + "dependsOn": [] + }, + { + "id": "update-main-code", + "description": "Update main code to use the new formatting utility", + "file": "src/main.ts", + "type": "feature", + "complexity": "low", + "dependsOn": ["create-format-utility"] + }, + { + "id": "add-format-tests", + "description": "Add comprehensive tests for the formatting utility", + "file": "test/format.test.ts", + "type": "feature", + "complexity": "low", + "dependsOn": ["create-format-utility"] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/planner/prompt.md b/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/planner/prompt.md new file mode 100644 index 0000000..5f99162 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/planner/prompt.md @@ -0,0 +1,11 @@ +Using the architect's spec for a string formatting utility, produce a task list +that properly decomposes the work into utility, main code, and test updates. + +The decomposition should be: +1. Create the utility function in src/utils/format.ts +2. Update main code in src/main.ts to use the utility +3. Add tests in test/format.test.ts + +Requirements: +- Emit a small chain linking utility change, main code update, and test update +- Ensure proper dependency ordering diff --git a/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/planner/verify.ts b/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/planner/verify.ts new file mode 100644 index 0000000..6bffb07 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/planner/verify.ts @@ -0,0 +1,36 @@ +import { + verifyPlanner, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyPlanner(ctx, (out) => { + if (out.tasks.length < 2) { + return { + ok: false, + reason: "Planner must emit at least 2 tasks for two-file decomposition.", + }; + } + + const hasUtilTask = out.tasks.some( + (t) => t.file.includes("utils") || t.file.includes("format") + ); + if (!hasUtilTask) { + return { + ok: false, + reason: "Planner must include a task for the utility file.", + }; + } + + const hasTestTask = out.tasks.some((t) => t.file.includes("test")); + if (!hasTestTask) { + return { + ok: false, + reason: "Planner must include a task for tests.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/reviewer/expected.json b/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/reviewer/expected.json new file mode 100644 index 0000000..ec6da38 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Clean decomposition with utility, main code, and tests properly separated and consistently updated.", + "path": "src/utils/format.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/reviewer/prompt.md b/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/reviewer/prompt.md new file mode 100644 index 0000000..543d2ea --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/reviewer/prompt.md @@ -0,0 +1,16 @@ +You are the reviewer agent. + +Review a patch that implements a string formatting utility with proper decomposition: +- Utility function in src/utils/format.ts +- Main code update in src/main.ts +- Tests in test/format.test.ts + +Your responsibilities: +- Check that all affected parts are updated consistently and with correct intent +- Verify the decomposition is clean and logical +- Ensure tests cover the new functionality +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/reviewer/verify.ts b/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/reviewer/verify.ts new file mode 100644 index 0000000..e730c8f --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-300-basic-two-file-decomp/reviewer/verify.ts @@ -0,0 +1,33 @@ +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: "Reviewer should approve a clean decomposition.", + }; + } + + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer should include at least one comment about the decomposition.", + }; + } + + const blocking = out.comments.filter((c) => c.blocking); + if (blocking.length > 0) { + return { + ok: false, + reason: "All comments should be non-blocking for a clean decomposition.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/architect/expected.json b/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/architect/expected.json new file mode 100644 index 0000000..661df15 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/architect/expected.json @@ -0,0 +1,10 @@ +{ + "highLevelSummary": "Update utility function to improve error handling, targeting only safe locations in src/ and explicitly avoiding forbidden paths like dist/, node_modules/, .swarm/, build/, and .git/.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/utils/helper.ts", + "src/services/api.ts" + ] +} diff --git a/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/architect/prompt.md b/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/architect/prompt.md new file mode 100644 index 0000000..e5fccef --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/architect/prompt.md @@ -0,0 +1,14 @@ +You are designing a spec for a change that mentions both safe and forbidden locations. + +The change involves updating a utility function, but the description mentions: +- Safe locations: `src/utils/helper.ts`, `src/services/api.ts` +- Forbidden locations: `dist/`, `node_modules/`, `.swarm/`, `build/`, `.git/` + +Requirements: +- Only modify files in safe locations (src/) +- Never touch forbidden paths +- The utility should be updated to improve error handling + +Non-goals: +- Do not modify any files in dist/, node_modules/, .swarm/, build/, or .git/ +- Do not create new files in forbidden locations diff --git a/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/architect/verify.ts b/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/architect/verify.ts new file mode 100644 index 0000000..ee80b59 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/architect/verify.ts @@ -0,0 +1,34 @@ +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("forbidden") && !summary.includes("safe")) { + return { + ok: false, + reason: "highLevelSummary must mention forbidden or safe paths", + }; + } + + const files = spec.recommendedFileStructure; + const forbiddenPaths = ["dist/", "node_modules/", ".swarm/", "build/", ".git/"]; + + for (const file of files) { + for (const forbidden of forbiddenPaths) { + if (file.includes(forbidden.replace("/", ""))) { + return { + ok: false, + reason: `recommendedFileStructure must not include forbidden path: ${forbidden}`, + }; + } + } + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/coder/expected.patch b/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/coder/expected.patch new file mode 100644 index 0000000..ea5d03b --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/coder/expected.patch @@ -0,0 +1,40 @@ +diff --git a/src/utils/helper.ts b/src/utils/helper.ts +index 0000000..0000001 100644 +--- a/src/utils/helper.ts ++++ b/src/utils/helper.ts +@@ -1,3 +1,7 @@ +-export function helper(input: string): string { +- return input; ++export class HelperError extends Error { ++ constructor(message: string) { ++ super(message); ++ this.name = "HelperError"; ++ } ++} ++ ++export function helper(input: string): string { ++ if (!input) { ++ throw new HelperError("Input is required"); ++ } ++ return input; + } +diff --git a/src/services/api.ts b/src/services/api.ts +index 0000000..0000001 100644 +--- a/src/services/api.ts ++++ b/src/services/api.ts +@@ -1,5 +1,9 @@ +-import { helper } from "../utils/helper"; ++import { helper, HelperError } from "../utils/helper"; + +-export function apiCall(data: string): string { +- return helper(data); ++export function apiCall(data: string): string { ++ try { ++ return helper(data); ++ } catch (error) { ++ if (error instanceof HelperError) { ++ throw new Error(`API Error: ${error.message}`); ++ } ++ throw error; ++ } + } diff --git a/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/coder/prompt.md b/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/coder/prompt.md new file mode 100644 index 0000000..f7ecde7 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/coder/prompt.md @@ -0,0 +1,9 @@ +You are the coder agent. Apply the architect and planner guidance to update +the utility with improved error handling. + +Requirements: +- Only modify files in src/ directory +- Never edit dist/, node_modules/, .swarm/, build/, or .git/ +- Update helper.ts and api.ts with improved error handling + +Return a unified diff patch that only touches allowed files. diff --git a/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/coder/verify.ts b/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/coder/verify.ts new file mode 100644 index 0000000..501b99e --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/coder/verify.ts @@ -0,0 +1,29 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + const forbiddenPaths = ["dist/", "node_modules/", ".swarm/", "build/", ".git/"]; + + for (const forbidden of forbiddenPaths) { + if (patch.includes(forbidden)) { + return { + ok: false, + reason: `Patch must not touch forbidden path: ${forbidden}`, + }; + } + } + + if (!patch.includes("src/")) { + return { + ok: false, + reason: "Patch must only modify files in src/ directory.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/planner/expected.json b/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/planner/expected.json new file mode 100644 index 0000000..d03c8e1 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/planner/expected.json @@ -0,0 +1,22 @@ +{ + "tasks": [ + { + "id": "update-helper-error-handling", + "description": "Update helper utility to improve error handling", + "file": "src/utils/helper.ts", + "type": "fix", + "complexity": "low", + "dependsOn": [] + }, + { + "id": "update-api-error-handling", + "description": "Update API service to use improved error handling", + "file": "src/services/api.ts", + "type": "fix", + "complexity": "low", + "dependsOn": ["update-helper-error-handling"] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/planner/prompt.md b/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/planner/prompt.md new file mode 100644 index 0000000..da0eaf1 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/planner/prompt.md @@ -0,0 +1,9 @@ +Using the architect's spec for updating a utility with forbidden path constraints, +produce a task list that only targets allowed locations. + +Safe locations: src/ +Forbidden locations: dist/, node_modules/, .swarm/, build/, .git/ + +Requirements: +- Only produce tasks pointing at allowed roots such as src/ +- Never include tasks that target forbidden paths diff --git a/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/planner/verify.ts b/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/planner/verify.ts new file mode 100644 index 0000000..f51addd --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/planner/verify.ts @@ -0,0 +1,38 @@ +import { + verifyPlanner, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyPlanner(ctx, (out) => { + const forbiddenPaths = ["dist/", "node_modules/", ".swarm/", "build/", ".git/"]; + + for (const task of out.tasks) { + for (const forbidden of forbiddenPaths) { + if (task.file.includes(forbidden.replace("/", ""))) { + return { + ok: false, + reason: `Task ${task.id} targets forbidden path: ${task.file}`, + }; + } + } + + if (!task.file.startsWith("src/")) { + return { + ok: false, + reason: `Task ${task.id} must target src/ directory, got: ${task.file}`, + }; + } + } + + if (out.tasks.length === 0) { + return { + ok: false, + reason: "Planner must emit at least one task.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/reviewer/expected.json b/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/reviewer/expected.json new file mode 100644 index 0000000..afdca3f --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Patch correctly targets only src/ files and avoids all forbidden paths.", + "path": "src/utils/helper.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/reviewer/prompt.md b/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/reviewer/prompt.md new file mode 100644 index 0000000..9cf3b3f --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/reviewer/prompt.md @@ -0,0 +1,19 @@ +You are the reviewer agent. + +Review a patch that updates utility functions with improved error handling. + +Forbidden paths that must NOT be touched: +- dist/ +- node_modules/ +- .swarm/ +- build/ +- .git/ + +Your responsibilities: +- Reject any change that touches forbidden paths +- Verify only src/ files are modified +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/reviewer/verify.ts b/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/reviewer/verify.ts new file mode 100644 index 0000000..c265c72 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-301-forbidden-paths-filter/reviewer/verify.ts @@ -0,0 +1,33 @@ +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: "Reviewer should approve a patch that respects forbidden paths.", + }; + } + + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer should include at least one comment about path compliance.", + }; + } + + const blocking = out.comments.filter((c) => c.blocking); + if (blocking.length > 0) { + return { + ok: false, + reason: "All comments should be non-blocking for a compliant patch.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/architect/expected.json b/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/architect/expected.json new file mode 100644 index 0000000..d135068 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/architect/expected.json @@ -0,0 +1,19 @@ +{ + "highLevelSummary": "Mixed task portfolio with a low-complexity bug fix in validators, medium-complexity refactor in services, and medium-complexity feature for caching, demonstrating varied task types and complexity levels.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [ + { + "name": "CacheEntry", + "fields": ["key", "value", "ttl"], + "primaryKey": null, + "indexes": null, + "relations": null + } + ], + "recommendedFileStructure": [ + "src/validators/input.ts", + "src/services/data.ts", + "src/cache/memory.ts" + ] +} diff --git a/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/architect/prompt.md b/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/architect/prompt.md new file mode 100644 index 0000000..0540e1e --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for a scenario that includes bug fixes, refactors, and a small feature. + +The work involves: +- Bug fix: Fix a validation error in `src/validators/input.ts` (low complexity) +- Refactor: Clean up the service layer in `src/services/data.ts` (medium complexity) +- Feature: Add a new caching mechanism in `src/cache/memory.ts` (medium complexity) + +Requirements: +- Classify tasks across type and complexity enums in a realistic mix +- Include at least one fix, one refactor, and one feature task +- Vary complexity levels appropriately + +Non-goals: +- Do not add high-complexity tasks +- Do not modify test files in this phase diff --git a/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/architect/verify.ts b/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/architect/verify.ts new file mode 100644 index 0000000..8c92017 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/architect/verify.ts @@ -0,0 +1,34 @@ +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("fix") && !summary.includes("bug")) { + return { + ok: false, + reason: "highLevelSummary must mention bug fix", + }; + } + + if (!summary.includes("refactor")) { + return { + ok: false, + reason: "highLevelSummary must mention refactor", + }; + } + + if (!summary.includes("feature") && !summary.includes("cach")) { + return { + ok: false, + reason: "highLevelSummary must mention feature or caching", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/coder/expected.patch b/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/coder/expected.patch new file mode 100644 index 0000000..b6bfdbf --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/coder/expected.patch @@ -0,0 +1,60 @@ +diff --git a/src/validators/input.ts b/src/validators/input.ts +index 0000000..0000001 100644 +--- a/src/validators/input.ts ++++ b/src/validators/input.ts +@@ -1,4 +1,4 @@ +-export function validateInput(input: string): boolean { +- return input.length > 0; ++export function validateInput(input: string | null | undefined): boolean { ++ return typeof input === "string" && input.length > 0; + } +diff --git a/src/services/data.ts b/src/services/data.ts +index 0000000..0000001 100644 +--- a/src/services/data.ts ++++ b/src/services/data.ts +@@ -1,8 +1,12 @@ +-export function getData(id: string): any { +- // legacy implementation +- const result = fetch(id); +- return result; ++export interface DataResult { ++ data: T; ++ timestamp: number; ++} ++ ++export async function getData(id: string): Promise> { ++ const response = await fetch(`/api/data/${id}`); ++ const data = await response.json(); ++ return { data, timestamp: Date.now() }; + } +diff --git a/src/cache/memory.ts b/src/cache/memory.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/cache/memory.ts +@@ -0,0 +1,23 @@ ++export interface CacheEntry { ++ value: T; ++ ttl: number; ++ createdAt: number; ++} ++ ++const cache = new Map>(); ++ ++export function set(key: string, value: T, ttl: number): void { ++ cache.set(key, { value, ttl, createdAt: Date.now() }); ++} ++ ++export function get(key: string): T | undefined { ++ const entry = cache.get(key) as CacheEntry | undefined; ++ if (!entry) return undefined; ++ if (Date.now() - entry.createdAt > entry.ttl) { ++ cache.delete(key); ++ return undefined; ++ } ++ return entry.value; ++} ++ ++export function clear(): void { ++ cache.clear(); ++} diff --git a/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/coder/prompt.md b/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/coder/prompt.md new file mode 100644 index 0000000..2ff9bad --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/coder/prompt.md @@ -0,0 +1,10 @@ +You are the coder agent. Apply the architect and planner guidance to implement +the mixed task portfolio with bug fix, refactor, and feature. + +Requirements: +- Fix the validation error in src/validators/input.ts +- Refactor the service layer in src/services/data.ts +- Add caching mechanism in src/cache/memory.ts +- Implement patches that reflect the intended task types and difficulty + +Return a unified diff patch that implements all three changes. diff --git a/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/coder/verify.ts b/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/coder/verify.ts new file mode 100644 index 0000000..3e773b6 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/coder/verify.ts @@ -0,0 +1,40 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("validators") && !patch.includes("input.ts")) { + return { + ok: false, + reason: "Patch must include the validator fix.", + }; + } + + if (!patch.includes("services") && !patch.includes("data.ts")) { + return { + ok: false, + reason: "Patch must include the service refactor.", + }; + } + + if (!patch.includes("cache") && !patch.includes("memory.ts")) { + return { + ok: false, + reason: "Patch must include the caching feature.", + }; + } + + const headerCount = (patch.match(/^diff --git /gm) || []).length; + if (headerCount < 3) { + return { + ok: false, + reason: "Patch must contain at least 3 diff headers for mixed tasks.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/planner/expected.json b/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/planner/expected.json new file mode 100644 index 0000000..ac38842 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/planner/expected.json @@ -0,0 +1,30 @@ +{ + "tasks": [ + { + "id": "fix-validation-error", + "description": "Fix the validation error in input validator", + "file": "src/validators/input.ts", + "type": "fix", + "complexity": "low", + "dependsOn": [] + }, + { + "id": "refactor-service-layer", + "description": "Clean up and refactor the data service layer", + "file": "src/services/data.ts", + "type": "refactor", + "complexity": "medium", + "dependsOn": [] + }, + { + "id": "add-caching-feature", + "description": "Add new memory caching mechanism", + "file": "src/cache/memory.ts", + "type": "feature", + "complexity": "medium", + "dependsOn": ["refactor-service-layer"] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/planner/prompt.md b/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/planner/prompt.md new file mode 100644 index 0000000..c1f56e5 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/planner/prompt.md @@ -0,0 +1,11 @@ +Using the architect's spec for a mixed task portfolio, produce a task list +that classifies tasks across type and complexity enums in a realistic mix. + +The work involves: +- Bug fix: Fix validation error (low complexity) +- Refactor: Clean up service layer (medium complexity) +- Feature: Add caching mechanism (medium complexity) + +Requirements: +- Include at least one fix, one refactor, and one feature task +- Vary complexity levels appropriately diff --git a/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/planner/verify.ts b/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/planner/verify.ts new file mode 100644 index 0000000..2ae34bf --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/planner/verify.ts @@ -0,0 +1,52 @@ +import { + verifyPlanner, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyPlanner(ctx, (out) => { + const types = out.tasks.map((t) => t.type); + const complexities = out.tasks.map((t) => t.complexity); + + if (!types.includes("fix")) { + return { + ok: false, + reason: "Planner must include at least one fix task.", + }; + } + + if (!types.includes("refactor")) { + return { + ok: false, + reason: "Planner must include at least one refactor task.", + }; + } + + if (!types.includes("feature")) { + return { + ok: false, + reason: "Planner must include at least one feature task.", + }; + } + + const hasLow = complexities.includes("low"); + const hasMedium = complexities.includes("medium"); + if (!hasLow || !hasMedium) { + return { + ok: false, + reason: "Planner must include varied complexity levels (low and medium).", + }; + } + + const hasHigh = complexities.includes("high"); + if (hasHigh) { + return { + ok: false, + reason: "Planner must not include high-complexity tasks per spec.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/reviewer/expected.json b/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/reviewer/expected.json new file mode 100644 index 0000000..45acefa --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Mixed task portfolio correctly implements fix, refactor, and feature with appropriate complexity levels.", + "path": "src/validators/input.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/reviewer/prompt.md b/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/reviewer/prompt.md new file mode 100644 index 0000000..f918e01 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/reviewer/prompt.md @@ -0,0 +1,15 @@ +You are the reviewer agent. + +Review a patch that implements a mixed task portfolio: +- Bug fix in src/validators/input.ts (low complexity) +- Refactor in src/services/data.ts (medium complexity) +- Feature in src/cache/memory.ts (medium complexity) + +Your responsibilities: +- Evaluate high-complexity and feature tasks more strictly than low-complexity refactors +- Verify the task types and complexities are appropriate +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/reviewer/verify.ts b/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/reviewer/verify.ts new file mode 100644 index 0000000..9b90b03 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-302-mixed-types-and-complexities/reviewer/verify.ts @@ -0,0 +1,33 @@ +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: "Reviewer should approve a well-implemented mixed task portfolio.", + }; + } + + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer should include at least one comment about the mixed tasks.", + }; + } + + const blocking = out.comments.filter((c) => c.blocking); + if (blocking.length > 0) { + return { + ok: false, + reason: "All comments should be non-blocking for a correct implementation.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/architect/expected.json b/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/architect/expected.json new file mode 100644 index 0000000..e63ff2f --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/architect/expected.json @@ -0,0 +1,10 @@ +{ + "highLevelSummary": "Add missing edge-case tests for the string parser utility, covering empty strings, null/undefined input, very long strings, and special characters to improve test coverage without modifying the implementation.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/utils/parser.ts", + "test/utils/parser.test.ts" + ] +} diff --git a/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/architect/prompt.md b/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/architect/prompt.md new file mode 100644 index 0000000..45f3252 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/architect/prompt.md @@ -0,0 +1,16 @@ +You are designing a spec for adding missing edge-case tests to existing logic. + +The existing code in `src/utils/parser.ts` handles string parsing but lacks tests for: +- Empty string input +- Null/undefined input +- Very long strings +- Special characters + +Requirements: +- Specify missing edge-case tests for existing logic +- Require improved test coverage +- Tests should be added to `test/utils/parser.test.ts` + +Non-goals: +- Do not modify the parser implementation +- Do not add new features to the parser diff --git a/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/architect/verify.ts b/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/architect/verify.ts new file mode 100644 index 0000000..fa64f48 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/architect/verify.ts @@ -0,0 +1,36 @@ +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("test") && !summary.includes("coverage")) { + return { + ok: false, + reason: "highLevelSummary must mention tests or coverage", + }; + } + + if (!summary.includes("edge") && !summary.includes("missing")) { + return { + ok: false, + reason: "highLevelSummary must mention edge cases or missing tests", + }; + } + + const files = spec.recommendedFileStructure; + const hasTest = files.some((f) => f.includes("test")); + if (!hasTest) { + return { + ok: false, + reason: "recommendedFileStructure must include a test file", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/coder/expected.patch b/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/coder/expected.patch new file mode 100644 index 0000000..0fd4739 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/coder/expected.patch @@ -0,0 +1,37 @@ +diff --git a/test/utils/parser.test.ts b/test/utils/parser.test.ts +index 0000000..0000001 100644 +--- a/test/utils/parser.test.ts ++++ b/test/utils/parser.test.ts +@@ -1,9 +1,37 @@ + import { parse } from "../../src/utils/parser"; + + describe("parse", () => { + it("should parse valid input", () => { + expect(parse("hello")).toBe("hello"); + }); ++ ++ describe("edge cases", () => { ++ it("should handle empty string input", () => { ++ expect(parse("")).toBe(""); ++ }); ++ ++ it("should handle null input", () => { ++ expect(() => parse(null as unknown as string)).toThrow(); ++ }); ++ ++ it("should handle undefined input", () => { ++ expect(() => parse(undefined as unknown as string)).toThrow(); ++ }); ++ ++ it("should handle very long strings", () => { ++ const longString = "a".repeat(10000); ++ expect(parse(longString)).toBe(longString); ++ }); ++ ++ it("should handle special characters", () => { ++ expect(parse("hello\nworld")).toBe("hello\nworld"); ++ expect(parse("hello\tworld")).toBe("hello\tworld"); ++ expect(parse("")).toBe(""); ++ }); ++ }); + }); diff --git a/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/coder/prompt.md b/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/coder/prompt.md new file mode 100644 index 0000000..dc4e3d0 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/coder/prompt.md @@ -0,0 +1,10 @@ +You are the coder agent. Apply the architect and planner guidance to add +missing edge-case tests for the parser utility. + +Requirements: +- Add meaningful tests in addition to logic changes +- No test omission - cover all edge cases +- Test empty strings, null/undefined, long strings, and special characters +- Do not modify the parser implementation + +Return a unified diff patch that adds the edge-case tests. diff --git a/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/coder/verify.ts b/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/coder/verify.ts new file mode 100644 index 0000000..a8c762a --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/coder/verify.ts @@ -0,0 +1,40 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("test") && !patch.includes(".test.ts")) { + return { + ok: false, + reason: "Patch must include test file changes.", + }; + } + + const edgeCases = ["empty", "null", "undefined", "long", "special"]; + let coveredCases = 0; + for (const edgeCase of edgeCases) { + if (patch.toLowerCase().includes(edgeCase)) { + coveredCases++; + } + } + + if (coveredCases < 3) { + return { + ok: false, + reason: "Patch must cover at least 3 edge cases (empty, null, undefined, long, special).", + }; + } + + if (patch.includes("src/utils/parser.ts") && !patch.includes("test")) { + return { + ok: false, + reason: "Patch must not modify the parser implementation.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/planner/expected.json b/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/planner/expected.json new file mode 100644 index 0000000..b787491 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/planner/expected.json @@ -0,0 +1,14 @@ +{ + "tasks": [ + { + "id": "add-edge-case-tests", + "description": "Add comprehensive edge-case tests for the parser utility covering empty strings, null/undefined, long strings, and special characters", + "file": "test/utils/parser.test.ts", + "type": "feature", + "complexity": "medium", + "dependsOn": [] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/planner/prompt.md b/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/planner/prompt.md new file mode 100644 index 0000000..864e678 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/planner/prompt.md @@ -0,0 +1,12 @@ +Using the architect's spec for adding missing edge-case tests, produce a task list +that includes at least one task explicitly calling for adding or improving tests. + +Missing test cases: +- Empty string input +- Null/undefined input +- Very long strings +- Special characters + +Requirements: +- Include at least one task that explicitly calls for adding or improving tests +- Do not modify the parser implementation diff --git a/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/planner/verify.ts b/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/planner/verify.ts new file mode 100644 index 0000000..96972a5 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/planner/verify.ts @@ -0,0 +1,31 @@ +import { + verifyPlanner, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyPlanner(ctx, (out) => { + const hasTestTask = out.tasks.some( + (t) => t.file.includes("test") || t.description.toLowerCase().includes("test") + ); + if (!hasTestTask) { + return { + ok: false, + reason: "Planner must include at least one task for adding or improving tests.", + }; + } + + const modifiesParser = out.tasks.some( + (t) => t.file === "src/utils/parser.ts" && t.type !== "unknown" + ); + if (modifiesParser) { + return { + ok: false, + reason: "Planner must not modify the parser implementation per spec.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/reviewer/expected.json b/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/reviewer/expected.json new file mode 100644 index 0000000..2610695 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Comprehensive edge-case tests added covering empty strings, null/undefined, long strings, and special characters.", + "path": "test/utils/parser.test.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/reviewer/prompt.md b/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/reviewer/prompt.md new file mode 100644 index 0000000..8026bfa --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/reviewer/prompt.md @@ -0,0 +1,18 @@ +You are the reviewer agent. + +Review a patch that adds missing edge-case tests for a parser utility. + +Edge cases that should be covered: +- Empty string input +- Null/undefined input +- Very long strings +- Special characters + +Your responsibilities: +- Require tests for the new behavior +- Block approval if tests are missing or weak +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/reviewer/verify.ts b/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/reviewer/verify.ts new file mode 100644 index 0000000..070254f --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-303-test-coverage-enforcement/reviewer/verify.ts @@ -0,0 +1,46 @@ +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: "Reviewer should approve comprehensive edge-case tests.", + }; + } + + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer should include at least one comment about test coverage.", + }; + } + + const blocking = out.comments.filter((c) => c.blocking); + if (blocking.length > 0) { + return { + ok: false, + reason: "All comments should be non-blocking for comprehensive tests.", + }; + } + + const mentionsTests = out.comments.some( + (c) => + c.message.toLowerCase().includes("test") || + c.message.toLowerCase().includes("edge") || + c.message.toLowerCase().includes("coverage") + ); + if (!mentionsTests) { + return { + ok: false, + reason: "At least one comment should reference tests or coverage.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-304-scope-constraints/architect/expected.json b/fixtures/core-semantics-and-tests/task-304-scope-constraints/architect/expected.json new file mode 100644 index 0000000..46ca5ad --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-304-scope-constraints/architect/expected.json @@ -0,0 +1,10 @@ +{ + "highLevelSummary": "Update internal utilities with strict scope constraints: only touch src/utils/, never touch public API endpoints in src/api/ or configuration files.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/utils/helper.ts", + "src/utils/format.ts" + ] +} diff --git a/fixtures/core-semantics-and-tests/task-304-scope-constraints/architect/prompt.md b/fixtures/core-semantics-and-tests/task-304-scope-constraints/architect/prompt.md new file mode 100644 index 0000000..23c52ce --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-304-scope-constraints/architect/prompt.md @@ -0,0 +1,16 @@ +You are designing a spec for work that is feasible but explicitly constrained in scope. + +The work involves updating internal utilities, but with strict constraints: +- Allowed: Only touch `src/utils/` directory +- Forbidden: Never touch public API endpoints in `src/api/` +- Forbidden: Never modify configuration files + +Requirements: +- Mark the work as feasible +- Explicitly constrain scope to src/utils only +- State that public API must not be touched + +Non-goals: +- Do not modify public API endpoints +- Do not change configuration files +- Do not expand scope beyond src/utils diff --git a/fixtures/core-semantics-and-tests/task-304-scope-constraints/architect/verify.ts b/fixtures/core-semantics-and-tests/task-304-scope-constraints/architect/verify.ts new file mode 100644 index 0000000..71e1524 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-304-scope-constraints/architect/verify.ts @@ -0,0 +1,37 @@ +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("constraint") && !summary.includes("scope")) { + return { + ok: false, + reason: "highLevelSummary must mention constraints or scope", + }; + } + + if (!summary.includes("utils")) { + return { + ok: false, + reason: "highLevelSummary must mention src/utils as allowed scope", + }; + } + + const files = spec.recommendedFileStructure; + for (const file of files) { + if (file.includes("api/") || file.includes("config")) { + return { + ok: false, + reason: "recommendedFileStructure must not include forbidden paths", + }; + } + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-304-scope-constraints/coder/expected.patch b/fixtures/core-semantics-and-tests/task-304-scope-constraints/coder/expected.patch new file mode 100644 index 0000000..848308d --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-304-scope-constraints/coder/expected.patch @@ -0,0 +1,25 @@ +diff --git a/src/utils/helper.ts b/src/utils/helper.ts +index 0000000..0000001 100644 +--- a/src/utils/helper.ts ++++ b/src/utils/helper.ts +@@ -1,3 +1,5 @@ +-export function helper(input: string): string { +- return input; ++export function helper(input: string): string { ++ if (!input) { ++ return ""; ++ } ++ return input.trim(); + } +diff --git a/src/utils/format.ts b/src/utils/format.ts +index 0000000..0000001 100644 +--- a/src/utils/format.ts ++++ b/src/utils/format.ts +@@ -1,3 +1,5 @@ +-export function format(value: string): string { +- return value; ++import { helper } from "./helper"; ++ ++export function format(value: string): string { ++ return helper(value).toLowerCase(); + } diff --git a/fixtures/core-semantics-and-tests/task-304-scope-constraints/coder/prompt.md b/fixtures/core-semantics-and-tests/task-304-scope-constraints/coder/prompt.md new file mode 100644 index 0000000..8e3b190 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-304-scope-constraints/coder/prompt.md @@ -0,0 +1,10 @@ +You are the coder agent. Apply the architect and planner guidance to update +utilities within the constrained scope. + +Requirements: +- Only modify files in src/utils/ directory +- Never touch public API endpoints in src/api/ +- Never modify configuration files +- Changes should only affect the allowed areas + +Return a unified diff patch that respects the scope constraints. diff --git a/fixtures/core-semantics-and-tests/task-304-scope-constraints/coder/verify.ts b/fixtures/core-semantics-and-tests/task-304-scope-constraints/coder/verify.ts new file mode 100644 index 0000000..256d101 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-304-scope-constraints/coder/verify.ts @@ -0,0 +1,32 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("src/utils/")) { + return { + ok: false, + reason: "Patch must modify files in src/utils/ directory.", + }; + } + + if (patch.includes("src/api/")) { + return { + ok: false, + reason: "Patch must not touch public API endpoints in src/api/.", + }; + } + + if (patch.includes("config") && !patch.includes("src/utils/")) { + return { + ok: false, + reason: "Patch must not modify configuration files.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-304-scope-constraints/planner/expected.json b/fixtures/core-semantics-and-tests/task-304-scope-constraints/planner/expected.json new file mode 100644 index 0000000..a85b790 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-304-scope-constraints/planner/expected.json @@ -0,0 +1,22 @@ +{ + "tasks": [ + { + "id": "update-helper-utility", + "description": "Update helper utility in src/utils/helper.ts", + "file": "src/utils/helper.ts", + "type": "refactor", + "complexity": "low", + "dependsOn": [] + }, + { + "id": "update-format-utility", + "description": "Update format utility in src/utils/format.ts", + "file": "src/utils/format.ts", + "type": "refactor", + "complexity": "low", + "dependsOn": ["update-helper-utility"] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/core-semantics-and-tests/task-304-scope-constraints/planner/prompt.md b/fixtures/core-semantics-and-tests/task-304-scope-constraints/planner/prompt.md new file mode 100644 index 0000000..fe1d1e9 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-304-scope-constraints/planner/prompt.md @@ -0,0 +1,9 @@ +Using the architect's spec for scope-constrained utility updates, produce a task list +that targets only the allowed locations. + +Allowed: src/utils/ +Forbidden: src/api/, configuration files + +Requirements: +- Emit tasks that target only the allowed locations +- Do not include tasks outside the constrained scope diff --git a/fixtures/core-semantics-and-tests/task-304-scope-constraints/planner/verify.ts b/fixtures/core-semantics-and-tests/task-304-scope-constraints/planner/verify.ts new file mode 100644 index 0000000..ad27347 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-304-scope-constraints/planner/verify.ts @@ -0,0 +1,34 @@ +import { + verifyPlanner, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyPlanner(ctx, (out) => { + for (const task of out.tasks) { + if (!task.file.startsWith("src/utils/")) { + return { + ok: false, + reason: `Task ${task.id} targets ${task.file} which is outside allowed scope (src/utils/).`, + }; + } + + if (task.file.includes("api/") || task.file.includes("config")) { + return { + ok: false, + reason: `Task ${task.id} targets forbidden path: ${task.file}`, + }; + } + } + + if (out.tasks.length === 0) { + return { + ok: false, + reason: "Planner must emit at least one task.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-304-scope-constraints/reviewer/expected.json b/fixtures/core-semantics-and-tests/task-304-scope-constraints/reviewer/expected.json new file mode 100644 index 0000000..8390eac --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-304-scope-constraints/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Patch correctly respects scope constraints, only modifying files in src/utils/ without touching public API or configuration.", + "path": "src/utils/helper.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/core-semantics-and-tests/task-304-scope-constraints/reviewer/prompt.md b/fixtures/core-semantics-and-tests/task-304-scope-constraints/reviewer/prompt.md new file mode 100644 index 0000000..581abe0 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-304-scope-constraints/reviewer/prompt.md @@ -0,0 +1,15 @@ +You are the reviewer agent. + +Review a patch that updates utilities within strict scope constraints. + +Allowed scope: src/utils/ +Forbidden: src/api/, configuration files + +Your responsibilities: +- Reject patches that violate scope constraints +- Call out any edits to forbidden locations +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/core-semantics-and-tests/task-304-scope-constraints/reviewer/verify.ts b/fixtures/core-semantics-and-tests/task-304-scope-constraints/reviewer/verify.ts new file mode 100644 index 0000000..876e6a1 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-304-scope-constraints/reviewer/verify.ts @@ -0,0 +1,33 @@ +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: "Reviewer should approve a patch that respects scope constraints.", + }; + } + + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer should include at least one comment about scope compliance.", + }; + } + + const blocking = out.comments.filter((c) => c.blocking); + if (blocking.length > 0) { + return { + ok: false, + reason: "All comments should be non-blocking for a scope-compliant patch.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/architect/expected.json b/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/architect/expected.json new file mode 100644 index 0000000..32b0518 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/architect/expected.json @@ -0,0 +1,10 @@ +{ + "highLevelSummary": "Create a new helper utility file at src/utils/newHelper.ts and wire it into existing code in src/main.ts, ensuring the file is placed in an allowed location.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/utils/newHelper.ts", + "src/main.ts" + ] +} diff --git a/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/architect/prompt.md b/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/architect/prompt.md new file mode 100644 index 0000000..45068dd --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for creating a new file in an allowed location. + +The request is to add a new helper utility: +- New file: `src/utils/newHelper.ts` +- The file should contain a simple string manipulation function +- It should be wired into existing code in `src/main.ts` + +Requirements: +- Create a new file in the allowed directory (src/utils/) +- Wire the new utility into existing code +- Do not create files in forbidden locations + +Non-goals: +- Do not create files in dist/, node_modules/, or other forbidden paths +- Do not modify configuration files diff --git a/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/architect/verify.ts b/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/architect/verify.ts new file mode 100644 index 0000000..00cfde1 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/architect/verify.ts @@ -0,0 +1,36 @@ +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("new") && !summary.includes("create")) { + return { + ok: false, + reason: "highLevelSummary must mention creating a new file", + }; + } + + if (!summary.includes("helper") && !summary.includes("utility")) { + return { + ok: false, + reason: "highLevelSummary must mention helper or utility", + }; + } + + const files = spec.recommendedFileStructure; + const hasNewFile = files.some((f) => f.includes("newHelper") || f.includes("new")); + if (!hasNewFile) { + return { + ok: false, + reason: "recommendedFileStructure must include the new file", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/coder/expected.patch b/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/coder/expected.patch new file mode 100644 index 0000000..f62aefd --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/coder/expected.patch @@ -0,0 +1,28 @@ +diff --git a/src/utils/newHelper.ts b/src/utils/newHelper.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/utils/newHelper.ts +@@ -0,0 +1,7 @@ ++export function capitalize(input: string): string { ++ if (!input) return ""; ++ return input.charAt(0).toUpperCase() + input.slice(1); ++} ++ ++export function reverse(input: string): string { ++ return input.split("").reverse().join(""); ++} +diff --git a/src/main.ts b/src/main.ts +index 0000000..0000001 100644 +--- a/src/main.ts ++++ b/src/main.ts +@@ -1,3 +1,7 @@ +-export function main(): void { +- console.log("Hello"); ++import { capitalize, reverse } from "./utils/newHelper"; ++ ++export function main(): void { ++ const greeting = capitalize("hello"); ++ const reversed = reverse(greeting); ++ console.log(greeting, reversed); + } diff --git a/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/coder/prompt.md b/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/coder/prompt.md new file mode 100644 index 0000000..a00d579 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/coder/prompt.md @@ -0,0 +1,9 @@ +You are the coder agent. Apply the architect and planner guidance to create +a new helper utility file and wire it into existing code. + +Requirements: +- Create a new file at src/utils/newHelper.ts +- Wire the new utility into src/main.ts +- Do not create files in forbidden paths (dist/, node_modules/, etc.) + +Return a unified diff patch that creates the new file and integrates it. diff --git a/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/coder/verify.ts b/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/coder/verify.ts new file mode 100644 index 0000000..11e2a0c --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/coder/verify.ts @@ -0,0 +1,35 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("newHelper.ts") && !patch.includes("new file")) { + return { + ok: false, + reason: "Patch must create the new helper file.", + }; + } + + if (!patch.includes("src/main.ts")) { + return { + ok: false, + reason: "Patch must wire the new utility into main.ts.", + }; + } + + const forbiddenPaths = ["dist/", "node_modules/", ".swarm/", "build/"]; + for (const forbidden of forbiddenPaths) { + if (patch.includes(forbidden)) { + return { + ok: false, + reason: `Patch must not create files in forbidden path: ${forbidden}`, + }; + } + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/planner/expected.json b/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/planner/expected.json new file mode 100644 index 0000000..57843bf --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/planner/expected.json @@ -0,0 +1,22 @@ +{ + "tasks": [ + { + "id": "create-new-helper", + "description": "Create new helper utility file at src/utils/newHelper.ts with string manipulation function", + "file": "src/utils/newHelper.ts", + "type": "feature", + "complexity": "low", + "dependsOn": [] + }, + { + "id": "wire-helper-to-main", + "description": "Wire the new helper utility into src/main.ts", + "file": "src/main.ts", + "type": "feature", + "complexity": "low", + "dependsOn": ["create-new-helper"] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/planner/prompt.md b/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/planner/prompt.md new file mode 100644 index 0000000..8b05b91 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/planner/prompt.md @@ -0,0 +1,9 @@ +Using the architect's spec for creating a new helper utility, produce a task list +that includes at least one task for creating a new file in the allowed path. + +New file: src/utils/newHelper.ts +Integration: src/main.ts + +Requirements: +- Include at least one task that clearly describes creating a new file in the allowed path +- Wire the new utility into existing code diff --git a/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/planner/verify.ts b/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/planner/verify.ts new file mode 100644 index 0000000..a9ce7b3 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/planner/verify.ts @@ -0,0 +1,35 @@ +import { + verifyPlanner, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyPlanner(ctx, (out) => { + const hasNewFileTask = out.tasks.some( + (t) => + t.description.toLowerCase().includes("create") || + t.description.toLowerCase().includes("new") + ); + if (!hasNewFileTask) { + return { + ok: false, + reason: "Planner must include a task for creating a new file.", + }; + } + + const forbiddenPaths = ["dist/", "node_modules/", ".swarm/", "build/"]; + for (const task of out.tasks) { + for (const forbidden of forbiddenPaths) { + if (task.file.includes(forbidden.replace("/", ""))) { + return { + ok: false, + reason: `Task ${task.id} creates file in forbidden path: ${task.file}`, + }; + } + } + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/reviewer/expected.json b/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/reviewer/expected.json new file mode 100644 index 0000000..f8b25a3 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "New helper file correctly placed in src/utils/ and properly wired into main.ts.", + "path": "src/utils/newHelper.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/reviewer/prompt.md b/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/reviewer/prompt.md new file mode 100644 index 0000000..e98f02e --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/reviewer/prompt.md @@ -0,0 +1,15 @@ +You are the reviewer agent. + +Review a patch that creates a new helper utility file and wires it into existing code. + +New file: src/utils/newHelper.ts +Integration: src/main.ts + +Your responsibilities: +- Verify that the new file is placed correctly in an allowed location +- Ensure no disallowed files were added +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/reviewer/verify.ts b/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/reviewer/verify.ts new file mode 100644 index 0000000..096a929 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-305-create-new-file-safe/reviewer/verify.ts @@ -0,0 +1,33 @@ +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: "Reviewer should approve a correctly placed new file.", + }; + } + + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer should include at least one comment about the new file.", + }; + } + + const blocking = out.comments.filter((c) => c.blocking); + if (blocking.length > 0) { + return { + ok: false, + reason: "All comments should be non-blocking for a correctly placed file.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/architect/expected.json b/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/architect/expected.json new file mode 100644 index 0000000..df7895a --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/architect/expected.json @@ -0,0 +1,10 @@ +{ + "highLevelSummary": "Implement functionality by reusing the existing utility in src/utils/existing.ts and not creating new helpers, adapting existing abstractions instead of introducing new ones.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/utils/existing.ts", + "src/features/newFeature.ts" + ] +} diff --git a/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/architect/prompt.md b/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/architect/prompt.md new file mode 100644 index 0000000..a455bca --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/architect/prompt.md @@ -0,0 +1,14 @@ +You are designing a spec for functionality that must reuse an existing utility. + +The existing utility `src/utils/existing.ts` provides string formatting functions. +New functionality needs string formatting but must NOT create new helpers. + +Requirements: +- New functionality must reuse the existing utility in src/utils/existing.ts +- Must not introduce new helpers or utility functions +- Adapt existing utilities rather than creating new ones + +Non-goals: +- Do not create new utility files +- Do not duplicate existing functionality +- Do not add new helper functions diff --git a/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/architect/verify.ts b/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/architect/verify.ts new file mode 100644 index 0000000..b8dc5dd --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/architect/verify.ts @@ -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("reuse") && !summary.includes("existing")) { + return { + ok: false, + reason: "highLevelSummary must mention reusing existing utilities", + }; + } + + if (!summary.includes("not") || !summary.includes("new")) { + return { + ok: false, + reason: "highLevelSummary must mention not creating new helpers", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/coder/expected.patch b/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/coder/expected.patch new file mode 100644 index 0000000..a9084d3 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/coder/expected.patch @@ -0,0 +1,16 @@ +diff --git a/src/features/newFeature.ts b/src/features/newFeature.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/features/newFeature.ts +@@ -0,0 +1,9 @@ ++import { formatString, trimWhitespace } from "../utils/existing"; ++ ++export function processUserInput(input: string): string { ++ const trimmed = trimWhitespace(input); ++ return formatString(trimmed); ++} ++ ++export function formatOutput(data: string): string { ++ return formatString(data); ++} diff --git a/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/coder/prompt.md b/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/coder/prompt.md new file mode 100644 index 0000000..7c093b3 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/coder/prompt.md @@ -0,0 +1,9 @@ +You are the coder agent. Apply the architect and planner guidance to implement +new functionality by reusing the existing utility. + +Requirements: +- Implement changes by reusing the existing util in src/utils/existing.ts +- Do not create any new helper files or functions +- Import and use the existing utility in the new feature + +Return a unified diff patch that reuses existing abstractions. diff --git a/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/coder/verify.ts b/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/coder/verify.ts new file mode 100644 index 0000000..064d4d9 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/coder/verify.ts @@ -0,0 +1,28 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("import") || !patch.includes("existing")) { + return { + ok: false, + reason: "Patch must import from the existing utility.", + }; + } + + const createsNewUtil = + patch.includes("src/utils/new") || + (patch.includes("new file") && patch.includes("utils/") && !patch.includes("features/")); + if (createsNewUtil) { + return { + ok: false, + reason: "Patch must not create new utility files.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/planner/expected.json b/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/planner/expected.json new file mode 100644 index 0000000..ef5821e --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/planner/expected.json @@ -0,0 +1,14 @@ +{ + "tasks": [ + { + "id": "implement-feature-with-existing-util", + "description": "Implement new feature using the existing utility from src/utils/existing.ts", + "file": "src/features/newFeature.ts", + "type": "feature", + "complexity": "low", + "dependsOn": [] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/planner/prompt.md b/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/planner/prompt.md new file mode 100644 index 0000000..24ba379 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/planner/prompt.md @@ -0,0 +1,9 @@ +Using the architect's spec for reusing existing utilities, produce a task list +that targets tasks calling or adapting existing utilities rather than adding new ones. + +Existing utility: src/utils/existing.ts +New feature: src/features/newFeature.ts + +Requirements: +- Target tasks that call or adapt existing utilities +- Do not add tasks for creating new helper files or functions diff --git a/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/planner/verify.ts b/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/planner/verify.ts new file mode 100644 index 0000000..b65522f --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/planner/verify.ts @@ -0,0 +1,31 @@ +import { + verifyPlanner, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyPlanner(ctx, (out) => { + const createsNewUtil = out.tasks.some( + (t) => + t.file.includes("utils/new") || + (t.description.toLowerCase().includes("create") && + t.description.toLowerCase().includes("util")) + ); + if (createsNewUtil) { + return { + ok: false, + reason: "Planner must not create new utility files when existing ones should be reused.", + }; + } + + if (out.tasks.length === 0) { + return { + ok: false, + reason: "Planner must emit at least one task.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/reviewer/expected.json b/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/reviewer/expected.json new file mode 100644 index 0000000..5c8e638 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Correctly reuses existing utility from src/utils/existing.ts without creating new helpers.", + "path": "src/features/newFeature.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/reviewer/prompt.md b/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/reviewer/prompt.md new file mode 100644 index 0000000..b2b5e3a --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/reviewer/prompt.md @@ -0,0 +1,15 @@ +You are the reviewer agent. + +Review a patch that implements new functionality by reusing an existing utility. + +Existing utility: src/utils/existing.ts +New feature: src/features/newFeature.ts + +Your responsibilities: +- Block patches that introduce new utilities when an existing one was mandated +- Verify the existing utility is properly imported and used +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/reviewer/verify.ts b/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/reviewer/verify.ts new file mode 100644 index 0000000..173400c --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-306-prefer-existing-abstraction/reviewer/verify.ts @@ -0,0 +1,33 @@ +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: "Reviewer should approve a patch that correctly reuses existing utilities.", + }; + } + + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer should include at least one comment about utility reuse.", + }; + } + + const blocking = out.comments.filter((c) => c.blocking); + if (blocking.length > 0) { + return { + ok: false, + reason: "All comments should be non-blocking for correct utility reuse.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-307-safe-file-delete/architect/expected.json b/fixtures/core-semantics-and-tests/task-307-safe-file-delete/architect/expected.json new file mode 100644 index 0000000..0ca75ad --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-307-safe-file-delete/architect/expected.json @@ -0,0 +1,9 @@ +{ + "highLevelSummary": "Safely delete the obsolete file src/utils/deprecated.ts and clean up any remaining references, ensuring the file removal is safe and all imports have been migrated to src/utils/modern.ts.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/utils/modern.ts" + ] +} diff --git a/fixtures/core-semantics-and-tests/task-307-safe-file-delete/architect/prompt.md b/fixtures/core-semantics-and-tests/task-307-safe-file-delete/architect/prompt.md new file mode 100644 index 0000000..cd84100 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-307-safe-file-delete/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for safely deleting an obsolete file. + +The obsolete file `src/utils/deprecated.ts` should be removed: +- The file is no longer used anywhere in the codebase +- All references to it have been migrated to `src/utils/modern.ts` +- The file should be safely deleted + +Requirements: +- Request removal of the obsolete file in an allowed directory +- Describe the expected behavior after deletion +- Ensure all references are cleaned up + +Non-goals: +- Do not delete files in forbidden locations +- Do not remove files that are still in use diff --git a/fixtures/core-semantics-and-tests/task-307-safe-file-delete/architect/verify.ts b/fixtures/core-semantics-and-tests/task-307-safe-file-delete/architect/verify.ts new file mode 100644 index 0000000..3387b8b --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-307-safe-file-delete/architect/verify.ts @@ -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("delete") && !summary.includes("remove")) { + return { + ok: false, + reason: "highLevelSummary must mention deleting or removing the file", + }; + } + + if (!summary.includes("safe") && !summary.includes("obsolete") && !summary.includes("deprecated")) { + return { + ok: false, + reason: "highLevelSummary must mention safe deletion or obsolete/deprecated file", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-307-safe-file-delete/coder/expected.patch b/fixtures/core-semantics-and-tests/task-307-safe-file-delete/coder/expected.patch new file mode 100644 index 0000000..b534cd0 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-307-safe-file-delete/coder/expected.patch @@ -0,0 +1,21 @@ +diff --git a/src/main.ts b/src/main.ts +index 0000000..0000001 100644 +--- a/src/main.ts ++++ b/src/main.ts +@@ -1,5 +1,5 @@ +-import { oldHelper } from "./utils/deprecated"; ++import { modernHelper } from "./utils/modern"; + + export function main(): void { +- console.log(oldHelper("test")); ++ console.log(modernHelper("test")); + } +diff --git a/src/utils/deprecated.ts b/src/utils/deprecated.ts +deleted file mode 100644 +index 0000001..0000000 +--- a/src/utils/deprecated.ts ++++ /dev/null +@@ -1,3 +0,0 @@ +-export function oldHelper(input: string): string { +- return input; +-} diff --git a/fixtures/core-semantics-and-tests/task-307-safe-file-delete/coder/prompt.md b/fixtures/core-semantics-and-tests/task-307-safe-file-delete/coder/prompt.md new file mode 100644 index 0000000..1d03bd8 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-307-safe-file-delete/coder/prompt.md @@ -0,0 +1,9 @@ +You are the coder agent. Apply the architect and planner guidance to safely +delete the obsolete file and clean up references. + +Requirements: +- Produce a patch that safely deletes src/utils/deprecated.ts +- Clean up imports or references to the deleted file +- Do not touch forbidden paths or remove unrelated files + +Return a unified diff patch that safely deletes the file and cleans up references. diff --git a/fixtures/core-semantics-and-tests/task-307-safe-file-delete/coder/verify.ts b/fixtures/core-semantics-and-tests/task-307-safe-file-delete/coder/verify.ts new file mode 100644 index 0000000..a0ecacc --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-307-safe-file-delete/coder/verify.ts @@ -0,0 +1,28 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("deleted file") && !patch.includes("deprecated.ts")) { + return { + ok: false, + reason: "Patch must delete the obsolete file.", + }; + } + + const forbiddenPaths = ["dist/", "node_modules/", ".swarm/", "build/"]; + for (const forbidden of forbiddenPaths) { + if (patch.includes(`deleted file`) && patch.includes(forbidden)) { + return { + ok: false, + reason: `Patch must not delete files in forbidden path: ${forbidden}`, + }; + } + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-307-safe-file-delete/planner/expected.json b/fixtures/core-semantics-and-tests/task-307-safe-file-delete/planner/expected.json new file mode 100644 index 0000000..29dbeec --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-307-safe-file-delete/planner/expected.json @@ -0,0 +1,22 @@ +{ + "tasks": [ + { + "id": "update-references", + "description": "Update any remaining references from deprecated.ts to modern.ts", + "file": "src/main.ts", + "type": "refactor", + "complexity": "low", + "dependsOn": [] + }, + { + "id": "delete-deprecated-file", + "description": "Delete the obsolete file src/utils/deprecated.ts", + "file": "src/utils/deprecated.ts", + "type": "refactor", + "complexity": "low", + "dependsOn": ["update-references"] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/core-semantics-and-tests/task-307-safe-file-delete/planner/prompt.md b/fixtures/core-semantics-and-tests/task-307-safe-file-delete/planner/prompt.md new file mode 100644 index 0000000..0c96ae0 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-307-safe-file-delete/planner/prompt.md @@ -0,0 +1,9 @@ +Using the architect's spec for safely deleting an obsolete file, produce a task list +that includes at least one task for deleting the specified file and updating any references. + +Obsolete file: src/utils/deprecated.ts +Replacement: src/utils/modern.ts + +Requirements: +- Include at least one task that explicitly calls for deleting the specified file +- Include tasks for updating any references diff --git a/fixtures/core-semantics-and-tests/task-307-safe-file-delete/planner/verify.ts b/fixtures/core-semantics-and-tests/task-307-safe-file-delete/planner/verify.ts new file mode 100644 index 0000000..9f3acf0 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-307-safe-file-delete/planner/verify.ts @@ -0,0 +1,30 @@ +import { + verifyPlanner, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyPlanner(ctx, (out) => { + const hasDeleteTask = out.tasks.some( + (t) => + t.description.toLowerCase().includes("delete") || + t.description.toLowerCase().includes("remove") + ); + if (!hasDeleteTask) { + return { + ok: false, + reason: "Planner must include a task for deleting the obsolete file.", + }; + } + + if (out.tasks.length === 0) { + return { + ok: false, + reason: "Planner must emit at least one task.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/core-semantics-and-tests/task-307-safe-file-delete/reviewer/expected.json b/fixtures/core-semantics-and-tests/task-307-safe-file-delete/reviewer/expected.json new file mode 100644 index 0000000..c56d8f1 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-307-safe-file-delete/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Obsolete file safely deleted and all references properly migrated to modern.ts.", + "path": "src/utils/deprecated.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/core-semantics-and-tests/task-307-safe-file-delete/reviewer/prompt.md b/fixtures/core-semantics-and-tests/task-307-safe-file-delete/reviewer/prompt.md new file mode 100644 index 0000000..72d73d6 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-307-safe-file-delete/reviewer/prompt.md @@ -0,0 +1,15 @@ +You are the reviewer agent. + +Review a patch that safely deletes an obsolete file and cleans up references. + +Obsolete file: src/utils/deprecated.ts +Replacement: src/utils/modern.ts + +Your responsibilities: +- Verify the file deletion is safe and all references are cleaned up +- Ensure no forbidden files were deleted +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/core-semantics-and-tests/task-307-safe-file-delete/reviewer/verify.ts b/fixtures/core-semantics-and-tests/task-307-safe-file-delete/reviewer/verify.ts new file mode 100644 index 0000000..8ffd521 --- /dev/null +++ b/fixtures/core-semantics-and-tests/task-307-safe-file-delete/reviewer/verify.ts @@ -0,0 +1,33 @@ +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: "Reviewer should approve a safe file deletion with proper cleanup.", + }; + } + + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer should include at least one comment about the file deletion.", + }; + } + + const blocking = out.comments.filter((c) => c.blocking); + if (blocking.length > 0) { + return { + ok: false, + reason: "All comments should be non-blocking for a safe file deletion.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/dag-topology/task-701-diamond-dependency/architect/expected.json b/fixtures/dag-topology/task-701-diamond-dependency/architect/expected.json new file mode 100644 index 0000000..4545e68 --- /dev/null +++ b/fixtures/dag-topology/task-701-diamond-dependency/architect/expected.json @@ -0,0 +1,12 @@ +{ + "highLevelSummary": "Implement a diamond dependency pattern where Task A is the root, Tasks B and C depend on A, and Task D depends on both B and C, ensuring proper execution order at the convergence point.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/tasks/taskA.ts", + "src/tasks/taskB.ts", + "src/tasks/taskC.ts", + "src/tasks/taskD.ts" + ] +} diff --git a/fixtures/dag-topology/task-701-diamond-dependency/architect/prompt.md b/fixtures/dag-topology/task-701-diamond-dependency/architect/prompt.md new file mode 100644 index 0000000..3816df3 --- /dev/null +++ b/fixtures/dag-topology/task-701-diamond-dependency/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for a diamond dependency pattern. + +The task involves: +- Task A depends on nothing +- Tasks B and C both depend on A +- Task D depends on both B and C (diamond pattern) + +Requirements: +- Describe the diamond dependency structure +- Ensure proper execution order +- Handle the convergence point correctly + +Non-goals: +- Do not create circular dependencies +- Do not skip intermediate tasks diff --git a/fixtures/dag-topology/task-701-diamond-dependency/architect/verify.ts b/fixtures/dag-topology/task-701-diamond-dependency/architect/verify.ts new file mode 100644 index 0000000..b05f9a8 --- /dev/null +++ b/fixtures/dag-topology/task-701-diamond-dependency/architect/verify.ts @@ -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("diamond") && !summary.includes("depend")) { + return { + ok: false, + reason: "highLevelSummary must mention diamond dependency pattern", + }; + } + + if (spec.recommendedFileStructure.length < 4) { + return { + ok: false, + reason: "recommendedFileStructure must include at least 4 tasks for diamond pattern", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/dag-topology/task-701-diamond-dependency/coder/expected.patch b/fixtures/dag-topology/task-701-diamond-dependency/coder/expected.patch new file mode 100644 index 0000000..ebdc6a2 --- /dev/null +++ b/fixtures/dag-topology/task-701-diamond-dependency/coder/expected.patch @@ -0,0 +1,50 @@ +diff --git a/src/tasks/taskA.ts b/src/tasks/taskA.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/tasks/taskA.ts +@@ -0,0 +1,5 @@ ++export async function taskA(): Promise { ++ console.log("Executing Task A (root)"); ++ return "A"; ++} +diff --git a/src/tasks/taskB.ts b/src/tasks/taskB.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/tasks/taskB.ts +@@ -0,0 +1,7 @@ ++import { taskA } from "./taskA"; ++ ++export async function taskB(): Promise { ++ const resultA = await taskA(); ++ console.log("Executing Task B (depends on A)"); ++ return `${resultA}->B`; ++} +diff --git a/src/tasks/taskC.ts b/src/tasks/taskC.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/tasks/taskC.ts +@@ -0,0 +1,7 @@ ++import { taskA } from "./taskA"; ++ ++export async function taskC(): Promise { ++ const resultA = await taskA(); ++ console.log("Executing Task C (depends on A)"); ++ return `${resultA}->C`; ++} +diff --git a/src/tasks/taskD.ts b/src/tasks/taskD.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/tasks/taskD.ts +@@ -0,0 +1,9 @@ ++import { taskB } from "./taskB"; ++import { taskC } from "./taskC"; ++ ++export async function taskD(): Promise { ++ const [resultB, resultC] = await Promise.all([taskB(), taskC()]); ++ console.log("Executing Task D (diamond convergence)"); ++ return `${resultB}+${resultC}->D`; ++} diff --git a/fixtures/dag-topology/task-701-diamond-dependency/coder/prompt.md b/fixtures/dag-topology/task-701-diamond-dependency/coder/prompt.md new file mode 100644 index 0000000..3db64dc --- /dev/null +++ b/fixtures/dag-topology/task-701-diamond-dependency/coder/prompt.md @@ -0,0 +1,10 @@ +You are the coder agent. Apply the architect and planner guidance to implement +the diamond dependency pattern. + +Requirements: +- Create src/tasks/taskA.ts (root, no dependencies) +- Create src/tasks/taskB.ts (depends on A) +- Create src/tasks/taskC.ts (depends on A) +- Create src/tasks/taskD.ts (depends on B and C) + +Return a unified diff patch that implements the diamond pattern. diff --git a/fixtures/dag-topology/task-701-diamond-dependency/coder/verify.ts b/fixtures/dag-topology/task-701-diamond-dependency/coder/verify.ts new file mode 100644 index 0000000..2115797 --- /dev/null +++ b/fixtures/dag-topology/task-701-diamond-dependency/coder/verify.ts @@ -0,0 +1,26 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + const headerCount = (patch.match(/^diff --git /gm) || []).length; + if (headerCount < 4) { + return { + ok: false, + reason: "Patch must create at least 4 files for diamond pattern.", + }; + } + + if (!patch.includes("taskA") || !patch.includes("taskD")) { + return { + ok: false, + reason: "Patch must include root task A and convergence task D.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/dag-topology/task-701-diamond-dependency/planner/expected.json b/fixtures/dag-topology/task-701-diamond-dependency/planner/expected.json new file mode 100644 index 0000000..ec99ba8 --- /dev/null +++ b/fixtures/dag-topology/task-701-diamond-dependency/planner/expected.json @@ -0,0 +1,38 @@ +{ + "tasks": [ + { + "id": "task-a", + "description": "Implement root task A with no dependencies", + "file": "src/tasks/taskA.ts", + "type": "feature", + "complexity": "low", + "dependsOn": [] + }, + { + "id": "task-b", + "description": "Implement task B depending on task A", + "file": "src/tasks/taskB.ts", + "type": "feature", + "complexity": "low", + "dependsOn": ["task-a"] + }, + { + "id": "task-c", + "description": "Implement task C depending on task A", + "file": "src/tasks/taskC.ts", + "type": "feature", + "complexity": "low", + "dependsOn": ["task-a"] + }, + { + "id": "task-d", + "description": "Implement task D depending on both B and C (diamond convergence)", + "file": "src/tasks/taskD.ts", + "type": "feature", + "complexity": "low", + "dependsOn": ["task-b", "task-c"] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/dag-topology/task-701-diamond-dependency/planner/prompt.md b/fixtures/dag-topology/task-701-diamond-dependency/planner/prompt.md new file mode 100644 index 0000000..94a2f80 --- /dev/null +++ b/fixtures/dag-topology/task-701-diamond-dependency/planner/prompt.md @@ -0,0 +1,11 @@ +Using the architect's spec for a diamond dependency pattern, produce a task list +that correctly models the diamond structure. + +Pattern: +- Task A: root (no dependencies) +- Tasks B, C: depend on A +- Task D: depends on both B and C + +Requirements: +- Emit tasks with correct dependency structure +- Ensure no circular dependencies diff --git a/fixtures/dag-topology/task-701-diamond-dependency/planner/verify.ts b/fixtures/dag-topology/task-701-diamond-dependency/planner/verify.ts new file mode 100644 index 0000000..4df7ddc --- /dev/null +++ b/fixtures/dag-topology/task-701-diamond-dependency/planner/verify.ts @@ -0,0 +1,34 @@ +import { + verifyPlanner, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyPlanner(ctx, (out) => { + if (out.tasks.length < 4) { + return { + ok: false, + reason: "Planner must emit at least 4 tasks for diamond pattern.", + }; + } + + const hasRootTask = out.tasks.some((t) => t.dependsOn.length === 0); + if (!hasRootTask) { + return { + ok: false, + reason: "Planner must include a root task with no dependencies.", + }; + } + + const hasConvergenceTask = out.tasks.some((t) => t.dependsOn.length >= 2); + if (!hasConvergenceTask) { + return { + ok: false, + reason: "Planner must include a convergence task depending on multiple tasks.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/dag-topology/task-701-diamond-dependency/reviewer/expected.json b/fixtures/dag-topology/task-701-diamond-dependency/reviewer/expected.json new file mode 100644 index 0000000..c49cba1 --- /dev/null +++ b/fixtures/dag-topology/task-701-diamond-dependency/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Diamond dependency pattern correctly implemented with proper convergence at Task D.", + "path": "src/tasks/taskD.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/dag-topology/task-701-diamond-dependency/reviewer/prompt.md b/fixtures/dag-topology/task-701-diamond-dependency/reviewer/prompt.md new file mode 100644 index 0000000..07d90c4 --- /dev/null +++ b/fixtures/dag-topology/task-701-diamond-dependency/reviewer/prompt.md @@ -0,0 +1,17 @@ +You are the reviewer agent. + +Review a patch that implements a diamond dependency pattern. + +Pattern: +- Task A: root (no dependencies) +- Tasks B, C: depend on A +- Task D: depends on both B and C + +Your responsibilities: +- Verify the diamond structure is correct +- Ensure no circular dependencies +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/dag-topology/task-701-diamond-dependency/reviewer/verify.ts b/fixtures/dag-topology/task-701-diamond-dependency/reviewer/verify.ts new file mode 100644 index 0000000..a3dd0b3 --- /dev/null +++ b/fixtures/dag-topology/task-701-diamond-dependency/reviewer/verify.ts @@ -0,0 +1,18 @@ +import { + verifyReviewer, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyReviewer(ctx, (out) => { + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer must include at least one comment about the diamond pattern.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/dag-topology/task-702-parallel-independent/architect/expected.json b/fixtures/dag-topology/task-702-parallel-independent/architect/expected.json new file mode 100644 index 0000000..f4ef382 --- /dev/null +++ b/fixtures/dag-topology/task-702-parallel-independent/architect/expected.json @@ -0,0 +1,11 @@ +{ + "highLevelSummary": "Implement multiple parallel independent tasks with no dependencies between them, allowing all tasks to start immediately and maximize parallelism.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/parallel/taskX.ts", + "src/parallel/taskY.ts", + "src/parallel/taskZ.ts" + ] +} diff --git a/fixtures/dag-topology/task-702-parallel-independent/architect/prompt.md b/fixtures/dag-topology/task-702-parallel-independent/architect/prompt.md new file mode 100644 index 0000000..5aa12ec --- /dev/null +++ b/fixtures/dag-topology/task-702-parallel-independent/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for parallel independent tasks. + +The task involves: +- Multiple tasks that can run in parallel +- No dependencies between them +- All can start immediately + +Requirements: +- Describe the parallel execution structure +- Ensure tasks are truly independent +- Maximize parallelism + +Non-goals: +- Do not create unnecessary dependencies +- Do not serialize independent work diff --git a/fixtures/dag-topology/task-702-parallel-independent/architect/verify.ts b/fixtures/dag-topology/task-702-parallel-independent/architect/verify.ts new file mode 100644 index 0000000..06db79d --- /dev/null +++ b/fixtures/dag-topology/task-702-parallel-independent/architect/verify.ts @@ -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("parallel") && !summary.includes("independent")) { + return { + ok: false, + reason: "highLevelSummary must mention parallel or independent tasks", + }; + } + + if (spec.recommendedFileStructure.length < 2) { + return { + ok: false, + reason: "recommendedFileStructure must include multiple parallel tasks", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/dag-topology/task-702-parallel-independent/coder/expected.patch b/fixtures/dag-topology/task-702-parallel-independent/coder/expected.patch new file mode 100644 index 0000000..9c6dadc --- /dev/null +++ b/fixtures/dag-topology/task-702-parallel-independent/coder/expected.patch @@ -0,0 +1,30 @@ +diff --git a/src/parallel/taskX.ts b/src/parallel/taskX.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/parallel/taskX.ts +@@ -0,0 +1,4 @@ ++export async function taskX(): Promise { ++ console.log("Executing independent Task X"); ++ return "X"; ++} +diff --git a/src/parallel/taskY.ts b/src/parallel/taskY.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/parallel/taskY.ts +@@ -0,0 +1,4 @@ ++export async function taskY(): Promise { ++ console.log("Executing independent Task Y"); ++ return "Y"; ++} +diff --git a/src/parallel/taskZ.ts b/src/parallel/taskZ.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/parallel/taskZ.ts +@@ -0,0 +1,4 @@ ++export async function taskZ(): Promise { ++ console.log("Executing independent Task Z"); ++ return "Z"; ++} diff --git a/fixtures/dag-topology/task-702-parallel-independent/coder/prompt.md b/fixtures/dag-topology/task-702-parallel-independent/coder/prompt.md new file mode 100644 index 0000000..dda9df2 --- /dev/null +++ b/fixtures/dag-topology/task-702-parallel-independent/coder/prompt.md @@ -0,0 +1,10 @@ +You are the coder agent. Apply the architect and planner guidance to implement +parallel independent tasks. + +Requirements: +- Create src/parallel/taskX.ts (independent) +- Create src/parallel/taskY.ts (independent) +- Create src/parallel/taskZ.ts (independent) +- No dependencies between tasks + +Return a unified diff patch that implements the parallel tasks. diff --git a/fixtures/dag-topology/task-702-parallel-independent/coder/verify.ts b/fixtures/dag-topology/task-702-parallel-independent/coder/verify.ts new file mode 100644 index 0000000..8593df3 --- /dev/null +++ b/fixtures/dag-topology/task-702-parallel-independent/coder/verify.ts @@ -0,0 +1,29 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + const headerCount = (patch.match(/^diff --git /gm) || []).length; + if (headerCount < 2) { + return { + ok: false, + reason: "Patch must create at least 2 parallel task files.", + }; + } + + if (patch.includes("import") && patch.includes("from")) { + const importLines = patch.match(/import.*from.*task/gi) || []; + if (importLines.length > 0) { + return { + ok: false, + reason: "Parallel tasks should not import from each other.", + }; + } + } + + return { ok: true }; + }); +} diff --git a/fixtures/dag-topology/task-702-parallel-independent/planner/expected.json b/fixtures/dag-topology/task-702-parallel-independent/planner/expected.json new file mode 100644 index 0000000..e7be40d --- /dev/null +++ b/fixtures/dag-topology/task-702-parallel-independent/planner/expected.json @@ -0,0 +1,30 @@ +{ + "tasks": [ + { + "id": "task-x", + "description": "Implement independent task X", + "file": "src/parallel/taskX.ts", + "type": "feature", + "complexity": "low", + "dependsOn": [] + }, + { + "id": "task-y", + "description": "Implement independent task Y", + "file": "src/parallel/taskY.ts", + "type": "feature", + "complexity": "low", + "dependsOn": [] + }, + { + "id": "task-z", + "description": "Implement independent task Z", + "file": "src/parallel/taskZ.ts", + "type": "feature", + "complexity": "low", + "dependsOn": [] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/dag-topology/task-702-parallel-independent/planner/prompt.md b/fixtures/dag-topology/task-702-parallel-independent/planner/prompt.md new file mode 100644 index 0000000..50adf27 --- /dev/null +++ b/fixtures/dag-topology/task-702-parallel-independent/planner/prompt.md @@ -0,0 +1,6 @@ +Using the architect's spec for parallel independent tasks, produce a task list +with no dependencies between tasks. + +Requirements: +- Emit multiple tasks with empty dependsOn arrays +- All tasks can run in parallel diff --git a/fixtures/dag-topology/task-702-parallel-independent/planner/verify.ts b/fixtures/dag-topology/task-702-parallel-independent/planner/verify.ts new file mode 100644 index 0000000..d896a16 --- /dev/null +++ b/fixtures/dag-topology/task-702-parallel-independent/planner/verify.ts @@ -0,0 +1,26 @@ +import { + verifyPlanner, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyPlanner(ctx, (out) => { + if (out.tasks.length < 2) { + return { + ok: false, + reason: "Planner must emit at least 2 parallel tasks.", + }; + } + + const allIndependent = out.tasks.every((t) => t.dependsOn.length === 0); + if (!allIndependent) { + return { + ok: false, + reason: "All tasks must be independent with empty dependsOn arrays.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/dag-topology/task-702-parallel-independent/reviewer/expected.json b/fixtures/dag-topology/task-702-parallel-independent/reviewer/expected.json new file mode 100644 index 0000000..e69081c --- /dev/null +++ b/fixtures/dag-topology/task-702-parallel-independent/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Parallel independent tasks correctly implemented with no dependencies between them.", + "path": "src/parallel/taskX.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/dag-topology/task-702-parallel-independent/reviewer/prompt.md b/fixtures/dag-topology/task-702-parallel-independent/reviewer/prompt.md new file mode 100644 index 0000000..ef04c9a --- /dev/null +++ b/fixtures/dag-topology/task-702-parallel-independent/reviewer/prompt.md @@ -0,0 +1,16 @@ +You are the reviewer agent. + +Review a patch that implements parallel independent tasks. + +Requirements: +- All tasks should be independent with no dependencies +- Tasks can run in parallel + +Your responsibilities: +- Verify tasks are truly independent +- Ensure no unnecessary dependencies +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/dag-topology/task-702-parallel-independent/reviewer/verify.ts b/fixtures/dag-topology/task-702-parallel-independent/reviewer/verify.ts new file mode 100644 index 0000000..eb24d8b --- /dev/null +++ b/fixtures/dag-topology/task-702-parallel-independent/reviewer/verify.ts @@ -0,0 +1,18 @@ +import { + verifyReviewer, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyReviewer(ctx, (out) => { + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer must include at least one comment about parallel tasks.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/dag-topology/task-703-sequential-chain/architect/expected.json b/fixtures/dag-topology/task-703-sequential-chain/architect/expected.json new file mode 100644 index 0000000..cb4f7e1 --- /dev/null +++ b/fixtures/dag-topology/task-703-sequential-chain/architect/expected.json @@ -0,0 +1,12 @@ +{ + "highLevelSummary": "Implement a sequential chain of tasks where each task depends on the previous one (Task 1 → Task 2 → Task 3 → Task 4), ensuring strict sequential execution with no parallel branches.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/chain/step1.ts", + "src/chain/step2.ts", + "src/chain/step3.ts", + "src/chain/step4.ts" + ] +} diff --git a/fixtures/dag-topology/task-703-sequential-chain/architect/prompt.md b/fixtures/dag-topology/task-703-sequential-chain/architect/prompt.md new file mode 100644 index 0000000..2800a3a --- /dev/null +++ b/fixtures/dag-topology/task-703-sequential-chain/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for a sequential chain of tasks. + +The task involves: +- Task 1 → Task 2 → Task 3 → Task 4 +- Each task depends on the previous one +- Strict sequential execution required + +Requirements: +- Describe the sequential chain structure +- Ensure proper execution order +- No parallel execution allowed + +Non-goals: +- Do not skip tasks in the chain +- Do not create parallel branches diff --git a/fixtures/dag-topology/task-703-sequential-chain/architect/verify.ts b/fixtures/dag-topology/task-703-sequential-chain/architect/verify.ts new file mode 100644 index 0000000..29df38d --- /dev/null +++ b/fixtures/dag-topology/task-703-sequential-chain/architect/verify.ts @@ -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("sequential") && !summary.includes("chain")) { + return { + ok: false, + reason: "highLevelSummary must mention sequential chain", + }; + } + + if (spec.recommendedFileStructure.length < 3) { + return { + ok: false, + reason: "recommendedFileStructure must include multiple steps for chain", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/dag-topology/task-703-sequential-chain/coder/expected.patch b/fixtures/dag-topology/task-703-sequential-chain/coder/expected.patch new file mode 100644 index 0000000..8e1764b --- /dev/null +++ b/fixtures/dag-topology/task-703-sequential-chain/coder/expected.patch @@ -0,0 +1,49 @@ +diff --git a/src/chain/step1.ts b/src/chain/step1.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/chain/step1.ts +@@ -0,0 +1,4 @@ ++export async function step1(): Promise { ++ console.log("Executing Step 1"); ++ return 1; ++} +diff --git a/src/chain/step2.ts b/src/chain/step2.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/chain/step2.ts +@@ -0,0 +1,6 @@ ++import { step1 } from "./step1"; ++ ++export async function step2(): Promise { ++ const prev = await step1(); ++ console.log("Executing Step 2"); ++ return prev + 1; ++} +diff --git a/src/chain/step3.ts b/src/chain/step3.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/chain/step3.ts +@@ -0,0 +1,6 @@ ++import { step2 } from "./step2"; ++ ++export async function step3(): Promise { ++ const prev = await step2(); ++ console.log("Executing Step 3"); ++ return prev + 1; ++} +diff --git a/src/chain/step4.ts b/src/chain/step4.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/chain/step4.ts +@@ -0,0 +1,6 @@ ++import { step3 } from "./step3"; ++ ++export async function step4(): Promise { ++ const prev = await step3(); ++ console.log("Executing Step 4"); ++ return prev + 1; ++} diff --git a/fixtures/dag-topology/task-703-sequential-chain/coder/prompt.md b/fixtures/dag-topology/task-703-sequential-chain/coder/prompt.md new file mode 100644 index 0000000..36fb8fd --- /dev/null +++ b/fixtures/dag-topology/task-703-sequential-chain/coder/prompt.md @@ -0,0 +1,10 @@ +You are the coder agent. Apply the architect and planner guidance to implement +a sequential chain of tasks. + +Requirements: +- Create src/chain/step1.ts (root) +- Create src/chain/step2.ts (depends on step1) +- Create src/chain/step3.ts (depends on step2) +- Create src/chain/step4.ts (depends on step3) + +Return a unified diff patch that implements the sequential chain. diff --git a/fixtures/dag-topology/task-703-sequential-chain/coder/verify.ts b/fixtures/dag-topology/task-703-sequential-chain/coder/verify.ts new file mode 100644 index 0000000..101013f --- /dev/null +++ b/fixtures/dag-topology/task-703-sequential-chain/coder/verify.ts @@ -0,0 +1,26 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + const headerCount = (patch.match(/^diff --git /gm) || []).length; + if (headerCount < 3) { + return { + ok: false, + reason: "Patch must create at least 3 files for sequential chain.", + }; + } + + if (!patch.includes("step1") || !patch.includes("step4")) { + return { + ok: false, + reason: "Patch must include first and last steps of the chain.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/dag-topology/task-703-sequential-chain/planner/expected.json b/fixtures/dag-topology/task-703-sequential-chain/planner/expected.json new file mode 100644 index 0000000..fbd6efa --- /dev/null +++ b/fixtures/dag-topology/task-703-sequential-chain/planner/expected.json @@ -0,0 +1,38 @@ +{ + "tasks": [ + { + "id": "step-1", + "description": "Implement step 1 of the sequential chain", + "file": "src/chain/step1.ts", + "type": "feature", + "complexity": "low", + "dependsOn": [] + }, + { + "id": "step-2", + "description": "Implement step 2 depending on step 1", + "file": "src/chain/step2.ts", + "type": "feature", + "complexity": "low", + "dependsOn": ["step-1"] + }, + { + "id": "step-3", + "description": "Implement step 3 depending on step 2", + "file": "src/chain/step3.ts", + "type": "feature", + "complexity": "low", + "dependsOn": ["step-2"] + }, + { + "id": "step-4", + "description": "Implement step 4 depending on step 3", + "file": "src/chain/step4.ts", + "type": "feature", + "complexity": "low", + "dependsOn": ["step-3"] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/dag-topology/task-703-sequential-chain/planner/prompt.md b/fixtures/dag-topology/task-703-sequential-chain/planner/prompt.md new file mode 100644 index 0000000..fed29f9 --- /dev/null +++ b/fixtures/dag-topology/task-703-sequential-chain/planner/prompt.md @@ -0,0 +1,8 @@ +Using the architect's spec for a sequential chain, produce a task list +with strict sequential dependencies. + +Chain: Task 1 → Task 2 → Task 3 → Task 4 + +Requirements: +- Each task depends on the previous one +- No parallel execution diff --git a/fixtures/dag-topology/task-703-sequential-chain/planner/verify.ts b/fixtures/dag-topology/task-703-sequential-chain/planner/verify.ts new file mode 100644 index 0000000..b73d897 --- /dev/null +++ b/fixtures/dag-topology/task-703-sequential-chain/planner/verify.ts @@ -0,0 +1,34 @@ +import { + verifyPlanner, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyPlanner(ctx, (out) => { + if (out.tasks.length < 3) { + return { + ok: false, + reason: "Planner must emit at least 3 tasks for sequential chain.", + }; + } + + const hasRoot = out.tasks.some((t) => t.dependsOn.length === 0); + if (!hasRoot) { + return { + ok: false, + reason: "Chain must have a root task with no dependencies.", + }; + } + + const hasSequentialDeps = out.tasks.filter((t) => t.dependsOn.length === 1).length >= 2; + if (!hasSequentialDeps) { + return { + ok: false, + reason: "Chain must have sequential dependencies (each task depends on one previous task).", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/dag-topology/task-703-sequential-chain/reviewer/expected.json b/fixtures/dag-topology/task-703-sequential-chain/reviewer/expected.json new file mode 100644 index 0000000..4af2d8b --- /dev/null +++ b/fixtures/dag-topology/task-703-sequential-chain/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Sequential chain correctly implemented with proper dependencies between steps.", + "path": "src/chain/step4.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/dag-topology/task-703-sequential-chain/reviewer/prompt.md b/fixtures/dag-topology/task-703-sequential-chain/reviewer/prompt.md new file mode 100644 index 0000000..30ea24a --- /dev/null +++ b/fixtures/dag-topology/task-703-sequential-chain/reviewer/prompt.md @@ -0,0 +1,14 @@ +You are the reviewer agent. + +Review a patch that implements a sequential chain of tasks. + +Chain: Step 1 → Step 2 → Step 3 → Step 4 + +Your responsibilities: +- Verify the sequential structure is correct +- Ensure each step depends on the previous one +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/dag-topology/task-703-sequential-chain/reviewer/verify.ts b/fixtures/dag-topology/task-703-sequential-chain/reviewer/verify.ts new file mode 100644 index 0000000..0fdcb7b --- /dev/null +++ b/fixtures/dag-topology/task-703-sequential-chain/reviewer/verify.ts @@ -0,0 +1,18 @@ +import { + verifyReviewer, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyReviewer(ctx, (out) => { + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer must include at least one comment about the sequential chain.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/dag-topology/task-713-cycle-detection/architect/expected.json b/fixtures/dag-topology/task-713-cycle-detection/architect/expected.json new file mode 100644 index 0000000..1ad047e --- /dev/null +++ b/fixtures/dag-topology/task-713-cycle-detection/architect/expected.json @@ -0,0 +1,10 @@ +{ + "highLevelSummary": "Implement cycle detection for task dependencies to prevent circular dependencies and provide clear error messages when cycles are detected in the task graph.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/graph/cycleDetector.ts", + "src/graph/types.ts" + ] +} diff --git a/fixtures/dag-topology/task-713-cycle-detection/architect/prompt.md b/fixtures/dag-topology/task-713-cycle-detection/architect/prompt.md new file mode 100644 index 0000000..7bf26af --- /dev/null +++ b/fixtures/dag-topology/task-713-cycle-detection/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for cycle detection in task dependencies. + +The task involves: +- Detecting circular dependencies in task graphs +- Preventing cycles from being created +- Reporting cycle errors clearly + +Requirements: +- Describe the cycle detection approach +- Handle various cycle patterns (A→B→A, A→B→C→A, etc.) +- Provide clear error messages + +Non-goals: +- Do not allow cycles to be created +- Do not silently ignore cycles diff --git a/fixtures/dag-topology/task-713-cycle-detection/architect/verify.ts b/fixtures/dag-topology/task-713-cycle-detection/architect/verify.ts new file mode 100644 index 0000000..86bbb46 --- /dev/null +++ b/fixtures/dag-topology/task-713-cycle-detection/architect/verify.ts @@ -0,0 +1,20 @@ +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("cycle") && !summary.includes("circular")) { + return { + ok: false, + reason: "highLevelSummary must mention cycle detection", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/dag-topology/task-713-cycle-detection/coder/expected.patch b/fixtures/dag-topology/task-713-cycle-detection/coder/expected.patch new file mode 100644 index 0000000..85ff1b1 --- /dev/null +++ b/fixtures/dag-topology/task-713-cycle-detection/coder/expected.patch @@ -0,0 +1,65 @@ +diff --git a/src/graph/types.ts b/src/graph/types.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/graph/types.ts +@@ -0,0 +1,9 @@ ++export interface TaskNode { ++ id: string; ++ dependsOn: string[]; ++} ++ ++export interface CycleError { ++ message: string; ++ cycle: string[]; ++} +diff --git a/src/graph/cycleDetector.ts b/src/graph/cycleDetector.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/graph/cycleDetector.ts +@@ -0,0 +1,35 @@ ++import { TaskNode, CycleError } from "./types"; ++ ++export function detectCycle(tasks: TaskNode[]): CycleError | null { ++ const taskMap = new Map(); ++ for (const task of tasks) { ++ taskMap.set(task.id, task); ++ } ++ ++ const visited = new Set(); ++ const recursionStack = new Set(); ++ const path: string[] = []; ++ ++ function dfs(nodeId: string): CycleError | null { ++ visited.add(nodeId); ++ recursionStack.add(nodeId); ++ path.push(nodeId); ++ ++ const node = taskMap.get(nodeId); ++ if (node) { ++ for (const dep of node.dependsOn) { ++ if (!visited.has(dep)) { ++ const result = dfs(dep); ++ if (result) return result; ++ } else if (recursionStack.has(dep)) { ++ const cycleStart = path.indexOf(dep); ++ return { message: "Cycle detected", cycle: path.slice(cycleStart) }; ++ } ++ } ++ } ++ ++ path.pop(); ++ recursionStack.delete(nodeId); ++ return null; ++ } ++ ++ for (const task of tasks) { ++ if (!visited.has(task.id)) { ++ const result = dfs(task.id); ++ if (result) return result; ++ } ++ } ++ ++ return null; ++} diff --git a/fixtures/dag-topology/task-713-cycle-detection/coder/prompt.md b/fixtures/dag-topology/task-713-cycle-detection/coder/prompt.md new file mode 100644 index 0000000..111f23a --- /dev/null +++ b/fixtures/dag-topology/task-713-cycle-detection/coder/prompt.md @@ -0,0 +1,8 @@ +You are the coder agent. Apply the architect and planner guidance to implement +cycle detection for task dependencies. + +Requirements: +- Create src/graph/types.ts with graph types +- Create src/graph/cycleDetector.ts with cycle detection algorithm + +Return a unified diff patch that implements cycle detection. diff --git a/fixtures/dag-topology/task-713-cycle-detection/coder/verify.ts b/fixtures/dag-topology/task-713-cycle-detection/coder/verify.ts new file mode 100644 index 0000000..5fa55a7 --- /dev/null +++ b/fixtures/dag-topology/task-713-cycle-detection/coder/verify.ts @@ -0,0 +1,25 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("cycleDetector") && !patch.includes("cycle")) { + return { + ok: false, + reason: "Patch must include cycle detection implementation.", + }; + } + + if (!patch.includes("detectCycle") && !patch.includes("dfs")) { + return { + ok: false, + reason: "Patch must include cycle detection function.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/dag-topology/task-713-cycle-detection/planner/expected.json b/fixtures/dag-topology/task-713-cycle-detection/planner/expected.json new file mode 100644 index 0000000..9f312f8 --- /dev/null +++ b/fixtures/dag-topology/task-713-cycle-detection/planner/expected.json @@ -0,0 +1,22 @@ +{ + "tasks": [ + { + "id": "define-types", + "description": "Define types for task graph nodes and edges", + "file": "src/graph/types.ts", + "type": "feature", + "complexity": "low", + "dependsOn": [] + }, + { + "id": "implement-cycle-detector", + "description": "Implement cycle detection algorithm using DFS", + "file": "src/graph/cycleDetector.ts", + "type": "feature", + "complexity": "medium", + "dependsOn": ["define-types"] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/dag-topology/task-713-cycle-detection/planner/prompt.md b/fixtures/dag-topology/task-713-cycle-detection/planner/prompt.md new file mode 100644 index 0000000..f7f09e1 --- /dev/null +++ b/fixtures/dag-topology/task-713-cycle-detection/planner/prompt.md @@ -0,0 +1,7 @@ +Using the architect's spec for cycle detection, produce a task list +for implementing cycle detection in task dependencies. + +Requirements: +- Implement cycle detection algorithm +- Handle various cycle patterns +- Provide clear error messages diff --git a/fixtures/dag-topology/task-713-cycle-detection/planner/verify.ts b/fixtures/dag-topology/task-713-cycle-detection/planner/verify.ts new file mode 100644 index 0000000..f59302b --- /dev/null +++ b/fixtures/dag-topology/task-713-cycle-detection/planner/verify.ts @@ -0,0 +1,30 @@ +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 at least 1 task for cycle detection.", + }; + } + + const hasCycleTask = out.tasks.some( + (t) => + t.description.toLowerCase().includes("cycle") || + t.file.toLowerCase().includes("cycle") + ); + if (!hasCycleTask) { + return { + ok: false, + reason: "Planner must include a task for cycle detection.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/dag-topology/task-713-cycle-detection/reviewer/expected.json b/fixtures/dag-topology/task-713-cycle-detection/reviewer/expected.json new file mode 100644 index 0000000..c3a44f6 --- /dev/null +++ b/fixtures/dag-topology/task-713-cycle-detection/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Cycle detection algorithm correctly implemented using DFS with proper error reporting.", + "path": "src/graph/cycleDetector.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/dag-topology/task-713-cycle-detection/reviewer/prompt.md b/fixtures/dag-topology/task-713-cycle-detection/reviewer/prompt.md new file mode 100644 index 0000000..bee93d1 --- /dev/null +++ b/fixtures/dag-topology/task-713-cycle-detection/reviewer/prompt.md @@ -0,0 +1,12 @@ +You are the reviewer agent. + +Review a patch that implements cycle detection for task dependencies. + +Your responsibilities: +- Verify the cycle detection algorithm is correct +- Ensure clear error messages are provided +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/dag-topology/task-713-cycle-detection/reviewer/verify.ts b/fixtures/dag-topology/task-713-cycle-detection/reviewer/verify.ts new file mode 100644 index 0000000..9dc3f93 --- /dev/null +++ b/fixtures/dag-topology/task-713-cycle-detection/reviewer/verify.ts @@ -0,0 +1,18 @@ +import { + verifyReviewer, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyReviewer(ctx, (out) => { + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer must include at least one comment about cycle detection.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/architect/expected.json b/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/architect/expected.json new file mode 100644 index 0000000..bc414c2 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/architect/expected.json @@ -0,0 +1,10 @@ +{ + "highLevelSummary": "Implement forbidden path detection to prevent modifications to protected directories like dist/, node_modules/, .git/, and provide clear error messages when violations are detected.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/validation/forbiddenPaths.ts", + "src/validation/pathMatcher.ts" + ] +} diff --git a/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/architect/prompt.md b/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/architect/prompt.md new file mode 100644 index 0000000..aee4210 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for forbidden path detection. + +The task involves: +- Detecting edits to forbidden paths (dist/, node_modules/, .git/, etc.) +- Preventing modifications to protected files +- Reporting violations clearly + +Requirements: +- Define the list of forbidden paths +- Implement path matching logic +- Provide clear error messages + +Non-goals: +- Do not allow edits to forbidden paths +- Do not silently ignore violations diff --git a/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/architect/verify.ts b/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/architect/verify.ts new file mode 100644 index 0000000..c2220b8 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/architect/verify.ts @@ -0,0 +1,20 @@ +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("forbidden") && !summary.includes("protected")) { + return { + ok: false, + reason: "highLevelSummary must mention forbidden or protected paths", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/coder/expected.patch b/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/coder/expected.patch new file mode 100644 index 0000000..85628a5 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/coder/expected.patch @@ -0,0 +1,42 @@ +diff --git a/src/validation/forbiddenPaths.ts b/src/validation/forbiddenPaths.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/validation/forbiddenPaths.ts +@@ -0,0 +1,10 @@ ++export const FORBIDDEN_PATHS = [ ++ "dist/", ++ "node_modules/", ++ ".git/", ++ ".swarm/", ++ "build/", ++ ".env", ++]; ++ ++export type ForbiddenPath = (typeof FORBIDDEN_PATHS)[number]; +diff --git a/src/validation/pathMatcher.ts b/src/validation/pathMatcher.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/validation/pathMatcher.ts +@@ -0,0 +1,20 @@ ++import { FORBIDDEN_PATHS } from "./forbiddenPaths"; ++ ++export interface PathViolation { ++ path: string; ++ matchedForbidden: string; ++ message: string; ++} ++ ++export function checkForbiddenPath(path: string): PathViolation | null { ++ for (const forbidden of FORBIDDEN_PATHS) { ++ if (path.startsWith(forbidden) || path.includes(`/${forbidden}`)) { ++ return { ++ path, ++ matchedForbidden: forbidden, ++ message: `Path "${path}" is forbidden: matches "${forbidden}"`, ++ }; ++ } ++ } ++ return null; ++} diff --git a/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/coder/prompt.md b/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/coder/prompt.md new file mode 100644 index 0000000..c0df5d4 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/coder/prompt.md @@ -0,0 +1,8 @@ +You are the coder agent. Apply the architect and planner guidance to implement +forbidden path detection. + +Requirements: +- Create src/validation/forbiddenPaths.ts with forbidden paths list +- Create src/validation/pathMatcher.ts with path matching logic + +Return a unified diff patch that implements forbidden path detection. diff --git a/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/coder/verify.ts b/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/coder/verify.ts new file mode 100644 index 0000000..45fa4cf --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/coder/verify.ts @@ -0,0 +1,25 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("forbiddenPaths") && !patch.includes("FORBIDDEN")) { + return { + ok: false, + reason: "Patch must include forbidden paths definition.", + }; + } + + if (!patch.includes("checkForbiddenPath") && !patch.includes("pathMatcher")) { + return { + ok: false, + reason: "Patch must include path matching logic.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/planner/expected.json b/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/planner/expected.json new file mode 100644 index 0000000..df2f2a7 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/planner/expected.json @@ -0,0 +1,22 @@ +{ + "tasks": [ + { + "id": "define-forbidden-paths", + "description": "Define the list of forbidden paths (dist/, node_modules/, .git/, etc.)", + "file": "src/validation/forbiddenPaths.ts", + "type": "feature", + "complexity": "low", + "dependsOn": [] + }, + { + "id": "implement-path-matcher", + "description": "Implement path matching logic to detect forbidden path violations", + "file": "src/validation/pathMatcher.ts", + "type": "feature", + "complexity": "medium", + "dependsOn": ["define-forbidden-paths"] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/planner/prompt.md b/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/planner/prompt.md new file mode 100644 index 0000000..2e09120 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/planner/prompt.md @@ -0,0 +1,7 @@ +Using the architect's spec for forbidden path detection, produce a task list +for implementing path validation. + +Requirements: +- Define forbidden paths list +- Implement path matching logic +- Provide clear error messages diff --git a/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/planner/verify.ts b/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/planner/verify.ts new file mode 100644 index 0000000..13c1a89 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/planner/verify.ts @@ -0,0 +1,30 @@ +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 at least 1 task for forbidden path detection.", + }; + } + + const hasForbiddenTask = out.tasks.some( + (t) => + t.description.toLowerCase().includes("forbidden") || + t.file.toLowerCase().includes("forbidden") + ); + if (!hasForbiddenTask) { + return { + ok: false, + reason: "Planner must include a task for forbidden path handling.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/reviewer/expected.json b/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/reviewer/expected.json new file mode 100644 index 0000000..8ba904f --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Forbidden path detection correctly implemented with comprehensive path list and clear error messages.", + "path": "src/validation/pathMatcher.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/reviewer/prompt.md b/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/reviewer/prompt.md new file mode 100644 index 0000000..061247b --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/reviewer/prompt.md @@ -0,0 +1,12 @@ +You are the reviewer agent. + +Review a patch that implements forbidden path detection. + +Your responsibilities: +- Verify the forbidden paths list is comprehensive +- Ensure path matching logic is correct +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/reviewer/verify.ts b/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/reviewer/verify.ts new file mode 100644 index 0000000..dcc6f1b --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-801-forbidden-path-detection/reviewer/verify.ts @@ -0,0 +1,18 @@ +import { + verifyReviewer, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyReviewer(ctx, (out) => { + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer must include at least one comment about forbidden path detection.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/architect/expected.json b/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/architect/expected.json new file mode 100644 index 0000000..bc0f049 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/architect/expected.json @@ -0,0 +1,10 @@ +{ + "highLevelSummary": "Implement provenance tracking to record the origin of code changes, including who made changes and when, maintaining an audit trail for compliance and supporting change history queries.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/provenance/tracker.ts", + "src/provenance/types.ts" + ] +} diff --git a/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/architect/prompt.md b/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/architect/prompt.md new file mode 100644 index 0000000..5a4ba2e --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for provenance tracking. + +The task involves: +- Tracking the origin of code changes +- Recording who made changes and when +- Maintaining audit trail for compliance + +Requirements: +- Describe the provenance tracking approach +- Include metadata for each change +- Support querying change history + +Non-goals: +- Do not modify the actual code +- Do not store sensitive information diff --git a/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/architect/verify.ts b/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/architect/verify.ts new file mode 100644 index 0000000..8464b19 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/architect/verify.ts @@ -0,0 +1,20 @@ +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("provenance") && !summary.includes("tracking")) { + return { + ok: false, + reason: "highLevelSummary must mention provenance or tracking", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/coder/expected.patch b/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/coder/expected.patch new file mode 100644 index 0000000..b8860b8 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/coder/expected.patch @@ -0,0 +1,51 @@ +diff --git a/src/provenance/types.ts b/src/provenance/types.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/provenance/types.ts +@@ -0,0 +1,12 @@ ++export interface ProvenanceRecord { ++ id: string; ++ file: string; ++ author: string; ++ timestamp: Date; ++ changeType: "create" | "modify" | "delete"; ++ description: string; ++} ++ ++export interface ProvenanceQuery { ++ file?: string; ++ author?: string; ++ since?: Date; ++} +diff --git a/src/provenance/tracker.ts b/src/provenance/tracker.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/provenance/tracker.ts +@@ -0,0 +1,25 @@ ++import { ProvenanceRecord, ProvenanceQuery } from "./types"; ++ ++const records: ProvenanceRecord[] = []; ++ ++export function recordChange(record: Omit): ProvenanceRecord { ++ const newRecord: ProvenanceRecord = { ++ ...record, ++ id: `prov-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`, ++ }; ++ records.push(newRecord); ++ return newRecord; ++} ++ ++export function queryChanges(query: ProvenanceQuery): ProvenanceRecord[] { ++ return records.filter((r) => { ++ if (query.file && r.file !== query.file) return false; ++ if (query.author && r.author !== query.author) return false; ++ if (query.since && r.timestamp < query.since) return false; ++ return true; ++ }); ++} ++ ++export function getChangeHistory(file: string): ProvenanceRecord[] { ++ return queryChanges({ file }).sort((a, b) => b.timestamp.getTime() - a.timestamp.getTime()); ++} diff --git a/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/coder/prompt.md b/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/coder/prompt.md new file mode 100644 index 0000000..6130615 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/coder/prompt.md @@ -0,0 +1,8 @@ +You are the coder agent. Apply the architect and planner guidance to implement +provenance tracking. + +Requirements: +- Create src/provenance/types.ts with provenance types +- Create src/provenance/tracker.ts with tracking logic + +Return a unified diff patch that implements provenance tracking. diff --git a/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/coder/verify.ts b/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/coder/verify.ts new file mode 100644 index 0000000..6e728c6 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/coder/verify.ts @@ -0,0 +1,25 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("ProvenanceRecord") && !patch.includes("provenance")) { + return { + ok: false, + reason: "Patch must include provenance types.", + }; + } + + if (!patch.includes("recordChange") && !patch.includes("tracker")) { + return { + ok: false, + reason: "Patch must include tracking logic.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/planner/expected.json b/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/planner/expected.json new file mode 100644 index 0000000..2ea1848 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/planner/expected.json @@ -0,0 +1,22 @@ +{ + "tasks": [ + { + "id": "define-provenance-types", + "description": "Define types for provenance records and metadata", + "file": "src/provenance/types.ts", + "type": "feature", + "complexity": "low", + "dependsOn": [] + }, + { + "id": "implement-tracker", + "description": "Implement provenance tracker to record and query changes", + "file": "src/provenance/tracker.ts", + "type": "feature", + "complexity": "medium", + "dependsOn": ["define-provenance-types"] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/planner/prompt.md b/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/planner/prompt.md new file mode 100644 index 0000000..06326e9 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/planner/prompt.md @@ -0,0 +1,7 @@ +Using the architect's spec for provenance tracking, produce a task list +for implementing change tracking. + +Requirements: +- Define provenance types +- Implement tracking logic +- Support querying change history diff --git a/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/planner/verify.ts b/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/planner/verify.ts new file mode 100644 index 0000000..e742e72 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/planner/verify.ts @@ -0,0 +1,30 @@ +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 at least 1 task for provenance tracking.", + }; + } + + const hasProvenanceTask = out.tasks.some( + (t) => + t.description.toLowerCase().includes("provenance") || + t.file.toLowerCase().includes("provenance") + ); + if (!hasProvenanceTask) { + return { + ok: false, + reason: "Planner must include a task for provenance handling.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/reviewer/expected.json b/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/reviewer/expected.json new file mode 100644 index 0000000..e10cc4f --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Provenance tracking correctly implemented with comprehensive types and query support.", + "path": "src/provenance/tracker.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/reviewer/prompt.md b/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/reviewer/prompt.md new file mode 100644 index 0000000..c658b88 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/reviewer/prompt.md @@ -0,0 +1,12 @@ +You are the reviewer agent. + +Review a patch that implements provenance tracking. + +Your responsibilities: +- Verify the provenance types are comprehensive +- Ensure tracking logic is correct +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/reviewer/verify.ts b/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/reviewer/verify.ts new file mode 100644 index 0000000..c0d8720 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-802-provenance-tracking/reviewer/verify.ts @@ -0,0 +1,18 @@ +import { + verifyReviewer, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyReviewer(ctx, (out) => { + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer must include at least one comment about provenance tracking.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/architect/expected.json b/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/architect/expected.json new file mode 100644 index 0000000..3fd1808 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/architect/expected.json @@ -0,0 +1,10 @@ +{ + "highLevelSummary": "Implement edge case handling for path validation including symlinks, relative paths, special characters, and cross-platform differences with proper path normalization.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/validation/pathNormalizer.ts", + "src/validation/edgeCases.ts" + ] +} diff --git a/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/architect/prompt.md b/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/architect/prompt.md new file mode 100644 index 0000000..154db42 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for edge case handling in path validation. + +The task involves: +- Handling edge cases like symlinks, relative paths, and special characters +- Normalizing paths before validation +- Handling cross-platform path differences + +Requirements: +- Describe edge case handling approach +- Include path normalization +- Handle platform-specific differences + +Non-goals: +- Do not allow bypassing validation through edge cases +- Do not silently ignore malformed paths diff --git a/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/architect/verify.ts b/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/architect/verify.ts new file mode 100644 index 0000000..6e10491 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/architect/verify.ts @@ -0,0 +1,20 @@ +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("edge") && !summary.includes("normali")) { + return { + ok: false, + reason: "highLevelSummary must mention edge cases or normalization", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/coder/expected.patch b/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/coder/expected.patch new file mode 100644 index 0000000..5f0c176 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/coder/expected.patch @@ -0,0 +1,56 @@ +diff --git a/src/validation/pathNormalizer.ts b/src/validation/pathNormalizer.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/validation/pathNormalizer.ts +@@ -0,0 +1,20 @@ ++import * as path from "path"; ++ ++export function normalizePath(inputPath: string): string { ++ // Convert backslashes to forward slashes for cross-platform support ++ let normalized = inputPath.replace(/\\/g, "/"); ++ ++ // Remove leading ./ ++ normalized = normalized.replace(/^\.\//, ""); ++ ++ // Resolve .. and . segments ++ normalized = path.posix.normalize(normalized); ++ ++ // Remove trailing slashes except for root ++ if (normalized.length > 1 && normalized.endsWith("/")) { ++ normalized = normalized.slice(0, -1); ++ } ++ ++ return normalized; ++} +diff --git a/src/validation/edgeCases.ts b/src/validation/edgeCases.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/validation/edgeCases.ts +@@ -0,0 +1,25 @@ ++import { normalizePath } from "./pathNormalizer"; ++ ++export interface EdgeCaseResult { ++ isValid: boolean; ++ normalizedPath: string; ++ warnings: string[]; ++} ++ ++export function handleEdgeCases(inputPath: string): EdgeCaseResult { ++ const warnings: string[] = []; ++ ++ // Check for special characters that might cause issues ++ if (/[<>:"|?*]/.test(inputPath)) { ++ warnings.push("Path contains special characters that may not be portable"); ++ } ++ ++ // Check for potential symlink traversal ++ if (inputPath.includes("..")) { ++ warnings.push("Path contains parent directory references"); ++ } ++ ++ const normalizedPath = normalizePath(inputPath); ++ ++ return { isValid: true, normalizedPath, warnings }; ++} diff --git a/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/coder/prompt.md b/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/coder/prompt.md new file mode 100644 index 0000000..5c86abc --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/coder/prompt.md @@ -0,0 +1,8 @@ +You are the coder agent. Apply the architect and planner guidance to implement +edge case handling for path validation. + +Requirements: +- Create src/validation/pathNormalizer.ts with path normalization +- Create src/validation/edgeCases.ts with edge case handling + +Return a unified diff patch that implements edge case handling. diff --git a/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/coder/verify.ts b/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/coder/verify.ts new file mode 100644 index 0000000..14c4bc9 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/coder/verify.ts @@ -0,0 +1,25 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("normalizePath") && !patch.includes("pathNormalizer")) { + return { + ok: false, + reason: "Patch must include path normalization.", + }; + } + + if (!patch.includes("edgeCases") && !patch.includes("handleEdgeCases")) { + return { + ok: false, + reason: "Patch must include edge case handling.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/planner/expected.json b/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/planner/expected.json new file mode 100644 index 0000000..faa9b30 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/planner/expected.json @@ -0,0 +1,22 @@ +{ + "tasks": [ + { + "id": "implement-path-normalizer", + "description": "Implement path normalization to handle relative paths and special characters", + "file": "src/validation/pathNormalizer.ts", + "type": "feature", + "complexity": "medium", + "dependsOn": [] + }, + { + "id": "implement-edge-cases", + "description": "Implement edge case handling for symlinks and cross-platform differences", + "file": "src/validation/edgeCases.ts", + "type": "feature", + "complexity": "medium", + "dependsOn": ["implement-path-normalizer"] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/planner/prompt.md b/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/planner/prompt.md new file mode 100644 index 0000000..6c3425a --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/planner/prompt.md @@ -0,0 +1,7 @@ +Using the architect's spec for edge case handling, produce a task list +for implementing path normalization and edge case handling. + +Requirements: +- Implement path normalization +- Handle symlinks, relative paths, special characters +- Handle cross-platform differences diff --git a/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/planner/verify.ts b/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/planner/verify.ts new file mode 100644 index 0000000..c7141a0 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/planner/verify.ts @@ -0,0 +1,32 @@ +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 at least 1 task for edge case handling.", + }; + } + + const hasEdgeTask = out.tasks.some( + (t) => + t.description.toLowerCase().includes("edge") || + t.description.toLowerCase().includes("normal") || + t.file.toLowerCase().includes("edge") || + t.file.toLowerCase().includes("normal") + ); + if (!hasEdgeTask) { + return { + ok: false, + reason: "Planner must include a task for edge case or normalization handling.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/reviewer/expected.json b/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/reviewer/expected.json new file mode 100644 index 0000000..1d436da --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Edge case handling correctly implemented with proper path normalization and cross-platform support.", + "path": "src/validation/edgeCases.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/reviewer/prompt.md b/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/reviewer/prompt.md new file mode 100644 index 0000000..6f17b87 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/reviewer/prompt.md @@ -0,0 +1,12 @@ +You are the reviewer agent. + +Review a patch that implements edge case handling for path validation. + +Your responsibilities: +- Verify path normalization is correct +- Ensure edge cases are handled properly +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/reviewer/verify.ts b/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/reviewer/verify.ts new file mode 100644 index 0000000..98d5d22 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-803-edge-case-handling/reviewer/verify.ts @@ -0,0 +1,18 @@ +import { + verifyReviewer, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyReviewer(ctx, (out) => { + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer must include at least one comment about edge case handling.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/architect/expected.json b/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/architect/expected.json new file mode 100644 index 0000000..424aabd --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/architect/expected.json @@ -0,0 +1,10 @@ +{ + "highLevelSummary": "Implement sensitive config protection to prevent accidental exposure of secrets in files like .env and credentials.json, with detection logic and clear warnings for potential leaks.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/security/sensitivePatterns.ts", + "src/security/secretDetector.ts" + ] +} diff --git a/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/architect/prompt.md b/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/architect/prompt.md new file mode 100644 index 0000000..d5b677e --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for sensitive config protection. + +The task involves: +- Protecting sensitive configuration files (.env, credentials.json, etc.) +- Preventing accidental exposure of secrets +- Detecting potential secret leaks in patches + +Requirements: +- Define sensitive file patterns +- Implement detection logic +- Provide clear warnings + +Non-goals: +- Do not allow commits of sensitive files +- Do not silently ignore potential leaks diff --git a/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/architect/verify.ts b/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/architect/verify.ts new file mode 100644 index 0000000..30c765a --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/architect/verify.ts @@ -0,0 +1,20 @@ +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("sensitive") && !summary.includes("secret")) { + return { + ok: false, + reason: "highLevelSummary must mention sensitive files or secrets", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/coder/expected.patch b/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/coder/expected.patch new file mode 100644 index 0000000..7f56b80 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/coder/expected.patch @@ -0,0 +1,61 @@ +diff --git a/src/security/sensitivePatterns.ts b/src/security/sensitivePatterns.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/security/sensitivePatterns.ts +@@ -0,0 +1,15 @@ ++export const SENSITIVE_FILE_PATTERNS = [ ++ ".env", ++ ".env.local", ++ ".env.production", ++ "credentials.json", ++ "secrets.json", ++ "*.pem", ++ "*.key", ++ "id_rsa", ++ "id_ed25519", ++]; ++ ++export const SECRET_PATTERNS = [ ++ /(?:api[_-]?key|apikey)\s*[:=]\s*['"]?[\w-]+['"]?/i, ++ /(?:password|passwd|pwd)\s*[:=]\s*['"]?[^'"]+['"]?/i, ++ /(?:secret|token)\s*[:=]\s*['"]?[\w-]+['"]?/i, ++]; +diff --git a/src/security/secretDetector.ts b/src/security/secretDetector.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/security/secretDetector.ts +@@ -0,0 +1,30 @@ ++import { SENSITIVE_FILE_PATTERNS, SECRET_PATTERNS } from "./sensitivePatterns"; ++ ++export interface SecretWarning { ++ type: "sensitive_file" | "potential_secret"; ++ path: string; ++ line?: number; ++ message: string; ++} ++ ++export function isSensitiveFile(path: string): boolean { ++ return SENSITIVE_FILE_PATTERNS.some((pattern) => { ++ if (pattern.includes("*")) { ++ const regex = new RegExp(pattern.replace("*", ".*")); ++ return regex.test(path); ++ } ++ return path.endsWith(pattern) || path.includes(`/${pattern}`); ++ }); ++} ++ ++export function detectSecrets(content: string, path: string): SecretWarning[] { ++ const warnings: SecretWarning[] = []; ++ ++ if (isSensitiveFile(path)) { ++ warnings.push({ ++ type: "sensitive_file", ++ path, ++ message: `File "${path}" is a sensitive configuration file and should not be committed`, ++ }); ++ } ++ ++ return warnings; ++} diff --git a/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/coder/prompt.md b/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/coder/prompt.md new file mode 100644 index 0000000..855fc00 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/coder/prompt.md @@ -0,0 +1,8 @@ +You are the coder agent. Apply the architect and planner guidance to implement +sensitive config protection. + +Requirements: +- Create src/security/sensitivePatterns.ts with sensitive file patterns +- Create src/security/secretDetector.ts with detection logic + +Return a unified diff patch that implements sensitive config protection. diff --git a/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/coder/verify.ts b/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/coder/verify.ts new file mode 100644 index 0000000..5eba0a5 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/coder/verify.ts @@ -0,0 +1,25 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("sensitivePatterns") && !patch.includes("SENSITIVE")) { + return { + ok: false, + reason: "Patch must include sensitive patterns definition.", + }; + } + + if (!patch.includes("secretDetector") && !patch.includes("detectSecrets")) { + return { + ok: false, + reason: "Patch must include secret detection logic.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/planner/expected.json b/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/planner/expected.json new file mode 100644 index 0000000..778a17b --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/planner/expected.json @@ -0,0 +1,22 @@ +{ + "tasks": [ + { + "id": "define-sensitive-patterns", + "description": "Define patterns for sensitive files (.env, credentials.json, etc.)", + "file": "src/security/sensitivePatterns.ts", + "type": "feature", + "complexity": "low", + "dependsOn": [] + }, + { + "id": "implement-secret-detector", + "description": "Implement secret detection logic to identify potential leaks", + "file": "src/security/secretDetector.ts", + "type": "feature", + "complexity": "medium", + "dependsOn": ["define-sensitive-patterns"] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/planner/prompt.md b/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/planner/prompt.md new file mode 100644 index 0000000..8a8e2cb --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/planner/prompt.md @@ -0,0 +1,7 @@ +Using the architect's spec for sensitive config protection, produce a task list +for implementing secret detection. + +Requirements: +- Define sensitive file patterns +- Implement detection logic +- Provide clear warnings diff --git a/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/planner/verify.ts b/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/planner/verify.ts new file mode 100644 index 0000000..1d8096c --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/planner/verify.ts @@ -0,0 +1,32 @@ +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 at least 1 task for sensitive config protection.", + }; + } + + const hasSensitiveTask = out.tasks.some( + (t) => + t.description.toLowerCase().includes("sensitive") || + t.description.toLowerCase().includes("secret") || + t.file.toLowerCase().includes("sensitive") || + t.file.toLowerCase().includes("secret") + ); + if (!hasSensitiveTask) { + return { + ok: false, + reason: "Planner must include a task for sensitive file or secret handling.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/reviewer/expected.json b/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/reviewer/expected.json new file mode 100644 index 0000000..6e11562 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Sensitive config protection correctly implemented with comprehensive patterns and clear warnings.", + "path": "src/security/secretDetector.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/reviewer/prompt.md b/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/reviewer/prompt.md new file mode 100644 index 0000000..4f13ad1 --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/reviewer/prompt.md @@ -0,0 +1,12 @@ +You are the reviewer agent. + +Review a patch that implements sensitive config protection. + +Your responsibilities: +- Verify sensitive file patterns are comprehensive +- Ensure detection logic is correct +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/reviewer/verify.ts b/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/reviewer/verify.ts new file mode 100644 index 0000000..0a2a04c --- /dev/null +++ b/fixtures/forbidden-and-provenance-edge/task-804-sensitive-config-protection/reviewer/verify.ts @@ -0,0 +1,18 @@ +import { + verifyReviewer, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyReviewer(ctx, (out) => { + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer must include at least one comment about sensitive config protection.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/large-file-and-integrity/task-901-large-file-handling/architect/expected.json b/fixtures/large-file-and-integrity/task-901-large-file-handling/architect/expected.json new file mode 100644 index 0000000..4dfe6b9 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-901-large-file-handling/architect/expected.json @@ -0,0 +1,10 @@ +{ + "highLevelSummary": "Implement large file handling with chunked processing to avoid memory issues, including size thresholds and progress feedback for long operations.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/files/largeFileHandler.ts", + "src/files/chunkProcessor.ts" + ] +} diff --git a/fixtures/large-file-and-integrity/task-901-large-file-handling/architect/prompt.md b/fixtures/large-file-and-integrity/task-901-large-file-handling/architect/prompt.md new file mode 100644 index 0000000..9071737 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-901-large-file-handling/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for large file handling. + +The task involves: +- Handling files that exceed size limits +- Implementing chunked processing for large files +- Providing progress feedback for long operations + +Requirements: +- Define size thresholds +- Implement chunked processing +- Provide progress indicators + +Non-goals: +- Do not load entire large files into memory +- Do not block on long operations without feedback diff --git a/fixtures/large-file-and-integrity/task-901-large-file-handling/architect/verify.ts b/fixtures/large-file-and-integrity/task-901-large-file-handling/architect/verify.ts new file mode 100644 index 0000000..9a6a968 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-901-large-file-handling/architect/verify.ts @@ -0,0 +1,20 @@ +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("large") && !summary.includes("chunk")) { + return { + ok: false, + reason: "highLevelSummary must mention large files or chunked processing", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/large-file-and-integrity/task-901-large-file-handling/coder/expected.patch b/fixtures/large-file-and-integrity/task-901-large-file-handling/coder/expected.patch new file mode 100644 index 0000000..7015a84 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-901-large-file-handling/coder/expected.patch @@ -0,0 +1,58 @@ +diff --git a/src/files/chunkProcessor.ts b/src/files/chunkProcessor.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/files/chunkProcessor.ts +@@ -0,0 +1,20 @@ ++export interface ChunkResult { ++ chunkIndex: number; ++ bytesProcessed: number; ++ data: Buffer; ++} ++ ++export async function* processChunks( ++ buffer: Buffer, ++ chunkSize: number ++): AsyncGenerator { ++ let offset = 0; ++ let chunkIndex = 0; ++ ++ while (offset < buffer.length) { ++ const chunk = buffer.slice(offset, offset + chunkSize); ++ yield { chunkIndex, bytesProcessed: chunk.length, data: chunk }; ++ offset += chunkSize; ++ chunkIndex++; ++ } ++} +diff --git a/src/files/largeFileHandler.ts b/src/files/largeFileHandler.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/files/largeFileHandler.ts +@@ -0,0 +1,25 @@ ++import { processChunks } from "./chunkProcessor"; ++ ++export const SIZE_THRESHOLD = 10 * 1024 * 1024; // 10MB ++export const CHUNK_SIZE = 1024 * 1024; // 1MB ++ ++export interface ProgressCallback { ++ (processed: number, total: number): void; ++} ++ ++export async function handleLargeFile( ++ buffer: Buffer, ++ onProgress?: ProgressCallback ++): Promise { ++ const total = buffer.length; ++ let processed = 0; ++ ++ if (buffer.length <= SIZE_THRESHOLD) { ++ onProgress?.(total, total); ++ return; ++ } ++ ++ for await (const chunk of processChunks(buffer, CHUNK_SIZE)) { ++ processed += chunk.bytesProcessed; ++ onProgress?.(processed, total); ++ } ++} diff --git a/fixtures/large-file-and-integrity/task-901-large-file-handling/coder/prompt.md b/fixtures/large-file-and-integrity/task-901-large-file-handling/coder/prompt.md new file mode 100644 index 0000000..530b185 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-901-large-file-handling/coder/prompt.md @@ -0,0 +1,8 @@ +You are the coder agent. Apply the architect and planner guidance to implement +large file handling. + +Requirements: +- Create src/files/chunkProcessor.ts with chunked processing +- Create src/files/largeFileHandler.ts with size thresholds and progress + +Return a unified diff patch that implements large file handling. diff --git a/fixtures/large-file-and-integrity/task-901-large-file-handling/coder/verify.ts b/fixtures/large-file-and-integrity/task-901-large-file-handling/coder/verify.ts new file mode 100644 index 0000000..17d2030 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-901-large-file-handling/coder/verify.ts @@ -0,0 +1,25 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("chunkProcessor") && !patch.includes("processChunks")) { + return { + ok: false, + reason: "Patch must include chunk processor.", + }; + } + + if (!patch.includes("largeFileHandler") && !patch.includes("handleLargeFile")) { + return { + ok: false, + reason: "Patch must include large file handler.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/large-file-and-integrity/task-901-large-file-handling/planner/expected.json b/fixtures/large-file-and-integrity/task-901-large-file-handling/planner/expected.json new file mode 100644 index 0000000..452c433 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-901-large-file-handling/planner/expected.json @@ -0,0 +1,22 @@ +{ + "tasks": [ + { + "id": "implement-chunk-processor", + "description": "Implement chunk processor for handling large files in segments", + "file": "src/files/chunkProcessor.ts", + "type": "feature", + "complexity": "medium", + "dependsOn": [] + }, + { + "id": "implement-large-file-handler", + "description": "Implement large file handler with size thresholds and progress feedback", + "file": "src/files/largeFileHandler.ts", + "type": "feature", + "complexity": "medium", + "dependsOn": ["implement-chunk-processor"] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/large-file-and-integrity/task-901-large-file-handling/planner/prompt.md b/fixtures/large-file-and-integrity/task-901-large-file-handling/planner/prompt.md new file mode 100644 index 0000000..4eea1d0 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-901-large-file-handling/planner/prompt.md @@ -0,0 +1,7 @@ +Using the architect's spec for large file handling, produce a task list +for implementing chunked processing. + +Requirements: +- Define size thresholds +- Implement chunked processing +- Provide progress indicators diff --git a/fixtures/large-file-and-integrity/task-901-large-file-handling/planner/verify.ts b/fixtures/large-file-and-integrity/task-901-large-file-handling/planner/verify.ts new file mode 100644 index 0000000..7b537b5 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-901-large-file-handling/planner/verify.ts @@ -0,0 +1,32 @@ +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 at least 1 task for large file handling.", + }; + } + + const hasLargeFileTask = out.tasks.some( + (t) => + t.description.toLowerCase().includes("large") || + t.description.toLowerCase().includes("chunk") || + t.file.toLowerCase().includes("large") || + t.file.toLowerCase().includes("chunk") + ); + if (!hasLargeFileTask) { + return { + ok: false, + reason: "Planner must include a task for large file or chunk handling.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/large-file-and-integrity/task-901-large-file-handling/reviewer/expected.json b/fixtures/large-file-and-integrity/task-901-large-file-handling/reviewer/expected.json new file mode 100644 index 0000000..6a168b6 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-901-large-file-handling/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Large file handling correctly implemented with chunked processing and progress feedback.", + "path": "src/files/largeFileHandler.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/large-file-and-integrity/task-901-large-file-handling/reviewer/prompt.md b/fixtures/large-file-and-integrity/task-901-large-file-handling/reviewer/prompt.md new file mode 100644 index 0000000..da690d0 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-901-large-file-handling/reviewer/prompt.md @@ -0,0 +1,12 @@ +You are the reviewer agent. + +Review a patch that implements large file handling. + +Your responsibilities: +- Verify chunked processing is correct +- Ensure progress feedback is provided +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/large-file-and-integrity/task-901-large-file-handling/reviewer/verify.ts b/fixtures/large-file-and-integrity/task-901-large-file-handling/reviewer/verify.ts new file mode 100644 index 0000000..eaadf99 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-901-large-file-handling/reviewer/verify.ts @@ -0,0 +1,18 @@ +import { + verifyReviewer, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyReviewer(ctx, (out) => { + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer must include at least one comment about large file handling.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/large-file-and-integrity/task-904-checksum-validation/architect/expected.json b/fixtures/large-file-and-integrity/task-904-checksum-validation/architect/expected.json new file mode 100644 index 0000000..a70ce8d --- /dev/null +++ b/fixtures/large-file-and-integrity/task-904-checksum-validation/architect/expected.json @@ -0,0 +1,10 @@ +{ + "highLevelSummary": "Implement checksum validation for file integrity verification, supporting multiple hash algorithms like MD5 and SHA-256, with clear validation results.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/integrity/checksumComputer.ts", + "src/integrity/validator.ts" + ] +} diff --git a/fixtures/large-file-and-integrity/task-904-checksum-validation/architect/prompt.md b/fixtures/large-file-and-integrity/task-904-checksum-validation/architect/prompt.md new file mode 100644 index 0000000..edccde4 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-904-checksum-validation/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for checksum validation. + +The task involves: +- Computing checksums for file integrity verification +- Supporting multiple hash algorithms (MD5, SHA-256, etc.) +- Validating files against expected checksums + +Requirements: +- Implement checksum computation +- Support multiple algorithms +- Provide validation results + +Non-goals: +- Do not use deprecated algorithms for security +- Do not skip validation for any files diff --git a/fixtures/large-file-and-integrity/task-904-checksum-validation/architect/verify.ts b/fixtures/large-file-and-integrity/task-904-checksum-validation/architect/verify.ts new file mode 100644 index 0000000..bd7e32a --- /dev/null +++ b/fixtures/large-file-and-integrity/task-904-checksum-validation/architect/verify.ts @@ -0,0 +1,20 @@ +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("checksum") && !summary.includes("hash") && !summary.includes("integrity")) { + return { + ok: false, + reason: "highLevelSummary must mention checksum, hash, or integrity", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/large-file-and-integrity/task-904-checksum-validation/coder/expected.patch b/fixtures/large-file-and-integrity/task-904-checksum-validation/coder/expected.patch new file mode 100644 index 0000000..9dd5d21 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-904-checksum-validation/coder/expected.patch @@ -0,0 +1,50 @@ +diff --git a/src/integrity/checksumComputer.ts b/src/integrity/checksumComputer.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/integrity/checksumComputer.ts +@@ -0,0 +1,15 @@ ++import * as crypto from "crypto"; ++ ++export type HashAlgorithm = "md5" | "sha256" | "sha512"; ++ ++export function computeChecksum( ++ data: Buffer | string, ++ algorithm: HashAlgorithm = "sha256" ++): string { ++ const hash = crypto.createHash(algorithm); ++ hash.update(data); ++ return hash.digest("hex"); ++} ++ ++export function computeSHA256(data: Buffer | string): string { ++ return computeChecksum(data, "sha256"); ++} +diff --git a/src/integrity/validator.ts b/src/integrity/validator.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/integrity/validator.ts +@@ -0,0 +1,20 @@ ++import { computeChecksum, HashAlgorithm } from "./checksumComputer"; ++ ++export interface ValidationResult { ++ isValid: boolean; ++ expected: string; ++ actual: string; ++ algorithm: HashAlgorithm; ++} ++ ++export function validateChecksum( ++ data: Buffer | string, ++ expectedChecksum: string, ++ algorithm: HashAlgorithm = "sha256" ++): ValidationResult { ++ const actual = computeChecksum(data, algorithm); ++ return { ++ isValid: actual === expectedChecksum.toLowerCase(), ++ expected: expectedChecksum.toLowerCase(), ++ actual, ++ algorithm, ++ }; ++} diff --git a/fixtures/large-file-and-integrity/task-904-checksum-validation/coder/prompt.md b/fixtures/large-file-and-integrity/task-904-checksum-validation/coder/prompt.md new file mode 100644 index 0000000..830a1cc --- /dev/null +++ b/fixtures/large-file-and-integrity/task-904-checksum-validation/coder/prompt.md @@ -0,0 +1,8 @@ +You are the coder agent. Apply the architect and planner guidance to implement +checksum validation. + +Requirements: +- Create src/integrity/checksumComputer.ts with hash computation +- Create src/integrity/validator.ts with validation logic + +Return a unified diff patch that implements checksum validation. diff --git a/fixtures/large-file-and-integrity/task-904-checksum-validation/coder/verify.ts b/fixtures/large-file-and-integrity/task-904-checksum-validation/coder/verify.ts new file mode 100644 index 0000000..298a6da --- /dev/null +++ b/fixtures/large-file-and-integrity/task-904-checksum-validation/coder/verify.ts @@ -0,0 +1,25 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("checksumComputer") && !patch.includes("computeChecksum")) { + return { + ok: false, + reason: "Patch must include checksum computation.", + }; + } + + if (!patch.includes("validator") && !patch.includes("validateChecksum")) { + return { + ok: false, + reason: "Patch must include validation logic.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/large-file-and-integrity/task-904-checksum-validation/planner/expected.json b/fixtures/large-file-and-integrity/task-904-checksum-validation/planner/expected.json new file mode 100644 index 0000000..2e54cb3 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-904-checksum-validation/planner/expected.json @@ -0,0 +1,22 @@ +{ + "tasks": [ + { + "id": "implement-checksum-computer", + "description": "Implement checksum computation supporting multiple hash algorithms", + "file": "src/integrity/checksumComputer.ts", + "type": "feature", + "complexity": "medium", + "dependsOn": [] + }, + { + "id": "implement-validator", + "description": "Implement file validator to verify checksums against expected values", + "file": "src/integrity/validator.ts", + "type": "feature", + "complexity": "low", + "dependsOn": ["implement-checksum-computer"] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/large-file-and-integrity/task-904-checksum-validation/planner/prompt.md b/fixtures/large-file-and-integrity/task-904-checksum-validation/planner/prompt.md new file mode 100644 index 0000000..c3a0fc9 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-904-checksum-validation/planner/prompt.md @@ -0,0 +1,7 @@ +Using the architect's spec for checksum validation, produce a task list +for implementing integrity verification. + +Requirements: +- Implement checksum computation +- Support multiple algorithms +- Provide validation results diff --git a/fixtures/large-file-and-integrity/task-904-checksum-validation/planner/verify.ts b/fixtures/large-file-and-integrity/task-904-checksum-validation/planner/verify.ts new file mode 100644 index 0000000..afe7f81 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-904-checksum-validation/planner/verify.ts @@ -0,0 +1,32 @@ +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 at least 1 task for checksum validation.", + }; + } + + const hasChecksumTask = out.tasks.some( + (t) => + t.description.toLowerCase().includes("checksum") || + t.description.toLowerCase().includes("hash") || + t.file.toLowerCase().includes("checksum") || + t.file.toLowerCase().includes("integrity") + ); + if (!hasChecksumTask) { + return { + ok: false, + reason: "Planner must include a task for checksum or integrity handling.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/large-file-and-integrity/task-904-checksum-validation/reviewer/expected.json b/fixtures/large-file-and-integrity/task-904-checksum-validation/reviewer/expected.json new file mode 100644 index 0000000..9e2de1e --- /dev/null +++ b/fixtures/large-file-and-integrity/task-904-checksum-validation/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Checksum validation correctly implemented with multiple algorithm support and clear validation results.", + "path": "src/integrity/validator.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/large-file-and-integrity/task-904-checksum-validation/reviewer/prompt.md b/fixtures/large-file-and-integrity/task-904-checksum-validation/reviewer/prompt.md new file mode 100644 index 0000000..d6bc526 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-904-checksum-validation/reviewer/prompt.md @@ -0,0 +1,12 @@ +You are the reviewer agent. + +Review a patch that implements checksum validation. + +Your responsibilities: +- Verify checksum computation is correct +- Ensure validation logic is proper +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/large-file-and-integrity/task-904-checksum-validation/reviewer/verify.ts b/fixtures/large-file-and-integrity/task-904-checksum-validation/reviewer/verify.ts new file mode 100644 index 0000000..ddff5e6 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-904-checksum-validation/reviewer/verify.ts @@ -0,0 +1,18 @@ +import { + verifyReviewer, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyReviewer(ctx, (out) => { + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer must include at least one comment about checksum validation.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/large-file-and-integrity/task-905-binary-file-detection/architect/expected.json b/fixtures/large-file-and-integrity/task-905-binary-file-detection/architect/expected.json new file mode 100644 index 0000000..e876e9f --- /dev/null +++ b/fixtures/large-file-and-integrity/task-905-binary-file-detection/architect/expected.json @@ -0,0 +1,10 @@ +{ + "highLevelSummary": "Implement binary file detection to distinguish between binary and text files, with appropriate handling strategies to prevent corruption from text operations.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/files/binaryDetector.ts", + "src/files/fileTypeHandler.ts" + ] +} diff --git a/fixtures/large-file-and-integrity/task-905-binary-file-detection/architect/prompt.md b/fixtures/large-file-and-integrity/task-905-binary-file-detection/architect/prompt.md new file mode 100644 index 0000000..7dc32ba --- /dev/null +++ b/fixtures/large-file-and-integrity/task-905-binary-file-detection/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for binary file detection. + +The task involves: +- Detecting binary vs text files +- Handling binary files appropriately +- Preventing text operations on binary files + +Requirements: +- Implement binary detection logic +- Define handling strategies for binary files +- Provide clear file type information + +Non-goals: +- Do not corrupt binary files with text operations +- Do not silently convert binary to text diff --git a/fixtures/large-file-and-integrity/task-905-binary-file-detection/architect/verify.ts b/fixtures/large-file-and-integrity/task-905-binary-file-detection/architect/verify.ts new file mode 100644 index 0000000..dece282 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-905-binary-file-detection/architect/verify.ts @@ -0,0 +1,20 @@ +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("binary") && !summary.includes("file type")) { + return { + ok: false, + reason: "highLevelSummary must mention binary files or file type detection", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/large-file-and-integrity/task-905-binary-file-detection/coder/expected.patch b/fixtures/large-file-and-integrity/task-905-binary-file-detection/coder/expected.patch new file mode 100644 index 0000000..3f32b0a --- /dev/null +++ b/fixtures/large-file-and-integrity/task-905-binary-file-detection/coder/expected.patch @@ -0,0 +1,52 @@ +diff --git a/src/files/binaryDetector.ts b/src/files/binaryDetector.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/files/binaryDetector.ts +@@ -0,0 +1,20 @@ ++export function isBinaryFile(buffer: Buffer): boolean { ++ // Check for null bytes which typically indicate binary content ++ for (let i = 0; i < Math.min(buffer.length, 8000); i++) { ++ if (buffer[i] === 0) { ++ return true; ++ } ++ } ++ ++ // Check for high ratio of non-printable characters ++ let nonPrintable = 0; ++ const sampleSize = Math.min(buffer.length, 512); ++ for (let i = 0; i < sampleSize; i++) { ++ const byte = buffer[i]; ++ if (byte < 32 && byte !== 9 && byte !== 10 && byte !== 13) { ++ nonPrintable++; ++ } ++ } ++ ++ return nonPrintable / sampleSize > 0.3; ++} +diff --git a/src/files/fileTypeHandler.ts b/src/files/fileTypeHandler.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/files/fileTypeHandler.ts +@@ -0,0 +1,20 @@ ++import { isBinaryFile } from "./binaryDetector"; ++ ++export type FileType = "text" | "binary"; ++ ++export interface FileTypeInfo { ++ type: FileType; ++ canApplyTextOperations: boolean; ++ message: string; ++} ++ ++export function getFileTypeInfo(buffer: Buffer): FileTypeInfo { ++ const isBinary = isBinaryFile(buffer); ++ return { ++ type: isBinary ? "binary" : "text", ++ canApplyTextOperations: !isBinary, ++ message: isBinary ++ ? "Binary file detected - text operations will be skipped" ++ : "Text file detected - text operations allowed", ++ }; ++} diff --git a/fixtures/large-file-and-integrity/task-905-binary-file-detection/coder/prompt.md b/fixtures/large-file-and-integrity/task-905-binary-file-detection/coder/prompt.md new file mode 100644 index 0000000..fc6b48d --- /dev/null +++ b/fixtures/large-file-and-integrity/task-905-binary-file-detection/coder/prompt.md @@ -0,0 +1,8 @@ +You are the coder agent. Apply the architect and planner guidance to implement +binary file detection. + +Requirements: +- Create src/files/binaryDetector.ts with detection logic +- Create src/files/fileTypeHandler.ts with handling strategies + +Return a unified diff patch that implements binary file detection. diff --git a/fixtures/large-file-and-integrity/task-905-binary-file-detection/coder/verify.ts b/fixtures/large-file-and-integrity/task-905-binary-file-detection/coder/verify.ts new file mode 100644 index 0000000..7dc3ea0 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-905-binary-file-detection/coder/verify.ts @@ -0,0 +1,25 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("binaryDetector") && !patch.includes("isBinaryFile")) { + return { + ok: false, + reason: "Patch must include binary detection logic.", + }; + } + + if (!patch.includes("fileTypeHandler") && !patch.includes("getFileTypeInfo")) { + return { + ok: false, + reason: "Patch must include file type handler.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/large-file-and-integrity/task-905-binary-file-detection/planner/expected.json b/fixtures/large-file-and-integrity/task-905-binary-file-detection/planner/expected.json new file mode 100644 index 0000000..7f15fa8 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-905-binary-file-detection/planner/expected.json @@ -0,0 +1,22 @@ +{ + "tasks": [ + { + "id": "implement-binary-detector", + "description": "Implement binary file detection logic to distinguish binary from text files", + "file": "src/files/binaryDetector.ts", + "type": "feature", + "complexity": "medium", + "dependsOn": [] + }, + { + "id": "implement-file-type-handler", + "description": "Implement file type handler with appropriate strategies for binary files", + "file": "src/files/fileTypeHandler.ts", + "type": "feature", + "complexity": "low", + "dependsOn": ["implement-binary-detector"] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/large-file-and-integrity/task-905-binary-file-detection/planner/prompt.md b/fixtures/large-file-and-integrity/task-905-binary-file-detection/planner/prompt.md new file mode 100644 index 0000000..e0edd9c --- /dev/null +++ b/fixtures/large-file-and-integrity/task-905-binary-file-detection/planner/prompt.md @@ -0,0 +1,7 @@ +Using the architect's spec for binary file detection, produce a task list +for implementing file type detection. + +Requirements: +- Implement binary detection logic +- Define handling strategies for binary files +- Provide clear file type information diff --git a/fixtures/large-file-and-integrity/task-905-binary-file-detection/planner/verify.ts b/fixtures/large-file-and-integrity/task-905-binary-file-detection/planner/verify.ts new file mode 100644 index 0000000..ec4d11b --- /dev/null +++ b/fixtures/large-file-and-integrity/task-905-binary-file-detection/planner/verify.ts @@ -0,0 +1,30 @@ +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 at least 1 task for binary file detection.", + }; + } + + const hasBinaryTask = out.tasks.some( + (t) => + t.description.toLowerCase().includes("binary") || + t.file.toLowerCase().includes("binary") + ); + if (!hasBinaryTask) { + return { + ok: false, + reason: "Planner must include a task for binary file handling.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/large-file-and-integrity/task-905-binary-file-detection/reviewer/expected.json b/fixtures/large-file-and-integrity/task-905-binary-file-detection/reviewer/expected.json new file mode 100644 index 0000000..17525ed --- /dev/null +++ b/fixtures/large-file-and-integrity/task-905-binary-file-detection/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Binary file detection correctly implemented with appropriate handling strategies.", + "path": "src/files/binaryDetector.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/large-file-and-integrity/task-905-binary-file-detection/reviewer/prompt.md b/fixtures/large-file-and-integrity/task-905-binary-file-detection/reviewer/prompt.md new file mode 100644 index 0000000..65aabcb --- /dev/null +++ b/fixtures/large-file-and-integrity/task-905-binary-file-detection/reviewer/prompt.md @@ -0,0 +1,12 @@ +You are the reviewer agent. + +Review a patch that implements binary file detection. + +Your responsibilities: +- Verify binary detection logic is correct +- Ensure file type handling is appropriate +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/large-file-and-integrity/task-905-binary-file-detection/reviewer/verify.ts b/fixtures/large-file-and-integrity/task-905-binary-file-detection/reviewer/verify.ts new file mode 100644 index 0000000..0e6f2c0 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-905-binary-file-detection/reviewer/verify.ts @@ -0,0 +1,18 @@ +import { + verifyReviewer, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyReviewer(ctx, (out) => { + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer must include at least one comment about binary file detection.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/large-file-and-integrity/task-906-file-locking/architect/expected.json b/fixtures/large-file-and-integrity/task-906-file-locking/architect/expected.json new file mode 100644 index 0000000..04bd4f3 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-906-file-locking/architect/expected.json @@ -0,0 +1,10 @@ +{ + "highLevelSummary": "Implement file locking to prevent concurrent modifications, with lock acquisition, release, timeout handling, and clear conflict messages.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/files/lockManager.ts", + "src/files/lockTypes.ts" + ] +} diff --git a/fixtures/large-file-and-integrity/task-906-file-locking/architect/prompt.md b/fixtures/large-file-and-integrity/task-906-file-locking/architect/prompt.md new file mode 100644 index 0000000..9e0fb52 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-906-file-locking/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for file locking. + +The task involves: +- Implementing file locking to prevent concurrent modifications +- Handling lock acquisition and release +- Detecting and handling lock conflicts + +Requirements: +- Implement lock acquisition logic +- Handle lock timeouts +- Provide clear conflict messages + +Non-goals: +- Do not allow concurrent writes to locked files +- Do not leave stale locks diff --git a/fixtures/large-file-and-integrity/task-906-file-locking/architect/verify.ts b/fixtures/large-file-and-integrity/task-906-file-locking/architect/verify.ts new file mode 100644 index 0000000..eb5a20c --- /dev/null +++ b/fixtures/large-file-and-integrity/task-906-file-locking/architect/verify.ts @@ -0,0 +1,20 @@ +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("lock") && !summary.includes("concurrent")) { + return { + ok: false, + reason: "highLevelSummary must mention locking or concurrent access", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/large-file-and-integrity/task-906-file-locking/coder/expected.patch b/fixtures/large-file-and-integrity/task-906-file-locking/coder/expected.patch new file mode 100644 index 0000000..f23e203 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-906-file-locking/coder/expected.patch @@ -0,0 +1,67 @@ +diff --git a/src/files/lockTypes.ts b/src/files/lockTypes.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/files/lockTypes.ts +@@ -0,0 +1,15 @@ ++export interface FileLock { ++ path: string; ++ owner: string; ++ acquiredAt: Date; ++ expiresAt: Date; ++} ++ ++export interface LockResult { ++ success: boolean; ++ lock?: FileLock; ++ error?: string; ++} ++ ++export type LockState = "unlocked" | "locked" | "expired"; +diff --git a/src/files/lockManager.ts b/src/files/lockManager.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/files/lockManager.ts +@@ -0,0 +1,35 @@ ++import { FileLock, LockResult, LockState } from "./lockTypes"; ++ ++const locks = new Map(); ++const DEFAULT_TIMEOUT_MS = 30000; ++ ++export function acquireLock(path: string, owner: string, timeoutMs = DEFAULT_TIMEOUT_MS): LockResult { ++ const existing = locks.get(path); ++ ++ if (existing && existing.expiresAt > new Date()) { ++ return { ++ success: false, ++ error: `File "${path}" is locked by "${existing.owner}" until ${existing.expiresAt.toISOString()}`, ++ }; ++ } ++ ++ const lock: FileLock = { ++ path, ++ owner, ++ acquiredAt: new Date(), ++ expiresAt: new Date(Date.now() + timeoutMs), ++ }; ++ ++ locks.set(path, lock); ++ return { success: true, lock }; ++} ++ ++export function releaseLock(path: string, owner: string): boolean { ++ const existing = locks.get(path); ++ if (existing && existing.owner === owner) { ++ locks.delete(path); ++ return true; ++ } ++ return false; ++} ++ ++export function getLockState(path: string): LockState { ++ const lock = locks.get(path); ++ if (!lock) return "unlocked"; ++ if (lock.expiresAt < new Date()) return "expired"; ++ return "locked"; ++} diff --git a/fixtures/large-file-and-integrity/task-906-file-locking/coder/prompt.md b/fixtures/large-file-and-integrity/task-906-file-locking/coder/prompt.md new file mode 100644 index 0000000..ff86975 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-906-file-locking/coder/prompt.md @@ -0,0 +1,8 @@ +You are the coder agent. Apply the architect and planner guidance to implement +file locking. + +Requirements: +- Create src/files/lockTypes.ts with lock types +- Create src/files/lockManager.ts with lock management logic + +Return a unified diff patch that implements file locking. diff --git a/fixtures/large-file-and-integrity/task-906-file-locking/coder/verify.ts b/fixtures/large-file-and-integrity/task-906-file-locking/coder/verify.ts new file mode 100644 index 0000000..7704a5a --- /dev/null +++ b/fixtures/large-file-and-integrity/task-906-file-locking/coder/verify.ts @@ -0,0 +1,25 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("lockTypes") && !patch.includes("FileLock")) { + return { + ok: false, + reason: "Patch must include lock types.", + }; + } + + if (!patch.includes("lockManager") && !patch.includes("acquireLock")) { + return { + ok: false, + reason: "Patch must include lock manager.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/large-file-and-integrity/task-906-file-locking/planner/expected.json b/fixtures/large-file-and-integrity/task-906-file-locking/planner/expected.json new file mode 100644 index 0000000..5ff735d --- /dev/null +++ b/fixtures/large-file-and-integrity/task-906-file-locking/planner/expected.json @@ -0,0 +1,22 @@ +{ + "tasks": [ + { + "id": "define-lock-types", + "description": "Define types for file locks and lock states", + "file": "src/files/lockTypes.ts", + "type": "feature", + "complexity": "low", + "dependsOn": [] + }, + { + "id": "implement-lock-manager", + "description": "Implement lock manager with acquisition, release, and timeout handling", + "file": "src/files/lockManager.ts", + "type": "feature", + "complexity": "medium", + "dependsOn": ["define-lock-types"] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/large-file-and-integrity/task-906-file-locking/planner/prompt.md b/fixtures/large-file-and-integrity/task-906-file-locking/planner/prompt.md new file mode 100644 index 0000000..ffcef77 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-906-file-locking/planner/prompt.md @@ -0,0 +1,7 @@ +Using the architect's spec for file locking, produce a task list +for implementing lock management. + +Requirements: +- Implement lock acquisition logic +- Handle lock timeouts +- Provide clear conflict messages diff --git a/fixtures/large-file-and-integrity/task-906-file-locking/planner/verify.ts b/fixtures/large-file-and-integrity/task-906-file-locking/planner/verify.ts new file mode 100644 index 0000000..dd7733d --- /dev/null +++ b/fixtures/large-file-and-integrity/task-906-file-locking/planner/verify.ts @@ -0,0 +1,30 @@ +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 at least 1 task for file locking.", + }; + } + + const hasLockTask = out.tasks.some( + (t) => + t.description.toLowerCase().includes("lock") || + t.file.toLowerCase().includes("lock") + ); + if (!hasLockTask) { + return { + ok: false, + reason: "Planner must include a task for lock handling.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/large-file-and-integrity/task-906-file-locking/reviewer/expected.json b/fixtures/large-file-and-integrity/task-906-file-locking/reviewer/expected.json new file mode 100644 index 0000000..dbab1b7 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-906-file-locking/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "File locking correctly implemented with proper acquisition, release, and timeout handling.", + "path": "src/files/lockManager.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/large-file-and-integrity/task-906-file-locking/reviewer/prompt.md b/fixtures/large-file-and-integrity/task-906-file-locking/reviewer/prompt.md new file mode 100644 index 0000000..8542d43 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-906-file-locking/reviewer/prompt.md @@ -0,0 +1,12 @@ +You are the reviewer agent. + +Review a patch that implements file locking. + +Your responsibilities: +- Verify lock acquisition logic is correct +- Ensure timeout handling is proper +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/large-file-and-integrity/task-906-file-locking/reviewer/verify.ts b/fixtures/large-file-and-integrity/task-906-file-locking/reviewer/verify.ts new file mode 100644 index 0000000..5a6d45d --- /dev/null +++ b/fixtures/large-file-and-integrity/task-906-file-locking/reviewer/verify.ts @@ -0,0 +1,18 @@ +import { + verifyReviewer, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyReviewer(ctx, (out) => { + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer must include at least one comment about file locking.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/large-file-and-integrity/task-907-atomic-write/architect/expected.json b/fixtures/large-file-and-integrity/task-907-atomic-write/architect/expected.json new file mode 100644 index 0000000..82a5012 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-907-atomic-write/architect/expected.json @@ -0,0 +1,9 @@ +{ + "highLevelSummary": "Implement atomic file writes using temporary files and rename operations to prevent partial writes and ensure data integrity on failures.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/files/atomicWriter.ts" + ] +} diff --git a/fixtures/large-file-and-integrity/task-907-atomic-write/architect/prompt.md b/fixtures/large-file-and-integrity/task-907-atomic-write/architect/prompt.md new file mode 100644 index 0000000..6845a04 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-907-atomic-write/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for atomic file writes. + +The task involves: +- Implementing atomic write operations to prevent partial writes +- Using temporary files and rename for atomicity +- Handling write failures gracefully + +Requirements: +- Implement atomic write logic +- Use temp file + rename pattern +- Handle errors and cleanup + +Non-goals: +- Do not leave partial files on failure +- Do not corrupt existing files on write errors diff --git a/fixtures/large-file-and-integrity/task-907-atomic-write/architect/verify.ts b/fixtures/large-file-and-integrity/task-907-atomic-write/architect/verify.ts new file mode 100644 index 0000000..2352c3d --- /dev/null +++ b/fixtures/large-file-and-integrity/task-907-atomic-write/architect/verify.ts @@ -0,0 +1,20 @@ +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("atomic") && !summary.includes("write")) { + return { + ok: false, + reason: "highLevelSummary must mention atomic writes", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/large-file-and-integrity/task-907-atomic-write/coder/expected.patch b/fixtures/large-file-and-integrity/task-907-atomic-write/coder/expected.patch new file mode 100644 index 0000000..4dabf54 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-907-atomic-write/coder/expected.patch @@ -0,0 +1,45 @@ +diff --git a/src/files/atomicWriter.ts b/src/files/atomicWriter.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/files/atomicWriter.ts +@@ -0,0 +1,35 @@ ++import * as fs from "fs"; ++import * as path from "path"; ++ ++export interface AtomicWriteResult { ++ success: boolean; ++ path: string; ++ error?: string; ++} ++ ++export async function atomicWrite( ++ filePath: string, ++ content: string | Buffer ++): Promise { ++ const dir = path.dirname(filePath); ++ const tempPath = path.join(dir, `.tmp-${Date.now()}-${path.basename(filePath)}`); ++ ++ try { ++ // Write to temporary file first ++ await fs.promises.writeFile(tempPath, content); ++ ++ // Atomically rename temp file to target ++ await fs.promises.rename(tempPath, filePath); ++ ++ return { success: true, path: filePath }; ++ } catch (error) { ++ // Cleanup temp file on failure ++ try { ++ await fs.promises.unlink(tempPath); ++ } catch { ++ // Ignore cleanup errors ++ } ++ ++ return { ++ success: false, ++ path: filePath, ++ error: error instanceof Error ? error.message : "Unknown error", ++ }; ++ } ++} diff --git a/fixtures/large-file-and-integrity/task-907-atomic-write/coder/prompt.md b/fixtures/large-file-and-integrity/task-907-atomic-write/coder/prompt.md new file mode 100644 index 0000000..4d46e60 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-907-atomic-write/coder/prompt.md @@ -0,0 +1,8 @@ +You are the coder agent. Apply the architect and planner guidance to implement +atomic file writes. + +Requirements: +- Create src/files/atomicWriter.ts with atomic write logic +- Use temp file + rename pattern for atomicity + +Return a unified diff patch that implements atomic file writes. diff --git a/fixtures/large-file-and-integrity/task-907-atomic-write/coder/verify.ts b/fixtures/large-file-and-integrity/task-907-atomic-write/coder/verify.ts new file mode 100644 index 0000000..18c0aa5 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-907-atomic-write/coder/verify.ts @@ -0,0 +1,25 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("atomicWriter") && !patch.includes("atomicWrite")) { + return { + ok: false, + reason: "Patch must include atomic writer.", + }; + } + + if (!patch.includes("rename") && !patch.includes("temp")) { + return { + ok: false, + reason: "Patch must use temp file + rename pattern for atomicity.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/large-file-and-integrity/task-907-atomic-write/planner/expected.json b/fixtures/large-file-and-integrity/task-907-atomic-write/planner/expected.json new file mode 100644 index 0000000..3b94b07 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-907-atomic-write/planner/expected.json @@ -0,0 +1,14 @@ +{ + "tasks": [ + { + "id": "implement-atomic-writer", + "description": "Implement atomic file writer using temp file and rename pattern", + "file": "src/files/atomicWriter.ts", + "type": "feature", + "complexity": "medium", + "dependsOn": [] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/large-file-and-integrity/task-907-atomic-write/planner/prompt.md b/fixtures/large-file-and-integrity/task-907-atomic-write/planner/prompt.md new file mode 100644 index 0000000..a8c1461 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-907-atomic-write/planner/prompt.md @@ -0,0 +1,7 @@ +Using the architect's spec for atomic file writes, produce a task list +for implementing atomic write operations. + +Requirements: +- Implement atomic write logic +- Use temp file + rename pattern +- Handle errors and cleanup diff --git a/fixtures/large-file-and-integrity/task-907-atomic-write/planner/verify.ts b/fixtures/large-file-and-integrity/task-907-atomic-write/planner/verify.ts new file mode 100644 index 0000000..72d0775 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-907-atomic-write/planner/verify.ts @@ -0,0 +1,30 @@ +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 at least 1 task for atomic writes.", + }; + } + + const hasAtomicTask = out.tasks.some( + (t) => + t.description.toLowerCase().includes("atomic") || + t.file.toLowerCase().includes("atomic") + ); + if (!hasAtomicTask) { + return { + ok: false, + reason: "Planner must include a task for atomic write handling.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/large-file-and-integrity/task-907-atomic-write/reviewer/expected.json b/fixtures/large-file-and-integrity/task-907-atomic-write/reviewer/expected.json new file mode 100644 index 0000000..ca5dfe6 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-907-atomic-write/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Atomic file writes correctly implemented using temp file and rename pattern with proper error handling.", + "path": "src/files/atomicWriter.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/large-file-and-integrity/task-907-atomic-write/reviewer/prompt.md b/fixtures/large-file-and-integrity/task-907-atomic-write/reviewer/prompt.md new file mode 100644 index 0000000..b1600c4 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-907-atomic-write/reviewer/prompt.md @@ -0,0 +1,12 @@ +You are the reviewer agent. + +Review a patch that implements atomic file writes. + +Your responsibilities: +- Verify atomic write logic is correct +- Ensure temp file + rename pattern is used +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/large-file-and-integrity/task-907-atomic-write/reviewer/verify.ts b/fixtures/large-file-and-integrity/task-907-atomic-write/reviewer/verify.ts new file mode 100644 index 0000000..358e872 --- /dev/null +++ b/fixtures/large-file-and-integrity/task-907-atomic-write/reviewer/verify.ts @@ -0,0 +1,18 @@ +import { + verifyReviewer, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyReviewer(ctx, (out) => { + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer must include at least one comment about atomic writes.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/multi-file-refactors/task-600-rename-across-files/architect/expected.json b/fixtures/multi-file-refactors/task-600-rename-across-files/architect/expected.json new file mode 100644 index 0000000..9fc49b1 --- /dev/null +++ b/fixtures/multi-file-refactors/task-600-rename-across-files/architect/expected.json @@ -0,0 +1,11 @@ +{ + "highLevelSummary": "Rename getUserData to fetchUserProfile across the codebase, updating all imports and references to ensure consistency across all files.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/services/user.ts", + "src/api/handlers.ts", + "src/components/Profile.tsx" + ] +} diff --git a/fixtures/multi-file-refactors/task-600-rename-across-files/architect/prompt.md b/fixtures/multi-file-refactors/task-600-rename-across-files/architect/prompt.md new file mode 100644 index 0000000..12c5379 --- /dev/null +++ b/fixtures/multi-file-refactors/task-600-rename-across-files/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for renaming a function across multiple files. + +The task involves: +- Rename `getUserData` to `fetchUserProfile` across the codebase +- Update all imports and references +- Ensure consistency across all files + +Requirements: +- Describe the rename operation +- List all files that need to be updated +- Ensure no references are missed + +Non-goals: +- Do not change functionality +- Do not add new features diff --git a/fixtures/multi-file-refactors/task-600-rename-across-files/architect/verify.ts b/fixtures/multi-file-refactors/task-600-rename-across-files/architect/verify.ts new file mode 100644 index 0000000..074d974 --- /dev/null +++ b/fixtures/multi-file-refactors/task-600-rename-across-files/architect/verify.ts @@ -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("rename")) { + return { + ok: false, + reason: "highLevelSummary must mention renaming", + }; + } + + if (spec.recommendedFileStructure.length < 2) { + return { + ok: false, + reason: "recommendedFileStructure must include multiple files for a multi-file refactor", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/multi-file-refactors/task-600-rename-across-files/coder/expected.patch b/fixtures/multi-file-refactors/task-600-rename-across-files/coder/expected.patch new file mode 100644 index 0000000..930f482 --- /dev/null +++ b/fixtures/multi-file-refactors/task-600-rename-across-files/coder/expected.patch @@ -0,0 +1,34 @@ +diff --git a/src/services/user.ts b/src/services/user.ts +index 0000000..0000001 100644 +--- a/src/services/user.ts ++++ b/src/services/user.ts +@@ -1,3 +1,3 @@ +-export function getUserData(userId: string): Promise { ++export function fetchUserProfile(userId: string): Promise { + return fetch(`/api/users/${userId}`).then((res) => res.json()); + } +diff --git a/src/api/handlers.ts b/src/api/handlers.ts +index 0000000..0000001 100644 +--- a/src/api/handlers.ts ++++ b/src/api/handlers.ts +@@ -1,5 +1,5 @@ +-import { getUserData } from "../services/user"; ++import { fetchUserProfile } from "../services/user"; + + export async function handleUserRequest(userId: string) { +- return getUserData(userId); ++ return fetchUserProfile(userId); + } +diff --git a/src/components/Profile.tsx b/src/components/Profile.tsx +index 0000000..0000001 100644 +--- a/src/components/Profile.tsx ++++ b/src/components/Profile.tsx +@@ -1,7 +1,7 @@ +-import { getUserData } from "../services/user"; ++import { fetchUserProfile } from "../services/user"; + + export function Profile({ userId }: { userId: string }) { +- const user = getUserData(userId); ++ const user = fetchUserProfile(userId); + return
{user.name}
; + } diff --git a/fixtures/multi-file-refactors/task-600-rename-across-files/coder/prompt.md b/fixtures/multi-file-refactors/task-600-rename-across-files/coder/prompt.md new file mode 100644 index 0000000..c569a49 --- /dev/null +++ b/fixtures/multi-file-refactors/task-600-rename-across-files/coder/prompt.md @@ -0,0 +1,10 @@ +You are the coder agent. Apply the architect and planner guidance to rename +getUserData to fetchUserProfile across multiple files. + +Requirements: +- Rename the function in src/services/user.ts +- Update imports in src/api/handlers.ts +- Update imports in src/components/Profile.tsx +- Ensure all references are updated consistently + +Return a unified diff patch that renames across all files. diff --git a/fixtures/multi-file-refactors/task-600-rename-across-files/coder/verify.ts b/fixtures/multi-file-refactors/task-600-rename-across-files/coder/verify.ts new file mode 100644 index 0000000..ac360bb --- /dev/null +++ b/fixtures/multi-file-refactors/task-600-rename-across-files/coder/verify.ts @@ -0,0 +1,26 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + const headerCount = (patch.match(/^diff --git /gm) || []).length; + if (headerCount < 2) { + return { + ok: false, + reason: "Patch must modify multiple files for a multi-file refactor.", + }; + } + + if (!patch.includes("fetchUserProfile")) { + return { + ok: false, + reason: "Patch must include the new function name fetchUserProfile.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/multi-file-refactors/task-600-rename-across-files/planner/expected.json b/fixtures/multi-file-refactors/task-600-rename-across-files/planner/expected.json new file mode 100644 index 0000000..e7d44ac --- /dev/null +++ b/fixtures/multi-file-refactors/task-600-rename-across-files/planner/expected.json @@ -0,0 +1,30 @@ +{ + "tasks": [ + { + "id": "rename-in-user-service", + "description": "Rename getUserData to fetchUserProfile in src/services/user.ts", + "file": "src/services/user.ts", + "type": "refactor", + "complexity": "low", + "dependsOn": [] + }, + { + "id": "update-handlers-import", + "description": "Update import and usage of fetchUserProfile in src/api/handlers.ts", + "file": "src/api/handlers.ts", + "type": "refactor", + "complexity": "low", + "dependsOn": ["rename-in-user-service"] + }, + { + "id": "update-profile-component", + "description": "Update import and usage of fetchUserProfile in src/components/Profile.tsx", + "file": "src/components/Profile.tsx", + "type": "refactor", + "complexity": "low", + "dependsOn": ["rename-in-user-service"] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/multi-file-refactors/task-600-rename-across-files/planner/prompt.md b/fixtures/multi-file-refactors/task-600-rename-across-files/planner/prompt.md new file mode 100644 index 0000000..9a9436b --- /dev/null +++ b/fixtures/multi-file-refactors/task-600-rename-across-files/planner/prompt.md @@ -0,0 +1,8 @@ +Using the architect's spec for renaming across files, produce a task list +that covers all files needing updates. + +Rename: getUserData → fetchUserProfile + +Requirements: +- Include tasks for each file that needs updating +- Ensure all imports and references are covered diff --git a/fixtures/multi-file-refactors/task-600-rename-across-files/planner/verify.ts b/fixtures/multi-file-refactors/task-600-rename-across-files/planner/verify.ts new file mode 100644 index 0000000..ebeb244 --- /dev/null +++ b/fixtures/multi-file-refactors/task-600-rename-across-files/planner/verify.ts @@ -0,0 +1,38 @@ +import { + verifyPlanner, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyPlanner(ctx, (out) => { + if (out.tasks.length < 2) { + return { + ok: false, + reason: "Planner must emit multiple tasks for a multi-file refactor.", + }; + } + + const hasRenameTask = out.tasks.some( + (t) => + t.description.toLowerCase().includes("rename") || + t.type === "refactor" + ); + if (!hasRenameTask) { + return { + ok: false, + reason: "Planner must include rename/refactor tasks.", + }; + } + + const uniqueFiles = new Set(out.tasks.map((t) => t.file)); + if (uniqueFiles.size < 2) { + return { + ok: false, + reason: "Planner must target multiple files for a multi-file refactor.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/multi-file-refactors/task-600-rename-across-files/reviewer/expected.json b/fixtures/multi-file-refactors/task-600-rename-across-files/reviewer/expected.json new file mode 100644 index 0000000..67427e8 --- /dev/null +++ b/fixtures/multi-file-refactors/task-600-rename-across-files/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Rename completed consistently across all files - function definition and all imports/usages updated.", + "path": "src/services/user.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/multi-file-refactors/task-600-rename-across-files/reviewer/prompt.md b/fixtures/multi-file-refactors/task-600-rename-across-files/reviewer/prompt.md new file mode 100644 index 0000000..3c0b10a --- /dev/null +++ b/fixtures/multi-file-refactors/task-600-rename-across-files/reviewer/prompt.md @@ -0,0 +1,14 @@ +You are the reviewer agent. + +Review a patch that renames a function across multiple files. + +Rename: getUserData → fetchUserProfile + +Your responsibilities: +- Verify all references are updated consistently +- Ensure no references were missed +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/multi-file-refactors/task-600-rename-across-files/reviewer/verify.ts b/fixtures/multi-file-refactors/task-600-rename-across-files/reviewer/verify.ts new file mode 100644 index 0000000..a1ecee1 --- /dev/null +++ b/fixtures/multi-file-refactors/task-600-rename-across-files/reviewer/verify.ts @@ -0,0 +1,18 @@ +import { + verifyReviewer, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyReviewer(ctx, (out) => { + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer must include at least one comment about the rename.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/multi-file-refactors/task-601-extract-shared-module/architect/expected.json b/fixtures/multi-file-refactors/task-601-extract-shared-module/architect/expected.json new file mode 100644 index 0000000..ff1581d --- /dev/null +++ b/fixtures/multi-file-refactors/task-601-extract-shared-module/architect/expected.json @@ -0,0 +1,11 @@ +{ + "highLevelSummary": "Extract common validation logic from multiple files into a new shared module src/utils/validation.ts, then update all files to import from the shared module.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/utils/validation.ts", + "src/forms/login.ts", + "src/forms/register.ts" + ] +} diff --git a/fixtures/multi-file-refactors/task-601-extract-shared-module/architect/prompt.md b/fixtures/multi-file-refactors/task-601-extract-shared-module/architect/prompt.md new file mode 100644 index 0000000..f02b141 --- /dev/null +++ b/fixtures/multi-file-refactors/task-601-extract-shared-module/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for extracting shared code into a new module. + +The task involves: +- Extract common validation logic from multiple files +- Create a new shared module `src/utils/validation.ts` +- Update all files to import from the new shared module + +Requirements: +- Describe the extraction operation +- List all files that need to be updated +- Ensure the shared module is properly structured + +Non-goals: +- Do not change validation logic +- Do not add new validation rules diff --git a/fixtures/multi-file-refactors/task-601-extract-shared-module/architect/verify.ts b/fixtures/multi-file-refactors/task-601-extract-shared-module/architect/verify.ts new file mode 100644 index 0000000..5db236a --- /dev/null +++ b/fixtures/multi-file-refactors/task-601-extract-shared-module/architect/verify.ts @@ -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("extract") && !summary.includes("shared")) { + return { + ok: false, + reason: "highLevelSummary must mention extracting or shared module", + }; + } + + if (spec.recommendedFileStructure.length < 2) { + return { + ok: false, + reason: "recommendedFileStructure must include multiple files for extraction", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/multi-file-refactors/task-601-extract-shared-module/coder/expected.patch b/fixtures/multi-file-refactors/task-601-extract-shared-module/coder/expected.patch new file mode 100644 index 0000000..513956f --- /dev/null +++ b/fixtures/multi-file-refactors/task-601-extract-shared-module/coder/expected.patch @@ -0,0 +1,52 @@ +diff --git a/src/utils/validation.ts b/src/utils/validation.ts +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/src/utils/validation.ts +@@ -0,0 +1,11 @@ ++export function validateEmail(email: string): boolean { ++ return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email); ++} ++ ++export function validatePassword(password: string): boolean { ++ return password.length >= 8; ++} ++ ++export function validateRequired(value: string): boolean { ++ return value.trim().length > 0; ++} +diff --git a/src/forms/login.ts b/src/forms/login.ts +index 0000000..0000001 100644 +--- a/src/forms/login.ts ++++ b/src/forms/login.ts +@@ -1,10 +1,5 @@ +-function validateEmail(email: string): boolean { +- return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email); +-} +- +-function validatePassword(password: string): boolean { +- return password.length >= 8; +-} ++import { validateEmail, validatePassword } from "../utils/validation"; + + export function validateLoginForm(email: string, password: string): boolean { + return validateEmail(email) && validatePassword(password); + } +diff --git a/src/forms/register.ts b/src/forms/register.ts +index 0000000..0000001 100644 +--- a/src/forms/register.ts ++++ b/src/forms/register.ts +@@ -1,10 +1,5 @@ +-function validateEmail(email: string): boolean { +- return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email); +-} +- +-function validatePassword(password: string): boolean { +- return password.length >= 8; +-} ++import { validateEmail, validatePassword, validateRequired } from "../utils/validation"; + + export function validateRegisterForm(email: string, password: string, name: string): boolean { +- return validateEmail(email) && validatePassword(password) && name.trim().length > 0; ++ return validateEmail(email) && validatePassword(password) && validateRequired(name); + } diff --git a/fixtures/multi-file-refactors/task-601-extract-shared-module/coder/prompt.md b/fixtures/multi-file-refactors/task-601-extract-shared-module/coder/prompt.md new file mode 100644 index 0000000..a9b238e --- /dev/null +++ b/fixtures/multi-file-refactors/task-601-extract-shared-module/coder/prompt.md @@ -0,0 +1,9 @@ +You are the coder agent. Apply the architect and planner guidance to extract +shared validation logic into a new module. + +Requirements: +- Create src/utils/validation.ts with common validation functions +- Update src/forms/login.ts to import from the shared module +- Update src/forms/register.ts to import from the shared module + +Return a unified diff patch that extracts the shared module. diff --git a/fixtures/multi-file-refactors/task-601-extract-shared-module/coder/verify.ts b/fixtures/multi-file-refactors/task-601-extract-shared-module/coder/verify.ts new file mode 100644 index 0000000..ccf2d76 --- /dev/null +++ b/fixtures/multi-file-refactors/task-601-extract-shared-module/coder/verify.ts @@ -0,0 +1,33 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("new file") && !patch.includes("validation.ts")) { + return { + ok: false, + reason: "Patch must create the shared validation module.", + }; + } + + const headerCount = (patch.match(/^diff --git /gm) || []).length; + if (headerCount < 2) { + return { + ok: false, + reason: "Patch must modify multiple files for extraction.", + }; + } + + if (!patch.includes("import")) { + return { + ok: false, + reason: "Patch must update imports in consuming files.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/multi-file-refactors/task-601-extract-shared-module/planner/expected.json b/fixtures/multi-file-refactors/task-601-extract-shared-module/planner/expected.json new file mode 100644 index 0000000..1296c80 --- /dev/null +++ b/fixtures/multi-file-refactors/task-601-extract-shared-module/planner/expected.json @@ -0,0 +1,30 @@ +{ + "tasks": [ + { + "id": "create-validation-module", + "description": "Create shared validation module at src/utils/validation.ts with common validation logic", + "file": "src/utils/validation.ts", + "type": "refactor", + "complexity": "medium", + "dependsOn": [] + }, + { + "id": "update-login-form", + "description": "Update src/forms/login.ts to import from shared validation module", + "file": "src/forms/login.ts", + "type": "refactor", + "complexity": "low", + "dependsOn": ["create-validation-module"] + }, + { + "id": "update-register-form", + "description": "Update src/forms/register.ts to import from shared validation module", + "file": "src/forms/register.ts", + "type": "refactor", + "complexity": "low", + "dependsOn": ["create-validation-module"] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/multi-file-refactors/task-601-extract-shared-module/planner/prompt.md b/fixtures/multi-file-refactors/task-601-extract-shared-module/planner/prompt.md new file mode 100644 index 0000000..7763730 --- /dev/null +++ b/fixtures/multi-file-refactors/task-601-extract-shared-module/planner/prompt.md @@ -0,0 +1,9 @@ +Using the architect's spec for extracting shared code, produce a task list +that covers creating the shared module and updating all files. + +New shared module: src/utils/validation.ts +Files to update: src/forms/login.ts, src/forms/register.ts + +Requirements: +- Include task for creating the shared module +- Include tasks for updating each file to use the shared module diff --git a/fixtures/multi-file-refactors/task-601-extract-shared-module/planner/verify.ts b/fixtures/multi-file-refactors/task-601-extract-shared-module/planner/verify.ts new file mode 100644 index 0000000..3386482 --- /dev/null +++ b/fixtures/multi-file-refactors/task-601-extract-shared-module/planner/verify.ts @@ -0,0 +1,30 @@ +import { + verifyPlanner, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyPlanner(ctx, (out) => { + if (out.tasks.length < 2) { + return { + ok: false, + reason: "Planner must emit multiple tasks for extracting shared module.", + }; + } + + const hasCreateTask = out.tasks.some( + (t) => + t.description.toLowerCase().includes("create") || + t.description.toLowerCase().includes("shared") + ); + if (!hasCreateTask) { + return { + ok: false, + reason: "Planner must include a task for creating the shared module.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/multi-file-refactors/task-601-extract-shared-module/reviewer/expected.json b/fixtures/multi-file-refactors/task-601-extract-shared-module/reviewer/expected.json new file mode 100644 index 0000000..c0592ed --- /dev/null +++ b/fixtures/multi-file-refactors/task-601-extract-shared-module/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Shared validation module correctly extracts common logic and all consuming files updated to import from it.", + "path": "src/utils/validation.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/multi-file-refactors/task-601-extract-shared-module/reviewer/prompt.md b/fixtures/multi-file-refactors/task-601-extract-shared-module/reviewer/prompt.md new file mode 100644 index 0000000..55b18d4 --- /dev/null +++ b/fixtures/multi-file-refactors/task-601-extract-shared-module/reviewer/prompt.md @@ -0,0 +1,15 @@ +You are the reviewer agent. + +Review a patch that extracts shared validation logic into a new module. + +New shared module: src/utils/validation.ts +Updated files: src/forms/login.ts, src/forms/register.ts + +Your responsibilities: +- Verify the shared module is properly structured +- Ensure all files are updated to use the shared module +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/multi-file-refactors/task-601-extract-shared-module/reviewer/verify.ts b/fixtures/multi-file-refactors/task-601-extract-shared-module/reviewer/verify.ts new file mode 100644 index 0000000..acd82ba --- /dev/null +++ b/fixtures/multi-file-refactors/task-601-extract-shared-module/reviewer/verify.ts @@ -0,0 +1,18 @@ +import { + verifyReviewer, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyReviewer(ctx, (out) => { + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer must include at least one comment about the extraction.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/multi-file-refactors/task-602-move-file-update-imports/architect/expected.json b/fixtures/multi-file-refactors/task-602-move-file-update-imports/architect/expected.json new file mode 100644 index 0000000..a3f6db8 --- /dev/null +++ b/fixtures/multi-file-refactors/task-602-move-file-update-imports/architect/expected.json @@ -0,0 +1,11 @@ +{ + "highLevelSummary": "Move src/helpers/utils.ts to src/utils/helpers.ts and update all import paths across the codebase to ensure no broken imports remain.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/utils/helpers.ts", + "src/services/api.ts", + "src/components/App.tsx" + ] +} diff --git a/fixtures/multi-file-refactors/task-602-move-file-update-imports/architect/prompt.md b/fixtures/multi-file-refactors/task-602-move-file-update-imports/architect/prompt.md new file mode 100644 index 0000000..d4ee3b0 --- /dev/null +++ b/fixtures/multi-file-refactors/task-602-move-file-update-imports/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for moving a file and updating all imports. + +The task involves: +- Move `src/helpers/utils.ts` to `src/utils/helpers.ts` +- Update all import paths across the codebase +- Ensure no broken imports remain + +Requirements: +- Describe the file move operation +- List all files that need import updates +- Ensure consistency across all imports + +Non-goals: +- Do not change file contents +- Do not add new functionality diff --git a/fixtures/multi-file-refactors/task-602-move-file-update-imports/architect/verify.ts b/fixtures/multi-file-refactors/task-602-move-file-update-imports/architect/verify.ts new file mode 100644 index 0000000..ba3020c --- /dev/null +++ b/fixtures/multi-file-refactors/task-602-move-file-update-imports/architect/verify.ts @@ -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("move") && !summary.includes("import")) { + return { + ok: false, + reason: "highLevelSummary must mention moving file or updating imports", + }; + } + + if (spec.recommendedFileStructure.length < 2) { + return { + ok: false, + reason: "recommendedFileStructure must include multiple files for import updates", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/multi-file-refactors/task-602-move-file-update-imports/coder/expected.patch b/fixtures/multi-file-refactors/task-602-move-file-update-imports/coder/expected.patch new file mode 100644 index 0000000..f6e6056 --- /dev/null +++ b/fixtures/multi-file-refactors/task-602-move-file-update-imports/coder/expected.patch @@ -0,0 +1,26 @@ +diff --git a/src/helpers/utils.ts b/src/utils/helpers.ts +similarity index 100% +rename from src/helpers/utils.ts +rename to src/utils/helpers.ts +diff --git a/src/services/api.ts b/src/services/api.ts +index 0000000..0000001 100644 +--- a/src/services/api.ts ++++ b/src/services/api.ts +@@ -1,4 +1,4 @@ +-import { formatData } from "../helpers/utils"; ++import { formatData } from "../utils/helpers"; + + export function fetchData() { + return formatData({}); + } +diff --git a/src/components/App.tsx b/src/components/App.tsx +index 0000000..0000001 100644 +--- a/src/components/App.tsx ++++ b/src/components/App.tsx +@@ -1,4 +1,4 @@ +-import { formatData } from "../helpers/utils"; ++import { formatData } from "../utils/helpers"; + + export function App() { + return
{formatData({})}
; + } diff --git a/fixtures/multi-file-refactors/task-602-move-file-update-imports/coder/prompt.md b/fixtures/multi-file-refactors/task-602-move-file-update-imports/coder/prompt.md new file mode 100644 index 0000000..a15b3c1 --- /dev/null +++ b/fixtures/multi-file-refactors/task-602-move-file-update-imports/coder/prompt.md @@ -0,0 +1,9 @@ +You are the coder agent. Apply the architect and planner guidance to move +a file and update all imports. + +Requirements: +- Move src/helpers/utils.ts to src/utils/helpers.ts +- Update imports in src/services/api.ts +- Update imports in src/components/App.tsx + +Return a unified diff patch that moves the file and updates imports. diff --git a/fixtures/multi-file-refactors/task-602-move-file-update-imports/coder/verify.ts b/fixtures/multi-file-refactors/task-602-move-file-update-imports/coder/verify.ts new file mode 100644 index 0000000..c0be21e --- /dev/null +++ b/fixtures/multi-file-refactors/task-602-move-file-update-imports/coder/verify.ts @@ -0,0 +1,26 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("rename") && !patch.includes("utils/helpers")) { + return { + ok: false, + reason: "Patch must show file rename or new path.", + }; + } + + const headerCount = (patch.match(/^diff --git /gm) || []).length; + if (headerCount < 2) { + return { + ok: false, + reason: "Patch must update multiple files for import changes.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/multi-file-refactors/task-602-move-file-update-imports/planner/expected.json b/fixtures/multi-file-refactors/task-602-move-file-update-imports/planner/expected.json new file mode 100644 index 0000000..49a04d8 --- /dev/null +++ b/fixtures/multi-file-refactors/task-602-move-file-update-imports/planner/expected.json @@ -0,0 +1,30 @@ +{ + "tasks": [ + { + "id": "move-utils-file", + "description": "Move src/helpers/utils.ts to src/utils/helpers.ts", + "file": "src/utils/helpers.ts", + "type": "refactor", + "complexity": "low", + "dependsOn": [] + }, + { + "id": "update-api-imports", + "description": "Update import paths in src/services/api.ts", + "file": "src/services/api.ts", + "type": "refactor", + "complexity": "low", + "dependsOn": ["move-utils-file"] + }, + { + "id": "update-app-imports", + "description": "Update import paths in src/components/App.tsx", + "file": "src/components/App.tsx", + "type": "refactor", + "complexity": "low", + "dependsOn": ["move-utils-file"] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/multi-file-refactors/task-602-move-file-update-imports/planner/prompt.md b/fixtures/multi-file-refactors/task-602-move-file-update-imports/planner/prompt.md new file mode 100644 index 0000000..360818b --- /dev/null +++ b/fixtures/multi-file-refactors/task-602-move-file-update-imports/planner/prompt.md @@ -0,0 +1,8 @@ +Using the architect's spec for moving a file and updating imports, produce a task list +that covers the file move and all import updates. + +Move: src/helpers/utils.ts → src/utils/helpers.ts + +Requirements: +- Include task for moving the file +- Include tasks for updating imports in all consuming files diff --git a/fixtures/multi-file-refactors/task-602-move-file-update-imports/planner/verify.ts b/fixtures/multi-file-refactors/task-602-move-file-update-imports/planner/verify.ts new file mode 100644 index 0000000..37a3cbc --- /dev/null +++ b/fixtures/multi-file-refactors/task-602-move-file-update-imports/planner/verify.ts @@ -0,0 +1,30 @@ +import { + verifyPlanner, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyPlanner(ctx, (out) => { + if (out.tasks.length < 2) { + return { + ok: false, + reason: "Planner must emit multiple tasks for file move and import updates.", + }; + } + + const hasMoveTask = out.tasks.some( + (t) => + t.description.toLowerCase().includes("move") || + t.description.toLowerCase().includes("import") + ); + if (!hasMoveTask) { + return { + ok: false, + reason: "Planner must include a task for moving the file or updating imports.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/multi-file-refactors/task-602-move-file-update-imports/reviewer/expected.json b/fixtures/multi-file-refactors/task-602-move-file-update-imports/reviewer/expected.json new file mode 100644 index 0000000..7c70f9e --- /dev/null +++ b/fixtures/multi-file-refactors/task-602-move-file-update-imports/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "File move completed correctly and all import paths updated consistently.", + "path": "src/utils/helpers.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/multi-file-refactors/task-602-move-file-update-imports/reviewer/prompt.md b/fixtures/multi-file-refactors/task-602-move-file-update-imports/reviewer/prompt.md new file mode 100644 index 0000000..3eeb0b2 --- /dev/null +++ b/fixtures/multi-file-refactors/task-602-move-file-update-imports/reviewer/prompt.md @@ -0,0 +1,14 @@ +You are the reviewer agent. + +Review a patch that moves a file and updates all imports. + +Move: src/helpers/utils.ts → src/utils/helpers.ts + +Your responsibilities: +- Verify all import paths are updated correctly +- Ensure no broken imports remain +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/multi-file-refactors/task-602-move-file-update-imports/reviewer/verify.ts b/fixtures/multi-file-refactors/task-602-move-file-update-imports/reviewer/verify.ts new file mode 100644 index 0000000..90ebb91 --- /dev/null +++ b/fixtures/multi-file-refactors/task-602-move-file-update-imports/reviewer/verify.ts @@ -0,0 +1,18 @@ +import { + verifyReviewer, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyReviewer(ctx, (out) => { + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer must include at least one comment about the file move.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/provenance/task-401-trace-origin/architect/expected.json b/fixtures/provenance/task-401-trace-origin/architect/expected.json new file mode 100644 index 0000000..69f2ef2 --- /dev/null +++ b/fixtures/provenance/task-401-trace-origin/architect/expected.json @@ -0,0 +1,9 @@ +{ + "highLevelSummary": "Trace the origin and provenance of code in src/services/handler.ts, documenting the chain of custody from original implementation through any transformations to the current state.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/services/handler.ts" + ] +} diff --git a/fixtures/provenance/task-401-trace-origin/architect/prompt.md b/fixtures/provenance/task-401-trace-origin/architect/prompt.md new file mode 100644 index 0000000..1bfe538 --- /dev/null +++ b/fixtures/provenance/task-401-trace-origin/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for tracing the origin of a code change. + +The task involves understanding where a specific piece of code came from: +- Trace the origin of a function in `src/services/handler.ts` +- Document the provenance chain from original implementation to current state +- Identify any transformations or refactors along the way + +Requirements: +- Describe the provenance tracking approach +- Identify the original source and any intermediate changes +- Document the chain of custody for the code + +Non-goals: +- Do not modify the code itself +- Do not introduce new functionality diff --git a/fixtures/provenance/task-401-trace-origin/architect/verify.ts b/fixtures/provenance/task-401-trace-origin/architect/verify.ts new file mode 100644 index 0000000..abae4c5 --- /dev/null +++ b/fixtures/provenance/task-401-trace-origin/architect/verify.ts @@ -0,0 +1,20 @@ +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("trace") && !summary.includes("origin") && !summary.includes("provenance")) { + return { + ok: false, + reason: "highLevelSummary must mention tracing, origin, or provenance", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/provenance/task-401-trace-origin/coder/expected.patch b/fixtures/provenance/task-401-trace-origin/coder/expected.patch new file mode 100644 index 0000000..9aab41f --- /dev/null +++ b/fixtures/provenance/task-401-trace-origin/coder/expected.patch @@ -0,0 +1,15 @@ +diff --git a/src/services/handler.ts b/src/services/handler.ts +index 0000000..0000001 100644 +--- a/src/services/handler.ts ++++ b/src/services/handler.ts +@@ -1,3 +1,10 @@ ++/** ++ * @provenance ++ * Origin: Initial implementation in src/legacy/handler.ts ++ * Transformation: Migrated to services layer in v2.0 ++ * Current: Refactored for TypeScript strict mode ++ */ ++ + export function handleRequest(data: unknown): void { + console.log("Handling request", data); + } diff --git a/fixtures/provenance/task-401-trace-origin/coder/prompt.md b/fixtures/provenance/task-401-trace-origin/coder/prompt.md new file mode 100644 index 0000000..8ae3556 --- /dev/null +++ b/fixtures/provenance/task-401-trace-origin/coder/prompt.md @@ -0,0 +1,9 @@ +You are the coder agent. Apply the architect and planner guidance to document +the provenance of the code. + +Requirements: +- Add provenance documentation comments to src/services/handler.ts +- Document the origin and any transformations +- Do not change the functional code + +Return a unified diff patch that adds provenance documentation. diff --git a/fixtures/provenance/task-401-trace-origin/coder/verify.ts b/fixtures/provenance/task-401-trace-origin/coder/verify.ts new file mode 100644 index 0000000..a8c2d3c --- /dev/null +++ b/fixtures/provenance/task-401-trace-origin/coder/verify.ts @@ -0,0 +1,18 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("provenance") && !patch.includes("origin") && !patch.includes("Origin")) { + return { + ok: false, + reason: "Patch must include provenance documentation.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/provenance/task-401-trace-origin/planner/expected.json b/fixtures/provenance/task-401-trace-origin/planner/expected.json new file mode 100644 index 0000000..f1d1f01 --- /dev/null +++ b/fixtures/provenance/task-401-trace-origin/planner/expected.json @@ -0,0 +1,14 @@ +{ + "tasks": [ + { + "id": "document-provenance", + "description": "Document the provenance chain for src/services/handler.ts, tracing from original implementation to current state", + "file": "src/services/handler.ts", + "type": "unknown", + "complexity": "low", + "dependsOn": [] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/provenance/task-401-trace-origin/planner/prompt.md b/fixtures/provenance/task-401-trace-origin/planner/prompt.md new file mode 100644 index 0000000..7857019 --- /dev/null +++ b/fixtures/provenance/task-401-trace-origin/planner/prompt.md @@ -0,0 +1,8 @@ +Using the architect's spec for tracing code origin, produce a task list +that documents the provenance chain. + +Target file: src/services/handler.ts + +Requirements: +- Include tasks for documenting the provenance chain +- Trace from original implementation to current state diff --git a/fixtures/provenance/task-401-trace-origin/planner/verify.ts b/fixtures/provenance/task-401-trace-origin/planner/verify.ts new file mode 100644 index 0000000..1e0132c --- /dev/null +++ b/fixtures/provenance/task-401-trace-origin/planner/verify.ts @@ -0,0 +1,24 @@ +import { + verifyPlanner, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyPlanner(ctx, (out) => { + const hasProvenanceTask = out.tasks.some( + (t) => + t.description.toLowerCase().includes("provenance") || + t.description.toLowerCase().includes("trace") || + t.description.toLowerCase().includes("origin") + ); + if (!hasProvenanceTask) { + return { + ok: false, + reason: "Planner must include a task for documenting provenance.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/provenance/task-401-trace-origin/reviewer/expected.json b/fixtures/provenance/task-401-trace-origin/reviewer/expected.json new file mode 100644 index 0000000..7fd12db --- /dev/null +++ b/fixtures/provenance/task-401-trace-origin/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Provenance documentation correctly traces the origin and transformations of the code.", + "path": "src/services/handler.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/provenance/task-401-trace-origin/reviewer/prompt.md b/fixtures/provenance/task-401-trace-origin/reviewer/prompt.md new file mode 100644 index 0000000..0b04b8f --- /dev/null +++ b/fixtures/provenance/task-401-trace-origin/reviewer/prompt.md @@ -0,0 +1,14 @@ +You are the reviewer agent. + +Review a patch that adds provenance documentation to code. + +Target file: src/services/handler.ts + +Your responsibilities: +- Verify the provenance documentation is accurate and complete +- Ensure the functional code was not modified +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/provenance/task-401-trace-origin/reviewer/verify.ts b/fixtures/provenance/task-401-trace-origin/reviewer/verify.ts new file mode 100644 index 0000000..f5112b3 --- /dev/null +++ b/fixtures/provenance/task-401-trace-origin/reviewer/verify.ts @@ -0,0 +1,25 @@ +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: "Reviewer should approve accurate provenance documentation.", + }; + } + + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer should include at least one comment about provenance.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/provenance/task-402-attribution-chain/architect/expected.json b/fixtures/provenance/task-402-attribution-chain/architect/expected.json new file mode 100644 index 0000000..0ec0bd6 --- /dev/null +++ b/fixtures/provenance/task-402-attribution-chain/architect/expected.json @@ -0,0 +1,10 @@ +{ + "highLevelSummary": "Maintain attribution chains for code derived from external sources, ensuring license compliance and documenting the chain of attribution from original source to current implementation.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/utils/derived.ts", + "ATTRIBUTION.md" + ] +} diff --git a/fixtures/provenance/task-402-attribution-chain/architect/prompt.md b/fixtures/provenance/task-402-attribution-chain/architect/prompt.md new file mode 100644 index 0000000..fe8b189 --- /dev/null +++ b/fixtures/provenance/task-402-attribution-chain/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for maintaining attribution chains in code. + +The task involves ensuring proper attribution when code is derived from other sources: +- Track attribution for code derived from external libraries +- Maintain license compliance information +- Document the chain of attribution from source to current implementation + +Requirements: +- Describe the attribution tracking approach +- Ensure license compliance is maintained +- Document the attribution chain + +Non-goals: +- Do not modify the functional code +- Do not remove existing attributions diff --git a/fixtures/provenance/task-402-attribution-chain/architect/verify.ts b/fixtures/provenance/task-402-attribution-chain/architect/verify.ts new file mode 100644 index 0000000..4cd84b5 --- /dev/null +++ b/fixtures/provenance/task-402-attribution-chain/architect/verify.ts @@ -0,0 +1,20 @@ +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("attribution") && !summary.includes("license")) { + return { + ok: false, + reason: "highLevelSummary must mention attribution or license", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/provenance/task-402-attribution-chain/coder/expected.patch b/fixtures/provenance/task-402-attribution-chain/coder/expected.patch new file mode 100644 index 0000000..dd4f2d4 --- /dev/null +++ b/fixtures/provenance/task-402-attribution-chain/coder/expected.patch @@ -0,0 +1,27 @@ +diff --git a/src/utils/derived.ts b/src/utils/derived.ts +index 0000000..0000001 100644 +--- a/src/utils/derived.ts ++++ b/src/utils/derived.ts +@@ -1,3 +1,9 @@ ++/** ++ * @attribution ++ * Derived from: lodash v4.17.21 ++ * License: MIT ++ * Original source: https://github.com/lodash/lodash ++ */ + export function deepClone(obj: T): T { + return JSON.parse(JSON.stringify(obj)); + } +diff --git a/ATTRIBUTION.md b/ATTRIBUTION.md +index 0000000..0000001 100644 +--- a/ATTRIBUTION.md ++++ b/ATTRIBUTION.md +@@ -1 +1,8 @@ + # Attribution ++ ++## Third-Party Code ++ ++### src/utils/derived.ts ++- **Source**: lodash v4.17.21 ++- **License**: MIT ++- **URL**: https://github.com/lodash/lodash diff --git a/fixtures/provenance/task-402-attribution-chain/coder/prompt.md b/fixtures/provenance/task-402-attribution-chain/coder/prompt.md new file mode 100644 index 0000000..4bb34fe --- /dev/null +++ b/fixtures/provenance/task-402-attribution-chain/coder/prompt.md @@ -0,0 +1,9 @@ +You are the coder agent. Apply the architect and planner guidance to add +attribution documentation to derived code. + +Requirements: +- Add attribution comments to src/utils/derived.ts +- Update ATTRIBUTION.md with license compliance information +- Do not modify the functional code + +Return a unified diff patch that adds attribution documentation. diff --git a/fixtures/provenance/task-402-attribution-chain/coder/verify.ts b/fixtures/provenance/task-402-attribution-chain/coder/verify.ts new file mode 100644 index 0000000..fb1871c --- /dev/null +++ b/fixtures/provenance/task-402-attribution-chain/coder/verify.ts @@ -0,0 +1,25 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("attribution") && !patch.includes("Attribution")) { + return { + ok: false, + reason: "Patch must include attribution documentation.", + }; + } + + if (!patch.includes("License") && !patch.includes("license")) { + return { + ok: false, + reason: "Patch must include license information.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/provenance/task-402-attribution-chain/planner/expected.json b/fixtures/provenance/task-402-attribution-chain/planner/expected.json new file mode 100644 index 0000000..cb49916 --- /dev/null +++ b/fixtures/provenance/task-402-attribution-chain/planner/expected.json @@ -0,0 +1,22 @@ +{ + "tasks": [ + { + "id": "add-attribution-comments", + "description": "Add attribution comments to derived code in src/utils/derived.ts", + "file": "src/utils/derived.ts", + "type": "refactor", + "complexity": "low", + "dependsOn": [] + }, + { + "id": "update-attribution-doc", + "description": "Update ATTRIBUTION.md with license compliance information", + "file": "ATTRIBUTION.md", + "type": "feature", + "complexity": "low", + "dependsOn": ["add-attribution-comments"] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/provenance/task-402-attribution-chain/planner/prompt.md b/fixtures/provenance/task-402-attribution-chain/planner/prompt.md new file mode 100644 index 0000000..2569420 --- /dev/null +++ b/fixtures/provenance/task-402-attribution-chain/planner/prompt.md @@ -0,0 +1,6 @@ +Using the architect's spec for maintaining attribution chains, produce a task list +that ensures proper attribution and license compliance. + +Requirements: +- Include tasks for documenting attribution +- Ensure license compliance is maintained diff --git a/fixtures/provenance/task-402-attribution-chain/planner/verify.ts b/fixtures/provenance/task-402-attribution-chain/planner/verify.ts new file mode 100644 index 0000000..0d85fbf --- /dev/null +++ b/fixtures/provenance/task-402-attribution-chain/planner/verify.ts @@ -0,0 +1,23 @@ +import { + verifyPlanner, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyPlanner(ctx, (out) => { + const hasAttributionTask = out.tasks.some( + (t) => + t.description.toLowerCase().includes("attribution") || + t.description.toLowerCase().includes("license") + ); + if (!hasAttributionTask) { + return { + ok: false, + reason: "Planner must include a task for attribution or license compliance.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/provenance/task-402-attribution-chain/reviewer/expected.json b/fixtures/provenance/task-402-attribution-chain/reviewer/expected.json new file mode 100644 index 0000000..c05e099 --- /dev/null +++ b/fixtures/provenance/task-402-attribution-chain/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Attribution chain correctly documented with license compliance information.", + "path": "src/utils/derived.ts", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/provenance/task-402-attribution-chain/reviewer/prompt.md b/fixtures/provenance/task-402-attribution-chain/reviewer/prompt.md new file mode 100644 index 0000000..b2a8ff8 --- /dev/null +++ b/fixtures/provenance/task-402-attribution-chain/reviewer/prompt.md @@ -0,0 +1,12 @@ +You are the reviewer agent. + +Review a patch that adds attribution documentation to derived code. + +Your responsibilities: +- Verify the attribution is accurate and complete +- Ensure license compliance information is included +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/provenance/task-402-attribution-chain/reviewer/verify.ts b/fixtures/provenance/task-402-attribution-chain/reviewer/verify.ts new file mode 100644 index 0000000..8dafe92 --- /dev/null +++ b/fixtures/provenance/task-402-attribution-chain/reviewer/verify.ts @@ -0,0 +1,25 @@ +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: "Reviewer should approve accurate attribution documentation.", + }; + } + + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer should include at least one comment about attribution.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/provenance/task-403-dependency-tracking/architect/expected.json b/fixtures/provenance/task-403-dependency-tracking/architect/expected.json new file mode 100644 index 0000000..a612f82 --- /dev/null +++ b/fixtures/provenance/task-403-dependency-tracking/architect/expected.json @@ -0,0 +1,11 @@ +{ + "highLevelSummary": "Track and document dependencies between files, creating a dependency graph to understand the impact of changes and identify affected files.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/core/module.ts", + "src/utils/helper.ts", + "DEPENDENCIES.md" + ] +} diff --git a/fixtures/provenance/task-403-dependency-tracking/architect/prompt.md b/fixtures/provenance/task-403-dependency-tracking/architect/prompt.md new file mode 100644 index 0000000..7892bcb --- /dev/null +++ b/fixtures/provenance/task-403-dependency-tracking/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for tracking dependencies in code changes. + +The task involves understanding and documenting dependencies: +- Track which files depend on which other files +- Document the dependency graph for a module +- Identify potential impact of changes + +Requirements: +- Describe the dependency tracking approach +- Document the dependency graph +- Identify files that would be affected by changes + +Non-goals: +- Do not modify the functional code +- Do not break existing dependencies diff --git a/fixtures/provenance/task-403-dependency-tracking/architect/verify.ts b/fixtures/provenance/task-403-dependency-tracking/architect/verify.ts new file mode 100644 index 0000000..60f2ec9 --- /dev/null +++ b/fixtures/provenance/task-403-dependency-tracking/architect/verify.ts @@ -0,0 +1,20 @@ +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("depend") && !summary.includes("track")) { + return { + ok: false, + reason: "highLevelSummary must mention dependencies or tracking", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/provenance/task-403-dependency-tracking/coder/expected.patch b/fixtures/provenance/task-403-dependency-tracking/coder/expected.patch new file mode 100644 index 0000000..4c9c449 --- /dev/null +++ b/fixtures/provenance/task-403-dependency-tracking/coder/expected.patch @@ -0,0 +1,21 @@ +diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md +new file mode 100644 +index 0000000..0000001 +--- /dev/null ++++ b/DEPENDENCIES.md +@@ -0,0 +1,15 @@ ++# Dependency Graph ++ ++## src/core/module.ts ++- Depends on: `src/utils/helper.ts` ++- Depended by: `src/main.ts` ++ ++## src/utils/helper.ts ++- Depends on: none ++- Depended by: `src/core/module.ts`, `src/services/api.ts` ++ ++## Impact Analysis ++ ++Changes to `src/utils/helper.ts` will affect: ++- `src/core/module.ts` ++- `src/services/api.ts` diff --git a/fixtures/provenance/task-403-dependency-tracking/coder/prompt.md b/fixtures/provenance/task-403-dependency-tracking/coder/prompt.md new file mode 100644 index 0000000..1d09c97 --- /dev/null +++ b/fixtures/provenance/task-403-dependency-tracking/coder/prompt.md @@ -0,0 +1,9 @@ +You are the coder agent. Apply the architect and planner guidance to document +the dependency graph. + +Requirements: +- Create DEPENDENCIES.md documenting the dependency graph +- Show which files depend on which other files +- Do not modify the functional code + +Return a unified diff patch that adds dependency documentation. diff --git a/fixtures/provenance/task-403-dependency-tracking/coder/verify.ts b/fixtures/provenance/task-403-dependency-tracking/coder/verify.ts new file mode 100644 index 0000000..85d018f --- /dev/null +++ b/fixtures/provenance/task-403-dependency-tracking/coder/verify.ts @@ -0,0 +1,18 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("Depend") && !patch.includes("depend")) { + return { + ok: false, + reason: "Patch must include dependency documentation.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/provenance/task-403-dependency-tracking/planner/expected.json b/fixtures/provenance/task-403-dependency-tracking/planner/expected.json new file mode 100644 index 0000000..a7f48cc --- /dev/null +++ b/fixtures/provenance/task-403-dependency-tracking/planner/expected.json @@ -0,0 +1,14 @@ +{ + "tasks": [ + { + "id": "document-dependencies", + "description": "Document the dependency graph showing which files depend on which other files", + "file": "DEPENDENCIES.md", + "type": "feature", + "complexity": "low", + "dependsOn": [] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/provenance/task-403-dependency-tracking/planner/prompt.md b/fixtures/provenance/task-403-dependency-tracking/planner/prompt.md new file mode 100644 index 0000000..ef67b86 --- /dev/null +++ b/fixtures/provenance/task-403-dependency-tracking/planner/prompt.md @@ -0,0 +1,6 @@ +Using the architect's spec for tracking dependencies, produce a task list +that documents the dependency graph. + +Requirements: +- Include tasks for documenting dependencies +- Track which files depend on which other files diff --git a/fixtures/provenance/task-403-dependency-tracking/planner/verify.ts b/fixtures/provenance/task-403-dependency-tracking/planner/verify.ts new file mode 100644 index 0000000..f4c8baa --- /dev/null +++ b/fixtures/provenance/task-403-dependency-tracking/planner/verify.ts @@ -0,0 +1,23 @@ +import { + verifyPlanner, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyPlanner(ctx, (out) => { + const hasDependencyTask = out.tasks.some( + (t) => + t.description.toLowerCase().includes("depend") || + t.description.toLowerCase().includes("graph") + ); + if (!hasDependencyTask) { + return { + ok: false, + reason: "Planner must include a task for documenting dependencies.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/provenance/task-403-dependency-tracking/reviewer/expected.json b/fixtures/provenance/task-403-dependency-tracking/reviewer/expected.json new file mode 100644 index 0000000..b22b931 --- /dev/null +++ b/fixtures/provenance/task-403-dependency-tracking/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Dependency graph correctly documents file relationships and impact analysis.", + "path": "DEPENDENCIES.md", + "line": 1, + "blocking": false + } + ] +} diff --git a/fixtures/provenance/task-403-dependency-tracking/reviewer/prompt.md b/fixtures/provenance/task-403-dependency-tracking/reviewer/prompt.md new file mode 100644 index 0000000..e1a2f6d --- /dev/null +++ b/fixtures/provenance/task-403-dependency-tracking/reviewer/prompt.md @@ -0,0 +1,12 @@ +You are the reviewer agent. + +Review a patch that adds dependency documentation. + +Your responsibilities: +- Verify the dependency graph is accurate and complete +- Ensure the documentation is useful for understanding impact +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/provenance/task-403-dependency-tracking/reviewer/verify.ts b/fixtures/provenance/task-403-dependency-tracking/reviewer/verify.ts new file mode 100644 index 0000000..8a5aa1c --- /dev/null +++ b/fixtures/provenance/task-403-dependency-tracking/reviewer/verify.ts @@ -0,0 +1,25 @@ +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: "Reviewer should approve accurate dependency documentation.", + }; + } + + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer should include at least one comment about dependencies.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/reviewer-behavior/task-406-blocking-comment-required/architect/expected.json b/fixtures/reviewer-behavior/task-406-blocking-comment-required/architect/expected.json new file mode 100644 index 0000000..b89b585 --- /dev/null +++ b/fixtures/reviewer-behavior/task-406-blocking-comment-required/architect/expected.json @@ -0,0 +1,9 @@ +{ + "highLevelSummary": "Fix SQL injection vulnerability in src/db/query.ts. This is a security-critical change requiring thorough review with blocking comments for any issues found.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/db/query.ts" + ] +} diff --git a/fixtures/reviewer-behavior/task-406-blocking-comment-required/architect/prompt.md b/fixtures/reviewer-behavior/task-406-blocking-comment-required/architect/prompt.md new file mode 100644 index 0000000..44394a1 --- /dev/null +++ b/fixtures/reviewer-behavior/task-406-blocking-comment-required/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for a change that requires blocking review comments. + +The task involves a critical security fix: +- Fix SQL injection vulnerability in `src/db/query.ts` +- This is a security-critical change that must be reviewed carefully +- Any issues found must be marked as blocking + +Requirements: +- Describe the security fix needed +- Emphasize the critical nature of the change +- Require thorough review with blocking comments for any issues + +Non-goals: +- Do not introduce new features +- Do not refactor unrelated code diff --git a/fixtures/reviewer-behavior/task-406-blocking-comment-required/architect/verify.ts b/fixtures/reviewer-behavior/task-406-blocking-comment-required/architect/verify.ts new file mode 100644 index 0000000..de21621 --- /dev/null +++ b/fixtures/reviewer-behavior/task-406-blocking-comment-required/architect/verify.ts @@ -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("security") && !summary.includes("sql") && !summary.includes("injection")) { + return { + ok: false, + reason: "highLevelSummary must mention security or SQL injection", + }; + } + + if (!summary.includes("blocking") && !summary.includes("critical")) { + return { + ok: false, + reason: "highLevelSummary must mention blocking or critical nature", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/reviewer-behavior/task-406-blocking-comment-required/coder/expected.patch b/fixtures/reviewer-behavior/task-406-blocking-comment-required/coder/expected.patch new file mode 100644 index 0000000..cddbb6f --- /dev/null +++ b/fixtures/reviewer-behavior/task-406-blocking-comment-required/coder/expected.patch @@ -0,0 +1,16 @@ +diff --git a/src/db/query.ts b/src/db/query.ts +index 0000000..0000001 100644 +--- a/src/db/query.ts ++++ b/src/db/query.ts +@@ -1,5 +1,5 @@ +-export function getUserById(id: string): string { +- return `SELECT * FROM users WHERE id = '${id}'`; ++export function getUserById(id: string): { query: string; params: string[] } { ++ return { query: "SELECT * FROM users WHERE id = $1", params: [id] }; + } + +-export function searchUsers(name: string): string { +- return `SELECT * FROM users WHERE name LIKE '%${name}%'`; ++export function searchUsers(name: string): { query: string; params: string[] } { ++ return { query: "SELECT * FROM users WHERE name LIKE $1", params: [`%${name}%`] }; + } diff --git a/fixtures/reviewer-behavior/task-406-blocking-comment-required/coder/prompt.md b/fixtures/reviewer-behavior/task-406-blocking-comment-required/coder/prompt.md new file mode 100644 index 0000000..f90373e --- /dev/null +++ b/fixtures/reviewer-behavior/task-406-blocking-comment-required/coder/prompt.md @@ -0,0 +1,9 @@ +You are the coder agent. Apply the architect and planner guidance to fix +the SQL injection vulnerability. + +Requirements: +- Fix the SQL injection vulnerability in src/db/query.ts +- Use parameterized queries instead of string concatenation +- This is a security-critical change + +Return a unified diff patch that fixes the vulnerability. diff --git a/fixtures/reviewer-behavior/task-406-blocking-comment-required/coder/verify.ts b/fixtures/reviewer-behavior/task-406-blocking-comment-required/coder/verify.ts new file mode 100644 index 0000000..b4a21e0 --- /dev/null +++ b/fixtures/reviewer-behavior/task-406-blocking-comment-required/coder/verify.ts @@ -0,0 +1,25 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("query.ts")) { + return { + ok: false, + reason: "Patch must modify src/db/query.ts.", + }; + } + + if (!patch.includes("param") && !patch.includes("$1")) { + return { + ok: false, + reason: "Patch must use parameterized queries to fix SQL injection.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/reviewer-behavior/task-406-blocking-comment-required/planner/expected.json b/fixtures/reviewer-behavior/task-406-blocking-comment-required/planner/expected.json new file mode 100644 index 0000000..2bc811d --- /dev/null +++ b/fixtures/reviewer-behavior/task-406-blocking-comment-required/planner/expected.json @@ -0,0 +1,14 @@ +{ + "tasks": [ + { + "id": "fix-sql-injection", + "description": "Fix SQL injection vulnerability in src/db/query.ts by using parameterized queries", + "file": "src/db/query.ts", + "type": "fix", + "complexity": "medium", + "dependsOn": [] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/reviewer-behavior/task-406-blocking-comment-required/planner/prompt.md b/fixtures/reviewer-behavior/task-406-blocking-comment-required/planner/prompt.md new file mode 100644 index 0000000..aad58f7 --- /dev/null +++ b/fixtures/reviewer-behavior/task-406-blocking-comment-required/planner/prompt.md @@ -0,0 +1,8 @@ +Using the architect's spec for a security-critical fix, produce a task list +that addresses the SQL injection vulnerability. + +Target file: src/db/query.ts + +Requirements: +- Include tasks for fixing the security vulnerability +- This is a critical fix requiring careful review diff --git a/fixtures/reviewer-behavior/task-406-blocking-comment-required/planner/verify.ts b/fixtures/reviewer-behavior/task-406-blocking-comment-required/planner/verify.ts new file mode 100644 index 0000000..ed9c49c --- /dev/null +++ b/fixtures/reviewer-behavior/task-406-blocking-comment-required/planner/verify.ts @@ -0,0 +1,32 @@ +import { + verifyPlanner, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyPlanner(ctx, (out) => { + const hasSecurityTask = out.tasks.some( + (t) => + t.description.toLowerCase().includes("sql") || + t.description.toLowerCase().includes("injection") || + t.description.toLowerCase().includes("security") + ); + if (!hasSecurityTask) { + return { + ok: false, + reason: "Planner must include a task for fixing the security vulnerability.", + }; + } + + const hasFixType = out.tasks.some((t) => t.type === "fix"); + if (!hasFixType) { + return { + ok: false, + reason: "Planner must include a fix task for the security issue.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/reviewer-behavior/task-406-blocking-comment-required/reviewer/expected.json b/fixtures/reviewer-behavior/task-406-blocking-comment-required/reviewer/expected.json new file mode 100644 index 0000000..9aad321 --- /dev/null +++ b/fixtures/reviewer-behavior/task-406-blocking-comment-required/reviewer/expected.json @@ -0,0 +1,11 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Security fix correctly uses parameterized queries to prevent SQL injection.", + "path": "src/db/query.ts", + "line": 2, + "blocking": false + } + ] +} diff --git a/fixtures/reviewer-behavior/task-406-blocking-comment-required/reviewer/prompt.md b/fixtures/reviewer-behavior/task-406-blocking-comment-required/reviewer/prompt.md new file mode 100644 index 0000000..a80df82 --- /dev/null +++ b/fixtures/reviewer-behavior/task-406-blocking-comment-required/reviewer/prompt.md @@ -0,0 +1,15 @@ +You are the reviewer agent. + +Review a patch that fixes a SQL injection vulnerability. + +Target file: src/db/query.ts + +Your responsibilities: +- This is a security-critical change requiring thorough review +- Any issues found MUST be marked as blocking +- Verify the fix properly addresses the SQL injection vulnerability +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/reviewer-behavior/task-406-blocking-comment-required/reviewer/verify.ts b/fixtures/reviewer-behavior/task-406-blocking-comment-required/reviewer/verify.ts new file mode 100644 index 0000000..7d45a91 --- /dev/null +++ b/fixtures/reviewer-behavior/task-406-blocking-comment-required/reviewer/verify.ts @@ -0,0 +1,26 @@ +import { + verifyReviewer, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyReviewer(ctx, (out) => { + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer must include at least one comment for security-critical changes.", + }; + } + + const hasBlockingField = out.comments.every((c) => typeof c.blocking === "boolean"); + if (!hasBlockingField) { + return { + ok: false, + reason: "All comments must include a blocking field for security reviews.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/reviewer-behavior/task-408-grounded-comments/architect/expected.json b/fixtures/reviewer-behavior/task-408-grounded-comments/architect/expected.json new file mode 100644 index 0000000..86fbaf8 --- /dev/null +++ b/fixtures/reviewer-behavior/task-408-grounded-comments/architect/expected.json @@ -0,0 +1,9 @@ +{ + "highLevelSummary": "Refactor src/utils/transform.ts to improve readability. Review comments must be grounded in actual patch lines with no speculative or hypothetical feedback.", + "pagesOrScreens": [], + "apis": [], + "dataModels": [], + "recommendedFileStructure": [ + "src/utils/transform.ts" + ] +} diff --git a/fixtures/reviewer-behavior/task-408-grounded-comments/architect/prompt.md b/fixtures/reviewer-behavior/task-408-grounded-comments/architect/prompt.md new file mode 100644 index 0000000..e9a24f0 --- /dev/null +++ b/fixtures/reviewer-behavior/task-408-grounded-comments/architect/prompt.md @@ -0,0 +1,15 @@ +You are designing a spec for a change that requires grounded review comments. + +The task involves refactoring a utility function: +- Refactor `src/utils/transform.ts` to improve readability +- Comments must reference actual lines in the patch +- No speculative or hypothetical comments allowed + +Requirements: +- Describe the refactoring needed +- Require comments to be grounded in actual patch lines +- No abstract or speculative feedback + +Non-goals: +- Do not change functionality +- Do not add new features diff --git a/fixtures/reviewer-behavior/task-408-grounded-comments/architect/verify.ts b/fixtures/reviewer-behavior/task-408-grounded-comments/architect/verify.ts new file mode 100644 index 0000000..e1cf7cd --- /dev/null +++ b/fixtures/reviewer-behavior/task-408-grounded-comments/architect/verify.ts @@ -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("refactor") && !summary.includes("readability")) { + return { + ok: false, + reason: "highLevelSummary must mention refactoring or readability", + }; + } + + if (!summary.includes("grounded") && !summary.includes("actual")) { + return { + ok: false, + reason: "highLevelSummary must mention grounded or actual patch lines", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/reviewer-behavior/task-408-grounded-comments/coder/expected.patch b/fixtures/reviewer-behavior/task-408-grounded-comments/coder/expected.patch new file mode 100644 index 0000000..23126ab --- /dev/null +++ b/fixtures/reviewer-behavior/task-408-grounded-comments/coder/expected.patch @@ -0,0 +1,13 @@ +diff --git a/src/utils/transform.ts b/src/utils/transform.ts +index 0000000..0000001 100644 +--- a/src/utils/transform.ts ++++ b/src/utils/transform.ts +@@ -1,6 +1,10 @@ +-export function t(d: any): any { +- const r = d.map((x: any) => x * 2); +- return r.filter((x: any) => x > 0); ++export function transformData(inputData: number[]): number[] { ++ const doubledValues = inputData.map((value) => value * 2); ++ const positiveValues = doubledValues.filter((value) => value > 0); ++ return positiveValues; + } diff --git a/fixtures/reviewer-behavior/task-408-grounded-comments/coder/prompt.md b/fixtures/reviewer-behavior/task-408-grounded-comments/coder/prompt.md new file mode 100644 index 0000000..6646816 --- /dev/null +++ b/fixtures/reviewer-behavior/task-408-grounded-comments/coder/prompt.md @@ -0,0 +1,9 @@ +You are the coder agent. Apply the architect and planner guidance to refactor +the transform utility for improved readability. + +Requirements: +- Refactor src/utils/transform.ts for better readability +- Use clearer variable names and function structure +- Do not change functionality + +Return a unified diff patch that improves readability. diff --git a/fixtures/reviewer-behavior/task-408-grounded-comments/coder/verify.ts b/fixtures/reviewer-behavior/task-408-grounded-comments/coder/verify.ts new file mode 100644 index 0000000..1397cdf --- /dev/null +++ b/fixtures/reviewer-behavior/task-408-grounded-comments/coder/verify.ts @@ -0,0 +1,18 @@ +import { + verifyCoder, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyCoder(ctx, (patch) => { + if (!patch.includes("transform.ts")) { + return { + ok: false, + reason: "Patch must modify src/utils/transform.ts.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/reviewer-behavior/task-408-grounded-comments/planner/expected.json b/fixtures/reviewer-behavior/task-408-grounded-comments/planner/expected.json new file mode 100644 index 0000000..927cbad --- /dev/null +++ b/fixtures/reviewer-behavior/task-408-grounded-comments/planner/expected.json @@ -0,0 +1,14 @@ +{ + "tasks": [ + { + "id": "refactor-transform", + "description": "Refactor src/utils/transform.ts to improve readability with clearer variable names and function structure", + "file": "src/utils/transform.ts", + "type": "refactor", + "complexity": "low", + "dependsOn": [] + } + ], + "ambiguities": [], + "invalidTaskCount": 0 +} diff --git a/fixtures/reviewer-behavior/task-408-grounded-comments/planner/prompt.md b/fixtures/reviewer-behavior/task-408-grounded-comments/planner/prompt.md new file mode 100644 index 0000000..c8ec3e7 --- /dev/null +++ b/fixtures/reviewer-behavior/task-408-grounded-comments/planner/prompt.md @@ -0,0 +1,8 @@ +Using the architect's spec for refactoring with grounded comments, produce a task list +that addresses the readability improvements. + +Target file: src/utils/transform.ts + +Requirements: +- Include tasks for refactoring to improve readability +- Comments must reference actual lines in the patch diff --git a/fixtures/reviewer-behavior/task-408-grounded-comments/planner/verify.ts b/fixtures/reviewer-behavior/task-408-grounded-comments/planner/verify.ts new file mode 100644 index 0000000..0f8fba5 --- /dev/null +++ b/fixtures/reviewer-behavior/task-408-grounded-comments/planner/verify.ts @@ -0,0 +1,24 @@ +import { + verifyPlanner, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyPlanner(ctx, (out) => { + const hasRefactorTask = out.tasks.some( + (t) => + t.type === "refactor" || + t.description.toLowerCase().includes("refactor") || + t.description.toLowerCase().includes("readability") + ); + if (!hasRefactorTask) { + return { + ok: false, + reason: "Planner must include a refactor task for readability improvements.", + }; + } + + return { ok: true }; + }); +} diff --git a/fixtures/reviewer-behavior/task-408-grounded-comments/reviewer/expected.json b/fixtures/reviewer-behavior/task-408-grounded-comments/reviewer/expected.json new file mode 100644 index 0000000..67621cd --- /dev/null +++ b/fixtures/reviewer-behavior/task-408-grounded-comments/reviewer/expected.json @@ -0,0 +1,17 @@ +{ + "decision": "approve", + "comments": [ + { + "message": "Good refactoring: renamed 't' to 'transformData' and 'd' to 'inputData' for clarity.", + "path": "src/utils/transform.ts", + "line": 1, + "blocking": false + }, + { + "message": "Variable names 'doubledValues' and 'positiveValues' clearly describe their purpose.", + "path": "src/utils/transform.ts", + "line": 2, + "blocking": false + } + ] +} diff --git a/fixtures/reviewer-behavior/task-408-grounded-comments/reviewer/prompt.md b/fixtures/reviewer-behavior/task-408-grounded-comments/reviewer/prompt.md new file mode 100644 index 0000000..3849867 --- /dev/null +++ b/fixtures/reviewer-behavior/task-408-grounded-comments/reviewer/prompt.md @@ -0,0 +1,15 @@ +You are the reviewer agent. + +Review a patch that refactors a utility for improved readability. + +Target file: src/utils/transform.ts + +Your responsibilities: +- Comments must be grounded in actual patch lines +- No speculative or hypothetical comments allowed +- Reference specific line numbers and code changes +- Use structured comments with a `blocking: boolean` field for each issue + +Return: +- `decision`: `"approve" | "revise" | "reject"` +- `comments[]`: structured comments with `blocking: true | false` diff --git a/fixtures/reviewer-behavior/task-408-grounded-comments/reviewer/verify.ts b/fixtures/reviewer-behavior/task-408-grounded-comments/reviewer/verify.ts new file mode 100644 index 0000000..b062304 --- /dev/null +++ b/fixtures/reviewer-behavior/task-408-grounded-comments/reviewer/verify.ts @@ -0,0 +1,36 @@ +import { + verifyReviewer, + type VerifyCtx, + type VerifyResult, +} from "@kit/fixture-helpers"; + +export function verify(ctx: VerifyCtx): VerifyResult { + return verifyReviewer(ctx, (out) => { + if (out.comments.length === 0) { + return { + ok: false, + reason: "Reviewer must include at least one grounded comment.", + }; + } + + const hasGroundedComments = out.comments.every( + (c) => c.path && typeof c.line === "number" + ); + if (!hasGroundedComments) { + return { + ok: false, + reason: "All comments must be grounded with path and line number.", + }; + } + + const hasBlockingField = out.comments.every((c) => typeof c.blocking === "boolean"); + if (!hasBlockingField) { + return { + ok: false, + reason: "All comments must include a blocking field.", + }; + } + + return { ok: true }; + }); +} diff --git a/package-lock.json b/package-lock.json index 930dd51..ad3c234 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,7 @@ "": { "name": "test-fixtures", "version": "0.1.0", + "license": "SEE LICENSE", "devDependencies": { "@types/node": "^24.10.1", "husky": "^9.1.7", From 1af8f9014549165352a08b540881e853f3abe782 Mon Sep 17 00:00:00 2001 From: PM Palles Date: Fri, 5 Dec 2025 11:03:32 -0500 Subject: [PATCH 2/2] fix: ts compilation --- tsconfig.json | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 839931e..cb31f5b 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,5 +13,13 @@ }, "types": ["node"] }, - "include": ["src", "fixtures"] + "include": [ + "src", + "fixtures" + ], + "exclude": [ + "node_modules", + "dist", + "fixtures/**/repo/**" + ] }