@mmnto/totem 1.20.0 → 1.22.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/ast-classifier.d.ts +72 -4
- package/dist/ast-classifier.d.ts.map +1 -1
- package/dist/ast-classifier.js +155 -30
- package/dist/ast-classifier.js.map +1 -1
- package/dist/ast-classifier.test.js +80 -2
- package/dist/ast-classifier.test.js.map +1 -1
- package/dist/ast-grep-query.d.ts.map +1 -1
- package/dist/ast-grep-query.js +31 -11
- package/dist/ast-grep-query.js.map +1 -1
- package/dist/chunkers/chunker-registry.d.ts +77 -0
- package/dist/chunkers/chunker-registry.d.ts.map +1 -0
- package/dist/chunkers/chunker-registry.js +134 -0
- package/dist/chunkers/chunker-registry.js.map +1 -0
- package/dist/chunkers/chunker-registry.test.d.ts +14 -0
- package/dist/chunkers/chunker-registry.test.d.ts.map +1 -0
- package/dist/chunkers/chunker-registry.test.js +95 -0
- package/dist/chunkers/chunker-registry.test.js.map +1 -0
- package/dist/chunkers/chunker.d.ts +18 -3
- package/dist/chunkers/chunker.d.ts.map +1 -1
- package/dist/chunkers/chunker.js +20 -13
- package/dist/chunkers/chunker.js.map +1 -1
- package/dist/compiler.d.ts +1 -1
- package/dist/compiler.d.ts.map +1 -1
- package/dist/compiler.js +1 -1
- package/dist/compiler.js.map +1 -1
- package/dist/config-schema.d.ts +193 -10
- package/dist/config-schema.d.ts.map +1 -1
- package/dist/config-schema.js +87 -2
- package/dist/config-schema.js.map +1 -1
- package/dist/config-schema.test.js +122 -0
- package/dist/config-schema.test.js.map +1 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/pack-discovery.d.ts +201 -0
- package/dist/pack-discovery.d.ts.map +1 -0
- package/dist/pack-discovery.js +298 -0
- package/dist/pack-discovery.js.map +1 -0
- package/dist/pack-discovery.test.d.ts +17 -0
- package/dist/pack-discovery.test.d.ts.map +1 -0
- package/dist/pack-discovery.test.js +343 -0
- package/dist/pack-discovery.test.js.map +1 -0
- package/dist/pack-manifest-writer.d.ts +88 -0
- package/dist/pack-manifest-writer.d.ts.map +1 -0
- package/dist/pack-manifest-writer.js +162 -0
- package/dist/pack-manifest-writer.js.map +1 -0
- package/dist/pack-manifest-writer.test.d.ts +15 -0
- package/dist/pack-manifest-writer.test.d.ts.map +1 -0
- package/dist/pack-manifest-writer.test.js +184 -0
- package/dist/pack-manifest-writer.test.js.map +1 -0
- package/dist/rule-engine.d.ts +11 -0
- package/dist/rule-engine.d.ts.map +1 -1
- package/dist/rule-engine.js +60 -6
- package/dist/rule-engine.js.map +1 -1
- package/dist/rule-engine.test.js +116 -0
- package/dist/rule-engine.test.js.map +1 -1
- package/dist/stage4-verifier.d.ts +94 -1
- package/dist/stage4-verifier.d.ts.map +1 -1
- package/dist/stage4-verifier.js +139 -71
- package/dist/stage4-verifier.js.map +1 -1
- package/dist/stage4-verifier.test.js +215 -4
- package/dist/stage4-verifier.test.js.map +1 -1
- package/dist/store/lance-schema.d.ts +3 -3
- package/package.json +3 -1
package/dist/config-schema.d.ts
CHANGED
|
@@ -2,20 +2,48 @@ import { z } from 'zod';
|
|
|
2
2
|
/**
|
|
3
3
|
* Zod schema for totem.config.ts — lives at the root of consuming projects.
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Built-in chunk strategy names. Exported so the literal union derived
|
|
7
|
+
* via `typeof BUILTIN_CHUNK_STRATEGIES[number]` keeps the runtime list
|
|
8
|
+
* and the type signature in sync with a single source of truth. Pack-
|
|
9
|
+
* contributed strategies extend `ChunkStrategy` via the `(string & {})`
|
|
10
|
+
* tail and register at boot through `chunker-registry.ts`.
|
|
11
|
+
*/
|
|
12
|
+
export declare const BUILTIN_CHUNK_STRATEGIES: readonly ["typescript-ast", "markdown-heading", "session-log", "schema-file", "test-file"];
|
|
13
|
+
/**
|
|
14
|
+
* `ChunkStrategy` schema. Per ADR-097 § 10 + mmnto-ai/totem#1769 strategy
|
|
15
|
+
* lookup goes through `chunker-registry.ts` at runtime; this schema only
|
|
16
|
+
* shape-checks the input string.
|
|
17
|
+
*
|
|
18
|
+
* **Why not refine against the registry here?** Bootstrap chicken-and-egg
|
|
19
|
+
* (Gemini review of mmnto-ai/totem#1768 PR-A): config parse runs BEFORE
|
|
20
|
+
* `loadInstalledPacks()` populates the registry with pack-contributed
|
|
21
|
+
* strategies (the manifest is read AFTER config load by every command).
|
|
22
|
+
* A strict registry-check at parse time would crash `totem sync` on the
|
|
23
|
+
* very edit that adds the pack — user adds `@totem/pack-foo` to extends
|
|
24
|
+
* AND a target with `strategy: 'foo-strat'` in the same change, sync
|
|
25
|
+
* fails to parse the config, never writes installed-packs.json, never
|
|
26
|
+
* registers the pack. Forever stuck.
|
|
27
|
+
*
|
|
28
|
+
* The actual fail-loud happens at `createChunker(strategy)` in
|
|
29
|
+
* `chunkers/chunker.ts` — runtime lookup against the post-boot registry
|
|
30
|
+
* with a structured error naming the missing strategy. That's the right
|
|
31
|
+
* boundary because by then the registry IS populated.
|
|
32
|
+
*/
|
|
33
|
+
export declare const ChunkStrategySchema: z.ZodString;
|
|
6
34
|
export declare const ContentTypeSchema: z.ZodEnum<["code", "session_log", "spec", "lesson"]>;
|
|
7
35
|
export declare const IngestTargetSchema: z.ZodObject<{
|
|
8
36
|
glob: z.ZodString;
|
|
9
37
|
type: z.ZodEnum<["code", "session_log", "spec", "lesson"]>;
|
|
10
|
-
strategy: z.
|
|
38
|
+
strategy: z.ZodString;
|
|
11
39
|
}, "strip", z.ZodTypeAny, {
|
|
12
40
|
type: "code" | "session_log" | "spec" | "lesson";
|
|
13
41
|
glob: string;
|
|
14
|
-
strategy:
|
|
42
|
+
strategy: string;
|
|
15
43
|
}, {
|
|
16
44
|
type: "code" | "session_log" | "spec" | "lesson";
|
|
17
45
|
glob: string;
|
|
18
|
-
strategy:
|
|
46
|
+
strategy: string;
|
|
19
47
|
}>;
|
|
20
48
|
export declare const OpenAIProviderSchema: z.ZodObject<{
|
|
21
49
|
provider: z.ZodLiteral<"openai">;
|
|
@@ -712,27 +740,91 @@ export declare const DEFAULT_REVIEW_SOURCE_EXTENSIONS: readonly [".ts", ".tsx",
|
|
|
712
740
|
* newlines, and any other character that could break out of a glob arg.
|
|
713
741
|
*/
|
|
714
742
|
export declare const ReviewSourceExtensionSchema: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
743
|
+
export declare const Stage4BaselineConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
744
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
745
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
746
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
747
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
748
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
749
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
750
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
751
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
752
|
+
}, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
|
|
753
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
754
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
755
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
756
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
757
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
758
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
715
759
|
export declare const ReviewConfigSchema: z.ZodDefault<z.ZodObject<{
|
|
716
760
|
sourceExtensions: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">>;
|
|
761
|
+
stage4Baseline: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
762
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
763
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
764
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
765
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
766
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
767
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
768
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
769
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
770
|
+
}, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
|
|
771
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
772
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
773
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
774
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
775
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
776
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
717
777
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
718
778
|
sourceExtensions: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">>;
|
|
779
|
+
stage4Baseline: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
780
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
781
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
782
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
783
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
784
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
785
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
786
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
787
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
788
|
+
}, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
|
|
789
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
790
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
791
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
792
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
793
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
794
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
719
795
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
720
796
|
sourceExtensions: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">>;
|
|
797
|
+
stage4Baseline: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
798
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
799
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
800
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
801
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
802
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
803
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
804
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
805
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
806
|
+
}, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
|
|
807
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
808
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
809
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
810
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
811
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
812
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
721
813
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
722
814
|
export declare const TotemConfigSchema: z.ZodObject<{
|
|
723
815
|
/** Glob patterns and chunking strategies for each ingest target */
|
|
724
816
|
targets: z.ZodArray<z.ZodObject<{
|
|
725
817
|
glob: z.ZodString;
|
|
726
818
|
type: z.ZodEnum<["code", "session_log", "spec", "lesson"]>;
|
|
727
|
-
strategy: z.
|
|
819
|
+
strategy: z.ZodString;
|
|
728
820
|
}, "strip", z.ZodTypeAny, {
|
|
729
821
|
type: "code" | "session_log" | "spec" | "lesson";
|
|
730
822
|
glob: string;
|
|
731
|
-
strategy:
|
|
823
|
+
strategy: string;
|
|
732
824
|
}, {
|
|
733
825
|
type: "code" | "session_log" | "spec" | "lesson";
|
|
734
826
|
glob: string;
|
|
735
|
-
strategy:
|
|
827
|
+
strategy: string;
|
|
736
828
|
}>, "many">;
|
|
737
829
|
/** Embedding provider configuration (optional for Lite tier) */
|
|
738
830
|
embedding: z.ZodOptional<z.ZodDiscriminatedUnion<"provider", [z.ZodObject<{
|
|
@@ -1126,6 +1218,19 @@ export declare const TotemConfigSchema: z.ZodObject<{
|
|
|
1126
1218
|
botMarkers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1127
1219
|
/** Optional: paths to other totem-managed directories whose indexes should be queried alongside this one (e.g., ['.strategy', '../docs-repo']) */
|
|
1128
1220
|
linkedIndexes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1221
|
+
/**
|
|
1222
|
+
* Optional: pack package names to extend rules from (ADR-085 + ADR-097).
|
|
1223
|
+
*
|
|
1224
|
+
* Each entry is a pack name like `@totem/pack-rust-architecture`. The
|
|
1225
|
+
* pack must also appear in the consumer's `package.json` dependencies
|
|
1226
|
+
* (or devDependencies) so npm/pnpm can resolve it. Pack-merge logic
|
|
1227
|
+
* (`packages/core/src/pack-merge.ts`) reads pack rules at lint time.
|
|
1228
|
+
* Pack discovery (`packages/core/src/pack-discovery.ts`,
|
|
1229
|
+
* mmnto-ai/totem#1768) reads this field plus the project's
|
|
1230
|
+
* package.json dependencies, deduplicates, and writes the union to
|
|
1231
|
+
* `.totem/installed-packs.json` for boot-time registration.
|
|
1232
|
+
*/
|
|
1233
|
+
extends: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1129
1234
|
/**
|
|
1130
1235
|
* Optional: path override for the strategy repository (mmnto-ai/totem#1710).
|
|
1131
1236
|
*
|
|
@@ -1216,16 +1321,64 @@ export declare const TotemConfigSchema: z.ZodObject<{
|
|
|
1216
1321
|
* additional source languages (e.g., `['.rs', '.gd']` for Rust + Godot). */
|
|
1217
1322
|
review: z.ZodDefault<z.ZodObject<{
|
|
1218
1323
|
sourceExtensions: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">>;
|
|
1324
|
+
stage4Baseline: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
1325
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1326
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1327
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1328
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1329
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1330
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1331
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1332
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1333
|
+
}, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
|
|
1334
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1335
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1336
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1337
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1338
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1339
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
1219
1340
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1220
1341
|
sourceExtensions: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">>;
|
|
1342
|
+
stage4Baseline: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
1343
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1344
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1345
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1346
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1347
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1348
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1349
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1350
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1351
|
+
}, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
|
|
1352
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1353
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1354
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1355
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1356
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1357
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
1221
1358
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1222
1359
|
sourceExtensions: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">>;
|
|
1360
|
+
stage4Baseline: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
1361
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1362
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1363
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1364
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1365
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1366
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1367
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1368
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1369
|
+
}, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
|
|
1370
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1371
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1372
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1373
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1374
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1375
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
1223
1376
|
}, z.ZodTypeAny, "passthrough">>>;
|
|
1224
1377
|
}, "strip", z.ZodTypeAny, {
|
|
1225
1378
|
targets: {
|
|
1226
1379
|
type: "code" | "session_log" | "spec" | "lesson";
|
|
1227
1380
|
glob: string;
|
|
1228
|
-
strategy:
|
|
1381
|
+
strategy: string;
|
|
1229
1382
|
}[];
|
|
1230
1383
|
totemDir: string;
|
|
1231
1384
|
lanceDir: string;
|
|
@@ -1235,6 +1388,10 @@ export declare const TotemConfigSchema: z.ZodObject<{
|
|
|
1235
1388
|
shieldAutoLearn: boolean;
|
|
1236
1389
|
review: {
|
|
1237
1390
|
sourceExtensions: string[];
|
|
1391
|
+
stage4Baseline?: z.objectOutputType<{
|
|
1392
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1393
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1394
|
+
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1238
1395
|
} & {
|
|
1239
1396
|
[k: string]: unknown;
|
|
1240
1397
|
};
|
|
@@ -1311,6 +1468,7 @@ export declare const TotemConfigSchema: z.ZodObject<{
|
|
|
1311
1468
|
repositories?: string[] | undefined;
|
|
1312
1469
|
botMarkers?: string[] | undefined;
|
|
1313
1470
|
linkedIndexes?: string[] | undefined;
|
|
1471
|
+
extends?: string[] | undefined;
|
|
1314
1472
|
strategyRoot?: string | undefined;
|
|
1315
1473
|
partitions?: Record<string, string[]> | undefined;
|
|
1316
1474
|
garbageCollection?: {
|
|
@@ -1332,7 +1490,7 @@ export declare const TotemConfigSchema: z.ZodObject<{
|
|
|
1332
1490
|
targets: {
|
|
1333
1491
|
type: "code" | "session_log" | "spec" | "lesson";
|
|
1334
1492
|
glob: string;
|
|
1335
|
-
strategy:
|
|
1493
|
+
strategy: string;
|
|
1336
1494
|
}[];
|
|
1337
1495
|
secrets?: {
|
|
1338
1496
|
value: string;
|
|
@@ -1368,6 +1526,7 @@ export declare const TotemConfigSchema: z.ZodObject<{
|
|
|
1368
1526
|
repositories?: string[] | undefined;
|
|
1369
1527
|
botMarkers?: string[] | undefined;
|
|
1370
1528
|
linkedIndexes?: string[] | undefined;
|
|
1529
|
+
extends?: string[] | undefined;
|
|
1371
1530
|
strategyRoot?: string | undefined;
|
|
1372
1531
|
partitions?: Record<string, string[]> | undefined;
|
|
1373
1532
|
shieldAutoLearn?: boolean | undefined;
|
|
@@ -1388,9 +1547,33 @@ export declare const TotemConfigSchema: z.ZodObject<{
|
|
|
1388
1547
|
} | undefined;
|
|
1389
1548
|
review?: z.objectInputType<{
|
|
1390
1549
|
sourceExtensions: z.ZodDefault<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, "many">>;
|
|
1550
|
+
stage4Baseline: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
1551
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1552
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1553
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
1554
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1555
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1556
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1557
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1558
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1559
|
+
}, z.ZodTypeAny, "passthrough">>, z.objectOutputType<{
|
|
1560
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1561
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1562
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
1563
|
+
extend: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1564
|
+
exclude: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1565
|
+
}, z.ZodTypeAny, "passthrough">>>;
|
|
1391
1566
|
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
1392
1567
|
}>;
|
|
1393
|
-
|
|
1568
|
+
/**
|
|
1569
|
+
* `ChunkStrategy` keeps the literal union of built-in strategy names for
|
|
1570
|
+
* IntelliSense on core code paths while admitting any string registered
|
|
1571
|
+
* via Pack registration callbacks at boot. The Zod schema validates the
|
|
1572
|
+
* runtime value against the registry; this type alias lives independently
|
|
1573
|
+
* so callers don't lose type safety on built-in names. Per ADR-097 § 10 +
|
|
1574
|
+
* mmnto-ai/totem#1769.
|
|
1575
|
+
*/
|
|
1576
|
+
export type ChunkStrategy = (typeof BUILTIN_CHUNK_STRATEGIES)[number] | (string & {});
|
|
1394
1577
|
export type ContentType = z.infer<typeof ContentTypeSchema>;
|
|
1395
1578
|
export type IngestTarget = z.infer<typeof IngestTargetSchema>;
|
|
1396
1579
|
export type EmbeddingProvider = z.infer<typeof EmbeddingProviderSchema>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-schema.d.ts","sourceRoot":"","sources":["../src/config-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB;;GAEG;AAEH,eAAO,MAAM,mBAAmB,
|
|
1
|
+
{"version":3,"file":"config-schema.d.ts","sourceRoot":"","sources":["../src/config-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB;;GAEG;AAEH;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,4FAM3B,CAAC;AAEX;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,mBAAmB,aAAoB,CAAC;AAErD,eAAO,MAAM,iBAAiB,sDAAoD,CAAC;AAEnF,eAAO,MAAM,kBAAkB;;;;;;;;;;;;EAI7B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;EAI/B,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;EAK/B,CAAC;AAEH,eAAO,MAAM,oBAAoB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,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAC9E,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAC9D,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AACxD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,YAAY,uEAAwE,CAAC;AAElG;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,GAAG,UAAU,CAI7D;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,WAAW,GAAG,iBAAiB,CAQvE"}
|
package/dist/config-schema.js
CHANGED
|
@@ -4,13 +4,41 @@ import { CustomSecretSchema } from './secrets.js';
|
|
|
4
4
|
/**
|
|
5
5
|
* Zod schema for totem.config.ts — lives at the root of consuming projects.
|
|
6
6
|
*/
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Built-in chunk strategy names. Exported so the literal union derived
|
|
9
|
+
* via `typeof BUILTIN_CHUNK_STRATEGIES[number]` keeps the runtime list
|
|
10
|
+
* and the type signature in sync with a single source of truth. Pack-
|
|
11
|
+
* contributed strategies extend `ChunkStrategy` via the `(string & {})`
|
|
12
|
+
* tail and register at boot through `chunker-registry.ts`.
|
|
13
|
+
*/
|
|
14
|
+
export const BUILTIN_CHUNK_STRATEGIES = [
|
|
8
15
|
'typescript-ast',
|
|
9
16
|
'markdown-heading',
|
|
10
17
|
'session-log',
|
|
11
18
|
'schema-file',
|
|
12
19
|
'test-file',
|
|
13
|
-
]
|
|
20
|
+
];
|
|
21
|
+
/**
|
|
22
|
+
* `ChunkStrategy` schema. Per ADR-097 § 10 + mmnto-ai/totem#1769 strategy
|
|
23
|
+
* lookup goes through `chunker-registry.ts` at runtime; this schema only
|
|
24
|
+
* shape-checks the input string.
|
|
25
|
+
*
|
|
26
|
+
* **Why not refine against the registry here?** Bootstrap chicken-and-egg
|
|
27
|
+
* (Gemini review of mmnto-ai/totem#1768 PR-A): config parse runs BEFORE
|
|
28
|
+
* `loadInstalledPacks()` populates the registry with pack-contributed
|
|
29
|
+
* strategies (the manifest is read AFTER config load by every command).
|
|
30
|
+
* A strict registry-check at parse time would crash `totem sync` on the
|
|
31
|
+
* very edit that adds the pack — user adds `@totem/pack-foo` to extends
|
|
32
|
+
* AND a target with `strategy: 'foo-strat'` in the same change, sync
|
|
33
|
+
* fails to parse the config, never writes installed-packs.json, never
|
|
34
|
+
* registers the pack. Forever stuck.
|
|
35
|
+
*
|
|
36
|
+
* The actual fail-loud happens at `createChunker(strategy)` in
|
|
37
|
+
* `chunkers/chunker.ts` — runtime lookup against the post-boot registry
|
|
38
|
+
* with a structured error naming the missing strategy. That's the right
|
|
39
|
+
* boundary because by then the registry IS populated.
|
|
40
|
+
*/
|
|
41
|
+
export const ChunkStrategySchema = z.string().min(1);
|
|
14
42
|
export const ContentTypeSchema = z.enum(['code', 'session_log', 'spec', 'lesson']);
|
|
15
43
|
export const IngestTargetSchema = z.object({
|
|
16
44
|
glob: z.string(),
|
|
@@ -192,12 +220,56 @@ export const ReviewSourceExtensionSchema = z
|
|
|
192
220
|
.string()
|
|
193
221
|
.transform((s) => (s.startsWith('.') ? s : '.' + s))
|
|
194
222
|
.refine((s) => /^\.[a-z0-9][a-z0-9.-]*$/i.test(s), 'must match /\\.[A-Za-z0-9.-]+/ after normalization');
|
|
223
|
+
/**
|
|
224
|
+
* Stage 4 verification baseline overrides (mmnto-ai/totem#1683).
|
|
225
|
+
*
|
|
226
|
+
* `extend` adds globs to the default baseline; `exclude` removes them. Both
|
|
227
|
+
* default to `[]`. Naming discipline (per the GCA finding logged in ADR-091
|
|
228
|
+
* Deferred Decisions): no `allowlist` aliases. The schema explicitly rejects
|
|
229
|
+
* an `allowlist` key with a pointer to mmnto-ai/totem#1683 so a future
|
|
230
|
+
* regression surfaces at config-parse time, not in a silent passthrough.
|
|
231
|
+
*/
|
|
232
|
+
const STAGE4_BASELINE_KNOWN_KEYS = new Set(['extend', 'exclude']);
|
|
233
|
+
export const Stage4BaselineConfigSchema = z
|
|
234
|
+
.object({
|
|
235
|
+
extend: z.array(z.string()).default([]),
|
|
236
|
+
exclude: z.array(z.string()).default([]),
|
|
237
|
+
})
|
|
238
|
+
.passthrough()
|
|
239
|
+
.superRefine((data, ctx) => {
|
|
240
|
+
const raw = data;
|
|
241
|
+
// Naming-discipline guard: the `allowlist` key gets a custom error
|
|
242
|
+
// message that points at mmnto-ai/totem#1683 so a future regression
|
|
243
|
+
// surfaces with the right rationale at config-parse time.
|
|
244
|
+
if ('allowlist' in raw) {
|
|
245
|
+
ctx.addIssue({
|
|
246
|
+
code: z.ZodIssueCode.custom,
|
|
247
|
+
message: "Use 'baseline' framing (extend / exclude) — 'allowlist' is rejected per mmnto-ai/totem#1683 naming discipline.",
|
|
248
|
+
path: ['allowlist'],
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
// Reject other unknown keys (e.g. typos like `exlcude`/`extends`) at
|
|
252
|
+
// parse time rather than letting them silently passthrough and become
|
|
253
|
+
// load-bearing-but-ignored config (CR mmnto-ai/totem#1766 R1).
|
|
254
|
+
for (const key of Object.keys(raw)) {
|
|
255
|
+
if (key === 'allowlist')
|
|
256
|
+
continue; // handled above with a custom message
|
|
257
|
+
if (!STAGE4_BASELINE_KNOWN_KEYS.has(key)) {
|
|
258
|
+
ctx.addIssue({
|
|
259
|
+
code: z.ZodIssueCode.unrecognized_keys,
|
|
260
|
+
keys: [key],
|
|
261
|
+
path: [],
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
});
|
|
195
266
|
export const ReviewConfigSchema = z
|
|
196
267
|
.object({
|
|
197
268
|
sourceExtensions: z
|
|
198
269
|
.array(ReviewSourceExtensionSchema)
|
|
199
270
|
.min(1, 'review.sourceExtensions must contain at least one extension')
|
|
200
271
|
.default([...DEFAULT_REVIEW_SOURCE_EXTENSIONS]),
|
|
272
|
+
stage4Baseline: Stage4BaselineConfigSchema.optional(),
|
|
201
273
|
})
|
|
202
274
|
.passthrough()
|
|
203
275
|
.default({});
|
|
@@ -234,6 +306,19 @@ export const TotemConfigSchema = z.object({
|
|
|
234
306
|
botMarkers: z.array(z.string()).optional(),
|
|
235
307
|
/** Optional: paths to other totem-managed directories whose indexes should be queried alongside this one (e.g., ['.strategy', '../docs-repo']) */
|
|
236
308
|
linkedIndexes: z.array(z.string()).optional(),
|
|
309
|
+
/**
|
|
310
|
+
* Optional: pack package names to extend rules from (ADR-085 + ADR-097).
|
|
311
|
+
*
|
|
312
|
+
* Each entry is a pack name like `@totem/pack-rust-architecture`. The
|
|
313
|
+
* pack must also appear in the consumer's `package.json` dependencies
|
|
314
|
+
* (or devDependencies) so npm/pnpm can resolve it. Pack-merge logic
|
|
315
|
+
* (`packages/core/src/pack-merge.ts`) reads pack rules at lint time.
|
|
316
|
+
* Pack discovery (`packages/core/src/pack-discovery.ts`,
|
|
317
|
+
* mmnto-ai/totem#1768) reads this field plus the project's
|
|
318
|
+
* package.json dependencies, deduplicates, and writes the union to
|
|
319
|
+
* `.totem/installed-packs.json` for boot-time registration.
|
|
320
|
+
*/
|
|
321
|
+
extends: z.array(z.string().min(1)).optional(),
|
|
237
322
|
/**
|
|
238
323
|
* Optional: path override for the strategy repository (mmnto-ai/totem#1710).
|
|
239
324
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-schema.js","sourceRoot":"","sources":["../src/config-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD;;GAEG;AAEH,MAAM,CAAC,MAAM,
|
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CAAC;IAC5C,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAmB;IAClD,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;QACtB,MAAM,IAAI,gBAAgB,CACxB,qGAAqG,EACrG,4EAA4E,CAC7E,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC,SAAS,CAAC;AAC1B,CAAC"}
|
|
@@ -582,6 +582,128 @@ describe('review.sourceExtensions', () => {
|
|
|
582
582
|
}
|
|
583
583
|
});
|
|
584
584
|
});
|
|
585
|
+
// ─── review.stage4Baseline (mmnto-ai/totem#1683) ────
|
|
586
|
+
describe('review.stage4Baseline', () => {
|
|
587
|
+
it('validates extend and exclude as arrays of strings (happy path)', () => {
|
|
588
|
+
const result = TotemConfigSchema.safeParse({
|
|
589
|
+
targets: BASE_TARGETS,
|
|
590
|
+
review: {
|
|
591
|
+
stage4Baseline: {
|
|
592
|
+
extend: ['**/legacy/**', 'tools/scripts/**'],
|
|
593
|
+
exclude: ['**/tests/**'],
|
|
594
|
+
},
|
|
595
|
+
},
|
|
596
|
+
});
|
|
597
|
+
expect(result.success).toBe(true);
|
|
598
|
+
if (result.success) {
|
|
599
|
+
expect(result.data.review.stage4Baseline).toEqual({
|
|
600
|
+
extend: ['**/legacy/**', 'tools/scripts/**'],
|
|
601
|
+
exclude: ['**/tests/**'],
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
});
|
|
605
|
+
it('defaults extend and exclude to empty arrays when stage4Baseline is empty object', () => {
|
|
606
|
+
const result = TotemConfigSchema.safeParse({
|
|
607
|
+
targets: BASE_TARGETS,
|
|
608
|
+
review: { stage4Baseline: {} },
|
|
609
|
+
});
|
|
610
|
+
expect(result.success).toBe(true);
|
|
611
|
+
if (result.success) {
|
|
612
|
+
expect(result.data.review.stage4Baseline).toEqual({ extend: [], exclude: [] });
|
|
613
|
+
}
|
|
614
|
+
});
|
|
615
|
+
it('omits stage4Baseline from parsed config when not provided', () => {
|
|
616
|
+
const result = TotemConfigSchema.safeParse({
|
|
617
|
+
targets: BASE_TARGETS,
|
|
618
|
+
review: {},
|
|
619
|
+
});
|
|
620
|
+
expect(result.success).toBe(true);
|
|
621
|
+
if (result.success) {
|
|
622
|
+
expect(result.data.review.stage4Baseline).toBeUndefined();
|
|
623
|
+
}
|
|
624
|
+
});
|
|
625
|
+
it('rejects allowlist key under stage4Baseline (naming-discipline guard, mmnto-ai/totem#1683)', () => {
|
|
626
|
+
const result = TotemConfigSchema.safeParse({
|
|
627
|
+
targets: BASE_TARGETS,
|
|
628
|
+
review: {
|
|
629
|
+
stage4Baseline: {
|
|
630
|
+
allowlist: ['**/legacy/**'],
|
|
631
|
+
},
|
|
632
|
+
},
|
|
633
|
+
});
|
|
634
|
+
expect(result.success).toBe(false);
|
|
635
|
+
if (!result.success) {
|
|
636
|
+
const messages = result.error.issues.map((i) => i.message).join('\n');
|
|
637
|
+
expect(messages).toMatch(/baseline/);
|
|
638
|
+
expect(messages).toMatch(/1683/);
|
|
639
|
+
}
|
|
640
|
+
});
|
|
641
|
+
it('rejects allowlist key even when extend is also present', () => {
|
|
642
|
+
const result = TotemConfigSchema.safeParse({
|
|
643
|
+
targets: BASE_TARGETS,
|
|
644
|
+
review: {
|
|
645
|
+
stage4Baseline: {
|
|
646
|
+
extend: ['**/foo/**'],
|
|
647
|
+
allowlist: ['**/legacy/**'],
|
|
648
|
+
},
|
|
649
|
+
},
|
|
650
|
+
});
|
|
651
|
+
expect(result.success).toBe(false);
|
|
652
|
+
});
|
|
653
|
+
it('rejects extend with non-string elements', () => {
|
|
654
|
+
const result = TotemConfigSchema.safeParse({
|
|
655
|
+
targets: BASE_TARGETS,
|
|
656
|
+
review: {
|
|
657
|
+
stage4Baseline: { extend: [42, '**/foo/**'] },
|
|
658
|
+
},
|
|
659
|
+
});
|
|
660
|
+
expect(result.success).toBe(false);
|
|
661
|
+
});
|
|
662
|
+
it('rejects exclude with non-string elements', () => {
|
|
663
|
+
const result = TotemConfigSchema.safeParse({
|
|
664
|
+
targets: BASE_TARGETS,
|
|
665
|
+
review: {
|
|
666
|
+
stage4Baseline: { exclude: [{ glob: '**/foo/**' }] },
|
|
667
|
+
},
|
|
668
|
+
});
|
|
669
|
+
expect(result.success).toBe(false);
|
|
670
|
+
});
|
|
671
|
+
it('rejects unknown keys like typos (CR mmnto-ai/totem#1766 R1)', () => {
|
|
672
|
+
// `exlcude` (transposed) silently passed through under the original
|
|
673
|
+
// `.passthrough()` schema; now caught at parse time so misconfiguration
|
|
674
|
+
// surfaces immediately instead of becoming load-bearing-but-ignored.
|
|
675
|
+
const result = TotemConfigSchema.safeParse({
|
|
676
|
+
targets: BASE_TARGETS,
|
|
677
|
+
review: {
|
|
678
|
+
stage4Baseline: { exlcude: ['**/foo/**'] },
|
|
679
|
+
},
|
|
680
|
+
});
|
|
681
|
+
expect(result.success).toBe(false);
|
|
682
|
+
});
|
|
683
|
+
it('rejects unknown keys like extends/excludes plurals (CR mmnto-ai/totem#1766 R1)', () => {
|
|
684
|
+
const result = TotemConfigSchema.safeParse({
|
|
685
|
+
targets: BASE_TARGETS,
|
|
686
|
+
review: {
|
|
687
|
+
stage4Baseline: { extends: ['**/foo/**'], excludes: ['**/bar/**'] },
|
|
688
|
+
},
|
|
689
|
+
});
|
|
690
|
+
expect(result.success).toBe(false);
|
|
691
|
+
});
|
|
692
|
+
it('continues to reject allowlist with the naming-discipline message even alongside unknown keys', () => {
|
|
693
|
+
const result = TotemConfigSchema.safeParse({
|
|
694
|
+
targets: BASE_TARGETS,
|
|
695
|
+
review: {
|
|
696
|
+
stage4Baseline: { allowlist: ['**/foo/**'], typo: ['**/bar/**'] },
|
|
697
|
+
},
|
|
698
|
+
});
|
|
699
|
+
expect(result.success).toBe(false);
|
|
700
|
+
if (!result.success) {
|
|
701
|
+
const messages = result.error.issues.map((i) => i.message).join('\n');
|
|
702
|
+
expect(messages).toMatch(/baseline/);
|
|
703
|
+
expect(messages).toMatch(/1683/);
|
|
704
|
+
}
|
|
705
|
+
});
|
|
706
|
+
});
|
|
585
707
|
describe('GarbageCollectionSchema', () => {
|
|
586
708
|
it('rejects garbage collection config with negative minAgeDays', () => {
|
|
587
709
|
const result = GarbageCollectionSchema.safeParse({ minAgeDays: -1 });
|