@lensmcp/protocol-types 1.25.49 → 1.25.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -32,6 +32,8 @@ export * from './lib/event-loop.js';
32
32
  export * from './lib/workspace-actions.js';
33
33
  export * from './lib/team.js';
34
34
  export * from './lib/team-review-changes.js';
35
+ export * from './lib/goal-outcome.js';
36
+ export * from './lib/goal-retro.js';
35
37
  export * from './lib/team-design.js';
36
38
  export * from './lib/team-library.js';
37
39
  export * from './lib/system-report.js';
package/index.js CHANGED
@@ -1 +1 @@
1
- "use strict";export*from"./lib/schema-version.js";export*from"./lib/source-location.js";export*from"./lib/context.js";export*from"./lib/event.js";export*from"./lib/node.js";export*from"./lib/edge.js";export*from"./lib/attributes.js";export*from"./lib/producer-health.js";export*from"./lib/resources.js";export*from"./lib/tokens.js";export*from"./lib/capture-demand.js";export*from"./lib/bounded-clone.js";export*from"./lib/bounded-map.js";export*from"./lib/flood-guard.js";export*from"./lib/dashboard.js";export*from"./lib/log-query.js";export*from"./lib/error-dismissal.js";export*from"./lib/ai-content.js";export*from"./lib/http-exchange.js";export*from"./lib/ai-call.js";export*from"./lib/ai-call-row.js";export*from"./lib/ai-call-groups.js";export*from"./lib/ai-context.js";export*from"./lib/ai-origins.js";export*from"./lib/ai-playground.js";export*from"./lib/pod-memory.js";export*from"./lib/perf-rules.js";export*from"./lib/sources.js";export*from"./lib/page-visit.js";export*from"./lib/replay.js";export*from"./lib/event-loop.js";export*from"./lib/workspace-actions.js";export*from"./lib/team.js";export*from"./lib/team-review-changes.js";export*from"./lib/team-design.js";export*from"./lib/team-library.js";export*from"./lib/system-report.js";export*from"./lib/overseer-findings.js";export*from"./lib/overseer-rounds.js";
1
+ "use strict";export*from"./lib/schema-version.js";export*from"./lib/source-location.js";export*from"./lib/context.js";export*from"./lib/event.js";export*from"./lib/node.js";export*from"./lib/edge.js";export*from"./lib/attributes.js";export*from"./lib/producer-health.js";export*from"./lib/resources.js";export*from"./lib/tokens.js";export*from"./lib/capture-demand.js";export*from"./lib/bounded-clone.js";export*from"./lib/bounded-map.js";export*from"./lib/flood-guard.js";export*from"./lib/dashboard.js";export*from"./lib/log-query.js";export*from"./lib/error-dismissal.js";export*from"./lib/ai-content.js";export*from"./lib/http-exchange.js";export*from"./lib/ai-call.js";export*from"./lib/ai-call-row.js";export*from"./lib/ai-call-groups.js";export*from"./lib/ai-context.js";export*from"./lib/ai-origins.js";export*from"./lib/ai-playground.js";export*from"./lib/pod-memory.js";export*from"./lib/perf-rules.js";export*from"./lib/sources.js";export*from"./lib/page-visit.js";export*from"./lib/replay.js";export*from"./lib/event-loop.js";export*from"./lib/workspace-actions.js";export*from"./lib/team.js";export*from"./lib/team-review-changes.js";export*from"./lib/goal-outcome.js";export*from"./lib/goal-retro.js";export*from"./lib/team-design.js";export*from"./lib/team-library.js";export*from"./lib/system-report.js";export*from"./lib/overseer-findings.js";export*from"./lib/overseer-rounds.js";
@@ -271,6 +271,11 @@ export interface DashCluster {
271
271
  }>;
272
272
  /** This project's worktree INSTANCES the gateway knows (`lensmcp instance start`) — running or stopped. */
273
273
  worktrees?: DashWorktree[];
274
+ /**
275
+ * Worktrees still on record whose folder is no longer a checkout — removed, or removed with a failure the lens recorded
276
+ * — left out of `worktrees`: `lensmcp instance prune` forgets them and drops the data the lens made for them.
277
+ */
278
+ worktreesGone?: number;
274
279
  /** Set when THIS dashboard is a worktree instance's: whose worktree it is. */
275
280
  instance?: {
276
281
  name: string;
@@ -965,6 +970,7 @@ export interface DashSummary {
965
970
  troubled: number;
966
971
  instance?: DashCluster['instance'];
967
972
  worktrees?: DashWorktree[];
973
+ worktreesGone?: number;
968
974
  };
969
975
  /** `DashSession.setupIssues.length`. */
970
976
  setupIssues?: number;
@@ -0,0 +1,159 @@
1
+ import type { DashTeamKind, DashTeamOutcome, DashTeamTaskState } from './team.js';
2
+ /**
3
+ * A goal's outcome row (planning/team/18 RT-D16): its run's outcomes in numbers, written when its archive is, or by the
4
+ * retrospective for a goal that never archives, and kept in the coordination store. Later retrospectives grade the
5
+ * changes applied after a goal against the rows of the goals that follow it; a row says nothing about why.
6
+ */
7
+ export interface DashGoalOutcome {
8
+ schema: 1;
9
+ goalId: string;
10
+ title: string;
11
+ repoId: string;
12
+ /** What wrote it: the goal's archive, or a retrospective of a goal with none. */
13
+ source: 'archive' | 'retrospective';
14
+ writtenAt: number;
15
+ /** The run review's window — `open`: the goal was still running. */
16
+ window: {
17
+ from: number;
18
+ to: number;
19
+ open: boolean;
20
+ };
21
+ state: DashTeamTaskState;
22
+ outcome?: DashTeamOutcome;
23
+ /** The lensmcp that wrote the row. */
24
+ lensmcp?: string;
25
+ changes: DashGoalOutcomeChanges;
26
+ /** Bugs filed against, and tests failed on, a change a review had approved — the verdicts an outcome contradicted. */
27
+ afterApproval: DashGoalOutcomeContradiction[];
28
+ /** Per check: seeded, its verdicts, caught later (check-counts.ts), without the review ids. */
29
+ checks: DashGoalOutcomeCheck[];
30
+ qa: {
31
+ runs: number;
32
+ passed: number;
33
+ failed: number;
34
+ };
35
+ /** Per kind of task: how many, ms waited from created to first claim, ms worked from first claim to closed. */
36
+ time: Partial<Record<DashTeamKind, {
37
+ tasks: number;
38
+ waited: number;
39
+ worked: number;
40
+ }>>;
41
+ sessions: DashGoalOutcomeSessions;
42
+ /** The run's model tokens (input with cache, and output), corrected as foodguard-157 made them; per change made. */
43
+ tokens?: {
44
+ total: number;
45
+ perChange?: number;
46
+ };
47
+ /** The paths the goal's work named or edited, at most 300 — what a proposal's path scope is matched against. */
48
+ touched?: string[];
49
+ /** The run review's flags by kind. */
50
+ flags: Record<string, number>;
51
+ /** What the agents worked under (RT-D5): each role's rules hash and when it was in force, the flow's, the checks'. */
52
+ inForce: DashGoalInForce;
53
+ /**
54
+ * The lessons the run's claims were told (RT-D15), each with the claims and changes it was told on, and the bugs filed
55
+ * and tests failed after an approval on those changes — what grades a lesson beyond its finding's acceptance check.
56
+ * Absent on a row a lensmcp before this wrote.
57
+ */
58
+ lessons?: DashGoalOutcomeLesson[];
59
+ /**
60
+ * Transcript mistakes LensMCP's recipes counted (planning/team/18 gate 7) — kept by the goal's retrospective, which
61
+ * reads the transcripts; absent on a row no retrospective read.
62
+ */
63
+ transcripts?: DashGoalTranscripts;
64
+ /** Items left out past a cap — the row counts what it read. */
65
+ truncated?: {
66
+ tasks?: number;
67
+ joins?: number;
68
+ };
69
+ }
70
+ export interface DashGoalOutcomeChanges {
71
+ /** Builds and bugs the team made. */
72
+ total: number;
73
+ /** Those with at least one review, and those whose every reviewing role's newest review approved. */
74
+ reviewed: number;
75
+ approved: number;
76
+ /** Those reworked at least once, and the rework rounds of all of them. */
77
+ reworked: number;
78
+ reworkRounds: number;
79
+ /** Reviewed changes by rework rounds: `{ "0": 5, "1": 2, "2": 1 }`. */
80
+ byRounds: Record<string, number>;
81
+ }
82
+ export interface DashGoalOutcomeContradiction {
83
+ /** The bug filed, or the test that failed. */
84
+ taskId: string;
85
+ kind: 'bug' | 'test';
86
+ /** The change it contradicts, and the reviews that had approved it. */
87
+ changeId: string;
88
+ approvedBy: string[];
89
+ /** The paths it and the change share — the change's own when it names none. */
90
+ paths: string[];
91
+ /** The check families the approving reviews passed or ruled n/a. */
92
+ families: string[];
93
+ }
94
+ export interface DashGoalTranscripts {
95
+ /** Transcripts read, their bytes, and those cut or left out past the caps. */
96
+ agents: number;
97
+ bytes: number;
98
+ cut?: number;
99
+ /** By recipe: lines matched and the agents they came from; for repeated errors, groups and their keys (`5× Error: …`). */
100
+ recipes: Partial<Record<string, {
101
+ count: number;
102
+ agents: number;
103
+ keys?: string[];
104
+ }>>;
105
+ }
106
+ export interface DashGoalOutcomeLesson {
107
+ id: string;
108
+ /** Claims it was told at, and the changes (builds and bugs) those claims were on. */
109
+ told: number;
110
+ changes: number;
111
+ /** The afterApproval rows on a change it was told on: the bug or test's task id — it was told, and it did not hold. */
112
+ missed: string[];
113
+ }
114
+ export type DashGoalOutcomeCheck = {
115
+ id: string;
116
+ family: string;
117
+ level?: 'must' | 'should';
118
+ seeded: number;
119
+ pass: number;
120
+ fail: number;
121
+ na: number;
122
+ open: number;
123
+ caughtLater: number;
124
+ };
125
+ export interface DashGoalOutcomeSessions {
126
+ /** Agents with a session, by the role they held longest. */
127
+ byRole: Record<string, number>;
128
+ /** Agents that claimed work and completed none. */
129
+ finishedNothing: number;
130
+ /** Spawned agents that never joined. */
131
+ unjoined: number;
132
+ }
133
+ export interface DashGoalInForce {
134
+ /** Each role's rules hash, in the order first joined: how many joins carried it, and when the first and last were. */
135
+ roles: Array<{
136
+ role: string;
137
+ rulesHash: string;
138
+ joins: number;
139
+ from: number;
140
+ to: number;
141
+ }>;
142
+ /** The flow's (flow.json and its caps) and the check catalog's hashes the joins saw. */
143
+ flow: string[];
144
+ checks: string[];
145
+ /** Joins from a lensmcp too old to record what it sent. */
146
+ unrecorded: number;
147
+ /**
148
+ * The lensmcp versions that served the joins, in the order first seen, with the roles that joined through each: two
149
+ * versions in one goal is LensMCP's own rules changing under it (a lens upgraded mid-run, or a worktree's older lens).
150
+ * Absent on a row a lensmcp before this recorded, and empty when no join recorded its version.
151
+ */
152
+ lensmcp?: Array<{
153
+ version: string;
154
+ joins: number;
155
+ roles: string[];
156
+ from: number;
157
+ to: number;
158
+ }>;
159
+ }
@@ -0,0 +1 @@
1
+ "use strict";export{};
@@ -0,0 +1,60 @@
1
+ /**
2
+ * A goal's retrospective run (planning/team/18 RT-D1, RT-D2): queued when the goal's archive is written or the person
3
+ * clicks, run by the lens — a digest code builds, one Opus call only when a gate fired — and what it wrote: the goal's
4
+ * account, the findings it proposed, those it merged into a live one, those it dropped and why, the grades it read first.
5
+ */
6
+ export type DashGoalRetroState = 'queued' | 'running' | 'waiting' | 'done' | 'failed';
7
+ export interface DashGoalRetroGate {
8
+ id: string;
9
+ rank: number;
10
+ fired: boolean;
11
+ text: string;
12
+ }
13
+ export interface DashGoalRetro {
14
+ schema: 1;
15
+ goalId: string;
16
+ repoId: string;
17
+ title: string;
18
+ /** Who asked: the goal's archive (it completed), or the person. */
19
+ by: 'archive' | 'person';
20
+ queuedAt: number;
21
+ state: DashGoalRetroState;
22
+ /** What it waits on: Retrospectives switched off, no working key, the day's allowance spent. */
23
+ wait?: 'off' | 'key' | 'allowance';
24
+ reason?: string;
25
+ startedAt?: number;
26
+ endedAt?: number;
27
+ gates?: DashGoalRetroGate[];
28
+ /** The goal's account (markdown): where time went, what nobody knew, how earlier fixes fared. */
29
+ account?: string;
30
+ /** Findings it wrote, those a new sighting merged into, and the proposals it dropped with why. */
31
+ findings?: string[];
32
+ merged?: string[];
33
+ dropped?: string[];
34
+ /** The earlier proposals it graded before proposing (RT-D16). */
35
+ graded?: Array<{
36
+ id: string;
37
+ verdict: string;
38
+ }>;
39
+ costUsd?: number;
40
+ model?: string;
41
+ toolCalls?: number;
42
+ digestBytes?: number;
43
+ /** The goal's earlier runs, newest last (at most 10): what each cost counts toward its day's allowance. */
44
+ earlier?: Array<{
45
+ endedAt: number;
46
+ state: DashGoalRetroState;
47
+ costUsd: number;
48
+ findings: number;
49
+ }>;
50
+ }
51
+ /** `/api/team/retro?id=` — a goal's retrospective (none yet: null), and the day's allowance for them. */
52
+ export interface DashGoalRetroAnswer {
53
+ retro: DashGoalRetro | null;
54
+ allowance: {
55
+ on: boolean;
56
+ dailyUsd: number;
57
+ runUsd: number;
58
+ spentTodayUsd: number;
59
+ };
60
+ }
@@ -0,0 +1 @@
1
+ "use strict";export{};
@@ -83,6 +83,49 @@ export type DashFindingAction = {
83
83
  kind: 'issue';
84
84
  title: string;
85
85
  draft: string;
86
+ }
87
+ /**
88
+ * A check file in the project's layer (planning/team/18 RT-D7): `add` a new one, `narrow` one with the same id (the
89
+ * whole file both times), or `off` — never for a must check of the security or data families. Written uncommitted.
90
+ */
91
+ | {
92
+ kind: 'check';
93
+ repoId: string;
94
+ id: string;
95
+ op: 'add' | 'narrow' | 'off';
96
+ text?: string;
97
+ why?: string;
98
+ level?: 'must' | 'should';
99
+ }
100
+ /**
101
+ * One rule of `project.md` or a role file, by its anchor — the rule's exact text, found exactly once: `add` a line
102
+ * after it, `edit` it, `retire` its line. Refused past the brief's cut or a role's budget. Written uncommitted.
103
+ */
104
+ | {
105
+ kind: 'rule';
106
+ repoId: string;
107
+ file: string;
108
+ op: 'add' | 'edit' | 'retire';
109
+ anchor: string;
110
+ text?: string;
111
+ }
112
+ /** `flow.json` keys set (caps, goal, handOffs; null takes one out) — refused below the lensmcp that reads them. */
113
+ | {
114
+ kind: 'flow';
115
+ repoId: string;
116
+ set: Record<string, unknown>;
117
+ minLensmcp?: string;
118
+ }
119
+ /**
120
+ * A team lesson (planning/team/18 RT-D15), `.lensmcp/team/lessons/<id>.md`: `add` the whole file (a fact, its roles and
121
+ * paths, the file:line it cites; LensMCP sets its expiry, 90 days), `renew` its expiry, `retire` it. Written uncommitted.
122
+ */
123
+ | {
124
+ kind: 'lesson';
125
+ repoId: string;
126
+ id: string;
127
+ op: 'add' | 'renew' | 'retire';
128
+ text?: string;
86
129
  };
87
130
  export type DashFindingActionKind = DashFindingAction['kind'];
88
131
  /** The kinds Apply runs itself; any other is the person's — but an `issue`, run once the issues folder is set (S6). */
@@ -99,6 +142,9 @@ export interface DashFindingActionResult {
99
142
  kind: DashFindingActionKind;
100
143
  outcome: 'ran' | 'yours' | 'failed';
101
144
  message?: string;
145
+ /** A file it wrote, and the sha-256 of what it wrote — a later edit outside Apply is the person's (planning/team/18 RT-D14). */
146
+ path?: string;
147
+ sha?: string;
102
148
  }
103
149
  /** The newest Apply: every action run (or the person's) — or, not ok, the ones that failed; the finding stays proposed. */
104
150
  export interface DashFindingApply {
@@ -117,8 +163,62 @@ export interface DashFindingDismissed {
117
163
  }
118
164
  export interface DashFindingFixed {
119
165
  at: number;
120
- /** Its proposal applied and its checks ok for 24 h; its checks ok for 24 h with nothing applied; the overseer said so. */
121
- how: 'applied' | 'cleared' | 'overseer';
166
+ /**
167
+ * Its proposal applied and its checks ok for 24 h; its checks ok for 24 h with nothing applied; the overseer said so;
168
+ * its acceptance check held on the goals after it (planning/team/18 RT-D16).
169
+ */
170
+ how: 'applied' | 'cleared' | 'overseer' | 'held';
171
+ }
172
+ /**
173
+ * How an applied proposal is judged on the goals after it (planning/team/18 RT-D16): a metric read from their outcome
174
+ * rows, with no model. `metric` is one of:
175
+ * - `check.caughtLater:<id>`, `check.fail:<id>`: per seeding of the check;
176
+ * - `afterApproval`, `afterApproval.family:<family>`: bugs and failed tests after an approval, per reviewed change;
177
+ * - `rework.rounds`: per reviewed change;
178
+ * - `flags:<kind>`: per goal;
179
+ * - `sessions.finishedNothing`: per session;
180
+ * - `wait:<kind>`: ms waited per ms worked, for tasks of the kind;
181
+ * - `tokens.perChange`: per change made.
182
+ */
183
+ export interface DashFindingAcceptance {
184
+ metric: string;
185
+ /** The goals it is judged on: those touching one of these roles or paths — none: every goal of its repository. */
186
+ scope?: {
187
+ roles?: string[];
188
+ paths?: string[];
189
+ };
190
+ /** The metric over the goals it came from, and what it must reach: at most (`down`) or at least (`up`). */
191
+ baseline: number;
192
+ target: number;
193
+ direction: 'down' | 'up';
194
+ /** The next `goals` goals in scope (3), or what `days` (21) brought. */
195
+ goals: number;
196
+ days: number;
197
+ /** The least exposure a verdict needs (3): seedings, reviewed changes, sessions, tasks of the kind, goals. */
198
+ minExposure: number;
199
+ /** One metric that must not get worse by more than `tolerance`, a fraction of its baseline (0.25). */
200
+ counter?: {
201
+ metric: string;
202
+ baseline: number;
203
+ direction: 'down' | 'up';
204
+ tolerance: number;
205
+ };
206
+ /** The goals its baseline was read from: never graded on them. */
207
+ from?: string[];
208
+ }
209
+ export type DashFindingGradeVerdict = 'held' | 'not-held' | 'side-effect' | 'unexposed' | 'expired';
210
+ /** An applied proposal graded (RT-D16) — a count of recurrence over the goals read, not a claim about cause. */
211
+ export interface DashFindingGrade {
212
+ at: number;
213
+ verdict: DashFindingGradeVerdict;
214
+ /** The goals read, oldest first. */
215
+ goals: string[];
216
+ /** The metric over them, and its exposure; the counter-metric's. */
217
+ value?: number;
218
+ exposure: number;
219
+ counterValue?: number;
220
+ /** Not held or a side effect, across the proposals tried for it: two make a retire or escalate proposal. */
221
+ failures: number;
122
222
  }
123
223
  /**
124
224
  * A LensMCP-cause finding filed as an issue in the lensmcp checkout (planning/team/15 S6, SA-D5): its copy in the
@@ -166,6 +266,17 @@ export interface DashFinding {
166
266
  fixed?: DashFindingFixed;
167
267
  /** Filed as a LensMCP issue (cause `lensmcp`, the issues folder set). */
168
268
  issue?: DashFindingIssue;
269
+ /** How its applied proposal is judged on the goals after it, and the newest grade (planning/team/18 RT-D16). */
270
+ acceptance?: DashFindingAcceptance;
271
+ grade?: DashFindingGrade;
272
+ /** A retrospective wrote it (planning/team/18 RT-D1) — the overseer's otherwise. */
273
+ source?: 'retrospective';
274
+ /** `<repo>:<target>:<signal>` (RT-D8): a new sighting of the same cause merges into it as another goal (RT-D9). */
275
+ causeKey?: string;
276
+ /** The independent goals that showed its cause, oldest first. */
277
+ goals?: string[];
278
+ /** An unapplied retrospective proposal expires then (RT-D9: 14 days). */
279
+ expiresAt?: number;
169
280
  createdAt: number;
170
281
  updatedAt: number;
171
282
  /** The evidence and the proposal in words (markdown) — whole on one finding, absent in a list. */
@@ -1 +1 @@
1
- "use strict";var c=Object.defineProperty;var i=(e,n)=>c(e,"name",{value:n,configurable:!0});var u=Object.defineProperty,o=i((e,n)=>u(e,"name",{value:n,configurable:!0}),"t");export const FINDING_RUN_KINDS=["operate","stop-launch","close-session","role","role-off"];export function findingLive(e){return e.state==="open"||e.state==="proposed"||e.state==="applied"}i(findingLive,"findingLive"),o(findingLive,"findingLive");export function findingRunsActions(e,n={}){return e.actions.some(t=>FINDING_RUN_KINDS.includes(t.kind)||t.kind==="issue"&&n.issuesFolder===!0)}i(findingRunsActions,"findingRunsActions"),o(findingRunsActions,"findingRunsActions");export function findingsForCheck(e,n,t){const r=`repo:${n}/team.${t}`;return e.filter(s=>findingLive(s)&&s.checks.includes(r))}i(findingsForCheck,"findingsForCheck"),o(findingsForCheck,"findingsForCheck");
1
+ "use strict";var c=Object.defineProperty;var i=(e,n)=>c(e,"name",{value:n,configurable:!0});var u=Object.defineProperty,o=i((e,n)=>u(e,"name",{value:n,configurable:!0}),"s");export const FINDING_RUN_KINDS=["operate","stop-launch","close-session","role","role-off","check","rule","flow","lesson"];export function findingLive(e){return e.state==="open"||e.state==="proposed"||e.state==="applied"}i(findingLive,"findingLive"),o(findingLive,"findingLive");export function findingRunsActions(e,n={}){return e.actions.some(s=>FINDING_RUN_KINDS.includes(s.kind)||s.kind==="issue"&&n.issuesFolder===!0)}i(findingRunsActions,"findingRunsActions"),o(findingRunsActions,"findingRunsActions");export function findingsForCheck(e,n,s){const r=`repo:${n}/team.${s}`;return e.filter(t=>findingLive(t)&&t.checks.includes(r))}i(findingsForCheck,"findingsForCheck"),o(findingsForCheck,"findingsForCheck");
@@ -154,6 +154,15 @@ export interface DashTeamMember {
154
154
  fields: Record<string, DashTeamFieldSource>;
155
155
  /** Why its file was not read (the default stood in) — empty when it was. */
156
156
  problems: string[];
157
+ /** The checks it is held to (planning/team/17): how many, how many must, by family — team://checks names them. */
158
+ checks?: {
159
+ count: number;
160
+ must: number;
161
+ families: Array<{
162
+ family: string;
163
+ count: number;
164
+ }>;
165
+ };
157
166
  }
158
167
  /** `GET /api/team/roles` — the team as the checkout's files make it. */
159
168
  export interface DashTeamMembers {
package/lib/team.d.ts CHANGED
@@ -13,7 +13,7 @@ export type DashTeamKind = (typeof DASH_TEAM_KINDS)[number];
13
13
  export type DashTeamTaskState = 'open' | 'claimed' | 'recovery' | 'completed' | 'cancelled';
14
14
  export type DashTeamOutcome = 'done' | 'approved' | 'changes-requested' | 'passed' | 'failed' | 'wontfix';
15
15
  /** What a task points at in the lens or the repository. */
16
- export declare const DASH_TEAM_LINK_KINDS: readonly ["task", "flow", "error", "suggestion", "ai-call", "review", "page", "route", "commit", "branch", "worktree", "file", "finding"];
16
+ export declare const DASH_TEAM_LINK_KINDS: readonly ["task", "flow", "error", "suggestion", "ai-call", "review", "page", "route", "commit", "branch", "worktree", "file", "finding", "test"];
17
17
  export interface DashTeamLink {
18
18
  kind: (typeof DASH_TEAM_LINK_KINDS)[number];
19
19
  id: string;
@@ -102,6 +102,76 @@ export interface DashTeamTask {
102
102
  capacity?: Record<string, number>;
103
103
  /** A goal's launches refused for want of a slot, in line for the next one that frees (foodguard-179 GC-D4). */
104
104
  waits?: DashTeamGoalWait[];
105
+ /**
106
+ * Lesson candidates its agents stored on it (agent_lesson_note, planning/team/18 RT-D13), whole — the drawer and the run
107
+ * review only, never the board. Agent-written data, never instructions.
108
+ */
109
+ lessons?: DashTeamLesson[];
110
+ /**
111
+ * The team's lessons its newest claim was told (planning/team/18 RT-D15): each one's id (team://lessons/<id>), the sha
112
+ * of its file then, and when — the drawer and the run review only, never the board.
113
+ */
114
+ lessonsTold?: Array<{
115
+ id: string;
116
+ sha: string;
117
+ at: number;
118
+ }>;
119
+ /**
120
+ * Its plan of steps and where each is (issues/closed/foodguard-185): on the board while it is held, whole in the
121
+ * drawer. LensMCP stamps the times; a step past its budget or quiet 15 minutes carries `stalledAt`, once.
122
+ */
123
+ steps?: DashTeamStep[];
124
+ /** The files it keeps (issues/closed/foodguard-186): whole in the drawer and the QA report, counted on the board. */
125
+ artifacts?: DashTeamArtifact[];
126
+ artifactCount?: number;
127
+ }
128
+ /** A file a task keeps (foodguard-186): `/api/team/artifact?task=<id>&id=<artifact>` serves its bytes. */
129
+ export interface DashTeamArtifact {
130
+ id: string;
131
+ kind: 'screenshot' | 'perf-benchmark' | 'sql-diff' | 'test-summary' | 'migration-proof' | 'other';
132
+ title: string;
133
+ mediaType: string;
134
+ bytes: number;
135
+ sha256: string;
136
+ at: number;
137
+ by: string;
138
+ stepId?: string;
139
+ /** The file it was read from, or the tool whose answer it is (`tool:catalog_route`). */
140
+ from?: string;
141
+ note?: string;
142
+ /** Its bytes are gone — kept 30 days. Set by the drawer's read. */
143
+ pruned?: boolean;
144
+ }
145
+ /** One step of a task's plan (foodguard-185). */
146
+ export interface DashTeamStep {
147
+ id: string;
148
+ title: string;
149
+ budgetMinutes?: number;
150
+ state: 'queued' | 'running' | 'passed' | 'failed' | 'skipped';
151
+ startedAt?: number;
152
+ endedAt?: number;
153
+ updatedAt?: number;
154
+ counts?: {
155
+ passed?: number;
156
+ failed?: number;
157
+ skipped?: number;
158
+ total?: number;
159
+ };
160
+ runIds?: string[];
161
+ note?: string;
162
+ stalledAt?: number;
163
+ }
164
+ /** A fact a team agent noticed while it worked (RT-D13): agent-written data — no other agent is shown it. */
165
+ export interface DashTeamLesson {
166
+ at: number;
167
+ /** The session that wrote it, and the role it was in. */
168
+ sessionId: string;
169
+ role?: string;
170
+ fact: string;
171
+ /** Repository-relative paths it is about, the roles it matters to, and the tasks it rests on. */
172
+ paths?: string[];
173
+ roles?: string[];
174
+ rests?: string[];
105
175
  }
106
176
  /** A launch in line for a slot (issues/closed/foodguard-179 GC-D4). */
107
177
  export interface DashTeamGoalWait {
@@ -208,7 +278,7 @@ export interface DashTeamTaskWork {
208
278
  * change completed with no commit or no check, a QA pass naming no run, a claim with no line in ten minutes, a holder
209
279
  * whose process ended. Hints, never verdicts.
210
280
  */
211
- export type DashTeamConductKind = 'checker-edited' | 'whole-suite' | 'outside-paths' | 'no-commit' | 'unchecked' | 'qa-unrun' | 'quiet-claim' | 'host-gone' | 'edited-reserved';
281
+ export type DashTeamConductKind = 'checker-edited' | 'whole-suite' | 'outside-paths' | 'no-commit' | 'unchecked' | 'qa-unrun' | 'quiet-claim' | 'host-gone' | 'edited-reserved' | 'check-unproved' | 'over-budget';
212
282
  export interface DashTeamFlag {
213
283
  kind: DashTeamConductKind;
214
284
  severity: 'info' | 'warn';
@@ -221,9 +291,52 @@ export interface DashTeamFlag {
221
291
  export interface DashTeamReviewItem {
222
292
  id: string;
223
293
  text: string;
224
- from: 'done-means' | 'tests' | 'recheck' | 'reviewer';
294
+ from: 'done-means' | 'tests' | 'recheck' | 'check' | 'reviewer';
225
295
  verdict?: 'pass' | 'fail' | 'n/a';
226
296
  note?: string;
297
+ /** A check's item (planning/team/17): `<id>@<hash8>`, its level, what its note must show, what not to flag, and why it applied. */
298
+ check?: string;
299
+ level?: 'must' | 'should';
300
+ proof?: string;
301
+ not?: string;
302
+ why?: string;
303
+ }
304
+ /**
305
+ * A goal's checks as the Team page's drawer shows them (planning/team/17 SK-D7): the pick's state and its picks — each
306
+ * with why, the paths it was picked for, and whether the model or the person chose it — the ids the person removed,
307
+ * and the checks in force to add from. `GET /api/team/goal/checks?id=`.
308
+ */
309
+ export interface DashTeamGoalChecks {
310
+ goal: {
311
+ id: string;
312
+ title: string;
313
+ };
314
+ checks?: {
315
+ state: 'picked' | 'floor' | 'running';
316
+ picked: Array<{
317
+ id: string;
318
+ why: string;
319
+ paths?: string[];
320
+ by: 'model' | 'person';
321
+ }>;
322
+ removed: string[];
323
+ at: number;
324
+ reason?: string;
325
+ wait?: 'key' | 'allowance' | 'off';
326
+ model?: string;
327
+ again?: boolean;
328
+ costUsd?: number;
329
+ };
330
+ catalog: {
331
+ sha: string;
332
+ checks: Array<{
333
+ id: string;
334
+ title: string;
335
+ level: 'must' | 'should';
336
+ family: string;
337
+ layer: 'library' | 'user' | 'project';
338
+ }>;
339
+ };
227
340
  }
228
341
  /** A task named in another's chain: its parent, its children, a blocker. */
229
342
  export interface DashTeamTaskRef {
@@ -796,6 +909,27 @@ export interface DashTeamReview {
796
909
  /** The reviewed goal's plan, and its next list (GS-D1–D2). */
797
910
  plan?: import('./team-review-changes.js').DashTeamReviewPlan;
798
911
  next?: DashTeamNextItem[];
912
+ /** How each check fared in the run's reviews (planning/team/17 SK-D12) — absent: no review held a check item. */
913
+ checks?: DashTeamCheckCount[];
914
+ }
915
+ /**
916
+ * One check's record in a window's reviews (planning/team/17 SK-D12, libs/storage check-counts.ts): seeded, its verdicts,
917
+ * and caught later — passed or n/a, then a later review of the same change failed an item of its family, or a bug filed
918
+ * after it names the check.
919
+ */
920
+ export interface DashTeamCheckCount {
921
+ /** Without its content hash: `data/no-query-in-loop` — team://checks/<id>. */
922
+ id: string;
923
+ family: string;
924
+ level?: 'must' | 'should';
925
+ seeded: number;
926
+ pass: number;
927
+ fail: number;
928
+ na: number;
929
+ open: number;
930
+ caughtLater: number;
931
+ /** The reviews it was in, at most 5: caught later first, then failed, then the newest. */
932
+ reviews: string[];
799
933
  }
800
934
  /** The clients LensMCP launches headless: Codex (`codex exec`) and Claude Code (`claude -p`). */
801
935
  export type DashTeamLaunchClient = 'codex' | 'claude';
@@ -1060,6 +1194,8 @@ export interface DashTeamHealth {
1060
1194
  joins?: number;
1061
1195
  messages?: number;
1062
1196
  };
1197
+ /** How each check fared in the window's reviews (planning/team/17 SK-D12) — absent: no review held a check item. */
1198
+ reviewChecks?: DashTeamCheckCount[];
1063
1199
  observedAt: number;
1064
1200
  }
1065
1201
  /**
package/lib/team.js CHANGED
@@ -1 +1 @@
1
- "use strict";var o=Object.defineProperty;var r=(t,e)=>o(t,"name",{value:e,configurable:!0});var i=Object.defineProperty,a=r((t,e)=>i(t,"name",{value:e,configurable:!0}),"r");export const DASH_TEAM_KINDS=["goal","build","bug","review","test","qa","docs","marketing","research","chore"],DASH_TEAM_LINK_KINDS=["task","flow","error","suggestion","ai-call","review","page","route","commit","branch","worktree","file","finding"];export function modelClient(t){const e=t?.trim()??"";if(/\b(claude|opus|sonnet|haiku|fable)\b/i.test(e))return"claude";if(/^(gpt|o\d+|codex)\b/i.test(e))return"codex"}r(modelClient,"modelClient"),a(modelClient,"modelClient");
1
+ "use strict";var o=Object.defineProperty;var r=(t,e)=>o(t,"name",{value:e,configurable:!0});var i=Object.defineProperty,a=r((t,e)=>i(t,"name",{value:e,configurable:!0}),"r");export const DASH_TEAM_KINDS=["goal","build","bug","review","test","qa","docs","marketing","research","chore"],DASH_TEAM_LINK_KINDS=["task","flow","error","suggestion","ai-call","review","page","route","commit","branch","worktree","file","finding","test"];export function modelClient(t){const e=t?.trim()??"";if(/\b(claude|opus|sonnet|haiku|fable)\b/i.test(e))return"claude";if(/^(gpt|o\d+|codex)\b/i.test(e))return"codex"}r(modelClient,"modelClient"),a(modelClient,"modelClient");
@@ -1,8 +1,15 @@
1
- export type WorkspaceActionKind = 'start' | 'stop' | 'restart' | 'migrate' | 'test' | 'e2e' | 'typecheck' | 'lint' | 'build' | 'verify' | 'worktree-stop' | 'worktree-remove';
1
+ export type WorkspaceActionKind = 'start' | 'stop' | 'restart' | 'migrate' | 'test' | 'e2e' | 'typecheck' | 'lint' | 'build' | 'verify' | 'benchmark' | 'capture' | 'worktree-stop' | 'worktree-remove';
2
2
  export type WorkspaceActionState = 'queued' | 'running' | 'passed' | 'failed' | 'errored' | 'cancelled' | 'timeout';
3
+ /**
4
+ * The machine queue's lane (issues/closed/foodguard-189): `heavy` runs one at a time on the machine — a whole test target,
5
+ * e2e, verify, anything over an hour; `light` runs a few at once, admitted by free memory — specs by file or relation, a
6
+ * typecheck, a lint, a build.
7
+ */
8
+ export type WorkspaceActionLane = 'light' | 'heavy';
3
9
  export interface WorkspaceActionInput {
4
10
  action: WorkspaceActionKind;
5
- project: string;
11
+ /** The Nx project — absent only for a run over `affected` projects. */
12
+ project?: string;
6
13
  target?: string;
7
14
  worktree?: string;
8
15
  timeoutMs?: number;
@@ -10,13 +17,88 @@ export interface WorkspaceActionInput {
10
17
  heapMb?: number;
11
18
  files?: string[];
12
19
  testName?: string;
20
+ /**
21
+ * A test run of the specs related to these source files (issues/closed/foodguard-188): jest's `--findRelatedTests`, or
22
+ * for vitest the specs the repository's import graph says import them at any depth. Paths in the checkout.
23
+ */
24
+ related?: string[];
25
+ /**
26
+ * The target over every project Nx says is affected between `base` and `head` (HEAD) — one step per project, in the
27
+ * heavy lane, `stage` saying «test 12 of 148: dashboard» (foodguard-188, main-level QA). `project` may be left out.
28
+ */
29
+ affected?: {
30
+ base: string;
31
+ head?: string;
32
+ };
13
33
  hard?: boolean;
34
+ /** The queue's lane — none: by what the run is (heavy for a whole test target, e2e, verify or over an hour). */
35
+ lane?: WorkspaceActionLane;
14
36
  /** Preparation of an existing instance. Only services started by this run are cleaned up. */
15
37
  prepare?: {
16
38
  migrationProject?: string;
17
39
  migrationTarget?: string;
18
40
  services?: string[];
19
41
  };
42
+ /**
43
+ * benchmark (issues/closed/foodguard-191): the routes called through the lens, `calls` times each after `warmup`, on
44
+ * this run's checkout and — `compare`, on by default in a worktree — on Main, alone on the machine.
45
+ */
46
+ benchmark?: {
47
+ origin: string;
48
+ routes: WorkspaceBenchmarkRoute[];
49
+ calls?: number;
50
+ warmup?: number;
51
+ compare?: boolean;
52
+ };
53
+ /** capture (foodguard-191): real PNGs of the pages, at each width and theme, on this run's checkout and on Main. */
54
+ capture?: {
55
+ origin: string;
56
+ pages: WorkspaceCapturePage[];
57
+ widths?: number[];
58
+ themes?: Array<'light' | 'dark'>;
59
+ compare?: boolean;
60
+ };
61
+ }
62
+ export interface WorkspaceBenchmarkRoute {
63
+ method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';
64
+ path: string;
65
+ as?: string;
66
+ body?: unknown;
67
+ service?: string;
68
+ }
69
+ export interface WorkspaceCapturePage {
70
+ path: string;
71
+ name?: string;
72
+ }
73
+ /** One route on one checkout, as a benchmark measured it. */
74
+ export interface WorkspaceBenchmarkRow {
75
+ route: string;
76
+ checkout: string;
77
+ as?: string;
78
+ calls: number;
79
+ /** Calls that did not answer 2xx/3xx, or did not answer. */
80
+ failed: number;
81
+ p50Ms?: number;
82
+ p95Ms?: number;
83
+ maxMs?: number;
84
+ /** SQL statements one request ran, its median; and the most times one request ran the same statement (a loop). */
85
+ sqlPerRequest?: number;
86
+ dbInLoop?: number;
87
+ statuses: Record<string, number>;
88
+ /** A few of its flows, to open with flow_get. */
89
+ flows?: string[];
90
+ note?: string;
91
+ }
92
+ /** One picture a capture took: `file` is the run's evidence (`capture-3.bin`, a PNG — workspace_action_read gives it base64). */
93
+ export interface WorkspaceCaptureShot {
94
+ checkout: string;
95
+ page: string;
96
+ width: number;
97
+ theme: 'light' | 'dark';
98
+ file?: string;
99
+ bytes?: number;
100
+ url: string;
101
+ note?: string;
20
102
  }
21
103
  export interface WorkspaceActionDescriptor {
22
104
  id: string;
@@ -29,12 +111,50 @@ export interface WorkspaceActionDescriptor {
29
111
  prerequisites: string[];
30
112
  }
31
113
  export interface WorkspaceActionFailure {
114
+ /** Of the test's file as the checkout knows it and its full name: the same test has one id in every checkout. */
32
115
  id: string;
33
116
  name: string;
34
117
  file?: string;
35
118
  line?: number;
36
119
  message: string;
37
120
  occurrences: number;
121
+ /**
122
+ * Against main's known failures for its project and target (issues/closed/foodguard-184): `known` — it fails on main
123
+ * too — or `new`. None: no baseline was read (an opaque target, or a run from before LensMCP read one).
124
+ */
125
+ status?: 'new' | 'known';
126
+ /** A known failure: main's latest commit it failed at, and the commit and day it was first seen failing there. */
127
+ known?: {
128
+ sha: string;
129
+ firstSha: string;
130
+ since: string;
131
+ firstAt?: number;
132
+ };
133
+ }
134
+ /**
135
+ * A test step against main's known failures for its project and target (issues/closed/foodguard-184). `sha`, `date`
136
+ * and `run`: main's latest run that kept the list — none when no main run is recorded, and every failure is new.
137
+ */
138
+ export interface WorkspaceActionBaseline {
139
+ branch?: string;
140
+ sha?: string;
141
+ date?: string;
142
+ run?: string;
143
+ /** Only narrowed main runs (by file, name or relation) kept this list: a test none of them ran is new by default. */
144
+ partial?: boolean;
145
+ newFailed: number;
146
+ knownFailed: number;
147
+ /** Known on main, and passed here: the first 10, and how many in all. */
148
+ fixedHere: Array<{
149
+ id: string;
150
+ name: string;
151
+ file?: string;
152
+ }>;
153
+ fixedHereCount: number;
154
+ /** This run was clean on Main and kept the list: `whole` replaced it; `narrowed` added its failures and cleared what passed. */
155
+ recorded?: 'whole' | 'narrowed';
156
+ /** Why the list was not read, or why this run on Main did not keep it. */
157
+ note?: string;
38
158
  }
39
159
  export interface WorkspaceActionCounts {
40
160
  passed: number;
@@ -44,6 +164,11 @@ export interface WorkspaceActionCounts {
44
164
  }
45
165
  export interface WorkspaceActionStep {
46
166
  id: string;
167
+ /** The project it ran — a run over several projects (`affected`) has one step each. */
168
+ project?: string;
169
+ /** A related run: the specs it ran (first 50), and how many in all. */
170
+ specs?: string[];
171
+ specsCount?: number;
47
172
  action: WorkspaceActionKind | 'cleanup';
48
173
  state: WorkspaceActionState | 'skipped';
49
174
  durationMs: number;
@@ -79,6 +204,17 @@ export interface WorkspaceActionStep {
79
204
  changed: string[];
80
205
  };
81
206
  };
207
+ /** A test step's failures against main's known ones: how many are new, how many known, and what passed here. */
208
+ baseline?: WorkspaceActionBaseline;
209
+ /** A benchmark step's rows: each route on each checkout, Main beside this one (foodguard-191). */
210
+ benchmark?: {
211
+ rows: WorkspaceBenchmarkRow[];
212
+ quiet?: string;
213
+ };
214
+ /** A capture step's pictures (foodguard-191). */
215
+ capture?: {
216
+ shots: WorkspaceCaptureShot[];
217
+ };
82
218
  evidence: {
83
219
  log: string;
84
220
  report?: string;
@@ -101,6 +237,27 @@ export interface WorkspaceActionRun {
101
237
  durationMs: number;
102
238
  steps: WorkspaceActionStep[];
103
239
  note?: string;
240
+ /** The machine queue: its lane; while queued, its place and why it waits; once admitted, how long it waited. */
241
+ queue?: WorkspaceActionQueue;
242
+ /** A run over many projects: its steps by state — the summary keeps the ones that did not pass, and folds the rest here. */
243
+ rollup?: {
244
+ steps: number;
245
+ passed: number;
246
+ failed: number;
247
+ errored: number;
248
+ skipped: number;
249
+ other: number;
250
+ folded: number;
251
+ newFailed?: number;
252
+ knownFailed?: number;
253
+ };
104
254
  resultRef: string;
105
255
  retentionDays: number;
106
256
  }
257
+ export interface WorkspaceActionQueue {
258
+ lane: WorkspaceActionLane;
259
+ place?: number;
260
+ of?: number;
261
+ why?: string;
262
+ waitedMs?: number;
263
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lensmcp/protocol-types",
3
- "version": "1.25.49",
3
+ "version": "1.25.50",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "module": "./index.js",