@erclx/canon 5.38.0 → 5.40.0
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 -5
- package/claude/.claude-plugin/plugin.json +1 -1
- package/claude/skills/api-design/SKILL.md +12 -9
- package/claude/skills/auto-ship/SKILL.md +43 -23
- package/claude/skills/backlog-triage/SKILL.md +62 -53
- package/claude/skills/backlog-triage/references/apply.md +69 -0
- package/claude/skills/build-in-slices/SKILL.md +8 -4
- package/claude/skills/canon-cli/SKILL.md +5 -1
- package/claude/skills/canon-feedback/SKILL.md +18 -8
- package/claude/skills/canon-feedback-triage/SKILL.md +10 -3
- package/claude/skills/canvas-board/SKILL.md +37 -18
- package/claude/skills/ci-workflow/SKILL.md +5 -4
- package/claude/skills/code-craft/SKILL.md +10 -6
- package/claude/skills/codebase-layout/SKILL.md +3 -5
- package/claude/skills/context-fold/REQUIREMENT.md +4 -4
- package/claude/skills/context-fold/SKILL.md +42 -23
- package/claude/skills/context-fold/references/context-refresh.md +4 -3
- package/claude/skills/context-fold/references/context.md +79 -64
- package/claude/skills/create-rule/SKILL.md +7 -3
- package/claude/skills/create-skill/SKILL.md +27 -7
- package/claude/skills/create-skill/references/skill-reference.md +41 -17
- package/claude/skills/decision-escalate/SKILL.md +8 -5
- package/claude/skills/deploy-app/SKILL.md +1 -1
- package/claude/skills/deprecation-migration/SKILL.md +12 -4
- package/claude/skills/design-taste/SKILL.md +17 -11
- package/claude/skills/docs-sync/REQUIREMENT.md +1 -0
- package/claude/skills/docs-sync/SKILL.md +17 -6
- package/claude/skills/docs-sync/references/docs.md +54 -21
- package/claude/skills/docs-sync/references/readme.md +32 -8
- package/claude/skills/document-health/SKILL.md +3 -4
- package/claude/skills/draft-and-pick/SKILL.md +73 -47
- package/claude/skills/draft-doc/SKILL.md +9 -4
- package/claude/skills/draft-doc/references/context.md +4 -4
- package/claude/skills/draft-doc/references/docs.md +1 -0
- package/claude/skills/draft-doc/references/wiki.md +3 -2
- package/claude/skills/draft-figure/SKILL.md +9 -7
- package/claude/skills/draft-identity/SKILL.md +24 -52
- package/claude/skills/draft-identity/references/card-route.md +46 -0
- package/claude/skills/draft-ready/SKILL.md +19 -7
- package/claude/skills/draft-screencast/SKILL.md +6 -112
- package/claude/skills/draft-screencast/references/beats-template.md +119 -0
- package/claude/skills/draft-slides/SKILL.md +9 -7
- package/claude/skills/draft-slides/references/deck.md +183 -0
- package/claude/skills/git-branch/SKILL.md +3 -3
- package/claude/skills/git-commit/SKILL.md +5 -3
- package/claude/skills/git-followup/SKILL.md +16 -9
- package/claude/skills/git-issue/SKILL.md +6 -5
- package/claude/skills/git-pr/SKILL.md +56 -44
- package/claude/skills/git-pr/references/evidence.md +2 -2
- package/claude/skills/git-pr/references/final-command.md +1 -1
- package/claude/skills/git-pr/references/labels.md +1 -1
- package/claude/skills/git-pr/references/publish.md +1 -1
- package/claude/skills/git-ship/SKILL.md +43 -34
- package/claude/skills/git-ship/references/ci-watch.md +31 -0
- package/claude/skills/git-split/SKILL.md +28 -100
- package/claude/skills/git-split/references/independent.md +40 -0
- package/claude/skills/git-split/references/stacked.md +73 -0
- package/claude/skills/git-stage/SKILL.md +9 -7
- package/claude/skills/git-worktree/SKILL.md +27 -49
- package/claude/skills/git-worktree/references/cleanup.md +55 -0
- package/claude/skills/markdown-craft/SKILL.md +2 -2
- package/claude/skills/markdown-craft/references/markdown.md +82 -53
- package/claude/skills/plan-feature/SKILL.md +52 -46
- package/claude/skills/plan-feature/references/batches.md +46 -0
- package/claude/skills/plan-groundwork/SKILL.md +60 -74
- package/claude/skills/plan-groundwork/references/output.md +48 -0
- package/claude/skills/plan-intake/SKILL.md +28 -21
- package/claude/skills/plan-intake-answer/SKILL.md +14 -13
- package/claude/skills/read-frames/SKILL.md +2 -0
- package/claude/skills/record-screencast/SKILL.md +31 -11
- package/claude/skills/review-address/SKILL.md +76 -158
- package/claude/skills/review-address/references/rebase-only.md +34 -0
- package/claude/skills/review-craft/SKILL.md +27 -11
- package/claude/skills/review-pr/SKILL.md +91 -40
- package/claude/skills/review-ui/SKILL.md +63 -37
- package/claude/skills/review-ui/references/hosted-preview.md +30 -0
- package/claude/skills/role-orchestrator/SKILL.md +105 -74
- package/claude/skills/role-orchestrator/references/orchestrator-filing.md +26 -0
- package/claude/skills/role-orchestrator/references/orchestrator-handback.md +1 -1
- package/claude/skills/role-planner/SKILL.md +66 -64
- package/claude/skills/role-reviewer/SKILL.md +57 -46
- package/claude/skills/role-worker/SKILL.md +68 -63
- package/claude/skills/search-craft/SKILL.md +7 -5
- package/claude/skills/session-compact/SKILL.md +16 -11
- package/claude/skills/session-map/SKILL.md +31 -10
- package/claude/skills/session-relay/SKILL.md +32 -65
- package/claude/skills/session-resume/SKILL.md +18 -13
- package/claude/skills/session-worktree/SKILL.md +70 -42
- package/claude/skills/systematic-debugging/SKILL.md +6 -1
- package/claude/skills/target-check/SKILL.md +13 -6
- package/claude/skills/target-setup/SKILL.md +39 -27
- package/claude/skills/task-board/SKILL.md +68 -60
- package/claude/skills/task-board/references/board.md +1 -1
- package/claude/skills/task-board/references/create-report.md +36 -0
- package/claude/skills/task-board/references/tasks.md +1 -1
- package/claude/skills/task-complete/SKILL.md +20 -18
- package/claude/skills/teach-workspace/SKILL.md +61 -33
- package/claude/skills/test-craft/SKILL.md +2 -1
- package/claude/skills/test-first/SKILL.md +15 -9
- package/claude/skills/ui-checklist/SKILL.md +18 -16
- package/claude/skills/ux-audit/SKILL.md +9 -10
- package/claude/skills/ux-measure/SKILL.md +23 -19
- package/claude/skills/video-craft/SKILL.md +15 -7
- package/claude/skills/write-human/SKILL.md +9 -1
- package/claude/skills/youtube-transcripts/SKILL.md +2 -1
- package/docs/agents/audits.md +61 -60
- package/docs/agents/context-audit.md +40 -58
- package/docs/agents/index.md +11 -61
- package/docs/agents/indexes.md +25 -29
- package/docs/agents/install-and-sync.md +125 -235
- package/docs/agents/markdown-audit.md +54 -96
- package/docs/agents/migrate.md +41 -16
- package/docs/agents/output-shape.md +60 -45
- package/docs/agents/overview.md +36 -12
- package/docs/agents/records.md +37 -79
- package/docs/agents/sessions-transfer.md +26 -70
- package/docs/agents/targets.md +25 -77
- package/docs/target/index.md +0 -1
- package/docs/target/migrations.md +57 -66
- package/docs/target/projects.md +36 -78
- package/docs/target/scenarios.md +9 -19
- package/docs/target/sync.md +27 -68
- package/docs/workflow/ai-workflow.md +22 -68
- package/docs/workflow/operating-model.md +32 -186
- package/docs/workflow/parallel-features.md +29 -66
- package/docs/workflow/skill-map-on-request.md +22 -24
- package/docs/workflow/skill-map.md +72 -76
- package/docs/workflow/visual-design-workflow.md +25 -118
- package/docs/workflow/zshrc-aliases.md +18 -37
- package/package.json +1 -1
- package/src/canvas/client/inspector/fields.css +4 -0
- package/src/canvas/index.html +6 -0
- package/src/claude/skills-reach.ts +2 -2
- package/src/cli/ui.ts +3 -1
- package/src/commands/canvas.ts +23 -0
- package/src/commands/capture.ts +14 -0
- package/src/commands/claude.ts +14 -1
- package/src/commands/context.ts +106 -7
- package/src/commands/demo.ts +22 -0
- package/src/commands/deps.ts +6 -0
- package/src/commands/driver.ts +28 -2
- package/src/commands/gov.ts +52 -18
- package/src/commands/hooks.ts +63 -0
- package/src/commands/intake.ts +17 -0
- package/src/commands/labels.ts +38 -5
- package/src/commands/markdown.ts +169 -32
- package/src/commands/pr.ts +160 -43
- package/src/commands/records.ts +8 -0
- package/src/commands/secrets.ts +6 -0
- package/src/commands/sessions.ts +8 -0
- package/src/commands/tasks.ts +52 -0
- package/src/commands/teach.ts +13 -0
- package/src/commands/upstream.ts +25 -1
- package/src/commands/worktrees.ts +5 -0
- package/src/context/audit.ts +274 -5
- package/src/context/classify/prompts.ts +1 -1
- package/src/context/folders.ts +1 -1
- package/src/context/gate.ts +23 -7
- package/src/context/shape-gated.ts +30 -0
- package/src/counts/scan.ts +1 -1
- package/src/design/components.ts +1 -1
- package/src/design/document.ts +1 -1
- package/src/design/tokens.ts +1 -1
- package/src/gate/boundaries.ts +4 -1
- package/src/gate/measures.ts +16 -191
- package/src/gate/stages.ts +14 -30
- package/src/git/env.ts +6 -0
- package/src/hooks/reply-links.ts +110 -0
- package/src/markdown/density.ts +258 -0
- package/src/markdown/gate.ts +57 -18
- package/src/markdown/reference-shape.ts +103 -0
- package/src/markdown/scope.ts +162 -0
- package/src/markdown/structure.ts +9 -59
- package/src/pr/lift.ts +153 -19
- package/src/pr/painted.ts +87 -0
- package/src/roots/record.ts +18 -1
- package/src/sandbox/census.ts +1 -1
- package/src/sandbox/headless/run.ts +3 -2
- package/src/sandbox/headless/watch.ts +3 -4
- package/src/shipped/references.ts +1 -1
- package/src/slides/convert/master.ts +3 -0
- package/src/sync/format.ts +46 -0
- package/src/sync/stamp.ts +6 -0
- package/tooling/astro/reference.md +2 -2
- package/tooling/base/reference.md +1 -1
- package/tooling/claude/seeds/.claude/hooks/reply-links.sh +72 -0
- package/tooling/claude/seeds/.claude/hooks/standards-audit.sh +22 -1
- package/tooling/claude/seeds/.claude/settings.json +4 -0
- package/tooling/go/reference.md +1 -1
- package/tooling/nextjs/reference.md +1 -1
- package/tooling/php/reference.md +1 -1
- package/tooling/python/reference.md +1 -1
- package/tooling/vite-react/reference.md +1 -1
- package/tooling/web/reference.md +1 -1
- package/docs/agents/canvas.md +0 -86
- package/docs/agents/capture.md +0 -65
- package/docs/agents/census.md +0 -23
- package/docs/agents/commands.md +0 -154
- package/docs/agents/comments.md +0 -34
- package/docs/agents/context-audit-checks.md +0 -90
- package/docs/agents/context-classify.md +0 -101
- package/docs/agents/counts.md +0 -74
- package/docs/agents/demo.md +0 -140
- package/docs/agents/docs.md +0 -27
- package/docs/agents/drift-surfaces.md +0 -201
- package/docs/agents/driver.md +0 -103
- package/docs/agents/gate.md +0 -90
- package/docs/agents/gov-detect.md +0 -47
- package/docs/agents/hooks.md +0 -58
- package/docs/agents/intake.md +0 -81
- package/docs/agents/key-changes.md +0 -116
- package/docs/agents/label-coverage.md +0 -86
- package/docs/agents/markdown-audit-weight.md +0 -81
- package/docs/agents/pr-evidence-layout.md +0 -70
- package/docs/agents/pr-evidence.md +0 -273
- package/docs/agents/pr-frames.md +0 -131
- package/docs/agents/pr-lift.md +0 -132
- package/docs/agents/pr-local.md +0 -111
- package/docs/agents/pr-preview.md +0 -155
- package/docs/agents/pr-reads.md +0 -111
- package/docs/agents/pr-tick.md +0 -72
- package/docs/agents/records-push.md +0 -61
- package/docs/agents/records-stale.md +0 -40
- package/docs/agents/records-validate.md +0 -57
- package/docs/agents/restated.md +0 -83
- package/docs/agents/routing.md +0 -61
- package/docs/agents/rule-citations.md +0 -90
- package/docs/agents/sandbox.md +0 -126
- package/docs/agents/scripting.md +0 -142
- package/docs/agents/sessions.md +0 -128
- package/docs/agents/skills-audit.md +0 -120
- package/docs/agents/skills-reach.md +0 -64
- package/docs/agents/slides.md +0 -176
- package/docs/agents/state-scoped-risk.md +0 -105
- package/docs/agents/superseded.md +0 -85
- package/docs/agents/tasks-archive.md +0 -83
- package/docs/agents/tasks-plans.md +0 -152
- package/docs/agents/tasks-validate.md +0 -133
- package/docs/agents/tasks.md +0 -123
- package/docs/agents/teach-authoring.md +0 -118
- package/docs/agents/teach.md +0 -157
- package/docs/agents/test-order.md +0 -58
- package/docs/agents/upstream.md +0 -94
- package/docs/agents/worktrees.md +0 -118
- package/docs/target/standards-moved.md +0 -34
- package/src/markdown/growth.ts +0 -43
package/docs/agents/audits.md
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Audits
|
|
3
|
-
description: Running every health check as one set,
|
|
3
|
+
description: Running every health check as one set, the verdict and exit codes, the corpus states, the retained baseline and its delta, and a catalog of every audit verb with whether a finding gates
|
|
4
|
+
kind: reference
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Audits
|
|
7
8
|
|
|
8
|
-
`canon audits run` runs every audit this repository owns, reports each
|
|
9
|
+
`canon audits run` runs every audit this repository owns, reports each under one verdict, and compares each count to the baseline the last recorded run left. Every number comes from a verb in the catalog below.
|
|
9
10
|
|
|
10
11
|
```bash
|
|
11
12
|
canon audits run
|
|
@@ -15,36 +16,11 @@ canon audits run --corpus tracked --corpus per-machine
|
|
|
15
16
|
canon audits list --json
|
|
16
17
|
```
|
|
17
18
|
|
|
18
|
-
|
|
19
|
-
| ----------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
20
|
-
| `--json` | Add a machine-readable record on stdout, keeping the frame |
|
|
21
|
-
| `--root <path>` | Measure this tree instead of the current worktree |
|
|
22
|
-
| `--record` | Write this run's tracked counts to `canon/config/baseline.json` |
|
|
23
|
-
| `--corpus <name>` | Limit the run to one corpus (`tracked`, `per-machine`, `upstream`), repeatable, defaulting to every corpus |
|
|
19
|
+
`--record` writes the tracked counts to `canon/config/baseline.json`. `--corpus` limits the run to `tracked`, `per-machine`, or `upstream` and repeats. `--root <path>` measures another tree. `canon audits list` prints the catalog the run reads.
|
|
24
20
|
|
|
25
|
-
##
|
|
21
|
+
## Output
|
|
26
22
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
The verbs walk separate trees and share no state, so they run together. Measured on the authoring machine at twelve verbs, a run finished in 0.8 seconds of wall clock against 4.4 seconds of processor, which is under every other stage in `bun run check`. `canon deps audit` is the one that changes that reading, since it reaches a network rather than a tree and its latency is the index's rather than this machine's: three clean runs measured 44.7, 77.6, and 62.9 seconds, and a stalled lookup runs to an explicit 120-second timeout rather than to bun's own 299-second ceiling. `--corpus` is what keeps a caller from paying that cost when it wants only the corpora on this disk.
|
|
30
|
-
|
|
31
|
-
Eighteen of the twenty-one read a tree on this disk, the one added by `restated.md` and the one added by `census.md` among them, since the first reads four such trees against each other and the second counts every file in one. The two added by `state-scoped-risk.md` read committed state rather than an arriving change, which is the gap every review surface here leaves by construction, and the one added by `label-coverage.md` reads a branch range against a map the project declares.
|
|
32
|
-
|
|
33
|
-
The placement entry runs `canon context classify sweep` pinned to `--backend off`, so it reads the regex layer alone whatever classifier setting the project resolves. A count that moves with whichever model a machine runs is not comparable across clones, and the model layer turned a sub-second read into one measured at about 17 minutes over this repository's context sections on the authoring machine. It retains one tally per verdict, `keep`, `rewrite`, and `move`, and gates on nothing, since each verdict is a judgment. `document-health` is the surface that reads the same sections with the model.
|
|
34
|
-
|
|
35
|
-
Each is invoked as the CLI the caller is running rather than as a global `canon`. A globally installed binary resolves to the main checkout no matter which worktree is executing, so the aggregate would measure a tree the branch never touched and report a pass over it.
|
|
36
|
-
|
|
37
|
-
## What gates and what reports
|
|
38
|
-
|
|
39
|
-
Five findings fail the run: an unresolved context citation, a banned character, a relative link resolving to nothing on disk, a skill folder carrying no `REQUIREMENT.md`, and a credential-shaped value in the tree the package ships. Each is a fact with no false-positive class behind it.
|
|
40
|
-
|
|
41
|
-
Four of the five are the ones `canon gate run` already fails a push on. The secret scan is the one entry gating without a stage behind it, added on that same fact-or-judgment test rather than as a side effect of registering a measure, and the toolkit already ranks content leaving the repository above content that stays.
|
|
42
|
-
|
|
43
|
-
Everything else reports. A heavy bullet, a long entry, a board row nothing resolves, a degradation term in a comment, and an implementation reaching history ahead of its test are judgments a reader settles. A push failing on one of those teaches contributors to route around the stage, which is the split recorded across every audit here and the one this command inherits rather than moves.
|
|
44
|
-
|
|
45
|
-
Growth against the baseline reports too. The standards behind the largest measures set no hard cap, so a count that rose is a fact about the corpus and a judgment about whether it matters.
|
|
46
|
-
|
|
47
|
-
## Exit codes
|
|
23
|
+
`summary.verdict` is `clean`, `reported`, `findings`, or `incomplete`. Every run also states how many corpora it measured against how many it skipped.
|
|
48
24
|
|
|
49
25
|
| Code | Meaning |
|
|
50
26
|
| ---- | -------------------------------------------------------------------- |
|
|
@@ -53,52 +29,77 @@ Growth against the baseline reports too. The standards behind the largest measur
|
|
|
53
29
|
| `2` | An audit carries a finding that is a fact |
|
|
54
30
|
| `3` | An audit did not report, so the run measured less than the whole set |
|
|
55
31
|
|
|
56
|
-
`3`
|
|
57
|
-
|
|
58
|
-
The verdict is published as a field as well as an exit code. A reader branching on `summary.verdict` gets `clean`, `reported`, `findings`, or `incomplete` without inferring the difference between a quiet corpus and one nobody finished measuring.
|
|
59
|
-
|
|
60
|
-
### An absent corpus is not an unmeasured one
|
|
61
|
-
|
|
62
|
-
A per-machine folder that is not on this disk reports as `absent` and moves neither the verdict nor the exit code. Every one of those folders is gitignored, so a fresh clone and every CI run carry none of them, and counting six expected absences as failures pins the verdict at `incomplete` forever. A signal that never changes is one nobody reads after the second time they see it.
|
|
63
|
-
|
|
64
|
-
Which refusals count as an absence is declared per audit rather than inferred from the corpus alone. A per-machine corpus counts a missing folder. An upstream corpus counts every reason the advisory verb publishes, since each of the three means there is nothing resolved to measure. Several tracked audits override that default too, wherever the corpus not being there is the ordinary state of a target rather than a broken checkout: the secret scan for a project that publishes nothing, the skill corpora, the citation reach check, and the routing measure for a project holding no skills tree, and the context audit for a project that adopted none of the folders it measures.
|
|
65
|
-
|
|
66
|
-
Everything else stays `unmeasured`. That covers a tree git cannot list, which is a broken checkout, and a package declaring no `files` field, where a publish would pack the whole tree and the scan read none of it. Both are a corpus that exists and went unread, so softening either would report a pass over a shipped tree nobody measured.
|
|
32
|
+
Code `3` marks a defect in the run rather than in the tree. An unparseable record, a verb that could not start, and an undocumented exit all land there.
|
|
67
33
|
|
|
68
|
-
|
|
34
|
+
Four findings gate, being an unresolved context citation, a banned character, a skill folder with no `REQUIREMENT.md`, and a credential-shaped value in the shipped tree. Everything else reports, and growth against the baseline reports too.
|
|
69
35
|
|
|
70
|
-
|
|
36
|
+
**Corpus states.**
|
|
71
37
|
|
|
72
|
-
|
|
38
|
+
An audit that finds no corpus reports `absent`, which moves neither the verdict nor the exit code. Anything unread that should exist is `unmeasured`, which sets `incomplete` and exit `3`.
|
|
73
39
|
|
|
74
|
-
|
|
40
|
+
- A per-machine folder missing from this disk is `absent`
|
|
41
|
+
- `upstream` is `absent` offline, and stays out of the baseline
|
|
42
|
+
- The secret scan reports `no-manifest`, `no-publish`, and `no-shipped-files` as `absent`, and `no-files-field` and `no-git` as `unmeasured`
|
|
43
|
+
- The skill audits, the citation reach check, and the routing measure report `absent` for a project with no skills tree
|
|
44
|
+
- The context audit reports `absent` for a project that adopted none of its folders, and a tree git cannot list is `unmeasured`
|
|
75
45
|
|
|
76
|
-
|
|
46
|
+
**Baseline.**
|
|
77
47
|
|
|
78
|
-
|
|
48
|
+
`canon/config/baseline.json` holds the counts from the last `--record`, with the day and the commit. It falls back to `.claude/canon/baseline.json` for a project that has not moved. Each run reports which counts moved and by how much.
|
|
79
49
|
|
|
80
|
-
|
|
50
|
+
- A run with no baseline says so rather than showing a delta of zero
|
|
51
|
+
- A key on one side only is named as new or gone
|
|
52
|
+
- A per-machine record and the task board are reported every run and never recorded
|
|
53
|
+
- An audit that did not report is left out, never written as zero
|
|
54
|
+
- A baseline that does not parse refuses the run
|
|
81
55
|
|
|
82
|
-
|
|
56
|
+
`gov test-order` reads zero in a shallow clone, so read its delta only from a clone carrying the history.
|
|
83
57
|
|
|
84
|
-
|
|
58
|
+
**In `bun run check`.**
|
|
85
59
|
|
|
86
|
-
|
|
60
|
+
`bun run check` runs `--corpus tracked --corpus per-machine` as a reporting stage after the gating stages, and never fails on it. `summary` is a flat object of unique scalar keys that a shell stage greps without a JSON parser. `deps` runs weekly instead.
|
|
87
61
|
|
|
88
|
-
|
|
62
|
+
The placement entry runs pinned to `--backend off`, so its tally stays comparable across machines. Each audit runs as the CLI the caller is running, never a global `canon`.
|
|
89
63
|
|
|
90
|
-
|
|
64
|
+
**Catalog.**
|
|
91
65
|
|
|
92
|
-
|
|
66
|
+
`canon audits list` reports the first 19 rows. The rows marked `outside` run by hand or from a skill and sit beside the aggregate.
|
|
93
67
|
|
|
94
|
-
|
|
68
|
+
| Id | Verb | Measures | Finding |
|
|
69
|
+
| -------------------- | ----------------------------------- | ---------------------------------------------------------------------------------- | -------------- |
|
|
70
|
+
| `context` | `canon context audit` | Context folder structure, citations, and the requirements record's word cap | Gates |
|
|
71
|
+
| `placement` | `canon context classify sweep` | Keep, rewrite, and move tally per context section, regex layer only | Reports |
|
|
72
|
+
| `markdown` | `canon markdown audit` | Bans, dead links, density, and reference shape | Gates |
|
|
73
|
+
| `skills` | `canon claude skills audit` | Both skill corpora against the skill standards | Gates |
|
|
74
|
+
| `skills-reach` | `canon claude skills reach` | Skill bodies citing a path no target receives | Reports |
|
|
75
|
+
| `skills-rank` | `canon claude skills rank` | Whether skill descriptions separate against a routing case corpus | Reports |
|
|
76
|
+
| `tasks` | `canon tasks validate` | Board rows nothing resolves | Reports |
|
|
77
|
+
| `records-plans` | `canon records validate plans` | Plan records against their shape | Reports |
|
|
78
|
+
| `records-groundwork` | `canon records validate groundwork` | Groundwork folders against their shape | Reports |
|
|
79
|
+
| `records-intake` | `canon records validate intake` | Intake folders against their shape | Reports |
|
|
80
|
+
| `records-teach` | `canon records validate teach` | Teach records against their shape | Reports |
|
|
81
|
+
| `comments` | `canon comments scan` | Comment density by language and kind, and `TODO`, `FIXME`, `HACK`, `XXX` | Reports |
|
|
82
|
+
| `test-order` | `canon gov test-order` | Implementations that reached branch history before their test | Reports |
|
|
83
|
+
| `secrets` | `canon secrets scan` | Credential-shaped values in the shipped tree | Gates |
|
|
84
|
+
| `labels` | `canon labels audit` | Changed paths no row of the label map reaches | Reports |
|
|
85
|
+
| `restated` | `canon gov restated` | Instructions `CLAUDE.md` states that a second surface states too | Reports |
|
|
86
|
+
| `counts` | `canon gov counts` | Sentences stating a closed catalog's size that disagree with the tree | Reports |
|
|
87
|
+
| `census` | `canon census` | File count, extension breakdown, and line total | Reports |
|
|
88
|
+
| `deps` | `canon deps audit` | Advisories against the resolved dependencies | Reports |
|
|
89
|
+
| `outside` | `canon gov citations` | Rule citations and internal frontmatter globs reaching nothing | Gates in check |
|
|
90
|
+
| `outside` | `canon gov superseded <old> <new>` | Where the tree still asserts a value a changed convention no longer produces | Reports |
|
|
91
|
+
| `outside` | `canon claude skills drift <ref>` | Shipped skill bodies rewritten since a ref | Reports |
|
|
92
|
+
| `outside` | `canon claude routing` | Per `CLAUDE.md` section, how many bullets name a path and whether a rule covers it | Reports |
|
|
93
|
+
| `outside` | `canon context classify diff` | Classification of the chunks a git range changed | Reports |
|
|
95
94
|
|
|
96
|
-
A
|
|
95
|
+
A deliberate secret takes a `canon-allow-secret: <reason>` marker. A deliberate citation takes `canon-allow-citation: <reason>` and a deliberate superseded value takes `canon-allow-superseded: <reason>`, each on its own line or the one above. Run any verb with `--help` for its flags and refusal reasons.
|
|
97
96
|
|
|
98
|
-
##
|
|
97
|
+
## Refusals
|
|
99
98
|
|
|
100
|
-
|
|
99
|
+
- A baseline that does not parse
|
|
100
|
+
- A `--root` that is not a tree git can list
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
## See also
|
|
103
103
|
|
|
104
|
-
|
|
104
|
+
- `markdown-audit.md`: the markdown audit
|
|
105
|
+
- `context-audit.md`: the context audit
|
|
@@ -1,87 +1,69 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Context audit
|
|
3
|
-
description: Running the audit, its
|
|
3
|
+
description: Running the context audit, its folder scope, the exit codes, every check with the folders it reaches and whether it gates, the seed gate, and the citation exclusions
|
|
4
|
+
kind: reference
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Context audit
|
|
7
8
|
|
|
8
|
-
`canon context audit [path]` reports the
|
|
9
|
-
|
|
10
|
-
Findings stated over every markdown file rather than over a context entry are measured by `canon markdown audit`, described in `markdown-audit.md`. That command resolves no folder, so it reaches trees this one refuses.
|
|
9
|
+
`canon context audit [path]` reports the structure of the folders following the index-plus-entry contract, meaning a generated `index.md` beside entries carrying frontmatter, and measures `canon/REQUIREMENTS.md` beside them. It reads and reports. Findings over every markdown file belong to `canon markdown audit`, in `markdown-audit.md`.
|
|
11
10
|
|
|
12
11
|
```bash
|
|
13
12
|
canon context audit
|
|
14
13
|
canon context audit --json
|
|
15
14
|
canon context audit --citations-only
|
|
16
15
|
canon context audit --folder context,diagrams
|
|
17
|
-
canon context audit --folder docs
|
|
18
16
|
canon context audit tooling/base/seeds --gate
|
|
19
17
|
```
|
|
20
18
|
|
|
21
|
-
|
|
22
|
-
| ------------------ | ------------------------------------------------------------------------- |
|
|
23
|
-
| `--json` | Add a machine-readable record on stdout, keeping the frame |
|
|
24
|
-
| `--folder <list>` | Comma-separated folder names (default: the three below) |
|
|
25
|
-
| `--citations-only` | Run the gating citation check alone, printing nothing when it passes |
|
|
26
|
-
| `--gate` | Fail on a missing required section, an off-set H2, or index drift as well |
|
|
27
|
-
|
|
28
|
-
`--citations-only` and `--gate` refuse together. The first runs the citation check alone, so the two findings the second adds are never measured, and a run honoring both would exit clean on a file short a required section.
|
|
29
|
-
|
|
30
|
-
## Folder scope
|
|
31
|
-
|
|
32
|
-
Scope defaults to `context`, `decisions`, and `diagrams`, and a folder the project does not carry is skipped rather than reported. A domain that outgrew one file and split into `<domain>/` is audited as its own folder, so a split entry measures at the same grain as a flat one.
|
|
33
|
-
|
|
34
|
-
A name passed to `--folder` resolves under the record roots first, `.canon/` ahead of `.claude/`, and at the project root last, which is what puts `docs/` and any later corpus in reach of the same engine. The root base is reached only by a name the caller passes, so the default list still resolves under a record root alone and a project holding a root folder of one of those names is not audited against a standard it never adopted. `diagrams` is the one default name that is a session record and moves with them, which is why both record roots are in the list rather than one, and `docs/agents/records.md` states the read order every verb shares. The scope line prints the resolved path, so a project carrying both spellings reads which one was taken. The JSON record carries the base per folder as `folders[].base`.
|
|
35
|
-
|
|
36
|
-
A run where no requested name resolves refuses, whichever list it read. Naming the absent ones narrows to `--folder`, since a project carrying one of the three default folders is the ordinary case and a name it never asked for is not a typo. The JSON record carries those names as `unresolvedFolders`.
|
|
37
|
-
|
|
38
|
-
## Exit codes
|
|
39
|
-
|
|
40
|
-
Exit codes are `0` for a clean run, `1` for a refusal, and `2` for a gating finding. An unresolved citation gates under every mode. A requirements record stating a word cap gates past it, on any run that measures it, which is every mode except `--citations-only`. A record stating none is reported and never gated.
|
|
41
|
-
|
|
42
|
-
`bun run check` in the toolkit repository reads every one of these rules through its own Canonical records stage as well as through this verb, whose gating stage there runs `--gate`.
|
|
19
|
+
`--gate` widens the failing set to the findings marked below. `--citations-only` runs the citation check alone, and the two refuse together.
|
|
43
20
|
|
|
44
|
-
|
|
21
|
+
`--folder` takes comma-separated names, defaulting to `context`, `decisions`, and `diagrams`. A folder the project lacks is skipped, and `folders[].base` names where each resolved.
|
|
45
22
|
|
|
46
|
-
|
|
23
|
+
## Output
|
|
47
24
|
|
|
48
|
-
|
|
25
|
+
| Check | Reports | Reaches | Finding |
|
|
26
|
+
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------- | ----------------------------------------------------------- |
|
|
27
|
+
| Citations | A path into an audited folder that resolves nowhere | Every audited folder | Gates always |
|
|
28
|
+
| Requirements record | Words past the cap the record states as `This record holds at most 600 words.` | `canon/REQUIREMENTS.md` | Gates past a stated cap, never under `--citations-only` |
|
|
29
|
+
| Required sections | An entry missing `Overview` or `Layout`. A split folder answers by any sibling | `canon/context/` | Gates under `--gate` |
|
|
30
|
+
| Closed set | An H2 outside `Overview`, `Layout`, and `Gotchas`, under `extraSections` | `canon/context/` | Gates under `--gate` |
|
|
31
|
+
| Shape | `retired-section`, `gotcha-count`, `gotcha-heading`, `gotcha-paragraph`, `layout-heading`, `layout-bullets`, `layout-paragraphs`, `layout-depth` | `canon/context/` | Gates under `--gate` in a `SHAPE_GATED_FOLDERS` folder only |
|
|
32
|
+
| Index drift | An entry its index does not link, or a link resolving to nothing | Every audited folder | Gates under `--gate` |
|
|
33
|
+
| Reference form | A backticked bare filename matching a sibling entry, under `bareReferences` | Split folders | Reports |
|
|
34
|
+
| Length | An entry past about 150 rendered lines at 80 columns, with its `causes` | Every audited folder | Reports |
|
|
35
|
+
| Tables | Six or more body rows whose first column mostly carries a path, command, or link | Every audited folder | Reports |
|
|
36
|
+
| Provenance | A date, change number, or release label. A date after measured, verified, driven, passed, or fired is excluded | `canon/context/` | Reports |
|
|
49
37
|
|
|
50
|
-
|
|
38
|
+
A shape break is any of these:
|
|
51
39
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
The stage prints the entries it measured per root and warns on a root that measured none. A root can resolve an audited folder and hold no entry in it, which `tooling/claude/seeds` does today, so a single pass line over the set would report coverage of a tree nothing opened.
|
|
57
|
-
|
|
58
|
-
It reads the exit code rather than pass against fail, since the two failing codes mean opposite things. A root carrying a `.claude/` that resolves no audited folder refuses at 1 and warns, while a seed short a required section gates at 2 and fails the push. A new stack seeding `.claude/` alone therefore reports what it is rather than a violation it does not have.
|
|
59
|
-
|
|
60
|
-
### Exempting a skeleton
|
|
61
|
-
|
|
62
|
-
A seed that deliberately omits a required section sets `stub: true` in its frontmatter, and the section check then skips it. Every other measure still reads the file, since a stub is exempt from owing sections rather than from being well formed.
|
|
63
|
-
|
|
64
|
-
```markdown
|
|
65
|
-
---
|
|
66
|
-
title: Architecture
|
|
67
|
-
stub: true
|
|
68
|
-
---
|
|
69
|
-
```
|
|
40
|
+
- A `## Decisions` H2, or a `Gotchas` section past five bullets or holding a heading or paragraph
|
|
41
|
+
- A `Layout` H3 titled neither a code-spanned path nor `Other folders`, or a heading below H3 under `Layout`
|
|
42
|
+
- A folder H3 past five bullets or its one-paragraph lead
|
|
70
43
|
|
|
71
|
-
|
|
44
|
+
The development entry may carry a `Scripts` H3 exempt from both folder caps. `SHAPE_GATED_FOLDERS` lives in `src/context/shape-gated.ts`.
|
|
72
45
|
|
|
73
|
-
|
|
46
|
+
| Code | Meaning |
|
|
47
|
+
| ---- | ------------------------------------------ |
|
|
48
|
+
| `0` | A clean run, or findings that report |
|
|
49
|
+
| `1` | Refused, with the reason on stderr |
|
|
50
|
+
| `2` | A gating finding for the mode the run took |
|
|
74
51
|
|
|
75
|
-
|
|
52
|
+
- `bun run check` runs `--gate` against every `tooling/<stack>/seeds/` directory carrying a `.claude/` folder
|
|
53
|
+
- A root resolving no audited folder refuses with `1` and warns, a root measuring no entry warns, and a seed short a section fails with `2`
|
|
54
|
+
- A seed omitting a required section on purpose sets `stub: true` in its frontmatter. Only the value `true` counts, and both install paths strip the field.
|
|
76
55
|
|
|
77
|
-
The citation check
|
|
56
|
+
The citation check skips fenced blocks, fixture and harness trees including `*.test.ts`, and a path into a folder the project lacks.
|
|
78
57
|
|
|
79
|
-
|
|
58
|
+
Append `<!-- audit-ignore-citations: <path> -->` to a line that displays a path without pointing at it. The marker excuses only the paths it names, and a bare `<!-- audit-ignore-citations -->` excuses every citation on the line. In seeds, plugin skill bodies, and stack references, which install into a target, reword the line instead.
|
|
80
59
|
|
|
81
|
-
|
|
60
|
+
## Refusals
|
|
82
61
|
|
|
83
|
-
|
|
62
|
+
- No requested `--folder` name resolves, with the names under `unresolvedFolders`
|
|
63
|
+
- `--citations-only` together with `--gate`
|
|
64
|
+
- `--citations-only` over folders that all resolved at the project root, which is out of scope
|
|
84
65
|
|
|
85
|
-
|
|
66
|
+
## See also
|
|
86
67
|
|
|
87
|
-
|
|
68
|
+
- `markdown-audit.md`: depth and bullet weight, which this audit no longer measures
|
|
69
|
+
- `audits.md`: the aggregate that runs this audit
|
package/docs/agents/index.md
CHANGED
|
@@ -8,64 +8,14 @@ category: Agent surface
|
|
|
8
8
|
|
|
9
9
|
CLI catalog and invocation rules for agents, split by command domain. Start with overview.
|
|
10
10
|
|
|
11
|
-
- [Audits](audits.md): Running every health check as one set,
|
|
12
|
-
- [
|
|
13
|
-
- [
|
|
14
|
-
- [
|
|
15
|
-
- [
|
|
16
|
-
- [
|
|
17
|
-
- [
|
|
18
|
-
- [
|
|
19
|
-
- [
|
|
20
|
-
- [
|
|
21
|
-
- [
|
|
22
|
-
- [Docs](docs.md): How canon docs resolves the toolkit's own reference surface from an install root, and how a split domain is named
|
|
23
|
-
- [Drift surfaces](drift-surfaces.md): The seven sections canon sync --check reports beside the per-domain scan, being seeds, superseded artifacts, unmigrated domains, surfaces at the old root, new rules and skills, and the reverse walk, with the managed-target gate and what counts toward the exit code
|
|
24
|
-
- [Driver](driver.md): Walking a page through named interactions, the probe catalog and the false finding each one carries, why viewport heights are never defaulted, and what each refusal reports
|
|
25
|
-
- [Merge gate](gate.md): Running the gate this repository verifies a branch with, what the stage table holds and what stays a script, how the changed set scopes three stages, and why a stage that cannot read its input reports rather than passing
|
|
26
|
-
- [Rule detection](gov-detect.md): Proposing opt-in governance rules from a target's dependencies and paths, the evidence file the verb reads, the record it emits, and its exit codes
|
|
27
|
-
- [Hooks](hooks.md): Running the post-merge steps through one verb, the order and the child call behind each, the root and working directory each step reads, the skip switches, and the line each record maps to
|
|
28
|
-
- [Indexes](indexes.md): Flags, exit codes, and JSON shape for canon indexes regen and canon indexes list, plus when regen auto-stages what it rewrote
|
|
29
|
-
- [Install and sync](install-and-sync.md): What each install and sync verb writes, refuses, or leaves alone, and how drift is attributed in a target project
|
|
30
|
-
- [Intake](intake.md): Reading intake folder counts and items, the three read states an item can be in, landing a batch of selections in one cluster, the refusal reasons, and why a call is scoped to one file
|
|
31
|
-
- [Key changes bijection](key-changes.md): Comparing the files a pull request body's Key changes names against its own diff, the two directions and the split inside each that decides what is worth raising, the span rules the extractor was measured into, and the three refusals that separate a clean pass from a read that produced nothing
|
|
32
|
-
- [Label coverage](label-coverage.md): Reading a changed set against the pull request label map, the two tables it matches, how a gap is separated from a decision, and why an absent map is an answer
|
|
33
|
-
- [Markdown audit weight](markdown-audit-weight.md): The structural half of the markdown audit, being bullet and paragraph weight, bullet stacks, run depth, the two cadence numbers, and the length ceiling, with the samples behind each checkpoint and why none of them gates
|
|
34
|
-
- [Markdown audit](markdown-audit.md): Running the audit over any markdown path, where its bans and checkpoints are read from, what each check reports, and why the ban half gates while the structural half reports
|
|
35
|
-
- [Migrate](migrate.md): What each canon migrate verb moves and rewrites, what it refuses, the markers that keep an old spelling, and the idempotence check a second run gives
|
|
36
|
-
- [Output shape](output-shape.md): Two framed shapes every command renders into, how JSON and --names modes keep stdout clean, and the exit discipline that lets piped output drain
|
|
37
|
-
- [Overview](overview.md): What this folder covers, the invocation rules every command inherits, and where domain behavior is documented instead
|
|
38
|
-
- [The pull request evidence layout](pr-evidence-layout.md): How canon pr evidence groups screenshots into one block per view with a row per width and a column per theme, when a base column appears, where a name outside the form lands, how the commit line links, and when the blocks open
|
|
39
|
-
- [The pull request evidence comparison](pr-evidence.md): What canon pr evidence compares, the marker that lets it edit its own comment rather than duplicate it, the refusal reasons it names, what the --check read reports as owed, and why the comparison anchors at the merge base rather than the previous push
|
|
40
|
-
- [The pull request frame store](pr-frames.md): How canon pr frames pushes a UI review frame to a never-merged branch through the GitHub API and returns a branch-path link, which ref it writes, the pass segment that keeps an earlier image fixed, the refusal reasons it names, and how --drop and --prune rewrite the branch so a dropped frame leaves history
|
|
41
|
-
- [The pull request draft lift](pr-lift.md): How canon pr lift removes the draft mark once the reviews, evidence, standing, and CI all read clear at the head, the gate order and what each reads, the wait on a pending run, the re-read before the write, the refusal reasons it names, and what --check reports
|
|
42
|
-
- [The pull request local preview](pr-local.md): How canon pr local finds the server a worktree is running, why a server in another worktree is never reported, the refusal reasons it names, and how a close workflow drops the address line with --remove
|
|
43
|
-
- [The pull request preview deploy](pr-preview.md): How canon pr preview finds a fenced Cloudflare Pages deploy, refuses a branch its push filter does not serve, dispatches it on a pull request's branch, reads the alias the run prints, the refusal reasons it names, and why an unfenced deploy is refused before anything runs
|
|
44
|
-
- [Head-sensitive pull request reads](pr-reads.md): Resolving a branch tip from the remote rather than from the pull request object, reading what a review pass covered off its own marker rather than off GitHub's submission stamps, why an empty run list is not a pass, the refusal reasons each verb names, and what the remote read costs
|
|
45
|
-
- [The pull request checklist tick](pr-tick.md): How canon pr tick marks the checklist boxes a UI pass drove, the stamp that names the commit each passed at, why a render at a newer head clears a tick, the refusal reasons it names, and why a taste box is never ticked
|
|
46
|
-
- [Records push](records-push.md): Backing the record folders to a private remote and restoring them, which folders the payload carries, the one-time setup, the refusal reasons, and the hook that runs the push
|
|
47
|
-
- [Records stale](records-stale.md): Counting the releases since the requirements record was last reviewed, where the review date is read from, and the exit codes and refusals
|
|
48
|
-
- [Records validate](records-validate.md): Validating the session records, the per-kind checks, which root they default to, the exit codes, and the refusal reasons
|
|
49
|
-
- [Records](records.md): The two roots a record folder resolves at, claiming the ordinal intake and groundwork share, reading each folder's size and growth, pruning stale scratch, and where validation, the canonical review count, and the private-remote backup are described
|
|
50
|
-
- [Restated instructions](restated.md): Counting the instructions the always-loaded file and every path-scoped rule share with the seed, the skill bodies, and each other, how a match is decided, the three classes, which surface a later edit starts from, and why the sweep reports rather than gates
|
|
51
|
-
- [Routing report](routing.md): Reading per CLAUDE.md section how many bullets name a path, what counts as naming one, when a rule counts as covering it, the two refusals, and why the verb reports rather than gates
|
|
52
|
-
- [Rule citations](rule-citations.md): Resolving every path a governance rule cites and every frontmatter glob the internal corpus declares, the one form a citation is written in, the shapes that look like citations and are not, the two classes where an absent path is correct, why the glob half reads one corpus, and why this one gates
|
|
53
|
-
- [Sandbox](sandbox.md): Scenario routing, the expectation scoring surface, and the coverage census over scenarios and skills
|
|
54
|
-
- [Scripting](scripting.md): The runtime catalogs that replace hardcoded names, what each carries, and a headless invocation per domain
|
|
55
|
-
- [Sessions transfer](sessions-transfer.md): Moving a session to another machine, the export bundle and its manifest, placing it with import, the refusal reasons, and what a resume on the target depends on
|
|
56
|
-
- [Sessions](sessions.md): Resolving live peer sessions to the worktree and branch each holds, reading which row is the caller, the liveness confidence field, what each session surface can see, and where moving a session to another machine is described
|
|
57
|
-
- [Skill audit](skills-audit.md): Measuring both skill corpora against the skill standards, the checks it reads, the requirement gate that is the only failing one, and the drift verb that names bodies rewritten since a ref
|
|
58
|
-
- [Citation reach](skills-reach.md): Reporting the skill bodies that cite a path no target project receives, which corpus the verb reads, the ownership key that decides what counts, the one-word qualifier that marks a citation as decided, and why the verb reports instead of gating
|
|
59
|
-
- [Slides](slides.md): Where a deck folder lives and what it holds, what it declares for the whole deck in deck.json, the faces it embeds, what each slide declares on its own body, transitions and entrances, the master built from the project's tokens, speaker notes, charts, and what each refusal reports
|
|
60
|
-
- [State-scoped risk](state-scoped-risk.md): Reading committed state rather than an arriving change, the shipped-tree corpus the secret scan reads, what it keys on and how a deliberate value is exempted, the advisory check and its network failure mode, and why one gates while the other reports
|
|
61
|
-
- [Superseded values](superseded.md): Reading where the tree still asserts a value a changed convention no longer produces, why the sweep keys on the value rather than the file, the family stem behind a templated citation, the exemption marker, the blind spots it cannot reach, and why it reports rather than gates
|
|
62
|
-
- [Targets](targets.md): The projects this toolkit installed into, the record the install writes against the sweep that backs it, what bounds each answer, and the cross-target pull request read
|
|
63
|
-
- [Tasks archive](tasks-archive.md): Archiving a shipped task by stem or pull request, declining one decided against, the refusal reasons each carries, and how the plan and ready folder move with the task
|
|
64
|
-
- [Tasks plans](tasks-plans.md): The five verbs that read or write a task's plan, being where it sits and who cites it, whether it waits on the operator, the branch it derives, what a branch reached against what it declared, and writing its Plan line
|
|
65
|
-
- [Tasks validate](tasks-validate.md): Validating the board against the tree, the seven checks, the five report arrays, the exit codes, and the refusal reasons
|
|
66
|
-
- [Tasks](tasks.md): Claiming the next phase label, recording a pull request number and closing an outcome, listing each task's readiness, and where archiving, the plan verbs, and board validation are described
|
|
67
|
-
- [Teach authoring](teach-authoring.md): Resolving what the next lesson needs before it is written, rendering a lesson body's blocks to HTML, and rewriting the root listing, a contents page, and each lesson's chrome and quiz stepper from its marker regions
|
|
68
|
-
- [Teach](teach.md): Listing learning workspaces with what their records schedule next, opening one with its required files, recording sources and glossary terms, viewing one with its chrome refreshed, where the lesson authoring verbs are described, the refusal reasons, and why every write here runs through a verb
|
|
69
|
-
- [Test order](test-order.md): Reading where an implementation reached history ahead of its test, how a pair is decided, the three verdicts, the coverage the pairing cannot reach, and why the check reports rather than gates
|
|
70
|
-
- [Upstream](upstream.md): The fetch, catalog, due, and advance verbs that read Claude Code releases against the toolkit, the cursor record, and each refusal reason
|
|
71
|
-
- [Worktrees](worktrees.md): Reporting which worktrees are reclaimable, removing the ones that are, the hidden verb that clears a stranded bare flag, the record a hook reads back, why the reading keys on the pull request rather than on git ancestry, the refusals it names, and the two removal shapes
|
|
11
|
+
- [Audits](audits.md): Running every health check as one set, the verdict and exit codes, the corpus states, the retained baseline and its delta, and a catalog of every audit verb with whether a finding gates
|
|
12
|
+
- [Context audit](context-audit.md): Running the context audit, its folder scope, the exit codes, every check with the folders it reaches and whether it gates, the seed gate, and the citation exclusions
|
|
13
|
+
- [Indexes](indexes.md): How canon indexes regen and canon indexes list resolve paths, what they stage, and the record and exit codes each emits
|
|
14
|
+
- [Install and sync](install-and-sync.md): What each install and sync verb writes, refuses, or leaves alone, the drift report and its seven side sections, the rule detection record, and version skew states
|
|
15
|
+
- [Markdown audit](markdown-audit.md): Running the markdown audit over any path, each finding it reports with whether it gates, the six density limits, the advisory measures, the exit codes, and where the audit runs
|
|
16
|
+
- [Migrate](migrate.md): What each canon migrate verb moves, the markers that keep an old spelling, and what each one refuses
|
|
17
|
+
- [Output shape](output-shape.md): The framed output shape every command renders into, the JSON and color modes, the exit discipline, the runtime catalogs, and a headless invocation per domain
|
|
18
|
+
- [Overview](overview.md): What this folder covers, the invocation rules every command inherits, and how canon docs resolves a topic name
|
|
19
|
+
- [Records](records.md): Backing the record folders to a private remote, restoring them on a new machine, reading folder size, and pruning stale scratch
|
|
20
|
+
- [Sessions transfer](sessions-transfer.md): Moving a session to another machine with export and import, the manifest fields, the refusal reasons, and what a resume on the target depends on
|
|
21
|
+
- [Targets](targets.md): The projects this toolkit installed into, where each answer comes from, and the cross-target pull request read
|
package/docs/agents/indexes.md
CHANGED
|
@@ -1,51 +1,47 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Indexes
|
|
3
|
-
description:
|
|
3
|
+
description: How canon indexes regen and canon indexes list resolve paths, what they stage, and the record and exit codes each emits
|
|
4
|
+
kind: reference
|
|
4
5
|
---
|
|
5
6
|
|
|
6
7
|
# Indexes
|
|
7
8
|
|
|
8
|
-
`canon indexes regen` rewrites `index.md` files from sibling frontmatter, so a hand edit to a generated index is lost
|
|
9
|
+
`canon indexes regen [paths…]` rewrites `index.md` files from sibling frontmatter, so a hand edit to a generated index is lost. `canon indexes list [path]` flattens each folder's `title` and `subtitle` plus each sibling's `title` and `description` into one catalog sorted by path.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
`regen` takes `--dry-run`, `--json`, `--root <path>` (default the current directory), and `--no-stage`. `list` takes `--json`.
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
- With no paths `regen` walks the current directory, pruning `.git`, `node_modules`, and anything git ignores
|
|
14
|
+
- With paths, each resolves by walking up to the nearest indexed ancestor, bounded by `--root`, without consulting git. That is how `.canon/tasks/` and `.canon/memory/` stay current.
|
|
15
|
+
- A `PostToolUse` hook on `Write|Edit|MultiEdit` drives it, so a shell `mv` fires nothing. Run it after the last move.
|
|
13
16
|
|
|
14
|
-
|
|
17
|
+
## Output
|
|
15
18
|
|
|
16
|
-
|
|
17
|
-
| --------------- | ---------------------------------------------------------------- |
|
|
18
|
-
| `--dry-run` | Report which indexes would change without writing |
|
|
19
|
-
| `--json` | Emit a machine-readable record per index on stdout |
|
|
20
|
-
| `--root <path>` | Walk-up boundary when positional paths are passed (default: CWD) |
|
|
21
|
-
| `--no-stage` | Skip the auto `git add` on modified indexes |
|
|
22
|
-
|
|
23
|
-
Exit codes: `0` clean, `1` frontmatter error or missing index, `2` drift found in `--dry-run`.
|
|
24
|
-
|
|
25
|
-
An exit code says nothing about a call made from a session, since a shell profile may wrap the binary in a function taking its status from a later command. Read the record's `results` array rather than the exit when a skill consumes this, on the write pass as well as the dry run.
|
|
26
|
-
|
|
27
|
-
When positional paths are passed inside a git repo, modified `index.md` files are staged so lint-staged and Claude `PostToolUse` hooks commit the regenerated catalog. Whole-repo walks never auto-stage, and neither does a path git ignores, since staging one always fails and the warning would fire on every edit.
|
|
28
|
-
|
|
29
|
-
Skills can parse drift without branching on exit code:
|
|
19
|
+
`regen --json` emits a record per index in `results`, each with an `action`. A dry run reports drift as `would-write`.
|
|
30
20
|
|
|
31
21
|
```bash
|
|
32
22
|
canon indexes regen --dry-run --json | jq '.results[] | select(.action == "would-write")'
|
|
33
23
|
```
|
|
34
24
|
|
|
35
|
-
|
|
25
|
+
With paths inside a git repo, modified indexes are staged. A whole-repo walk and a git-ignored path never stage.
|
|
36
26
|
|
|
37
|
-
`
|
|
27
|
+
`list --json` emits `{ root, entries, errors }`.
|
|
38
28
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
- Each entry is `{ path, title, description }`, and an `index.md` row takes its `subtitle` as `description`
|
|
30
|
+
- A folder failing validation lands in `errors`, drops out of `entries`, and prints one `ERROR:` line on stderr
|
|
31
|
+
- Git-ignored folders never appear, so `.canon/tasks/` and `.canon/memory/` are absent
|
|
42
32
|
|
|
43
|
-
|
|
33
|
+
## Refusals
|
|
44
34
|
|
|
45
|
-
|
|
35
|
+
Read the record's `results` rather than the exit, on a write pass as well as a dry run.
|
|
46
36
|
|
|
47
|
-
|
|
37
|
+
| Verb | Exit | Means |
|
|
38
|
+
| ------- | ---- | ---------------------------------------------------------- |
|
|
39
|
+
| `regen` | 0 | Clean |
|
|
40
|
+
| `regen` | 1 | A frontmatter error or a missing index |
|
|
41
|
+
| `regen` | 2 | Drift found under `--dry-run` |
|
|
42
|
+
| `list` | 0 | No errors |
|
|
43
|
+
| `list` | 1 | The root is not a directory, or a folder failed validation |
|
|
48
44
|
|
|
49
|
-
|
|
45
|
+
## See also
|
|
50
46
|
|
|
51
|
-
|
|
47
|
+
- `canon docs context-model`: the frontmatter contract and when to adopt indexes
|