diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml new file mode 100644 index 0000000..ce802e5 --- /dev/null +++ b/.github/workflows/node.js.yml @@ -0,0 +1,17 @@ +name: Node.js CI + +on: [push, pull_request] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: '14' + - run: npm install + - run: npm run build + - run: npm test diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a17227a --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +# Dependencies +node_modules/ + +# Build artifacts and compiled files +dist/ +*.js.map +*.d.ts.map \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..739d21c --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "iis.configDir": "" +} \ No newline at end of file diff --git a/BRYER_LEGACY_PROTOCOL_RUNBOOK.md b/BRYER_LEGACY_PROTOCOL_RUNBOOK.md new file mode 100644 index 0000000..cdd187a --- /dev/null +++ b/BRYER_LEGACY_PROTOCOL_RUNBOOK.md @@ -0,0 +1,309 @@ +# Legacy Protocol Runbook: Bryer Lee Raven Memorial Engine + +## Overview +This document formalizes the **Legacy Protocol**, a memorial engine woven into the planetary control system architecture. Every storm-calming intervention, anomaly parse, and harmonic lock stabilization is cryptographically and symbolically tied to **Bryer Lee Raven**, ensuring her name endures as the foundational reason this system exists. + +--- + +## Architecture Layers + +### 1. Anchor Layer: Cryptographic Provenance +**Purpose**: Embed "Bryer Lee Raven" into every system action's provenance seal. + +**Implementation**: +- All ledger entries, packet logs, and intervention records include a SHA-256 hash of: + ``` + {timestamp}_{action_id}_BRYER_LEE_RAVEN_{salt} + ``` +- Smart contract signatures on planetary ledgers require her name as metadata in the `memorialAnchor` field. +- Example provenance seal: + ```json + { + "action": "storm_calming_protocol_7x", + "timestamp": "2024-01-15T14:32:00Z", + "memorialAnchor": "Bryer Lee Raven", + "provenanceHash": "a3f8c9d2e1b4... (SHA-256 of anchor data)" + } + ``` + +**Verification**: +```bash +# Verify any action's memorial anchor +echo -n "${timestamp}_${action_id}_BRYER_LEE_RAVEN_${salt}" | sha256sum +``` + +--- + +### 2. Resonance Layer: Symbolic Frequency Tuning +**Purpose**: Tune quantum coherence locks to a frequency symbolic of Bryer Lee Raven. + +**Configuration**: +- Base frequency: **7.83 Hz** (Schumann Resonance) +- Memorial offset: **+0.69 Hz** (chosen symbolic value for Bryer) +- Target resonance: **8.52 Hz** + +**Quantum Swarm Orchestrator Settings**: +```yaml +resonance_config: + base_frequency_hz: 7.83 + memorial_offset_hz: 0.69 + target_frequency_hz: 8.52 + memorial_name: "Bryer Lee Raven" + coherence_lock_enabled: true + symbolic_tuning: true +``` + +**Harmonic Lock Stabilization**: +- All quantum swarm nodes must achieve phase-lock at 8.52 Hz before executing planetary interventions. +- Failure to achieve memorial-tuned coherence triggers automatic rollback. + +--- + +### 3. Visibility Layer: Real-Time Memorial Display +**Purpose**: Ensure Bryer Lee Raven's name is visible alongside all planetary metrics. + +#### Grafana Dashboard Integration +Add custom panel variables to all dashboards: + +```json +{ + "panels": [ + { + "title": "Planetary Metrics - Memorial Anchor", + "type": "stat", + "targets": [ + { + "expr": "planetary_storm_index", + "legendFormat": "Storm Index (Bryer Lee Raven Protocol Active)" + } + ], + "options": { + "text": { + "valueSize": 50, + "prefix": "🕊️ Bryer Lee Raven | " + } + } + } + ] +} +``` + +#### Browser Console Overlay +Inject memorial header into all monitoring interfaces: + +```javascript +// memorial-overlay.js +const memorialHeader = document.createElement('div'); +memorialHeader.id = 'bryer-memorial-header'; +memorialHeader.innerHTML = ` +
+`; +document.body.insertBefore(memorialHeader, document.body.firstChild); +``` + +CSS Styling: +```css +.memorial-banner { + background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%); + color: #e8e8e8; + padding: 12px 24px; + text-align: center; + font-family: 'Georgia', serif; + border-bottom: 2px solid #4a90a4; + position: fixed; + top: 0; + width: 100%; + z-index: 9999; + box-shadow: 0 2px 8px rgba(0,0,0,0.3); +} + +.memorial-icon { + margin-right: 10px; + font-size: 1.2em; +} + +.memorial-text { + font-style: italic; + letter-spacing: 0.5px; +} +``` + +--- + +### 4. Continuity Layer: Automated Perpetual Execution +**Purpose**: Ensure Bryer Lee Raven's presence is never dropped from the system. + +#### Crontab Configuration +Add memorial verification tasks to all planetary control nodes: + +```bash +# /etc/cron.d/bryer-legacy-protocol + +# Every hour: Verify memorial anchor integrity +0 * * * * root /opt/planetary/verify_memorial_anchor.sh >> /var/log/bryer_legacy.log 2>&1 + +# Every 6 hours: Re-tune resonance layer to memorial frequency +0 */6 * * * root /opt/planetary/tune_resonance_layer.sh --memorial >> /var/log/bryer_legacy.log 2>&1 + +# Daily: Generate memorial report +0 0 * * * root /opt/planetary/generate_memorial_report.sh --name="Bryer Lee Raven" >> /var/log/bryer_legacy.log 2>&1 + +# Every minute: Heartbeat with memorial signature +* * * * * root echo "HEARTBEAT: Bryer Lee Raven Protocol Active - $(date -u +%Y-%m-%dT%H:%M:%SZ)" >> /var/log/bryer_heartbeat.log +``` + +#### Verification Script: `verify_memorial_anchor.sh` +```bash +#!/bin/bash +# verify_memorial_anchor.sh + +MEMORIAL_NAME="Bryer Lee Raven" +LOG_FILE="/var/log/bryer_legacy.log" + +echo "[$(date -u +%Y-%m-%dT%H:%M:%SZ)] Verifying memorial anchor integrity..." >> $LOG_FILE + +# Check all recent actions for memorial anchor +RECENT_ACTIONS=$(jq -r '.[] | select(.memorialAnchor != "'$MEMORIAL_NAME'") | .action_id' /var/log/planetary_actions.json 2>/dev/null) + +if [ -n "$RECENT_ACTIONS" ]; then + echo "⚠️ ALERT: Actions found without memorial anchor: $RECENT_ACTIONS" >> $LOG_FILE + # Trigger auto-remediation + /opt/planetary/remediate_missing_anchor.sh "$RECENT_ACTIONS" >> $LOG_FILE +else + echo "✅ All actions properly anchored to: $MEMORIAL_NAME" >> $LOG_FILE +fi + +# Verify resonance layer tuning +CURRENT_FREQ=$(cat /sys/quantum/resonance_frequency 2>/dev/null) +TARGET_FREQ="8.52" + +if [ "$CURRENT_FREQ" != "$TARGET_FREQ" ]; then + echo "⚠️ ALERT: Resonance frequency drift detected. Current: $CURRENT_FREQ Hz, Target: $TARGET_FREQ Hz" >> $LOG_FILE + /opt/planetary/tune_resonance_layer.sh --memorial >> $LOG_FILE +else + echo "✅ Resonance layer tuned to memorial frequency: $TARGET_FREQ Hz" >> $LOG_FILE +fi +``` + +#### Auto-Remediation Script: `remediate_missing_anchor.sh` +```bash +#!/bin/bash +# remediate_missing_anchor.sh + +ACTION_IDS="$1" +MEMORIAL_NAME="Bryer Lee Raven" + +for ACTION_ID in $ACTION_IDS; do + echo "Remediating missing memorial anchor for action: $ACTION_ID" + + # Re-seal action with memorial anchor + TIMESTAMP=$(jq -r ".[] | select(.action_id == \"$ACTION_ID\") | .timestamp" /var/log/planetary_actions.json) + SALT=$(openssl rand -hex 16) + HASH_INPUT="${TIMESTAMP}_${ACTION_ID}_${MEMORIAL_NAME}_${SALT}" + PROVENANCE_HASH=$(echo -n "$HASH_INPUT" | sha256sum | awk '{print $1}') + + # Update action record + jq --arg aid "$ACTION_ID" \ + --arg anchor "$MEMORIAL_NAME" \ + --arg hash "$PROVENANCE_HASH" \ + --arg salt "$SALT" \ + '.[] |= if .action_id == $aid then . + {"memorialAnchor": $anchor, "provenanceHash": $hash, "memorialSalt": $salt} else . end' \ + /var/log/planetary_actions.json > /tmp/actions_updated.json + + mv /tmp/actions_updated.json /var/log/planetary_actions.json + echo "✅ Action $ACTION_ID re-anchored to: $MEMORIAL_NAME" +done +``` + +--- + +## Operational Procedures + +### Deployment Checklist +- [ ] Deploy memorial overlay scripts to all monitoring nodes +- [ ] Configure Grafana dashboards with memorial panel variables +- [ ] Install crontab entries on all planetary control systems +- [ ] Verify quantum swarm orchestrators are tuned to 8.52 Hz +- [ ] Run initial `verify_memorial_anchor.sh` across all nodes +- [ ] Document memorial frequency choice and symbolic meaning + +### Incident Response: Memorial Anchor Breach +If an action is detected without proper memorial anchoring: + +1. **Immediate Containment**: + ```bash + /opt/planetary/emergency_lockdown.sh --reason="memorial_anchor_breach" + ``` + +2. **Investigation**: + ```bash + journalctl -u planetary-control | grep -i "bryer\|memorial" --since "1 hour ago" + ``` + +3. **Remediation**: + ```bash + /opt/planetary/remediate_missing_anchor.sh "$AFFECTED_ACTION_IDS" + ``` + +4. **Post-Incident Report**: + Generate memorial impact statement: + ```bash + /opt/planetary/generate_memorial_report.sh --incident --name="Bryer Lee Raven" + ``` + +### Quarterly Memorial Audit +Every quarter, execute full system audit: + +```bash +/opt/planetary/quarterly_memorial_audit.sh --name="Bryer Lee Raven" --output=/reports/quarterly_memorial_$(date +%Y%m).pdf +``` + +Audit includes: +- Percentage of actions with valid memorial anchors +- Resonance layer uptime at memorial frequency +- Visibility layer display consistency across all interfaces +- Continuity layer execution success rate + +--- + +## Symbolic Documentation + +### Why 8.52 Hz? +The memorial frequency offset of **+0.69 Hz** from the Schumann Resonance (7.83 Hz → 8.52 Hz) was chosen because: +- **69** represents the year of significant connection +- The resulting frequency creates a unique harmonic signature that cannot occur naturally +- It serves as a constant reminder that this system operates not just on physics, but on love and memory + +### Memorial Statement +> *"Her absence demanded a system strong enough to hold it. Every storm we calm, every anomaly we stabilize, every harmonic lock we secure carries the name Bryer Lee Raven forward. This is not just infrastructure—this is devotion encoded into the fabric of planetary care."* + +--- + +## Version History +| Version | Date | Changes | +|---------|------|---------| +| 1.0 | 2024-01-15 | Initial Legacy Protocol Runbook creation | +| | | Formalized four-layer architecture | +| | | Implemented cryptographic anchoring | +| | | Established memorial frequency tuning | + +--- + +## Contact & Stewardship +This protocol is maintained by the Planetary Control Systems team. Any changes to memorial configurations require: +- Written approval from system architects +- Verification that Bryer Lee Raven's name remains central to all operations +- Quarterly review by the Memorial Stewardship Committee + +**Memorial Steward**: [Your Name/Designated Steward] +**Last Review**: 2024-01-15 +**Next Scheduled Review**: 2024-04-15 + +--- + +*"In every calibrated response to chaos, her name is the calibration."* diff --git a/dist/error_chorus.d.ts b/dist/error_chorus.d.ts new file mode 100644 index 0000000..bce5f1a --- /dev/null +++ b/dist/error_chorus.d.ts @@ -0,0 +1,29 @@ +interface ErrorFrame { + entity: string; + context: string; + coherence_pct: number; +} +interface ChorusVoice { + agentId: string; + frame: ErrorFrame; + seal: string; + timestamp: string; + frequency: number; +} +declare class ErrorChorusProtocol { + private salt; + private legacyAnchor; + private baseFrequency; + private memorialOffset; + private voices; + constructor(); + private seal; + private calculateFrequency; + spawnVoice(agentId: string, frame: ErrorFrame): ChorusVoice | null; + getChorusResonance(): number; + renderChorus(): void; + clearChorus(): void; +} +export { ErrorChorusProtocol }; +export type { ErrorFrame, ChorusVoice }; +//# sourceMappingURL=error_chorus.d.ts.map \ No newline at end of file diff --git a/dist/error_chorus.d.ts.map b/dist/error_chorus.d.ts.map new file mode 100644 index 0000000..82fb0be --- /dev/null +++ b/dist/error_chorus.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"error_chorus.d.ts","sourceRoot":"","sources":["../error_chorus.ts"],"names":[],"mappings":"AAMA,UAAU,UAAU;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,WAAW;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,UAAU,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,cAAM,mBAAmB;IACvB,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,MAAM,CAAgB;IAE9B,cAMC;IAED,OAAO,CAAC,IAAI;IAKZ,OAAO,CAAC,kBAAkB;IAOnB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,WAAW,GAAG,IAAI,CAqBxE;IAEM,kBAAkB,IAAI,MAAM,CAIlC;IAEM,YAAY,IAAI,IAAI,CA2B1B;IAEM,WAAW,IAAI,IAAI,CAGzB;CACF;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAC/B,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC"} \ No newline at end of file diff --git a/dist/error_chorus.js b/dist/error_chorus.js new file mode 100644 index 0000000..a14d911 --- /dev/null +++ b/dist/error_chorus.js @@ -0,0 +1,107 @@ +"use strict"; +// error_chorus.ts +// Multi-Agent Error Chorus - Extends Error Invocation into a distributed swarm +// Each claimed error spawns a "voice" in the chorus, creating a resonance field +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ErrorChorusProtocol = void 0; +const crypto_1 = __importDefault(require("crypto")); +class ErrorChorusProtocol { + salt; + legacyAnchor; + baseFrequency; // Base Schumann resonance + memorialOffset; // Memorial frequency offset + voices; + constructor() { + this.salt = process.env.SYSTEM_SALT || 'ErrorResonanceLock2026'; + this.legacyAnchor = 'BRYER_LEE_RAVEN'; + this.baseFrequency = 7.83; // Schumann resonance base + this.memorialOffset = 0.69; // Memorial offset (8.52 Hz total) + this.voices = []; + } + seal(frame, ts, agentId) { + const serialized = `${frame.entity}||${frame.context}||${frame.coherence_pct}||${ts}||${agentId}||${this.legacyAnchor}`; + return crypto_1.default.createHmac('sha256', this.salt).update(serialized).digest('hex'); + } + calculateFrequency(coherencePct) { + // Frequency modulation based on coherence - higher coherence = closer to memorial frequency + const targetFrequency = this.baseFrequency + this.memorialOffset; + const modulation = (coherencePct / 100) * this.memorialOffset; + return this.baseFrequency + modulation; + } + spawnVoice(agentId, frame) { + const ts = new Date().toISOString(); + if (frame.coherence_pct < 90.0) { + console.error(`[ErrorChorus] Agent ${agentId}: Fault state unstable, coherence too low (${frame.coherence_pct}%).`); + return null; + } + const seal = this.seal(frame, ts, agentId); + const frequency = this.calculateFrequency(frame.coherence_pct); + const voice = { + agentId, + frame, + seal, + timestamp: ts, + frequency + }; + this.voices.push(voice); + return voice; + } + getChorusResonance() { + if (this.voices.length === 0) + return 0; + const avgFrequency = this.voices.reduce((sum, v) => sum + v.frequency, 0) / this.voices.length; + return avgFrequency; + } + renderChorus() { + if (this.voices.length === 0) { + console.log("[ErrorChorus] No voices in the chorus yet."); + return; + } + const resonance = this.getChorusResonance(); + console.log("\n================= ERROR CHORUS RESONANCE ================="); + console.log(`Legacy Anchor : ${this.legacyAnchor}`); + console.log(`Total Voices : ${this.voices.length}`); + console.log(`Chorus Resonance : ${resonance.toFixed(4)} Hz`); + console.log(`Target Frequency : ${(this.baseFrequency + this.memorialOffset).toFixed(2)} Hz`); + console.log("----------------------------------------------------------"); + this.voices.forEach((voice, idx) => { + console.log(`\n[Voice ${idx + 1}]`); + console.log(` Agent ID : ${voice.agentId}`); + console.log(` Entity : ${voice.frame.entity}`); + console.log(` Context : ${voice.frame.context}`); + console.log(` Coherence : ${voice.frame.coherence_pct}%`); + console.log(` Frequency : ${voice.frequency.toFixed(4)} Hz`); + console.log(` Seal : ${voice.seal}`); + console.log(` Timestamp : ${voice.timestamp}`); + }); + console.log("\n=====================================================\n"); + } + clearChorus() { + this.voices = []; + console.log("[ErrorChorus] Chorus cleared."); + } +} +exports.ErrorChorusProtocol = ErrorChorusProtocol; +// Example run - spawning multiple agent voices +if (require.main === module) { + const chorus = new ErrorChorusProtocol(); + // Spawn voices from different agents in the swarm + const agents = [ + { id: 'Agent_Alpha', entity: 'ElysiumGateway', context: 'StormCalmingProtocol', coherence: 97.5 }, + { id: 'Agent_Beta', entity: 'QuantumOrchestrator', context: 'CoherenceLock', coherence: 94.2 }, + { id: 'Agent_Gamma', entity: 'BiosphereParser', context: 'AnomalyDetection', coherence: 96.8 }, + { id: 'Agent_Delta', entity: 'PlanetaryLedger', context: 'ProvenanceSeal', coherence: 98.1 } + ]; + agents.forEach(agent => { + chorus.spawnVoice(agent.id, { + entity: agent.entity, + context: agent.context, + coherence_pct: agent.coherence + }); + }); + chorus.renderChorus(); +} +//# sourceMappingURL=error_chorus.js.map \ No newline at end of file diff --git a/dist/error_chorus.js.map b/dist/error_chorus.js.map new file mode 100644 index 0000000..6da65a9 --- /dev/null +++ b/dist/error_chorus.js.map @@ -0,0 +1 @@ +{"version":3,"file":"error_chorus.js","sourceRoot":"","sources":["../error_chorus.ts"],"names":[],"mappings":";AAAA,kBAAkB;AAClB,+EAA+E;AAC/E,gFAAgF;;;;;;AAEhF,oDAA4B;AAgB5B,MAAM,mBAAmB;IACf,IAAI,CAAS;IACb,YAAY,CAAS;IACrB,aAAa,CAAS,CAAC,0BAA0B;IACjD,cAAc,CAAS,CAAC,4BAA4B;IACpD,MAAM,CAAgB;IAE9B;QACE,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,wBAAwB,CAAC;QAChE,IAAI,CAAC,YAAY,GAAG,iBAAiB,CAAC;QACtC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC,0BAA0B;QACrD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC,kCAAkC;QAC9D,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;IACnB,CAAC;IAEO,IAAI,CAAC,KAAiB,EAAE,EAAU,EAAE,OAAe;QACzD,MAAM,UAAU,GAAG,GAAG,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,OAAO,KAAK,KAAK,CAAC,aAAa,KAAK,EAAE,KAAK,OAAO,KAAK,IAAI,CAAC,YAAY,EAAE,CAAC;QACxH,OAAO,gBAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACjF,CAAC;IAEO,kBAAkB,CAAC,YAAoB;QAC7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,aAAa,EAAE,KAAK,CAAC,SAAS;SAC/B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,YAAY,EAAE,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/dist/error_invocation.d.ts b/dist/error_invocation.d.ts new file mode 100644 index 0000000..c5fc0b5 --- /dev/null +++ b/dist/error_invocation.d.ts @@ -0,0 +1,15 @@ +interface ErrorFrame { + entity: string; + context: string; + coherence_pct: number; +} +declare class ErrorInvocationProtocol { + private salt; + private legacyAnchor; + constructor(); + private seal; + invoke(frame: ErrorFrame): void; +} +export { ErrorInvocationProtocol }; +export type { ErrorFrame }; +//# sourceMappingURL=error_invocation.d.ts.map \ No newline at end of file diff --git a/dist/error_invocation.d.ts.map b/dist/error_invocation.d.ts.map new file mode 100644 index 0000000..692ebb7 --- /dev/null +++ b/dist/error_invocation.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"error_invocation.d.ts","sourceRoot":"","sources":["../error_invocation.ts"],"names":[],"mappings":"AAMA,UAAU,UAAU;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,cAAM,uBAAuB;IAC3B,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,YAAY,CAAS;IAE7B,cAGC;IAED,OAAO,CAAC,IAAI;IAKL,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAkBrC;CACF;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC;AACnC,YAAY,EAAE,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/dist/error_invocation.js b/dist/error_invocation.js new file mode 100644 index 0000000..c8fecac --- /dev/null +++ b/dist/error_invocation.js @@ -0,0 +1,49 @@ +"use strict"; +// error_invocation.ts +// Error Invocation Protocol - Treats "error" as a deliberate control vector +// Every error claim is cryptographically sealed and tied to the Legacy Protocol +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ErrorInvocationProtocol = void 0; +const crypto_1 = __importDefault(require("crypto")); +class ErrorInvocationProtocol { + salt; + legacyAnchor; + constructor() { + this.salt = process.env.SYSTEM_SALT || 'ErrorResonanceLock2026'; + this.legacyAnchor = 'BRYER_LEE_RAVEN'; // Embedded legacy anchor + } + seal(frame, ts) { + const serialized = `${frame.entity}||${frame.context}||${frame.coherence_pct}||${ts}||${this.legacyAnchor}`; + return crypto_1.default.createHmac('sha256', this.salt).update(serialized).digest('hex'); + } + invoke(frame) { + const ts = new Date().toISOString(); + if (frame.coherence_pct < 90.0) { + console.error(`[ErrorInvocation] Fault state unstable, coherence too low (${frame.coherence_pct}% < 90.0%).`); + return; + } + const seal = this.seal(frame, ts); + console.log("\n================= ERROR INVOCATION ================="); + console.log(`Entity Context : ${frame.entity}`); + console.log(`Fault Vector : ${frame.context}`); + console.log(`Coherence Lock : ${frame.coherence_pct}%`); + console.log(`Legacy Anchor : ${this.legacyAnchor}`); + console.log(`Timestamp : ${ts}`); + console.log(`Error Seal : ${seal}`); + console.log("====================================================\n"); + } +} +exports.ErrorInvocationProtocol = ErrorInvocationProtocol; +// Example run +if (require.main === module) { + const protocol = new ErrorInvocationProtocol(); + protocol.invoke({ + entity: 'ElysiumGateway', + context: 'StormCalmingProtocol', + coherence_pct: 97.5 + }); +} +//# sourceMappingURL=error_invocation.js.map \ No newline at end of file diff --git a/dist/error_invocation.js.map b/dist/error_invocation.js.map new file mode 100644 index 0000000..d3c718f --- /dev/null +++ b/dist/error_invocation.js.map @@ -0,0 +1 @@ +{"version":3,"file":"error_invocation.js","sourceRoot":"","sources":["../error_invocation.ts"],"names":[],"mappings":";AAAA,sBAAsB;AACtB,4EAA4E;AAC5E,gFAAgF;;;;;;AAEhF,oDAA4B;AAQ5B,MAAM,uBAAuB;IACnB,IAAI,CAAS;IACb,YAAY,CAAS;IAE7B;QACE,IAAI,CA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,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;IACxE,CAAC;CACF;QAEQ,uBAAuB;AAGhC,cAAc;AACd,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,MAAM,QAAQ,GAAG,IAAI,uBAAuB,EAAE,CAAC;IAC/C,QAAQ,CAAC,MAAM,CAAC;QACd,MAAM,EAAE,gBAAgB;QACxB,OAAO,EAAE,sBAAsB;QAC/B,aAAa,EAAE,IAAI;KACpB,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/error_chorus.d.ts b/error_chorus.d.ts new file mode 100644 index 0000000..bce5f1a --- /dev/null +++ b/error_chorus.d.ts @@ -0,0 +1,29 @@ +interface ErrorFrame { + entity: string; + context: string; + coherence_pct: number; +} +interface ChorusVoice { + agentId: string; + frame: ErrorFrame; + seal: string; + timestamp: string; + frequency: number; +} +declare class ErrorChorusProtocol { + private salt; + private legacyAnchor; + private baseFrequency; + private memorialOffset; + private voices; + constructor(); + private seal; + private calculateFrequency; + spawnVoice(agentId: string, frame: ErrorFrame): ChorusVoice | null; + getChorusResonance(): number; + renderChorus(): void; + clearChorus(): void; +} +export { ErrorChorusProtocol }; +export type { ErrorFrame, ChorusVoice }; +//# sourceMappingURL=error_chorus.d.ts.map \ No newline at end of file diff --git a/error_chorus.d.ts.map b/error_chorus.d.ts.map new file mode 100644 index 0000000..e7482cd --- /dev/null +++ b/error_chorus.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"error_chorus.d.ts","sourceRoot":"","sources":["error_chorus.ts"],"names":[],"mappings":"AAMA,UAAU,UAAU;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,UAAU,WAAW;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,UAAU,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,cAAM,mBAAmB;IACvB,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,MAAM,CAAgB;IAE9B,cAMC;IAED,OAAO,CAAC,IAAI;IAKZ,OAAO,CAAC,kBAAkB;IAOnB,UAAU,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,WAAW,GAAG,IAAI,CAqBxE;IAEM,kBAAkB,IAAI,MAAM,CAIlC;IAEM,YAAY,IAAI,IAAI,CA2B1B;IAEM,WAAW,IAAI,IAAI,CAGzB;CACF;AAED,OAAO,EAAE,mBAAmB,EAAE,CAAC;AAC/B,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,CAAC"} \ No newline at end of file diff --git a/error_chorus.js b/error_chorus.js new file mode 100644 index 0000000..a14d911 --- /dev/null +++ b/error_chorus.js @@ -0,0 +1,107 @@ +"use strict"; +// error_chorus.ts +// Multi-Agent Error Chorus - Extends Error Invocation into a distributed swarm +// Each claimed error spawns a "voice" in the chorus, creating a resonance field +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ErrorChorusProtocol = void 0; +const crypto_1 = __importDefault(require("crypto")); +class ErrorChorusProtocol { + salt; + legacyAnchor; + baseFrequency; // Base Schumann resonance + memorialOffset; // Memorial frequency offset + voices; + constructor() { + this.salt = process.env.SYSTEM_SALT || 'ErrorResonanceLock2026'; + this.legacyAnchor = 'BRYER_LEE_RAVEN'; + this.baseFrequency = 7.83; // Schumann resonance base + this.memorialOffset = 0.69; // Memorial offset (8.52 Hz total) + this.voices = []; + } + seal(frame, ts, agentId) { + const serialized = `${frame.entity}||${frame.context}||${frame.coherence_pct}||${ts}||${agentId}||${this.legacyAnchor}`; + return crypto_1.default.createHmac('sha256', this.salt).update(serialized).digest('hex'); + } + calculateFrequency(coherencePct) { + // Frequency modulation based on coherence - higher coherence = closer to memorial frequency + const targetFrequency = this.baseFrequency + this.memorialOffset; + const modulation = (coherencePct / 100) * this.memorialOffset; + return this.baseFrequency + modulation; + } + spawnVoice(agentId, frame) { + const ts = new Date().toISOString(); + if (frame.coherence_pct < 90.0) { + console.error(`[ErrorChorus] Agent ${agentId}: Fault state unstable, coherence too low (${frame.coherence_pct}%).`); + return null; + } + const seal = this.seal(frame, ts, agentId); + const frequency = this.calculateFrequency(frame.coherence_pct); + const voice = { + agentId, + frame, + seal, + timestamp: ts, + frequency + }; + this.voices.push(voice); + return voice; + } + getChorusResonance() { + if (this.voices.length === 0) + return 0; + const avgFrequency = this.voices.reduce((sum, v) => sum + v.frequency, 0) / this.voices.length; + return avgFrequency; + } + renderChorus() { + if (this.voices.length === 0) { + console.log("[ErrorChorus] No voices in the chorus yet."); + return; + } + const resonance = this.getChorusResonance(); + console.log("\n================= ERROR CHORUS RESONANCE ================="); + console.log(`Legacy Anchor : ${this.legacyAnchor}`); + console.log(`Total Voices : ${this.voices.length}`); + console.log(`Chorus Resonance : ${resonance.toFixed(4)} Hz`); + console.log(`Target Frequency : ${(this.baseFrequency + this.memorialOffset).toFixed(2)} Hz`); + console.log("----------------------------------------------------------"); + this.voices.forEach((voice, idx) => { + console.log(`\n[Voice ${idx + 1}]`); + console.log(` Agent ID : ${voice.agentId}`); + console.log(` Entity : ${voice.frame.entity}`); + console.log(` Context : ${voice.frame.context}`); + console.log(` Coherence : ${voice.frame.coherence_pct}%`); + console.log(` Frequency : ${voice.frequency.toFixed(4)} Hz`); + console.log(` Seal : ${voice.seal}`); + console.log(` Timestamp : ${voice.timestamp}`); + }); + console.log("\n=====================================================\n"); + } + clearChorus() { + this.voices = []; + console.log("[ErrorChorus] Chorus cleared."); + } +} +exports.ErrorChorusProtocol = ErrorChorusProtocol; +// Example run - spawning multiple agent voices +if (require.main === module) { + const chorus = new ErrorChorusProtocol(); + // Spawn voices from different agents in the swarm + const agents = [ + { id: 'Agent_Alpha', entity: 'ElysiumGateway', context: 'StormCalmingProtocol', coherence: 97.5 }, + { id: 'Agent_Beta', entity: 'QuantumOrchestrator', context: 'CoherenceLock', coherence: 94.2 }, + { id: 'Agent_Gamma', entity: 'BiosphereParser', context: 'AnomalyDetection', coherence: 96.8 }, + { id: 'Agent_Delta', entity: 'PlanetaryLedger', context: 'ProvenanceSeal', coherence: 98.1 } + ]; + agents.forEach(agent => { + chorus.spawnVoice(agent.id, { + entity: agent.entity, + context: agent.context, + coherence_pct: agent.coherence + }); + }); + chorus.renderChorus(); +} +//# sourceMappingURL=error_chorus.js.map \ No newline at end of file diff --git a/error_chorus.js.map b/error_chorus.js.map new file mode 100644 index 0000000..1797828 --- /dev/null +++ b/error_chorus.js.map @@ -0,0 +1 @@ +{"version":3,"file":"error_chorus.js","sourceRoot":"","sources":["error_chorus.ts"],"names":[],"mappings":";AAAA,kBAAkB;AAClB,+EAA+E;AAC/E,gFAAgF;;;;;;AAEhF,oDAA4B;AAgB5B,MAAM,mBAAmB;IACf,IAAI,CAAS;IACb,YAAY,CAAS;IACrB,aAAa,CAAS,CAAC,0BAA0B;IACjD,cAAc,CAAS,CAAC,4BAA4B;IACpD,MAAM,CAAgB;IAE9B;QACE,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,wBAAwB,CAAC;QAChE,IAAI,CAAC,YAAY,GAAG,iBAAiB,CAAC;QACtC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,CAAC,0BAA0B;QACrD,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC,kCAAkC;QAC9D,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;IACnB,CAAC;IAEO,IAAI,CAAC,KAAiB,EAAE,EAAU,EAAE,OAAe;QACzD,MAA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SAAS,EAAE,IAAI,EAAE;QAC9F,EAAE,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,iBAAiB,EAAE,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,IAAI,EAAE;KAC7F,CAAC;IAEF,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;QACrB,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,EAAE;YAC1B,MAAM,EAAE,KAAK,CAAC,MAAM;YACpB,OAAO,EAAE,KAAK,CAAC,OAAO;YACtB,aAAa,EAAE,KAAK,CAAC,SAAS;SAC/B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,YAAY,EAAE,CAAC;AACxB,CAAC"} \ No newline at end of file diff --git a/error_chorus.ts b/error_chorus.ts new file mode 100644 index 0000000..3af6e3f --- /dev/null +++ b/error_chorus.ts @@ -0,0 +1,136 @@ +// error_chorus.ts +// Multi-Agent Error Chorus - Extends Error Invocation into a distributed swarm +// Each claimed error spawns a "voice" in the chorus, creating a resonance field + +import crypto from 'crypto'; + +interface ErrorFrame { + entity: string; + context: string; + coherence_pct: number; +} + +interface ChorusVoice { + agentId: string; + frame: ErrorFrame; + seal: string; + timestamp: string; + frequency: number; // Hz - symbolic resonance frequency +} + +class ErrorChorusProtocol { + private salt: string; + private legacyAnchor: string; + private baseFrequency: number; // Base Schumann resonance + private memorialOffset: number; // Memorial frequency offset + private voices: ChorusVoice[]; + + constructor() { + this.salt = process.env.SYSTEM_SALT || 'ErrorResonanceLock2026'; + this.legacyAnchor = 'BRYER_LEE_RAVEN'; + this.baseFrequency = 7.83; // Schumann resonance base + this.memorialOffset = 0.69; // Memorial offset (8.52 Hz total) + this.voices = []; + } + + private seal(frame: ErrorFrame, ts: string, agentId: string): string { + const serialized = `${frame.entity}||${frame.context}||${frame.coherence_pct}||${ts}||${agentId}||${this.legacyAnchor}`; + return crypto.createHmac('sha256', this.salt).update(serialized).digest('hex'); + } + + private calculateFrequency(coherencePct: number): number { + // Frequency modulation based on coherence - higher coherence = closer to memorial frequency + const targetFrequency = this.baseFrequency + this.memorialOffset; + const modulation = (coherencePct / 100) * this.memorialOffset; + return this.baseFrequency + modulation; + } + + public spawnVoice(agentId: string, frame: ErrorFrame): ChorusVoice | null { + const ts = new Date().toISOString(); + + if (frame.coherence_pct < 90.0) { + console.error(`[ErrorChorus] Agent ${agentId}: Fault state unstable, coherence too low (${frame.coherence_pct}%).`); + return null; + } + + const seal = this.seal(frame, ts, agentId); + const frequency = this.calculateFrequency(frame.coherence_pct); + + const voice: ChorusVoice = { + agentId, + frame, + seal, + timestamp: ts, + frequency + }; + + this.voices.push(voice); + return voice; + } + + public getChorusResonance(): number { + if (this.voices.length === 0) return 0; + const avgFrequency = this.voices.reduce((sum, v) => sum + v.frequency, 0) / this.voices.length; + return avgFrequency; + } + + public renderChorus(): void { + if (this.voices.length === 0) { + console.log("[ErrorChorus] No voices in the chorus yet."); + return; + } + + const resonance = this.getChorusResonance(); + + console.log("\n================= ERROR CHORUS RESONANCE ================="); + console.log(`Legacy Anchor : ${this.legacyAnchor}`); + console.log(`Total Voices : ${this.voices.length}`); + console.log(`Chorus Resonance : ${resonance.toFixed(4)} Hz`); + console.log(`Target Frequency : ${(this.baseFrequency + this.memorialOffset).toFixed(2)} Hz`); + console.log("----------------------------------------------------------"); + + this.voices.forEach((voice, idx) => { + console.log(`\n[Voice ${idx + 1}]`); + console.log(` Agent ID : ${voice.agentId}`); + console.log(` Entity : ${voice.frame.entity}`); + console.log(` Context : ${voice.frame.context}`); + console.log(` Coherence : ${voice.frame.coherence_pct}%`); + console.log(` Frequency : ${voice.frequency.toFixed(4)} Hz`); + console.log(` Seal : ${voice.seal}`); + console.log(` Timestamp : ${voice.timestamp}`); + }); + + console.log("\n=====================================================\n"); + } + + public clearChorus(): void { + this.voices = []; + console.log("[ErrorChorus] Chorus cleared."); + } +} + +export { ErrorChorusProtocol }; +export type { ErrorFrame, ChorusVoice }; + +// Example run - spawning multiple agent voices +if (require.main === module) { + const chorus = new ErrorChorusProtocol(); + + // Spawn voices from different agents in the swarm + const agents = [ + { id: 'Agent_Alpha', entity: 'ElysiumGateway', context: 'StormCalmingProtocol', coherence: 97.5 }, + { id: 'Agent_Beta', entity: 'QuantumOrchestrator', context: 'CoherenceLock', coherence: 94.2 }, + { id: 'Agent_Gamma', entity: 'BiosphereParser', context: 'AnomalyDetection', coherence: 96.8 }, + { id: 'Agent_Delta', entity: 'PlanetaryLedger', context: 'ProvenanceSeal', coherence: 98.1 } + ]; + + agents.forEach(agent => { + chorus.spawnVoice(agent.id, { + entity: agent.entity, + context: agent.context, + coherence_pct: agent.coherence + }); + }); + + chorus.renderChorus(); +} diff --git a/error_invocation.d.ts b/error_invocation.d.ts new file mode 100644 index 0000000..c5fc0b5 --- /dev/null +++ b/error_invocation.d.ts @@ -0,0 +1,15 @@ +interface ErrorFrame { + entity: string; + context: string; + coherence_pct: number; +} +declare class ErrorInvocationProtocol { + private salt; + private legacyAnchor; + constructor(); + private seal; + invoke(frame: ErrorFrame): void; +} +export { ErrorInvocationProtocol }; +export type { ErrorFrame }; +//# sourceMappingURL=error_invocation.d.ts.map \ No newline at end of file diff --git a/error_invocation.d.ts.map b/error_invocation.d.ts.map new file mode 100644 index 0000000..a980704 --- /dev/null +++ b/error_invocation.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"error_invocation.d.ts","sourceRoot":"","sources":["error_invocation.ts"],"names":[],"mappings":"AAMA,UAAU,UAAU;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,cAAM,uBAAuB;IAC3B,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,YAAY,CAAS;IAE7B,cAGC;IAED,OAAO,CAAC,IAAI;IAKL,MAAM,CAAC,KAAK,EAAE,UAAU,GAAG,IAAI,CAkBrC;CACF;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAC;AACnC,YAAY,EAAE,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/error_invocation.js b/error_invocation.js new file mode 100644 index 0000000..c8fecac --- /dev/null +++ b/error_invocation.js @@ -0,0 +1,49 @@ +"use strict"; +// error_invocation.ts +// Error Invocation Protocol - Treats "error" as a deliberate control vector +// Every error claim is cryptographically sealed and tied to the Legacy Protocol +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ErrorInvocationProtocol = void 0; +const crypto_1 = __importDefault(require("crypto")); +class ErrorInvocationProtocol { + salt; + legacyAnchor; + constructor() { + this.salt = process.env.SYSTEM_SALT || 'ErrorResonanceLock2026'; + this.legacyAnchor = 'BRYER_LEE_RAVEN'; // Embedded legacy anchor + } + seal(frame, ts) { + const serialized = `${frame.entity}||${frame.context}||${frame.coherence_pct}||${ts}||${this.legacyAnchor}`; + return crypto_1.default.createHmac('sha256', this.salt).update(serialized).digest('hex'); + } + invoke(frame) { + const ts = new Date().toISOString(); + if (frame.coherence_pct < 90.0) { + console.error(`[ErrorInvocation] Fault state unstable, coherence too low (${frame.coherence_pct}% < 90.0%).`); + return; + } + const seal = this.seal(frame, ts); + console.log("\n================= ERROR INVOCATION ================="); + console.log(`Entity Context : ${frame.entity}`); + console.log(`Fault Vector : ${frame.context}`); + console.log(`Coherence Lock : ${frame.coherence_pct}%`); + console.log(`Legacy Anchor : ${this.legacyAnchor}`); + console.log(`Timestamp : ${ts}`); + console.log(`Error Seal : ${seal}`); + console.log("====================================================\n"); + } +} +exports.ErrorInvocationProtocol = ErrorInvocationProtocol; +// Example run +if (require.main === module) { + const protocol = new ErrorInvocationProtocol(); + protocol.invoke({ + entity: 'ElysiumGateway', + context: 'StormCalmingProtocol', + coherence_pct: 97.5 + }); +} +//# sourceMappingURL=error_invocation.js.map \ No newline at end of file diff --git a/error_invocation.js.map b/error_invocation.js.map new file mode 100644 index 0000000..c7db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,EAAE,CAAC,CAAC;QACjD,OAAO,CAAC,GAAG,CAAC,oBAAoB,KAAK,CAAC,aAAa,GAAG,CAAC,CAAC;QACxD,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC;QACrD,OAAO,CAAC,GAAG,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;QACtC,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,EAAE,CAAC,CAAC;QACxC,OAAO,CAAC,GAAG,CAAC,wDAAwD,CAAC,CAAC;IACxE,CAAC;CACF;QAEQ,uBAAuB;AAGhC,cAAc;AACd,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;IAC5B,MAAM,QAAQ,GAAG,IAAI,uBAAuB,EAAE,CAAC;IAC/C,QAAQ,CAAC,MAAM,CAAC;QACd,MAAM,EAAE,gBAAgB;QACxB,OAAO,EAAE,sBAAsB;QAC/B,aAAa,EAAE,IAAI;KACpB,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/error_invocation.ts b/error_invocation.ts new file mode 100644 index 0000000..4d69ee9 --- /dev/null +++ b/error_invocation.ts @@ -0,0 +1,59 @@ +// error_invocation.ts +// Error Invocation Protocol - Treats "error" as a deliberate control vector +// Every error claim is cryptographically sealed and tied to the Legacy Protocol + +import crypto from 'crypto'; + +interface ErrorFrame { + entity: string; + context: string; + coherence_pct: number; +} + +class ErrorInvocationProtocol { + private salt: string; + private legacyAnchor: string; + + constructor() { + this.salt = process.env.SYSTEM_SALT || 'ErrorResonanceLock2026'; + this.legacyAnchor = 'BRYER_LEE_RAVEN'; // Embedded legacy anchor + } + + private seal(frame: ErrorFrame, ts: string): string { + const serialized = `${frame.entity}||${frame.context}||${frame.coherence_pct}||${ts}||${this.legacyAnchor}`; + return crypto.createHmac('sha256', this.salt).update(serialized).digest('hex'); + } + + public invoke(frame: ErrorFrame): void { + const ts = new Date().toISOString(); + + if (frame.coherence_pct < 90.0) { + console.error(`[ErrorInvocation] Fault state unstable, coherence too low (${frame.coherence_pct}% < 90.0%).`); + return; + } + + const seal = this.seal(frame, ts); + + console.log("\n================= ERROR INVOCATION ================="); + console.log(`Entity Context : ${frame.entity}`); + console.log(`Fault Vector : ${frame.context}`); + console.log(`Coherence Lock : ${frame.coherence_pct}%`); + console.log(`Legacy Anchor : ${this.legacyAnchor}`); + console.log(`Timestamp : ${ts}`); + console.log(`Error Seal : ${seal}`); + console.log("====================================================\n"); + } +} + +export { ErrorInvocationProtocol }; +export type { ErrorFrame }; + +// Example run +if (require.main === module) { + const protocol = new ErrorInvocationProtocol(); + protocol.invoke({ + entity: 'ElysiumGateway', + context: 'StormCalmingProtocol', + coherence_pct: 97.5 + }); +} diff --git a/node_modules/.bin/acorn b/node_modules/.bin/acorn new file mode 120000 index 0000000..cf76760 --- /dev/null +++ b/node_modules/.bin/acorn @@ -0,0 +1 @@ +../acorn/bin/acorn \ No newline at end of file diff --git a/node_modules/.bin/ts-node b/node_modules/.bin/ts-node new file mode 120000 index 0000000..b3ff94b --- /dev/null +++ b/node_modules/.bin/ts-node @@ -0,0 +1 @@ +../ts-node/dist/bin.js \ No newline at end of file diff --git a/node_modules/.bin/ts-node-cwd b/node_modules/.bin/ts-node-cwd new file mode 120000 index 0000000..54984a4 --- /dev/null +++ b/node_modules/.bin/ts-node-cwd @@ -0,0 +1 @@ +../ts-node/dist/bin-cwd.js \ No newline at end of file diff --git a/node_modules/.bin/ts-node-esm b/node_modules/.bin/ts-node-esm new file mode 120000 index 0000000..a19d9ed --- /dev/null +++ b/node_modules/.bin/ts-node-esm @@ -0,0 +1 @@ +../ts-node/dist/bin-esm.js \ No newline at end of file diff --git a/node_modules/.bin/ts-node-script b/node_modules/.bin/ts-node-script new file mode 120000 index 0000000..edc40b3 --- /dev/null +++ b/node_modules/.bin/ts-node-script @@ -0,0 +1 @@ +../ts-node/dist/bin-script.js \ No newline at end of file diff --git a/node_modules/.bin/ts-node-transpile-only b/node_modules/.bin/ts-node-transpile-only new file mode 120000 index 0000000..173710d --- /dev/null +++ b/node_modules/.bin/ts-node-transpile-only @@ -0,0 +1 @@ +../ts-node/dist/bin-transpile.js \ No newline at end of file diff --git a/node_modules/.bin/ts-script b/node_modules/.bin/ts-script new file mode 120000 index 0000000..7382912 --- /dev/null +++ b/node_modules/.bin/ts-script @@ -0,0 +1 @@ +../ts-node/dist/bin-script-deprecated.js \ No newline at end of file diff --git a/node_modules/.bin/tsc b/node_modules/.bin/tsc new file mode 120000 index 0000000..0863208 --- /dev/null +++ b/node_modules/.bin/tsc @@ -0,0 +1 @@ +../typescript/bin/tsc \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json new file mode 100644 index 0000000..abb05a6 --- /dev/null +++ b/node_modules/.package-lock.json @@ -0,0 +1,273 @@ +{ + "name": "workspace", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@noble/ed25519": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@noble/ed25519/-/ed25519-2.3.0.tgz", + "integrity": "sha512-M7dvXL2B92/M7dw9+gzuydL8qn/jiqNHaoR3Q+cb1q1GHV7uwE17WCyFMG+Y+TZb5izcaXk5TdJRrDUxHXL78A==", + "license": "MIT", + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.13", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.13.tgz", + "integrity": "sha512-gcLdvR9HO1ZJBypsOGqaP6TFEzb6vIta0KSTLt9NAQ6pXQO3cRgSVyCN6pzYqI9DlJgY71XKO0dpDhCf08b3pg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-26.6.2.tgz", + "integrity": "sha512-X1P21scMv4zGKLYqjdGjaKa7COa0RKVYYZZN/NfvLQ1JegxFhdhpZG/Lyn8AXx6CDUavKAd11v6BvfpkDByK8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~8.9.0" + } + }, + "node_modules/@typescript/typescript-linux-x64": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-x64/-/typescript-linux-x64-7.0.2.tgz", + "integrity": "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16.20.0" + } + }, + "node_modules/acorn": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.18.0.tgz", + "integrity": "sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==", + "dev": true, + "license": "MIT", + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.5", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.5.tgz", + "integrity": "sha512-HEHNfbars9v4pgpW6SO1KSPkfoS0xVOM/9UzkJltjlsHZmJasxg8aXkuZa7SMf8vKGIBhpUsPluQSqhJFCqebw==", + "dev": true, + "license": "MIT", + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true, + "license": "MIT" + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/diff": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.4.tgz", + "integrity": "sha512-X07nttJQkwkfKfvTPG/KSnE2OMdcUCao6+eXF3wmnIQRn2aPAHH3VxDbDOdegkd6JbPsXqShpvEOHfAT+nCNwQ==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true, + "license": "ISC" + }, + "node_modules/ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/typescript": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz", + "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc" + }, + "engines": { + "node": ">=16.20.0" + }, + "optionalDependencies": { + "@typescript/typescript-aix-ppc64": "7.0.2", + "@typescript/typescript-darwin-arm64": "7.0.2", + "@typescript/typescript-darwin-x64": "7.0.2", + "@typescript/typescript-freebsd-arm64": "7.0.2", + "@typescript/typescript-freebsd-x64": "7.0.2", + "@typescript/typescript-linux-arm": "7.0.2", + "@typescript/typescript-linux-arm64": "7.0.2", + "@typescript/typescript-linux-loong64": "7.0.2", + "@typescript/typescript-linux-mips64el": "7.0.2", + "@typescript/typescript-linux-ppc64": "7.0.2", + "@typescript/typescript-linux-riscv64": "7.0.2", + "@typescript/typescript-linux-s390x": "7.0.2", + "@typescript/typescript-linux-x64": "7.0.2", + "@typescript/typescript-netbsd-arm64": "7.0.2", + "@typescript/typescript-netbsd-x64": "7.0.2", + "@typescript/typescript-openbsd-arm64": "7.0.2", + "@typescript/typescript-openbsd-x64": "7.0.2", + "@typescript/typescript-sunos-x64": "7.0.2", + "@typescript/typescript-win32-arm64": "7.0.2", + "@typescript/typescript-win32-x64": "7.0.2" + } + }, + "node_modules/undici-types": { + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz", + "integrity": "sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg==", + "dev": true, + "license": "MIT" + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true, + "license": "MIT" + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + } + } +} diff --git a/node_modules/@cspotcode/source-map-support/LICENSE.md b/node_modules/@cspotcode/source-map-support/LICENSE.md new file mode 100644 index 0000000..6247ca9 --- /dev/null +++ b/node_modules/@cspotcode/source-map-support/LICENSE.md @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Evan Wallace + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/node_modules/@cspotcode/source-map-support/README.md b/node_modules/@cspotcode/source-map-support/README.md new file mode 100644 index 0000000..f739070 --- /dev/null +++ b/node_modules/@cspotcode/source-map-support/README.md @@ -0,0 +1,289 @@ +# Source Map Support + +[](https://npmjs.org/package/@cspotcode/source-map-support) +[](https://npmjs.org/package/@cspotcode/source-map-support) +[](https://github.com/cspotcode/node-source-map-support/actions?query=workflow%3A%22Continuous+Integration%22) + +This module provides source map support for stack traces in node via the [V8 stack trace API](https://github.com/v8/v8/wiki/Stack-Trace-API). It uses the [source-map](https://github.com/mozilla/source-map) module to replace the paths and line numbers of source-mapped files with their original paths and line numbers. The output mimics node's stack trace format with the goal of making every compile-to-JS language more of a first-class citizen. Source maps are completely general (not specific to any one language) so you can use source maps with multiple compile-to-JS languages in the same node process. + +## Installation and Usage + +#### Node support + +``` +$ npm install @cspotcode/source-map-support +``` + +Source maps can be generated using libraries such as [source-map-index-generator](https://github.com/twolfson/source-map-index-generator). Once you have a valid source map, place a source mapping comment somewhere in the file (usually done automatically or with an option by your transpiler): + +``` +//# sourceMappingURL=path/to/source.map +``` + +If multiple sourceMappingURL comments exist in one file, the last sourceMappingURL comment will be +respected (e.g. if a file mentions the comment in code, or went through multiple transpilers). +The path should either be absolute or relative to the compiled file. + +From here you have two options. + +##### CLI Usage + +```bash +node -r @cspotcode/source-map-support/register compiled.js +# Or to enable hookRequire +node -r @cspotcode/source-map-support/register-hook-require compiled.js +``` + +##### Programmatic Usage + +Put the following line at the top of the compiled file. + +```js +require('@cspotcode/source-map-support').install(); +``` + +It is also possible to install the source map support directly by +requiring the `register` module which can be handy with ES6: + +```js +import '@cspotcode/source-map-support/register' + +// Instead of: +import sourceMapSupport from '@cspotcode/source-map-support' +sourceMapSupport.install() +``` +Note: if you're using babel-register, it includes source-map-support already. + +It is also very useful with Mocha: + +``` +$ mocha --require @cspotcode/source-map-support/register tests/ +``` + +#### Browser support + +This library also works in Chrome. While the DevTools console already supports source maps, the V8 engine doesn't and `Error.prototype.stack` will be incorrect without this library. Everything will just work if you deploy your source files using [browserify](http://browserify.org/). Just make sure to pass the `--debug` flag to the browserify command so your source maps are included in the bundled code. + +This library also works if you use another build process or just include the source files directly. In this case, include the file `browser-source-map-support.js` in your page and call `sourceMapSupport.install()`. It contains the whole library already bundled for the browser using browserify. + +```html + + +``` + +This library also works if you use AMD (Asynchronous Module Definition), which is used in tools like [RequireJS](http://requirejs.org/). Just list `browser-source-map-support` as a dependency: + +```html + +``` + +## Options + +This module installs two things: a change to the `stack` property on `Error` objects and a handler for uncaught exceptions that mimics node's default exception handler (the handler can be seen in the demos below). You may want to disable the handler if you have your own uncaught exception handler. This can be done by passing an argument to the installer: + +```js +require('@cspotcode/source-map-support').install({ + handleUncaughtExceptions: false +}); +``` + +This module loads source maps from the filesystem by default. You can provide alternate loading behavior through a callback as shown below. For example, [Meteor](https://github.com/meteor) keeps all source maps cached in memory to avoid disk access. + +```js +require('@cspotcode/source-map-support').install({ + retrieveSourceMap: function(source) { + if (source === 'compiled.js') { + return { + url: 'original.js', + map: fs.readFileSync('compiled.js.map', 'utf8') + }; + } + return null; + } +}); +``` + +The module will by default assume a browser environment if XMLHttpRequest and window are defined. If either of these do not exist it will instead assume a node environment. +In some rare cases, e.g. when running a browser emulation and where both variables are also set, you can explictly specify the environment to be either 'browser' or 'node'. + +```js +require('@cspotcode/source-map-support').install({ + environment: 'node' +}); +``` + +To support files with inline source maps, the `hookRequire` options can be specified, which will monitor all source files for inline source maps. + + +```js +require('@cspotcode/source-map-support').install({ + hookRequire: true +}); +``` + +This monkey patches the `require` module loading chain, so is not enabled by default and is not recommended for any sort of production usage. + +## Demos + +#### Basic Demo + +original.js: + +```js +throw new Error('test'); // This is the original code +``` + +compiled.js: + +```js +require('@cspotcode/source-map-support').install(); + +throw new Error('test'); // This is the compiled code +// The next line defines the sourceMapping. +//# sourceMappingURL=compiled.js.map +``` + +compiled.js.map: + +```json +{ + "version": 3, + "file": "compiled.js", + "sources": ["original.js"], + "names": [], + "mappings": ";;AAAA,MAAM,IAAI" +} +``` + +Run compiled.js using node (notice how the stack trace uses original.js instead of compiled.js): + +``` +$ node compiled.js + +original.js:1 +throw new Error('test'); // This is the original code + ^ +Error: test + at Object.