@open-agent-toolkit/control-plane 0.2.23 → 0.2.25

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/README.md CHANGED
@@ -35,6 +35,18 @@ Reads one OAT project directory and returns a full `ProjectState` snapshot, incl
35
35
  - blocker and HiLL metadata
36
36
  - PR/docs timestamps and recommendation output
37
37
 
38
+ Review ledger entries in `ProjectState.reviews` expose the stable five-column
39
+ event identity (`scope`, `type`, `status`, `date`, and `artifact`) plus optional
40
+ provenance:
41
+
42
+ - `reviewedHead`: validated full 40-character commit SHA at the head of the
43
+ reviewed range
44
+ - `invocation`: invocation kind recorded by the review writer
45
+ - `gateTarget`: configured target for gate-originated review lineage
46
+
47
+ Legacy five-column review rows remain supported. Missing, empty, placeholder,
48
+ or invalid provenance is omitted from the parsed object.
49
+
38
50
  ### `listProjects(projectsRoot)`
39
51
 
40
52
  Reads all projects under a configured projects root and returns lightweight `ProjectSummary` records suitable for list or dashboard surfaces.
@@ -1 +1 @@
1
- {"version":3,"file":"reviews.d.ts","sourceRoot":"","sources":["../../src/state/reviews.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAI7C,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,YAAY,EAAE,CAepE;AAED,wBAAsB,sBAAsB,CAC1C,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,EAAE,CAAC,CAgBnB;AAED,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,MAAM,GACd;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAYxC"}
1
+ {"version":3,"file":"reviews.d.ts","sourceRoot":"","sources":["../../src/state/reviews.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAgB7C,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,YAAY,EAAE,CAoBpE;AAED,wBAAsB,sBAAsB,CAC1C,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,EAAE,CAAC,CAgBnB;AAED,wBAAgB,2BAA2B,CACzC,OAAO,EAAE,MAAM,GACd;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAYxC"}
@@ -3,6 +3,7 @@ import { join } from 'node:path';
3
3
  import { isMissingFileError } from '../shared/utils/errors.js';
4
4
  import { parseFrontmatterRecord } from '../shared/utils/frontmatter.js';
5
5
  const REVIEWS_HEADING = '## Reviews';
6
+ const FULL_COMMIT_SHA = /^[0-9a-f]{40}$/i;
6
7
  export function parseReviewTable(planContent) {
7
8
  const reviewsSection = extractReviewsSection(planContent);
8
9
  if (reviewsSection == null) {
@@ -12,9 +13,13 @@ export function parseReviewTable(planContent) {
12
13
  .split('\n')
13
14
  .map((line) => line.trim())
14
15
  .filter((line) => line.startsWith('|'));
16
+ const columns = resolveReviewColumnIndices(parseTableCells(rows[0] ?? ''));
17
+ if (columns == null) {
18
+ return [];
19
+ }
15
20
  return rows
16
21
  .slice(2)
17
- .map(parseTableRow)
22
+ .map((line) => parseTableRow(line, columns))
18
23
  .filter((row) => row !== null);
19
24
  }
20
25
  export async function scanUnprocessedReviews(projectPath) {
@@ -55,17 +60,75 @@ function extractReviewsSection(planContent) {
55
60
  }
56
61
  return remaining.slice(0, nextHeadingIndex).trim();
57
62
  }
58
- function parseTableRow(line) {
59
- const cells = line
63
+ function parseTableRow(line, columns) {
64
+ const cells = parseTableCells(line);
65
+ const scope = cells[columns.scope];
66
+ const type = cells[columns.type];
67
+ const status = cells[columns.status];
68
+ const date = cells[columns.date];
69
+ const artifact = cells[columns.artifact];
70
+ if (!scope || !type || !status || !date || !artifact) {
71
+ return null;
72
+ }
73
+ const reviewedHeadCell = optionalIndexedCell(cells, columns.reviewedHead);
74
+ const invocationCell = optionalIndexedCell(cells, columns.invocation);
75
+ const gateTargetCell = optionalIndexedCell(cells, columns.gateTarget);
76
+ const reviewedHead = reviewedHeadCell && FULL_COMMIT_SHA.test(reviewedHeadCell)
77
+ ? reviewedHeadCell
78
+ : undefined;
79
+ const invocation = optionalCell(invocationCell);
80
+ const gateTarget = optionalCell(gateTargetCell);
81
+ return {
82
+ scope,
83
+ type,
84
+ status,
85
+ date,
86
+ artifact,
87
+ ...(reviewedHead ? { reviewedHead } : {}),
88
+ ...(invocation ? { invocation } : {}),
89
+ ...(gateTarget ? { gateTarget } : {}),
90
+ };
91
+ }
92
+ function parseTableCells(line) {
93
+ return line
60
94
  .split('|')
61
95
  .slice(1, -1)
62
96
  .map((cell) => cell.trim());
63
- if (cells.length !== 5) {
64
- return null;
65
- }
66
- const [scope, type, status, date, artifact] = cells;
67
- if (!scope || !type || !status || !date || !artifact) {
97
+ }
98
+ function resolveReviewColumnIndices(headerCells) {
99
+ const headerIndex = new Map(headerCells.map((cell, index) => [normalizeHeader(cell), index]));
100
+ const scope = headerIndex.get('scope');
101
+ const type = headerIndex.get('type');
102
+ const status = headerIndex.get('status');
103
+ const date = headerIndex.get('date');
104
+ const artifact = headerIndex.get('artifact');
105
+ const reviewedHead = headerIndex.get('reviewed head');
106
+ const invocation = headerIndex.get('invocation');
107
+ const gateTarget = headerIndex.get('gate target');
108
+ if (scope == null ||
109
+ type == null ||
110
+ status == null ||
111
+ date == null ||
112
+ artifact == null) {
68
113
  return null;
69
114
  }
70
- return { scope, type, status, date, artifact };
115
+ return {
116
+ scope,
117
+ type,
118
+ status,
119
+ date,
120
+ artifact,
121
+ ...(reviewedHead == null ? {} : { reviewedHead }),
122
+ ...(invocation == null ? {} : { invocation }),
123
+ ...(gateTarget == null ? {} : { gateTarget }),
124
+ };
125
+ }
126
+ function normalizeHeader(cell) {
127
+ return cell.trim().replace(/\s+/g, ' ').toLowerCase();
128
+ }
129
+ function optionalIndexedCell(cells, index) {
130
+ return index == null ? undefined : cells[index];
131
+ }
132
+ function optionalCell(cell) {
133
+ return cell && cell !== '-' ? cell : undefined;
71
134
  }
package/dist/types.d.ts CHANGED
@@ -38,6 +38,12 @@ export interface ReviewStatus {
38
38
  status: string;
39
39
  date: string;
40
40
  artifact: string;
41
+ /** Full 40-character commit SHA at the head of the reviewed range. */
42
+ reviewedHead?: string;
43
+ /** Review invocation kind used to qualify the review lineage. */
44
+ invocation?: string;
45
+ /** Configured gate target for gate-originated review lineage. */
46
+ gateTarget?: string;
41
47
  }
42
48
  export interface ReviewArtifactStatus {
43
49
  path: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GACb,WAAW,GACX,MAAM,GACN,QAAQ,GACR,MAAM,GACN,WAAW,GACX,eAAe,CAAC;AAEpB,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,UAAU,GAAG,SAAS,CAAC;AAEjE,MAAM,MAAM,YAAY,GAAG,aAAa,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE9D,MAAM,MAAM,aAAa,GAAG,eAAe,GAAG,iBAAiB,CAAC;AAEhE,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAEzD,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,UAAU,GAAG,MAAM,CAAC;IAC9B,MAAM,EAAE,aAAa,GAAG,gBAAgB,GAAG,mBAAmB,CAAC;IAC/D,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,YAAY,GACpB,WAAW,GACX,MAAM,GACN,QAAQ,GACR,MAAM,GACN,gBAAgB,GAChB,SAAS,CAAC;AAEd,MAAM,MAAM,YAAY,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAErC,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,OAAO,CAAC;IAChB,IAAI,EAAE,MAA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I,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,gBAAgB,EAAE,mBAAmB,GAAG,IAAI,CAAC;IAC7C,YAAY,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACzC,UAAU,EAAE;QACV,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;QACzB,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,cAAc,EAAE,mBAAmB,CAAC;CACrC;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,KAAK,CAAC;IACb,WAAW,EAAE,WAAW,CAAC;IACzB,YAAY,EAAE,YAAY,CAAC;IAC3B,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE;QACR,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,cAAc,EAAE;QACd,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-agent-toolkit/control-plane",
3
- "version": "0.2.23",
3
+ "version": "0.2.25",
4
4
  "private": false,
5
5
  "description": "Read-only OAT control-plane library for structured project state",
6
6
  "homepage": "https://github.com/voxmedia/open-agent-toolkit/tree/main/packages/control-plane",