archctx-contracts 0.1.5

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 (100) hide show
  1. package/fixtures/boundary/agent-job-expired.json +33 -0
  2. package/fixtures/boundary/architecture-event-extension.json +41 -0
  3. package/fixtures/boundary/architecture-node-extension.json +13 -0
  4. package/fixtures/boundary/attestation-v2-error.json +43 -0
  5. package/fixtures/boundary/check-delivery-dead-letter.json +14 -0
  6. package/fixtures/boundary/evidence-binding-context-only.json +20 -0
  7. package/fixtures/boundary/practice-disabled-overlay.json +59 -0
  8. package/fixtures/boundary/recommendation-deferred.json +19 -0
  9. package/fixtures/boundary/review-challenge-v2-organization.json +15 -0
  10. package/fixtures/boundary/runner-identity-organization-scope.json +16 -0
  11. package/fixtures/invalid/adapter-fidelity-reverse-sync.json +9 -0
  12. package/fixtures/invalid/agent-job-direct-mutation.json +32 -0
  13. package/fixtures/invalid/architecture-event-source-body-field.json +39 -0
  14. package/fixtures/invalid/architecture-snapshot-unknown-mode.json +29 -0
  15. package/fixtures/invalid/attestation-v2-finding-field.json +39 -0
  16. package/fixtures/invalid/check-delivery-legacy-check-name.json +14 -0
  17. package/fixtures/invalid/cloud-egress-envelope-private-field.json +12 -0
  18. package/fixtures/invalid/compatibility-illegal-reason.json +17 -0
  19. package/fixtures/invalid/evidence-binding-summary-substring-authority.json +17 -0
  20. package/fixtures/invalid/evidence-item-source-body-field.json +27 -0
  21. package/fixtures/invalid/explorer-projection-write-field.json +21 -0
  22. package/fixtures/invalid/investigation-report-direct-mutation.json +38 -0
  23. package/fixtures/invalid/investigation-report-missing-proposed-delta.json +19 -0
  24. package/fixtures/invalid/node-unknown-field.json +10 -0
  25. package/fixtures/invalid/notification-event-code-field.json +11 -0
  26. package/fixtures/invalid/practice-policy-empty-test-evidence.json +15 -0
  27. package/fixtures/invalid/practice-policy-negative-recommendation-budget.json +10 -0
  28. package/fixtures/invalid/practice-unknown-field.json +56 -0
  29. package/fixtures/invalid/projection-target-invalid-ownership.json +18 -0
  30. package/fixtures/invalid/recommendation-feedback-implicit-acceptance.json +29 -0
  31. package/fixtures/invalid/recommendation-run-raw-input-field.json +33 -0
  32. package/fixtures/invalid/recommendation-source-body-field.json +17 -0
  33. package/fixtures/invalid/review-challenge-v2-private-field.json +16 -0
  34. package/fixtures/valid/adapter-fidelity.json +9 -0
  35. package/fixtures/valid/agent-job.json +33 -0
  36. package/fixtures/valid/architecture-candidate-delta-policy.json +45 -0
  37. package/fixtures/valid/architecture-candidate-delta.json +188 -0
  38. package/fixtures/valid/architecture-event.json +39 -0
  39. package/fixtures/valid/architecture-intervention.json +36 -0
  40. package/fixtures/valid/architecture-node.json +25 -0
  41. package/fixtures/valid/architecture-relation.json +14 -0
  42. package/fixtures/valid/architecture-snapshot.json +31 -0
  43. package/fixtures/valid/architecture-subject-selector.json +9 -0
  44. package/fixtures/valid/attestation-v2.json +38 -0
  45. package/fixtures/valid/attestation.json +25 -0
  46. package/fixtures/valid/changeset.json +30 -0
  47. package/fixtures/valid/chatgpt-ga-tool.json +9 -0
  48. package/fixtures/valid/check-delivery.json +14 -0
  49. package/fixtures/valid/cloud-egress-envelope.json +11 -0
  50. package/fixtures/valid/compatibility-contract.json +19 -0
  51. package/fixtures/valid/constraint.json +22 -0
  52. package/fixtures/valid/cross-repo-relation.json +23 -0
  53. package/fixtures/valid/device-identity.json +10 -0
  54. package/fixtures/valid/entitlement.json +12 -0
  55. package/fixtures/valid/evidence-binding.json +17 -0
  56. package/fixtures/valid/evidence-item.json +29 -0
  57. package/fixtures/valid/explorer-projection.json +53 -0
  58. package/fixtures/valid/explorer-service.json +11 -0
  59. package/fixtures/valid/external-document-resource.json +29 -0
  60. package/fixtures/valid/governance-key-status.json +11 -0
  61. package/fixtures/valid/investigation-report.json +38 -0
  62. package/fixtures/valid/landscape.json +36 -0
  63. package/fixtures/valid/likec4-mapping.json +14 -0
  64. package/fixtures/valid/notification-event.json +10 -0
  65. package/fixtures/valid/notification-provider.json +12 -0
  66. package/fixtures/valid/org-runner-identity.json +10 -0
  67. package/fixtures/valid/practice-catalog-manifest.json +16 -0
  68. package/fixtures/valid/practice-check-result.json +17 -0
  69. package/fixtures/valid/practice-checkpoint.json +94 -0
  70. package/fixtures/valid/practice-guidance.json +42 -0
  71. package/fixtures/valid/practice-match.json +23 -0
  72. package/fixtures/valid/practice-policy.json +33 -0
  73. package/fixtures/valid/practice-profile.json +22 -0
  74. package/fixtures/valid/practice-source.json +19 -0
  75. package/fixtures/valid/practice-waiver.json +14 -0
  76. package/fixtures/valid/practice.json +93 -0
  77. package/fixtures/valid/product-version-manifest.json +51 -0
  78. package/fixtures/valid/projection-target.json +18 -0
  79. package/fixtures/valid/recommendation-feedback.json +29 -0
  80. package/fixtures/valid/recommendation-run.json +33 -0
  81. package/fixtures/valid/recommendation.json +17 -0
  82. package/fixtures/valid/retrieval-config.json +20 -0
  83. package/fixtures/valid/retrieval-decision.json +26 -0
  84. package/fixtures/valid/retrieval-eval.json +14 -0
  85. package/fixtures/valid/review-challenge-v2.json +15 -0
  86. package/fixtures/valid/review-result.json +32 -0
  87. package/fixtures/valid/runner-identity.json +13 -0
  88. package/fixtures/valid/structurizr-mapping.json +15 -0
  89. package/fixtures/valid/task-context.json +23 -0
  90. package/package.json +17 -0
  91. package/src/control-plane-routes.ts +35 -0
  92. package/src/external-docs.ts +137 -0
  93. package/src/github-governance.ts +850 -0
  94. package/src/index.ts +9 -0
  95. package/src/ledger.ts +649 -0
  96. package/src/ports.ts +385 -0
  97. package/src/practices.ts +433 -0
  98. package/src/product-version.ts +108 -0
  99. package/src/schema.ts +145 -0
  100. package/src/validator.ts +95 -0
@@ -0,0 +1,137 @@
1
+ import type { Json } from "./schema";
2
+
3
+ export const EXTERNAL_DOCUMENTATION_RESOURCE_SCHEMA_VERSION = "archcontext.external-document/v1" as const;
4
+ export const CONTEXT7_LOCKFILE_SCHEMA_VERSION = "archcontext.context7-lock/v1" as const;
5
+
6
+ export type ExternalDocumentationProvider = "context7";
7
+ export type ExternalDocumentationTrust = "external-unverified";
8
+ export type ExternalDocumentationEnforcement = "advisory-only";
9
+ export type ExternalDocumentationCacheStatus = "fresh" | "stale" | "miss";
10
+ export type ExternalDocumentationMode = "manual" | "prepare-unknowns";
11
+
12
+ export interface ExternalDocumentationResourceSnippetV1 {
13
+ title: string;
14
+ contentPreview: string;
15
+ contentDigest: string;
16
+ sourceUri: string;
17
+ byteCount: number;
18
+ }
19
+
20
+ export interface ExternalDocumentationResourceV1 {
21
+ schemaVersion: typeof EXTERNAL_DOCUMENTATION_RESOURCE_SCHEMA_VERSION;
22
+ provider: ExternalDocumentationProvider;
23
+ libraryId: string;
24
+ requestedVersion?: string;
25
+ resolvedVersion?: string;
26
+ queryDigest: string;
27
+ contentDigest: string;
28
+ retrievedAt: string;
29
+ expiresAt: string;
30
+ trust: ExternalDocumentationTrust;
31
+ enforcement: ExternalDocumentationEnforcement;
32
+ cacheStatus: ExternalDocumentationCacheStatus;
33
+ uri: string;
34
+ byteCount: number;
35
+ snippets: ExternalDocumentationResourceSnippetV1[];
36
+ warning: "untrusted-documentation-data";
37
+ metadata?: Record<string, Json>;
38
+ }
39
+
40
+ export interface Context7LibraryPinV1 {
41
+ libraryId: string;
42
+ version: string;
43
+ pinnedAt: string;
44
+ source: "manual";
45
+ }
46
+
47
+ export interface Context7LockfileV1 {
48
+ schemaVersion: typeof CONTEXT7_LOCKFILE_SCHEMA_VERSION;
49
+ provider: "context7";
50
+ libraries: Context7LibraryPinV1[];
51
+ }
52
+
53
+ export interface ExternalDocumentationProviderHealth {
54
+ provider: ExternalDocumentationProvider;
55
+ enabled: boolean;
56
+ mode: ExternalDocumentationMode;
57
+ egress: "none" | "manual-only" | "prepare-unknowns";
58
+ cache: "sqlite";
59
+ keySource: "env" | "os-credential" | "none";
60
+ }
61
+
62
+ export interface ExternalDocumentationResolveInput {
63
+ provider: ExternalDocumentationProvider;
64
+ libraryName: string;
65
+ query: string;
66
+ fast?: boolean;
67
+ }
68
+
69
+ export interface ExternalDocumentationLibraryCandidate {
70
+ id: string;
71
+ title: string;
72
+ description?: string;
73
+ versions: string[];
74
+ trustScore?: number;
75
+ benchmarkScore?: number;
76
+ }
77
+
78
+ export interface ExternalDocumentationResolveResult {
79
+ schemaVersion: "archcontext.external-docs-resolve/v1";
80
+ provider: ExternalDocumentationProvider;
81
+ queryDigest: string;
82
+ candidates: ExternalDocumentationLibraryCandidate[];
83
+ searchFilterApplied: boolean;
84
+ egress: "manual-only";
85
+ }
86
+
87
+ export interface ExternalDocumentationFetchInput {
88
+ provider: ExternalDocumentationProvider;
89
+ libraryId: string;
90
+ version: string;
91
+ intent: string;
92
+ query?: string;
93
+ maxResults?: number;
94
+ ttlSeconds?: number;
95
+ forceRefresh?: boolean;
96
+ }
97
+
98
+ export interface ExternalDocumentationFetchResult {
99
+ schemaVersion: "archcontext.external-docs-fetch/v1";
100
+ provider: ExternalDocumentationProvider;
101
+ cacheStatus: ExternalDocumentationCacheStatus;
102
+ resource: ExternalDocumentationResourceV1;
103
+ request: {
104
+ libraryId: string;
105
+ version: string;
106
+ queryDigest: string;
107
+ intent: string;
108
+ };
109
+ }
110
+
111
+ export interface ExternalDocumentationPurgeInput {
112
+ provider?: ExternalDocumentationProvider;
113
+ libraryId?: string;
114
+ all?: boolean;
115
+ }
116
+
117
+ export interface ExternalDocumentationPurgeResult {
118
+ schemaVersion: "archcontext.external-docs-purge/v1";
119
+ purged: number;
120
+ }
121
+
122
+ export interface ExternalDocumentationCacheEntry {
123
+ provider: ExternalDocumentationProvider;
124
+ libraryId: string;
125
+ version: string;
126
+ queryDigest: string;
127
+ contentDigest: string;
128
+ resource: ExternalDocumentationResourceV1;
129
+ retrievedAt: string;
130
+ expiresAt: string;
131
+ }
132
+
133
+ export interface ExternalDocumentationPort {
134
+ health(): ExternalDocumentationProviderHealth | Promise<ExternalDocumentationProviderHealth>;
135
+ resolve(input: ExternalDocumentationResolveInput): Promise<ExternalDocumentationResolveResult>;
136
+ fetch(input: ExternalDocumentationFetchInput): Promise<ExternalDocumentationFetchResult>;
137
+ }