Skip to content

release: v1.12.0 Nexus Consolidation#27

Open
sairam0424 wants to merge 85 commits into
mainfrom
release/v1.10.0-nexus
Open

release: v1.12.0 Nexus Consolidation#27
sairam0424 wants to merge 85 commits into
mainfrom
release/v1.10.0-nexus

Conversation

@sairam0424

Copy link
Copy Markdown
Owner

Summary

ContextOS v1.12.0 "Nexus Consolidation" — zero new features, 15 security fixes, 7 architectural corrections, 5 new test suites. Published to npm.

What changed

  • Database singleton: 6 separate SQLite connections collapsed to 1 shared instance via getSharedDatabase(), fixing embedding isolation bug
  • Search pipeline: Real query embeddings instead of empty vectors, FTS5 query injection sanitized, MiniSearch removed (FTS5 is sole keyword engine)
  • Security hardening: Shell injection fixed (execexecFile), path traversal in dashboard static serving blocked, CORS restricted to localhost, prompt injection defense in repair service, source code directories marked read-only for agents
  • Data integrity: Tag extraction bug fixed, orphaned edges/symbols cleaned on file removal, access log pruning, 2nd-degree graph affinity
  • Dashboard resilience: WebSocket auto-reconnect with backoff, stale closure fix, error boundary for Three.js, async file streaming
  • Test coverage: 5 new suites (locking, knowledge-graph, intelligence-queue, repair, capability) — 24 new tests, all passing

Security fixes (15 total)

Severity Fix
CRITICAL Path traversal in static file serving (CWE-22)
CRITICAL Prompt injection via file content to Gemini (CWE-74)
HIGH FTS5 query syntax injection (CWE-89)
HIGH Wildcard CORS → localhost-only (CWE-942)
HIGH Source code directories writable by agents (CWE-732)
HIGH Lock acquisition always returned true
MEDIUM ReDoS via grep -E → -F with timeout (CWE-1333)
MEDIUM POST body size unlimited (CWE-400)
MEDIUM WebSocket payloads unvalidated (CWE-20)
MEDIUM exec() for browser launch → execFile (CWE-78)
MEDIUM Repair loop amplification (CWE-835)
LOW WebSocket reconnection leak on unmount
LOW removeFile orphaned edges/symbols
LOW Progress bar operator precedence
LOW getAllDocuments().find() O(N) → getDocumentById()

npm packages published

  • @context-os/core@1.12.0
  • @context-os/cli@1.12.0
  • @context-os/mcp@1.12.0

Test plan

  • npm run build — 4/4 workspaces clean
  • npm run validate — all hooks pass
  • Core tests: 34 passing, 5 pre-existing failures (tree-sitter grammar, not regressions)
  • CLI smoke tests: 5 passing, 1 pre-existing failure
  • Security audit: 10/10 fixes verified line-by-line
  • API contract: 7/7 checks pass, full backward compatibility
  • Version parity: all 5 manifests at 1.12.0
  • npm publish: all 3 packages live on registry

sairam0424 and others added 30 commits March 30, 2026 23:58
…preferences, skills, anti-patterns, decisions, changelog)
docs: add session notes and project isolation insights to AGENTS_LEAR…
Migrated from runtime O(N^2) graph computation to a persistent SQLite-backed adjacency mesh for near-instant retrieval.
Added Ollama as a local embedding provider and transitioned to Chokidar for more stable, cross-platform file watching.
Initialized a modern Vite+React workspace for the dashboard. Implemented a 3D Knowledge Graph with Three.js and a glassmorphic HUD design.
Updated the dashboard command to serve the production build of the React HUD. Implemented SPA routing and CORS support for local development.
…rd to tailwind v4

- Updated federated-intelligence.test.ts to seed graph edges in mock database
- Upgraded workspace-dashboard to Tailwind v4 (CSS-first architecture)
- Removed legacy tailwind.config.js and updated vite/css configs
- Updated package-lock.json with required dependencies
Replace 6 separate DatabaseService instances with a single lazy
getSharedDatabase() factory. Fixes embedding isolation bug where
intelligence queue writes were invisible to the search pipeline.

Adds schema migration for existing databases missing columns added
after initial table creation (status, is_private, intelligence_status,
hash). Also fixes lock acquisition always returning true by verifying
ownership post-upsert instead of trusting SQLite change count.
- Replace exec() with execFile() for grep fallback (CWE-78 fix)
- Switch grep from -E (regex) to -F (fixed string) with 10s timeout
  to prevent ReDoS via user-controlled patterns (CWE-1333)
- Sanitize FTS5 MATCH queries by quoting input to prevent operator
  injection (CWE-89 variant)
- Remove MiniSearch in-memory index — FTS5 is the sole keyword engine
- Generate real query embeddings instead of passing empty Float32Array
- Add dimension guard: skip semantic search when embedding is empty
- Wire Spatial RAG anchor parameter through MCP workspace_search tool
- Unify SearchResult type to 'hybrid' | 'deep'
- Fix tag extraction: return combined body+frontmatter tags instead
  of frontmatter-only (indexer.ts)
- Fix removeFile: clean up orphaned edges and symbols before deleting
  the document record
- Add access_log pruning (24h TTL) on Sentinel startup and hourly
- Implement 2nd-degree graph affinity with 0.3x decay weighting
- Add getDocumentById() to avoid O(N) scan in intelligence queue
- Harden repair service against prompt injection: truncate content,
  strip path to basename, add explicit ignore instruction, validate
  LLM output body-similarity before writing to disk
- Add repair debounce in WatchService to prevent re-entry loop
Dashboard server:
- Fix path traversal in static file serving (CWE-22) — resolve and
  verify all paths stay within dashboardDist before serving
- Restrict CORS from wildcard to localhost:port origin (CWE-942)
- Add POST body size limit (4KB) with overflow detection
- Add WebSocket message size limit (8KB) and payload type validation
- Switch browser launch from exec() to execFile()
- Stream static files via createReadStream().pipe() instead of
  blocking readFileSync()

Dashboard frontend:
- Fix WebSocket reconnection leak — cancelled flag prevents zombie
  connections on unmount, clearTimeout on cleanup
- Fix stale closure via graphDataRef in onmessage handler
- Fix progress bar operator precedence (Math.max instead of ||)
- Add ErrorBoundary around AetherGraph for Three.js crash recovery
New suites:
- locking.test.ts: acquire, contention, refresh, release, expiry
- knowledge-graph.test.ts: document/symbol/tag nodes, edge construction
- intelligence-queue.test.ts: enqueue, dequeue, status transitions
- repair.test.ts: rule-based frontmatter injection, API-less fallback
- capability.test.ts: defaults, wildcard matching, reload

Updated existing tests to use 'hybrid'|'deep' result types after
MiniSearch removal and SearchResult type unification.
Strict version parity across all 5 manifests.
Source code directories (packages/, workspace-*) now read-only for
AI agents to prevent self-modification via MCP.
MCP server reads version from package.json instead of hardcoding.
CHANGELOG and AGENTS.md updated for v1.12.0 release.
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.

1 participant