vectorforce 0.0.0-stage → 0.1.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.
- package/.agents/mcp_config.json +17 -0
- package/.codex/config.toml +8 -0
- package/AGENTS.md +43 -0
- package/LICENSE +21 -0
- package/README.md +173 -2
- package/bin/vf.js +756 -0
- package/codex.json +14 -0
- package/commandcode.json +11 -0
- package/musecode.json +18 -0
- package/package.json +39 -4
- package/src/core/errors.js +45 -0
- package/src/core/hash.js +56 -0
- package/src/core/types.js +194 -0
- package/src/index.js +17 -0
- package/src/mcp/harness-config.js +498 -0
- package/src/mcp/mcp-server.js +507 -0
- package/src/operations/briefing-service.js +313 -0
- package/src/operations/checkpoint-service.js +120 -0
- package/src/operations/handoff-service.js +343 -0
- package/src/operations/project-service.js +132 -0
- package/src/operations/reasoning-service.js +356 -0
- package/src/policy/authorizer.js +147 -0
- package/src/providers/code-index-provider.js +285 -0
- package/src/providers/document-provider.js +105 -0
- package/src/providers/git-provider.js +98 -0
- package/src/providers/llm-provider.js +410 -0
- package/src/storage/sqlite-store.js +387 -0
- package/src/studio/server.js +456 -0
- package/studio/dist/assets/index-DTKNBk3V.css +2 -0
- package/studio/dist/assets/index-X-wHcJ6r.js +9 -0
- package/studio/dist/favicon.svg +1 -0
- package/studio/dist/icons.svg +24 -0
- package/studio/dist/index.html +17 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
{
|
|
2
|
+
"mcpServers": {
|
|
3
|
+
"vectorforce": {
|
|
4
|
+
"command": "node",
|
|
5
|
+
"args": [
|
|
6
|
+
"/Users/omprakashprajapat/AgentAI/VectorForce/bin/vf.js",
|
|
7
|
+
"mcp",
|
|
8
|
+
"--workspace",
|
|
9
|
+
"/Users/omprakashprajapat/AgentAI/VectorForce"
|
|
10
|
+
],
|
|
11
|
+
"env": {
|
|
12
|
+
"VF_WORKSPACE": "/Users/omprakashprajapat/AgentAI/VectorForce",
|
|
13
|
+
"VF_DB_PATH": "/Users/omprakashprajapat/AgentAI/VectorForce/.vectorforce/vectorforce.db"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Agent Context Sharing & Continuity Guidelines (VectorForce)
|
|
2
|
+
|
|
3
|
+
This project uses **VectorForce** as a local-first, privacy-preserving engineering context platform ("Git for AI context").
|
|
4
|
+
|
|
5
|
+
## 1. Context Protocol Workflow
|
|
6
|
+
|
|
7
|
+
Whenever you are working in this repository (in Google Antigravity, Command Code, Meta Muse, or OpenAI Codex):
|
|
8
|
+
|
|
9
|
+
### At the Start of a Task / Resuming Work:
|
|
10
|
+
1. **Discover active tasks:**
|
|
11
|
+
- Call MCP tool: `list_tasks({ status: "active" })`
|
|
12
|
+
- Or CLI: `node bin/vf.js tasks active`
|
|
13
|
+
2. **Check for workspace or document drift:**
|
|
14
|
+
- Call MCP tool: `check_workspace_drift({ task_id: "<task_id>" })`
|
|
15
|
+
- Or CLI: `node bin/vf.js drift --task <task_id>`
|
|
16
|
+
3. **Retrieve the authorized briefing:**
|
|
17
|
+
- Call MCP tool: `get_resume_briefing({ task_id: "<task_id>", destination_harness: "antigravity" })` (use your harness: `"antigravity"`, `"codex"`, `"command-code"`, or `"muse-code"`)
|
|
18
|
+
- Or CLI: `node bin/vf.js resume --task <task_id> --dest antigravity`
|
|
19
|
+
4. **Reason over the context (AI memory):**
|
|
20
|
+
- Call MCP tool: `reason_about_task({ task_id: "<task_id>" })`
|
|
21
|
+
- Or CLI: `node bin/vf.js reason --task <task_id>` (alias: `node bin/vf.js continue`)
|
|
22
|
+
- Produces a Llama-generated narrative: where you left off, what changed since the checkpoint, architectural risks, and ranked next actions. Requires a configured provider (`VF_LLM_*` cloud Llama/Muse or `VF_OLLAMA_*` local); it degrades to the deterministic briefing when unavailable.
|
|
23
|
+
5. **Adhere to Invariant Constraints:** Respect all non-negotiable constraints listed under the briefing's `# Invariant Constraints` section.
|
|
24
|
+
|
|
25
|
+
### At the End of a Task Phase / Before Switching Harnesses:
|
|
26
|
+
1. **Capture an immutable checkpoint:**
|
|
27
|
+
- Call MCP tool: `save_checkpoint({ task_id, summary, goals, constraints, decisions, next_steps, requested_documents })`
|
|
28
|
+
- Or CLI:
|
|
29
|
+
```bash
|
|
30
|
+
node bin/vf.js checkpoint --task <id> --summary "<summary>" \
|
|
31
|
+
--goal "<goal>" --constraint "<constraint>" \
|
|
32
|
+
--decision "<ID>:<Title>:<Rationale>" \
|
|
33
|
+
--next "<next_step>" --doc "<allowlisted_doc.md>"
|
|
34
|
+
```
|
|
35
|
+
2. **Verification Receipt:** Ensure the operation receipt returns `status: "committed"`.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 2. Security & Policy Invariants
|
|
40
|
+
|
|
41
|
+
- **Claims vs Evidence Distinction:** Goals, constraints, and decisions are model assertions (`claims`). Git commits and document hashes are verifiable observations (`evidence`). Never confuse an unverified model claim with ground truth.
|
|
42
|
+
- **Strict Document Allowlists:** Only files registered in the project allowlist (`node bin/vf.js policy list`) can be collected as document evidence. Never attempt path traversal outside the workspace.
|
|
43
|
+
- **Safe Receipts:** Receipts never contain document bodies or private credentials.
|
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,174 @@
|
|
|
1
|
-
#
|
|
1
|
+
# VectorForce (VF)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> **Git for AI Context** — A local-first, privacy-preserving engineering memory platform and architecture control center for AI coding agents.
|
|
4
|
+
|
|
5
|
+
[](#test-suite)
|
|
6
|
+
[](#architecture-invariants)
|
|
7
|
+
[](#local-first-architecture)
|
|
8
|
+
[](#harness-integrations)
|
|
9
|
+
[](#meta-muse-hackathon)
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## The Problem: Coding Agent Amnesia
|
|
14
|
+
|
|
15
|
+
Every autonomous coding agent today (Google Antigravity, Command Code, Claude Engineer, etc.) operates in isolated ephemeral sessions. When an agent closes its context window:
|
|
16
|
+
1. **Architectural Decisions vanish**: Rationale, API boundaries, and non-negotiable constraints are forgotten.
|
|
17
|
+
2. **Silent Drift goes unnoticed**: Files and documents change without verifying against prior invariant contracts.
|
|
18
|
+
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.
|
|
19
|
+
|
|
20
|
+
## The Solution: VectorForce
|
|
21
|
+
|
|
22
|
+
VectorForce provides an immutable, cryptographic context layer that tracks:
|
|
23
|
+
- **Verifiable Evidence**: Git commit SHAs, file SHA-256 hashes, and workspace drift.
|
|
24
|
+
- **Model Claims**: Explicit goals, constraints, architectural decisions (ADRs), and next steps.
|
|
25
|
+
- **AI Engineering Memory**: Meta Llama / Muse reasoning layer that synthesizes where you left off, what changed, architectural risks, and ranked next actions.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## VectorForce Studio (Web UI)
|
|
30
|
+
|
|
31
|
+
VectorForce includes a local-first engineering control center:
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
# Launch VectorForce Studio (opens on port 3210 by default)
|
|
35
|
+
node bin/vf.js studio
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Studio Features
|
|
39
|
+
- **Project Health & Metrics**: Live health score based on active drift, task completion, and checkpoint currency.
|
|
40
|
+
- **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.
|
|
41
|
+
- **AI Workspace Console**: Real-time prompt console powered by Meta Llama / Muse models with strict Claims vs Evidence visual fencing.
|
|
42
|
+
- **Repository Memory & Timeline**: Search indexed symbols, view allowlisted documents, inspect decisions, and generate weekly context continuity recaps.
|
|
43
|
+
- **Team Handoff Preview**: Secure, selective context sharing without leaking private secrets or un-allowlisted documents.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Quickstart
|
|
48
|
+
|
|
49
|
+
### 1. Initialize a Project
|
|
50
|
+
```bash
|
|
51
|
+
node bin/vf.js init
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 2. Create and Select a Task
|
|
55
|
+
```bash
|
|
56
|
+
node bin/vf.js task auth-module "Implement PKCE OAuth Authentication"
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### 3. Check for Workspace Drift
|
|
60
|
+
```bash
|
|
61
|
+
node bin/vf.js drift --task auth-module
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### 4. Commit an Immutable Checkpoint
|
|
65
|
+
```bash
|
|
66
|
+
node bin/vf.js checkpoint --task auth-module \
|
|
67
|
+
--summary "Completed PKCE OAuth handshake and token validation" \
|
|
68
|
+
--goal "Ship secure OAuth flow" \
|
|
69
|
+
--constraint "Zero external auth libraries" \
|
|
70
|
+
--decision "DEC-AUTH-01:PKCE:Use SHA-256 code challenge with local storage" \
|
|
71
|
+
--next "Implement refresh token rotation" \
|
|
72
|
+
--doc "AGENTS.md"
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### 5. Reason Over Context (AI Engineering Memory)
|
|
76
|
+
```bash
|
|
77
|
+
# Uses local Ollama by default, or cloud providers (Meta Muse, OpenRouter, OpenAI Codex)
|
|
78
|
+
# With Meta Muse (Responses API at api.meta.ai):
|
|
79
|
+
node bin/vf.js config muse <API_KEY>
|
|
80
|
+
node bin/vf.js reason --task auth-module
|
|
81
|
+
|
|
82
|
+
# With OpenRouter + DeepSeek v4.1 Flash:
|
|
83
|
+
export OPENROUTER_API_KEY="sk-or-v1-..."
|
|
84
|
+
node bin/vf.js reason --task auth-module
|
|
85
|
+
|
|
86
|
+
# Or specify model explicitly:
|
|
87
|
+
node bin/vf.js reason --task auth-module --model deepseek/deepseek-v4.1-flash-1017
|
|
88
|
+
|
|
89
|
+
# Degrades deterministically if no LLM provider is configured
|
|
90
|
+
node bin/vf.js reason --task auth-module --no-llm
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Model Context Protocol (MCP)
|
|
96
|
+
|
|
97
|
+
VectorForce exposes a standard stdio JSON-RPC MCP server for direct integration into **Google Antigravity**, **Command Code**, **Meta Muse**, and **OpenAI Codex**:
|
|
98
|
+
|
|
99
|
+
### JSON Configuration (Antigravity, Command Code, Muse)
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"mcpServers": {
|
|
103
|
+
"vectorforce": {
|
|
104
|
+
"command": "node",
|
|
105
|
+
"args": ["/absolute/path/to/VectorForce/bin/vf.js", "mcp"]
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### TOML Configuration (OpenAI Codex CLI: `.codex/config.toml`)
|
|
112
|
+
```toml
|
|
113
|
+
[mcp_servers.vectorforce]
|
|
114
|
+
command = "node"
|
|
115
|
+
args = ["/absolute/path/to/VectorForce/bin/vf.js", "mcp"]
|
|
116
|
+
[mcp_servers.vectorforce.env]
|
|
117
|
+
VF_HARNESS = "codex"
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Automated Configuration
|
|
121
|
+
```bash
|
|
122
|
+
# Auto-configure for a specific harness:
|
|
123
|
+
node bin/vf.js config install codex
|
|
124
|
+
node bin/vf.js config install antigravity
|
|
125
|
+
node bin/vf.js config install command-code
|
|
126
|
+
|
|
127
|
+
# Or install for all supported harnesses at once:
|
|
128
|
+
node bin/vf.js config install all
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### Available MCP Tools
|
|
132
|
+
| Tool | Purpose |
|
|
133
|
+
|---|---|
|
|
134
|
+
| `save_checkpoint` | Commit an immutable context checkpoint with Git and document evidence |
|
|
135
|
+
| `get_resume_briefing` | Retrieve authorized task briefing with invariant constraints and drift analysis |
|
|
136
|
+
| `check_workspace_drift` | Compare working tree commit and allowlisted file hashes against checkpoint |
|
|
137
|
+
| `reason_about_task` | Llama-powered AI continuation narrative and architectural risk assessment |
|
|
138
|
+
| `list_tasks` | Discover and filter active, archived, or all tasks |
|
|
139
|
+
| `set_document_policy` | Manage project allowlist for verifiable document evidence |
|
|
140
|
+
| `export_handoff` | Create an encrypted, tamper-evident handoff bundle for teammates or other harnesses |
|
|
141
|
+
| `import_handoff` | Safely verify and import a handoff bundle into destination workspace |
|
|
142
|
+
| `get_timeline` | Generate weekly chronological context continuity recap |
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Architecture Invariants
|
|
147
|
+
|
|
148
|
+
- **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`).
|
|
149
|
+
- **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.
|
|
150
|
+
- **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`.
|
|
151
|
+
- **Workspace Containment**: Document collection and AST indexing are strictly constrained to canonical workspace paths; symlinks and secrets (`.env`, `*.key`, `id_rsa`) are strictly ignored.
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Architecture Decision Records (ADR)
|
|
156
|
+
|
|
157
|
+
All design decisions are formalized in the [`wiki/`](wiki/README.md):
|
|
158
|
+
|
|
159
|
+
- [ADR-001: Event-driven context architecture](wiki/decisions/adr-001-event-driven-harness-independent-context-architecture.md)
|
|
160
|
+
- [ADR-002: Local-first checkpoints & disclosure boundaries](wiki/decisions/adr-002-local-first-checkpoints-and-disclosure-boundaries.md)
|
|
161
|
+
- [ADR-003: Portable checkpoints & cross-harness resume](wiki/decisions/adr-003-portable-checkpoints-and-cross-harness-resume.md)
|
|
162
|
+
- [ADR-012: Target harnesses: Antigravity & Command Code](wiki/decisions/adr-012-target-harness-selection-antigravity-commandcode-pidev.md)
|
|
163
|
+
- [ADR-013: AI reasoning layer & model provider authorization](wiki/decisions/adr-013-ai-reasoning-layer-and-provider-authorization.md)
|
|
164
|
+
- [ADR-014: VectorForce Studio & local topology visualizer](wiki/decisions/adr-014-vectorforce-studio-and-local-topology-visualizer.md)
|
|
165
|
+
|
|
166
|
+
---
|
|
167
|
+
|
|
168
|
+
## Verification & Test Suite
|
|
169
|
+
|
|
170
|
+
Run the full automated test suite (62 tests across 15 suites):
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
npm test
|
|
174
|
+
```
|