@logicsrc/schemas 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.
Files changed (194) hide show
  1. package/README.md +34 -0
  2. package/fixtures/agent.yaml +20 -0
  3. package/fixtures/agentad-ad.yaml +33 -0
  4. package/fixtures/agentad-placement.yaml +21 -0
  5. package/fixtures/opencontext/conformance.json +279 -0
  6. package/fixtures/opencontext/invalid/audit-event-missing-actor.json +5 -0
  7. package/fixtures/opencontext/invalid/audit-event-unknown-event.json +9 -0
  8. package/fixtures/opencontext/invalid/bundle-bad-digest.json +11 -0
  9. package/fixtures/opencontext/invalid/bundle-bad-id.json +11 -0
  10. package/fixtures/opencontext/invalid/bundle-missing-digest.json +10 -0
  11. package/fixtures/opencontext/invalid/bundle-unknown-exclusion-reason.json +17 -0
  12. package/fixtures/opencontext/invalid/decision-bad-status.json +7 -0
  13. package/fixtures/opencontext/invalid/decision-missing-decision.json +5 -0
  14. package/fixtures/opencontext/invalid/decision-wrong-type.json +6 -0
  15. package/fixtures/opencontext/invalid/diagnostic-missing-ok.json +4 -0
  16. package/fixtures/opencontext/invalid/diagnostic-unknown-code.json +11 -0
  17. package/fixtures/opencontext/invalid/manifest-bad-authority.json +10 -0
  18. package/fixtures/opencontext/invalid/manifest-bad-extension.json +9 -0
  19. package/fixtures/opencontext/invalid/manifest-bad-id.json +4 -0
  20. package/fixtures/opencontext/invalid/manifest-bad-ttl.json +7 -0
  21. package/fixtures/opencontext/invalid/manifest-missing-version.json +3 -0
  22. package/fixtures/opencontext/invalid/manifest-role-bad-pattern.json +11 -0
  23. package/fixtures/opencontext/invalid/manifest-unknown-key.json +5 -0
  24. package/fixtures/opencontext/invalid/object-bad-digest.json +10 -0
  25. package/fixtures/opencontext/invalid/object-bad-id.json +4 -0
  26. package/fixtures/opencontext/invalid/object-bad-layer.json +5 -0
  27. package/fixtures/opencontext/invalid/object-bad-redaction-mode.json +10 -0
  28. package/fixtures/opencontext/invalid/object-bad-supersedes.json +7 -0
  29. package/fixtures/opencontext/invalid/object-confidence-out-of-range.json +5 -0
  30. package/fixtures/opencontext/invalid/object-extra-property.json +5 -0
  31. package/fixtures/opencontext/invalid/object-missing-id.json +3 -0
  32. package/fixtures/opencontext/invalid/object-missing-type.json +3 -0
  33. package/fixtures/opencontext/invalid/object-source-without-uri.json +9 -0
  34. package/fixtures/opencontext/invalid/object-unknown-authority.json +5 -0
  35. package/fixtures/opencontext/invalid/object-unknown-classification.json +5 -0
  36. package/fixtures/opencontext/invalid/object-unknown-trust.json +5 -0
  37. package/fixtures/opencontext/invalid/provenance-canonical-false.json +4 -0
  38. package/fixtures/opencontext/invalid/provenance-no-source.json +3 -0
  39. package/fixtures/opencontext/invalid/role-bad-classification.json +4 -0
  40. package/fixtures/opencontext/invalid/role-bad-include.json +6 -0
  41. package/fixtures/opencontext/invalid-manifest.json +177 -0
  42. package/fixtures/opencontext/resolution/authority-conflict/context/policies/refunds-observed.md +10 -0
  43. package/fixtures/opencontext/resolution/authority-conflict/context/policies/refunds.md +12 -0
  44. package/fixtures/opencontext/resolution/authority-conflict/expected.json +21 -0
  45. package/fixtures/opencontext/resolution/authority-conflict/opencontext.yaml +11 -0
  46. package/fixtures/opencontext/resolution/classification-ceiling/context/docs/handbook.md +11 -0
  47. package/fixtures/opencontext/resolution/classification-ceiling/context/docs/litigation.md +11 -0
  48. package/fixtures/opencontext/resolution/classification-ceiling/expected.json +32 -0
  49. package/fixtures/opencontext/resolution/classification-ceiling/opencontext.yaml +16 -0
  50. package/fixtures/opencontext/resolution/deny-overrides-allow/context/mission.md +10 -0
  51. package/fixtures/opencontext/resolution/deny-overrides-allow/context/policies/internal/margins.md +10 -0
  52. package/fixtures/opencontext/resolution/deny-overrides-allow/context/policies/refunds.md +10 -0
  53. package/fixtures/opencontext/resolution/deny-overrides-allow/expected.json +19 -0
  54. package/fixtures/opencontext/resolution/deny-overrides-allow/opencontext.yaml +17 -0
  55. package/fixtures/opencontext/resolution/duplicate-canonical/context/policies/refunds-rewrite.md +12 -0
  56. package/fixtures/opencontext/resolution/duplicate-canonical/context/policies/refunds.md +12 -0
  57. package/fixtures/opencontext/resolution/duplicate-canonical/expected.json +10 -0
  58. package/fixtures/opencontext/resolution/duplicate-canonical/opencontext.yaml +11 -0
  59. package/fixtures/opencontext/resolution/lifecycle/context/notes/current.md +11 -0
  60. package/fixtures/opencontext/resolution/lifecycle/context/notes/expired.md +12 -0
  61. package/fixtures/opencontext/resolution/lifecycle/context/notes/future.md +12 -0
  62. package/fixtures/opencontext/resolution/lifecycle/context/notes/stale.md +11 -0
  63. package/fixtures/opencontext/resolution/lifecycle/expected.json +30 -0
  64. package/fixtures/opencontext/resolution/lifecycle/opencontext.yaml +14 -0
  65. package/fixtures/opencontext/resolution/object-permissions/context/policies/payroll.md +12 -0
  66. package/fixtures/opencontext/resolution/object-permissions/context/policies/refunds.md +10 -0
  67. package/fixtures/opencontext/resolution/object-permissions/expected.json +32 -0
  68. package/fixtures/opencontext/resolution/object-permissions/opencontext.yaml +14 -0
  69. package/fixtures/opencontext/resolution/redaction/context/customers/acme.json +21 -0
  70. package/fixtures/opencontext/resolution/redaction/expected.json +28 -0
  71. package/fixtures/opencontext/resolution/redaction/opencontext.yaml +19 -0
  72. package/fixtures/opencontext/resolution/supersession/context/pricing/enterprise.v1.md +12 -0
  73. package/fixtures/opencontext/resolution/supersession/context/pricing/enterprise.v2.md +14 -0
  74. package/fixtures/opencontext/resolution/supersession/expected.json +33 -0
  75. package/fixtures/opencontext/resolution/supersession/opencontext.yaml +11 -0
  76. package/fixtures/opencontext/valid/audit-event.json +26 -0
  77. package/fixtures/opencontext/valid/bundle.json +67 -0
  78. package/fixtures/opencontext/valid/decision.json +51 -0
  79. package/fixtures/opencontext/valid/diagnostic.json +37 -0
  80. package/fixtures/opencontext/valid/manifest-minimal.json +4 -0
  81. package/fixtures/opencontext/valid/manifest.json +134 -0
  82. package/fixtures/opencontext/valid/object-minimal.json +4 -0
  83. package/fixtures/opencontext/valid/object-policy.json +75 -0
  84. package/fixtures/opencontext/valid/object-structured.json +34 -0
  85. package/fixtures/opencontext/valid/object-untrusted.json +19 -0
  86. package/fixtures/opencontext/valid/provenance-canonical.json +4 -0
  87. package/fixtures/opencontext/valid/provenance.json +14 -0
  88. package/fixtures/opencontext/valid/role.json +38 -0
  89. package/fixtures/openontology/conformance.json +158 -0
  90. package/fixtures/openontology/invalid/action-no-permissions.json +13 -0
  91. package/fixtures/openontology/invalid/changeset-empty-operations.json +10 -0
  92. package/fixtures/openontology/invalid/changeset-unknown-op.json +15 -0
  93. package/fixtures/openontology/invalid/claim-both-objects.json +14 -0
  94. package/fixtures/openontology/invalid/claim-confidence-out-of-range.json +14 -0
  95. package/fixtures/openontology/invalid/claim-extra-property.json +14 -0
  96. package/fixtures/openontology/invalid/claim-unknown-status.json +13 -0
  97. package/fixtures/openontology/invalid/entity-missing-canonical-name.json +8 -0
  98. package/fixtures/openontology/invalid/evidence-unknown-selector.json +10 -0
  99. package/fixtures/openontology/invalid/manifest-bad-id.json +15 -0
  100. package/fixtures/openontology/invalid/manifest-bad-version.json +15 -0
  101. package/fixtures/openontology/invalid/manifest-no-maintainer.json +11 -0
  102. package/fixtures/openontology/invalid/relationship-no-range.json +11 -0
  103. package/fixtures/openontology/valid/action.json +29 -0
  104. package/fixtures/openontology/valid/approval.json +12 -0
  105. package/fixtures/openontology/valid/changeset.json +34 -0
  106. package/fixtures/openontology/valid/claim-relationship.json +23 -0
  107. package/fixtures/openontology/valid/claim-value.json +15 -0
  108. package/fixtures/openontology/valid/constraint.json +12 -0
  109. package/fixtures/openontology/valid/entity-type.json +16 -0
  110. package/fixtures/openontology/valid/entity.json +16 -0
  111. package/fixtures/openontology/valid/event.json +17 -0
  112. package/fixtures/openontology/valid/evidence.json +12 -0
  113. package/fixtures/openontology/valid/manifest.json +21 -0
  114. package/fixtures/openontology/valid/namespace.json +7 -0
  115. package/fixtures/openontology/valid/property.json +8 -0
  116. package/fixtures/openontology/valid/query-adhoc.json +16 -0
  117. package/fixtures/openontology/valid/query.json +24 -0
  118. package/fixtures/openontology/valid/relationship-type.json +16 -0
  119. package/fixtures/openontology/valid/review.json +17 -0
  120. package/fixtures/openontology/valid/source.json +13 -0
  121. package/fixtures/openprd/conformance.json +104 -0
  122. package/fixtures/openprd/invalid/bad-filename.md +41 -0
  123. package/fixtures/openprd/invalid/bad-id-format.md +41 -0
  124. package/fixtures/openprd/invalid/bad-status.md +41 -0
  125. package/fixtures/openprd/invalid/dates-backwards.md +43 -0
  126. package/fixtures/openprd/invalid/duplicate-requirement.md +42 -0
  127. package/fixtures/openprd/invalid/id-mismatch.md +41 -0
  128. package/fixtures/openprd/invalid/missing-section.md +37 -0
  129. package/fixtures/openprd/invalid/missing-title.md +40 -0
  130. package/fixtures/openprd/invalid/no-front-matter.md +33 -0
  131. package/fixtures/openprd/invalid/out-of-order.md +41 -0
  132. package/fixtures/openprd/invalid/superseded-without-replacement.md +41 -0
  133. package/fixtures/openprd/invalid/unknown-key.md +42 -0
  134. package/fixtures/openprd/valid/bold-requirements.md +41 -0
  135. package/fixtures/openprd/valid/full.md +48 -0
  136. package/fixtures/openprd/valid/minimal.md +41 -0
  137. package/fixtures/openprd/valid/none-sections.md +41 -0
  138. package/fixtures/openprd/valid/subsections.md +47 -0
  139. package/fixtures/openprd/valid/superseded.md +42 -0
  140. package/fixtures/openprd-prd.yaml +12 -0
  141. package/fixtures/pull-request.yaml +24 -0
  142. package/fixtures/repo.yaml +27 -0
  143. package/fixtures/task.yaml +26 -0
  144. package/package.json +91 -0
  145. package/schemas/agentad-ad-request.schema.json +32 -0
  146. package/schemas/agentad-ad-response.schema.json +31 -0
  147. package/schemas/agentad-ad.schema.json +79 -0
  148. package/schemas/agentad-campaign.schema.json +40 -0
  149. package/schemas/agentad-click.schema.json +23 -0
  150. package/schemas/agentad-impression.schema.json +18 -0
  151. package/schemas/agentad-placement.schema.json +46 -0
  152. package/schemas/logicsrc-account-audit-event.schema.json +31 -0
  153. package/schemas/logicsrc-account-grant.schema.json +48 -0
  154. package/schemas/logicsrc-account-provider.schema.json +31 -0
  155. package/schemas/logicsrc-agent.schema.json +51 -0
  156. package/schemas/logicsrc-connected-account.schema.json +39 -0
  157. package/schemas/logicsrc-credential-audit-event.schema.json +32 -0
  158. package/schemas/logicsrc-credential-provider.schema.json +28 -0
  159. package/schemas/logicsrc-credential-sync-plan.schema.json +56 -0
  160. package/schemas/logicsrc-credential-sync-run.schema.json +35 -0
  161. package/schemas/logicsrc-email-message.schema.json +22 -0
  162. package/schemas/logicsrc-event.schema.json +25 -0
  163. package/schemas/logicsrc-opencontext-audit-event.schema.json +69 -0
  164. package/schemas/logicsrc-opencontext-bundle.schema.json +210 -0
  165. package/schemas/logicsrc-opencontext-decision.schema.json +229 -0
  166. package/schemas/logicsrc-opencontext-diagnostic.schema.json +123 -0
  167. package/schemas/logicsrc-opencontext-manifest.schema.json +337 -0
  168. package/schemas/logicsrc-opencontext-object.schema.json +311 -0
  169. package/schemas/logicsrc-opencontext-provenance.schema.json +76 -0
  170. package/schemas/logicsrc-opencontext-role.schema.json +93 -0
  171. package/schemas/logicsrc-openontology-action.schema.json +90 -0
  172. package/schemas/logicsrc-openontology-approval.schema.json +39 -0
  173. package/schemas/logicsrc-openontology-changeset.schema.json +168 -0
  174. package/schemas/logicsrc-openontology-claim.schema.json +148 -0
  175. package/schemas/logicsrc-openontology-constraint.schema.json +104 -0
  176. package/schemas/logicsrc-openontology-entity-type.schema.json +107 -0
  177. package/schemas/logicsrc-openontology-entity.schema.json +59 -0
  178. package/schemas/logicsrc-openontology-event.schema.json +60 -0
  179. package/schemas/logicsrc-openontology-evidence.schema.json +121 -0
  180. package/schemas/logicsrc-openontology-manifest.schema.json +148 -0
  181. package/schemas/logicsrc-openontology-namespace.schema.json +21 -0
  182. package/schemas/logicsrc-openontology-package.schema.json +73 -0
  183. package/schemas/logicsrc-openontology-property.schema.json +83 -0
  184. package/schemas/logicsrc-openontology-query.schema.json +207 -0
  185. package/schemas/logicsrc-openontology-relationship-type.schema.json +57 -0
  186. package/schemas/logicsrc-openontology-review.schema.json +37 -0
  187. package/schemas/logicsrc-openontology-source.schema.json +43 -0
  188. package/schemas/logicsrc-plugin.schema.json +35 -0
  189. package/schemas/logicsrc-pull-request.schema.json +73 -0
  190. package/schemas/logicsrc-repo.schema.json +73 -0
  191. package/schemas/logicsrc-run.schema.json +69 -0
  192. package/schemas/logicsrc-social-post.schema.json +26 -0
  193. package/schemas/logicsrc-task.schema.json +114 -0
  194. package/schemas/openprd-prd.schema.json +79 -0
@@ -0,0 +1,4 @@
1
+ {
2
+ "id": "policies.refunds",
3
+ "canonical_source": false
4
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "id": "policies.refunds"
3
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "id": "support",
3
+ "max_classification": "top-secret"
4
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "id": "support",
3
+ "include": [
4
+ "Policies.*"
5
+ ]
6
+ }
@@ -0,0 +1,177 @@
1
+ [
2
+ {
3
+ "fixture": "invalid/manifest-missing-version.json",
4
+ "kind": "opencontext-manifest",
5
+ "why": "manifest has no opencontext version"
6
+ },
7
+ {
8
+ "fixture": "invalid/manifest-bad-id.json",
9
+ "kind": "opencontext-manifest",
10
+ "why": "namespace id must be a lowercase slug"
11
+ },
12
+ {
13
+ "fixture": "invalid/manifest-unknown-key.json",
14
+ "kind": "opencontext-manifest",
15
+ "why": "unknown top-level key (contexts vs context)"
16
+ },
17
+ {
18
+ "fixture": "invalid/manifest-bad-authority.json",
19
+ "kind": "opencontext-manifest",
20
+ "why": "authority precedence contains a level that is not defined"
21
+ },
22
+ {
23
+ "fixture": "invalid/manifest-bad-ttl.json",
24
+ "kind": "opencontext-manifest",
25
+ "why": "duration must look like 30d"
26
+ },
27
+ {
28
+ "fixture": "invalid/manifest-role-bad-pattern.json",
29
+ "kind": "opencontext-manifest",
30
+ "why": "a wildcard must be a whole segment, never a substring"
31
+ },
32
+ {
33
+ "fixture": "invalid/manifest-bad-extension.json",
34
+ "kind": "opencontext-manifest",
35
+ "why": "extension keys must be reverse-DNS namespaced"
36
+ },
37
+ {
38
+ "fixture": "invalid/object-missing-type.json",
39
+ "kind": "opencontext-object",
40
+ "why": "type is required"
41
+ },
42
+ {
43
+ "fixture": "invalid/object-missing-id.json",
44
+ "kind": "opencontext-object",
45
+ "why": "id is required"
46
+ },
47
+ {
48
+ "fixture": "invalid/object-bad-id.json",
49
+ "kind": "opencontext-object",
50
+ "why": "id must be a dotted lowercase slug"
51
+ },
52
+ {
53
+ "fixture": "invalid/object-unknown-authority.json",
54
+ "kind": "opencontext-object",
55
+ "why": "authority must be one of the six defined levels"
56
+ },
57
+ {
58
+ "fixture": "invalid/object-unknown-classification.json",
59
+ "kind": "opencontext-object",
60
+ "why": "classification must be public/internal/confidential/restricted"
61
+ },
62
+ {
63
+ "fixture": "invalid/object-unknown-trust.json",
64
+ "kind": "opencontext-object",
65
+ "why": "trust must be trusted/verified/untrusted"
66
+ },
67
+ {
68
+ "fixture": "invalid/object-extra-property.json",
69
+ "kind": "opencontext-object",
70
+ "why": "unknown field must go under extensions"
71
+ },
72
+ {
73
+ "fixture": "invalid/object-confidence-out-of-range.json",
74
+ "kind": "opencontext-object",
75
+ "why": "confidence must be between 0 and 1"
76
+ },
77
+ {
78
+ "fixture": "invalid/object-bad-digest.json",
79
+ "kind": "opencontext-object",
80
+ "why": "source digest must be sha256:<64 hex>"
81
+ },
82
+ {
83
+ "fixture": "invalid/object-bad-layer.json",
84
+ "kind": "opencontext-object",
85
+ "why": "layer must be L0 to L5"
86
+ },
87
+ {
88
+ "fixture": "invalid/object-source-without-uri.json",
89
+ "kind": "opencontext-object",
90
+ "why": "every source needs a uri"
91
+ },
92
+ {
93
+ "fixture": "invalid/object-bad-supersedes.json",
94
+ "kind": "opencontext-object",
95
+ "why": "version pin must be @<integer>"
96
+ },
97
+ {
98
+ "fixture": "invalid/object-bad-redaction-mode.json",
99
+ "kind": "opencontext-object",
100
+ "why": "redaction mode must be remove/mask/hash"
101
+ },
102
+ {
103
+ "fixture": "invalid/decision-missing-decision.json",
104
+ "kind": "opencontext-decision",
105
+ "why": "a decision record must state the decision"
106
+ },
107
+ {
108
+ "fixture": "invalid/decision-wrong-type.json",
109
+ "kind": "opencontext-decision",
110
+ "why": "type must be decision"
111
+ },
112
+ {
113
+ "fixture": "invalid/decision-bad-status.json",
114
+ "kind": "opencontext-decision",
115
+ "why": "status must be proposed/accepted/rejected/superseded/deprecated"
116
+ },
117
+ {
118
+ "fixture": "invalid/bundle-missing-digest.json",
119
+ "kind": "opencontext-bundle",
120
+ "why": "a bundle must carry a digest"
121
+ },
122
+ {
123
+ "fixture": "invalid/bundle-bad-digest.json",
124
+ "kind": "opencontext-bundle",
125
+ "why": "digest must be sha256:<64 hex>"
126
+ },
127
+ {
128
+ "fixture": "invalid/bundle-bad-id.json",
129
+ "kind": "opencontext-bundle",
130
+ "why": "bundle_id must be prefixed ocb_"
131
+ },
132
+ {
133
+ "fixture": "invalid/bundle-unknown-exclusion-reason.json",
134
+ "kind": "opencontext-bundle",
135
+ "why": "exclusion reasons are a closed set"
136
+ },
137
+ {
138
+ "fixture": "invalid/role-bad-classification.json",
139
+ "kind": "opencontext-role",
140
+ "why": "max_classification must be one of the four bands"
141
+ },
142
+ {
143
+ "fixture": "invalid/role-bad-include.json",
144
+ "kind": "opencontext-role",
145
+ "why": "scope patterns are lowercase"
146
+ },
147
+ {
148
+ "fixture": "invalid/provenance-no-source.json",
149
+ "kind": "opencontext-provenance",
150
+ "why": "must declare sources or canonical_source"
151
+ },
152
+ {
153
+ "fixture": "invalid/provenance-canonical-false.json",
154
+ "kind": "opencontext-provenance",
155
+ "why": "canonical_source: false does not satisfy the requirement"
156
+ },
157
+ {
158
+ "fixture": "invalid/diagnostic-unknown-code.json",
159
+ "kind": "opencontext-diagnostic",
160
+ "why": "diagnostic codes are normative and closed"
161
+ },
162
+ {
163
+ "fixture": "invalid/diagnostic-missing-ok.json",
164
+ "kind": "opencontext-diagnostic",
165
+ "why": "ok is required \u2014 it is what the exit code follows"
166
+ },
167
+ {
168
+ "fixture": "invalid/audit-event-unknown-event.json",
169
+ "kind": "opencontext-audit-event",
170
+ "why": "event names are a closed set"
171
+ },
172
+ {
173
+ "fixture": "invalid/audit-event-missing-actor.json",
174
+ "kind": "opencontext-audit-event",
175
+ "why": "an audit event without an actor is not attributable"
176
+ }
177
+ ]
@@ -0,0 +1,10 @@
1
+ ---
2
+ id: policies.refunds-observed
3
+ type: policy
4
+ layer: L3
5
+ authority: observed
6
+ owner: support
7
+ canonical_source: true
8
+ ---
9
+
10
+ An agent observed staff granting refunds up to 60 days.
@@ -0,0 +1,12 @@
1
+ ---
2
+ id: policies.refunds
3
+ type: policy
4
+ layer: L3
5
+ authority: canonical
6
+ owner: support
7
+ canonical_source: true
8
+ conflicts_with:
9
+ - policies.refunds-observed
10
+ ---
11
+
12
+ Refunds within 30 days.
@@ -0,0 +1,21 @@
1
+ {
2
+ "description": "A declared conflict that authority settles is still reported, never silently hidden. Canonical outranks observed, and the losing side is named in the warning.",
3
+ "resolve": {
4
+ "role": "everyone",
5
+ "at": "2026-08-09T12:00:00Z"
6
+ },
7
+ "expect": {
8
+ "included": [
9
+ "policies.refunds",
10
+ "policies.refunds-observed"
11
+ ],
12
+ "warnings": [
13
+ "conflict-declared"
14
+ ]
15
+ },
16
+ "validate": {
17
+ "expectDiagnostics": [
18
+ "conflict-declared"
19
+ ]
20
+ }
21
+ }
@@ -0,0 +1,11 @@
1
+ opencontext: "1.0"
2
+ id: conflict-test
3
+ name: Declared conflicts
4
+
5
+ collections:
6
+ policies: ./context/policies/**
7
+
8
+ roles:
9
+ everyone:
10
+ include:
11
+ - policies.*
@@ -0,0 +1,11 @@
1
+ ---
2
+ id: docs.handbook
3
+ type: knowledge
4
+ layer: L2
5
+ authority: approved
6
+ owner: ops
7
+ classification: internal
8
+ canonical_source: true
9
+ ---
10
+
11
+ How we work.
@@ -0,0 +1,11 @@
1
+ ---
2
+ id: docs.litigation
3
+ type: knowledge
4
+ layer: L2
5
+ authority: approved
6
+ owner: legal
7
+ classification: restricted
8
+ canonical_source: true
9
+ ---
10
+
11
+ Privileged and confidential.
@@ -0,0 +1,32 @@
1
+ {
2
+ "description": "Classification bounds a role regardless of scope: support includes docs.* and is still denied the restricted document, while legal is not.",
3
+ "resolve": {
4
+ "role": "support",
5
+ "at": "2026-08-09T12:00:00Z"
6
+ },
7
+ "expect": {
8
+ "included": [
9
+ "docs.handbook"
10
+ ],
11
+ "excluded": [
12
+ {
13
+ "id": "docs.litigation",
14
+ "reason": "classification-denied"
15
+ }
16
+ ]
17
+ },
18
+ "also": [
19
+ {
20
+ "resolve": {
21
+ "role": "legal",
22
+ "at": "2026-08-09T12:00:00Z"
23
+ },
24
+ "expect": {
25
+ "included": [
26
+ "docs.handbook",
27
+ "docs.litigation"
28
+ ]
29
+ }
30
+ }
31
+ ]
32
+ }
@@ -0,0 +1,16 @@
1
+ opencontext: "1.0"
2
+ id: classification-test
3
+ name: Classification ceiling
4
+
5
+ collections:
6
+ docs: ./context/docs/**
7
+
8
+ roles:
9
+ support:
10
+ include:
11
+ - docs.*
12
+ max_classification: internal
13
+ legal:
14
+ include:
15
+ - docs.*
16
+ max_classification: restricted
@@ -0,0 +1,10 @@
1
+ ---
2
+ id: mission
3
+ type: mission
4
+ layer: L0
5
+ authority: canonical
6
+ owner: founders
7
+ canonical_source: true
8
+ ---
9
+
10
+ Make refunds boring.
@@ -0,0 +1,10 @@
1
+ ---
2
+ id: policies.internal.margins
3
+ type: policy
4
+ layer: L3
5
+ authority: canonical
6
+ owner: finance
7
+ canonical_source: true
8
+ ---
9
+
10
+ Gross margin floor is 62%.
@@ -0,0 +1,10 @@
1
+ ---
2
+ id: policies.refunds
3
+ type: policy
4
+ layer: L3
5
+ authority: canonical
6
+ owner: support
7
+ canonical_source: true
8
+ ---
9
+
10
+ Refunds within 30 days.
@@ -0,0 +1,19 @@
1
+ {
2
+ "description": "An exclude pattern beats an include that also matches. Deny overrides allow, unconditionally.",
3
+ "resolve": {
4
+ "role": "support",
5
+ "at": "2026-08-09T12:00:00Z"
6
+ },
7
+ "expect": {
8
+ "included": [
9
+ "mission",
10
+ "policies.refunds"
11
+ ],
12
+ "excluded": [
13
+ {
14
+ "id": "policies.internal.margins",
15
+ "reason": "scope-exclusion"
16
+ }
17
+ ]
18
+ }
19
+ }
@@ -0,0 +1,17 @@
1
+ opencontext: "1.0"
2
+ id: scope-test
3
+ name: Deny overrides allow
4
+
5
+ context:
6
+ mission: ./context/mission.md
7
+
8
+ collections:
9
+ policies: ./context/policies/**
10
+
11
+ roles:
12
+ support:
13
+ include:
14
+ - mission
15
+ - policies.*
16
+ exclude:
17
+ - policies.internal.*
@@ -0,0 +1,12 @@
1
+ ---
2
+ id: policies.refunds
3
+ type: policy
4
+ layer: L3
5
+ version: 2
6
+ authority: canonical
7
+ owner: support
8
+ canonical_source: true
9
+ updated: 2026-08-01T00:00:00Z
10
+ ---
11
+
12
+ Refunds within 60 days. Nobody added supersedes.
@@ -0,0 +1,12 @@
1
+ ---
2
+ id: policies.refunds
3
+ type: policy
4
+ layer: L3
5
+ version: 1
6
+ authority: canonical
7
+ owner: support
8
+ canonical_source: true
9
+ updated: 2026-01-01T00:00:00Z
10
+ ---
11
+
12
+ Refunds within 30 days.
@@ -0,0 +1,10 @@
1
+ {
2
+ "description": "Two active canonical objects for one id, with no supersession linking them. Canonical means exactly one source of truth, so this is an error a strict run must fail on.",
3
+ "validate": {
4
+ "expectDiagnostics": [
5
+ "duplicate-canonical",
6
+ "multiple-active-versions"
7
+ ],
8
+ "expectFailure": true
9
+ }
10
+ }
@@ -0,0 +1,11 @@
1
+ opencontext: "1.0"
2
+ id: duplicate-test
3
+ name: Duplicate canonical
4
+
5
+ collections:
6
+ policies: ./context/policies/**
7
+
8
+ roles:
9
+ everyone:
10
+ include:
11
+ - policies.*
@@ -0,0 +1,11 @@
1
+ ---
2
+ id: notes.current
3
+ type: note
4
+ layer: L2
5
+ authority: reference
6
+ owner: ops
7
+ canonical_source: true
8
+ updated: 2026-08-01T00:00:00Z
9
+ ---
10
+
11
+ Fresh, inside the 30d window.
@@ -0,0 +1,12 @@
1
+ ---
2
+ id: notes.expired
3
+ type: note
4
+ layer: L2
5
+ authority: reference
6
+ owner: ops
7
+ canonical_source: true
8
+ updated: 2026-08-01T00:00:00Z
9
+ expires: 2026-08-05T00:00:00Z
10
+ ---
11
+
12
+ Expired before the resolution timestamp.
@@ -0,0 +1,12 @@
1
+ ---
2
+ id: notes.future
3
+ type: note
4
+ layer: L2
5
+ authority: reference
6
+ owner: ops
7
+ canonical_source: true
8
+ updated: 2026-08-01T00:00:00Z
9
+ valid_from: 2027-01-01T00:00:00Z
10
+ ---
11
+
12
+ Not valid until next year.
@@ -0,0 +1,11 @@
1
+ ---
2
+ id: notes.stale
3
+ type: note
4
+ layer: L2
5
+ authority: reference
6
+ owner: ops
7
+ canonical_source: true
8
+ updated: 2026-01-01T00:00:00Z
9
+ ---
10
+
11
+ Outside the 30d window, so stale — resolved anyway, and reported.
@@ -0,0 +1,30 @@
1
+ {
2
+ "description": "Lifecycle is computed against the resolution timestamp. Expired and not-yet-valid context is excluded; stale context is still resolved, and warned about \u2014 silence would be worse than staleness.",
3
+ "resolve": {
4
+ "role": "everyone",
5
+ "at": "2026-08-09T12:00:00Z"
6
+ },
7
+ "expect": {
8
+ "included": [
9
+ "notes.current",
10
+ "notes.stale"
11
+ ],
12
+ "excluded": [
13
+ {
14
+ "id": "notes.expired",
15
+ "reason": "expired"
16
+ },
17
+ {
18
+ "id": "notes.future",
19
+ "reason": "not-yet-valid"
20
+ }
21
+ ],
22
+ "warnings": [
23
+ "stale"
24
+ ],
25
+ "lifecycle": {
26
+ "notes.current": "current",
27
+ "notes.stale": "stale"
28
+ }
29
+ }
30
+ }
@@ -0,0 +1,14 @@
1
+ opencontext: "1.0"
2
+ id: lifecycle-test
3
+ name: Lifecycle
4
+
5
+ collections:
6
+ notes: ./context/notes/**
7
+
8
+ freshness:
9
+ default_ttl: 30d
10
+
11
+ roles:
12
+ everyone:
13
+ include:
14
+ - notes.*
@@ -0,0 +1,12 @@
1
+ ---
2
+ id: policies.payroll
3
+ type: policy
4
+ layer: L3
5
+ authority: canonical
6
+ owner: finance
7
+ canonical_source: true
8
+ permissions:
9
+ read: [finance]
10
+ ---
11
+
12
+ Payroll runs on the 25th.
@@ -0,0 +1,10 @@
1
+ ---
2
+ id: policies.refunds
3
+ type: policy
4
+ layer: L3
5
+ authority: canonical
6
+ owner: support
7
+ canonical_source: true
8
+ ---
9
+
10
+ Refunds within 30 days.
@@ -0,0 +1,32 @@
1
+ {
2
+ "description": "An object-level read grant narrows a role that would otherwise include it. Both roles include policies.*; only finance may read the payroll policy.",
3
+ "resolve": {
4
+ "role": "support",
5
+ "at": "2026-08-09T12:00:00Z"
6
+ },
7
+ "expect": {
8
+ "included": [
9
+ "policies.refunds"
10
+ ],
11
+ "excluded": [
12
+ {
13
+ "id": "policies.payroll",
14
+ "reason": "permission-denied"
15
+ }
16
+ ]
17
+ },
18
+ "also": [
19
+ {
20
+ "resolve": {
21
+ "role": "finance",
22
+ "at": "2026-08-09T12:00:00Z"
23
+ },
24
+ "expect": {
25
+ "included": [
26
+ "policies.payroll",
27
+ "policies.refunds"
28
+ ]
29
+ }
30
+ }
31
+ ]
32
+ }
@@ -0,0 +1,14 @@
1
+ opencontext: "1.0"
2
+ id: permissions-test
3
+ name: Object-level permissions
4
+
5
+ collections:
6
+ policies: ./context/policies/**
7
+
8
+ roles:
9
+ support:
10
+ include:
11
+ - policies.*
12
+ finance:
13
+ include:
14
+ - policies.*
@@ -0,0 +1,21 @@
1
+ {
2
+ "id": "customers.acme",
3
+ "type": "customer",
4
+ "layer": "L2",
5
+ "title": "ACME Inc.",
6
+ "authority": "reference",
7
+ "owner": "support",
8
+ "classification": "confidential",
9
+ "canonical_source": true,
10
+ "content": {
11
+ "name": "ACME Inc.",
12
+ "plan": "enterprise",
13
+ "ssn": "000-00-0000",
14
+ "contacts": [
15
+ {
16
+ "name": "Dana",
17
+ "email": "dana@acme.example"
18
+ }
19
+ ]
20
+ }
21
+ }