truecourse 0.5.6 → 0.5.8-windows.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
@@ -52,11 +52,39 @@ No setup step. TrueCourse creates `.truecourse/` in your repo on first analyze a
52
52
 
53
53
  TrueCourse uses the [Claude Code CLI](https://docs.anthropic.com/en/docs/claude-code) for LLM-powered rules. If `claude` isn't on your PATH, deterministic rules still run and LLM rules are skipped.
54
54
 
55
+ ## Setup
56
+
57
+ The first `truecourse analyze` creates `.truecourse/` in your repo. Three files inside it are committable and travel with the repo:
58
+
59
+ | File | Purpose |
60
+ |---|---|
61
+ | `LATEST.json` | Most recent analysis snapshot. Doubles as the baseline for `truecourse analyze --diff` and the pre-commit hook. |
62
+ | `config.json` | Per-repo rule categories and LLM toggles. |
63
+ | `hooks.yaml` | Pre-commit hook policy (created by `truecourse hooks install`). |
64
+
65
+ Everything else (`analyses/`, `diff.json`, `history.json`, `ui-state.json`, `logs/`, `.analyze.lock`) is local-only and added to `.truecourse/.gitignore` automatically.
66
+
67
+ **First time, on `main`:**
68
+
69
+ ```bash
70
+ truecourse analyze
71
+ git add .truecourse/LATEST.json .truecourse/config.json
72
+ git commit -m "add truecourse baseline"
73
+ ```
74
+
75
+ **Refreshing the baseline:** re-run `truecourse analyze` after merging to `main` and commit the updated `LATEST.json`. **Don't commit `LATEST.json` from feature branches** — two PRs both updating it will conflict on a large generated JSON.
76
+
77
+ ### Worktrees and fresh clones
78
+
79
+ `LATEST.json` is tracked, so `git worktree add ../feat-x` and fresh clones inherit the baseline through git. `truecourse analyze --diff` and the pre-commit hook both work on the first commit in a new worktree — no per-checkout cold-start. Inside a worktree, run `truecourse analyze --diff` to see what your in-flight changes introduce relative to `main`'s committed baseline; the diff result lands in `.truecourse/diff.json` (gitignored, per-checkout).
80
+
55
81
  ## CLI Commands
56
82
 
57
83
  ```bash
58
84
  # Analysis
59
- truecourse analyze # Analyze current repo
85
+ truecourse analyze # Analyze current repo (prompts before stashing dirty trees)
86
+ truecourse analyze --stash # Pre-approve stashing pending changes (CI-friendly)
87
+ truecourse analyze --no-stash # Analyze working tree as-is, no stash
60
88
  truecourse analyze --diff # New/resolved violations from your uncommitted changes
61
89
  truecourse list # Show violations from latest analysis
62
90
  truecourse list --all # Show all violations (no pagination)
@@ -100,7 +128,7 @@ truecourse hooks status # Show hook status + config
100
128
 
101
129
  On every commit the hook runs `truecourse analyze --diff` against the repo's last full analysis and blocks if any newly-introduced violation matches the configured block severities. **Commits will take as long as a full diff analysis** — on large repos that can be tens of seconds per commit. `truecourse hooks install` warns you and requires confirmation before writing the hook.
102
130
 
103
- **First-time setup:** run `truecourse analyze` once to establish a baseline. Without it the hook can't diff.
131
+ The hook diffs against `.truecourse/LATEST.json`, so you need a committed baseline first — see [Setup](#setup). Without it the hook has nothing to diff against.
104
132
 
105
133
  **Bypass:** `git commit --no-verify` (standard git).
106
134
 
@@ -192,6 +220,23 @@ For a one-off override, prefix the command:
192
220
  CLAUDE_CODE_MAX_CONCURRENCY=2 truecourse analyze
193
221
  ```
194
222
 
223
+ ### Excluding files from analysis
224
+
225
+ TrueCourse honors `.gitignore` automatically (including nested `.gitignore` files, `.git/info/exclude`, and your configured global excludes file).
226
+
227
+ For paths you want tracked in git but not analyzed — generated code, vendored snapshots, large fixtures — add a `.truecourseignore` at the repo root. Same syntax as `.gitignore`:
228
+
229
+ ```
230
+ # generated
231
+ src/generated/
232
+ # vendored
233
+ third_party/
234
+ # specific files
235
+ scripts/ingest-epub.js
236
+ ```
237
+
238
+ Patterns are anchored to the file's location, so `src/generated/` matches the top-level directory only; use `**/generated/` to match at any depth.
239
+
195
240
  ## Development
196
241
 
197
242
  ```bash