truecourse 0.6.0-next.10 → 0.6.0-next.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -26
- package/cli.mjs +1657 -1272
- package/package.json +1 -1
- package/server.mjs +3085 -2794
package/README.md
CHANGED
|
@@ -323,31 +323,7 @@ The first `truecourse analyze` (or `truecourse add`) in a fresh repo asks whethe
|
|
|
323
323
|
## Prerequisites
|
|
324
324
|
|
|
325
325
|
- Node.js >= 20
|
|
326
|
-
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) CLI on your PATH
|
|
327
|
-
|
|
328
|
-
## LLM transport (`--llm-transport`)
|
|
329
|
-
|
|
330
|
-
Every LLM-powered step — `analyze`'s LLM rules, and the whole Spec → Verify pipeline (`spec scan`, `spec resolve`, `contracts generate`) — reaches the model through a pluggable **transport**, chosen with `--llm-transport`:
|
|
331
|
-
|
|
332
|
-
| Mode | How it reaches the model | Needs |
|
|
333
|
-
|---|---|---|
|
|
334
|
-
| **`cli`** *(default)* | spawns `claude -p …` per call | the `claude` binary on PATH, signed in. No API key. |
|
|
335
|
-
| **`agent`** | a **filesystem mailbox** under `--io <dir>` | nothing — no `claude` binary, no API key |
|
|
336
|
-
|
|
337
|
-
In **`agent`** mode the tool doesn't call the model itself: for each prompt it writes `requests/<id>.json` (`{ stage, system, user, schema, … }`) into the `--io` directory and waits for a matching `responses/<id>.json` (`{ text }`). An **orchestrating agent that is itself an LLM** — e.g. a [Claude Code routine](https://code.claude.com/docs/en/routines) — watches that directory and answers each prompt. This lets contract generation and `analyze`'s LLM rules run **inside a headless cloud session with no `claude` binary and no API key**.
|
|
338
|
-
|
|
339
|
-
```bash
|
|
340
|
-
# default: spawn the claude CLI
|
|
341
|
-
truecourse analyze --llm
|
|
342
|
-
truecourse contracts generate
|
|
343
|
-
|
|
344
|
-
# agent transport: the tool parks prompts in ./io and an external agent answers them
|
|
345
|
-
truecourse analyze --llm --llm-transport agent --io ./io
|
|
346
|
-
truecourse spec scan --llm-transport agent --io ./io
|
|
347
|
-
truecourse contracts generate --llm-transport agent --io ./io
|
|
348
|
-
```
|
|
349
|
-
|
|
350
|
-
Accepted by: `analyze`, `spec scan`, `spec resolve`, `contracts generate`. (On `analyze`, `--llm` / `--no-llm` is a *separate* flag — it decides **whether** LLM rules run; `--llm-transport` decides **how** to reach the model.) Both modes send identical prompts and parse identical schema-validated JSON — only the delivery differs.
|
|
326
|
+
- [Claude Code](https://docs.anthropic.com/en/docs/claude-code) CLI on your PATH. Deterministic rules run without it; LLM-powered rules and the Spec → Verify pipeline need it.
|
|
351
327
|
|
|
352
328
|
## Configuration
|
|
353
329
|
|
|
@@ -356,13 +332,16 @@ TrueCourse talks to Claude Code via the `claude` CLI. You can tune how that inte
|
|
|
356
332
|
For packaged installs (`npx truecourse` or `npm install -g truecourse`), the simplest place to set them is `~/.truecourse/.env`. The file is loaded automatically on every invocation:
|
|
357
333
|
|
|
358
334
|
```
|
|
359
|
-
CLAUDE_CODE_BINARY=claude # override the `claude` binary on PATH
|
|
335
|
+
CLAUDE_CODE_BINARY=claude # override the `claude` binary on PATH (CLAUDE_CODE_BIN also accepted)
|
|
360
336
|
CLAUDE_CODE_MODEL= # Claude Code --model flag (empty = default)
|
|
361
337
|
CLAUDE_CODE_TIMEOUT_MS=120000 # per-call timeout (ms)
|
|
362
338
|
CLAUDE_CODE_MAX_RETRIES=2 # retry attempts on parse/validation failure
|
|
363
339
|
CLAUDE_CODE_MAX_CONCURRENCY=10 # max concurrent `claude` processes per run
|
|
340
|
+
TRUECOURSE_SKIP_CLAUDE_CHECK= # set to 1 to skip the up-front `claude` login preflight
|
|
364
341
|
```
|
|
365
342
|
|
|
343
|
+
Every command that uses Claude (`analyze` with LLM rules, `spec scan`, `spec resolve`, `contracts generate`) runs a quick up-front preflight: it makes one tiny `claude` call to confirm the CLI is installed and logged in, and aborts with the CLI's own error message if not — so an expired login is caught immediately instead of failing every extraction subprocess at the end of a long run. Set `TRUECOURSE_SKIP_CLAUDE_CHECK=1` to skip it (e.g. on CI where auth is known good). `CLAUDE_CODE_BINARY` is the canonical way to point at a non-default binary; `CLAUDE_CODE_BIN` is honored as a legacy alias.
|
|
344
|
+
|
|
366
345
|
**`CLAUDE_CODE_MAX_CONCURRENCY`** caps how many Claude CLI processes TrueCourse spawns in parallel during a single run. Default `10`. Raise it on CI runners with spare headroom; lower it on resource-constrained machines (e.g. 8 GB laptops, shared VMs) to avoid OOM on large repos. Must be a positive integer.
|
|
367
346
|
|
|
368
347
|
For a one-off override, prefix the command:
|