Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

Fix failing governance decision type checks#11

Merged
issdandavis merged 9 commits into
mainfrom
claude/fix-governance-decision-tests-xnssk
Mar 25, 2026
Merged

Fix failing governance decision type checks#11
issdandavis merged 9 commits into
mainfrom
claude/fix-governance-decision-tests-xnssk

Conversation

@issdandavis

Copy link
Copy Markdown
Owner

Use consistent import path (symphonic_cipher.scbe_aethermoore) instead of manipulating sys.path and importing from scbe_aethermoore. The dual import paths caused Python to create two separate enum class objects, breaking isinstance() and equality checks against GovernanceDecision.

Use consistent import path (symphonic_cipher.scbe_aethermoore) instead
of manipulating sys.path and importing from scbe_aethermoore. The dual
import paths caused Python to create two separate enum class objects,
breaking isinstance() and equality checks against GovernanceDecision.
@cursor

cursor Bot commented Jan 15, 2026

Copy link
Copy Markdown

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on February 11.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Copilot AI left a comment

Copy link
Copy Markdown

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 fixes failing governance decision type checks by replacing sys.path manipulation with proper package imports. The root cause was that dual import paths caused Python to create two separate enum class objects, breaking isinstance() and equality checks against GovernanceDecision.

Changes:

  • Removed sys.path manipulation code (sys and os imports, sys.path.insert call)
  • Updated import statement to use consistent package path symphonic_cipher.scbe_aethermoore instead of scbe_aethermoore
Comments suppressed due to low confidence (1)

symphonic_cipher/tests/test_full_system.py:15

  • Import of 'GovernanceMetrics' is not used.
from symphonic_cipher.scbe_aethermoore import (
    SCBEFullSystem,
    GovernanceMode,
    GovernanceMetrics,
    GovernanceDecision,
    quick_evaluate,
    verify_all_theorems,
)

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

symphonic_cipher/tests/test_full_system.py:15

  • Import of 'GovernanceMetrics' is not used.
from symphonic_cipher.scbe_aethermoore import (
    SCBEFullSystem,
    GovernanceMode,
    GovernanceMetrics,
    GovernanceDecision,
    quick_evaluate,
    verify_all_theorems,
)

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

New files:
- constants.py: Centralized AETHERMOORE constants (PHI, R_FIFTH,
  LAMBDA_ISSAC, harmonic_scale, security_bits functions)
- pqc/__init__.py: Package exports for PQC module
- pqc/pqc_core.py: Kyber768 KEM and Dilithium3 signature stubs
  with correct NIST key/signature sizes
- pqc/pqc_harmonic.py: Harmonic-enhanced PQC operations including:
  - harmonic_key_stretch: H(d,R) iteration-based key derivation
  - fast_harmonic_key: Single-pass dimension-based derivation
  - HarmonicPQCSession: Kyber+Dilithium sessions with harmonic scaling
  - Vector6DKey: 6D spatial access control keys
  - HarmonicKyberOrchestrator: High-level session management
- tests/test_pqc.py: 54 tests covering all PQC functionality

Security enhancement formula: S = S_base + d² × log₂(R) bits
For Kyber768 (192 bits) at d=6: ~213 effective bits
…defense

- dual_lattice.py: Claim 62 dual-lattice quantum security (Kyber + Dilithium)
  with fail-to-noise protection and dual consensus verification
- qc_lattice/quasicrystal.py: Icosahedral 6D→3D projection for aperiodic
  lattice generation using cut-and-project method
- qc_lattice/phdm.py: Polyhedral Hamiltonian Defense Manifold with 16
  polyhedra (5 Platonic + 11 Archimedean) and Euler characteristic verification
- axiom_grouped/langues_metric.py: Six Sacred Tongues 6D cost function with
  Polly/Quasi/Demi fluxing dimensions and golden ratio progression
- axiom_grouped/audio_axis.py: L14 FFT telemetry with spectral centroid,
  flux, and high-frequency stability scoring
- axiom_grouped/hamiltonian_cfi.py: Topological CFI via spectral embedding
  with Dirac/Ore theorem verification and golden path detection
- tests/test_qc_lattice.py: 31 tests for PHDM and quasicrystal modules
  covering Euler characteristic, polyhedra duality, icosahedral projection
- Updated qc_lattice/__init__.py exports for diffraction_fingerprint, etc.
- docs/index.html: Interactive 14-layer pipeline demo with live simulation
- docs/SIMPLE_GUIDE.md: Plain English explanation + 5 monetization paths
- Pricing tiers: Free/Enterprise ($499/mo)/Patent License
- Includes patentability assessment from validation tests
- web/app.py: Flask REST API with 14-layer pipeline
  - POST /api/analyze - Single text analysis
  - POST /api/batch - Batch processing (up to 100)
  - GET /api/constants - System constants (PHI, R_FIFTH, etc.)
  - GET /api/demo - Demo endpoint (no auth)
  - GET /api/health - Health check

- web/static/index.html: Interactive dashboard
  - Real-time layer visualization
  - ALLOW/QUARANTINE/DENY decision display
  - Risk meter and layer cards

- Dockerfile: Production-ready container
- run_web.py: Quick start script

Run locally: python run_web.py
Deploy: docker build -t scbe . && docker run -p 8080:8080 scbe
Serverless function implementing the 14-layer governance pipeline:
- Poincaré ball embedding (L1-4)
- Hyperbolic distance calculation (L5)
- Multi-well zone detection (L8)
- Triadic consensus voting (L11)
- Harmonic scaling (L12)
- Final decision logic (L13)

Supports POST JSON body and GET query parameters with CORS headers.
- SAM template for CloudFormation deployment
- deploy.sh script for one-command deployment
- requirements.txt for Lambda dependencies
- README.md with deployment instructions for both SAM CLI
  and manual AWS Console upload methods
- Includes Zapier integration instructions
@issdandavis

Copy link
Copy Markdown
Owner Author

Closing stale dirty PR to reduce backlog noise. This branch can be reopened later as a fresh PR from the current base if the work is still wanted.

@issdandavis issdandavis reopened this Mar 24, 2026
Comment thread docs/index.html
Comment on lines +341 to +380
output.innerHTML = `
<strong>Input:</strong> "${input.substring(0, 50)}${input.length > 50 ? '...' : ''}"

<strong>Layer 1-4 (Context Embedding):</strong>
Poincare ball coordinates: [${(Math.random()*0.5).toFixed(3)}, ${(Math.random()*0.5).toFixed(3)}, ${(Math.random()*0.5).toFixed(3)}]
Norm: ${(Math.random()*0.7).toFixed(4)} (< 1, valid)

<strong>Layer 5 (Hyperbolic Distance):</strong>
d_H(origin, point) = ${hyperbolicDist}

<strong>Layer 6-7 (Breath + Phase):</strong>
Breathing amplitude: A = 0.05
Phase offset: θ = ${(Math.random()*Math.PI).toFixed(4)} rad

<strong>Layer 8 (Multi-Well):</strong>
Nearest attractor: SAFE_ZONE (distance: ${(Math.random()*0.3).toFixed(3)})

<strong>Layer 9-10 (Spectral/Spin):</strong>
S_spectral = ${coherence}
S_spin = ${(0.8 + Math.random()*0.2).toFixed(4)}

<strong>Layer 11 (Triadic Consensus):</strong>
Node votes: [${decision}, ${decision}, ${decision}]
Consensus: ACHIEVED

<strong>Layer 12 (Harmonic Scaling):</strong>
H(6, 1.5) = 1.5^36 = ${harmonicScale}
Security amplification: ${harmonicScale}x

<strong>Layer 13 (Decision Gate):</strong>
<span class="status status-${statusClass}">${decision}</span>
Risk score: ${(risk * 100).toFixed(1)}%

<strong>Layer 14 (Audio Telemetry):</strong>
S_audio = ${(0.85 + Math.random()*0.15).toFixed(4)}
HF ratio: ${(Math.random()*0.15).toFixed(4)}

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
<strong>FINAL DECISION: <span class="status status-${statusClass}">${decision}</span></strong>
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━`;

Check failure

Code scanning / CodeQL

DOM text reinterpreted as HTML High documentation

DOM text
is reinterpreted as HTML without escaping meta-characters.
Comment thread run_web.py
# Import and run app
from web.app import app
print(f"\n Starting SCBE-AETHERMOORE Web API on http://localhost:{port}\n")
app.run(host='0.0.0.0', port=port, debug=True)

Check failure

Code scanning / CodeQL

Flask app is run in debug mode High

A Flask app appears to be run in debug mode. This may allow an attacker to run arbitrary code through the debugger.
def create_default(cls, tongue: SacredTongue, beta_base: float = 1.0) -> TongueParameters:
"""Create default parameters for a tongue using golden ratio progression."""
k = tongue.value
return cls(

Check failure

Code scanning / CodeQL

Syntax error Error

Syntax Error (in Python 3).
Comment thread web/app.py
result = run_pipeline(text)
return jsonify(result)
except Exception as e:
return jsonify({'error': str(e)}), 500

Check warning

Code scanning / CodeQL

Information exposure through an exception Medium

Stack trace information
flows to this location and may be exposed to an external user.
return False, f"Balanced bipartite: |A|={len(a)}, |B|={len(b)}"


def verify_deviation_detection(cfi: HamiltonianCFI) -> bool:

Check warning

Code scanning / CodeQL

Variable defined multiple times Warning

This assignment to 'verify_deviation_detection' is unnecessary as it is
redefined
before this value is used.
return None


def verify_dirac_theorem(graph: ControlFlowGraph) -> bool:

Check warning

Code scanning / CodeQL

Variable defined multiple times Warning

This assignment to 'verify_dirac_theorem' is unnecessary as it is
redefined
before this value is used.
Comment thread web/app.py

import os
import sys
import json

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'json' is not used.
Comment thread web/app.py
# Add parent directory to path for imports
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from flask import Flask, request, jsonify, render_template, send_from_directory

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'render_template' is not used.
Comment thread web/app.py
Comment on lines +29 to +32
from symphonic_cipher.scbe_aethermoore import (
GovernanceDecision,
process_governance_request,
)

Check notice

Code scanning / CodeQL

Unused import Note

Import of 'GovernanceDecision' is not used.
Import of 'process_governance_request' is not used.
Comment thread web/app.py
SCBE_AVAILABLE = True
except ImportError:
SCBE_AVAILABLE = False
print("Warning: SCBE modules not fully available, using simulation mode")

Check notice

Code scanning / CodeQL

Use of a print statement at module level Note

Print statement may execute during import.
Comment thread web/app.py
# Layer 12: Harmonic Scaling
dimension = 6
h_scale = harmonic_scale(dimension, R_FIFTH)
security_amplification = h_scale

Check notice

Code scanning / CodeQL

Unused local variable Note

Variable security_amplification is not used.
@issdandavis issdandavis merged commit 6d0f75f into main Mar 25, 2026
24 of 33 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants