@pegma/knowledge-base-contracts 0.0.0-stage → 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Pegma
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,38 @@
1
- # Temporary Holding Version
1
+ # @pegma/knowledge-base-contracts
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Provider-free collection, immutable article revision, validation evidence, and
4
+ exact approval contracts for a composable knowledge base. This package owns
5
+ permission names; the application enforces current permission/resource checks
6
+ using host-resolved Authorization Core contexts. Identity and time types come
7
+ from `@pegma/spine`.
8
+
9
+ Collections independently enable portal and bot use for an explicit audience.
10
+ Every article inherits its collection policy; there are no article-level access
11
+ overrides. An enabled permission audience names a permission the host resolves.
12
+ Anonymous use is representable for future opt-in publication, with an exact
13
+ public collection approval; both initial hosts keep it disabled.
14
+
15
+ Content edits create a new immutable `ArticleRevision`. `Article` is a bounded
16
+ transition aggregate containing the current draft and at most one published
17
+ snapshot; it is not a revision archive. The application retains bounded
18
+ revision history separately and authorizes access to it. An existing
19
+ publication can remain while an update awaits review. Retirement removes the
20
+ published snapshot from the transition result.
21
+
22
+ `ApprovalBinding` names the exact content hash, collection audience policy,
23
+ applicability, validation policy, and evidence versions/hashes that a reviewer
24
+ approved. Evidence includes steps, a staging build, a runner, timestamps,
25
+ protected artifact references, and an attestation receipt. A `passed` result
26
+ alone is insufficient. Hashes use lowercase hexadecimal SHA-256.
27
+
28
+ These types do not authenticate identity or prove a submitted attestation. The
29
+ application/host boundary must authenticate the runner and reviewer,
30
+ verify the attestation against its trusted verifier, apply current permission
31
+ and resource checks, and control private evidence access. Authoring callers
32
+ cannot grant themselves publication authority by supplying these fields.
33
+
34
+ The package does not own persistence, an access model, HTTP/MCP transports,
35
+ safe HTML rendering, arbitrary URL fetching, code execution, GitHub, or model
36
+ integration. Evidence and approval records are private staff material; the
37
+ application's customer/bot DTOs return approved article content and safe
38
+ metadata only.
@@ -0,0 +1,181 @@
1
+ import type { IsoTimestamp, PrincipalId } from "@pegma/spine";
2
+ export type { Clock, IsoTimestamp, Logger, PrincipalId } from "@pegma/spine";
3
+ export type CollectionId = string;
4
+ export type ArticleId = string;
5
+ export type EvidenceId = string;
6
+ export type ValidationPolicyId = string;
7
+ /** These are permission names, never role names or an authorization engine. */
8
+ export declare const knowledgePermissions: {
9
+ readonly collectionRead: "knowledge.collection.read";
10
+ readonly collectionManage: "knowledge.collection.manage";
11
+ readonly publicCollectionApprove: "knowledge.collection.approve-public";
12
+ readonly articleRead: "knowledge.article.read";
13
+ readonly botRead: "knowledge.article.bot.read";
14
+ readonly indexManage: "knowledge.index.manage";
15
+ readonly draftRead: "knowledge.article.draft.read";
16
+ readonly draftWrite: "knowledge.article.draft.write";
17
+ readonly evidenceRead: "knowledge.article.evidence.read";
18
+ readonly evidenceSubmit: "knowledge.article.evidence.submit";
19
+ readonly evidenceRevoke: "knowledge.article.evidence.revoke";
20
+ readonly provenanceRead: "knowledge.article.provenance.read";
21
+ readonly provenanceWrite: "knowledge.article.provenance.write";
22
+ readonly reviewSubmit: "knowledge.article.review.submit";
23
+ readonly review: "knowledge.article.review";
24
+ readonly publish: "knowledge.article.publish";
25
+ readonly retire: "knowledge.article.retire";
26
+ readonly validationManage: "knowledge.validation.manage";
27
+ };
28
+ export type KnowledgePermission = (typeof knowledgePermissions)[keyof typeof knowledgePermissions];
29
+ export declare const articleKinds: readonly ["explanation", "walkthrough", "troubleshooting", "developer-reference"];
30
+ export type ArticleKind = (typeof articleKinds)[number];
31
+ /** The host resolves named permissions and authenticates every protected use. */
32
+ export type KnowledgeAudience = {
33
+ readonly kind: "permission";
34
+ readonly permission: string;
35
+ } | {
36
+ readonly kind: "anonymous";
37
+ };
38
+ export type CollectionUse = {
39
+ readonly enabled: false;
40
+ } | {
41
+ readonly enabled: true;
42
+ readonly audience: KnowledgeAudience;
43
+ };
44
+ export interface CollectionPolicy {
45
+ readonly version: number;
46
+ readonly portal: CollectionUse;
47
+ readonly bot: CollectionUse;
48
+ }
49
+ export interface PublicCollectionApproval {
50
+ readonly collectionId: CollectionId;
51
+ readonly policyVersion: number;
52
+ readonly policyHash: string;
53
+ readonly reviewerId: PrincipalId;
54
+ readonly reviewedAt: IsoTimestamp;
55
+ }
56
+ export interface Collection {
57
+ readonly id: CollectionId;
58
+ readonly revision: number;
59
+ readonly name: string;
60
+ readonly policy: CollectionPolicy;
61
+ readonly publicApproval?: PublicCollectionApproval;
62
+ readonly createdBy: PrincipalId;
63
+ readonly createdAt: IsoTimestamp;
64
+ readonly updatedBy: PrincipalId;
65
+ readonly updatedAt: IsoTimestamp;
66
+ }
67
+ export interface Applicability {
68
+ readonly productId: string;
69
+ readonly productVersion: string;
70
+ readonly buildId?: string;
71
+ readonly locale?: string;
72
+ }
73
+ export interface ArticleContent {
74
+ readonly format: "markdown" | "plain_text";
75
+ readonly text: string;
76
+ }
77
+ export interface ValidationPolicyReference {
78
+ readonly id: ValidationPolicyId;
79
+ readonly version: number;
80
+ }
81
+ /** Content is immutable. Editing creates a new numbered revision. */
82
+ export interface ArticleRevision {
83
+ readonly articleId: ArticleId;
84
+ readonly number: number;
85
+ readonly collectionId: CollectionId;
86
+ readonly kind: ArticleKind;
87
+ readonly title: string;
88
+ readonly summary: string;
89
+ readonly content: ArticleContent;
90
+ readonly tags: readonly string[];
91
+ readonly applicability: Applicability;
92
+ readonly validationPolicy: ValidationPolicyReference;
93
+ /** Lowercase hexadecimal SHA-256, computed by core, not supplied as proof. */
94
+ readonly contentHash: string;
95
+ readonly createdBy: PrincipalId;
96
+ readonly createdAt: IsoTimestamp;
97
+ }
98
+ export interface ValidationRequirement {
99
+ readonly id: string;
100
+ readonly kind: ArticleKind;
101
+ readonly testKind: string;
102
+ readonly maxAgeMilliseconds: number;
103
+ /** Identity authentication and attestation verification belong to KB-02/host. */
104
+ readonly trustedRunnerIds: readonly PrincipalId[];
105
+ }
106
+ export interface ValidationPolicy {
107
+ readonly id: ValidationPolicyId;
108
+ readonly version: number;
109
+ readonly requirements: readonly ValidationRequirement[];
110
+ }
111
+ /** Opaque protected artifact identity; core never fetches URLs or executes it. */
112
+ export interface EvidenceArtifactReference {
113
+ readonly id: string;
114
+ readonly hash: string;
115
+ }
116
+ /** Private verification material, excluded from later customer/bot DTOs. */
117
+ export interface VerificationEvidence {
118
+ readonly id: EvidenceId;
119
+ readonly version: number;
120
+ readonly articleId: ArticleId;
121
+ readonly articleRevision: number;
122
+ readonly contentHash: string;
123
+ readonly validationPolicy: ValidationPolicyReference;
124
+ readonly checkId: string;
125
+ readonly testKind: string;
126
+ readonly applicability: Applicability;
127
+ readonly stagingBuildId: string;
128
+ readonly steps: readonly string[];
129
+ readonly result: "passed" | "failed" | "inconclusive";
130
+ readonly executedAt: IsoTimestamp;
131
+ readonly runnerId: PrincipalId;
132
+ readonly artifacts: readonly EvidenceArtifactReference[];
133
+ /** A trusted boundary must authenticate the runner and verify this receipt. */
134
+ readonly attestation: {
135
+ readonly id: string;
136
+ readonly verifiedBy: PrincipalId;
137
+ readonly verifiedAt: IsoTimestamp;
138
+ };
139
+ /** Lowercase hexadecimal SHA-256 over the evidence fields excluding hash. */
140
+ readonly hash: string;
141
+ }
142
+ export interface EvidenceBinding {
143
+ readonly id: EvidenceId;
144
+ readonly version: number;
145
+ readonly hash: string;
146
+ }
147
+ /** Exact review snapshot. Changes to any binding require a fresh review. */
148
+ export interface ApprovalBinding {
149
+ readonly articleId: ArticleId;
150
+ readonly articleRevision: number;
151
+ readonly contentHash: string;
152
+ readonly collectionId: CollectionId;
153
+ readonly collectionPolicyVersion: number;
154
+ readonly collectionPolicyHash: string;
155
+ readonly applicability: Applicability;
156
+ readonly validationPolicy: ValidationPolicyReference;
157
+ readonly validationPolicyHash: string;
158
+ readonly evidence: readonly EvidenceBinding[];
159
+ }
160
+ export interface ArticleApproval {
161
+ readonly binding: ApprovalBinding;
162
+ readonly reviewerId: PrincipalId;
163
+ readonly reviewedAt: IsoTimestamp;
164
+ }
165
+ export interface PublishedArticle {
166
+ readonly revision: ArticleRevision;
167
+ readonly approval: ArticleApproval;
168
+ }
169
+ /**
170
+ * Bounded transition input/output: one current revision and one publication.
171
+ * Durable immutable revision history is owned by application services.
172
+ */
173
+ export interface Article {
174
+ readonly id: ArticleId;
175
+ readonly state: "draft" | "in-review" | "published" | "retired";
176
+ readonly current: ArticleRevision;
177
+ readonly evidence: readonly VerificationEvidence[];
178
+ readonly review?: ApprovalBinding;
179
+ readonly published?: PublishedArticle;
180
+ }
181
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MA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,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACnD,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,gBAAgB,CAAC;CACvC"}
package/dist/index.js ADDED
@@ -0,0 +1,28 @@
1
+ /** These are permission names, never role names or an authorization engine. */
2
+ export const knowledgePermissions = {
3
+ collectionRead: "knowledge.collection.read",
4
+ collectionManage: "knowledge.collection.manage",
5
+ publicCollectionApprove: "knowledge.collection.approve-public",
6
+ articleRead: "knowledge.article.read",
7
+ botRead: "knowledge.article.bot.read",
8
+ indexManage: "knowledge.index.manage",
9
+ draftRead: "knowledge.article.draft.read",
10
+ draftWrite: "knowledge.article.draft.write",
11
+ evidenceRead: "knowledge.article.evidence.read",
12
+ evidenceSubmit: "knowledge.article.evidence.submit",
13
+ evidenceRevoke: "knowledge.article.evidence.revoke",
14
+ provenanceRead: "knowledge.article.provenance.read",
15
+ provenanceWrite: "knowledge.article.provenance.write",
16
+ reviewSubmit: "knowledge.article.review.submit",
17
+ review: "knowledge.article.review",
18
+ publish: "knowledge.article.publish",
19
+ retire: "knowledge.article.retire",
20
+ validationManage: "knowledge.validation.manage",
21
+ };
22
+ export const articleKinds = [
23
+ "explanation",
24
+ "walkthrough",
25
+ "troubleshooting",
26
+ "developer-reference",
27
+ ];
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AASA,+EAA+E;AAC/E,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,cAAc,EAAE,2BAA2B;IAC3C,gBAAgB,EAAE,6BAA6B;IAC/C,uBAAuB,EAAE,qCAAqC;IAC9D,WAAW,EAAE,wBAAwB;IACrC,OAAO,EAAE,4BAA4B;IACrC,WAAW,EAAE,wBAAwB;IACrC,SAAS,EAAE,8BAA8B;IACzC,UAAU,EAAE,+BAA+B;IAC3C,YAAY,EAAE,iCAAiC;IAC/C,cAAc,EAAE,mCAAmC;IACnD,cAAc,EAAE,mCAAmC;IACnD,cAAc,EAAE,mCAAmC;IACnD,eAAe,EAAE,oCAAoC;IACrD,YAAY,EAAE,iCAAiC;IAC/C,MAAM,EAAE,0BAA0B;IAClC,OAAO,EAAE,2BAA2B;IACpC,MAAM,EAAE,0BAA0B;IAClC,gBAAgB,EAAE,6BAA6B;CACvC,CAAC;AAKX,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,aAAa;IACb,aAAa;IACb,iBAAiB;IACjB,qBAAqB;CACb,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,39 @@
1
1
  {
2
2
  "name": "@pegma/knowledge-base-contracts",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Provider-neutral knowledge collections, revisions, validation, and approval contracts.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "files": [
12
+ "dist/**/*.d.ts",
13
+ "dist/**/*.d.ts.map",
14
+ "dist/**/*.js",
15
+ "dist/**/*.js.map"
16
+ ],
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/index.d.ts",
20
+ "import": "./dist/index.js"
21
+ }
22
+ },
23
+ "engines": {
24
+ "node": ">=22"
25
+ },
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/pegma-dev/knowledge-base.git",
29
+ "directory": "packages/contracts"
30
+ },
31
+ "dependencies": {
32
+ "@pegma/spine": "0.1.2"
33
+ },
34
+ "scripts": {
35
+ "build": "tsc -p tsconfig.json",
36
+ "check": "tsc -p tsconfig.json --noEmit",
37
+ "prepack": "pnpm run --silent build"
38
+ }
39
+ }