@neurcode-ai/contracts 0.1.1 → 0.1.3

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 (82) hide show
  1. package/dist/admission/framing.d.ts +38 -0
  2. package/dist/admission/framing.d.ts.map +1 -0
  3. package/dist/admission/framing.js +78 -0
  4. package/dist/admission/framing.js.map +1 -0
  5. package/dist/admission/index.d.ts +4 -0
  6. package/dist/admission/index.d.ts.map +1 -0
  7. package/dist/admission/index.js +37 -0
  8. package/dist/admission/index.js.map +1 -0
  9. package/dist/admission/privacy.d.ts +23 -0
  10. package/dist/admission/privacy.d.ts.map +1 -0
  11. package/dist/admission/privacy.js +99 -0
  12. package/dist/admission/privacy.js.map +1 -0
  13. package/dist/admission/schema.d.ts +277 -0
  14. package/dist/admission/schema.d.ts.map +1 -0
  15. package/dist/admission/schema.js +156 -0
  16. package/dist/admission/schema.js.map +1 -0
  17. package/dist/index.d.ts +91 -11
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +182 -17
  20. package/dist/index.js.map +1 -1
  21. package/dist/intelligence.d.ts +522 -0
  22. package/dist/intelligence.d.ts.map +1 -0
  23. package/dist/intelligence.js +5 -0
  24. package/dist/intelligence.js.map +1 -0
  25. package/dist/remediation/capabilities.d.ts +36 -0
  26. package/dist/remediation/capabilities.d.ts.map +1 -0
  27. package/dist/remediation/capabilities.js +7 -0
  28. package/dist/remediation/capabilities.js.map +1 -0
  29. package/dist/remediation/index.d.ts +5 -0
  30. package/dist/remediation/index.d.ts.map +1 -0
  31. package/dist/remediation/index.js +3 -0
  32. package/dist/remediation/index.js.map +1 -0
  33. package/dist/remediation/request.d.ts +183 -0
  34. package/dist/remediation/request.d.ts.map +1 -0
  35. package/dist/remediation/request.js +15 -0
  36. package/dist/remediation/request.js.map +1 -0
  37. package/dist/remediation/response.d.ts +100 -0
  38. package/dist/remediation/response.d.ts.map +1 -0
  39. package/dist/remediation/response.js +11 -0
  40. package/dist/remediation/response.js.map +1 -0
  41. package/dist/remediation/validation.d.ts +87 -0
  42. package/dist/remediation/validation.d.ts.map +1 -0
  43. package/dist/remediation/validation.js +15 -0
  44. package/dist/remediation/validation.js.map +1 -0
  45. package/dist/status-vocabulary.d.ts +45 -0
  46. package/dist/status-vocabulary.d.ts.map +1 -0
  47. package/dist/status-vocabulary.js +101 -0
  48. package/dist/status-vocabulary.js.map +1 -0
  49. package/dist/verification/canonical-finding.d.ts +171 -0
  50. package/dist/verification/canonical-finding.d.ts.map +1 -0
  51. package/dist/verification/canonical-finding.js +3 -0
  52. package/dist/verification/canonical-finding.js.map +1 -0
  53. package/dist/verification/index.d.ts +6 -0
  54. package/dist/verification/index.d.ts.map +1 -0
  55. package/dist/verification/index.js +11 -0
  56. package/dist/verification/index.js.map +1 -0
  57. package/dist/verification/pipeline.d.ts +134 -0
  58. package/dist/verification/pipeline.d.ts.map +1 -0
  59. package/dist/verification/pipeline.js +57 -0
  60. package/dist/verification/pipeline.js.map +1 -0
  61. package/dist/verification/taxonomy.d.ts +10 -0
  62. package/dist/verification/taxonomy.d.ts.map +1 -0
  63. package/dist/verification/taxonomy.js +16 -0
  64. package/dist/verification/taxonomy.js.map +1 -0
  65. package/package.json +1 -1
  66. package/src/admission/admission-framing.test.ts +93 -0
  67. package/src/admission/framing.ts +78 -0
  68. package/src/admission/index.ts +58 -0
  69. package/src/admission/privacy.ts +93 -0
  70. package/src/admission/schema.ts +392 -0
  71. package/src/index.ts +266 -26
  72. package/src/intelligence.ts +698 -0
  73. package/src/remediation/capabilities.ts +53 -0
  74. package/src/remediation/index.ts +29 -0
  75. package/src/remediation/request.ts +236 -0
  76. package/src/remediation/response.ts +129 -0
  77. package/src/remediation/validation.ts +109 -0
  78. package/src/status-vocabulary.ts +125 -0
  79. package/src/verification/canonical-finding.ts +196 -0
  80. package/src/verification/index.ts +41 -0
  81. package/src/verification/pipeline.ts +199 -0
  82. package/src/verification/taxonomy.ts +46 -0
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ONBOARDING_HINTS = exports.DAEMON_ERROR_CODES = exports.CONFIDENCE_LABELS = exports.VERIFICATION_SUMMARY_LABELS = exports.SEVERITY_LABELS = exports.STATUS_TERMS = exports.STATUS_VOCABULARY_VERSION = void 0;
4
+ exports.statusTerm = statusTerm;
5
+ exports.severityLabel = severityLabel;
6
+ exports.toPatchStateLabel = toPatchStateLabel;
7
+ exports.toRetrySafeMessage = toRetrySafeMessage;
8
+ exports.toManualReviewMessage = toManualReviewMessage;
9
+ exports.toVerificationCompleteTitle = toVerificationCompleteTitle;
10
+ exports.toVerificationSummaryLabel = toVerificationSummaryLabel;
11
+ exports.STATUS_VOCABULARY_VERSION = 'neurcode.status.v1';
12
+ exports.STATUS_TERMS = {
13
+ verificationComplete: 'Verification Complete',
14
+ safePatchApplied: 'Safe Patch Applied',
15
+ patchRejected: 'Patch Rejected',
16
+ rollbackAvailable: 'Rollback Available',
17
+ rollbackApplied: 'Rollback Applied',
18
+ replayAvailable: 'Replay Available',
19
+ evidenceGenerated: 'Evidence Generated',
20
+ manualReviewRecommended: 'Manual Review Recommended',
21
+ filesystemChangedSincePreview: 'Filesystem Changed Since Preview',
22
+ transactionVerified: 'Transaction Verified',
23
+ retrySafe: 'Retry Safe',
24
+ };
25
+ exports.SEVERITY_LABELS = {
26
+ critical: 'Critical',
27
+ blocking: 'Blocking',
28
+ high: 'High',
29
+ advisory: 'Advisory',
30
+ medium: 'Medium',
31
+ warning: 'Warning',
32
+ low: 'Low',
33
+ info: 'Info',
34
+ };
35
+ exports.VERIFICATION_SUMMARY_LABELS = {
36
+ clean: exports.STATUS_TERMS.verificationComplete,
37
+ issues: 'Verification Findings Detected',
38
+ partial: 'Verification Partially Complete',
39
+ failed: 'Verification Failed',
40
+ };
41
+ exports.CONFIDENCE_LABELS = {
42
+ HIGH: 'HIGH confidence',
43
+ MEDIUM: 'MEDIUM confidence',
44
+ LOW: 'LOW confidence',
45
+ };
46
+ function statusTerm(key) {
47
+ return exports.STATUS_TERMS[key];
48
+ }
49
+ function severityLabel(severity) {
50
+ return exports.SEVERITY_LABELS[severity];
51
+ }
52
+ function toPatchStateLabel(state) {
53
+ if (state === 'applied')
54
+ return exports.STATUS_TERMS.safePatchApplied;
55
+ if (state === 'partial')
56
+ return `${exports.STATUS_TERMS.safePatchApplied} · ${exports.STATUS_TERMS.manualReviewRecommended}`;
57
+ if (state === 'stale_preview' || state === 'filesystem_changed_since_preview') {
58
+ return exports.STATUS_TERMS.filesystemChangedSincePreview;
59
+ }
60
+ if (state === 'rollback_applied')
61
+ return exports.STATUS_TERMS.rollbackApplied;
62
+ if (state === 'rollback_stale')
63
+ return `${exports.STATUS_TERMS.patchRejected} · ${exports.STATUS_TERMS.filesystemChangedSincePreview}`;
64
+ if (state === 'rollback_rejected')
65
+ return exports.STATUS_TERMS.patchRejected;
66
+ return exports.STATUS_TERMS.patchRejected;
67
+ }
68
+ function toRetrySafeMessage(context) {
69
+ return `${context}. ${exports.STATUS_TERMS.retrySafe}.`;
70
+ }
71
+ function toManualReviewMessage(context) {
72
+ return `${exports.STATUS_TERMS.manualReviewRecommended}: ${context}`;
73
+ }
74
+ function toVerificationCompleteTitle(confidenceSuffix = '') {
75
+ return `${exports.STATUS_TERMS.verificationComplete}${confidenceSuffix}`;
76
+ }
77
+ function toVerificationSummaryLabel(state) {
78
+ return exports.VERIFICATION_SUMMARY_LABELS[state];
79
+ }
80
+ exports.DAEMON_ERROR_CODES = {
81
+ badRequest: 'daemon.bad_request',
82
+ unauthorized: 'daemon.unauthorized',
83
+ forbidden: 'daemon.forbidden',
84
+ notFound: 'daemon.not_found',
85
+ routeNotFound: 'daemon.route_not_found',
86
+ timeout: 'daemon.timeout',
87
+ conflict: 'daemon.conflict',
88
+ validationFailed: 'daemon.validation_failed',
89
+ rateLimited: 'daemon.rate_limited',
90
+ internalError: 'daemon.internal_error',
91
+ unknown: 'daemon.error',
92
+ };
93
+ exports.ONBOARDING_HINTS = [
94
+ 'Run your first verification',
95
+ 'Review findings',
96
+ 'Preview deterministic patch',
97
+ 'Apply safe patch',
98
+ 'View evidence',
99
+ 'Replay execution history',
100
+ ];
101
+ //# sourceMappingURL=status-vocabulary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status-vocabulary.js","sourceRoot":"","sources":["../src/status-vocabulary.ts"],"names":[],"mappings":";;;AAiEA,gCAEC;AAED,sCAEC;AAED,8CAUC;AAED,gDAEC;AAED,sDAEC;AAED,kEAEC;AAED,gEAEC;AAnGY,QAAA,yBAAyB,GAAG,oBAAoB,CAAC;AAEjD,QAAA,YAAY,GAAG;IAC1B,oBAAoB,EAAE,uBAAuB;IAC7C,gBAAgB,EAAE,oBAAoB;IACtC,aAAa,EAAE,gBAAgB;IAC/B,iBAAiB,EAAE,oBAAoB;IACvC,eAAe,EAAE,kBAAkB;IACnC,eAAe,EAAE,kBAAkB;IACnC,iBAAiB,EAAE,oBAAoB;IACvC,uBAAuB,EAAE,2BAA2B;IACpD,6BAA6B,EAAE,kCAAkC;IACjE,mBAAmB,EAAE,sBAAsB;IAC3C,SAAS,EAAE,YAAY;CACf,CAAC;AAaE,QAAA,eAAe,GAAkC;IAC5D,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,SAAS;IAClB,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;CACb,CAAC;AAIW,QAAA,2BAA2B,GAA6C;IACnF,KAAK,EAAE,oBAAY,CAAC,oBAAoB;IACxC,MAAM,EAAE,gCAAgC;IACxC,OAAO,EAAE,iCAAiC;IAC1C,MAAM,EAAE,qBAAqB;CAC9B,CAAC;AAcW,QAAA,iBAAiB,GAAoC;IAChE,IAAI,EAAE,iBAAiB;IACvB,MAAM,EAAE,mBAAmB;IAC3B,GAAG,EAAE,gBAAg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K,CAAC,CAAC;AAC5C,CAAC;AAEY,QAAA,kBAAkB,GAAG;IAChC,UAAU,EAAE,oBAAoB;IAChC,YAAY,EAAE,qBAAqB;IACnC,SAAS,EAAE,kBAAkB;IAC7B,QAAQ,EAAE,kBAAkB;IAC5B,aAAa,EAAE,wBAAwB;IACvC,OAAO,EAAE,gBAAgB;IACzB,QAAQ,EAAE,iBAAiB;IAC3B,gBAAgB,EAAE,0BAA0B;IAC5C,WAAW,EAAE,qBAAqB;IAClC,aAAa,EAAE,uBAAuB;IACtC,OAAO,EAAE,cAAc;CACf,CAAC;AAIE,QAAA,gBAAgB,GAAG;IAC9B,6BAA6B;IAC7B,iBAAiB;IACjB,6BAA6B;IAC7B,kBAAkB;IAClB,eAAe;IACf,0BAA0B;CAClB,CAAC"}
@@ -0,0 +1,171 @@
1
+ import type { DeterminismClassification, GovernanceFindingCategory, GovernanceSourceSystem } from './taxonomy';
2
+ import { GOVERNANCE_FINDINGS_SCHEMA_VERSION } from './taxonomy';
3
+ import type { GovernancePipelineSummary } from './pipeline';
4
+ export type GovernanceSeverity = 'BLOCKING' | 'ADVISORY' | 'INFO';
5
+ export interface GovernanceEvidence {
6
+ /** Human-readable excerpt (code, diff line, policy excerpt). */
7
+ excerpt: string;
8
+ /** Stable machine hint: AST path, regex id, policy rule type, etc. */
9
+ structuralHint?: string;
10
+ line?: number;
11
+ column?: number;
12
+ filePath?: string;
13
+ }
14
+ export interface GovernanceReplayMetadata {
15
+ evidenceArtifactRef?: string;
16
+ executionRecordRef?: string;
17
+ snapshotIds?: string[];
18
+ /** True when replay used only immutable artifacts with matching digests. */
19
+ reconstructedExactly?: boolean;
20
+ /** Present when bounded degradation occurred (truncation, missing artifact, etc.). */
21
+ boundedDegradation?: string[];
22
+ }
23
+ export interface GovernanceProvenanceMetadata {
24
+ runId?: string;
25
+ planId?: string | null;
26
+ verificationSource?: string;
27
+ policyLockFingerprint?: string | null;
28
+ compiledPolicyFingerprint?: string | null;
29
+ generatedAt?: string;
30
+ /**
31
+ * Canonical pipeline stage that emitted this finding. Additive lineage —
32
+ * never participates in the finding identity or the replay checksum, but
33
+ * threads governance computation provenance through to dashboards and audit.
34
+ */
35
+ producedByStage?: string;
36
+ }
37
+ export interface GovernanceSuppressionMetadata {
38
+ suppressed: boolean;
39
+ directive?: string;
40
+ exceptionId?: string;
41
+ reason?: string;
42
+ }
43
+ export interface GovernanceGraphMetadata {
44
+ edgeVia?: string;
45
+ fromRepo?: string;
46
+ toRepo?: string;
47
+ confidence?: 'high' | 'medium' | 'low';
48
+ traversalDepth?: number;
49
+ /** Explicit incompleteness — never omit when graph was capped. */
50
+ truncated?: boolean;
51
+ truncationReason?: string;
52
+ }
53
+ export interface GovernanceSemanticMetadata {
54
+ retrievalMethod?: 'deterministic-graph' | 'deterministic-tfidf' | 'heuristic-expansion';
55
+ matchedTerms?: string[];
56
+ tfidfScore?: number;
57
+ corpusCoverageRatio?: number;
58
+ indexTruncated?: boolean;
59
+ documentsIndexed?: number;
60
+ documentsCap?: number;
61
+ }
62
+ export interface GovernanceStructuralMetadata {
63
+ ruleId: string;
64
+ ruleName?: string;
65
+ policyRef?: string;
66
+ language?: string;
67
+ astNodeType?: string;
68
+ }
69
+ /**
70
+ * Canonical normalized finding — single source of truth across CLI, CI, replay, dashboards.
71
+ */
72
+ export interface GovernanceFinding {
73
+ /** Deterministic id: sha256-128 of stable fields, or caller-supplied stable id. */
74
+ id: string;
75
+ category: GovernanceFindingCategory;
76
+ sourceSystem: GovernanceSourceSystem;
77
+ determinismClassification: DeterminismClassification;
78
+ severity: GovernanceSeverity;
79
+ /** 0–1; structural deterministic often 0.85–1.0; heuristics lower. */
80
+ confidence: number;
81
+ title: string;
82
+ evidence: GovernanceEvidence;
83
+ operationalImplication: string;
84
+ remediation: string;
85
+ replayMetadata?: GovernanceReplayMetadata;
86
+ provenanceMetadata?: GovernanceProvenanceMetadata;
87
+ suppressionMetadata?: GovernanceSuppressionMetadata;
88
+ graphMetadata?: GovernanceGraphMetadata;
89
+ semanticMetadata?: GovernanceSemanticMetadata;
90
+ structuralMetadata?: GovernanceStructuralMetadata;
91
+ /**
92
+ * When multiple raw signals were merged for reviewer compression.
93
+ * Primary finding keeps merged* fields; sources list contributing ids.
94
+ */
95
+ mergedFrom?: string[];
96
+ }
97
+ /**
98
+ * Replay reconstruction status.
99
+ *
100
+ * exact - checksums match, identical governance output
101
+ * bounded-degradation - minor mismatch (e.g. missing artifact) but not a hard failure
102
+ * drift-detected - HARD FAILURE: same commit + diff + rules produced different output.
103
+ * Checksum mismatch. Must be investigated before any governance trust.
104
+ */
105
+ export type ReplayReconstructionStatus = 'exact' | 'bounded-degradation' | 'drift-detected';
106
+ /**
107
+ * Phase 2: Typed drift reason taxonomy for replay integrity analysis.
108
+ *
109
+ * Each reason maps to a specific class of replay failure:
110
+ * finding-order-drift - findings appear in different canonical order
111
+ * severity-drift - a finding changed severity between runs
112
+ * determinism-drift - a finding changed determinismClassification
113
+ * provenance-drift - provenance metadata differs between runs
114
+ * suppression-drift - suppression state changed between runs
115
+ * checksum-drift - top-level replayChecksum mismatch (composite signal)
116
+ * missing-finding - finding present in baseline but absent in replay
117
+ * extra-finding - finding present in replay but absent in baseline
118
+ */
119
+ export type ReplayIntegrityDriftReason = 'finding-order-drift' | 'severity-drift' | 'determinism-drift' | 'provenance-drift' | 'suppression-drift' | 'checksum-drift' | 'missing-finding' | 'extra-finding';
120
+ export interface GovernanceReplayIntegrity {
121
+ status: ReplayReconstructionStatus;
122
+ missingArtifacts: string[];
123
+ provenanceMismatches: string[];
124
+ graphMismatches: string[];
125
+ semanticTruncationMismatches: string[];
126
+ notes: string[];
127
+ /** Phase 2: Typed drift reasons — empty if status === 'exact'. */
128
+ driftReasons?: ReplayIntegrityDriftReason[];
129
+ }
130
+ export interface GovernanceVerificationEnvelope {
131
+ schemaVersion: typeof GOVERNANCE_FINDINGS_SCHEMA_VERSION;
132
+ generatedAt: string;
133
+ findings: GovernanceFinding[];
134
+ /** Count of raw findings folded into merged clusters. */
135
+ compressedDuplicateCount: number;
136
+ /**
137
+ * Phase 6: Total count of cross-source-system duplicates absorbed into
138
+ * canonical finding identities. Equals compressedDuplicateCount but named
139
+ * explicitly for telemetry readability.
140
+ */
141
+ deduplicatedFindingCount?: number;
142
+ /**
143
+ * Phase 2: Count of findings demoted from BLOCKING to ADVISORY because they
144
+ * exist on unmodified (historical) lines. Visible for CI reporting.
145
+ */
146
+ legacyDebtFindingCount?: number;
147
+ /**
148
+ * Phase 3: Deterministic replay checksum.
149
+ * SHA-256 over the canonically sorted finding set (id + severity + determinism + file + line).
150
+ * Same commit + same diff + same rules MUST produce the same checksum.
151
+ * A mismatch between two runs with identical inputs indicates replay drift (trust failure).
152
+ */
153
+ replayChecksum?: string;
154
+ replayIntegrity?: GovernanceReplayIntegrity;
155
+ /** Pilot / operational summary lines (high-signal, not verbose). */
156
+ reviewerSummary?: string[];
157
+ /**
158
+ * Canonical governance pipeline summary — stage execution ledger surface.
159
+ *
160
+ * Additive observability. Excluded by design from:
161
+ * - `replayChecksum` (computed only from finding-set fields)
162
+ * - finding identity (`GovernanceFinding.id`)
163
+ * - canonical sort order
164
+ *
165
+ * Present when verify ran with the staged pipeline runtime. Consumers
166
+ * (dashboards, audit replay, SLO gates) read this to explain HOW
167
+ * governance computation occurred. Absent on legacy / older-CLI envelopes.
168
+ */
169
+ pipelineSummary?: GovernancePipelineSummary;
170
+ }
171
+ //# sourceMappingURL=canonical-finding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canonical-finding.d.ts","sourceRoot":"","sources":["../../src/verification/canonical-finding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,EACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kCAAkC,EAAE,MAAM,YAAY,CAAC;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE5D,MAAM,MAAM,kBAAkB,GAAG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7C"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=canonical-finding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canonical-finding.js","sourceRoot":"","sources":["../../src/verification/canonical-finding.ts"],"names":[],"mappings":""}
@@ -0,0 +1,6 @@
1
+ export type { DeterminismClassification, GovernanceFindingCategory, GovernanceSourceSystem, } from './taxonomy';
2
+ export { GOVERNANCE_FINDINGS_SCHEMA_VERSION, isDeterminismClassification, } from './taxonomy';
3
+ export type { GovernanceEvidence, GovernanceFinding, GovernanceGraphMetadata, GovernanceProvenanceMetadata, GovernanceReplayIntegrity, GovernanceReplayMetadata, GovernanceSemanticMetadata, GovernanceSeverity, GovernanceStructuralMetadata, GovernanceSuppressionMetadata, GovernanceVerificationEnvelope, ReplayIntegrityDriftReason, ReplayReconstructionStatus, } from './canonical-finding';
4
+ export type { GovernancePipelineSummary, GovernanceStageBoundary, GovernanceStageFailure, GovernanceStageFailureCategory, GovernanceStageId, GovernanceStageMetrics, GovernanceStageReplayMetadata, GovernanceStageResult, GovernanceStageStatus, GovernanceStageSummary, } from './pipeline';
5
+ export { GOVERNANCE_PIPELINE_SCHEMA_VERSION, GOVERNANCE_STAGE_ORDER, isGovernanceStageId, } from './pipeline';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/verification/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,yBAAyB,EACzB,yBAAyB,EACzB,sBAAsB,GACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,kCAAkC,EAClC,2BAA2B,GAC5B,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,kBAAkB,EAClB,iBAAiB,EACjB,uBAAuB,EACvB,4BAA4B,EAC5B,yBAAyB,EACzB,wBAAwB,EACxB,0BAA0B,EAC1B,kBAAkB,EAClB,4BAA4B,EAC5B,6BAA6B,EAC7B,8BAA8B,EAC9B,0BAA0B,EAC1B,0BAA0B,GAC3B,MAAM,qBAAqB,CAAC;AAC7B,YAAY,EACV,yBAAyB,EACzB,uBAAuB,EACvB,sBAAsB,EACtB,8BAA8B,EAC9B,iBAAiB,EACjB,sBAAsB,EACtB,6BAA6B,EAC7B,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,kCAAkC,EAClC,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,YAAY,CAAC"}
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isGovernanceStageId = exports.GOVERNANCE_STAGE_ORDER = exports.GOVERNANCE_PIPELINE_SCHEMA_VERSION = exports.isDeterminismClassification = exports.GOVERNANCE_FINDINGS_SCHEMA_VERSION = void 0;
4
+ var taxonomy_1 = require("./taxonomy");
5
+ Object.defineProperty(exports, "GOVERNANCE_FINDINGS_SCHEMA_VERSION", { enumerable: true, get: function () { return taxonomy_1.GOVERNANCE_FINDINGS_SCHEMA_VERSION; } });
6
+ Object.defineProperty(exports, "isDeterminismClassification", { enumerable: true, get: function () { return taxonomy_1.isDeterminismClassification; } });
7
+ var pipeline_1 = require("./pipeline");
8
+ Object.defineProperty(exports, "GOVERNANCE_PIPELINE_SCHEMA_VERSION", { enumerable: true, get: function () { return pipeline_1.GOVERNANCE_PIPELINE_SCHEMA_VERSION; } });
9
+ Object.defineProperty(exports, "GOVERNANCE_STAGE_ORDER", { enumerable: true, get: function () { return pipeline_1.GOVERNANCE_STAGE_ORDER; } });
10
+ Object.defineProperty(exports, "isGovernanceStageId", { enumerable: true, get: function () { return pipeline_1.isGovernanceStageId; } });
11
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/verification/index.ts"],"names":[],"mappings":";;;AAKA,uCAGoB;AAFlB,8HAAA,kCAAkC,OAAA;AAClC,uHAAA,2BAA2B,OAAA;AA6B7B,uCAIoB;AAHlB,8HAAA,kCAAkC,OAAA;AAClC,kHAAA,sBAAsB,OAAA;AACtB,+GAAA,mBAAmB,OAAA"}
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Canonical Governance Pipeline Contracts
3
+ * ----------------------------------------
4
+ * Shared, immutable types describing the staged decomposition of the verify runtime.
5
+ *
6
+ * These contracts are ADDITIVE. They do not replace, mutate, or re-encode the canonical
7
+ * governance envelope (`GovernanceVerificationEnvelope`), the finding identity scheme,
8
+ * or the replay checksum. Stage metadata flows alongside the envelope as an
9
+ * out-of-band observability + replay-reconstruction surface.
10
+ *
11
+ * Design invariants:
12
+ * - Stage IDs are a closed set. Adding a new stage requires bumping the schema version.
13
+ * - Stage metadata never carries excerpts, file content, or PII.
14
+ * - Stage fingerprints are computed from stable identifiers — never wall-clock timestamps.
15
+ * - A stage's `replay.outputFingerprint` is independent of `replayChecksum`; the two
16
+ * are consistent but serve different audiences (stage lineage vs. envelope identity).
17
+ */
18
+ import type { DeterminismClassification } from './taxonomy';
19
+ /**
20
+ * Closed set of canonical governance pipeline stage identifiers.
21
+ *
22
+ * The order of declaration is the canonical execution order. Consumers MUST treat
23
+ * this list as the authoritative pipeline definition for replay reconstruction
24
+ * and explainability dashboards.
25
+ */
26
+ export type GovernanceStageId = 'diff-normalization' | 'plan-sync' | 'policy-lock' | 'compiled-policy' | 'policy-exceptions' | 'structural-analysis' | 'runtime-guard' | 'intent-evaluation' | 'semantic-analysis' | 'policy-evaluation' | 'suppression-evaluation' | 'advisory-signals' | 'change-contract' | 'ai-debt-budget' | 'governance-synthesis' | 'provenance-generation' | 'replay-integrity' | 'remediation-export-preparation' | 'evidence-generation' | 'telemetry-harvest' | 'ci-shaping' | 'output-rendering';
27
+ /**
28
+ * Terminal state for a stage execution. `degraded` means the stage produced output
29
+ * but a non-fatal anomaly was observed (e.g. truncation, partial dependency).
30
+ */
31
+ export type GovernanceStageStatus = 'succeeded' | 'skipped' | 'degraded' | 'failed';
32
+ /**
33
+ * Stage failure category. Maps to operator-visible runbooks and replay annotations.
34
+ */
35
+ export type GovernanceStageFailureCategory = 'timeout' | 'exception' | 'invariant-violation' | 'degraded-dependency' | 'aborted-precondition';
36
+ export interface GovernanceStageMetrics {
37
+ /** Stage wall-clock duration in milliseconds. */
38
+ durationMs: number;
39
+ /** Size of the stage input as a stable item count (e.g. diff files, rules). Optional. */
40
+ inputItemCount?: number;
41
+ /** Size of the stage output as a stable item count (e.g. findings produced). Optional. */
42
+ outputItemCount?: number;
43
+ /** Delta of `process.memoryUsage().heapUsed` across the stage. Optional. */
44
+ memoryDeltaBytes?: number;
45
+ }
46
+ export interface GovernanceStageReplayMetadata {
47
+ stageId: GovernanceStageId;
48
+ /** Determinism classification of the stage itself (matches the most-deterministic finding it can emit). */
49
+ determinism: DeterminismClassification;
50
+ /** SHA-256 fingerprint of stage input, computed from stable identifiers only. */
51
+ inputFingerprint?: string;
52
+ /** SHA-256 fingerprint of stage output, computed from stable identifiers only. */
53
+ outputFingerprint?: string;
54
+ /** Stage IDs whose successful completion was a precondition for this stage. */
55
+ dependsOn: GovernanceStageId[];
56
+ /** Stage start time as an ISO-8601 timestamp. NOT included in fingerprints. */
57
+ startedAt: string;
58
+ /** Stage finish time as an ISO-8601 timestamp. NOT included in fingerprints. */
59
+ finishedAt: string;
60
+ }
61
+ export interface GovernanceStageFailure {
62
+ category: GovernanceStageFailureCategory;
63
+ /** Stable, PII-free message. Never includes source excerpts. */
64
+ message: string;
65
+ /** True when the rest of the pipeline can proceed in a degraded mode. */
66
+ recoverable: boolean;
67
+ }
68
+ /**
69
+ * Boundary policy declared by a stage. The pipeline runtime uses this to decide
70
+ * how to respond to failure (abort vs. degrade) and which stages must run first.
71
+ */
72
+ export interface GovernanceStageBoundary {
73
+ /** When true, the stage failing is reported but does NOT abort downstream stages. */
74
+ isolateFailure: boolean;
75
+ /** When true, the stage is required for governance correctness. */
76
+ required: boolean;
77
+ /** Stage IDs whose successful completion is required before this stage may execute. */
78
+ dependencies: GovernanceStageId[];
79
+ }
80
+ /**
81
+ * Single-stage execution receipt. Persisted alongside the canonical envelope and
82
+ * consumed by replay reconstruction, observability dashboards, and SLO gates.
83
+ *
84
+ * `output` is the typed stage payload; consumers MUST treat it as immutable.
85
+ */
86
+ export interface GovernanceStageResult<T = unknown> {
87
+ stageId: GovernanceStageId;
88
+ status: GovernanceStageStatus;
89
+ /** Stage output. `null` when status is 'failed' or 'skipped'. */
90
+ output: T | null;
91
+ metrics: GovernanceStageMetrics;
92
+ replay: GovernanceStageReplayMetadata;
93
+ failure?: GovernanceStageFailure;
94
+ /** Stage-emitted observability notes (PII-free, bounded). */
95
+ notes?: string[];
96
+ }
97
+ /**
98
+ * Compact, replay-friendly summary of a stage. Embedded into telemetry and the
99
+ * pipeline-level summary surface.
100
+ */
101
+ export interface GovernanceStageSummary {
102
+ stageId: GovernanceStageId;
103
+ status: GovernanceStageStatus;
104
+ determinism: DeterminismClassification;
105
+ durationMs: number;
106
+ inputFingerprint?: string;
107
+ outputFingerprint?: string;
108
+ dependsOn: GovernanceStageId[];
109
+ failureCategory?: GovernanceStageFailureCategory;
110
+ }
111
+ /**
112
+ * Pipeline-level summary. Pinned across replays. The `pipelineFingerprint` is
113
+ * a stable SHA-256 over the ordered (stageId, outputFingerprint, status) tuple
114
+ * and is independent of `GovernanceVerificationEnvelope.replayChecksum`.
115
+ */
116
+ export interface GovernancePipelineSummary {
117
+ schemaVersion: typeof GOVERNANCE_PIPELINE_SCHEMA_VERSION;
118
+ pipelineFingerprint: string;
119
+ stages: GovernanceStageSummary[];
120
+ totalDurationMs: number;
121
+ degradedStages: GovernanceStageId[];
122
+ failedStages: GovernanceStageId[];
123
+ }
124
+ export declare const GOVERNANCE_PIPELINE_SCHEMA_VERSION: "2026-05-14.1";
125
+ /**
126
+ * Type guard: is the given string a known stage identifier?
127
+ */
128
+ export declare function isGovernanceStageId(value: string): value is GovernanceStageId;
129
+ /**
130
+ * Canonical execution order. Mirror of the union above — exported as a runtime
131
+ * value for iteration, indexing, and stage-ordering invariants.
132
+ */
133
+ export declare const GOVERNANCE_STAGE_ORDER: readonly GovernanceStageId[];
134
+ //# sourceMappingURL=pipeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/verification/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,YAAY,CAAC;AAE5D;;;;;;GAMG;AACH,MAAM,MAAM,iBAAiB,GACzB,oBAAoB,GACpB,WAAW,GACX,aAAa,GACb,iBAAiB,GACjB,mBAAmB,GACnB,qBAAqB,GACrB,eAAe,GACf,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,wBAAwB,GACxB,kBAAkB,GAClB,iBAAiB,GACjB,gBAAgB,GAChB,sBAAsB,GACtB,uBAAuB,GACvB,kBAAkB,GAClB,gCAAgC,GAChC,qBAAqB,GACrB,mBAAmB,GACnB,YAAY,GACZ,kBAAkB,CAAC;AAEvB;;;GAGG;AACH,MAAM,MAAM,qBAAqB,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEpF;;GAEG;AACH,MAAM,MAAM,8BAA8B,GACtC,SAAS,GACT,WAAW,GACX,qBAAqB,GACrB,qBAAqB,GACrB,sBAAsB,CAAC;AAE3B,MAAM,WAAW,sBAAsB;IACrC,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,yFAAyF;IACzF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,0FAA0F;IAC1F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4EAA4E;IAC5E,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,6BAA6B;IAC5C,OAAO,EAAE,iBAAiB,CAAC;IAC3B,2GAA2G;IAC3G,WAAW,EAAE,yB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AE,iBAAiB,EAAE,CAAC;IAC/B,eAAe,CAAC,EAAE,8BAA8B,CAAC;CAClD;AAED;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC,aAAa,EAAE,OAAO,kCAAkC,CAAC;IACzD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,MAAM,EAAE,sBAAsB,EAAE,CAAC;IACjC,eAAe,EAAE,MAAM,CAAC;IACxB,cAAc,EAAE,iBAAiB,EAAE,CAAC;IACpC,YAAY,EAAE,iBAAiB,EAAE,CAAC;CACnC;AAED,eAAO,MAAM,kCAAkC,EAAG,cAAuB,CAAC;AAE1E;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,iBAAiB,CAE7E;AAED;;;GAGG;AACH,eAAO,MAAM,sBAAsB,EAAE,SAAS,iBAAiB,EAuBrD,CAAC"}
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ /**
3
+ * Canonical Governance Pipeline Contracts
4
+ * ----------------------------------------
5
+ * Shared, immutable types describing the staged decomposition of the verify runtime.
6
+ *
7
+ * These contracts are ADDITIVE. They do not replace, mutate, or re-encode the canonical
8
+ * governance envelope (`GovernanceVerificationEnvelope`), the finding identity scheme,
9
+ * or the replay checksum. Stage metadata flows alongside the envelope as an
10
+ * out-of-band observability + replay-reconstruction surface.
11
+ *
12
+ * Design invariants:
13
+ * - Stage IDs are a closed set. Adding a new stage requires bumping the schema version.
14
+ * - Stage metadata never carries excerpts, file content, or PII.
15
+ * - Stage fingerprints are computed from stable identifiers — never wall-clock timestamps.
16
+ * - A stage's `replay.outputFingerprint` is independent of `replayChecksum`; the two
17
+ * are consistent but serve different audiences (stage lineage vs. envelope identity).
18
+ */
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.GOVERNANCE_STAGE_ORDER = exports.GOVERNANCE_PIPELINE_SCHEMA_VERSION = void 0;
21
+ exports.isGovernanceStageId = isGovernanceStageId;
22
+ exports.GOVERNANCE_PIPELINE_SCHEMA_VERSION = '2026-05-14.1';
23
+ /**
24
+ * Type guard: is the given string a known stage identifier?
25
+ */
26
+ function isGovernanceStageId(value) {
27
+ return exports.GOVERNANCE_STAGE_ORDER.includes(value);
28
+ }
29
+ /**
30
+ * Canonical execution order. Mirror of the union above — exported as a runtime
31
+ * value for iteration, indexing, and stage-ordering invariants.
32
+ */
33
+ exports.GOVERNANCE_STAGE_ORDER = [
34
+ 'diff-normalization',
35
+ 'plan-sync',
36
+ 'policy-lock',
37
+ 'compiled-policy',
38
+ 'policy-exceptions',
39
+ 'structural-analysis',
40
+ 'runtime-guard',
41
+ 'intent-evaluation',
42
+ 'semantic-analysis',
43
+ 'policy-evaluation',
44
+ 'suppression-evaluation',
45
+ 'advisory-signals',
46
+ 'change-contract',
47
+ 'ai-debt-budget',
48
+ 'governance-synthesis',
49
+ 'provenance-generation',
50
+ 'replay-integrity',
51
+ 'remediation-export-preparation',
52
+ 'evidence-generation',
53
+ 'telemetry-harvest',
54
+ 'ci-shaping',
55
+ 'output-rendering',
56
+ ];
57
+ //# sourceMappingURL=pipeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../src/verification/pipeline.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAuJH,kDAEC;AAPY,QAAA,kCAAkC,GAAG,cAAuB,CAAC;AAE1E;;GAEG;AACH,SAAgB,mBAAmB,CAAC,KAAa;IAC/C,OAAO,8BAAsB,CAAC,QAAQ,CAAC,KAA0B,CAAC,CAAC;AACrE,CAAC;AAED;;;GAGG;AACU,QAAA,sBAAsB,GAAiC;IAClE,oBAAoB;IACpB,WAAW;IACX,aAAa;IACb,iBAAiB;IACjB,mBAAmB;IACnB,qBAAqB;IACrB,eAAe;IACf,mBAAmB;IACnB,mBAAmB;IACnB,mBAAmB;IACnB,wBAAwB;IACxB,kBAAkB;IAClB,iBAAiB;IACjB,gBAAgB;IAChB,sBAAsB;IACtB,uBAAuB;IACvB,kBAAkB;IAClB,gCAAgC;IAChC,qBAAqB;IACrB,mBAAmB;IACnB,YAAY;IACZ,kBAAkB;CACV,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Canonical determinism taxonomy — every governance finding MUST map to exactly one.
3
+ * Do not blur or infer across these buckets in consumer UIs.
4
+ */
5
+ export type DeterminismClassification = 'deterministic-structural' | 'deterministic-semantic' | 'heuristic-advisory' | 'llm-assisted-planning';
6
+ export type GovernanceFindingCategory = 'structural' | 'semantic-advisory' | 'policy-engine' | 'governance-constraint' | 'intent-conditioned' | 'flow-connectivity' | 'regression' | 'scope' | 'replay' | 'ci' | 'pilot-metric' | 'workspace-federation';
7
+ export type GovernanceSourceSystem = 'structural-rules' | 'policy-engine' | 'governance-runtime' | 'intent-engine' | 'semantic-index' | 'workspace-federation' | 'replay-runtime' | 'ci-adapter' | 'pilot-metrics';
8
+ export declare const GOVERNANCE_FINDINGS_SCHEMA_VERSION: "2026-05-11.1";
9
+ export declare function isDeterminismClassification(value: string): value is DeterminismClassification;
10
+ //# sourceMappingURL=taxonomy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taxonomy.d.ts","sourceRoot":"","sources":["../../src/verification/taxonomy.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,yBAAyB,GACjC,0BAA0B,GAC1B,wBAAwB,GACxB,oBAAoB,GACpB,uBAAuB,CAAC;AAE5B,MAAM,MAAM,yBAAyB,GACjC,YAAY,GACZ,mBAAmB,GACnB,eAAe,GACf,uBAAuB,GACvB,oBAAoB,GACpB,mBAAmB,GACnB,YAAY,GACZ,OAAO,GACP,QAAQ,GACR,IAAI,GACJ,cAAc,GACd,sBAAsB,CAAC;AAE3B,MAAM,MAAM,sBAAsB,GAC9B,kBAAkB,GAClB,eAAe,GACf,oBAAoB,GACpB,eAAe,GACf,gBAAgB,GAChB,sBAAsB,GACtB,gBAAgB,GAChB,YAAY,GACZ,eAAe,CAAC;AAEpB,eAAO,MAAM,kCAAkC,EAAG,cAAuB,CAAC;AAE1E,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,yBAAyB,CAO7F"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ /**
3
+ * Canonical determinism taxonomy — every governance finding MUST map to exactly one.
4
+ * Do not blur or infer across these buckets in consumer UIs.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.GOVERNANCE_FINDINGS_SCHEMA_VERSION = void 0;
8
+ exports.isDeterminismClassification = isDeterminismClassification;
9
+ exports.GOVERNANCE_FINDINGS_SCHEMA_VERSION = '2026-05-11.1';
10
+ function isDeterminismClassification(value) {
11
+ return (value === 'deterministic-structural'
12
+ || value === 'deterministic-semantic'
13
+ || value === 'heuristic-advisory'
14
+ || value === 'llm-assisted-planning');
15
+ }
16
+ //# sourceMappingURL=taxonomy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"taxonomy.js","sourceRoot":"","sources":["../../src/verification/taxonomy.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAmCH,kEAOC;AATY,QAAA,kCAAkC,GAAG,cAAuB,CAAC;AAE1E,SAAgB,2BAA2B,CAAC,KAAa;IACvD,OAAO,CACL,KAAK,KAAK,0BAA0B;WACjC,KAAK,KAAK,wBAAwB;WAClC,KAAK,KAAK,oBAAoB;WAC9B,KAAK,KAAK,uBAAuB,CACrC,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neurcode-ai/contracts",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Shared JSON contracts for Neurcode CLI, API, action, IDE, and MCP surfaces",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",