@clemrig/factory 0.5.1 → 0.6.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.
package/README.md CHANGED
@@ -46,12 +46,12 @@ The global `factory` command uses the nearest `.factory/` holding a `package.jso
46
46
  ## From an idea to a pull request
47
47
 
48
48
  1. **Backlog.** In Claude Code, Codex or Pi, `/issue` asks for a title and a description, writes a draft outside the repository and saves it with `factory run issue-save --issue <slug> --kind issue --file <draft>`. The command checks the draft and writes `.factory/issues/<slug>/issue.md` itself: the agent chooses neither the path nor the format.
49
- 2. **Specifying.** `/issue` again: the agent reads the code, asks questions until it can fill every section without inventing anything, and proposes the spec; once the operator agrees, `--kind spec` writes `spec.md`.
49
+ 2. **Specifying.** `/issue` again: the agent reads the code, asks questions until it can fill every section without inventing anything, including the issues this one depends on, and proposes the spec; once the operator agrees, `--kind spec` writes `spec.md`. When a run refuses to start because of the spec, `/issue` fixes it from the problems the run listed.
50
50
  3. Review the spec, commit it and push it on the main branch.
51
51
  4. **Executing.** `factory run implement --issue <slug>`: starting the run approves the spec. It runs without the operator; follow it in `factory ui`.
52
52
  5. **To Approve → Done.** Review and merge the pull request. After `git pull`, `plan.md` is on the main branch: the issue is done. Its folder stays.
53
53
 
54
- A failed run stops; past `prepare`, it leaves the repository on the branch `<slug>`, with the agent's changes, for inspection. When the cause has passed (a timeout, the budget, the network, a Git hook), `factory resume <RUN_ID>` starts the stopped stage again, its agent in the same conversation: the repository must still be on `<slug>` at the commit where the run stopped (the plan's commit, or the starting commit before it), with its changes in progress and none in `.factory/`; a delivery that stopped after its commit resumes once `git reset --soft <plan commit>` puts the changes back in progress, as the refusal says, and a run whose pull request is recorded in its state, stopped once its delivery was done, does not resume. Otherwise, clean up, fix what is needed (often the spec, committed and pushed again) and start a new run: it starts again from the main branch, recreates the branch and replaces the pull request's content. Requested changes on a pull request are fixed the same way, or by hand on the branch. An issue is abandoned by deleting its folder (and closing its pull request, if any).
54
+ A failed run stops; past `prepare`, it leaves the repository on the branch `<slug>`, with the agent's changes, for inspection. When the cause has passed (a timeout, the budget, the network, a Git hook), `factory resume <RUN_ID>` starts the stopped stage again, its agent in the same conversation: the repository must still be on `<slug>` at the commit where the run stopped (the plan's commit, or the starting commit before it), with its changes in progress and none in `.factory/`; a delivery that stopped after its commit resumes once `git reset --soft <plan commit>` puts the changes back in progress, as the refusal says, a run whose pull request is recorded in its state, stopped once its delivery was done, does not resume, and neither does, past its checks, a run whose checks ran with an earlier version of the factory. Otherwise, clean up, fix what is needed (often the spec, committed and pushed again) and start a new run: it starts again from the main branch, recreates the branch and replaces the pull request's content. Requested changes on a pull request are fixed the same way, or by hand on the branch. An issue is abandoned by deleting its folder (and closing its pull request, if any).
55
55
 
56
56
  `issue-save` lists every problem of a draft at once, refuses a spec for an issue that has no `issue.md`, replaces the file if it exists and commits nothing; each save is a run. The skill tells the agent never to write in `.factory/issues/` directly, commit or run `implement`. Pi reads a project's skills once the project is trusted; Codex ignores a `SKILL.md` that is itself a link, hence the folder link.
57
57
 
@@ -60,23 +60,23 @@ A failed run stops; past `prepare`, it leaves the repository on the branch `<slu
60
60
  An issue is a folder `.factory/issues/<slug>/` holding at least one of the files below (any other folder there is ignored), identified by its slug alone: lowercase letters and digits in words separated by hyphens, which also names its branch and its `--issue` input.
61
61
 
62
62
  - `issue.md`: a `# ` title, then a description.
63
- - `spec.md`: a `# ` title, then exactly `## Objective`, `## Scope`, `## Out of scope`, `## Acceptance criteria` and `## Constraints`, in this order, with nothing before the first and none empty (`None.`). Acceptance criteria holds only `- AC<n>: <criterion>` items numbered from AC1 without gaps; an indented line continues an item. The spec says what and why, not how; headings stay in English, the content may be in any language. `issue-save` and `implement` read it the same way.
63
+ - `spec.md`: a `# ` title, then exactly `## Objective`, `## Scope`, `## Out of scope`, `## Acceptance criteria`, `## Constraints` and `## Dependencies`, in this order, with nothing before the first and none empty (`None.`). Acceptance criteria holds only `- AC<n>: <criterion>` items numbered from AC1 without gaps; an indented line continues an item. Dependencies holds only `- <slug>` items, each another issue of the repository that must be delivered first, or `None.`. The spec says what and why, not how; headings stay in English, the content may be in any language. `issue-save` and `implement` read it the same way; `issue-save` also refuses a dependency that is no issue of the repository.
64
64
  - `plan.md`: written by the run, in English: the approach, steps that each name the criteria they serve, their files and tests, and the risks.
65
65
 
66
66
  ### The `implement` run
67
67
 
68
68
  | Stage | What it does |
69
69
  |---|---|
70
- | `prepare` | Refuses to start, listing every reason, unless the repository is on the main branch without any change in progress, the main branch matches `origin` after `git fetch`, `spec.md` is valid, the issue has no `plan.md` (an issue already delivered is never restarted), its slug does not name the main branch (its branch would replace it) and `gh` is logged in; then the repository's checks must pass on the main branch, before any agent; then, under a lock of the working tree (`factory-implement.lock` in its Git directory, held for that step only) and unless the repository moved meanwhile (another run is using it: the run stops), creates (or recreates) the branch `<slug>` from the approved start commit. Branches are read and pushed by their full reference: a tag of the same name never stands in for them |
70
+ | `prepare` | Refuses to start, listing every reason, unless the repository is on the main branch without any change in progress, the main branch matches `origin` after `git fetch`, `spec.md` is valid (otherwise it says to fix it with `/issue <slug>`), each of its dependencies is delivered (its `plan.md` is on the main branch), the issue has no `plan.md` (an issue already delivered is never restarted), its slug does not name the main branch (its branch would replace it) and `gh` is logged in; then the repository's checks must pass on the main branch, before any agent; then, under a lock of the working tree (`factory-implement.lock` in its Git directory, held for that step only) and unless the repository moved meanwhile (another run is using it: the run stops), creates (or recreates) the branch `<slug>` from the approved start commit. Branches are read and pushed by their full reference: a tag of the same name never stands in for them |
71
71
  | `plan`, `planned` | The `plan` agent receives the slug and the spec and answers with a plan; every criterion must be served by a step, otherwise the plan goes back to it (2 times at most) |
72
72
  | `commit-plan` | Writes `plan.md` and commits it alone (`docs: plan <slug>`): the run's reference commit |
73
73
  | `implement`, `implemented` | The `implement` agent receives the spec and the plan, in one conversation for the run, and answers with evidence for each criterion and its deviations from the plan; the run stops if it committed, switched branches or changed `.factory/`, whatever it answered |
74
- | `verify` | The repository's checks, in order; a failure, a timeout or a command that cannot start goes back to `implement` with the command, the cause and the end of its output (3 times at most) |
75
- | `diff` | Every change since the reference commit, new files included; the run stops if it is over 2 MiB |
76
- | `review`, `reviewed` | The `review` agent, in a new conversation for each review, receives the spec, the changes and the checks, never the implementing agent's answer, and judges each criterion `met` or `not_met`, with `blocking` or `minor` findings; an unmet criterion or a blocking finding goes back to `implement` (2 times at most) |
74
+ | `verify` | The repository's checks, in order, a check with `when` only if a file changed since the reference commit matches it; a failure, a timeout or a command that cannot start goes back to `implement` with the command, the cause and the end of its output (3 times at most). What each check wrote is kept in the run's folder, for the review (over 2 MiB per stream, its end, marked as truncated) |
75
+ | `diff` | Every change since the reference commit, new files included, with each file's added and removed lines; the run stops if it is over 2 MiB. Over 1,500 lines of diff, the change is large: its diff is kept in the run's folder instead of being sent in the review's request |
76
+ | `review`, `reviewed` | The `review` agent, in a new conversation for each review, receives the spec, the changes (the diff, or for a large change where to read it), the checks and where their output is, never the implementing agent's answer. It may run commands if its profile allows them, and on a large change hand a few angles to sub-agents if its profile has the `Agent` tool. It judges each criterion `met` or `not_met` and gives each finding a nature: `incorrect_behavior`, `data_loss`, `outage`, `security`, `regression` and `spec_violation` block the change, `weak_test`, `maintainability` and `documentation` do not. An unmet criterion or a blocking finding goes back to `implement` (2 times at most). The review always starts from the tree the `diff` stage gave it to read, so that what an earlier review left behind is put back before it, on a resumed run too, and counts as that review's change (a resumed review whose tree Git has since pruned is refused); after it, even when the call fails, the repository is compared with that tree: what the review changed is put back (`.gitignore` files first, so that an ignored file is never taken for an addition) and the review starts again in a new conversation, once per run, whether its call succeeded or failed; a second time, or a commit or a branch switch, stops the run, and so does a list of changed files longer than the 2 MiB the run reads from Git, which leaves the repository as it is for inspection |
77
77
  | `deliver` | Commits the changes with the plan's conventional commit subject, force-pushes `<slug>` to `origin`, updates the branch's open pull request or opens one with `gh`, then returns to the main branch |
78
78
 
79
- A malformed agent response goes back to that agent, 2 times at most. The pull request's title is the commit subject; its body gives the summary, each criterion with its review status and evidence, the checks, the review's rounds and minor findings, the deviations from the plan, then the spec at its starting commit, `plan.md` and the run's ID. The run's result shows the pull request, the review rounds and the checks passed.
79
+ A malformed agent response goes back to that agent, 2 times at most. The pull request's title is the commit subject; its body gives the summary, each criterion with its review status and evidence, the checks (those skipped for want of a matching change included), the review's rounds and its other findings with their nature, the deviations from the plan, then the spec at its starting commit, `plan.md` and the run's ID. The run's result shows the pull request, the review rounds and the checks passed.
80
80
 
81
81
  ### Kanban
82
82
 
@@ -122,9 +122,9 @@ export default defineFactory({
122
122
  });
123
123
  ```
124
124
 
125
- - `verify`: the repository's checks, at least one: `{ name, command, timeoutMs }`, the command an executable and its arguments, run without a shell in the repository. They run in order and stop at the first failure: on the main branch before the run's agents, then after each implementation.
125
+ - `verify`: the repository's checks, at least one: `{ name, command, timeoutMs }`, the command an executable and its arguments, run without a shell in the repository. They run in order and stop at the first failure: on the main branch before the run's agents, then after each implementation. A check may add `when`, globs of the files whose change makes it run (`when: ["scripts/*deploy*", "caddy/**"]`): it is for a long validation, such as a rehearsal, that only some changes call for; it never runs on the main branch, and after an implementation only if a file changed since the plan matches it.
126
126
  - `maxCostUsd`: the budget of an `implement` run, in USD; `factory run implement --issue <slug> --max-cost-usd 40` changes it for one run. Codex announces no cost, so these three agents cannot run with Codex.
127
- - `profiles`: the agents of `plan`, `implement` and `review` (see Profiles below). Each profile decides what its agent may do: here, `plan` and `review` only read the repository; `implement` also edits it and runs commands, and `permissionMode: "dontAsk"` refuses any other tool instead of waiting for a permission prompt.
127
+ - `profiles`: the agents of `plan`, `implement` and `review` (see Profiles below). Each profile decides what its agent may do: here, `plan` and `review` only read the repository; `implement` also edits it and runs commands, and `permissionMode: "dontAsk"` refuses any other tool instead of waiting for a permission prompt. Adding `Bash` to the review's tools lets it run tests and reproductions (it must not change the repository: the run puts back what it changes), and `Agent` lets it hand angles of a large change to sub-agents.
128
128
  - `workflows` (optional): the repository's own workflows.
129
129
 
130
130
  `defineFactory` lists every problem at once, each agent's profile checked on its own even when other fields are wrong; it also refuses a workflow not made by `defineWorkflow`, or named like another, `issue-save` and `implement` included. Any other default export of `factory.ts` is refused.
@@ -205,7 +205,7 @@ Add it to `workflows` in `.factory/factory.ts` (`workflows: [ask, changelog]`),
205
205
 
206
206
  Workflows are TypeScript run directly by Node: use erasable syntax only (no `enum`, no parameter properties) and relative imports with their `.ts` extension. Import only from `@clemrig/factory`, which also exports `z` (Zod), so that workflows, the factory and its engine share one Zod instance.
207
207
 
208
- **Graph.** Each stage declares its outcomes and the node routes every outcome to a stage, to `END` or to `retry(stage, max)`. A stage receives `{ state, agent, log, dir }`: the run (read-only), the agent runtime, the run journal and the repository directory. Stages and agents work in the repository (the folder that contains `.factory/`), which is also the process's working directory during a run, wherever the command was started.
208
+ **Graph.** Each stage declares its outcomes and the node routes every outcome to a stage, to `END` or to `retry(stage, max)`. A stage receives `{ state, agent, log, dir, runDir }`: the run (read-only), the agent runtime, the run journal, the repository directory and the run's own directory, where a stage keeps files that belong to the run. Stages and agents work in the repository (the folder that contains `.factory/`), which is also the process's working directory during a run, wherever the command was started.
209
209
 
210
210
  | Primitive | Use |
211
211
  |---|---|
@@ -3,14 +3,15 @@ import { isSlug } from "../../domain/issue.js";
3
3
  import { planCommitMessage, planOutput, planProblem, renderPlan, } from "../../domain/plan.js";
4
4
  import { DELIVERY } from "../../domain/delivery.js";
5
5
  import { pullRequestBody } from "../../domain/pull-request.js";
6
- import { implementationOutput, implementationProblem, reviewChanges, reviewOutput, reviewProblem, } from "../../domain/review.js";
6
+ import { implementationOutput, implementationProblem, largeChangeLines, reviewChanges, reviewOutput, reviewProblem, } from "../../domain/review.js";
7
7
  import { parseSpec } from "../../domain/spec.js";
8
8
  import { failureFeedback, seconds, } from "../../domain/verification.js";
9
9
  import { runChecks } from "../../system/checks.js";
10
10
  import * as git from "../../system/git.js";
11
11
  import * as github from "../../system/github.js";
12
12
  import { withTreeLock } from "../../system/lock.js";
13
- import { artifactPath, hasArtifact, readArtifact, writeArtifact, } from "../../system/issues.js";
13
+ import { artifactPath, hasArtifact, isIssue, readArtifact, writeArtifact, } from "../../system/issues.js";
14
+ import { fileName, keepInRun } from "../../system/run-files.js";
14
15
  function facts(state) {
15
16
  return state.data;
16
17
  }
@@ -18,14 +19,41 @@ function facts(state) {
18
19
  function reviewRounds(state) {
19
20
  return state.retries?.["reviewed.changes"] ?? 0;
20
21
  }
22
+ /**
23
+ * A new conversation for each review, and for a review started again after it
24
+ * changed the repository; a correction of its format resumes it.
25
+ */
26
+ function reviewSession(state) {
27
+ const restarts = state.retries?.["review.modified"] ?? 0;
28
+ return `review-${reviewRounds(state)}${restarts > 0 ? `-${restarts}` : ""}`;
29
+ }
21
30
  function short(commit) {
22
31
  return commit.slice(0, 7);
23
32
  }
24
- /** Journals each check as it starts and passes: they can take minutes. */
33
+ /** Journals each check as it starts, passes or is skipped: they can take minutes. */
25
34
  function journalChecks(log, where = "") {
26
- return ({ check, ...event }) => log(event.status === "started"
27
- ? `Running ${check.name}${where}: ${check.command.join(" ")}`
28
- : `${check.name} passed in ${seconds(event.durationMs)}`);
35
+ return (event) => {
36
+ const { check } = event;
37
+ if (event.status === "started")
38
+ log(`Running ${check.name}${where}: ${check.command.join(" ")}`);
39
+ else if (event.status === "skipped")
40
+ log(`Skipped ${check.name}${where}: no change matches ${check.when?.join(", ")}`);
41
+ else
42
+ log(`${check.name} passed in ${seconds(event.durationMs)}`);
43
+ };
44
+ }
45
+ /** The dependencies of the spec that are not delivered: no plan.md on the main branch, which is checked out. */
46
+ async function undeliveredDependencies(dir, slug, base, spec) {
47
+ const problems = [];
48
+ for (const dependency of spec.dependencies) {
49
+ if (await hasArtifact(dir, dependency, "plan"))
50
+ continue;
51
+ if (!(await isIssue(dir, dependency)))
52
+ problems.push(`Issue ${slug} depends on ${dependency}, which is no issue of .factory/issues/: fix spec.md with the issue skill (/issue ${slug})`);
53
+ else
54
+ problems.push(`Issue ${slug} depends on ${dependency}, which is not delivered (its plan.md is not on ${base}): deliver it first, or revise the dependency with the issue skill (/issue ${slug})`);
55
+ }
56
+ return problems;
29
57
  }
30
58
  /** Every reason not to start, found without changing anything; then the base must pass its checks. */
31
59
  async function prepare(definition, { dir, state, log }) {
@@ -44,11 +72,13 @@ async function prepare(definition, { dir, state, log }) {
44
72
  (await git.commitOf(dir, git.remoteRef(base))))
45
73
  problems.push(`${base} must match origin/${base}: push or pull first`);
46
74
  const text = await readArtifact(dir, slug, "spec");
47
- const spec = text === undefined ? undefined : parseSpec(text);
75
+ const spec = text === undefined ? undefined : parseSpec(text, slug);
48
76
  if (!spec)
49
77
  problems.push(`Issue ${slug} has no spec.md`);
50
78
  else if (!spec.ok)
51
- problems.push(...spec.problems.map((problem) => `spec.md: ${problem}`));
79
+ problems.push(...spec.problems.map((problem) => `spec.md: ${problem}`), `Fix spec.md with the issue skill (/issue ${slug}), then commit and push it`);
80
+ else
81
+ problems.push(...(await undeliveredDependencies(dir, slug, base, spec.value)));
52
82
  if (await hasArtifact(dir, slug, "plan"))
53
83
  problems.push(`Issue ${slug} is already delivered (its plan.md is on ${base}): start a new issue`);
54
84
  if (!(await github.isAuthenticated(dir)))
@@ -92,6 +122,71 @@ async function guard({ dir, state }) {
92
122
  if (await git.hasChanges(dir, ".factory"))
93
123
  throw new Error("The implementing agent changed .factory/: the run stops");
94
124
  }
125
+ /**
126
+ * The reviewing agent, which may run commands but never change the repository.
127
+ * The tree the diff stage gave it to read is put back before its call, in case
128
+ * an earlier review stopped without putting back what it left, and after it:
129
+ * what it changed is put back, and the review starts again. Committing or
130
+ * switching branches stops the run.
131
+ */
132
+ function review(profile) {
133
+ const call = agent({
134
+ profile,
135
+ schema: reviewOutput,
136
+ session: reviewSession,
137
+ context: ({ state }) => {
138
+ const { slug, spec, changes, checks } = facts(state);
139
+ return { issue: slug, spec, changes, checks };
140
+ },
141
+ });
142
+ return {
143
+ ...call,
144
+ outcomes: ["ok", "modified"],
145
+ async run(context) {
146
+ const { dir, state, log } = context;
147
+ const { slug, planCommit, reviewedTree } = facts(state);
148
+ const putBack = async () => {
149
+ if ((await git.commitOf(dir, "HEAD")) !== planCommit ||
150
+ (await git.currentBranch(dir)) !== slug)
151
+ throw new Error("The reviewing agent committed or switched branches: the run stops");
152
+ return git.putBack(dir, reviewedTree);
153
+ };
154
+ const modified = (changed, why) => {
155
+ log(`The review changed ${changed.join(", ")}${why}: put back`);
156
+ return {
157
+ outcome: "modified",
158
+ reason: `The review changed the repository (${changed.join(", ")})${why}: put back, the review starts again`,
159
+ feedback: `A previous review changed ${changed.join(", ")}; the run put them back as they were. Review the change again, without modifying anything in the repository.`,
160
+ };
161
+ };
162
+ // Left by a review that stopped before putting it back: it counts as
163
+ // that review's change, so it starts again in a new conversation.
164
+ const left = await putBack();
165
+ if (left.length > 0)
166
+ return modified(left, " before the run could put it back");
167
+ let result;
168
+ let failure;
169
+ try {
170
+ result = await call.run(context);
171
+ }
172
+ catch (error) {
173
+ failure = error;
174
+ }
175
+ // What the agent changed is put back even when its call failed; a
176
+ // review that changed it starts again in a new conversation, the same
177
+ // way whether its call failed or not.
178
+ const changed = await putBack();
179
+ if (changed.length === 0) {
180
+ if (result)
181
+ return result;
182
+ throw failure;
183
+ }
184
+ return modified(changed, result
185
+ ? ""
186
+ : ` and its call failed (${failure instanceof Error ? failure.message : String(failure)})`);
187
+ },
188
+ };
189
+ }
95
190
  /**
96
191
  * A failed run resumes on its branch, at the commit its stage started from,
97
192
  * with its changes in progress and none in .factory/ but the plan it may have
@@ -104,6 +199,17 @@ async function resumeProblem({ dir, state, }) {
104
199
  const { pullRequest } = state.data;
105
200
  if (typeof pullRequest === "string")
106
201
  return `the run already delivered its pull request ${pullRequest}`;
202
+ // An earlier factory kept neither skipped checks nor the review's changes:
203
+ // past its checks, such a run has data these stages cannot read.
204
+ if (["diff", "review", "reviewed", "deliver"].includes(state.stage) &&
205
+ !Array.isArray(state.data.skippedChecks))
206
+ return "the run's checks ran with an earlier version of the factory, whose data this one does not read: start a new run";
207
+ // The review starts from the tree it reads, which Git may have pruned meanwhile.
208
+ const { reviewedTree } = state.data;
209
+ if (state.stage === "review" &&
210
+ typeof reviewedTree === "string" &&
211
+ !(await git.hasObject(dir, reviewedTree)))
212
+ return "the tree the review reads is no longer in Git (removed by git gc): start a new run";
107
213
  const { slug, baseCommit, planPath } = facts(state);
108
214
  // Until the plan is committed, the branch is at the run's starting commit.
109
215
  const { planCommit } = state.data;
@@ -191,13 +297,20 @@ export function implement(definition) {
191
297
  data: { implementation: parsed.data },
192
298
  };
193
299
  }), { ok: "verify", invalid: retry("implement", 2) }),
194
- verify: node(code(["passed", "failed"], async ({ dir, log }) => {
195
- const checks = await runChecks(dir, definition.verify, journalChecks(log));
300
+ verify: node(code(["passed", "failed"], async ({ dir, state, log, runDir }) => {
301
+ const checks = await runChecks(dir, definition.verify, journalChecks(log), await git.changedFiles(dir, facts(state).planCommit));
196
302
  if (checks.ok)
197
303
  return {
198
304
  outcome: "passed",
199
305
  reason: "Every check passed",
200
- data: { checks: checks.passed },
306
+ data: {
307
+ // What each check wrote stays with the run, for the review.
308
+ checks: await Promise.all(checks.passed.map(async ({ output, ...check }, index) => ({
309
+ ...check,
310
+ outputFile: await keepInRun(runDir, `checks/${index + 1}-${fileName(check.name)}.log`, output),
311
+ }))),
312
+ skippedChecks: checks.skipped.map(({ name }) => name),
313
+ },
201
314
  };
202
315
  return {
203
316
  outcome: "failed",
@@ -205,24 +318,38 @@ export function implement(definition) {
205
318
  feedback: failureFeedback(checks.check, checks.cause, checks.output),
206
319
  };
207
320
  }), { passed: "diff", failed: retry("implement", 3) }),
208
- diff: node(step(async ({ dir, state, log }) => {
209
- const diff = await git.stagedDiff(dir, facts(state).planCommit);
321
+ diff: node(step(async ({ dir, state, log, runDir }) => {
322
+ const { planCommit } = facts(state);
323
+ const diff = await git.stagedDiff(dir, planCommit);
210
324
  if (diff.truncated)
211
325
  throw new Error("The changes are too large to review (over 2 MiB of diff): the run stops");
212
- const files = diff.text.match(/^diff --git /gm)?.length ?? 0;
213
- log(`Changes since the plan: ${files} files, ${diff.text.split("\n").length} diff lines`);
214
- return { diff: diff.text };
326
+ const files = await git.stagedStat(dir, planCommit);
327
+ const lines = diff.text.split("\n").length;
328
+ // What the review reads, and must leave as it found it.
329
+ const reviewedTree = await git.snapshot(dir);
330
+ log(`Changes since the plan: ${files.length} files, ${lines} diff lines`);
331
+ if (lines <= largeChangeLines)
332
+ return {
333
+ changes: {
334
+ files,
335
+ lines,
336
+ large: false,
337
+ diff: diff.text,
338
+ },
339
+ reviewedTree,
340
+ };
341
+ // A large diff is read from a file, part by part.
342
+ const diffFile = await keepInRun(runDir, "diff.patch", diff.text);
343
+ log(`Large change: the review reads its diff from ${diffFile}`);
344
+ return {
345
+ changes: { files, lines, large: true, diffFile },
346
+ reviewedTree,
347
+ };
215
348
  }), { ok: "review" }),
216
- review: node(agent({
217
- profile: definition.profiles.review,
218
- schema: reviewOutput,
219
- // A new conversation for each review; a correction of its format resumes it.
220
- session: (state) => `review-${reviewRounds(state)}`,
221
- context: ({ state }) => {
222
- const { slug, spec, diff, checks } = facts(state);
223
- return { issue: slug, spec, diff, checks };
224
- },
225
- }), { ok: "reviewed" }),
349
+ review: node(review(definition.profiles.review), {
350
+ ok: "reviewed",
351
+ modified: retry("review", 1),
352
+ }),
226
353
  reviewed: node(gate(["approved", "changes", "invalid"], async ({ state }) => {
227
354
  const parsed = reviewOutput.safeParse(state.output);
228
355
  if (!parsed.success)
@@ -252,7 +379,7 @@ export function implement(definition) {
252
379
  invalid: retry("review", 2),
253
380
  }),
254
381
  deliver: node(step(async ({ dir, state, log }) => {
255
- const { slug, base, plan, specPath, planPath, baseCommit, criteria, implementation, review, checks, } = facts(state);
382
+ const { slug, base, plan, specPath, planPath, baseCommit, criteria, implementation, review, checks, skippedChecks, } = facts(state);
256
383
  const commit = await git.commit(dir, `${plan.commit}\n\nSpec: ${specPath}`);
257
384
  log(`Committed "${plan.commit}" as ${short(commit)}`);
258
385
  await git.forcePush(dir, slug);
@@ -266,6 +393,7 @@ export function implement(definition) {
266
393
  implementation,
267
394
  review,
268
395
  checks,
396
+ skippedChecks,
269
397
  reviewRounds: reviewRounds(state),
270
398
  specPath,
271
399
  planPath,
@@ -1 +1 @@
1
- {"version":3,"file":"implement.js","sourceRoot":"","sources":["../../../src/app/workflows/implement.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,IAAI,EACJ,cAAc,EACd,GAAG,EACH,IAAI,EAEJ,IAAI,EAEJ,KAAK,EAEL,UAAU,EACV,IAAI,EACJ,CAAC,GACF,MAAM,eAAe,CAAC;AAOvB,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAEL,iBAAiB,EACjB,UAAU,EACV,WAAW,EACX,UAAU,GACX,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,QAAQ,EAAkB,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAEL,oBAAoB,EACpB,qBAAqB,EAErB,aAAa,EACb,YAAY,EACZ,aAAa,GACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAkB,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EAEL,eAAe,EACf,OAAO,GACR,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAsB,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,KAAK,GAAG,MAAM,qBAAqB,CAAC;AAC3C,OAAO,KAAK,MAAM,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EACL,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,aAAa,GACd,MAAM,wBAAwB,CAAC;AAqBhC,SAAS,KAAK,CAAC,KAAyB;IACtC,OAAO,KAAK,CAAC,IAAwB,CAAC;AACxC,CAAC;AAED,+CAA+C;AAC/C,SAAS,YAAY,CAAC,KAAyB;IAC7C,OAA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../../domain/issue.js";
3
3
  import { parseSpec } from "../../domain/spec.js";
4
- import { hasArtifact, readDraft, writeArtifact } from "../../system/issues.js";
4
+ import { hasArtifact, isIssue, readDraft, writeArtifact, } from "../../system/issues.js";
5
+ /** The dependencies a spec names that are no issue of the repository. */
6
+ async function unknownDependencies(dir, value) {
7
+ if (!("dependencies" in value))
8
+ return [];
9
+ const problems = [];
10
+ for (const dependency of value.dependencies)
11
+ if (!(await isIssue(dir, dependency)))
12
+ problems.push(`Dependencies: there is no issue ${dependency} in .factory/issues/`);
13
+ return problems;
14
+ }
5
15
  const input = z.object({
6
16
  issue: z
7
17
  .string()
@@ -20,11 +30,14 @@ export const issueSave = defineWorkflow({
20
30
  if (kind === "spec" && !(await hasArtifact(dir, issue, "issue")))
21
31
  throw new Error(`Issue ${issue} does not exist: save its issue.md first`);
22
32
  const text = await readDraft(file);
23
- const parsed = kind === "issue" ? parseIssue(text) : parseSpec(text);
24
- if (!parsed.ok)
33
+ const parsed = kind === "issue" ? parseIssue(text) : parseSpec(text, issue);
34
+ const problems = parsed.ok
35
+ ? await unknownDependencies(dir, parsed.value)
36
+ : parsed.problems;
37
+ if (problems.length > 0)
25
38
  throw new Error([
26
39
  `Invalid ${kind}.md draft ${file}:`,
27
- ...parsed.problems.map((problem) => `- ${problem}`),
40
+ ...problems.map((problem) => `- ${problem}`),
28
41
  ].join("\n"));
29
42
  return { path: await writeArtifact(dir, issue, kind, text) };
30
43
  }), { ok: END }),
@@ -1 +1 @@
1
- {"version":3,"file":"issue-save.js","sourceRoot":"","sources":["../../../src/app/workflows/issue-save.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,WAA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WAAW,IAAI,aAAa,IAAI,GAAG;oBACnC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,OAAO,EAAE,CAAC;iBAC7C,CAAC,IAAI,CAAC,IAAI,CAAC,CACb,CAAC;YACJ,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC;QAC/D,CAAC,CAAC,EACF,EAAE,EAAE,EAAE,GAAG,EAAE,CACZ;KACF;IACD,qDAAqD;IACrD,aAAa,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAC1B,OAAO,IAAI,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE;CAC9D,CAAC,CAAC"}
@@ -8,6 +8,8 @@ const definition = z.strictObject({
8
8
  /** The executable, then its arguments; run without a shell. */
9
9
  command: z.tuple([z.string().min(1)], z.string()),
10
10
  timeoutMs: z.number().int().positive(),
11
+ /** Globs of the files whose change makes the check run, such as `scripts/*deploy*`. */
12
+ when: z.array(z.string().min(1)).min(1).optional(),
11
13
  }))
12
14
  .min(1),
13
15
  maxCostUsd: z.number().positive(),
@@ -1 +1 @@
1
- {"version":3,"file":"definition.js","sourceRoot":"","sources":["../../src/domain/definition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoC,CAAC,EAAE,MAAM,eAAe,CAAC;AAgBpE,uFAAuF;AACvF,MAAM,OAAO,GAAG,CAAC,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;AAElC,MAAM,UAAU,GAAG,CAAC,CAAC,YAAY,CAAC;IAChC,MAAM,EAAE,CAAC;SACN,KAAK,CACJ,CAAC,CAAC,YAAY,CAAC;QACb,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACvB,+DAA+D;QAC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,4 +1,4 @@
1
- import type { Implementation, Review } from "./review.js";
1
+ import { type Implementation, type Review } from "./review.js";
2
2
  import type { Criterion } from "./spec.js";
3
3
  import { type CheckResult } from "./verification.js";
4
4
  export interface PullRequestFacts {
@@ -6,6 +6,8 @@ export interface PullRequestFacts {
6
6
  implementation: Implementation;
7
7
  review: Review;
8
8
  checks: CheckResult[];
9
+ /** The checks that did not run: no changed file matched their `when`. */
10
+ skippedChecks: string[];
9
11
  /** Corrections the review asked for before approving. */
10
12
  reviewRounds: number;
11
13
  specPath: string;
@@ -1,3 +1,4 @@
1
+ import { isBlocking, natureLabel, } from "./review.js";
1
2
  import { seconds } from "./verification.js";
2
3
  /** Agent text inside a table cell: one line, no column separator. */
3
4
  function cell(text) {
@@ -11,13 +12,16 @@ export function pullRequestBody(facts) {
11
12
  const status = judged?.status === "met" ? "Met" : "Not met";
12
13
  return `| ${cell(`${id}: ${text}`)} | ${status} | ${cell(judged?.evidence ?? "")} |`;
13
14
  });
14
- const checks = facts.checks.map(({ name, command, durationMs }) => `- ${name}: \`${command.join(" ")}\` passed in ${seconds(durationMs)}`);
15
+ const checks = [
16
+ ...facts.checks.map(({ name, command, durationMs }) => `- ${name}: \`${command.join(" ")}\` passed in ${seconds(durationMs)}`),
17
+ ...facts.skippedChecks.map((name) => `- ${name}: skipped, no change matches its files`),
18
+ ];
15
19
  const rounds = facts.reviewRounds === 0
16
20
  ? "Approved at the first review."
17
21
  : `Approved after ${facts.reviewRounds} round${facts.reviewRounds === 1 ? "" : "s"} of changes.`;
18
22
  const minor = review.findings
19
- .filter(({ severity }) => severity === "minor")
20
- .map(({ file, summary }) => `- ${file ? `\`${file}\`: ` : ""}${summary}`);
23
+ .filter(({ nature }) => !isBlocking(nature))
24
+ .map(({ nature, file, summary }) => `- ${file ? `\`${file}\`: ` : ""}${summary} (${natureLabel(nature)})`);
21
25
  const deviations = implementation.deviations.map((deviation) => `- ${deviation}`);
22
26
  return `${[
23
27
  `## Summary\n\n${implementation.summary}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AC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE;QACvF,KAAK;QACL,WAAW,KAAK,CAAC,QAAQ,SAAS,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,cAAc,KAAK,CAAC,QAAQ,aAAa,KAAK,CAAC,KAAK,EAAE;KACrH,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC"}
@@ -11,6 +11,37 @@ export declare const implementationOutput: z.ZodObject<{
11
11
  }, z.core.$strict>;
12
12
  export type Implementation = z.output<typeof implementationOutput>;
13
13
  export declare function implementationProblem(implementation: Implementation, criteria: Criterion[]): string | undefined;
14
+ /**
15
+ * What a finding is. Its severity follows from it in code, never from the
16
+ * reviewer's own judgment: the first six block the change, the others do not.
17
+ */
18
+ export declare const findingNatures: readonly ["incorrect_behavior", "data_loss", "outage", "security", "regression", "spec_violation", "weak_test", "maintainability", "documentation"];
19
+ export type FindingNature = (typeof findingNatures)[number];
20
+ /** Whether a finding of this nature blocks the change. */
21
+ export declare function isBlocking(nature: FindingNature): boolean;
22
+ /** A nature as people read it: `incorrect_behavior` is "incorrect behavior". */
23
+ export declare function natureLabel(nature: FindingNature): string;
24
+ /** Above this many lines of diff, a change is large: its reviewer reads the diff from a file and may split the review. */
25
+ export declare const largeChangeLines = 1500;
26
+ /** A changed file and its added and removed lines; none for a binary file. */
27
+ export interface ChangedFile {
28
+ path: string;
29
+ /** Its former path, when the diff sees it renamed. */
30
+ from?: string;
31
+ added?: number;
32
+ removed?: number;
33
+ }
34
+ /** The change as its reviewer receives it: the whole diff when it is small, where to read it when it is large. */
35
+ export type Changes = {
36
+ files: ChangedFile[];
37
+ lines: number;
38
+ } & ({
39
+ large: false;
40
+ diff: string;
41
+ } | {
42
+ large: true;
43
+ diffFile: string;
44
+ });
14
45
  /** The reviewer's response: its approval follows from these facts alone. */
15
46
  export declare const reviewOutput: z.ZodObject<{
16
47
  criteria: z.ZodArray<z.ZodObject<{
@@ -22,9 +53,16 @@ export declare const reviewOutput: z.ZodObject<{
22
53
  evidence: z.ZodString;
23
54
  }, z.core.$strict>>;
24
55
  findings: z.ZodArray<z.ZodObject<{
25
- severity: z.ZodEnum<{
26
- blocking: "blocking";
27
- minor: "minor";
56
+ nature: z.ZodEnum<{
57
+ data_loss: "data_loss";
58
+ documentation: "documentation";
59
+ incorrect_behavior: "incorrect_behavior";
60
+ maintainability: "maintainability";
61
+ outage: "outage";
62
+ regression: "regression";
63
+ security: "security";
64
+ spec_violation: "spec_violation";
65
+ weak_test: "weak_test";
28
66
  }>;
29
67
  file: z.ZodOptional<z.ZodString>;
30
68
  summary: z.ZodString;