stata-code 0.3.0__tar.gz → 0.4.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.
Files changed (46) hide show
  1. {stata_code-0.3.0 → stata_code-0.4.0}/.gitignore +1 -0
  2. {stata_code-0.3.0 → stata_code-0.4.0}/CHANGELOG.md +88 -1
  3. stata_code-0.4.0/PKG-INFO +719 -0
  4. stata_code-0.4.0/README.md +681 -0
  5. {stata_code-0.3.0 → stata_code-0.4.0}/SCHEMA.md +40 -0
  6. {stata_code-0.3.0 → stata_code-0.4.0}/pyproject.toml +1 -1
  7. {stata_code-0.3.0 → stata_code-0.4.0}/schema/run_result.schema.json +126 -0
  8. {stata_code-0.3.0 → stata_code-0.4.0}/stata_code/__init__.py +3 -1
  9. {stata_code-0.3.0 → stata_code-0.4.0}/stata_code/core/__init__.py +2 -0
  10. stata_code-0.4.0/stata_code/core/log_artifacts.py +431 -0
  11. {stata_code-0.3.0 → stata_code-0.4.0}/stata_code/core/runner.py +145 -4
  12. {stata_code-0.3.0 → stata_code-0.4.0}/stata_code/core/schema.py +19 -0
  13. {stata_code-0.3.0 → stata_code-0.4.0}/stata_code/mcp/server.py +57 -1
  14. stata_code-0.4.0/tests/test_log_artifacts.py +154 -0
  15. {stata_code-0.3.0 → stata_code-0.4.0}/tests/test_mcp.py +5 -0
  16. stata_code-0.3.0/PKG-INFO +0 -389
  17. stata_code-0.3.0/README.md +0 -351
  18. {stata_code-0.3.0 → stata_code-0.4.0}/LICENSE +0 -0
  19. {stata_code-0.3.0 → stata_code-0.4.0}/LICENSE-POLICY.md +0 -0
  20. {stata_code-0.3.0 → stata_code-0.4.0}/PUBLISHING.md +0 -0
  21. {stata_code-0.3.0 → stata_code-0.4.0}/docs/design/hard_timeout.md +0 -0
  22. {stata_code-0.3.0 → stata_code-0.4.0}/examples/01-basic-regression.md +0 -0
  23. {stata_code-0.3.0 → stata_code-0.4.0}/examples/02-did-card-krueger.md +0 -0
  24. {stata_code-0.3.0 → stata_code-0.4.0}/examples/03-graphs.md +0 -0
  25. {stata_code-0.3.0 → stata_code-0.4.0}/examples/04-multi-session.md +0 -0
  26. {stata_code-0.3.0 → stata_code-0.4.0}/examples/05-large-matrix.md +0 -0
  27. {stata_code-0.3.0 → stata_code-0.4.0}/examples/README.md +0 -0
  28. {stata_code-0.3.0 → stata_code-0.4.0}/scripts/export_schema.py +0 -0
  29. {stata_code-0.3.0 → stata_code-0.4.0}/stata_code/core/_pool.py +0 -0
  30. {stata_code-0.3.0 → stata_code-0.4.0}/stata_code/core/_refs.py +0 -0
  31. {stata_code-0.3.0 → stata_code-0.4.0}/stata_code/core/_runtime.py +0 -0
  32. {stata_code-0.3.0 → stata_code-0.4.0}/stata_code/core/errors.py +0 -0
  33. {stata_code-0.3.0 → stata_code-0.4.0}/stata_code/kernel/__init__.py +0 -0
  34. {stata_code-0.3.0 → stata_code-0.4.0}/stata_code/kernel/__main__.py +0 -0
  35. {stata_code-0.3.0 → stata_code-0.4.0}/stata_code/kernel/kernel.py +0 -0
  36. {stata_code-0.3.0 → stata_code-0.4.0}/stata_code/mcp/__init__.py +0 -0
  37. {stata_code-0.3.0 → stata_code-0.4.0}/stata_code/mcp/__main__.py +0 -0
  38. {stata_code-0.3.0 → stata_code-0.4.0}/tests/__init__.py +0 -0
  39. {stata_code-0.3.0 → stata_code-0.4.0}/tests/fixtures/.gitkeep +0 -0
  40. {stata_code-0.3.0 → stata_code-0.4.0}/tests/test_cancel.py +0 -0
  41. {stata_code-0.3.0 → stata_code-0.4.0}/tests/test_errors.py +0 -0
  42. {stata_code-0.3.0 → stata_code-0.4.0}/tests/test_kernel.py +0 -0
  43. {stata_code-0.3.0 → stata_code-0.4.0}/tests/test_pool.py +0 -0
  44. {stata_code-0.3.0 → stata_code-0.4.0}/tests/test_runner.py +0 -0
  45. {stata_code-0.3.0 → stata_code-0.4.0}/tests/test_schema.py +0 -0
  46. {stata_code-0.3.0 → stata_code-0.4.0}/tests/test_schema_artifact.py +0 -0
@@ -218,6 +218,7 @@ __marimo__/
218
218
  .streamlit/secrets.toml
219
219
 
220
220
  # Stata-specific
221
+ log-files/
221
222
  *.gph
222
223
  *.smcl
223
224
  *.dta
@@ -4,7 +4,94 @@ All notable changes to `stata-code` are documented here. The format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); the project adheres
5
5
  to semver-major.minor for the result schema (see `SCHEMA.md` §6).
6
6
 
7
- ## [Unreleased]
7
+ ## [0.4.0] — 2026-05-07
8
+
9
+ ### Added
10
+
11
+ - **Persistent per-run log bundles.** When a `.do` file path is supplied as
12
+ `origin_path`, the runner writes an immutable `log-files/<run>/` directory
13
+ next to the source file containing:
14
+ - `<run>.log` and `<run>.smcl` — Stata's textual and SMCL logs
15
+ - `manifest.json` — run metadata (elapsed_ms, rc, session, Stata edition)
16
+ - `submitted.do` — a snapshot of the code that was executed
17
+ - `graphs/` — captured graph files materialized from graph refs
18
+ - `outputs/` — newly created or modified table/export files copied from
19
+ the run's working directory
20
+
21
+ The directory name encodes UTC timestamp, session, and request IDs so
22
+ parallel runs and reruns are never ambiguous.
23
+
24
+ - **Working-directory defaults from `origin_path`.** Before running,
25
+ Stata `cd`s to the `.do` file's parent so relative `graph export`,
26
+ `putexcel`, `esttab using`, `collect export`, etc. output next to the
27
+ source. Toggle with `use_origin_workdir` / `useDoFileDirectory` setting.
28
+ Explicit `working_dir` overrides this.
29
+
30
+ - **Schema extensions.** `LogInfo.files` (`LogFileInfo`) carries the
31
+ bundle paths and derived `graphs_dir`/`outputs_dir`; `GraphInfo.file_path`
32
+ records where a graph was materialized; two new capabilities
33
+ `log_files` and `run_artifacts` signal support.
34
+
35
+ - **MCP tool options.** `stata_run` gains `persist_log_files`,
36
+ `persist_generated_files`, `origin_path`, `origin_kind`,
37
+ `origin_label`, `use_origin_workdir`, `working_dir`.
38
+
39
+ - **VS Code settings.** Three new configuration options:
40
+ `stataCode.persistLogFiles` (default `true`),
41
+ `stataCode.persistGeneratedFiles` (default `true`),
42
+ `stataCode.useDoFileDirectory` (default `true`).
43
+
44
+ - **VS Code tree views.** The Last Result tree now shows "saved" and
45
+ "N outputs" badges on the log node when artifacts are present; the
46
+ output log header prints `working_dir:`, `log_file:`, `smcl_file:`,
47
+ `graphs_dir:`, `outputs_dir:` for each run.
48
+
49
+ ### Changed
50
+
51
+ - **VSCode MCP startup.** The extension now expands common macOS Python
52
+ script directories before spawning `stata-code-mcp`, tries workspace
53
+ `.venv` and `python -m stata_code.mcp` fallbacks for the default command,
54
+ and writes child-process stderr to the `stata-code` output channel so
55
+ missing PATH / missing dependency failures are actionable.
56
+ - **VSCode toolbar ordering.** Run-all and run-selection now share the same
57
+ ordinary `editor/title` toolbar sequence, with ordering moved later in the
58
+ `navigation` group to reduce interleaving from other extensions.
59
+
60
+ ## [0.3.2] — 2026-05-08
61
+
62
+ ### Changed
63
+
64
+ - **VSCode toolbar ordering.** Editor title-bar actions now live in one
65
+ contiguous `navigation` group so `stata-code` buttons stay together. The
66
+ order prioritizes run commands first, then data/output views, session
67
+ controls, cancellation/reset, and working-directory actions.
68
+
69
+ ## [0.3.1] — 2026-05-07
70
+
71
+ ### Changed
72
+
73
+ - **VSCode extension polish.** Custom SVG toolbar icons (sessions / output /
74
+ graphs / data / run / stop / reset / new-tab / switch-tab) replace the
75
+ generic codicons; toolbar buttons render in the editor title bar with
76
+ consistent visual weight. Adds `View Data Preview` command surfaced from
77
+ the command palette and the editor right-click menu for opening the
78
+ current `Last Result` dataset preview without re-running.
79
+ - **Run history retains origin URI and base line** so reruns from the
80
+ Sessions / Last Result views replay the correct file/selection rather
81
+ than re-resolving against whatever editor happens to be focused.
82
+ - **Marketplace publishing pipeline** (`.github/workflows/vscode-release.yml`).
83
+ Tagging `v*` now packages `vscode/` into a VSIX and publishes via `vsce`
84
+ using a stored `VSCE_PAT`. `vscode/.vscodeignore` tightened to exclude
85
+ `.git/`, stale `.vsix` artifacts, and `.npmignore`. `vscode/LICENSE`
86
+ vendored from the repo root so the VSIX ships its declared MIT license.
87
+ - **README docs.** English-first / Chinese-second bilingual layout, with
88
+ expanded Claude Code MCP install instructions (`claude mcp add` patterns)
89
+ and VS Code Marketplace install steps now that the extension is live.
90
+
91
+ ### Fixed
92
+
93
+ - **mcpClient handshake** version string aligned with `package.json` so
94
+ the VSCode client and MCP server announce matching versions.
8
95
 
9
96
  ## [0.3.0] — 2026-05-07
10
97