Skip to content

Where people and agents ship software together. The open-source git platform for the whole job: issues, agents, checks and deploys to the edge.

Commit

Contracts: signals carry session cost, harness use, and stalled as no activity

workspace_signals gains what harness sessions cost (per week, and each pull request's share), each person's first use of each harness (for practices spreading through a team), and stalled now means no activity in three days rather than open over a week. Part of #157

G1t-Session:
ses_01m57128wre9bvvj1y4z4b8dk0
syntaqxcommitted Parentd34fb83Browse files
3 files+44−40/3 viewed
+4−1
7272 // --- Adding up batches ------------------------------------------------------------
7373
7474 export function emptySignals(): WorkspaceSignals {
75− return { weeks: [], days: [], waiting: [], pulls: [], pullsCapped: false, authors: [], items: [], milestones: [] };
75+ return { weeks: [], days: [], waiting: [], pulls: [], pullsCapped: false, authors: [], harnesses: [], items: [], milestones: [] };
7676 }
7777
7878 /** The batches' answers as one: rows are per repository, so they add; items and milestones once each. */
8686 all.waiting.push(...batch.waiting);
8787 all.pulls.push(...batch.pulls);
8888 all.authors.push(...batch.authors);
89+ all.harnesses.push(...(batch.harnesses ?? []));
8990 all.pullsCapped ||= batch.pullsCapped;
9091 for (const item of batch.items) items.set(item.number, item);
9192 for (const milestone of batch.milestones) milestones.set(milestone.number, milestone);
110111 reviewed: 0,
111112 reviewSeconds: 0,
112113 stalled: 0,
114+ sessionCostUsd: 0,
113115 });
114116
115117 /** Every week in `starts`, quiet ones too, for the repositories in `only` (every one when not given). */
126128 week.reviewed += row.reviewed;
127129 week.reviewSeconds += row.reviewSeconds;
128130 week.stalled += row.stalled;
131+ week.sessionCostUsd += row.sessionCostUsd ?? 0;
129132 }
130133 return starts.map((start) => byStart.get(start)!);
131134 }
+26−2
4848 /// changes, as Insights counts them), and the seconds each waited.
4949 pub reviewed: u32,
5050 pub review_seconds: f64,
51− /// Pull requests open when the week ended (now, for the current week)
52− /// that had been open over seven days by then.
51+ /// Pull requests open when the week ended (now, for the current week),
52+ /// opened at least three days before, with no activity in the three
53+ /// days before it ended: no push, comment, review, timeline event,
54+ /// check or session entry.
5355 pub stalled: u32,
56+ /// What the harness sessions started in the week cost, as they
57+ /// reported it (estimated at list price from their token usage).
58+ pub session_cost_usd: f64,
5459 }
5560
5661 /// One repository's UTC day. Days with nothing in them are left out.
104109 /// The work item it is for, and that item's milestone.
105110 pub item: Option<u32>,
106111 pub milestone: Option<u32>,
112+ /// Its share of what the harness sessions tied to it cost: each
113+ /// session's cost split evenly among the pull requests it is tied to.
114+ pub session_cost_usd: f64,
115+}
116+
117+/// One person's use of one harness in one repository: when they first
118+/// started a session with it there, and how many they have started.
119+#[derive(Clone, Default, Deserialize, Serialize)]
120+#[serde(default, rename_all(serialize = "camelCase"))]
121+pub struct SignalHarness {
122+ pub repo_id: String,
123+ pub owner_id: String,
124+ pub owner_name: String,
125+ /// claude_code, codex, cursor, copilot or other.
126+ pub harness: String,
127+ pub first_at: String,
128+ pub sessions: u32,
107129 }
108130
109131 /// One person's merged pull requests in one repository, over its whole history.
153175 pub pulls: Vec<SignalPull>,
154176 pub pulls_capped: bool,
155177 pub authors: Vec<SignalAuthor>,
178+ /// People's harnesses, root sessions only (a subagent is its parent's).
179+ pub harnesses: Vec<SignalHarness>,
156180 pub items: Vec<SignalItem>,
157181 pub milestones: Vec<SignalMilestone>,
158182 }
+14−1
18591859 /** The first UTC day `pulls` reaches back to: at most 400 days before `until`. */
18601860 since: string;
18611861 };
1862−/** One repository's week from UTC day `start`; empty weeks are left out. `stalled`: open when the week ended (now, for this week), and open over seven days by then. */
1862+/**
1863+ * One repository's week from UTC day `start`; empty weeks are left out.
1864+ * `stalled`: open when the week ended (now, for this week), opened three
1865+ * days or more before, and no activity (push, comment, review, timeline
1866+ * event, check, session entry) in the three days before it ended.
1867+ * `sessionCostUsd`: what the harness sessions started in the week cost,
1868+ * estimated at list price from the token usage they reported.
1869+ */
18631870 export type SignalWeek = {
18641871 repoId: string;
18651872 start: string;
18721879 reviewed: number;
18731880 reviewSeconds: number;
18741881 stalled: number;
1882+ sessionCostUsd: number;
18751883 };
18761884 export type SignalDay = { repoId: string; day: string; opened: number; merged: number; agentMerged: number; reworked: number; reviews: number; sessions: number };
18771885 /** An open pull request no one has reviewed, oldest first; `blocks`: the open work items waiting on its work item. */
18881896 mergedAt: string | null;
18891897 item: number | null;
18901898 milestone: number | null;
1899+ /** Its share of its harness sessions' cost: each session's split evenly among the pull requests it is tied to. */
1900+ sessionCostUsd: number;
18911901 };
1902+/** One person's use of one harness in one repository, root sessions only. */
1903+export type SignalHarness = { repoId: string; ownerId: string; ownerName: string; harness: string; firstAt: string; sessions: number };
18921904 /** One person's merged pull requests in one repository over its history; `recent`: in the 90 days ending with `until`. */
18931905 export type SignalAuthor = { repoId: string; ownerId: string; ownerName: string; firstMergedAt: string; lastMergedAt: string; merged: number; recent: number };
18941906 export type SignalItem = { number: number; title: string; state: string; milestone: number | null };
19001912 pulls: SignalPull[];
19011913 pullsCapped: boolean;
19021914 authors: SignalAuthor[];
1915+ harnesses: SignalHarness[];
19031916 items: SignalItem[];
19041917 milestones: SignalMilestone[];
19051918 };

Comments

Sign in to comment.