scbe-gate-swap
Analyze and swap between 2-gate (binary/negabinary) and 3-gate (balanced ternary) encoding for stability optimization. Use when evaluating gate efficiency, comparing encoding strategies for governance decisions, or optimizing bit-level representation in SCBE subsystems.
Best use case
scbe-gate-swap is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Analyze and swap between 2-gate (binary/negabinary) and 3-gate (balanced ternary) encoding for stability optimization. Use when evaluating gate efficiency, comparing encoding strategies for governance decisions, or optimizing bit-level representation in SCBE subsystems.
Teams using scbe-gate-swap should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/scbe-gate-swap/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How scbe-gate-swap Compares
| Feature / Agent | scbe-gate-swap | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Analyze and swap between 2-gate (binary/negabinary) and 3-gate (balanced ternary) encoding for stability optimization. Use when evaluating gate efficiency, comparing encoding strategies for governance decisions, or optimizing bit-level representation in SCBE subsystems.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# SCBE Gate Swap Analysis
Determine where in the SCBE-AETHERMOORE system to use 2-gate (binary) vs 3-gate (ternary) encoding for maximum stability and efficiency.
## Gate Types
### 3-Gate (Balanced Ternary)
- Digits: {-1, 0, +1} (T, 0, 1)
- No sign bit needed
- Maps directly to ALLOW/QUARANTINE/DENY
- Best for: governance decisions, small mixed-sign values, consensus voting
### 2-Gate (Binary / Negabinary)
- Standard binary: digits {0, 1}, needs sign bit for negatives
- Negabinary (base -2): digits {0, 1}, no sign bit, polarity from position
- Best for: large positive ranges, bit-level operations, hardware compatibility
## When to Use Which
| Subsystem | Recommended Gate | Why |
|-----------|-----------------|-----|
| Governance decisions | 3-gate (ternary) | Natural ALLOW/QUARANTINE/DENY mapping |
| BFT voting | 3-gate (ternary) | YES/ABSTAIN/NO maps to +1/0/-1 |
| Trust scores | 3-gate (ternary) | Trust/neutral/distrust is triadic |
| Entropy values | 2-gate (binary) | Always positive, wide range |
| Bit lengths | 2-gate (binary) | Always positive integers |
| Polarity analysis | 2-gate (negabinary) | Natural positive/negative encoding |
| Sacred Tongue mapping | 2-gate (negabinary) | KO/AV polarity from bit position |
| Hamiltonian routing | 3-gate (ternary) | Direction: forward/stay/backward |
| Safety scores | 3-gate (ternary) | Safe/uncertain/unsafe |
| Cryptographic keys | 2-gate (binary) | Hardware/algorithm compatibility |
| Spectral coefficients | 3-gate (ternary) | Positive/zero/negative frequency |
## Analysis Workflow
### 1. Profile the Value Range
```python
from src.symphonic_cipher.scbe_aethermoore.negabinary import analyze_gate_stability
# Collect values from the subsystem
values = [...] # the data to encode
report = analyze_gate_stability(values)
print(report.stability_recommendation)
print(f"Binary: {report.binary_total_bits} bits")
print(f"Ternary: {report.ternary_total_trits} trits")
print(f"Negabinary: {report.negabinary_total_bits} bits")
```
### 2. Interpret the Recommendation
The analyzer uses these heuristics:
- **Small mixed-sign (|max| <= 40, has negatives)**: TERNARY
- **Mixed polarity, negabinary more compact**: NEGABINARY
- **Ternary fewer trits than negabinary bits**: TERNARY
- **Large positive range**: BINARY
### 3. Cross-Convert if Needed
```python
from src.symphonic_cipher.scbe_aethermoore.negabinary import (
negabinary_to_balanced_ternary,
balanced_ternary_to_negabinary,
)
from src.symphonic_cipher.scbe_aethermoore.trinary import BalancedTernary
from src.symphonic_cipher.scbe_aethermoore.negabinary import NegaBinary
# Ternary -> Negabinary
bt = BalancedTernary.from_int(42)
nb = balanced_ternary_to_negabinary(bt)
# Negabinary -> Ternary
nb = NegaBinary.from_int(-7)
bt = negabinary_to_balanced_ternary(nb)
```
### 4. Governance Decision Packing
```python
from src.symphonic_cipher.scbe_aethermoore.trinary import BalancedTernary
decisions = ["ALLOW", "DENY", "QUARANTINE", "ALLOW", "ALLOW"]
packed = BalancedTernary.pack_decisions(decisions)
summary = packed.governance_summary()
# {consensus: "ALLOW", net_score: 2, allow: 3, deny: 1, quarantine: 1}
```
### 5. Tongue Polarity from Negabinary
```python
from src.symphonic_cipher.scbe_aethermoore.negabinary import NegaBinary
nb = NegaBinary.from_int(42)
print(nb.tongue_polarity()) # "KO" or "AV" or "RU"
print(nb.tongue_encoding()) # ["KO", "UM", "AV", "KO", ...]
# Even bit positions = positive weight = KO (assertive)
# Odd bit positions = negative weight = AV (receptive)
# Zero bits = UM (silence)
```
## Integration with Existing Systems
### Dual Ternary (ai_brain/dual_ternary.py)
The existing 9-state dual ternary system uses {-1,0,+1} x {-1,0,+1} for spectral analysis. The new balanced ternary module provides arithmetic operations that complement it.
### CPSE z-vector
The CPSE deviation channels (chaosdev, fractaldev, energydev) produce values in [-1, +1]. These map naturally to ternary encoding when discretized.
### Layer 11 Triadic Distance
The triadic temporal distance already uses a 3-valued system. Balanced ternary provides the formal arithmetic foundation.
## Key Files
| File | Purpose |
|------|---------|
| `src/symphonic_cipher/scbe_aethermoore/trinary.py` | Balanced ternary encoding + governance |
| `src/symphonic_cipher/scbe_aethermoore/negabinary.py` | Negabinary + gate stability analysis |
| `src/symphonic_cipher/scbe_aethermoore/ai_brain/dual_ternary.py` | 9-state dual ternary spectral |
| `tests/test_trinary_negabinary.py` | 45 tests covering both systems |
## Entropy Comparison
```python
# Ternary: max entropy = log2(3) = 1.585 bits per trit
# Binary: max entropy = log2(2) = 1.000 bits per bit
# Ternary packs more information per digit
bt = BalancedTernary.from_int(n)
density = bt.information_density() # 0.0 to 1.0
nb = NegaBinary.from_int(n)
entropy = nb.bit_entropy() # Shannon entropy of bit distribution
```Related Skills
scbe-training-pair-authoring
Create prompt and response and metadata training pairs from SCBE documents, repair traces, terminal sessions, and operational workflows using the repository's canonical dataset contract and provenance rules.
scbe-spin-conversation-engine
Generate SFT training data via radial matrix conversation pivots with D&D-style combat research mode. Produces diverse, cost-effective training pairs with Sacred Tongue encoding, golden spiral problem distribution, and harmonic re-attunement.
scbe-research-training-bridge
Stage arXiv evidence and Obsidian markdown into source-grounded Hugging Face training bundles for research, review, and later SFT runs.
scbe-document-management
Consolidate overlapping docs, classify files by authority, and keep SCBE repo documents aligned with runtime truth. Use when the repo has drift between canonical docs, public docs, proposal notes, research branches, and generated evidence.
scbe-colab-bridge
Control Google Colab notebooks from Claude Code via Chrome extension. Execute cells, run terminal commands, read outputs, and manage GPU compute remotely.
scbe-claim-to-code-evidence
Map SCBE Notion technical claims, proof pages, and patent-facing architecture notes to concrete repository evidence such as code paths, tests, demos, and docs. Use when Codex needs to build a due-diligence packet, claim-to-code audit, implementation crosswalk, patent support note, or proof summary from local Notion exports and repo artifacts.
scbe-autonomous-worker-productizer
Turn SCBE automation, autonomous worker, and revenue-system notes into concrete offers, workflow packs, pilot plans, or SaaS-facing product packets. Use when Codex needs to package Notion automation pages into buyer-ready offerings, n8n/Zapier workflow designs, flock-backed worker systems, or implementation roadmaps tied to existing SCBE repo surfaces.
scbe-code-scanning-ops
Operate GitHub code scanning and CodeQL remediation for SCBE repositories. Use when triaging code-scanning alerts, mapping alert classes to fix patterns, validating targeted regressions, or wiring dedicated CodeQL workflows and runbooks into the repo.
scbe-world-anvil-lore-rag-7th-tongue
Build and operate a lore-focused RAG system using World Anvil exports and SCBE docs, with deterministic Claude/Codex cross-talk packets for handoff. Use when users ask to structure lore canon retrieval, sync worldbuilding data, enforce citation-grounded generation, or coordinate a 7th Tongue overseer lane across multiple AI agents.
scbe-webtoon-book-conversion
Convert The Six Tongues Protocol and related manuscript sections into webtoon/manhwa storyboard packets, episode roadmaps, panel expansion plans, and image-generation-ready prompt lanes. Use when extending the series storyboard, adapting book chapters into vertical scroll episodes, or keeping art generation tied to canon instead of drifting into generic fantasy panels.
scbe-voice-render-verification
Govern and verify SCBE voice rendering work that maps Langues weighting into breath, phase, and Layer 14 audio-axis packets. Use when implementing or reviewing `scripts/voice_gen_hf.py`, emitting sidecar voice packets, validating canonical tongue ordering, tuning breath planning or phase timing, or keeping voice docs and code aligned with `docs/LANGUES_WEIGHTING_SYSTEM.md` and `docs/specs/SCBE_VOICE_EMOTIONAL_TIMBRE_SYSTEM.md`.
scbe-universal-synthesis
Orchestrate all installed Codex skills through an auto-updating synthesis matrix with Sacred Tongues routing, emotion/intent metadata, and decodable lexicon packets tied to established SCBE characters. Use when the user asks for cross-skill coordination, auto skill updates, multi-skill routing, or Sacred Tongues intent mapping.