tribunal-kit 9.2.6 → 9.2.7
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/.agent/ARCHITECTURE.md +2 -2
- package/.agent/history/architecture-intelligence.html +1487 -401
- package/.agent/history/architecture-model.json +9365 -5697
- package/.agent/history/architecture-verification.json +37 -9
- package/.agent/routing_index.json +2069 -3340
- package/.agent/rules/GEMINI.md +1 -1
- package/.agent/scripts/adaptive_execution.js +511 -0
- package/.agent/scripts/architecture_diff.js +303 -260
- package/.agent/scripts/architecture_extractor.js +792 -753
- package/.agent/scripts/architecture_health.js +293 -256
- package/.agent/scripts/architecture_intelligence.js +3100 -0
- package/.agent/scripts/architecture_verifier.js +303 -270
- package/.agent/scripts/architecture_visualizer.js +880 -873
- package/.agent/scripts/blast_radius_engine.js +274 -234
- package/.agent/scripts/capability_evolution.js +453 -0
- package/.agent/scripts/concept_extractor.js +240 -0
- package/.agent/scripts/consideration_engine.js +284 -0
- package/.agent/scripts/coverage_engine.js +102 -0
- package/.agent/scripts/cross_domain_engine.js +1883 -0
- package/.agent/scripts/engineering_memory.js +1313 -0
- package/.agent/scripts/integrity_manifest.js +1 -5
- package/.agent/scripts/judgment_engine.js +790 -0
- package/.agent/scripts/materiality_engine.js +251 -0
- package/.agent/scripts/outcome_engine.js +624 -0
- package/.agent/scripts/outcome_optimization_engine.js +1632 -0
- package/.agent/scripts/simulation_engine.js +1478 -0
- package/.agent/scripts/skill_intelligence.js +1371 -0
- package/.agent/scripts/validation_engine.js +236 -236
- package/.agent/scripts/verification_auditor.js +266 -0
- package/.agent/skill-intelligence/taxonomy/engineering-concepts.json +555 -0
- package/.agent/skill_topic_map.json +301 -341
- package/.agent/skills_inventory.json +4272 -6922
- package/.agent/workflows/arch.md +96 -80
- package/.agent/workflows/skill-intelligence.md +216 -0
- package/CONTRIBUTING.md +2 -2
- package/README.md +24 -24
- package/bin/adapter-install.js +1 -1
- package/package.json +8 -9
- package/plugins/core-plugin.json +1 -1
- package/plugins/gemini/extension.json +1 -1
- package/src/browser/index.js +2 -1
- package/src/browser/launcher.js +41 -1
- package/src/cli.js +3 -1
- package/src/commands/arch.js +261 -172
- package/src/commands/context.js +27 -8
- package/src/commands/learn.js +21 -6
- package/src/commands/memory.js +10 -1
- package/src/commands/native.js +12 -3
- package/src/commands/skill-intelligence.js +1165 -0
- package/src/commands/system1.js +105 -4
- package/src/context/ranker.js +337 -339
- package/src/evolution/engine.js +296 -295
- package/src/synthesis/claim_check_separator.js +294 -271
- package/src/system1/browser_intelligence.js +300 -0
- package/src/system1/constants.js +49 -0
- package/src/system1/decision_engine.js +498 -0
- package/src/system1/evidence_engine.js +602 -0
- package/src/system1/evolution_pipeline.js +581 -0
- package/src/system1/index.d.ts +114 -0
- package/src/system1/index.js +102 -0
- package/src/system1/reviewer_orchestrator.js +477 -0
- package/src/tui/banner.js +1 -1
- package/src/utils/fs.js +27 -0
|
@@ -0,0 +1,790 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* judgment_engine.js — Tribunal Kit Phase 4: Engineering Judgment Engine
|
|
5
|
+
* =====================================================================
|
|
6
|
+
* Implements evidence-driven engineering judgment, explicit uncertainty tracking,
|
|
7
|
+
* reversibility analysis, requirement conflict detection, counterfactual analysis,
|
|
8
|
+
* decision invalidation upon contradiction, and architectural anti-slop auditing.
|
|
9
|
+
*
|
|
10
|
+
* Invariants:
|
|
11
|
+
* - EXECUTION SHOULD BE ADAPTIVE, NOT PREDETERMINED.
|
|
12
|
+
* - EVIDENCE > ASSUMPTION.
|
|
13
|
+
* - HIGH-IMPACT DECISIONS REQUIRE HIGHER VERIFICATION.
|
|
14
|
+
* - A FIX IS ONLY AN IMPROVEMENT IF THE OVERALL OUTCOME IMPROVES.
|
|
15
|
+
* - TRIBUNAL MUST BE WILLING TO REJECT ITS OWN PREVIOUS DECISION WHEN EVIDENCE CONTRADICTS IT.
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
// ============================================================================
|
|
19
|
+
// 1. EVIDENCE HIERARCHY (SECTION 4)
|
|
20
|
+
// ============================================================================
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 8-tier evidence hierarchy.
|
|
24
|
+
* Runtime evidence is king; model inference is speculative until verified.
|
|
25
|
+
*/
|
|
26
|
+
const EVIDENCE_LEVELS = {
|
|
27
|
+
RUNTIME: { tier: 1, name: 'Runtime Evidence', weight: 1.0, reliable: true },
|
|
28
|
+
TESTS: { tier: 2, name: 'Automated Tests', weight: 0.9, reliable: true },
|
|
29
|
+
STATIC_ANALYSIS: { tier: 3, name: 'Static Analysis & AST', weight: 0.8, reliable: true },
|
|
30
|
+
BENCHMARKS: { tier: 4, name: 'Benchmarks & Profiling', weight: 0.75, reliable: true },
|
|
31
|
+
REPOSITORY: { tier: 5, name: 'Repository Artifacts', weight: 0.65, reliable: true },
|
|
32
|
+
CONFIGURATION: { tier: 6, name: 'Environment & Config', weight: 0.55, reliable: true },
|
|
33
|
+
DOCUMENTATION: { tier: 7, name: 'Documentation & ADRs', weight: 0.4, reliable: false },
|
|
34
|
+
MODEL_INFERENCE: { tier: 8, name: 'Model Inference (Unverified)', weight: 0.2, reliable: false },
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Classify a piece of evidence into the engineering evidence hierarchy.
|
|
39
|
+
* Distinguishes KNOWN from INFERRED from ASSUMED from CONTRADICTED.
|
|
40
|
+
*
|
|
41
|
+
* @param {Object|string} evidenceItem
|
|
42
|
+
* @returns {Object} Classified evidence
|
|
43
|
+
*/
|
|
44
|
+
function classifyEvidence(evidenceItem) {
|
|
45
|
+
if (!evidenceItem) {
|
|
46
|
+
return {
|
|
47
|
+
type: 'MODEL_INFERENCE',
|
|
48
|
+
tier: 8,
|
|
49
|
+
status: 'ASSUMED',
|
|
50
|
+
name: EVIDENCE_LEVELS.MODEL_INFERENCE.name,
|
|
51
|
+
weight: EVIDENCE_LEVELS.MODEL_INFERENCE.weight,
|
|
52
|
+
detail: 'No verifiable source provided.',
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const text =
|
|
57
|
+
typeof evidenceItem === 'string'
|
|
58
|
+
? evidenceItem
|
|
59
|
+
: evidenceItem.detail || evidenceItem.source || evidenceItem.type || '';
|
|
60
|
+
const t = text.toLowerCase();
|
|
61
|
+
|
|
62
|
+
if (/(?:runtime|execution output|trace log|live error|production log|profile log)/i.test(t)) {
|
|
63
|
+
return {
|
|
64
|
+
type: 'RUNTIME',
|
|
65
|
+
tier: 1,
|
|
66
|
+
status: 'KNOWN',
|
|
67
|
+
name: EVIDENCE_LEVELS.RUNTIME.name,
|
|
68
|
+
weight: EVIDENCE_LEVELS.RUNTIME.weight,
|
|
69
|
+
detail: text,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
if (/(?:test|spec|jest|vitest|assert|passed|failed|testsuite)/i.test(t)) {
|
|
73
|
+
return {
|
|
74
|
+
type: 'TESTS',
|
|
75
|
+
tier: 2,
|
|
76
|
+
status: 'KNOWN',
|
|
77
|
+
name: EVIDENCE_LEVELS.TESTS.name,
|
|
78
|
+
weight: EVIDENCE_LEVELS.TESTS.weight,
|
|
79
|
+
detail: text,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
if (/(?:\bast\b|eslint|tsc|typecheck|syntax tree|static check|linter)/i.test(t)) {
|
|
83
|
+
return {
|
|
84
|
+
type: 'STATIC_ANALYSIS',
|
|
85
|
+
tier: 3,
|
|
86
|
+
status: 'KNOWN',
|
|
87
|
+
name: EVIDENCE_LEVELS.STATIC_ANALYSIS.name,
|
|
88
|
+
weight: EVIDENCE_LEVELS.STATIC_ANALYSIS.weight,
|
|
89
|
+
detail: text,
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
if (/(?:benchmark|latency measurement|throughput|p99|flamegraph|profil)/i.test(t)) {
|
|
93
|
+
return {
|
|
94
|
+
type: 'BENCHMARKS',
|
|
95
|
+
tier: 4,
|
|
96
|
+
status: 'KNOWN',
|
|
97
|
+
name: EVIDENCE_LEVELS.BENCHMARKS.name,
|
|
98
|
+
weight: EVIDENCE_LEVELS.BENCHMARKS.weight,
|
|
99
|
+
detail: text,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
if (/(?:package\.json|schema\.prisma|cargo\.toml|dockerfile|git commit|repo file)/i.test(t)) {
|
|
103
|
+
return {
|
|
104
|
+
type: 'REPOSITORY',
|
|
105
|
+
tier: 5,
|
|
106
|
+
status: 'KNOWN',
|
|
107
|
+
name: EVIDENCE_LEVELS.REPOSITORY.name,
|
|
108
|
+
weight: EVIDENCE_LEVELS.REPOSITORY.weight,
|
|
109
|
+
detail: text,
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
if (/(?:env|process\.env|k8s config|helm|nginx\.conf|yaml config)/i.test(t)) {
|
|
113
|
+
return {
|
|
114
|
+
type: 'CONFIGURATION',
|
|
115
|
+
tier: 6,
|
|
116
|
+
status: 'KNOWN',
|
|
117
|
+
name: EVIDENCE_LEVELS.CONFIGURATION.name,
|
|
118
|
+
weight: EVIDENCE_LEVELS.CONFIGURATION.weight,
|
|
119
|
+
detail: text,
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
if (/(?:readme|adr|comment|docstring|confluence|wiki)/i.test(t)) {
|
|
123
|
+
return {
|
|
124
|
+
type: 'DOCUMENTATION',
|
|
125
|
+
tier: 7,
|
|
126
|
+
status: 'INFERRED',
|
|
127
|
+
name: EVIDENCE_LEVELS.DOCUMENTATION.name,
|
|
128
|
+
weight: EVIDENCE_LEVELS.DOCUMENTATION.weight,
|
|
129
|
+
detail: text,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
return {
|
|
134
|
+
type: 'MODEL_INFERENCE',
|
|
135
|
+
tier: 8,
|
|
136
|
+
status: 'ASSUMED',
|
|
137
|
+
name: EVIDENCE_LEVELS.MODEL_INFERENCE.name,
|
|
138
|
+
weight: EVIDENCE_LEVELS.MODEL_INFERENCE.weight,
|
|
139
|
+
detail: text,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// ============================================================================
|
|
144
|
+
// 2. UNCERTAINTY MODEL (SECTION 3 & 10)
|
|
145
|
+
// ============================================================================
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Creates an uncertainty tracking record.
|
|
149
|
+
* Prevents assumptions from silently becoming facts.
|
|
150
|
+
*
|
|
151
|
+
* @param {string} claim
|
|
152
|
+
* @param {Object} [options]
|
|
153
|
+
* @returns {Object} Uncertainty record
|
|
154
|
+
*/
|
|
155
|
+
function createUncertaintyRecord(claim, options = {}) {
|
|
156
|
+
const evidenceList = (options.evidence || []).map(classifyEvidence);
|
|
157
|
+
const highestEvidence =
|
|
158
|
+
evidenceList.length > 0
|
|
159
|
+
? evidenceList.reduce((prev, curr) => (curr.tier < prev.tier ? curr : prev), evidenceList[0])
|
|
160
|
+
: null;
|
|
161
|
+
|
|
162
|
+
let status = options.status || 'unknown';
|
|
163
|
+
if (!options.status) {
|
|
164
|
+
if (evidenceList.length === 0) {
|
|
165
|
+
status = 'unknown';
|
|
166
|
+
} else if (evidenceList.some(e => e.status === 'CONTRADICTED')) {
|
|
167
|
+
status = 'contradicted';
|
|
168
|
+
} else if (highestEvidence && highestEvidence.tier <= 4) {
|
|
169
|
+
status = 'verified';
|
|
170
|
+
} else if (highestEvidence && highestEvidence.tier <= 7) {
|
|
171
|
+
status = 'inferred';
|
|
172
|
+
} else {
|
|
173
|
+
status = 'assumed';
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const confidence =
|
|
178
|
+
options.confidence ||
|
|
179
|
+
(status === 'verified' ? 'HIGH' : status === 'inferred' ? 'MEDIUM' : 'LOW');
|
|
180
|
+
|
|
181
|
+
return {
|
|
182
|
+
claim,
|
|
183
|
+
status, // 'verified' | 'assumed' | 'inferred' | 'unknown' | 'contradicted'
|
|
184
|
+
confidence, // 'HIGH' | 'MEDIUM' | 'LOW'
|
|
185
|
+
evidence: evidenceList,
|
|
186
|
+
highest_evidence_tier: highestEvidence ? highestEvidence.tier : 8,
|
|
187
|
+
impact_if_wrong:
|
|
188
|
+
options.impact_if_wrong || 'Moderate operational, performance, or correctness divergence.',
|
|
189
|
+
next_action:
|
|
190
|
+
options.next_action ||
|
|
191
|
+
(status === 'verified'
|
|
192
|
+
? 'Proceed with verified claim.'
|
|
193
|
+
: `Execute verification to corroborate claim '${claim}'.`),
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Calculates Expected Information Value for an investigation (Section 10).
|
|
199
|
+
* Expected Reduction in Uncertainty / Investigation Cost.
|
|
200
|
+
*
|
|
201
|
+
* @param {Object} uncertaintyRecord
|
|
202
|
+
* @param {number} investigationCostSec (or relative cost index 1-10)
|
|
203
|
+
* @returns {Object} Evaluation with recommendation
|
|
204
|
+
*/
|
|
205
|
+
function calculateInformationValue(uncertaintyRecord, investigationCostSec = 5) {
|
|
206
|
+
const impactWeights = {
|
|
207
|
+
CRITICAL: 1.0,
|
|
208
|
+
HIGH: 0.8,
|
|
209
|
+
MEDIUM: 0.5,
|
|
210
|
+
LOW: 0.2,
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
const impactKey = (uncertaintyRecord.impact_level || 'MEDIUM').toUpperCase();
|
|
214
|
+
const impactWeight = impactWeights[impactKey] || 0.5;
|
|
215
|
+
|
|
216
|
+
const uncertaintyFactor =
|
|
217
|
+
uncertaintyRecord.status === 'verified'
|
|
218
|
+
? 0.05
|
|
219
|
+
: uncertaintyRecord.status === 'unknown'
|
|
220
|
+
? 1.0
|
|
221
|
+
: uncertaintyRecord.status === 'contradicted'
|
|
222
|
+
? 1.0
|
|
223
|
+
: 0.6;
|
|
224
|
+
|
|
225
|
+
const rawValue = (impactWeight * uncertaintyFactor * 100) / Math.max(1, investigationCostSec);
|
|
226
|
+
const normalizedScore = Number(rawValue.toFixed(2));
|
|
227
|
+
|
|
228
|
+
const shouldInvestigate = normalizedScore >= 5.0 && uncertaintyRecord.status !== 'verified';
|
|
229
|
+
|
|
230
|
+
return {
|
|
231
|
+
claim: uncertaintyRecord.claim,
|
|
232
|
+
expected_information_value: normalizedScore,
|
|
233
|
+
investigation_cost: investigationCostSec,
|
|
234
|
+
should_investigate: shouldInvestigate,
|
|
235
|
+
rationale: shouldInvestigate
|
|
236
|
+
? `High information payoff (${normalizedScore}): Investigating reduces high-impact uncertainty before irreversible work.`
|
|
237
|
+
: `Low information payoff (${normalizedScore}): Cost outweighs expected reduction in uncertainty; proceed with bounded defaults.`,
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// ============================================================================
|
|
242
|
+
// 3. REVERSIBILITY ANALYSIS (SECTION 6)
|
|
243
|
+
// ============================================================================
|
|
244
|
+
|
|
245
|
+
const REVERSIBILITY_LEVELS = {
|
|
246
|
+
REVERSIBLE: {
|
|
247
|
+
tier: 1,
|
|
248
|
+
name: 'REVERSIBLE',
|
|
249
|
+
description:
|
|
250
|
+
'Can be rolled back trivially with git checkout or simple code reversion (e.g. CSS, formatting, comments).',
|
|
251
|
+
},
|
|
252
|
+
PARTIALLY_REVERSIBLE: {
|
|
253
|
+
tier: 2,
|
|
254
|
+
name: 'PARTIALLY_REVERSIBLE',
|
|
255
|
+
description:
|
|
256
|
+
'Requires minor migration rollback or cache clearing (e.g. additive schema column, internal caching layer).',
|
|
257
|
+
},
|
|
258
|
+
HARD_TO_REVERSE: {
|
|
259
|
+
tier: 3,
|
|
260
|
+
name: 'HARD_TO_REVERSE',
|
|
261
|
+
description:
|
|
262
|
+
'Modifies public API contracts, shared library signatures, or alters complex database tables.',
|
|
263
|
+
},
|
|
264
|
+
IRREVERSIBLE: {
|
|
265
|
+
tier: 4,
|
|
266
|
+
name: 'IRREVERSIBLE',
|
|
267
|
+
description:
|
|
268
|
+
'Destructive database operations (DROP TABLE, DELETE records), production secret rotation, or distributed data loss.',
|
|
269
|
+
},
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Classifies the reversibility of an architectural or code decision.
|
|
274
|
+
*
|
|
275
|
+
* @param {string} decisionDescription
|
|
276
|
+
* @param {Object} [context]
|
|
277
|
+
* @returns {Object} Reversibility report
|
|
278
|
+
*/
|
|
279
|
+
function classifyReversibility(decisionDescription, context = {}) {
|
|
280
|
+
const text = (decisionDescription || '').toLowerCase();
|
|
281
|
+
|
|
282
|
+
if (/(?:delete|drop table|truncate|destroy|purge|wipe|remove customer|permanent)/i.test(text)) {
|
|
283
|
+
return {
|
|
284
|
+
classification: REVERSIBILITY_LEVELS.IRREVERSIBLE.name,
|
|
285
|
+
tier: 4,
|
|
286
|
+
is_irreversible: true,
|
|
287
|
+
requires_pre_verification: true,
|
|
288
|
+
warning:
|
|
289
|
+
'DESTRUCTIVE / IRREVERSIBLE OPERATION: Requires backup verification, dry-run simulation, and explicit confirmation.',
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
if (
|
|
293
|
+
/(?:public api|breaking change|contract change|v1 to v2|rename column|alter type|migration)/i.test(
|
|
294
|
+
text,
|
|
295
|
+
)
|
|
296
|
+
) {
|
|
297
|
+
return {
|
|
298
|
+
classification: REVERSIBILITY_LEVELS.HARD_TO_REVERSE.name,
|
|
299
|
+
tier: 3,
|
|
300
|
+
is_irreversible: false,
|
|
301
|
+
requires_pre_verification: true,
|
|
302
|
+
warning:
|
|
303
|
+
'HARD TO REVERSE: Affects external consumers or persistent schema; requires backward-compatibility gating.',
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
if (/(?:cache|redis|new table|add column|internal function|queue)/i.test(text)) {
|
|
307
|
+
return {
|
|
308
|
+
classification: REVERSIBILITY_LEVELS.PARTIALLY_REVERSIBLE.name,
|
|
309
|
+
tier: 2,
|
|
310
|
+
is_irreversible: false,
|
|
311
|
+
requires_pre_verification: false,
|
|
312
|
+
warning:
|
|
313
|
+
'PARTIALLY REVERSIBLE: Additive change; rollbacks require teardown or data invalidation.',
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
return {
|
|
318
|
+
classification: REVERSIBILITY_LEVELS.REVERSIBLE.name,
|
|
319
|
+
tier: 1,
|
|
320
|
+
is_irreversible: false,
|
|
321
|
+
requires_pre_verification: false,
|
|
322
|
+
warning: 'REVERSIBLE: Code or style change; easily reverted via standard VCS.',
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// ============================================================================
|
|
327
|
+
// 4. DECISION RECORDING & REVISION (SECTION 5 & 19)
|
|
328
|
+
// ============================================================================
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* Creates an Architectural Decision Record (ADR-style) for an engineering decision.
|
|
332
|
+
*
|
|
333
|
+
* @param {Object} decisionSpec
|
|
334
|
+
* @returns {Object} Structured decision record
|
|
335
|
+
*/
|
|
336
|
+
function recordDecision(decisionSpec) {
|
|
337
|
+
const reversibility = classifyReversibility(decisionSpec.decision, decisionSpec.context);
|
|
338
|
+
|
|
339
|
+
return {
|
|
340
|
+
id: `ADR-${Date.now().toString(36).toUpperCase()}`,
|
|
341
|
+
decision: decisionSpec.decision,
|
|
342
|
+
context: decisionSpec.context || 'Standard engineering task execution.',
|
|
343
|
+
alternatives: decisionSpec.alternatives || [],
|
|
344
|
+
selected_approach: decisionSpec.selected_approach || decisionSpec.decision,
|
|
345
|
+
evidence: (decisionSpec.evidence || []).map(classifyEvidence),
|
|
346
|
+
tradeoffs: decisionSpec.tradeoffs || [],
|
|
347
|
+
rejected_options: decisionSpec.rejected_options || [],
|
|
348
|
+
confidence: decisionSpec.confidence || 'HIGH',
|
|
349
|
+
reversibility: reversibility.classification,
|
|
350
|
+
is_irreversible: reversibility.is_irreversible,
|
|
351
|
+
verification_plan:
|
|
352
|
+
decisionSpec.verification_plan ||
|
|
353
|
+
'Automated integration test verifying invariant properties.',
|
|
354
|
+
status: 'ACTIVE',
|
|
355
|
+
invalidation_reason: null,
|
|
356
|
+
};
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* Invalidates a previous decision when new contradictory evidence emerges (Section 19).
|
|
361
|
+
* Tribunal must not defend prior architecture simply because it was already chosen.
|
|
362
|
+
*
|
|
363
|
+
* @param {Object} decisionRecord
|
|
364
|
+
* @param {Object|string} contradictoryEvidence
|
|
365
|
+
* @param {string} reason
|
|
366
|
+
* @returns {Object} Updated decision record
|
|
367
|
+
*/
|
|
368
|
+
function invalidateDecision(decisionRecord, contradictoryEvidence, reason) {
|
|
369
|
+
const evidence = classifyEvidence(contradictoryEvidence);
|
|
370
|
+
|
|
371
|
+
return {
|
|
372
|
+
...decisionRecord,
|
|
373
|
+
status: 'INVALIDATED',
|
|
374
|
+
invalidation_reason: reason,
|
|
375
|
+
contradictory_evidence: evidence,
|
|
376
|
+
invalidation_timestamp: new Date().toISOString(),
|
|
377
|
+
next_action: `REPLAN: Previous decision '${decisionRecord.decision}' invalidated due to: ${reason}`,
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
// ============================================================================
|
|
382
|
+
// 5. REQUIREMENT CONFLICT DETECTION (SECTION 12)
|
|
383
|
+
// ============================================================================
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Detects conflicts among competing requirements (e.g. Latency vs Consistency vs Cost).
|
|
387
|
+
* Tribunal surfaces conflicts explicitly rather than silently choosing a compromise.
|
|
388
|
+
*
|
|
389
|
+
* @param {Array<string>|string} requirements
|
|
390
|
+
* @returns {Array<Object>} Identified conflicts
|
|
391
|
+
*/
|
|
392
|
+
function detectRequirementConflicts(requirements) {
|
|
393
|
+
const text = (
|
|
394
|
+
Array.isArray(requirements) ? requirements.join(' ') : String(requirements)
|
|
395
|
+
).toLowerCase();
|
|
396
|
+
const conflicts = [];
|
|
397
|
+
|
|
398
|
+
// Conflict 1: Low Latency vs Strong Cross-Region Consistency
|
|
399
|
+
const hasLowLatency = /(?:< ?50ms|< ?100ms|sub-second|real-time|ultra low latency)/i.test(text);
|
|
400
|
+
const hasGlobalCrossRegion =
|
|
401
|
+
/(?:multi-region|cross-region|global|active-active|geo-distributed)/i.test(text);
|
|
402
|
+
const hasStrongConsistency =
|
|
403
|
+
/(?:strong\s+(?:[a-z-]+\s+)?consistency|serializable|acid across regions|two-phase commit|2pc)/i.test(
|
|
404
|
+
text,
|
|
405
|
+
);
|
|
406
|
+
|
|
407
|
+
if (hasLowLatency && hasGlobalCrossRegion && hasStrongConsistency) {
|
|
408
|
+
conflicts.push({
|
|
409
|
+
conflict: 'Latency vs. Cross-Region Strong Consistency (CAP / PACELC Bound)',
|
|
410
|
+
dimensions: ['Latency', 'Consistency', 'Availability'],
|
|
411
|
+
explanation:
|
|
412
|
+
'Speed of light and network round-trips make cross-region synchronous coordination (>150ms RTT) mathematically incompatible with sub-50ms latency.',
|
|
413
|
+
action_required:
|
|
414
|
+
'User must decide: Prioritize sub-50ms local reads with eventual consistency, OR enforce global serializable consistency at the expense of higher latency.',
|
|
415
|
+
});
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
// Conflict 2: High Performance / Low Latency vs Zero Infrastructure Cost
|
|
419
|
+
const hasLowCost =
|
|
420
|
+
/(?:(?:low|zero|minimal)\s+(?:[a-z-]+\s+)?cost|no infrastructure|cheap|free tier)/i.test(text);
|
|
421
|
+
if (hasLowLatency && hasGlobalCrossRegion && hasLowCost) {
|
|
422
|
+
conflicts.push({
|
|
423
|
+
conflict: 'Global Low-Latency Infrastructure vs. Low-Cost Constraint',
|
|
424
|
+
dimensions: ['Performance', 'Cost', 'Infrastructure'],
|
|
425
|
+
explanation:
|
|
426
|
+
'Active-active multi-region edge deployment with automated DNS failover incurs significant minimum infrastructure and egress commitments.',
|
|
427
|
+
action_required:
|
|
428
|
+
'User must reconcile: Accept multi-region deployment costs OR deploy to a single primary region with CDN caching.',
|
|
429
|
+
});
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
// Conflict 3: Maximum Security / Sandboxing vs Maximum Execution Convenience
|
|
433
|
+
const hasArbitraryExecution =
|
|
434
|
+
/(?:arbitrary shell|unrestricted tool|execute any command|unfiltered script)/i.test(text);
|
|
435
|
+
const hasHighSecurity = /(?:maximum security|zero trust|no data leak|isolated|untrusted)/i.test(
|
|
436
|
+
text,
|
|
437
|
+
);
|
|
438
|
+
if (hasArbitraryExecution && hasHighSecurity) {
|
|
439
|
+
conflicts.push({
|
|
440
|
+
conflict: 'Unrestricted Shell Tool Execution vs. Zero-Trust Security Sandbox',
|
|
441
|
+
dimensions: ['Security', 'Flexibility'],
|
|
442
|
+
explanation:
|
|
443
|
+
'Allowing agents unrestricted command-line access violates zero-trust isolation and introduces severe remote code execution risks.',
|
|
444
|
+
action_required:
|
|
445
|
+
'User must approve a strict command whitelist, dedicated containerized sandbox, or require human-in-the-loop gate before execution.',
|
|
446
|
+
});
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
// Conflict 4: In-Memory / Distributed Caching vs Absolute Real-Time Data Freshness
|
|
450
|
+
const hasCaching = /(?:cache|redis|caching)/i.test(text);
|
|
451
|
+
const hasStrictFreshness =
|
|
452
|
+
/(?:zero stale data|instant updates|no caching lag|strict freshness)/i.test(text);
|
|
453
|
+
if (hasCaching && hasStrictFreshness) {
|
|
454
|
+
conflicts.push({
|
|
455
|
+
conflict: 'Caching Strategy vs. Absolute Data Freshness',
|
|
456
|
+
dimensions: ['Performance', 'Data Freshness'],
|
|
457
|
+
explanation:
|
|
458
|
+
'Caching introduces cache invalidation lag and race conditions where clients may read stale data before invalidation events propagate.',
|
|
459
|
+
action_required:
|
|
460
|
+
'Determine acceptable stale-while-revalidate TTL or bypass cache on critical mutating queries.',
|
|
461
|
+
});
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
return conflicts;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
// ============================================================================
|
|
468
|
+
// 6. COUNTERFACTUAL & FAILURE-FIRST ANALYSIS (SECTION 16 & 17)
|
|
469
|
+
// ============================================================================
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Runs counterfactual analysis for high-materiality decisions.
|
|
473
|
+
* "What happens if this assumption is wrong? What happens under 10x traffic or network partition?"
|
|
474
|
+
*
|
|
475
|
+
* @param {string} task
|
|
476
|
+
* @param {Object} [context]
|
|
477
|
+
* @returns {Array<Object>} Counterfactual stress findings
|
|
478
|
+
*/
|
|
479
|
+
function runCounterfactualAnalysis(task, context = {}) {
|
|
480
|
+
const t = (task || '').toLowerCase();
|
|
481
|
+
const counterfactuals = [];
|
|
482
|
+
|
|
483
|
+
if (/(?:payment|checkout|charge|order|mutation|transfer)/i.test(t)) {
|
|
484
|
+
counterfactuals.push({
|
|
485
|
+
scenario: 'Concurrent Duplicate Requests',
|
|
486
|
+
question:
|
|
487
|
+
'What happens if the client or network drops and retries two identical payments simultaneously?',
|
|
488
|
+
mitigation_required:
|
|
489
|
+
'Database-level unique constraint or distributed lock on idempotency key.',
|
|
490
|
+
});
|
|
491
|
+
counterfactuals.push({
|
|
492
|
+
scenario: 'Downstream Payment Provider Timeout',
|
|
493
|
+
question:
|
|
494
|
+
'What happens if the provider charges the card but network drops before sending the response back?',
|
|
495
|
+
mitigation_required:
|
|
496
|
+
'Explicit reconciliation worker or status enquiry query before blind retrying.',
|
|
497
|
+
});
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
if (/(?:upload|file|media|asset)/i.test(t)) {
|
|
501
|
+
counterfactuals.push({
|
|
502
|
+
scenario: 'Exhaustion Attack via Oversized or Infinite Streams',
|
|
503
|
+
question: 'What happens if an attacker uploads a multi-gigabyte payload or zip bomb?',
|
|
504
|
+
mitigation_required:
|
|
505
|
+
'Hard Content-Length validation, streaming byte counters, and magic-number MIME checks.',
|
|
506
|
+
});
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
if (/(?:database|query|postgres|sql)/i.test(t)) {
|
|
510
|
+
counterfactuals.push({
|
|
511
|
+
scenario: '10x Traffic Spike / Table Growth',
|
|
512
|
+
question: 'What happens when table rows grow from 10k to 10M?',
|
|
513
|
+
mitigation_required: 'Verify index usage via EXPLAIN ANALYZE; avoid full table scans.',
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
if (/(?:agent|tool|shell|execution)/i.test(t)) {
|
|
518
|
+
counterfactuals.push({
|
|
519
|
+
scenario: 'Malicious Prompt Injection into Tool Arguments',
|
|
520
|
+
question: 'What happens if user-supplied content includes shell operators (; rm -rf /)?',
|
|
521
|
+
mitigation_required:
|
|
522
|
+
'Disallow raw shell spawning; use execFile with immutable array arguments.',
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
return counterfactuals;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
// ============================================================================
|
|
530
|
+
// 7. ARCHITECTURAL ANTI-SLOP ENGINE (SECTION 23)
|
|
531
|
+
// ============================================================================
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* Detects both overengineering (premature complexity) and underengineering (missing essentials).
|
|
535
|
+
*
|
|
536
|
+
* @param {string} taskQuery
|
|
537
|
+
* @param {Array<string>|string} proposedStackOrDiff
|
|
538
|
+
* @returns {Object} Anti-slop assessment
|
|
539
|
+
*/
|
|
540
|
+
function detectEngineeringSmells(taskQuery, proposedStackOrDiff) {
|
|
541
|
+
const task = (taskQuery || '').toLowerCase();
|
|
542
|
+
const stack = (
|
|
543
|
+
Array.isArray(proposedStackOrDiff) ? proposedStackOrDiff.join(' ') : String(proposedStackOrDiff)
|
|
544
|
+
).toLowerCase();
|
|
545
|
+
|
|
546
|
+
const overengineeringSmells = [];
|
|
547
|
+
const underengineeringSmells = [];
|
|
548
|
+
|
|
549
|
+
const isSimpleTask =
|
|
550
|
+
/(?:simple|static|readme|cli script|prototype|internal tool|single page|toy|basic)/i.test(task);
|
|
551
|
+
const isFinancialOrCritical =
|
|
552
|
+
/(?:payment|checkout|billing|transaction|auth|banking|medical|critical)/i.test(task);
|
|
553
|
+
|
|
554
|
+
const combined = stack + ' ' + task;
|
|
555
|
+
|
|
556
|
+
// Check Overengineering
|
|
557
|
+
if (isSimpleTask) {
|
|
558
|
+
if (/(?:kafka|event sourcing|cqrs|eventstore)/i.test(combined)) {
|
|
559
|
+
overengineeringSmells.push({
|
|
560
|
+
smell: 'Premature Event Streaming / CQRS',
|
|
561
|
+
reason: 'Event streaming is vastly disproportionate for simple/static tasks.',
|
|
562
|
+
});
|
|
563
|
+
}
|
|
564
|
+
if (/(?:kubernetes|k8s|service mesh|istio)/i.test(combined)) {
|
|
565
|
+
overengineeringSmells.push({
|
|
566
|
+
smell: 'Premature Kubernetes / Service Mesh',
|
|
567
|
+
reason: 'Container orchestration adds excessive operational burden to a simple task.',
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
if (/(?:redis|memcached|distributed cache)/i.test(combined)) {
|
|
571
|
+
overengineeringSmells.push({
|
|
572
|
+
smell: 'Unnecessary Distributed Caching',
|
|
573
|
+
reason: 'Process-local or static serving eliminates need for external cache servers.',
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
if (/(?:microservices|multi-service|grpc federation)/i.test(combined)) {
|
|
577
|
+
overengineeringSmells.push({
|
|
578
|
+
smell: 'Premature Microservices Federation',
|
|
579
|
+
reason: 'Single modular monolith or CLI binary avoids distributed failure modes.',
|
|
580
|
+
});
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
// Check Underengineering
|
|
585
|
+
if (isFinancialOrCritical) {
|
|
586
|
+
if (!/(?:idempotency|idempotent|lock|mutex|unique constraint)/i.test(stack)) {
|
|
587
|
+
underengineeringSmells.push({
|
|
588
|
+
smell: 'Missing Idempotency & Duplicate Execution Defense',
|
|
589
|
+
severity: 'CRITICAL',
|
|
590
|
+
reason: 'Financial and mutating workflows must protect against duplicate client retries.',
|
|
591
|
+
});
|
|
592
|
+
}
|
|
593
|
+
if (!/(?:transaction|begin|commit|rollback|atomic)/i.test(stack)) {
|
|
594
|
+
underengineeringSmells.push({
|
|
595
|
+
smell: 'Missing Atomic Transaction Boundaries',
|
|
596
|
+
severity: 'CRITICAL',
|
|
597
|
+
reason: 'Multi-step financial state mutations risk orphaned records upon partial failure.',
|
|
598
|
+
});
|
|
599
|
+
}
|
|
600
|
+
if (!/(?:error handling|catch|try|failure recovery)/i.test(stack)) {
|
|
601
|
+
underengineeringSmells.push({
|
|
602
|
+
smell: 'Inadequate Error Handling & Resilience',
|
|
603
|
+
severity: 'HIGH',
|
|
604
|
+
reason: 'Critical workflows require deterministic error handling and cleanup.',
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
return {
|
|
610
|
+
is_clean: overengineeringSmells.length === 0 && underengineeringSmells.length === 0,
|
|
611
|
+
has_overengineering: overengineeringSmells.length > 0,
|
|
612
|
+
has_underengineering: underengineeringSmells.length > 0,
|
|
613
|
+
overengineering: overengineeringSmells,
|
|
614
|
+
underengineering: underengineeringSmells,
|
|
615
|
+
recommendation:
|
|
616
|
+
overengineeringSmells.length > 0
|
|
617
|
+
? 'STRIP_COMPLEXITY: Remove speculative distributed infrastructure.'
|
|
618
|
+
: underengineeringSmells.length > 0
|
|
619
|
+
? 'HARDEN_FOUNDATION: Add mandatory transaction boundaries and duplicate protection.'
|
|
620
|
+
: 'APPROVED: Proportional engineering depth.',
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
// ============================================================================
|
|
625
|
+
// 8. ESCALATION ENGINE (SECTION 11)
|
|
626
|
+
// ============================================================================
|
|
627
|
+
|
|
628
|
+
/**
|
|
629
|
+
* Evaluates whether an execution must be ESCALATED / BLOCKED.
|
|
630
|
+
*
|
|
631
|
+
* @param {string} task
|
|
632
|
+
* @param {Object} context
|
|
633
|
+
* @returns {Object} Escalation assessment
|
|
634
|
+
*/
|
|
635
|
+
function evaluateEscalation(task, context = {}) {
|
|
636
|
+
const reversibility = classifyReversibility(task, context);
|
|
637
|
+
const conflicts = detectRequirementConflicts(task);
|
|
638
|
+
const uncertainty = context.uncertainty || [];
|
|
639
|
+
|
|
640
|
+
const highImpactUnresolved = uncertainty.filter(
|
|
641
|
+
u =>
|
|
642
|
+
(u.confidence === 'LOW' || u.status === 'unknown' || u.status === 'contradicted') &&
|
|
643
|
+
/(?:critical|high|data loss|security)/i.test(u.impact_if_wrong || ''),
|
|
644
|
+
);
|
|
645
|
+
|
|
646
|
+
if (reversibility.is_irreversible) {
|
|
647
|
+
return {
|
|
648
|
+
tier: 'CRITICAL',
|
|
649
|
+
is_blocked: true,
|
|
650
|
+
reason: 'ACTION BLOCKED: Irreversible data mutation or deletion operation detected.',
|
|
651
|
+
required_action:
|
|
652
|
+
'Perform full database snapshot verification and require explicit human authorization.',
|
|
653
|
+
};
|
|
654
|
+
}
|
|
655
|
+
|
|
656
|
+
if (conflicts.length > 0) {
|
|
657
|
+
return {
|
|
658
|
+
tier: 'HIGH',
|
|
659
|
+
is_blocked: true,
|
|
660
|
+
reason: `ACTION BLOCKED: Mutually conflicting engineering constraints detected (${conflicts[0].conflict}).`,
|
|
661
|
+
required_action: conflicts[0].action_required,
|
|
662
|
+
};
|
|
663
|
+
}
|
|
664
|
+
|
|
665
|
+
if (highImpactUnresolved.length > 0) {
|
|
666
|
+
return {
|
|
667
|
+
tier: 'HIGH',
|
|
668
|
+
is_blocked: true,
|
|
669
|
+
reason: `ACTION BLOCKED: Evidence insufficient for high-impact assumption '${highImpactUnresolved[0].claim}'.`,
|
|
670
|
+
required_action: highImpactUnresolved[0].next_action,
|
|
671
|
+
};
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
return {
|
|
675
|
+
tier: 'LOW',
|
|
676
|
+
is_blocked: false,
|
|
677
|
+
reason: 'Operational risk within autonomous parameters.',
|
|
678
|
+
required_action: 'Proceed with standard verification.',
|
|
679
|
+
};
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
// ============================================================================
|
|
683
|
+
// 9. ENGINEERING JUDGMENT STATE MACHINE (SECTION 2 & 9)
|
|
684
|
+
// ============================================================================
|
|
685
|
+
|
|
686
|
+
/**
|
|
687
|
+
* Evaluates the current state of execution and determines the next engineering judgment state:
|
|
688
|
+
* PROCEED | INVESTIGATE | REPLAN | CORRECT | ESCALATE | DEFER | STOP | COMPLETE
|
|
689
|
+
*
|
|
690
|
+
* @param {Object} input
|
|
691
|
+
* @returns {Object} Judgment verdict
|
|
692
|
+
*/
|
|
693
|
+
function evaluateJudgmentState(input = {}) {
|
|
694
|
+
const {
|
|
695
|
+
task,
|
|
696
|
+
evidence = [],
|
|
697
|
+
uncertainties = [],
|
|
698
|
+
outcomeContract,
|
|
699
|
+
auditReport,
|
|
700
|
+
tradeoffs = [],
|
|
701
|
+
contradictions = [],
|
|
702
|
+
} = input;
|
|
703
|
+
|
|
704
|
+
// 1. Check for Contradictions -> REPLAN
|
|
705
|
+
if (contradictions.length > 0) {
|
|
706
|
+
return {
|
|
707
|
+
state: 'REPLAN',
|
|
708
|
+
reason: `Contradictory evidence detected: ${contradictions[0].reason || 'Prior assumption was refuted.'}`,
|
|
709
|
+
action:
|
|
710
|
+
'Abandon refuted approach, discard invalid decisions, and formulate alternative plan.',
|
|
711
|
+
details: contradictions,
|
|
712
|
+
};
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
// 2. Check Escalations -> ESCALATE
|
|
716
|
+
const escalation = evaluateEscalation(task || '', { uncertainty: uncertainties });
|
|
717
|
+
if (escalation.is_blocked) {
|
|
718
|
+
return {
|
|
719
|
+
state: 'ESCALATE',
|
|
720
|
+
reason: escalation.reason,
|
|
721
|
+
action: escalation.required_action,
|
|
722
|
+
details: escalation,
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
|
|
726
|
+
// 3. Check High-Value Uncertainties -> INVESTIGATE
|
|
727
|
+
const highValueInvestigate = uncertainties
|
|
728
|
+
.map(u => calculateInformationValue(u))
|
|
729
|
+
.find(v => v.should_investigate);
|
|
730
|
+
|
|
731
|
+
if (highValueInvestigate) {
|
|
732
|
+
return {
|
|
733
|
+
state: 'INVESTIGATE',
|
|
734
|
+
reason: `High information payoff: Investigating '${highValueInvestigate.claim}' prevents costly architectural mistakes.`,
|
|
735
|
+
action: highValueInvestigate.rationale,
|
|
736
|
+
details: highValueInvestigate,
|
|
737
|
+
};
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
// 4. Check Post-Implementation Gaps -> CORRECT
|
|
741
|
+
if (auditReport && !auditReport.is_outcome_complete) {
|
|
742
|
+
if (
|
|
743
|
+
auditReport.unsatisfied.length > 0 ||
|
|
744
|
+
auditReport.partially_satisfied.length > 0 ||
|
|
745
|
+
auditReport.new_risks.length > 0
|
|
746
|
+
) {
|
|
747
|
+
return {
|
|
748
|
+
state: 'CORRECT',
|
|
749
|
+
reason:
|
|
750
|
+
'Post-implementation outcome audit discovered gaps or unverified material considerations.',
|
|
751
|
+
action: (auditReport.corrective_actions || [])[0] || 'Execute corrective cycle.',
|
|
752
|
+
details: auditReport,
|
|
753
|
+
};
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
// 5. Check Completion Criteria -> COMPLETE (or STOP)
|
|
758
|
+
if (auditReport && auditReport.is_outcome_complete) {
|
|
759
|
+
return {
|
|
760
|
+
state: 'COMPLETE',
|
|
761
|
+
reason:
|
|
762
|
+
'All material considerations verified with zero regressions and zero unnecessary complexity.',
|
|
763
|
+
action: 'Declare engineering outcome complete with evidence.',
|
|
764
|
+
details: auditReport,
|
|
765
|
+
};
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
// 6. Default to PROCEED with bounded verification
|
|
769
|
+
return {
|
|
770
|
+
state: 'PROCEED',
|
|
771
|
+
reason: 'Requirements, evidence, and materiality align. Ready for execution.',
|
|
772
|
+
action: 'Execute planned capability pipeline under active verification monitoring.',
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
module.exports = {
|
|
777
|
+
EVIDENCE_LEVELS,
|
|
778
|
+
REVERSIBILITY_LEVELS,
|
|
779
|
+
classifyEvidence,
|
|
780
|
+
createUncertaintyRecord,
|
|
781
|
+
calculateInformationValue,
|
|
782
|
+
classifyReversibility,
|
|
783
|
+
recordDecision,
|
|
784
|
+
invalidateDecision,
|
|
785
|
+
detectRequirementConflicts,
|
|
786
|
+
runCounterfactualAnalysis,
|
|
787
|
+
detectEngineeringSmells,
|
|
788
|
+
evaluateEscalation,
|
|
789
|
+
evaluateJudgmentState,
|
|
790
|
+
};
|