Skip to content

Commit 5e7fec2

Browse files
Bordaclaude[bot]
andcommitted
refine: collection-time test skip markers
- Replace runtime pytest.skip() calls inside test/fixture bodies with module-level capability probes gated by pytest.mark.skipif, across benchmarks/, cc_develop, cc_foundry, cc_oss, cc_research, codemap-py, and codex-rig; codify the rule in AGENTS.md and CLAUDE.md ("Test skips are collection-time decorators only ... never call pytest.skip() from a test or fixture body") - Remove now-redundant portability micro-tests (test_no_tmp_literal_in_source, test_stdout_reconfigure_present, test_shebang_env_python) after widening .pre-commit-config.yaml's no-tmp-literal check to also cover bin/ scripts (previously hooks/ only), and swap the resulting /tmp/... doctest literals for /opt/... in cc_oss, cc_research, and codemap-py bin scripts - cc_oss: consolidate 13 near-identical per-script --help-exits-0 tests into one parametrized tests/test_bin_help_contract.py that walks bin/ dynamically - cc_foundry: merge the hyphenated tests/test_find-polluter.py into tests/test_find_polluter.py, keeping one canonical CLI/security test module - codex-rig: sync_codex.py now reconciles the managed plugin set from a configured local (non-Git) marketplace instead of forcing a Git-only marketplace upgrade; extract shared tests/_platform.py capability probes (POSIX bash, symlinks, FIFO, mode retention) replacing duplicated per-file probes - Rewrite README.md, docs/index.md, and every plugin README (foundry, oss, develop, research, codemap-py, codex-rig) for accuracy and discoverability: correct stale agent/skill counts and command examples, remove benchmark-result duplication in favor of the canonical benchmarks/README.md, and expand docs/llms.txt and docs/robots.txt for AI-crawler discoverability - Patch-bump plugin.json for develop, foundry, oss, research, and codemap-py (both manifests), and codex-rig (0.7.5 to 0.7.6), syncing descriptions to the current skill/agent rosters; sync marketplace.json and docs/hooks.py structured data to match --- Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
1 parent b9c6b5a commit 5e7fec2

106 files changed

Lines changed: 3580 additions & 4854 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.

.claude-plugin/marketplace.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
{
2+
"description": "Independently installable Claude Code plugins for configuration, Python development, open-source maintenance, ML research, and static Python structure.",
23
"name": "borda-ai-rig",
34
"owner": {
45
"name": "Borda"
56
},
67
"plugins": [
78
{
8-
"description": "Production-grade Claude Code config: specialist agents, slash-command skills, and event-driven hooks for Python/ML OSS development",
9+
"description": "Claude Code configuration and workflow maintenance: 11 skills, 10 specialist agents, rules, hooks, audit, calibration, and session handover",
910
"name": "foundry",
1011
"source": "./plugins/cc_foundry"
1112
},
1213
{
13-
"description": "OSS maintenance skills: analyse, resolve, review, release",
14+
"description": "Open-source maintenance: issue and repository analysis, PR review, feedback resolution, release-readiness assessment, setup, and 4 specialist agents",
1415
"name": "oss",
1516
"source": "./plugins/cc_oss"
1617
},
1718
{
18-
"description": "Implementation workflow skills: feature, fix, refactor, plan, debug",
19+
"description": "Validate-first Python development: plan, feature, fix, refactor, debug, review, and setup workflows",
1920
"name": "develop",
2021
"source": "./plugins/cc_develop"
2122
},
2223
{
23-
"description": "ML/perf investigation skills: topic, plan, judge, run, sweep",
24+
"description": "Reviewable ML research: literature, planning, methodology review, bounded runs, sweeps, implementation verification, ablations, retrospectives, Kaggle, and setup",
2425
"name": "research",
2526
"source": "./plugins/cc_research"
2627
},
2728
{
28-
"description": "Codebase structural index \u2014 scan Python projects, query the import graph for blast-radius and coupling",
29+
"description": "Static Python structure for Claude Code: indexing, queries, test impact, reference renames, integration, and session telemetry debriefs",
2930
"name": "codemap-py",
3031
"source": "./plugins/codemap-py"
3132
}

.claude/README.md

Lines changed: 416 additions & 367 deletions
Large diffs are not rendered by default.

.codex/README.md

Lines changed: 364 additions & 0 deletions
Large diffs are not rendered by default.

.pre-commit-config.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,10 @@ repos:
304304
entry: '["''`]/tmp/'
305305
# Replaces tests/hooks/tmp-paths.test.js, which checked a hardcoded 6-file cc_foundry list
306306
# and missed the other 16 plugin hooks; this glob picks up new hooks automatically.
307-
files: ^plugins/[^/]+/hooks/.*\.(js|py)$|^\.claude/hooks/.*\.(js|py)$|^\.codex/hooks/.*\.(js|py)$
307+
# bin/ included for the same reason: the per-script test_no_tmp_literal_in_source copies
308+
# covered 8 of 124 bin/ scripts. Doctests must avoid quoted /tmp/ too — a doctest's
309+
# expected-output line is indistinguishable from a real path constant to a line matcher.
310+
files: ^plugins/[^/]+/(hooks|bin)/.*\.(js|py)$|^\.claude/hooks/.*\.(js|py)$|^\.codex/hooks/.*\.(js|py)$
308311

309312
- id: check-benchmark-portable-paths
310313
name: 🧳 No hardcoded machine paths in benchmark source

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Scripts, hooks, `bin/` entry points, and CI steps all run on Linux, macOS, and n
2929
- A workflow `run:` step invoking `.sh` needs explicit `shell: bash` — the Windows default shell dot-sources it and exits zero, a false green.
3030
- Symlinks, file modes, and uid checks are capabilities: degrade in production code first.
3131
- Skips are the last resort: never a blanket `skipif(sys.platform == "win32")`, always a capability probe skipping on `OSError`, with each surviving skip documented and re-audited.
32+
- Test skips must be collection-time decorators (`pytest.mark.skipif`, `pytest.mark.skip`, or parametrized marks); never call `pytest.skip()` from a test or fixture body.
3233
- Green macOS is absence of regression, not Windows support: prove Windows semantics with `PureWindowsPath` or `ntpath`, since monkeypatching `os.name` does not change `pathlib`.
3334

3435
## Benchmark Isolation

CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Scripts, hooks, `bin/`, CI steps all run Linux + macOS + native Windows. Fix at
5353
- CI `run:` calling `.sh` needs explicit `shell: bash` — Windows pwsh dot-sources it, exits 0, runs nothing (false green)
5454
- Symlink/mode/uid = capabilities: degrade in production code first
5555
- Skip last resort: never blanket `skipif(sys.platform == "win32")` — probe capability, skip on `OSError`; document + re-audit each surviving skip
56+
- Test skips are collection-time decorators only (`pytest.mark.skipif`, `pytest.mark.skip`, parametrized marks); never call `pytest.skip()` from a test or fixture body
5657
- Green macOS ≠ Windows support: prove with `PureWindowsPath`/`ntpath`; monkeypatching `os.name` does not change `pathlib`
5758

5859
## Benchmark Isolation

README.md

Lines changed: 305 additions & 377 deletions
Large diffs are not rendered by default.

benchmarks/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -858,7 +858,7 @@ Omitting `--tasks` runs all 73 locked tasks (219 A/B/C cells); use an explicit f
858858

859859
Rows below use the canonical arm name with the retired one in parentheses: `C_strict` was called `C_required` when this run was frozen, and `benchmarks/results/code-2026-08-04.json` still records the old string — search that artifact for `C_required`, not `C_strict`. The [agentic measurement caveats](#agentic-measurement-caveats) apply to this table: the arms ran in fixed A→B→C order against a warm provider cache, and the `erec`/`rrec`/`aqs` columns carry the substring-credit and unweighted-mean inflation described there.
860860

861-
<!-- result-sync: duplicated/summarized in ../plugins/codemap-py/README.md#claude-agentic-2026-08-04; update both files or record an explicit divergence note. -->
861+
<!-- result-sync: ../plugins/codemap-py/README.md#claude-agentic-2026-08-04 is an anchor stub only — the plugin README intentionally no longer duplicates run-specific tables (§Benchmark Isolation). This table is canonical; do not re-add values there. -->
862862

863863
| Model | Arm | n | in tok | out tok | cost $ | elapsed s | erec | rrec | aqs | correct |
864864
| ------ | ------------------------- | --: | ---------: | -------: | --------: | --------: | -------: | -------: | -------: | -------: |
@@ -1088,7 +1088,7 @@ Full summary + per-task reading: [`results/bench-summary-2026-07-29.md`](results
10881088

10891089
**Two value axes — read separately, never blended.** (1) **Reliability/quality**: safety-grade + structural recall — codemap **13/13 safety-grade every tier** vs plain 8/13 → 12/13 → 13/13; the primary proposition, holds up-tier. (2) **Economy (cost/tokens/time)**: read at *matched caller fan-in* — the win grows with fan-in (cost 0.35× haiku / 0.54× opus on high-fan-in tasks); raw median token ratio is a *secondary, caveated* number that → 1 as models get terser. Accuracy Δ is a saturation-sensitive tie-breaker, not a headline.
10901090

1091-
<!-- result-sync: this is the canonical July 29 table; ../plugins/codemap-py/README.md#three-model-comparison contains the distinct June 22 legacy run, so do not synchronize their values. -->
1091+
<!-- result-sync: this is the canonical July 29 table. ../plugins/codemap-py/README.md#three-model-comparison is now an anchor stub only — the June 22 legacy run it used to hold was removed from the plugin README (§Benchmark Isolation). The June 22 table below remains the canonical copy; the two runs are still distinct and must not be blended. -->
10921092

10931093
| Tier | Plain accuracy | Codemap accuracy | Δ accuracy | Safety-grade plain | Safety-grade codemap | Token× med / mean | Cost× med / mean |
10941094
| --------- | ----------------- | ----------------- | ---------- | ------------------ | -------------------- | ----------------- | ---------------- |
@@ -1113,7 +1113,7 @@ Per-workflow codemap accuracy: query (n=28) 92.0 / 95.8 / 84.0%; debug (n=6) 100
11131113
11141114
Results — June 22 2026 — 44 tasks × 2 arms × 3 models, pytorch-lightning-master. **Models** `claude-haiku-4-5` / `claude-sonnet-4-6` / `claude-opus-4-6` · **codemap version not recorded in these result lines** (predates the v0.13.2 agentic run; ~mid-June 2026) · **codemap-favoring steering harness** (not comparable with the July run above — see comparability note).
11151115

1116-
<!-- result-sync: duplicated/summarized in ../plugins/codemap-py/README.md#three-model-comparison; update both files or record an explicit divergence note. All result tables in this historical block are canonical sources for downstream summaries. -->
1116+
<!-- result-sync: ../plugins/codemap-py/README.md#three-model-comparison is an anchor stub only — the plugin README no longer duplicates run-specific tables (§Benchmark Isolation). All result tables in this historical block are the canonical sources for downstream summaries; do not re-add values to the plugin README. -->
11171117

11181118
| Model | Plain accuracy | Codemap accuracy | Accuracy lift | Safety-grade plain | Safety-grade codemap | Token ratio (median) | Token ratio range |
11191119
| ---------- | ----------------- | ----------------- | ------------- | ------------------ | -------------------- | -------------------- | ----------------- |
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""Capability checks for benchmark launcher artifacts."""
2+
3+
from __future__ import annotations
4+
5+
import subprocess
6+
from pathlib import Path
7+
8+
9+
def raw_codemap_launchers_are_runnable(repo_root: Path) -> bool:
10+
"""Return whether both shipped raw Codemap launchers can run on this host."""
11+
for name in ("scan-index", "scan-query"):
12+
launcher = repo_root / "plugins" / "codemap-py" / "bin" / name
13+
try:
14+
result = subprocess.run([str(launcher), "--help"], capture_output=True, text=True, timeout=30, check=False)
15+
except (OSError, subprocess.SubprocessError):
16+
return False
17+
if result.returncode != 0:
18+
return False
19+
return True

benchmarks/tests/conftest.py

Lines changed: 23 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,13 @@
1717

1818
BENCHMARKS_DIR = Path(__file__).parent.parent
1919
REPO_ROOT = BENCHMARKS_DIR.parent
20+
TESTS_DIR = Path(__file__).parent
21+
if str(TESTS_DIR) not in sys.path:
22+
sys.path.insert(0, str(TESTS_DIR))
23+
PYTORCH_LIGHTNING_REPO = Path(os.environ.get("PL_REPO_PATH", str(REPO_ROOT / ".sandbox" / "pytorch-lightning")))
24+
PYTORCH_LIGHTNING_INDEXES = (
25+
tuple(sorted(PYTORCH_LIGHTNING_REPO.rglob(".cache/codemap/*.json"))) if PYTORCH_LIGHTNING_REPO.exists() else ()
26+
)
2027

2128

2229
def _load_module(module_name: str, filename: str):
@@ -98,18 +105,13 @@ def script_gen_real_issues():
98105
def scan_query_binary() -> Path:
99106
"""Path to scan-query binary; fails on POSIX when the tracked binary is absent.
100107
101-
Windows skips (the harness exercises the POSIX launcher only). On POSIX the
102-
binary is a tracked file, so a missing path means a broken checkout, not an
103-
unavailable dependency — fail loudly instead of yielding a false-green skip.
108+
The enclosing tests use a collection-time launchability marker. Once selected,
109+
a missing tracked binary means a broken checkout, so fail loudly rather than
110+
yielding a false-green skip.
104111
105112
Returns:
106113
Absolute path to the scan-query executable.
107114
"""
108-
if sys.platform == "win32":
109-
pytest.skip(
110-
"benchmark harness exercises the POSIX launcher only; "
111-
"codemap-py Windows coverage lives in plugins/codemap-py tests"
112-
)
113115
binary = REPO_ROOT / "plugins" / "codemap-py" / "bin" / "scan-query"
114116
if not binary.exists():
115117
pytest.fail(f"tracked scan-query binary missing at {binary} — broken checkout")
@@ -120,18 +122,13 @@ def scan_query_binary() -> Path:
120122
def scan_index_binary() -> Path:
121123
"""Path to scan-index binary; fails on POSIX when the tracked binary is absent.
122124
123-
Windows skips (the harness exercises the POSIX launcher only). On POSIX the
124-
binary is a tracked file, so a missing path means a broken checkout, not an
125-
unavailable dependency — fail loudly instead of yielding a false-green skip.
125+
The enclosing tests use a collection-time launchability marker. Once selected,
126+
a missing tracked binary means a broken checkout, so fail loudly rather than
127+
yielding a false-green skip.
126128
127129
Returns:
128130
Absolute path to the scan-index executable.
129131
"""
130-
if sys.platform == "win32":
131-
pytest.skip(
132-
"benchmark harness exercises the POSIX launcher only; "
133-
"codemap-py Windows coverage lives in plugins/codemap-py tests"
134-
)
135132
binary = REPO_ROOT / "plugins" / "codemap-py" / "bin" / "scan-index"
136133
if not binary.exists():
137134
pytest.fail(f"tracked scan-index binary missing at {binary} — broken checkout")
@@ -142,7 +139,7 @@ def scan_index_binary() -> Path:
142139
def sample_repo(tmp_path_factory: pytest.TempPathFactory, scan_index_binary: Path) -> tuple[Path, Path]:
143140
"""Clone psf/requests (shallow) and build a codemap index.
144141
145-
Skips if git clone fails (no network access).
142+
Fails if clone or indexing fails after collection.
146143
147144
Args:
148145
tmp_path_factory: pytest factory for session-scoped temp directories.
@@ -160,7 +157,7 @@ def sample_repo(tmp_path_factory: pytest.TempPathFactory, scan_index_binary: Pat
160157
timeout=120,
161158
)
162159
except (subprocess.CalledProcessError, subprocess.TimeoutExpired) as exc:
163-
pytest.skip(f"git clone failed (no network?): {exc}")
160+
pytest.fail(f"git clone failed (no network?): {exc}")
164161

165162
try:
166163
subprocess.run(
@@ -171,35 +168,32 @@ def sample_repo(tmp_path_factory: pytest.TempPathFactory, scan_index_binary: Pat
171168
cwd=str(clone_dir),
172169
)
173170
except subprocess.CalledProcessError as exc:
174-
pytest.skip(f"scan-index failed: {exc.stderr.decode()}")
171+
pytest.fail(f"scan-index failed: {exc.stderr.decode()}")
175172

176173
index_candidates = sorted(clone_dir.rglob(".cache/codemap/*.json"))
177174
if not index_candidates:
178-
pytest.skip("scan-index ran but produced no index file")
175+
pytest.fail("scan-index ran but produced no index file")
179176

180177
return clone_dir, index_candidates[0]
181178

182179

183180
@pytest.fixture(scope="session")
184181
def pytorch_lightning_repo() -> Path:
185-
"""Path to a pytorch-lightning checkout; skips if not found.
182+
"""Path to a decorator-validated pytorch-lightning checkout.
186183
187184
Checks ``PL_REPO_PATH`` env var first, then the pinned in-project clone
188185
``.sandbox/pytorch-lightning`` (created by ``run-all.sh``).
189186
190187
Returns:
191188
Absolute path to the pytorch-lightning repository root.
192189
"""
193-
default = Path(__file__).resolve().parents[2] / ".sandbox" / "pytorch-lightning"
194-
repo = Path(os.environ.get("PL_REPO_PATH", str(default)))
195-
if not repo.exists():
196-
pytest.skip(f"pytorch-lightning repo not found at {repo}; set PL_REPO_PATH env var")
197-
return repo
190+
assert PYTORCH_LIGHTNING_REPO.is_dir(), "pytorch-lightning test lacks checkout marker"
191+
return PYTORCH_LIGHTNING_REPO
198192

199193

200194
@pytest.fixture(scope="session")
201195
def pytorch_lightning_index(pytorch_lightning_repo: Path, scan_query_binary: Path) -> Path:
202-
"""Pre-built codemap index for pytorch-lightning; skips if not found.
196+
"""Decorator-validated pre-built Codemap index for pytorch-lightning.
203197
204198
The index is expected at ``.cache/codemap/<repo-name>.json`` inside the
205199
repo. Run ``scan-index --root <repo>`` once to create it.
@@ -212,9 +206,5 @@ def pytorch_lightning_index(pytorch_lightning_repo: Path, scan_query_binary: Pat
212206
Absolute path to the JSON index file.
213207
"""
214208
_ = scan_query_binary # ensure binary fixture resolved
215-
candidates = sorted(pytorch_lightning_repo.rglob(".cache/codemap/*.json"))
216-
if not candidates:
217-
pytest.skip(
218-
f"No codemap index found under {pytorch_lightning_repo}/.cache/codemap/; run: scan-index --root <repo>"
219-
)
220-
return candidates[0]
209+
assert PYTORCH_LIGHTNING_INDEXES, "pytorch-lightning index test lacks index marker"
210+
return PYTORCH_LIGHTNING_INDEXES[0]

0 commit comments

Comments
 (0)