Markus Maiwald
290e8ec824
docs: Add L4 Feed architecture documentation
2026-02-03 15:03:03 +01:00
Markus Maiwald
977eaa8ceb
feat(feed): Add L4 Feed schema for DuckDB + LanceDB
...
- FeedEvent structure with vector embeddings
- EventType enum (post, reaction, follow, mention, hashtag)
- FeedStore interface for hybrid storage
- Query options for temporal + semantic search
- Tests for encoding
Sprint 4 WIP: L4 Feed
2026-02-03 15:00:58 +01:00
Markus Maiwald
abea07febf
Merge feature/janus-sdk-v0.1.0 into unstable
...
Sprint 2 Complete:
- GQL Parser (ISO/IEC 39075:2024 compliant)
- GQL to Zig Code Generator
- Comprehensive SDK Documentation
- Bellman-Ford Betrayal Detection
- 166/166 tests passing (green build)
2026-02-03 13:12:17 +01:00
Markus Maiwald
e24c9d5b52
fix(storage): add nodes when adding edges in PersistentGraph
...
- toRiskGraph now properly adds all nodes before edges
- addEdge now registers from/to nodes automatically
- Fixes betrayal detection test by ensuring nodes exist in graph
2026-02-03 13:11:30 +01:00
Markus Maiwald
b0f8a73fcb
fix(qvl): fix integration test and pop imports
...
- Fix negative cycle detection test (use proper risk values)
- Fix pop_integration.zig imports to use module paths
- Fix integration.zig imports
97/97 tests passing in core modules
2026-02-03 13:04:49 +01:00
Markus Maiwald
ff40f3739c
docs(sdk): add comprehensive Janus SDK documentation
...
Add README.md with:
- Architecture overview with diagram
- Quick start examples (Identity, QVL, GQL)
- Module reference for all public APIs
- GQL syntax guide (MATCH, CREATE, DELETE, RETURN)
- Design principles (Exit is Voice, Profit=Honesty, etc.)
- Testing instructions
- Sprint roadmap
Covers Sprint 3: Documentation
2026-02-03 12:52:41 +01:00
Markus Maiwald
19577e99f8
feat(gql): add GQL to Zig code generator
...
Add codegen.zig that transpiles GQL AST to programmatic Zig code:
- MATCH statements → graph traversal code
- CREATE statements → addNode/addEdge calls
- DELETE statements → remove operations
- RETURN statements → result collection
- Expression generation (literals, comparisons, binary ops)
7/7 tests passing (codegen + lexer + parser)
2026-02-03 12:49:56 +01:00
Markus Maiwald
7077e37c06
fix(gql): fix all Zig 0.15.2 API breaking changes for GQL parser
...
- ArrayList: init(), append(allocator, item), deinit(allocator)
- Fixed errdefer const qualifier issues with mutable variables
- Fixed all AST struct deinit() calls (no allocator needed)
- All 6 GQL parser tests now passing
Lexer: 4/4 tests
Parser: 2/2 tests
2026-02-03 11:04:30 +01:00
Markus Maiwald
c944e08202
feat(qvl): add GQL parser (ISO 39075) - Sprint 2 WIP
...
Add Graph Query Language parser components:
- gql/ast.zig: AST types (Query, Match, Create, Return, etc.)
- gql/lexer.zig: Tokenizer with ISO 39075 keywords
- gql/parser.zig: Recursive descent parser
- gql.zig: Module entry point with parse() function
Supports:
- MATCH, CREATE, DELETE, RETURN statements
- Node and Edge patterns with properties
- Variable length paths (*1..3 quantifiers)
- WHERE clauses with AND/OR logic
- Property comparisons (=, <>, <, <=, >, >=)
Note: Tests need Zig API updates (ArrayList changes)
Part of Sprint 2: GQL Parser.
2026-02-03 09:59:50 +01:00
Markus Maiwald
59e1f10f7a
fix(qvl): fix Zig API compatibility for storage and integration layers
...
- Update ArrayList API (allocator parameter changes)
- Fix const qualifier for BellmanFordResult.deinit
- Fix u8 overflow (level = -7 not valid)
- Fix toOwnedSlice API changes
- All QVL tests now compile and pass
152/154 tests green (2 pre-existing PoP failures)
2026-02-03 09:35:36 +01:00
Markus Maiwald
f6ba8dcf51
feat(qvl): add integration layer between PersistentGraph and algorithms
...
Add HybridGraph for seamless disk-memory workflow:
- Automatic cache management (load on demand)
- Transaction support (batch operations)
- Direct integration with betrayal detection, pathfinding
- Algorithm delegation to in-memory RiskGraph
Export from qvl.zig: HybridGraph, GraphTransaction
Integration complete: storage.zig ↔ existing QVL modules
2026-02-03 09:04:31 +01:00
Markus Maiwald
23174f6a6c
chore(gitignore): protect BDD specs from competitors
...
Add *.feature and features/ to .gitignore. These specs are
gold-worth intellectual property - competitors could steal
and refactor to TypeScript.
Keep features/README.md public for documentation.
2026-02-03 09:00:04 +01:00
Markus Maiwald
5aab5cdc8d
feat(qvl): add libmdbx persistent storage layer
...
Add PersistentGraph with libmdbx backend for Kenya Rule compliance.
2026-02-03 08:59:13 +01:00
Markus Maiwald
ccf521131a
feat(janus-sdk): add libertaria sdk v0.1.0-alpha
...
Add Janus language SDK for Libertaria with core modules:
- identity: cryptographic agent identity with rotation/burn
- message: signed, content-addressed messages
- context: NCP implementation
- memory: LanceDB vector store integration
- lib: unified API exports
2026-02-03 08:09:43 +01:00
Markus Maiwald
514e521abe
feat(ncp): add L1 index layer with path-based addressing
...
Implement B-Tree style index:
- Path to CID mapping (exact lookup)
- List by prefix (directory listing)
- Glob pattern matching (* and ? wildcards)
- Insert, remove, paths operations
Supports hierarchical addressing: /agents/frankie/tasks
Refs RFC-NCP-001 L1 Index
Developed with Frankie assistance
2026-02-02 12:19:40 +01:00
Markus Maiwald
f22390552e
feat(ncp): add L0 storage layer with file backend
...
Implement content-addressed storage:
- CID to filesystem path mapping (content-addressing)
- Store/retrieve/delete operations
- Directory structure: root/XX/YY/ZZ...
- 100MB default file size limit
Refs RFC-NCP-001 L0 Storage
Developed with Frankie assistance
2026-02-02 12:15:34 +01:00
Markus Maiwald
904ddae674
feat(ncp): add core types for Nexus Context Protocol
2026-02-02 12:09:38 +01:00
Markus Maiwald
b6edd5c403
feat(capsule): stabilize TUI monitor, implement control IPC, and fix leaks (Zig 0.15.2)
2026-02-01 10:35:35 +01:00
Markus Maiwald
842ebf631c
docs: Add RFC-0105 (STP) and RFC-0014 (Secure Relay)
...
Documented recent architectural changes:
- RFC-0105: Defined Sovereign Epochs (1 Hour) and Timestamp behavior.
- RFC-0014: Defined Secure Relay Protocol (XChaCha20 + X25519), Sticky Sessions, and Nonce Binding.
2026-01-31 22:29:31 +01:00
Markus Maiwald
5b80760d56
feat(stp): Define Sovereign Epoch (1 Hour)
...
Implemented struct in Sovereign Time Protocol (l0-transport/time.zig).
- Epoch Duration: 1 Hour (3600 seconds).
- Logic for calculating current epoch, start/end times, and time remaining.
- Aligned with SovereignTimestamp (attosecond precision).
2026-01-31 22:25:11 +01:00
Markus Maiwald
87cd30dbe3
feat(relay): Implement Sticky Sessions & RelaySend CLI
...
- Added to support reusing SessionID and Ephemeral Keys.
- Updated to track session statistics (packet counts) for rate-limiting.
- Implemented CLI command to send packets via Relay.
- Refactored to accept optional reusable keypair.
- Updated tests.
2026-01-31 22:21:53 +01:00
Markus Maiwald
8b115ee2a6
chore(federation): Bump protocol version to 2 (DHT key propagation)
2026-01-31 22:16:21 +01:00
Markus Maiwald
24adf936e5
feat(relay): Wire up CircuitBuilder with DHT Keys
...
- Implemented in DHT for exact key lookup.
- Updated to use DHT service for resolving Relay Public Keys.
- Generated on client-side (random) for circuit privacy.
- Wired to pass DHT instance to CircuitBuilder.
- Updated forwarding logic to use strict SessionID binding.
- Fixed lints in dht.zig.
2026-01-31 22:15:46 +01:00
Markus Maiwald
e5f59869bc
feat(crypto): Integrate ECDH & XChaCha20-Poly1305 for Relay
...
Phase 14 Real Crypto Update:
- Replaced mock encryption with XChaCha20-Poly1305 + X25519 ECDH.
- Implemented strict Nonce/SessionID binding (RFC-0000 alignment).
- Updated RelayPacket wire format to include Ephemeral Key.
- Updated RelayService to unwrap using Node Identity (SoulKey).
- Extended DHT and Federation protocols to propagate X25519 Public Keys.
- Persisted peer keys in SQLite storage.
- Tests passing (including new crypto logic).
2026-01-31 22:13:11 +01:00
Markus Maiwald
fca9ac13e0
feat(integration): Wire Relay Forwarding & CLI Control
...
Phase 14 Integration:
- Relay Forwarding integrated into CapsuleNode event loop
- Handle LWF frames
- Forward packets to next hop (or local delivery if final)
- Added CLI commands: , ,
- Tests passing (140/140)
Capabilities:
✅ Relay Forwarding (Mock Encryption)
✅ Dynamic Relay Service Control
✅ Statistics Reporting
2026-01-31 21:47:40 +01:00
Markus Maiwald
cda96d303e
feat(integration): Phase 14 - Integrate Relay & Circuit into CapsuleNode
...
Integration Complete:
- Added relay_enabled, bridge_enabled config options
- relay_trust_threshold for QVL relay selection
- RelayService for packet forwarding logic
- CircuitBuilder integrated into CapsuleNode
- Conditional initialization based on config
- All tests passing (140/140)
Node Capabilities:
✅ Gateway mode: NAT coordination
✅ Relay mode: Onion packet forwarding
✅ Client mode: Circuit building & sending
Config Example:
{
"relay_enabled": true,
"relay_trust_threshold": 0.7
}
2026-01-31 20:56:15 +01:00
Markus Maiwald
ff9cebcb1e
feat(bridge): Implement Bridge Protocol for Layer 3 translation
...
Week 35 Complete:
- ChapterBridge with DID mapping for cross-Chapter communication
- HttpBridge adapter (HTTP ↔ LWF translation)
- SmtpBridge adapter (SMTP ↔ LWF translation)
- Protocol version translation framework
- Bridge reputation tracking and stats
- All tests passing (139/139)
Phase 13 (Three-Layer Forwarding) Complete:
✅ Week 33: Gateway Protocol
✅ Week 34: Relay Protocol
✅ Week 35: Bridge Protocol
2026-01-31 20:21:43 +01:00
Markus Maiwald
a8ee5bebbd
feat(relay): Add Circuit Building and QVL relay selection
...
- Implemented CircuitBuilder for QVL-based relay path selection
- Added getTrustedRelays() to QvlStore for reputation queries
- Built 1-hop circuit MVP (Source -> Relay -> Target)
- All tests passing (137/137)
2026-01-31 19:57:03 +01:00
Markus Maiwald
43156fc033
feat(relay): Implement RelayPacket and onion wrapping logic
2026-01-31 18:11:09 +01:00
Markus Maiwald
e2f9a8c38d
feat(capsule): Admin CLI & Emergency Lockdown
...
- Added Admin CLI commands:
- Peer Management: ban, unban, trust, slash
- Diagnostics: sessions, dht, qvl-query, identity
- Security: lockdown, unlock, airlock
- Implemented L0 Transport Airlock & global lockdown flag
- Integrated SoulKey identity inspection
- Added comprehensive Admin CLI documentation
2026-01-31 10:41:38 +01:00
Markus Maiwald
4498da5ce6
feat(capsule): implement discovery, federation, and persistence (Phase 10)
2026-01-31 08:35:22 +01:00
Markus Maiwald
8cb89065bd
Phase 9 Complete: Autonomous Immune Response Operational 🛡️ (Artifacts Removed)
2026-01-31 04:32:09 +01:00
Markus Maiwald
26050655c5
Phase 8 Complete: Rust Policy Enforcer Armed
...
- Zig L1: Added qvl_get_did export (NodeID -> DID lookup)
- Rust L2: Added get_did wrapper and punish_if_guilty logic
- Rust L2: Fixed policy_enforcer_neutral test (Accept default)
- Alignment: Mapped AnomalyReason to SlashReason
The PolicyEnforcer can now detect, target, and slash betrayers autonomously.
2026-01-31 04:06:51 +01:00
Markus Maiwald
cbb73d16b8
Phase 8 Sprint 1: FFI Export for Slash Protocol
...
- Zig L1: Implemented qvl_issue_slash_signal (constructs SlashSignal)
- Rust L2: Added FFI binding and safe wrapper issue_slash_signal
- Config: Wired l1_slash_mod into qvl_ffi build
- Verified: Unit test for signal creation passing
The active defense loop is closed. L2 can now pull the trigger.
2026-01-31 03:54:36 +01:00
Markus Maiwald
a60fd16e45
Phase 7 Complete: Slash Protocol Integration
...
- Integrated QuarantineList into L0Service (Hooks ready)
- Validated all tests (173/173 + new Slash/Quarantine tests)
- Weaponized stack: L0 can now hold and check blacklist of DIDs.
Next: Connect L2 trigger (FFI) to complete the active defense loop.
2026-01-31 03:50:49 +01:00
Markus Maiwald
cc68e4f9a2
Phase 7 Sprint 1&2: SlashSignal and QuarantineList
...
- Implemented l1-identity/slash.zig (SlashSignal, PunishmentType)
- Implemented l0-transport/quarantine.zig (QuarantineList, Honeypot mode)
- Integrated modules into build.zig
- Validated with unit tests
Ready for enforcement hooks.
2026-01-31 03:47:14 +01:00
Markus Maiwald
1b05a6555c
Phase 6C COMPLETE: L0-L2 IPC Bridge
...
- Zig L0: Implemented ipc/client.zig (Unix Domain Sockets)
- Zig L0: Hooked utcp/socket.zig to stream PacketReceived events to L2
- Rust L2: Implemented IpcServer (see previous commit)
- Refactor: Updated UTCP.init signature globally to accept allocator
- Verified: 173 Zig tests passing, Rust IPC server verified
Nervous system connected. Ready for Phase 7 (Slash Protocol).
2026-01-31 03:43:29 +01:00
Markus Maiwald
a4645865b3
Phase 6B Week 3 COMPLETE: L2 Membrane Agent Integration
...
- Implemented L2 Pipeline Integration Test (tests/integration_test.rs)
- Connects L0 events -> PolicyEnforcer -> QVL FFI
- Validates full stack behavior
- Fixed build.rs linkage (linking libqvl_ffi.a correctly)
- Added README.md for membrane-agent
- Updated tasks and walkthroughs
Phase 6B Delivery:
- Rust L2 Agent Daemon (Functional)
- QVL FFI Bridge (Verified)
- Core Enforcement Logic (Policy/Alerts)
- RFC-0121 Slash Protocol Spec (Drafted)
Ready for next phase: Slash Protocol Implementation.
2026-01-31 03:33:13 +01:00
Markus Maiwald
446b1203d5
Phase 6B Week 2 COMPLETE: Rust L2 Membrane Agent Daemon
...
- Implemented Core Daemon Components:
- PolicyEnforcer: Trust-based packet classification (Accept/Deprioritize/Drop)
- AnomalyAlertSystem: P0/P1 security alert queues with priority logic
- EventListener: Async stub for L0 UTCP event monitoring
- main.rs: Async daemon loop with component orchestration
- Verification:
- cargo build: SUCCESS
- cargo test: PASS (including FFI safety)
- cargo run: SUCCESS (Daemon initializes, checks QVL, enters loop)
Ready for Week 3 (L0 Integration) or Slash Protocol.
2026-01-31 03:30:07 +01:00
Markus Maiwald
20c593220c
Phase 6B Week 1: Rust membrane-agent FFI bindings (partial)
...
- Created membrane-agent/ Rust crate structure
- Implemented qvl_ffi.rs: Safe Rust FFI wrapper around Zig QVL C ABI
- QvlClient with RAII semantics (init/deinit)
- Safe wrappers: get_trust_score, verify_pop, detect_betrayal, add/revoke edges
- AnomalyScore, PopVerdict enums
- Created main.rs: Minimal daemon stub
- Created Cargo.toml, build.rs for future Zig library linking
Blocker: build.zig static library target (Zig 0.15.2 API incompatibility)
- addStaticLibrary/addSharedLibrary don't exist in this Zig version
- LibraryOptions API changed (no .kind, .root_source_file fields)
- Deferred to next session: either upgrade Zig or use manual object linking
All Zig FFI tests passing (173/173). Rust compiles but can't link yet.
2026-01-31 03:21:35 +01:00
Markus Maiwald
8b55df50b5
Phase 6A: QVL FFI C exports for L2 integration
...
- Created qvl_ffi.zig: C ABI exports (qvl_init, qvl_deinit, trust scoring, PoP verification, betrayal detection, graph mutations)
- Created qvl.h: C header with full API documentation
- Created test_qvl_ffi.c: C test harness (manual compilation)
- Added FFI tests to build.zig with libc linking
- Fixed API mismatches: TrustGraph.init (3 args), BellmanFordResult.betrayal_cycles usage
- All tests passing (173/173: 137 SDK + 36 FFI)
FFI enables Rust Membrane Agents (L2) to consume L1 trust functions.
2026-01-31 03:06:20 +01:00
Markus Maiwald
27d182a117
Phase 4B: L1 QVL Advanced Graph Engine (Bellman-Ford, A*, Aleph Gossip, Belief Propagation)
2026-01-31 02:24:19 +01:00
Markus Maiwald
995e74dc18
Phase 4: Advanced L0 Validation (Deterministic Ordering, Replay Filtering, and Trust Distance Integration)
2026-01-31 01:09:05 +01:00
Markus Maiwald
2276954ba3
Phase 4: Established L0 Transport Pipeline with UTCP and Segmented WAL OPQ
2026-01-31 00:51:20 +01:00
Markus Maiwald
e1df4b89c9
feat(l1-identity): integrate ML-KEM-768 post-quantum key and fix Zig 0.13 compatibility
2026-01-31 00:13:36 +01:00
Markus Maiwald
c8ba5ea532
feat(all): Complete Phase 2 and Phase 3 Implementation
...
- l1-identity:
- Vector Clocks (vector.zig) and Causality tracking
- Trust Graph (trust_graph.zig) and Reputation logic
- Proof of Path (proof_of_path.zig)
- PQXDH Protocol (pqxdh.zig) with LibOQS integration
- Argon2/SoulKey hardening
- builds:
- Integrated static liboqs build script
- Updated build.zig for modular linkage
- docs:
- Added Phase 3 completion report
- Added build instructions
2026-01-30 23:24:01 +01:00
Markus Maiwald
3b3993bea6
fix(l1): Export PQXDH module and correct build linkage
...
- l1-identity/crypto.zig: Export pqxdh module for SDK consumption
- build.zig: Define proper modules for PQXDH library and tests
- Link liboqs to l1_pqxdh_mod and propagate dependency to l1_mod
2026-01-30 23:12:35 +01:00
Markus Maiwald
d9adadd1d5
docs(l1): Add Phase 3 PQXDH Documentation & Build Script
...
- scripts/build_liboqs.sh: Automated script to build static liboqs without OpenSSL
- docs/PHASE_3_PQXDH.md: Protocol implementation details and usage guide
- Resolves: Implement Post-Quantum Extended Diffie-Hellman handshake
2026-01-30 23:08:51 +01:00
Markus Maiwald
97251137af
feat(l1): Integrate real LibOQS (ML-KEM-768)
...
- Build System: Link against static liboqs.a (built without OpenSSL)
- PQXDH: Replace stubs with OQS_KEM_ml_kem_768 functions
- Tests: Verify full handshake with real post-quantum KEM
- Disable Kyber (old) in liboqs build to fix symbol conflicts
2026-01-30 23:08:15 +01:00
Markus Maiwald
97e1ad3f69
feat(l1): PQXDH Protocol & Security Hardening
...
- Implement PQXDH handshake (RFC-0830) with stubbed KEM
- Complete X3DH key agreement logic (Alice <-> Bob)
- Correctly implements HKDF-SHA256 key derivation
- Unit tests verify shared secret agreement
- NOTE: ML-KEM-768 is currently stubbed pending liboqs integration
- Harden SoulKey Implementation
- Replace potentially unsafe @memset with std.crypto.secureZero
- Ensure private keys and seeds are wiped from memory
- Documentation
- Add FFI export comments to crypto.zig
- Build System
- specific test step for PQXDH
2026-01-30 22:57:12 +01:00