@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.
- package/dist/__test-helpers/git-env.d.ts +40 -0
- package/dist/__test-helpers/git-env.js +73 -0
- package/dist/adapters.d.ts +42 -3
- package/dist/adapters.js +133 -3
- package/dist/admission-composite.d.ts +134 -1
- package/dist/admission-composite.js +170 -6
- package/dist/admission-enrichment.d.ts +12 -3
- package/dist/admission-enrichment.js +71 -10
- package/dist/admission-hc.d.ts +20 -1
- package/dist/admission-hc.js +12 -1
- package/dist/admission-score.d.ts +44 -0
- package/dist/admission-score.js +11 -2
- package/dist/backlog-adapter.d.ts +45 -0
- package/dist/backlog-adapter.js +145 -1
- package/dist/calibration.d.ts +81 -0
- package/dist/calibration.js +76 -0
- package/dist/cli/commands/git-remote.d.ts +25 -0
- package/dist/cli/commands/git-remote.js +80 -1
- package/dist/cli/commands/init-features.d.ts +507 -0
- package/dist/cli/commands/init-features.js +1100 -0
- package/dist/cli/commands/init-templates.d.ts +301 -0
- package/dist/cli/commands/init-templates.js +1341 -0
- package/dist/cli/commands/init.d.ts +67 -0
- package/dist/cli/commands/init.js +301 -2
- package/dist/cli/commands/run.js +9 -1
- package/dist/cli/index.d.ts +11 -0
- package/dist/cli/index.js +42 -8
- package/dist/compliance/composer.d.ts +79 -0
- package/dist/compliance/composer.js +258 -0
- package/dist/compliance/errors.d.ts +64 -0
- package/dist/compliance/errors.js +85 -0
- package/dist/compliance/loader.d.ts +52 -0
- package/dist/compliance/loader.js +124 -0
- package/dist/compliance/types.d.ts +184 -0
- package/dist/compliance/types.js +41 -0
- package/dist/compliance-clearance.d.ts +269 -0
- package/dist/compliance-clearance.js +269 -0
- package/dist/config.js +17 -0
- package/dist/cost-tracker.d.ts +22 -0
- package/dist/cost-tracker.js +41 -0
- package/dist/database/adapters/external.js +5 -1
- package/dist/design-authority.d.ts +13 -0
- package/dist/design-authority.js +13 -0
- package/dist/embedding/adapters/openai-text-embedding-3-small.d.ts +71 -0
- package/dist/embedding/adapters/openai-text-embedding-3-small.js +190 -0
- package/dist/embedding/consumers/tessellation-drift.d.ts +74 -0
- package/dist/embedding/consumers/tessellation-drift.js +76 -0
- package/dist/embedding/cross-provider.d.ts +78 -0
- package/dist/embedding/cross-provider.js +75 -0
- package/dist/embedding/deprecation.d.ts +151 -0
- package/dist/embedding/deprecation.js +229 -0
- package/dist/embedding/errors.d.ts +90 -0
- package/dist/embedding/errors.js +150 -0
- package/dist/embedding/index.d.ts +29 -0
- package/dist/embedding/index.js +24 -0
- package/dist/embedding/pipeline-load.d.ts +146 -0
- package/dist/embedding/pipeline-load.js +178 -0
- package/dist/embedding/registry.d.ts +45 -0
- package/dist/embedding/registry.js +61 -0
- package/dist/embedding/stale-vector.d.ts +110 -0
- package/dist/embedding/stale-vector.js +92 -0
- package/dist/embedding/storage/index.d.ts +51 -0
- package/dist/embedding/storage/index.js +43 -0
- package/dist/embedding/storage/jsonl-backend.d.ts +150 -0
- package/dist/embedding/storage/jsonl-backend.js +332 -0
- package/dist/embedding/storage/types.d.ts +135 -0
- package/dist/embedding/storage/types.js +13 -0
- package/dist/embedding/types.d.ts +180 -0
- package/dist/embedding/types.js +10 -0
- package/dist/execute.d.ts +29 -2
- package/dist/execute.js +179 -35
- package/dist/index.d.ts +14 -2
- package/dist/index.js +19 -2
- package/dist/journey/inheritance-validator.d.ts +396 -0
- package/dist/journey/inheritance-validator.js +370 -0
- package/dist/journey/state-id-drift-rule.d.ts +137 -0
- package/dist/journey/state-id-drift-rule.js +245 -0
- package/dist/journey-sa2-router.d.ts +395 -0
- package/dist/journey-sa2-router.js +308 -0
- package/dist/models/classifier.d.ts +3 -1
- package/dist/models/classifier.js +61 -5
- package/dist/pillar-breakdown.d.ts +23 -1
- package/dist/pillar-breakdown.js +9 -0
- package/dist/runners/review-agent.js +6 -2
- package/dist/runners/runner-registry.d.ts +36 -0
- package/dist/runners/runner-registry.js +90 -0
- package/dist/runtime/attestations.d.ts +663 -11
- package/dist/runtime/attestations.js +971 -24
- package/dist/runtime/index.d.ts +1 -1
- package/dist/runtime/index.js +1 -1
- package/dist/runtime/parallelism-flag.d.ts +21 -3
- package/dist/runtime/parallelism-flag.js +27 -6
- package/dist/runtime/port-allocator.d.ts +11 -0
- package/dist/runtime/port-allocator.js +30 -0
- package/dist/sa-scoring/layer3-llm.js +6 -1
- package/dist/sa-scoring/revision-proposal-config.d.ts +178 -0
- package/dist/sa-scoring/revision-proposal-config.js +198 -0
- package/dist/sa-scoring/revision-proposal.d.ts +285 -0
- package/dist/sa-scoring/revision-proposal.js +417 -0
- package/dist/signal-ingestion/adapters/community-thread.d.ts +43 -0
- package/dist/signal-ingestion/adapters/community-thread.js +55 -0
- package/dist/signal-ingestion/adapters/in-app-feedback.d.ts +67 -0
- package/dist/signal-ingestion/adapters/in-app-feedback.js +51 -0
- package/dist/signal-ingestion/adapters/manual.d.ts +78 -0
- package/dist/signal-ingestion/adapters/manual.js +112 -0
- package/dist/signal-ingestion/adapters/support-ticket.d.ts +47 -0
- package/dist/signal-ingestion/adapters/support-ticket.js +51 -0
- package/dist/signal-ingestion/classifier.d.ts +205 -0
- package/dist/signal-ingestion/classifier.js +494 -0
- package/dist/signal-ingestion/clustering-types.d.ts +36 -0
- package/dist/signal-ingestion/clustering-types.js +14 -0
- package/dist/signal-ingestion/clustering.d.ts +200 -0
- package/dist/signal-ingestion/clustering.js +413 -0
- package/dist/signal-ingestion/config.d.ts +351 -0
- package/dist/signal-ingestion/config.js +587 -0
- package/dist/signal-ingestion/d1.d.ts +252 -0
- package/dist/signal-ingestion/d1.js +235 -0
- package/dist/signal-ingestion/errors.d.ts +73 -0
- package/dist/signal-ingestion/errors.js +108 -0
- package/dist/signal-ingestion/governance-events.d.ts +181 -0
- package/dist/signal-ingestion/governance-events.js +189 -0
- package/dist/signal-ingestion/index.d.ts +35 -0
- package/dist/signal-ingestion/index.js +53 -0
- package/dist/signal-ingestion/manual-share-metric.d.ts +93 -0
- package/dist/signal-ingestion/manual-share-metric.js +106 -0
- package/dist/signal-ingestion/registry.d.ts +40 -0
- package/dist/signal-ingestion/registry.js +137 -0
- package/dist/signal-ingestion/residency.d.ts +227 -0
- package/dist/signal-ingestion/residency.js +238 -0
- package/dist/signal-ingestion/significance.d.ts +554 -0
- package/dist/signal-ingestion/significance.js +555 -0
- package/dist/signal-ingestion/types.d.ts +191 -0
- package/dist/signal-ingestion/types.js +8 -0
- package/dist/substrate/drift-composition.d.ts +270 -0
- package/dist/substrate/drift-composition.js +306 -0
- package/dist/substrate/drift-tui-surface.d.ts +61 -0
- package/dist/substrate/drift-tui-surface.js +102 -0
- package/dist/substrate/identity-class.d.ts +176 -0
- package/dist/substrate/identity-class.js +201 -0
- package/dist/tessellation/cross-soul-provenance-rule.d.ts +133 -0
- package/dist/tessellation/cross-soul-provenance-rule.js +171 -0
- package/dist/tessellation/inter-soul-embedding-distance-rule.d.ts +61 -0
- package/dist/tessellation/inter-soul-embedding-distance-rule.js +67 -0
- package/dist/tessellation/rule-registry.d.ts +269 -0
- package/dist/tessellation/rule-registry.js +92 -0
- package/dist/tessellation/soul-slug-ast-scan-rule.d.ts +90 -0
- package/dist/tessellation/soul-slug-ast-scan-rule.js +158 -0
- package/dist/tessellation-admission.d.ts +162 -0
- package/dist/tessellation-admission.js +146 -0
- package/dist/tessellation-drift.d.ts +246 -0
- package/dist/tessellation-drift.js +250 -0
- package/dist/validate-config.js +13 -0
- package/dist/validate-issue.js +2 -2
- package/dist/variant/cardinality-activation.d.ts +126 -0
- package/dist/variant/cardinality-activation.js +101 -0
- package/dist/variant/deprecation-lifecycle.d.ts +184 -0
- package/dist/variant/deprecation-lifecycle.js +208 -0
- package/dist/variant/drift-extension.d.ts +136 -0
- package/dist/variant/drift-extension.js +164 -0
- package/dist/variant/engineering-review.d.ts +185 -0
- package/dist/variant/engineering-review.js +142 -0
- package/dist/variant/index.d.ts +32 -0
- package/dist/variant/index.js +32 -0
- package/dist/variant/inheritance-validator.d.ts +165 -0
- package/dist/variant/inheritance-validator.js +139 -0
- package/dist/variant/internal-adopter/index.d.ts +11 -0
- package/dist/variant/internal-adopter/index.js +10 -0
- package/dist/variant/internal-adopter/products.d.ts +156 -0
- package/dist/variant/internal-adopter/products.js +366 -0
- package/dist/variant-admission.d.ts +316 -0
- package/dist/variant-admission.js +247 -0
- package/package.json +11 -8
|
@@ -0,0 +1,351 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Signal ingestion configuration loader for RFC-0030 Phase 2.
|
|
3
|
+
*
|
|
4
|
+
* Reads `.ai-sdlc/signal-ingestion.yaml`, validates its shape, and returns a
|
|
5
|
+
* fully-resolved `SignalIngestionConfig` with all defaults applied.
|
|
6
|
+
*
|
|
7
|
+
* Design decisions:
|
|
8
|
+
* - Missing file → returns the default config (pipeline is disabled by default).
|
|
9
|
+
* - Invalid YAML or schema mismatch → throws `SignalIngestionConfigError`.
|
|
10
|
+
* - All numeric fields are validated to be non-negative finite numbers.
|
|
11
|
+
* - `acceptedLanguages` defaults to `['en']` per RFC-0030 OQ-13.2 resolution.
|
|
12
|
+
* - Tier multipliers and ICP resonance weights are read from the config; the
|
|
13
|
+
* defaults match RFC-0030 §11.
|
|
14
|
+
* - `flooding` block (RFC-0030 OQ-13.5 v0.3 re-walkthrough refinement,
|
|
15
|
+
* AISDLC-433) replaces the legacy `sourceBaselineDriftMultiplier` knob
|
|
16
|
+
* with a z-score detector on per-source rolling 7d baseline + quarantine.
|
|
17
|
+
* The legacy `flooding.detection.sourceBaselineDriftMultiplier` field at
|
|
18
|
+
* the LOADER level emits a `signal-ingestion-config-deprecated-field`
|
|
19
|
+
* Decision; the loader translates it to the closest z-score equivalent
|
|
20
|
+
* for one release window then hard-errors after the soak.
|
|
21
|
+
*/
|
|
22
|
+
export declare const DEFAULT_SIGNAL_INGESTION_CONFIG_PATH = ".ai-sdlc/signal-ingestion.yaml";
|
|
23
|
+
/** Tier multipliers keyed by CustomerTier. All values must be non-negative. */
|
|
24
|
+
export interface TierMultipliers {
|
|
25
|
+
enterprise: number;
|
|
26
|
+
mid: number;
|
|
27
|
+
smb: number;
|
|
28
|
+
free: number;
|
|
29
|
+
churned: number;
|
|
30
|
+
}
|
|
31
|
+
/** ICP resonance weights keyed by ICPResonance level. All values must be non-negative. */
|
|
32
|
+
export interface IcpResonanceWeights {
|
|
33
|
+
strong: number;
|
|
34
|
+
partial: number;
|
|
35
|
+
weak: number;
|
|
36
|
+
}
|
|
37
|
+
/** Tier 2 significance threshold parameters. */
|
|
38
|
+
export interface Tier2SignificanceThreshold {
|
|
39
|
+
/** Minimum number of signals in the cluster to qualify. */
|
|
40
|
+
minSignalCount: number;
|
|
41
|
+
/** Minimum number of distinct sources in the cluster. */
|
|
42
|
+
minUniqueSources: number;
|
|
43
|
+
/** Minimum number of Tier 1 signals required in the cluster. */
|
|
44
|
+
minTier1SignalCount: number;
|
|
45
|
+
/** Minimum cluster age in days. */
|
|
46
|
+
minClusterAgeDays: number;
|
|
47
|
+
}
|
|
48
|
+
/** SA resonance threshold configuration for D1 weight bands. */
|
|
49
|
+
export interface SaResonanceThresholds {
|
|
50
|
+
/** Clusters at or above this score receive full weight. */
|
|
51
|
+
fullWeight: number;
|
|
52
|
+
/** Clusters at or above this score (but below fullWeight) receive discounted weight. */
|
|
53
|
+
discounted: number;
|
|
54
|
+
/** Clusters at or above this score (but below discounted) are flagged for review. */
|
|
55
|
+
excluded: number;
|
|
56
|
+
}
|
|
57
|
+
/** Clustering algorithm and parameters. */
|
|
58
|
+
export interface ClusteringConfig {
|
|
59
|
+
algorithm: 'bm25' | 'embedding';
|
|
60
|
+
similarityThreshold: number;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Language-detection configuration (RFC-0030 OQ-13.2 re-walkthrough v0.3).
|
|
64
|
+
*
|
|
65
|
+
* v0.3 adds explicit `franc` library specification + behaviour controls.
|
|
66
|
+
* The previous v0.2 implementation used a script-block heuristic that
|
|
67
|
+
* conflated "non-Latin script" with "non-English", causing false drops on
|
|
68
|
+
* legitimate English payloads containing CJK identifiers (e.g. office names)
|
|
69
|
+
* and false accepts on legitimate French / Spanish / German payloads
|
|
70
|
+
* (Latin script but not English). `franc` is deterministic, MIT-licensed,
|
|
71
|
+
* JS-native, runs in <10ms per signal on text >50 chars at 95%+ accuracy.
|
|
72
|
+
*/
|
|
73
|
+
export interface LanguageDetectionConfig {
|
|
74
|
+
/**
|
|
75
|
+
* Detection library identifier. Currently always `'franc'` — the field
|
|
76
|
+
* exists as a forward-compat hook for swapping the detector (e.g. LLM-based
|
|
77
|
+
* detection in v2). Configuring `'none'` disables the gate entirely,
|
|
78
|
+
* useful for testing or for adopters that pre-filter signals upstream.
|
|
79
|
+
*/
|
|
80
|
+
library: 'franc' | 'none';
|
|
81
|
+
/**
|
|
82
|
+
* Minimum character count below which `franc` returns 'und' (undetermined).
|
|
83
|
+
* Below this length, signals are accepted without language gating to avoid
|
|
84
|
+
* dropping legitimate short payloads (e.g. "Bug: crash on save" — 18 chars).
|
|
85
|
+
* Default 50 — the practical lower bound for franc accuracy.
|
|
86
|
+
*/
|
|
87
|
+
minDetectionLength: number;
|
|
88
|
+
/**
|
|
89
|
+
* Behaviour when franc returns 'und' (text too short OR no script matched).
|
|
90
|
+
* `'accept'` (default) is conservative — pass through to the rest of the
|
|
91
|
+
* pipeline since short payloads + ambiguous scripts have low false-positive
|
|
92
|
+
* risk. `'drop'` is strict — drop and log as `signal-language-unsupported`.
|
|
93
|
+
*/
|
|
94
|
+
onUndetermined: 'accept' | 'drop';
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Phase 5 — non-replacement weighting between signal-pipeline-derived demand
|
|
98
|
+
* and human-authored backlog-item demand when both feed D1 (RFC-0030 §10).
|
|
99
|
+
*
|
|
100
|
+
* **Backward compat (AC #4)**: when `enabled: false` at the top level, only
|
|
101
|
+
* `backlogItemWeight` is in effect — `signalPipelineWeight` is irrelevant
|
|
102
|
+
* because no pipeline-derived demand exists. When `enabled: true`, both
|
|
103
|
+
* weights blend the two demand streams; default 50/50 keeps neither stream
|
|
104
|
+
* dominant out of the box.
|
|
105
|
+
*
|
|
106
|
+
* The weights are normalised to sum to 1 inside `composeD1Inputs()` so any
|
|
107
|
+
* positive pair is meaningful (e.g. `{1, 3}` becomes `{0.25, 0.75}`).
|
|
108
|
+
*/
|
|
109
|
+
export interface D1CompositionWeights {
|
|
110
|
+
/**
|
|
111
|
+
* Weight applied to the signal-pipeline-derived (cluster-aggregate) D1
|
|
112
|
+
* input. Default 0.5 — even blend with backlog-derived demand.
|
|
113
|
+
*/
|
|
114
|
+
signalPipelineWeight: number;
|
|
115
|
+
/**
|
|
116
|
+
* Weight applied to the human-authored backlog-item demand input.
|
|
117
|
+
* Default 0.5 — even blend with signal-pipeline demand.
|
|
118
|
+
*/
|
|
119
|
+
backlogItemWeight: number;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Per-stage residency enforcement toggles per RFC-0030 v0.3 OQ-13.3
|
|
123
|
+
* re-walkthrough. Each flag corresponds to an enforcement point in the
|
|
124
|
+
* pipeline:
|
|
125
|
+
*
|
|
126
|
+
* - `fetchSignals`: adapter-level signal tag check against allowed regions
|
|
127
|
+
* (already implemented via `checkSignalResidency`).
|
|
128
|
+
* - `clustering`: partition signals by residencyRegion before similarity
|
|
129
|
+
* computation; cross-region cluster merge is structurally impossible.
|
|
130
|
+
* - `storage`: persist `residencyRegion` field on every stored record;
|
|
131
|
+
* cross-region reads emit elevated audit-log entries.
|
|
132
|
+
* - `unifiedCostReport`: group cost attribution rows by region so per-region
|
|
133
|
+
* totals are visible in the unified cost report.
|
|
134
|
+
*
|
|
135
|
+
* `multiPostureBehavior` controls how the pipeline composes multiple regimes
|
|
136
|
+
* declared by the adopter. `'union'` is the v0.3 default — UNION of regime
|
|
137
|
+
* constraints, strictest applies (when an adopter declares HIPAA AND GDPR,
|
|
138
|
+
* a signal must satisfy BOTH regimes' allowed-region constraints).
|
|
139
|
+
*
|
|
140
|
+
* Defaults match RFC-0030 §11 v0.3 (all enforcement points ON; multi-posture
|
|
141
|
+
* = UNION).
|
|
142
|
+
*/
|
|
143
|
+
export interface ResidencyEnforcementConfig {
|
|
144
|
+
sourceFromCompliancePosture: boolean;
|
|
145
|
+
enforcementPoints: {
|
|
146
|
+
fetchSignals: boolean;
|
|
147
|
+
clustering: boolean;
|
|
148
|
+
storage: boolean;
|
|
149
|
+
unifiedCostReport: boolean;
|
|
150
|
+
};
|
|
151
|
+
multiPostureBehavior: 'union';
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* RFC-0030 OQ-13.4 v0.3 re-walkthrough — manual-entry anti-gaming hardening.
|
|
155
|
+
*
|
|
156
|
+
* Layered on top of the shipped audit-trail pattern (RFC-0022 OQ-2: forced
|
|
157
|
+
* `attestedBy` + auto-filled `attestedAt`):
|
|
158
|
+
*
|
|
159
|
+
* - `dailyCapPerOperator`: per-operator UTC-day rate limit on manual entries
|
|
160
|
+
* (default 10/day). Above cap → `Decision: manual-signal-rate-limit-exceeded`.
|
|
161
|
+
* - `evidenceUrlOptional`: when `true`, manual signals MAY carry an
|
|
162
|
+
* `evidenceUrl` field (call recording URL, ticket URL, transcript link).
|
|
163
|
+
* The field is preserved through the pipeline + visible in audit export.
|
|
164
|
+
* - `qualityMetric`: rolling manual/total share metric. When the share
|
|
165
|
+
* exceeds `shareWarningThreshold` over `windowDays` → `Decision:
|
|
166
|
+
* manual-signal-share-elevated` (warning, not block — surfaces
|
|
167
|
+
* architectural anti-pattern).
|
|
168
|
+
*/
|
|
169
|
+
export interface ManualEntryQualityMetricConfig {
|
|
170
|
+
enabled: boolean;
|
|
171
|
+
windowDays: number;
|
|
172
|
+
shareWarningThreshold: number;
|
|
173
|
+
}
|
|
174
|
+
export interface ManualEntryConfig {
|
|
175
|
+
/** Per-operator UTC-day cap. Default 10. Set to `0` to disable. */
|
|
176
|
+
dailyCapPerOperator: number;
|
|
177
|
+
/** Whether the optional `evidenceUrl` field on manual signals is accepted. */
|
|
178
|
+
evidenceUrlOptional: boolean;
|
|
179
|
+
/** Rolling manual-share quality metric configuration. */
|
|
180
|
+
qualityMetric: ManualEntryQualityMetricConfig;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Flooding-detection block (RFC-0030 OQ-13.5 v0.3 re-walkthrough refinement).
|
|
184
|
+
*
|
|
185
|
+
* REPLACES the legacy fixed-multiplier detector with z-score on a rolling
|
|
186
|
+
* per-source baseline. The trigger condition is
|
|
187
|
+
* `volume_in_window > (baseline_mean + zScoreThreshold × baseline_stddev)
|
|
188
|
+
* AND uniqueSources_in_window < minUniqueSourcesForSuspicion`.
|
|
189
|
+
*
|
|
190
|
+
* Cold-start handling (per AC #4): when the rolling baseline has fewer than
|
|
191
|
+
* `baselineDays` of history, the detector returns the special `calibrating`
|
|
192
|
+
* status and emits NO `signal-flooding-detected` Decision — Tier 2
|
|
193
|
+
* significance is the sole defense during the calibration window.
|
|
194
|
+
*/
|
|
195
|
+
export interface FloodingDetectionConfig {
|
|
196
|
+
/** Z-score threshold (σ multiples) above baseline mean. Default 3.0. */
|
|
197
|
+
zScoreThreshold: number;
|
|
198
|
+
/** Detection window in minutes. Default 60. */
|
|
199
|
+
windowMinutes: number;
|
|
200
|
+
/** `uniqueSources < this` is part of the trigger condition. Default 3. */
|
|
201
|
+
minUniqueSourcesForSuspicion: number;
|
|
202
|
+
/** Rolling-baseline window in days. Default 7. */
|
|
203
|
+
baselineDays: number;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Quarantine sub-block (RFC-0030 §13.5 v0.3). Quarantined signals are NOT
|
|
207
|
+
* fed to D1; quarantine auto-expires after `durationHours`. Operators can
|
|
208
|
+
* unquarantine before expiry via `unquarantineFlooded()`.
|
|
209
|
+
*/
|
|
210
|
+
export interface FloodingQuarantineConfig {
|
|
211
|
+
/** Master switch. When false, flooding Decisions emit but signals stay live. */
|
|
212
|
+
enabled: boolean;
|
|
213
|
+
/** How long quarantine lasts before auto-expiry. Default 24h. */
|
|
214
|
+
durationHours: number;
|
|
215
|
+
}
|
|
216
|
+
/** Combined flooding config (detection + quarantine). */
|
|
217
|
+
export interface FloodingConfig {
|
|
218
|
+
detection: FloodingDetectionConfig;
|
|
219
|
+
quarantine: FloodingQuarantineConfig;
|
|
220
|
+
}
|
|
221
|
+
/** Fully-resolved signal ingestion configuration. */
|
|
222
|
+
export interface SignalIngestionConfig {
|
|
223
|
+
enabled: boolean;
|
|
224
|
+
tierMultipliers: TierMultipliers;
|
|
225
|
+
icpResonanceWeights: IcpResonanceWeights;
|
|
226
|
+
recencyHalfLifeDays: number;
|
|
227
|
+
tier2SignificanceThreshold: Tier2SignificanceThreshold;
|
|
228
|
+
saResonanceThresholds: SaResonanceThresholds;
|
|
229
|
+
clustering: ClusteringConfig;
|
|
230
|
+
d1Composition: D1CompositionWeights;
|
|
231
|
+
adapters: string[];
|
|
232
|
+
/**
|
|
233
|
+
* Per-org list of accepted BCP-47 (or ISO 639-1 / 639-3) language tags.
|
|
234
|
+
* Default: `['en']`.
|
|
235
|
+
*
|
|
236
|
+
* Signals whose detected language is NOT in this list are dropped and logged
|
|
237
|
+
* as `Decision: signal-language-unsupported` (RFC-0030 OQ-13.2 v0.3
|
|
238
|
+
* resolution). Multi-language opt-in (e.g. `['en', 'fr', 'es']`) accepts
|
|
239
|
+
* signals in any listed language; adopters take on documented BM25 quality
|
|
240
|
+
* degradation (~15-30% precision drop without per-language stopwords /
|
|
241
|
+
* stemming — Robertson & Zaragoza §3.5) in exchange for non-English signal
|
|
242
|
+
* coverage.
|
|
243
|
+
*
|
|
244
|
+
* Tags are normalised to lowercase. The detector returns ISO 639-3
|
|
245
|
+
* three-letter codes (`'eng'`, `'fra'`, `'spa'`); the config matcher
|
|
246
|
+
* accepts the common forms (`'en'`, `'eng'`, `'en-US'`) and maps them
|
|
247
|
+
* to the 639-3 family.
|
|
248
|
+
*/
|
|
249
|
+
acceptedLanguages: string[];
|
|
250
|
+
/**
|
|
251
|
+
* Language-detection runtime config (RFC-0030 §11 v0.3). The default
|
|
252
|
+
* specifies `franc` per the OQ-13.2 re-walkthrough resolution.
|
|
253
|
+
*/
|
|
254
|
+
languageDetection: LanguageDetectionConfig;
|
|
255
|
+
/**
|
|
256
|
+
* Per-stage residency enforcement configuration per RFC-0030 OQ-13.3
|
|
257
|
+
* re-walkthrough (v0.3). Defaults to all enforcement points ON with
|
|
258
|
+
* `multiPostureBehavior: 'union'`.
|
|
259
|
+
*/
|
|
260
|
+
residencyEnforcement: ResidencyEnforcementConfig;
|
|
261
|
+
/**
|
|
262
|
+
* RFC-0030 OQ-13.4 v0.3 — manual-entry anti-gaming config block.
|
|
263
|
+
*/
|
|
264
|
+
manualEntry: ManualEntryConfig;
|
|
265
|
+
/**
|
|
266
|
+
* Flooding-detection + quarantine block (RFC-0030 OQ-13.5 v0.3
|
|
267
|
+
* re-walkthrough refinement, AISDLC-433). REPLACES the legacy
|
|
268
|
+
* multiplier-based detector path; the loader emits a
|
|
269
|
+
* `signal-ingestion-config-deprecated-field` Decision when the legacy
|
|
270
|
+
* `flooding.detection.sourceBaselineDriftMultiplier` key is still present
|
|
271
|
+
* AND translates it to the closest z-score equivalent for one release
|
|
272
|
+
* window (then hard-errors).
|
|
273
|
+
*/
|
|
274
|
+
flooding: FloodingConfig;
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Decision emitted by the config loader when a deprecated field is still
|
|
278
|
+
* present in `.ai-sdlc/signal-ingestion.yaml`. Translated to the closest
|
|
279
|
+
* z-score equivalent for one release window; after the soak, the loader
|
|
280
|
+
* hard-errors instead of translating (controlled by
|
|
281
|
+
* `AI_SDLC_SIGNAL_INGESTION_LEGACY_HARD_ERROR=1`).
|
|
282
|
+
*
|
|
283
|
+
* Returned alongside the resolved config from
|
|
284
|
+
* `loadSignalIngestionConfigWithDeprecations()` so the caller can route the
|
|
285
|
+
* Decision to the catalog without coupling the loader to event emission.
|
|
286
|
+
*/
|
|
287
|
+
export interface SignalIngestionConfigDeprecatedFieldDecision {
|
|
288
|
+
type: 'Decision';
|
|
289
|
+
decision: 'signal-ingestion-config-deprecated-field';
|
|
290
|
+
/** Deprecated field path, e.g. `flooding.detection.sourceBaselineDriftMultiplier`. */
|
|
291
|
+
field: string;
|
|
292
|
+
/** What the operator should switch to. */
|
|
293
|
+
replacement: string;
|
|
294
|
+
/** Legacy value the loader translated from (for audit). */
|
|
295
|
+
legacyValue: unknown;
|
|
296
|
+
/** Z-score equivalent the loader translated to (for audit). */
|
|
297
|
+
translatedTo: unknown;
|
|
298
|
+
message: string;
|
|
299
|
+
}
|
|
300
|
+
export declare const DEFAULT_SIGNAL_INGESTION_CONFIG: SignalIngestionConfig;
|
|
301
|
+
export declare class SignalIngestionConfigError extends Error {
|
|
302
|
+
readonly cause?: unknown | undefined;
|
|
303
|
+
constructor(message: string, cause?: unknown | undefined);
|
|
304
|
+
}
|
|
305
|
+
export interface LoadSignalIngestionConfigOptions {
|
|
306
|
+
/** Absolute path to the project root. Defaults to `process.cwd()`. */
|
|
307
|
+
projectRoot?: string;
|
|
308
|
+
/** Explicit path to the config file. Overrides the default location. */
|
|
309
|
+
configPath?: string;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Load and resolve the signal ingestion configuration from
|
|
313
|
+
* `.ai-sdlc/signal-ingestion.yaml`.
|
|
314
|
+
*
|
|
315
|
+
* Returns `DEFAULT_SIGNAL_INGESTION_CONFIG` when the file is absent.
|
|
316
|
+
* Throws `SignalIngestionConfigError` on parse or validation failure.
|
|
317
|
+
*/
|
|
318
|
+
export declare function loadSignalIngestionConfig(options?: LoadSignalIngestionConfigOptions): SignalIngestionConfig;
|
|
319
|
+
/**
|
|
320
|
+
* Result of `loadSignalIngestionConfigWithDeprecations()`. `config` is the
|
|
321
|
+
* fully-resolved config (with any legacy fields already translated to their
|
|
322
|
+
* z-score equivalents). `deprecations` is the list of
|
|
323
|
+
* `signal-ingestion-config-deprecated-field` Decisions the caller MUST route
|
|
324
|
+
* to the RFC-0035 Decision Catalog so the operator sees the deprecation
|
|
325
|
+
* surface and can migrate.
|
|
326
|
+
*/
|
|
327
|
+
export interface LoadSignalIngestionConfigWithDeprecationsResult {
|
|
328
|
+
config: SignalIngestionConfig;
|
|
329
|
+
deprecations: SignalIngestionConfigDeprecatedFieldDecision[];
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Load + resolve config, AND surface every deprecated-field Decision the
|
|
333
|
+
* loader detected. Wraps `loadSignalIngestionConfig()` so callers that want
|
|
334
|
+
* the deprecation audit trail can opt in without changing the existing
|
|
335
|
+
* Pure-load callers (which keep using `loadSignalIngestionConfig`).
|
|
336
|
+
*
|
|
337
|
+
* Behaviour:
|
|
338
|
+
* - When the legacy `flooding.detection.sourceBaselineDriftMultiplier` key
|
|
339
|
+
* is present in the YAML AND `LEGACY_HARD_ERROR_ENV_VAR` is unset, the
|
|
340
|
+
* loader translates it to `zScoreThreshold = legacyMultiplier × 0.6` (an
|
|
341
|
+
* empirical mapping documented in the operator runbook — a 5× multiplier
|
|
342
|
+
* over a per-source baseline corresponds approximately to a 3σ spike on
|
|
343
|
+
* most production datasets) and emits one
|
|
344
|
+
* `signal-ingestion-config-deprecated-field` Decision.
|
|
345
|
+
* - When `LEGACY_HARD_ERROR_ENV_VAR=1`, the loader throws
|
|
346
|
+
* `SignalIngestionConfigError` with a migration message.
|
|
347
|
+
* - When neither legacy key nor v0.3 z-score key is present, the loader
|
|
348
|
+
* fills in defaults silently (no deprecation noise).
|
|
349
|
+
*/
|
|
350
|
+
export declare function loadSignalIngestionConfigWithDeprecations(options?: LoadSignalIngestionConfigOptions): LoadSignalIngestionConfigWithDeprecationsResult;
|
|
351
|
+
//# sourceMappingURL=config.d.ts.map
|