Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
201f61d
Docs: compare conch with herdr, T3 Code and Orca
Amitgb14 Nov 13, 2026
6f55e2e
Docs: replace the comparison table with a Why conch page
Amitgb14 Nov 13, 2026
dd44a0e
Merge remote-tracking branch 'origin/master'
Amitgb14 Nov 13, 2026
24ccc59
Docs: diagrams a page can draw — feature cards, the autopilot loop, a…
Amitgb14 Nov 13, 2026
1820b30
Docs: refresh the introduction and Why conch with the desktop and pic…
Amitgb14 Nov 13, 2026
7fdcb03
Docs: keep the guide pages short — a feature, how to use it, a picture
Amitgb14 Nov 13, 2026
f477f61
Docs: take Conch Cloud out of the navigation and say it is not enabled
Amitgb14 Nov 13, 2026
b528a1e
Test that the website hides Conch Cloud
Amitgb14 Nov 13, 2026
f016988
Merge branch 'master' of https://github.com/Amitgb14/conch
Amitgb14 Nov 14, 2026
418bfb7
Notice ref changes in reftable repositories
Amitgb14 Nov 14, 2026
01c68c7
Make a moved repository with its bundle's object format
Amitgb14 Nov 14, 2026
5574974
Say a repository's object and ref format in project.log
Amitgb14 Nov 15, 2026
c8be64a
ConchKit: whose commit is whose, and what each agent branch needs
Amitgb14 Nov 15, 2026
ade024c
Conch.app's commit graph: agents' branches, conflicts and CI
Amitgb14 Nov 15, 2026
2ab78a2
Docs: the commit graph's agents, conflicts and CI, and project.log's …
Amitgb14 Nov 15, 2026
d8ae499
Say which branch a stopped rebase is rewriting
Amitgb14 Nov 15, 2026
2bc868f
Name the files a stopped rebase or merge is waiting on
Amitgb14 Nov 15, 2026
6851206
Commit graph: fit narrow windows, reachable by accessibility
Amitgb14 Nov 15, 2026
732ddfd
Docs: keep the Mac app guide under its 700 words
Amitgb14 Nov 15, 2026
6ad5952
ghx: GitHub Actions history and CI statistics, re-run failed jobs
Amitgb14 Nov 15, 2026
00f1a5f
Server: ci.stats and ci.rerun for the CI panel
Amitgb14 Nov 15, 2026
cc99f34
ConchKit: the CI panel's numbers
Amitgb14 Nov 15, 2026
d585271
Conch.app: a CI panel in the commit graph, and re-run failed jobs
Amitgb14 Nov 15, 2026
56f61c6
Keep what the autopilot did: autopilot.activity
Amitgb14 Nov 15, 2026
ae28728
ConchKit: the autopilot's notes, rules and branches for a feed
Amitgb14 Nov 15, 2026
e734964
Conch.app: the autopilot's activity beside the commit graph
Amitgb14 Nov 15, 2026
6e76d92
gitx: read a branch's newest rebase back from its reflog
Amitgb14 Nov 15, 2026
ff36187
branch.rebased: a resolved rebase read back, pushed with a lease, or …
Amitgb14 Nov 15, 2026
9ddd848
ConchKit: a rebased branch not pushed, and range-diff read for review
Amitgb14 Nov 15, 2026
dd8e985
Conch.app: review a resolved rebase, then push it with a lease or und…
Amitgb14 Nov 15, 2026
b7cafec
Conch.app: fixes from looking at the rebase review live
Amitgb14 Nov 15, 2026
49984cf
Conch.app: no compare hint while the CI or Autopilot panel is open
Amitgb14 Nov 15, 2026
3643e3f
branch.resolving: who was asked to resolve a branch's conflict, kept …
Amitgb14 Nov 15, 2026
f3c9853
Conch.app: an agent resolving a conflict, shown while it works
Amitgb14 Nov 15, 2026
ba6446a
gitx: a git without --show-ref-format is not a refs backend called that
Amitgb14 Nov 15, 2026
dbab0a6
Conch.app: fixes from watching an agent resolve live, and another age…
Amitgb14 Nov 15, 2026
ace5515
Merge origin/master into conch/we-have-basic-git-view
Amitgb14 Nov 15, 2026
5669832
Docs: the Mac app guide back under its 700 words after the merge
Amitgb14 Nov 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/testing/end-to-end.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,11 @@ What it carries, and what is left over in each row:
| 9.181 🖥 | Mobile options only for mobile projects | Conch.app on this Mac with three local projects: an iOS app, a plain Go service, and one whose app exists only on an agent's branch (worktree); then have an agent create an Expo app in the Go project | Right-click: **Mobile Preview** on the iOS project and the branch-only one, not on the Go service; a workbench on the Go service has no phone button and no Mobile layout; once the agent writes the Expo app's package.json, Mobile Preview appears there within seconds; in the branch-only project, ▶ Run builds in the checkout that has the app | ☐ |
| 9.182 | Pruning merged branches against GitHub | In a real repository: merge one branch's pull request on GitHub with a squash, another with a merge commit, and merge a third locally; push a fourth unmerged; commit once more on a fifth after its merge. Run `conch branch prune -merged`, then Settings → Git → Old branches → Merged in Conch.app, and delete. | All three merged ones are listed (the squashed one once GitHub says it merged), ticked, and deleted; the pushed one and the one with a later commit are not listed; a branch checked out in a worktree is listed and kept. Against a server from before this, both say to reload it and delete nothing. | ☐ |
| 9.183 🖥 | Agent teams in Conch.app with real agents | With `[[teams]]` Backend (a project) and UI (a branch pattern) and a dozen agents across two projects: watch Agents split; right-click one → Team → UI; drag another onto Backend and onto No team; New Task with a team; Show Side by Side and Broadcast to This Team… on a team's row; `conch server reload`; `conch status -team UI`. | Each project's Agents shows Backend, UI, then No team, with counts; a project with no team keeps its list. A move by menu or drag lands at once, in every window and the TUI's `conch status -team`; a reload keeps it. Side by Side puts the team's agents in one tab; the broadcast reaches only them. | ☐ |
| 9.184 💳🌐 | Conch.app's commit graph with agents | A project with Claude and Codex on task branches, one with an open pull request on a real GitHub repository and red CI, one whose change master then touches on the same lines; open **Commit Graph**. Rebase the second onto master by hand so it stops, then **Ask Codex to resolve**, and its menu's *Start a new agent* on another; **Hand to an Agent…** on an older commit; a SHA-256 reftable repository (`git init --object-format=sha256 --ref-format=reftable`) added as a project | Agents on branches lists both in urgency order with the right agent and ↑/↓; commits show their agent; the CI squares match GitHub; *will conflict* shows before anything moves, the banner when the rebase stops; the agent gets the files and resolves without pushing; the new task's branch starts at the commit; the header says **Git 3 · SHA-256 · reftable** | ☐ |
| 9.185 🌐 | The CI panel against real GitHub Actions | On a project with a month of real Actions history and `gh` logged in: **Commit Graph** → **CI**, then 7d, 14d and 30d; on a busy repository watch *Reading the jobs of N more runs…* fill in; break a test on a branch, let its run fail, then **Re-run failed jobs** in the panel and **Re-run Failed Jobs** on the branch's menu | The numbers match GitHub's Actions page for the period (pass rate, the failing runs, a job's time); the re-run starts a new attempt of that run on GitHub, the button says *Re-running…* until the attempt shows, and the pull request's checks turn pending | ☐ |
| 9.186 💳🌐 | The autopilot's activity in Conch.app | With the autopilot on (auto_fix, auto_merge, auto_resolve, a check) for a real GitHub repository and a real agent on a task branch: open **Commit Graph** → **Autopilot** and leave it open; break a test so CI fails, let the agent fix it, let the pull request merge; then quit everything, reload the server, and open it again | Each step appears in *What it did* as it happens (CI sent to the agent, pushed, merged), marked by kind, under Today, with the branch a link to its commits; *Minding now* follows the branch; the rules match Settings; after the reload the feed is all still there | ☐ |
| 9.187 💳 | Review and push a resolved rebase in Conch.app | A task branch pushed with a pull request, then the base changed on the same lines: open **Commit Graph**, **Ask an agent to resolve** with a real agent, wait for it to finish the rebase | The banner turns green (*rebased onto master*), the branch's card lists each commit old → new with the conflicted one marked *resolved*; **Review the resolution** shows the agent's own lines as + / −; **Push (with lease)** replaces the old branch on GitHub and the pull request updates; on a second run, **Undo the rebase** puts the branch back and the conflict returns; with a commit pushed from elsewhere in between, the push is refused rather than overwriting it | ☐ |
| 9.188 💳 | Watch an agent resolve a conflict in Conch.app | A task branch whose rebase onto master stopped on a conflict: open **Commit Graph**, **Ask an agent to resolve** with a real agent; then once more with `auto_resolve` on and the autopilot asking | While the agent works the banner turns blue (*Claude is resolving the conflict with master*, *N of M files left · you asked …*, or *the autopilot asked*), the branch reads *resolving*, and **Show Claude** opens its pane; when the agent asks a permission question the banner says it is waiting on you; it turns green once the rebase is finished; closing the agent's pane mid-way turns it red (*has ended*) with **Ask again**; after `conch server reload` an agent still working in the stopped worktree still reads *resolving* | ☐ |

Everything else marked 💳 wants a model: the brain's providers (1.x), an
agent's own state hooks and usage (2.1-2.5, 9.1, 9.21, 9.22, 9.70), saved
Expand Down
382 changes: 382 additions & 0 deletions internal/ghx/actions.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,382 @@
package ghx

import (
"context"
"encoding/json"
"fmt"
"math"
"sort"
"strconv"
"time"
)

// A repository's GitHub Actions history, read through gh, and what conch
// says about it: how often it passes, how long it takes, which jobs are
// slow or flaky, and which failures can be run again.

// Run is one workflow run, at its latest attempt.
type Run struct {
ID int64
Workflow string
Branch string
Sha string
Event string
Status string // queued, in_progress, completed
Conclusion string // success, failure, cancelled, timed_out, skipped… once completed
Attempt int
URL string
Created time.Time
Started time.Time
Updated time.Time
}

// Job is one job of a run.
type Job struct {
Name string
Conclusion string
Started time.Time
Completed time.Time
}

// Runs lists the repository's newest workflow runs, up to limit.
func Runs(ctx context.Context, dir string, limit int) ([]Run, error) {
out, err := run(ctx, dir, "run", "list", "--limit", strconv.Itoa(limit), "--json",
"databaseId,workflowName,headBranch,headSha,event,status,conclusion,attempt,url,createdAt,startedAt,updatedAt")
if err != nil {
return nil, err
}
var raw []struct {
ID int64 `json:"databaseId"`
Workflow string `json:"workflowName"`
Branch string `json:"headBranch"`
Sha string `json:"headSha"`
Event string `json:"event"`
Status string `json:"status"`
Conclusion string `json:"conclusion"`
Attempt int `json:"attempt"`
URL string `json:"url"`
Created time.Time `json:"createdAt"`
Started time.Time `json:"startedAt"`
Updated time.Time `json:"updatedAt"`
}
if err := json.Unmarshal(out, &raw); err != nil {
return nil, fmt.Errorf("gh run list: %w", err)
}
runs := make([]Run, 0, len(raw))
for _, r := range raw {
runs = append(runs, Run{ID: r.ID, Workflow: r.Workflow, Branch: r.Branch, Sha: r.Sha, Event: r.Event, Status: r.Status,
Conclusion: r.Conclusion, Attempt: r.Attempt, URL: r.URL, Created: r.Created, Started: r.Started, Updated: r.Updated})
}
return runs, nil
}

// RunJobs lists a run's jobs. A finished run's jobs never change, so a
// caller may keep them.
func RunJobs(ctx context.Context, dir string, id int64) ([]Job, error) {
out, err := run(ctx, dir, "run", "view", strconv.FormatInt(id, 10), "--json", "jobs")
if err != nil {
return nil, err
}
var raw struct {
Jobs []struct {
Name string `json:"name"`
Conclusion string `json:"conclusion"`
Started time.Time `json:"startedAt"`
Completed time.Time `json:"completedAt"`
} `json:"jobs"`
}
if err := json.Unmarshal(out, &raw); err != nil {
return nil, fmt.Errorf("gh run view: %w", err)
}
jobs := make([]Job, 0, len(raw.Jobs))
for _, j := range raw.Jobs {
jobs = append(jobs, Job{Name: j.Name, Conclusion: j.Conclusion, Started: j.Started, Completed: j.Completed})
}
return jobs, nil
}

// Rerun runs a run's failed jobs again, as a new attempt of the same run.
func Rerun(ctx context.Context, dir string, id int64) error {
_, err := run(ctx, dir, "run", "rerun", strconv.FormatInt(id, 10), "--failed")
return err
}

// FailedRunID is the newest failed Actions run on branch — at commit head
// when given — for a re-run asked for by branch rather than by run.
func FailedRunID(ctx context.Context, dir, branch, head string) (int64, error) {
runs, err := failedRuns(ctx, dir, branch, head)
if err != nil {
return 0, err
}
return runs[0].ID, nil
}

// failed says whether a finished run's conclusion is a failure: a timeout
// is one, a cancellation is somebody's choice.
func failed(conclusion string) bool { return conclusion == "failure" || conclusion == "timed_out" }

// CIStats is what the CI panel shows for a period of whole days.
type CIStats struct {
Days int
// Finished runs that passed or failed in the period (a cancelled or
// skipped run is neither), and the same for the period before it.
Runs, Passed, Failed int
PrevRuns, PrevPassed int
// Medians, in seconds, of a run's time from start to finish and of
// its wait in the queue; the run time also for the period before.
MedianSeconds, PrevMedianSeconds, QueueSeconds int
// How long a branch stayed red: from a failed run to the next passing
// run of the same workflow on the same branch, median, and how many.
RedToGreenSeconds, RedToGreenCount int
// One entry a day, the oldest first and today last.
Daily []CIDay
// Each job, the slowest (by median) first.
Jobs []CIJob
// Jobs and runs that failed and then passed without a change.
Flaky []CIFlaky
// The newest run of each workflow on each branch, where it failed:
// what can be run again.
Failing []Run
// How many of the period's runs had their jobs read.
JobsRead int
}

// CIDay is one day's finished runs.
type CIDay struct {
Date string // YYYY-MM-DD in the server's time zone
Passed, Failed int
}

// CIJob is one job's record over the period.
type CIJob struct {
Name string
Runs, Failed int
MedianSeconds, P90Seconds int
}

// CIFlaky is a job (or a whole run) that failed and passed with nothing
// changed: on the same commit, or on a second attempt of the same run.
type CIFlaky struct {
Name string
Times int
How string
Last time.Time
}

// ComputeStats works out a period's statistics: the days days up to and
// including now's (in loc), and the same number before them. jobs holds
// the jobs of whichever runs have been read.
func ComputeStats(runs []Run, jobs map[int64][]Job, now time.Time, days int, loc *time.Location) CIStats {
if days < 1 {
days = 1
}
y, m, d := now.In(loc).Date()
start := time.Date(y, m, d, 0, 0, 0, 0, loc).AddDate(0, 0, -(days - 1))
prevStart := start.AddDate(0, 0, -days)
s := CIStats{Days: days}
day := map[string]int{}
for i := range days {
date := start.AddDate(0, 0, i).Format("2006-01-02")
day[date] = i
s.Daily = append(s.Daily, CIDay{Date: date})
}
var durations, prevDurations, queues []int
type jobAcc struct {
runs, failed int
secs []int
}
jobAccs := map[string]*jobAcc{}
var inPeriod []Run
for _, r := range runs {
finished := r.Status == "completed" && (r.Conclusion == "success" || failed(r.Conclusion))
switch {
case !finished:
continue
case !r.Created.Before(start):
inPeriod = append(inPeriod, r)
s.Runs++
i := day[r.Created.In(loc).Format("2006-01-02")]
if r.Conclusion == "success" {
s.Passed++
s.Daily[i].Passed++
} else {
s.Failed++
s.Daily[i].Failed++
}
if !r.Started.IsZero() && r.Updated.After(r.Started) {
durations = append(durations, int(r.Updated.Sub(r.Started).Seconds()))
}
if !r.Started.IsZero() && !r.Started.Before(r.Created) {
queues = append(queues, int(r.Started.Sub(r.Created).Seconds()))
}
if js, ok := jobs[r.ID]; ok {
s.JobsRead++
for _, j := range js {
a := jobAccs[j.Name]
if a == nil {
a = &jobAcc{}
jobAccs[j.Name] = a
}
a.runs++
if failed(j.Conclusion) {
a.failed++
}
if !j.Started.IsZero() && j.Completed.After(j.Started) {
a.secs = append(a.secs, int(j.Completed.Sub(j.Started).Seconds()))
}
}
}
case !r.Created.Before(prevStart):
s.PrevRuns++
if r.Conclusion == "success" {
s.PrevPassed++
}
if !r.Started.IsZero() && r.Updated.After(r.Started) {
prevDurations = append(prevDurations, int(r.Updated.Sub(r.Started).Seconds()))
}
}
}
s.MedianSeconds = percentile(durations, 0.5)
s.PrevMedianSeconds = percentile(prevDurations, 0.5)
s.QueueSeconds = percentile(queues, 0.5)
for name, a := range jobAccs {
s.Jobs = append(s.Jobs, CIJob{Name: name, Runs: a.runs, Failed: a.failed, MedianSeconds: percentile(a.secs, 0.5), P90Seconds: percentile(a.secs, 0.9)})
}
sort.Slice(s.Jobs, func(i, j int) bool {
if s.Jobs[i].MedianSeconds != s.Jobs[j].MedianSeconds {
return s.Jobs[i].MedianSeconds > s.Jobs[j].MedianSeconds
}
return s.Jobs[i].Name < s.Jobs[j].Name
})

// Oldest first from here: red to green, and flakiness, follow time.
sort.Slice(inPeriod, func(i, j int) bool {
if !inPeriod[i].Created.Equal(inPeriod[j].Created) {
return inPeriod[i].Created.Before(inPeriod[j].Created)
}
return inPeriod[i].ID < inPeriod[j].ID
})
redSince := map[string]time.Time{}
var greens []int
for _, r := range inPeriod {
k := r.Workflow + "\x00" + r.Branch
if failed(r.Conclusion) {
if _, ok := redSince[k]; !ok {
redSince[k] = r.Updated
}
} else if t, ok := redSince[k]; ok {
greens = append(greens, int(r.Updated.Sub(t).Seconds()))
delete(redSince, k)
}
}
s.RedToGreenSeconds, s.RedToGreenCount = percentile(greens, 0.5), len(greens)

// A job that failed and passed on one commit in one workflow.
type seen struct{ failed, passed bool }
bySha := map[string]map[string]*seen{}
last := map[string]time.Time{}
for _, r := range inPeriod {
k := r.Workflow + "\x00" + r.Sha
if bySha[k] == nil {
bySha[k] = map[string]*seen{}
}
for _, j := range jobs[r.ID] {
sn := bySha[k][j.Name]
if sn == nil {
sn = &seen{}
bySha[k][j.Name] = sn
}
if failed(j.Conclusion) {
sn.failed = true
} else if j.Conclusion == "success" {
sn.passed = true
}
if sn.failed && sn.passed && r.Updated.After(last[k+"\x00"+j.Name]) {
last[k+"\x00"+j.Name] = r.Updated
}
}
}
flaky := map[string]*CIFlaky{}
for k, names := range bySha {
for name, sn := range names {
if !sn.failed || !sn.passed {
continue
}
f := flaky[name]
if f == nil {
f = &CIFlaky{Name: name, How: "failed and passed on the same commit"}
flaky[name] = f
}
f.Times++
if t := last[k+"\x00"+name]; t.After(f.Last) {
f.Last = t
}
}
}
for _, f := range flaky {
s.Flaky = append(s.Flaky, *f)
}
sort.Slice(s.Flaky, func(i, j int) bool {
if s.Flaky[i].Times != s.Flaky[j].Times {
return s.Flaky[i].Times > s.Flaky[j].Times
}
return s.Flaky[i].Name < s.Flaky[j].Name
})
// A run that passed only on a later attempt: which job failed first is
// not in the run's latest attempt, so the run itself is named.
retried := map[string]*CIFlaky{}
var retriedNames []string
for _, r := range inPeriod {
if r.Attempt > 1 && r.Conclusion == "success" {
f := retried[r.Workflow]
if f == nil {
f = &CIFlaky{Name: r.Workflow}
retried[r.Workflow] = f
retriedNames = append(retriedNames, r.Workflow)
}
f.Times++
f.How = fmt.Sprintf("passed on attempt %d", r.Attempt)
f.Last = r.Updated
}
}
sort.Strings(retriedNames)
for _, n := range retriedNames {
s.Flaky = append(s.Flaky, *retried[n])
}

// What can be run again: each workflow's newest run on each branch,
// where it failed. Newest first.
newest := map[string]Run{}
for _, r := range runs {
if r.Status != "completed" {
continue
}
k := r.Workflow + "\x00" + r.Branch
if o, ok := newest[k]; !ok || r.Created.After(o.Created) || (r.Created.Equal(o.Created) && r.ID > o.ID) {
newest[k] = r
}
}
for _, r := range newest {
if failed(r.Conclusion) {
s.Failing = append(s.Failing, r)
}
}
sort.Slice(s.Failing, func(i, j int) bool {
if !s.Failing[i].Created.Equal(s.Failing[j].Created) {
return s.Failing[i].Created.After(s.Failing[j].Created)
}
return s.Failing[i].ID > s.Failing[j].ID
})
return s
}

// percentile is the nearest-rank percentile of xs (p in 0..1), 0 for none.
func percentile(xs []int, p float64) int {
if len(xs) == 0 {
return 0
}
s := append([]int(nil), xs...)
sort.Ints(s)
i := int(math.Ceil(p*float64(len(s)))) - 1
return s[max(0, min(i, len(s)-1))]
}
Loading
Loading