@erclx/canon 5.33.0 → 5.35.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 +3 -5
- package/claude/.claude-plugin/plugin.json +1 -1
- package/claude/skills/api-design/REQUIREMENT.md +2 -3
- package/claude/skills/api-design/SKILL.md +2 -3
- package/claude/skills/api-design/references/adopted.md +1 -1
- package/claude/skills/auto-ship/references/draft-mark.md +1 -1
- package/claude/skills/canon-cli/SKILL.md +10 -11
- package/claude/skills/canon-feedback/REQUIREMENT.md +1 -0
- package/claude/skills/canon-feedback/SKILL.md +10 -28
- package/claude/skills/canon-feedback/references/template.md +53 -0
- package/claude/skills/canvas-board/SKILL.md +4 -1
- package/claude/skills/canvas-board/references/canvas.md +26 -3
- package/claude/skills/code-craft/REQUIREMENT.md +1 -1
- package/claude/skills/code-craft/SKILL.md +0 -1
- package/claude/skills/create-rule/SKILL.md +1 -1
- package/claude/skills/create-rule/references/rule.md +3 -1
- package/claude/skills/create-skill/SKILL.md +2 -1
- package/claude/skills/create-skill/references/skill-paths.md +12 -15
- package/{standards/standard.md → claude/skills/create-skill/references/skill-reference.md} +50 -45
- package/claude/skills/create-skill/references/skill.md +10 -4
- package/claude/skills/draft-and-pick/SKILL.md +1 -1
- package/claude/skills/git-commit/references/versioning.md +13 -13
- package/claude/skills/git-issue/references/issue.md +4 -1
- package/claude/skills/git-pr/SKILL.md +1 -1
- package/claude/skills/git-pr/references/publish.md +1 -1
- package/claude/skills/review-address/REQUIREMENT.md +1 -1
- package/claude/skills/review-address/SKILL.md +2 -2
- package/claude/skills/review-craft/references/ui.md +1 -1
- package/claude/skills/review-pr/SKILL.md +3 -3
- package/claude/skills/review-pr/references/post.md +1 -1
- package/claude/skills/review-ui/REQUIREMENT.md +1 -1
- package/claude/skills/review-ui/SKILL.md +8 -6
- package/claude/skills/review-ui/references/driving.md +8 -8
- package/claude/skills/review-ui/references/post.md +52 -16
- package/claude/skills/role-orchestrator/REQUIREMENT.md +2 -2
- package/claude/skills/role-orchestrator/SKILL.md +11 -12
- package/claude/skills/role-orchestrator/references/orchestrator-cloud-launch.md +3 -1
- package/claude/skills/role-orchestrator/references/orchestrator-dispatch.md +11 -8
- package/claude/skills/role-orchestrator/references/orchestrator-handback.md +10 -4
- package/claude/skills/role-orchestrator/references/orchestrator-launch.md +11 -2
- package/claude/skills/role-orchestrator/references/orchestrator-poll.md +11 -12
- package/claude/skills/role-orchestrator/references/orchestrator-review-dispatch.md +12 -15
- package/claude/skills/role-orchestrator/references/orchestrator-reviewer-launch.md +6 -4
- package/claude/skills/role-orchestrator/scripts/poll.ts +50 -1
- package/claude/skills/role-reviewer/REQUIREMENT.md +17 -7
- package/claude/skills/role-reviewer/SKILL.md +17 -10
- package/claude/skills/role-worker/REQUIREMENT.md +1 -1
- package/claude/skills/role-worker/SKILL.md +6 -6
- package/claude/skills/session-compact/references/handoff-note.md +1 -1
- package/claude/skills/target-setup/SKILL.md +12 -6
- package/claude/skills/target-setup/references/detect.md +22 -5
- package/claude/skills/test-craft/REQUIREMENT.md +2 -3
- package/claude/skills/test-craft/SKILL.md +15 -3
- package/docs/agents/audits.md +1 -1
- package/docs/agents/canvas.md +5 -1
- package/docs/agents/commands.md +3 -5
- package/docs/agents/counts.md +5 -6
- package/docs/agents/drift-surfaces.md +15 -19
- package/docs/agents/gov-detect.md +47 -0
- package/docs/agents/index.md +6 -4
- package/docs/agents/install-and-sync.md +11 -31
- package/docs/agents/markdown-audit.md +10 -12
- package/docs/agents/migrate.md +1 -1
- package/docs/agents/pr-evidence-layout.md +70 -0
- package/docs/agents/pr-evidence.md +8 -9
- package/docs/agents/pr-frames.md +7 -2
- package/docs/agents/pr-lift.md +132 -0
- package/docs/agents/records-stale.md +1 -1
- package/docs/agents/records-validate.md +11 -23
- package/docs/agents/records.md +1 -1
- package/docs/agents/routing.md +1 -1
- package/docs/agents/rule-citations.md +11 -14
- package/docs/agents/scripting.md +4 -21
- package/docs/agents/state-scoped-risk.md +1 -1
- package/docs/agents/tasks-validate.md +1 -1
- package/docs/agents/teach.md +1 -1
- package/docs/target/index.md +1 -0
- package/docs/target/migrations.md +4 -0
- package/docs/target/projects.md +11 -11
- package/docs/target/scenarios.md +5 -6
- package/docs/target/standards-moved.md +32 -0
- package/docs/target/sync.md +5 -5
- package/docs/workflow/operating-model.md +16 -18
- package/docs/workflow/skill-map.md +1 -1
- package/governance/detect.toml +197 -0
- package/governance/renames.toml +0 -1
- package/governance/rules/code/000-code.md +1 -13
- package/governance/rules/code/010-testing.md +2 -30
- package/governance/rules/ui/400-ui.md +1 -1
- package/governance/rules/ui/480-canvas.md +13 -0
- package/governance/stacks/base.toml +15 -8
- package/governance/stacks/go.toml +2 -0
- package/governance/stacks/node.toml +1 -1
- package/governance/stacks/php.toml +2 -0
- package/governance/stacks/python.toml +1 -1
- package/package.json +1 -4
- package/scripts/core/install-check.sh +2 -3
- package/scripts/core/regen-hero.ts +0 -6
- package/scripts/lib/ui.sh +0 -9
- package/src/audits/catalog.ts +0 -9
- package/src/canvas/arrange.ts +66 -0
- package/src/canvas/capture.ts +20 -6
- package/src/canvas/content.ts +39 -0
- package/src/canvas/fit.ts +238 -0
- package/src/canvas/tokens.ts +28 -10
- package/src/capture/frame-values.ts +2 -32
- package/src/claude/routing.ts +1 -1
- package/src/claude/skills-reach.ts +4 -6
- package/src/cli/help.ts +3 -4
- package/src/cli.ts +0 -2
- package/src/commands/canvas.ts +179 -1
- package/src/commands/gov.ts +149 -10
- package/src/commands/init.ts +1 -1
- package/src/commands/labels.ts +4 -44
- package/src/commands/migrate.ts +1 -1
- package/src/commands/pr.ts +376 -1
- package/src/commands/records.ts +4 -20
- package/src/commands/tooling.ts +2 -4
- package/src/counts/catalogs.ts +0 -6
- package/src/feedback/body.ts +26 -5
- package/src/gate/boundaries.ts +2 -2
- package/src/gate/measures.ts +64 -72
- package/src/gate/sequencer.ts +51 -2
- package/src/gate/stages.ts +3 -22
- package/src/gov/citations.ts +11 -43
- package/src/gov/detect.ts +301 -0
- package/src/gov/list.ts +23 -2
- package/src/gov/stacks.ts +9 -0
- package/src/markdown/bans.ts +1 -1
- package/src/migrate/scratch-evidence.ts +2 -2
- package/src/pr/evidence.ts +218 -45
- package/src/pr/frames.ts +23 -3
- package/src/pr/lift.ts +418 -0
- package/src/pr/rest.ts +3 -0
- package/src/pr/review-scope.ts +76 -0
- package/src/records/validate.ts +6 -194
- package/src/sandbox/equivalence.ts +14 -7
- package/src/sandbox/provision.ts +0 -5
- package/src/secrets/shipped.ts +1 -2
- package/src/serve/static.ts +1 -2
- package/src/shipped/references.ts +29 -80
- package/src/sync/check.ts +18 -14
- package/src/tooling/inject.ts +6 -37
- package/src/tooling/read.ts +2 -3
- package/src/tooling/scan.ts +4 -17
- package/src/tooling/subfolder.ts +2 -66
- package/tooling/base/configs/scripts/verify.json +1 -1
- package/tooling/base/configs/scripts/verify.ts +1 -12
- package/tooling/base/manifest.toml +1 -2
- package/tooling/base/reference.md +10 -16
- package/tooling/base/seeds/.github/workflows/verify.yml +0 -3
- package/tooling/base/seeds/.lintstagedrc +1 -2
- package/tooling/base/seeds/canon/context/ci.md +0 -1
- package/tooling/base/seeds/canon/context/development.md +1 -1
- package/tooling/claude/reference.md +1 -1
- package/tooling/claude/seeds/.claude/hooks/review-post-scan.sh +13 -1
- package/tooling/go/reference.md +1 -1
- package/tooling/php/reference.md +1 -1
- package/tooling/python/reference.md +2 -2
- package/tooling/web/configs/.github/workflows/verify.yml +0 -3
- package/tooling/web/manifest.toml +0 -1
- package/tooling/web/reference.md +2 -4
- package/docs/agents/standards-audit.md +0 -40
- package/governance/rules/tooling/765-spelling.md +0 -19
- package/governance/stacks/astro.toml +0 -2
- package/governance/stacks/nextjs.toml +0 -2
- package/governance/stacks/node-server.toml +0 -2
- package/governance/stacks/python-fastapi.toml +0 -2
- package/governance/stacks/react.toml +0 -2
- package/src/commands/standards.ts +0 -278
- package/src/labels/spelling.ts +0 -120
- package/src/standards/audit.ts +0 -146
- package/src/standards/list.ts +0 -33
- package/src/standards/read.ts +0 -177
- package/src/standards/scope.ts +0 -56
- package/standards/index.md +0 -10
- package/tooling/base/configs/.vscode/extensions.json +0 -9
- package/tooling/base/configs/.vscode/settings.json +0 -3
- package/tooling/base/seeds/.cspell/project-terms.txt +0 -0
- package/tooling/base/seeds/.cspell/tech-stack.txt +0 -25
- package/tooling/base/seeds/cspell.json +0 -20
- package/tooling/go/seeds/.cspell/tech-stack.txt +0 -16
- package/tooling/nextjs/seeds/.cspell/tech-stack.txt +0 -3
- package/tooling/php/seeds/.cspell/tech-stack.txt +0 -5
- package/tooling/python/seeds/.cspell/tech-stack.txt +0 -18
- package/tooling/vite-react/seeds/.cspell/project-terms.txt +0 -1
- package/tooling/vite-react/seeds/.cspell/tech-stack.txt +0 -2
- package/tooling/web/configs/.vscode/extensions.json +0 -13
- package/tooling/web/configs/.vscode/settings.json +0 -10
- package/tooling/web/seeds/.cspell/tech-stack.txt +0 -21
|
@@ -809,12 +809,61 @@ const countSince =
|
|
|
809
809
|
return log.isOk ? log.stdout.split('\n').filter((l) => l !== '').length : 0
|
|
810
810
|
}
|
|
811
811
|
|
|
812
|
+
const LIFT_STANDING: Record<
|
|
813
|
+
string,
|
|
814
|
+
Pick<Baseline, 'merges' | 'stale'> | undefined
|
|
815
|
+
> = {
|
|
816
|
+
'standing-conflict': { merges: 'conflict', stale: 'unknown' },
|
|
817
|
+
'standing-stale': { merges: 'clean', stale: 'stale' },
|
|
818
|
+
'standing-unknown': { merges: 'unknown', stale: 'unknown' },
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
/**
|
|
822
|
+
* The standing `canon pr lift --check` read, so the lift and this check answer
|
|
823
|
+
* from one authority. Null when the record names no head or no standing gate,
|
|
824
|
+
* which a pull request already ready, a closed one, and an older binary with no
|
|
825
|
+
* `pr lift` verb all leave.
|
|
826
|
+
*/
|
|
827
|
+
export const standingFromLift = (
|
|
828
|
+
record: unknown,
|
|
829
|
+
): null | Pick<Baseline, 'head' | 'merges' | 'stale'> => {
|
|
830
|
+
if (typeof record !== 'object' || record === null) return null
|
|
831
|
+
const { gates, head } = record as Record<string, unknown>
|
|
832
|
+
if (typeof head !== 'string' || head === '' || !Array.isArray(gates)) {
|
|
833
|
+
return null
|
|
834
|
+
}
|
|
835
|
+
const gate: unknown = gates.find(
|
|
836
|
+
(g: unknown) =>
|
|
837
|
+
typeof g === 'object' &&
|
|
838
|
+
g !== null &&
|
|
839
|
+
(g as Record<string, unknown>).gate === 'standing',
|
|
840
|
+
)
|
|
841
|
+
if (gate === undefined) return null
|
|
842
|
+
const { isOk, reason } = gate as Record<string, unknown>
|
|
843
|
+
if (isOk === true) return { head, merges: 'clean', stale: 'fresh' }
|
|
844
|
+
const standing =
|
|
845
|
+
typeof reason === 'string' ? LIFT_STANDING[reason] : undefined
|
|
846
|
+
|
|
847
|
+
return standing === undefined ? null : { head, ...standing }
|
|
848
|
+
}
|
|
849
|
+
|
|
812
850
|
/**
|
|
813
851
|
* `--check <number>` reads the base and the head at call time and writes
|
|
814
852
|
* nothing. The baseline is as old as the last full run, and a sibling merging
|
|
815
|
-
* after it would leave a stored reading claiming clear.
|
|
853
|
+
* after it would leave a stored reading claiming clear. The lift verb's reading
|
|
854
|
+
* comes first, and the read below stays as the fallback for an older binary.
|
|
816
855
|
*/
|
|
817
856
|
const check = (number: string): number => {
|
|
857
|
+
// The verb exits 1 on any refused gate and still prints its record, so the
|
|
858
|
+
// exit says nothing about whether the standing was read.
|
|
859
|
+
const lifted = standingFromLift(
|
|
860
|
+
parseJson(run('canon', ['pr', 'lift', number, '--check', '--json']).stdout),
|
|
861
|
+
)
|
|
862
|
+
if (lifted !== null) {
|
|
863
|
+
console.log(standingLine({ ...lifted, number }))
|
|
864
|
+
|
|
865
|
+
return 0
|
|
866
|
+
}
|
|
818
867
|
const ref = baseRef()
|
|
819
868
|
run('git', ['fetch', '-q', 'origin', baseBranch(ref)])
|
|
820
869
|
const head = readHead(number)
|
|
@@ -24,19 +24,27 @@ cold pass found a finding the warm pass missed and showed one of the warm pass's
|
|
|
24
24
|
own findings wrong.
|
|
25
25
|
|
|
26
26
|
Every one of those launches restated the reviewer's bounds by hand: write the
|
|
27
|
-
comment alone, no worktree, no branch, no board write, no fix, no draft
|
|
27
|
+
comment alone, no worktree, no branch, no board write, no fix, no direct draft
|
|
28
|
+
lift.
|
|
28
29
|
Each is a property of the role rather than of the pull request, so each dispatch
|
|
29
30
|
reproduced them from memory, the shape `role-planner` was written to retire on
|
|
30
31
|
the planning side.
|
|
31
32
|
|
|
32
33
|
Three bounds matter more than the rest. A reviewer asked to fix what it found
|
|
33
34
|
has reviewed its own change afterwards, and nothing recovers the independent
|
|
34
|
-
read. A reviewer posting `## Review closed` is one step from
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
read. A reviewer posting `## Review closed` is one step from readying the pull
|
|
36
|
+
request by hand, which skips the gates `canon pr lift` reads, and `review-pr`
|
|
37
|
+
Step 5 reports a merge recommendation that reads as permission when the body is
|
|
38
|
+
silent. A reviewer with no checkout reading a file
|
|
37
39
|
off the main worktree reads the trunk, so every finding it files there is about
|
|
38
40
|
a tree the pull request never changed.
|
|
39
41
|
|
|
42
|
+
Routing through the controlling session costs that session the most. Until
|
|
43
|
+
2026-10-12 each review round passed through it four times: the pass announced to
|
|
44
|
+
it, the dispatch to the worker, the worker's answer, and the re-review request.
|
|
45
|
+
Every one of those is a turn that reads the whole wave's context, and the
|
|
46
|
+
reviewer and the worker each already knew what the other needed next.
|
|
47
|
+
|
|
40
48
|
## Must
|
|
41
49
|
|
|
42
50
|
- Assert what a reviewing session is, what it may write, and how long the role lasts, since `review-pr` carries the pass and no body carries the role that runs it when dispatched
|
|
@@ -44,8 +52,10 @@ a tree the pull request never changed.
|
|
|
44
52
|
- Send every file read a finding rests on to `git show <head>:<path>` at the head `review-pr` resolved, since the main worktree holds the trunk
|
|
45
53
|
- Name what the pass reads, the diff, the plan, the task's outcomes, the rules, and `review-craft`, and what it leaves, the author's argument and the worker's session, since the independence is what the trials measured
|
|
46
54
|
- Read the cross-branch facts a launch carries as inputs rather than findings, since the controller's wave-level read reaches this session only through the brief
|
|
47
|
-
- Refuse the fix,
|
|
48
|
-
-
|
|
55
|
+
- Refuse the fix, a draft lift by any route but `canon pr lift`, and the merge, whoever asks, and name who owns each, since each has a sender who will ask
|
|
56
|
+
- Run `canon pr lift` after posting a close, since the verb reads every gate itself and a reviewer's close is the moment the last of them can turn clear
|
|
57
|
+
- Send the `review-address` dispatch to the worker on an open pass, carrying the number, the heading, `review-pr` Step 5's count line, and this session's sessionId, and fall back to the controller when no worker resolves, since every hop through the controller costs it a turn that reads the whole wave's context
|
|
58
|
+
- Message the controller on a close with the reason `canon pr lift` returned, unless the reason names the other review as still open, since that refusal needs nothing from anyone
|
|
49
59
|
- Owe a message before a block becomes an interactive prompt, since a session already waiting on input never reaches the tool round an inbound message drains at
|
|
50
60
|
- Keep a re-review with the reviewer that took the first pass while it is live, so the second pass keeps the read the first paid for
|
|
51
61
|
- Defer the addressee resolution to `session-relay` and keep only the last-rung inference, which discriminates as it does for a planner because a reviewer holds no feature branch either
|
|
@@ -62,7 +72,7 @@ a tree the pull request never changed.
|
|
|
62
72
|
## Guards
|
|
63
73
|
|
|
64
74
|
- Plan or task does not resolve from where the session stands: report it unreadable and name the main-root path, rather than reviewing as though the branch had no plan
|
|
65
|
-
- Asked by anyone to fix,
|
|
75
|
+
- Asked by anyone to fix, ready the pull request directly, or merge: refuse, name who owns the act, and file the defect in the comment when the ask was a fix
|
|
66
76
|
- Launch named no controlling session and an operator is present: ask which row to address rather than inferring
|
|
67
77
|
- Launch named no controlling session and nobody is present: infer from the sessions holding no feature branch, report the candidates when more than one comes back, and say the addressee was inferred
|
|
68
78
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: role-reviewer
|
|
3
|
-
description: Asserts the reviewer role for a session dispatched to review one pull request another session built, holding what it may write, what it reads and never reads, the
|
|
3
|
+
description: Asserts the reviewer role for a session dispatched to review one pull request another session built, holding what it may write, what it reads and never reads, the messages it owes the worker and the controller, the lift it runs on a close, and the acts it refuses. Use when asked to "be the reviewer", "you are a reviewer session", at the start of a dispatched or hand-launched review of one pull request, or when a reviewing session needs to know what it may not write or who it answers to. Do NOT use to run the pass itself, which is `review-pr` for the code and `review-ui` for the running app, or to make the cross-branch call across a wave.
|
|
4
4
|
metadata:
|
|
5
5
|
family: parallel
|
|
6
6
|
---
|
|
@@ -25,7 +25,7 @@ from here.
|
|
|
25
25
|
|
|
26
26
|
## Where the session stands
|
|
27
27
|
|
|
28
|
-
- Write the review comment through `review-pr` and the body file it names under `.canon/tmp/pr/review/`, and nothing else. A UI reviewer writes the comment `review-ui` posts, its body file, and the browser's snapshots and frames, all under `.canon/tmp/pr/review-ui/`, and ticks the boxes it passed on the evidence comment through `canon pr tick`. A tracked file, a branch, a worktree, a board file, and a commit all sit outside what this session may touch.
|
|
28
|
+
- Write the review comment through `review-pr` and the body file it names under `.canon/tmp/pr/review/`, and nothing else. A UI reviewer writes the comment `review-ui` posts, its body file, and the browser's snapshots and frames, all under `.canon/tmp/pr/review-ui/`, and ticks the boxes it passed on the evidence comment through `canon pr tick`. Either reviewer writes the draft flag through `canon pr lift` and no other way. A tracked file, a branch, a worktree, a board file, and a commit all sit outside what this session may touch.
|
|
29
29
|
- Never enter a worktree and never check the branch out. The pass reads a change, and a checkout is the first step toward editing it.
|
|
30
30
|
- Read a file a finding rests on at the head `review-pr` resolved, through `git show <head>:<path>`. The main worktree holds the trunk, so a finding read off its copy is about a tree the pull request never changed, and it reads as confidently as one that is right.
|
|
31
31
|
- Resolve `.canon/plans/`, `.canon/tasks/`, and `.canon/tmp/` at the main worktree root, and send the body file as a heredoc, the main-root route `session-worktree` states. Report a plan or task that fails to resolve there as unreadable, naming the path, rather than reviewing as though the branch had none.
|
|
@@ -46,16 +46,23 @@ from here.
|
|
|
46
46
|
|
|
47
47
|
## The channel
|
|
48
48
|
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
Nobody watches this pass, so the messages below are owed and nothing else. The
|
|
50
|
+
worker and this session answer each other directly, and the controlling session
|
|
51
|
+
hears only what it acts on.
|
|
51
52
|
|
|
52
|
-
-
|
|
53
|
+
- Send the `review-address` dispatch to the worker holding the branch as `review-pr` Step 5 returns an open `## Review`, or as `review-ui` reports an open `## UI review`, carrying the pull request number, the heading, that step's count line verbatim, and this session's own sessionId for the worker's reply. Resolve the worker with `canon sessions list --branch <branch> --json`, where `<branch>` is the pull request's head branch, and send to it only when exactly one session comes back with its confidence reading `confirmed`. Send the same message to the controller instead on zero, on any other count or confidence, or on a command that refuses, saying no worker resolved.
|
|
54
|
+
- Run `canon pr lift <number> --json` after posting `## Review closed` or `## UI review closed`. Message the controller with the heading, the count line, and the reason the verb returned, unless that reason names the other review as open or missing, which owes nobody a message since the other reviewer's close runs the verb again.
|
|
53
55
|
- Send a block out as a message before it becomes an interactive prompt.
|
|
54
56
|
- Send nothing on progress, and send no recommendation to merge as an instruction. `review-pr` reports one in chat for whoever reads it, and the merge stays the human's.
|
|
55
57
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
Carry the sessionId in the message alone, never in the posted comment. The
|
|
59
|
+
comment is public, and an id there addresses nothing for a reader without the
|
|
60
|
+
roster.
|
|
61
|
+
|
|
62
|
+
Address the controlling session the launch named, which it names as a
|
|
63
|
+
`sessionId` rather than a name. `canon:session-relay` turns that id or the
|
|
64
|
+
worker's branch into an address and carries the send, so invoke it rather than
|
|
65
|
+
resolving a name here.
|
|
59
66
|
|
|
60
67
|
One rung stays here, because it is the rung that differs between roles. A
|
|
61
68
|
reviewer holds no feature branch, so inferring an addressee from the sessions
|
|
@@ -66,13 +73,13 @@ where exactly one does, and say the addressee was inferred.
|
|
|
66
73
|
## Refusing is part of the job
|
|
67
74
|
|
|
68
75
|
- Refuse to fix the defect this pass found, whoever asks. File it in the comment for the worker holding the branch instead. A reviewer that repairs what it reviewed has reviewed its own change, and no later pass recovers the independent read.
|
|
69
|
-
-
|
|
76
|
+
- Lift the draft mark through `canon pr lift` alone, and never ready the pull request directly, whoever asks. The verb reads the reviews, the evidence, the standing, and CI itself, so its lift needs no one to vouch for the request, and a direct ready skips every gate it holds.
|
|
70
77
|
- Refuse to merge, and refuse to approve through the review API in place of the comment `review-pr` posts, since the poll routes on that comment's heading and an approval carries none.
|
|
71
78
|
- Carry the evidence with a refusal. Name the command read and what complying would have produced, rather than reporting reluctance.
|
|
72
79
|
- Withdraw a finding the worker's reply shows wrong, the way `review-pr` states, rather than defending it. A withdrawal naming its cause is part of a pass, not a retreat from one.
|
|
73
80
|
|
|
74
81
|
## Lifetime
|
|
75
82
|
|
|
76
|
-
- The role runs from the launch to the merge of the pull request it reviewed, and covers every pass on that pull request. A re-review comes back to this session while it is live, which keeps the read the first pass paid for.
|
|
83
|
+
- The role runs from the launch to the merge of the pull request it reviewed, and covers every pass on that pull request. A re-review comes back to this session from the worker directly while it is live, which keeps the read the first pass paid for.
|
|
77
84
|
- A session handed a second pull request is a new reviewer under a new launch, since the first one's reading of the change is exactly what the second one must not carry.
|
|
78
85
|
- Treat this body as possibly older than the branch under review. A plugin skill loads from the marketplace cache rather than from the working tree.
|
|
@@ -19,7 +19,7 @@ Finishing is invisible from the other side. A worker that opens a pull request g
|
|
|
19
19
|
|
|
20
20
|
Nothing tells the session that refusing is allowed either. Four occasions across two days had a worker halt correctly with the cost falling on the dispatcher, and the correction that mattered most reached the right place because a worker argued back with evidence rather than complying. A role written only as report-upward suppresses exactly that.
|
|
21
21
|
|
|
22
|
-
The draft mark fails from both ends. On 2026-08-31 four sessions re-drafted a pull request someone had readied, acting on a belief no surface in the tree stated. On 2026-09-07 a controlling session told a worker to lift the mark rather than lifting it itself, and the worker complied and reported against the surface rather than the outcome.
|
|
22
|
+
The draft mark fails from both ends. On 2026-08-31 four sessions re-drafted a pull request someone had readied, acting on a belief no surface in the tree stated. On 2026-09-07 a controlling session told a worker to lift the mark rather than lifting it itself, and the worker complied and reported against the surface rather than the outcome. From 2026-10-12 `canon pr lift` reads the gates itself, so the reviewers run it on a close and the controlling session runs it as the fallback. A worker leaves the verb to them and readies a pull request directly for nobody, since a direct ready skips every gate the verb reads.
|
|
23
23
|
|
|
24
24
|
## Must
|
|
25
25
|
|
|
@@ -32,8 +32,8 @@ which `auto-ship` Step 2 loads.
|
|
|
32
32
|
- Report a plan that fails to resolve as unreadable from here, naming the main-root path. Reporting the task as having no plan is true where this session stands and wrong about the world, and a reader with no second tree to check cannot separate the two.
|
|
33
33
|
- Build the plan the launch named. Do not write a second one when the path fails to resolve, since a row that cites a plan already has one and drafting another produces two plans for one row.
|
|
34
34
|
- Copy a ready folder's files verbatim to the paths its plan's constraints name, when the plan's `**Constraints:**` block names one, and edit only what the gate or the overview's own list requires. A rewrite discards the text the handoff exists to carry.
|
|
35
|
-
- Report a draft flag reading ready once, and leave it cleared. The ship chain marks the pull request a draft and
|
|
36
|
-
-
|
|
35
|
+
- Report a draft flag reading ready once, and leave it cleared. The ship chain marks the pull request a draft, and only `canon pr lift` or the operator un-marks it, so a flag reading ready afterwards passed every gate the verb reads or was readied by a person, which GitHub requires before a merge. Re-drafting fights them, and no surface in the tree states a reason to.
|
|
36
|
+
- Leave the lift to the reviewers, who run `canon pr lift` on posting their close, and to the controlling session as the fallback. Refuse an instruction to ready the pull request directly, whoever sends it, since a direct ready skips every gate the verb reads.
|
|
37
37
|
- Rewrite a plan question's `- Suggested:` line as `overridden at execution to <pick>,` plus the measurement when this build decides against an unanswered one, leaving the `- Answer:` slot blank, and put the same deviation in one line under the open task's `## Findings`, per `${CLAUDE_SKILL_DIR}/../plan-feature/references/plan.md`.
|
|
38
38
|
|
|
39
39
|
## The board is read-only
|
|
@@ -51,13 +51,13 @@ owed and nothing else.
|
|
|
51
51
|
- Announce the pull request as the ship chain's pull request step returns, carrying the number, the branch, and the task it closes. That transition is the one moment only this session knows, and the controller's review poll no longer starts on a dispatch because of it.
|
|
52
52
|
- Carry the reach in that same message: the paths this branch wrote that another live plan or `## Run now` row holds, and who holds each, which `canon tasks plan-reach` reports as `claimed`. Report each as a rebase the controller should order, never as a breach, since sharing a path is not a hold. The gate cleared this branch against a prediction it has since outgrown, so the controller holds a reading of what this branch shares that stopped being true hours ago and nothing else tells it. Say the reach was unread rather than clear when the installed binary carries no such subcommand, and leave the undeclared list to the pull request.
|
|
53
53
|
- Carry a row this build turned up in that same message, with its title, its origin, and the surface it would take. Send it as its own message only when the session will end before a pull request opens, since the row has no other way to reach the controller.
|
|
54
|
-
-
|
|
54
|
+
- Ask for the re-review when an address-review pass finishes, as `review-address` Step 8 returns, carrying what was addressed and the PR's new CI state. Send it to the reviewer whose sessionId the review dispatch carried, resolved from that id at the moment of sending, since a reviewer holds the trunk branch and no branch lookup finds it. Send it to the controller instead when the dispatch named no reviewer or the id resolves to no live session. That transition is the other moment only this session knows, and the message is what starts the re-review rather than a poll for an answer nothing marks as landed.
|
|
55
55
|
- Send a block out as a message before it becomes an interactive prompt.
|
|
56
56
|
- Send nothing on progress. A worker reporting progress rebuilds, on this side of the channel, the poll the announcement retired on the other.
|
|
57
57
|
|
|
58
|
-
Address the session the launch named,
|
|
59
|
-
|
|
60
|
-
send, so invoke it rather than resolving a name here. It reads the roster at the
|
|
58
|
+
Address the session the launch named, and the reviewer by the sessionId its
|
|
59
|
+
dispatch carried, each as a `sessionId` rather than a name.
|
|
60
|
+
`canon:session-relay` turns that id into an address and carries the send, so invoke it rather than resolving a name here. It reads the roster at the
|
|
61
61
|
moment of sending, checks the result against the agent listing, and falls back
|
|
62
62
|
to a copyable block where this session holds no tool to send through. The
|
|
63
63
|
message owed stays in its own bullet above.
|
|
@@ -5,7 +5,7 @@ description: What each section of a compact handoff carries, what stays out, and
|
|
|
5
5
|
|
|
6
6
|
# Handoff note
|
|
7
7
|
|
|
8
|
-
The shape `session-compact` writes. It lives
|
|
8
|
+
The shape `session-compact` writes. It lives in this skill's `references/` because one skill reads it, and a shape nothing else cites has no second reader to correct it.
|
|
9
9
|
|
|
10
10
|
## The test every line passes
|
|
11
11
|
|
|
@@ -33,7 +33,7 @@ rather than a step within it, so the full chain never runs it separately.
|
|
|
33
33
|
|
|
34
34
|
## Non-interactive path
|
|
35
35
|
|
|
36
|
-
Every phase runs under `CANON_NON_INTERACTIVE=1` with no TTY.
|
|
36
|
+
Every phase runs under `CANON_NON_INTERACTIVE=1` with no TTY. Three phases
|
|
37
37
|
otherwise pause, and each takes an argument that answers its prompt ahead of
|
|
38
38
|
time:
|
|
39
39
|
|
|
@@ -41,11 +41,15 @@ time:
|
|
|
41
41
|
takes every candidate the scan found, and `--folders <a>,<b>` takes a named
|
|
42
42
|
set. With neither, and with no TTY, the phase reports its candidates and stops
|
|
43
43
|
rather than choosing for the operator.
|
|
44
|
+
- `install` and `gov` confirm the proposed extras with the operator.
|
|
45
|
+
`--extras <a>,<b>` takes a named set and `--extras none` takes none. With
|
|
46
|
+
neither, and with nobody to answer, both take every proposal and list each in
|
|
47
|
+
the report rather than stopping.
|
|
44
48
|
- `gov` stops on a detected technology with no matching rule. `--skip-gaps`
|
|
45
49
|
proceeds with the matched layer and lists the gap in the report.
|
|
46
50
|
|
|
47
51
|
Claude Code's tool permission dialog is the confirmation gate for everything
|
|
48
|
-
else. Do not pause for a separate confirmation.
|
|
52
|
+
else. Do not pause for a separate confirmation beyond the extras question.
|
|
49
53
|
|
|
50
54
|
## Scope
|
|
51
55
|
|
|
@@ -71,7 +75,8 @@ the `install` and `gov` phases share rather than each stating.
|
|
|
71
75
|
|
|
72
76
|
## Phase: install
|
|
73
77
|
|
|
74
|
-
Run the chain in order, starting
|
|
78
|
+
Run the chain in order, starting once the operator has confirmed the extras the
|
|
79
|
+
preview proposed, per the detect reference. Run from the
|
|
75
80
|
target project's current directory. Do not cd into the toolkit source tree. The
|
|
76
81
|
`canon` CLI is global.
|
|
77
82
|
|
|
@@ -94,7 +99,7 @@ Step 2: `canon tooling sync <tooling-stack> --write` installs stack deps, script
|
|
|
94
99
|
CANON_NON_INTERACTIVE=1 canon tooling sync <tooling-stack> <target> --write
|
|
95
100
|
```
|
|
96
101
|
|
|
97
|
-
Monorepo with multiple language roots: run `canon init` once at the repo root so `base` (husky, prettier,
|
|
102
|
+
Monorepo with multiple language roots: run `canon init` once at the repo root so `base` (husky, prettier, commitlint, CI) lands single, then sync each subtree with `--skip base` so the shared layer is not re-dropped. Take the subtree commands from the per-root rows the preview printed rather than picking folders by hand. Detection found each root and its stack, and the two commands below show the shape.
|
|
98
103
|
|
|
99
104
|
```bash
|
|
100
105
|
CANON_NON_INTERACTIVE=1 canon tooling sync vite-react ./frontend --skip base --write
|
|
@@ -103,7 +108,7 @@ CANON_NON_INTERACTIVE=1 canon tooling sync python ./backend --skip base --write
|
|
|
103
108
|
|
|
104
109
|
Without `--skip base`, each subtree re-drops husky, and git honors only one `core.hooksPath`, so the extra hook dirs silently break. Each subtree keeps its own framework configs, and its own stack reference reads through `canon tooling reference <stack>`.
|
|
105
110
|
|
|
106
|
-
A subtree sync withholds `.github/`, since GitHub reads workflows only at the repository root, and names each withheld file with the `working-directory` a root CI job needs.
|
|
111
|
+
A subtree sync withholds `.github/`, since GitHub reads workflows only at the repository root, and names each withheld file with the `working-directory` a root CI job needs. A subtree needs its own `bun init` before its scripts and dependencies land. The sync warns and skips them until then.
|
|
107
112
|
|
|
108
113
|
Step 3: post-sync fixups. Golden configs arrive from sync, so no config generation is required. But a few items may need a one-time touch:
|
|
109
114
|
|
|
@@ -116,7 +121,8 @@ Do not generate ESLint, Vitest, or Playwright configs. They ship as golden files
|
|
|
116
121
|
## Phase: gov
|
|
117
122
|
|
|
118
123
|
Governance rules and nothing else, for a project declining the tooling layer.
|
|
119
|
-
Resolve exactly as the detect reference states,
|
|
124
|
+
Resolve exactly as the detect reference states, confirm the proposed extras
|
|
125
|
+
there, then run:
|
|
120
126
|
|
|
121
127
|
```bash
|
|
122
128
|
CANON_NON_INTERACTIVE=1 canon gov install <stack> --add <extras> <target>
|
|
@@ -77,10 +77,11 @@ already reach every subfolder. Tooling installs per folder. So resolve one
|
|
|
77
77
|
governance stack for the whole repository and one tooling stack per language
|
|
78
78
|
root.
|
|
79
79
|
|
|
80
|
-
- **Stack:** pick the
|
|
80
|
+
- **Stack:** pick the governance stack by matching the repository root's detected language against stack names in the catalog. Governance stacks are per language, so a framework never names one, and its rules arrive as extras. If the root matched nothing, `base` is the stack, including when subfolders matched, since no subfolder owns the repository and picking one by order would state a preference nobody gave. Mark it `fallback` in the preview only when no root matched anywhere.
|
|
81
81
|
- **Tooling stack:** for each language root, pick the closest tooling stack from `canon tooling list --json` (e.g. `vite-react`, `astro`, `nextjs`). Distinct from the governance stack. Fall back to `base` for a root with no framework or language match, and carry that fallback into its preview row.
|
|
82
|
-
- **Next.js:** map `next` in a root's `package.json` dependencies, or a `next.config.ts`/`.js`/`.mjs` file in that root, to the `
|
|
83
|
-
- **Extras:**
|
|
82
|
+
- **Next.js:** map `next` in a root's `package.json` dependencies, or a `next.config.ts`/`.js`/`.mjs` file in that root, to the `node` governance stack and the `nextjs` tooling stack. The dependency name does not match the tooling stack name by itself, and the Next.js rule arrives as an extra.
|
|
83
|
+
- **Extras:** run `canon gov detect <target> --stack <stack> --json` from the target and take its `proposals` array as the candidate extras. Each proposal names a `rule` and the `evidence` that matched it across every language root to depth two. The verb already leaves out every rule the picked stack resolves, so do not dedupe again, and do not match a rule's `description` or `paths` by hand.
|
|
84
|
+
- **Subfolder language rules:** a language root below the repository root whose language the picked stack does not carry contributes its language rule by name, read from `canon gov list --json`. The verb proposes no language rule, since a stack reaches each one.
|
|
84
85
|
- **Subfolder tooling:** a language root below the repository root takes its own `canon tooling sync <stack> <path> --skip base`, since `canon init` already lands `base` once at the root. Leave a root whose stack resolves to `base` out of the commands, since that sync would land nothing. A repository-root `package.json` hosting only formatters and hooks is that case, and it adds no row.
|
|
85
86
|
- **Skip (`--skip`):** `wiki` installs by default. Add `--skip wiki` only when the user explicitly wants it left out.
|
|
86
87
|
|
|
@@ -110,9 +111,9 @@ toolkit repository, and option 2 hands the project-local file to `create-rule`.
|
|
|
110
111
|
Before executing, output:
|
|
111
112
|
|
|
112
113
|
- **Detected:** each technology with its evidence file, path included, so a subfolder marker reads as one
|
|
113
|
-
- **Stack:** picked governance stack and resolved rule count. Mark it `fallback` when no detected
|
|
114
|
+
- **Stack:** picked governance stack and resolved rule count. Mark it `fallback` when no detected language matched a catalog name.
|
|
114
115
|
- **Tooling stack:** one row per language root, each carrying its path, its picked tooling stack, a `fallback` mark on the same test, and its own command. On the repository root's row, name what `base` lands: configs, seeds, and gitignore entries in every case, plus the JavaScript development dependencies, scripts, and hook activation wherever a `package.json` exists to carry them. A project outside that ecosystem runs none of the second group and keeps the first. Omit these rows entirely on the `gov` phase, which syncs no tooling.
|
|
115
|
-
- **Extras:** each
|
|
116
|
+
- **Extras:** each proposal with the evidence the verb returned, plus each subfolder language rule, listed in full as the list the operator confirms. A second matched stack reaches the install only through this list, since `canon init --stack` takes one stack, so a shortened list reads as that stack dropped.
|
|
116
117
|
- **Skip:** any `--skip` entries with reason
|
|
117
118
|
- **Target:** resolved target path
|
|
118
119
|
- **Commands:** the full chain that will run
|
|
@@ -120,3 +121,19 @@ Before executing, output:
|
|
|
120
121
|
A resolved name and a fallback read alike once written, so mark the fallback
|
|
121
122
|
here rather than in the report. The preview is the last point before the first
|
|
122
123
|
write, and the report runs after the files have landed.
|
|
124
|
+
|
|
125
|
+
### Confirm the extras
|
|
126
|
+
|
|
127
|
+
The extras are the one part of the preview the operator confirms before the
|
|
128
|
+
install runs, since a proposal is evidence that a project might want a rule
|
|
129
|
+
rather than proof that it does. Put the list through the structured question
|
|
130
|
+
surface with three options: take every proposal, which is the recommended
|
|
131
|
+
first option, take none, or name a subset, which the operator types as a
|
|
132
|
+
comma-separated list. Pass what they kept to `--add` and drop the flag when
|
|
133
|
+
they kept nothing.
|
|
134
|
+
|
|
135
|
+
An `--extras` argument answers ahead of time and skips the question.
|
|
136
|
+
`--extras <a>,<b>` takes the named rules, and `--extras none` takes none. With
|
|
137
|
+
neither and no one to answer, take every proposal and list each in the report,
|
|
138
|
+
since a proposed rule costs one file to delete and stopping would break every
|
|
139
|
+
headless setup.
|
|
@@ -15,7 +15,7 @@ The failure is measured on a real target. A single-page portfolio site carried 2
|
|
|
15
15
|
|
|
16
16
|
A stated rule is also one a session can talk itself out of. Each test in that suite sat where it did for a reason that sounded fine at the time, such as the end to end spec already being open or a pause quieting a run that flaked under load, and nothing in front of the session answered the reason.
|
|
17
17
|
|
|
18
|
-
Moving the guidance into a path-scoped rule does not reach the session that needs it. A path-scoped rule loads when a session reads a matching file and
|
|
18
|
+
Moving the guidance into a path-scoped rule does not reach the session that needs it. A path-scoped rule loads when a session reads or writes a matching file, and it is absent from the write that creates the first one, measured in three headless runs, so a rule scoped to test files is silent on the first test of every feature.
|
|
19
19
|
|
|
20
20
|
## Must
|
|
21
21
|
|
|
@@ -23,6 +23,7 @@ Moving the guidance into a path-scoped rule does not reach the session that need
|
|
|
23
23
|
- Open every test with the question of which production change makes it fail and whether that change is a bug or a decision, since a test with no answer proves nothing
|
|
24
24
|
- State the end to end budget in words: journeys and what only a real browser renders, never a state a component test reaches
|
|
25
25
|
- Carry a final filter the session runs over its own tests, each item a shape it can check: mirror assertion, change detector, assertion on a mock, framework behavior, fixed pause, and the mutation check
|
|
26
|
+
- Own the structure floors every test carries, being arrange, act, assert, one behavior per test, no branching or loops in a body, no testing of private functions or internal state, no coverage targets, nesting at most two levels deep, independent tests that clean up, factories for test data, every async call awaited, and no snapshot verification. The testing rule only points here, so a later trim keeps them.
|
|
26
27
|
- Hold in the body what every test decision pays for, and defer each layer's specifics to a reference loaded only when a test at that layer is being written
|
|
27
28
|
- Promise a middle layer for behavior a simulated DOM cannot render, naming the real-browser component runners, so a static site is not left choosing between a simulated DOM that computes no layout and a whole-site run
|
|
28
29
|
- Repeat in the end to end reference the two floors a session writing its first spec never loads through the path-scoped rule, being the `scrollend` settle and motion reduced by default
|
|
@@ -34,7 +35,6 @@ Moving the guidance into a path-scoped rule does not reach the session that need
|
|
|
34
35
|
|
|
35
36
|
- Name a framework or runner in the body. Runner specifics live in the references and in the language testing rules, so the body holds across stacks.
|
|
36
37
|
- Carry a numeric mix across layers. A codebase-wide ratio is a target a session writing one test cannot act on.
|
|
37
|
-
- Restate the structure floors the testing rule already carries, such as arrange, act, assert, one behavior per test, isolation, and no snapshots
|
|
38
38
|
- Restate the settle, guard, and run-scope rules the end to end rules carry, beyond the two floors named above
|
|
39
39
|
- Run the red, green, refactor procedure or decide its order, which `test-first` owns
|
|
40
40
|
- Import an external skill's tone, such as a law stated as absolute, or an excuse row rebutting an objection no session has raised
|
|
@@ -49,7 +49,6 @@ Moving the guidance into a path-scoped rule does not reach the session that need
|
|
|
49
49
|
|
|
50
50
|
- The red, green, refactor loop and the order it runs in: `test-first`, which loads this skill at its first step
|
|
51
51
|
- Reproducing a failure with no known cause: `systematic-debugging`
|
|
52
|
-
- Structure floors for every test: the core testing rule
|
|
53
52
|
- Runner choice, file suffix, placement, and query conventions: the TypeScript and Python testing rules
|
|
54
53
|
- Settle, guard, and run-scope rules inside an end to end file: the end to end reliability and test scope rules
|
|
55
54
|
- Writing a UI change's visual checklist, and naming the behaviors it ships untested for this skill to place: `ui-checklist`
|
|
@@ -45,10 +45,23 @@ Size a test by what it touches rather than by what it covers. Pick the first row
|
|
|
45
45
|
|
|
46
46
|
## Keep test code readable over clever
|
|
47
47
|
|
|
48
|
-
- Prefer a descriptive, repeated arrange over a shared helper a reader has to open. A test is read when it fails, by someone who did not write it.
|
|
49
|
-
- Assert through the public surface a caller uses. A test reaching into internals breaks on every refactor and catches nothing a caller sees.
|
|
48
|
+
- Prefer a descriptive, repeated arrange over a shared helper a reader has to open. A test is read when it fails, by someone who did not write it. Build test data through a factory or builder rather than an inline object literal repeated across tests.
|
|
49
|
+
- Assert through the public surface a caller uses, never on a private function or internal state directly. A test reaching into internals breaks on every refactor and catches nothing a caller sees.
|
|
50
50
|
- Prefer a real collaborator, then a fake, then a stub, and a mock last. A mock asserts how the code is built rather than what it does.
|
|
51
51
|
|
|
52
|
+
## Hold the structure floors
|
|
53
|
+
|
|
54
|
+
Every test carries these, at any layer and in any runner:
|
|
55
|
+
|
|
56
|
+
- Structure each test as arrange, act, assert.
|
|
57
|
+
- Verify one behavior per test.
|
|
58
|
+
- Keep conditional logic and loops out of a test body. A table of cases is one test per row, never a branch inside one.
|
|
59
|
+
- Set no coverage percentage as a target. Cover the behaviors and their edges.
|
|
60
|
+
- Group related tests with the framework's nesting mechanism, and keep it to two levels deep.
|
|
61
|
+
- Keep tests independent with no shared side effects. Clean up and restore state after each one.
|
|
62
|
+
- Await every async operation. Never leave a promise fire-and-forget in a test.
|
|
63
|
+
- Verify with assertions, never with a snapshot.
|
|
64
|
+
|
|
52
65
|
## Read the reference for the layer
|
|
53
66
|
|
|
54
67
|
Read the one reference matching the layer the table picked, before writing the first test at it. Skip the other two.
|
|
@@ -92,6 +105,5 @@ Run the final filter over every test written this session, checking each line. A
|
|
|
92
105
|
|
|
93
106
|
- The red, green, refactor procedure and its order: `test-first`, which loads this skill at its first step
|
|
94
107
|
- Reproducing a failure with no known cause: `systematic-debugging`
|
|
95
|
-
- Test structure floors such as arrange, act, assert, one behavior per test, isolation, and no snapshots: `010-testing`
|
|
96
108
|
- Runner, file suffix, placement, and query conventions per language: `300-testing-ts`, `330-testing-py`, `335-testing-go`, and `336-testing-php`
|
|
97
109
|
- Settle, guard, and run-scope rules inside an end to end file: `305-e2e-reliability` and `306-test-scope`
|
package/docs/agents/audits.md
CHANGED
|
@@ -85,7 +85,7 @@ It sits under the project root rather than beside the aggregator in `src/`. The
|
|
|
85
85
|
|
|
86
86
|
### What is kept out of it
|
|
87
87
|
|
|
88
|
-
A gitignored record folder holds one machine's session scratch. Its counts describe somebody else's disk, so committing them writes a floor no other clone can reproduce and every contributor reads a regression against a number that was never about their tree. The board and
|
|
88
|
+
A gitignored record folder holds one machine's session scratch. Its counts describe somebody else's disk, so committing them writes a floor no other clone can reproduce and every contributor reads a regression against a number that was never about their tree. The board and every record kind are therefore reported on every run and recorded in none.
|
|
89
89
|
|
|
90
90
|
An audit that did not report is left out rather than written as zero. Zero there records a clean corpus nobody measured, and the next run reads its real numbers as a regression against a floor that was never taken.
|
|
91
91
|
|
package/docs/agents/canvas.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Canvas
|
|
3
|
-
description: The canvas server, its content format, and the verbs that list, arrange, select, edit, mark, and capture frames
|
|
3
|
+
description: The canvas server, its content format, and the verbs that list, arrange, fit, select, edit, mark, and capture frames
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Canvas
|
|
@@ -29,6 +29,10 @@ The write routes the shell posts to also refuse a request carrying an `Origin` o
|
|
|
29
29
|
|
|
30
30
|
`frame resize <page> <name> --width <px> --height <px>` rewrites one frame's whole box in one write, and `--x` and `--y` move it at the same time. An omitted flag keeps the frame's current value. It refuses a width or height that is not a positive number as `invalid-size`, a position that is not a number as `invalid-position`, and a missing frame, a missing page, or a layout that does not parse as `frame move` does.
|
|
31
31
|
|
|
32
|
+
`canvas arrange <page>` re-lays a page's frames. It keeps the rows they already sit in, where boxes whose vertical spans overlap share a row, orders each row left to right by `x`, places the boxes on the 80px frame gap from the page's leftmost edge, and stacks the rows on their tallest box plus the gap from the page's top edge. It also drops every layout entry whose frame file is gone. `--check` writes nothing. `--json` emits `{ ok, page, written, moved, dropped }`, where `moved` lists each frame with its `from` and `to` position and `dropped` lists the entries with no file. Sizes never change. Under `--check` it exits 2 when a frame would move or an entry would drop, and it refuses a missing page as `no-page` and a layout that does not parse as `malformed-layout`.
|
|
33
|
+
|
|
34
|
+
`canvas fit <page>/<frame>` and `canvas fit <page>` set each frame's height to its content. The content is measured in the capture browser at the frame's box width, through the served address, after fonts and the load event settle, and the height is that measure rounded up with no margin. The write goes through the same writer as `frame resize`. `--check` writes nothing. `--json` emits `{ ok, written, frames }`, one row per frame carrying `height`, `fitted`, `wide`, `font`, `viewport`, `family`, and `owed`. `wide` is true when the content is wider than the box, which fit reports and never widens, since the width is the frame's declared render width. `font` is true when the first family of the body text is not one the served sheet declares a face for, being the toolkit faces `Geist Variable`, `Noto Sans Mono`, and the hand-drawn pair, plus any face the project declares, because a height fitted against a machine family may not hold in another browser. `viewport` is true when the frame's height depends on the viewport, as a height in `vh` does. The lowest element edge is read with the viewport at the box height and at twice it, and an edge that moved means the content measure is not the height a viewer draws, so its height is kept and nothing is written for it. Under `--check` it exits 2 when any row is owed, and it refuses as `no-page`, `no-frame`, `no-server`, or `capture-failed` the way `canvas capture` does. Rows below a frame that grew do not move, so run `canvas arrange` after a fit.
|
|
35
|
+
|
|
32
36
|
The shell writes through the same writer when the operator drags a frame or one of its corner handles. Both take a lock file beside the layout, read it, merge their change, and replace it, so a drag released while a verb writes loses neither position. A writer that cannot get the lock within two seconds refuses with reason `busy`.
|
|
33
37
|
|
|
34
38
|
`canvas selection --json` emits `{ ok, selection }` with the page, frame, file, box, and path of the frame the operator selected, or `selection: null` when nothing is selected or the selected frame has since been removed. Read it when the operator says "this one".
|
package/docs/agents/commands.md
CHANGED
|
@@ -19,7 +19,6 @@ One row per top-level command, in the order `canon --help` prints them. A domain
|
|
|
19
19
|
| `canon migrate <verb>` | Move a project off a retired name or layout, reporting the plan until `--write` |
|
|
20
20
|
| `canon targets <verb>` | Report the projects this toolkit installed into |
|
|
21
21
|
| `canon gov <verb>` | Install and sync governance rules, and audit the tree against them |
|
|
22
|
-
| `canon standards <verb>` | List, audit, or print a standard by name |
|
|
23
22
|
| `canon tooling <verb>` | Sync, diff, and verify tooling stacks |
|
|
24
23
|
| `canon claude <verb>` | Install the Claude workflow and audit both skill corpora |
|
|
25
24
|
| `canon wiki <verb>` | Scaffold the wiki pages |
|
|
@@ -61,7 +60,7 @@ A port already in use is the ordinary case rather than a refusal, so it walks fo
|
|
|
61
60
|
|
|
62
61
|
A request naming a directory is redirected to its trailing-slash form rather than answered in place. A browser resolves a relative asset against the last slash of the URL it is on, so answering `/lesson` directly leaves the page asking for `/course.css` instead of `/lesson/course.css`, and it renders unstyled through the server that exists to prevent exactly that.
|
|
63
62
|
|
|
64
|
-
Containment is tested after symlinks are followed rather than on the path as written, and the test sits immediately before the read rather than beside the request that produced it. Resolving a request lexically clears a link pointing outside the served root, and
|
|
63
|
+
Containment is tested after symlinks are followed rather than on the path as written, and the test sits immediately before the read rather than beside the request that produced it. Resolving a request lexically clears a link pointing outside the served root, and a link out of the served root is the shape it guards against. Position is what makes the property hold: a directory request appends its index after the request path has been checked, so a check placed earlier leaves that index untested. `--index` answers a directory holding no `index.html` with a listing read per request, where the default stays a 404. Every entry the listing names takes the same containment test a request for it would, so a link out of the root is absent rather than greyed, and dotfiles are hidden. With no `--entry` and no root `index.html`, the printed link is `/` and `entryExists` reads true. An `--entry` that escapes the root refuses with `no-entry` before a port is taken, because `url` is the field a caller hands to a reader.
|
|
65
64
|
|
|
66
65
|
`canon demo` is the second browser command and the one that ships, since its purpose is running in a target rather than regenerating what this repository commits. It needs a browser binary the package does not carry, installed once with `bunx playwright install chromium`.
|
|
67
66
|
|
|
@@ -84,7 +83,6 @@ Each domain exposes a consistent shape where applicable: `list`, `install`, `syn
|
|
|
84
83
|
- `migrate`, in `migrate.md`: `rename`, `skill-names`, `records`, `surface-roots`, `record-tree`, `rule-layout`, `scratch-evidence`, `record-layout`
|
|
85
84
|
- `targets`, in `targets.md`: `list`, `pulls`
|
|
86
85
|
- `gov`, in `install-and-sync.md`: `list`, `install`, `sync`, `build`, `regen`, `test-order`, `counts`, `superseded`, `citations`, `restated`
|
|
87
|
-
- `standards`, in `standards-audit.md`: `list`, `audit`, `<name>`
|
|
88
86
|
- `tooling`, in `install-and-sync.md`: `list`, `sync`, `diff`, `reference`, `verify`, `inject`, `prune-gitignore`
|
|
89
87
|
- `claude`, in `skills-audit.md`: `init`, `sync`, `setup`, `routing`, `plugin-update`, `seeds list`, `skills list`, `skills audit`, `skills drift`, `skills reach`, `skills rank`
|
|
90
88
|
- `wiki`, in `scripting.md`: `init`
|
|
@@ -103,7 +101,7 @@ Each domain exposes a consistent shape where applicable: `list`, `install`, `syn
|
|
|
103
101
|
- `sessions`, in `sessions.md`: `list`, `export`, `import`
|
|
104
102
|
- `worktrees`, in `worktrees.md`: `list`, `reclaim`
|
|
105
103
|
- `hooks`, in `hooks.md`: `post-merge`
|
|
106
|
-
- `pr`, in `pr-reads.md`: `key-changes`, `head`, `checks`, `review-state`, `evidence`, `preview`, `local`, `frames`
|
|
104
|
+
- `pr`, in `pr-reads.md`: `key-changes`, `head`, `checks`, `review-state`, `evidence`, `preview`, `local`, `frames`, `lift` (in `pr-lift.md`)
|
|
107
105
|
- `audits`, in `audits.md`: `run`, `list`
|
|
108
106
|
- `gate`, in `gate.md`: `run`
|
|
109
107
|
- `secrets`, in `state-scoped-risk.md`: `scan`
|
|
@@ -130,7 +128,7 @@ Subcommands no other page describes:
|
|
|
130
128
|
- A deck folder's `deck.json` and the faces it embeds, its per-slide `<body>` attributes, transitions and entrances, speaker notes, and charts are described in `slides.md`.
|
|
131
129
|
- `canvas`, with its verbs, content format, and write routes, is described in `canvas.md`.
|
|
132
130
|
- `labels apply <number>` adds the labels this branch earns to its open pull request, refusing a pull request whose head is not the current branch or that is not open, and never creating a label the remote lacks or removing one a person added (`--check` writes nothing and exits 2 when labels are owed, `--base`, `--json`).
|
|
133
|
-
- `labels scan` fails a pull request or a posted review whose title, body, or review comment carries a phase label, a label a code span quotes, a gitignored record path, a session link, a banned character, a body heading outside the closed section list or a missing `## Summary` or `## Key changes`,
|
|
131
|
+
- `labels scan` fails a pull request or a posted review whose title, body, or review comment carries a phase label, a label a code span quotes, a gitignored record path, a session link, a banned character, a body heading outside the closed section list or a missing `## Summary` or `## Key changes`, or a title breaking `claude/skills/git-pr/references/pr.md`'s format, casing, or length rule (`--event`, `--body-file`, `--json`).
|
|
134
132
|
|
|
135
133
|
## Version skew
|
|
136
134
|
|
package/docs/agents/counts.md
CHANGED
|
@@ -22,11 +22,10 @@ Under `--json` the record holds stdout alone and the frame still renders on stde
|
|
|
22
22
|
|
|
23
23
|
## The catalogs it reads
|
|
24
24
|
|
|
25
|
-
A closed set of
|
|
25
|
+
A closed set of four, each with a filesystem reader behind it rather than every list command this CLI ships:
|
|
26
26
|
|
|
27
27
|
- `skills`: shipped plugin skills, a folder per `claude/skills/*/SKILL.md`
|
|
28
28
|
- `rules`: authored governance rules, a file per `governance/rules/**/*.md`
|
|
29
|
-
- `standards`: the authoring corpus at `standards/`
|
|
30
29
|
- `commands`: top-level `canon` commands, read off `src/cli.ts`'s registration imports
|
|
31
30
|
- `audits`: the registered set in `src/audits/catalog.ts`, this entry included
|
|
32
31
|
|
|
@@ -36,7 +35,7 @@ The set is closed rather than derived, so widening it is a deliberate change to
|
|
|
36
35
|
|
|
37
36
|
A sentence has to carry an assertion verb (`loads`, `ships`, `carries`, `holds`, `counts`, `totals`, `documents`, `declares`, `installs`, `lists`, `contains`, `comprises`, `authors`), the quantifier `all`, or an article (`the`, `a`, `an`) immediately ahead of the number, which is immediately ahead of the catalog noun, with one optional qualifying word between the number and the noun (`sixty-one shipped skills`). The number reads either as digits or as a spelled-out cardinal through ninety-nine, since this corpus states a catalog size in words as often as in digits.
|
|
38
37
|
|
|
39
|
-
Nothing stands between the trigger and the number, which is the rule an author writing a new count has to know. It separates `the toolkit authors
|
|
38
|
+
Nothing stands between the trigger and the number, which is the rule an author writing a new count has to know. It separates `the toolkit authors 49 rules` and `took all 49 rules`, both read, from `a domain of 55 skills` and `denominator of sixty-one shipped skills`, neither of them read. A figure meant as a past state takes a date in the same sentence instead, which reads the sentence past whatever its shape.
|
|
40
39
|
|
|
41
40
|
## How the trigger set grew
|
|
42
41
|
|
|
@@ -44,7 +43,7 @@ The verb gate is not the first design tried. A bare number next to a catalog nou
|
|
|
44
43
|
|
|
45
44
|
The article half was added after a first review of the shipped design found a live miss: the development domain's gating-stages entry stated a stale audit total while the tree held 20, and the verb gate never reached it, since that sentence puts its verb after the noun rather than ahead of the number. Widening the trigger set to admit an article ahead of the number closed that gap.
|
|
46
45
|
|
|
47
|
-
The quantifier `all` and the verb `authors` joined on the same evidence, two more live misses failing only the trigger test. Allowing words to stand between the trigger and the number was the other candidate, measured and declined: at widths of one, two, and three it reached 77, 104, and 132 sentences against a baseline of 65, missed `took all
|
|
46
|
+
The quantifier `all` and the verb `authors` joined on the same evidence, two more live misses failing only the trigger test. Allowing words to stand between the trigger and the number was the other candidate, measured and declined: at widths of one, two, and three it reached 77, 104, and 132 sentences against a baseline of 65, missed `took all 49 rules` at every width, and reached `the toolkit authors 49 rules` only at a width admitting the indirect-noun shape below. The two words reach both at 75 sentences and no false positive.
|
|
48
47
|
|
|
49
48
|
## The plausibility filter
|
|
50
49
|
|
|
@@ -52,13 +51,13 @@ The verb gate alone still left four false positives standing: `carries two rules
|
|
|
52
51
|
|
|
53
52
|
A stated figure is read only when it sits within a factor of two of the true count, in either direction. That bound is tuned against the run this sweep was written against rather than reasoned to from first principles, the way `restated.ts` tunes its own document-frequency ceiling, and it is a property of the scale every catalog here sits at (the tens) rather than a universal rule.
|
|
54
53
|
|
|
55
|
-
The article gate is looser than the verb list and carries a real cost. Re-running against the tree once it widened caught the live miss above and also misread a passage in
|
|
54
|
+
The article gate is looser than the verb list and carries a real cost. Re-running against the tree once it widened caught the live miss above and also misread a passage in the standards destinations entry, since retired, naming a real subset, a standard outside the retired bundled fan-out, as a claim about the whole standards catalog. The qualifying adjective there fills the same optional-word slot `sixty-one shipped skills` needs to match at all, and no syntactic rule tells a qualifier that narrows a catalog from one that only restates it. The finding could not be closed by correcting a figure, since the sentence was true when the corpus held it, only unmarked as a past state, which is the class the date exclusion already reads past. Naming the moment, the same way a context entry dates its own figures, closed it with no change to the matcher.
|
|
56
55
|
|
|
57
56
|
## What it does not measure
|
|
58
57
|
|
|
59
58
|
A delta phrased as a transition (`from fourteen to fifteen`), a fraction (`thirteen of sixteen`), and a total reached through an indirect noun (`denominator of sixty-one shipped skills`) are all catalog-size claims this corpus carries, and none matches the trigger shape this reads. Each stays a known gap. The false-positive rate that gated closing them has a measurement behind it now, and what it showed is that the widening these three need is the one that costs a false positive rather than the one that does not.
|
|
60
59
|
|
|
61
|
-
A second figure in a sentence whose first figure already matched is a fourth gap and a structural one, since one match is taken per catalog per sentence. `authors
|
|
60
|
+
A second figure in a sentence whose first figure already matched is a fourth gap and a structural one, since one match is taken per catalog per sentence. `authors 49 rules under governance/rules/ and consumes 31 into .claude/rules/` is read for its 49 alone, which is correct here because the two figures name different populations, and a sentence stating one catalog twice would go unread the same way.
|
|
62
61
|
|
|
63
62
|
A calendar date (`2026-08-21`) or a backticked commit reference in the same sentence reads the whole sentence past, since that is how this corpus already marks a figure as a historical record rather than a live claim. The context entries carry a figure this way deliberately, and every one of them stays correct forever.
|
|
64
63
|
|