truecourse 0.6.0-next.1 → 0.6.0-next.10

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 CHANGED
@@ -193,6 +193,8 @@ truecourse verify # Check code against the contracts → d
193
193
 
194
194
  Resolve conflicts and review drifts visually in the [dashboard](#dashboard-web-ui)'s BL Drift section, or drive every step from the CLI.
195
195
 
196
+ > Like `analyze`, the spec → contracts → verify track requires a **git repository** — TrueCourse's baselines are commit-anchored (committable `LATEST.json`, diff vs HEAD, stashing the committed state). On a non-git folder these commands stop with a clear message and the dashboard hides their actions.
197
+
196
198
  ## How it works
197
199
 
198
200
  Three stages run in order, each producing artifacts the next consumes:
@@ -254,17 +256,22 @@ truecourse spec docs uninclude <path>
254
256
 
255
257
  # Contract extraction (canonical spec → .tc artifacts)
256
258
  truecourse contracts generate # Extract / re-extract TC contract files
257
- truecourse contracts list # List generated contracts
259
+ truecourse contracts list # List artifacts (kind · identity · location)
260
+ truecourse contracts list --inferred / --authored # Only reverse-engineered (_inferred/) / only authored
258
261
  truecourse contracts validate # Parse + resolve TC files; report unresolved refs
259
262
 
260
263
  # Verification (code against contracts)
261
264
  truecourse verify # Full run: stashes dirty tree (prompts), writes verifier/runs + LATEST + history
262
265
  truecourse verify --diff # Git diff: working-tree drifts vs committed baseline (added/resolved/unchanged)
263
266
  truecourse verify --stash / --no-stash # Pre-approve / skip stashing on a full run
267
+ truecourse drifts list # List drifts from the latest verify (paginated; reads LATEST, no re-run)
268
+ truecourse drifts list --all # Show every drift (no pagination)
269
+ truecourse drifts list --offset 20 / --severity critical,high # Page through / filter by severity
264
270
 
265
271
  # Inference (code → inferred contracts) — reverse-engineer undocumented decisions
266
272
  truecourse infer # Write inferred .tc files to contracts/_inferred/
267
273
  truecourse infer --dry-run # Report what would be written, touch nothing
274
+ truecourse contracts list --inferred # Review what infer produced (kind · confidence · code location)
268
275
  ```
269
276
 
270
277
  ---
@@ -316,7 +323,31 @@ The first `truecourse analyze` (or `truecourse add`) in a fresh repo asks whethe
316
323
  ## Prerequisites
317
324
 
318
325
  - Node.js >= 20
319
- - [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.
326
+ - [Claude Code](https://docs.anthropic.com/en/docs/claude-code) CLI on your PATH — optional. The default `cli` transport spawns it for LLM-powered work; deterministic rules and the `agent` transport (below) don't need it.
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.
320
351
 
321
352
  ## Configuration
322
353
 
@@ -359,7 +390,7 @@ Patterns are anchored to the file's location, so `src/generated/` matches the to
359
390
 
360
391
  ## Telemetry
361
392
 
362
- TrueCourse collects anonymous usage data (event type, language, file count range, OS) to improve the product. No source code, file paths, or violation details are collected. It is automatically disabled in CI environments.
393
+ TrueCourse collects anonymous usage data to improve the product — one event per command (`analyze`, `spec_scan`, `contracts_generate`, `verify`, `infer`), each carrying only coarse, bucketed counts (file/artifact/drift/decision *ranges*, duration range), the surface (CLI vs dashboard), OS, and tool version. No source code, file paths, identities, or violation/drift details are collected. It is automatically disabled in CI environments.
363
394
 
364
395
  ```bash
365
396
  truecourse telemetry status # Check telemetry status