@pmelab/gtd 15.7.0 → 15.8.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pmelab/gtd",
3
- "version": "15.7.0",
3
+ "version": "15.8.0",
4
4
  "private": false,
5
5
  "description": "Git-aware CLI that emits the next prompt for an autonomous coding agent based on the current repository state",
6
6
  "bin": {
@@ -0,0 +1,13 @@
1
+ import { describe, expect, it } from "vitest"
2
+ import { toRequest } from "../judges/index.js"
3
+ import { retryQuestion } from "./health.js"
4
+
5
+ describe("retryQuestion", () => {
6
+ it.each([true, false])("is sendable to jev (comparable=%s)", (comparable) => {
7
+ const { primitive, ...rest } = retryQuestion(comparable)
8
+ const { questions } = toRequest([{ ...rest, primitive } as never], {})
9
+ expect(
10
+ Object.keys((questions["verdict"] as { criteria: object }).criteria).length,
11
+ ).toBeGreaterThanOrEqual(2)
12
+ })
13
+ })
@@ -40,7 +40,7 @@ const STAMP = /\n<!-- gtd check [0-9a-f]+ -->\n?$/
40
40
  const stripStamp = (text: string): string => text.replace(STAMP, "\n")
41
41
 
42
42
  /** "Is this red round the same failure as the last one?" — asked of two reports, or of nothing when one is empty. */
43
- const retryQuestion = (comparable: boolean): JudgeQuestion =>
43
+ export const retryQuestion = (comparable: boolean): JudgeQuestion =>
44
44
  comparable
45
45
  ? {
46
46
  id: "verdict",
@@ -54,9 +54,9 @@ const retryQuestion = (comparable: boolean): JudgeQuestion =>
54
54
  id: "verdict",
55
55
  primitive: "choice",
56
56
  instructions:
57
- "state carries tailsNotComparable: one of the two check reports came back empty. There is nothing to compare here; answer from criteria alone.",
57
+ "state carries tailsNotComparable: one of the two check reports came back empty. There is nothing to compare here; answer from criteria alone. `identical` is FORBIDDEN here.",
58
58
  criteria:
59
- "identical is FORBIDDEN here — answer new-failure or progress instead, defaulting to progress if genuinely unsure.",
59
+ "new-failure: a materially different failure than before. progress: still red, but closer to green — the default if genuinely unsure.",
60
60
  }
61
61
 
62
62
  const sameFailure = async (previous: string, current: string): Promise<boolean> => {