@ai-sdlc/orchestrator 0.9.0 → 0.13.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 (172) hide show
  1. package/dist/__test-helpers/git-env.d.ts +40 -0
  2. package/dist/__test-helpers/git-env.js +73 -0
  3. package/dist/adapters.d.ts +42 -3
  4. package/dist/adapters.js +133 -3
  5. package/dist/admission-composite.d.ts +134 -1
  6. package/dist/admission-composite.js +170 -6
  7. package/dist/admission-enrichment.d.ts +12 -3
  8. package/dist/admission-enrichment.js +71 -10
  9. package/dist/admission-hc.d.ts +20 -1
  10. package/dist/admission-hc.js +12 -1
  11. package/dist/admission-score.d.ts +44 -0
  12. package/dist/admission-score.js +11 -2
  13. package/dist/backlog-adapter.d.ts +45 -0
  14. package/dist/backlog-adapter.js +145 -1
  15. package/dist/calibration.d.ts +81 -0
  16. package/dist/calibration.js +76 -0
  17. package/dist/cli/commands/git-remote.d.ts +25 -0
  18. package/dist/cli/commands/git-remote.js +80 -1
  19. package/dist/cli/commands/init-features.d.ts +507 -0
  20. package/dist/cli/commands/init-features.js +1100 -0
  21. package/dist/cli/commands/init-templates.d.ts +301 -0
  22. package/dist/cli/commands/init-templates.js +1341 -0
  23. package/dist/cli/commands/init.d.ts +67 -0
  24. package/dist/cli/commands/init.js +301 -2
  25. package/dist/cli/commands/run.js +9 -1
  26. package/dist/cli/index.d.ts +11 -0
  27. package/dist/cli/index.js +42 -8
  28. package/dist/compliance/composer.d.ts +79 -0
  29. package/dist/compliance/composer.js +258 -0
  30. package/dist/compliance/errors.d.ts +64 -0
  31. package/dist/compliance/errors.js +85 -0
  32. package/dist/compliance/loader.d.ts +52 -0
  33. package/dist/compliance/loader.js +124 -0
  34. package/dist/compliance/types.d.ts +184 -0
  35. package/dist/compliance/types.js +41 -0
  36. package/dist/compliance-clearance.d.ts +269 -0
  37. package/dist/compliance-clearance.js +269 -0
  38. package/dist/config.js +17 -0
  39. package/dist/cost-tracker.d.ts +22 -0
  40. package/dist/cost-tracker.js +41 -0
  41. package/dist/database/adapters/external.js +5 -1
  42. package/dist/design-authority.d.ts +13 -0
  43. package/dist/design-authority.js +13 -0
  44. package/dist/embedding/adapters/openai-text-embedding-3-small.d.ts +71 -0
  45. package/dist/embedding/adapters/openai-text-embedding-3-small.js +190 -0
  46. package/dist/embedding/consumers/tessellation-drift.d.ts +74 -0
  47. package/dist/embedding/consumers/tessellation-drift.js +76 -0
  48. package/dist/embedding/cross-provider.d.ts +78 -0
  49. package/dist/embedding/cross-provider.js +75 -0
  50. package/dist/embedding/deprecation.d.ts +151 -0
  51. package/dist/embedding/deprecation.js +229 -0
  52. package/dist/embedding/errors.d.ts +90 -0
  53. package/dist/embedding/errors.js +150 -0
  54. package/dist/embedding/index.d.ts +29 -0
  55. package/dist/embedding/index.js +24 -0
  56. package/dist/embedding/pipeline-load.d.ts +146 -0
  57. package/dist/embedding/pipeline-load.js +178 -0
  58. package/dist/embedding/registry.d.ts +45 -0
  59. package/dist/embedding/registry.js +61 -0
  60. package/dist/embedding/stale-vector.d.ts +110 -0
  61. package/dist/embedding/stale-vector.js +92 -0
  62. package/dist/embedding/storage/index.d.ts +51 -0
  63. package/dist/embedding/storage/index.js +43 -0
  64. package/dist/embedding/storage/jsonl-backend.d.ts +150 -0
  65. package/dist/embedding/storage/jsonl-backend.js +332 -0
  66. package/dist/embedding/storage/types.d.ts +135 -0
  67. package/dist/embedding/storage/types.js +13 -0
  68. package/dist/embedding/types.d.ts +180 -0
  69. package/dist/embedding/types.js +10 -0
  70. package/dist/execute.d.ts +29 -2
  71. package/dist/execute.js +179 -35
  72. package/dist/index.d.ts +14 -2
  73. package/dist/index.js +19 -2
  74. package/dist/journey/inheritance-validator.d.ts +396 -0
  75. package/dist/journey/inheritance-validator.js +370 -0
  76. package/dist/journey/state-id-drift-rule.d.ts +137 -0
  77. package/dist/journey/state-id-drift-rule.js +245 -0
  78. package/dist/journey-sa2-router.d.ts +395 -0
  79. package/dist/journey-sa2-router.js +308 -0
  80. package/dist/models/classifier.d.ts +3 -1
  81. package/dist/models/classifier.js +61 -5
  82. package/dist/pillar-breakdown.d.ts +23 -1
  83. package/dist/pillar-breakdown.js +9 -0
  84. package/dist/runners/review-agent.js +6 -2
  85. package/dist/runners/runner-registry.d.ts +36 -0
  86. package/dist/runners/runner-registry.js +90 -0
  87. package/dist/runtime/attestations.d.ts +663 -11
  88. package/dist/runtime/attestations.js +971 -24
  89. package/dist/runtime/index.d.ts +1 -1
  90. package/dist/runtime/index.js +1 -1
  91. package/dist/runtime/parallelism-flag.d.ts +21 -3
  92. package/dist/runtime/parallelism-flag.js +27 -6
  93. package/dist/runtime/port-allocator.d.ts +11 -0
  94. package/dist/runtime/port-allocator.js +30 -0
  95. package/dist/sa-scoring/layer3-llm.js +6 -1
  96. package/dist/sa-scoring/revision-proposal-config.d.ts +178 -0
  97. package/dist/sa-scoring/revision-proposal-config.js +198 -0
  98. package/dist/sa-scoring/revision-proposal.d.ts +285 -0
  99. package/dist/sa-scoring/revision-proposal.js +417 -0
  100. package/dist/signal-ingestion/adapters/community-thread.d.ts +43 -0
  101. package/dist/signal-ingestion/adapters/community-thread.js +55 -0
  102. package/dist/signal-ingestion/adapters/in-app-feedback.d.ts +67 -0
  103. package/dist/signal-ingestion/adapters/in-app-feedback.js +51 -0
  104. package/dist/signal-ingestion/adapters/manual.d.ts +78 -0
  105. package/dist/signal-ingestion/adapters/manual.js +112 -0
  106. package/dist/signal-ingestion/adapters/support-ticket.d.ts +47 -0
  107. package/dist/signal-ingestion/adapters/support-ticket.js +51 -0
  108. package/dist/signal-ingestion/classifier.d.ts +205 -0
  109. package/dist/signal-ingestion/classifier.js +494 -0
  110. package/dist/signal-ingestion/clustering-types.d.ts +36 -0
  111. package/dist/signal-ingestion/clustering-types.js +14 -0
  112. package/dist/signal-ingestion/clustering.d.ts +200 -0
  113. package/dist/signal-ingestion/clustering.js +413 -0
  114. package/dist/signal-ingestion/config.d.ts +351 -0
  115. package/dist/signal-ingestion/config.js +587 -0
  116. package/dist/signal-ingestion/d1.d.ts +252 -0
  117. package/dist/signal-ingestion/d1.js +235 -0
  118. package/dist/signal-ingestion/errors.d.ts +73 -0
  119. package/dist/signal-ingestion/errors.js +108 -0
  120. package/dist/signal-ingestion/governance-events.d.ts +181 -0
  121. package/dist/signal-ingestion/governance-events.js +189 -0
  122. package/dist/signal-ingestion/index.d.ts +35 -0
  123. package/dist/signal-ingestion/index.js +53 -0
  124. package/dist/signal-ingestion/manual-share-metric.d.ts +93 -0
  125. package/dist/signal-ingestion/manual-share-metric.js +106 -0
  126. package/dist/signal-ingestion/registry.d.ts +40 -0
  127. package/dist/signal-ingestion/registry.js +137 -0
  128. package/dist/signal-ingestion/residency.d.ts +227 -0
  129. package/dist/signal-ingestion/residency.js +238 -0
  130. package/dist/signal-ingestion/significance.d.ts +554 -0
  131. package/dist/signal-ingestion/significance.js +555 -0
  132. package/dist/signal-ingestion/types.d.ts +191 -0
  133. package/dist/signal-ingestion/types.js +8 -0
  134. package/dist/substrate/drift-composition.d.ts +270 -0
  135. package/dist/substrate/drift-composition.js +306 -0
  136. package/dist/substrate/drift-tui-surface.d.ts +61 -0
  137. package/dist/substrate/drift-tui-surface.js +102 -0
  138. package/dist/substrate/identity-class.d.ts +176 -0
  139. package/dist/substrate/identity-class.js +201 -0
  140. package/dist/tessellation/cross-soul-provenance-rule.d.ts +133 -0
  141. package/dist/tessellation/cross-soul-provenance-rule.js +171 -0
  142. package/dist/tessellation/inter-soul-embedding-distance-rule.d.ts +61 -0
  143. package/dist/tessellation/inter-soul-embedding-distance-rule.js +67 -0
  144. package/dist/tessellation/rule-registry.d.ts +269 -0
  145. package/dist/tessellation/rule-registry.js +92 -0
  146. package/dist/tessellation/soul-slug-ast-scan-rule.d.ts +90 -0
  147. package/dist/tessellation/soul-slug-ast-scan-rule.js +158 -0
  148. package/dist/tessellation-admission.d.ts +162 -0
  149. package/dist/tessellation-admission.js +146 -0
  150. package/dist/tessellation-drift.d.ts +246 -0
  151. package/dist/tessellation-drift.js +250 -0
  152. package/dist/validate-config.js +13 -0
  153. package/dist/validate-issue.js +2 -2
  154. package/dist/variant/cardinality-activation.d.ts +126 -0
  155. package/dist/variant/cardinality-activation.js +101 -0
  156. package/dist/variant/deprecation-lifecycle.d.ts +184 -0
  157. package/dist/variant/deprecation-lifecycle.js +208 -0
  158. package/dist/variant/drift-extension.d.ts +136 -0
  159. package/dist/variant/drift-extension.js +164 -0
  160. package/dist/variant/engineering-review.d.ts +185 -0
  161. package/dist/variant/engineering-review.js +142 -0
  162. package/dist/variant/index.d.ts +32 -0
  163. package/dist/variant/index.js +32 -0
  164. package/dist/variant/inheritance-validator.d.ts +165 -0
  165. package/dist/variant/inheritance-validator.js +139 -0
  166. package/dist/variant/internal-adopter/index.d.ts +11 -0
  167. package/dist/variant/internal-adopter/index.js +10 -0
  168. package/dist/variant/internal-adopter/products.d.ts +156 -0
  169. package/dist/variant/internal-adopter/products.js +366 -0
  170. package/dist/variant-admission.d.ts +316 -0
  171. package/dist/variant-admission.js +247 -0
  172. package/package.json +11 -8
@@ -0,0 +1,285 @@
1
+ /**
2
+ * DIDRevisionProposal mechanism (RFC-0031).
3
+ *
4
+ * Implements the calibration-driven proposal mechanism that fires when the
5
+ * PPA flywheel accumulates sufficient evidence that a DID field has drifted
6
+ * from observed reality.
7
+ *
8
+ * What ships here:
9
+ * - DIDRevisionProposal event shape + classification logic (§3, §5)
10
+ * - SoulHealthDiagnostic event for unhealthy-drift path (§7)
11
+ * - Approval routing by identityClass (§8)
12
+ * - 14-day expiry + DIDRevisionProposalExpired event (§9)
13
+ * - lockNoProposal opt-out per field from calibration config (OQ-12.3)
14
+ * - Rejection learnings flowing back into the calibration log (OQ-12.5)
15
+ * - Multi-field bundling explicitly deferred to v2 (OQ-12.2)
16
+ * - Confidence derived from sample size + classification clarity + identityClass (OQ-12.1)
17
+ * - PPA generates proposal regardless of pillar; pillar lead approves (OQ-12.4)
18
+ *
19
+ * Trigger entry point: `evaluateRevisionProposal()` — called after drift
20
+ * is detected (i.e., a `SoulDriftDetected` event fires). One call per
21
+ * field; bundling is v2.
22
+ *
23
+ * Scope: Shard-DID only. Platform-level DID changes are human-initiated.
24
+ */
25
+ import { type ResolvedRevisionProposalCalibrationConfig } from './revision-proposal-config.js';
26
+ export type { ResolvedRevisionProposalCalibrationConfig };
27
+ export { type RevisionProposalCalibrationConfig, type ConfidenceThresholdsConfig, type RejectionPrecedentConfig, type RejectionPrecedentWeightsConfig, type ConfigValidationResult, type ConfigValidationError, DEFAULT_CONFIDENCE_HIGH_SAMPLE_SIZE, DEFAULT_CONFIDENCE_LOW_SAMPLE_SIZE, DEFAULT_REJECTION_WEIGHT_HIGH, DEFAULT_REJECTION_WEIGHT_MEDIUM, DEFAULT_REJECTION_WEIGHT_LOW, DEFAULT_CONFIDENCE_PENALTY_FLOOR, DEFAULT_RESOLVED_CALIBRATION_CONFIG, validateRevisionProposalCalibrationConfig, resolveRevisionProposalCalibrationConfig, parseRevisionProposalCalibrationYaml, } from './revision-proposal-config.js';
28
+ /** Default trigger thresholds (§6). Configurable per deployment. */
29
+ export declare const DEFAULT_DISMISS_THRESHOLD = 10;
30
+ export declare const DEFAULT_DEMAND_MISALIGNMENT_THRESHOLD = 0.3;
31
+ export declare const DEFAULT_DRIFT_EVENTS_THRESHOLD = 3;
32
+ export declare const DEFAULT_TRIGGER_WINDOW_DAYS = 60;
33
+ export declare const DEFAULT_PROPOSAL_EXPIRY_DAYS = 14;
34
+ /** Classification thresholds per §7. */
35
+ export declare const HEALTHY_ICP_MATCH_MIN = 0.6;
36
+ export declare const UNHEALTHY_ICP_MATCH_MAX = 0.3;
37
+ export type DriftClassification = 'healthy' | 'unhealthy' | 'ambiguous';
38
+ export type IdentityClass = 'core' | 'evolving';
39
+ export type ApprovalPath = 'triad' | 'pillarLead';
40
+ export type ProposalStatus = 'pending' | 'approved' | 'rejected' | 'expired';
41
+ export type ProposalConfidence = 'high' | 'medium' | 'low';
42
+ export interface ClassificationEvidence {
43
+ /** [0,1]; high = healthy signal source (ICP-matched demand clusters). */
44
+ demandClusterICPMatchRate: number;
45
+ /** [0,1]; high = validated loss signal (churn-correlated demand). */
46
+ demandClusterChurnCorrelation: number;
47
+ /** High dismiss + low escalate = DID is stale (healthy evolution). */
48
+ dismissToEscalateRatio: number;
49
+ /** True = core identity field affected; more caution warranted. */
50
+ coreDIDFieldsAffected: boolean;
51
+ }
52
+ export interface TriggerEvidence {
53
+ /** Dismiss-signal count over the trigger window. */
54
+ dismissSignals: number;
55
+ escalateSignals: number;
56
+ /** SA gap between demand clusters and DID field (0=aligned, 1=fully misaligned). */
57
+ demandMisalignment: number;
58
+ /** SoulDriftDetected events attributable to this field. */
59
+ driftEvents: number;
60
+ /** ISO-8601 duration string for the evaluation window, e.g. "P60D". */
61
+ triggerWindow: string;
62
+ }
63
+ export interface DIDRevisionProposalEvent {
64
+ type: 'DIDRevisionProposal';
65
+ proposalId: string;
66
+ /** MUST be 'shard' — platform proposals are not generated. */
67
+ scope: 'shard';
68
+ shardId: string;
69
+ field: string;
70
+ currentValue: unknown;
71
+ proposedValue: unknown;
72
+ identityClass: IdentityClass | undefined;
73
+ classification: DriftClassification;
74
+ classificationEvidence: ClassificationEvidence;
75
+ triggerEvidence: TriggerEvidence;
76
+ confidence: ProposalConfidence;
77
+ approvalPath: ApprovalPath;
78
+ expiresAt: string;
79
+ createdAt: string;
80
+ /** Current lifecycle status. */
81
+ status: ProposalStatus;
82
+ }
83
+ /** Emitted on unhealthy drift (§7) instead of a DIDRevisionProposalEvent. */
84
+ export interface SoulHealthDiagnosticEvent {
85
+ type: 'SoulHealthDiagnostic';
86
+ proposalId: string;
87
+ shardId: string;
88
+ field: string;
89
+ classification: 'unhealthy';
90
+ classificationEvidence: ClassificationEvidence;
91
+ triggerEvidence: TriggerEvidence;
92
+ /** Recommendation for unhealthy drift — tighten admission or review demand source. */
93
+ recommendation: 'tighten-admission-threshold' | 'review-demand-source';
94
+ createdAt: string;
95
+ }
96
+ /** Emitted by `archiveExpiredProposals()` for each expired proposal. */
97
+ export interface DIDRevisionProposalExpiredEvent {
98
+ type: 'DIDRevisionProposalExpired';
99
+ proposalId: string;
100
+ shardId: string;
101
+ field: string;
102
+ classification: DriftClassification;
103
+ createdAt: string;
104
+ expiredAt: string;
105
+ }
106
+ /** Emitted when a proposal is rejected; flows back into the calibration log. */
107
+ export interface ProposalRejectionRecord {
108
+ proposalId: string;
109
+ shardId: string;
110
+ field: string;
111
+ rejectedBy: string;
112
+ rationale: string;
113
+ rejectedAt: string;
114
+ classification: DriftClassification;
115
+ /** Confidence weight carried forward into future trigger evaluations. */
116
+ rejectionPrecedentWeight: number;
117
+ }
118
+ /**
119
+ * Classify drift as healthy / unhealthy / ambiguous per RFC-0031 §7.
120
+ *
121
+ * ```
122
+ * healthy: icpMatchRate > 0.6 AND NOT coreDIDFieldsAffected
123
+ * unhealthy: icpMatchRate < 0.3 OR (coreDIDFieldsAffected AND dismissToEscalateRatio < 1.0)
124
+ * ambiguous: everything else
125
+ * ```
126
+ */
127
+ export declare function classifyDrift(evidence: ClassificationEvidence): DriftClassification;
128
+ /**
129
+ * Derive approval path from identityClass per RFC-0031 §8.
130
+ *
131
+ * - `core` → `triad` (all three pillar leads required)
132
+ * - `evolving` → `pillarLead` (owning lead + one other)
133
+ * - `undefined` → `triad` (default-tighten when class is undeclared)
134
+ * - ambiguous classification always → `triad` (§7 override)
135
+ */
136
+ export declare function deriveApprovalPath(identityClass: IdentityClass | undefined, classification: DriftClassification): ApprovalPath;
137
+ /**
138
+ * Compute proposal confidence from trigger evidence + classification clarity
139
+ * + identityClass (OQ-12.1 resolved position: confidence = f(sample size,
140
+ * classification clarity, identityClass)).
141
+ *
142
+ * Thresholds are per-org configurable via `.ai-sdlc/calibration.yaml`
143
+ * (Refit AISDLC-310). Defaults match the shipped AISDLC-271 values:
144
+ *
145
+ * - high: sampleSize ≥ highSampleSize (default 20) AND classification != 'ambiguous' AND identityClass = 'evolving'
146
+ * - low: sampleSize < lowSampleSize (default 5) OR classification = 'ambiguous' OR identityClass = 'core'
147
+ * - medium: everything else
148
+ *
149
+ * @param calibrationConfig Optional resolved config from `parseRevisionProposalCalibrationYaml()`.
150
+ * When omitted, shipped defaults (20 / 5) are used.
151
+ */
152
+ export declare function computeConfidence(triggerEvidence: TriggerEvidence, classification: DriftClassification, identityClass: IdentityClass | undefined, calibrationConfig?: ResolvedRevisionProposalCalibrationConfig): ProposalConfidence;
153
+ export interface TriggerConditions {
154
+ /** Dismiss-signal count over the last `triggerWindowDays`. */
155
+ dismissSignals: number;
156
+ escalateSignals: number;
157
+ /** SA gap between demand clusters and DID field — sustained over 3 sprints. */
158
+ demandMisalignment: number;
159
+ /** SoulDriftDetected events attributable to this field (indefinite window). */
160
+ driftEvents: number;
161
+ }
162
+ export interface TriggerConfig {
163
+ dismissThreshold?: number;
164
+ demandMisalignmentThreshold?: number;
165
+ driftEventsThreshold?: number;
166
+ triggerWindowDays?: number;
167
+ }
168
+ /**
169
+ * Returns true if ANY trigger condition fires per RFC-0031 §6.
170
+ */
171
+ export declare function triggerConditionMet(conditions: TriggerConditions, config?: TriggerConfig): boolean;
172
+ export interface CalibrationLockConfig {
173
+ /** List of JSON-path field identifiers that should never receive auto-proposals. */
174
+ lockNoProposal?: string[];
175
+ }
176
+ /**
177
+ * Returns true if the given field is locked from auto-proposals per OQ-12.3.
178
+ *
179
+ * Proposal generation SKIPS locked fields. Operators remove entries from
180
+ * `lockNoProposal` to opt back in.
181
+ */
182
+ export declare function isFieldLocked(field: string, lockConfig: CalibrationLockConfig): boolean;
183
+ export interface EvaluateRevisionProposalInput {
184
+ shardId: string;
185
+ /** JSON path for the DID field being evaluated, e.g. "soulPurpose.mission". */
186
+ field: string;
187
+ currentValue: unknown;
188
+ /** PPA's best inferred proposed value based on flywheel evidence. */
189
+ proposedValue: unknown;
190
+ identityClass: IdentityClass | undefined;
191
+ triggerConditions: TriggerConditions;
192
+ classificationEvidence: ClassificationEvidence;
193
+ lockConfig?: CalibrationLockConfig;
194
+ config?: TriggerConfig & {
195
+ expiryDays?: number;
196
+ };
197
+ /**
198
+ * Per-org calibration config loaded from `.ai-sdlc/calibration.yaml`.
199
+ * When omitted, shipped AISDLC-271 defaults are used for confidence
200
+ * thresholds (Refit AISDLC-310 / RFC-0031 §12.6).
201
+ */
202
+ calibrationConfig?: ResolvedRevisionProposalCalibrationConfig;
203
+ /** Clock injection for tests. */
204
+ now?: () => number;
205
+ }
206
+ export type EvaluateRevisionProposalResult = {
207
+ kind: 'proposal';
208
+ event: DIDRevisionProposalEvent;
209
+ } | {
210
+ kind: 'diagnostic';
211
+ event: SoulHealthDiagnosticEvent;
212
+ } | {
213
+ kind: 'ambiguous';
214
+ proposal: DIDRevisionProposalEvent;
215
+ diagnostic: SoulHealthDiagnosticEvent;
216
+ } | {
217
+ kind: 'skipped';
218
+ reason: 'locked' | 'no-trigger';
219
+ };
220
+ /**
221
+ * Evaluate whether a DIDRevisionProposal should be generated for a given
222
+ * DID field. Entry point called once per field (one-field-per-proposal in
223
+ * v1 per OQ-12.2).
224
+ *
225
+ * Returns a discriminated union describing what was produced:
226
+ * - `proposal` — healthy drift; one DIDRevisionProposalEvent
227
+ * - `diagnostic` — unhealthy drift; one SoulHealthDiagnosticEvent
228
+ * - `ambiguous` — both events produced, both flagged for triad review
229
+ * - `skipped` — field is locked or trigger conditions not met
230
+ */
231
+ export declare function evaluateRevisionProposal(input: EvaluateRevisionProposalInput): EvaluateRevisionProposalResult;
232
+ /**
233
+ * Check whether a proposal has passed its `expiresAt` timestamp.
234
+ *
235
+ * AISDLC-271 PR #476 round-2: validates expiresAt is parseable. Pre-fix
236
+ * a malformed (or attacker-mutated) expiresAt would silently NEVER
237
+ * expire because Date.parse returns NaN and `NaN <= now` is always false.
238
+ */
239
+ export declare function isProposalExpired(proposal: DIDRevisionProposalEvent, nowMs?: number): boolean;
240
+ /**
241
+ * Archive expired proposals and emit `DIDRevisionProposalExpired` events.
242
+ * Returns the list of expiry events for caller to process (persist / alert).
243
+ *
244
+ * Per §9: expiry without resolution emits the event — operator alert, not
245
+ * silent dismissal. Auto-archives by setting status to 'expired'.
246
+ */
247
+ export declare function archiveExpiredProposals(proposals: DIDRevisionProposalEvent[], nowMs?: number): {
248
+ expired: DIDRevisionProposalExpiredEvent[];
249
+ remaining: DIDRevisionProposalEvent[];
250
+ };
251
+ /**
252
+ * Record a proposal rejection and compute the `rejectionPrecedentWeight`
253
+ * to feed back into future trigger evaluations (OQ-12.5 resolved position:
254
+ * rejection rationale captured in calibration log; future trigger evaluations
255
+ * weight rejection-precedent into confidence).
256
+ *
257
+ * Weight formula (defaults from AISDLC-271, per-org configurable via
258
+ * `calibration.yaml` — Refit AISDLC-310 / RFC-0031 §12.6):
259
+ * - high-confidence proposals that were rejected → 0.8 (default)
260
+ * - medium-confidence → 0.5 (default)
261
+ * - low-confidence → 0.2 default (expected noise level, lower weight)
262
+ *
263
+ * Callers persist this record to their calibration log; the next trigger
264
+ * evaluation should factor it in by reducing effective confidence.
265
+ *
266
+ * @param calibrationConfig Optional resolved config from `parseRevisionProposalCalibrationYaml()`.
267
+ * When omitted, shipped AISDLC-271 weights (0.8 / 0.5 / 0.2) are used.
268
+ */
269
+ export declare function recordRejection(proposal: DIDRevisionProposalEvent, rejectedBy: string, rationale: string, now?: () => number, calibrationConfig?: ResolvedRevisionProposalCalibrationConfig): ProposalRejectionRecord;
270
+ /**
271
+ * Apply rejection precedent to reduce effective trigger confidence.
272
+ * When a field has prior rejection records, the aggregated precedent
273
+ * weight penalises future proposals for the same field.
274
+ *
275
+ * Formula (RFC-0031 §12.6): `factor = max(floor, 1.0 - avgWeight × 0.5)`
276
+ * where `floor` is `confidencePenaltyFloor` from calibration config
277
+ * (default 0.2 — at most 80% suppression).
278
+ *
279
+ * Returns a factor in `[floor, 1.0]`. Callers decide how to interpret.
280
+ *
281
+ * @param calibrationConfig Optional resolved config from `parseRevisionProposalCalibrationYaml()`.
282
+ * When omitted, shipped AISDLC-271 floor (0.2) is used.
283
+ */
284
+ export declare function computeRejectionPrecedentFactor(field: string, rejections: readonly ProposalRejectionRecord[], calibrationConfig?: ResolvedRevisionProposalCalibrationConfig): number;
285
+ //# sourceMappingURL=revision-proposal.d.ts.map