Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 30 additions & 4 deletions packages/quantum-ethics/src/vortex-wavespec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,27 @@ function normalizeCoherenceScore(rawScore: number): number {
return Math.max(0, Math.min(1, rawScore / 100));
}

/**
* Vortex criticality levels determine coherence boost based on system importance.
* Higher criticality = greater coherence boost to ensure stability of critical subsystems.
*/
enum VortexCriticality {
MONITORING = 0, // Baseline - observational role, no boost needed
PLANNING = 3, // Infrastructure planning requires moderate stability
TESTING = 5, // Testing/compliance needs high reliability for audit integrity
CORE = 8, // Core ethics/philosophy requires maximum coherence for system integrity
}

/**
* Calculate coherence boost based on vortex criticality level.
* Formula: boost = criticality / 100
* This ensures critical vortexes maintain higher coherence thresholds
* while staying within the 0-1 normalized range.
*/
function calculateCoherenceBoost(criticality: VortexCriticality): number {
return criticality / 100;
}

/**
* Create VORTEX dashboard payload for endpoint integration
*/
Expand All @@ -124,12 +145,17 @@ export function createVortexPayload(
const cfg = { ...DEFAULT_VORTEX_CONFIG, ...config };
const waveAnalysis = analyzeWave(analysisText);

const baseCoherence = normalizeCoherenceScore(waveAnalysis.coherence_score);

const vortexes: VortexCluster[] = [
{
vortex_name: "MonitoringVortex",
description:
"Autonomous monitoring cluster – self-maintains coherence metrics",
coherence: normalizeCoherenceScore(waveAnalysis.coherence_score),
coherence: Math.min(
1,
baseCoherence + calculateCoherenceBoost(VortexCriticality.MONITORING),
),
components: [
"CoherenceConstellation.tsx",
"SpectralAnalyzer.tsx",
Expand All @@ -151,7 +177,7 @@ export function createVortexPayload(
"Autonomous testing/compliance – self-maintains audits/proofs",
coherence: Math.min(
1,
normalizeCoherenceScore(waveAnalysis.coherence_score) + 0.05,
baseCoherence + calculateCoherenceBoost(VortexCriticality.TESTING),
),
components: [
"LoadTestingSimulator.tsx",
Expand All @@ -172,7 +198,7 @@ export function createVortexPayload(
description: "Autonomous planning/infra – self-maintains transitions",
coherence: Math.min(
1,
normalizeCoherenceScore(waveAnalysis.coherence_score) + 0.03,
baseCoherence + calculateCoherenceBoost(VortexCriticality.PLANNING),
),
components: [
"MigrationPlanner.tsx",
Expand All @@ -193,7 +219,7 @@ export function createVortexPayload(
description: "Autonomous core/philo – self-maintains ethics",
coherence: Math.min(
1,
normalizeCoherenceScore(waveAnalysis.coherence_score) + 0.08,
baseCoherence + calculateCoherenceBoost(VortexCriticality.CORE),
),
components: ["HopeSaucedPhilosophy.tsx", "StakeholderHub.tsx"],
refinements: [
Expand Down
Loading