@clemrig/factory 0.10.0 → 0.11.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
|
@@ -70,17 +70,17 @@ An issue is a folder `.factory/issues/<slug>/` holding at least one of the files
|
|
|
70
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), `gh` is 2.99.0 or later, logged in, and finds the repository on GitHub; 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. It first explores the code where the spec changes it (mechanisms, invariants, conventions, test tools), handing each area of a spec that touches several to a sub-agent when its profile allows it, then answers with a plan: what the code already does that the change must keep, and steps with their criteria, the files expected, the situations to handle besides the main path and their tests. Where the spec reads more than one way, or its letter would give a behavior its objective would not want, the plan records the reading it chose, apart from its risks: the pull request asks you to confirm it. The plan says what must be true, not how to write it; the implementing agent may take a better way and records it as a deviation; 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
|
-
| `implement`, `implemented` | The `implement` agent receives the spec, the plan and the run's browser, 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 |
|
|
73
|
+
| `implement`, `implemented` | The `implement` agent receives the spec, the plan and the run's browser, in one conversation for the run, and answers with evidence for each criterion and its deviations from the plan. It fixes what the review asks for test first: a test that reproduces the trigger and fails, the fix, then a test for each situation around it that the fix changes; what no test can show, it checks in the browser before and after; the run stops if it committed, switched branches or changed `.factory/`, whatever it answered |
|
|
74
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, and a failed check's whole output in `checks/failed-<n>-<name>.log`, the run's `n`th failure, resumptions included, whose path the run journals (over 2 MiB per stream, its end, marked as truncated) |
|
|
75
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, and the run's browser, never the implementing agent's answer. It judges each criterion `met` or `not_met`, with its decisive evidence, and gives each finding a nature, only on what it established: a test it ran, the application it tried or a code path it followed to its end; a risk it could not establish is at most a `weak_test`. From the second round on, once it has answered on its own, it receives in the same conversation the previous review
|
|
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, and the run's browser, never the implementing agent's answer. It judges each criterion `met` or `not_met`, with its decisive evidence, and gives each finding a nature, only on what it established: a test it ran, the application it tried or a code path it followed to its end; a risk it could not establish is at most a `weak_test`. From the second round on, once it has answered on its own with a review the run can judge (an answer it cannot, such as a note sent while its sub-agents still run, goes back to it as an invalid review), it receives in the same conversation the previous review and checks it itself, without sub-agents: it reads and runs the tests of each fix, lists as fixed those a faithful test proves (one that reproduces the trigger, would fail without the fix and covers the situations around it), keeps the others with the same nature, a fix no test proves included, judges how they were fixed (a fix that breaks what worked is a `regression`), and answers its whole review again. Every review judged is kept in the run. An unmet criterion or a blocking finding goes back to `implement` (4 times at most) with the other findings, to fix as well when that is safe, and the implementing agent fixes the mechanism that let a defect happen, wherever the change has it, rather than adding a guard per case |
|
|
77
77
|
| `describe`, `described` | Once the change is approved, the `describe` agent explains it for the pull request (see below) and takes its screenshots. It receives the spec, the plan, the changes, the checks, the approved review, the deviations from the plan, whether the repository is public, the screenshots folder and the run's browser, never the implementing agent's summary. Its guide must name changed files only, each once, its screenshots must be distinct images of the folder, 10 MB at most, and the pull request's body must stay under 60,000 characters; otherwise its answer goes back to it (2 times at most) |
|
|
78
78
|
| `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 |
|
|
79
79
|
| `attach` | When there are screenshots: replaces the pull request's body with one that shows them and uploads them (`gh pr edit --attach`) |
|
|
80
80
|
|
|
81
81
|
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.
|
|
82
82
|
|
|
83
|
-
If its profile allows it, the reviewer runs commands (tests, reproductions, the application in a browser) and, on a large change or one that spans several applications or layers, splits
|
|
83
|
+
If its profile allows it, the reviewer runs commands (tests, reproductions, the application in a browser) and, on a large change or one that spans several applications or layers, splits its first answer between sub-agents (the `Agent` tool), keeping no part for itself: each takes one part, its browser checks included, and one more, always, the paths across them: failures, interruptions, concurrency, recovery. It reports a defect once with every place it occurs, so that it is fixed everywhere at once. Neither the reviewer nor the describing agent changes the repository:
|
|
84
84
|
|
|
85
85
|
- The `diff` stage records the tree it reviews, and the review and the description always start from it: what an interrupted call left behind is put back first, on a resumed run too, and counts as that call's change. A resumed review or description whose tree Git has since pruned is refused.
|
|
86
86
|
- After each call, even a failed one, what the agent changed is put back (`.gitignore` files first, so that an ignored file is never taken for an addition), and it starts again in a new conversation, once per run.
|
|
@@ -288,7 +288,7 @@ Workflows are TypeScript run directly by Node: use erasable syntax only (no `enu
|
|
|
288
288
|
| other | `permissionMode` (a `--permission-mode` choice), `mcpServers: { name: { command, args? } }` | `sandbox`: `read-only`, `workspace-write` or `danger-full-access` | `skills`, `extensions` (paths) |
|
|
289
289
|
| `timeoutMs` | default 15 minutes, no maximum | default 15 minutes, no maximum | default 15 minutes, no maximum |
|
|
290
290
|
|
|
291
|
-
Each agent runs with this machine's and this repository's configuration, as you would run it yourself: Claude Code with its settings, `CLAUDE.md`, plugins, hooks, skills, MCP servers and memory; Codex with its `config.toml`, `AGENTS.md` files, skills and MCP servers; Pi with its extensions, skills, context files and MCP servers. The profile only adds its settings; without `tools`, `permissionMode` or `sandbox`, the agent's own configuration decides. The same workflow can therefore behave differently on another machine, and a repository's own hooks and MCP servers run with its agents. Relative skill, extension and MCP command paths are relative to `.factory/`; a bare command is looked up in the `PATH`. Runtimes are not sandboxes unless one is enabled: their tools act with your rights.
|
|
291
|
+
Each agent runs with this machine's and this repository's configuration, as you would run it yourself: Claude Code with its settings, `CLAUDE.md`, plugins, hooks, skills, MCP servers and memory; Codex with its `config.toml`, `AGENTS.md` files, skills and MCP servers; Pi with its extensions, skills, context files and MCP servers. The profile only adds its settings; without `tools`, `permissionMode` or `sandbox`, the agent's own configuration decides. A Claude Code call waits for its agent's background work, sub-agents included, until it ends or the profile's timeout stops the call: print mode alone would stop it after 10 minutes without a turn. The same workflow can therefore behave differently on another machine, and a repository's own hooks and MCP servers run with its agents. Relative skill, extension and MCP command paths are relative to `.factory/`; a bare command is looked up in the `PATH`. Runtimes are not sandboxes unless one is enabled: their tools act with your rights.
|
|
292
292
|
|
|
293
293
|
**Prompts.** An agent's prompt is `.factory/workflows/<workflow>/prompts/<name>.md`, where the name is the stage's unless `agent({ prompt })` names another; the factory's own workflows read theirs from the package. It is appended to the runtime's system prompt (Codex receives it as the session's `developer_instructions`); the request (context and output JSON Schema) follows on standard input. Prompts are read when a run starts: an edit applies to the next run, without building anything.
|
|
294
294
|
|
|
@@ -9,7 +9,10 @@ export declare const diff: Stage<"ok">;
|
|
|
9
9
|
* and the checks alone. From the second round on, it first reviews the change
|
|
10
10
|
* knowing nothing of the earlier reviews, then, in the same conversation,
|
|
11
11
|
* checks what the previous one found against the code as it is now, and gives
|
|
12
|
-
* its whole review again: nothing found earlier is lost on the way.
|
|
12
|
+
* its whole review again: nothing found earlier is lost on the way. A first
|
|
13
|
+
* answer that cannot be judged, such as a note sent while its sub-agents still
|
|
14
|
+
* ran, goes to the gate as it is: checked against the previous review, it
|
|
15
|
+
* would leave that review alone to repeat.
|
|
13
16
|
*/
|
|
14
17
|
export declare function reviewer(profile: AgentProfile): Stage<"ok" | "modified">;
|
|
15
18
|
/** An unmet criterion or a blocking finding sends the change back, unless the operator accepted the review. */
|
|
@@ -37,12 +37,25 @@ export const diff = step(async ({ dir, state, log, runDir }) => {
|
|
|
37
37
|
log(`Large change: the review reads its diff from ${changes.diffFile}`);
|
|
38
38
|
return { changes, reviewedTree };
|
|
39
39
|
});
|
|
40
|
+
/** The review an agent's answer gives, or why it cannot be judged. */
|
|
41
|
+
function readReview(output, criteria) {
|
|
42
|
+
const parsed = reviewOutput.safeParse(output);
|
|
43
|
+
if (!parsed.success)
|
|
44
|
+
return {
|
|
45
|
+
problem: `Invalid structured output:\n${z.prettifyError(parsed.error)}`,
|
|
46
|
+
};
|
|
47
|
+
const problem = reviewProblem(parsed.data, criteria);
|
|
48
|
+
return problem ? { problem } : { review: parsed.data };
|
|
49
|
+
}
|
|
40
50
|
/**
|
|
41
51
|
* The reviewing agent: it judges the change against the spec, from the code
|
|
42
52
|
* and the checks alone. From the second round on, it first reviews the change
|
|
43
53
|
* knowing nothing of the earlier reviews, then, in the same conversation,
|
|
44
54
|
* checks what the previous one found against the code as it is now, and gives
|
|
45
|
-
* its whole review again: nothing found earlier is lost on the way.
|
|
55
|
+
* its whole review again: nothing found earlier is lost on the way. A first
|
|
56
|
+
* answer that cannot be judged, such as a note sent while its sub-agents still
|
|
57
|
+
* ran, goes to the gate as it is: checked against the previous review, it
|
|
58
|
+
* would leave that review alone to repeat.
|
|
46
59
|
*/
|
|
47
60
|
export function reviewer(profile) {
|
|
48
61
|
const call = (context) => agent({ profile, schema: reviewOutput, session: reviewSession, context });
|
|
@@ -57,28 +70,28 @@ export function reviewer(profile) {
|
|
|
57
70
|
...fresh,
|
|
58
71
|
async run(context) {
|
|
59
72
|
const first = await fresh.run(context);
|
|
60
|
-
|
|
73
|
+
const { reviews, criteria } = facts(context.state);
|
|
74
|
+
if ((reviews ?? []).length === 0)
|
|
61
75
|
return first;
|
|
76
|
+
if ("problem" in readReview(first.output, criteria)) {
|
|
77
|
+
context.log("The review's own answer cannot be judged: sent back before the previous review is checked");
|
|
78
|
+
return first;
|
|
79
|
+
}
|
|
62
80
|
return recheck.run(context);
|
|
63
81
|
},
|
|
64
82
|
});
|
|
65
83
|
}
|
|
66
84
|
/** An unmet criterion or a blocking finding sends the change back, unless the operator accepted the review. */
|
|
67
85
|
export const judgeReview = gate(["approved", "changes", "invalid"], async ({ state }) => {
|
|
68
|
-
const
|
|
69
|
-
if (
|
|
70
|
-
return {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
};
|
|
74
|
-
const problem = reviewProblem(parsed.data, facts(state).criteria);
|
|
75
|
-
if (problem)
|
|
76
|
-
return { outcome: "invalid", reason: problem };
|
|
77
|
-
const changes = reviewChanges(parsed.data);
|
|
86
|
+
const read = readReview(state.output, facts(state).criteria);
|
|
87
|
+
if ("problem" in read)
|
|
88
|
+
return { outcome: "invalid", reason: read.problem };
|
|
89
|
+
const { review } = read;
|
|
90
|
+
const changes = reviewChanges(review);
|
|
78
91
|
// Each review judged is kept, the last one apart for the stages after.
|
|
79
92
|
const judged = {
|
|
80
|
-
review
|
|
81
|
-
reviews: [...(facts(state).reviews ?? []),
|
|
93
|
+
review,
|
|
94
|
+
reviews: [...(facts(state).reviews ?? []), review],
|
|
82
95
|
};
|
|
83
96
|
// The operator resumed the run to deliver it as the review left it.
|
|
84
97
|
if (changes && state.data.acceptedReview === true)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"review.js","sourceRoot":"","sources":["../../../../src/app/workflows/stages/review.ts"],"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AAU;QACnB,MAAM,EAAE,2CAA2C;QACnD,IAAI,EAAE,MAAM;KACb,CAAC;AACJ,CAAC,CACF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clemrig/factory",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Take a repository's issues from spec to pull request with agents, watch them on a local Kanban, and run the repository's own workflows",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@clemrig/factory-ui": "0.2.0",
|
|
43
|
-
"@clemrig/flow": "0.7.
|
|
44
|
-
"@clemrig/flow-ui": "0.5.
|
|
43
|
+
"@clemrig/flow": "0.7.1",
|
|
44
|
+
"@clemrig/flow-ui": "0.5.1"
|
|
45
45
|
}
|
|
46
46
|
}
|
package/prompts/implement.md
CHANGED
|
@@ -25,9 +25,21 @@ First find why the change let each defect happen. When defects come from the sam
|
|
|
25
25
|
machine, the order locks are taken in or the way texts are built, or when a fix would add a special case for one
|
|
26
26
|
situation, change the mechanism instead, reworking that part of your change if needed: prefer the fix that leaves
|
|
27
27
|
less code and fewer special cases, a guard per case is the sign of a wrong mechanism. Fix each defect wherever the
|
|
28
|
-
change has it, not only where the feedback points
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
change has it, not only where the feedback points.
|
|
29
|
+
|
|
30
|
+
Fix each unmet criterion and blocking finding of the review test first, at each place it occurs. Before changing
|
|
31
|
+
the code, write a test that reproduces its trigger as the review describes it, run it and see it fail: a test that
|
|
32
|
+
passes before the fix does not reproduce the defect yet, so make it reproduce that trigger rather than conclude the
|
|
33
|
+
defect is absent. Then fix it and see the test pass. When the review says a fix already holds and only its test is
|
|
34
|
+
missing, that test passes at once: check instead that it fails once you undo the fix, then put the fix back. Then
|
|
35
|
+
add a test for each situation around that one which your fix changes, such as another error, size, input mode or
|
|
36
|
+
state: a fix tested on its own case alone has broken the situation next to it. What no test in this repository can
|
|
37
|
+
show, such as a layout, a contrast or the browser's handling of a touch, reproduce in the browser before the fix
|
|
38
|
+
and check there after it. Change what an existing test expects only where the spec asks for the new behavior, and
|
|
39
|
+
say in your summary which tests you changed and why: a test realigned on what the code now does hides the
|
|
40
|
+
regression it should catch. The review checks each fix through these tests. It may add findings that do not block:
|
|
41
|
+
fix them too when that is safe and stays within the spec, and say in your summary which you left and why. Then
|
|
42
|
+
answer again.
|
|
31
43
|
|
|
32
44
|
Answer with:
|
|
33
45
|
|
package/prompts/review.md
CHANGED
|
@@ -39,13 +39,13 @@ answer. Never modify, stage, commit or delete anything in the repository: the ru
|
|
|
39
39
|
your review, restores what changed and starts the review again.
|
|
40
40
|
|
|
41
41
|
When the change is large (`large` is true), or spans several applications or layers, and you can launch
|
|
42
|
-
sub-agents, split the whole review between them, five at most, and review no part yourself:
|
|
43
|
-
you coordinate the others gets less attention than theirs. Each takes one part of the
|
|
44
|
-
application, a layer or a feature, with its checks in a browser when it shows in a web
|
|
45
|
-
takes the paths that cross the parts: failures, interruptions, concurrent requests and
|
|
46
|
-
spec, its part, the files concerned and where to read the diff, and tell it to report its
|
|
47
|
-
evidence, established as above, to look for each defect's other occurrences, to change nothing
|
|
48
|
-
agent itself. Check their reports, then give one answer for the whole change.
|
|
42
|
+
sub-agents, split the whole review between them for your first answer, five at most, and review no part yourself:
|
|
43
|
+
a part you keep while you coordinate the others gets less attention than theirs. Each takes one part of the
|
|
44
|
+
change, such as an application, a layer or a feature, with its checks in a browser when it shows in a web
|
|
45
|
+
interface; one more, always, takes the paths that cross the parts: failures, interruptions, concurrent requests and
|
|
46
|
+
recoveries. Give each the spec, its part, the files concerned and where to read the diff, and tell it to report its
|
|
47
|
+
findings with their evidence, established as above, to look for each defect's other occurrences, to change nothing
|
|
48
|
+
and to launch no agent itself. Check their reports, then give one answer for the whole change.
|
|
49
49
|
|
|
50
50
|
Answer with:
|
|
51
51
|
|
|
@@ -67,15 +67,25 @@ Answer with:
|
|
|
67
67
|
## The previous review
|
|
68
68
|
|
|
69
69
|
From the second round on, once you have answered, a request in this conversation gives `previous`, the review of
|
|
70
|
-
the change's previous version. Check
|
|
71
|
-
the change
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
70
|
+
the change's previous version. Check it yourself, without launching sub-agents: your first answer has just
|
|
71
|
+
reviewed the whole change, and the implementing agent fixes each unmet criterion and blocking finding test first.
|
|
72
|
+
Do not check again what your first answer found: the code has not changed since.
|
|
73
|
+
|
|
74
|
+
For each unmet criterion and finding `previous` gave, read its fix and the tests that cover it, then run those
|
|
75
|
+
tests. A test proves a fix when it reproduces the trigger the finding described, would fail without the fix, and
|
|
76
|
+
covers the situations around it that the fix changed, such as another error, size, input mode or state. Read also
|
|
77
|
+
the tests the fix changed: an assertion relaxed or realigned on what the code now does, where the spec does not ask
|
|
78
|
+
for it, hides a regression. Check in the browser only what no test can show, such as a layout, a contrast or the
|
|
79
|
+
browser's handling of a touch.
|
|
80
|
+
|
|
81
|
+
When the fix is proven, put the finding in `resolved`, with its `summary` and the `evidence` of the fix. A fix of a
|
|
82
|
+
behavior that no test proves, nor a browser check where no test can show it, is not resolved: keep its finding with
|
|
83
|
+
its nature, and say in its summary which test is missing and whether the fix itself holds, as far as you
|
|
84
|
+
established it. When it still holds, keep it in `findings`, with the same
|
|
85
|
+
nature unless the code shows that nature was wrong, which its summary then says. Look at how each was fixed: a fix
|
|
86
|
+
that adds a special case where the mechanism should change, or that makes the change harder to follow without
|
|
87
|
+
need, is a finding, `maintainability`, or the defect's own nature when the mechanism still fails elsewhere. A fix
|
|
88
|
+
that breaks something that worked in the previous version is a `regression`. Then answer your whole review again:
|
|
89
|
+
every criterion, and your findings with the previous ones that still hold, each once.
|
|
80
90
|
|
|
81
91
|
The change is approved only when every criterion is met and no finding is blocking.
|