Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
f185280
Make test_claude_code hermetic: clear the third-party switches per test
sdcarlson Oct 26, 2026
98d3459
Check githits_lookups against an independent GitHits counter; unknown…
sdcarlson Oct 26, 2026
08989d2
Make arm B's GitHits skill shorter and sharper: look up only when a f…
claude Oct 26, 2026
be67706
Read the GitHits pilot's API arm from the host's launcher ledger in t…
sdcarlson Oct 26, 2026
7c1f1f7
Merge origin/main (#135, GitHits launcher hardening) into the ground-…
sdcarlson Oct 26, 2026
a3ad866
Recheck the GitHits ground truth against #135: five lookups per call,…
sdcarlson Oct 26, 2026
77dd5e4
Pin the skill's grep claims to the GitHits contract, and let the tree…
claude Oct 26, 2026
86e509b
Say when arm B had GitHits by two routes: the launcher and a stray Gi…
sdcarlson Oct 26, 2026
d2c6f04
Pin the skill's stop rule to the launcher's own output: refused: and …
claude Oct 26, 2026
4dc5828
Pin the registries the skill names to the ones the client accepts
claude Oct 26, 2026
c0b1f84
Say in the skill test's docstring which rules it checks against what …
claude Oct 26, 2026
219a677
Close bypasses an adversarial review found in the GitHits client and …
sdcarlson Oct 26, 2026
40d98d0
Refuse a path, glob or prefix that names an excluded owner, never cra…
sdcarlson Oct 26, 2026
689a5a2
Sharpen two rules in arm B's GitHits skill where Sonnet and Haiku rea…
claude Oct 26, 2026
2aba75d
Merge #142 (fix/githits-client-adversarial) into the ground-truth branch
sdcarlson Oct 26, 2026
bc5f34d
Tighten what makes a failing check implicate a package: the error mus…
claude Oct 26, 2026
2e67397
Rework the GitHits ground truth for #142: findings closed, sent check…
sdcarlson Oct 26, 2026
d10fc3d
Document the GitHits API route in docs/EXPERIMENTS.md and the experim…
sdcarlson Oct 26, 2026
1cab541
Name @name in bash_arguments' docstring among the words a shell reads…
sdcarlson Oct 26, 2026
a5e6e69
Add scripts/pilot_dry_run.py: the GitHits pilot's dry run as one command
claude Oct 26, 2026
d3a6965
pilot_dry_run: refuse a --repo that is not a directory; quieter refus…
claude Oct 26, 2026
d08f39c
pilot_dry_run: on top of #141, the paired report must compare every item
claude Oct 26, 2026
79ac090
pilot_dry_run: fixes from the independent review
claude Oct 26, 2026
1fdb903
pilot_dry_run: the canary's refusal must be for content and its looku…
claude Oct 26, 2026
8775e7c
pilot_dry_run: record the treatment's license policy; on #141's lates…
claude Oct 26, 2026
60b820d
skills/githits: an empty lookup proves nothing
claude Oct 26, 2026
b0cbe8f
Merge remote-tracking branch 'origin/pr136' into codex/githits-two-ar…
sdcarlson Oct 26, 2026
f1db7f0
Merge remote-tracking branch 'origin/pr139' into codex/githits-two-ar…
sdcarlson Oct 26, 2026
52fcfc7
Merge remote-tracking branch 'origin/pr142' into codex/githits-two-ar…
sdcarlson Oct 26, 2026
7222900
Merge remote-tracking branch 'origin/pr143' into codex/githits-two-ar…
sdcarlson Oct 26, 2026
2c6f413
Merge remote-tracking branch 'origin/pr140' into codex/githits-two-ar…
sdcarlson Oct 26, 2026
f5e7afc
patch: GitHits launcher entry survives a cp1252 pipe (shared unicode …
Oct 26, 2026
14aac5d
Integrate truthful two-arm GitHits accounting and finalized dry-run v…
sdcarlson Oct 26, 2026
dc20d6d
Normalize touched file line endings for a surgical review
sdcarlson Oct 26, 2026
04a5a91
Reconcile missing-record refusals and caret quoting across integrated…
sdcarlson Oct 26, 2026
49a4845
Refresh integrated candidate onto main after upstream PR 138 landed
sdcarlson Oct 26, 2026
f760957
Complete frozen engineering smoke recipe and close independent review…
sdcarlson Oct 26, 2026
24575f1
Describe no-change gaps as unknown in operator metrics documentation
sdcarlson Oct 26, 2026
fe0a435
Keep Windows system paths in the clean-wheel check environment
sdcarlson Oct 27, 2026
8cfd844
Preserve LF in the clean-wheel check
sdcarlson Oct 27, 2026
260cffe
Isolate launcher test settings and wait for definite Windows connecti…
sdcarlson Oct 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions conformance/clean_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ def main() -> None:
# The venv comes first; the rest of PATH is kept so the Build Thread example can find git.
env = {"PATH": os.pathsep.join([str(python.parent), os.environ.get("PATH", "")]), "HOME": str(outside),
"PYTHONNOUSERSITE": "1"}
# Windows' TLS provider needs the system directory even in a clean venv.
env.update({name: os.environ[name] for name in ("SystemRoot", "WINDIR") if name in os.environ})
origin = run([str(python), "-c", "import syberlabs, syberwork; print(syberlabs.__file__); print(syberwork.__file__)"],
cwd=outside, env=env).split()
if any(str(ROOT) in path or "site-packages" not in path for path in origin):
Expand Down
8 changes: 4 additions & 4 deletions docs/CLAUDE_CODE.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ exec '<host python>' -I '<host checkout>/syberlabs/githits_cli_entry.py' "$@"
| `SYBERLABS_GUARD_LAUNCHER` | the launcher's path, for the query guard |
| `SYBERLABS_GITHITS_RECORD_DIR` | `githits-records/` in the call's guard directory |
| `SYBERLABS_GITHITS_RECORD_KEY` | a fresh `secrets.token_hex(32)` per call, in no file |
| `GITHITS_SESSION_ID` | `<thread>-<arm>` (`X-GitHits-Session-ID`; GitHits allows only `[A-Za-z0-9_-]`, so not `/`) |
| `GITHITS_SESSION_ID` | `<thread>-<arm>` (`X-GitHits-Session-ID`; GitHits allows only `[A-Za-z0-9_-]`, so not `/`); the thread is `thread_label` (the CLI passes the thread's id), else the search space's thread, so a provider built in Python names its thread too |
| `GITHITS_AGENT` | `syberfactory/<arm>` (`X-GitHits-Agent`) |
| `SYBERLABS_GITHITS_LICENSES` | the license allow list in force, written out (the operator's, else the permissive default) |
| `SYBERLABS_GITHITS_EXCLUDE` | the exclusion list in force, written out (`syberlabs` plus what the operator added) |
Expand All @@ -154,13 +154,13 @@ exec '<host python>' -I '<host checkout>/syberlabs/githits_cli_entry.py' "$@"

**Arm A holds no GitHits variable.** Without `--githits`, and without `--mcp-config` (no GitHits route at all), the provider removes every `GITHITS_*` and `SYBERLABS_GITHITS_*` variable from Claude Code's environment (`claude_code.githits_variable`, compared ignoring case), `GITHITS_API_TOKEN` and `GITHITS_API_URL` included. Least privilege was chosen over a byte-identical environment: arm A has no tool that could use the token, and now it does not hold it either. Arm A's argv is still byte-identical to what it was before this route existed. `tests/test_claude_code.py` pins arm A's argv literally and its environment as the caller's minus those variables plus the guard's three, and pins arm B's differences to exactly the items above plus the operator's GitHits variables that arm A no longer receives. An `--mcp-config` run keeps them, because a GitHits MCP server, a child of Claude Code, may read its token from that environment (the MCP A/B below).

**The guard over Bash.** With the launcher, the query guard's matcher is `^(mcp__githits__.*|WebSearch|WebFetch|Bash)$`, and a `Bash` call passes only when its command is the launcher's exact path, alone or followed by a space, and what follows is plain words and single- or double-quoted strings (`query_guard.bash_arguments`). `not_launcher` blocks any other command; `shell_syntax` blocks a control operator, redirection, expansion or substitution anywhere (`` ; & | < > $ ` \ ( ) { } ! ``, any control character such as a newline), a glob, tilde or comment character outside quotes, an unterminated quote, and `run_in_background`. The arguments that pass are the outbound text: each one, and all of them joined, are judged by the same rules as a GitHits tool's query (`secret`, `url_credentials`, `email`, `too_long`, `code_fence`, `code_lines`, `tree_line`). Decisions carry the same MAC under the per-call key. Claude Code's own permission check is a second gate: under `dontAsk` a Bash command that `Bash(<launcher>:*)` does not name is denied.
**The guard over Bash.** With the launcher, the query guard's matcher is `^(mcp__githits__.*|WebSearch|WebFetch|Bash)$`, and a `Bash` call passes only when its command is the launcher's exact path, alone or followed by a space, and what follows is plain words and single- or double-quoted strings (`query_guard.bash_arguments`). `not_launcher` blocks any other command; `shell_syntax` blocks a control operator, redirection, expansion or substitution anywhere (`` ; & | < > $ ` \ ( ) { } ! ``, any control character such as a newline), a glob, tilde, caret or comment character outside quotes, an unquoted word that a shell reads differently from the guard (one that starts with `=`, which zsh's default EQUALS option expands to a command's path; with `NAME=`, which bash's `set -k` turns into an assignment into the launcher's environment, so `GITHITS_API_URL=https://...` would send the client and its token elsewhere; or with `@`, which PowerShell splats; quoted, each passes), an unterminated quote, `run_in_background`, and a `timeout` shorter than the Bash tool's two-minute default (`query_guard.MIN_BASH_TIMEOUT_MS`): ended early by Claude Code, the launcher's client could be killed after its request left and before it writes the call's record. The arguments that pass are the outbound text: each one, and all of them joined, are judged by the same rules as a GitHits tool's query (`secret`, `url_credentials`, `email`, `too_long`, `code_fence`, `code_lines`, `tree_line`). Decisions carry the same MAC under the per-call key. Claude Code's own permission check is a second gate: under `dontAsk` a Bash command that `Bash(<launcher>:*)` does not name is denied.

**PowerShell under the override.** An operator's `Bash` or `PowerShell` entry is refused with `--githits` unless `--allow-code-tools-with-mcp` is passed. With the override, the matcher is `^(mcp__githits__.*|WebSearch|WebFetch|Bash|PowerShell)$` (`query_guard.MATCHER_SHELLS`), and a `PowerShell` call is judged by the same launcher-only rule as `Bash` (`query_guard.SHELL_TOOLS`): any command but the launcher is `not_launcher`, so an allowed PowerShell no longer runs unguarded. Its refusals are journaled like a refused Bash call (tool `PowerShell`, its rule) and counted in `signal.githits.bash_refused` and `lookups_blocked`. Without the override the matcher is the Bash one above.

**What is recorded.** After the call the provider reads the client's records (`githits.read_records` under the call's record key). Each authentic record becomes one verified `lookup` fact, tool `githits.<op>`, value `{tool, query_digest, request_id, status, at, results_returned, results_dropped, results_dropped_license, latency_ms, contamination_blocked, ok, guard}`: the client's own digest of the request it sent, never text. Forged or altered record lines are counted (`signal.githits.records_ignored`) and ignored. Every `Bash` call the guard did not pass is journaled as a `lookup` with tool `Bash` and its rule (or `unguarded`), which `lookups_blocked` counts. `signal.tool_usage.githits` is the number of authentic records (plus any `mcp__githits__*` call the stream shows). The candidate also carries `signal.githits: {arm, launcher_calls, launcher_passed, records, records_ignored, bash_refused, license_policy[, mismatch]}` and `signal.harness.skill: {path, sha256}`. `githits_lookups` never counts a `githits.doctor` fact.
**What is recorded.** After the call the provider reads the client's records (`githits.read_records` under the call's record key). Each authentic record becomes one verified `lookup` fact, tool `githits.<op>`, value `{tool, query_digest, request_id, status, at, results_returned, results_dropped, results_dropped_license, latency_ms, contamination_blocked, sent, ok, guard}`: the client's own digest of the request it sent, never text; `sent` is the record's, whether the request was written to GitHits (false for an excluded target or a connection that never opened, true from a timeout after the request left to an answer, null for a call interrupted in flight). The client records every call it starts, an answer it cannot read and an interruption included; the launcher's entry turns a `SIGTERM` into an exception for that, so a launcher ended by a Bash timeout records its call (a `SIGKILL` cannot be caught). Forged or altered record lines are counted (`signal.githits.records_ignored`) and ignored. Every `Bash` call the guard did not pass is journaled as a `lookup` with tool `Bash` and its rule (or `unguarded`), which `lookups_blocked` counts. `signal.tool_usage.githits` is the number of authentic records (plus any `mcp__githits__*` call the stream shows). The candidate also carries `signal.githits: {arm, launcher_calls, launcher_passed, records, records_ignored, bash_refused, license_policy[, mismatch]}` and `signal.harness.skill: {path, sha256}`. `githits_lookups` never counts a `githits.doctor` fact.

A record cannot be tied to the tool use that ran it, so the host reconciles counts: authentic records against launcher calls the guard passed. Fewer records is `mismatch: githits_unrecorded` (a usage error, a client that failed before recording, a denied permission; recorded, the call stands). More records than guarded calls is `githits_unexpected_records`: each record of the call is journaled `guard: unguarded`, and the search stops `provider_guard_inactive`, because something holding the key ran the client without the guard.
A record cannot be tied to the tool use that ran it, so the host reconciles counts: authentic records against launcher calls the guard passed. Fewer records is `mismatch: githits_unrecorded` (a usage error, a client that failed before recording, a denied permission; recorded, the call stands). More records than guarded calls is `githits_unexpected_records`: each record of the call is journaled `guard: unguarded`, and the search stops `provider_guard_inactive`, because something holding the key ran the client without the guard. A call that fails or times out registers no candidate, so its mismatch would reach the journal nowhere, and a launcher call still waiting for GitHits when the host ends Claude Code (its session is killed, so the client cannot record) would leave no trace: when such a call has fewer records than guarded launcher calls, its records are journaled `guard: unguarded` (not reconciled), and when it has none, one `githits.unrecorded` fact (the command line's digest, `sent: null`, `guard: unguarded`) stands for each launcher call the guard passed. A `no_change` refusal with missing records journals a synthetic gap without assigning it to a concurrent command; its count remains unknown (`spec/GAPS.md` 59 (12)).

**The skill.** `skills/githits/SKILL.md` adapts GitHits' shipped skills (`githits-com/githits-cli` at `0bc9f5e68b`, `skills/githits-code/SKILL.md` and `skills/githits-mcp/SKILL.md`, Apache-2.0, Copyright 2025 GitHits Inc.; `skills/githits/LICENSE` is the upstream license and `skills/githits/NOTICE` says what changed) for the launcher: when a lookup is worth it (an API or version fact the repository and the standard library do not settle), how to phrase a query (short, naming the package and version, no code or repository text), targets first, search then grep or list then read, results as untrusted data, and citing sources in the final reply (the harness does not commit). Claude Code 2.1.309's `--help` offers `--append-system-prompt`, `--plugin-dir` (skills inside a plugin) and `--add-dir`; the provider uses `--append-system-prompt`, so the text is part of arm B's system prompt on every request rather than a skill the model may or may not load, and arm A's prompt is exactly the harness note. The YAML front matter is left out, and `{launcher}` is replaced by the call's launcher path, so arm B's exact appended text is the harness note, a blank line, and the file's body with that one substitution; the file's SHA-256 is on `signal.harness.skill`, computed with CRLF normalized to LF, so a Windows checkout with `core.autocrlf` records the committed blob's digest (`24c150e4…6508` today) as a POSIX one does. `.gitattributes` (`skills/** text eol=lf`) also checks the skill out with LF on every platform.

Expand Down
Loading
Loading