@open-agent-toolkit/cli 0.3.0 → 0.3.1

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.
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: oat-reviewer
3
- version: 1.2.7
3
+ version: 1.2.8
4
4
  description: Unified reviewer for OAT projects - mode-aware verification of requirements/design alignment and code quality. Writes a review artifact to disk by default, or returns structured findings in-memory when dispatched in structured-output mode.
5
5
  tools: Read, Bash, Grep, Glob, Write, Task
6
6
  color: yellow
@@ -430,6 +430,8 @@ worker claims, and root-inline coverage}
430
430
 
431
431
  ## Findings
432
432
 
433
+ {Every finding MUST be written as a markdown list item — a line starting with `- `, `* `, `+ `, or `1. `. The gate counts list items only; a finding written as a bold paragraph, a heading, or any other prose shape counts as zero and makes the gate refuse the whole artifact.}
434
+
433
435
  ### Critical
434
436
 
435
437
  {If none: "None"}
@@ -494,7 +496,7 @@ Run the `oat-project-review-receive` skill to convert findings into plan tasks.
494
496
 
495
497
  ```
496
498
 
497
- Gate parsing contract: artifact-mode reviews, including reviews spawned by `oat gate review`, MUST include either the complete `Findings by severity: {N} critical, {N} high, {N} medium, {N} low` count line or the standard `## Findings` sections shown above with every severity subsection present. When more than one count source is present — the frontmatter count fields, the count line, and the sections — the counts must agree; the gate refuses an artifact whose sources contradict each other rather than picking one.
499
+ Gate parsing contract: artifact-mode reviews, including reviews spawned by `oat gate review`, MUST include either the complete `Findings by severity: {N} critical, {N} high, {N} medium, {N} low` count line or the standard `## Findings` sections shown above with every severity subsection present. When more than one count source is present — the frontmatter count fields, the count line, and the sections — the counts must agree; the gate refuses an artifact whose sources contradict each other rather than picking one. How a section is counted is load-bearing: the gate counts only markdown list items (`- `, `* `, `+ `, or `1. `) as findings. A finding written as a bold paragraph, a heading, or any other prose shape counts as zero, so a section of prose findings under a non-zero count line is a contradiction and the gate refuses the artifact — the entire review is rejected, not just the miscounted section.
498
500
 
499
501
  For every artifact-mode code review, `oat_review_head_sha` is required and must be the full 40-character commit SHA at the head of the authoritative review range. Resolve it with `git rev-parse <authoritative-range-head>^{commit}`. An abbreviated SHA, symbolic ref, or range string is invalid. When the review narrowed, `oat_review_range`, `oat_prior_review_artifact`, and `oat_prior_review_head_sha` are also required; the prior head must likewise be a full 40-character SHA. These code-review fields are independent of the gate-only block and do not apply to artifact, analysis, or structured-output reviews.
500
502
 
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "oatVersion": "0.3.0"
3
+ "oatVersion": "0.3.1"
4
4
  }
@@ -1,6 +1,6 @@
1
1
  {
2
- "cli": "0.3.0",
3
- "docs-config": "0.3.0",
4
- "docs-theme": "0.3.0",
5
- "docs-transforms": "0.3.0"
2
+ "cli": "0.3.1",
3
+ "docs-config": "0.3.1",
4
+ "docs-theme": "0.3.1",
5
+ "docs-transforms": "0.3.1"
6
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"review-verdict.d.ts","sourceRoot":"","sources":["../../../src/commands/gate/review-verdict.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IAC5C,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,cAAc,CAAC,EAAE,4BAA4B,CAAC;IAC9C,MAAM,EAAE;QACN,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;QACf,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE;QACd,kBAAkB,EAAE,QAAQ,EAAE,CAAC;QAC/B,SAAS,EAAE,OAAO,CAAC;KACpB,CAAC;CACH;AAED,MAAM,WAA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CAAC;QACf,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,QAAQ,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE;QACd,kBAAkB,EAAE,QAAQ,EAAE,CAAC;QAC/B,SAAS,EAAE,OAAO,CAAC;KACpB,CAAC;CACH;AAED,MAAM,WAAW,4BAA4B;IAC3C,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,MAAM,QAAQ,GAAG,MAAM,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAEzD,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,6BAA6B;IAC5C,qCAAqC,CAAC,EAAE,OAAO,CAAC;IAChD,gBAAgB,CAAC,EAAE,0BAA0B,CAAC;CAC/C;AA8OD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAE9D;AA4fD,wBAAsB,sBAAsB,CAC1C,YAAY,EAAE,MAAM,EACpB,OAAO,GAAE,6BAAkC,GAC1C,OAAO,CAAC,iBAAiB,CAAC,CA8F5B"}
@@ -129,6 +129,17 @@ function sectionContentIsEmpty(content) {
129
129
  .trim();
130
130
  return cleaned.length === 0 || /^none\.?$/i.test(cleaned);
131
131
  }
132
+ /**
133
+ * Count the findings a severity section declares.
134
+ *
135
+ * Only top-level markdown list items count. Prose shapes are deliberately not
136
+ * counted — a bold lead-in paragraph, a wrapped continuation line, and a nested
137
+ * detail bullet are indistinguishable from a finding title without parsing the
138
+ * prose, so counting them would miscount and double-count. The cost of that
139
+ * choice is that a reviewer who writes findings as paragraphs gets a zero
140
+ * tally, so every diagnostic built on this count must name the list-item
141
+ * requirement (see `FINDING_LIST_ITEM_CONTRACT_HINT`).
142
+ */
132
143
  function countFindingsInSection(content) {
133
144
  if (sectionContentIsEmpty(content)) {
134
145
  return 0;
@@ -409,6 +420,15 @@ async function normalizeMissingEmptySeveritySections(artifactPath, content, coun
409
420
  persisted: insertedSeverities.length > 0 && persist,
410
421
  };
411
422
  }
423
+ /**
424
+ * The one fact a reviewer cannot recover from the raw contradiction report.
425
+ *
426
+ * A section whose findings are written as bold paragraphs tallies zero, so the
427
+ * gate reports a contradiction that looks like a counting mistake. Without this
428
+ * sentence the reviewer has no way to learn that the shape of the finding, not
429
+ * the arithmetic, is what the parser objected to.
430
+ */
431
+ const FINDING_LIST_ITEM_CONTRACT_HINT = 'Only markdown list items count as findings in a Findings section: a line starting with `- `, `* `, `+ `, or `1. `. A finding written as a bold paragraph, a heading, or any other prose shape counts as zero, which is the usual reason a section tallies lower than the declared counts. Rewrite each finding as a list item, or correct the declared counts to match.';
412
432
  function formatCounts(counts) {
413
433
  return SEVERITIES.map((severity) => `${counts[severity]} ${severity}`).join(', ');
414
434
  }
@@ -424,7 +444,8 @@ function assertAgreeingCounts(artifactPath, left, right, tiers = SEVERITIES) {
424
444
  if (differing.length === 0) {
425
445
  return;
426
446
  }
427
- throw new Error(`Review artifact at ${artifactPath} contradicts itself about finding counts (${differing.join(', ')}): declared counts are ${formatCounts(left.counts)} (${left.name}) but ${formatCounts(right.counts)} (${right.name}). Reconcile them before the gate can evaluate the review.`);
447
+ const sectionsInvolved = left.fromSections === true || right.fromSections === true;
448
+ throw new Error(`Review artifact at ${artifactPath} contradicts itself about finding counts (${differing.join(', ')}): declared counts are ${formatCounts(left.counts)} (${left.name}) but ${formatCounts(right.counts)} (${right.name}). Reconcile them before the gate can evaluate the review.${sectionsInvolved ? ` ${FINDING_LIST_ITEM_CONTRACT_HINT}` : ''}`);
428
449
  }
429
450
  /**
430
451
  * Resolve the artifact's counts, cross-checking every source that is present.
@@ -467,6 +488,7 @@ function resolveCounts(content, frontmatter, artifactPath) {
467
488
  name: 'the Findings sections',
468
489
  counts: bodyCounts,
469
490
  tiers: bodyTiers,
491
+ fromSections: true,
470
492
  };
471
493
  for (const source of explicitSources) {
472
494
  const comparableTiers = source.tiers.filter((severity) => bodyTiers.includes(severity));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-agent-toolkit/cli",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "private": false,
5
5
  "description": "Open Agent Toolkit CLI",
6
6
  "homepage": "https://github.com/voxmedia/open-agent-toolkit/tree/main/packages/cli",
@@ -34,7 +34,7 @@
34
34
  "ora": "^9.0.0",
35
35
  "yaml": "2.8.2",
36
36
  "zod": "^3.25.76",
37
- "@open-agent-toolkit/control-plane": "0.3.0"
37
+ "@open-agent-toolkit/control-plane": "0.3.1"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/node": "^22.10.0",