Skip to content

Commit 3891fbe

Browse files
drknowhowclaude
andcommitted
feat(2.28.0): production-ready release
Brings the project to a marketable, distributable state. See CHANGELOG.md for the full breakdown. Highlights: * Licensing — Apache-2.0 LICENSE + NOTICE, EULA-PRO.md placeholder for a future commercial Pro tier, THIRD_PARTY_LICENSES.md catalogue. Open-core model: the OSS core is permissively licensed, paid features will be license-key gated separately. * Packaging — pyproject.toml replaces requirements.txt. Project ships as `code-context-control` on PyPI with three console scripts (c3, c3-mcp, c3-hub). Optional extras: [vector] (chromadb/sklearn), [tui] (textual), [telemetry] (sentry-sdk), [dev] (pytest/ruff/build/twine). Both install.sh and install.bat now `pip install .` instead of using the legacy requirements file. * Security — SECURITY.md disclosure policy. Hub server (cli/hub_server.py) now binds to 127.0.0.1 by default with a startup warning on non-loopback bind; the prior 0.0.0.0 default exposed the unauthenticated dashboard to LAN. Added missing main() entry-points for c3-mcp / c3-hub (previously declared in pyproject but absent at runtime). * Telemetry — services/error_reporting.py adds opt-in Sentry crash reporting. Off by default. Activates only when SENTRY_DSN is set AND the user opts in via C3_TELEMETRY_OPT_IN=1 or ~/.c3/telemetry.json. before_send hook strips request bodies, local variables, and most contexts before sending. No source code, prompts, or model output ever transmitted. * CI/CD — .github/workflows/ci.yml runs ruff + pytest matrix on Linux/macOS/Windows × Python 3.10/3.11/3.12 plus a build-and-twine-check job. .github/workflows/release.yml does tag-triggered PyPI publishing via Trusted Publishing (OIDC) and creates a GitHub Release with the artifacts attached. * Lint — Conservative ruff config in pyproject.toml. 407 cosmetic issues auto-fixed across the codebase. Two real bugs surfaced and fixed: services/version_tracker.py was missing `import sys` (would NameError on Windows git ops); services/e2e_benchmark.py was missing `from core import count_tokens`. * Tests — Added smoke tests for the three entry-points (cli/c3 CLI, cli/mcp_server, cli/hub_server). Suite now: 235 passed, 2 skipped, 0 failed. The 2 skips are pre-existing-broken bench tests with tracking comments, separate from this release. * Docs — README.md rewritten as a buyer-facing landing page (problem -> value -> install -> screenshots -> license). Marketing screenshots moved from Marketing/ to docs/screenshots/ and referenced via stable GitHub raw URLs so they render on PyPI as well as on GitHub. * Hygiene — Cleaned ghost files from repo root. Removed hard-coded per-machine .mcp.json from tracking. Removed two unused rich.* imports. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent ebeae14 commit 3891fbe

197 files changed

Lines changed: 60069 additions & 1349 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/copilot-instructions.md

Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
## C3 Tools — MANDATORY
2+
This project uses the C3 MCP server. You MUST use `c3_*` MCP tools for ALL code operations.
3+
4+
### Session Initialization (VS Code ONLY)
5+
C3 tools are deferred in VS Code. Before you can use them, you MUST load them.
6+
1. **LOAD TOOLS**: Call `tool_search_tool_regex` with pattern `^mcp_c3_` as your VERY FIRST action in every session.
7+
2. **VERIFY**: Ensure tools like `mcp_c3_c3_search`, `mcp_c3_c3_read`, etc., are available before proceeding.
8+
9+
### Enforcement
10+
While native tools (read_file, grep_search, etc.) are not technically blocked by hooks in VS Code, using them without a prior c3_* call is still a violation of the project's workflow. You must follow the steps below regardless of technical restrictions.
11+
12+
**Native tools are permitted ONLY when:**
13+
1. The c3_* tool failed or returned an error
14+
2. The c3_* tool returned insufficient scope for a targeted follow-up
15+
When falling back, state which c3_* tool was attempted and why it was insufficient.
16+
17+
## Workflow (follow this order — do not skip steps)
18+
1. **RECALL**: `c3_memory(action='recall')` — before any multi-step or context-dependent task
19+
2. **SEARCH FIRST**: `c3_search(action='code|files|semantic')` — before ANY file discovery or content search. Never start with Grep/Glob
20+
3. **MAP before READ**: `c3_compress(mode='map')` then `c3_read(symbols=...|lines=...)` — for ANY file read. Never start with native Read
21+
4. **EDIT via C3**: `c3_edit(file_path, old_string, new_string, summary)` — for ALL edits (reads, patches, writes, and logs in one step)
22+
5. **FILTER output**: `c3_filter(text=...)` — for terminal output >10 lines
23+
6. **VALIDATE**: `c3_validate(file_path)` — after edits or before reporting done
24+
7. **LOG**: `c3_session(action='log')` for decisions. `c3_session(action='snapshot')` before /clear
25+
26+
## Anti-patterns (DO NOT do these)
27+
- Starting with native file search/read/grep without a prior c3_* call
28+
- Using native Edit when c3_edit is available
29+
- Reading entire files when c3_compress + c3_read would be more surgical
30+
- Skipping c3_validate after making edits
31+
32+
---
33+
34+
# Project Context
35+
36+
```
37+
claude-companion - v2/
38+
.mcp.json
39+
AGENTS.md
40+
CLAUDE.md
41+
GEMINI.md
42+
README.md
43+
benchmark-report.html
44+
c3.bat
45+
install.bat
46+
install.sh
47+
landing.html
48+
requirements.txt
49+
self.line_limit
50+
self.warn_threshold
51+
.claude/
52+
settings.local.json
53+
.codex/
54+
config.toml
55+
.gemini/
56+
settings.json
57+
.github/
58+
copilot-instructions.md
59+
.pytest_cache/
60+
.gitignore
61+
CACHEDIR.TAG
62+
README.md
63+
v/
64+
.vscode/
65+
mcp.json
66+
settings.json
67+
cli/
68+
__init__.py
69+
_hook_utils.py
70+
c3.py
71+
docs.html
72+
edits.html
73+
hook_c3read.py
74+
hook_edit_ledger.py
75+
hook_edit_unlock.py
76+
hook_filter.py
77+
hook_pretool_enforce.py
78+
hook_read.py
79+
hub.html
80+
hub_server.py
81+
mcp_proxy.py
82+
mcp_server.py
83+
... +4 more
84+
commands/ (3 files)
85+
tools/ (14 files)
86+
ui/ (5 files)
87+
commercial/
88+
info_01_efficiency.json
89+
info_02_hierarchy.json
90+
info_03_memory_flow.json
91+
info_04_integration.json
92+
scene_01.json
93+
scene_02.json
94+
scene_03.json
95+
scene_04.json
96+
core/
97+
__init__.py
98+
config.py
99+
ide.py
100+
docs/
101+
budget-system.md
102+
token-efficiency-roadmap.md
103+
superpowers/
104+
services/
105+
__init__.py
106+
activity_log.py
107+
agent_base.py
108+
agents.py
109+
auto_memory.py
110+
claude_md.py
111+
compressor.py
112+
context_snapshot.py
113+
conversation_store.py
114+
doc_index.py
115+
e2e_benchmark.py
116+
e2e_evaluator.py
117+
e2e_tasks.py
118+
edit_ledger.py
119+
embedding_index.py
120+
... +26 more
121+
tests/
122+
test_e2e_benchmark.py
123+
test_memory_system.py
124+
test_output_filter.py
125+
test_project_manager.py
126+
test_session_benchmark.py
127+
test_session_budget.py
128+
test_validate.py
129+
tui/
130+
backend.py
131+
build.bat
132+
build.sh
133+
main.py
134+
theme.tcss
135+
screens/ (14 files)
136+
widgets/
137+
```
138+
139+
## Tech Stack
140+
141+
Python
142+
143+
## Key Files
144+
145+
- `services/claude_md.py` — edited in 5 sessions
146+
- `cli/mcp_server.py` — edited in 4 sessions
147+
- `services/agents.py` — edited in 4 sessions
148+
- `cli/edits.html` — edited in 3 sessions
149+
- `services/session_preloader.py` — edited in 2 sessions

.github/workflows/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
lint:
16+
name: Lint (ruff)
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-python@v5
21+
with:
22+
python-version: "3.12"
23+
cache: pip
24+
- name: Install ruff
25+
run: python -m pip install --upgrade pip ruff
26+
- name: ruff check
27+
run: ruff check .
28+
29+
test:
30+
name: Test (${{ matrix.os }} / py${{ matrix.python-version }})
31+
runs-on: ${{ matrix.os }}
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
os: [ubuntu-latest, macos-latest, windows-latest]
36+
python-version: ["3.10", "3.11", "3.12"]
37+
steps:
38+
- uses: actions/checkout@v4
39+
- uses: actions/setup-python@v5
40+
with:
41+
python-version: ${{ matrix.python-version }}
42+
cache: pip
43+
- name: Install package + dev extras
44+
run: |
45+
python -m pip install --upgrade pip
46+
python -m pip install ".[dev]"
47+
- name: Run pytest
48+
env:
49+
# Smoke tests must not initialize real telemetry
50+
SENTRY_DSN: ""
51+
C3_TELEMETRY_OPT_IN: "0"
52+
run: pytest -q
53+
54+
build:
55+
name: Build distribution
56+
needs: [lint, test]
57+
runs-on: ubuntu-latest
58+
steps:
59+
- uses: actions/checkout@v4
60+
- uses: actions/setup-python@v5
61+
with:
62+
python-version: "3.12"
63+
cache: pip
64+
- name: Install build tooling
65+
run: python -m pip install --upgrade pip build twine
66+
- name: Build sdist + wheel
67+
run: python -m build --sdist --wheel --outdir dist
68+
- name: twine check
69+
run: python -m twine check dist/*
70+
- name: Upload artifacts
71+
uses: actions/upload-artifact@v4
72+
with:
73+
name: dist
74+
path: dist/
75+
retention-days: 7

.github/workflows/release.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
9+
# Required for PyPI Trusted Publishing (OIDC):
10+
# 1. On PyPI, go to the project page → Publishing → Add a pending publisher.
11+
# 2. Owner = drknowhow, Repository = code-context-control,
12+
# Workflow = release.yml, Environment = pypi.
13+
# 3. Push a tag (e.g. `git tag v2.28.0 && git push --tags`) to trigger.
14+
15+
permissions:
16+
contents: read
17+
18+
jobs:
19+
build:
20+
name: Build distribution
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: actions/setup-python@v5
25+
with:
26+
python-version: "3.12"
27+
cache: pip
28+
- name: Install build tooling
29+
run: python -m pip install --upgrade pip build twine
30+
- name: Verify tag matches package version
31+
run: |
32+
TAG_VERSION="${GITHUB_REF_NAME#v}"
33+
PKG_VERSION=$(python -c "import tomllib, pathlib; print(tomllib.loads(pathlib.Path('pyproject.toml').read_text())['project']['version'])")
34+
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
35+
echo "::error::Tag $GITHUB_REF_NAME does not match pyproject.toml version $PKG_VERSION"
36+
exit 1
37+
fi
38+
- name: Build sdist + wheel
39+
run: python -m build --sdist --wheel --outdir dist
40+
- name: twine check
41+
run: python -m twine check dist/*
42+
- name: Upload distribution artifacts
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: dist
46+
path: dist/
47+
48+
publish-pypi:
49+
name: Publish to PyPI
50+
needs: build
51+
runs-on: ubuntu-latest
52+
environment:
53+
name: pypi
54+
url: https://pypi.org/p/code-context-control
55+
permissions:
56+
id-token: write # required for Trusted Publishing
57+
steps:
58+
- name: Download distribution artifacts
59+
uses: actions/download-artifact@v4
60+
with:
61+
name: dist
62+
path: dist/
63+
- name: Publish to PyPI
64+
uses: pypa/gh-action-pypi-publish@release/v1
65+
66+
github-release:
67+
name: Attach artifacts to GitHub Release
68+
needs: publish-pypi
69+
runs-on: ubuntu-latest
70+
permissions:
71+
contents: write
72+
steps:
73+
- uses: actions/checkout@v4
74+
- name: Download distribution artifacts
75+
uses: actions/download-artifact@v4
76+
with:
77+
name: dist
78+
path: dist/
79+
- name: Create GitHub Release
80+
uses: softprops/action-gh-release@v2
81+
with:
82+
files: dist/*
83+
generate_release_notes: true
84+
draft: false
85+
prerelease: false

0 commit comments

Comments
 (0)