Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 16, 2026

The createVortexPayload function used undocumented magic numbers (+0.05, +0.03, +0.08) for coherence boosts, making the code difficult to maintain and understand.

Changes:

  • Added VortexCriticality enum defining criticality levels (0-8) with rationale for each vortex type
  • Added calculateCoherenceBoost(criticality) function: boost = criticality / 100
  • Refactored coherence calculations to use formula instead of hardcoded offsets

Before:

coherence: Math.min(1, normalizeCoherenceScore(waveAnalysis.coherence_score) + 0.05)

After:

enum VortexCriticality {
  MONITORING = 0, // Baseline - observational role
  PLANNING = 3,   // Infrastructure planning requires moderate stability
  TESTING = 5,    // Testing/compliance needs high reliability
  CORE = 8,       // Core ethics requires maximum coherence
}

coherence: Math.min(1, baseCoherence + calculateCoherenceBoost(VortexCriticality.TESTING))

Values remain mathematically identical, but the rationale is now explicit and maintainable.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: toolate28 <105518313+toolate28@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback from review on Copilot/sub PR 8 Replace magic number coherence boosts with formula-based VortexCriticality system Jan 16, 2026
Copilot AI requested a review from toolate28 January 16, 2026 21:09
@toolate28 toolate28 marked this pull request as ready for review January 17, 2026 00:22
Copilot AI review requested due to automatic review settings January 17, 2026 00:22
@github-actions
Copy link

🌀 Agent Review: Coherence >60%. Ethical quantum sims validated. Ready for merge.

@toolate28 toolate28 merged commit 888f8f7 into copilot/sub-pr-8-again Jan 17, 2026
5 checks passed
@toolate28 toolate28 deleted the copilot/sub-pr-24-another-one branch January 17, 2026 00:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors magic number coherence boosts in the createVortexPayload function by introducing a formula-based VortexCriticality system. The change improves code maintainability by replacing undocumented hardcoded values (+0.05, +0.03, +0.08) with an explicit enum and calculation function, while maintaining mathematical equivalence.

Changes:

  • Introduced VortexCriticality enum with four criticality levels (0, 3, 5, 8) and documentation for each vortex type
  • Added calculateCoherenceBoost() helper function implementing the formula boost = criticality / 100
  • Refactored coherence calculations in all four vortex clusters to use the new formula-based system

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants