@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/README.md +7 -1
- package/dist/gtd.bundle.mjs +410 -142
- package/package.json +1 -1
- package/src/workflows/health.test.ts +13 -0
- package/src/workflows/health.ts +3 -3
package/package.json
CHANGED
|
@@ -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
|
+
})
|
package/src/workflows/health.ts
CHANGED
|
@@ -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
|
-
"
|
|
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> => {
|