Commit Graph

690 Commits

Author SHA1 Message Date
f314b27e69 feat: standardize llama.cpp backend (#1123) 2026-04-18 15:19:56 -04:00
6bdfa5aea3 feat: standardize llama.cpp backend (#1123) 2026-04-18 15:19:56 -04:00
728ac89b26 feat: standardize llama.cpp backend (#1123) 2026-04-18 15:19:56 -04:00
ade422463b feat: standardize llama.cpp backend for sovereign local inference (#1123) 2026-04-18 15:19:56 -04:00
45e7608a03 feat: standardize llama.cpp backend for sovereign local inference (#1123) 2026-04-18 15:19:56 -04:00
Alexander Whitestone
7ef61c8eaa fix: ChatLog.log() crash — CHATLOG_FILE defined after use (#1349)
Move configuration block (WORLD_DIR, CHATLOG_FILE, etc.) before the
ChatLog class definition. Previously CHATLOG_FILE was defined at line ~254
but used at line ~200 inside ChatLog.log(), causing NameError on every
chat message persistence attempt.

Fixes #1349.
2026-04-18 15:19:56 -04:00
Alexander Whitestone
9ac00f019f feat: implement A2A protocol for fleet-wizard delegation (#1122)
Implements Google Agent2Agent Protocol v1.0 with full fleet integration:

## Phase 1 - Agent Card & Discovery
- Agent Card types with JSON serialization (camelCase, Part discrimination by key)
- Card generation from YAML config (~/.hermes/agent_card.yaml)
- Fleet registry with LocalFileRegistry + GiteaRegistry backends
- Discovery by skill ID or tag

## Phase 2 - Task Delegation
- Async A2A client with JSON-RPC SendMessage/GetTask/ListTasks/CancelTask
- FastAPI server with pluggable task handlers (skill-routed)
- CLI tool (bin/a2a_delegate.py) for fleet delegation
- Broadcast to multiple agents in parallel

## Phase 3 - Security & Reliability
- Bearer token + API key auth (configurable per agent)
- Retry logic (max 3 retries, 30s timeout)
- Audit logging for all inter-agent requests
- Error handling per A2A spec (-32001 to -32009 codes)

## Test Coverage
- 37 tests covering types, card building, registry, server integration
- Auth (required + success), handler routing, error handling

Files:
- nexus/a2a/ (types.py, card.py, client.py, server.py, registry.py)
- bin/a2a_delegate.py (CLI)
- config/ (agent_card.example.yaml, fleet_agents.json)
- docs/A2A_PROTOCOL.md
- tests/test_a2a.py (37 tests, all passing)
2026-04-18 15:19:56 -04:00
Timmy
61b296d2b1 fix(#1356): ThreadingHTTPServer for multi-user bridge concurrency
Replace single-threaded HTTPServer with ThreadingHTTPServer
(thread-per-request) in both multi_user_bridge.py copies.

Fixes #1356
2026-04-18 15:19:56 -04:00
Alexander Whitestone
4995b5f6e2 fix: Add Sovereign Sound Playground and fix portals.json (#1354)
This commit addresses issue #1354 by:

1. Fixing portals.json syntax error (duplicate params field)
2. Adding the Sovereign Sound Playground as a new portal
3. Including the complete playground application

Changes:
- Fixed JSON syntax error in portals.json (line 41-44)
- Added playground/playground.html - Complete interactive audio-visual experience
- Added playground/README.md - Documentation and usage guide
- Updated portals.json with playground portal entry

The playground portal is configured with:
- Online status
- Visitor access mode
- Local destination URL
- Creative tool portal type

This resolves the issue and provides a working playground accessible through the Nexus portal system.
2026-04-18 15:19:56 -04:00
Alexander Whitestone
3e4f7de961 feat: Add Reasoning Trace HUD Component
Closes #875

- Added new ReasoningTrace component for real-time reasoning visualization
- Shows agent's reasoning steps during complex task execution
- Supports step types: THINK, DECIDE, RECALL, PLAN, EXECUTE, VERIFY, DOUBT, MEMORY
- Includes confidence visualization, task tracking, and export functionality
- Integrated into existing GOFAI HUD system
2026-04-18 15:19:56 -04:00
Alexander Whitestone
6670a63635 fix: reconcile registry locations with fleet-routing.json, add missing agents
- Aligned 7 location mismatches between identity-registry.yaml and
  fleet-routing.json (allegro, ezra, bezalel, bilbobagginshire,
  substratum, fenrir, kimi)
- Added carnice (active, local ollama agent) to registry
- Added allegro-primus (deprecated) to registry

Audit results: 16 findings → 7 info-only (ghost agents intentionally
kept for audit trail). Zero warnings. Registry VALID.
2026-04-18 15:19:56 -04:00
Timmy (NEXUSBURN)
bc1224af82 feat: fleet audit tool — deduplicate agents, one identity per machine
Closes #1144. Builds a fleet audit pipeline that detects duplicate
agent identities, ghost accounts, and authorship ambiguity across
all machines.

Deliverables:

bin/fleet_audit.py — Full audit tool with four checks:
  - Identity registry validation (one name per machine, unique gitea_user)
  - Git authorship audit (detects ambiguous committers from branch names)
  - Gitea org member audit (finds ghost accounts with zero activity)
  - Cross-reference registry vs fleet-routing.json (orphan/location mismatch)

fleet/identity-registry.yaml — Canonical identity registry:
  - 8 active agents (timmy, allegro, ezra, bezalel, bilbobagginshire,
    fenrir, substratum, claw-code)
  - 7 ghost/deprecated accounts marked inactive
  - Rules: one identity per machine, unique gitea_user, required fields

tests/test_fleet_audit.py — 11 tests covering all validation rules.

Usage:
  python3 bin/fleet_audit.py                  # full audit -> JSON
  python3 bin/fleet_audit.py --identity-check # registry only
  python3 bin/fleet_audit.py --git-authors    # authorship only
  python3 bin/fleet_audit.py --report out.json # write to file
2026-04-18 15:19:56 -04:00
Timmy
2a32b32185 fix: MEMPALACE INIT shows real stats from fleet API (#1340)
Root cause: connectMemPalace() set placeholder values (0x, 0, 0B)
immediately and tried to connect to window.Claude.mcp which doesn't
exist in a normal browser. Never contacted the actual fleet API.

Fix:
- Replace connectMemPalace() to fetch from fleet API (/health, /wings)
- Show MEMPALACE CONNECTING during fetch, ACTIVE on success,
  OFFLINE if API unavailable
- Populate compression ratio, docs mined, AAAK size from real data
- Add formatBytes() helper for human-readable sizes
- Periodic refresh every 60s when connected
- Configurable API endpoint via ?mempalace=host:port query param
- Remove dead window.Claude.mcp mock code
2026-04-18 15:19:56 -04:00
Alexander Whitestone
0f71856b48 fix: remove duplicate content blocks from README.md
## Summary
Fixed duplicate content blocks in README.md caused by bad merge.
Branch protection policy, default reviewers, and implementation status
blocks were duplicated 3-4 times on the page.

## Problem
The README.md file had massive duplication from multiple bad merges:
- Branch protection policy appeared 4 times
- Default reviewers appeared multiple times
- Implementation status appeared multiple times
- Repository-specific configuration duplicated
- Acceptance criteria duplicated

The file grew to 517 lines with the same content repeated.

## Solution
Cleaned up README.md to contain:
1. Single branch protection policy section
2. Original Nexus project content (preserved)
3. Clean structure without duplicates

Reduced from 517 lines to 167 lines while preserving all unique content.

## Changes
- Removed duplicate branch protection policy sections
- Removed duplicate default reviewers sections
- Removed duplicate implementation status sections
- Removed duplicate repository-specific configuration
- Removed duplicate acceptance criteria
- Preserved original Nexus project content
- Maintained clear structure and formatting

## Testing
- Verified all unique content is preserved
- Checked for any remaining duplicates
- Confirmed file structure is clean and readable

## Acceptance Criteria
 Branch protection policy appears once
 Default reviewers appear once
 Implementation status appears once
 Content is clear and not duplicated
 Original Nexus content preserved

Issue: #1338
2026-04-18 15:19:56 -04:00
Timmy
460e5af9c0 [verified] test: guard index.html against merge junk
Refs #1336
Refs #1338

- assert index.html has no conflict markers or stray markdown
- assert cleaned single-instance blocks stay single
2026-04-18 15:19:56 -04:00
14e1d8a1dc [claude] Fix: unblock CI deploy and staging gate secrets (#1363) (#1364) 2026-04-18 15:19:56 -04:00
Timmy
5b1c1ecec0 [verified] fix: harden Three.js boot path
Fixes #1337

- show explicit guidance when opened from file://
- route browser boot through a classic script gate
- sanitize malformed generated app module before execution
- trim duplicated footer junk and add regression tests
2026-04-18 15:19:56 -04:00
8538b7085a fix: [RESPONSIVE] Tighten layout for laptop and smaller-screen viewing (#1359)
Co-authored-by: Alexander Whitestone <alexander@alexanderwhitestone.com>
Co-committed-by: Alexander Whitestone <alexander@alexanderwhitestone.com>
2026-04-18 15:19:56 -04:00
Alexander Whitestone
a007897fc9 fix: eliminate two 404 sources — case mismatch + missing icons
- app.js:1195: Fix timmy_Foundation → Timmy_Foundation in vision.json API URL.
  The lowercase 't' caused a silent 404 on case-sensitive servers, preventing
  world state from loading in fetchGiteaData().

- Create icons/icon-192x192.png and icons/icon-512x512.png placeholders.
  Both manifest.json and service-worker.js referenced these but the icons/
  directory was missing, causing 404 on every page load and SW install.

Refs #707
2026-04-18 15:19:56 -04:00
Alexander Whitestone
8066eacad6 fix: call self.load() in all game system manager __init__ methods
QuestManager, InventoryManager, GuildManager, CombatManager, and
MagicManager all had load() methods that were never called. This
meant quests were never seeded, items never appeared in rooms, and
all game data started empty on every server restart.

Fixes #1351
2026-04-18 15:19:56 -04:00
Alexander Whitestone
de08da30c9 fix: one-way exits — rooms now bidirectional (#1350)
World state: added explicit exits dict to all 5 rooms
Bridge: reads exits from world_state.json first, falls back to description parsing

Before: inner rooms (Tower, Garden, Forge, Bridge) had no exits
After: all rooms bidirectional — Threshold connects to all 4, each connects back
2026-04-18 15:19:56 -04:00
Alexander Whitestone
4208da798f Add paper Results section with 4 experiments 2026-04-18 15:19:56 -04:00
perplexity
cebba1eb45 feat: full-history persistent dedup index for DPO training pairs
Replace the 5-file sliding window cross-run dedup with a persistent
hash index that covers ALL historical training data. Overfitting risk
compounds across the full dataset — a 5-file window lets old duplicates
leak back into training after enough overnight runs.

New module: dedup_index.py (DedupIndex)
- Persistent JSON index (.dpo_dedup_index.json) alongside JSONL files
- Append-on-export: new prompt hashes registered after each successful
  export — no full rescan needed for normal operations
- Incremental sync: on load, detects JSONL files not yet indexed and
  ingests them automatically (handles files from other tools)
- Full rebuild: rebuild() scans ALL deepdive_*.jsonl + pairs_*.jsonl
  to reconstruct from scratch (first run, corruption recovery)
- Atomic writes (write-to-tmp + rename) to prevent index corruption
- Standalone CLI: python3 dedup_index.py <dir> --rebuild --stats

Modified: dpo_quality.py
- Imports DedupIndex with graceful degradation
- Replaces _load_history_hashes() with persistent index lookup
- Fallback: if index unavailable, scans ALL files in-memory (not just 5)
- New register_exported_hashes() method called after export
- Config key: dedup_full_history (replaces dedup_history_files)

Modified: dpo_generator.py
- Calls validator.register_exported_hashes() after successful export
  to keep the persistent index current without rescanning

Modified: config.yaml
- Replaced dedup_history_files: 5 with dedup_full_history: true

Tested — 7 integration tests:
  ✓ Fresh index build from empty directory
  ✓ Build from 3 existing JSONL files (15 unique hashes)
  ✓ Incremental sync when new file appears between runs
  ✓ Append after export + persistence across reloads
  ✓ Rebuild from scratch (recovers from corruption)
  ✓ Validator catches day-1 dupe from 20-day history (5-file window miss)
  ✓ Full pipeline: generate → validate → export → register → re-run detects
2026-04-18 15:19:56 -04:00
perplexity
77cfa48707 feat: DPO pair quality validator — gate before overnight training
Add DPOQualityValidator that catches bad training pairs before they
enter the tightening loop. Wired into DPOPairGenerator between
generate() and export() as an automatic quality gate.

New module: dpo_quality.py
- 5 single-pair quality checks:
  1. Field length minimums (prompt ≥40, chosen ≥80, rejected ≥30 chars)
  2. Chosen/rejected length ratio (chosen must be ≥1.3x longer)
  3. Chosen≈rejected similarity (Jaccard ≤0.70 — catches low-contrast)
  4. Vocabulary diversity in chosen (unique word ratio ≥0.30)
  5. Substance markers in chosen (≥2 fleet/training/action terms)
- 2 cross-pair quality checks:
  6. Near-duplicate prompts within batch (Jaccard ≤0.85)
  7. Cross-run dedup against recent JSONL history files
- Two modes: 'drop' (filter out bad pairs) or 'flag' (export with warning)
- BatchReport with per-pair diagnostics, pass rates, and warnings
- Standalone CLI: python3 dpo_quality.py <file.jsonl> [--strict] [--json]

Modified: dpo_generator.py
- Imports DPOQualityValidator with graceful degradation
- Initializes from config validation section (enabled by default)
- Validates between generate() and export() in run()
- Quality report included in pipeline result dict
- Validator failure never blocks — falls back to unvalidated export

Modified: config.yaml
- New deepdive.training.dpo.validation section with all tunable knobs:
  enabled, flagged_pair_action, similarity thresholds, length minimums,
  dedup_history_files

Integration tested — 6 test cases covering:
  ✓ Good pairs pass (3/3 accepted)
  ✓ Bad pairs caught: too-short, high-similarity, inverted signal (0/3)
  ✓ Near-duplicate prompt detection (1/2 deduped)
  ✓ Flag mode preserves pairs with warnings (3/3 flagged)
  ✓ Cross-run deduplication against history (1 dupe caught)
  ✓ Full generator→validator→export pipeline (6/6 validated)
2026-04-18 15:19:56 -04:00
perplexity
984dce78e7 feat: Phase 3.5 — DPO training pair generation from Deep Dive pipeline
Wire arXiv relevance filter output directly into DPO pair generation,
closing the loop between research synthesis and overnight training data.

New module: dpo_generator.py
- DPOPairGenerator class with 3 pair strategies:
  * summarize: paper → fleet-grounded analysis (chosen) vs generic (rejected)
  * relevance: 'what matters to Hermes?' → scored context vs vague
  * implication: 'what should we do?' → actionable insight vs platitude
- Extracts synthesis excerpts matched to each ranked item
- Outputs to ~/.timmy/training-data/dpo-pairs/deepdive_{timestamp}.jsonl
- Format: {prompt, chosen, rejected, task_type, evidence_ids,
  source_session, safety_flags, metadata}

Pipeline changes (pipeline.py):
- Import DPOPairGenerator with graceful degradation
- Initialize from config deepdive.training.dpo section
- Execute as Phase 3.5 between synthesis and audio
- DPO results included in pipeline return dict
- Wrapped in try/except — DPO failure never blocks delivery

Config changes (config.yaml):
- New deepdive.training.dpo section with:
  enabled, output_dir, min_score, max_pairs_per_run, pair_types

Integration tested: 2 mock items × 3 pair types = 6 valid JSONL pairs.
Chosen responses consistently richer than rejected (assert-verified).
2026-04-18 15:19:56 -04:00
53f75c3d06 purge: remove Anthropic from the-nexus fleet + deepdive (#1346) 2026-04-18 15:19:56 -04:00
6eff715bda fix: deduplicate playwright install in CI 2026-04-18 15:19:56 -04:00
c47f68bf31 muda: remove stale artifact protected_branches.yaml` 2026-04-18 15:19:56 -04:00
0446bccf8d muda: remove stale artifact codowners 2026-04-18 15:19:55 -04:00
ea75cc57b4 muda: remove stale artifact cODEOWNERS 2026-04-18 15:19:55 -04:00
794ad017dd muda: remove stale artifact cODEOWNERS 2026-04-18 15:19:55 -04:00
bd180b13a0 muda: remove stale artifact cODEOWNERS 2026-04-18 15:19:55 -04:00
5f8e07111b muda: remove stale artifact CODEOWNERS 2026-04-18 15:19:55 -04:00
52f13c7d45 muda: remove stale artifact CODEOWNERS 2026-04-18 15:19:55 -04:00
cf81290392 muda: remove stale artifact CODEOWNERS 2026-04-18 15:19:55 -04:00
c38fb4960d muda: remove stale artifact CODEOWNERS 2026-04-18 15:19:55 -04:00
b08eba73d9 muda: remove stale artifact CODEOWNERS 2026-04-18 15:19:55 -04:00
853c0bdbf4 muda: remove stale artifact CODEOWNERS 2026-04-18 15:19:55 -04:00
3af7f49429 muda: remove stale artifact CONTRIBUTING.md 2026-04-18 15:19:55 -04:00
5ce0a82b5c muda: remove stale artifact CODEOWNERS 2026-04-18 15:19:55 -04:00
08fb802b57 Merge PR #1343
Add structured GOFAI worker outcomes and goal-directed planning
2026-04-18 15:19:55 -04:00
1afc4856ae fix: remove stale file docus/branch-protection.md 2026-04-18 15:19:55 -04:00
ed37ae98cb fix: remove stale file timmy-home/SOUL.md 2026-04-18 15:19:55 -04:00
66d2d9693d fix: remove stale file timmy-home/CONTRIBUTING.md 2026-04-18 15:19:55 -04:00
71f8e9bd5c fix: remove stale file timmy-home/CODEOWNERS 2026-04-18 15:19:55 -04:00
a7b3b47643 fix: remove stale file timmy-config/SOUL.md 2026-04-18 15:19:55 -04:00
a377dee0b6 fix: remove stale file timmy-config/CONTRIBUTING.md 2026-04-18 15:19:55 -04:00
2959e55658 fix: remove stale file timmy-config/CODEOWNERS 2026-04-18 15:19:55 -04:00
466b1ee3a7 fix: remove stale file the-nexus/CONTRIBUTING.md 2026-04-18 15:19:55 -04:00
a9dda31b86 fix: remove stale file the-nexus/CODEOWNERS 2026-04-18 15:19:55 -04:00