@contractspec/example.versioned-knowledge-base 3.7.5 → 3.7.7

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.
@@ -3,7 +3,7 @@ $ bun run prebuild && bun run build:bundle && bun run build:types
3
3
  $ contractspec-bun-build prebuild
4
4
  $ contractspec-bun-build transpile
5
5
  [contractspec-bun-build] transpile target=bun root=src entries=12 noBundle=false
6
- Bundled 12 modules in 32ms
6
+ Bundled 12 modules in 36ms
7
7
 
8
8
  docs/index.js 1.51 KB (entry point)
9
9
  ./index.js 20.31 KB (entry point)
@@ -19,7 +19,7 @@ Bundled 12 modules in 32ms
19
19
  handlers/memory.handlers.js 3.56 KB (entry point)
20
20
 
21
21
  [contractspec-bun-build] transpile target=node root=src entries=12 noBundle=false
22
- Bundled 12 modules in 23ms
22
+ Bundled 12 modules in 27ms
23
23
 
24
24
  docs/index.js 1.50 KB (entry point)
25
25
  ./index.js 20.30 KB (entry point)
@@ -35,7 +35,7 @@ Bundled 12 modules in 23ms
35
35
  handlers/memory.handlers.js 3.55 KB (entry point)
36
36
 
37
37
  [contractspec-bun-build] transpile target=browser root=src entries=12 noBundle=false
38
- Bundled 12 modules in 32ms
38
+ Bundled 12 modules in 27ms
39
39
 
40
40
  docs/index.js 1.50 KB (entry point)
41
41
  ./index.js 20.30 KB (entry point)
package/AGENTS.md CHANGED
@@ -1,35 +1,59 @@
1
- # AI Agent Guide -- `@contractspec/example.versioned-knowledge-base`
1
+ # AI Agent Guide `@contractspec/example.versioned-knowledge-base`
2
2
 
3
3
  Scope: `packages/examples/versioned-knowledge-base/*`
4
4
 
5
- Curated, versioned knowledge base with immutable sources, rule versions, and published snapshots.
5
+ Example: curated, versioned knowledge base with immutable sources, rule versions, and published snapshots.
6
6
 
7
7
  ## Quick Context
8
8
 
9
- - **Layer**: example
10
- - **Related Packages**: `lib.contracts-spec`, `lib.schema`
11
-
12
- ## What This Demonstrates
13
-
14
- - Immutable source and versioned rule management
15
- - Snapshot publishing pattern
16
- - Entity models for KB domain
17
- - Memory-based handler implementation
18
- - Feature definition and event-driven architecture
19
-
20
- ## Public Exports
21
-
22
- - `.` -- root barrel
23
- - `./entities` -- models
24
- - `./operations` -- KB operations
25
- - `./handlers` -- memory handlers
26
- - `./events` -- KB lifecycle events
27
- - `./versioned-knowledge-base.feature` -- feature definition
28
- - `./docs`, `./example`
9
+ - Layer: `example`.
10
+ - Package visibility: published package.
11
+ - Primary consumers are example explorers, template authors, and documentation readers.
12
+ - Related packages: `@contractspec/lib.contracts-spec`, `@contractspec/lib.schema`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
13
+
14
+ ## Architecture
15
+
16
+ - `src/docs/` contains docblocks and documentation-facing exports.
17
+ - `src/entities/` contains domain entities and value objects.
18
+ - `src/events.ts` is package-level event definitions.
19
+ - `src/example.ts` is the runnable example entrypoint.
20
+ - `src/handlers/` contains handlers or demo adapters wired to contract surfaces.
21
+ - `src/index.ts` is the root public barrel and package entrypoint.
22
+ - `src/operations` is part of the package's public or composition surface.
23
+
24
+ ## Public Surface
25
+
26
+ - Export `.` resolves through `./src/index.ts`.
27
+ - Export `./docs` resolves through `./src/docs/index.ts`.
28
+ - Export `./docs/versioned-knowledge-base.docblock` resolves through `./src/docs/versioned-knowledge-base.docblock.ts`.
29
+ - Export `./entities` resolves through `./src/entities/index.ts`.
30
+ - Export `./entities/models` resolves through `./src/entities/models.ts`.
31
+ - Export `./events` resolves through `./src/events.ts`.
32
+ - Export `./example` resolves through `./src/example.ts`.
33
+ - Export `./handlers` resolves through `./src/handlers/index.ts`.
34
+ - Export `./handlers/memory.handlers` resolves through `./src/handlers/memory.handlers.ts`.
35
+ - Export `./operations` resolves through `./src/operations/index.ts`.
36
+ - The package publishes 12 total export subpaths; keep docs aligned with `package.json`.
37
+
38
+ ## Guardrails
39
+
40
+ - Keep the example package demonstrative, buildable, and aligned with the exported feature surface.
41
+ - Do not add hidden production assumptions that are not actually implemented in the example.
42
+ - Changes here can affect downstream packages such as `@contractspec/lib.contracts-spec`, `@contractspec/lib.schema`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
43
+ - Changes here can affect downstream packages such as `@contractspec/lib.contracts-spec`, `@contractspec/lib.schema`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
29
44
 
30
45
  ## Local Commands
31
46
 
32
- - Build: `bun run build`
33
- - Dev: `bun run dev`
34
- - Test: `bun test`
35
- - Typecheck: `bun run typecheck`
47
+ - `bun run dev` — contractspec-bun-build dev
48
+ - `bun run build`bun run prebuild && bun run build:bundle && bun run build:types
49
+ - `bun run test`bun test
50
+ - `bun run lint` — bun lint:fix
51
+ - `bun run lint:check` — biome check .
52
+ - `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
53
+ - `bun run typecheck` — tsc --noEmit
54
+ - `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
55
+ - `bun run publish:pkg:canary` — bun publish:pkg --tag canary
56
+ - `bun run clean` — rimraf dist .turbo
57
+ - `bun run build:bundle` — contractspec-bun-build transpile
58
+ - `bun run build:types` — contractspec-bun-build types
59
+ - `bun run prebuild` — contractspec-bun-build prebuild
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @contractspec/example.versioned-knowledge-base
2
2
 
3
+ ## 3.7.6
4
+
5
+ ### Patch Changes
6
+
7
+ - fix: release manifest
8
+ - Updated dependencies
9
+ - @contractspec/lib.contracts-spec@3.7.6
10
+ - @contractspec/lib.schema@3.7.6
11
+
3
12
  ## 3.7.5
4
13
 
5
14
  ### Patch Changes
package/README.md CHANGED
@@ -1,35 +1,75 @@
1
- # `@contractspec/example.versioned-knowledge-base`
1
+ # @contractspec/example.versioned-knowledge-base
2
2
 
3
- Website: https://contractspec.io/
3
+ Website: https://contractspec.io
4
4
 
5
+ **Example: curated, versioned knowledge base with immutable sources, rule versions, and published snapshots.**
5
6
 
6
- Spec-first example demonstrating a **curated, versioned knowledge base**:
7
+ ## What This Demonstrates
7
8
 
8
- - Raw **source documents** are immutable and referenced by hash.
9
- - Curated **rules** are versioned, reviewable, and must cite sources.
10
- - Published **KB snapshots** contain only **approved** rule versions.
11
- - Assistant answers reference a **snapshot id** for traceability.
9
+ - Immutable source and versioned rule management.
10
+ - Snapshot publishing pattern.
11
+ - Entity models for KB domain.
12
+ - Memory-based handler implementation.
13
+ - Feature definition and event-driven architecture.
14
+ - `src/docs/` contains docblocks and documentation-facing exports.
12
15
 
13
- ## Contracts
16
+ ## Running Locally
14
17
 
15
- - `kb.ingestSource(docMeta, fileRef) -> SourceDocument`
16
- - `kb.upsertRuleVersion(ruleId, content, sourceRefs) -> RuleVersion (draft)`
17
- - `kb.approveRuleVersion(ruleVersionId, approver) -> RuleVersion (approved)`
18
- - `kb.publishSnapshot(jurisdiction, asOfDate) -> KBSnapshot`
19
- - `kb.search(snapshotId, query) -> results (ruleVersionIds + citations)`
18
+ From `packages/examples/versioned-knowledge-base`:
19
+ - `bun run dev`
20
+ - `bun run build`
21
+ - `bun run test`
22
+ - `bun run typecheck`
20
23
 
21
- ## Running tests
24
+ ## Usage
22
25
 
23
- ```bash
24
- bun test
25
- ```
26
+ Use `@contractspec/example.versioned-knowledge-base` as a reference implementation, or import its exported surfaces into a workspace that composes ContractSpec examples and bundles.
26
27
 
28
+ ## Architecture
27
29
 
30
+ - `src/docs/` contains docblocks and documentation-facing exports.
31
+ - `src/entities/` contains domain entities and value objects.
32
+ - `src/events.ts` is package-level event definitions.
33
+ - `src/example.ts` is the runnable example entrypoint.
34
+ - `src/handlers/` contains handlers or demo adapters wired to contract surfaces.
35
+ - `src/index.ts` is the root public barrel and package entrypoint.
36
+ - `src/operations` is part of the package's public or composition surface.
28
37
 
38
+ ## Public Entry Points
29
39
 
40
+ - Export `.` resolves through `./src/index.ts`.
41
+ - Export `./docs` resolves through `./src/docs/index.ts`.
42
+ - Export `./docs/versioned-knowledge-base.docblock` resolves through `./src/docs/versioned-knowledge-base.docblock.ts`.
43
+ - Export `./entities` resolves through `./src/entities/index.ts`.
44
+ - Export `./entities/models` resolves through `./src/entities/models.ts`.
45
+ - Export `./events` resolves through `./src/events.ts`.
46
+ - Export `./example` resolves through `./src/example.ts`.
47
+ - Export `./handlers` resolves through `./src/handlers/index.ts`.
48
+ - Export `./handlers/memory.handlers` resolves through `./src/handlers/memory.handlers.ts`.
49
+ - Export `./operations` resolves through `./src/operations/index.ts`.
50
+ - The package publishes 12 total export subpaths; keep docs aligned with `package.json`.
30
51
 
52
+ ## Local Commands
31
53
 
54
+ - `bun run dev` — contractspec-bun-build dev
55
+ - `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
56
+ - `bun run test` — bun test
57
+ - `bun run lint` — bun lint:fix
58
+ - `bun run lint:check` — biome check .
59
+ - `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
60
+ - `bun run typecheck` — tsc --noEmit
61
+ - `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
62
+ - `bun run publish:pkg:canary` — bun publish:pkg --tag canary
63
+ - `bun run clean` — rimraf dist .turbo
64
+ - `bun run build:bundle` — contractspec-bun-build transpile
65
+ - `bun run build:types` — contractspec-bun-build types
66
+ - `bun run prebuild` — contractspec-bun-build prebuild
32
67
 
68
+ ## Recent Updates
33
69
 
70
+ - Replace eslint+prettier by biomejs to optimize speed.
71
+ - Missing contract layers.
34
72
 
73
+ ## Notes
35
74
 
75
+ - Works alongside `@contractspec/lib.contracts-spec`, `@contractspec/lib.schema`, `@contractspec/tool.bun`, `@contractspec/tool.typescript`.
@@ -1,5 +1,5 @@
1
1
  // src/entities/models.ts
2
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
2
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
3
3
  var SourceDocumentModel = defineSchemaModel({
4
4
  name: "SourceDocument",
5
5
  description: "Immutable raw source document metadata referencing a stored file.",
@@ -1,5 +1,5 @@
1
1
  // src/entities/models.ts
2
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
2
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
3
3
  var SourceDocumentModel = defineSchemaModel({
4
4
  name: "SourceDocument",
5
5
  description: "Immutable raw source document metadata referencing a stored file.",
@@ -1,6 +1,6 @@
1
1
  // src/events.ts
2
2
  import { defineEvent } from "@contractspec/lib.contracts-spec";
3
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
3
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
4
4
  var KbSourceIngestedPayload = defineSchemaModel({
5
5
  name: "KbSourceIngestedPayload",
6
6
  description: "Emitted when a source document is ingested.",
@@ -43,7 +43,7 @@ var docBlocks = [
43
43
  ];
44
44
  registerDocBlocks(docBlocks);
45
45
  // src/entities/models.ts
46
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
46
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
47
47
  var SourceDocumentModel = defineSchemaModel({
48
48
  name: "SourceDocument",
49
49
  description: "Immutable raw source document metadata referencing a stored file.",
@@ -111,7 +111,7 @@ var KBSnapshotModel = defineSchemaModel({
111
111
  });
112
112
  // src/events.ts
113
113
  import { defineEvent } from "@contractspec/lib.contracts-spec";
114
- import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
114
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
115
115
  var KbSourceIngestedPayload = defineSchemaModel2({
116
116
  name: "KbSourceIngestedPayload",
117
117
  description: "Emitted when a source document is ingested.",
@@ -351,7 +351,7 @@ function createMemoryKbHandlers(store) {
351
351
  }
352
352
  // src/operations/kb.ts
353
353
  import { defineCommand, defineQuery } from "@contractspec/lib.contracts-spec";
354
- import { ScalarTypeEnum as ScalarTypeEnum3, defineSchemaModel as defineSchemaModel3 } from "@contractspec/lib.schema";
354
+ import { defineSchemaModel as defineSchemaModel3, ScalarTypeEnum as ScalarTypeEnum3 } from "@contractspec/lib.schema";
355
355
  var IngestSourceInput = defineSchemaModel3({
356
356
  name: "KbIngestSourceInput",
357
357
  description: "Ingest immutable source metadata referencing a stored file.",
@@ -1,5 +1,5 @@
1
1
  // src/entities/models.ts
2
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
2
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
3
3
  var SourceDocumentModel = defineSchemaModel({
4
4
  name: "SourceDocument",
5
5
  description: "Immutable raw source document metadata referencing a stored file.",
@@ -68,7 +68,7 @@ var KBSnapshotModel = defineSchemaModel({
68
68
 
69
69
  // src/operations/kb.ts
70
70
  import { defineCommand, defineQuery } from "@contractspec/lib.contracts-spec";
71
- import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
71
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
72
72
  var IngestSourceInput = defineSchemaModel2({
73
73
  name: "KbIngestSourceInput",
74
74
  description: "Ingest immutable source metadata referencing a stored file.",
@@ -1,5 +1,5 @@
1
1
  // src/entities/models.ts
2
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
2
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
3
3
  var SourceDocumentModel = defineSchemaModel({
4
4
  name: "SourceDocument",
5
5
  description: "Immutable raw source document metadata referencing a stored file.",
@@ -68,7 +68,7 @@ var KBSnapshotModel = defineSchemaModel({
68
68
 
69
69
  // src/operations/kb.ts
70
70
  import { defineCommand, defineQuery } from "@contractspec/lib.contracts-spec";
71
- import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
71
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
72
72
  var IngestSourceInput = defineSchemaModel2({
73
73
  name: "KbIngestSourceInput",
74
74
  description: "Ingest immutable source metadata referencing a stored file.",
@@ -1,6 +1,6 @@
1
1
  // @bun
2
2
  // src/entities/models.ts
3
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
3
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
4
4
  var SourceDocumentModel = defineSchemaModel({
5
5
  name: "SourceDocument",
6
6
  description: "Immutable raw source document metadata referencing a stored file.",
@@ -1,6 +1,6 @@
1
1
  // @bun
2
2
  // src/entities/models.ts
3
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
3
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
4
4
  var SourceDocumentModel = defineSchemaModel({
5
5
  name: "SourceDocument",
6
6
  description: "Immutable raw source document metadata referencing a stored file.",
package/dist/events.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  // src/events.ts
3
3
  import { defineEvent } from "@contractspec/lib.contracts-spec";
4
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
4
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
5
5
  var KbSourceIngestedPayload = defineSchemaModel({
6
6
  name: "KbSourceIngestedPayload",
7
7
  description: "Emitted when a source document is ingested.",
package/dist/index.d.ts CHANGED
@@ -4,9 +4,9 @@
4
4
  * Curated KB with immutable sources, reviewable rule versions, and published snapshots.
5
5
  */
6
6
  export * from './entities';
7
- export * from './operations';
8
7
  export * from './events';
8
+ export { default as example } from './example';
9
9
  export * from './handlers';
10
+ export * from './operations';
10
11
  export * from './versioned-knowledge-base.feature';
11
- export { default as example } from './example';
12
12
  import './docs';
package/dist/index.js CHANGED
@@ -44,7 +44,7 @@ var docBlocks = [
44
44
  ];
45
45
  registerDocBlocks(docBlocks);
46
46
  // src/entities/models.ts
47
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
47
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
48
48
  var SourceDocumentModel = defineSchemaModel({
49
49
  name: "SourceDocument",
50
50
  description: "Immutable raw source document metadata referencing a stored file.",
@@ -112,7 +112,7 @@ var KBSnapshotModel = defineSchemaModel({
112
112
  });
113
113
  // src/events.ts
114
114
  import { defineEvent } from "@contractspec/lib.contracts-spec";
115
- import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
115
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
116
116
  var KbSourceIngestedPayload = defineSchemaModel2({
117
117
  name: "KbSourceIngestedPayload",
118
118
  description: "Emitted when a source document is ingested.",
@@ -352,7 +352,7 @@ function createMemoryKbHandlers(store) {
352
352
  }
353
353
  // src/operations/kb.ts
354
354
  import { defineCommand, defineQuery } from "@contractspec/lib.contracts-spec";
355
- import { ScalarTypeEnum as ScalarTypeEnum3, defineSchemaModel as defineSchemaModel3 } from "@contractspec/lib.schema";
355
+ import { defineSchemaModel as defineSchemaModel3, ScalarTypeEnum as ScalarTypeEnum3 } from "@contractspec/lib.schema";
356
356
  var IngestSourceInput = defineSchemaModel3({
357
357
  name: "KbIngestSourceInput",
358
358
  description: "Ingest immutable source metadata referencing a stored file.",
@@ -1,5 +1,5 @@
1
1
  // src/entities/models.ts
2
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
2
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
3
3
  var SourceDocumentModel = defineSchemaModel({
4
4
  name: "SourceDocument",
5
5
  description: "Immutable raw source document metadata referencing a stored file.",
@@ -1,5 +1,5 @@
1
1
  // src/entities/models.ts
2
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
2
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
3
3
  var SourceDocumentModel = defineSchemaModel({
4
4
  name: "SourceDocument",
5
5
  description: "Immutable raw source document metadata referencing a stored file.",
@@ -1,6 +1,6 @@
1
1
  // src/events.ts
2
2
  import { defineEvent } from "@contractspec/lib.contracts-spec";
3
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
3
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
4
4
  var KbSourceIngestedPayload = defineSchemaModel({
5
5
  name: "KbSourceIngestedPayload",
6
6
  description: "Emitted when a source document is ingested.",
@@ -43,7 +43,7 @@ var docBlocks = [
43
43
  ];
44
44
  registerDocBlocks(docBlocks);
45
45
  // src/entities/models.ts
46
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
46
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
47
47
  var SourceDocumentModel = defineSchemaModel({
48
48
  name: "SourceDocument",
49
49
  description: "Immutable raw source document metadata referencing a stored file.",
@@ -111,7 +111,7 @@ var KBSnapshotModel = defineSchemaModel({
111
111
  });
112
112
  // src/events.ts
113
113
  import { defineEvent } from "@contractspec/lib.contracts-spec";
114
- import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
114
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
115
115
  var KbSourceIngestedPayload = defineSchemaModel2({
116
116
  name: "KbSourceIngestedPayload",
117
117
  description: "Emitted when a source document is ingested.",
@@ -351,7 +351,7 @@ function createMemoryKbHandlers(store) {
351
351
  }
352
352
  // src/operations/kb.ts
353
353
  import { defineCommand, defineQuery } from "@contractspec/lib.contracts-spec";
354
- import { ScalarTypeEnum as ScalarTypeEnum3, defineSchemaModel as defineSchemaModel3 } from "@contractspec/lib.schema";
354
+ import { defineSchemaModel as defineSchemaModel3, ScalarTypeEnum as ScalarTypeEnum3 } from "@contractspec/lib.schema";
355
355
  var IngestSourceInput = defineSchemaModel3({
356
356
  name: "KbIngestSourceInput",
357
357
  description: "Ingest immutable source metadata referencing a stored file.",
@@ -1,5 +1,5 @@
1
1
  // src/entities/models.ts
2
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
2
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
3
3
  var SourceDocumentModel = defineSchemaModel({
4
4
  name: "SourceDocument",
5
5
  description: "Immutable raw source document metadata referencing a stored file.",
@@ -68,7 +68,7 @@ var KBSnapshotModel = defineSchemaModel({
68
68
 
69
69
  // src/operations/kb.ts
70
70
  import { defineCommand, defineQuery } from "@contractspec/lib.contracts-spec";
71
- import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
71
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
72
72
  var IngestSourceInput = defineSchemaModel2({
73
73
  name: "KbIngestSourceInput",
74
74
  description: "Ingest immutable source metadata referencing a stored file.",
@@ -1,5 +1,5 @@
1
1
  // src/entities/models.ts
2
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
2
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
3
3
  var SourceDocumentModel = defineSchemaModel({
4
4
  name: "SourceDocument",
5
5
  description: "Immutable raw source document metadata referencing a stored file.",
@@ -68,7 +68,7 @@ var KBSnapshotModel = defineSchemaModel({
68
68
 
69
69
  // src/operations/kb.ts
70
70
  import { defineCommand, defineQuery } from "@contractspec/lib.contracts-spec";
71
- import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
71
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
72
72
  var IngestSourceInput = defineSchemaModel2({
73
73
  name: "KbIngestSourceInput",
74
74
  description: "Ingest immutable source metadata referencing a stored file.",
@@ -1,6 +1,6 @@
1
1
  // @bun
2
2
  // src/entities/models.ts
3
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
3
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
4
4
  var SourceDocumentModel = defineSchemaModel({
5
5
  name: "SourceDocument",
6
6
  description: "Immutable raw source document metadata referencing a stored file.",
@@ -69,7 +69,7 @@ var KBSnapshotModel = defineSchemaModel({
69
69
 
70
70
  // src/operations/kb.ts
71
71
  import { defineCommand, defineQuery } from "@contractspec/lib.contracts-spec";
72
- import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
72
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
73
73
  var IngestSourceInput = defineSchemaModel2({
74
74
  name: "KbIngestSourceInput",
75
75
  description: "Ingest immutable source metadata referencing a stored file.",
@@ -1,6 +1,6 @@
1
1
  // @bun
2
2
  // src/entities/models.ts
3
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
3
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
4
4
  var SourceDocumentModel = defineSchemaModel({
5
5
  name: "SourceDocument",
6
6
  description: "Immutable raw source document metadata referencing a stored file.",
@@ -69,7 +69,7 @@ var KBSnapshotModel = defineSchemaModel({
69
69
 
70
70
  // src/operations/kb.ts
71
71
  import { defineCommand, defineQuery } from "@contractspec/lib.contracts-spec";
72
- import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
72
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
73
73
  var IngestSourceInput = defineSchemaModel2({
74
74
  name: "KbIngestSourceInput",
75
75
  description: "Ingest immutable source metadata referencing a stored file.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/example.versioned-knowledge-base",
3
- "version": "3.7.5",
3
+ "version": "3.7.7",
4
4
  "description": "Example: curated, versioned knowledge base with immutable sources, rule versions, and published snapshots.",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
@@ -99,20 +99,20 @@
99
99
  "dev": "contractspec-bun-build dev",
100
100
  "clean": "rimraf dist .turbo",
101
101
  "lint": "bun lint:fix",
102
- "lint:fix": "eslint src --fix",
103
- "lint:check": "eslint src",
102
+ "lint:fix": "biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .",
103
+ "lint:check": "biome check .",
104
104
  "test": "bun test",
105
105
  "prebuild": "contractspec-bun-build prebuild",
106
106
  "typecheck": "tsc --noEmit"
107
107
  },
108
108
  "dependencies": {
109
- "@contractspec/lib.contracts-spec": "3.7.5",
110
- "@contractspec/lib.schema": "3.7.5"
109
+ "@contractspec/lib.contracts-spec": "4.0.0",
110
+ "@contractspec/lib.schema": "3.7.6"
111
111
  },
112
112
  "devDependencies": {
113
- "@contractspec/tool.typescript": "3.7.5",
113
+ "@contractspec/tool.typescript": "3.7.6",
114
114
  "typescript": "^5.9.3",
115
- "@contractspec/tool.bun": "3.7.5"
115
+ "@contractspec/tool.bun": "3.7.6"
116
116
  },
117
117
  "publishConfig": {
118
118
  "access": "public",
@@ -2,28 +2,28 @@ import type { DocBlock } from '@contractspec/lib.contracts-spec/docs';
2
2
  import { registerDocBlocks } from '@contractspec/lib.contracts-spec/docs';
3
3
 
4
4
  const docBlocks: DocBlock[] = [
5
- {
6
- id: 'docs.examples.versioned-knowledge-base.goal',
7
- title: 'Versioned Knowledge Base — Goal',
8
- summary:
9
- 'Curated KB with immutable sources, versioned rules, and published snapshots referenced by answers.',
10
- kind: 'goal',
11
- visibility: 'public',
12
- route: '/docs/examples/versioned-knowledge-base/goal',
13
- tags: ['knowledge', 'versioning', 'snapshots', 'traceability'],
14
- body: `## Why it matters
5
+ {
6
+ id: 'docs.examples.versioned-knowledge-base.goal',
7
+ title: 'Versioned Knowledge Base — Goal',
8
+ summary:
9
+ 'Curated KB with immutable sources, versioned rules, and published snapshots referenced by answers.',
10
+ kind: 'goal',
11
+ visibility: 'public',
12
+ route: '/docs/examples/versioned-knowledge-base/goal',
13
+ tags: ['knowledge', 'versioning', 'snapshots', 'traceability'],
14
+ body: `## Why it matters
15
15
  - Separates raw sources from curated knowledge.\n- Ensures assistant answers cite a published snapshot.\n- Makes change review and safe regeneration possible.\n\n## Core invariants\n- Sources are immutable and content-addressed (hash).\n- Rule versions must cite at least one source.\n- Snapshots include only approved rule versions.`,
16
- },
17
- {
18
- id: 'docs.examples.versioned-knowledge-base.reference',
19
- title: 'Versioned Knowledge Base — Reference',
20
- summary: 'Entities, contracts, and events for the versioned KB example.',
21
- kind: 'reference',
22
- visibility: 'public',
23
- route: '/docs/examples/versioned-knowledge-base',
24
- tags: ['knowledge', 'reference'],
25
- body: `## Contracts\n- kb.ingestSource\n- kb.upsertRuleVersion\n- kb.approveRuleVersion\n- kb.publishSnapshot\n- kb.search\n\n## Events\n- kb.source.ingested\n- kb.ruleVersion.created\n- kb.ruleVersion.approved\n- kb.snapshot.published`,
26
- },
16
+ },
17
+ {
18
+ id: 'docs.examples.versioned-knowledge-base.reference',
19
+ title: 'Versioned Knowledge Base — Reference',
20
+ summary: 'Entities, contracts, and events for the versioned KB example.',
21
+ kind: 'reference',
22
+ visibility: 'public',
23
+ route: '/docs/examples/versioned-knowledge-base',
24
+ tags: ['knowledge', 'reference'],
25
+ body: `## Contracts\n- kb.ingestSource\n- kb.upsertRuleVersion\n- kb.approveRuleVersion\n- kb.publishSnapshot\n- kb.search\n\n## Events\n- kb.source.ingested\n- kb.ruleVersion.created\n- kb.ruleVersion.approved\n- kb.snapshot.published`,
26
+ },
27
27
  ];
28
28
 
29
29
  registerDocBlocks(docBlocks);