@clemrig/factory 0.5.1 → 0.6.1

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,31 @@ 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 judges each criterion `met` or `not_met` and gives each finding a nature; an unmet criterion or a blocking finding goes back to `implement` (2 times at most) |
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 finding's nature alone decides whether it blocks the change: `incorrect_behavior`, `data_loss`, `outage`, `security`, `regression` and `spec_violation` block it; `weak_test`, `maintainability` and `documentation` do not.
80
+
81
+ If its profile allows it, the reviewer runs commands (tests, reproductions) and, on a large change, hands a few angles to sub-agents (the `Agent` tool). It never changes the repository:
82
+
83
+ - The `diff` stage records the tree it reviews, and the review always starts from it: what an interrupted review left behind is put back first, on a resumed run too, and counts as that review's change. A resumed review whose tree Git has since pruned is refused.
84
+ - After each call, even a failed one, 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.
85
+ - A second change, a commit or a branch switch stops the run. 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.
86
+
87
+ 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
88
 
81
89
  ### Kanban
82
90
 
@@ -122,9 +130,9 @@ export default defineFactory({
122
130
  });
123
131
  ```
124
132
 
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.
133
+ - `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
134
  - `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.
135
+ - `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
136
  - `workflows` (optional): the repository's own workflows.
129
137
 
130
138
  `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 +213,7 @@ Add it to `workflows` in `.factory/factory.ts` (`workflows: [ask, changelog]`),
205
213
 
206
214
  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
215
 
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.
216
+ **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
217
 
210
218
  | Primitive | Use |
211
219
  |---|---|
@@ -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
- import { failureFeedback, seconds, } from "../../domain/verification.js";
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 { keepCheckOutputs, 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 that are not delivered: no plan.md on the main branch, which is checked out. */
46
+ async function dependencyProblems(dir, slug, base, dependencies) {
47
+ const problems = [];
48
+ for (const dependency of 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 not delivered (its plan.md is not on ${base}): deliver it first, or revise the dependency with the issue skill (/issue ${slug})`);
53
+ else
54
+ problems.push(`Issue ${slug} depends on ${dependency}, which is no issue of .factory/issues/: fix spec.md 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 dependencyProblems(dir, slug, base, spec.value.dependencies)));
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)))
@@ -57,7 +87,8 @@ async function prepare(definition, { dir, state, log }) {
57
87
  throw new Error(["Cannot start:", ...problems.map((problem) => `- ${problem}`)].join("\n"));
58
88
  log(`Starting point valid: ${base} matches origin, spec with ${spec.value.criteria.length} criteria, gh logged in`);
59
89
  const baseCommit = await git.commitOf(dir, "HEAD");
60
- const checks = await runChecks(dir, definition.verify, journalChecks(log, ` on ${base}`));
90
+ // Nothing changed on the base yet: the checks with `when` wait for a change.
91
+ const checks = await runChecks(dir, definition.verify, [], journalChecks(log, ` on ${base}`));
61
92
  if (!checks.ok)
62
93
  throw new Error(`${base} does not pass its own checks:\n${failureFeedback(checks.check, checks.cause, checks.output)}`);
63
94
  // One run at a time per working tree: another one started during the checks
@@ -83,15 +114,71 @@ async function prepare(definition, { dir, state, log }) {
83
114
  planPath: artifactPath(slug, "plan"),
84
115
  };
85
116
  }
86
- /** The implementing agent may not commit, switch branches or touch .factory/: the run stops if it did. */
87
- async function guard({ dir, state }) {
117
+ /** The agents work on the plan's commit, on the issue's branch: the run stops if one committed or switched branches. */
118
+ async function ensureOnPlanCommit({ dir, state }, agentName) {
88
119
  const { slug, planCommit } = facts(state);
89
120
  if ((await git.commitOf(dir, "HEAD")) !== planCommit ||
90
121
  (await git.currentBranch(dir)) !== slug)
91
- throw new Error("The implementing agent committed or switched branches: the run stops");
92
- if (await git.hasChanges(dir, ".factory"))
122
+ throw new Error(`The ${agentName} agent committed or switched branches: the run stops`);
123
+ }
124
+ /** The implementing agent may not commit, switch branches or touch .factory/: the run stops if it did. */
125
+ async function guard(context) {
126
+ await ensureOnPlanCommit(context, "implementing");
127
+ if (await git.hasChanges(context.dir, ".factory"))
93
128
  throw new Error("The implementing agent changed .factory/: the run stops");
94
129
  }
130
+ /** Puts back the tree the review reads, as the diff stage recorded it; returns the paths it put back. */
131
+ async function putBackReviewedTree(context) {
132
+ await ensureOnPlanCommit(context, "reviewing");
133
+ return git.putBack(context.dir, facts(context.state).reviewedTree);
134
+ }
135
+ /** The review changed the repository, which the run put back: it starts again in a new conversation. */
136
+ function reviewModified(log, changed, why) {
137
+ const paths = changed.join(", ");
138
+ const after = why ? ` ${why}` : "";
139
+ log(`The review changed ${paths}${after}: put back`);
140
+ return {
141
+ outcome: "modified",
142
+ reason: `The review changed the repository (${paths})${after}: put back, the review starts again`,
143
+ feedback: `A previous review changed ${paths}; the run put them back as they were. Review the change again, without modifying anything in the repository.`,
144
+ };
145
+ }
146
+ /**
147
+ * The reviewing agent, which may run commands but never change the
148
+ * repository. The tree it reads is put back before its call and after it,
149
+ * even when the call fails; what it changed makes the review start again.
150
+ */
151
+ function review(profile) {
152
+ const reviewer = agent({
153
+ profile,
154
+ schema: reviewOutput,
155
+ session: reviewSession,
156
+ context: ({ state }) => {
157
+ const { slug, spec, changes, checks } = facts(state);
158
+ return { issue: slug, spec, changes, checks };
159
+ },
160
+ });
161
+ return {
162
+ ...reviewer,
163
+ outcomes: ["ok", "modified"],
164
+ async run(context) {
165
+ // Left by a review that stopped before the run put it back: it counts
166
+ // as that review's change.
167
+ const left = await putBackReviewedTree(context);
168
+ if (left.length > 0)
169
+ return reviewModified(context.log, left, "before the run could put it back");
170
+ const call = await reviewer.run(context).then((result) => ({ result }), (error) => ({ error }));
171
+ const changed = await putBackReviewedTree(context);
172
+ if (changed.length > 0)
173
+ return reviewModified(context.log, changed, "error" in call
174
+ ? `and its call failed (${call.error instanceof Error ? call.error.message : String(call.error)})`
175
+ : undefined);
176
+ if ("error" in call)
177
+ throw call.error;
178
+ return call.result;
179
+ },
180
+ };
181
+ }
95
182
  /**
96
183
  * A failed run resumes on its branch, at the commit its stage started from,
97
184
  * with its changes in progress and none in .factory/ but the plan it may have
@@ -104,6 +191,17 @@ async function resumeProblem({ dir, state, }) {
104
191
  const { pullRequest } = state.data;
105
192
  if (typeof pullRequest === "string")
106
193
  return `the run already delivered its pull request ${pullRequest}`;
194
+ // An earlier factory kept neither skipped checks nor the review's changes:
195
+ // past its checks, such a run has data these stages cannot read.
196
+ if (["diff", "review", "reviewed", "deliver"].includes(state.stage) &&
197
+ !Array.isArray(state.data.skippedChecks))
198
+ return "the run's checks ran with an earlier version of the factory, whose data this one does not read: start a new run";
199
+ // The review starts from the tree it reads, which Git may have pruned meanwhile.
200
+ const { reviewedTree } = state.data;
201
+ if (state.stage === "review" &&
202
+ typeof reviewedTree === "string" &&
203
+ !(await git.hasObject(dir, reviewedTree)))
204
+ return "the tree the review reads is no longer in Git (removed by git gc): start a new run";
107
205
  const { slug, baseCommit, planPath } = facts(state);
108
206
  // Until the plan is committed, the branch is at the run's starting commit.
109
207
  const { planCommit } = state.data;
@@ -191,13 +289,17 @@ export function implement(definition) {
191
289
  data: { implementation: parsed.data },
192
290
  };
193
291
  }), { 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));
292
+ verify: node(code(["passed", "failed"], async ({ dir, state, log, runDir }) => {
293
+ const checks = await runChecks(dir, definition.verify, await git.changedFiles(dir, facts(state).planCommit), journalChecks(log));
196
294
  if (checks.ok)
197
295
  return {
198
296
  outcome: "passed",
199
297
  reason: "Every check passed",
200
- data: { checks: checks.passed },
298
+ data: {
299
+ // What each check wrote stays with the run, for the review.
300
+ checks: await keepCheckOutputs(runDir, checks.passed),
301
+ skippedChecks: checks.skipped.map(({ name }) => name),
302
+ },
201
303
  };
202
304
  return {
203
305
  outcome: "failed",
@@ -205,24 +307,32 @@ export function implement(definition) {
205
307
  feedback: failureFeedback(checks.check, checks.cause, checks.output),
206
308
  };
207
309
  }), { passed: "diff", failed: retry("implement", 3) }),
208
- diff: node(step(async ({ dir, state, log }) => {
209
- const diff = await git.stagedDiff(dir, facts(state).planCommit);
310
+ diff: node(step(async ({ dir, state, log, runDir }) => {
311
+ const { planCommit } = facts(state);
312
+ const reviewedTree = await git.snapshot(dir);
313
+ const diff = await git.diff(dir, planCommit, reviewedTree);
210
314
  if (diff.truncated)
211
315
  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 };
316
+ const files = await git.diffStat(dir, planCommit, reviewedTree);
317
+ const lines = diff.text.split("\n").length;
318
+ log(`Changes since the plan: ${files.length} files, ${lines} diff lines`);
319
+ // A large diff is read from a file, part by part.
320
+ const changes = lines <= largeChangeLines
321
+ ? { files, lines, large: false, diff: diff.text }
322
+ : {
323
+ files,
324
+ lines,
325
+ large: true,
326
+ diffFile: await keepInRun(runDir, "diff.patch", diff.text),
327
+ };
328
+ if (changes.large)
329
+ log(`Large change: the review reads its diff from ${changes.diffFile}`);
330
+ return { changes, reviewedTree };
215
331
  }), { 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" }),
332
+ review: node(review(definition.profiles.review), {
333
+ ok: "reviewed",
334
+ modified: retry("review", 1),
335
+ }),
226
336
  reviewed: node(gate(["approved", "changes", "invalid"], async ({ state }) => {
227
337
  const parsed = reviewOutput.safeParse(state.output);
228
338
  if (!parsed.success)
@@ -252,7 +362,7 @@ export function implement(definition) {
252
362
  invalid: retry("review", 2),
253
363
  }),
254
364
  deliver: node(step(async ({ dir, state, log }) => {
255
- const { slug, base, plan, specPath, planPath, baseCommit, criteria, implementation, review, checks, } = facts(state);
365
+ const { slug, base, plan, specPath, planPath, baseCommit, criteria, implementation, review, checks, skippedChecks, } = facts(state);
256
366
  const commit = await git.commit(dir, `${plan.commit}\n\nSpec: ${specPath}`);
257
367
  log(`Committed "${plan.commit}" as ${short(commit)}`);
258
368
  await git.forcePush(dir, slug);
@@ -266,6 +376,7 @@ export function implement(definition) {
266
376
  implementation,
267
377
  review,
268
378
  checks,
379
+ skippedChecks,
269
380
  reviewRounds: reviewRounds(state),
270
381
  specPath,
271
382
  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,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I,OAAO,WAAW,KAAK,QAAQ;gBAAE,OAAO,EAAE,CAAC;YAC/C,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;YACnC,OAAO;gBACL,iBAAiB,WAAW,EAAE;gBAC9B,oBAAoB,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,SAAS,MAAM,SAAS,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,aAAa,EAAE;gBACzH,kBAAkB,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;aAC9D,CAAC;QACJ,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { defineWorkflow, END, node, step, z } from "@clemrig/flow";
2
2
  import { isSlug, parseIssue } from "../../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
5
  const input = z.object({
6
6
  issue: z
7
7
  .string()
@@ -9,6 +9,21 @@ const input = z.object({
9
9
  kind: z.enum(["issue", "spec"]),
10
10
  file: z.string().min(1),
11
11
  });
12
+ /** What is wrong with a draft: its format, and for a spec, dependencies that are no issue of the repository. */
13
+ async function draftProblems(dir, { issue, kind }, text) {
14
+ if (kind === "issue") {
15
+ const parsed = parseIssue(text);
16
+ return parsed.ok ? [] : parsed.problems;
17
+ }
18
+ const parsed = parseSpec(text, issue);
19
+ if (!parsed.ok)
20
+ return parsed.problems;
21
+ const problems = [];
22
+ for (const dependency of parsed.value.dependencies)
23
+ if (!(await isIssue(dir, dependency)))
24
+ problems.push(`Dependencies: there is no issue ${dependency} in .factory/issues/`);
25
+ return problems;
26
+ }
12
27
  /** Checks a draft written by an agent, then writes it as the issue's issue.md or spec.md. */
13
28
  export const issueSave = defineWorkflow({
14
29
  name: "issue-save",
@@ -20,11 +35,11 @@ export const issueSave = defineWorkflow({
20
35
  if (kind === "spec" && !(await hasArtifact(dir, issue, "issue")))
21
36
  throw new Error(`Issue ${issue} does not exist: save its issue.md first`);
22
37
  const text = await readDraft(file);
23
- const parsed = kind === "issue" ? parseIssue(text) : parseSpec(text);
24
- if (!parsed.ok)
38
+ const problems = await draftProblems(dir, { issue, kind }, text);
39
+ if (problems.length > 0)
25
40
  throw new Error([
26
41
  `Invalid ${kind}.md draft ${file}:`,
27
- ...parsed.problems.map((problem) => `- ${problem}`),
42
+ ...problems.map((problem) => `- ${problem}`),
28
43
  ].join("\n"));
29
44
  return { path: await writeArtifact(dir, issue, kind, text) };
30
45
  }), { 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,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE/E,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC;IACrB,KAAK,EAAE,CAAC;SACL,MAAM,EAAE;SACR,MAAM,CAAC,MAAM,EAAE,+CAA+C,CAAC;IAClE,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC/B,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;CACxB,CAAC,CAAC;AAGH,6FAA6F;AAC7F,MAAM,CAAC,MAAM,SAAS,GAA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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/D,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;QACjD,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;KACvC,CAAC,CACH;SACA,GAAG,CAAC,CAAC,CAAC;IACT,UAAU,EAAE,C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C,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;QACtC,uFAAuF;QACvF,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;KACnD,CAAC,CACH;SACA,GAAG,CAAC,CAAC,CAAC;IACT,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,QAAQ,EAAE,CAAC,CAAC,YAAY,CAAC;QACvB,IAAI,EAAE,OAAO;QACb,SAAS,EAAE,OAAO;QAClB,MAAM,EAAE,OAAO;KAChB,CAAC;IACF,yDAAyD;IACzD,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,QAAQ,EAAE;CAC3C,CAAC,CAAC;AAEH,MAAM,UAAU,kBAAkB,CAAC,KAAc;IAC/C,MAAM,MAAM,GAAG,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC3C,OAAO,MAAM,CAAC,OAAO;QACnB,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CACrB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,OAAO,EAAE,CACvD,CAAC;AACR,CAAC"}
@@ -1,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,19 +12,22 @@ 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
- const minor = review.findings
19
- .filter(({ severity }) => severity === "minor")
20
- .map(({ file, summary }) => `- ${file ? `\`${file}\`: ` : ""}${summary}`);
22
+ const nonBlocking = review.findings
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}`,
24
28
  `## Acceptance criteria\n\n| Criterion | Review | Evidence |\n|---|---|---|\n${criteria.join("\n")}`,
25
29
  `## Verification\n\n${checks.join("\n")}`,
26
- `## Review\n\n${rounds}\n\n${minor.length > 0 ? `Minor findings:\n${minor.join("\n")}` : "No minor findings."}`,
30
+ `## Review\n\n${rounds}\n\n${nonBlocking.length > 0 ? `Non-blocking findings:\n${nonBlocking.join("\n")}` : "No non-blocking findings."}`,
27
31
  `## Deviations from plan\n\n${deviations.length > 0 ? deviations.join("\n") : "None."}`,
28
32
  "---",
29
33
  `Spec: \`${facts.specPath}\` at ${facts.baseCommit.slice(0, 7)} · Plan: \`${facts.planPath}\` · Run: ${facts.runId}`,
@@ -1 +1 @@
1
- {"version":3,"file":"pull-request.js","sourceRoot":"","sources":["../../src/domain/pull-request.ts"],"names":[],"mappings":"AAEA,OAAO,EAAoB,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAe9D,qEAAqE;AACrE,SAAS,IAAI,CAAC,IAAY;IACxB,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AAC/D,CAAC;AAED,uEAAuE;AACvE,MAAM,UAAU,eAAe,CAAC,KAAuB;IACrD,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IACzC,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;QACnD,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;QACxE,MAAM,MAAM,GAAG,MAAM,EAAE,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;QAC5D,OAAO,KAAK,IAAI,CAAC,GAAG,EAAE,KAAK,IAAI,EAAE,CAAC,MAAM,MAAM,MAAM,IAAI,CAAC,MAAM,EAAE,QAAQ,IAAI,EAAE,CAAC,IAAI,CAAC;IACvF,CAAC,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAC7B,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,EAAE,EAAE,CAChC,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