truecourse 0.7.0-next.9 → 0.7.1

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,8 +193,6 @@ TrueCourse builds a curated spec corpus from your docs, then **guards** it: an L
193
193
 
194
194
  > **Prerequisite:** the spec scan and guard generator shell out to the Claude Code CLI (`claude -p`). Install Claude Code and sign in once before running `spec scan` or `guard generate`. `guard run` needs neither — it's deterministic.
195
195
 
196
- > **Discontinued: contract generation & verify.** Guard replaces the earlier contracts pipeline (`contracts generate` / `contracts list` / `contracts validate`, `truecourse verify`, `truecourse drifts`, `truecourse infer`, and the dashboard's BL Drift section). Those commands still exist in this release but are **no longer maintained** and will be removed; the BL Drift section is already hidden from the dashboard. Use Guard instead: it verifies what the code *does* (by executing scenarios) rather than what it *says* (static contract matching), and its coverage isn't capped by a contract-kind taxonomy.
197
-
198
196
  ## Quick Start
199
197
 
200
198
  ```bash
@@ -215,7 +213,7 @@ Stages run in order, each producing committable artifacts the next consumes:
215
213
 
216
214
  **1. Spec consolidation** — Walks every `.md` file in the repo (PRDs, ADRs, RFCs, READMEs, design notes; `.truecourse/`, `node_modules/`, `.git/` etc. are skipped). An LLM relevance filter drops obvious non-spec material (task lists, research logs, AI agent prompts). For the docs that remain, an LLM tags each into **areas** (`product/concern`), auto-detects doc→doc **relations** (version chains, supersession), and flags within-area **overlaps** where two docs may disagree. Output: `.truecourse/specs/corpus.json` (the curated corpus every downstream stage consumes — kept docs + area tags, docs grouped by area, overlap flags, relations, and the relevance-dropped docs; committable) and `.truecourse/specs/decisions.json` (the user's resolutions: doc→doc `relations`, `manualAreas`, `manualIncludes`, and `manualExcludes` — committable).
217
215
 
218
- Only genuine within-area **disagreements** flag as overlaps — docs that agree never surface. Version chains (e.g. `v1`→`v2`) are auto-detected; you resolve the rest with doc→doc relations, in the dashboard's Guard → Coverage tab or via `spec conflicts` / `spec chains`. [Plan](docs/SPEC_SCAN_REDESIGN_PLAN.md).
216
+ Only genuine within-area **disagreements** flag as overlaps — docs that agree never surface. Version chains (e.g. `v1`→`v2`) are auto-detected; you resolve the rest with doc→doc relations, in the dashboard's Guard → Coverage tab or via `spec conflicts` / `spec chains`.
219
217
 
220
218
  **2. Guard generation** (`truecourse guard generate`) — Splits each kept doc into sections and, per section: **classifies** whether the section makes a claim a driver can assert (today's driver runs your project's CLI; a non-testable verdict carries a one-sentence reason and surfaces as a visible coverage gap), **authors** one or more declarative YAML scenarios from the section's claim plus the code, and **birth-validates** each one by running it immediately — a scenario that fails at birth is reported as a finding (the spec and the code already disagree) instead of being silently committed. Output, all committable: `.truecourse/scenarios/<area>/*.yaml` (the scenarios), `scenarios/recipe.json` (how to build/prepare the repo for a run), and `scenarios/manifest.json` (section ↔ scenario bindings + section fingerprints, so re-generates only touch changed sections).
221
219
 
@@ -301,14 +299,11 @@ truecourse spec docs unexclude <path> # Remove a force-exclude overr
301
299
  truecourse guard generate # Author scenarios from spec sections (classify → generate → birth-validate)
302
300
  truecourse guard run # Build via the recipe + run committed scenarios; exits non-zero on any drift (CI gate)
303
301
  truecourse guard run --scenario <id> # Run a single scenario
302
+ truecourse guard run --verbose # List every scenario result (one ✓ line per pass; default shows failures only)
304
303
  truecourse guard status # Compact summary: section coverage, last run, last generate (LLM-free, no re-run)
305
304
  truecourse guard drifts # List the latest run's non-pass scenarios, most severe first (paginated; --all / --offset / --json)
306
305
  ```
307
306
 
308
- ### Discontinued: contracts & verify
309
-
310
- The static contract pipeline that predates Guard still ships in this release but is **discontinued and unmaintained** — it will be removed in a future release. `truecourse contracts generate|list|validate` (corpus → `.tc` artifacts), `truecourse verify` / `truecourse drifts` (per-kind static comparators), and `truecourse infer` (reverse-engineered `.tc` from code) all keep working against the same spec corpus for now, but new work — including new artifact-kind coverage — happens only in Guard.
311
-
312
307
  ---
313
308
 
314
309
  # Dashboard (web UI)
@@ -327,8 +322,6 @@ truecourse dashboard uninstall # Remove the background service
327
322
  - **Code Analysis** — architecture graph, violations list, severity/category analytics, code hotspots, trend over time; toggle rules and silence noisy ones inline.
328
323
  - **Guard** — Coverage shows each spec doc's sections with their scenario coverage and walks you through resolving spec conflicts (pick / write custom / mark superseded / include skipped doc); Scenarios lists the committed scenario corpus with the recipe and last-generate summary; Runs shows each run's drifts with per-failure evidence.
329
324
 
330
- (The BL Drift section — the discontinued contracts/verify workflow — is hidden from the section switcher; existing deep links into it still render.)
331
-
332
325
  ---
333
326
 
334
327
  # Common
@@ -387,7 +380,7 @@ truecourse spec scan --llm-transport agent --io ./io
387
380
  truecourse guard generate --llm-transport agent --io ./io
388
381
  ```
389
382
 
390
- Accepted by: `analyze`, `spec scan`, `guard generate` (and the discontinued `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.
383
+ Accepted by: `analyze`, `spec scan`, `guard 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.
391
384
 
392
385
  ## Configuration
393
386
 
@@ -427,8 +420,6 @@ Each LLM-powered pipeline stage resolves its model independently, so you can run
427
420
  | guard scenario generate | `TRUECOURSE_MODEL_GUARD_GENERATE` | opus |
428
421
  | guard recipe derivation | `TRUECOURSE_MODEL_GUARD_RECIPE` | sonnet |
429
422
 
430
- (The discontinued contract pipeline's stages — `TRUECOURSE_MODEL_CONTRACT_ENUMERATE`, `TRUECOURSE_MODEL_CONTRACT_EXTRACT`, `TRUECOURSE_MODEL_CONTRACT_REPAIR` — still resolve the same way.)
431
-
432
423
  `TRUECOURSE_FALLBACK_MODEL` sets the `--fallback-model` used when the primary is overloaded. `TRUECOURSE_MAX_CONCURRENCY` caps concurrent LLM calls across every stage (default `min(cpus, 4)`). `TRUECOURSE_LLM_TIMEOUT_SCALE` multiplies every stage's per-call timeout by a float (default `1`); a slow model or proxy that trips the built-in ceilings can widen them all with one knob — e.g. `TRUECOURSE_LLM_TIMEOUT_SCALE=3` for a slow proxy. `TRUECOURSE_LLM_LOG` / `TRUECOURSE_LLM_DUMP` enable per-call logging.
433
424
 
434
425
  ### Excluding files from analysis
@@ -450,7 +441,7 @@ Patterns are anchored to the file's location, so `src/generated/` matches the to
450
441
 
451
442
  ## Telemetry
452
443
 
453
- 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.
444
+ TrueCourse collects anonymous usage data to improve the product — one event per command (`analyze`, `spec_scan`), each carrying only coarse, bucketed counts (file/finding *ranges*, duration range), the surface (CLI vs dashboard), OS, and tool version. No source code, file paths, identities, or violation details are collected. It is automatically disabled in CI environments.
454
445
 
455
446
  ```bash
456
447
  truecourse telemetry status # Check telemetry status
@@ -466,13 +457,16 @@ Or set `TRUECOURSE_TELEMETRY=0` to opt out.
466
457
  git clone https://github.com/truecourse-ai/truecourse.git
467
458
  cd truecourse
468
459
  pnpm install
460
+ pnpm build # Build all packages — required before the first `pnpm test` (tests resolve workspace packages from their dist/)
461
+ dotnet build -c Release tools/csharp-roslyn-host # One-time, needs the .NET 8 SDK — see note below
469
462
  pnpm dev # Start dashboard at http://localhost:3000 (server on :3001, Vite on :3000)
470
463
  pnpm test # Run tests
471
- pnpm build # Build all packages
472
464
  ```
473
465
 
474
466
  `pnpm dev` expects a `.truecourse/` folder at the repo root — created automatically on the first `truecourse analyze` against the repo (or simply `mkdir -p .truecourse`).
475
467
 
468
+ The full test suite requires the C# Roslyn host to be built (same requirement as [analyzing C#](#prerequisites)): the C# e2e test fails without it, and the Roslyn semantic-rule tests silently skip. CI builds it before running tests (`.github/workflows/test.yml`); do the same locally, once per checkout/worktree.
469
+
476
470
  ## Community
477
471
 
478
472
  Join the [TrueCourse Discord](https://discord.gg/TanxB63arz) to ask questions, share feedback, and follow what's shipping.