vichar 0.1.0__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.
@@ -0,0 +1,65 @@
1
+ # Changelog
2
+
3
+ All notable changes to VICHAR are documented here.
4
+ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
5
+
6
+ ---
7
+
8
+ ## [0.1.0] — 2024-06-16
9
+
10
+ ### Added
11
+
12
+ - **`vichar init`** — stamps `.vichar/project.json` with a UUID project identity,
13
+ writes `.vichar/CLAUDE.md`, `.vichar/cursor_rules`, `.vichar/SCHEMA.md`,
14
+ non-destructively injects `@.vichar/CLAUDE.md` into project `CLAUDE.md` and
15
+ inline block into `.cursor/rules` using `# --- VICHAR START/END ---` markers.
16
+ Interactive git prompt: `[L]ocal`, `[G]it`, `[S]kip`.
17
+
18
+ - **`vichar capture`** — records a `decision`, `thread`, or `task` with `--type`,
19
+ `--body`, and `--author` flags. All entries stamped with `"schema": "1"`.
20
+ Atomic writes via `.tmp` + `os.replace()`. Cross-platform file locking
21
+ (`fcntl` on Unix, `msvcrt` on Windows).
22
+
23
+ - **`vichar ratify <id>`** — marks an entry as human-confirmed (`proposed` → `ratified`).
24
+ Records `ratified_by` and `ratified_at`.
25
+
26
+ - **`vichar close <id>`** — marks an entry as closed.
27
+
28
+ - **`vichar log`** — rich ANSI table of open entries with status icons:
29
+ `V` (ratified), `?` (proposed), `o` (open), `X` (closed).
30
+ Body preview on second line. Warns about pre-schema entries.
31
+
32
+ - **`vichar status`** — one-line project summary with entry counts by
33
+ type and status. `--json` flag for machine-readable output.
34
+
35
+ - **`vichar migrate`** — upgrades pre-schema (`v0`) entries to schema v1.
36
+ `--dry-run` to preview changes. Backs up `entries.json` before writing.
37
+
38
+ - **`vichar uninit`** — removes VICHAR injection blocks from `CLAUDE.md`
39
+ and `.cursor/rules`. Leaves `.vichar/` directory intact.
40
+
41
+ - **`vichar-server`** — HTTP server on port 7474 (configurable via `--port`/`--host`).
42
+ Endpoints: `GET /` (HTML status page), `GET /status` (JSON), `GET /log` (JSON),
43
+ `POST /capture`, `POST /ratify`, `POST /close`.
44
+ Real-time coloured terminal output per event. Port conflict detection.
45
+ Graceful `Ctrl+C` shutdown.
46
+
47
+ - **Zero external dependencies** — pure Python stdlib. Works on Python 3.8+.
48
+
49
+ - **ANSI colours** — disabled automatically in CI (`NO_COLOR` env var),
50
+ non-TTY pipes, and enabled via `os.system("")` on Windows 10+.
51
+
52
+ - **`pyproject.toml`** — PEP 621 packaging. Entry points for `vichar` and
53
+ `vichar-server` console scripts.
54
+
55
+ - **`SCHEMA.md`** — documents all entry fields and schema versions.
56
+
57
+ - **`.gitignore`** — standard Python ignores. `.vichar/` intentionally NOT
58
+ ignored in this repo (development entries are worth keeping).
59
+
60
+ ---
61
+
62
+ ## Pre-release (development)
63
+
64
+ Initial design and prototyping captured in `.vichar/entries.json`
65
+ (17 entries, including real decisions made during the build).
vichar-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Shivranjan Kolvankar
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.
@@ -0,0 +1,5 @@
1
+ include README.md
2
+ include LICENSE
3
+ include CHANGELOG.md
4
+ include vichar.py
5
+ include vichar_server.py
vichar-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,191 @@
1
+ Metadata-Version: 2.4
2
+ Name: vichar
3
+ Version: 0.1.0
4
+ Summary: Versioned Intent and Context History for Agentic Reasoning — capture the why behind AI agent decisions
5
+ Author-email: Shivranjan Kolvankar <shivranjankolvankar@gmail.com>
6
+ License: MIT License
7
+
8
+ Copyright (c) 2024 Shivranjan Kolvankar
9
+
10
+ Permission is hereby granted, free of charge, to any person obtaining a copy
11
+ of this software and associated documentation files (the "Software"), to deal
12
+ in the Software without restriction, including without limitation the rights
13
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
+ copies of the Software, and to permit persons to whom the Software is
15
+ furnished to do so, subject to the following conditions:
16
+
17
+ The above copyright notice and this permission notice shall be included in all
18
+ copies or substantial portions of the Software.
19
+
20
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26
+ SOFTWARE.
27
+
28
+ Project-URL: Homepage, https://github.com/shivranjankolvankar/vichar
29
+ Project-URL: Repository, https://github.com/shivranjankolvankar/vichar
30
+ Keywords: ai,agent,reasoning,decision,claude,cursor,llm
31
+ Classifier: Development Status :: 3 - Alpha
32
+ Classifier: Intended Audience :: Developers
33
+ Classifier: License :: OSI Approved :: MIT License
34
+ Classifier: Programming Language :: Python :: 3
35
+ Classifier: Programming Language :: Python :: 3.8
36
+ Classifier: Programming Language :: Python :: 3.9
37
+ Classifier: Programming Language :: Python :: 3.10
38
+ Classifier: Programming Language :: Python :: 3.11
39
+ Classifier: Programming Language :: Python :: 3.12
40
+ Classifier: Topic :: Software Development :: Libraries
41
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
42
+ Requires-Python: >=3.8
43
+ Description-Content-Type: text/markdown
44
+ License-File: LICENSE
45
+ Dynamic: license-file
46
+
47
+ # VICHAR — विचार
48
+
49
+ **Versioned Intent and Context History for Agentic Reasoning**
50
+
51
+ VICHAR captures *why* AI agents make decisions — not just what they do.
52
+ Every decision, open question, and task is recorded so the next session
53
+ (or a different agent) starts with full context instead of zero.
54
+
55
+ ---
56
+
57
+ ## Install
58
+
59
+ ```bash
60
+ pip install vichar
61
+ ```
62
+
63
+ Or from source:
64
+
65
+ ```bash
66
+ git clone https://github.com/shivranjankolvankar/vichar
67
+ cd vichar
68
+ pip install -e .
69
+ ```
70
+
71
+ ---
72
+
73
+ ## Quick start
74
+
75
+ ```bash
76
+ # Initialise in your project
77
+ cd my-project
78
+ vichar init
79
+
80
+ # Agents capture reasoning as they work
81
+ vichar capture "Use FastAPI over Flask" \
82
+ --type decision \
83
+ --author claude-code \
84
+ --body "Flask lacks async support. FastAPI gives us OpenAPI docs for free."
85
+
86
+ # At session start — read prior context
87
+ vichar log
88
+
89
+ # Confirm an entry (human ratification)
90
+ vichar ratify abc12345
91
+
92
+ # One-line project summary
93
+ vichar status
94
+ ```
95
+
96
+ ---
97
+
98
+ ## Core concept: the trust gradient
99
+
100
+ | Status | Meaning |
101
+ |--------|---------|
102
+ | `proposed` | Agent-written, unreviewed |
103
+ | `ratified` | Human-confirmed |
104
+ | `closed` | No longer relevant |
105
+
106
+ Agents write freely. Humans decide what to trust.
107
+
108
+ ---
109
+
110
+ ## Commands
111
+
112
+ | Command | Description |
113
+ |---------|-------------|
114
+ | `vichar init` | Stamp project, write agent files, inject into CLAUDE.md + .cursor/rules |
115
+ | `vichar capture "<text>"` | Capture a decision, thread, or task |
116
+ | `vichar ratify <id>` | Mark an entry as human-confirmed |
117
+ | `vichar close <id>` | Close an entry |
118
+ | `vichar log` | Show open entries (rich table) |
119
+ | `vichar status` | One-line project summary (add `--json` for machine output) |
120
+ | `vichar migrate` | Upgrade pre-schema entries to schema v1 |
121
+ | `vichar uninit` | Remove VICHAR injection from CLAUDE.md + .cursor/rules |
122
+ | `vichar-server` | Start HTTP server on port 7474 (fallback for shell-less agents) |
123
+
124
+ ---
125
+
126
+ ## HTTP server (agent fallback)
127
+
128
+ When an agent cannot run shell commands, it can POST over HTTP instead:
129
+
130
+ ```bash
131
+ vichar-server [--port 7474] [--host 127.0.0.1]
132
+ ```
133
+
134
+ ```python
135
+ import urllib.request, json
136
+
137
+ def vichar(title, type="decision", body="", author="agent"):
138
+ data = json.dumps({"title": title, "type": type,
139
+ "body": body, "author": author}).encode()
140
+ req = urllib.request.Request(
141
+ "http://localhost:7474/capture", data=data,
142
+ headers={"Content-Type": "application/json"}, method="POST")
143
+ try:
144
+ with urllib.request.urlopen(req, timeout=2) as r:
145
+ return json.loads(r.read())
146
+ except Exception:
147
+ return None # never block on VICHAR
148
+ ```
149
+
150
+ Server endpoints: `GET /` `GET /status` `GET /log` `POST /capture` `POST /ratify` `POST /close`
151
+
152
+ ---
153
+
154
+ ## Agent integration
155
+
156
+ `vichar init` writes instruction files and injects them automatically:
157
+
158
+ - **Claude Code** (`CLAUDE.md`): injects `@.vichar/CLAUDE.md` import line
159
+ - **Cursor** (`.cursor/rules`): inlines the full instruction block
160
+ - Both injections are non-destructive (VICHAR START/END markers, idempotent)
161
+
162
+ The agent files tell Claude / Cursor *when* to capture, *how* to capture, and the HTTP fallback snippet.
163
+
164
+ ---
165
+
166
+ ## What gets stored
167
+
168
+ Each entry in `.vichar/entries.json` has:
169
+
170
+ | Field | Description |
171
+ |-------|-------------|
172
+ | `id` | 8-char hex identifier |
173
+ | `type` | `decision` / `thread` / `task` |
174
+ | `status` | `proposed` / `ratified` / `closed` |
175
+ | `title` | One-line summary |
176
+ | `body` | Extended reasoning (markdown) |
177
+ | `author` | `claude-code` / `cursor` / `human` / `agent` |
178
+ | `schema` | `"1"` (schema version) |
179
+
180
+ ---
181
+
182
+ ## Zero dependencies
183
+
184
+ VICHAR is pure Python stdlib — no `rich`, no `colorama`, no `click`.
185
+ It works in any Python 3.8+ environment without `pip install` overhead.
186
+
187
+ ---
188
+
189
+ ## License
190
+
191
+ MIT
vichar-0.1.0/README.md ADDED
@@ -0,0 +1,145 @@
1
+ # VICHAR — विचार
2
+
3
+ **Versioned Intent and Context History for Agentic Reasoning**
4
+
5
+ VICHAR captures *why* AI agents make decisions — not just what they do.
6
+ Every decision, open question, and task is recorded so the next session
7
+ (or a different agent) starts with full context instead of zero.
8
+
9
+ ---
10
+
11
+ ## Install
12
+
13
+ ```bash
14
+ pip install vichar
15
+ ```
16
+
17
+ Or from source:
18
+
19
+ ```bash
20
+ git clone https://github.com/shivranjankolvankar/vichar
21
+ cd vichar
22
+ pip install -e .
23
+ ```
24
+
25
+ ---
26
+
27
+ ## Quick start
28
+
29
+ ```bash
30
+ # Initialise in your project
31
+ cd my-project
32
+ vichar init
33
+
34
+ # Agents capture reasoning as they work
35
+ vichar capture "Use FastAPI over Flask" \
36
+ --type decision \
37
+ --author claude-code \
38
+ --body "Flask lacks async support. FastAPI gives us OpenAPI docs for free."
39
+
40
+ # At session start — read prior context
41
+ vichar log
42
+
43
+ # Confirm an entry (human ratification)
44
+ vichar ratify abc12345
45
+
46
+ # One-line project summary
47
+ vichar status
48
+ ```
49
+
50
+ ---
51
+
52
+ ## Core concept: the trust gradient
53
+
54
+ | Status | Meaning |
55
+ |--------|---------|
56
+ | `proposed` | Agent-written, unreviewed |
57
+ | `ratified` | Human-confirmed |
58
+ | `closed` | No longer relevant |
59
+
60
+ Agents write freely. Humans decide what to trust.
61
+
62
+ ---
63
+
64
+ ## Commands
65
+
66
+ | Command | Description |
67
+ |---------|-------------|
68
+ | `vichar init` | Stamp project, write agent files, inject into CLAUDE.md + .cursor/rules |
69
+ | `vichar capture "<text>"` | Capture a decision, thread, or task |
70
+ | `vichar ratify <id>` | Mark an entry as human-confirmed |
71
+ | `vichar close <id>` | Close an entry |
72
+ | `vichar log` | Show open entries (rich table) |
73
+ | `vichar status` | One-line project summary (add `--json` for machine output) |
74
+ | `vichar migrate` | Upgrade pre-schema entries to schema v1 |
75
+ | `vichar uninit` | Remove VICHAR injection from CLAUDE.md + .cursor/rules |
76
+ | `vichar-server` | Start HTTP server on port 7474 (fallback for shell-less agents) |
77
+
78
+ ---
79
+
80
+ ## HTTP server (agent fallback)
81
+
82
+ When an agent cannot run shell commands, it can POST over HTTP instead:
83
+
84
+ ```bash
85
+ vichar-server [--port 7474] [--host 127.0.0.1]
86
+ ```
87
+
88
+ ```python
89
+ import urllib.request, json
90
+
91
+ def vichar(title, type="decision", body="", author="agent"):
92
+ data = json.dumps({"title": title, "type": type,
93
+ "body": body, "author": author}).encode()
94
+ req = urllib.request.Request(
95
+ "http://localhost:7474/capture", data=data,
96
+ headers={"Content-Type": "application/json"}, method="POST")
97
+ try:
98
+ with urllib.request.urlopen(req, timeout=2) as r:
99
+ return json.loads(r.read())
100
+ except Exception:
101
+ return None # never block on VICHAR
102
+ ```
103
+
104
+ Server endpoints: `GET /` `GET /status` `GET /log` `POST /capture` `POST /ratify` `POST /close`
105
+
106
+ ---
107
+
108
+ ## Agent integration
109
+
110
+ `vichar init` writes instruction files and injects them automatically:
111
+
112
+ - **Claude Code** (`CLAUDE.md`): injects `@.vichar/CLAUDE.md` import line
113
+ - **Cursor** (`.cursor/rules`): inlines the full instruction block
114
+ - Both injections are non-destructive (VICHAR START/END markers, idempotent)
115
+
116
+ The agent files tell Claude / Cursor *when* to capture, *how* to capture, and the HTTP fallback snippet.
117
+
118
+ ---
119
+
120
+ ## What gets stored
121
+
122
+ Each entry in `.vichar/entries.json` has:
123
+
124
+ | Field | Description |
125
+ |-------|-------------|
126
+ | `id` | 8-char hex identifier |
127
+ | `type` | `decision` / `thread` / `task` |
128
+ | `status` | `proposed` / `ratified` / `closed` |
129
+ | `title` | One-line summary |
130
+ | `body` | Extended reasoning (markdown) |
131
+ | `author` | `claude-code` / `cursor` / `human` / `agent` |
132
+ | `schema` | `"1"` (schema version) |
133
+
134
+ ---
135
+
136
+ ## Zero dependencies
137
+
138
+ VICHAR is pure Python stdlib — no `rich`, no `colorama`, no `click`.
139
+ It works in any Python 3.8+ environment without `pip install` overhead.
140
+
141
+ ---
142
+
143
+ ## License
144
+
145
+ MIT
@@ -0,0 +1,37 @@
1
+ [build-system]
2
+ requires = ["setuptools>=61"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "vichar"
7
+ version = "0.1.0"
8
+ description = "Versioned Intent and Context History for Agentic Reasoning — capture the why behind AI agent decisions"
9
+ readme = "README.md"
10
+ license = { file = "LICENSE" }
11
+ requires-python = ">=3.8"
12
+ authors = [{ name = "Shivranjan Kolvankar", email = "shivranjankolvankar@gmail.com" }]
13
+ keywords = ["ai", "agent", "reasoning", "decision", "claude", "cursor", "llm"]
14
+ classifiers = [
15
+ "Development Status :: 3 - Alpha",
16
+ "Intended Audience :: Developers",
17
+ "License :: OSI Approved :: MIT License",
18
+ "Programming Language :: Python :: 3",
19
+ "Programming Language :: Python :: 3.8",
20
+ "Programming Language :: Python :: 3.9",
21
+ "Programming Language :: Python :: 3.10",
22
+ "Programming Language :: Python :: 3.11",
23
+ "Programming Language :: Python :: 3.12",
24
+ "Topic :: Software Development :: Libraries",
25
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
26
+ ]
27
+
28
+ [project.urls]
29
+ Homepage = "https://github.com/shivranjankolvankar/vichar"
30
+ Repository = "https://github.com/shivranjankolvankar/vichar"
31
+
32
+ [project.scripts]
33
+ vichar = "vichar:main"
34
+ vichar-server = "vichar_server:main"
35
+
36
+ [tool.setuptools]
37
+ py-modules = ["vichar", "vichar_server"]
vichar-0.1.0/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
vichar-0.1.0/setup.py ADDED
@@ -0,0 +1,4 @@
1
+ # Legacy shim — all metadata is in pyproject.toml (PEP 621).
2
+ # This file exists only for editable installs on older pip versions.
3
+ from setuptools import setup
4
+ setup()