You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,15 +69,15 @@ flowchart LR
69
69
70
70
1. A human creates a Requirement and chooses Codex or Claude Code, optionally pinning a model and reasoning effort. Code Factory creates a dedicated, persistent RD session for it.
71
71
2. Agent Manager starts or resumes that agent in the managed workspace. Messages sent during a run are queued; the human may explicitly interrupt when an immediate correction is needed.
72
-
3. The RD agent edits and tests the repository, then uses the bundled `code-factory-cli` to register any pull request it creates, propose separate follow-up work (optionally starting it immediately), inspect its direct parent and child Requirements, message their RD Agents, or schedule a wake-up while a long external build or command continues. Related-Agent messages are persisted in the target Requirement conversation and start or queue its long-lived RD session.
72
+
3. The RD agent edits and tests the repository, then uses the bundled `code-factory-cli` to register any pull request it creates, propose separate follow-up work (optionally starting it immediately), update its still-TODO proposals, inspect its direct parent and child Requirements, message their RD Agents, or schedule a wake-up while a long external build or command continues. Related-Agent messages are persisted in the target Requirement conversation and start or queue its long-lived RD session.
73
73
4. Agent Triggers route normalized, deduplicated messages into the Requirement conversation. The timer trigger executes configurable one-time or recurring timers and sends their ID and follow-up description when due. The GitHub triggers poll registered PRs whose last stored state is Draft or Open, observing state, comments and reviews, CI failures, and merge conflicts. This lets the reconciler discover when a Draft PR becomes Open. Once a PR transitions to Closed or Merged, it is excluded from later polls. An idle RD session resumes immediately; a running session consumes the new messages after its current run.
74
74
5. A human can request a short-lived AI review for an open PR with its own provider, model, and reasoning effort. Review results return to the same conversation and wake the original RD session to continue the loop.
75
75
76
76
The Agent Trigger boundary is intentionally source-neutral, but its current message contract targets an existing Requirement. Scheduled wake-ups are natively configurable; dynamic discovery and configuration of third-party trigger implementations, Slack and Jira sources, and triggers that create new Requirements are future extensions rather than implemented behavior.
77
77
78
78
Different Requirements can run concurrently, while each Requirement has at most one active RD run. Requirement state, conversations, runs, sessions, PR metadata, scheduled wake-ups, and Agent Trigger receipts are persisted in SQLite. Cancelled Requirements are retained for 7 days and completed Requirements for 365 days by default; both periods are runtime-configurable, and expiry atomically removes the Requirement and its related domain records while retaining retryable tombstones until attachment files are deleted.
79
79
80
-
Agent Manager places `code-factory-cli` on every RD process's `PATH` and injects its API URL, Requirement ID, and Session ID through the environment. The RD prompt describes available capabilities and leaves command names and arguments to `code-factory-cli --help`; raw HTTP details remain an internal transport contract. Use `code-factory-cli pr register --from-github <PR-URL>` to read current metadata through `gh`, and `requirement propose --description-file <PATH> [--start]` for multiline follow-up descriptions with optional immediate execution. Resumed prompts retain the current Requirement context and instruct agents to check for already-completed actions before retrying.
80
+
Agent Manager places `code-factory-cli` on every RD process's `PATH` and injects its API URL, Requirement ID, and Session ID through the environment. The RD prompt describes available capabilities and leaves command names and arguments to `code-factory-cli --help`; raw HTTP details remain an internal transport contract. Use `code-factory-cli pr register --from-github <PR-URL>` to read current metadata through `gh`, `requirement propose --description-file <PATH> [--start]` for multiline follow-up descriptions with optional immediate execution, and `requirement update --requirement-id <ID>` to correct a proposal before it starts. Resumed prompts retain the current Requirement context and instruct agents to check for already-completed actions before retrying.
81
81
82
82
Agent context is scoped to the Requirement rather than copied from whichever interactive agent or terminal started Agent Manager. A Requirement's first RD Run creates a new native Codex thread or Claude Code session; later Runs resume that same native session, preserving its conversation context. Because the child CLI inherits Agent Manager's environment and starts in the managed workspace, it also discovers the provider's configured project/user instructions, Skills, plugins, and local memory features according to the CLI's own rules. Code Factory does not automatically copy another agent's live transcript or merge context from other Requirements. An explicit related-Agent message is new, durable input to the target Requirement rather than shared session context. Code Factory does not guarantee that every provider-managed memory entry is injected.
Copy file name to clipboardExpand all lines: docs/agent-manager-api.md
+37Lines changed: 37 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,7 @@ The service listens only on the loopback interface by default and currently has
66
66
| GET | /api/events | Subscribe to the resumable SSE stream |
67
67
| POST | /api/agent/pull-requests | Register or update a PR from an RD Agent |
68
68
| POST | /api/agent/requirements | Propose a follow-up Requirement from an RD Agent |
69
+
| PATCH | /api/agent/requirements/:id| Update a TODO Requirement proposed by the current RD Agent |
69
70
| GET | /api/agent/requirements/:id/related | List a source Requirement's direct parent and children |
70
71
| POST | /api/agent/requirements/:id/related/:targetId/messages | Message a directly related Requirement's RD Agent |
71
72
@@ -703,6 +704,7 @@ These endpoints are the transport used by `code-factory-cli` and other trusted l
703
704
~~~bash
704
705
code-factory-cli pr register --help
705
706
code-factory-cli requirement propose --help
707
+
code-factory-cli requirement update --help
706
708
code-factory-cli requirement related --help
707
709
code-factory-cli requirement message --help
708
710
code-factory-cli timer register --help
@@ -782,6 +784,40 @@ curl -X POST http://127.0.0.1:4310/api/agent/requirements \
782
784
783
785
Success: 201 Created with the new Requirement and `createdBy=rd_agent`. Without `start: true`, it remains TODO. When `start` is true, the response reflects its started RD Session. Returns 404 for an unknown source Session and 400 when `parentRequirementId` does not match or another field is invalid.
Updates the title and/or description of a follow-up Requirement before it starts. The target must be a TODO child proposed by the same source RD Session. This prevents an Agent from changing unrelated, human-created, running, or terminal work.
790
+
791
+
Request body:
792
+
793
+
| Field | Type | Required | Meaning |
794
+
| --- | --- | --- | --- |
795
+
| sourceRequirementId | string | yes | Current Requirement injected into the source RD Agent |
Success: 200 OK with the updated Requirement and Session. Returns 404 for an unknown source or target, 400 for invalid input or a mismatched source Session, and 409 when the target was not proposed by the source or is no longer TODO.
813
+
814
+
The CLI supplies the source identifiers from its injected context. Use `requirement related` to discover child IDs:
### GET /api/agent/requirements/:sourceRequirementId/related
786
822
787
823
Returns the source Requirement's direct parent and children as `{ "parent": Requirement | null, "children": Requirement[] }`, including terminal records that have not yet expired. The required `sourceSessionId` query parameter must identify the source Requirement's RD Session.
@@ -843,6 +879,7 @@ Current event types and primary payloads:
Copy file name to clipboardExpand all lines: docs/agent-runners.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -41,23 +41,25 @@ RD Agents use self-describing commands instead of constructing Agent API request
41
41
```bash
42
42
code-factory-cli pr register --help
43
43
code-factory-cli requirement propose --help
44
+
code-factory-cli requirement update --help
44
45
code-factory-cli timer register --help
45
46
code-factory-cli timer show --help
46
47
code-factory-cli timer cancel --help
47
48
```
48
49
49
-
`pr register` registers a newly created PR or refreshes metadata changed by the RD Agent. `requirement propose` records separate follow-up work as a linked TODO Requirement. `requirement related` lists direct parent and child Requirements; `requirement message` coordinates with their RD Agents. `timer register` registers a one-time wake-up by default or a recurring one with `--repeat`; `timer show` recovers timer IDs and statuses for the current Requirement; `timer cancel` stops an active timer. The commands print the Agent API JSON response on stdout. Exit code `0` means success, `2` means invalid input or missing context, and `1` means an execution, network, HTTP, or response-format failure. Errors go to stderr. API requests and GitHub lookups time out after 30 seconds; writes are never automatically retried. A timeout or invalid response can occur after the server commits a write: inspect the Requirement before retrying, especially when proposing follow-up work.
50
+
`pr register` registers a newly created PR or refreshes metadata changed by the RD Agent. `requirement propose` records separate follow-up work as a linked TODO Requirement, and `requirement update` corrects the title or description of a proposal before it starts. `requirement related` lists direct parent and child Requirements; `requirement message` coordinates with their RD Agents. `timer register` registers a one-time wake-up by default or a recurring one with `--repeat`; `timer show` recovers timer IDs and statuses for the current Requirement; `timer cancel` stops an active timer. The commands print the Agent API JSON response on stdout. Exit code `0` means success, `2` means invalid input or missing context, and `1` means an execution, network, HTTP, or response-format failure. Errors go to stderr. API requests and GitHub lookups time out after 30 seconds; writes are never automatically retried. A timeout or invalid response can occur after the server commits a write: inspect the Requirement before retrying, especially when proposing or updating follow-up work.
50
51
51
52
Prefer registration from an explicit PR URL, using the authenticated local `gh` CLI:
`--from-github` reads the PR number, title, URL, branches, head SHA, and state from GitHub and validates the returned identity before registration. The repository key comes from the returned URL and is normalized to lowercase, matching Manager and Store identity checks. GitHub Enterprise URLs are supported and retain the hostname in the repository identifier. It cannot be mixed with manual metadata flags. The existing full manual registration form remains supported for callers that already have a snapshot; an existing PR's lifecycle is still owned by the reconciler, even when `--status` is supplied. The CLI does not create or edit GitHub PRs.
59
61
60
-
`--description-file` reads a UTF-8 file relative to the CLI's working directory and is mutually exclusive with `--description`. This avoids shell quoting problems for multiline descriptions. Proposed Requirements remain TODO by default; `--start` starts the new Requirement's RD Session immediately.
62
+
`--description-file` reads a UTF-8 file relative to the CLI's working directory and is mutually exclusive with `--description`. This avoids shell quoting problems for multiline descriptions. Proposed Requirements remain TODO by default; `--start` starts the new Requirement's RD Session immediately. Only the same source RD Session can update its directly proposed child, and only while that child remains TODO.
61
63
62
64
The RD behavioral prompt is supplied on both initial and resumed invocations. It describes CLI capabilities and behavioral constraints, leaving command names and arguments to `code-factory-cli --help`. It covers Requirement scope, worktree isolation, recovery without duplicate actions, control-plane commands, lifecycle ownership, evaluating external feedback, and evidence-based handoff. Task-specific content stays in the stdin prompt; every invocation includes the current Requirement ID, title, and description, with only new external conversation messages on resume. Questions and investigations do not inherently require code changes, and the RD Agent must not substitute follow-up proposals for work required by the current Requirement. A successful GitHub PR creation and a successful Code Factory registration are separate outcomes; a failed registration must be reported without recreating the PR. Human confirmation owns Requirement completion.
Copy file name to clipboardExpand all lines: docs/architecture.en.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,6 +80,7 @@ Every headless RD and Reviewer invocation skips interactive approval and CLI san
80
80
- optional `model` and `reasoningEffort` pin the CLI configuration for every RD Run in the Session;
81
81
-`createdBy`: `human | rd_agent`;
82
82
- an agent-proposed Requirement records `parentRequirementId` and `sourceSessionId`;
83
+
- the source RD Session may update that proposed child's title or description only while it remains TODO;
83
84
- an agent proposal is created as TODO by default, preventing uncontrolled recursive work; an explicit CLI `--start` opt-in starts its RD Session immediately.
84
85
- the proposing Requirement and its direct child can discover each other and exchange explicit, durable RD messages without sharing native agent-session context.
`provider` is optional and defaults to the source Session provider. The proposed Requirement is created as `createdBy=rd_agent`. It remains TODO by default; set the optional boolean `start` to `true` (or pass `--start` to `code-factory-cli requirement propose`) to start its RD Session immediately.
123
123
124
+
Update a still-TODO Requirement proposed by the current RD Session:
125
+
126
+
~~~http
127
+
PATCH /api/agent/requirements/req_child
128
+
Content-Type: application/json
129
+
130
+
{
131
+
"sourceRequirementId": "req_parent",
132
+
"sourceSessionId": "ses_parent",
133
+
"title": "Corrected follow-up title",
134
+
"description": "Corrected follow-up scope"
135
+
}
136
+
~~~
137
+
138
+
`title` and `description` are partial updates, with at least one required. The target must be a direct child created by the same source RD Session and must still be TODO. `code-factory-cli requirement update --requirement-id req_child` supplies the source identifiers from the injected context.
139
+
124
140
Inspect and message directly related Requirements:
0 commit comments