Skip to content

Add Post-Quantum Cryptography (PQC) security layer for MurphyOS#560

Draft
Copilot wants to merge 32 commits intomainfrom
copilot/create-linux-for-murphy-stack
Draft

Add Post-Quantum Cryptography (PQC) security layer for MurphyOS#560
Copilot wants to merge 32 commits intomainfrom
copilot/create-linux-for-murphy-stack

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 12, 2026

  • Explore existing codebase patterns (HTML, CSS, JS, backend, SSE, LLM provider)
  • Create Murphy System/src/chat_store.py — conversation state & history
  • Create Murphy System/src/chat_router.py — intent detection & routing
  • Create Murphy System/static/murphy-chat.css — chat-specific styles (750+ lines, 126 CSS rules)
  • Create Murphy System/static/murphy-chat.js — chat frontend logic (730+ lines)
  • Create Murphy System/static/murphy-chat.html — three-panel responsive layout
  • Wire 6 backend endpoints in Murphy System/src/runtime/app.py (chat API + page route)
  • Copy new files to root src/ and static/ per canonical source rules
  • Run module tests — all pass
  • Security review — XSS protection (escHtml), input sanitization (50k char cap), no eval/exec/shell

Copilot AI and others added 9 commits April 12, 2026 00:19
Create the murphy-kmod kernel module providing:
- /dev/murphy-event: character device for writing JSON events to Murphy
  event bus via ring buffer
- /dev/murphy-confidence: read-only device for live MFGC confidence score
- /sys/murphy/gates/: sysfs entries for 6 governance gates
  (EXECUTIVE/OPERATIONS/QA/HITL/COMPLIANCE/BUDGET)
- NF_INET_LOCAL_OUT netfilter hook for Murphy-aware packet classification
- ioctl interface for userspace daemon control

Files added:
  murphyos/kernel/murphy-kmod/murphy_kmod.h       - shared header/ioctl defs
  murphyos/kernel/murphy-kmod/murphy_kmod.c        - main module source
  murphyos/kernel/murphy-kmod/murphy_netfilter.c   - netfilter hooks
  murphyos/kernel/murphy-kmod/Makefile              - obj-m kernel build
  murphyos/kernel/murphy-kmod/dkms.conf             - DKMS auto-rebuild
  murphyos/kernel/murphy-kmod/README.md             - build/install docs

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
Add the full set of systemd integration files for MurphyOS:

- murphy-system.service: Core runtime with sd_notify, security hardening
- murphy-bus.socket: Unix domain socket for zero-latency IPC
- murphy-watchdog.service: Self-Healing Coordinator watchdog
- murphy-session@.service: Per-user session template (user-%i.slice)
- murphy-system-generator: Boot-time engine service generator
- murphy-watchdog: Health-check shell script (/usr/lib/murphy/)
- murphy-tmpfiles.conf: Runtime and persistent directory creation
- murphy-sysusers.conf: murphy user/group creation
- README.md: Installation instructions and architecture overview

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
Add the murphy-dbus userspace module that exposes the Murphy REST API
as native Linux D-Bus services:

- org.murphy.System.conf: D-Bus bus policy (ownership + method ACLs)
- org.murphy.System.service: D-Bus service activation file
- murphy-dbus.service: systemd unit for the bridge daemon
- murphy_dbus_service.py: async Python bridge (dbus-next + aiohttp)
- org.murphy.System.xml: full introspection XML for all 5 interfaces
- org.murphy.policy: Polkit action definitions (HITL, engine, swarm, forge)
- org.murphy.rules: confidence-aware Polkit JS rules
- README.md: installation, architecture, and usage documentation

Interfaces: ControlPlane, Confidence, HITL, Swarm, Forge

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
Address code review feedback:
- Use Inoni-Limited/Murphy-System URL consistently
- Add /murphy/live to ReadWritePaths for confidence score writes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
udev (murphyos/userspace/murphy-udev/):
- 90-murphy.rules: auto-register USB serial, IoT, GPU, network, block
  devices and set Murphy char-device permissions
- murphy-device-register: register IoT USB devices via /dev/murphy-event
  or HTTP fallback
- murphy-gpu-register: detect GPU vendor and notify Compute Plane
- murphy-net-register: register network interfaces with Event Backbone

PAM (murphyos/userspace/murphy-pam/):
- pam_murphy.c: session open/close via Murphy API, paranoid-mode HITL
  gate for sudo when confidence < 0.50, fail-open on Murphy downtime
- Makefile: builds pam_murphy.so with -lpam -lcurl
- pam.conf: default config (standard safety, localhost:8000, 5s timeout)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
Escape special characters (quotes, backslashes, control chars) before
embedding user-supplied values in JSON payloads to prevent malformed
JSON and injection attacks.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
Implements a complete PQC subsystem using NIST-standardized algorithms:

Kernel layer (murphyos/security/quantum/kernel/):
- murphy_pqc_kmod.c: HMAC-SHA3-256 event authentication on /dev/murphy-event
- murphy_pqc_kmod.h: ioctl definitions for key management
- Makefile: kernel module build system

Userspace library (murphyos/security/quantum/userspace/):
- murphy_pqc.py: ML-KEM-1024 (Kyber), ML-DSA-87 (Dilithium),
  SLH-DSA-SHA2-256f (SPHINCS+), hybrid mode, AES-256-GCM,
  HKDF-SHA3-256, SHAKE-256 session tokens
- murphy_pqc_keymanager.py: key generation/rotation daemon with
  ioctl kernel push and fleet distribution
- murphy_pqc_tls.py: hybrid TLS wrapper with PQC certificate authority
- murphy_pqc_tokens.py: ML-DSA-87 signed session tokens replacing JWT

Secure boot (murphyos/security/quantum/boot/):
- murphy_secureboot.py: runtime integrity verification with SPHINCS+
- murphy_manifest_sign.py: build-time manifest signing tool
- verify_chain.sh: early-boot verification script

Configuration (murphyos/security/quantum/):
- pqc.yaml: algorithm selection, key rotation, storage paths
- murphy-pqc-keymanager.service: hardened systemd unit
- README.md: architecture docs, threat model, upgrade path

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
…ICENSE

- murphy_pqc_tls.py: Change wrap_murphy_server return type to ssl.SSLContext
- murphy_pqc_tls.py: Store PQC cert signature as detached .pqc.sig file
- murphy_pqc_kmod.c: Use GPL MODULE_LICENSE for kernel module compatibility

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
Copilot AI and others added 3 commits April 12, 2026 01:01
Add murphyos/userspace/murphyfs/:
- murphyfs.py: Python FUSE filesystem exposing Murphy state as files
  (confidence, engines, swarm, gates, events, system)
- murphy-murphyfs.service: systemd unit with security hardening
- README.md

Add murphyos/userspace/murphy-cli/:
- murphy_cli.py: comprehensive CLI with D-Bus/REST/filesystem fallback
  (status, forge, swarm, gate, engine, log, confidence, config, pqc, version)
- murphy-completion.bash: Bash tab completion
- setup.py: package with console_scripts entry point
- README.md

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
…ITL, Forge)

Adds the GNOME Shell 45+ extension with:
- Panel confidence indicator with colour-coded bands
- D-Bus HITL approval notification with Approve/Deny actions
- Forge command entry and build progress notifications
- PQC lock indicator
- Adw preferences page
- Stylesheet for indicator, PQC lock, and forge entry

Remaining components (file-manager plugin, nftables, DNS resolver,
GSettings schema) to follow in subsequent commits.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
Implements the full MurphyOS plan with post-quantum cryptography:
- Kernel module (event bus, confidence device, sysfs gates, netfilter, PQC HMAC-SHA3)
- Systemd integration (service, socket, watchdog, per-user sessions, generator)
- D-Bus bridge (5 interfaces: ControlPlane, Confidence, HITL, Swarm, Forge)
- Post-quantum crypto (ML-KEM-1024, ML-DSA-87, SLH-DSA, hybrid mode, key manager, PQC TLS, secure boot)
- FUSE filesystem (murphyfs), Murphy CLI (20+ subcommands)
- udev rules, PAM module, Polkit policies, nftables, DNS resolver
- GNOME Shell extension, Nautilus plugin
- Debian packaging, AppArmor security profiles

Agent-Logs-Url: https://github.com/IKNOWINOT/Murphy-System/sessions/955df6d6-7c74-4e26-b1b6-cd923273dc1a

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
Copilot AI and others added 4 commits April 13, 2026 04:32
Add MODULE-SUBSYSTEM-ERR-NNN error codes to every except block
across 10 murphyos Python modules, following the existing convention.

Changes per file:
- murphy-nautilus.py: 2 excepts labeled (MURPHY-NAUTILUS-ERR-001..002)
- murphy_dbus_service.py: 3 excepts labeled (MURPHY-DBUS-ERR-001..003)
- murphy_resolved.py: 3 excepts labeled (MURPHY-RESOLVED-ERR-001..003)
- murphy_cli.py: 14 excepts labeled (MURPHY-CLI-ERR-001..014), added logging import
- murphy_secureboot.py: 4 excepts labeled (MURPHY-SECBOOT-ERR-001..004)
- murphy_manifest_sign.py: 1 except labeled (MURPHY-MANIFEST-ERR-001)
- murphy_pqc_keymanager.py: 6 excepts labeled (MURPHY-PQC-ERR-101..106)
- murphy_pqc.py: 3 excepts labeled (MURPHY-PQC-ERR-002,003,041)
- murphy_pqc_tls.py: 1 except labeled (MURPHY-PQC-ERR-203)
- murphyfs.py: 8 excepts labeled (MURPHYFS-ERR-007..014)

Each file includes an error-code registry comment block at the top.
All error codes appear both as comments on except lines and in logger messages.
No logic changes — only error labels, logging, and registry comments added.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
Add 11 files under murphyos/security/auto-hardening/:
- AutoEncryptEngine: AES-256-GCM file encryption with MFSE header
- AutoPatchEngine: self-updating with btrfs/LVM/tar rollback
- MemoryProtectionEngine: ASLR, stack protection, W^X, mlock
- NetworkSentinel: heuristic scoring, nftables auto-block, DNS exfil
- CredentialVault: encrypted secrets, per-user ACL, auto-rotation
- IntegrityMonitor: SHA3-256 baselines, quarantine & restore
- AutoSecOrchestrator: master coordinator with posture scoring
- systemd unit, YAML config, README

All engines degrade gracefully, use labeled MURPHY-AUTOSEC-ERR codes,
and never block legitimate work.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
- 12 test files covering all security engines, CLI, FUSE FS, and PQC
- 121 tests, all passing with mocked system dependencies
- conftest.py with PYTHONPATH setup and shared fixtures
- README.md with architecture diagram, security philosophy, directory map
- ERROR-CODES.md catalog of all MURPHY-*-ERR-* codes across 19 modules

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
…ow logs or re-raises

Agent-Logs-Url: https://github.com/IKNOWINOT/Murphy-System/sessions/48988dc7-5a65-49b7-b273-49c39cd8492d

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
Copilot AI and others added 9 commits April 14, 2026 00:11
Add murphy-cgroup module under murphyos/userspace/ providing OS-level
resource isolation for Murphy System workloads via Linux cgroups v2.

Files:
- murphy_cgroup_manager.py — CGroupManager class with create/destroy/
  list/get_usage/set_limits/cleanup_orphans, no-op graceful degradation,
  15 error codes, daemon mode with sd_notify, and CLI
- murphy-cgroup.service — systemd Type=notify unit with security hardening
- cgroup.yaml — default configuration for swarm/llm/automation workloads
- README.md — usage guide, hierarchy diagram, error code reference

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
Add murphy-journal module to bridge Murphy Event Backbone events to
systemd-journald structured fields. Includes:

- murphy_journal.py: MurphyJournal class with native python-systemd
  and logger(1) fallback backends
- murphy-journal.conf: journald namespace configuration (90-day
  retention, rate limiting)
- murphy.catalog: journal catalog entries for journalctl --catalog
- murphy-journal.service: systemd unit for the bridge daemon
- README.md: usage, field reference, and query examples

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
Add OS-level backup/disaster recovery module at
murphyos/userspace/murphy-backup/ with:

- murphy_backup.py: MurphyBackup class with create, restore, list,
  prune, verify, and export operations. Auto-detects backup strategy
  (btrfs → LVM → restic → tar). Includes database dump support for
  PostgreSQL (pg_dump) and SQLite (file copy), SHA3-256 manifest
  verification, pre/post hooks, and 15 typed error codes.

- murphy-backup.service: systemd oneshot unit for manual/timer backups
  with security hardening (ProtectSystem=strict, NoNewPrivileges, etc.)

- murphy-backup.timer: daily backup at 03:00 UTC with 15min jitter

- backup.yaml: configuration with retention policy, targets, hooks,
  and PQC encryption settings

- README.md: strategy comparison, restore procedures, error code table

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
Add OS-level governance for LLM workloads at
murphyos/userspace/murphy-llm-governor/ with:

- murphy_llm_governor.py: Token budget tracking, token-bucket rate
  limiting, GPU memory governance (nvidia-smi + sysfs), provider health
  monitoring (p50/p95/p99 latency, error rates), and cost circuit
  breakers with auto-reset at midnight UTC. Thread-safe with atomic
  JSON state persistence.
- murphy-llm-governor.service: systemd unit with security hardening
- llm-governor.yaml: per-provider budget/rate/GPU/health configuration
- README.md: architecture, budget enforcement, GPU monitoring, and
  error code reference (MURPHY-LLM-GOV-ERR-001 through 012)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
…ctor

Add OS-level telemetry module that exports Murphy System runtime metrics
in Prometheus node_exporter textfile format. Includes:

- murphy_telemetry_export.py: TelemetryExporter with 4-source fallback
  chain (D-Bus → REST API → MurphyFS → cgroup) covering confidence,
  gates, swarm, forge, LLM, security, system, backup, and cgroup metrics
- murphy-telemetry-export.service: systemd oneshot unit
- murphy-telemetry-export.timer: 15s systemd timer
- telemetry.yaml: default configuration
- README.md: metric reference and Grafana hints

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
Introduces systemd-based module instance management for MurphyOS,
corresponding to Murphy System's module_instance_manager.py,
module_loader.py, module_manager.py, and module_registry.py.

Files:
- murphy_module_lifecycle.py: ModuleLifecycleManager class with registry,
  lifecycle ops, health monitoring, auto-restart, resource governance
- murphy-module-lifecycle.service: systemd unit for daemon mode
- module-lifecycle.yaml: default configuration
- README.md: architecture, CLI usage, error codes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
Add 5 new command groups to the Murphy CLI:
- murphy llm {status,usage,health} — LLM governor operations
- murphy backup {create,list,verify,restore} — Backup operations
- murphy telemetry {status,dump} — Telemetry/metrics operations
- murphy cgroup {list,usage} — Resource isolation status
- murphy module {list,start,stop,status} — Module lifecycle management

Each group follows existing patterns with cmd_* functions, parser
entries, dispatch keys, and error codes MURPHY-CLI-ERR-015 through
MURPHY-CLI-ERR-024. Bash tab-completion updated accordingly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
…it, and packaging

Add cgroup, journal, backup, llm-governor, telemetry-export, and
module-lifecycle subsystem integration to MurphyOS components:

- D-Bus service: 4 new interfaces (LLM, Telemetry, Backup, Module)
- D-Bus introspection XML: matching interface definitions
- D-Bus policy conf: ownership and send/receive rules
- Polkit actions: backup.create, backup.restore, module.start, module.stop
- MurphyFS: virtual paths for llm/, telemetry/, backup/, cgroup/, modules/
- Init system: tmpfiles dirs and system-generator subsystem services
- Debian packaging: updated description and dependencies

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
…vernor, telemetry, module lifecycle; update CLI, D-Bus, MurphyFS, init, packaging, tests

Agent-Logs-Url: https://github.com/IKNOWINOT/Murphy-System/sessions/f73050b1-7ac7-4d0f-8065-4695d60e42c0

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
Copilot AI and others added 4 commits April 14, 2026 01:17
…t, journal call_args, cgroup config mock

Agent-Logs-Url: https://github.com/IKNOWINOT/Murphy-System/sessions/23dd8887-64e4-4960-91f4-f73a2ae1cb11

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
- Replace generic GNOME colours with Murphy brand palette in stylesheet.css
  (teal #00D4AA, green #00ff41, warning #FFA63E, danger #EF4444)
- Add .murphy-panel-button and .murphy-notification classes
- Update extension.js labels/notifications with ⚙ Murphy branding
- Add brand-accent-color GSettings key (default #00D4AA)
- Add branding preference section in prefs.js
- Brand Nautilus context menu items with Murphy System name
- Add branded CLI version output with teal ANSI colour
- Create murphyos/brand/ package with murphy_brand.py constants
- Create murphy-icon-symbolic.svg, murphy-icon-full.svg, murphy-banner.svg

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
…error codes and subsystems

Agent-Logs-Url: https://github.com/IKNOWINOT/Murphy-System/sessions/23dd8887-64e4-4960-91f4-f73a2ae1cb11

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
@github-actions
Copy link
Copy Markdown
Contributor

⚡ Performance Regression Report

Threshold: 10.0%

Metric Baseline p95 Current p95 Change
⚪ import_latency N/Ams 506.253ms N/A%
⚪ workflow_generation N/Ams 4.076ms N/A%
⚪ gate_wiring_init N/Ams 3.979ms N/A%
⚪ event_backbone_publish N/Ams 4.443ms N/A%
⚪ json_serialization N/Ams 0.039ms N/A%

✅ No regressions detected

Generated by PERF-REGRESSION-001 v1.0.0

@github-actions
Copy link
Copy Markdown
Contributor

🔗 Module Integration Parity Report

Check Count Total Coverage
Test files 371 1263 29.4%
In registry 1200 1263 95.0%
Importable (sample) 50 1263 N/A%
Server-wired 31 1263 2.5%
In baseline 526 1263 41.6%

Status: ⚠️ 1692 gap(s) found

Generated by INTEGRATION-PARITY-001 v1.0.0

@github-actions
Copy link
Copy Markdown
Contributor

📄 Documentation Freshness Report

Metric Value
Files changed 0
Doc debts 0
Missing docstrings 4486
Docstring coverage 77.9%
Baseline drift 842

Generated by DOC-FRESHNESS-001 v1.0.0

@github-actions
Copy link
Copy Markdown
Contributor

🔒 Security Posture Report

Score: 70/100 (threshold: 60)

Check Findings
Bandit (static analysis) 0
Secret scanning 0
SSRF patterns 55
HITL gate gaps 3
Authority band issues 0

Gate: ✅ PASSED

Generated by SEC-POSTURE-001 v1.0.0

Copilot AI and others added 2 commits April 14, 2026 05:11
…, CSS, JS, HTML, API endpoints)

Agent-Logs-Url: https://github.com/IKNOWINOT/Murphy-System/sessions/cdfb8654-93c1-4868-a8aa-1094a42d44c1

Co-authored-by: IKNOWINOT <48894967+IKNOWINOT@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants