@organon-methodology/testing 0.3.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.
Files changed (83) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +80 -0
  3. package/dist/adapters/vitest.d.ts +49 -0
  4. package/dist/adapters/vitest.d.ts.map +1 -0
  5. package/dist/adapters/vitest.js +60 -0
  6. package/dist/adapters/vitest.js.map +1 -0
  7. package/dist/core/assert-custom.d.ts +43 -0
  8. package/dist/core/assert-custom.d.ts.map +1 -0
  9. package/dist/core/assert-custom.js +48 -0
  10. package/dist/core/assert-custom.js.map +1 -0
  11. package/dist/core/assert-exports-present.d.ts +52 -0
  12. package/dist/core/assert-exports-present.d.ts.map +1 -0
  13. package/dist/core/assert-exports-present.js +125 -0
  14. package/dist/core/assert-exports-present.js.map +1 -0
  15. package/dist/core/assert-file-exists.d.ts +41 -0
  16. package/dist/core/assert-file-exists.d.ts.map +1 -0
  17. package/dist/core/assert-file-exists.js +52 -0
  18. package/dist/core/assert-file-exists.js.map +1 -0
  19. package/dist/core/assert-max-value.d.ts +79 -0
  20. package/dist/core/assert-max-value.d.ts.map +1 -0
  21. package/dist/core/assert-max-value.js +90 -0
  22. package/dist/core/assert-max-value.js.map +1 -0
  23. package/dist/core/assert-naming-convention.d.ts +61 -0
  24. package/dist/core/assert-naming-convention.d.ts.map +1 -0
  25. package/dist/core/assert-naming-convention.js +92 -0
  26. package/dist/core/assert-naming-convention.js.map +1 -0
  27. package/dist/core/assert-no-side-effects.d.ts +55 -0
  28. package/dist/core/assert-no-side-effects.d.ts.map +1 -0
  29. package/dist/core/assert-no-side-effects.js +72 -0
  30. package/dist/core/assert-no-side-effects.js.map +1 -0
  31. package/dist/core/assertions/exports-present.d.ts +38 -0
  32. package/dist/core/assertions/exports-present.d.ts.map +1 -0
  33. package/dist/core/assertions/exports-present.js +47 -0
  34. package/dist/core/assertions/exports-present.js.map +1 -0
  35. package/dist/core/assertions/file-exists.d.ts +45 -0
  36. package/dist/core/assertions/file-exists.d.ts.map +1 -0
  37. package/dist/core/assertions/file-exists.js +46 -0
  38. package/dist/core/assertions/file-exists.js.map +1 -0
  39. package/dist/core/assertions/max-value.d.ts +77 -0
  40. package/dist/core/assertions/max-value.d.ts.map +1 -0
  41. package/dist/core/assertions/max-value.js +60 -0
  42. package/dist/core/assertions/max-value.js.map +1 -0
  43. package/dist/core/assertions/naming-convention.d.ts +51 -0
  44. package/dist/core/assertions/naming-convention.d.ts.map +1 -0
  45. package/dist/core/assertions/naming-convention.js +73 -0
  46. package/dist/core/assertions/naming-convention.js.map +1 -0
  47. package/dist/core/assertions/no-side-effects.d.ts +47 -0
  48. package/dist/core/assertions/no-side-effects.d.ts.map +1 -0
  49. package/dist/core/assertions/no-side-effects.js +70 -0
  50. package/dist/core/assertions/no-side-effects.js.map +1 -0
  51. package/dist/core/invariant-test.d.ts +128 -0
  52. package/dist/core/invariant-test.d.ts.map +1 -0
  53. package/dist/core/invariant-test.js +174 -0
  54. package/dist/core/invariant-test.js.map +1 -0
  55. package/dist/core/resolvers/file-resolver.d.ts +92 -0
  56. package/dist/core/resolvers/file-resolver.d.ts.map +1 -0
  57. package/dist/core/resolvers/file-resolver.js +103 -0
  58. package/dist/core/resolvers/file-resolver.js.map +1 -0
  59. package/dist/core/resolvers/import-resolver.d.ts +55 -0
  60. package/dist/core/resolvers/import-resolver.d.ts.map +1 -0
  61. package/dist/core/resolvers/import-resolver.js +99 -0
  62. package/dist/core/resolvers/import-resolver.js.map +1 -0
  63. package/dist/core/resolvers/node-fs.d.ts +13 -0
  64. package/dist/core/resolvers/node-fs.d.ts.map +1 -0
  65. package/dist/core/resolvers/node-fs.js +32 -0
  66. package/dist/core/resolvers/node-fs.js.map +1 -0
  67. package/dist/core/resolvers/parallel-reader.d.ts +35 -0
  68. package/dist/core/resolvers/parallel-reader.d.ts.map +1 -0
  69. package/dist/core/resolvers/parallel-reader.js +56 -0
  70. package/dist/core/resolvers/parallel-reader.js.map +1 -0
  71. package/dist/core/resolvers/string-resolver.d.ts +66 -0
  72. package/dist/core/resolvers/string-resolver.d.ts.map +1 -0
  73. package/dist/core/resolvers/string-resolver.js +127 -0
  74. package/dist/core/resolvers/string-resolver.js.map +1 -0
  75. package/dist/core/resolvers/types.d.ts +16 -0
  76. package/dist/core/resolvers/types.d.ts.map +1 -0
  77. package/dist/core/resolvers/types.js +10 -0
  78. package/dist/core/resolvers/types.js.map +1 -0
  79. package/dist/index.d.ts +40 -0
  80. package/dist/index.d.ts.map +1 -0
  81. package/dist/index.js +50 -0
  82. package/dist/index.js.map +1 -0
  83. package/package.json +67 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Organon Methodology Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,80 @@
1
+ # @organon-methodology/testing
2
+
3
+ Semantic testing framework for automated tier-4 invariant verification in [Organon](https://github.com/VledicFranco/organon) projects.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ npm install --save-dev @organon-methodology/testing
9
+ ```
10
+
11
+ ## Assertions
12
+
13
+ | Assertion | Purpose |
14
+ |-----------|---------|
15
+ | `assertMaxValue` | Enforce numeric limits (line counts, token estimates, array lengths) |
16
+ | `assertFileExists` | Verify required files are present (globs supported) |
17
+ | `assertNamingConvention` | Enforce naming patterns (kebab-case, snake_case, custom regex) |
18
+ | `assertExportsPresent` | Verify modules export expected symbols |
19
+ | `assertNoSideEffects` | Detect forbidden patterns in source files |
20
+ | `assertCustom` | Escape hatch for arbitrary validation logic |
21
+
22
+ All assertions resolve files from disk using glob patterns and provide structured violation reports.
23
+
24
+ ## Usage with Vitest
25
+
26
+ ```ts
27
+ import { testInvariant } from '@organon-methodology/testing/vitest';
28
+ import { assertMaxValue } from '@organon-methodology/testing';
29
+
30
+ testInvariant('INV-EXAMPLE-1', 'README files stay under 100 lines', async () => {
31
+ await assertMaxValue({
32
+ pattern: '**/README.md',
33
+ extract: /\n/g, // count newlines
34
+ max: 100,
35
+ cwd: process.cwd(),
36
+ });
37
+ });
38
+ ```
39
+
40
+ The `testInvariant` adapter wraps your test runner (Vitest) so invariant tests are tracked in a registry and tagged with structured IDs.
41
+
42
+ ## API
43
+
44
+ ### `testInvariant(id, description, fn)`
45
+
46
+ Registers and runs an invariant test. The `id` must match the pattern `INV-<SCOPE>-<N>`.
47
+
48
+ ### `assertMaxValue(options)`
49
+
50
+ Resolves files matching `pattern`, extracts numeric values, and fails if any exceed `max`. Options:
51
+
52
+ - `pattern` — glob pattern for files
53
+ - `extract` — regex or function to extract a count from each file
54
+ - `max` — maximum allowed value
55
+ - `cwd` — working directory for glob resolution
56
+ - `requireMatches` — fail if no files match (default: `true`)
57
+
58
+ ### `assertFileExists(options)`
59
+
60
+ Verifies that files matching the given patterns exist.
61
+
62
+ ### `assertNamingConvention(options)`
63
+
64
+ Checks that file names or extracted strings conform to a naming convention (`kebab-case`, `snake_case`, `camelCase`, `PascalCase`, or custom regex).
65
+
66
+ ### `assertExportsPresent(options)`
67
+
68
+ Parses source files and verifies that expected export names are present.
69
+
70
+ ### `assertNoSideEffects(options)`
71
+
72
+ Scans files for forbidden patterns (e.g., `console.log`, `process.exit`) and fails if any are found.
73
+
74
+ ### `assertCustom(options)`
75
+
76
+ Runs an arbitrary validation function. Use when no built-in assertion fits.
77
+
78
+ ## License
79
+
80
+ MIT
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Vitest adapter for @organon-methodology/testing.
3
+ *
4
+ * Provides a TestRunner that delegates to vitest's `it()` so invariant tests
5
+ * participate in vitest's lifecycle (reporting, --bail, watch-mode, etc.).
6
+ *
7
+ * Usage:
8
+ * ```typescript
9
+ * import { testInvariant, assertMaxValue } from '@organon-methodology/testing/vitest';
10
+ *
11
+ * testInvariant('INV-FOO-1', 'max cache TTL is 24h', async () => {
12
+ * await assertMaxValue({ files: ['src/config.ts'], pattern: /ttl:\s*(\d+)/, maxValue: 86400 });
13
+ * });
14
+ * ```
15
+ *
16
+ * Invariants:
17
+ * - INV-TEST-4 (framework-agnostic-core): Core logic stays in invariant-test.ts;
18
+ * this file only bridges to vitest's `it()`.
19
+ */
20
+ import { type TestRunner, type InvariantTestFn, type TestInvariantOptions } from '../core/invariant-test.js';
21
+ /**
22
+ * A TestRunner that wraps vitest's `it()`.
23
+ *
24
+ * vitest's `it()` accepts an async function and tracks the promise internally,
25
+ * so the async test function integrates naturally.
26
+ */
27
+ export declare const vitestRunner: TestRunner;
28
+ /**
29
+ * testInvariant pre-configured with the vitest runner.
30
+ *
31
+ * Drop-in replacement for the core testInvariant — same signature,
32
+ * but tests run through vitest's `it()` instead of the default fire-and-forget runner.
33
+ */
34
+ export declare function testInvariant(invariantId: string, description: string, testFn: InvariantTestFn, options?: Omit<TestInvariantOptions, 'runner'>): void;
35
+ export { assertMaxValue, MaxValueResolverError, MaxValueAssertionError } from '../core/assert-max-value.js';
36
+ export type { MaxValueOptions } from '../core/assert-max-value.js';
37
+ export type { InvariantTestMetadata, InvariantTestFn, TestRunner, TestInvariantOptions, } from '../core/invariant-test.js';
38
+ export { createRegistry, getDefaultRegistry, InvariantTestError, } from '../core/invariant-test.js';
39
+ export { assertFileExists, FileExistsResolverError, FileExistsAssertionError } from '../core/assert-file-exists.js';
40
+ export type { FileExistsOptions } from '../core/assert-file-exists.js';
41
+ export { assertCustom, CustomAssertionError } from '../core/assert-custom.js';
42
+ export type { CustomAssertionOptions } from '../core/assert-custom.js';
43
+ export { assertNoSideEffects, NoSideEffectsResolverError, NoSideEffectsAssertionError } from '../core/assert-no-side-effects.js';
44
+ export type { NoSideEffectsOptions } from '../core/assert-no-side-effects.js';
45
+ export { assertNamingConvention, NamingConventionResolverError, NamingConventionAssertionError } from '../core/assert-naming-convention.js';
46
+ export type { NamingConventionOptions, Convention } from '../core/assert-naming-convention.js';
47
+ export { assertExportsPresent, ExportsPresentResolverError, ExportsPresentAssertionError } from '../core/assert-exports-present.js';
48
+ export type { ExportsPresentOptions } from '../core/assert-exports-present.js';
49
+ //# sourceMappingURL=vitest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vitest.d.ts","sourceRoot":"","sources":["../../src/adapters/vitest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,eAAe,EAEpB,KAAK,oBAAoB,EAC1B,MAAM,2BAA2B,CAAC;AAMnC;;;;;GAKG;AACH,eAAO,MAAM,YAAY,EAAE,UAM1B,CAAC;AAMF;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,eAAe,EACvB,OAAO,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,QAAQ,CAAC,GAC7C,IAAI,CAKN;AAMD,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC5G,YAAY,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,YAAY,EACV,qBAAqB,EACrB,eAAe,EACf,UAAU,EACV,oBAAoB,GACrB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACpH,YAAY,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAEvE,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAC9E,YAAY,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAEvE,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AACjI,YAAY,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAE9E,OAAO,EAAE,sBAAsB,EAAE,6BAA6B,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAC5I,YAAY,EAAE,uBAAuB,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAE/F,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC;AACpI,YAAY,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC"}
@@ -0,0 +1,60 @@
1
+ /**
2
+ * Vitest adapter for @organon-methodology/testing.
3
+ *
4
+ * Provides a TestRunner that delegates to vitest's `it()` so invariant tests
5
+ * participate in vitest's lifecycle (reporting, --bail, watch-mode, etc.).
6
+ *
7
+ * Usage:
8
+ * ```typescript
9
+ * import { testInvariant, assertMaxValue } from '@organon-methodology/testing/vitest';
10
+ *
11
+ * testInvariant('INV-FOO-1', 'max cache TTL is 24h', async () => {
12
+ * await assertMaxValue({ files: ['src/config.ts'], pattern: /ttl:\s*(\d+)/, maxValue: 86400 });
13
+ * });
14
+ * ```
15
+ *
16
+ * Invariants:
17
+ * - INV-TEST-4 (framework-agnostic-core): Core logic stays in invariant-test.ts;
18
+ * this file only bridges to vitest's `it()`.
19
+ */
20
+ import { it } from 'vitest';
21
+ import { testInvariant as coreTestInvariant, } from '../core/invariant-test.js';
22
+ // ---------------------------------------------------------------------------
23
+ // Vitest runner
24
+ // ---------------------------------------------------------------------------
25
+ /**
26
+ * A TestRunner that wraps vitest's `it()`.
27
+ *
28
+ * vitest's `it()` accepts an async function and tracks the promise internally,
29
+ * so the async test function integrates naturally.
30
+ */
31
+ export const vitestRunner = (testName, testFn, _metadata) => {
32
+ it(testName, testFn);
33
+ };
34
+ // ---------------------------------------------------------------------------
35
+ // Pre-configured testInvariant (convenience)
36
+ // ---------------------------------------------------------------------------
37
+ /**
38
+ * testInvariant pre-configured with the vitest runner.
39
+ *
40
+ * Drop-in replacement for the core testInvariant — same signature,
41
+ * but tests run through vitest's `it()` instead of the default fire-and-forget runner.
42
+ */
43
+ export function testInvariant(invariantId, description, testFn, options) {
44
+ coreTestInvariant(invariantId, description, testFn, {
45
+ ...options,
46
+ runner: vitestRunner,
47
+ });
48
+ }
49
+ // ---------------------------------------------------------------------------
50
+ // Re-exports for single-import convenience
51
+ // ---------------------------------------------------------------------------
52
+ export { assertMaxValue, MaxValueResolverError, MaxValueAssertionError } from '../core/assert-max-value.js';
53
+ export { createRegistry, getDefaultRegistry, InvariantTestError, } from '../core/invariant-test.js';
54
+ // Phase 2/3 assertions
55
+ export { assertFileExists, FileExistsResolverError, FileExistsAssertionError } from '../core/assert-file-exists.js';
56
+ export { assertCustom, CustomAssertionError } from '../core/assert-custom.js';
57
+ export { assertNoSideEffects, NoSideEffectsResolverError, NoSideEffectsAssertionError } from '../core/assert-no-side-effects.js';
58
+ export { assertNamingConvention, NamingConventionResolverError, NamingConventionAssertionError } from '../core/assert-naming-convention.js';
59
+ export { assertExportsPresent, ExportsPresentResolverError, ExportsPresentAssertionError } from '../core/assert-exports-present.js';
60
+ //# sourceMappingURL=vitest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vitest.js","sourceRoot":"","sources":["../../src/adapters/vitest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC5B,OAAO,EACL,aAAa,IAAI,iBAAiB,GAKnC,MAAM,2BAA2B,CAAC;AAEnC,8EAA8E;AAC9E,gBAAgB;AAChB,8EAA8E;AAE9E;;;;;GAKG;AACH,MAAM,CAAC,MAAM,YAAY,GAAe,CACtC,QAAgB,EAChB,MAAuB,EACvB,SAAgC,EAC1B,EAAE;IACR,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AACvB,CAAC,CAAC;AAEF,8EAA8E;AAC9E,6CAA6C;AAC7C,8EAA8E;AAE9E;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAC3B,WAAmB,EACnB,WAAmB,EACnB,MAAuB,EACvB,OAA8C;IAE9C,iBAAiB,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE;QAClD,GAAG,OAAO;QACV,MAAM,EAAE,YAAY;KACrB,CAAC,CAAC;AACL,CAAC;AAED,8EAA8E;AAC9E,2CAA2C;AAC3C,8EAA8E;AAE9E,OAAO,EAAE,cAAc,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAQ5G,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,2BAA2B,CAAC;AAEnC,uBAAuB;AACvB,OAAO,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAGpH,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAG9E,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAGjI,OAAO,EAAE,sBAAsB,EAAE,6BAA6B,EAAE,8BAA8B,EAAE,MAAM,qCAAqC,CAAC;AAG5I,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,mCAAmC,CAAC"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * assertCustom — Thin wrapper for user-defined validation functions.
3
+ *
4
+ * No pure validator layer needed — the validator IS the user's function.
5
+ * This wrapper provides consistent error handling and labeling.
6
+ *
7
+ * Invariants:
8
+ * - INV-TEST-2 (fail-fast): Re-throws user errors wrapped in CustomAssertionError
9
+ * - INV-TEST-6 (always-async): Returns Promise<void>
10
+ * - INV-TEST-7 (composable): No module-level mutable state
11
+ */
12
+ /**
13
+ * Options for assertCustom.
14
+ */
15
+ export interface CustomAssertionOptions {
16
+ /** Human-readable label for the assertion (used in error messages) */
17
+ label: string;
18
+ /** The validation function to execute. Throw to signal failure. */
19
+ validate: () => Promise<void>;
20
+ }
21
+ /**
22
+ * Error thrown when a custom assertion fails.
23
+ * Wraps the original error with a label for context.
24
+ */
25
+ export declare class CustomAssertionError extends Error {
26
+ /** The label provided for this assertion */
27
+ readonly label: string;
28
+ /** The original error thrown by the validation function */
29
+ readonly cause: Error;
30
+ constructor(label: string, cause: Error);
31
+ }
32
+ /**
33
+ * Run a user-defined validation function with consistent error handling.
34
+ *
35
+ * If the validation function throws, the error is wrapped in a
36
+ * CustomAssertionError with the provided label for context.
37
+ * If it completes without throwing, the assertion passes.
38
+ *
39
+ * @param options - Configuration including label and validate function
40
+ * @throws {CustomAssertionError} if the validate function throws
41
+ */
42
+ export declare function assertCustom(options: CustomAssertionOptions): Promise<void>;
43
+ //# sourceMappingURL=assert-custom.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert-custom.d.ts","sourceRoot":"","sources":["../../src/core/assert-custom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,QAAQ,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/B;AAED;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,4CAA4C;IAC5C,SAAgB,KAAK,EAAE,MAAM,CAAC;IAC9B,2DAA2D;IAC3D,SAAgB,KAAK,EAAE,KAAK,CAAC;gBAEjB,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK;CAMxC;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,IAAI,CAAC,CASf"}
@@ -0,0 +1,48 @@
1
+ /**
2
+ * assertCustom — Thin wrapper for user-defined validation functions.
3
+ *
4
+ * No pure validator layer needed — the validator IS the user's function.
5
+ * This wrapper provides consistent error handling and labeling.
6
+ *
7
+ * Invariants:
8
+ * - INV-TEST-2 (fail-fast): Re-throws user errors wrapped in CustomAssertionError
9
+ * - INV-TEST-6 (always-async): Returns Promise<void>
10
+ * - INV-TEST-7 (composable): No module-level mutable state
11
+ */
12
+ /**
13
+ * Error thrown when a custom assertion fails.
14
+ * Wraps the original error with a label for context.
15
+ */
16
+ export class CustomAssertionError extends Error {
17
+ /** The label provided for this assertion */
18
+ label;
19
+ /** The original error thrown by the validation function */
20
+ cause;
21
+ constructor(label, cause) {
22
+ super(`Custom assertion "${label}" failed: ${cause.message}`);
23
+ this.name = 'CustomAssertionError';
24
+ this.label = label;
25
+ this.cause = cause;
26
+ }
27
+ }
28
+ /**
29
+ * Run a user-defined validation function with consistent error handling.
30
+ *
31
+ * If the validation function throws, the error is wrapped in a
32
+ * CustomAssertionError with the provided label for context.
33
+ * If it completes without throwing, the assertion passes.
34
+ *
35
+ * @param options - Configuration including label and validate function
36
+ * @throws {CustomAssertionError} if the validate function throws
37
+ */
38
+ export async function assertCustom(options) {
39
+ const { label, validate } = options;
40
+ try {
41
+ await validate();
42
+ }
43
+ catch (err) {
44
+ const error = err instanceof Error ? err : new Error(String(err));
45
+ throw new CustomAssertionError(label, error);
46
+ }
47
+ }
48
+ //# sourceMappingURL=assert-custom.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert-custom.js","sourceRoot":"","sources":["../../src/core/assert-custom.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAYH;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C,4CAA4C;IAC5B,KAAK,CAAS;IAC9B,2DAA2D;IAC3C,KAAK,CAAQ;IAE7B,YAAY,KAAa,EAAE,KAAY;QACrC,KAAK,CAAC,qBAAqB,KAAK,aAAa,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;QAC9D,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;QACnC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF;AAED;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,OAA+B;IAE/B,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAEpC,IAAI,CAAC;QACH,MAAM,QAAQ,EAAE,CAAC;IACnB,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,KAAK,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;QAClE,MAAM,IAAI,oBAAoB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAC/C,CAAC;AACH,CAAC"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * assertExportsPresent — High-level assertion that verifies expected exports exist.
3
+ *
4
+ * Simplified backwards-compat check: scans a file for export statements
5
+ * and verifies that all expected export names are present.
6
+ *
7
+ * Architecture:
8
+ * - Reads file content via FileSystem (I/O layer)
9
+ * - Extracts export names via regex
10
+ * - Delegates to assertions/exports-present.ts for pure validation
11
+ *
12
+ * Invariants:
13
+ * - INV-TEST-2 (fail-fast): Throws on violation or resolver errors
14
+ * - INV-TEST-6 (always-async): Returns Promise<void>
15
+ * - INV-TEST-7 (composable): No module-level mutable state
16
+ */
17
+ import type { FileSystem } from './resolvers/types.js';
18
+ /**
19
+ * Options for assertExportsPresent.
20
+ */
21
+ export interface ExportsPresentOptions {
22
+ /** Path to the file to check */
23
+ file: string;
24
+ /** Expected export names that must be present */
25
+ expectedExports: string[];
26
+ /** Optional working directory */
27
+ cwd?: string;
28
+ /** Optional FileSystem implementation */
29
+ fs?: FileSystem;
30
+ }
31
+ /**
32
+ * Error thrown when assertExportsPresent encounters resolver-level errors.
33
+ */
34
+ export declare class ExportsPresentResolverError extends Error {
35
+ constructor(message: string);
36
+ }
37
+ /**
38
+ * Extract all exported names from file content.
39
+ *
40
+ * Pure function — no I/O.
41
+ */
42
+ export declare function extractExportNames(content: string): string[];
43
+ /**
44
+ * Assert that a file contains all expected exports.
45
+ *
46
+ * @param options - Configuration including file path and expected exports
47
+ * @throws {ExportsPresentResolverError} if file can't be read
48
+ * @throws {ExportsPresentAssertionError} if any expected export is missing
49
+ */
50
+ export declare function assertExportsPresent(options: ExportsPresentOptions): Promise<void>;
51
+ export { ExportsPresentAssertionError } from './assertions/exports-present.js';
52
+ //# sourceMappingURL=assert-exports-present.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert-exports-present.d.ts","sourceRoot":"","sources":["../../src/core/assert-exports-present.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAOvD;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,gCAAgC;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,iCAAiC;IACjC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,EAAE,CAAC,EAAE,UAAU,CAAC;CACjB;AAED;;GAEG;AACH,qBAAa,2BAA4B,SAAQ,KAAK;gBACxC,OAAO,EAAE,MAAM;CAI5B;AA2BD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAqC5D;AAED;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,IAAI,CAAC,CA2Bf;AAGD,OAAO,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC"}
@@ -0,0 +1,125 @@
1
+ /**
2
+ * assertExportsPresent — High-level assertion that verifies expected exports exist.
3
+ *
4
+ * Simplified backwards-compat check: scans a file for export statements
5
+ * and verifies that all expected export names are present.
6
+ *
7
+ * Architecture:
8
+ * - Reads file content via FileSystem (I/O layer)
9
+ * - Extracts export names via regex
10
+ * - Delegates to assertions/exports-present.ts for pure validation
11
+ *
12
+ * Invariants:
13
+ * - INV-TEST-2 (fail-fast): Throws on violation or resolver errors
14
+ * - INV-TEST-6 (always-async): Returns Promise<void>
15
+ * - INV-TEST-7 (composable): No module-level mutable state
16
+ */
17
+ import { createNodeFileSystem } from './resolvers/node-fs.js';
18
+ import { validateExportsPresent, } from './assertions/exports-present.js';
19
+ /**
20
+ * Error thrown when assertExportsPresent encounters resolver-level errors.
21
+ */
22
+ export class ExportsPresentResolverError extends Error {
23
+ constructor(message) {
24
+ super(message);
25
+ this.name = 'ExportsPresentResolverError';
26
+ }
27
+ }
28
+ /**
29
+ * Patterns to extract export names from TypeScript/JavaScript files.
30
+ *
31
+ * Captures from:
32
+ * - export function name
33
+ * - export async function name
34
+ * - export class name
35
+ * - export interface name
36
+ * - export type name
37
+ * - export const/let/var name
38
+ * - export enum name
39
+ * - export { name, name2 }
40
+ * - export { name } from '...'
41
+ */
42
+ const EXPORT_PATTERNS = [
43
+ /export\s+(?:async\s+)?function\s+(\w+)/,
44
+ /export\s+class\s+(\w+)/,
45
+ /export\s+interface\s+(\w+)/,
46
+ /export\s+type\s+(\w+)/,
47
+ /export\s+(?:const|let|var)\s+(\w+)/,
48
+ /export\s+enum\s+(\w+)/,
49
+ ];
50
+ const EXPORT_LIST_PATTERN = /export\s*\{([^}]+)\}/;
51
+ /**
52
+ * Extract all exported names from file content.
53
+ *
54
+ * Pure function — no I/O.
55
+ */
56
+ export function extractExportNames(content) {
57
+ const names = [];
58
+ const lines = content.split('\n');
59
+ for (const line of lines) {
60
+ // Check named export patterns
61
+ for (const pattern of EXPORT_PATTERNS) {
62
+ const match = pattern.exec(line);
63
+ if (match && match[1]) {
64
+ names.push(match[1]);
65
+ break;
66
+ }
67
+ }
68
+ // Check export list pattern: export { a, b, c }
69
+ const listMatch = EXPORT_LIST_PATTERN.exec(line);
70
+ if (listMatch && listMatch[1]) {
71
+ const items = listMatch[1].split(',');
72
+ for (const item of items) {
73
+ // Handle "name as alias" — use the original name
74
+ const trimmed = item.trim();
75
+ if (!trimmed)
76
+ continue;
77
+ const asMatch = /^(\w+)\s+as\s+/.exec(trimmed);
78
+ const typedMatch = /^type\s+(\w+)/.exec(trimmed);
79
+ if (typedMatch) {
80
+ names.push(typedMatch[1]);
81
+ }
82
+ else if (asMatch) {
83
+ names.push(asMatch[1]);
84
+ }
85
+ else {
86
+ const nameOnly = trimmed.split(/\s/)[0];
87
+ if (nameOnly)
88
+ names.push(nameOnly);
89
+ }
90
+ }
91
+ }
92
+ }
93
+ return names;
94
+ }
95
+ /**
96
+ * Assert that a file contains all expected exports.
97
+ *
98
+ * @param options - Configuration including file path and expected exports
99
+ * @throws {ExportsPresentResolverError} if file can't be read
100
+ * @throws {ExportsPresentAssertionError} if any expected export is missing
101
+ */
102
+ export async function assertExportsPresent(options) {
103
+ const { file, expectedExports, cwd, fs } = options;
104
+ const resolvedFs = fs ?? createNodeFileSystem();
105
+ // Fail-fast on empty inputs (INV-TEST-2)
106
+ if (expectedExports.length === 0) {
107
+ throw new ExportsPresentResolverError('No expected exports provided. The expectedExports array must not be empty.');
108
+ }
109
+ // Read the file
110
+ const readPath = cwd ? `${cwd}/${file}` : file;
111
+ let content;
112
+ try {
113
+ content = await resolvedFs.readFile(readPath);
114
+ }
115
+ catch (err) {
116
+ throw new ExportsPresentResolverError(`Failed to read file "${file}": ${err instanceof Error ? err.message : String(err)}`);
117
+ }
118
+ // Extract export names
119
+ const foundExports = extractExportNames(content);
120
+ // Delegate to pure validator
121
+ validateExportsPresent(file, expectedExports, foundExports);
122
+ }
123
+ // Re-export for consumers
124
+ export { ExportsPresentAssertionError } from './assertions/exports-present.js';
125
+ //# sourceMappingURL=assert-exports-present.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert-exports-present.js","sourceRoot":"","sources":["../../src/core/assert-exports-present.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EACL,sBAAsB,GAEvB,MAAM,iCAAiC,CAAC;AAgBzC;;GAEG;AACH,MAAM,OAAO,2BAA4B,SAAQ,KAAK;IACpD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAC;IAC5C,CAAC;CACF;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,eAAe,GAAG;IACtB,wCAAwC;IACxC,wBAAwB;IACxB,4BAA4B;IAC5B,uBAAuB;IACvB,oCAAoC;IACpC,uBAAuB;CACxB,CAAC;AAEF,MAAM,mBAAmB,GAAG,sBAAsB,CAAC;AAEnD;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAe;IAChD,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;I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.exists() to check each file (I/O layer)
6
+ * - Delegates to assertions/file-exists.ts for pure validation (no I/O)
7
+ * - This module is the composition layer that wires I/O to pure logic
8
+ *
9
+ * Invariants:
10
+ * - INV-TEST-2 (fail-fast): Throws on violation or empty files array
11
+ * - INV-TEST-6 (always-async): Returns Promise<void>
12
+ * - INV-TEST-7 (composable): No module-level mutable state
13
+ */
14
+ import type { FileSystem } from './resolvers/types.js';
15
+ /**
16
+ * Options for assertFileExists.
17
+ */
18
+ export interface FileExistsOptions {
19
+ /** File paths to check (not globs — existence check only) */
20
+ files: string[];
21
+ /** Optional working directory to resolve relative paths */
22
+ cwd?: string;
23
+ /** Optional FileSystem implementation (defaults to Node.js fs) */
24
+ fs?: FileSystem;
25
+ }
26
+ /**
27
+ * Error thrown when assertFileExists receives invalid input.
28
+ */
29
+ export declare class FileExistsResolverError extends Error {
30
+ constructor(message: string);
31
+ }
32
+ /**
33
+ * Assert that all specified files exist on the filesystem.
34
+ *
35
+ * @param options - Configuration including file paths and optional cwd/fs
36
+ * @throws {FileExistsResolverError} if files array is empty
37
+ * @throws {FileExistsAssertionError} if any file does not exist
38
+ */
39
+ export declare function assertFileExists(options: FileExistsOptions): Promise<void>;
40
+ export { FileExistsAssertionError } from './assertions/file-exists.js';
41
+ //# sourceMappingURL=assert-file-exists.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert-file-exists.d.ts","sourceRoot":"","sources":["../../src/core/assert-file-exists.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAQvD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,6DAA6D;IAC7D,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,2DAA2D;IAC3D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,kEAAkE;IAClE,EAAE,CAAC,EAAE,UAAU,CAAC;CACjB;AAED;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;gBACpC,OAAO,EAAE,MAAM;CAI5B;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,IAAI,CAAC,CAqBf;AAGD,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * assertFileExists — High-level assertion that checks file existence.
3
+ *
4
+ * Architecture:
5
+ * - Uses FileSystem.exists() to check each file (I/O layer)
6
+ * - Delegates to assertions/file-exists.ts for pure validation (no I/O)
7
+ * - This module is the composition layer that wires I/O to pure logic
8
+ *
9
+ * Invariants:
10
+ * - INV-TEST-2 (fail-fast): Throws on violation or empty files array
11
+ * - INV-TEST-6 (always-async): Returns Promise<void>
12
+ * - INV-TEST-7 (composable): No module-level mutable state
13
+ */
14
+ import { join } from 'node:path';
15
+ import { createNodeFileSystem } from './resolvers/node-fs.js';
16
+ import { validateFileExists, } from './assertions/file-exists.js';
17
+ /**
18
+ * Error thrown when assertFileExists receives invalid input.
19
+ */
20
+ export class FileExistsResolverError extends Error {
21
+ constructor(message) {
22
+ super(message);
23
+ this.name = 'FileExistsResolverError';
24
+ }
25
+ }
26
+ /**
27
+ * Assert that all specified files exist on the filesystem.
28
+ *
29
+ * @param options - Configuration including file paths and optional cwd/fs
30
+ * @throws {FileExistsResolverError} if files array is empty
31
+ * @throws {FileExistsAssertionError} if any file does not exist
32
+ */
33
+ export async function assertFileExists(options) {
34
+ const { files, cwd, fs } = options;
35
+ const resolvedFs = fs ?? createNodeFileSystem();
36
+ // Fail-fast on empty files array (INV-TEST-2)
37
+ if (files.length === 0) {
38
+ throw new FileExistsResolverError('No file paths provided. The files array must not be empty.');
39
+ }
40
+ // Resolve existence for each file
41
+ const entries = [];
42
+ for (const file of files) {
43
+ const fullPath = cwd ? join(cwd, file) : file;
44
+ const exists = await resolvedFs.exists(fullPath);
45
+ entries.push({ file, exists });
46
+ }
47
+ // Delegate to pure validator
48
+ validateFileExists(entries);
49
+ }
50
+ // Re-export assertion error for consumers
51
+ export { FileExistsAssertionError } from './assertions/file-exists.js';
52
+ //# sourceMappingURL=assert-file-exists.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"assert-file-exists.js","sourceRoot":"","sources":["../../src/core/assert-file-exists.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EACL,kBAAkB,GAGnB,MAAM,6BAA6B,CAAC;AAcrC;;GAEG;AACH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAChD,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;IACxC,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,OAA0B;IAE1B,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC;IACnC,MAAM,UAAU,GAAG,EAAE,IAAI,oBAAoB,EAAE,CAAC;IAEhD,8CAA8C;IAC9C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,uBAAuB,CAC/B,4DAA4D,CAC7D,CAAC;IACJ,CAAC;IAED,kCAAkC;IAClC,MAAM,OAAO,GAAsB,EAAE,CAAC;IACtC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,MAAM,QAAQ,GAAG,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAC9C,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACjD,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EA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