@voltro/plan 0.86.0 → 0.87.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/dist/evidence.js CHANGED
@@ -61,7 +61,13 @@ var r = (e, t, n, r, i, a) => ({
61
61
  } : r("evidence/idempotency-conflict", "error", `the key "${s.idempotencyKey}" was used for other evidence (${t.id})`, "Use a new key for new evidence.", c.id, n.conflict);
62
62
  }
63
63
  }
64
- let d = `EVD-${c.id}-`, f = a.evidence.filter((e) => e.id.startsWith(d)).map((e) => Number(e.id.slice(d.length))), p = String(Math.max(0, ...f) + 1).padStart(3, "0");
64
+ let d = `EVD-${c.id}-`, f = 0n;
65
+ for (let e of a.evidence) {
66
+ if (!e.id.startsWith(d)) continue;
67
+ let t = BigInt(e.id.slice(d.length));
68
+ t > f && (f = t);
69
+ }
70
+ let p = String(f + 1n).padStart(3, "0");
65
71
  return o.evidence.test(`${d}${p}`) ? {
66
72
  outcome: "add",
67
73
  evidence: {
@@ -70,7 +76,7 @@ var r = (e, t, n, r, i, a) => ({
70
76
  observedAt: s.observedAt,
71
77
  ...s.idempotencyKey === void 0 ? {} : { idempotencyKey: s.idempotencyKey }
72
78
  }
73
- } : r("evidence/exhausted", "error", `${c.id} has no evidence number left`, "Supersede the item.", c.id, n.failed);
79
+ } : r("evidence/identifier", "error", `${c.id} cannot form a valid evidence identifier`, "Check the program identifier grammar.", c.id, n.failed);
74
80
  };
75
81
  //#endregion
76
82
  export { a as decideEvidence };
package/dist/ids.js CHANGED
@@ -8,7 +8,7 @@ var e = /^[A-Z][A-Z0-9]{1,9}$/, t = (t) => {
8
8
  acceptance: RegExp(`^${t}-[0-9]{2}-[0-9]{3}-A[0-9]{2}$`),
9
9
  requirement: RegExp(`^${t}-[0-9]{2}-[0-9]{3}-E[0-9]{2}$`),
10
10
  source: RegExp(`^SRC-${t}-[0-9]{2}-[0-9]{3}-[0-9]{3}$`),
11
- evidence: RegExp(`^EVD-${t}-[0-9]{2}-[0-9]{3}-[0-9]{3}$`),
11
+ evidence: RegExp(`^EVD-${t}-[0-9]{2}-[0-9]{3}-[0-9]{3,}$`),
12
12
  finding: RegExp(`^FND-${t}-[0-9]{2}-[0-9]{3}-[0-9]{3}$`),
13
13
  adr: RegExp(`^ADR-${t}-[0-9]{3}$`),
14
14
  closureRun: RegExp(`^CLR-${t}-[0-9]{2}-[0-9]{3}$`),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voltro/plan",
3
- "version": "0.86.0",
3
+ "version": "0.87.0",
4
4
  "description": "The executable plan contract: ids, the v1 schema, lint, derived state, status and the next item — pure and browser-safe; the voltro plan CLI feeds it.",
5
5
  "keywords": [
6
6
  "voltro",