@jigyasudham/veto 2.0.1 → 2.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.
Files changed (105) hide show
  1. package/README.md +391 -658
  2. package/dist/agents/executor.d.ts.map +1 -1
  3. package/dist/agents/executor.js +3 -1
  4. package/dist/agents/executor.js.map +1 -1
  5. package/dist/agents/llm-runner.d.ts.map +1 -1
  6. package/dist/agents/llm-runner.js +62 -58
  7. package/dist/agents/llm-runner.js.map +1 -1
  8. package/dist/cli.js +84 -9
  9. package/dist/cli.js.map +1 -1
  10. package/dist/log.d.ts +9 -0
  11. package/dist/log.d.ts.map +1 -0
  12. package/dist/log.js +33 -0
  13. package/dist/log.js.map +1 -0
  14. package/dist/memory/config.d.ts +2 -0
  15. package/dist/memory/config.d.ts.map +1 -1
  16. package/dist/memory/config.js +4 -2
  17. package/dist/memory/config.js.map +1 -1
  18. package/dist/memory/local.d.ts.map +1 -1
  19. package/dist/memory/local.js +3 -1
  20. package/dist/memory/local.js.map +1 -1
  21. package/dist/memory/schema.d.ts +1 -1
  22. package/dist/memory/schema.d.ts.map +1 -1
  23. package/dist/memory/schema.js +1 -0
  24. package/dist/memory/schema.js.map +1 -1
  25. package/dist/router/learning-updater.d.ts +4 -1
  26. package/dist/router/learning-updater.d.ts.map +1 -1
  27. package/dist/router/learning-updater.js +10 -0
  28. package/dist/router/learning-updater.js.map +1 -1
  29. package/dist/server/handlers/advisors.d.ts +3 -0
  30. package/dist/server/handlers/advisors.d.ts.map +1 -0
  31. package/dist/server/handlers/advisors.js +331 -0
  32. package/dist/server/handlers/advisors.js.map +1 -0
  33. package/dist/server/handlers/agents.d.ts +3 -0
  34. package/dist/server/handlers/agents.d.ts.map +1 -0
  35. package/dist/server/handlers/agents.js +202 -0
  36. package/dist/server/handlers/agents.js.map +1 -0
  37. package/dist/server/handlers/core.d.ts +3 -0
  38. package/dist/server/handlers/core.d.ts.map +1 -0
  39. package/dist/server/handlers/core.js +169 -0
  40. package/dist/server/handlers/core.js.map +1 -0
  41. package/dist/server/handlers/council.d.ts +3 -0
  42. package/dist/server/handlers/council.d.ts.map +1 -0
  43. package/dist/server/handlers/council.js +277 -0
  44. package/dist/server/handlers/council.js.map +1 -0
  45. package/dist/server/handlers/devtools.d.ts +3 -0
  46. package/dist/server/handlers/devtools.d.ts.map +1 -0
  47. package/dist/server/handlers/devtools.js +41 -0
  48. package/dist/server/handlers/devtools.js.map +1 -0
  49. package/dist/server/handlers/generators.d.ts +3 -0
  50. package/dist/server/handlers/generators.d.ts.map +1 -0
  51. package/dist/server/handlers/generators.js +541 -0
  52. package/dist/server/handlers/generators.js.map +1 -0
  53. package/dist/server/handlers/git.d.ts +3 -0
  54. package/dist/server/handlers/git.d.ts.map +1 -0
  55. package/dist/server/handlers/git.js +225 -0
  56. package/dist/server/handlers/git.js.map +1 -0
  57. package/dist/server/handlers/learning.d.ts +3 -0
  58. package/dist/server/handlers/learning.d.ts.map +1 -0
  59. package/dist/server/handlers/learning.js +60 -0
  60. package/dist/server/handlers/learning.js.map +1 -0
  61. package/dist/server/handlers/memory.d.ts +3 -0
  62. package/dist/server/handlers/memory.d.ts.map +1 -0
  63. package/dist/server/handlers/memory.js +181 -0
  64. package/dist/server/handlers/memory.js.map +1 -0
  65. package/dist/server/handlers/observability.d.ts +3 -0
  66. package/dist/server/handlers/observability.d.ts.map +1 -0
  67. package/dist/server/handlers/observability.js +132 -0
  68. package/dist/server/handlers/observability.js.map +1 -0
  69. package/dist/server/handlers/review.d.ts +3 -0
  70. package/dist/server/handlers/review.d.ts.map +1 -0
  71. package/dist/server/handlers/review.js +327 -0
  72. package/dist/server/handlers/review.js.map +1 -0
  73. package/dist/server/handlers/session.d.ts +3 -0
  74. package/dist/server/handlers/session.d.ts.map +1 -0
  75. package/dist/server/handlers/session.js +272 -0
  76. package/dist/server/handlers/session.js.map +1 -0
  77. package/dist/server/handlers/watch.d.ts +3 -0
  78. package/dist/server/handlers/watch.d.ts.map +1 -0
  79. package/dist/server/handlers/watch.js +29 -0
  80. package/dist/server/handlers/watch.js.map +1 -0
  81. package/dist/server/handlers/workers.d.ts +3 -0
  82. package/dist/server/handlers/workers.d.ts.map +1 -0
  83. package/dist/server/handlers/workers.js +27 -0
  84. package/dist/server/handlers/workers.js.map +1 -0
  85. package/dist/server/registry.d.ts +11 -0
  86. package/dist/server/registry.d.ts.map +1 -0
  87. package/dist/server/registry.js +9 -0
  88. package/dist/server/registry.js.map +1 -0
  89. package/dist/server/runtime.d.ts +49 -0
  90. package/dist/server/runtime.d.ts.map +1 -0
  91. package/dist/server/runtime.js +81 -0
  92. package/dist/server/runtime.js.map +1 -0
  93. package/dist/server/scan-core.d.ts +32 -0
  94. package/dist/server/scan-core.d.ts.map +1 -0
  95. package/dist/server/scan-core.js +82 -0
  96. package/dist/server/scan-core.js.map +1 -0
  97. package/dist/server.d.ts +1 -1
  98. package/dist/server.d.ts.map +1 -1
  99. package/dist/server.js +64 -2944
  100. package/dist/server.js.map +1 -1
  101. package/dist/tools/definitions.d.ts +4 -4
  102. package/dist/tools/definitions.js +4 -4
  103. package/dist/tools/definitions.js.map +1 -1
  104. package/package.json +2 -2
  105. package/AGENTS.md +0 -134
package/README.md CHANGED
@@ -1,658 +1,391 @@
1
- # veto
2
-
3
- > **62 agentic tools. 50+ specialists. 4 AIs. Self-learning. Zero cost.**
4
-
5
- An MCP server that runs locally on your machine, plugs into Claude Code, Codex CLI, Gemini CLI, Antigravity CLI, Cursor, Windsurf, Zed, Copilot, and JetBrains using your existing subscriptions — giving every AI a council of specialist agents, local LLM support, SDD agents, playwright automation, persistent cross-platform memory, a self-learning router, CI/CD gates, workspace discovery, and bidirectional IDE communication.
6
-
7
- ---
8
-
9
- ## How the Agents Actually Work
10
-
11
- **Veto v2.0 is now 100% Agentic.**
12
-
13
- Every tool in Veto uses a **2-phase agentic loop pattern** — no API keys required, zero extra cost, working identically across Claude Code, Gemini CLI, Antigravity CLI, and Codex CLI.
14
-
15
- ### The 2-Phase Agentic Loop
16
- 1. **Phase 1 (Sampling):** The tool first attempts real LLM reasoning via **MCP Sampling** (the host AI's native ability to "create a message"). If supported by your client (like Claude Code or Gemini CLI), the agent performs deep reasoning and returns a structured plan or analysis instantly.
17
- 2. **Phase 2 (Upgrade Prompt):** If Sampling is unavailable or fails, Veto returns an `llm_upgrade` prompt. You (the host AI) read the specialist's role and task, perform the reasoning yourself, and pass the JSON response back to complete the operation.
18
-
19
- ### Specialist Roles
20
- Veto provides a council of 7 senior governance agents plus 55+ domain-specific worker agents.
21
-
22
- | Agent Group | Specialist Roles |
23
- |---|---|
24
- | **Council** | Lead Dev · PM · Architect · UX · Devil's Advocate · Legal · Security |
25
- | **Development** | Coder · Reviewer · Tester · Debugger · Refactor · Database · API · Frontend · Backend · DevOps · Performance · Migration |
26
- | **Advanced** | Local LLM (Ollama) · Semantic Search · SDD Agent · Playwright · i18n Translate · a11y Advisor |
27
- | **Intelligence** | Task Planner · Researcher · Tech Advisor · Risk Assessor · Cost Analyzer · Ethics/Bias |
28
- | **Workflow** | File Manager · Git Agent · Search Agent · Reporter · Automation |
29
-
30
- ### All 62 Tools are now 100% Agentic
31
-
32
- > Pattern matching, domain heuristics, and structured templates compiled into code. Offline capable. No LLM calls.
33
-
34
- **Development (12)**
35
- `Coder` · `Code Reviewer` · `Tester` · `Debugger` · `Refactor` · `Database` · `API` · `Frontend` · `Backend` · `DevOps` · `Performance` · `Migration`
36
-
37
- **Security (6)**
38
- `Security Scanner` · `Auth Agent` · `Data Privacy` · `Secrets Agent` · `Dependency Audit` · `Penetration Tester`
39
-
40
- **Memory (5)**
41
- `Context Manager` · `Decision Logger` · `Project Mapper` · `Pattern Learner` · `Knowledge Base`
42
-
43
- **Research (7)**
44
- `Researcher` · `Tech Advisor` · `Cost Analyzer` · `Competitor Analyzer` · `Risk Assessor` · `Estimator` · `Ethics & Bias`
45
-
46
- **Quality (5)**
47
- `Code Quality` · `Documentation` · `Accessibility` · `Compatibility` · `Error Handling`
48
-
49
- **Workflow (7)**
50
- `Task Planner` · `Task Coordinator` · `File Manager` · `Git Agent` · `Search Agent` · `Reporter` · `Automation`
51
-
52
- ---
53
-
54
- ## MCP Tools (62)
55
-
56
- | Category | Tools |
57
- |---|---|
58
- | **Session** | `veto_status` · `veto_session_save` · `veto_session_restore` · `veto_sessions_list` · `veto_autosave_status` · `veto_session_replay` |
59
- | **Router** | `veto_route_task` · `veto_rate_status` |
60
- | **Council** | `veto_council_debate` · `veto_benchmark` · `veto_adr` |
61
- | **Agents** | `veto_agent_plan` · `veto_execute_parallel` · `veto_explain` · `veto_compose_agents` · `veto_delegate` |
62
- | **Review** | `veto_code_review` · `veto_security_scan` · `veto_secrets_scan` · `veto_diff_review` · `veto_full_review` · `veto_pr_review` |
63
- | **Pipelines** | `veto_pre_commit` · `veto_new_feature` · `veto_workflow` · `veto_task_parse` |
64
- | **Advanced** | `veto_local_llm` · `veto_semantic_search` · `veto_sdd_agent` · `veto_playwright` · `veto_notify_ide` |
65
- | **Quality** | `veto_clone_detector` · `veto_lint_rules` · `veto_api_contract` · `veto_a11y_advisor` · `veto_type_coverage` · `veto_test_gaps` |
66
- | **Watching** | `veto_watch` · `veto_watch_poll` · `veto_watch_stop` |
67
- | **Memory** | `veto_memory_store` · `veto_memory_search` · `veto_memory_delete` · `veto_project_map_update` · `veto_project_map_get` · `veto_pattern_store` · `veto_patterns_list` · `veto_memory_export` · `veto_memory_import` |
68
- | **Learning** | `veto_record_outcome` · `veto_learning_stats` · `veto_learning_apply` |
69
- | **Handoff** | `veto_handoff` · `veto_continue` · `veto_platform_setup` |
70
- | **Observability** | `veto_usage_status` · `veto_audit_log` · `veto_health` · `veto_metrics` |
71
- | **Discover** | `veto_discover` · `veto_summarize` · `veto_git_blame` · `veto_changelog` · `veto_onboard` · `veto_debt_register` |
72
- | **DevTools** | `veto_docs_fetch` · `veto_context_status` · `veto_openapi_gen` · `veto_flag_auditor` · `veto_env_setup` · `veto_commit_message` · `veto_pr_description` · `veto_pr_post` · `veto_prompt_optimizer` · `veto_sre_advisor` · `veto_diagram` · `veto_rca` · `veto_translate` · `veto_merge_conflict` |
73
- | **Plugins** | `veto_plugins` |
74
-
75
- ## MCP Resources
76
-
77
- | URI | What it returns |
78
- |---|---|
79
- | `veto://sessions` | All saved sessions across platforms |
80
- | `veto://project-map?dir=<path>` | Stored project structure map |
81
- | `veto://memory?q=<query>` | Knowledge base search results |
82
- | `veto://patterns` | Learned coding patterns |
83
-
84
- ## MCP Prompts
85
-
86
- | Prompt | What it does |
87
- |---|---|
88
- | `code-review` | Full code review paste code, get scored findings |
89
- | `security-audit` | OWASP Top 10 scan with CWE references |
90
- | `deploy-checklist` | Council reviews your deployment plan before you ship |
91
- | `explain-file` | Expert explanation of any file, auto-routed by type |
92
-
93
- ---
94
-
95
- ## CLI Commands
96
-
97
- ```bash
98
- veto init # Configure all AI tools + scan project
99
- veto doctor # Check MCP registrations + system health
100
- veto status # Version, DB path, session/memory/outcome counts
101
- veto version # Alias for veto status
102
- veto sessions # List last 20 saved sessions ([auto] badge on auto-saves)
103
- veto sessions --clean # Remove auto-saves older than 7 days
104
- veto memory [query] # Search knowledge base (blank = all entries)
105
- veto patterns [prefix] # List learned agent/routing patterns
106
- veto hook install # Install pre-commit secrets scan hook
107
- veto hook remove # Remove the veto pre-commit hook
108
- veto check # Scan staged changes for secrets (used by hook)
109
- veto help # Commands + MCP tools reference
110
- veto help --troubleshoot # Full troubleshooting guide (14 scenarios)
111
- ```
112
-
113
- `veto help` shows all CLI commands, all 49 MCP tool names, MCP Resources, and MCP Prompts.
114
-
115
- ### `veto doctor`
116
-
117
- ```
118
- veto doctor
119
-
120
- Veto Doctor system health check
121
- ─────────────────────────────────────────────────────
122
- Node.js v22.5.0
123
- ~/.veto exists
124
- ✓ Database ~/.veto/veto.db
125
- 17 sessions · 12 memories · 3 patterns
126
-
127
- MCP Registrations
128
- ─────────────────────────────────────────────────────
129
- Claude Coderegistered
130
- Gemini CLI registered
131
- · Codex CLI not installed
132
- · Zed not installed
133
-
134
- ✓ All checks passed — Veto is healthy!
135
- ```
136
-
137
- ---
138
-
139
- ## Council Debate
140
-
141
- Two-phase flow — works on Claude Code, Gemini CLI, and Codex CLI with no API keys:
142
-
143
- ```
144
- # Phase 1 call with task, get instant deterministic result + LLM upgrade prompt
145
- veto_council_debate {
146
- task: "migrate auth from sessions to JWTs",
147
- project_dir: "/your/project",
148
- strictness: "standard"
149
- }
150
- {
151
- llm_backed: false,
152
- final_verdict: "YELLOW",
153
- votes: { lead_dev: {...}, architect: {...}, security: {...}, ... },
154
- llm_upgrade: {
155
- available: true,
156
- instruction: "Read debate_prompt, reason as all 7 agents, call again with agent_responses",
157
- debate_prompt: "You are running a Veto Council debate. Analyze the task as each specialist..."
158
- }
159
- }
160
-
161
- # Phase 2 — reason as all 7 agents, pass responses back → get LLM-backed verdict
162
- veto_council_debate {
163
- task: "migrate auth from sessions to JWTs",
164
- agent_responses: {
165
- lead_dev: { verdict: "warn", reason: "Stateless JWTs complicate logout — need blocklist", concerns: ["Refresh token rotation must be atomic"], recommendation: "Use short-lived access tokens (15m) + httpOnly refresh tokens" },
166
- pm: { verdict: "approve", reason: "JWT migration unblocks mobile clients", concerns: [], recommendation: "Ship behind a feature flag, roll back if logout issues" },
167
- architect: { verdict: "approve", reason: "Good fit for stateless microservice boundary", concerns: ["Clock skew can break expiry across services"], recommendation: "Add NTP sync check; use relative expiry not absolute timestamps" },
168
- ux: { verdict: "approve", reason: "No user-visible change if migration is seamless", concerns: [], recommendation: "Silent migration no logout required for existing sessions" },
169
- devil: { verdict: "warn", reason: "What if the refresh token store goes down at 2AM?", concerns: ["Redis outage = all users logged out", "Token replay attack window between rotation and invalidation"], recommendation: "Fallback to session auth if Redis is down; use short rotation window" },
170
- legal: { verdict: "approve", reason: "JWTs are industry standard, no new compliance risk", concerns: [], recommendation: "Document token storage in privacy policy" },
171
- security: { verdict: "warn", reason: "Refresh token rotation must be atomic TOCTOU risk", concerns: ["localStorage storage of access token is XSS-vulnerable"], recommendation: "Store access token in memory only; refresh token in httpOnly Secure SameSite=Strict cookie" }
172
- }
173
- }
174
- {
175
- llm_backed: true,
176
- final_verdict: "YELLOW",
177
- block_reasons: [],
178
- warnings: ["Refresh token rotation must be atomic...", "What if the refresh token store goes down..."],
179
- recommended: "Proceed with JWT. Use httpOnly cookies for refresh tokens, memory-only for access tokens..."
180
- }
181
- ```
182
-
183
- When the task presents a binary choice, agents name the option they prefer and the output includes a `🎯 Council leans toward:` line:
184
-
185
- ```
186
- veto_council_debate {
187
- task: "Should we add an Express HTTP layer or keep Veto pure MCP with an external adapter?"
188
- }
189
- → formatted_output includes:
190
- 🎯 Council leans toward: "pure MCP with an external adapter" (5 agents prefer it)
191
- Lead Dev: [Express HTTP vs external adapter] ... [WARN]
192
- recommendation: Prefer "external adapter" — Express adds new infrastructure...
193
- Security: [Express HTTP vs external adapter] ... [WARN]
194
- recommendation: Prefer "external adapter" — keeps the threat model local-only...
195
- ```
196
-
197
- ---
198
-
199
- ## Session Tagging + Search
200
-
201
- Tag sessions when saving to make them findable later:
202
-
203
- ```
204
- # Let Veto generate the summary from conversation context
205
- veto_session_save {
206
- auto_summarize: true,
207
- tags: ["auth", "jwt", "middleware"]
208
- }
209
-
210
- # Or write it manually
211
- veto_session_save {
212
- summary: "Implemented JWT auth middleware",
213
- context: "...",
214
- tags: ["auth", "jwt", "middleware"]
215
- }
216
-
217
- # Find it weeks later:
218
- veto_sessions_list { query: "auth" }
219
- → sessions matching "auth" in summary, context, tags, or project_dir
220
- ```
221
-
222
- ---
223
-
224
- ## New in v1.4.4
225
-
226
- ### Token count now updates from `veto_session_save`
227
-
228
- Previously, token count and context window usage only updated when `veto_status { token_count: N }` was called. Saving a session without calling status first left the VS Code extension and autosave status showing stale or zero values.
229
-
230
- Now `veto_session_save { token_count: N }` directly:
231
- - Calls `trackTokens()` to update the daily rate tracker
232
- - Upserts into the new `context_usage` table with `usage_pct` computed from the model's actual context window
233
-
234
- ```
235
- veto_session_save {
236
- summary: "...",
237
- context: "...",
238
- token_count: 45000, ← now updates live display immediately
239
- platform: "claude",
240
- model: "claude-sonnet-4-6" resolves exact 1M window for accurate %
241
- }
242
- → { usage_pct: 4.5, auto_summarized: false, ... }
243
- ```
244
-
245
- ### `context_usage` table — live DB polling for VS Code extension
246
-
247
- A new single-row-per-platform table in `~/.veto/veto.db` that always holds the latest known context state. Your VS Code extension can poll or watch this table directly:
248
-
249
- ```sql
250
- SELECT platform, model, token_count, context_window, usage_pct, updated_at
251
- FROM context_usage
252
- ORDER BY updated_at DESC
253
- ```
254
-
255
- Updated by both `veto_session_save` and `veto_status` whenever `token_count > 0` is passed. `veto_autosave_status` now includes `live_context_usage` in its response.
256
-
257
- ---
258
-
259
- ## New in v1.4.3
260
-
261
- ### Council debate + session save — work on Gemini CLI and Codex CLI
262
-
263
- MCP Sampling (`server.createMessage`) is not yet implemented by any of the four CLI hosts. Previously this meant the council always used deterministic fallbacks and `auto_summarize` never ran on any platform.
264
-
265
- **v1.4.3 introduces the agentic loop pattern** — no API keys, no sampling dependency, works on all four platforms identically.
266
-
267
- #### Council debate — two-phase LLM upgrade
268
-
269
- ```
270
- # Phase 1 always returns an instant deterministic result
271
- veto_council_debate { task: "migrate auth to JWT" }
272
- {
273
- llm_backed: false,
274
- final_verdict: "YELLOW",
275
- votes: { ... }, ← deterministic agent analysis
276
- llm_upgrade: {
277
- available: true,
278
- instruction: "Read debate_prompt, reason as all 7 agents, call again with agent_responses",
279
- debate_prompt: "You are running a Veto Council debate. Analyze the task as each specialist..."
280
- }
281
- }
282
-
283
- # Phase 2 — call again with your agent_responses → get the LLM-backed verdict
284
- veto_council_debate {
285
- task: "migrate auth to JWT",
286
- agent_responses: {
287
- lead_dev: { verdict: "warn", reason: "...", concerns: [], recommendation: "..." },
288
- pm: { verdict: "approve", ... },
289
- architect: { verdict: "warn", ... },
290
- ux: { verdict: "approve", ... },
291
- devil: { verdict: "warn", ... },
292
- legal: { verdict: "warn", ... },
293
- security: { verdict: "warn", ... }
294
- }
295
- }
296
- { llm_backed: true, final_verdict: "YELLOW", votes: { ... } }
297
- ```
298
-
299
- The host AI (Claude, Gemini, or Codex) reads the `debate_prompt`, reasons as all 7 specialists, and passes the structured JSON back. Veto runs the verdict engine on the real LLM output.
300
-
301
- #### Session save agentic fallback
302
-
303
- When `auto_summarize: true` and MCP Sampling is unavailable, `veto_session_save` now returns a structured template and instructions for the calling AI to fill in and call again — instead of silently saving nothing:
304
-
305
- ```
306
- veto_session_save { auto_summarize: true }
307
- {
308
- mode: "agentic",
309
- instruction: "Generate the session summary yourself from the conversation above, then call veto_session_save again with the filled-in fields.",
310
- summarize_prompt: "Review the conversation above and produce a session checkpoint...",
311
- template: {
312
- auto_summarize: false,
313
- summary: "<one sentence describing what was accomplished>",
314
- context: "{ task, decisions[], findings[] with file:line }",
315
- task_state: "{ completed[], remaining[], nextAction: 'Edit src/X.ts line N — ...' }"
316
- }
317
- }
318
- ```
319
-
320
- ---
321
-
322
- ## New in v1.4.2
323
-
324
- ### `veto_session_save` — LLM auto-summarization
325
-
326
- Pass `auto_summarize: true` and Veto reads the full conversation via MCP Sampling, then generates an accurate, structured session checkpoint itself — you don't write summary, context, or task_state manually.
327
-
328
- ```
329
- # Simplest possible save Veto does the work
330
- veto_session_save {
331
- auto_summarize: true,
332
- project_dir: "/your/project",
333
- tags: ["auth", "migration"]
334
- }
335
- → {
336
- success: true,
337
- auto_summarized: true,
338
- session_id: "abc-123",
339
- summary: "Implemented JWT auth middleware with refresh token rotation",
340
- context: {
341
- task: "migrate session auth to JWT",
342
- decisions: [{ decision: "store refresh token in httpOnly cookie", rationale: "XSS protection" }],
343
- findings: ["src/auth.ts:142 refreshToken handler, needs rotation logic next"]
344
- },
345
- task_state: {
346
- completed: ["access token generation", "middleware wiring"],
347
- remaining: ["refresh token rotation", "logout blocklist"],
348
- nextAction: "Edit src/auth.ts line 142 — implement rotation: invalidate old refresh token, issue new one, update DB row"
349
- }
350
- }
351
- ```
352
-
353
- Veto generates `nextAction` as a **concrete, file+line instruction** the next AI can execute without re-reading any source files. On restore, the `resume_instructions` field tells the AI to trust this and start immediately.
354
-
355
- When MCP Sampling is unavailable (all platforms currently), returns an agentic template asking the host AI to generate the summary from the conversation and call back with filled-in fields — see v1.4.3.
356
-
357
- ---
358
-
359
- ## New in v1.4.1
360
-
361
- ### Council debate decision-aware verdicts
362
-
363
- When your task presents a binary architectural choice ("should we X or Y", "A vs B"), every council agent now identifies which option it prefers and names it explicitly. The output includes a `🎯 Council leans toward:` line counting how many agents favour each option.
364
-
365
- Before agents fired generic keyword-matched concerns unrelated to the choice:
366
- ```
367
- Lead Dev: "Persistent memory stores grow unbounded..." ← nothing to do with the question
368
- ```
369
-
370
- After — agents address the specific choice:
371
- ```
372
- Lead Dev: [Express-bundled vs external-adapter] reason [WARN]
373
- recommendation: Prefer "external-adapter""Express-bundled" adds new
374
- infrastructure to maintain; validate real demand before building.
375
- 🎯 Council leans toward: "external adapter pattern" (4 agents prefer it)
376
- ```
377
-
378
- In the agentic loop (phase 2), the host AI is explicitly instructed to name the preferred option in its recommendation for each agent role.
379
-
380
- ### `veto_session_restore` — resume instructions
381
-
382
- The restore response now includes a `resume_instructions` field that tells the AI exactly what to do:
383
-
384
- ```
385
- veto_session_restore { session_id: "..." }
386
- → {
387
- resume_instructions: "Context restored. Trust the summary, context, and task_state
388
- above. Do NOT re-read source files to orient yourself — only open a file if you
389
- are about to EDIT it. Start immediately with: [nextAction from task_state].",
390
- session_id: "...",
391
- summary: "...",
392
- context: { ... },
393
- task_state: { nextAction: "Edit src/server.ts line 302, add zod validation..." },
394
- ...
395
- }
396
- ```
397
-
398
- This fixes the core issue where AI sessions were re-reading the entire codebase on restore instead of trusting the saved context.
399
-
400
- ### `veto_session_save` — input validation
401
-
402
- `summary`, `context`, and `task_state` now have enforced size limits. Oversized inputs are truncated with a warning rather than silently stored or crashing.
403
-
404
- | Field | Limit |
405
- |---|---|
406
- | `summary` | 2,000 chars |
407
- | `context` | 50,000 chars |
408
- | `task_state` | 20,000 chars |
409
-
410
- ```
411
- veto_session_save { summary: "...(very long)..." }
412
- → { success: true, truncation_warnings: ["summary truncated to 2000 chars (was 8432)"] }
413
- ```
414
-
415
- ---
416
-
417
- ## New in v1.4.0
418
-
419
- ### `veto_metrics` — usage dashboard
420
-
421
- ```
422
- veto_metrics {}
423
- → {
424
- sessions: { total: 45, today: 2, this_week: 8 },
425
- council: { total: 24, today: 1, by_verdict: { GREEN: 12, YELLOW: 9, RED: 3 } },
426
- agents: [ { agent: "coder", calls: 38, avg_quality: 86 }, ... ],
427
- quality: { overall_avg: 86, trend: [{ date: "2026-05-17", avg: 89, count: 5 }] },
428
- knowledge:{ total_entries: 12, by_type: { solution: 6, decision: 4, pattern: 2 } },
429
- patterns: { total: 10 }
430
- }
431
- ```
432
-
433
- ### `veto_changelog` — git changelog
434
-
435
- ```
436
- veto_changelog { project_dir: "/your/project" }
437
- → {
438
- since_tag: "v1.3.0",
439
- total_commits: 23,
440
- sections: [
441
- { section: "Features", items: [{ message: "Add council strictness param", hash: "a3f2b1c0", ... }] },
442
- { section: "Bug Fixes", items: [...] },
443
- { section: "Refactoring", items: [...] }
444
- ]
445
- }
446
- ```
447
-
448
- ### `veto_git_blame` — ownership data
449
-
450
- ```
451
- veto_git_blame { file_path: "/your/project/src/auth.ts" }
452
- → {
453
- path: "/your/project/src/auth.ts",
454
- total_commits: 14,
455
- contributors: [
456
- { commits: 9, author: "Jigyasu Dham" },
457
- { commits: 5, author: "contributor" }
458
- ],
459
- last_modified_at: "2026-05-16 18:30:00 +0530",
460
- last_author: "Jigyasu Dham",
461
- last_commit_message: "fix: JWT expiry check for clock skew"
462
- }
463
- ```
464
-
465
- ### `veto_explain` — now accepts raw text
466
-
467
- ```
468
- # Error message / stack trace
469
- veto_explain { text: "TypeError: Cannot read properties of undefined (reading 'id')\n at auth.ts:42" }
470
- → debugger agent explains the error and suggests root causes
471
-
472
- # Still works for files
473
- veto_explain { file_path: "/your/project/src/auth.ts", depth: "detailed" }
474
- ```
475
-
476
- ### Council `strictness` parameter
477
-
478
- ```
479
- veto_council_debate { task: "...", strictness: "fast" } # 3 agents, instant
480
- veto_council_debate { task: "...", strictness: "standard" } # 7 agents, default
481
- veto_council_debate { task: "...", strictness: "strict" } # 7 + devil rebuttal
482
- ```
483
-
484
- ---
485
-
486
- ## Workspace Discovery
487
-
488
- ```
489
- veto_discover { "project_dir": "/your/project" }
490
- → {
491
- git: { branch: "main", commit: "a3f2b1", dirty_files: [], recent_commits: [...] },
492
- ecosystems: { node: "my-app v2.1.0" },
493
- tech_stack: ["TypeScript", "React", "Prisma"],
494
- key_files: ["tsconfig.json", "prisma/schema.prisma", ".env.example"],
495
- total_files: 142
496
- }
497
- ```
498
-
499
- ---
500
-
501
- ## Diff Review
502
-
503
- ```
504
- veto_diff_review { project_dir: "/your/project" }
505
- → {
506
- verdict: "warn",
507
- files_changed: 4,
508
- code_review: { score: 78, critical: 0, high: 2, findings: [...] },
509
- security: { score: 91, critical: 0, high: 0, findings: [...] },
510
- secrets: { findings: [] },
511
- summary: "⚠️ WARN — 4 file(s) changed..."
512
- }
513
- ```
514
-
515
- ---
516
-
517
- ## Sequential Pipelines
518
-
519
- ```
520
- veto_workflow {
521
- steps: [
522
- { id: "code", agent: "coder", task: "implement auth middleware", gate: 70 },
523
- { id: "review", agent: "reviewer", task: "review the implementation", gate: 75 },
524
- { id: "security", agent: "security-scanner", task: "scan for vulnerabilities", gate: 80 },
525
- { id: "test", agent: "tester", task: "write test cases" }
526
- ],
527
- project_dir: "/your/project"
528
- }
529
- → { verdict: "passed", steps_passed: 4, steps_failed: 0, results: [...] }
530
- ```
531
-
532
- ---
533
-
534
- ## Self-Learning Router
535
-
536
- Every agent tool auto-records a quality signal when it completes. After any working session, `veto_learning_stats` shows live data and `veto_learning_apply` adjusts tier thresholds automatically after ~20 calls.
537
-
538
- ```bash
539
- veto_route_task { task: "debug auth issue", file_ext: ".ts" }
540
- → { ..., recommended_agent: "debugger" } # ← predicted from history
541
- ```
542
-
543
- ---
544
-
545
- ## Plugin System
546
-
547
- ```js
548
- // ~/.veto/agents/my-agent.js
549
- export function plan(task, context) {
550
- return {
551
- agent: 'my-agent', task, tier: 2,
552
- approach: 'Your custom approach...',
553
- steps: ['Step 1', 'Step 2'],
554
- checklist: ['[ ] Check 1'],
555
- pitfalls: ['Pitfall 1'],
556
- patterns: ['Pattern 1'],
557
- duration_estimate: '1-2 hours',
558
- };
559
- }
560
- ```
561
-
562
- ---
563
-
564
- ## Cross-Platform Handoff
565
-
566
- ```
567
- Claude at 90% → veto_handoff { summary, context }
568
- Open Gemini → veto_continue { resuming_as: "gemini" }
569
- Full context restored. Continue exactly where you stopped.
570
- ```
571
-
572
- | Platform | Support |
573
- |---|---|
574
- | Claude Code | ✅ Native MCP |
575
- | Gemini CLI | ✅ MCP support |
576
- | Codex CLI | ✅ MCP support |
577
- | Cursor | ✅ MCP support |
578
- | Windsurf | ✅ MCP support |
579
- | Zed | ✅ MCP support (`context_servers`) |
580
-
581
- ---
582
-
583
- ## Roadmap
584
-
585
- | Phase | Status | Version |
586
- |---|---|---|
587
- | 1–12 — Foundation through CLI + Diff Review | ✅ Complete | v0.1.0 – v1.0.0 |
588
- | 13 — Developer Intelligence + Auto Docs | ✅ Complete | v1.1.0 |
589
- | 14 — Observability + Usage Stats + Audit Log | ✅ Complete | v1.2.0 |
590
- | 15 — CI/CD Gates + GitHub PR Review | ✅ Complete | v1.2.5 |
591
- | 16 — Workspace Discovery + Summarization + Doctor | ✅ Complete | v1.2.8 |
592
- | 17 — VS Code Extension + Token Budget + Risk Annotations | ✅ Complete | v1.2.14 |
593
- | 18 — Extension Upgrades | ✅ Complete | veto-vscode v0.6.0 |
594
- | 19 — Auto-Learning Hooks | ✅ Complete | v1.2.15 |
595
- | 20 — Auto-Store Memory on RED | ✅ Complete | v1.2.16 |
596
- | 21 — Closing the Loop (auto-thresholds, pre-commit hook, benchmark) | ✅ Complete | v1.2.18 |
597
- | 22 — LLM Council (MCP Sampling, per-model context windows) | ✅ Complete | v1.3.0 |
598
- | 23 — Quality + Features (TTL cache, metrics, git blame, changelog, Zed, session tags) | ✅ Complete | v1.4.0 |
599
-
600
- ---
601
-
602
- ## Changelog
603
-
604
- ### v1.4.0
605
- - **feat:** `veto_metrics` — live usage dashboard (sessions, council verdicts, top agents, quality trend, knowledge stats). Pure SQLite reads, zero cost.
606
- - **feat:** `veto_changelog` — structured changelog from git history since last tag, grouped by conventional commit type.
607
- - **feat:** `veto_git_blame` — file/directory ownership data from local git (contributors, commit counts, last-modified metadata).
608
- - **feat:** Council `strictness` param — `fast` (3 core agents, instant) / `standard` (7 agents, default) / `strict` (7 + Devil's Advocate rebuttal round on most critical blocker).
609
- - **feat:** Session tagging — `veto_session_save` accepts `tags: string[]`; `veto_sessions_list` accepts `query` for full-text search across summary, context, tags, and project_dir.
610
- - **feat:** Zed editor support — `veto init` now auto-configures Zed via `~/.config/zed/settings.json` (`context_servers` key).
611
- - **feat:** `veto_explain` accepts raw `text` — error messages, stack traces, and compiler output are auto-routed to the debugger agent.
612
- - **fix:** `task_plans` TTL — cached plans older than 7 days are no longer returned; `veto_task_parse` checks cache before running the planner agent.
613
- - **fix:** Complexity scorer — word-count cap raised from 20→25 pts; +5 bonus for tasks over 60 words.
614
- - **fix:** Path sanitization — `readProjectContext` now validates that the resolved path is a directory before running any `git` commands.
615
- - **refactor:** Tool definitions extracted from `server.ts` into `src/tools/definitions.ts` (49 tools, grouped by category). `server.ts` reduced from 2640 → 1907 lines.
616
-
617
- ### v1.3.0
618
- - **feat:** Council agents are now LLM-backed via MCP Sampling — all 7 agents call the host LLM in parallel and return real reasoning, not deterministic templates. Deterministic fallback per agent if sampling is unavailable.
619
- - **feat:** Full agent reasoning returned — `votes` now includes each agent's complete `reason`, `concerns`, and `recommendation`.
620
- - **feat:** Knowledge retrieval pre-hook — council searches `knowledge_base` for similar past decisions before each debate.
621
- - **feat:** `veto_benchmark` runs two LLM council debates in parallel.
622
- - **feat:** Auto-store on YELLOW — significant YELLOW verdicts now stored in knowledge base with per-agent reasoning.
623
- - **feat:** Per-model context windows — `veto_status` and `veto_session_save` accept `model` param for exact window resolution.
624
-
625
- ### v1.2.19
626
- - **fix:** `veto_session_save` accepts optional `session_id` — updates that row in-place instead of inserting a new one.
627
-
628
- ### v1.2.18
629
- - **feat:** Auto-apply learned thresholds after every 20 `autoRecord()` calls.
630
- - **feat:** `veto hook install` / `veto hook remove` — pre-commit secrets scan hook.
631
- - **feat:** `veto check` — fast secrets scan on staged changes.
632
- - **feat:** `veto_benchmark` (tool #46) — two approaches → two parallel council debates → structured winner.
633
-
634
- ### v1.2.17
635
- - **fix:** `veto version` no longer shows "Unknown command".
636
- - **fix:** Unknown commands show a short 2-line error.
637
- - **fix:** `veto help` is now ~50 lines; full troubleshooting moved to `veto help --troubleshoot`.
638
- - **feat:** Sessions track `save_type` (`manual` | `auto`); `veto sessions --clean` removes old auto-saves.
639
-
640
- ### v1.2.15 – v1.2.16
641
- - Auto-learning hooks — `learning_data` fills automatically from every agent-producing tool.
642
- - Auto-store knowledge entries on RED council verdict and critical scan failures.
643
-
644
- ---
645
-
646
- ## Tech Stack
647
-
648
- - **Language:** TypeScript (strict mode)
649
- - **Runtime:** Node.js 22.5+ (built-in `node:sqlite` — no native compilation)
650
- - **Dependencies:** `@modelcontextprotocol/sdk` only — one package, zero native addons
651
- - **Memory:** Local SQLite — zero config, works offline, portable via JSON export
652
- - **Platforms:** Claude Code · Gemini CLI · Codex CLI · Cursor · Windsurf · Zed
653
-
654
- ---
655
-
656
- ## License
657
-
658
- MIT © 2026 Jigyasu Dham
1
+ # veto
2
+
3
+ > **89 agentic tools. 49 specialists. 4 AIs. Self-learning. Zero extra cost on subscriptions.**
4
+
5
+ An MCP server that runs locally on your machine, plugs into Claude Code, Codex CLI, Gemini CLI, Antigravity CLI, Cursor, Windsurf, Zed, and JetBrains using your existing subscriptions — giving every AI a council of specialist agents, local LLM support, SDD agents, playwright automation, persistent cross-platform memory, a self-learning router that re-tunes its tier thresholds automatically every 20 recorded task outcomes (reviews record outcomes for you; configurable via `auto_apply_learning`), CI/CD gates, workspace discovery, and bidirectional IDE communication.
6
+
7
+ > **Billing note:** "Zero cost" applies to subscription plans (Claude Max, Gemini Advanced, etc.). If you are on API/pay-per-token billing, MCP Sampling calls made by Veto agents will count toward your token usage. `veto init` detects API key environment variables and warns you automatically.
8
+
9
+ ---
10
+
11
+ ## How the Agents Work
12
+
13
+ **Every tool uses a 2-phase agentic loop — no API keys required, zero extra cost.**
14
+
15
+ ### Phase 1 — MCP Sampling
16
+ The tool attempts real LLM reasoning via MCP Sampling (`server.createMessage`). If your client supports it, the agent reasons deeply and returns a structured plan or analysis.
17
+
18
+ ### Phase 2 — Agentic Fallback
19
+ If Sampling is unavailable, Veto returns an `llm_upgrade` prompt. The host AI reads the specialist's role, performs the reasoning itself, and passes the JSON response back to complete the operation.
20
+
21
+ Every worker agent supports both modes. When multiple agents run, they execute in parallel. LLM calls delegate back to the AI you're already using — no extra billing.
22
+
23
+ ---
24
+
25
+ ## Specialist Roles
26
+
27
+ | Agent Group | Specialist Roles |
28
+ |---|---|
29
+ | **Council** | Lead Dev · PM · Architect · UX · Devil's Advocate · Legal · Security |
30
+ | **Development** | Coder · Reviewer · Tester · Debugger · Refactor · Database · API · Frontend · Backend · DevOps · Performance · Migration |
31
+ | **Advanced** | Local LLM (Ollama) · Semantic Search · SDD Agent · Playwright · i18n Translate · a11y Advisor |
32
+ | **Intelligence** | Task Planner · Researcher · Tech Advisor · Risk Assessor · Cost Analyzer · Ethics/Bias |
33
+ | **Workflow** | File Manager · Git Agent · Search Agent · Reporter · Automation |
34
+
35
+ **Development (12)**
36
+ `Coder` · `Code Reviewer` · `Tester` · `Debugger` · `Refactor` · `Database` · `API` · `Frontend` · `Backend` · `DevOps` · `Performance` · `Migration`
37
+
38
+ **Security (6)**
39
+ `Security Scanner` · `Auth Agent` · `Data Privacy` · `Secrets Agent` · `Dependency Audit` · `Penetration Tester`
40
+
41
+ **Memory (5)**
42
+ `Context Manager` · `Decision Logger` · `Project Mapper` · `Pattern Learner` · `Knowledge Base`
43
+
44
+ **Research (7)**
45
+ `Researcher` · `Tech Advisor` · `Cost Analyzer` · `Competitor Analyzer` · `Risk Assessor` · `Estimator` · `Ethics & Bias`
46
+
47
+ **Quality (5)**
48
+ `Code Quality` · `Documentation` · `Accessibility` · `Compatibility` · `Error Handling`
49
+
50
+ **Workflow (7)**
51
+ `Task Planner` · `Task Coordinator` · `File Manager` · `Git Agent` · `Search Agent` · `Reporter` · `Automation`
52
+
53
+ ---
54
+
55
+ ## MCP Tools (89)
56
+
57
+ | Category | Tools |
58
+ |---|---|
59
+ | **Session** | `veto_status` · `veto_session_save` · `veto_session_restore` · `veto_sessions_list` · `veto_autosave_status` · `veto_session_replay` |
60
+ | **Router** | `veto_route_task` · `veto_rate_status` |
61
+ | **Council** | `veto_council_debate` · `veto_benchmark` · `veto_adr` |
62
+ | **Agents** | `veto_agent_plan` · `veto_execute_parallel` · `veto_explain` · `veto_compose_agents` · `veto_delegate` |
63
+ | **Review** | `veto_code_review` · `veto_security_scan` · `veto_secrets_scan` · `veto_diff_review` · `veto_full_review` · `veto_pr_review` |
64
+ | **Pipelines** | `veto_pre_commit` · `veto_new_feature` · `veto_workflow` · `veto_task_parse` |
65
+ | **Advanced** | `veto_local_llm` · `veto_semantic_search` · `veto_sdd_agent` · `veto_playwright` · `veto_notify_ide` |
66
+ | **Quality** | `veto_clone_detector` · `veto_lint_rules` · `veto_api_contract` · `veto_a11y_advisor` · `veto_type_coverage` · `veto_test_gaps` |
67
+ | **Watching** | `veto_watch` · `veto_watch_poll` · `veto_watch_stop` |
68
+ | **Memory** | `veto_memory_store` · `veto_memory_search` · `veto_memory_delete` · `veto_project_map_update` · `veto_project_map_get` · `veto_pattern_store` · `veto_patterns_list` · `veto_memory_export` · `veto_memory_import` |
69
+ | **Learning** | `veto_record_outcome` · `veto_learning_stats` · `veto_learning_apply` |
70
+ | **Handoff** | `veto_handoff` · `veto_continue` · `veto_platform_setup` |
71
+ | **Observability** | `veto_usage_status` · `veto_audit_log` · `veto_health` · `veto_metrics` |
72
+ | **Discover** | `veto_discover` · `veto_summarize` · `veto_git_blame` · `veto_changelog` · `veto_onboard` · `veto_debt_register` |
73
+ | **DevTools** | `veto_docs_fetch` · `veto_context_status` · `veto_openapi_gen` · `veto_flag_auditor` · `veto_env_setup` · `veto_commit_message` · `veto_pr_description` · `veto_pr_post` · `veto_prompt_optimizer` · `veto_sre_advisor` · `veto_diagram` · `veto_rca` · `veto_translate` · `veto_merge_conflict` |
74
+ | **Plugins** | `veto_plugins` |
75
+
76
+ ## Which tool do I use?
77
+
78
+ Several tools overlap by design (different granularity or entry point). Quick guide:
79
+
80
+ **Reviewing code**
81
+
82
+ | You have… | Use | Note |
83
+ |---|---|---|
84
+ | A snippet or single file in hand | `veto_code_review` | not `veto_diff_review`, which reads a git diff |
85
+ | Uncommitted/changed files (git diff) | `veto_diff_review` | code + security + secrets scans in parallel |
86
+ | To gate a commit (hard-block on secrets) | `veto_pre_commit` | tuned for commit-time |
87
+ | To gate CI (exit code + pass/warn/fail) | `veto_ci_gate` | for GitHub Actions / GitLab CI |
88
+ | A deeper pre-merge/pre-ship pass (+ quality) | `veto_full_review` | richer than `veto_diff_review` |
89
+ | A GitHub PR by number/URL | `veto_pr_review` | fetches the diff, returns postable comments |
90
+
91
+ **Remembering things**
92
+
93
+ | Want to… | Use |
94
+ |---|---|
95
+ | Save/recall a solution, decision, or reference | `veto_memory_store` / `veto_memory_search` |
96
+ | Track a recurring code convention | `veto_pattern_store` / `veto_patterns_list` |
97
+ | Navigate the codebase without scanning the filesystem | `veto_project_map_get` (refresh via `veto_project_map_update`) |
98
+
99
+ **Running multi-step work**
100
+
101
+ | Want to… | Use |
102
+ |---|---|
103
+ | Run several agents at once on one task | `veto_execute_parallel` |
104
+ | Run a sequential pipeline with pass/fail gates | `veto_workflow` |
105
+ | Turn a PRD / plain English into a task DAG | `veto_task_parse` (feeds `veto_workflow`) |
106
+ | Plan a new feature end-to-end (council plan → tasks) | `veto_new_feature` |
107
+
108
+ **Sessions**
109
+
110
+ | Want to… | Use |
111
+ |---|---|
112
+ | Resume work with full saved context | `veto_session_restore` (or `veto_continue` for the latest) |
113
+ | See the event / tool-call timeline of a session | `veto_session_replay` |
114
+ | Move work to another AI tool | `veto_handoff` → `veto_continue` |
115
+
116
+ ## MCP Resources
117
+
118
+ | URI | What it returns |
119
+ |---|---|
120
+ | `veto://sessions` | All saved sessions across platforms |
121
+ | `veto://project-map?dir=<path>` | Stored project structure map |
122
+ | `veto://memory?q=<query>` | Knowledge base search results |
123
+ | `veto://patterns` | Learned coding patterns |
124
+
125
+ ## MCP Prompts
126
+
127
+ | Prompt | What it does |
128
+ |---|---|
129
+ | `code-review` | Full code review paste code, get scored findings |
130
+ | `security-audit` | OWASP Top 10 scan with CWE references |
131
+ | `deploy-checklist` | Council reviews your deployment plan before you ship |
132
+ | `explain-file` | Expert explanation of any file, auto-routed by type |
133
+
134
+ ---
135
+
136
+ ## CLI Commands
137
+
138
+ ```bash
139
+ veto init # Configure all AI tools + scan project
140
+ veto doctor # Check MCP registrations + system health
141
+ veto status # Version, DB path, session/memory/outcome counts
142
+ veto version # Alias for veto status
143
+ veto sessions # List last 20 saved sessions ([auto] badge on auto-saves)
144
+ veto sessions --clean # Remove auto-saves older than 7 days
145
+ veto memory [query] # Search knowledge base (blank = all entries)
146
+ veto patterns [prefix] # List learned agent/routing patterns
147
+ veto hook install # Install pre-commit secrets scan hook
148
+ veto hook remove # Remove the veto pre-commit hook
149
+ veto check # Scan staged changes for secrets (used by hook)
150
+ veto help # Commands + MCP tools reference
151
+ veto help --troubleshoot # Full troubleshooting guide
152
+ ```
153
+
154
+ ### `veto doctor`
155
+
156
+ ```
157
+ veto doctor
158
+
159
+ Veto Doctor — system health check
160
+ ─────────────────────────────────────────────────────
161
+ Node.js v22.5.0
162
+ ~/.veto exists
163
+ Database ~/.veto/veto.db
164
+ 17 sessions · 12 memories · 3 patterns
165
+
166
+ MCP Registrations
167
+ ─────────────────────────────────────────────────────
168
+ Claude Coderegistered
169
+ Gemini CLI registered
170
+ Antigravity CLI registered
171
+ · Codex CLInot installed
172
+ · Zed — not installed
173
+
174
+ All checks passed — Veto is healthy!
175
+ ```
176
+
177
+ ---
178
+
179
+ ## Council Debate
180
+
181
+ Two-phase flow — works on Claude Code, Gemini CLI, Antigravity CLI, and Codex CLI with no API keys:
182
+
183
+ ```
184
+ # Phase 1 — call with task, get instant deterministic result + LLM upgrade prompt
185
+ veto_council_debate {
186
+ task: "migrate auth from sessions to JWTs",
187
+ project_dir: "/your/project",
188
+ strictness: "standard"
189
+ }
190
+ {
191
+ llm_backed: false,
192
+ final_verdict: "YELLOW",
193
+ votes: { lead_dev: {...}, architect: {...}, security: {...}, ... },
194
+ llm_upgrade: {
195
+ available: true,
196
+ instruction: "Read debate_prompt, reason as all 7 agents, call again with agent_responses",
197
+ debate_prompt: "You are running a Veto Council debate. Analyze the task as each specialist..."
198
+ }
199
+ }
200
+
201
+ # Phase 2 reason as all 7 agents, pass responses back → get LLM-backed verdict
202
+ veto_council_debate {
203
+ task: "migrate auth from sessions to JWTs",
204
+ agent_responses: {
205
+ lead_dev: { verdict: "warn", reason: "Stateless JWTs complicate logout — need blocklist", concerns: ["Refresh token rotation must be atomic"], recommendation: "Use short-lived access tokens (15m) + httpOnly refresh tokens" },
206
+ pm: { verdict: "approve", reason: "JWT migration unblocks mobile clients", concerns: [], recommendation: "Ship behind a feature flag, roll back if logout issues" },
207
+ architect: { verdict: "approve", reason: "Good fit for stateless microservice boundary", concerns: ["Clock skew can break expiry across services"], recommendation: "Add NTP sync check; use relative expiry not absolute timestamps" },
208
+ ux: { verdict: "approve", reason: "No user-visible change if migration is seamless", concerns: [], recommendation: "Silent migration — no logout required for existing sessions" },
209
+ devil: { verdict: "warn", reason: "What if the refresh token store goes down at 2AM?", concerns: ["Redis outage = all users logged out"], recommendation: "Fallback to session auth if Redis is down; use short rotation window" },
210
+ legal: { verdict: "approve", reason: "JWTs are industry standard, no new compliance risk", concerns: [], recommendation: "Document token storage in privacy policy" },
211
+ security: { verdict: "warn", reason: "Refresh token rotation must be atomic — TOCTOU risk", concerns: ["localStorage storage of access token is XSS-vulnerable"], recommendation: "Store access token in memory only; refresh token in httpOnly Secure SameSite=Strict cookie" }
212
+ }
213
+ }
214
+ {
215
+ llm_backed: true,
216
+ final_verdict: "YELLOW",
217
+ warnings: ["Refresh token rotation must be atomic...", "What if the refresh token store goes down..."],
218
+ recommended: "Proceed with JWT. Use httpOnly cookies for refresh tokens, memory-only for access tokens..."
219
+ }
220
+ ```
221
+
222
+ ### Council `strictness`
223
+
224
+ ```
225
+ veto_council_debate { task: "...", strictness: "fast" } # 3 agents, instant
226
+ veto_council_debate { task: "...", strictness: "standard" } # 7 agents, default
227
+ veto_council_debate { task: "...", strictness: "strict" } # 7 + devil rebuttal
228
+ ```
229
+
230
+ ---
231
+
232
+ ## Session Tagging + Search
233
+
234
+ ```
235
+ veto_session_save {
236
+ auto_summarize: true,
237
+ tags: ["auth", "jwt", "middleware"]
238
+ }
239
+
240
+ veto_sessions_list { query: "auth" }
241
+ → sessions matching "auth" in summary, context, tags, or project_dir
242
+ ```
243
+
244
+ Token usage is manually reported — pass `token_count` to `veto_status` or `veto_session_save` and Veto stores it per platform per day. `veto_rate_status` shows what you've reported; nothing is counted automatically.
245
+
246
+ ---
247
+
248
+ ## Workspace Discovery
249
+
250
+ ```
251
+ veto_discover { "project_dir": "/your/project" }
252
+ {
253
+ git: { branch: "main", commit: "a3f2b1", dirty_files: [], recent_commits: [...] },
254
+ ecosystems: { node: "my-app v2.1.0" },
255
+ tech_stack: ["TypeScript", "React", "Prisma"],
256
+ key_files: ["tsconfig.json", "prisma/schema.prisma", ".env.example"],
257
+ total_files: 142
258
+ }
259
+ ```
260
+
261
+ ---
262
+
263
+ ## Diff Review
264
+
265
+ ```
266
+ veto_diff_review { project_dir: "/your/project" }
267
+ {
268
+ verdict: "warn",
269
+ files_changed: 4,
270
+ code_review: { score: 78, critical: 0, high: 2, findings: [...] },
271
+ security: { score: 91, critical: 0, high: 0, findings: [...] },
272
+ secrets: { findings: [] },
273
+ summary: "⚠️ WARN — 4 file(s) changed..."
274
+ }
275
+ ```
276
+
277
+ ---
278
+
279
+ ## Sequential Pipelines
280
+
281
+ ```
282
+ veto_workflow {
283
+ steps: [
284
+ { id: "code", agent: "coder", task: "implement auth middleware", gate: 70 },
285
+ { id: "review", agent: "reviewer", task: "review the implementation", gate: 75 },
286
+ { id: "security", agent: "security-scanner", task: "scan for vulnerabilities", gate: 80 },
287
+ { id: "test", agent: "tester", task: "write test cases" }
288
+ ],
289
+ project_dir: "/your/project"
290
+ }
291
+ { verdict: "passed", steps_passed: 4, steps_failed: 0, results: [...] }
292
+ ```
293
+
294
+ ---
295
+
296
+ ## Self-Learning Router
297
+
298
+ Every agent tool auto-records a quality signal when it completes. After any working session, `veto_learning_stats` shows live data and `veto_learning_apply` adjusts tier thresholds automatically after ~20 calls.
299
+
300
+ ```bash
301
+ veto_route_task { task: "debug auth issue", file_ext: ".ts" }
302
+ → { ..., recommended_agent: "debugger" } # ← predicted from history
303
+ ```
304
+
305
+ ---
306
+
307
+ ## Plugin System
308
+
309
+ ```js
310
+ // ~/.veto/agents/my-agent.js
311
+ export function plan(task, context) {
312
+ return {
313
+ agent: 'my-agent', task, tier: 2,
314
+ approach: 'Your custom approach...',
315
+ steps: ['Step 1', 'Step 2'],
316
+ checklist: ['[ ] Check 1'],
317
+ pitfalls: ['Pitfall 1'],
318
+ patterns: ['Pattern 1'],
319
+ duration_estimate: '1-2 hours',
320
+ };
321
+ }
322
+ ```
323
+
324
+ ---
325
+
326
+ ## Cross-Platform Handoff
327
+
328
+ ```
329
+ Claude at 90% → veto_handoff { summary, context }
330
+ Open Gemini → veto_continue { resuming_as: "gemini" }
331
+ Full context restored. Continue exactly where you stopped.
332
+ ```
333
+
334
+ Platform switching is manual — Veto surfaces which platform has budget remaining via `veto_rate_status`, you decide when to switch.
335
+
336
+ | Platform | Support |
337
+ |---|---|
338
+ | Claude Code | ✅ Native MCP |
339
+ | Gemini CLI | MCP support |
340
+ | Antigravity CLI | ✅ MCP support |
341
+ | Codex CLI | MCP support |
342
+ | Cursor | MCP support |
343
+ | Windsurf | MCP support |
344
+ | Zed | ✅ MCP support (`context_servers`) |
345
+
346
+ ---
347
+
348
+ ## Project Structure
349
+
350
+ Veto is a single MCP server (`src/server.ts`) that registers 89 tools, MCP Resources, and Prompts, then dispatches every tool call through a per-domain **handler registry** — there is no monolithic switch. Each domain owns a `HandlerMap` module under `src/server/handlers/`:
351
+
352
+ | Module | Tools | Domain |
353
+ |---|---|---|
354
+ | `workers.ts` | 15 | single-agent worker delegations (code_review, security_scan, explain, …) |
355
+ | `generators.ts` | 11 | single-agent artifact generators (adr, diagram, rca, doc_gen, onboard, …) |
356
+ | `memory.ts` | 9 | knowledge base, patterns, project map |
357
+ | `observability.ts` | 7 | health, metrics, usage, audit, context/rate status |
358
+ | `advisors.ts` | 7 | project scanners (dep, query, bundle, dead-code, flag, openapi, HITL) |
359
+ | `session.ts` | 6 | save · restore · list · handoff · continue · replay |
360
+ | `review.ts` | 5 | diff · ci · pr · full review + pre-commit pipelines |
361
+ | `git.ts` | 5 | blame · changelog · commit message · PR description/post |
362
+ | `core.ts` | 5 | status · routing · platform setup · docs fetch · discover |
363
+ | `agents.ts` | 5 | agent_plan · execute_parallel · delegate · workflow · task_parse |
364
+ | `devtools.ts` | 5 | plugins · local LLM · clone detector · compose · notify IDE |
365
+ | `council.ts` | 3 | council_debate · benchmark · new_feature |
366
+ | `learning.ts` | 3 | record_outcome · learning_stats · learning_apply |
367
+ | `watch.ts` | 3 | watch · poll · stop |
368
+
369
+ Shared, independently testable internals live in `src/server/`:
370
+
371
+ - `registry.ts` — the `ToolContext` (`{ request, args, server }`) and `HandlerMap` types
372
+ - `runtime.ts` — shared mutable state (active project dir, auto-save, server health, `VERSION`)
373
+ - `scan-core.ts`git-diff reader, triple-scan, and the agentic worker loop (unit-tested)
374
+
375
+ Every handler module is importable in isolation, so behaviour is covered by `tests/server/dispatch.test.ts` (the `callTool` behavioral net) and `tests/tools/definitions.test.ts` (the 89-tool registry-coverage check).
376
+
377
+ ---
378
+
379
+ ## Tech Stack
380
+
381
+ - **Language:** TypeScript (strict mode)
382
+ - **Runtime:** Node.js 22.5+ (built-in `node:sqlite` no native compilation)
383
+ - **Dependencies:** `@modelcontextprotocol/sdk` only — one package, zero native addons
384
+ - **Memory:** Local SQLite — zero config, works offline, portable via JSON export
385
+ - **Platforms:** Claude Code · Gemini CLI · Antigravity CLI · Codex CLI · Cursor · Windsurf · Zed
386
+
387
+ ---
388
+
389
+ ## License
390
+
391
+ MIT © 2026 Jigyasu Dham