M19-1: /issues/pipeline endpoint + IssuePipeline shared types #174
Labels
No labels
area:agents
area:dashboard
area:database
area:design
area:design-review
area:flows
area:infra
area:meta
area:security
area:sessions
area:webhook
area:workdir
security
type:bug
type:chore
type:meta
type:user-story
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/claude-hooks#174
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
As an operator (backend), I want
GET /issues/pipeline[?repo=…&milestone=…&state=open|closed|all]returning the canonical stage model for every issue the service has touched, so the new UI can render pipelines without talking directly to Forgejo.Acceptance criteria
Stage model
packages/shareddefines a canonicalStagestring union:"breakdown" | "implement" | "pr" | "ci" | "review" | "approved" | "merge" | "closed"plus design track:"design" | "design_review"StageStateunion:"pending" | "running" | "success" | "failure" | "skipped" | "stalled"IssuePipelineshape frozen inpackages/shared(see spec §Stage model for exact fields:repo,issue_number,title,labels,milestone,assignee,current_stage,stages[],updated_at,pr_number)StageEntrycarriesstage,state,task_ids[],agent,started_at,finished_at,duration_ms,cost_usd,turns,round,force_merge,link,stalled_sinceDerivation rules
task_historyrows matching(repo, issue_number)and the right agent type#<issue_number>in body.link= PR URLlistWorkflowRuns(sha)on the PR's head. State = worst of (pending / success / failure).link= run URLlistPullReviews(pr)+requested_reviewers. Round counter = number of distinctREQUEST_CHANGESverdicts from the reviewer agent.state=stalledif review request older thanconfig/agents.json::pipeline.stall_threshold_ms(default 600_000ms) without CI movementstate=successiff any APPROVED review at head. No task, no durationissue.state === "closed"Endpoint
GET /issues/pipeline— defaultstate=open, no repo filter. Returns{ issues: IssuePipeline[], generated_at }?repo=<owner>/<name>,?milestone=<id>,?state=<open|closed|all>,?limit=<n>(default 100, max 500)(repo, milestone, state, limit)— prevents multiple tabs hammering ForgejoSSE envelope
pipeline_stagewith{ repo, issue_number, stage, state, agent?, task_id?, round?, link? }task_started/task_finished/resultevents whenever a stage transitions. Old events unchanged — purely additive so M18-3's renderer is untouchedTests
pipeline.test.ts: derivation from fixturetask_history+ fake Forgejo responses. Design track, review loop (round counter), stall detection (>10 min)pipeline.test.ts: cache invalidation — second call within 5s hits cache, after 5s refetchespipeline-sse.test.ts:pipeline_stagefires when a task's lifecycle event fires, with the right stage mappingDocs
/issues/pipelinesection with response shapeapps/server/src/pipeline.tsOut of scope
task_historyretainsDependencies
References
specs/m19-pipeline-monitor.md§Story M19-1