@llm4ts/flow 3.2.3 → 3.2.5

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 +1 @@
1
- {"version":3,"file":"Evidence.d.ts","sourceRoot":"","sources":["../src/Evidence.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEzC,eAAO,MAAM,sBAAsB,wBAAwB,CAAA;AAS3D;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,SAAS,aAAa,CAAC,MAAM,CAAC,EAC9B,UAAU,aAAa,CAAC,MAAM,CAAC,KAC9B,aAAa,CAAC,MAAM,CAMtB,CAAA;AAED,yFAAyF;AACzF,eAAO,MAAM,sBAAsB,GACjC,YAAY,aAAa,CAAC,MAAM,CAAC,KAChC,aAAa,CAAC,WAAW,CAQzB,CAAA"}
1
+ {"version":3,"file":"Evidence.d.ts","sourceRoot":"","sources":["../src/Evidence.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEzC,eAAO,MAAM,sBAAsB,wBAAwB,CAAA;AAS3D;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,SAAS,aAAa,CAAC,MAAM,CAAC,EAC9B,UAAU,aAAa,CAAC,MAAM,CAAC,KAC9B,aAAa,CAAC,MAAM,CAMtB,CAAA;AAmCD,yFAAyF;AACzF,eAAO,MAAM,sBAAsB,GACjC,YAAY,aAAa,CAAC,MAAM,CAAC,KAChC,aAAa,CAAC,WAAW,CAQzB,CAAA"}
package/dist/Evidence.js CHANGED
@@ -15,12 +15,36 @@ const normalizeCommand = (command) => command
15
15
  * invocation (`pnpm test` within `pnpm test -- --run x`) counts as carried.
16
16
  */
17
17
  export const unverifiedClaims = (claimed, toolArgs) => {
18
- const ran = toolArgs.map(normalizeCommand);
18
+ const ran = toolArgs.map(recordedCommand);
19
19
  return claimed.filter((claim) => {
20
20
  const wanted = normalizeCommand(claim);
21
- return wanted.length > 0 && !ran.some((args) => args.includes(wanted));
21
+ return wanted.length > 0 && !ran.some((args) => carries(args, wanted));
22
22
  });
23
23
  };
24
+ const recordedCommand = (args) => {
25
+ const trimmed = args.trimEnd();
26
+ const truncated = trimmed.endsWith("…");
27
+ return { text: normalizeCommand(truncated ? trimmed.slice(0, -1) : trimmed), truncated };
28
+ };
29
+ /** The shortest head of a cut command that still identifies it. */
30
+ const minimumHead = 24;
31
+ /**
32
+ * A recorded call carries a claim when it contains it; a call the transcript
33
+ * cut short carries a longer claim when the cut's last command segment (after
34
+ * `;`, `&&` or `|`) is the start of the claim — `llm4ts tool validate-account
35
+ * --document fixtures/… ` recorded as its first 120 characters still proves
36
+ * the full invocation the coder quotes (ADR 0048).
37
+ */
38
+ const carries = (args, wanted) => {
39
+ if (args.text.includes(wanted)) {
40
+ return true;
41
+ }
42
+ if (!args.truncated) {
43
+ return false;
44
+ }
45
+ const head = args.text.split(/\s*(?:;|&&|\|\|?)\s*/u).at(-1) ?? "";
46
+ return head.length >= minimumHead && wanted.startsWith(head);
47
+ };
24
48
  /** One Warning per claimed-but-unrun command, for the story's findings and the judge. */
25
49
  export const fabricatedStatusIssues = (unverified) => unverified.map((command) => ReviewIssue.make({
26
50
  severity: "Warning",
@@ -1 +1 @@
1
- {"version":3,"file":"Evidence.js","sourceRoot":"","sources":["../src/Evidence.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,yEAAyE;AACzE,yDAAyD;AACzD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEzC,MAAM,CAAC,MAAM,sBAAsB,GAAG,qBAAqB,CAAA;AAE3D,MAAM,gBAAgB,GAAG,CAAC,OAAe,EAAU,EAAE,CACnD,OAAO;KACJ,IAAI,EAAE;KACN,OAAO,CAAC,mBAAmB,EAAE,EAAE,CAAC;KAChC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;KACrB,WAAW,EAAE,CAAA;AAElB;;;;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IAClE,OAAO,IAAI,CAAC,MAAM,IAAI,WAAW,IAAI,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;AAC9D,CAAC,CAAA;AAED,yFAAyF;AACzF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CACpC,UAAiC,EACL,EAAE,CAC9B,UAAU,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CACzB,WAAW,CAAC,IAAI,CAAC;IACf,QAAQ,EAAE,SAAS;IACnB,KAAK,EAAE,GAAG,sBAAsB,aAAa,OAAO,4BAA4B;IAChF,WAAW,EACT,wJAAwJ;CAC3J,CAAC,CACH,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@llm4ts/flow",
3
- "version": "3.2.3",
3
+ "version": "3.2.5",
4
4
  "description": "Effect-native LLM workflow, persistence, review, and repository automation",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -143,7 +143,7 @@
143
143
  "typescript"
144
144
  ],
145
145
  "dependencies": {
146
- "@llm4ts/core": "3.2.3"
146
+ "@llm4ts/core": "3.2.5"
147
147
  },
148
148
  "peerDependencies": {
149
149
  "effect": "4.0.0"
package/src/Evidence.ts CHANGED
@@ -22,13 +22,46 @@ export const unverifiedClaims = (
22
22
  claimed: ReadonlyArray<string>,
23
23
  toolArgs: ReadonlyArray<string>
24
24
  ): ReadonlyArray<string> => {
25
- const ran = toolArgs.map(normalizeCommand)
25
+ const ran = toolArgs.map(recordedCommand)
26
26
  return claimed.filter((claim) => {
27
27
  const wanted = normalizeCommand(claim)
28
- return wanted.length > 0 && !ran.some((args) => args.includes(wanted))
28
+ return wanted.length > 0 && !ran.some((args) => carries(args, wanted))
29
29
  })
30
30
  }
31
31
 
32
+ interface RecordedCommand {
33
+ readonly text: string
34
+ /** The transcript keeps a command's first characters and an ellipsis. */
35
+ readonly truncated: boolean
36
+ }
37
+
38
+ const recordedCommand = (args: string): RecordedCommand => {
39
+ const trimmed = args.trimEnd()
40
+ const truncated = trimmed.endsWith("…")
41
+ return { text: normalizeCommand(truncated ? trimmed.slice(0, -1) : trimmed), truncated }
42
+ }
43
+
44
+ /** The shortest head of a cut command that still identifies it. */
45
+ const minimumHead = 24
46
+
47
+ /**
48
+ * A recorded call carries a claim when it contains it; a call the transcript
49
+ * cut short carries a longer claim when the cut's last command segment (after
50
+ * `;`, `&&` or `|`) is the start of the claim — `llm4ts tool validate-account
51
+ * --document fixtures/… ` recorded as its first 120 characters still proves
52
+ * the full invocation the coder quotes (ADR 0048).
53
+ */
54
+ const carries = (args: RecordedCommand, wanted: string): boolean => {
55
+ if (args.text.includes(wanted)) {
56
+ return true
57
+ }
58
+ if (!args.truncated) {
59
+ return false
60
+ }
61
+ const head = args.text.split(/\s*(?:;|&&|\|\|?)\s*/u).at(-1) ?? ""
62
+ return head.length >= minimumHead && wanted.startsWith(head)
63
+ }
64
+
32
65
  /** One Warning per claimed-but-unrun command, for the story's findings and the judge. */
33
66
  export const fabricatedStatusIssues = (
34
67
  unverified: ReadonlyArray<string>