@weftlet/toolkit 0.0.0-stage → 0.1.1

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 (157) hide show
  1. package/LICENSE +176 -0
  2. package/NOTICE +6 -0
  3. package/README.md +162 -2
  4. package/THIRD_PARTY_NOTICES.md +610 -0
  5. package/dist/application/agent-context.d.ts +23 -0
  6. package/dist/application/agent-context.js +94 -0
  7. package/dist/application/application.d.ts +23 -0
  8. package/dist/application/application.js +91 -0
  9. package/dist/application/hydrator.d.ts +49 -0
  10. package/dist/application/hydrator.js +275 -0
  11. package/dist/application/overlay.d.ts +6 -0
  12. package/dist/application/overlay.js +110 -0
  13. package/dist/application/saved-evidence.d.ts +38 -0
  14. package/dist/application/saved-evidence.js +59 -0
  15. package/dist/application/snapshot-checks.d.ts +16 -0
  16. package/dist/application/snapshot-checks.js +51 -0
  17. package/dist/cli.d.ts +3 -0
  18. package/dist/cli.js +4 -0
  19. package/dist/configuration/cache.d.ts +2 -0
  20. package/dist/configuration/cache.js +10 -0
  21. package/dist/configuration/config.d.ts +79 -0
  22. package/dist/configuration/config.js +165 -0
  23. package/dist/core.d.ts +1 -0
  24. package/dist/core.js +2 -0
  25. package/dist/extraction/codex-auth.d.ts +12 -0
  26. package/dist/extraction/codex-auth.js +74 -0
  27. package/dist/extraction/document.d.ts +5 -0
  28. package/dist/extraction/document.js +54 -0
  29. package/dist/extraction/ontology.d.ts +32 -0
  30. package/dist/extraction/ontology.js +164 -0
  31. package/dist/extraction/providers.d.ts +8 -0
  32. package/dist/extraction/providers.js +58 -0
  33. package/dist/extraction/runtime-evidence.d.ts +2 -0
  34. package/dist/extraction/runtime-evidence.js +84 -0
  35. package/dist/extraction/semantic-citations.d.ts +7 -0
  36. package/dist/extraction/semantic-citations.js +27 -0
  37. package/dist/extraction/semantic-process.d.ts +11 -0
  38. package/dist/extraction/semantic-process.js +68 -0
  39. package/dist/extraction/semantic.d.ts +73 -0
  40. package/dist/extraction/semantic.js +414 -0
  41. package/dist/extraction/static.d.ts +52 -0
  42. package/dist/extraction/static.js +322 -0
  43. package/dist/extraction/telemetry.d.ts +19 -0
  44. package/dist/extraction/telemetry.js +259 -0
  45. package/dist/governance/governance.d.ts +60 -0
  46. package/dist/governance/governance.js +209 -0
  47. package/dist/graph/authority.d.ts +2 -0
  48. package/dist/graph/authority.js +13 -0
  49. package/dist/graph/diagnostics.d.ts +5 -0
  50. package/dist/graph/diagnostics.js +61 -0
  51. package/dist/graph/query.d.ts +16 -0
  52. package/dist/graph/query.js +373 -0
  53. package/dist/graph/rdf.d.ts +26 -0
  54. package/dist/graph/rdf.js +144 -0
  55. package/dist/index.d.ts +11 -0
  56. package/dist/index.js +12 -0
  57. package/dist/infrastructure/module-resolution.d.ts +2 -0
  58. package/dist/infrastructure/module-resolution.js +10 -0
  59. package/dist/infrastructure/process.d.ts +5 -0
  60. package/dist/infrastructure/process.js +27 -0
  61. package/dist/infrastructure/util.d.ts +1 -0
  62. package/dist/infrastructure/util.js +2 -0
  63. package/dist/interfaces/cli.d.ts +4 -0
  64. package/dist/interfaces/cli.js +197 -0
  65. package/dist/interfaces/doctor.d.ts +25 -0
  66. package/dist/interfaces/doctor.js +49 -0
  67. package/dist/interfaces/init.d.ts +24 -0
  68. package/dist/interfaces/init.js +154 -0
  69. package/dist/interfaces/mcp-facade.d.ts +3 -0
  70. package/dist/interfaces/mcp-facade.js +4 -0
  71. package/dist/interfaces/mcp.d.ts +2 -0
  72. package/dist/interfaces/mcp.js +81 -0
  73. package/dist/interfaces/request.d.ts +2 -0
  74. package/dist/interfaces/request.js +59 -0
  75. package/dist/mcp.d.ts +3 -0
  76. package/dist/mcp.js +4 -0
  77. package/dist/repository/committed-tree.d.ts +2 -0
  78. package/dist/repository/committed-tree.js +35 -0
  79. package/dist/repository/git.d.ts +26 -0
  80. package/dist/repository/git.js +163 -0
  81. package/dist/repository/glob.d.ts +2 -0
  82. package/dist/repository/glob.js +46 -0
  83. package/dist/repository/working-content.d.ts +3 -0
  84. package/dist/repository/working-content.js +34 -0
  85. package/dist/storage/atomic-rename.d.ts +2 -0
  86. package/dist/storage/atomic-rename.js +22 -0
  87. package/dist/storage/storage.d.ts +15 -0
  88. package/dist/storage/storage.js +115 -0
  89. package/dist/telemetry.d.ts +1 -0
  90. package/dist/telemetry.js +2 -0
  91. package/dist/visualization/viewer-interaction.d.ts +12 -0
  92. package/dist/visualization/viewer-interaction.js +123 -0
  93. package/dist/visualization/visualization.d.ts +26 -0
  94. package/dist/visualization/visualization.js +491 -0
  95. package/docs/ADR-001-standalone-baseline.md +16 -0
  96. package/docs/ADR-002-saved-evidence.md +21 -0
  97. package/docs/ADR-003-draft-overlays.md +23 -0
  98. package/docs/ADR-004-rdf-query-path.md +37 -0
  99. package/docs/ADR-005-governance-and-optional-oml.md +37 -0
  100. package/docs/ADR-006-provider-boundaries.md +15 -0
  101. package/docs/ADR-007-toolkit-modules.md +53 -0
  102. package/docs/ADR-008-weftlet-packages.md +32 -0
  103. package/docs/CLOUD-ENVIRONMENT.md +56 -0
  104. package/docs/ENVIRONMENT-VALIDATION.md +83 -0
  105. package/docs/MIGRATING-TO-WEFTLET.md +54 -0
  106. package/docs/PROVIDERS.md +121 -0
  107. package/docs/RELEASING.md +146 -0
  108. package/docs/ROADMAP.md +55 -0
  109. package/docs/SOURCE-INVENTORY.md +48 -0
  110. package/docs/VALIDATION.md +530 -0
  111. package/docs/VIEWER.md +36 -0
  112. package/docs/architecture-baseline.json +57 -0
  113. package/docs/architecture-policy.md +41 -0
  114. package/docs/extraction-manifest.json +721 -0
  115. package/docs/licenses/REVIEW.md +16 -0
  116. package/docs/licenses/lru-cache-11.5.3-BlueOak.md +55 -0
  117. package/docs/licenses/negotiate-1.0.1-BSD.txt +22 -0
  118. package/docs/licenses/spark-md5-3.0.2-MIT.txt +7 -0
  119. package/examples/generic-typescript/context-graph.config.json +47 -0
  120. package/examples/generic-typescript/context-graph.oml.config.json +49 -0
  121. package/examples/generic-typescript/docs/search-capability.md +14 -0
  122. package/examples/generic-typescript/ontology/build.gradle +38 -0
  123. package/examples/generic-typescript/ontology/catalog.xml +5 -0
  124. package/examples/generic-typescript/ontology/settings.gradle +1 -0
  125. package/examples/generic-typescript/ontology/src/oml/context-graph.dev/core.oml +99 -0
  126. package/examples/generic-typescript/package.json +6 -0
  127. package/examples/generic-typescript/src/search.ts +11 -0
  128. package/examples/generic-typescript/test/search.test.ts +8 -0
  129. package/examples/generic-typescript/tsconfig.json +10 -0
  130. package/examples/pipeline/context-graph.config.json +49 -0
  131. package/examples/pipeline/docs/admission.md +6 -0
  132. package/examples/pipeline/docs/analysis.md +6 -0
  133. package/examples/pipeline/docs/discovery.md +6 -0
  134. package/examples/pipeline/docs/execution.md +6 -0
  135. package/examples/pipeline/docs/outcomes.md +6 -0
  136. package/examples/pipeline/docs/planning.md +6 -0
  137. package/examples/pipeline/package.json +6 -0
  138. package/examples/pipeline/src/admission.ts +9 -0
  139. package/examples/pipeline/src/analysis.ts +9 -0
  140. package/examples/pipeline/src/contracts/admission.ts +1 -0
  141. package/examples/pipeline/src/contracts/analysis.ts +1 -0
  142. package/examples/pipeline/src/contracts/discovery.ts +1 -0
  143. package/examples/pipeline/src/contracts/execution.ts +1 -0
  144. package/examples/pipeline/src/contracts/outcomes.ts +1 -0
  145. package/examples/pipeline/src/contracts/planning.ts +1 -0
  146. package/examples/pipeline/src/discovery.ts +9 -0
  147. package/examples/pipeline/src/execution.ts +9 -0
  148. package/examples/pipeline/src/outcomes.ts +9 -0
  149. package/examples/pipeline/src/planning.ts +9 -0
  150. package/examples/pipeline/src/queue.ts +12 -0
  151. package/examples/pipeline/test/pipeline.test.ts +17 -0
  152. package/examples/pipeline/tsconfig.json +12 -0
  153. package/package.json +116 -3
  154. package/runtime-check.d.mts +2 -0
  155. package/runtime-check.mjs +12 -0
  156. package/templates/context-graph-development/SKILL.md +37 -0
  157. package/third-party-tools.json +34 -0
@@ -0,0 +1,16 @@
1
+ # Scoped dependency license review
2
+
3
+ The RDF dependency tree introduced three expressions outside the original generator allowlist.
4
+ `reviewed-licenses.json` pins these reviews to exact package versions and notice hashes.
5
+ Unrecognized future versions/expressions still fail the check.
6
+
7
+ - `spark-md5@3.0.2`: upstream package metadata and README offer MIT as an alternative.
8
+ The npm archive omits `LICENSE2`; the retained MIT notice was retrieved from the peeled
9
+ `v3.0.2` source commit `9315385868fe11076674d4ddd763005319a462a7`, path `LICENSE2`.
10
+ - `lru-cache@11.5.3`: the installed `LICENSE.md` grants copyright/patent permissions and
11
+ requires the license text or link. Its complete Blue Oak 1.0.0 text is retained.
12
+ - `negotiate@1.0.1`: metadata says FreeBSD; the installed `negotiate.js` header contains
13
+ two-clause BSD permissions, copyright and disclaimer. That notice is retained.
14
+
15
+ These selections support local development and preserve redistribution notices. They do not
16
+ authorize package publication or waive final export review.
@@ -0,0 +1,55 @@
1
+ # Blue Oak Model License
2
+
3
+ Version 1.0.0
4
+
5
+ ## Purpose
6
+
7
+ This license gives everyone as much permission to work with
8
+ this software as possible, while protecting contributors
9
+ from liability.
10
+
11
+ ## Acceptance
12
+
13
+ In order to receive this license, you must agree to its
14
+ rules. The rules of this license are both obligations
15
+ under that agreement and conditions to your license.
16
+ You must not do anything with this software that triggers
17
+ a rule that you cannot or will not follow.
18
+
19
+ ## Copyright
20
+
21
+ Each contributor licenses you to do everything with this
22
+ software that would otherwise infringe that contributor's
23
+ copyright in it.
24
+
25
+ ## Notices
26
+
27
+ You must ensure that everyone who gets a copy of
28
+ any part of this software from you, with or without
29
+ changes, also gets the text of this license or a link to
30
+ <https://blueoakcouncil.org/license/1.0.0>.
31
+
32
+ ## Excuse
33
+
34
+ If anyone notifies you in writing that you have not
35
+ complied with [Notices](#notices), you can keep your
36
+ license by taking all practical steps to comply within 30
37
+ days after the notice. If you do not do so, your license
38
+ ends immediately.
39
+
40
+ ## Patent
41
+
42
+ Each contributor licenses you to do everything with this
43
+ software that would otherwise infringe any patent claims
44
+ they can license or become able to license.
45
+
46
+ ## Reliability
47
+
48
+ No contributor can revoke this license.
49
+
50
+ ## No Liability
51
+
52
+ ***As far as the law allows, this software comes as is,
53
+ without any warranty or condition, and no contributor
54
+ will be liable to anyone for any damages related to this
55
+ software or this license, under any kind of legal claim.***
@@ -0,0 +1,22 @@
1
+ Copyright 2010 Gary Court. All rights reserved.
2
+
3
+ Redistribution and use in source and binary forms, with or without modification, are
4
+ permitted provided that the following conditions are met:
5
+
6
+ 1. Redistributions of source code must retain the above copyright notice, this list of
7
+ conditions and the following disclaimer.
8
+
9
+ 2. Redistributions in binary form must reproduce the above copyright notice, this list
10
+ of conditions and the following disclaimer in the documentation and/or other materials
11
+ provided with the distribution.
12
+
13
+ THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED
14
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
15
+ FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR
16
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
17
+ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
18
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
19
+ ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
20
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
21
+ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22
+
@@ -0,0 +1,7 @@
1
+ Copyright (c) 2015 André Cruz <amdfcruz@gmail.com>
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,47 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "repositoryRoot": ".",
4
+ "repositoryId": "example/generic-typescript",
5
+ "namespace": "https://example.test/context/",
6
+ "semanticSources": [
7
+ "docs"
8
+ ],
9
+ "codeRoots": [
10
+ "src"
11
+ ],
12
+ "contractPatterns": [],
13
+ "evidenceRoots": [
14
+ "test"
15
+ ],
16
+ "semantic": {
17
+ "provider": "codex-cli",
18
+ "model": "gpt-6-astra",
19
+ "reasoningEffort": "medium",
20
+ "promptVersion": "generic-semantic-v3",
21
+ "extractorVersion": "1.1.0",
22
+ "adapterVersion": "1.1.0",
23
+ "ontologyVersion": "1.1.0",
24
+ "minimumConfidence": 0.7,
25
+ "failOnUnresolved": true,
26
+ "concurrency": 1
27
+ },
28
+ "scip": {
29
+ "version": "0.4.0",
30
+ "command": "bundled-scip-typescript",
31
+ "args": [
32
+ "index",
33
+ "--no-global-caches",
34
+ "--infer-tsconfig"
35
+ ]
36
+ },
37
+ "ontology": {
38
+ "backend": "rdf",
39
+ "toolVersion": "rdf-record-v1"
40
+ },
41
+ "runtimeEvidence": [],
42
+ "storagePath": ".context-graph",
43
+ "x-extraction-modifications": "Portable example model profile; runtime evidence is opt-in.",
44
+ "approvedIntentSources": [
45
+ "docs/search-capability.md"
46
+ ]
47
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "repositoryRoot": ".",
4
+ "repositoryId": "example/generic-typescript",
5
+ "namespace": "https://example.test/context/",
6
+ "semanticSources": [
7
+ "docs"
8
+ ],
9
+ "codeRoots": [
10
+ "src"
11
+ ],
12
+ "contractPatterns": [],
13
+ "evidenceRoots": [
14
+ "test"
15
+ ],
16
+ "semantic": {
17
+ "provider": "codex-cli",
18
+ "model": "gpt-6-astra",
19
+ "reasoningEffort": "medium",
20
+ "promptVersion": "generic-semantic-v3",
21
+ "extractorVersion": "1.1.0",
22
+ "adapterVersion": "1.1.0",
23
+ "ontologyVersion": "1.1.0",
24
+ "minimumConfidence": 0.7,
25
+ "failOnUnresolved": true,
26
+ "concurrency": 1
27
+ },
28
+ "scip": {
29
+ "version": "0.4.0",
30
+ "command": "bundled-scip-typescript",
31
+ "args": [
32
+ "index",
33
+ "--no-global-caches",
34
+ "--infer-tsconfig"
35
+ ]
36
+ },
37
+ "ontology": {
38
+ "toolVersion": "oml2owl-gradle-2.13.1",
39
+ "containerImage": "gradle:8.10.2-jdk21@sha256:963d59f7f22767da4efbcf46b661361b61af5fb88b0309da1071c4234c647eba",
40
+ "projectPath": "ontology",
41
+ "backend": "opencaesar"
42
+ },
43
+ "runtimeEvidence": [],
44
+ "storagePath": ".context-graph",
45
+ "x-extraction-modifications": "Portable example model profile; runtime evidence is opt-in.",
46
+ "approvedIntentSources": [
47
+ "docs/search-capability.md"
48
+ ]
49
+ }
@@ -0,0 +1,14 @@
1
+ semantic-id: capability:document-search
2
+
3
+ # Document Search
4
+
5
+ The stable identifiers in this capability are:
6
+
7
+ - `capability:document-search` for the search capability.
8
+ - `component:query-service` for the query service.
9
+ - `contract:document-repository` for the document repository contract.
10
+ - `contract:search` for the search contract.
11
+ - `evidence:test-search-test-ts` for `test/search.test.ts`.
12
+
13
+ The search capability is implemented by the query service. The service consumes the document
14
+ repository contract, and the search contract is verified by `test/search.test.ts`.
@@ -0,0 +1,38 @@
1
+ buildscript {
2
+ repositories {
3
+ mavenCentral()
4
+ }
5
+ dependencies {
6
+ classpath 'io.opencaesar.oml:oml-merge-gradle:2.13.0'
7
+ classpath 'io.opencaesar.adapters:oml2owl-gradle:2.13.1'
8
+ }
9
+ }
10
+
11
+ apply plugin: 'base'
12
+ apply plugin: 'oml'
13
+
14
+ repositories {
15
+ mavenCentral()
16
+ }
17
+
18
+ dependencies {
19
+ oml 'io.opencaesar.ontologies:core-vocabularies:5.1.0'
20
+ }
21
+
22
+ task downloadDependencies(type: io.opencaesar.oml.merge.OmlMergeTask, dependsOn: configurations.oml) {
23
+ inputZipPaths = configurations.oml.files
24
+ outputCatalogFolder = file('build/oml')
25
+ }
26
+
27
+ task oml2owl(type: io.opencaesar.oml2owl.Oml2OwlTask, dependsOn: downloadDependencies) {
28
+ inputCatalogPath = file('catalog.xml')
29
+ rootOntologyIri = 'https://context-graph.dev/generated/snapshot'
30
+ outputCatalogPath = file('build/rdf/catalog.xml')
31
+ outputFileExtension = 'ttl'
32
+ generateRules = true
33
+ omlAnnotations = 'generate'
34
+ }
35
+
36
+ tasks.named('build') {
37
+ dependsOn oml2owl
38
+ }
@@ -0,0 +1,5 @@
1
+ <?xml version="1.0"?>
2
+ <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer="public">
3
+ <rewriteURI uriStartString="https://context-graph.dev/" rewritePrefix="src/oml/context-graph.dev/"/>
4
+ <rewriteURI uriStartString="http://" rewritePrefix="build/oml/"/>
5
+ </catalog>
@@ -0,0 +1 @@
1
+ rootProject.name = 'generic-context-graph-ontology'
@@ -0,0 +1,99 @@
1
+ vocabulary <https://context-graph.dev/core#> as cg {
2
+ extends <http://www.w3.org/2001/XMLSchema#> as xsd
3
+
4
+ aspect GraphElement [
5
+ key hasIdentifier
6
+ ]
7
+
8
+ scalar property hasIdentifier [
9
+ domain GraphElement
10
+ range xsd:string
11
+ functional
12
+ ]
13
+
14
+ concept Project < GraphElement
15
+ concept ProductCapability < GraphElement
16
+ concept Workflow < GraphElement
17
+ concept RuntimeComponent < GraphElement
18
+ concept APIContract < GraphElement
19
+ concept EventContract < GraphElement
20
+ concept QueueContract < GraphElement
21
+ concept PersistenceModel < GraphElement
22
+ concept Provider < GraphElement
23
+ concept Scope < GraphElement
24
+ concept OwnerDocument < GraphElement
25
+ concept ValidationArtifact < GraphElement
26
+ concept ArchitectureInvariant < GraphElement
27
+ concept DecisionAuthority < GraphElement
28
+
29
+ relation realizes [
30
+ from RuntimeComponent
31
+ to ProductCapability
32
+ reverse implementedBy
33
+ ]
34
+
35
+ relation consumes [
36
+ from RuntimeComponent
37
+ to GraphElement
38
+ ]
39
+
40
+ relation emits [
41
+ from RuntimeComponent
42
+ to GraphElement
43
+ ]
44
+
45
+ relation persistsTo [
46
+ from RuntimeComponent
47
+ to PersistenceModel
48
+ ]
49
+
50
+ relation governedBy [
51
+ from GraphElement
52
+ to ArchitectureInvariant
53
+ ]
54
+
55
+ relation definedBy [
56
+ from GraphElement
57
+ to OwnerDocument
58
+ ]
59
+
60
+ relation verifiedBy [
61
+ from GraphElement
62
+ to ValidationArtifact
63
+ ]
64
+
65
+ relation operationallyOwnedBy [
66
+ from ProductCapability
67
+ to RuntimeComponent
68
+ ]
69
+
70
+ relation hasDecisionAuthority [
71
+ from GraphElement
72
+ to DecisionAuthority
73
+ ]
74
+
75
+ relation routesThrough [
76
+ from RuntimeComponent
77
+ to RuntimeComponent
78
+ ]
79
+
80
+ relation authorizedBy [
81
+ from GraphElement
82
+ to Scope
83
+ ]
84
+
85
+ relation sourcedFrom [
86
+ from GraphElement
87
+ to Provider
88
+ ]
89
+
90
+ relation references [
91
+ from GraphElement
92
+ to GraphElement
93
+ ]
94
+
95
+ relation contains [
96
+ from GraphElement
97
+ to GraphElement
98
+ ]
99
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "generic-context-graph-example",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "type": "module"
6
+ }
@@ -0,0 +1,11 @@
1
+ export interface DocumentRepository {
2
+ search(query: string): Promise<readonly string[]>;
3
+ }
4
+
5
+ export class SearchService {
6
+ constructor(private readonly repository: DocumentRepository) {}
7
+
8
+ search(query: string): Promise<readonly string[]> {
9
+ return this.repository.search(query.trim());
10
+ }
11
+ }
@@ -0,0 +1,8 @@
1
+ import { expect, it } from 'vitest';
2
+
3
+ import { SearchService } from '../src/search.js';
4
+
5
+ it('proves the portable fixture service contract', async () => {
6
+ const service = new SearchService({ search: async (query) => [query] });
7
+ await expect(service.search(' context ')).resolves.toEqual(['context']);
8
+ });
@@ -0,0 +1,10 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "strict": true,
7
+ "noEmit": true
8
+ },
9
+ "include": ["src/**/*.ts"]
10
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "repositoryRoot": ".",
4
+ "repositoryId": "example/pipeline",
5
+ "namespace": "https://example.test/context/",
6
+ "semanticSources": [
7
+ "docs"
8
+ ],
9
+ "codeRoots": [
10
+ "src"
11
+ ],
12
+ "contractPatterns": [
13
+ "src/contracts/*.ts"
14
+ ],
15
+ "evidenceRoots": [
16
+ "test"
17
+ ],
18
+ "semantic": {
19
+ "provider": "codex-cli",
20
+ "model": "gpt-6-astra",
21
+ "reasoningEffort": "medium",
22
+ "promptVersion": "generic-semantic-v3",
23
+ "extractorVersion": "1.1.0",
24
+ "adapterVersion": "1.1.0",
25
+ "ontologyVersion": "1.1.0",
26
+ "minimumConfidence": 0.7,
27
+ "failOnUnresolved": true,
28
+ "concurrency": 1
29
+ },
30
+ "scip": {
31
+ "version": "0.4.0",
32
+ "command": "bundled-scip-typescript",
33
+ "args": [
34
+ "index",
35
+ "--no-global-caches",
36
+ "--infer-tsconfig"
37
+ ]
38
+ },
39
+ "ontology": {
40
+ "backend": "rdf",
41
+ "toolVersion": "rdf-record-v1"
42
+ },
43
+ "runtimeEvidence": [],
44
+ "storagePath": ".context-graph",
45
+ "x-extraction-modifications": "Portable example model profile; runtime evidence is opt-in.",
46
+ "approvedIntentSources": [
47
+ "docs/*.md"
48
+ ]
49
+ }
@@ -0,0 +1,6 @@
1
+ semantic-id: pipeline:admission
2
+ # Admission intent
3
+ Status: approved example policy (fictional product).
4
+ The admission stage is implemented by src/admission.ts.
5
+ The admission stage routes through the planning stage using an asynchronous queue.
6
+ The shared message contract is src/contracts/planning.ts.
@@ -0,0 +1,6 @@
1
+ semantic-id: pipeline:analysis
2
+ # Analysis intent
3
+ Status: approved example policy (fictional product).
4
+ The analysis stage is implemented by src/analysis.ts.
5
+ The analysis stage routes through the admission stage using an asynchronous queue.
6
+ The shared message contract is src/contracts/admission.ts.
@@ -0,0 +1,6 @@
1
+ semantic-id: pipeline:discovery
2
+ # Discovery intent
3
+ Status: approved example policy (fictional product).
4
+ The discovery stage is implemented by src/discovery.ts.
5
+ The discovery stage routes through the analysis stage using an asynchronous queue.
6
+ The shared message contract is src/contracts/analysis.ts.
@@ -0,0 +1,6 @@
1
+ semantic-id: pipeline:execution
2
+ # Execution intent
3
+ Status: approved example policy (fictional product).
4
+ The execution stage is implemented by src/execution.ts.
5
+ The execution stage routes through the outcomes stage using an asynchronous queue.
6
+ The shared message contract is src/contracts/outcomes.ts.
@@ -0,0 +1,6 @@
1
+ semantic-id: pipeline:outcomes
2
+ # Outcomes intent
3
+ Status: approved example policy (fictional product).
4
+ The outcomes stage is implemented by src/outcomes.ts.
5
+ The outcomes stage routes through the discovery stage using an asynchronous queue.
6
+ The shared message contract is src/contracts/discovery.ts.
@@ -0,0 +1,6 @@
1
+ semantic-id: pipeline:planning
2
+ # Planning intent
3
+ Status: approved example policy (fictional product).
4
+ The planning stage is implemented by src/planning.ts.
5
+ The planning stage routes through the execution stage using an asynchronous queue.
6
+ The shared message contract is src/contracts/execution.ts.
@@ -0,0 +1,6 @@
1
+ {
2
+ "name": "context-graph-pipeline-example",
3
+ "version": "1.0.0",
4
+ "private": true,
5
+ "type": "module"
6
+ }
@@ -0,0 +1,9 @@
1
+ import type { Queue } from './queue.js';
2
+ import type { AdmissionMessage } from './contracts/admission.js';
3
+ import type { PlanningMessage } from './contracts/planning.js';
4
+
5
+ export function admission(input: Queue<AdmissionMessage>, output: Queue<PlanningMessage>) {
6
+ input.subscribe(async (message) => {
7
+ await output.publish({ id: message.id, value: message.value + 1 });
8
+ });
9
+ }
@@ -0,0 +1,9 @@
1
+ import type { Queue } from './queue.js';
2
+ import type { AnalysisMessage } from './contracts/analysis.js';
3
+ import type { AdmissionMessage } from './contracts/admission.js';
4
+
5
+ export function analysis(input: Queue<AnalysisMessage>, output: Queue<AdmissionMessage>) {
6
+ input.subscribe(async (message) => {
7
+ await output.publish({ id: message.id, value: message.value + 1 });
8
+ });
9
+ }
@@ -0,0 +1 @@
1
+ export interface AdmissionMessage { id: string; value: number }
@@ -0,0 +1 @@
1
+ export interface AnalysisMessage { id: string; value: number }
@@ -0,0 +1 @@
1
+ export interface DiscoveryMessage { id: string; value: number }
@@ -0,0 +1 @@
1
+ export interface ExecutionMessage { id: string; value: number }
@@ -0,0 +1 @@
1
+ export interface OutcomesMessage { id: string; value: number }
@@ -0,0 +1 @@
1
+ export interface PlanningMessage { id: string; value: number }
@@ -0,0 +1,9 @@
1
+ import type { Queue } from './queue.js';
2
+ import type { DiscoveryMessage } from './contracts/discovery.js';
3
+ import type { AnalysisMessage } from './contracts/analysis.js';
4
+
5
+ export function discovery(input: Queue<DiscoveryMessage>, output: Queue<AnalysisMessage>) {
6
+ input.subscribe(async (message) => {
7
+ await output.publish({ id: message.id, value: message.value + 1 });
8
+ });
9
+ }
@@ -0,0 +1,9 @@
1
+ import type { Queue } from './queue.js';
2
+ import type { ExecutionMessage } from './contracts/execution.js';
3
+ import type { OutcomesMessage } from './contracts/outcomes.js';
4
+
5
+ export function execution(input: Queue<ExecutionMessage>, output: Queue<OutcomesMessage>) {
6
+ input.subscribe(async (message) => {
7
+ await output.publish({ id: message.id, value: message.value + 1 });
8
+ });
9
+ }
@@ -0,0 +1,9 @@
1
+ import type { Queue } from './queue.js';
2
+ import type { OutcomesMessage } from './contracts/outcomes.js';
3
+ import type { DiscoveryMessage } from './contracts/discovery.js';
4
+
5
+ export function outcomes(input: Queue<OutcomesMessage>, output: Queue<DiscoveryMessage>) {
6
+ input.subscribe(async (message) => {
7
+ await output.publish({ id: message.id, value: message.value + 1 });
8
+ });
9
+ }
@@ -0,0 +1,9 @@
1
+ import type { Queue } from './queue.js';
2
+ import type { PlanningMessage } from './contracts/planning.js';
3
+ import type { ExecutionMessage } from './contracts/execution.js';
4
+
5
+ export function planning(input: Queue<PlanningMessage>, output: Queue<ExecutionMessage>) {
6
+ input.subscribe(async (message) => {
7
+ await output.publish({ id: message.id, value: message.value + 1 });
8
+ });
9
+ }
@@ -0,0 +1,12 @@
1
+ export interface Queue<T> {
2
+ publish(value: T): Promise<void>;
3
+ subscribe(handler: (value: T) => Promise<void>): void;
4
+ }
5
+ export class MemoryQueue<T> implements Queue<T> {
6
+ private handlers: ((value: T) => Promise<void>)[] = [];
7
+ subscribe(handler: (value: T) => Promise<void>) { this.handlers.push(handler); }
8
+ async publish(value: T) {
9
+ await Promise.resolve();
10
+ for (const handler of this.handlers) await handler(value);
11
+ }
12
+ }
@@ -0,0 +1,17 @@
1
+ import { MemoryQueue } from '../src/queue.js';
2
+ import { discovery } from '../src/discovery.js';
3
+ import { analysis } from '../src/analysis.js';
4
+ import { admission } from '../src/admission.js';
5
+ import { planning } from '../src/planning.js';
6
+ import { execution } from '../src/execution.js';
7
+ import { outcomes } from '../src/outcomes.js';
8
+
9
+ export async function verifyPipeline(): Promise<void> {
10
+ const queues = Array.from({ length: 7 }, () => new MemoryQueue<{ id: string; value: number }>());
11
+ [discovery, analysis, admission, planning, execution, outcomes].forEach((stage, index) =>
12
+ stage(queues[index]!, queues[index + 1]!));
13
+ let observed: number | undefined;
14
+ queues[6]!.subscribe(async (message) => { observed = message.value; });
15
+ await queues[0]!.publish({ id: 'public-fixture', value: 0 });
16
+ if (observed !== 6) throw new Error(`Expected all six asynchronous stages; received ${observed}`);
17
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "strict": true
7
+ },
8
+ "include": [
9
+ "src/**/*.ts",
10
+ "test/**/*.ts"
11
+ ]
12
+ }