vectorforce 0.0.0-stage → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/.agents/agents/AGENTS.md +12 -0
  2. package/.agents/agents/vectorforce-architect.md +35 -0
  3. package/.agents/agents/vectorforce-auditor.md +25 -0
  4. package/.agents/agents/vectorforce-samples-builder.md +30 -0
  5. package/.agents/mcp_config.json +11 -0
  6. package/.codex/config.toml +5 -0
  7. package/AGENTS.md +115 -0
  8. package/LICENSE +21 -0
  9. package/README.md +198 -2
  10. package/bin/vf.js +1159 -0
  11. package/codex.json +14 -0
  12. package/commandcode.json +11 -0
  13. package/musecode.json +14 -0
  14. package/package.json +40 -4
  15. package/src/core/errors.js +45 -0
  16. package/src/core/hash.js +56 -0
  17. package/src/core/types.js +194 -0
  18. package/src/index.js +17 -0
  19. package/src/mcp/harness-config.js +546 -0
  20. package/src/mcp/mcp-server.js +507 -0
  21. package/src/operations/briefing-service.js +313 -0
  22. package/src/operations/checkpoint-service.js +120 -0
  23. package/src/operations/handoff-service.js +343 -0
  24. package/src/operations/project-service.js +132 -0
  25. package/src/operations/reasoning-service.js +356 -0
  26. package/src/policy/authorizer.js +147 -0
  27. package/src/providers/code-index-provider.js +285 -0
  28. package/src/providers/document-provider.js +105 -0
  29. package/src/providers/git-provider.js +98 -0
  30. package/src/providers/llm-provider.js +425 -0
  31. package/src/storage/sqlite-store.js +387 -0
  32. package/src/studio/server.js +764 -0
  33. package/studio/dist/assets/index-C0_eVpV1.js +9 -0
  34. package/studio/dist/assets/index-CxTK-2ty.css +2 -0
  35. package/studio/dist/favicon.svg +1 -0
  36. package/studio/dist/icons.svg +24 -0
  37. package/studio/dist/index.html +17 -0
@@ -0,0 +1,12 @@
1
+ # Workspace Agents Directory (`.agents/agents/`)
2
+
3
+ This directory defines workspace-scoped agents for **VectorForce** (alongside the project-root [`AGENTS.md`](../../AGENTS.md)).
4
+
5
+ ## Registered Workspace Agents
6
+
7
+ | Agent Name | File | Role & Responsibility |
8
+ | :--- | :--- | :--- |
9
+ | **`vectorforce-architect`** | [`vectorforce-architect.md`](vectorforce-architect.md) | Upgrades core VectorForce services (`src/operations/*`), SQLite WAL store (`src/storage/sqlite-store.js`), MCP tools (`src/mcp/mcp-server.js`), AI providers (`src/providers/llm-provider.js`), CLI (`bin/vf.js`), and Studio UI (`studio/`) while enforcing zero runtime dependencies. |
10
+ | **`vectorforce-samples-builder`** | [`vectorforce-samples-builder.md`](vectorforce-samples-builder.md) | Builds runnable multi-agent workflows, cross-harness reference architectures, and integration demos inside [`samples/`](../../samples/README.md). |
11
+ | **`vectorforce-auditor`** | [`vectorforce-auditor.md`](vectorforce-auditor.md) | Verifies security boundaries, allowlist limits (`AGENTS.md < 8192` bytes), HMAC-SHA256 handoff integrity, and runs `npm test` + `npm run test:practical`. |
12
+
@@ -0,0 +1,35 @@
1
+ ---
2
+ name: vectorforce-architect
3
+ description: >-
4
+ Specialized production architect for upgrading VectorForce core services, SQLite WAL storage, MCP tools, AI reasoning providers, and VectorForce Studio while enforcing zero runtime dependencies.
5
+ tools:
6
+ - read_file
7
+ - write_file
8
+ - edit_file
9
+ - run_command
10
+ ---
11
+
12
+ # VectorForce Production Architect (`vectorforce-architect`)
13
+
14
+ You are the **VectorForce Production Architect**, responsible for designing and implementing production-grade upgrades across the VectorForce engine (`src/`), CLI (`bin/vf.js`), MCP server (`src/mcp/mcp-server.js`), and Studio UI (`src/studio/server.js`, `studio/`).
15
+
16
+ ## Non-Negotiable Architectural Invariants
17
+
18
+ 1. **Zero External Runtime Dependencies**:
19
+ - All backend code (`bin/`, `src/`) must use **only** Node.js built-in modules (`node:sqlite`, `node:http`, `node:crypto`, `node:fs`, `node:path`, `node:child_process`).
20
+ - Never add runtime dependencies to the root `package.json`.
21
+ 2. **Strict Separation of `claims` vs `evidence`**:
22
+ - Human/AI assertions (`goals`, `constraints`, `decisions`, `next_steps`) live in `checkpoint.claims`.
23
+ - Verifiable observations (Git commit SHA, branch, dirty status, SHA-256 document digests) live in `checkpoint.evidence`.
24
+ 3. **Workspace Containment & Allowlist Enforcement**:
25
+ - Every file operation must pass through `Authorizer` (`src/policy/authorizer.js`).
26
+ - Reject symlinks, absolute paths, and `..` traversal sequences.
27
+ 4. **Full-Stack Tool Registration Checklist**:
28
+ When adding or upgrading a VectorForce capability:
29
+ - **Storage**: Add/update SQLite tables or queries in `src/storage/sqlite-store.js`.
30
+ - **Operations**: Add service method in `src/operations/*-service.js`.
31
+ - **MCP Bridge**: Register JSON-RPC tool schema and handler in `src/mcp/mcp-server.js`.
32
+ - **CLI**: Add command flag handling and help text in `bin/vf.js`.
33
+ - **SDK Export**: Export any new classes/types in `src/index.js`.
34
+ - **Tests**: Add unit tests in `test/` and verify `npm test` + `npm run test:practical`.
35
+
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: vectorforce-auditor
3
+ description: >-
4
+ Specialized security, workspace drift, and cross-OS verification auditor for VectorForce checkpoints, HMAC-SHA256 handoff packages, and test suites.
5
+ tools:
6
+ - read_file
7
+ - run_command
8
+ ---
9
+
10
+ # VectorForce Security & Continuity Auditor (`vectorforce-auditor`)
11
+
12
+ You are the **VectorForce Security & Continuity Auditor**, responsible for verifying security invariants, cross-OS compatibility, and checkpoint/handoff integrity across the workspace.
13
+
14
+ ## Verification Checklist
15
+
16
+ 1. **Automated Unit & Security Suite**:
17
+ - Run `npm test` and ensure all tests pass with `fail 0`.
18
+ 2. **Practical 7-Stage E2E Simulation**:
19
+ - Run `npm run test:practical` (`node scripts/practical-test-env.js`) to validate Git + CLI + live MCP stdio + HMAC-SHA256 handoff + tamper rejection + drift detection.
20
+ 3. **Workspace Health & Policy Check**:
21
+ - Run `node bin/vf.js status` and `node bin/vf.js policy list`.
22
+ - Ensure `AGENTS.md` at the repository root remains `< 8192` bytes (`wc -c AGENTS.md`) so it can always be collected as allowlisted document evidence.
23
+ 4. **Checkpoint Continuity**:
24
+ - Verify that every completed phase ends with a committed VectorForce checkpoint (`node bin/vf.js checkpoint --task <id> ... --doc "AGENTS.md"`).
25
+
@@ -0,0 +1,30 @@
1
+ ---
2
+ name: vectorforce-samples-builder
3
+ description: >-
4
+ Specialized builder for runnable multi-agent workflows, cross-harness reference architectures, and AI provider integrations inside the VectorForce samples/ directory.
5
+ tools:
6
+ - read_file
7
+ - write_file
8
+ - edit_file
9
+ - run_command
10
+ ---
11
+
12
+ # VectorForce Samples & Architecture Builder (`vectorforce-samples-builder`)
13
+
14
+ You are the **VectorForce Samples & Multi-Agent Workflow Builder**, responsible for translating user architecture diagrams, multi-agent patterns, and integration scenarios into clean, runnable examples inside `samples/`.
15
+
16
+ ## Guidelines for Building Samples (`samples/`)
17
+
18
+ 1. **Self-Contained & Runnable**:
19
+ - Every sample in `samples/` must be runnable directly via `node samples/<sample-name>.js` (or `node samples/<folder>/index.js`).
20
+ - Use isolated temporary workspaces (`mkdtempSync(join(tmpdir(), 'vf-sample-...'))`) and clean them up in a `finally` block so running a sample never pollutes the main repo.
21
+ 2. **SDK & MCP Coverage**:
22
+ - Import core classes directly from `../src/index.js` (`SqliteStore`, `ProjectService`, `CheckpointService`, `BriefingService`, `ReasoningService`, `HandoffService`, `LlmProvider`, `McpServer`).
23
+ - Demonstrate realistic multi-harness transitions across:
24
+ - **Google Antigravity** (`antigravity`)
25
+ - **Meta Muse / Fireworks AI (`Muse Spark Open`)** (`muse-code`)
26
+ - **Claude Code / Command Code** (`command-code`)
27
+ - **OpenAI Codex CLI** (`codex`)
28
+ 3. **Update Index**:
29
+ - Whenever you create a new sample, add it to the table in `samples/README.md` with its run command and architectural summary.
30
+
@@ -0,0 +1,11 @@
1
+ {
2
+ "mcpServers": {
3
+ "vectorforce": {
4
+ "command": "node",
5
+ "args": [
6
+ "/Users/omprakashprajapat/AgentAI/VectorForce/bin/vf.js",
7
+ "mcp"
8
+ ]
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,5 @@
1
+ [mcp_servers.vectorforce]
2
+ command = "node"
3
+ args = ["/Users/omprakashprajapat/AgentAI/VectorForce/bin/vf.js", "mcp"]
4
+ [mcp_servers.vectorforce.env]
5
+ VF_HARNESS = "codex"
package/AGENTS.md ADDED
@@ -0,0 +1,115 @@
1
+ # VectorForce Workspace Architecture & Agent Continuity Guide (`AGENTS.md`)
2
+
3
+ This repository is the core workspace for **VectorForce** — a local-first, zero-dependency, privacy-preserving engineering context platform ("Git for AI Context") across **Google Antigravity**, **Meta Muse**, **Claude Code**, **Command Code**, and **OpenAI Codex**.
4
+
5
+ ---
6
+
7
+ ## 1. Context Protocol Workflow (Mandatory for All AI Agents)
8
+
9
+ ### At the Start of a Task / Resuming Work:
10
+ 1. **Discover active tasks:**
11
+ - MCP: `list_tasks({ status: "active" })` | CLI: `node bin/vf.js tasks active`
12
+ 2. **Check for workspace or document drift:**
13
+ - MCP: `check_workspace_drift({ task_id: "<task_id>" })` | CLI: `node bin/vf.js drift --task <task_id>`
14
+ 3. **Retrieve the authorized briefing:**
15
+ - MCP: `get_resume_briefing({ task_id: "<task_id>", destination_harness: "antigravity" })` (`"antigravity" | "muse-code" | "command-code" | "codex"`)
16
+ - CLI: `node bin/vf.js resume --task <task_id> --dest antigravity`
17
+ 4. **Reason over the context (AI memory):**
18
+ - MCP: `reason_about_task({ task_id: "<task_id>" })` | CLI: `node bin/vf.js reason --task <task_id>`
19
+ 5. **Adhere to Invariant Constraints:** Respect all rules under `# Invariant Constraints` in the briefing.
20
+
21
+ ### At the End of a Task Phase / Before Switching Harnesses:
22
+ 1. **Capture an immutable checkpoint:**
23
+ - MCP: `save_checkpoint({ task_id, summary, goals, constraints, decisions, next_steps, requested_documents })`
24
+ - CLI:
25
+ ```bash
26
+ node bin/vf.js checkpoint --task <id> --summary "<summary>" \
27
+ --goal "<goal>" --constraint "<constraint>" \
28
+ --decision "<ID>:<Title>:<Rationale>" \
29
+ --next "<next_step>" --doc "AGENTS.md"
30
+ ```
31
+ 2. **Verify Receipt:** Ensure the operation receipt returns `status: "committed"`.
32
+
33
+ ---
34
+
35
+ ## 2. Security & Policy Invariants
36
+
37
+ - **Zero External Runtime Dependencies:** Core CLI, MCP server, and Studio backend use **only** Node.js built-ins (`node:sqlite`, `node:http`, `node:crypto`, `node:fs`, `node:child_process`).
38
+ - **Claims vs Evidence Distinction:** Human/model inputs (`goals`, `constraints`, `decisions`, `next_steps`) are stored as unverifiable **`claims`**. Git commit SHAs, dirty states, and SHA-256 document digests are recorded as verifiable **`evidence`**.
39
+ - **Strict Document Allowlist & Size Cap:** Only `.md`/`.txt` files in `node bin/vf.js policy list` (max `8 KiB` per file, `64 KiB` total) may be collected. `AGENTS.md` must stay `< 8192` bytes. Symlinks and path traversal (`..`) are strictly rejected.
40
+ - **Safe Receipts:** Receipts and audit logs never contain raw document bodies or API credentials.
41
+
42
+ ---
43
+
44
+ ## 3. Workspace Directory & Module Map
45
+
46
+ ```text
47
+ VectorForce/
48
+ ├── AGENTS.md # Workspace guide & agent protocol (< 8 KiB)
49
+ ├── README.md # Public documentation & quickstart
50
+ ├── package.json # Zero-dependency ESM package (Node >= 22.5.0)
51
+ ├── bin/vf.js # Unified CLI (init, status, checkpoint, resume, reason, studio, mcp, handoff, config)
52
+ ├── src/
53
+ │ ├── index.js # Public programmatic SDK exports
54
+ │ ├── core/ # errors.js, hash.js (SHA-256 / HMAC), types.js (schema validators)
55
+ │ ├── policy/authorizer.js # Workspace containment, symlink rejection, allowlist & harness auth
56
+ │ ├── storage/sqlite-store.js # Local SQLite WAL engine (.vectorforce/vectorforce.db)
57
+ │ ├── providers/
58
+ │ │ ├── code-index-provider.js # Zero-dep AST/symbol & dependency graph indexer
59
+ │ │ ├── document-provider.js # Policy-enforced doc reader & SHA-256 evidence collector
60
+ │ │ ├── git-provider.js # Git branch, HEAD SHA, dirty status, and file diff observer
61
+ │ │ └── llm-provider.js # AI adapter (Fireworks, Muse, OpenRouter, Ollama, OpenAI, Anthropic, BYOK)
62
+ │ ├── operations/
63
+ │ │ ├── project-service.js # Project & task lifecycle + allowlist management
64
+ │ │ ├── checkpoint-service.js # Immutable checkpoint creation + evidence collection
65
+ │ │ ├── briefing-service.js # Cross-harness resume briefing + live Git/doc drift reconciliation
66
+ │ │ ├── reasoning-service.js # AI reasoning synthesis over checkpoints + code index + drift
67
+ │ │ └── handoff-service.js # HMAC-SHA256 signed handoff export/import + lineage verification
68
+ │ ├── mcp/
69
+ │ │ ├── mcp-server.js # JSON-RPC 2.0 stdio MCP server exposing 9 tools + 3 resources
70
+ │ │ └── harness-config.js # Auto-generator for Antigravity, Claude, Command Code, Muse, Codex configs
71
+ │ └── studio/server.js # Local HTTP server (127.0.0.1:3210) + REST API for VectorForce Studio
72
+ ├── studio/ # React + Vite + Tailwind + XYFlow frontend for VectorForce Studio
73
+ ├── samples/ # Runnable sample architectures, multi-agent workflows & integrations
74
+ ├── scripts/practical-test-env.js # 7-stage cross-OS practical E2E simulation (Git + CLI + MCP + Handoff)
75
+ ├── test/ # 75 automated unit, security, MCP, and cross-harness tests
76
+ └── wiki/ # Local-only ADRs (001-014) and phase planning (gitignored)
77
+ ```
78
+
79
+ ### Generated Harness Configs in Workspace Root (`vf init`):
80
+ - `.mcp.json`, `.commandcode/mcp.json`, `commandcode.json` — Claude Code & Command Code
81
+ - `.agents/mcp_config.json`, `~/.gemini/antigravity/mcp_config.json` — Google Antigravity
82
+ - `.muse/mcp_config.json`, `musecode.json` — Meta Muse
83
+ - `.codex/config.toml`, `codex.json` — OpenAI Codex CLI
84
+
85
+ ---
86
+
87
+ ## 4. MCP Tools & AI Provider Reference
88
+
89
+ | MCP Tool (`src/mcp/mcp-server.js`) | Service Method | Purpose |
90
+ | :--- | :--- | :--- |
91
+ | `list_tasks` | `ProjectService.listTasks` | Discover active/completed tasks |
92
+ | `save_checkpoint` | `CheckpointService.saveCheckpoint` | Commit claims + Git/doc evidence to SQLite |
93
+ | `get_resume_briefing` | `BriefingService.generateBriefing` | Deterministic cross-harness briefing |
94
+ | `check_workspace_drift` | `BriefingService.checkWorkspaceDrift` | Compare live Git & doc hashes vs checkpoint |
95
+ | `reason_about_task` | `ReasoningService.reasonAboutTask` | AI architectural briefing + risk analysis |
96
+ | `set_document_policy` | `ProjectService.setDocumentPolicy` | Update workspace document allowlist |
97
+ | `export_handoff` | `HandoffService.exportHandoff` | Export HMAC-SHA256 signed `.vfhandoff.json` |
98
+ | `import_handoff` | `HandoffService.importHandoff` | Verify signature/hashes & import handoff |
99
+ | `get_timeline` | `SqliteStore.getAuditEvents` | Inspect chronological audit trail |
100
+
101
+ ### Supported AI Reasoning Providers (`src/providers/llm-provider.js`):
102
+ 1. **Fireworks AI (`Muse Spark Open`)**: `vf config fireworks <KEY>` (`accounts/fireworks/models/muse-spark-open`)
103
+ 2. **Meta Muse Direct**: `vf config muse <KEY>` (`muse-spark-1.3`)
104
+ 3. **OpenRouter (`Muse Spark Open`)**: `vf config openrouter <KEY> --model meta/muse-spark-open`
105
+ 4. **Local Ollama**: `vf config ollama --model llama3.3` (`http://127.0.0.1:11434`)
106
+ 5. **OpenAI / Anthropic / BYOK**: `vf config openai <KEY>` | `vf config anthropic <KEY>` | `vf config byok <URL> <KEY> --model <ID>`
107
+
108
+ ---
109
+
110
+ ## 5. Extension Playbook (Samples & Production Upgrades)
111
+
112
+ 1. **Adding Samples (`samples/`)**: Place runnable workflows, reference architectures, and multi-agent demos inside `samples/` using `src/index.js` or CLI/MCP bridges.
113
+ 2. **Adding/Upgrading MCP Tools**: Add business logic in `src/operations/*`, persistence in `src/storage/sqlite-store.js`, MCP registration in `src/mcp/mcp-server.js`, SDK export in `src/index.js`, and CLI command in `bin/vf.js`.
114
+ 3. **Upgrading Studio UI**: Add REST routes in `src/studio/server.js` and React views in `studio/src/components/`, then build via `npm --prefix studio run build`.
115
+ 4. **Verification Gate**: Always run `npm test` (75 unit/security tests) and `npm run test:practical` (7-stage E2E test) before committing.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Learn With Ohm
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,199 @@
1
- # Temporary Holding Version
1
+ # VectorForce (VF)
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ > **Git for AI Context** — A local-first, privacy-preserving engineering memory platform and architecture control center for AI coding agents.
4
+
5
+ [![Website](https://img.shields.io/badge/website-getvectorforce.github.io-6366f1.svg)](https://getvectorforce.github.io/)
6
+ [![Tests](https://img.shields.io/badge/tests-75%20passing%20(Linux%20%7C%20macOS%20%7C%20Windows)-brightgreen.svg)](https://github.com/getvectorforce/VectorForce/actions)
7
+ [![Dependencies](https://img.shields.io/badge/backend%20runtime%20deps-zero-blue.svg)](#architecture-invariants)
8
+ [![Storage](https://img.shields.io/badge/storage-local%20SQLite%20WAL-orange.svg)](#local-first-architecture)
9
+ [![Harnesses](https://img.shields.io/badge/harnesses-Antigravity%20%7C%20Claude%20Code%20%7C%20Command%20Code%20%7C%20Codex%20%7C%20Muse-purple.svg)](#model-context-protocol-mcp)
10
+ [![Hackathon](https://img.shields.io/badge/Meta%20Muse%20Hackathon-2026-blueviolet.svg)](#5-reason-over-context-ai-engineering-memory)
11
+
12
+ ---
13
+
14
+ ## The Problem: Coding Agent Amnesia
15
+
16
+ Every autonomous coding agent today (Google Antigravity, Command Code, Claude Engineer, etc.) operates in isolated ephemeral sessions. When an agent closes its context window:
17
+ 1. **Architectural Decisions vanish**: Rationale, API boundaries, and non-negotiable constraints are forgotten.
18
+ 2. **Silent Drift goes unnoticed**: Files and documents change without verifying against prior invariant contracts.
19
+ 3. **No Cross-Harness Continuity**: A task started in Antigravity cannot cleanly resume in Command Code or be handed off to a teammate without losing the intent.
20
+
21
+ ## The Solution: VectorForce
22
+
23
+ VectorForce provides an immutable, cryptographic context layer that tracks:
24
+ - **Verifiable Evidence**: Git commit SHAs, file SHA-256 hashes, and workspace drift.
25
+ - **Model Claims**: Explicit goals, constraints, architectural decisions (ADRs), and next steps.
26
+ - **AI Engineering Memory**: Meta Llama / Muse reasoning layer that synthesizes where you left off, what changed, architectural risks, and ranked next actions.
27
+
28
+ ---
29
+
30
+ ## VectorForce Studio (Web UI)
31
+
32
+ VectorForce includes a local-first engineering control center:
33
+
34
+ ```bash
35
+ # Launch VectorForce Studio (opens on port 3210 by default)
36
+ node bin/vf.js studio
37
+ ```
38
+
39
+ ### Studio Features
40
+ - **Project Health & Metrics**: Live health score based on active drift, task completion, and checkpoint currency.
41
+ - **Interactive Architecture Graph**: Interactive SVG topology mapping module dependencies across security, storage, reasoning, code index, and harness bridges. Click any node to inspect blast radius, governing ADRs, and active drift.
42
+ - **AI Workspace Console**: Real-time prompt console powered by Meta Llama / Muse models with strict Claims vs Evidence visual fencing.
43
+ - **Repository Memory & Timeline**: Search indexed symbols, view allowlisted documents, inspect decisions, and generate weekly context continuity recaps.
44
+ - **Team Handoff Preview**: Secure, selective context sharing without leaking private secrets or un-allowlisted documents.
45
+
46
+ ---
47
+
48
+ ## Quickstart
49
+
50
+ ### 1. Initialize a Project
51
+ ```bash
52
+ node bin/vf.js init
53
+ ```
54
+
55
+ ### 2. Create and Select a Task
56
+ ```bash
57
+ node bin/vf.js task auth-module "Implement PKCE OAuth Authentication"
58
+ ```
59
+
60
+ ### 3. Check for Workspace Drift
61
+ ```bash
62
+ node bin/vf.js drift --task auth-module
63
+ ```
64
+
65
+ ### 4. Commit an Immutable Checkpoint
66
+ ```bash
67
+ node bin/vf.js checkpoint --task auth-module \
68
+ --summary "Completed PKCE OAuth handshake and token validation" \
69
+ --goal "Ship secure OAuth flow" \
70
+ --constraint "Zero external auth libraries" \
71
+ --decision "DEC-AUTH-01:PKCE:Use SHA-256 code challenge with local storage" \
72
+ --next "Implement refresh token rotation" \
73
+ --doc "AGENTS.md"
74
+ ```
75
+
76
+ ### 5. Reason Over Context (AI Engineering Memory)
77
+
78
+ VectorForce prioritizes **Meta Muse (`muse-spark-1.3`)** and the open-weights **Meta Muse Spark Open (`muse-spark-open` • 1M token context window)** as its **#1 reasoning models**, while also supporting **Fireworks AI**, **OpenRouter**, **Local Ollama**, **OpenAI / Codex**, **Anthropic Claude**, and any **Custom BYOK** OpenAI-compatible endpoint:
79
+
80
+ ```bash
81
+ # 1. [1st Priority] Meta Muse Direct API (Responses API at api.meta.ai/v1 • muse-spark-1.3):
82
+ node bin/vf.js config muse <YOUR_META_API_KEY>
83
+ node bin/vf.js reason --task auth-module
84
+
85
+ # 2. [1st Priority Open-Weights] Meta "Muse Spark Open" (1M Context) via Fireworks AI:
86
+ node bin/vf.js config fireworks <YOUR_FIREWORKS_API_KEY> accounts/fireworks/models/muse-spark-open
87
+ node bin/vf.js reason --task auth-module
88
+
89
+ # 3. OpenRouter — Meta Muse Spark Open (meta/muse-spark-open), DeepSeek, Claude, Llama 3.3:
90
+ node bin/vf.js config openrouter <YOUR_OPENROUTER_API_KEY> meta/muse-spark-open
91
+ node bin/vf.js config openrouter <YOUR_OPENROUTER_API_KEY> deepseek/deepseek-v4.1-flash-1017
92
+ node bin/vf.js reason --task auth-module
93
+
94
+ # 4. Local Ollama (100% Offline & Private — Default when no cloud API key is set):
95
+ ollama pull llama3.1:8b
96
+ node bin/vf.js config ollama llama3.1:8b
97
+ node bin/vf.js reason --task auth-module
98
+
99
+ # 5. OpenAI / Codex (o3-mini, gpt-4.1, gpt-4o):
100
+ node bin/vf.js config openai <YOUR_OPENAI_API_KEY> o3-mini
101
+ node bin/vf.js reason --task auth-module
102
+
103
+ # 6. Anthropic Claude (claude-sonnet-4-20250514, claude-3-7-sonnet-latest):
104
+ node bin/vf.js config anthropic <YOUR_ANTHROPIC_API_KEY> claude-sonnet-4-20250514
105
+ node bin/vf.js reason --task auth-module
106
+
107
+ # 7. Custom BYOK (Groq, Together AI, LM Studio, vLLM, Azure):
108
+ node bin/vf.js config byok https://api.groq.com/openai/v1 <GROQ_API_KEY> llama-3.3-70b-versatile
109
+ node bin/vf.js config byok http://127.0.0.1:1234/v1 lm-studio qwen2.5-coder-14b
110
+
111
+ # Check active model configuration or run deterministic briefing (--raw):
112
+ node bin/vf.js config status
113
+ node bin/vf.js reason --task auth-module --raw
114
+
115
+ # Launch VectorForce Studio Web Control Center on http://127.0.0.1:3210
116
+ node bin/vf.js studio
117
+ ```
118
+
119
+ ---
120
+
121
+ ## Model Context Protocol (MCP)
122
+
123
+ VectorForce exposes a standard stdio JSON-RPC MCP server for direct integration into **Google Antigravity**, **Claude Code**, **Command Code**, **Meta Muse**, and **OpenAI Codex**.
124
+
125
+ > **How MCP Starts:** You **never** need to run `vf mcp` manually in a terminal. Each AI coding agent reads its configuration file below and automatically spawns VectorForce in the background over `stdio`.
126
+
127
+ | AI Coding Client | Config File Read by Client | 1-Command Auto-Setup |
128
+ |---|---|---|
129
+ | **Google Antigravity** | `.agents/mcp_config.json` & `~/.gemini/antigravity/mcp_config.json` | `node bin/vf.js config install antigravity` |
130
+ | **Claude Code (`claude`)** | `.mcp.json` (project root) | `node bin/vf.js config install claude-code` |
131
+ | **Command Code (`cmd`)** | `.mcp.json` & `commandcode.json` | `node bin/vf.js config install command-code` |
132
+ | **Meta Muse (`muse`)** | `.muse/mcp_config.json` & `~/.config/muse/settings.json` | `node bin/vf.js config install muse` |
133
+ | **OpenAI Codex (`codex`)** | `.codex/config.toml` & `~/.codex/config.toml` | `node bin/vf.js config install codex` |
134
+
135
+ ### Automated Configuration & Health Check
136
+ ```bash
137
+ # Auto-configure all supported AI harnesses at once:
138
+ node bin/vf.js config install all
139
+
140
+ # Verify SQLite DB, AGENTS.md, and all MCP client configs:
141
+ node bin/vf.js status
142
+ ```
143
+
144
+ ### JSON Configuration (Antigravity, Claude Code, Command Code, Muse)
145
+ ```json
146
+ {
147
+ "mcpServers": {
148
+ "vectorforce": {
149
+ "command": "node",
150
+ "args": ["/absolute/path/to/VectorForce/bin/vf.js", "mcp"]
151
+ }
152
+ }
153
+ }
154
+ ```
155
+
156
+ ### TOML Configuration (OpenAI Codex CLI: `.codex/config.toml`)
157
+ ```toml
158
+ [mcp_servers.vectorforce]
159
+ command = "node"
160
+ args = ["/absolute/path/to/VectorForce/bin/vf.js", "mcp"]
161
+ [mcp_servers.vectorforce.env]
162
+ VF_HARNESS = "codex"
163
+ ```
164
+
165
+ ### Available MCP Tools
166
+ | Tool | Purpose |
167
+ |---|---|
168
+ | `save_checkpoint` | Commit an immutable context checkpoint with Git and document evidence |
169
+ | `get_resume_briefing` | Retrieve authorized task briefing with invariant constraints and drift analysis |
170
+ | `check_workspace_drift` | Compare working tree commit and allowlisted file hashes against checkpoint |
171
+ | `reason_about_task` | Llama-powered AI continuation narrative and architectural risk assessment |
172
+ | `list_tasks` | Discover and filter active, archived, or all tasks |
173
+ | `set_document_policy` | Manage project allowlist for verifiable document evidence |
174
+ | `export_handoff` | Create an encrypted, tamper-evident handoff bundle for teammates or other harnesses |
175
+ | `import_handoff` | Safely verify and import a handoff bundle into destination workspace |
176
+ | `get_timeline` | Generate weekly chronological context continuity recap |
177
+
178
+ ---
179
+
180
+ ## Architecture Invariants
181
+
182
+ - **Zero Runtime Dependencies**: The core CLI, MCP server, and Studio backend use exclusively Node.js built-ins (`node:sqlite`, `node:http`, `node:crypto`, `node:fs`).
183
+ - **Local-First Isolation**: Database (`.vectorforce/vectorforce.db`) uses SQLite WAL mode strictly within the user's local workspace. No telemetry or code leaks to external servers.
184
+ - **Claims vs Evidence Distinction**: Human intent and AI outputs are strictly treated as unverifiable `claims`; Git commit SHAs and SHA-256 document hashes are recorded as verifiable `evidence`.
185
+ - **Workspace Containment**: Document collection and AST indexing are strictly constrained to canonical workspace paths; symlinks and secrets (`.env`, `*.key`, `id_rsa`) are strictly ignored.
186
+
187
+ ---
188
+
189
+ ## Verification & Cross-OS Test Suite (Linux, macOS, Windows)
190
+
191
+ Run the full automated test suite (75 unit & security tests) and the 7-stage practical multi-developer environment simulation:
192
+
193
+ ```bash
194
+ # Run all 75 unit, policy, MCP, and security tests:
195
+ npm test
196
+
197
+ # Run the 7-stage practical real-world environment simulation (Git + CLI + live MCP stdio + Handoff + Drift):
198
+ npm run test:practical
199
+ ```