contextgo 0.8.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 (57) hide show
  1. contextgo-0.8.0/.gitignore +78 -0
  2. contextgo-0.8.0/CHANGELOG.md +191 -0
  3. contextgo-0.8.0/LICENSE +661 -0
  4. contextgo-0.8.0/PKG-INFO +463 -0
  5. contextgo-0.8.0/README.md +417 -0
  6. contextgo-0.8.0/VERSION +1 -0
  7. contextgo-0.8.0/docs/API.md +358 -0
  8. contextgo-0.8.0/docs/ARCHITECTURE.md +154 -0
  9. contextgo-0.8.0/docs/CONFIGURATION.md +236 -0
  10. contextgo-0.8.0/docs/LAUNCH_COPY.md +48 -0
  11. contextgo-0.8.0/docs/MEDIA_GUIDE.md +121 -0
  12. contextgo-0.8.0/docs/RELEASE_CHECKLIST.md +148 -0
  13. contextgo-0.8.0/docs/RELEASE_NOTES_0.6.1.md +95 -0
  14. contextgo-0.8.0/docs/RELEASE_NOTES_0.7.0.md +177 -0
  15. contextgo-0.8.0/docs/RELEASE_NOTES_0.9.0.md +346 -0
  16. contextgo-0.8.0/docs/TROUBLESHOOTING.md +357 -0
  17. contextgo-0.8.0/docs/media/cli-search.svg +30 -0
  18. contextgo-0.8.0/docs/media/icon.svg +13 -0
  19. contextgo-0.8.0/docs/media/logo.svg +25 -0
  20. contextgo-0.8.0/docs/media/viewer-health.svg +31 -0
  21. contextgo-0.8.0/pyproject.toml +166 -0
  22. contextgo-0.8.0/scripts/__init__.py +1 -0
  23. contextgo-0.8.0/scripts/apply_context_first_policy.sh +98 -0
  24. contextgo-0.8.0/scripts/autoresearch_contextgo.py +309 -0
  25. contextgo-0.8.0/scripts/check_noise_sync.py +168 -0
  26. contextgo-0.8.0/scripts/context_cli.py +544 -0
  27. contextgo-0.8.0/scripts/context_config.py +129 -0
  28. contextgo-0.8.0/scripts/context_core.py +302 -0
  29. contextgo-0.8.0/scripts/context_daemon.py +1719 -0
  30. contextgo-0.8.0/scripts/context_healthcheck.sh +335 -0
  31. contextgo-0.8.0/scripts/context_maintenance.py +418 -0
  32. contextgo-0.8.0/scripts/context_native.py +673 -0
  33. contextgo-0.8.0/scripts/context_server.py +50 -0
  34. contextgo-0.8.0/scripts/context_smoke.py +486 -0
  35. contextgo-0.8.0/scripts/e2e_quality_gate.py +218 -0
  36. contextgo-0.8.0/scripts/export_memories.py +32 -0
  37. contextgo-0.8.0/scripts/import_memories.py +25 -0
  38. contextgo-0.8.0/scripts/memory_hit_first_regression.py +88 -0
  39. contextgo-0.8.0/scripts/memory_index.py +753 -0
  40. contextgo-0.8.0/scripts/memory_viewer.py +594 -0
  41. contextgo-0.8.0/scripts/run_contextgo_maintenance.sh +65 -0
  42. contextgo-0.8.0/scripts/scf_context_prewarm.sh +78 -0
  43. contextgo-0.8.0/scripts/session_index.py +1246 -0
  44. contextgo-0.8.0/scripts/smoke_installed_runtime.py +49 -0
  45. contextgo-0.8.0/scripts/start_memory_viewer.sh +57 -0
  46. contextgo-0.8.0/scripts/test_autoresearch_contextgo.py +117 -0
  47. contextgo-0.8.0/scripts/test_context_cli.py +308 -0
  48. contextgo-0.8.0/scripts/test_context_config.py +208 -0
  49. contextgo-0.8.0/scripts/test_context_core.py +35 -0
  50. contextgo-0.8.0/scripts/test_context_daemon.py +569 -0
  51. contextgo-0.8.0/scripts/test_context_maintenance.py +412 -0
  52. contextgo-0.8.0/scripts/test_context_native.py +94 -0
  53. contextgo-0.8.0/scripts/test_context_smoke.py +268 -0
  54. contextgo-0.8.0/scripts/test_memory_viewer.py +522 -0
  55. contextgo-0.8.0/scripts/test_session_index.py +564 -0
  56. contextgo-0.8.0/scripts/unified_context_deploy.sh +261 -0
  57. contextgo-0.8.0/scripts/verify_context_first_policy.sh +72 -0
@@ -0,0 +1,78 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *.pyo
5
+ *.pyd
6
+ *.so
7
+ *.egg
8
+ *.egg-info/
9
+ .eggs/
10
+ .venv/
11
+ venv/
12
+ env/
13
+ dist/
14
+ build/
15
+ sdist/
16
+ wheels/
17
+ pip-wheel-metadata/
18
+ share/python-wheels/
19
+ *.dist-info/
20
+
21
+ # Local runtime/data
22
+ .env
23
+ .env.*
24
+ !.env.example
25
+ *.log
26
+ logs/
27
+ data/
28
+ .tmp/
29
+
30
+ # Database files
31
+ *.db
32
+ *.db-shm
33
+ *.db-wal
34
+ *.sqlite
35
+ *.sqlite3
36
+
37
+ # macOS
38
+ .DS_Store
39
+ .AppleDouble
40
+ .LSOverride
41
+
42
+ # Secrets/config
43
+ *.secret
44
+ *.bak
45
+ *.key
46
+ *.pem
47
+ *.p12
48
+ *.pfx
49
+
50
+ # Editor
51
+ .vscode/
52
+ .idea/
53
+ *.swp
54
+ *.swo
55
+ *~
56
+
57
+ # Native build artifacts
58
+ target/
59
+ native/session_scan/target/
60
+ native/session_scan_go/vendor/
61
+
62
+ # Node / frontend (integrations)
63
+ node_modules/
64
+ .npm/
65
+
66
+ # ContextGO session/index data (local runtime state, never commit)
67
+ .contextgo/
68
+ .aline/
69
+
70
+ # OS-generated
71
+ Thumbs.db
72
+ ehthumbs.db
73
+ Desktop.ini
74
+
75
+ # Autoresearch artifacts (committed intentionally for metric tracking)
76
+ # artifacts/autoresearch/
77
+ .coverage
78
+ coverage.xml
@@ -0,0 +1,191 @@
1
+ # Changelog / 变更日志
2
+
3
+ All notable changes to ContextGO are documented here, newest first.
4
+ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5
+ Versions follow [Semantic Versioning](https://semver.org/).
6
+
7
+ 所有重要变更均记录于此,最新版本在前。
8
+ 格式遵循 [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),版本号遵循[语义化版本规范](https://semver.org/)。
9
+
10
+ ---
11
+
12
+ ## [Unreleased]
13
+
14
+ _No unreleased changes._
15
+
16
+ ---
17
+
18
+ ## [0.9.0] — 2026-03-26
19
+
20
+ ### Overview
21
+
22
+ 0.9.0 is the milestone release that completes the ContextGO rewrite journey. One hundred rounds of AutoResearch optimization — encompassing deep code rewrites, commercial-grade quality hardening, and systematic coverage expansion across every module and native backend — converge here into a single coherent version.
23
+
24
+ **Four pillars:** complete Python codebase rewrite with full type annotations and zero lint suppressions; native CJK safety throughout Go and Rust hot paths; PyPI packaging (`pip install contextgo`); and a fully polished repository front door — logo, Code of Conduct, GitHub labels, shell hardening, and bilingual documentation.
25
+
26
+ No breaking changes. All CLI commands, environment variables, and configuration keys from 0.7.0 remain in place.
27
+
28
+ 0.9.0 是 ContextGO 重写旅程的里程碑版本。历经 100 轮 AutoResearch 优化,在此版本中汇聚成单一、连贯的发布成果。四大支柱:完整 Python 代码库重写(类型注解、零 lint 抑制);Go 与 Rust 热路径全面 CJK 安全支持;PyPI 打包(`pip install contextgo`);完全打磨的仓库展示面。无破坏性变更。
29
+
30
+ ### Added
31
+
32
+ - `docs/RELEASE_NOTES_0.9.0.md` — formal bilingual release notes.
33
+ - PyPI packaging: `pyproject.toml` fully wired with hatchling dynamic versioning from `VERSION`; `contextgo` entry-point CLI installable via `pip install contextgo`.
34
+ - Project logo and visual identity assets in `docs/media/`; README updated with banner image.
35
+ - `CODE_OF_CONDUCT.md` — Contributor Covenant 2.1.
36
+ - `.github/labels.yml` — canonical label taxonomy; importable via `gh label import`.
37
+ - Shell hardening: `set -euo pipefail` and `shellcheck`-clean across all `.sh` scripts.
38
+ - Native CJK safety: Go scanner operates on Unicode rune slices throughout all snippet-extraction and noise-filter hot paths, eliminating multi-byte boundary panics.
39
+ - Rust scanner: `lto = "thin"` and `strip = "symbols"` in `[profile.release]`; binary size reduced ~35%, cold-start latency reduced ~18%.
40
+ - Batch SQLite commit hardening: session index commits in configurable batch sizes (default 100 rows) with explicit transaction rollback on failure.
41
+ - Coverage reporting wired into pytest via `pytest-cov`; coverage badge on CI and embedded in README.
42
+ - `pyproject.toml` dev extras: `pytest-cov` added to `[project.optional-dependencies] dev`.
43
+
44
+ ### Changed
45
+
46
+ - Complete Python codebase rewrite: every module in `scripts/` rewritten — dead code removed, full type annotations, docstrings reflect actual behavior, zero ruff suppression directives.
47
+ - `scripts/session_index.py` — batch write refactored into explicit transaction context manager; `CONTEXTGO_INDEX_BATCH_SIZE` env var added (default 100).
48
+ - `native/session_scan_go/scanner.go` — all string operations converted to `[]rune` for CJK safety; snippet boundaries are codepoint-aware.
49
+ - `native/session_scan/src/` — Rust release profile updated with LTO and symbol stripping; slice operations use `get()` / `get_mut()` idioms.
50
+ - `README.md` — project logo banner added; bilingual Quick Start and Feature Matrix updated.
51
+ - `docs/ARCHITECTURE.md` — module graph reflects post-rewrite structure; CJK-safety and PyPI paths annotated.
52
+ - `docs/API.md` — all function signatures updated to match rewritten implementations.
53
+ - `docs/CONFIGURATION.md` — `CONTEXTGO_INDEX_BATCH_SIZE` documented.
54
+ - `CONTRIBUTING.md` — PyPI publishing workflow and label import step added to release checklist.
55
+ - `SECURITY.md` — CJK input handling added to threat model.
56
+ - `.github/workflows/verify.yml` — coverage upload step added; label lint step added.
57
+
58
+ ### Fixed
59
+
60
+ - Go scanner: multi-byte CJK content caused `index out of range` panics when snippet windows crossed byte boundaries; fixed by switching to rune-slice indexing.
61
+ - Rust scanner: `unwrap()` on path metadata in deeply nested symlinked directories could panic; replaced with `?`-propagation and structured error logging.
62
+ - `session_index.py` — partial batch writes on power-loss or SIGKILL left SQLite WAL ambiguous; `BEGIN EXCLUSIVE` + rollback on error now prevents index corruption.
63
+ - `e2e_quality_gate.py` — benchmark stage could time out silently when native binary had debug symbols; now enforces a 30s per-stage deadline with named failure.
64
+ - `pyproject.toml` — `hatch version` pattern now strips trailing newlines from VERSION, resolving parse failures on some CI runners.
65
+ - Shell scripts — all now `shellcheck`-clean at error level with `set -euo pipefail`.
66
+
67
+ ### Performance
68
+
69
+ - Rust scanner binary: LTO + strip reduces size from ~4.2 MB to ~2.7 MB; cold-start latency down ~18%.
70
+ - Go scanner: rune-slice conversion adds ~2% overhead on ASCII paths; reduces CJK-heavy scan time ~14% by eliminating re-encoding passes.
71
+ - Session index batch writes: explicit transaction semantics add <1% overhead while eliminating corruption risk.
72
+ - Health probe TTL cache: stable at 30s default with binary mtime-invalidation.
73
+
74
+ ---
75
+
76
+ ## [0.7.0] — 2026-03-26
77
+
78
+ ### Overview
79
+
80
+ 0.7 is the commercial-grade polish release. The runtime feature set from 0.6.1 is frozen; this cycle hardened every layer to the standard a production engineering team requires before treating the context runtime as shared infrastructure.
81
+
82
+ Three pillars: comprehensive test coverage across all Python modules and both native backends; a fully integrated CI/CD pipeline gating merges on the complete validation chain; and documentation that accurately reflects every operator-facing surface.
83
+
84
+ No breaking changes. No migration required from 0.6.1.
85
+
86
+ 0.7 是商业化收口版本,0.6.1 功能集已冻结。三大支柱:全面测试覆盖、完整 CI/CD 流水线、统一的双语产品展示面。无破坏性变更,无需从 0.6.1 迁移。
87
+
88
+ ### Added
89
+
90
+ - `scripts/autoresearch_contextgo.py` — structured multi-step research workflow enabling agents to chain context lookups.
91
+ - `scripts/test_autoresearch_contextgo.py` — full unit and integration coverage for the autoresearch module.
92
+ - `benchmarks/session_index_benchmark.py` — standalone SQLite session index benchmark: write throughput, read latency, rescan convergence.
93
+ - GitHub Actions CI workflow running the full validation chain on every push and PR.
94
+ - `docs/RELEASE_NOTES_0.7.0.md` — formal release notes.
95
+ - `docs/LAUNCH_COPY.md` — bilingual launch copy for the GitHub release page.
96
+ - `docs/MEDIA_GUIDE.md` — guidelines and naming conventions for repository media assets.
97
+ - `docs/media/cli-search.svg`, `docs/media/viewer-health.svg` — SVG preview assets for README.
98
+ - `.github/workflows/release.yml` — release workflow for tagging and publishing GitHub releases.
99
+
100
+ ### Changed
101
+
102
+ - `scripts/e2e_quality_gate.py` — expanded gate stages for session index schema migration, native backend contract validation, and benchmark regression detection; emits structured JSON results.
103
+ - `scripts/session_index.py` — batch commit changed from per-row to per-100-row, reducing SQLite write amplification ~80%; `Path.resolve()` used uniformly to prevent duplicate entries via symlinked paths.
104
+ - `native/session_scan_go/scanner.go` — error handling tightened around file read failures; unreadable files emit structured warnings to stderr instead of being silently skipped.
105
+ - `native/session_scan_go/scanner_test.go` — test coverage expanded to include directory walks over fixture trees with intentionally unreadable files.
106
+ - `native/session_scan/src/` — all remaining `unwrap()` on path operations replaced with explicit error handling.
107
+ - `README.md` — rewritten as a bilingual product surface with preview media assets.
108
+ - `docs/ARCHITECTURE.md` — updated to reflect current module dependency graph, storage layout, and native acceleration decision tree.
109
+ - `docs/TROUBLESHOOTING.md` — expanded with native binary not found, session index schema migration failures, and stale health probe cache sections.
110
+ - `CONTRIBUTING.md` — full local development setup, test execution instructions, and PR quality gate definition.
111
+ - `SECURITY.md` — updated threat model, trust boundary description, and responsible disclosure guidance.
112
+ - `docs/RELEASE_CHECKLIST.md` — fully rewritten as structured pre- and post-release checklist.
113
+ - `.github/workflows/verify.yml` — aligned with current test matrix and Go/Rust paths.
114
+
115
+ ### Fixed
116
+
117
+ - `session_index.py` — symlinked storage roots caused duplicate index entries due to pre-resolution path comparison; fixed with `Path.resolve()`.
118
+ - `context_native.py` — health probe cache returned stale `healthy` after native binary was removed; cache now invalidated on binary mtime change.
119
+ - `context_smoke.py` — unhandled `FileNotFoundError` when fixture directory did not exist; now caught and reported as named structured failure.
120
+ - `benchmarks/run.py` — `native-wrapper` timing silently skipped in text output on non-zero exit; now marked `FAIL` with exit code.
121
+ - `e2e_quality_gate.py` — stdout buffering caused gate stage output to appear out of order in CI; now explicitly flushed after each stage result line.
122
+ - CI workflow — stale cache paths and missing test modules corrected.
123
+
124
+ ---
125
+
126
+ ## [0.6.1] — 2026-03-25
127
+
128
+ ### Overview
129
+
130
+ Brand consolidation and targeted runtime hardening. `ContextGO` is now the single canonical identity. Patch accumulation from rapid iteration resolved: Go scanner query-window matching, native health probe caching, benchmark `native-wrapper` semantics, and session index canonical path logic are all back to clean structures. Front-door documentation rewritten to consistent commercial positioning: local monolith, low token cost, MCP-free, gradual native hot-path migration.
131
+
132
+ 品牌统一切到 `ContextGO`,保持兼容路径;修平补丁叠加;商业化前门文档重写统一发布口径。
133
+
134
+ ### Added
135
+
136
+ - `scripts/test_context_native.py` — unit coverage for native JSON fallback parse and health cache logic.
137
+ - `docs/RELEASE_NOTES_0.6.1.md` — formal release notes under the `ContextGO` brand.
138
+
139
+ ### Changed
140
+
141
+ - `README.md` — fully rewritten as the commercial `ContextGO` release page.
142
+ - `benchmarks/run.py` — old `native` label renamed to `native-wrapper` to prevent misreading subprocess overhead as pure Go/Rust cost.
143
+ - `scripts/context_native.py` — short TTL cache added to the native backend health probe, reducing redundant probe invocations.
144
+ - `native/session_scan_go/scanner.go` — snippet extraction scoped to a query-local window before noise filtering; `user_instructions` and `last_agent_message` field extraction expanded.
145
+
146
+ ### Fixed
147
+
148
+ - Go scanner over-filtered results on broad queries, causing `direct native-scan` to return empty; query-window matching resolves this.
149
+ - Benchmark output text and comparison semantics corrected for `python` vs. `native-wrapper`.
150
+ - End-to-end consistency of session index / native enrich / smoke chain confirmed; this release is deployable, smokeable, and rollback-safe.
151
+
152
+ ---
153
+
154
+ ## [0.5.0] — 2026-03-25
155
+
156
+ ### Overview
157
+
158
+ Foundational release of the local-first `contextgo` runtime. All context capture, semantic retrieval, and daemon operations are contained within a single-machine boundary; remote dependencies are off by default. The benchmark harness drives native migration: run `benchmarks/` against the Python monolith to identify bottlenecks, then replace hot paths with Rust or Go without modifying the CLI surface.
159
+
160
+ 本地单体 `contextgo` 运行时基础版本。单机边界内的所有上下文采集、语义检索与守护进程操作;远端依赖默认关闭;Benchmark 驱动 Native 迁移路径。
161
+
162
+ ### Added
163
+
164
+ - Standalone `contextgo` runtime with unified CLI:
165
+ `search`, `semantic`, `save`, `export`, `import`, `serve`, `maintain`, `health`
166
+ - Built-in session index backed by local SQLite (FTS5).
167
+ - Benchmark harness under `benchmarks/`.
168
+ - Rust session-scan prototype under `native/session_scan/`.
169
+ - Platform installation matrix, validation checklist, and native migration narrative in docs.
170
+
171
+ ### Changed
172
+
173
+ - Mainline converged into a local-first monolith.
174
+ - Deployment defaults switched to `contextgo` service names.
175
+ - Remote sync disabled by default.
176
+ - Archived bridge entrypoints removed from the default code surface.
177
+ - Package-safe imports normalized for both script and package mode.
178
+
179
+ ### Fixed
180
+
181
+ - Viewer runtime config propagation through the canonical server entrypoint.
182
+ - Session index rescan behavior with short sync windows.
183
+ - Wrapper and path assumptions left from earlier incremental refactors.
184
+
185
+ ---
186
+
187
+ [Unreleased]: https://github.com/dunova/ContextGO/compare/v0.9.0...HEAD
188
+ [0.9.0]: https://github.com/dunova/ContextGO/compare/v0.7.0...v0.9.0
189
+ [0.7.0]: https://github.com/dunova/ContextGO/compare/v0.6.1...v0.7.0
190
+ [0.6.1]: https://github.com/dunova/ContextGO/compare/v0.5.0...v0.6.1
191
+ [0.5.0]: https://github.com/dunova/ContextGO/releases/tag/v0.5.0