@codyswann/lisa 1.31.1 → 1.33.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.
@@ -185,7 +185,7 @@ Include all required tasks defined in `@.claude/rules/plan-governance.md` (Requi
185
185
 
186
186
  ## Step 10: Implementation Team Instructions
187
187
 
188
- The plan must include explict instructions to "Create an agent team" for implementation. Recommend these specialized agents:
188
+ The plan must include explict instructions to "Create an agent team" for implementation and run the /plan-implement skill. Recommend these specialized agents:
189
189
 
190
190
  | Agent | Use For |
191
191
  |-------|---------|
@@ -9,6 +9,8 @@ Implement the requirements in $ARGUMENTS.
9
9
 
10
10
  If no argument provided, search for plan files in the `plans/` directory and present them to the user for selection.
11
11
 
12
+ Critical: you must create an agent team to implement the plan. Do not try to skip this!
13
+
12
14
  ## Step 1: Parse Plan
13
15
 
14
16
  1. **Read the plan file** specified in `$ARGUMENTS`
@@ -1,32 +1,51 @@
1
1
  /**
2
- * Fibonacci sequence utilities providing safe, validated computation
3
- * within JavaScript's integer precision limits.
4
- *
5
- * Caps at fibonacci(78) / sequence length 79 because fibonacci(79)
6
- * exceeds Number.MAX_SAFE_INTEGER, which would silently corrupt results.
7
- *
8
- * @module fibonacci
2
+ * @file fibonacci.ts
3
+ * @description BigInt Fibonacci utilities built on a lazy infinite generator.
4
+ * Every public function delegates to `fibonacciGenerator` so the core
5
+ * recurrence relation lives in exactly one place (DRY). BigInt eliminates
6
+ * the precision ceiling that Number hits at fibonacci(78).
7
+ * @module utils
9
8
  */
10
9
  /**
11
- * Compute the nth Fibonacci number (0-indexed).
12
- *
13
- * Uses an iterative tuple-reduce approach to avoid stack overflow
14
- * and keep computation O(n) time, O(1) space.
15
- *
16
- * @param n - The zero-based index in the Fibonacci sequence
17
- * @returns The nth Fibonacci number
18
- * @throws {RangeError} If n is negative, non-integer, NaN, Infinity, or greater than 78
10
+ * Infinite generator that lazily yields the Fibonacci sequence as BigInts
11
+ * @yields {bigint} The next Fibonacci number in the sequence (0n, 1n, 1n, 2n, 3n, …)
12
+ * @remarks Each call creates an independent iterator with its own state, so
13
+ * multiple consumers can advance through the sequence without interference.
14
+ * @example
15
+ * ```typescript
16
+ * const gen = fibonacciGenerator();
17
+ * gen.next().value; // 0n
18
+ * gen.next().value; // 1n
19
+ * gen.next().value; // 1n
20
+ * ```
19
21
  */
20
- export declare function fibonacci(n: number): number;
22
+ export declare function fibonacciGenerator(): Generator<bigint, never, unknown>;
21
23
  /**
22
- * Generate the first `length` Fibonacci numbers as a readonly array.
23
- *
24
- * Builds the sequence incrementally with reduce so each element derives
25
- * from its two predecessors without recomputing from scratch.
26
- *
27
- * @param length - How many Fibonacci numbers to generate
28
- * @returns A readonly array of Fibonacci numbers
29
- * @throws {RangeError} If length is negative, non-integer, NaN, Infinity, or greater than 79
24
+ * Returns the nth Fibonacci number as a BigInt
25
+ * @param n - Zero-based index into the Fibonacci sequence (must be a non-negative integer)
26
+ * @returns The nth Fibonacci number (e.g. fibonacci(5) 5n)
27
+ * @throws {RangeError} When n is negative, non-integer, NaN, or Infinity
28
+ * @remarks Delegates to `fibonacciGenerator` so the recurrence logic is defined once.
29
+ * @example
30
+ * ```typescript
31
+ * fibonacci(0); // 0n
32
+ * fibonacci(10); // 55n
33
+ * fibonacci(78); // 8944394323791464n — beyond Number.MAX_SAFE_INTEGER
34
+ * ```
30
35
  */
31
- export declare function fibonacciSequence(length: number): readonly number[];
36
+ export declare function fibonacci(n: number): bigint;
37
+ /**
38
+ * Returns the first `length` Fibonacci numbers as a readonly BigInt array
39
+ * @param length - How many Fibonacci numbers to return (must be a non-negative integer)
40
+ * @returns A new array containing the first `length` Fibonacci numbers
41
+ * @throws {RangeError} When length is negative, non-integer, NaN, or Infinity
42
+ * @remarks Delegates to `fibonacciGenerator` so the recurrence logic is defined once.
43
+ * Returns a fresh array on every call — callers can safely mutate the result.
44
+ * @example
45
+ * ```typescript
46
+ * fibonacciSequence(0); // []
47
+ * fibonacciSequence(5); // [0n, 1n, 1n, 2n, 3n]
48
+ * ```
49
+ */
50
+ export declare function fibonacciSequence(length: number): readonly bigint[];
32
51
  //# sourceMappingURL=fibonacci.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fibonacci.d.ts","sourceRoot":"","sources":["../../src/utils/fibonacci.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAQH;;;;;;;;;GASG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAsB3C;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CAiBnE"}
1
+ {"version":3,"file":"fibonacci.d.ts","sourceRoot":"","sources":["../../src/utils/fibonacci.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;;;;;GAYG;AACH,wBAAiB,kBAAkB,IAAI,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,CAUvE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAU3C;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CASnE"}
@@ -1,56 +1,73 @@
1
1
  /**
2
- * Fibonacci sequence utilities providing safe, validated computation
3
- * within JavaScript's integer precision limits.
4
- *
5
- * Caps at fibonacci(78) / sequence length 79 because fibonacci(79)
6
- * exceeds Number.MAX_SAFE_INTEGER, which would silently corrupt results.
7
- *
8
- * @module fibonacci
2
+ * @file fibonacci.ts
3
+ * @description BigInt Fibonacci utilities built on a lazy infinite generator.
4
+ * Every public function delegates to `fibonacciGenerator` so the core
5
+ * recurrence relation lives in exactly one place (DRY). BigInt eliminates
6
+ * the precision ceiling that Number hits at fibonacci(78).
7
+ * @module utils
9
8
  */
10
- /** Largest n for which fibonacci(n) fits in a safe JS integer. */
11
- const MAX_SAFE_N = 78;
12
- /** Largest sequence length where all elements remain safe JS integers. */
13
- const MAX_SAFE_LENGTH = 79;
14
9
  /**
15
- * Compute the nth Fibonacci number (0-indexed).
16
- *
17
- * Uses an iterative tuple-reduce approach to avoid stack overflow
18
- * and keep computation O(n) time, O(1) space.
19
- *
20
- * @param n - The zero-based index in the Fibonacci sequence
21
- * @returns The nth Fibonacci number
22
- * @throws {RangeError} If n is negative, non-integer, NaN, Infinity, or greater than 78
10
+ * Infinite generator that lazily yields the Fibonacci sequence as BigInts
11
+ * @yields {bigint} The next Fibonacci number in the sequence (0n, 1n, 1n, 2n, 3n, …)
12
+ * @remarks Each call creates an independent iterator with its own state, so
13
+ * multiple consumers can advance through the sequence without interference.
14
+ * @example
15
+ * ```typescript
16
+ * const gen = fibonacciGenerator();
17
+ * gen.next().value; // 0n
18
+ * gen.next().value; // 1n
19
+ * gen.next().value; // 1n
20
+ * ```
21
+ */
22
+ export function* fibonacciGenerator() {
23
+ /* eslint-disable functional/no-let -- generator requires mutable state for iterative Fibonacci computation */
24
+ let a = 0n;
25
+ let b = 1n;
26
+ /* eslint-enable functional/no-let -- re-enable after generator state declarations */
27
+ while (true) {
28
+ yield a;
29
+ [a, b] = [b, a + b];
30
+ }
31
+ }
32
+ /**
33
+ * Returns the nth Fibonacci number as a BigInt
34
+ * @param n - Zero-based index into the Fibonacci sequence (must be a non-negative integer)
35
+ * @returns The nth Fibonacci number (e.g. fibonacci(5) → 5n)
36
+ * @throws {RangeError} When n is negative, non-integer, NaN, or Infinity
37
+ * @remarks Delegates to `fibonacciGenerator` so the recurrence logic is defined once.
38
+ * @example
39
+ * ```typescript
40
+ * fibonacci(0); // 0n
41
+ * fibonacci(10); // 55n
42
+ * fibonacci(78); // 8944394323791464n — beyond Number.MAX_SAFE_INTEGER
43
+ * ```
23
44
  */
24
45
  export function fibonacci(n) {
25
- if (!Number.isInteger(n) || n < 0) {
46
+ if (!Number.isFinite(n) || !Number.isInteger(n) || n < 0) {
26
47
  throw new RangeError(`Expected a non-negative integer for n, got ${String(n)}`);
27
48
  }
28
- if (n > MAX_SAFE_N) {
29
- throw new RangeError("fibonacci(n) exceeds Number.MAX_SAFE_INTEGER for n > 78");
30
- }
31
- if (n <= 1) {
32
- return n;
33
- }
34
- const [, result] = Array.from({ length: n - 1 }).reduce(([prev, curr]) => [curr, prev + curr], [0, 1]);
35
- return result;
49
+ const gen = fibonacciGenerator();
50
+ Array.from({ length: n }, () => gen.next());
51
+ return gen.next().value;
36
52
  }
37
53
  /**
38
- * Generate the first `length` Fibonacci numbers as a readonly array.
39
- *
40
- * Builds the sequence incrementally with reduce so each element derives
41
- * from its two predecessors without recomputing from scratch.
42
- *
43
- * @param length - How many Fibonacci numbers to generate
44
- * @returns A readonly array of Fibonacci numbers
45
- * @throws {RangeError} If length is negative, non-integer, NaN, Infinity, or greater than 79
54
+ * Returns the first `length` Fibonacci numbers as a readonly BigInt array
55
+ * @param length - How many Fibonacci numbers to return (must be a non-negative integer)
56
+ * @returns A new array containing the first `length` Fibonacci numbers
57
+ * @throws {RangeError} When length is negative, non-integer, NaN, or Infinity
58
+ * @remarks Delegates to `fibonacciGenerator` so the recurrence logic is defined once.
59
+ * Returns a fresh array on every call callers can safely mutate the result.
60
+ * @example
61
+ * ```typescript
62
+ * fibonacciSequence(0); // []
63
+ * fibonacciSequence(5); // [0n, 1n, 1n, 2n, 3n]
64
+ * ```
46
65
  */
47
66
  export function fibonacciSequence(length) {
48
- if (!Number.isInteger(length) || length < 0) {
67
+ if (!Number.isFinite(length) || !Number.isInteger(length) || length < 0) {
49
68
  throw new RangeError(`Expected a non-negative integer for length, got ${String(length)}`);
50
69
  }
51
- if (length > MAX_SAFE_LENGTH) {
52
- throw new RangeError("fibonacciSequence(length) exceeds Number.MAX_SAFE_INTEGER for length > 79");
53
- }
54
- return Array.from({ length }).reduce((acc, _, i) => [...acc, i < 2 ? i : (acc[i - 1] ?? 0) + (acc[i - 2] ?? 0)], []);
70
+ const gen = fibonacciGenerator();
71
+ return Array.from({ length }, () => gen.next().value);
55
72
  }
56
73
  //# sourceMappingURL=fibonacci.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"fibonacci.js","sourceRoot":"","sources":["../../src/utils/fibonacci.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,kEAAkE;AAClE,MAAM,UAAU,GAAG,EAAE,CAAC;AAEtB,0EAA0E;AAC1E,MAAM,eAAe,GAAG,EAAE,CAAC;AAE3B;;;;;;;;;GASG;AACH,MAAM,UAAU,SAAS,CAAC,CAAS;IACjC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,UAAU,CAClB,8CAA8C,MAAM,CAAC,CAAC,CAAC,EAAE,CAC1D,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,GAAG,UAAU,EAAE,CAAC;QACnB,MAAM,IAAI,UAAU,CAClB,yDAAyD,CAC1D,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,CAAC;IACX,CAAC;IAED,MAAM,CAAC,EAAE,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,MAAM,CAErD,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAE1D,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC9C,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,UAAU,CAClB,mDAAmD,MAAM,CAAC,MAAM,CAAC,EAAE,CACp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,MAAM,GAAG,GAAG,kBAAkB,EAAE,CAAC;IACjC,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,CAAC;IAC5C,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC;AAC1B,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAc;IAC9C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,UAAU,CAClB,mDAAmD,MAAM,CAAC,MAAM,CAAC,EAAE,CACpE,CAAC;IACJ,CAAC;IAED,MAAM,GAAG,GAAG,kBAAkB,EAAE,CAAC;IACjC,OAAO,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC;AACxD,CAAC"}
package/package.json CHANGED
@@ -88,7 +88,7 @@
88
88
  "@isaacs/brace-expansion": "^5.0.1"
89
89
  },
90
90
  "name": "@codyswann/lisa",
91
- "version": "1.31.1",
91
+ "version": "1.33.0",
92
92
  "description": "Claude Code governance framework that applies guardrails, guidance, and automated enforcement to projects",
93
93
  "main": "dist/index.js",
94
94
  "bin": {