agent-bober 0.11.6 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/CHANGELOG.md +98 -0
  2. package/README.md +12 -6
  3. package/agents/bober-evaluator.md +38 -0
  4. package/agents/bober-generator.md +54 -0
  5. package/agents/bober-planner.md +256 -34
  6. package/dist/cli/commands/eval.js +6 -6
  7. package/dist/cli/commands/eval.js.map +1 -1
  8. package/dist/cli/commands/init.js +46 -2
  9. package/dist/cli/commands/init.js.map +1 -1
  10. package/dist/cli/commands/plan.d.ts +12 -0
  11. package/dist/cli/commands/plan.d.ts.map +1 -1
  12. package/dist/cli/commands/plan.js +232 -37
  13. package/dist/cli/commands/plan.js.map +1 -1
  14. package/dist/cli/commands/run.js +2 -2
  15. package/dist/cli/commands/run.js.map +1 -1
  16. package/dist/cli/commands/sprint.d.ts.map +1 -1
  17. package/dist/cli/commands/sprint.js +8 -8
  18. package/dist/cli/commands/sprint.js.map +1 -1
  19. package/dist/cli/index.js +23 -2
  20. package/dist/cli/index.js.map +1 -1
  21. package/dist/config/schema.d.ts +40 -40
  22. package/dist/contracts/eval-result.d.ts +38 -38
  23. package/dist/contracts/index.d.ts +2 -2
  24. package/dist/contracts/index.d.ts.map +1 -1
  25. package/dist/contracts/index.js +8 -4
  26. package/dist/contracts/index.js.map +1 -1
  27. package/dist/contracts/spec.d.ts +335 -40
  28. package/dist/contracts/spec.d.ts.map +1 -1
  29. package/dist/contracts/spec.js +210 -18
  30. package/dist/contracts/spec.js.map +1 -1
  31. package/dist/contracts/sprint-contract.d.ts +155 -88
  32. package/dist/contracts/sprint-contract.d.ts.map +1 -1
  33. package/dist/contracts/sprint-contract.js +176 -29
  34. package/dist/contracts/sprint-contract.js.map +1 -1
  35. package/dist/evaluators/builtin/api-check.js +1 -1
  36. package/dist/evaluators/builtin/api-check.js.map +1 -1
  37. package/dist/index.d.ts +2 -2
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +2 -2
  40. package/dist/index.js.map +1 -1
  41. package/dist/mcp/tools/contracts.js +2 -2
  42. package/dist/mcp/tools/contracts.js.map +1 -1
  43. package/dist/mcp/tools/eval.js +8 -8
  44. package/dist/mcp/tools/eval.js.map +1 -1
  45. package/dist/mcp/tools/plan.d.ts.map +1 -1
  46. package/dist/mcp/tools/plan.js +40 -14
  47. package/dist/mcp/tools/plan.js.map +1 -1
  48. package/dist/mcp/tools/sprint.d.ts.map +1 -1
  49. package/dist/mcp/tools/sprint.js +11 -11
  50. package/dist/mcp/tools/sprint.js.map +1 -1
  51. package/dist/orchestrator/context-handoff.d.ts +484 -224
  52. package/dist/orchestrator/context-handoff.d.ts.map +1 -1
  53. package/dist/orchestrator/context-handoff.js +32 -12
  54. package/dist/orchestrator/context-handoff.js.map +1 -1
  55. package/dist/orchestrator/curator-agent.d.ts.map +1 -1
  56. package/dist/orchestrator/curator-agent.js +4 -4
  57. package/dist/orchestrator/curator-agent.js.map +1 -1
  58. package/dist/orchestrator/evaluator-agent.js +2 -2
  59. package/dist/orchestrator/evaluator-agent.js.map +1 -1
  60. package/dist/orchestrator/generator-agent.js +3 -3
  61. package/dist/orchestrator/generator-agent.js.map +1 -1
  62. package/dist/orchestrator/model-resolver.js +2 -2
  63. package/dist/orchestrator/model-resolver.js.map +1 -1
  64. package/dist/orchestrator/pipeline.d.ts +7 -0
  65. package/dist/orchestrator/pipeline.d.ts.map +1 -1
  66. package/dist/orchestrator/pipeline.js +67 -28
  67. package/dist/orchestrator/pipeline.js.map +1 -1
  68. package/dist/orchestrator/planner-agent.d.ts +21 -1
  69. package/dist/orchestrator/planner-agent.d.ts.map +1 -1
  70. package/dist/orchestrator/planner-agent.js +11 -2
  71. package/dist/orchestrator/planner-agent.js.map +1 -1
  72. package/dist/state/history.d.ts.map +1 -1
  73. package/dist/state/history.js +3 -3
  74. package/dist/state/history.js.map +1 -1
  75. package/dist/state/plan-state.js +1 -1
  76. package/dist/state/plan-state.js.map +1 -1
  77. package/dist/state/sprint-state.d.ts +9 -2
  78. package/dist/state/sprint-state.d.ts.map +1 -1
  79. package/dist/state/sprint-state.js +25 -11
  80. package/dist/state/sprint-state.js.map +1 -1
  81. package/package.json +2 -1
  82. package/scripts/migrate-specs.mjs +127 -0
  83. package/scripts/sync-skills.mjs +96 -0
  84. package/skills/bober.plan/SKILL.md +41 -0
  85. package/skills/bober.plan/references/spec-schema.md +31 -4
  86. package/skills/bober.run/SKILL.md +41 -7
  87. package/skills/bober.sprint/SKILL.md +6 -259
@@ -1,51 +1,243 @@
1
1
  import { z } from "zod";
2
+ // ── Constants ───────────────────────────────────────────────────────
3
+ /**
4
+ * Threshold at which a spec must be marked needs-clarification rather than
5
+ * proceeding to sprint decomposition. Mirrors the planner agent's autonomous
6
+ * mode rule. Scores are 0..10 inclusive.
7
+ */
8
+ export const AMBIGUITY_BLOCK_THRESHOLD = 7;
2
9
  // ── Enums ───────────────────────────────────────────────────────────
3
- export const PrioritySchema = z.enum(["must", "should", "could"]);
10
+ export const PrioritySchema = z.enum([
11
+ "must-have",
12
+ "should-have",
13
+ "nice-to-have",
14
+ ]);
15
+ export const EstimatedComplexitySchema = z.enum(["low", "medium", "high"]);
16
+ /**
17
+ * Lifecycle of a plan spec.
18
+ *
19
+ * - `draft` — planner just emitted, no sprints run yet
20
+ * - `needs-clarification` — planner refused to fully decompose: ambiguityScore
21
+ * >= 7 OR open questions remain. The pipeline will not run sprints from
22
+ * this spec until status flips to `ready`.
23
+ * - `ready` — clarifications resolved (or never needed), pipeline may proceed
24
+ * - `in-progress` — at least one sprint has started
25
+ * - `completed` — all sprints finished
26
+ * - `abandoned` — planner or user explicitly dropped this spec
27
+ */
28
+ export const PlanSpecStatusSchema = z.enum([
29
+ "draft",
30
+ "needs-clarification",
31
+ "ready",
32
+ "in-progress",
33
+ "completed",
34
+ "abandoned",
35
+ ]);
36
+ export const PlanSpecModeSchema = z.enum(["greenfield", "brownfield"]);
37
+ /**
38
+ * Categories the planner uses to group clarifying questions. Matches the
39
+ * categories listed in `.claude/agents/bober-planner.md` Phase 2.
40
+ */
41
+ export const ClarificationCategorySchema = z.enum([
42
+ "scope",
43
+ "user-personas",
44
+ "data-model",
45
+ "tech-constraints",
46
+ "design-ux",
47
+ "integrations",
48
+ "non-functional",
49
+ "error-handling",
50
+ "integration-risk",
51
+ "pattern-conflict",
52
+ "regression-risk",
53
+ "other",
54
+ ]);
55
+ // ── Sub-types ───────────────────────────────────────────────────────
56
+ export const ClarificationOptionSchema = z.object({
57
+ /** Short label shown to the user (e.g. "A", "B", "Custom") */
58
+ label: z.string().min(1),
59
+ /** What this option means in plain English */
60
+ description: z.string().min(1),
61
+ });
62
+ export const ClarificationQuestionSchema = z.object({
63
+ questionId: z.string().min(1),
64
+ category: ClarificationCategorySchema,
65
+ /** The question itself — should end with a "?" */
66
+ question: z.string().min(5),
67
+ /** Optional multiple-choice options, including an "Other" escape hatch */
68
+ options: z.array(ClarificationOptionSchema).optional(),
69
+ /** Planner's recommended answer based on codebase evidence */
70
+ recommendation: z.string().optional(),
71
+ /**
72
+ * How much this question contributes to the overall ambiguityScore.
73
+ * Useful for the user to know which questions matter most to resolve.
74
+ */
75
+ ambiguityWeight: z.number().int().min(0).max(10).optional(),
76
+ });
77
+ export const ResolvedClarificationSchema = z.object({
78
+ questionId: z.string().min(1),
79
+ /** The user-supplied answer (free-form, may reference an option label) */
80
+ answer: z.string().min(1),
81
+ /** ISO 8601 timestamp when the answer was recorded */
82
+ resolvedAt: z.string().datetime({ offset: true }),
83
+ /** Who answered: "user" (interactive) or "planner" (autonomous self-answer) */
84
+ resolvedBy: z.enum(["user", "planner"]).default("user"),
85
+ });
4
86
  // ── Feature Spec ────────────────────────────────────────────────────
5
87
  export const FeatureSpecSchema = z.object({
6
- id: z.string().min(1),
88
+ featureId: z.string().min(1),
7
89
  title: z.string().min(1),
8
90
  description: z.string().min(1),
9
91
  priority: PrioritySchema,
10
- estimatedSprints: z.number().int().min(1),
11
- acceptanceCriteria: z.array(z.string().min(1)),
92
+ acceptanceCriteria: z.array(z.string().min(1)).min(1),
93
+ dependencies: z.array(z.string()).default([]),
94
+ estimatedComplexity: EstimatedComplexitySchema.optional(),
95
+ /** Legacy field kept for backward compat — prefer estimatedComplexity */
96
+ estimatedSprints: z.number().int().min(1).optional(),
12
97
  });
13
98
  // ── Plan Spec ───────────────────────────────────────────────────────
14
99
  export const PlanSpecSchema = z.object({
15
- id: z.string().min(1),
100
+ // Identity
101
+ specId: z.string().min(1),
102
+ version: z.number().int().min(1).default(1),
16
103
  title: z.string().min(1),
17
104
  description: z.string().min(1),
18
- projectType: z.string().min(1),
19
- techStack: z.array(z.string()),
105
+ // Lifecycle
106
+ status: PlanSpecStatusSchema,
107
+ mode: PlanSpecModeSchema,
108
+ // Features — what the user is asking for
20
109
  features: z.array(FeatureSpecSchema),
21
- nonFunctional: z.array(z.string()),
22
- constraints: z.array(z.string()),
23
- createdAt: z.string().datetime(),
24
- updatedAt: z.string().datetime(),
110
+ // Planning context — how the planner reasoned about the request
111
+ assumptions: z.array(z.string()).default([]),
112
+ outOfScope: z.array(z.string()).default([]),
113
+ // Clarification gate — NEW
114
+ /**
115
+ * Self-rated ambiguity 0..10. >= AMBIGUITY_BLOCK_THRESHOLD must result in
116
+ * status === "needs-clarification" with at least one open question.
117
+ */
118
+ ambiguityScore: z.number().int().min(0).max(10).optional(),
119
+ /** Open questions awaiting user answer. Empty when status is ready/completed. */
120
+ clarificationQuestions: z.array(ClarificationQuestionSchema).default([]),
121
+ /** Question/answer history, both autonomous self-answers and user inputs */
122
+ resolvedClarifications: z.array(ResolvedClarificationSchema).default([]),
123
+ // Tech context (loose — schemas vary by project type)
124
+ techStack: z.array(z.string()).default([]),
125
+ techNotes: z.record(z.string(), z.unknown()).optional(),
126
+ nonFunctionalRequirements: z.array(z.unknown()).default([]),
127
+ constraints: z.array(z.string()).default([]),
128
+ // Optional inline sprint definitions (some planner emits include these)
129
+ sprints: z.array(z.unknown()).optional(),
130
+ // Arbitrary metadata
131
+ metadata: z.record(z.string(), z.unknown()).optional(),
132
+ // Timestamps
133
+ createdAt: z.string().datetime({ offset: true }),
134
+ updatedAt: z.string().datetime({ offset: true }),
135
+ completedAt: z.string().datetime({ offset: true }).optional(),
25
136
  });
26
137
  // ── Helpers ─────────────────────────────────────────────────────────
27
138
  let specCounter = 0;
28
139
  /**
29
140
  * Create a new plan specification with sensible defaults.
30
141
  */
31
- export function createSpec(title, description, features) {
142
+ export function createSpec(title, description, features, options = {}) {
32
143
  specCounter++;
33
144
  const now = new Date().toISOString();
34
- const id = `spec-${Date.now()}-${specCounter}`;
145
+ const specId = `spec-${Date.now()}-${specCounter}`;
146
+ // If clarification questions were supplied, force status to needs-clarification
147
+ // (catches caller bugs where status and questions disagree).
148
+ const hasOpenQuestions = (options.clarificationQuestions?.length ?? 0) > 0;
149
+ const status = options.status ??
150
+ (hasOpenQuestions ||
151
+ (options.ambiguityScore !== undefined &&
152
+ options.ambiguityScore >= AMBIGUITY_BLOCK_THRESHOLD)
153
+ ? "needs-clarification"
154
+ : "draft");
35
155
  return {
36
- id,
156
+ specId,
157
+ version: 1,
37
158
  title,
38
159
  description,
39
- projectType: "greenfield",
40
- techStack: [],
160
+ status,
161
+ mode: options.mode ?? "greenfield",
41
162
  features: features.map((f, idx) => ({
42
163
  ...f,
43
- id: `feature-${idx + 1}`,
164
+ featureId: `feat-${idx + 1}`,
44
165
  })),
45
- nonFunctional: [],
166
+ assumptions: options.assumptions ?? [],
167
+ outOfScope: options.outOfScope ?? [],
168
+ ambiguityScore: options.ambiguityScore,
169
+ clarificationQuestions: options.clarificationQuestions ?? [],
170
+ resolvedClarifications: [],
171
+ techStack: options.techStack ?? [],
172
+ nonFunctionalRequirements: [],
46
173
  constraints: [],
47
174
  createdAt: now,
48
175
  updatedAt: now,
49
176
  };
50
177
  }
178
+ /**
179
+ * Return true when the spec has unresolved clarification questions.
180
+ *
181
+ * NOTE: This checks question state only, NOT spec.status — `status` is
182
+ * downstream of this. If you want "is the pipeline blocked?", check
183
+ * `spec.status === "needs-clarification" || hasOpenClarifications(spec)`
184
+ * instead, or use `isPipelineReady(spec)`.
185
+ */
186
+ export function hasOpenClarifications(spec) {
187
+ const resolvedIds = new Set(spec.resolvedClarifications.map((r) => r.questionId));
188
+ return spec.clarificationQuestions.some((q) => !resolvedIds.has(q.questionId));
189
+ }
190
+ /**
191
+ * Return true when the pipeline is allowed to run sprints from this spec.
192
+ * Combines the explicit status check with the question-resolution check.
193
+ */
194
+ export function isPipelineReady(spec) {
195
+ if (spec.status === "needs-clarification")
196
+ return false;
197
+ if (spec.status === "abandoned")
198
+ return false;
199
+ if (hasOpenClarifications(spec))
200
+ return false;
201
+ return true;
202
+ }
203
+ /**
204
+ * Return the questions that haven't been answered yet.
205
+ */
206
+ export function getOpenClarifications(spec) {
207
+ const resolvedIds = new Set(spec.resolvedClarifications.map((r) => r.questionId));
208
+ return spec.clarificationQuestions.filter((q) => !resolvedIds.has(q.questionId));
209
+ }
210
+ /**
211
+ * Record an answer to a clarification question. Returns a new spec — does
212
+ * not mutate. If this answer was the last open question, the spec status
213
+ * flips from `needs-clarification` to `ready`.
214
+ *
215
+ * Throws if the questionId doesn't exist on the spec.
216
+ */
217
+ export function resolveClarification(spec, questionId, answer, resolvedBy = "user") {
218
+ const question = spec.clarificationQuestions.find((q) => q.questionId === questionId);
219
+ if (!question) {
220
+ throw new Error(`Question "${questionId}" not found on spec "${spec.specId}". ` +
221
+ `Available: ${spec.clarificationQuestions.map((q) => q.questionId).join(", ") || "(none)"}`);
222
+ }
223
+ // Strip any previous answer to the same question — last write wins
224
+ const previousAnswers = spec.resolvedClarifications.filter((r) => r.questionId !== questionId);
225
+ const resolved = {
226
+ questionId,
227
+ answer,
228
+ resolvedAt: new Date().toISOString(),
229
+ resolvedBy,
230
+ };
231
+ const updated = {
232
+ ...spec,
233
+ resolvedClarifications: [...previousAnswers, resolved],
234
+ updatedAt: new Date().toISOString(),
235
+ };
236
+ // If all questions are now answered, advance status
237
+ if (updated.status === "needs-clarification" &&
238
+ !hasOpenClarifications(updated)) {
239
+ updated.status = "ready";
240
+ }
241
+ return updated;
242
+ }
51
243
  //# sourceMappingURL=spec.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"spec.js","sourceRoot":"","sources":["../../src/contracts/spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,uEAAuE;AAEvE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC;AAGlE,uEAAuE;AAEvE,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9B,QAAQ,EAAE,cAAc;IACxB,gBAAgB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzC,kBAAkB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAC/C,CAAC,CAAC;AAGH,uEAAuE;AAEvE,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACrC,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACrB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACxB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;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,OAAO,CAAC,MAAM,GAAG,OAAO,CAAC;IAC3B,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1,141 +1,208 @@
1
1
  import { z } from "zod";
2
- export declare const ContractStatusSchema: z.ZodEnum<["proposed", "negotiating", "agreed", "in-progress", "evaluating", "passed", "failed", "needs-rework"]>;
2
+ /**
3
+ * Minimum length for a success criterion description.
4
+ * Short descriptions are usually vague ("works correctly", "looks good").
5
+ * Opus 4.7 takes prompts literally — vague criteria produce vague verification.
6
+ */
7
+ export declare const MIN_CRITERION_DESCRIPTION_LENGTH = 25;
8
+ /**
9
+ * Minimum length for definitionOfDone.
10
+ * Single-sentence summaries leak too much intent that the model has to guess.
11
+ */
12
+ export declare const MIN_DEFINITION_OF_DONE_LENGTH = 20;
13
+ /**
14
+ * Phrases that almost always indicate a vague criterion.
15
+ * Match is case-insensitive and substring-based.
16
+ */
17
+ export declare const BANNED_VAGUE_PHRASES: readonly ["works correctly", "works as expected", "looks good", "looks nice", "is reasonable", "behaves properly", "behaves correctly", "is correct", "appears correct", "as needed", "if appropriate"];
18
+ export declare const ContractStatusSchema: z.ZodEnum<["proposed", "negotiating", "agreed", "in-progress", "evaluating", "passed", "failed", "needs-rework", "completed"]>;
3
19
  export type ContractStatus = z.infer<typeof ContractStatusSchema>;
4
- export declare const FileActionSchema: z.ZodEnum<["create", "modify", "delete"]>;
5
- export type FileAction = z.infer<typeof FileActionSchema>;
20
+ /**
21
+ * Strict enum of verification methods the evaluator can actually execute.
22
+ * Free-form strings here cause the evaluator to silently skip checks.
23
+ */
24
+ export declare const VerificationMethodSchema: z.ZodEnum<["manual", "typecheck", "lint", "unit-test", "playwright", "api-check", "build", "agent-evaluation"]>;
25
+ export type VerificationMethod = z.infer<typeof VerificationMethodSchema>;
26
+ export declare const EstimatedDurationSchema: z.ZodEnum<["small", "medium", "large"]>;
27
+ export type EstimatedDuration = z.infer<typeof EstimatedDurationSchema>;
6
28
  export declare const SuccessCriterionSchema: z.ZodObject<{
7
- id: z.ZodString;
29
+ criterionId: z.ZodString;
8
30
  description: z.ZodString;
9
- verificationMethod: z.ZodString;
10
- passed: z.ZodBoolean;
11
- notes: z.ZodOptional<z.ZodString>;
31
+ verificationMethod: z.ZodEnum<["manual", "typecheck", "lint", "unit-test", "playwright", "api-check", "build", "agent-evaluation"]>;
32
+ required: z.ZodBoolean;
12
33
  }, "strip", z.ZodTypeAny, {
13
34
  description: string;
14
- id: string;
15
- verificationMethod: string;
16
- passed: boolean;
17
- notes?: string | undefined;
35
+ criterionId: string;
36
+ verificationMethod: "manual" | "typecheck" | "lint" | "unit-test" | "playwright" | "api-check" | "build" | "agent-evaluation";
37
+ required: boolean;
18
38
  }, {
19
39
  description: string;
20
- id: string;
21
- verificationMethod: string;
22
- passed: boolean;
23
- notes?: string | undefined;
40
+ criterionId: string;
41
+ verificationMethod: "manual" | "typecheck" | "lint" | "unit-test" | "playwright" | "api-check" | "build" | "agent-evaluation";
42
+ required: boolean;
24
43
  }>;
25
44
  export type SuccessCriterion = z.infer<typeof SuccessCriterionSchema>;
26
- export declare const FileChangeSchema: z.ZodObject<{
27
- path: z.ZodString;
28
- action: z.ZodEnum<["create", "modify", "delete"]>;
29
- description: z.ZodString;
30
- }, "strip", z.ZodTypeAny, {
31
- path: string;
32
- description: string;
33
- action: "create" | "modify" | "delete";
34
- }, {
35
- path: string;
36
- description: string;
37
- action: "create" | "modify" | "delete";
38
- }>;
39
- export type FileChange = z.infer<typeof FileChangeSchema>;
40
45
  export declare const SprintContractSchema: z.ZodObject<{
41
- id: z.ZodString;
42
- feature: z.ZodString;
46
+ contractId: z.ZodString;
47
+ specId: z.ZodString;
48
+ sprintNumber: z.ZodNumber;
49
+ title: z.ZodString;
43
50
  description: z.ZodString;
51
+ status: z.ZodEnum<["proposed", "negotiating", "agreed", "in-progress", "evaluating", "passed", "failed", "needs-rework", "completed"]>;
52
+ dependsOn: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
53
+ features: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
44
54
  successCriteria: z.ZodArray<z.ZodObject<{
45
- id: z.ZodString;
55
+ criterionId: z.ZodString;
46
56
  description: z.ZodString;
47
- verificationMethod: z.ZodString;
48
- passed: z.ZodBoolean;
49
- notes: z.ZodOptional<z.ZodString>;
57
+ verificationMethod: z.ZodEnum<["manual", "typecheck", "lint", "unit-test", "playwright", "api-check", "build", "agent-evaluation"]>;
58
+ required: z.ZodBoolean;
50
59
  }, "strip", z.ZodTypeAny, {
51
60
  description: string;
52
- id: string;
53
- verificationMethod: string;
54
- passed: boolean;
55
- notes?: string | undefined;
61
+ criterionId: string;
62
+ verificationMethod: "manual" | "typecheck" | "lint" | "unit-test" | "playwright" | "api-check" | "build" | "agent-evaluation";
63
+ required: boolean;
56
64
  }, {
57
65
  description: string;
58
- id: string;
59
- verificationMethod: string;
60
- passed: boolean;
61
- notes?: string | undefined;
66
+ criterionId: string;
67
+ verificationMethod: "manual" | "typecheck" | "lint" | "unit-test" | "playwright" | "api-check" | "build" | "agent-evaluation";
68
+ required: boolean;
62
69
  }>, "many">;
63
- expectedChanges: z.ZodArray<z.ZodObject<{
64
- path: z.ZodString;
65
- action: z.ZodEnum<["create", "modify", "delete"]>;
66
- description: z.ZodString;
67
- }, "strip", z.ZodTypeAny, {
68
- path: string;
69
- description: string;
70
- action: "create" | "modify" | "delete";
71
- }, {
72
- path: string;
73
- description: string;
74
- action: "create" | "modify" | "delete";
75
- }>, "many">;
76
- dependsOn: z.ZodArray<z.ZodString, "many">;
77
- status: z.ZodEnum<["proposed", "negotiating", "agreed", "in-progress", "evaluating", "passed", "failed", "needs-rework"]>;
78
- evalResults: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
70
+ /** Things the generator MUST NOT do, even if tempting. Forces explicit scope. */
71
+ nonGoals: z.ZodArray<z.ZodString, "many">;
72
+ /** Concrete signals that the sprint is finished. "Stop when X" beats "stop when done". */
73
+ stopConditions: z.ZodArray<z.ZodString, "many">;
74
+ /** Plain-English paragraph the generator can re-read mid-task to recenter. */
75
+ definitionOfDone: z.ZodString;
76
+ /** Assumptions the planner made (often self-answered clarifications). */
77
+ assumptions: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
78
+ /** Items explicitly outside this sprint's scope (deferred or never). */
79
+ outOfScope: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
80
+ /**
81
+ * Self-rated ambiguity, 0 (fully specified) to 10 (very ambiguous).
82
+ * In autonomous mode the planner should refuse to emit contracts with
83
+ * scores >= 7 and instead surface clarification questions.
84
+ */
85
+ ambiguityScore: z.ZodOptional<z.ZodNumber>;
79
86
  generatorNotes: z.ZodOptional<z.ZodString>;
87
+ evaluatorNotes: z.ZodOptional<z.ZodString>;
88
+ estimatedFiles: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
89
+ estimatedDuration: z.ZodOptional<z.ZodEnum<["small", "medium", "large"]>>;
80
90
  evaluatorFeedback: z.ZodOptional<z.ZodString>;
91
+ iterationHistory: z.ZodDefault<z.ZodArray<z.ZodUnknown, "many">>;
92
+ lastEvalId: z.ZodOptional<z.ZodNullable<z.ZodString>>;
93
+ evalResults: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
94
+ createdAt: z.ZodOptional<z.ZodString>;
95
+ updatedAt: z.ZodOptional<z.ZodString>;
81
96
  startedAt: z.ZodOptional<z.ZodString>;
82
97
  completedAt: z.ZodOptional<z.ZodString>;
83
98
  }, "strip", z.ZodTypeAny, {
84
- status: "passed" | "proposed" | "negotiating" | "agreed" | "in-progress" | "evaluating" | "failed" | "needs-rework";
99
+ contractId: string;
100
+ specId: string;
101
+ sprintNumber: number;
102
+ title: string;
85
103
  description: string;
86
- id: string;
87
- feature: string;
104
+ status: "proposed" | "negotiating" | "agreed" | "in-progress" | "evaluating" | "passed" | "failed" | "needs-rework" | "completed";
105
+ dependsOn: string[];
106
+ features: string[];
88
107
  successCriteria: {
89
108
  description: string;
90
- id: string;
91
- verificationMethod: string;
92
- passed: boolean;
93
- notes?: string | undefined;
109
+ criterionId: string;
110
+ verificationMethod: "manual" | "typecheck" | "lint" | "unit-test" | "playwright" | "api-check" | "build" | "agent-evaluation";
111
+ required: boolean;
94
112
  }[];
95
- expectedChanges: {
96
- path: string;
97
- description: string;
98
- action: "create" | "modify" | "delete";
99
- }[];
100
- dependsOn: string[];
101
- evalResults?: unknown[] | undefined;
113
+ nonGoals: string[];
114
+ stopConditions: string[];
115
+ definitionOfDone: string;
116
+ assumptions: string[];
117
+ outOfScope: string[];
118
+ estimatedFiles: string[];
119
+ iterationHistory: unknown[];
120
+ ambiguityScore?: number | undefined;
102
121
  generatorNotes?: string | undefined;
122
+ evaluatorNotes?: string | undefined;
123
+ estimatedDuration?: "small" | "medium" | "large" | undefined;
103
124
  evaluatorFeedback?: string | undefined;
125
+ lastEvalId?: string | null | undefined;
126
+ evalResults?: unknown[] | undefined;
127
+ createdAt?: string | undefined;
128
+ updatedAt?: string | undefined;
104
129
  startedAt?: string | undefined;
105
130
  completedAt?: string | undefined;
106
131
  }, {
107
- status: "passed" | "proposed" | "negotiating" | "agreed" | "in-progress" | "evaluating" | "failed" | "needs-rework";
132
+ contractId: string;
133
+ specId: string;
134
+ sprintNumber: number;
135
+ title: string;
108
136
  description: string;
109
- id: string;
110
- feature: string;
137
+ status: "proposed" | "negotiating" | "agreed" | "in-progress" | "evaluating" | "passed" | "failed" | "needs-rework" | "completed";
111
138
  successCriteria: {
112
139
  description: string;
113
- id: string;
114
- verificationMethod: string;
115
- passed: boolean;
116
- notes?: string | undefined;
140
+ criterionId: string;
141
+ verificationMethod: "manual" | "typecheck" | "lint" | "unit-test" | "playwright" | "api-check" | "build" | "agent-evaluation";
142
+ required: boolean;
117
143
  }[];
118
- expectedChanges: {
119
- path: string;
120
- description: string;
121
- action: "create" | "modify" | "delete";
122
- }[];
123
- dependsOn: string[];
124
- evalResults?: unknown[] | undefined;
144
+ nonGoals: string[];
145
+ stopConditions: string[];
146
+ definitionOfDone: string;
147
+ dependsOn?: string[] | undefined;
148
+ features?: string[] | undefined;
149
+ assumptions?: string[] | undefined;
150
+ outOfScope?: string[] | undefined;
151
+ ambiguityScore?: number | undefined;
125
152
  generatorNotes?: string | undefined;
153
+ evaluatorNotes?: string | undefined;
154
+ estimatedFiles?: string[] | undefined;
155
+ estimatedDuration?: "small" | "medium" | "large" | undefined;
126
156
  evaluatorFeedback?: string | undefined;
157
+ iterationHistory?: unknown[] | undefined;
158
+ lastEvalId?: string | null | undefined;
159
+ evalResults?: unknown[] | undefined;
160
+ createdAt?: string | undefined;
161
+ updatedAt?: string | undefined;
127
162
  startedAt?: string | undefined;
128
163
  completedAt?: string | undefined;
129
164
  }>;
130
165
  export type SprintContract = z.infer<typeof SprintContractSchema>;
131
166
  /**
132
167
  * Create a new sprint contract in "proposed" status.
168
+ *
169
+ * Auto-generated contracts (e.g. one-feature-per-sprint pipelines) get
170
+ * placeholder precision fields that explicitly signal they were not authored
171
+ * by a planner agent. The generator preflight check should treat these as
172
+ * incomplete and request clarification before implementing.
133
173
  */
134
- export declare function createContract(feature: string, description: string, criteria: Omit<SuccessCriterion, "passed">[]): SprintContract;
174
+ export declare function createContract(title: string, description: string, criteria: Omit<SuccessCriterion, "required">[], options?: {
175
+ specId?: string;
176
+ sprintNumber?: number;
177
+ nonGoals?: string[];
178
+ stopConditions?: string[];
179
+ definitionOfDone?: string;
180
+ features?: string[];
181
+ estimatedFiles?: string[];
182
+ estimatedDuration?: EstimatedDuration;
183
+ }): SprintContract;
135
184
  /**
136
185
  * Return a new contract with an updated status.
137
186
  * Automatically sets `startedAt` when moving to "in-progress"
138
187
  * and `completedAt` when moving to a terminal status.
139
188
  */
140
189
  export declare function updateContractStatus(contract: SprintContract, status: ContractStatus): SprintContract;
190
+ export interface ContractPrecisionIssue {
191
+ field: string;
192
+ message: string;
193
+ }
194
+ /**
195
+ * Check a contract for precision issues that the Zod schema can't express:
196
+ * banned vague phrases, etc. Returns an empty array when the contract is clean.
197
+ *
198
+ * Schema-level constraints (min lengths, required fields) are enforced
199
+ * separately by SprintContractSchema.parse().
200
+ */
201
+ export declare function findPrecisionIssues(contract: SprintContract): ContractPrecisionIssue[];
202
+ /**
203
+ * Check whether a contract has the precision fields populated with substance,
204
+ * not just placeholders from createContract(). Use this in the generator
205
+ * preflight to refuse to start work on incomplete contracts.
206
+ */
207
+ export declare function isContractPrecise(contract: SprintContract): boolean;
141
208
  //# sourceMappingURL=sprint-contract.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sprint-contract.d.ts","sourceRoot":"","sources":["../../src/contracts/sprint-contract.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,oBAAoB,mHAS/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE,eAAO,MAAM,gBAAgB,2CAAyC,CAAC;AACvE,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAI1D,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;EAMjC,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEtE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;EAI3B,CAAC;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAI1D,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAa/B,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAMlE;;GAEG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,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