7 Commits

Author SHA1 Message Date
Julius Brussee 8fe0631dcc engine: unwrap agent <file> wrappers before content classification
In-flight work that was already in the working tree, committed alongside the
cross-platform review at the user's request. NOT reviewed as part of that
review — recorded separately so it stays attributable.

Generalizes unwrapListing into unwrapInput (engine/filewrap.go) so agent
<file> tags are stripped alongside read-tool line-number gutters before
Detect classifies content, and rewrapped afterwards. Carries matching
packages/cli changes and their runtime tests.

Verified before committing: `go test ./engine/` passes and the
packages/cli suite is 612 passed / 0 failed / 17 skipped.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ez7w7BBtKrMZCiZz9ea4cb
2026-08-20 04:14:48 +02:00
Julius Brussee 664268a4f8 test: force-exit runtime suites so no leaked handle can ever hang CI again
typescript hung a third time (2h+ where a completing run takes ~2min).
The telemetry-stub unref fixed one instance of the class, but ~55 runtime
files hold stub servers/processes, and ANY load-dependent failure that
skips its cleanup pins that file's event loop and node --test waits
forever. --test-force-exit (Node 22.5+) ends each test-file process once
its tests finish, leaked handles or not — a failure now fails, on every
file, permanently. Also gave the hand-rolled noisy-stdout stub the same
10s token-read budget as stubProxyStats (the remaining 400ms flake under
concurrency). Mixed batch at concurrency 4: 61 pass x3 consecutive runs.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ez7w7BBtKrMZCiZz9ea4cb
2026-08-19 10:27:07 +02:00
Julius Brussee aa749ecc59 test(cli): strip CI from the telemetry tests' isolated env
The interactive-disclosure tests build a real pty, but GitHub Actions
exports CI=1 and the CLI force-disables telemetry under CI regardless of
the tty — so the disclosure never printed and the last two typescript-job
failures fired only on CI. isolatedEnv now strips CI like it already strips
DO_NOT_TRACK; a test wanting CI semantics passes it explicitly. Suite is
16/16 with and without CI=1 in the parent env.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ez7w7BBtKrMZCiZz9ea4cb
2026-08-19 08:11:57 +02:00
Julius Brussee 916dab6f17 fix(cli-tests): stop telemetry stub leak from hanging the suite; un-flake the 400ms token budget under load
The 6-hour typescript-job silence was one leaked HTTP stub: a telemetry
test that fails an assertion never reaches stub.close(), the listener pins
that file's event loop, and node --test waits on the file forever. Both the
listener and hang-mode sockets are unref'd now, so a failure fails.

The assertion that failed on CI was real flake, not a bug: reading token
totals spawns caveman-proxy under a 400ms budget, which a loaded 2-core
runner blows on spawn alone. The budget is now env-overridable
(CAVEMAN_TELEMETRY_TOKEN_READ_TIMEOUT_MS) and the stub-backed tests pass
10s; the shipped default stays 400ms.

Repro batch (telemetry..windows-platform at concurrency 4): 52 pass, 0
fail, completes in normal time.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ez7w7BBtKrMZCiZz9ea4cb
2026-08-19 08:00:06 +02:00
Julius Brussee f71f6df015 feat(cli): persist shortcut, add token telemetry
Make `caveman <agent>` use the persistent native-enable path for hook-capable agents (with direct host launch), while safely falling back to session-only `wrap` when native constraints fail (`--off`/wrap flags, non-native agents, Cave Build lock, or enable errors). Add comprehensive runtime coverage for fallback, native idempotency, and signal forwarding.

Bump telemetry disclosure to v4 and extend `command_run` with proxy token volume deltas (`tokens_processed`, `tokens_saved`, `tokens_basis`) using a stored watermark to avoid replaying lifetime totals. Re-disclose once for stale opt-ins, preserve opt-outs, and clear the token watermark on `telemetry off`. Update README/SECURITY/CLAUDE docs to reflect new routing ownership and expanded telemetry scope.
2026-08-16 19:59:41 +02:00
Julius Brussee 1df938113c feat(cli): telemetry on as intended by default with opt-out and loud disclosure (#830)
* feat(cli): telemetry on by default with opt-out and loud disclosure

Flips the undecided-install default from off (opt-in) to on (opt-out).
The default is never silent and never sends blind:

- first interactive command persists the decision with a stable
  anonymous id and prints the one-line disclosure naming the scope
  (command counts only) and the off switch
- nothing sends while the decision is unpersisted: telemetrySendable
  keeps refusing source=default, so the first send always follows the
  disclosure run
- DO_NOT_TRACK, CAVEMAN_TELEMETRY=0, CI, and non-TTY still force off
  and never persist the default; a persisted opt-out from any prior
  version is honored forever
- telemetry suite rewritten for the opt-out contract (10/10)
- README and SECURITY updated to disclose the default honestly

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DLNTYJU8vMEdDWpV7e7k7Z

* chore: drop stray benchmark result from telemetry commit

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DLNTYJU8vMEdDWpV7e7k7Z

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-12 11:32:22 +02:00
Julius Brussee 82864c8f4c feat: ship Caveman 2.0.0 — engine, proxy, SDKs, unified CLI
Single-commit port of the Caveman 2 tree onto the original repo history
(candidate caveman-2@88878a4 applied over main@3098342). No unrelated-history
merge; original history untouched.

Preserved v1 surfaces:
- skills/caveman/SKILL.md byte-for-byte, plus plugin mirror and caveman.skill zip
- legacy CI (Node 18/20/22 installer + Python 3.11 suites) alongside engine-ci
- cli/install.js compatibility shim forwarding to bin/install.js
- .codex/config.toml ships both hooks and codex_hooks for older Codex (#617)
- README Trendshift + Skills.sh badges and local star-history asset
- v1.10.0-pinned curl installs; benchmarks/tmp-starcharts ignore rules

Fixed for public same-repo release:
- SECURITY.md vulnerability reporting points at this repository
- release-binaries.yml publishes to this repo via job-scoped GITHUB_TOKEN
  (cross-repo PAT removed); binary-release environment still gates signing
- packages/cli/PUBLISHING.md rewritten for packages/ layout and same-repo flow
- profile-contract and provider-catalog lanes skip lane-scope gates on
  initial import so the launch PR can gate on their real validation steps
- ANNOUNCEMENT.md network claim corrected: compression is local; requests
  still go to the provider you configured

Caveman 2 stays opt-in: bin-v1.0.0 binaries and @caveman-ai/cli publish
separately after this lands and soaks.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BLvb5QniwYjmcawyssQNw9
2026-08-11 16:46:10 +02:00