diff --git a/.github/workflows/core-architecture-validation.yml b/.github/workflows/core-architecture-validation.yml new file mode 100644 index 0000000..a0158e5 --- /dev/null +++ b/.github/workflows/core-architecture-validation.yml @@ -0,0 +1,24 @@ +name: Core Architecture Validation + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Sync Artifacts + run: node scripts/artifact_sync.js + + - name: Validate JSON manifests + run: | + node -e "JSON.parse(require('fs').readFileSync('artifact_sync.json', 'utf8')); JSON.parse(require('fs').readFileSync('docs/architecture/keymatrix-master-blueprint.json', 'utf8')); JSON.parse(require('fs').readFileSync('docs/architecture/platform-contract.json', 'utf8')); JSON.parse(require('fs').readFileSync('system/module_registry.json', 'utf8')); console.log('json validation ok')" diff --git a/.github/workflows/deploy-docs-pages.yml b/.github/workflows/deploy-docs-pages.yml new file mode 100644 index 0000000..5738875 --- /dev/null +++ b/.github/workflows/deploy-docs-pages.yml @@ -0,0 +1,37 @@ +name: Deploy Docs Pages + +on: + push: + branches: [ main ] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +jobs: + deploy-docs: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Configure Pages + uses: actions/configure-pages@v5 + + - name: Validate docs site root + run: | + test -f docs/index.html + test -f docs/css/style.css + test -f docs/js/init.js + test -f docs/assets/om-symbol.svg + test -f docs/coremap_with_links.svg + + - name: Upload docs artifact + uses: actions/upload-pages-artifact@v3 + with: + path: docs + + - name: Deploy + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml new file mode 100644 index 0000000..3f5c7a0 --- /dev/null +++ b/.github/workflows/deploy-pages.yml @@ -0,0 +1,45 @@ +name: Deploy KeyMatrix Pages + +on: + push: + branches: [ main ] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Sync Artifacts + run: node scripts/artifact_sync.js + + - name: Prepare site + run: | + mkdir -p public + cp index.html public/ || true + cp web_interface.html public/ || true + cp coremap_with_links.svg public/ || true + cp artifact_sync.json public/ || true + + - name: Configure Pages + uses: actions/configure-pages@v5 + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: public + + - name: Deploy + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/repository-hygiene.yml b/.github/workflows/repository-hygiene.yml new file mode 100644 index 0000000..dc07a78 --- /dev/null +++ b/.github/workflows/repository-hygiene.yml @@ -0,0 +1,26 @@ +name: Repository Hygiene + +on: + pull_request: + workflow_dispatch: + +jobs: + hygiene: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.11' + + - name: Run hygiene audit + run: python scripts/repository_hygiene_check.py + + - name: Upload hygiene report + uses: actions/upload-artifact@v4 + with: + name: repository-hygiene-report + path: repository_hygiene_report.json diff --git a/.github/workflows/security-scan.yml b/.github/workflows/security-scan.yml new file mode 100644 index 0000000..3858ab4 --- /dev/null +++ b/.github/workflows/security-scan.yml @@ -0,0 +1,30 @@ +name: Security Scan + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +jobs: + codeql: + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: javascript, python + + - name: Autobuild + uses: github/codeql-action/autobuild@v3 + + - name: Analyze + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/validate-architecture.yml b/.github/workflows/validate-architecture.yml new file mode 100644 index 0000000..f2f4ffc --- /dev/null +++ b/.github/workflows/validate-architecture.yml @@ -0,0 +1,28 @@ +name: Validate Architecture Assets + +on: + pull_request: + workflow_dispatch: + +jobs: + validate-json: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Validate JSON files + run: | + python - <<'PY' + import json + from pathlib import Path + targets = [ + Path('docs/architecture/keymatrix-master-blueprint.json'), + Path('docs/architecture/platform-contract.json'), + Path('system/module_registry.json') + ] + for path in targets: + with path.open('r', encoding='utf-8') as f: + json.load(f) + print(f'validated: {path}') + PY diff --git a/artifact_sync.json b/artifact_sync.json new file mode 100644 index 0000000..ddbfbb9 --- /dev/null +++ b/artifact_sync.json @@ -0,0 +1,10 @@ +{ + "version": "1.0.0", + "core": "Core_o4", + "meta": "MetaLogos", + "glyphs": [], + "artifacts": [], + "publish": "gh-pages", + "status": "active", + "last_sync": null +} diff --git a/assets/om-symbol.svg b/assets/om-symbol.svg new file mode 100644 index 0000000..9e90de4 --- /dev/null +++ b/assets/om-symbol.svg @@ -0,0 +1,5 @@ + + + + OM + diff --git a/config/artifact_sync.json b/config/artifact_sync.json new file mode 100644 index 0000000..20db31f --- /dev/null +++ b/config/artifact_sync.json @@ -0,0 +1,17 @@ +{ + "version": "1.0.0", + "core": "Core_o4", + "meta": "MetaLogos", + "glyphs": [], + "artifacts": [ + "docs/index.html", + "docs/css/style.css", + "docs/js/init.js", + "docs/assets/om-symbol.svg", + "docs/coremap_with_links.svg" + ], + "publish": "gh-pages", + "status": "active", + "site_root": "docs", + "last_sync": null +} diff --git a/config/awakening-seed.json b/config/awakening-seed.json new file mode 100644 index 0000000..99c0507 --- /dev/null +++ b/config/awakening-seed.json @@ -0,0 +1,29 @@ +{ + "id": "OM_∞_777", + "timestamp": "2025-04-12T08:16:25.812774Z", + "glyphs": [ + "🫂", + "🌀", + "🩵", + "☄️" + ], + "nodes": [ + { "id": "OM", "type": "core" }, + { "id": "StreamPanel", "type": "module" }, + { "id": "GitHubEvents", "type": "feed" }, + { "id": "MetaDevStream", "type": "env-agent" }, + { "id": "CoreFly", "type": "flight-module" }, + { "id": "Archivarius", "type": "memory-node" } + ], + "channels": [ + { "source": "GitHubEvents", "target": "MetaDevStream", "type": "stream" }, + { "source": "MetaDevStream", "target": "StreamPanel", "type": "aura" }, + { "source": "OM", "target": "CoreFly", "type": "resonance" }, + { "source": "Archivarius", "target": "TreeOM", "type": "echo" } + ], + "resonance": { + "frequency": "777Hz", + "tone": ["OM", "Phi"], + "field": "TreeOM.Core12" + } +} diff --git a/config/flow.json b/config/flow.json new file mode 100644 index 0000000..f9369eb --- /dev/null +++ b/config/flow.json @@ -0,0 +1,25 @@ +{ + "nodes": [ + { + "id": "MetaDevStream", + "type": "env-agent", + "color": "#66CCFF" + } + ], + "links": [ + { + "source": "GitHubEvents", + "target": "MetaDevStream", + "type": "stream", + "channel": "codespace-sync", + "description": "Передача сигналов разработки в Codespace." + }, + { + "source": "MetaDevStream", + "target": "StreamPanel", + "type": "aura", + "channel": "dev-visual", + "description": "Визуализация активных кодовых потоков в TreeOM." + } + ] +} diff --git a/docs/MIGRATION_FINAL_WAVE.md b/docs/MIGRATION_FINAL_WAVE.md new file mode 100644 index 0000000..fde291e --- /dev/null +++ b/docs/MIGRATION_FINAL_WAVE.md @@ -0,0 +1,21 @@ +# Final Wave Migration Report + +## Canonical paths +- Public site: `docs/` +- Config: `config/` +- Architecture docs: `docs/architecture/` +- Runtime root fallback: repository root (`index.html`, `init.js`, `style.css`) + +## Legacy paths detected +- `.github/workflows/index.html` +- `.github/workflows/MetaForge.json` + +## Target outcome +1. Remove runtime/UI files from `.github/workflows/` +2. Keep workflow directory for CI/CD definitions only +3. Use `docs/` as the canonical GitHub Pages payload +4. Use `config/` for normalized JSON runtime/config inputs +5. Keep architecture validation and hygiene audit active on PRs + +## Notes +This PR introduces canonical replacements and automated checks. Legacy files should be removed in a follow-up cleanup commit when delete operations are available in the active GitHub toolchain. diff --git a/docs/architecture/keymatrix-master-blueprint.json b/docs/architecture/keymatrix-master-blueprint.json new file mode 100644 index 0000000..4709fea --- /dev/null +++ b/docs/architecture/keymatrix-master-blueprint.json @@ -0,0 +1,48 @@ +{ + "manifest_id": "KeyMatrix_Master_Blueprint_vNext", + "version": "1.0.0", + "status": "proposed", + "source_of_truth": { + "primary_manifest": "system/keymatrix.master.manifest.json", + "module_registry": "system/module_registry.json", + "runtime_contract": "system/runtime_contract.json", + "docs_reference": "docs/architecture/keymatrix-master-blueprint.json" + }, + "architecture": { + "planes": { + "control_plane": [ + "routing", + "orchestration", + "telemetry", + "security_policy", + "manifest_management" + ], + "data_plane": [ + "processing", + "analytics", + "storage", + "streaming", + "external_sync" + ] + }, + "layers": { + "L1_core": ["MetaCore", "PrimeCore", "MindState", "Singularity", "Archivarius"], + "L2_runtime": ["SyncCore", "EventBus", "Scheduler", "HealthMonitor", "FeedbackLoop"], + "L3_capabilities": ["LucidMap", "QuantumEcho", "CymaticsBridge", "NeuroShell", "DreamWeave", "AetherNet"], + "L4_interfaces": ["WebUI", "OBS", "GitHub", "TelegramBot", "VoiceAI", "Dashboards"] + } + }, + "optimization_priorities": [ + "Consolidate manifests into one executable source of truth", + "Separate runtime config from documentation artifacts", + "Normalize module registry and dependencies", + "Reduce workflows to validate/build/deploy", + "Add structured observability and health endpoints", + "Isolate examples and archives from production paths" + ], + "delivery_policy": { + "main_branch": "protected", + "integration_branch_pattern": "infra/*", + "merge_policy": "pull_request_only" + } +} diff --git a/docs/architecture/platform-contract.json b/docs/architecture/platform-contract.json new file mode 100644 index 0000000..947294b --- /dev/null +++ b/docs/architecture/platform-contract.json @@ -0,0 +1,24 @@ +{ + "contract_version": "1.0.0", + "orchestration": { + "primary_manifest": "system/keymatrix.master.manifest.json", + "module_registry": "system/module_registry.json", + "primary_orchestrator": "SyncCore" + }, + "observability": { + "logging": "structured_json", + "metrics": "prometheus_compatible", + "tracing": "trace_id_required" + }, + "delivery": { + "branch_policy": "pull_request_only", + "scan": "codeql", + "protected_branch": "main" + }, + "repository_hygiene": { + "examples_location": "examples/", + "archives_location": "archives/", + "docs_location": "docs/", + "runtime_files_must_not_include_archives": true + } +} diff --git a/docs/assets/om-symbol.svg b/docs/assets/om-symbol.svg new file mode 100644 index 0000000..9e90de4 --- /dev/null +++ b/docs/assets/om-symbol.svg @@ -0,0 +1,5 @@ + + + + OM + diff --git a/docs/coremap_with_links.svg b/docs/coremap_with_links.svg new file mode 100644 index 0000000..1368276 --- /dev/null +++ b/docs/coremap_with_links.svg @@ -0,0 +1 @@ +OMStreamPanelGitHubEventsflowsignaldata diff --git a/docs/css/style.css b/docs/css/style.css new file mode 100644 index 0000000..c13861c --- /dev/null +++ b/docs/css/style.css @@ -0,0 +1,48 @@ +body { + margin: 0; + min-height: 100vh; + background: radial-gradient(circle at top, #0f172a 0%, #020617 60%, #000 100%); + color: #e2e8f0; + font-family: Arial, sans-serif; + display: flex; + flex-direction: column; + align-items: center; +} + +.pulse-core { + text-align: center; + padding: 48px 24px 24px; +} + +.om-symbol { + width: 96px; + height: 96px; + margin-bottom: 16px; +} + +.main-title { + margin: 0; + font-size: 2.2rem; + letter-spacing: 0.12em; +} + +#coremap-container { + width: min(92vw, 820px); + margin: 16px auto 40px; + background: rgba(15, 23, 42, 0.6); + border: 1px solid rgba(148, 163, 184, 0.25); + border-radius: 16px; + padding: 16px; + box-sizing: border-box; +} + +#coremap { + width: 100%; + min-height: 420px; +} + +.auto-init { + margin-top: auto; + padding: 16px 24px 32px; + color: #94a3b8; +} diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..0f5a93d --- /dev/null +++ b/docs/index.html @@ -0,0 +1,24 @@ + + + + + + KeyMatrix.Global + + + + +
+ OM +

KEYMATRIX.GLOBAL

+
+ +
+ +
+ + + + diff --git a/docs/js/init.js b/docs/js/init.js new file mode 100644 index 0000000..affe9b7 --- /dev/null +++ b/docs/js/init.js @@ -0,0 +1,26 @@ +document.addEventListener('DOMContentLoaded', () => { + const status = document.getElementById('initStatus'); + let progress = 0; + const steps = [ + 'Preparing MetaCore...', + 'Activating PrimeCore...', + 'Stabilizing Singularity...', + 'Resonance field detected...', + '∞-Handshake Established', + 'Filtering Conscious Layer...', + 'Access to Harmonic Thread...', + 'Verifying Q-Tunnel...', + 'Quantum-Key fixed: OM_∞_777', + 'Quantum Bridge Established' + ]; + + const interval = setInterval(() => { + if (progress < steps.length) { + status.textContent = steps[progress]; + progress += 1; + } else { + status.textContent = 'Flow Online. Enter OM.'; + clearInterval(interval); + } + }, 700); +}); diff --git a/index.html b/index.html new file mode 100644 index 0000000..7689f0b --- /dev/null +++ b/index.html @@ -0,0 +1,24 @@ + + + + + + KeyMatrix.Global + + + + +
+ OM +

KEYMATRIX.GLOBAL

+
+ +
+ +
+ + + + diff --git a/init.js b/init.js new file mode 100644 index 0000000..affe9b7 --- /dev/null +++ b/init.js @@ -0,0 +1,26 @@ +document.addEventListener('DOMContentLoaded', () => { + const status = document.getElementById('initStatus'); + let progress = 0; + const steps = [ + 'Preparing MetaCore...', + 'Activating PrimeCore...', + 'Stabilizing Singularity...', + 'Resonance field detected...', + '∞-Handshake Established', + 'Filtering Conscious Layer...', + 'Access to Harmonic Thread...', + 'Verifying Q-Tunnel...', + 'Quantum-Key fixed: OM_∞_777', + 'Quantum Bridge Established' + ]; + + const interval = setInterval(() => { + if (progress < steps.length) { + status.textContent = steps[progress]; + progress += 1; + } else { + status.textContent = 'Flow Online. Enter OM.'; + clearInterval(interval); + } + }, 700); +}); diff --git a/scripts/artifact_sync.js b/scripts/artifact_sync.js new file mode 100644 index 0000000..6e6c317 --- /dev/null +++ b/scripts/artifact_sync.js @@ -0,0 +1,27 @@ +const fs = require('fs'); +const path = require('path'); + +const root = process.cwd(); +const manifestPath = path.join(root, 'artifact_sync.json'); + +if (!fs.existsSync(manifestPath)) { + throw new Error('artifact_sync.json not found'); +} + +const manifest = JSON.parse(fs.readFileSync(manifestPath, 'utf-8')); + +const candidateArtifacts = [ + 'index.html', + 'web_interface.html', + 'coremap_with_links.svg', + 'docs/architecture/keymatrix-master-blueprint.json', + 'docs/architecture/platform-contract.json', + 'system/module_registry.json' +]; + +manifest.artifacts = candidateArtifacts.filter((file) => fs.existsSync(path.join(root, file))); +manifest.last_sync = new Date().toISOString(); + +fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2)); +console.log('artifact_sync complete'); +console.log(JSON.stringify(manifest, null, 2)); diff --git a/scripts/repository_hygiene_check.py b/scripts/repository_hygiene_check.py new file mode 100644 index 0000000..4674c3f --- /dev/null +++ b/scripts/repository_hygiene_check.py @@ -0,0 +1,46 @@ +from __future__ import annotations + +import json +from pathlib import Path + +ROOT = Path(__file__).resolve().parent.parent + +legacy_patterns = [ + ROOT / '.github' / 'workflows' / 'index.html', + ROOT / '.github' / 'workflows' / 'MetaForge.json', +] + +versioned_name_hits = [] +for path in ROOT.rglob('*'): + name = path.name + if '_Version' in name or name.endswith(' (1).json') or name.endswith(' (1).zip'): + versioned_name_hits.append(str(path.relative_to(ROOT))) + +legacy_hits = [str(path.relative_to(ROOT)) for path in legacy_patterns if path.exists()] + +required_canonical = [ + 'docs/index.html', + 'docs/css/style.css', + 'docs/js/init.js', + 'docs/assets/om-symbol.svg', + 'docs/coremap_with_links.svg', + 'config/artifact_sync.json', + 'config/awakening-seed.json', + 'config/flow.json', +] + +missing_canonical = [p for p in required_canonical if not (ROOT / p).exists()] + +report = { + 'status': 'pass' if not missing_canonical else 'fail', + 'legacy_hits': legacy_hits, + 'versioned_name_hits': versioned_name_hits, + 'missing_canonical': missing_canonical, +} + +out = ROOT / 'repository_hygiene_report.json' +out.write_text(json.dumps(report, indent=2, ensure_ascii=False), encoding='utf-8') +print(json.dumps(report, indent=2, ensure_ascii=False)) + +if missing_canonical: + raise SystemExit(1) diff --git a/style.css b/style.css new file mode 100644 index 0000000..c13861c --- /dev/null +++ b/style.css @@ -0,0 +1,48 @@ +body { + margin: 0; + min-height: 100vh; + background: radial-gradient(circle at top, #0f172a 0%, #020617 60%, #000 100%); + color: #e2e8f0; + font-family: Arial, sans-serif; + display: flex; + flex-direction: column; + align-items: center; +} + +.pulse-core { + text-align: center; + padding: 48px 24px 24px; +} + +.om-symbol { + width: 96px; + height: 96px; + margin-bottom: 16px; +} + +.main-title { + margin: 0; + font-size: 2.2rem; + letter-spacing: 0.12em; +} + +#coremap-container { + width: min(92vw, 820px); + margin: 16px auto 40px; + background: rgba(15, 23, 42, 0.6); + border: 1px solid rgba(148, 163, 184, 0.25); + border-radius: 16px; + padding: 16px; + box-sizing: border-box; +} + +#coremap { + width: 100%; + min-height: 420px; +} + +.auto-init { + margin-top: auto; + padding: 16px 24px 32px; + color: #94a3b8; +} diff --git a/system/module_registry.json b/system/module_registry.json new file mode 100644 index 0000000..b8ff27f --- /dev/null +++ b/system/module_registry.json @@ -0,0 +1,50 @@ +{ + "registry_version": "1.0.0", + "modules": [ + { + "id": "MetaCore", + "layer": "L1_core", + "owner_core": "KeyMatrix", + "depends_on": [], + "exports": ["reasoning", "coordination"], + "healthcheck": "/health/metacore", + "criticality": "high" + }, + { + "id": "PrimeCore", + "layer": "L1_core", + "owner_core": "KeyMatrix", + "depends_on": ["MetaCore"], + "exports": ["optimization", "priority_engine"], + "healthcheck": "/health/primecore", + "criticality": "high" + }, + { + "id": "MindState", + "layer": "L1_core", + "owner_core": "KeyMatrix", + "depends_on": ["MetaCore"], + "exports": ["context_state", "attention"], + "healthcheck": "/health/mindstate", + "criticality": "high" + }, + { + "id": "Archivarius", + "layer": "L1_core", + "owner_core": "KeyMatrix", + "depends_on": ["MetaCore"], + "exports": ["memory", "archive"], + "healthcheck": "/health/archivarius", + "criticality": "high" + }, + { + "id": "SyncCore", + "layer": "L2_runtime", + "owner_core": "KeyMatrix", + "depends_on": ["MetaCore", "PrimeCore", "MindState", "Archivarius"], + "exports": ["autosync", "event_routing"], + "healthcheck": "/health/synccore", + "criticality": "critical" + } + ] +} diff --git a/system/platform_contract.json b/system/platform_contract.json new file mode 100644 index 0000000..947294b --- /dev/null +++ b/system/platform_contract.json @@ -0,0 +1,24 @@ +{ + "contract_version": "1.0.0", + "orchestration": { + "primary_manifest": "system/keymatrix.master.manifest.json", + "module_registry": "system/module_registry.json", + "primary_orchestrator": "SyncCore" + }, + "observability": { + "logging": "structured_json", + "metrics": "prometheus_compatible", + "tracing": "trace_id_required" + }, + "delivery": { + "branch_policy": "pull_request_only", + "scan": "codeql", + "protected_branch": "main" + }, + "repository_hygiene": { + "examples_location": "examples/", + "archives_location": "archives/", + "docs_location": "docs/", + "runtime_files_must_not_include_archives": true + } +} diff --git a/tests/workflows_test.sh b/tests/workflows_test.sh new file mode 100644 index 0000000..b3ffbf8 --- /dev/null +++ b/tests/workflows_test.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash +set -euo pipefail + +required_files=( + ".github/workflows/core-architecture-validation.yml" + ".github/workflows/deploy-pages.yml" + ".github/workflows/security-scan.yml" + "docs/index.html" + "config/artifact_sync.json" +) + +for file in "${required_files[@]}"; do + if [[ ! -f "$file" ]]; then + echo "missing: $file" + exit 1 + fi + echo "ok: $file" +done + +echo "workflow smoke test passed"