Stevesolun commited on
Commit
0c5b275
·
verified ·
1 Parent(s): 8bb3bed

Add files using upload-large-folder tool

Browse files
.gitattributes CHANGED
@@ -1,4 +1 @@
1
  graph/wiki-graph.tar.gz filter=lfs diff=lfs merge=lfs -text
2
- graph/viz-overview.png filter=lfs diff=lfs merge=lfs -text
3
- graph/viz-security.png filter=lfs diff=lfs merge=lfs -text
4
- graph/skills-sh-catalog.json.gz filter=lfs diff=lfs merge=lfs -text
 
1
  graph/wiki-graph.tar.gz filter=lfs diff=lfs merge=lfs -text
 
 
 
.github/workflows/publish.yml CHANGED
@@ -129,15 +129,94 @@ jobs:
129
 
130
  - name: Resolve release graph LFS artifacts
131
  id: resolve_graph_lfs
132
- continue-on-error: true
 
 
133
  run: |
 
134
  git lfs install --local
135
- git lfs pull --include="graph/wiki-graph.tar.gz,graph/skills-sh-catalog.json.gz" --exclude=""
 
 
 
 
 
 
 
 
 
 
136
 
137
- - name: Warn when release graph LFS artifacts are unavailable
138
- if: steps.resolve_graph_lfs.outcome != 'success'
139
- run: |
140
- echo "::warning::Graph LFS artifacts are unavailable; PyPI publish will continue without release asset upload."
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
141
 
142
  - name: Validate release graph artifacts
143
  if: steps.resolve_graph_lfs.outcome == 'success'
@@ -321,11 +400,13 @@ jobs:
321
  GH_TOKEN: ${{ github.token }}
322
  TAG_NAME: ${{ github.ref_name }}
323
  run: |
324
- gh release view "$TAG_NAME" >/dev/null 2>&1 \
325
  || gh release create "$TAG_NAME" \
 
326
  --title "$TAG_NAME" \
327
  --notes "ctx $TAG_NAME"
328
  gh release upload "$TAG_NAME" \
 
329
  graph-release-assets/wiki-graph.tar.gz \
330
  graph-release-assets/skills-sh-catalog.json.gz \
331
  graph-release-assets/communities.json \
@@ -336,7 +417,7 @@ jobs:
336
  needs:
337
  - build
338
  - release-assets
339
- if: ${{ always() && needs.build.result == 'success' && (github.event_name == 'workflow_dispatch' || needs.release-assets.result == 'success' || needs.release-assets.result == 'skipped') }}
340
  runs-on: ubuntu-latest
341
  permissions:
342
  contents: read
 
129
 
130
  - name: Resolve release graph LFS artifacts
131
  id: resolve_graph_lfs
132
+ env:
133
+ GH_TOKEN: ${{ github.token }}
134
+ TAG_NAME: ${{ github.ref_name }}
135
  run: |
136
+ set -euo pipefail
137
  git lfs install --local
138
+ if git lfs pull --include="graph/wiki-graph.tar.gz" --exclude=""; then
139
+ exit 0
140
+ fi
141
+ echo "Git LFS download failed; trying matching prior release asset."
142
+ python - <<'PY'
143
+ import hashlib
144
+ import json
145
+ import os
146
+ from pathlib import Path
147
+ import subprocess
148
+ import urllib.request
149
 
150
+ graph_tar = Path("graph/wiki-graph.tar.gz")
151
+ pointer = graph_tar.read_text(encoding="utf-8", errors="replace")
152
+ expected_oid = ""
153
+ expected_size = 0
154
+ for line in pointer.splitlines():
155
+ if line.startswith("oid sha256:"):
156
+ expected_oid = line.split(":", 1)[1].strip()
157
+ elif line.startswith("size "):
158
+ expected_size = int(line.split(" ", 1)[1].strip())
159
+ if not expected_oid:
160
+ if graph_tar.stat().st_size > 100_000_000:
161
+ print(f"{graph_tar} is already hydrated")
162
+ raise SystemExit(0)
163
+ raise SystemExit("graph/wiki-graph.tar.gz is neither hydrated nor an LFS pointer")
164
+
165
+ repo = os.environ["GITHUB_REPOSITORY"]
166
+ current_tag = os.environ.get("TAG_NAME", "")
167
+ releases = json.loads(subprocess.check_output(
168
+ ["gh", "api", f"repos/{repo}/releases?per_page=50"],
169
+ text=True,
170
+ ))
171
+ candidates = []
172
+ for release in releases:
173
+ if release.get("draft") or release.get("prerelease"):
174
+ continue
175
+ if release.get("tag_name") == current_tag:
176
+ continue
177
+ for asset in release.get("assets", []):
178
+ if asset.get("name") != "wiki-graph.tar.gz":
179
+ continue
180
+ digest = str(asset.get("digest") or "")
181
+ size = int(asset.get("size") or 0)
182
+ if size != expected_size:
183
+ continue
184
+ if digest and digest != f"sha256:{expected_oid}":
185
+ continue
186
+ candidates.append((release.get("tag_name"), asset))
187
+
188
+ if not candidates:
189
+ raise SystemExit(
190
+ "No previous release asset matches graph/wiki-graph.tar.gz "
191
+ f"sha256:{expected_oid} size:{expected_size}"
192
+ )
193
+
194
+ source_tag, asset = candidates[0]
195
+ tmp = graph_tar.with_name("wiki-graph.tar.gz.download")
196
+ sha = hashlib.sha256()
197
+ total = 0
198
+ with urllib.request.urlopen(asset["browser_download_url"], timeout=300) as resp: # noqa: S310
199
+ with tmp.open("wb") as fh:
200
+ while True:
201
+ chunk = resp.read(1024 * 1024)
202
+ if not chunk:
203
+ break
204
+ sha.update(chunk)
205
+ total += len(chunk)
206
+ fh.write(chunk)
207
+ actual_oid = sha.hexdigest()
208
+ if actual_oid != expected_oid or total != expected_size:
209
+ tmp.unlink(missing_ok=True)
210
+ raise SystemExit(
211
+ "Downloaded graph tar does not match LFS pointer: "
212
+ f"sha256:{actual_oid} size:{total}"
213
+ )
214
+ tmp.replace(graph_tar)
215
+ print(
216
+ "Hydrated graph/wiki-graph.tar.gz from "
217
+ f"{source_tag} release asset sha256:{actual_oid} size:{total}"
218
+ )
219
+ PY
220
 
221
  - name: Validate release graph artifacts
222
  if: steps.resolve_graph_lfs.outcome == 'success'
 
400
  GH_TOKEN: ${{ github.token }}
401
  TAG_NAME: ${{ github.ref_name }}
402
  run: |
403
+ gh release view "$TAG_NAME" --repo "$GITHUB_REPOSITORY" >/dev/null 2>&1 \
404
  || gh release create "$TAG_NAME" \
405
+ --repo "$GITHUB_REPOSITORY" \
406
  --title "$TAG_NAME" \
407
  --notes "ctx $TAG_NAME"
408
  gh release upload "$TAG_NAME" \
409
+ --repo "$GITHUB_REPOSITORY" \
410
  graph-release-assets/wiki-graph.tar.gz \
411
  graph-release-assets/skills-sh-catalog.json.gz \
412
  graph-release-assets/communities.json \
 
417
  needs:
418
  - build
419
  - release-assets
420
+ if: ${{ always() && needs.build.result == 'success' && (github.event_name == 'workflow_dispatch' || needs.release-assets.result == 'success') }}
421
  runs-on: ubuntu-latest
422
  permissions:
423
  contents: read
CHANGELOG.md CHANGED
@@ -7,6 +7,38 @@ Format loosely follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
7
 
8
  - No unreleased changes yet.
9
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  ## [0.7.9] - 2026-05-09
11
 
12
  ### Changed
 
7
 
8
  - No unreleased changes yet.
9
 
10
+ ## [0.7.16] - 2026-05-09
11
+
12
+ ### Fixed
13
+
14
+ - Passed explicit repository context to release-asset upload commands so
15
+ publish jobs can create and update GitHub releases without a checkout.
16
+
17
+ ## [0.7.15] - 2026-05-09
18
+
19
+ ### Fixed
20
+
21
+ - Recovered release publishing when GitHub LFS budget is exhausted by hydrating
22
+ `wiki-graph.tar.gz` from a previous release asset only when its SHA-256 and
23
+ byte size match the checked-in LFS pointer.
24
+
25
+ ## [0.7.14] - 2026-05-09
26
+
27
+ ### Fixed
28
+
29
+ - Recorded the user's ctx knowledge-source mode during `ctx-init` so shipped
30
+ knowledge, local-only knowledge, and enriched knowledge are explicit choices.
31
+ - Rolled back harness updates when attach or manifest writes fail after target
32
+ replacement, preserving the previous installed harness and manifest.
33
+ - Inferred the no-fit custom harness PRD provider from model slugs such as
34
+ `openrouter/openai/gpt-5.5` when `--model-provider` is omitted.
35
+ - Made release publishing fail closed when graph LFS artifacts cannot be
36
+ hydrated, so PyPI releases do not ship without the matching graph assets.
37
+ - Corrected first-time README harness and hook commands plus stale graph
38
+ refresh instructions in the repo-stats maintenance skill.
39
+ - Required a read token for LAN-bound dashboard pages, avoided cold-loading
40
+ the full graph on `/graph`, and preserved entity type in KPI links.
41
+
42
  ## [0.7.9] - 2026-05-09
43
 
44
  ### Changed
README.md CHANGED
@@ -11,9 +11,6 @@ tags:
11
  - harness
12
  - codex
13
  - claude-code
14
- - developer-tools
15
- - context-management
16
- - local-llm
17
  ---
18
 
19
  # ctx — Skill, Agent, MCP & Harness Recommendations
@@ -21,7 +18,7 @@ tags:
21
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
22
  [![Python 3.11+](https://img.shields.io/badge/Python-3.11+-green.svg)](https://python.org)
23
  [![PyPI](https://img.shields.io/pypi/v/claude-ctx.svg)](https://pypi.org/project/claude-ctx/)
24
- [![Tests](https://img.shields.io/badge/Tests-3683_collected-brightgreen.svg)](#)
25
  [![Graph](https://img.shields.io/badge/Graph-102%2C696_nodes_/_2.9M_edges-red.svg)](graph/)
26
  [![Docs](https://img.shields.io/badge/docs-MkDocs_Material-blue.svg)](https://stevesolun.github.io/ctx/)
27
 
@@ -50,23 +47,30 @@ Current shipped snapshot:
50
  ```bash
51
  pip install claude-ctx
52
  ctx-init # terminal wizard: hooks, graph, model, harness goal
 
53
  ctx-init --wizard # force the same wizard from scripts/tests
54
- ctx-init --model-mode skip # non-interactive setup for automation
55
  ctx-init --model-mode custom --model openai/gpt-5.5 --goal "build a CAD agent"
56
  ```
57
 
58
  Optional extras: `pip install "claude-ctx[embeddings]"` for the semantic backend, `pip install "claude-ctx[harness]"` for local/API model harness runs, `pip install "claude-ctx[dev]"` for the test toolchain.
59
 
60
- ### Pre-built knowledge graph (optional)
61
 
62
- A pre-built knowledge graph of 102,696 nodes and 2.9M edges ships as a tarball. The same tarball includes `external-catalogs/skills-sh/catalog.json`, 89,463 body-backed Skills.sh skill pages under `entities/skills/skills-sh-*.md`, 89,463 hydrated installable Skills.sh `SKILL.md` files under `converted/skills-sh-*/`, and 13 cataloged harness pages under `entities/harnesses/`. Extract to get a ready-to-use `~/.claude/skill-wiki/`:
 
 
63
 
64
  ```bash
65
- # after `git clone` — or download graph/wiki-graph.tar.gz from the GitHub release
66
- mkdir -p ~/.claude/skill-wiki
67
- tar xzf graph/wiki-graph.tar.gz -C ~/.claude/skill-wiki/
68
  ```
69
 
 
 
 
 
 
 
 
70
  > **Windows:** PowerShell's built-in `tar.exe` does not support
71
  > `--force-local`; use `tar -xzf graph\wiki-graph.tar.gz -C "$env:USERPROFILE\.claude\skill-wiki"`.
72
  > In Git Bash or MSYS, use `--force-local` only when your `-C` target is a
@@ -74,7 +78,8 @@ tar xzf graph/wiki-graph.tar.gz -C ~/.claude/skill-wiki/
74
 
75
  ## Use
76
 
77
- After install, the `ctx` hooks integrate automatically with Claude Code's `PostToolUse` + `Stop` events. Typical flow:
 
78
 
79
  ```bash
80
  ctx-scan-repo --repo . # scan current repo and stack signals
@@ -82,6 +87,7 @@ ctx-scan-repo --repo . --recommend # include skill/agent/MCP recommendations
82
  ctx-agent-add --agent-path ./code-reviewer.md --name code-reviewer
83
  ctx-harness-add --repo https://github.com/earthtojake/text-to-cad --tag cad
84
  ctx-harness-install text-to-cad --dry-run # inspect before cloning/running anything
 
85
  ctx-harness-install text-to-cad --update --dry-run
86
  ctx-harness-install text-to-cad --uninstall --dry-run
87
  ctx-skill-quality list # four-signal quality score for every skill
 
11
  - harness
12
  - codex
13
  - claude-code
 
 
 
14
  ---
15
 
16
  # ctx — Skill, Agent, MCP & Harness Recommendations
 
18
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)
19
  [![Python 3.11+](https://img.shields.io/badge/Python-3.11+-green.svg)](https://python.org)
20
  [![PyPI](https://img.shields.io/pypi/v/claude-ctx.svg)](https://pypi.org/project/claude-ctx/)
21
+ [![Tests](https://img.shields.io/badge/Tests-3693_collected-brightgreen.svg)](#)
22
  [![Graph](https://img.shields.io/badge/Graph-102%2C696_nodes_/_2.9M_edges-red.svg)](graph/)
23
  [![Docs](https://img.shields.io/badge/docs-MkDocs_Material-blue.svg)](https://stevesolun.github.io/ctx/)
24
 
 
47
  ```bash
48
  pip install claude-ctx
49
  ctx-init # terminal wizard: hooks, graph, model, harness goal
50
+ ctx-init --graph --hooks --model-mode skip # non-interactive graph + Claude Code hooks
51
  ctx-init --wizard # force the same wizard from scripts/tests
 
52
  ctx-init --model-mode custom --model openai/gpt-5.5 --goal "build a CAD agent"
53
  ```
54
 
55
  Optional extras: `pip install "claude-ctx[embeddings]"` for the semantic backend, `pip install "claude-ctx[harness]"` for local/API model harness runs, `pip install "claude-ctx[dev]"` for the test toolchain.
56
 
57
+ ### Pre-built knowledge graph
58
 
59
+ Graph-backed recommendations need the pre-built wiki graph. Source checkouts
60
+ use `graph/wiki-graph.tar.gz`; pip installs download the matching GitHub
61
+ release asset:
62
 
63
  ```bash
64
+ ctx-init --graph
 
 
65
  ```
66
 
67
+ A pre-built knowledge graph of 102,696 nodes and 2.9M edges ships as a
68
+ tarball. The same tarball includes `external-catalogs/skills-sh/catalog.json`,
69
+ 89,463 body-backed Skills.sh skill pages under `entities/skills/skills-sh-*.md`,
70
+ 89,463 hydrated installable Skills.sh `SKILL.md` files under
71
+ `converted/skills-sh-*/`, and 13 cataloged harness pages under
72
+ `entities/harnesses/`.
73
+
74
  > **Windows:** PowerShell's built-in `tar.exe` does not support
75
  > `--force-local`; use `tar -xzf graph\wiki-graph.tar.gz -C "$env:USERPROFILE\.claude\skill-wiki"`.
76
  > In Git Bash or MSYS, use `--force-local` only when your `-C` target is a
 
78
 
79
  ## Use
80
 
81
+ After `ctx-init --hooks` or the wizard hook step, ctx observes Claude Code's
82
+ `PostToolUse` + `Stop` events. Typical flow:
83
 
84
  ```bash
85
  ctx-scan-repo --repo . # scan current repo and stack signals
 
87
  ctx-agent-add --agent-path ./code-reviewer.md --name code-reviewer
88
  ctx-harness-add --repo https://github.com/earthtojake/text-to-cad --tag cad
89
  ctx-harness-install text-to-cad --dry-run # inspect before cloning/running anything
90
+ ctx-harness-install text-to-cad # install after reviewing the plan
91
  ctx-harness-install text-to-cad --update --dry-run
92
  ctx-harness-install text-to-cad --uninstall --dry-run
93
  ctx-skill-quality list # four-signal quality score for every skill
docs/index.md CHANGED
@@ -17,6 +17,7 @@ memory that gets smarter every session.
17
 
18
  ```bash
19
  pip install claude-ctx
 
20
  ```
21
 
22
  Optional extras: `pip install "claude-ctx[embeddings]"` for the
@@ -24,7 +25,10 @@ memory that gets smarter every session.
24
  model harness runs, `pip install "claude-ctx[dev]"` for the
25
  pytest/mypy/ruff toolchain. After install the `ctx-scan-repo`,
26
  `ctx-skill-quality`, `ctx-skill-health`, and `ctx-toolbox` console
27
- scripts are on PATH.
 
 
 
28
 
29
  Custom-model users can run
30
  `ctx-init --model-mode custom --model <provider/model> --goal "<task>"`
@@ -182,7 +186,7 @@ ones are flagged. New ones self-ingest.
182
  ---
183
 
184
  **v0.7.x** — MIT, CI-matrixed (Ubuntu + Windows × Python 3.11/3.12),
185
- 3,683 tests collected. Ships console scripts including `ctx-init`,
186
  `ctx-monitor` (local dashboard with graph + wiki + load/unload for
187
  skills, agents, and MCP servers, plus harness wiki/graph browsing),
188
  `ctx-dedup-check` (pre-ship near-duplicate gate), and
 
17
 
18
  ```bash
19
  pip install claude-ctx
20
+ ctx-init --graph --model-mode skip
21
  ```
22
 
23
  Optional extras: `pip install "claude-ctx[embeddings]"` for the
 
25
  model harness runs, `pip install "claude-ctx[dev]"` for the
26
  pytest/mypy/ruff toolchain. After install the `ctx-scan-repo`,
27
  `ctx-skill-quality`, `ctx-skill-health`, and `ctx-toolbox` console
28
+ scripts are on PATH. `ctx-init --graph` installs the pre-built wiki
29
+ graph that powers recommendations; source checkouts use
30
+ `graph/wiki-graph.tar.gz`, while pip installs download the matching
31
+ GitHub release asset.
32
 
33
  Custom-model users can run
34
  `ctx-init --model-mode custom --model <provider/model> --goal "<task>"`
 
186
  ---
187
 
188
  **v0.7.x** — MIT, CI-matrixed (Ubuntu + Windows × Python 3.11/3.12),
189
+ 3,693 tests collected. Ships console scripts including `ctx-init`,
190
  `ctx-monitor` (local dashboard with graph + wiki + load/unload for
191
  skills, agents, and MCP servers, plus harness wiki/graph browsing),
192
  `ctx-dedup-check` (pre-ship near-duplicate gate), and
docs/knowledge-graph.md CHANGED
@@ -43,12 +43,20 @@ shipped tarball.
43
 
44
  ## Install
45
 
46
- Extract the tarball into your `~/.claude/skill-wiki/` to get a
47
- ready-to-query graph plus every shipped skill/agent/MCP entity page,
48
- cataloged harness pages when present, remote-cataloged Skills.sh skill
49
- pages, concept pages, and converted micro-skill pipelines. The extracted
50
- tree also includes the Skills.sh catalog JSON used by the shared
51
- recommender:
 
 
 
 
 
 
 
 
52
 
53
  ```bash
54
  mkdir -p ~/.claude/skill-wiki
 
43
 
44
  ## Install
45
 
46
+ Use `ctx-init --graph` to install the graph. Source checkouts use
47
+ `graph/wiki-graph.tar.gz`; pip installs download the matching GitHub
48
+ release asset for the installed package version:
49
+
50
+ ```bash
51
+ ctx-init --graph
52
+ ```
53
+
54
+ Manual extraction is still supported for offline/source installs. Extract
55
+ the tarball into your `~/.claude/skill-wiki/` to get a ready-to-query graph
56
+ plus every shipped skill/agent/MCP entity page, cataloged harness pages when
57
+ present, remote-cataloged Skills.sh skill pages, concept pages, and converted
58
+ micro-skill pipelines. The extracted tree also includes the Skills.sh catalog
59
+ JSON used by the shared recommender:
60
 
61
  ```bash
62
  mkdir -p ~/.claude/skill-wiki
pyproject.toml CHANGED
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
 
5
  [project]
6
  name = "claude-ctx"
7
- version = "0.7.13"
8
  description = "Skill and agent recommendation system for Claude Code — knowledge graph, wiki, and intake quality gates"
9
  authors = [{ name = "Steve Solun" }]
10
  license = "MIT"
@@ -111,8 +111,8 @@ harness = [
111
  ]
112
 
113
  [tool.setuptools]
114
- # Plan 001 migration (docs/plans/001-model-agnostic-harness.md).
115
- # During phases R0-R6 the codebase lives in TWO shapes simultaneously:
116
  # - The legacy flat modules listed in ``py-modules`` below.
117
  # - The target ``ctx`` package tree (ctx.core, ctx.adapters, ctx.cli,
118
  # ctx.mcp_server, ctx.utils) declared in ``packages`` below.
 
4
 
5
  [project]
6
  name = "claude-ctx"
7
+ version = "0.7.16"
8
  description = "Skill and agent recommendation system for Claude Code — knowledge graph, wiki, and intake quality gates"
9
  authors = [{ name = "Steve Solun" }]
10
  license = "MIT"
 
111
  ]
112
 
113
  [tool.setuptools]
114
+ # Incremental package-layout migration.
115
+ # During migration phases the codebase lives in TWO shapes simultaneously:
116
  # - The legacy flat modules listed in ``py-modules`` below.
117
  # - The target ``ctx`` package tree (ctx.core, ctx.adapters, ctx.cli,
118
  # ctx.mcp_server, ctx.utils) declared in ``packages`` below.