codevira 3.2.0__py3-none-any.whl → 3.3.0__py3-none-any.whl
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.
- {codevira-3.2.0.dist-info → codevira-3.3.0.dist-info}/METADATA +34 -11
- {codevira-3.2.0.dist-info → codevira-3.3.0.dist-info}/RECORD +20 -16
- mcp_server/__init__.py +1 -1
- mcp_server/cli.py +82 -24
- mcp_server/cli_export.py +84 -15
- mcp_server/cli_transfer.py +410 -0
- mcp_server/engine/__init__.py +2 -0
- mcp_server/engine/policies/__init__.py +2 -0
- mcp_server/engine/policies/blast_radius.py +33 -11
- mcp_server/engine/policies/decision_lock.py +89 -33
- mcp_server/engine/policies/prompt_capture.py +255 -0
- mcp_server/engine/policies/session_log_enforcer.py +88 -9
- mcp_server/server.py +57 -0
- mcp_server/tools/learning.py +17 -0
- mcp_server/tools/preferences.py +273 -0
- mcp_server/update_check.py +230 -0
- {codevira-3.2.0.dist-info → codevira-3.3.0.dist-info}/LICENSE +0 -0
- {codevira-3.2.0.dist-info → codevira-3.3.0.dist-info}/WHEEL +0 -0
- {codevira-3.2.0.dist-info → codevira-3.3.0.dist-info}/entry_points.txt +0 -0
- {codevira-3.2.0.dist-info → codevira-3.3.0.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: codevira
|
|
3
|
-
Version: 3.
|
|
3
|
+
Version: 3.3.0
|
|
4
4
|
Summary: Cross-IDE decision enforcement for AI coding agents. 1 MB per project, in your repo, no cloud, no vectors. Claude Code, Cursor, Windsurf, Antigravity, Codex all share the same in-repo memory; hooks block AI tool calls that violate prior decisions. MIT, local-first.
|
|
5
5
|
Author-email: Sachin Shelke <sachin.worldnet@gmail.com>
|
|
6
6
|
License: MIT
|
|
@@ -178,7 +178,7 @@ Full v3.1.1 release notes: [CHANGELOG.md](CHANGELOG.md#311--2026-05-30--hardenin
|
|
|
178
178
|
|---|---|
|
|
179
179
|
| **Decision storage** | Moved into `<repo>/.codevira/decisions.jsonl` (git-tracked, one decision per line). v2.x stored decisions in `~/.codevira/projects/<key>/graph/graph.db` (a SQLite blob nobody could read). |
|
|
180
180
|
| **AGENTS.md is the nudge file** | Per-IDE nudges (CLAUDE.md / GEMINI.md / .windsurfrules / .cursor/rules/codevira.mdc / .github/copilot-instructions.md) all deleted. Every modern AI tool reads AGENTS.md natively. Slim 5 KB cap; auto-regenerated from decisions; user content outside the `<!-- codevira:begin -->...<!-- codevira:end -->` markers preserved byte-for-byte. |
|
|
181
|
-
| **MCP tool surface** | 46 → 24 tools (-48%; 23 surfaced to AI clients, 1 admin-only). The audit found 22 tools that nobody called in real usage (preferences, learned_rules, changesets, project_maturity, list_nodes / add_node / update_node / export_graph, etc.). All deleted. |
|
|
181
|
+
| **MCP tool surface** | 46 → 24 tools (-48%; 23 surfaced to AI clients, 1 admin-only). The audit found 22 tools that nobody called in real usage (preferences, learned_rules, changesets, project_maturity, list_nodes / add_node / update_node / export_graph, etc.). All deleted. (v3.1.0 later added 24 memory-subsystem tools, and v3.3.0 brought preferences back redesigned — `distill_preferences` / `search_preferences`, LLM-distilled from real prompts instead of the unused v2.x CRUD.) |
|
|
182
182
|
| **CLI surface** | 23 → 15 commands (-35%). Deleted: `heal` (use `reset`), `budget`, `agents`, `hooks`, `register`, `configure`, `report` (folded into `doctor`), `calibrate`, `insights`. |
|
|
183
183
|
| **IDE detection hardened** | No more false-positives from stale `~/.cursor/` dirs. Each IDE needs a STRONG signal (binary on PATH, or verified config file). Pass `--ide X --force` to override when the detector misses an install. |
|
|
184
184
|
| **`codevira uninstall`** | New command. Reverses every system write made by `init`/`setup`: drops the MCP entry from `~/.claude.json`, deletes `~/.claude/hooks/codevira-*.sh`, strips codevira-tagged registrations from `~/.claude/settings.json`, removes per-project `.codevira/` + `.codevira-cache/`, strips the codevira block from AGENTS.md. Optional `--keep-data`. |
|
|
@@ -294,7 +294,8 @@ The v3.0.0 CLI surface is 15 commands:
|
|
|
294
294
|
| `codevira replay` | Browse the decisions timeline (terminal / markdown / HTML) |
|
|
295
295
|
| `codevira clean` | Remove orphaned project data |
|
|
296
296
|
| `codevira reset` | Destructive cleanup (auto-exports decisions first) |
|
|
297
|
-
| `codevira export` | Standalone decision backup (JSON / SQL) |
|
|
297
|
+
| `codevira export` | Standalone decision backup (JSON / SQL); `export setup` bundles project memory + global learning for machine transfer |
|
|
298
|
+
| `codevira import` | Restore a `codevira export setup` archive on a new machine (merges global learning) |
|
|
298
299
|
| `codevira graph` | Render an interactive, self-contained HTML viewer of decision memory (offline, queryable) |
|
|
299
300
|
| `codevira uninstall` | Reverse every system write codevira made (see ["Uninstall"](#uninstall)) |
|
|
300
301
|
| `codevira serve` | Start MCP HTTP server (single-project; stdio is the daily mode) |
|
|
@@ -401,12 +402,16 @@ servers you aren't actively using.
|
|
|
401
402
|
|
|
402
403
|
## MCP Tools
|
|
403
404
|
|
|
404
|
-
**
|
|
405
|
-
summary-first)
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
405
|
+
**49 tools** surfaced to AI clients via `tools/list` (token-optimized,
|
|
406
|
+
summary-first): the core decision/roadmap/graph surface plus the
|
|
407
|
+
v3.1.0 memory subsystems (working memory, skills, spatial, consensus,
|
|
408
|
+
reflections) and the v3.3.0 preference tools. One additional admin
|
|
409
|
+
tool (`refresh_graph`) is registered but hidden from `tools/list`
|
|
410
|
+
because it runs automatically in the background — humans invoke it via
|
|
411
|
+
`codevira sync`. Set `CODEVIRA_TOOL_PROFILE=lean` to advertise only
|
|
412
|
+
the daily-driver subset. v3.0.0 cut 21 v2.x tools that produced noise
|
|
413
|
+
or had no real users — see [CHANGELOG.md](CHANGELOG.md) for the full
|
|
414
|
+
kill list.
|
|
410
415
|
|
|
411
416
|
### Reads — the memory surface
|
|
412
417
|
|
|
@@ -417,7 +422,6 @@ see [CHANGELOG.md](CHANGELOG.md) for the full kill list.
|
|
|
417
422
|
| `list_decisions` | Paginate / filter: `since_date`, `file_pattern`, `protected_only`, `tags`, `include_superseded`. |
|
|
418
423
|
| `list_tags` | Enumerate all tags with decision counts. |
|
|
419
424
|
| `get_history(file_path)` | Recent decisions touching a file. |
|
|
420
|
-
| `get_decision_confidence(file_path?, pattern?)` | Outcome-based reliability score for a file/area. |
|
|
421
425
|
| `check_conflict(decision_text)` | Surface duplicate / contradictory decisions BEFORE you write. |
|
|
422
426
|
|
|
423
427
|
### Writes — capturing decisions
|
|
@@ -426,6 +430,8 @@ see [CHANGELOG.md](CHANGELOG.md) for the full kill list.
|
|
|
426
430
|
|---|---|
|
|
427
431
|
| `record_decision` | Capture an architectural decision. Optional `do_not_revert=true` triggers hard enforcement at the Claude Code PreToolUse hook. Supports `tags`, `force`, `session_id`. |
|
|
428
432
|
| `supersede_decision(old_id, new_decision, reason)` | Retire an old decision and link to its replacement. Audit trail preserved. |
|
|
433
|
+
| `reaffirm_decision(decision_id)` | Re-confirm a soft-expired `do_not_revert` lock is still wanted. |
|
|
434
|
+
| `set_decision_flag(decision_id, ...)` | Toggle `do_not_revert` / tags on an existing decision. |
|
|
429
435
|
| `write_session_log` | Structured session record. |
|
|
430
436
|
|
|
431
437
|
### Roadmap
|
|
@@ -453,6 +459,23 @@ see [CHANGELOG.md](CHANGELOG.md) for the full kill list.
|
|
|
453
459
|
| `get_code(file_path, symbol)` | Full source of one function or class. |
|
|
454
460
|
| `get_playbook(task_type)` | Curated rules for: `add_tool`, `add_service`, `add_schema`, `debug_pipeline`, `commit`, `write_test`. |
|
|
455
461
|
|
|
462
|
+
### Memory subsystems (v3.1.0)
|
|
463
|
+
|
|
464
|
+
| Subsystem | Tools | What it covers |
|
|
465
|
+
|---|---|---|
|
|
466
|
+
| Working memory | `working_add`, `working_get`, `working_promote`, `get_working_context` | Intra-session scratchpad (decay-scored, capacity-bounded). |
|
|
467
|
+
| Skill library | `record_skill`, `get_skill`, `apply_skill_outcome`, `list_skills`, `supersede_skill`, `promote_skill_to_playbook` | Reusable procedures with composite-ranked retrieval and git-driven reinforcement. |
|
|
468
|
+
| Spatial | `spatial_nearby`, `spatial_heat`, `spatial_neighborhood`, `spatial_affordances` | Code-as-space: activity heatmap, neighborhoods, what task types apply where. |
|
|
469
|
+
| Consensus | `consensus_check`, `consensus_status`, `consensus_propose_supersession`, `consensus_resolve`, `origin_of` | Cross-IDE conflict detection + provenance. |
|
|
470
|
+
| Reflections | `reflect`, `get_reflections`, `list_reflections` | LLM-generated abstractions over recent decisions + sessions (MCP sampling). |
|
|
471
|
+
|
|
472
|
+
### Preferences (v3.3.0)
|
|
473
|
+
|
|
474
|
+
| Tool | Description |
|
|
475
|
+
|---|---|
|
|
476
|
+
| `distill_preferences` | Session-end LLM distillation of captured prompts into durable, user-scoped preferences (`~/.codevira/global.db`). |
|
|
477
|
+
| `search_preferences(category?)` | Retrieve learned preferences — communication style, workflow habits — across all projects. |
|
|
478
|
+
|
|
456
479
|
### MCP Workflow Prompts
|
|
457
480
|
|
|
458
481
|
| Prompt | Description |
|
|
@@ -462,7 +485,7 @@ see [CHANGELOG.md](CHANGELOG.md) for the full kill list.
|
|
|
462
485
|
> v3.0.0 removed 4 v2.x prompts (`review_changes`, `debug_issue`,
|
|
463
486
|
> `pre_commit_check`, `architecture_overview`) because they referenced
|
|
464
487
|
> deleted MCP tools. The slim surface means the AI can synthesize
|
|
465
|
-
> these workflows from the
|
|
488
|
+
> these workflows from the kept tools directly.
|
|
466
489
|
|
|
467
490
|
---
|
|
468
491
|
|
|
@@ -10,7 +10,7 @@ indexer/index_codebase.py,sha256=Fk514UB6TTDY84M6GD7TIID6prhwDfxPK0WDrjkCU50,602
|
|
|
10
10
|
indexer/outcome_tracker.py,sha256=Q0PccuUEZEqxEyXVwWghvxeZ9fVixUSbNFNXF9h2eEE,9795
|
|
11
11
|
indexer/sqlite_graph.py,sha256=fu2sxkW1E3O0SjF3ujuhVPzKebfeUKFnenbeOjZolyc,42012
|
|
12
12
|
indexer/treesitter_parser.py,sha256=Jhlj7rVakFmGpGpACGEt6IOE2IFv18f9u5R82WIr9WQ,18608
|
|
13
|
-
mcp_server/__init__.py,sha256=
|
|
13
|
+
mcp_server/__init__.py,sha256=o38H9jbAr3hSf4qAT4mHe5Axlk1bWiiN9SnAHsFMR0g,549
|
|
14
14
|
mcp_server/__main__.py,sha256=P0lMnAyDBIyRXh6mb8cuOqTjzTlizJKW22_uP9ErLtw,492
|
|
15
15
|
mcp_server/_ghost_check.py,sha256=63JqB_bzNO_pTDVQltC1QT65Bf9Kx3u3s0YV8vpXFLk,3442
|
|
16
16
|
mcp_server/_mcp_registry.py,sha256=kuTJst8g7Zg4td1A2UTOCiPqE5k7vbhjDxznywrZfKc,4338
|
|
@@ -19,9 +19,9 @@ mcp_server/_prompts.py,sha256=YcRxTRwluycT_YKi2jN1UOuZP7Xc_pvQ_CAcW6DAvWs,5224
|
|
|
19
19
|
mcp_server/_repair_init.py,sha256=V22_ZOmyvM3JkBXT3uKXNg-MEbgXsDFR5Hbuyjq5DqM,6138
|
|
20
20
|
mcp_server/_safe_crash.py,sha256=00KmAxkxmoUb7oMwoTJhatT_HYBvzbg0r9tyHO7-_pg,2053
|
|
21
21
|
mcp_server/auto_init.py,sha256=LEr5_wWyTIYsEx4t3lO8Z_TazsOthdjMHCWGfF8NY50,13696
|
|
22
|
-
mcp_server/cli.py,sha256=
|
|
22
|
+
mcp_server/cli.py,sha256=Tv3W-P4gWhKnfSrY_RpjlN5EMXc8niFTIfljZGDzlNQ,106939
|
|
23
23
|
mcp_server/cli_consensus.py,sha256=4fna1blMWWi_w9guSRdUYY6IFSYcna8sbUH6ta5MqWY,1911
|
|
24
|
-
mcp_server/cli_export.py,sha256=
|
|
24
|
+
mcp_server/cli_export.py,sha256=ub9msqisVwIUd3tje0XXJcEMVo933Cjr-Edk2_sZYYE,15542
|
|
25
25
|
mcp_server/cli_graph.py,sha256=gWO4T0zMH14tPlBpCtNZg9FbZL9SEPsotm19FdREbXM,17085
|
|
26
26
|
mcp_server/cli_hooks_admin.py,sha256=v5pIf8Qs1ik5Nj0Q07TDXVj-N9eMtodOhXrPOhHYrh0,8849
|
|
27
27
|
mcp_server/cli_induce.py,sha256=x6Vq2SD0EIIWOSNlwe1SW1NsNTiaiau9lUAxYXpq1M8,12418
|
|
@@ -30,6 +30,7 @@ mcp_server/cli_projects.py,sha256=-8kW27BSnE5ey_WZx5kVzQfW4Cs_B1JvhYsCkcHXlW0,66
|
|
|
30
30
|
mcp_server/cli_reflect.py,sha256=voKpVPBWVFhOu7vkw9CXKXuX51HirIpGHNp_tIexyAY,5980
|
|
31
31
|
mcp_server/cli_replay.py,sha256=YBYQhJf7CnkaxHNLzzpXPfHYdPwPdX4QN8Lz2dZFtCE,5859
|
|
32
32
|
mcp_server/cli_sync.py,sha256=Dhyz34FHfRyCddjyNjZuvGoBPlQbH0rpQ_OZj108QvY,5023
|
|
33
|
+
mcp_server/cli_transfer.py,sha256=UaeeqajgANCNOk5ygQdq_fE-aZdMWOvF0qOT8JSUCkg,15894
|
|
33
34
|
mcp_server/cli_uninstall.py,sha256=QH1Qv3ytNETrlMhlHMr8Aw7Sxba54XCsS0LN6GKhHik,17909
|
|
34
35
|
mcp_server/cli_working.py,sha256=3gWQ6G__ON4tmsJ7MuOhFscs31O_k4j3Q2w4E9So06Y,2841
|
|
35
36
|
mcp_server/crash_logger.py,sha256=qKICLZ7ypHB7EgrKA7UPeH4gU4l38nzUbcx-VFbW9OA,12535
|
|
@@ -46,8 +47,9 @@ mcp_server/migrate.py,sha256=lDOESOXv0VGUGvDYpth7GqpIjzaEVNS2bzlTUEVOtfs,7813
|
|
|
46
47
|
mcp_server/paths.py,sha256=8bmFnBfogyBwu5eRBC58SHbd2CzZS1vqyhvAmYSqdE4,15971
|
|
47
48
|
mcp_server/prompts.py,sha256=ysgMirAMEkiV7AhuAt0QmP_G9AfK_RDBu0FHUz5J-ew,3051
|
|
48
49
|
mcp_server/roadmap_drift.py,sha256=5n6p8htzjlC4wcoG7_7Pdb9-fFJ8vLuHYOYTrBIACro,9066
|
|
49
|
-
mcp_server/server.py,sha256=
|
|
50
|
+
mcp_server/server.py,sha256=G_W4EABNcZbCfpnsi88TG26-2Z7sLUf71OGRBqaa4Ew,97105
|
|
50
51
|
mcp_server/setup_wizard.py,sha256=iu2rkgWuaMIcbIFmUmwr0vHdqYSIs-xslb64mxzobmg,36134
|
|
52
|
+
mcp_server/update_check.py,sha256=xUmbXkbXMJO6ih-8TGMmWaj-9_OwCKax4Kxh0hwQOV4,8061
|
|
51
53
|
mcp_server/data/__init__.py,sha256=gt9uNK2dKtw4v_qI95ywq0ovzZbyrPKwWyeYBtMJ_xY,78
|
|
52
54
|
mcp_server/data/affordances.yaml,sha256=s10qlWgZkhS1a8uWE19ZNtjq40ahLRykAeKCl2IfLic,1344
|
|
53
55
|
mcp_server/data/config.example.yaml,sha256=Okm7QTCjU6YfA36sxzmy8O8bdN-hUkZ9CBWHJ8X9HLw,1428
|
|
@@ -78,7 +80,7 @@ mcp_server/data/rules/persistence.md,sha256=EHmE-FH1Pc_lhcf9hZRTCk3rctyehqUmaRo0
|
|
|
78
80
|
mcp_server/data/rules/resilience-observability.md,sha256=Rur1XG_OozlWMVG9bUJL0AnIujQOPTX1-Cgrrkfla0E,1058
|
|
79
81
|
mcp_server/data/rules/smoke-testing.md,sha256=TpHgxEo29HhVlZfcBF-ku5KxlG4a5GV9cMm8TEFQQlc,2765
|
|
80
82
|
mcp_server/data/rules/testing-standards.md,sha256=IKjvmAZsf2VcNfm5mb1iNdmP14KrgAijQr05MLt_ClY,833
|
|
81
|
-
mcp_server/engine/__init__.py,sha256=
|
|
83
|
+
mcp_server/engine/__init__.py,sha256=RbJFry_KdUu32JNl2o88szfmz8SNSqxhMso4Z_gt-bw,3626
|
|
82
84
|
mcp_server/engine/demo_policy.py,sha256=j6wLs5n3CeN9Wj4GCOCiiagh9TB1K0IBHHYaos9xOQI,2398
|
|
83
85
|
mcp_server/engine/events.py,sha256=mTOQLbUxEVcZjPj0-SpRxz25ZhMEPe2Tg79uYUr6Asw,4992
|
|
84
86
|
mcp_server/engine/memory_fanout.py,sha256=XRx3YU7eM-iqsSTkvA6sbaLTXrU9nKwDtfmP5pxz4pA,9865
|
|
@@ -86,14 +88,15 @@ mcp_server/engine/policy.py,sha256=QTqQvYucW3DS0wQ0VZAbS5IHMGdhE0EVA0X1JapTJPs,5
|
|
|
86
88
|
mcp_server/engine/runner.py,sha256=PNutcmnvAY8gRrpbL_Sp4uaUM_NdmsnmaJ7wKaZD5S4,10527
|
|
87
89
|
mcp_server/engine/signals.py,sha256=tRB-q-GTBTP9VMZFtoeHM6x-vOQl-fE-DkaWUIuGefQ,15243
|
|
88
90
|
mcp_server/engine/token_meter.py,sha256=V7Gs8hv5HDQhqFc7ey_BTic__pFqY2Lb5QR3VFLp7aA,12986
|
|
89
|
-
mcp_server/engine/policies/__init__.py,sha256=
|
|
91
|
+
mcp_server/engine/policies/__init__.py,sha256=W_hT1SYxv2zxGScWTTR0Un35ebj6TUZm6Iddlx84SOE,2080
|
|
90
92
|
mcp_server/engine/policies/_signature_detect.py,sha256=_EAfrS5RJHYj9Sg8EWE7gPK7yBEc9BpV9k1lH6ZtPQE,11517
|
|
91
93
|
mcp_server/engine/policies/anti_regression.py,sha256=ZmY9J6MBpdN1p_voxIwDKf646mdK0taq1avjt59hTAM,7049
|
|
92
|
-
mcp_server/engine/policies/blast_radius.py,sha256=
|
|
93
|
-
mcp_server/engine/policies/decision_lock.py,sha256=
|
|
94
|
+
mcp_server/engine/policies/blast_radius.py,sha256=Rgjp2_nR0w3Ilu17pM8Fzxs9MkKQywAwn5bEwmVSl80,10860
|
|
95
|
+
mcp_server/engine/policies/decision_lock.py,sha256=eM0ZFSa8y4qbPBsbgPSA8FUwRRKQeF1UPH7Biy8EpO4,12473
|
|
94
96
|
mcp_server/engine/policies/post_edit_refresh.py,sha256=uGNzst19k2xlTot0SwmSToAMFLZ8XOuMroB1d1PYP_4,3320
|
|
97
|
+
mcp_server/engine/policies/prompt_capture.py,sha256=si5lQdbjg4I2ZMThyiVWohj9Okc_HdFIjqOKv9yZ1t8,9717
|
|
95
98
|
mcp_server/engine/policies/relevance_inject.py,sha256=OBF2uRUBxAokhFd3e1piUGHLiHwA-7sn8Ma4QAdwUZ0,18529
|
|
96
|
-
mcp_server/engine/policies/session_log_enforcer.py,sha256=
|
|
99
|
+
mcp_server/engine/policies/session_log_enforcer.py,sha256=X5T0PRYwm3EULcV8nikmrppdvqO6bcm5YNvg9-O9zzQ,15326
|
|
97
100
|
mcp_server/engine/policies/token_budget.py,sha256=0SBddbhIyhbYishsxy_ahRP3PGMAkpYSRGTtouBMTi0,3426
|
|
98
101
|
mcp_server/engine/wiring/__init__.py,sha256=dMSx9z1xpp8Z9PmpwjatWoacR5V_HnIJbUosHPqlohA,598
|
|
99
102
|
mcp_server/engine/wiring/claude_code_hooks.py,sha256=MWY0qSUPq-Z6r09Qdi-nKB8w0cZ12NFiOWIguCjLxRw,14939
|
|
@@ -126,17 +129,18 @@ mcp_server/tools/check_conflict.py,sha256=i2MbIa_ih5ps_1my3X23JYX2LkPTQ8bPC3ylFH
|
|
|
126
129
|
mcp_server/tools/code_reader.py,sha256=iLoBC4J2tumivW-6d-gwffU5DoJRJNke4M7OWf7pmUo,10501
|
|
127
130
|
mcp_server/tools/consensus.py,sha256=EGdi36m1LKoV2qL7GUIZ9ETZuMZ9K-G8IYrldSkjVxk,5112
|
|
128
131
|
mcp_server/tools/graph.py,sha256=RoDxRamI3hLrQuZ4Tnf2M0eiLe0sz0vXuxZCGCqEp60,24682
|
|
129
|
-
mcp_server/tools/learning.py,sha256=
|
|
132
|
+
mcp_server/tools/learning.py,sha256=2PU8l_VMNp-O__rNHIdDCL_Mh0jVghFuB5JkfIEK5ZU,33520
|
|
130
133
|
mcp_server/tools/playbook.py,sha256=NnFmE-25-SXoQWeWLOicSnDUfwAf2i8XCzlLNyqnofM,9261
|
|
134
|
+
mcp_server/tools/preferences.py,sha256=vaqi2Vip57bnfXkNymFyQy_BIo5IAweCIhVU25xkMD8,9786
|
|
131
135
|
mcp_server/tools/reflections.py,sha256=woZPRmSgKvjBPCweCuJiU0GE_wFL4togb7PihUzP1hA,9021
|
|
132
136
|
mcp_server/tools/roadmap.py,sha256=P3dwQa-7K5Gyush-Bd7RvzgEwdn5SE8k1GxYzzTB5qs,34961
|
|
133
137
|
mcp_server/tools/search.py,sha256=6qcugN1UJZO9N0HdsPH9BT2b0cCPjaD74qg1eRCES8M,9681
|
|
134
138
|
mcp_server/tools/skills.py,sha256=H6NtYKrWrZD8IksRnASw9LZsWnRxPQ-yI95n7IlIf_o,16687
|
|
135
139
|
mcp_server/tools/spatial.py,sha256=18svw7M8Gf6GDZQ8_znD733MYBqHd-PciwDOiYupJT0,19933
|
|
136
140
|
mcp_server/tools/working.py,sha256=3OfP3woxPGRKcAIX0q5_9mG7JrpkCXtRhklmaz10qM0,13218
|
|
137
|
-
codevira-3.
|
|
138
|
-
codevira-3.
|
|
139
|
-
codevira-3.
|
|
140
|
-
codevira-3.
|
|
141
|
-
codevira-3.
|
|
142
|
-
codevira-3.
|
|
141
|
+
codevira-3.3.0.dist-info/LICENSE,sha256=RT8w5eFsZVXuOet_7BMCoT5V91xaSkPxIjpAgAy2Gpw,1098
|
|
142
|
+
codevira-3.3.0.dist-info/METADATA,sha256=B7lIhAMnsW1Wsfrkmf3Vr8JQhrD-C-_ZiH7oFwaCZ8E,31651
|
|
143
|
+
codevira-3.3.0.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
|
|
144
|
+
codevira-3.3.0.dist-info/entry_points.txt,sha256=VRAnR4NxB73l7GIGSjfYmSOsrvYL4sGPhpi3Xx69gJA,49
|
|
145
|
+
codevira-3.3.0.dist-info/top_level.txt,sha256=8emn9mD-fhXZj48WspJe_R-RWoNBejJbqZcbHlQ12RY,19
|
|
146
|
+
codevira-3.3.0.dist-info/RECORD,,
|
mcp_server/__init__.py
CHANGED
mcp_server/cli.py
CHANGED
|
@@ -726,7 +726,7 @@ def main() -> None:
|
|
|
726
726
|
# serve (P2-1 rc.5: added description)
|
|
727
727
|
serve_parser = subparsers.add_parser(
|
|
728
728
|
"serve",
|
|
729
|
-
help="
|
|
729
|
+
help="Start the MCP HTTP server (single-project; stdio via your IDE's MCP config is the daily mode)",
|
|
730
730
|
description=(
|
|
731
731
|
"Run the codevira MCP server over HTTP/HTTPS instead of stdio. PREVIEW "
|
|
732
732
|
"in v1.7+: the server binds to one project at startup; multi-project "
|
|
@@ -910,7 +910,7 @@ def main() -> None:
|
|
|
910
910
|
# replay (v2.0 hero 8 — Decision Replay)
|
|
911
911
|
replay_parser = subparsers.add_parser(
|
|
912
912
|
"replay",
|
|
913
|
-
help="Browse the decisions timeline (
|
|
913
|
+
help="Browse the decisions timeline (terminal, markdown, or HTML)",
|
|
914
914
|
description=(
|
|
915
915
|
"Browse this project's decision history with outcomes + session "
|
|
916
916
|
"context. Three output formats: terminal (default), markdown, html. "
|
|
@@ -1028,7 +1028,7 @@ def main() -> None:
|
|
|
1028
1028
|
# retains only the non-destructive `--decisions` backfill.
|
|
1029
1029
|
reset_parser = subparsers.add_parser(
|
|
1030
1030
|
"reset",
|
|
1031
|
-
help="DESTRUCTIVE: wipe + rebuild this project's
|
|
1031
|
+
help="DESTRUCTIVE: wipe + rebuild parts of this project's local state (auto-exports decisions first)",
|
|
1032
1032
|
description=(
|
|
1033
1033
|
"Destructive recovery operations. Each flag wipes a specific "
|
|
1034
1034
|
"part of this project's local state and rebuilds it. Decisions, "
|
|
@@ -1043,7 +1043,7 @@ def main() -> None:
|
|
|
1043
1043
|
reset_parser.add_argument(
|
|
1044
1044
|
"--vectors",
|
|
1045
1045
|
action="store_true",
|
|
1046
|
-
help="
|
|
1046
|
+
help="Remove a leftover v2.x vector store directory, if present (v3.x has no vector store)",
|
|
1047
1047
|
)
|
|
1048
1048
|
reset_parser.add_argument(
|
|
1049
1049
|
"--graph",
|
|
@@ -1053,7 +1053,7 @@ def main() -> None:
|
|
|
1053
1053
|
reset_parser.add_argument(
|
|
1054
1054
|
"--all",
|
|
1055
1055
|
action="store_true",
|
|
1056
|
-
help="Wipe ALL of this project's local state (
|
|
1056
|
+
help="Wipe ALL of this project's local state (index, graph cache, sessions)",
|
|
1057
1057
|
)
|
|
1058
1058
|
reset_parser.add_argument(
|
|
1059
1059
|
"--no-backup",
|
|
@@ -1093,8 +1093,12 @@ def main() -> None:
|
|
|
1093
1093
|
"target",
|
|
1094
1094
|
nargs="?",
|
|
1095
1095
|
default="decisions",
|
|
1096
|
-
choices=["decisions", "all"],
|
|
1097
|
-
help=
|
|
1096
|
+
choices=["decisions", "all", "setup"],
|
|
1097
|
+
help=(
|
|
1098
|
+
"What to export (default: decisions). 'setup' bundles "
|
|
1099
|
+
".codevira/ + global learning into one tar.gz for machine "
|
|
1100
|
+
"transfer — restore with `codevira import <archive>`."
|
|
1101
|
+
),
|
|
1098
1102
|
)
|
|
1099
1103
|
export_parser.add_argument(
|
|
1100
1104
|
"--format",
|
|
@@ -1114,6 +1118,30 @@ def main() -> None:
|
|
|
1114
1118
|
help="Show what would be done without writing",
|
|
1115
1119
|
)
|
|
1116
1120
|
|
|
1121
|
+
# v3.3.0 (Phase 6): `codevira import` — restore a setup archive made
|
|
1122
|
+
# by `codevira export setup` on another machine.
|
|
1123
|
+
import_parser = subparsers.add_parser(
|
|
1124
|
+
"import",
|
|
1125
|
+
help="Import a codevira setup archive (machine transfer)",
|
|
1126
|
+
description=(
|
|
1127
|
+
"Restore a tar.gz produced by `codevira export setup`: unpacks "
|
|
1128
|
+
".codevira/ into this project and merges global learning into "
|
|
1129
|
+
"~/.codevira/global.db. Refuses to overwrite an existing "
|
|
1130
|
+
"non-empty .codevira/ unless --force (which backs it up first)."
|
|
1131
|
+
),
|
|
1132
|
+
)
|
|
1133
|
+
import_parser.add_argument("archive", help="Path to the setup .tar.gz")
|
|
1134
|
+
import_parser.add_argument(
|
|
1135
|
+
"--force",
|
|
1136
|
+
action="store_true",
|
|
1137
|
+
help="Overwrite existing .codevira/ (backed up to .codevira.pre-import-<ts>/)",
|
|
1138
|
+
)
|
|
1139
|
+
import_parser.add_argument(
|
|
1140
|
+
"--dry-run",
|
|
1141
|
+
action="store_true",
|
|
1142
|
+
help="Show archive contents and what would happen without writing",
|
|
1143
|
+
)
|
|
1144
|
+
|
|
1117
1145
|
# v3.0.0 (D000016): `codevira graph` — self-contained interactive HTML
|
|
1118
1146
|
# viewer of decision memory (zero deps, offline, queryable).
|
|
1119
1147
|
graph_parser = subparsers.add_parser(
|
|
@@ -1258,10 +1286,10 @@ def main() -> None:
|
|
|
1258
1286
|
# LLM response and writes a proposal (or commits with --apply).
|
|
1259
1287
|
reflect_parser = subparsers.add_parser(
|
|
1260
1288
|
"reflect",
|
|
1261
|
-
help="Build a reflection over recent decisions + sessions "
|
|
1262
|
-
"
|
|
1263
|
-
"
|
|
1264
|
-
"an LLM response via --from-file.",
|
|
1289
|
+
help="Build a reflection over recent decisions + sessions. "
|
|
1290
|
+
"Inside an MCP client with sampling support, the `reflect` "
|
|
1291
|
+
"tool runs the LLM call directly; this CLI renders the "
|
|
1292
|
+
"prompt and accepts an LLM response via --from-file.",
|
|
1265
1293
|
)
|
|
1266
1294
|
reflect_parser.add_argument(
|
|
1267
1295
|
"--period",
|
|
@@ -1292,11 +1320,11 @@ def main() -> None:
|
|
|
1292
1320
|
# MCP surface (consensus_check / consensus_status) is also exposed.
|
|
1293
1321
|
consensus_parser = subparsers.add_parser(
|
|
1294
1322
|
"consensus",
|
|
1295
|
-
help="Cross-IDE consensus operations
|
|
1296
|
-
"
|
|
1297
|
-
"
|
|
1298
|
-
"
|
|
1299
|
-
"
|
|
1323
|
+
help="Cross-IDE consensus operations. `check` materializes "
|
|
1324
|
+
"conflicts between decisions written by this IDE vs other "
|
|
1325
|
+
"IDEs into .codevira/pending_conflicts.jsonl for human "
|
|
1326
|
+
"review. Nothing is resolved automatically; the supersession "
|
|
1327
|
+
"handshake is opt-in via config.",
|
|
1300
1328
|
)
|
|
1301
1329
|
consensus_sub = consensus_parser.add_subparsers(dest="consensus_action")
|
|
1302
1330
|
consensus_sub.add_parser(
|
|
@@ -1309,8 +1337,8 @@ def main() -> None:
|
|
|
1309
1337
|
# surface for skills is record_skill / get_skill / list_skills.
|
|
1310
1338
|
induce_parser = subparsers.add_parser(
|
|
1311
1339
|
"induce-skills",
|
|
1312
|
-
help="Cluster productive sessions and propose
|
|
1313
|
-
"
|
|
1340
|
+
help="Cluster productive sessions and propose reusable skills. "
|
|
1341
|
+
"Without --apply: writes proposals to "
|
|
1314
1342
|
".codevira/induction_proposals.jsonl for human review. With "
|
|
1315
1343
|
"--apply: interactively confirms each proposal (use --yes to "
|
|
1316
1344
|
"skip prompts in CI).",
|
|
@@ -1334,10 +1362,10 @@ def main() -> None:
|
|
|
1334
1362
|
# a human user operating on the per-machine cache outside an IDE.
|
|
1335
1363
|
working_parser = subparsers.add_parser(
|
|
1336
1364
|
"working",
|
|
1337
|
-
help="Operate on
|
|
1338
|
-
"copies a session's live
|
|
1339
|
-
"cache (.codevira-cache/working.jsonl) to the
|
|
1340
|
-
"(.codevira/working_archived
|
|
1365
|
+
help="Operate on the session scratchpad (working memory). "
|
|
1366
|
+
"`commit <session_id>` copies a session's live entries from "
|
|
1367
|
+
"the per-machine cache (.codevira-cache/working.jsonl) to the "
|
|
1368
|
+
"canonical archive (.codevira/working_archived/).",
|
|
1341
1369
|
)
|
|
1342
1370
|
working_sub = working_parser.add_subparsers(dest="working_action")
|
|
1343
1371
|
working_commit_parser = working_sub.add_parser(
|
|
@@ -1398,6 +1426,16 @@ def main() -> None:
|
|
|
1398
1426
|
|
|
1399
1427
|
args = parser.parse_args(raw_args)
|
|
1400
1428
|
|
|
1429
|
+
# v3.3.0: homebrew-style "update available" notice. Cache-read only
|
|
1430
|
+
# on this path (zero network / zero latency); skips serve + engine
|
|
1431
|
+
# (hook hot path). Opt-out: CODEVIRA_NO_UPDATE_CHECK=1.
|
|
1432
|
+
try:
|
|
1433
|
+
from mcp_server.update_check import maybe_notify
|
|
1434
|
+
|
|
1435
|
+
maybe_notify(args.command)
|
|
1436
|
+
except Exception:
|
|
1437
|
+
pass # advisory feature — must never break a CLI invocation
|
|
1438
|
+
|
|
1401
1439
|
# P0-6 (rc.5): self-heal ghost dirs from CLI invocations too. Before this
|
|
1402
1440
|
# rc, only MCP tool dispatch fired the Bug-21a repair. So a CLI-only user
|
|
1403
1441
|
# who got a ghost dir from a stale Claude Code session could never recover
|
|
@@ -1563,6 +1601,16 @@ def main() -> None:
|
|
|
1563
1601
|
)
|
|
1564
1602
|
sys.exit(rc)
|
|
1565
1603
|
elif args.command == "export":
|
|
1604
|
+
if getattr(args, "target", "decisions") == "setup":
|
|
1605
|
+
# v3.3.0 Phase 6: machine-transfer bundle.
|
|
1606
|
+
from mcp_server.cli_transfer import cmd_export_setup
|
|
1607
|
+
|
|
1608
|
+
sys.exit(
|
|
1609
|
+
cmd_export_setup(
|
|
1610
|
+
out=getattr(args, "out", None),
|
|
1611
|
+
dry_run=getattr(args, "dry_run", False),
|
|
1612
|
+
)
|
|
1613
|
+
)
|
|
1566
1614
|
# 2026-05-18 v2.1.2 Item 3e: standalone export command.
|
|
1567
1615
|
from mcp_server.cli_export import cmd_export
|
|
1568
1616
|
|
|
@@ -1573,6 +1621,16 @@ def main() -> None:
|
|
|
1573
1621
|
dry_run=getattr(args, "dry_run", False),
|
|
1574
1622
|
)
|
|
1575
1623
|
sys.exit(rc)
|
|
1624
|
+
elif args.command == "import":
|
|
1625
|
+
from mcp_server.cli_transfer import cmd_import_setup
|
|
1626
|
+
|
|
1627
|
+
sys.exit(
|
|
1628
|
+
cmd_import_setup(
|
|
1629
|
+
args.archive,
|
|
1630
|
+
force=getattr(args, "force", False),
|
|
1631
|
+
dry_run=getattr(args, "dry_run", False),
|
|
1632
|
+
)
|
|
1633
|
+
)
|
|
1576
1634
|
elif args.command == "graph":
|
|
1577
1635
|
# v3.0.0 (D000016): self-contained interactive memory viewer.
|
|
1578
1636
|
from mcp_server.cli_graph import cmd_graph
|
|
@@ -1808,9 +1866,9 @@ def cmd_reset(
|
|
|
1808
1866
|
if not (vectors or graph or reset_all):
|
|
1809
1867
|
print(
|
|
1810
1868
|
"Error: nothing to reset. Pass one of:\n"
|
|
1811
|
-
" --vectors
|
|
1869
|
+
" --vectors remove a leftover v2.x vector store, if present\n"
|
|
1812
1870
|
" --graph wipe graph.db (DESTROYS decisions unless --no-backup is omitted)\n"
|
|
1813
|
-
" --all wipe ALL local state (
|
|
1871
|
+
" --all wipe ALL local state (index + graph cache + sessions)\n"
|
|
1814
1872
|
"\n"
|
|
1815
1873
|
"Add --no-backup to skip auto-export (use with caution).\n"
|
|
1816
1874
|
"Add --dry-run to preview, --yes to skip typed confirmation.",
|
mcp_server/cli_export.py
CHANGED
|
@@ -13,8 +13,12 @@ Two entry points share one implementation:
|
|
|
13
13
|
Format choices:
|
|
14
14
|
- **json** (default): list of decision dicts. Human-readable, jq-friendly.
|
|
15
15
|
Includes decisions + sessions + outcomes + preferences + learned_rules.
|
|
16
|
+
v3.3.0: sourced from the canonical ``.codevira/*.jsonl`` store, with a
|
|
17
|
+
per-table fallback to the legacy graph.db for pre-v3 projects. graph.db
|
|
18
|
+
is no longer required for a JSON export.
|
|
16
19
|
- **sql**: full SQL dump via SQLite's `iterdump()`. Replay against an
|
|
17
20
|
empty graph.db to fully reconstruct (preserves FK relationships).
|
|
21
|
+
Legacy-only: dumps graph.db, NOT the v3.x JSONL store.
|
|
18
22
|
|
|
19
23
|
Per-target tables exported:
|
|
20
24
|
- `decisions` → always
|
|
@@ -135,38 +139,79 @@ def export_decisions_to_path(
|
|
|
135
139
|
if target not in ("decisions", "all"):
|
|
136
140
|
raise ValueError(f"target must be 'decisions' or 'all', got {target!r}")
|
|
137
141
|
|
|
138
|
-
|
|
142
|
+
# v3.3.0: the canonical store is .codevira/*.jsonl; graph.db is a
|
|
143
|
+
# derived index. JSON exports prefer JSONL per-table and only fall
|
|
144
|
+
# back to graph.db (legacy pre-v3 projects, or tables with no JSONL
|
|
145
|
+
# equivalent like `phases`). SQL format remains a graph.db dump, and
|
|
146
|
+
# graph-tier tables (target=all) only exist in graph.db — so graph.db
|
|
147
|
+
# is required for those paths, optional for plain JSON exports.
|
|
148
|
+
from mcp_server.storage import paths as storage_paths
|
|
149
|
+
from mcp_server.storage.jsonl_store import read_all as _jsonl_read_all
|
|
150
|
+
|
|
151
|
+
jsonl_sources: dict[str, Path] = {
|
|
152
|
+
"decisions": storage_paths.decisions_path(),
|
|
153
|
+
"sessions": storage_paths.sessions_path(),
|
|
154
|
+
"outcomes": storage_paths.outcomes_path(),
|
|
155
|
+
"preferences": storage_paths.preferences_path(),
|
|
156
|
+
"learned_rules": storage_paths.learned_rules_path(),
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
graph_db_path: Path | None
|
|
160
|
+
try:
|
|
161
|
+
graph_db_path = _resolve_graph_db_path()
|
|
162
|
+
except FileNotFoundError:
|
|
163
|
+
if format == "sql" or target == "all":
|
|
164
|
+
raise
|
|
165
|
+
graph_db_path = None # JSON + decisions tier: JSONL alone is fine.
|
|
166
|
+
|
|
139
167
|
out_path = Path(out_path)
|
|
140
168
|
out_path.parent.mkdir(parents=True, exist_ok=True)
|
|
141
169
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
170
|
+
conn: sqlite3.Connection | None = None
|
|
171
|
+
if graph_db_path is not None:
|
|
172
|
+
# Open in read-only mode so a concurrent indexer write can't be
|
|
173
|
+
# blocked. SQLite URI form is required for read-only.
|
|
174
|
+
uri = f"file:{graph_db_path}?mode=ro"
|
|
175
|
+
conn = sqlite3.connect(uri, uri=True)
|
|
176
|
+
conn.row_factory = sqlite3.Row
|
|
147
177
|
|
|
148
178
|
tables_to_dump = _DECISION_TABLES if target == "decisions" else _FULL_STATE_TABLES
|
|
149
179
|
summary: dict[str, Any] = {
|
|
150
180
|
"exported_at": datetime.now(timezone.utc).isoformat(),
|
|
151
|
-
"source_db": str(graph_db_path),
|
|
181
|
+
"source_db": str(graph_db_path) if graph_db_path else None,
|
|
182
|
+
"source_jsonl_dir": str(storage_paths.codevira_dir()),
|
|
152
183
|
"format": format,
|
|
153
184
|
"target": target,
|
|
154
185
|
"tables": {},
|
|
186
|
+
"table_sources": {},
|
|
155
187
|
}
|
|
156
188
|
|
|
157
189
|
try:
|
|
158
190
|
if format == "json":
|
|
159
191
|
payload = {
|
|
160
|
-
"schema_version":
|
|
192
|
+
"schema_version": 2,
|
|
161
193
|
"exported_at": summary["exported_at"],
|
|
162
|
-
"source_db":
|
|
194
|
+
"source_db": summary["source_db"],
|
|
195
|
+
"source_jsonl_dir": summary["source_jsonl_dir"],
|
|
163
196
|
"target": target,
|
|
164
197
|
"tables": {},
|
|
198
|
+
"table_sources": {},
|
|
165
199
|
}
|
|
166
200
|
for table in tables_to_dump:
|
|
167
|
-
|
|
201
|
+
jsonl_path = jsonl_sources.get(table)
|
|
202
|
+
if jsonl_path is not None and jsonl_path.is_file():
|
|
203
|
+
rows = _jsonl_read_all(jsonl_path)
|
|
204
|
+
source = "jsonl"
|
|
205
|
+
elif conn is not None:
|
|
206
|
+
rows = _dump_table_as_json(conn, table)
|
|
207
|
+
source = "sqlite-legacy"
|
|
208
|
+
else:
|
|
209
|
+
rows = []
|
|
210
|
+
source = "missing"
|
|
168
211
|
payload["tables"][table] = rows
|
|
212
|
+
payload["table_sources"][table] = source
|
|
169
213
|
summary["tables"][table] = len(rows)
|
|
214
|
+
summary["table_sources"][table] = source
|
|
170
215
|
# v3.0.0 round-3: shared atomic-write helper (was a fixed
|
|
171
216
|
# ``.tmp`` suffix — same race shape as the manifest bug).
|
|
172
217
|
from mcp_server.storage.atomic import atomic_write_text
|
|
@@ -177,6 +222,7 @@ def export_decisions_to_path(
|
|
|
177
222
|
)
|
|
178
223
|
|
|
179
224
|
elif format == "sql":
|
|
225
|
+
assert conn is not None # sql format re-raised on missing graph.db
|
|
180
226
|
# SQL dump preserves schema + FK relationships. iterdump
|
|
181
227
|
# yields every CREATE / INSERT in one stream — we stream
|
|
182
228
|
# to a unique tmp file (mkstemp) and rename into place so
|
|
@@ -236,7 +282,8 @@ def export_decisions_to_path(
|
|
|
236
282
|
except Exception:
|
|
237
283
|
summary["tables"][table] = 0
|
|
238
284
|
finally:
|
|
239
|
-
conn
|
|
285
|
+
if conn is not None:
|
|
286
|
+
conn.close()
|
|
240
287
|
|
|
241
288
|
try:
|
|
242
289
|
summary["bytes"] = out_path.stat().st_size
|
|
@@ -304,17 +351,34 @@ def cmd_export(
|
|
|
304
351
|
)
|
|
305
352
|
return 1
|
|
306
353
|
|
|
354
|
+
# v3.3.0: graph.db is only mandatory for sql format / target=all
|
|
355
|
+
# (graph-tier tables live nowhere else). JSON decision exports read
|
|
356
|
+
# the canonical .codevira/*.jsonl store and need neither.
|
|
357
|
+
graph_db_path: Path | None
|
|
307
358
|
try:
|
|
308
359
|
graph_db_path = _resolve_graph_db_path()
|
|
309
360
|
except FileNotFoundError as e:
|
|
310
|
-
|
|
311
|
-
|
|
361
|
+
if fmt == "sql" or target == "all":
|
|
362
|
+
print(f"Error: {e}", file=sys.stderr)
|
|
363
|
+
return 1
|
|
364
|
+
graph_db_path = None
|
|
312
365
|
except ValueError as e:
|
|
313
366
|
# v3.0 hardening: get_data_dir refuses invalid project roots
|
|
314
367
|
# ($HOME, system top-levels). Run from a real project directory.
|
|
315
368
|
print(f"Error: {e}", file=sys.stderr)
|
|
316
369
|
return 1
|
|
317
370
|
|
|
371
|
+
if graph_db_path is None:
|
|
372
|
+
from mcp_server.storage.paths import codevira_dir
|
|
373
|
+
|
|
374
|
+
if not codevira_dir().is_dir():
|
|
375
|
+
print(
|
|
376
|
+
"Error: nothing to export — no .codevira/ store and no "
|
|
377
|
+
"graph.db. Run `codevira init` first.",
|
|
378
|
+
file=sys.stderr,
|
|
379
|
+
)
|
|
380
|
+
return 2
|
|
381
|
+
|
|
318
382
|
if out is None:
|
|
319
383
|
from mcp_server.paths import get_data_dir
|
|
320
384
|
|
|
@@ -325,8 +389,11 @@ def cmd_export(
|
|
|
325
389
|
out_path = Path(out).expanduser().resolve()
|
|
326
390
|
|
|
327
391
|
if dry_run:
|
|
392
|
+
from mcp_server.storage.paths import codevira_dir
|
|
393
|
+
|
|
328
394
|
print(f" [dry-run] Would export {target} as {fmt} → {out_path}")
|
|
329
|
-
print(f" Source: {
|
|
395
|
+
print(f" Source: {codevira_dir()} (canonical JSONL)")
|
|
396
|
+
print(f" Legacy fallback: {graph_db_path or 'none (no graph.db)'}")
|
|
330
397
|
return 0
|
|
331
398
|
|
|
332
399
|
try:
|
|
@@ -340,5 +407,7 @@ def cmd_export(
|
|
|
340
407
|
print(f" Size: {summary['bytes']:,} bytes")
|
|
341
408
|
print(" Tables:")
|
|
342
409
|
for name, count in summary["tables"].items():
|
|
343
|
-
|
|
410
|
+
source = summary.get("table_sources", {}).get(name, "")
|
|
411
|
+
suffix = f" ({source})" if source else ""
|
|
412
|
+
print(f" {name:<16} {count:>6} rows{suffix}")
|
|
344
413
|
return 0
|