vivechak 0.1.0rc1__tar.gz
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.
- vivechak-0.1.0rc1/PKG-INFO +86 -0
- vivechak-0.1.0rc1/README.md +69 -0
- vivechak-0.1.0rc1/pyproject.toml +28 -0
- vivechak-0.1.0rc1/setup.cfg +4 -0
- vivechak-0.1.0rc1/src/vivechak/__init__.py +2 -0
- vivechak-0.1.0rc1/src/vivechak/cli.py +260 -0
- vivechak-0.1.0rc1/src/vivechak.egg-info/PKG-INFO +86 -0
- vivechak-0.1.0rc1/src/vivechak.egg-info/SOURCES.txt +9 -0
- vivechak-0.1.0rc1/src/vivechak.egg-info/dependency_links.txt +1 -0
- vivechak-0.1.0rc1/src/vivechak.egg-info/entry_points.txt +3 -0
- vivechak-0.1.0rc1/src/vivechak.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vivechak
|
|
3
|
+
Version: 0.1.0rc1
|
|
4
|
+
Summary: Evidence-grounded research for technical decisions — MCP server
|
|
5
|
+
Author-email: Bhaskar Jha <me@bhaskarjha.dev>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://vivechak.bhaskarjha.dev
|
|
8
|
+
Project-URL: Repository, https://github.com/bhaskarjha-dev/vivechak
|
|
9
|
+
Project-URL: Documentation, https://vivechak.bhaskarjha.dev/docs
|
|
10
|
+
Keywords: mcp,model-context-protocol,ai-agent,architecture,research,cursor,claude
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
15
|
+
Requires-Python: >=3.8
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+
# Vivechak & `vck`
|
|
19
|
+
|
|
20
|
+
<!-- mcp-name: io.github.bhaskarjha-dev/vivechak -->
|
|
21
|
+
|
|
22
|
+
**Evidence-graded technical decisions for AI coding agents — researched, challenged, and gated in Markdown before you write code.**
|
|
23
|
+
|
|
24
|
+
Official Python runner for **Vivechak** and shorthand CLI **`vck`**. Automatically downloads, SHA-256-verifies, and caches the pre-compiled static Go binary for your OS and architecture (`darwin`, `linux`, `windows`, `freebsd`) while keeping `stdout` 100% clean for MCP JSON-RPC over `stdio`.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 1. Quickstart (`uvx`)
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Configure your AI coding host in one command (10 verified presets)
|
|
32
|
+
uvx vck setup claude-code # or: cursor, vscode, claude, agy, windsurf, zed, roo, opencode, goose
|
|
33
|
+
|
|
34
|
+
# Optional: install as a persistent CLI tool via uv
|
|
35
|
+
uv tool install vivechak # provides both `vck` and `vivechak`
|
|
36
|
+
|
|
37
|
+
# Check workspace integrity and evaluate the pre-code Phase 0 Gate (exits 1 on FAIL)
|
|
38
|
+
uvx vck doctor
|
|
39
|
+
uvx vck gate
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 2. Zero-Install Host Configuration (`uvx vck serve`)
|
|
45
|
+
|
|
46
|
+
### Claude Code (`~/.claude.json` or `.mcp.json`) · Cursor (`.cursor/mcp.json`) · Claude Desktop
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"mcpServers": {
|
|
50
|
+
"vivechak": {
|
|
51
|
+
"command": "uvx",
|
|
52
|
+
"args": ["vck", "serve"]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### VS Code Copilot Agent Mode (`.vscode/mcp.json`)
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"servers": {
|
|
62
|
+
"vivechak": {
|
|
63
|
+
"command": "uvx",
|
|
64
|
+
"args": ["vck", "serve"]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## 3. Three Reversibility-Calibrated Scopes
|
|
73
|
+
|
|
74
|
+
| Scope | Example Agent Prompt | Investment | Saved Artifact in `research/` |
|
|
75
|
+
|---|---|---|---|
|
|
76
|
+
| **Comparison** | *"Use Vivechak to compare Pino vs Winston for our Node.js service."* | 1 session (~5 min) | `C-001-comparison.md` (Weighted Evaluation Matrix) |
|
|
77
|
+
| **Decision** | *"Use Vivechak to decide whether to migrate events from Postgres to ClickHouse."* | 1–3 sessions (~30 min) | `D-001-decision.md` (ADR) + `DECISIONS.md` |
|
|
78
|
+
| **Project** | *"Use Vivechak to architect our multi-tenant telemetry pipeline."* | 4–30 DAG sessions | `RESEARCH-PIPELINE.md` → `FAD.md` |
|
|
79
|
+
|
|
80
|
+
For irreversible **One-Way Door** ADRs, `vck gate` requires an adversarial red-team challenge record (`vivechak_review(mode="red_team", id="D-001")`) and an out-of-band human terminal sign-off (`vck signoff D-001 --reviewer "Your Name"`).
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Documentation & Source
|
|
85
|
+
|
|
86
|
+
Official Website: **[vivechak.bhaskarjha.dev](https://vivechak.bhaskarjha.dev)** · Documentation: **[vivechak.bhaskarjha.dev/docs](https://vivechak.bhaskarjha.dev/docs)** · Source: **[github.com/bhaskarjha-dev/vivechak](https://github.com/bhaskarjha-dev/vivechak)** · MIT License © [Bhaskar Jha](https://bhaskarjha.dev).
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Vivechak & `vck`
|
|
2
|
+
|
|
3
|
+
<!-- mcp-name: io.github.bhaskarjha-dev/vivechak -->
|
|
4
|
+
|
|
5
|
+
**Evidence-graded technical decisions for AI coding agents — researched, challenged, and gated in Markdown before you write code.**
|
|
6
|
+
|
|
7
|
+
Official Python runner for **Vivechak** and shorthand CLI **`vck`**. Automatically downloads, SHA-256-verifies, and caches the pre-compiled static Go binary for your OS and architecture (`darwin`, `linux`, `windows`, `freebsd`) while keeping `stdout` 100% clean for MCP JSON-RPC over `stdio`.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 1. Quickstart (`uvx`)
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# Configure your AI coding host in one command (10 verified presets)
|
|
15
|
+
uvx vck setup claude-code # or: cursor, vscode, claude, agy, windsurf, zed, roo, opencode, goose
|
|
16
|
+
|
|
17
|
+
# Optional: install as a persistent CLI tool via uv
|
|
18
|
+
uv tool install vivechak # provides both `vck` and `vivechak`
|
|
19
|
+
|
|
20
|
+
# Check workspace integrity and evaluate the pre-code Phase 0 Gate (exits 1 on FAIL)
|
|
21
|
+
uvx vck doctor
|
|
22
|
+
uvx vck gate
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## 2. Zero-Install Host Configuration (`uvx vck serve`)
|
|
28
|
+
|
|
29
|
+
### Claude Code (`~/.claude.json` or `.mcp.json`) · Cursor (`.cursor/mcp.json`) · Claude Desktop
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"mcpServers": {
|
|
33
|
+
"vivechak": {
|
|
34
|
+
"command": "uvx",
|
|
35
|
+
"args": ["vck", "serve"]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### VS Code Copilot Agent Mode (`.vscode/mcp.json`)
|
|
42
|
+
```json
|
|
43
|
+
{
|
|
44
|
+
"servers": {
|
|
45
|
+
"vivechak": {
|
|
46
|
+
"command": "uvx",
|
|
47
|
+
"args": ["vck", "serve"]
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 3. Three Reversibility-Calibrated Scopes
|
|
56
|
+
|
|
57
|
+
| Scope | Example Agent Prompt | Investment | Saved Artifact in `research/` |
|
|
58
|
+
|---|---|---|---|
|
|
59
|
+
| **Comparison** | *"Use Vivechak to compare Pino vs Winston for our Node.js service."* | 1 session (~5 min) | `C-001-comparison.md` (Weighted Evaluation Matrix) |
|
|
60
|
+
| **Decision** | *"Use Vivechak to decide whether to migrate events from Postgres to ClickHouse."* | 1–3 sessions (~30 min) | `D-001-decision.md` (ADR) + `DECISIONS.md` |
|
|
61
|
+
| **Project** | *"Use Vivechak to architect our multi-tenant telemetry pipeline."* | 4–30 DAG sessions | `RESEARCH-PIPELINE.md` → `FAD.md` |
|
|
62
|
+
|
|
63
|
+
For irreversible **One-Way Door** ADRs, `vck gate` requires an adversarial red-team challenge record (`vivechak_review(mode="red_team", id="D-001")`) and an out-of-band human terminal sign-off (`vck signoff D-001 --reviewer "Your Name"`).
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Documentation & Source
|
|
68
|
+
|
|
69
|
+
Official Website: **[vivechak.bhaskarjha.dev](https://vivechak.bhaskarjha.dev)** · Documentation: **[vivechak.bhaskarjha.dev/docs](https://vivechak.bhaskarjha.dev/docs)** · Source: **[github.com/bhaskarjha-dev/vivechak](https://github.com/bhaskarjha-dev/vivechak)** · MIT License © [Bhaskar Jha](https://bhaskarjha.dev).
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "vivechak"
|
|
7
|
+
version = "0.1.0rc1"
|
|
8
|
+
description = "Evidence-grounded research for technical decisions — MCP server"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.8"
|
|
11
|
+
license = {text = "MIT"}
|
|
12
|
+
authors = [{name = "Bhaskar Jha", email = "me@bhaskarjha.dev"}]
|
|
13
|
+
keywords = ["mcp", "model-context-protocol", "ai-agent", "architecture", "research", "cursor", "claude"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Programming Language :: Python :: 3",
|
|
16
|
+
"License :: OSI Approved :: MIT License",
|
|
17
|
+
"Operating System :: OS Independent",
|
|
18
|
+
"Topic :: Software Development :: Build Tools",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
[project.scripts]
|
|
22
|
+
vivechak = "vivechak.cli:main"
|
|
23
|
+
vck = "vivechak.cli:main"
|
|
24
|
+
|
|
25
|
+
[project.urls]
|
|
26
|
+
Homepage = "https://vivechak.bhaskarjha.dev"
|
|
27
|
+
Repository = "https://github.com/bhaskarjha-dev/vivechak"
|
|
28
|
+
Documentation = "https://vivechak.bhaskarjha.dev/docs"
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
"""Native binary runner for Vivechak and vck.
|
|
2
|
+
All diagnostic and status output is directed strictly to sys.stderr so that
|
|
3
|
+
sys.stdout remains 100% clean for MCP JSON-RPC protocol communication.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
import os
|
|
7
|
+
import sys
|
|
8
|
+
import platform
|
|
9
|
+
import hashlib
|
|
10
|
+
import urllib.request
|
|
11
|
+
import urllib.parse
|
|
12
|
+
import urllib.error
|
|
13
|
+
import tarfile
|
|
14
|
+
import zipfile
|
|
15
|
+
import subprocess
|
|
16
|
+
import secrets
|
|
17
|
+
import shutil
|
|
18
|
+
from pathlib import Path
|
|
19
|
+
|
|
20
|
+
VERSION = "0.1.0-rc.1"
|
|
21
|
+
DEFAULT_DOWNLOAD_BASE = "https://github.com/bhaskarjha-dev/vivechak/releases/download"
|
|
22
|
+
|
|
23
|
+
def get_platform_info():
|
|
24
|
+
sys_plat = sys.platform
|
|
25
|
+
mach = platform.machine().lower()
|
|
26
|
+
|
|
27
|
+
if sys_plat.startswith("linux"):
|
|
28
|
+
os_name = "linux"
|
|
29
|
+
elif sys_plat == "darwin":
|
|
30
|
+
os_name = "darwin"
|
|
31
|
+
elif sys_plat in ("win32", "cygwin"):
|
|
32
|
+
os_name = "windows"
|
|
33
|
+
elif sys_plat.startswith("freebsd"):
|
|
34
|
+
os_name = "freebsd"
|
|
35
|
+
else:
|
|
36
|
+
raise RuntimeError(f"Unsupported operating system: {sys_plat}")
|
|
37
|
+
|
|
38
|
+
if mach in ("x86_64", "amd64"):
|
|
39
|
+
arch_name = "amd64"
|
|
40
|
+
elif mach in ("arm64", "aarch64"):
|
|
41
|
+
arch_name = "arm64"
|
|
42
|
+
else:
|
|
43
|
+
raise RuntimeError(f"Unsupported architecture: {mach}")
|
|
44
|
+
|
|
45
|
+
return os_name, arch_name
|
|
46
|
+
|
|
47
|
+
def get_cache_dir():
|
|
48
|
+
cache_base = os.environ.get("VIVECHAK_CACHE_DIR")
|
|
49
|
+
if cache_base:
|
|
50
|
+
return Path(cache_base) / f"v{VERSION}"
|
|
51
|
+
if sys.platform in ("win32", "cygwin"):
|
|
52
|
+
base = Path(os.environ.get("LOCALAPPDATA", Path.home() / "AppData" / "Local"))
|
|
53
|
+
else:
|
|
54
|
+
base = Path(os.environ.get("XDG_CACHE_HOME", Path.home() / ".cache"))
|
|
55
|
+
return base / "vivechak" / f"v{VERSION}"
|
|
56
|
+
|
|
57
|
+
def get_download_base():
|
|
58
|
+
custom_base = os.environ.get("VIVECHAK_DOWNLOAD_BASE")
|
|
59
|
+
if not custom_base:
|
|
60
|
+
return DEFAULT_DOWNLOAD_BASE
|
|
61
|
+
parsed = urllib.parse.urlparse(custom_base)
|
|
62
|
+
if parsed.scheme == "http":
|
|
63
|
+
host = (parsed.hostname or "").lower()
|
|
64
|
+
if host not in ("127.0.0.1", "localhost"):
|
|
65
|
+
raise RuntimeError(f"Insecure HTTP download base only allowed for 127.0.0.1 or localhost, got: {host}")
|
|
66
|
+
elif parsed.scheme != "https":
|
|
67
|
+
raise RuntimeError(f"Unsupported download protocol: {parsed.scheme}")
|
|
68
|
+
return custom_base.rstrip("/")
|
|
69
|
+
|
|
70
|
+
class SafeRedirectHandler(urllib.request.HTTPRedirectHandler):
|
|
71
|
+
def __init__(self, max_redirects=5):
|
|
72
|
+
super().__init__()
|
|
73
|
+
self.max_redirects = max_redirects
|
|
74
|
+
self.count = 0
|
|
75
|
+
|
|
76
|
+
def redirect_request(self, req, fp, code, msg, headers, newurl):
|
|
77
|
+
self.count += 1
|
|
78
|
+
if self.count > self.max_redirects:
|
|
79
|
+
raise urllib.error.HTTPError(req.full_url, code, f"Too many redirects (limit {self.max_redirects})", headers, fp)
|
|
80
|
+
# Block HTTPS to HTTP downgrade
|
|
81
|
+
if req.full_url.startswith("https://") and newurl.startswith("http://"):
|
|
82
|
+
raise urllib.error.HTTPError(req.full_url, code, f"Insecure redirect downgrade from HTTPS to HTTP forbidden: {newurl}", headers, fp)
|
|
83
|
+
return super().redirect_request(req, fp, code, msg, headers, newurl)
|
|
84
|
+
|
|
85
|
+
def download_file(url, dest_path):
|
|
86
|
+
opener = urllib.request.build_opener(SafeRedirectHandler(max_redirects=5))
|
|
87
|
+
req = urllib.request.Request(url, headers={"User-Agent": f"vivechak-runner/{VERSION}"})
|
|
88
|
+
try:
|
|
89
|
+
with opener.open(req, timeout=30.0) as resp:
|
|
90
|
+
if resp.status != 200:
|
|
91
|
+
raise RuntimeError(f"Download failed with HTTP status {resp.status} from {url}")
|
|
92
|
+
with open(dest_path, "wb") as f:
|
|
93
|
+
while True:
|
|
94
|
+
chunk = resp.read(64 * 1024)
|
|
95
|
+
if not chunk:
|
|
96
|
+
break
|
|
97
|
+
f.write(chunk)
|
|
98
|
+
except Exception as e:
|
|
99
|
+
sys.stderr.write("Download failed. Behind a proxy? Use Node 24+ with NODE_USE_ENV_PROXY=1, or install with install.sh.\n")
|
|
100
|
+
raise e
|
|
101
|
+
|
|
102
|
+
def safe_extract_tar(tar, path):
|
|
103
|
+
# Use PEP 706 filter="data" if supported (Python 3.12+)
|
|
104
|
+
if hasattr(tarfile, "data_filter"):
|
|
105
|
+
tar.extractall(path, filter="data")
|
|
106
|
+
else:
|
|
107
|
+
for member in tar.getmembers():
|
|
108
|
+
member_path = Path(member.name)
|
|
109
|
+
if member_path.is_absolute() or ".." in member_path.parts:
|
|
110
|
+
raise RuntimeError(f"Archive member contains illegal escaping path: {member.name}")
|
|
111
|
+
tar.extractall(path)
|
|
112
|
+
|
|
113
|
+
def safe_extract_zip(zf, path):
|
|
114
|
+
for member in zf.namelist():
|
|
115
|
+
member_path = Path(member)
|
|
116
|
+
if member_path.is_absolute() or ".." in member_path.parts:
|
|
117
|
+
raise RuntimeError(f"ZIP member contains illegal escaping path: {member}")
|
|
118
|
+
zf.extractall(path)
|
|
119
|
+
|
|
120
|
+
def ensure_binary(prog_name):
|
|
121
|
+
os_name, arch_name = get_platform_info()
|
|
122
|
+
is_win = os_name == "windows"
|
|
123
|
+
bin_name = f"{prog_name}.exe" if is_win else prog_name
|
|
124
|
+
cache_dir = get_cache_dir()
|
|
125
|
+
bin_path = cache_dir / bin_name
|
|
126
|
+
|
|
127
|
+
if bin_path.exists():
|
|
128
|
+
return str(bin_path)
|
|
129
|
+
|
|
130
|
+
# Determine release archive name
|
|
131
|
+
if os_name == "darwin":
|
|
132
|
+
archive = f"vivechak_{VERSION}_darwin_all.tar.gz"
|
|
133
|
+
elif os_name == "windows":
|
|
134
|
+
archive = f"vivechak_{VERSION}_windows_{arch_name}.zip"
|
|
135
|
+
else:
|
|
136
|
+
archive = f"vivechak_{VERSION}_{os_name}_{arch_name}.tar.gz"
|
|
137
|
+
|
|
138
|
+
cache_dir.mkdir(parents=True, exist_ok=True)
|
|
139
|
+
random_id = secrets.token_hex(6)
|
|
140
|
+
temp_extract_dir = cache_dir / f".tmp-{os.getpid()}-{random_id}"
|
|
141
|
+
archive_path = cache_dir / f"{archive}.{os.getpid()}-{random_id}.tmp"
|
|
142
|
+
checksum_path = cache_dir / f"checksums.{os.getpid()}-{random_id}.tmp"
|
|
143
|
+
|
|
144
|
+
base_url = get_download_base()
|
|
145
|
+
url = f"{base_url}/v{VERSION}/{archive}"
|
|
146
|
+
checksum_url = f"{base_url}/v{VERSION}/checksums.txt"
|
|
147
|
+
|
|
148
|
+
sys.stderr.write(f"[vck] Fetching Vivechak v{VERSION} for {os_name}/{arch_name}...\n")
|
|
149
|
+
sys.stderr.flush()
|
|
150
|
+
|
|
151
|
+
try:
|
|
152
|
+
download_file(url, archive_path)
|
|
153
|
+
download_file(checksum_url, checksum_path)
|
|
154
|
+
|
|
155
|
+
# Compute SHA-256 of downloaded archive
|
|
156
|
+
hasher = hashlib.sha256()
|
|
157
|
+
with open(archive_path, "rb") as f:
|
|
158
|
+
while True:
|
|
159
|
+
chunk = f.read(64 * 1024)
|
|
160
|
+
if not chunk:
|
|
161
|
+
break
|
|
162
|
+
hasher.update(chunk)
|
|
163
|
+
computed_sha = hasher.hexdigest().lower()
|
|
164
|
+
|
|
165
|
+
# Parse checksums.txt
|
|
166
|
+
with open(checksum_path, "rb") as f:
|
|
167
|
+
checksum_data = f.read()
|
|
168
|
+
|
|
169
|
+
expected_sha = None
|
|
170
|
+
for line in checksum_data.decode("utf-8", errors="replace").splitlines():
|
|
171
|
+
parts = line.strip().split()
|
|
172
|
+
if len(parts) >= 2 and parts[1] == archive:
|
|
173
|
+
expected_sha = parts[0].lower()
|
|
174
|
+
break
|
|
175
|
+
|
|
176
|
+
if not expected_sha:
|
|
177
|
+
raise RuntimeError(f"Checksum entry for {archive} not found in checksums.txt")
|
|
178
|
+
|
|
179
|
+
if computed_sha != expected_sha:
|
|
180
|
+
raise RuntimeError(f"Checksum mismatch for {archive}! Expected {expected_sha}, computed {computed_sha}")
|
|
181
|
+
|
|
182
|
+
sys.stderr.write(f"[vck] Checksum verified: {computed_sha[:8]}...\n")
|
|
183
|
+
sys.stderr.flush()
|
|
184
|
+
|
|
185
|
+
temp_extract_dir.mkdir(parents=True, exist_ok=True)
|
|
186
|
+
if archive.endswith(".zip"):
|
|
187
|
+
with zipfile.ZipFile(archive_path, "r") as zf:
|
|
188
|
+
safe_extract_zip(zf, temp_extract_dir)
|
|
189
|
+
else:
|
|
190
|
+
with tarfile.open(archive_path, "r:gz") as tf:
|
|
191
|
+
safe_extract_tar(tf, temp_extract_dir)
|
|
192
|
+
|
|
193
|
+
# Set permissions in temporary extraction directory
|
|
194
|
+
if not is_win:
|
|
195
|
+
for b in [temp_extract_dir / "vivechak", temp_extract_dir / "vck"]:
|
|
196
|
+
if b.exists():
|
|
197
|
+
b.chmod(0o755)
|
|
198
|
+
|
|
199
|
+
# Atomically rename or copy files into cache_dir
|
|
200
|
+
for item in temp_extract_dir.iterdir():
|
|
201
|
+
target_file = cache_dir / item.name
|
|
202
|
+
try:
|
|
203
|
+
item.replace(target_file)
|
|
204
|
+
except Exception:
|
|
205
|
+
shutil.copy2(item, target_file)
|
|
206
|
+
try:
|
|
207
|
+
item.unlink()
|
|
208
|
+
except Exception:
|
|
209
|
+
pass
|
|
210
|
+
|
|
211
|
+
finally:
|
|
212
|
+
for p in (archive_path, checksum_path):
|
|
213
|
+
if p.exists():
|
|
214
|
+
try:
|
|
215
|
+
p.unlink()
|
|
216
|
+
except Exception:
|
|
217
|
+
pass
|
|
218
|
+
if temp_extract_dir.exists():
|
|
219
|
+
shutil.rmtree(temp_extract_dir, ignore_errors=True)
|
|
220
|
+
|
|
221
|
+
if not is_win:
|
|
222
|
+
for b in [cache_dir / "vivechak", cache_dir / "vck"]:
|
|
223
|
+
if b.exists():
|
|
224
|
+
b.chmod(0o755)
|
|
225
|
+
|
|
226
|
+
if not bin_path.exists():
|
|
227
|
+
alt_name = (f"{'vivechak' if prog_name == 'vck' else 'vck'}.exe") if is_win else ('vivechak' if prog_name == 'vck' else 'vck')
|
|
228
|
+
alt_path = cache_dir / alt_name
|
|
229
|
+
if alt_path.exists():
|
|
230
|
+
shutil.copy2(alt_path, bin_path)
|
|
231
|
+
if not is_win:
|
|
232
|
+
bin_path.chmod(0o755)
|
|
233
|
+
else:
|
|
234
|
+
raise RuntimeError(f"Binary {bin_name} was not found after extraction in {cache_dir}")
|
|
235
|
+
|
|
236
|
+
return str(bin_path)
|
|
237
|
+
|
|
238
|
+
def main():
|
|
239
|
+
try:
|
|
240
|
+
raw_cmd = Path(sys.argv[0]).stem.lower()
|
|
241
|
+
prog = "vck" if "vck" in raw_cmd else "vivechak"
|
|
242
|
+
bin_path = ensure_binary(prog)
|
|
243
|
+
args = [bin_path] + sys.argv[1:]
|
|
244
|
+
|
|
245
|
+
env = os.environ.copy()
|
|
246
|
+
env["VIVECHAK_LAUNCHER"] = "uvx"
|
|
247
|
+
|
|
248
|
+
if sys.platform not in ("win32", "cygwin"):
|
|
249
|
+
os.execvpe(bin_path, args, env)
|
|
250
|
+
else:
|
|
251
|
+
code = subprocess.call(args, env=env)
|
|
252
|
+
sys.exit(code)
|
|
253
|
+
except KeyboardInterrupt:
|
|
254
|
+
sys.exit(130)
|
|
255
|
+
except Exception as e:
|
|
256
|
+
sys.stderr.write(f"Error: {e}\n")
|
|
257
|
+
sys.exit(1)
|
|
258
|
+
|
|
259
|
+
if __name__ == "__main__":
|
|
260
|
+
main()
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: vivechak
|
|
3
|
+
Version: 0.1.0rc1
|
|
4
|
+
Summary: Evidence-grounded research for technical decisions — MCP server
|
|
5
|
+
Author-email: Bhaskar Jha <me@bhaskarjha.dev>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://vivechak.bhaskarjha.dev
|
|
8
|
+
Project-URL: Repository, https://github.com/bhaskarjha-dev/vivechak
|
|
9
|
+
Project-URL: Documentation, https://vivechak.bhaskarjha.dev/docs
|
|
10
|
+
Keywords: mcp,model-context-protocol,ai-agent,architecture,research,cursor,claude
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
15
|
+
Requires-Python: >=3.8
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
18
|
+
# Vivechak & `vck`
|
|
19
|
+
|
|
20
|
+
<!-- mcp-name: io.github.bhaskarjha-dev/vivechak -->
|
|
21
|
+
|
|
22
|
+
**Evidence-graded technical decisions for AI coding agents — researched, challenged, and gated in Markdown before you write code.**
|
|
23
|
+
|
|
24
|
+
Official Python runner for **Vivechak** and shorthand CLI **`vck`**. Automatically downloads, SHA-256-verifies, and caches the pre-compiled static Go binary for your OS and architecture (`darwin`, `linux`, `windows`, `freebsd`) while keeping `stdout` 100% clean for MCP JSON-RPC over `stdio`.
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 1. Quickstart (`uvx`)
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Configure your AI coding host in one command (10 verified presets)
|
|
32
|
+
uvx vck setup claude-code # or: cursor, vscode, claude, agy, windsurf, zed, roo, opencode, goose
|
|
33
|
+
|
|
34
|
+
# Optional: install as a persistent CLI tool via uv
|
|
35
|
+
uv tool install vivechak # provides both `vck` and `vivechak`
|
|
36
|
+
|
|
37
|
+
# Check workspace integrity and evaluate the pre-code Phase 0 Gate (exits 1 on FAIL)
|
|
38
|
+
uvx vck doctor
|
|
39
|
+
uvx vck gate
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## 2. Zero-Install Host Configuration (`uvx vck serve`)
|
|
45
|
+
|
|
46
|
+
### Claude Code (`~/.claude.json` or `.mcp.json`) · Cursor (`.cursor/mcp.json`) · Claude Desktop
|
|
47
|
+
```json
|
|
48
|
+
{
|
|
49
|
+
"mcpServers": {
|
|
50
|
+
"vivechak": {
|
|
51
|
+
"command": "uvx",
|
|
52
|
+
"args": ["vck", "serve"]
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### VS Code Copilot Agent Mode (`.vscode/mcp.json`)
|
|
59
|
+
```json
|
|
60
|
+
{
|
|
61
|
+
"servers": {
|
|
62
|
+
"vivechak": {
|
|
63
|
+
"command": "uvx",
|
|
64
|
+
"args": ["vck", "serve"]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
---
|
|
71
|
+
|
|
72
|
+
## 3. Three Reversibility-Calibrated Scopes
|
|
73
|
+
|
|
74
|
+
| Scope | Example Agent Prompt | Investment | Saved Artifact in `research/` |
|
|
75
|
+
|---|---|---|---|
|
|
76
|
+
| **Comparison** | *"Use Vivechak to compare Pino vs Winston for our Node.js service."* | 1 session (~5 min) | `C-001-comparison.md` (Weighted Evaluation Matrix) |
|
|
77
|
+
| **Decision** | *"Use Vivechak to decide whether to migrate events from Postgres to ClickHouse."* | 1–3 sessions (~30 min) | `D-001-decision.md` (ADR) + `DECISIONS.md` |
|
|
78
|
+
| **Project** | *"Use Vivechak to architect our multi-tenant telemetry pipeline."* | 4–30 DAG sessions | `RESEARCH-PIPELINE.md` → `FAD.md` |
|
|
79
|
+
|
|
80
|
+
For irreversible **One-Way Door** ADRs, `vck gate` requires an adversarial red-team challenge record (`vivechak_review(mode="red_team", id="D-001")`) and an out-of-band human terminal sign-off (`vck signoff D-001 --reviewer "Your Name"`).
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Documentation & Source
|
|
85
|
+
|
|
86
|
+
Official Website: **[vivechak.bhaskarjha.dev](https://vivechak.bhaskarjha.dev)** · Documentation: **[vivechak.bhaskarjha.dev/docs](https://vivechak.bhaskarjha.dev/docs)** · Source: **[github.com/bhaskarjha-dev/vivechak](https://github.com/bhaskarjha-dev/vivechak)** · MIT License © [Bhaskar Jha](https://bhaskarjha.dev).
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
src/vivechak/__init__.py
|
|
4
|
+
src/vivechak/cli.py
|
|
5
|
+
src/vivechak.egg-info/PKG-INFO
|
|
6
|
+
src/vivechak.egg-info/SOURCES.txt
|
|
7
|
+
src/vivechak.egg-info/dependency_links.txt
|
|
8
|
+
src/vivechak.egg-info/entry_points.txt
|
|
9
|
+
src/vivechak.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
vivechak
|