Repository navigation
factory: the factory is an AgentField node; AgentField triggers are its intake - #2487
Merged
Merged
Conversation
…ts intake internal/factory/agentfield registers the factory on an AgentField control plane as codeaf-factory with intake, message and status reasoners, renews its lease as a fresh instance per start, and serves them under a secret path in its base_url (the trigger dispatcher sends no credential). One translator per source (linear, sentry, slack, generic, cron) turns a dispatched event into an inbox.Entry under agentfield:<source>, trust capped by the ceiling; a github event only wakes the native GitHub read. intake answers 202 and reports the job's progress and completion (pr_url) on the execution. Wire: factory.agentfield_connect/_status/_disconnect/_triggers/_sources/ _trigger_add, hello factory.agentfield. Manual page factory-agentfield.
santoshkumarradha
added a commit
that referenced
this pull request
Nov 7, 2026
…age and status reasoners are the Trigger API's doors The node registers as inbox sink "agentfield" and reports each moment to the job's open executions; the 20-second tick is gone. An execution quiet for keepAlive is told again with the lease, so a long job never looks stale and a dropped job still completes. The message and status reasoners call trigger.Message and trigger.Status; Node.Send and its job_send wiring are removed. #2487's change entry now names its pull request.
santoshkumarradha
added a commit
that referenced
this pull request
Nov 7, 2026
…inks, signed webhooks per source (#2485) * factory: the Trigger API — a token per source, messages and status from outside, signed webhooks, Go and TypeScript clients * factory: Trigger API reshaped — one event bus with sinks, webhooks per source, message and status doors for AgentField; no source tokens, no SDKs * factory: shorten the Trigger API change title * factory: the Trigger API change entry names its pull request * factory: the AgentField node is a sink on the event bus, and its message and status reasoners are the Trigger API's doors The node registers as inbox sink "agentfield" and reports each moment to the job's open executions; the 20-second tick is gone. An execution quiet for keepAlive is told again with the lease, so a long job never looks stale and a dropped job still completes. The message and status reasoners call trigger.Message and trigger.Status; Node.Send and its job_send wiring are removed. #2487's change entry now names its pull request.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The factory registers as a node on an AgentField control plane, and every AgentField trigger aimed at
codeaf-factory.intakebecomes a factory job through the inbox. Spec:docs/design/factory-general/DESIGN.md§AgentField.What it adds
factory.agentfield):factory.agentfield_connect,_status,_disconnect,_triggers,_sources,_trigger_add. Documented in PROTOCOL.md.intake(accepts_webhook): files the event as a job;message: reaches a job's manager; a stranger's text becomes activity context only;status: answers the job's facts./health,/statusand/discover, on the node's own listener.instance_idon every start; the lease renews every lease/3; a 404 on renewal re-registers; the node sendsofflineon stop.internal/factory/agentfield/translate.go): pure and fixture-tested. One each for linear, sentry and slack, and one for generic_bearer, generic_hmac, cron and a direct execute.agentfield:<source>.agentfield-executions.json. It then reportsrunningwith progress, thensucceededwith{job, state, pr_url, steps_done, steps_total, …}, orfailedwith the job's own words.factory-agentfield.mdwith 13 probes, and a change entry withinvalidates:.Transport and auth
AgentField's trigger dispatcher sends no credential to the node. Only the execute path carries
internal_token. So the node registers<base_url>/n/<64-hex secret>and answers 404 anywhere outside that path, using a constant-time check. That is the strongest option the control plane supports today.The CP API key and the secret are kept the way the GitHub token is: app keys first, otherwise the profile. They are redacted and never answered back.
The client is hand-written rather than importing the SDK. The SDK's agent package is a whole runtime: its own server, DID, memory and AI clients.
Live e2e on mac-studio
TestFactoryAgentFieldNodeE2Eran against a real AgentField control plane built from origin/main c48139680a, using SQLite. Models were deepseek/deepseek-v4.1-flash only, on a fresh home. It passed in 88s at a cost of $0.025.codeaf-factory, reasoners intake/message/status, lifecycle ready, base_url…/n/…exec_20261106_202509_b2znog0t, status dispatchedagentfield:generic-bearer:afnode-1794014709, route "AgentField small changes"ran on deepseek/deepseek-v4.1-flashresult.pr_urlexec_20261106_202509_ahdmpctk→succeeded,pr_url= #163Cleanup closed #163 with the comment "agentfield node e2e, closing" and deleted its branch. It also deleted the triggers and disconnected the node.
Checks
make test-laws,go test ./internal/manual/andmake pr-readypass; the change entry's PR number is set in the follow-up commit. The unit tests cover the translators, the registration payload, the lease, the 404 without the secret, the GitHub nudge, the completion callback, dedup, a refused entry (422), and message/status.Deferred
codeaf factory servedoes not run the node.inbox.NotifyReplier plus a 20s tick that doubles as the keepAlive.messageandstatusare minimal. Swap both to the started/question/done bus events when the lane merges.🤖 Generated with Claude Code