Repository navigation
factory: Jira Cloud connector — feed, replier, jirastub, connect and poll (lane J) - #2476
Merged
Merged
Conversation
santoshkumarradha
added a commit
that referenced
this pull request
Nov 6, 2026
… and poll
internal/factory/jira translates Jira Cloud REST v3 into the inbox:
Feed runs the person's JQL narrowed by an updated cursor (account zone,
one minute overlap) into inbox.Entry values with a jira-project:<KEY>
label and Jira priority mapped p0-p3; Replier comments the pull request
link on open and merge and the job's words when stuck. jirastub fakes
exactly /myself, /search/jql and /issue/{key}/comment.
factory.jira_connect/_status/_disconnect connect this machine's factory,
checking /myself and one search before keeping anything; the token is
kept like the GitHub one. The Jira poll starts beside the GitHub poll
only while connected and restarts on connect and disconnect.
…e door The classifier law forbids reading a status as a decision outside the fact packages; IsAuth now reads the Reason the client stamped.
…ipes, one health record The Jira answerer is registered from the host's mount while connected and unregistered on disconnect, independent of the read loops. The poll passes inbox.WithRecipe through the floor's RecipeAt, as POST /api/intake does. Status reads last read and last error from the poll's own source record (store.SourceMeta) instead of a second file. The poll-wiring test now asserts ticket → job → PR comment, and silence after a disconnect.
… one The asker's word is ticket; the heading that answers it now says so, and the Jira page points there instead of restating the rule.
Lane R's priority section used the resident's word, which the chat manual gate refuses.
santoshkumarradha
force-pushed
the
factory/gi-jira
branch
from
November 6, 2026 21:49
0003682 to
affa994
Compare
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.
Lane J of the general-factory wave (
docs/design/factory-general/DESIGN.md): Jira Cloud tickets become factory jobs through the inbox, and the ticket gets a comment with the pull request's link.What changed
internal/factory/jira: translates and does nothing else.Client: a typed client for exactly three Jira Cloud REST v3 calls, using basic auth:GET /rest/api/3/search/jql(paginated withnextPageToken),POST /rest/api/3/issue/{key}/comment(ADF), andGET /rest/api/3/myself. Errors are written in a person's words and never carry the token.PlainText/Doc: an ADF description becomes plain text, and a comment's text becomes ADF with its links marked as links.Feed(inbox.Feed, namejira): runs(<person's JQL>) [AND updated >= "<cursor>"] ORDER BY updated ASCand maps each ticket to aninbox.Entry:Name <email>;jira-project:<KEY>;The cursor is the newest
updatedminus 1 minute, in the account's/myselftime zone. When that zone is unknown, the cursor is written in UTC with 14 h of slack, so no ticket is skipped.Replier(inbox.Replier) posts three comments:codeaf opened a pull request: <url>Merged: <url>Connection:Connectchecks/myselfand runs one search before it keeps anything.jira.jsonin the floor folder.store.SourceMeta, written byinbox.PollOnce), never kept a second time. Connect and disconnect clear that record.jira) in app mode, otherwise the profile'sjira_token(newinternal/config/jira.go).Feed()returns false when not connected.Replier()resolves the live connection on every call.Reasondecided once at the door (reasonOf), so nothing reads a status as a decision, which is the classifier law.jirastub: an httptest fake of exactly those three endpoints. It checks auth and accepts only the JQL shape that Feed sends.internal/appwire/factory_jira.go):factory.jira_connect,factory.jira_statusandfactory.jira_disconnect, plus the hello wordfactory.jira. All three are listed in PROTOCOL.md.cmd/codeaf/app_factory_jira.go, plus 4 lines inapp_factory.go):inbox.Poll(ctx, feed, floor, factoryPollEvery, after)starts beside the GitHub poll inreadLoopsandpollLoop, with the sameaftereach of them uses.inbox.WithRecipethrough the floor'sRecipeAt, the same wayPOST /api/intakedoes.inbox.RegisterReplier("jira", conn.Replier())runs from the host's mount while connected, andRegisterReplier("jira", nil)runs on disconnect.internal/manual/chat/factory-jira.md(connect, tickets become jobs, which tickets/JQL, routing viajira-project:, the PR-link comment, disconnect/status, limits), with 10 new retrieval probes.factory.md:sources: [jira]+labels: [jira-project:FL]and not by OPS or github rules.Not in this PR
factory serve(the team host) gets no Jira loop, because nothing can connect it. The wire reaches only the app's local host.jirakey in its keychain and hand it back withkeys.set, the way it does forgithub.Proof
make pr-ready BASE=e5effe0b2: every touched package exceptcmd/codeafis green.cmd/codeafhad 7 failures:TestTheManagersEditOfARunningJobIsNotLostToItsWorkerTestAWindowsLaunchRunsOnTheWorkerAndLandsTestARunTheWorkerRefusesGoesBackWithItsReasonTestFactoryStartLaunchesContinuesAndSaysWhyTestAppFactoryPlanFilesAnswerTestGuardOwedAbsoluteMeasuredCommandTestHostedTakeBackReachesAcquireWithoutSharedUploadsOrReleaseDelayTestTheJiraPollFollowsTheConnectionruns on the real inbox: ticket → job (Highest →urgent) within one poll → PR comment on the ticket while connected → no comment after a disconnect.🤖 Generated with Claude Code