@cratis/pi 7.3.4 → 7.5.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/package/corpus/harnesses/pi/extensions/cratis-hooks/index.ts +19 -2
- package/package/corpus/hooks/README.md +59 -3
- package/package/corpus/hooks/scripts/cratis-check-pr.mjs +397 -0
- package/package/corpus/hooks/scripts/cratis-guard-pr-body.sh +41 -0
- package/package/corpus/hooks/scripts/cratis-release-notes-reviewed.cjs +867 -0
- package/package/corpus/hooks/settings.template.json +4 -0
- package/package/corpus/prompts/ship-changes.prompt.md +7 -2
- package/package/corpus/rules/pull-requests.md +15 -5
- package/package/corpus/skills/cratis-release-notes/SKILL.md +10 -7
- package/package/corpus/skills/cratis-release-notes/verification.json +4 -1
- package/package.json +1 -1
|
@@ -17,6 +17,10 @@
|
|
|
17
17
|
{
|
|
18
18
|
"type": "command",
|
|
19
19
|
"command": "\"$CLAUDE_PROJECT_DIR\"/.cratis/ai/hooks/scripts/cratis-guard-store-mutations.sh"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"type": "command",
|
|
23
|
+
"command": "\"$CLAUDE_PROJECT_DIR\"/.cratis/ai/hooks/scripts/cratis-guard-pr-body.sh"
|
|
20
24
|
}
|
|
21
25
|
]
|
|
22
26
|
}
|
|
@@ -14,7 +14,7 @@ branch → commits → PR → merge → issue disposition → cleanup workflow.
|
|
|
14
14
|
## Inputs
|
|
15
15
|
|
|
16
16
|
- **What changed** — brief description of the work (used for branch name and PR title)
|
|
17
|
-
- **Label** — `no-release`, `patch`, `minor`, or `major`,
|
|
17
|
+
- **Label** — exactly one of `no-release`, `patch`, `minor`, or `major`, selected from the repository's release contract and applied in `gh pr create --label <intent>`
|
|
18
18
|
- **Related issue** — optional exact repository and issue number; if unknown, search read-only first. Comment on or close it only when the user's request includes that effect; otherwise prepare the disposition as a proposal. In repositories released by `cratis/release-action`, a delivered issue is closed by release-action through `(#n)` in the description, but release-action does not run for a `no-release` PR, so `(#n)` closes nothing there; elsewhere follow the repository's own release and issue-closing process.
|
|
19
19
|
|
|
20
20
|
Invoking this prompt is direct authority for the standard branch, commit, push, pull-request,
|
|
@@ -39,11 +39,16 @@ The description is published verbatim as the release notes, so it follows the co
|
|
|
39
39
|
[`pull-requests.md`](../rules/pull-requests.md#the-description-is-the-release-note).
|
|
40
40
|
|
|
41
41
|
- Before `gh pr create` or `gh pr edit`, write the body from `.github/pull_request_template.md` and
|
|
42
|
-
|
|
42
|
+
save it to `.ai-work/pr-body.md`, and run `node .cratis/ai/hooks/scripts/cratis-check-pr.mjs --body-file .ai-work/pr-body.md --label <intent>`.
|
|
43
|
+
After a merge or rebase from main and before a body edit, reconcile every bullet with
|
|
44
|
+
`git diff --stat origin/main...HEAD`. The rules agents most often break:
|
|
43
45
|
- No development write-up: no Overview/Verification/Test plan headings (only a first `## Summary`
|
|
44
46
|
is allowed), no review, testing or provenance notes. Those go in a PR comment.
|
|
45
47
|
- `(#n)` ends the bullet that delivers an issue and `(part of #n)` marks anything that stays open;
|
|
46
48
|
never `Closes`/`Fixes`/`Refs` before a number, and never an issue reference inside an HTML comment,
|
|
47
49
|
which still closes the issue.
|
|
48
50
|
- Links are absolute `https://` URLs, never relative paths.
|
|
51
|
+
- Post reviewer notes (checks run, what was not verified, review provenance, stacking, merge or
|
|
52
|
+
deploy order) right after creating the PR with `gh pr comment <n> --body-file .ai-work/pr-notes.md`.
|
|
53
|
+
Never put them in the description, even for `no-release`.
|
|
49
54
|
- After pushing, if `verify-release-notes` fails, fix it by editing the description; it re-runs on edit.
|
|
@@ -6,7 +6,7 @@ applyTo: "**/*"
|
|
|
6
6
|
|
|
7
7
|
## The description is the release note
|
|
8
8
|
|
|
9
|
-
**The PR description is published verbatim as the GitHub release. In repositories released by `cratis/release-action`, it also closes every issue written as `(#n)`; elsewhere, follow the repository's own release and issue-closing process.** Write the note the person upgrading should read, not a development write-up. The same contract applies to release notes typed into a manual workflow run or written straight into a release. Where it is installed, the `verify-release-notes` check enforces it on
|
|
9
|
+
**The PR description is published verbatim as the GitHub release. In repositories released by `cratis/release-action`, it also closes every issue written as `(#n)`; elsewhere, follow the repository's own release and issue-closing process.** Write the note the person upgrading should read, not a development write-up. The same contract applies to release notes typed into a manual workflow run or written straight into a release. Where it is installed, the `verify-release-notes` check enforces it on release-bound PRs into the default branch carrying `major`/`minor`/`patch` (it re-runs when the label is added); it warns on `no-release` and unlabelled PRs, which must still be written this way because any of them may become releasable. `release-action` does not run for a `no-release` PR, so `(#n)` closes nothing there. Editing the description re-runs the check. HTML comments are not shown on the release page and the check ignores them for headings, keywords and placeholders, but a `(#n)` inside a comment still closes the issue (`release-action` skips only fenced and inline code) and the check fails it, so never put an issue reference in a comment. The template's own comment can stay: its `(#123)` examples are inline code.
|
|
10
10
|
|
|
11
11
|
### Allowed shape
|
|
12
12
|
|
|
@@ -36,11 +36,18 @@ applyTo: "**/*"
|
|
|
36
36
|
|
|
37
37
|
- **Headings** (any level, also written as HTML `<h2>`, `<b>`, `<i>` or a possibly multi-line `<summary>`, or as an `*italic*` line; a heading line is checked like any other, so a keyword, relative link or `(#n)` in one fails too) other than a first `## Summary`, such as Overview, Description, What, Why, How, Context, Changes, What changed, Test plan, Testing, Tests, Verification, Verified, Validation, Quality, Review, Notes, Notes for reviewers, Limitations, Known follow-up, Acceptance, Details, and any `#`/`##` heading not in the allowed list.
|
|
38
38
|
- **Review, verification, testing and provenance notes**: `Review:`, `Reviewed:`, a stand-alone `Reviewed by` line, `Verification:`, `Tested:`, `Testing:`, `Validation:` lines that stand alone or report a result (`Tests: 400 passed`, `Review: approved`); same-provider, cross-provider, Opus-only or Anthropic-only review remarks; the review workflow having passed, returned or run; CI or gate results (`CI green`, `all tests passed`); and a line stating which agent or model wrote the description (`Generated with Claude Code`, `Co-Authored-By:`). A bullet that describes a product change and only mentions review, validation, tests or an AI model (`- Validation: rules now apply to commands (#3)`, `- Reviewed by status is now shown on the dashboard (#4)`) is fine: inside a bullet, a summary or the lead paragraph the check reads a note only when it ends the clause (`- Cross-provider review pending`).
|
|
39
|
+
- **Verification and scope notes**: how or where something was checked (`verified by building …`, `verified in Storybook`, `tested locally`, `Storybook only`), what was not checked (`not yet verified`, `Not verified against a real kernel`), and results (`492/492`, `9 of 9 runs`, `Tier 1 PASS`, `0 warnings, 0 errors`, a `Local:`, `CI:`, `Checks:` or `Checked locally:` line).
|
|
40
|
+
- **Reviewer, merge and deploy instructions**: `Stacked on #207`, `retarget to main once #207 merges`, `This PR should be deployed separately`, `Draft:`, `do not merge`, merge or deploy order. If a consumer must upgrade in a set order, write that as an upgrade bullet ("Upgrade the Chronicle kernel to 19.25 before this client").
|
|
41
|
+
- **Provenance**: which branch, commit or build something was checked against (`verified against Arc.TypeScript main (v0.34.0)`). If compatibility matters to the reader, state it as a fact about the release: "Requires `@cratis/arc` 0.34 or later."
|
|
39
42
|
- **Internal state** that is not a consumer change (for example "npm publication remains disabled").
|
|
40
43
|
- **Relative links** (`](Documentation/x.md)`, `](./x)`, `](Source/...)`): they 404 on the release page. Use `https://github.com/Cratis/<Repo>/blob/main/<path>`, a `#anchor` or `mailto:`.
|
|
41
44
|
- **Placeholders and transcripts**: template text, empty sections, Copilot "Original prompt" blocks, agent transcripts.
|
|
42
45
|
|
|
43
|
-
Reviewer-facing information (test plan, verification, review provenance,
|
|
46
|
+
Reviewer-facing information (test plan, verification, what was not verified, review provenance, stacking, merge or deploy order) goes in a **PR comment** posted right after creating the PR: `gh pr comment <n> --body-file .ai-work/pr-notes.md`. Never put it in the description, even when the PR is labelled `no-release`.
|
|
47
|
+
|
|
48
|
+
### Keep the note true to the diff
|
|
49
|
+
|
|
50
|
+
After merging or rebasing the base branch, and before every body edit, run `git diff --stat origin/main...HEAD`. Delete each bullet whose change is now on main through another PR, or was dropped in conflict resolution. Check every version, package name and registry against the diff and the current `.github/workflows/publish*.yml`; never name a registry the publish workflow does not push to.
|
|
44
51
|
|
|
45
52
|
### Bad to good
|
|
46
53
|
|
|
@@ -74,9 +81,10 @@ Arc can now construct Chronicle reactors and reducers through its own dependency
|
|
|
74
81
|
|
|
75
82
|
### Before you create or edit a PR
|
|
76
83
|
|
|
77
|
-
1.
|
|
78
|
-
2.
|
|
79
|
-
3.
|
|
84
|
+
1. Run `node .cratis/ai/hooks/scripts/cratis-check-pr.mjs --body-file <file> --label <intent>`. It runs the exact `verify-release-notes` rules plus the label and diff checks, and the Bash hook runs it on `gh pr create` and `gh pr edit`.
|
|
85
|
+
2. Read the body against the forbidden list and the issue table above; delete every hit and verify every issue number.
|
|
86
|
+
3. Sections in order, none empty, at most one summary form; every bullet user-facing.
|
|
87
|
+
4. Test plan, verification and review notes are in a PR comment.
|
|
80
88
|
|
|
81
89
|
If `verify-release-notes` fails, fix it by editing the description, not by pushing code.
|
|
82
90
|
|
|
@@ -94,6 +102,8 @@ Quick reminders:
|
|
|
94
102
|
|
|
95
103
|
Confirm the current repository workflow contract before selecting release intent because release-intent labels can trigger publication. A direct request to ship with a named label authorizes applying that label and completing the repository's standard pull-request workflow, including the release it normally triggers. Do not ask for separate authorization at each step. If the user did not request shipping or publication, a proposed semantic label describes impact but does not grant authority.
|
|
96
104
|
|
|
105
|
+
- Exactly one of `major`/`minor`/`patch`/`no-release`, set in the creating command (`gh pr create --label patch`), in every repository, including samples, docs and tooling repositories (`no-release` when nothing is shipped). To change intent, swap labels in one command: `gh pr edit <n> --remove-label minor --add-label patch`. Never add a second.
|
|
106
|
+
- Dependabot PRs carry only `no-release`. release-action never releases them, and the `major`/`minor`/`patch` Dependabot adds describe the dependency's version, not this product's.
|
|
97
107
|
- Label the PR according to semantic versioning impact:
|
|
98
108
|
- **major** — breaking changes to public APIs
|
|
99
109
|
- **minor** — new features, new slices, non-breaking additions
|
|
@@ -29,14 +29,16 @@ For each change, ask: who uses this path, what happened before, what happens
|
|
|
29
29
|
now, is action required, and how would they notice? Check changed defaults,
|
|
30
30
|
serialization/schema/data migrations, runtime and dependency compatibility,
|
|
31
31
|
deploy ordering, deprecations/removals, and upgrade/rollback limits. Report
|
|
32
|
-
|
|
32
|
+
what was not verified to the requester or in a PR comment; the published note
|
|
33
|
+
states only verified facts and never says 'not verified'.
|
|
33
34
|
|
|
34
35
|
Cratis products move together at their seams: the Chronicle kernel and its
|
|
35
36
|
clients, Arc and Chronicle, Components and Arc. When a change touches a
|
|
36
|
-
seam, state
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
seam, state supported pairings as facts the reader can act on ('Requires
|
|
38
|
+
Chronicle kernel 19.25 or later'). Which pairings were tested, and against
|
|
39
|
+
which branch or commit, is evidence for the PR comment. There is no central
|
|
40
|
+
compatibility matrix to defer to, so the release note may be the only place
|
|
41
|
+
a reader learns the supported pairings. Where a measurement drove the change,
|
|
40
42
|
such as how many deployments hit a failure, give the number; never estimate
|
|
41
43
|
one to add weight.
|
|
42
44
|
|
|
@@ -125,8 +127,9 @@ Only when asked to fix a release that violates the contract:
|
|
|
125
127
|
metadata, and explicit `**You do:**` actions.
|
|
126
128
|
Check `sync-upgrade-paths.mjs` and an existing guide before changing that
|
|
127
129
|
structure, then verify the generated picker as well as the page.
|
|
128
|
-
4. Name the checks actually run and the combinations not checked
|
|
129
|
-
|
|
130
|
+
4. Name the checks actually run and the combinations not checked to the
|
|
131
|
+
requester or in a PR comment, never in the published note. Do not imply
|
|
132
|
+
that a green docs build proved an upgrade safe.
|
|
130
133
|
|
|
131
134
|
The pattern is informed by [Wolverine's migration guide](https://wolverinefx.io/guide/migration.html)
|
|
132
135
|
and [Marten's migration guide](https://martendb.io/migration-guide.html),
|
|
@@ -9,6 +9,9 @@
|
|
|
9
9
|
{ "kind": "skill-contains", "value": "drafting never authorizes publishing" },
|
|
10
10
|
{ "kind": "skill-contains", "value": "`(part of #n)`" },
|
|
11
11
|
{ "kind": "skill-contains", "value": "gh release edit TAG --notes-file" },
|
|
12
|
-
{ "kind": "skill-contains", "value": "does not re-run release-action" }
|
|
12
|
+
{ "kind": "skill-contains", "value": "does not re-run release-action" },
|
|
13
|
+
{ "kind": "skill-contains", "value": "states only verified facts and never says 'not verified'" },
|
|
14
|
+
{ "kind": "skill-contains", "value": "state supported pairings as facts" },
|
|
15
|
+
{ "kind": "skill-contains", "value": "which branch or commit, is evidence for the PR comment" }
|
|
13
16
|
]
|
|
14
17
|
}
|