@cratis/pi 7.178.1 → 7.178.3
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/copilot/instructions/pull-requests.instructions.md +2 -1
- package/package/corpus/hooks/scripts/cratis-pattern-scan.sh +19 -13
- package/package/corpus/hooks/scripts/hook-lib.sh +6 -4
- package/package/corpus/rules/pull-requests.md +2 -1
- package/package/corpus/skills/cratis-commits-and-pull-requests/SKILL.md +3 -2
- package/package/corpus/skills/cratis-commits-and-pull-requests/references/pr-description.md +23 -0
- package/package.json +1 -1
|
@@ -5,13 +5,14 @@ applyTo: "**/*"
|
|
|
5
5
|
|
|
6
6
|
# How to Do Pull Requests
|
|
7
7
|
|
|
8
|
-
**Before writing any commit message, committing, pushing, or creating/editing a PR, read the `cratis-commits-and-pull-requests` skill.** It holds the
|
|
8
|
+
**Before writing any commit message, committing, pushing, or creating/editing a PR, read the `cratis-commits-and-pull-requests` skill.** It holds the description shape, forbidden list, examples, labels, grouping and release-action windows. Commit rules: [git-commits.md](./git-commits.instructions.md).
|
|
9
9
|
|
|
10
10
|
## The description is the release note
|
|
11
11
|
|
|
12
12
|
**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.
|
|
13
13
|
|
|
14
14
|
- Follow the repository's pull request template within this contract: an optional summary first, then only `## Added`, `## Changed`, `## Fixed`, `## Removed`, `## Security`, `## Deprecated`, each with short, user-facing bullets and none empty.
|
|
15
|
+
- No author-first-person narration, even in summaries or bullets; quoted UI text is allowed.
|
|
15
16
|
- Never put review, verification, test or CI results, provenance, merge or deploy instructions, internal state, relative links or placeholders in the description. **Reviewer-facing information goes in a PR comment** posted right after creating the PR (`gh pr comment <n> --body-file .ai-work/pr-notes.md`), even when the PR is labelled `no-release`.
|
|
16
17
|
- A change to a hook script or its wiring (`.cratis/ai/hooks/**`) needs a release-note line that tells consumers to run `cratis ai update`; a hook fix does not reach a repository until they do.
|
|
17
18
|
|
|
@@ -66,22 +66,28 @@ else
|
|
|
66
66
|
fi
|
|
67
67
|
|
|
68
68
|
# One record per line. Fields separated by US (0x1f); list members inside a field by SOH (0x01).
|
|
69
|
-
#
|
|
70
|
-
|
|
69
|
+
# Raw output preserves regex backslashes (@tsv would escape them). Emit list members separately:
|
|
70
|
+
# jq join repeatedly copies its growing string, making large glob lists quadratic.
|
|
71
|
+
records="$(printf '%s' "$merged" | jq -j '
|
|
72
|
+
def emit_joined($separator):
|
|
73
|
+
. as $items
|
|
74
|
+
| range(0; length) as $index
|
|
75
|
+
| (if $index > 0 then $separator else "" end),
|
|
76
|
+
([$items[$index]] | join(""));
|
|
71
77
|
.patterns // []
|
|
72
78
|
| map(select((.enabled // true) == true))
|
|
73
79
|
| .[]
|
|
74
|
-
| [ .id,
|
|
75
|
-
.
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
((.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
|
80
|
+
| [ ([ .id, .pattern, .message, (.rule // "") ] | join("")),
|
|
81
|
+
([ (.paths // ["**/*"]),
|
|
82
|
+
(.exclude_paths // []),
|
|
83
|
+
(.requires_in_file // []),
|
|
84
|
+
(.absent_in_file // []) ]
|
|
85
|
+
| .[] | "", emit_joined("")),
|
|
86
|
+
"",
|
|
87
|
+
([ (.within_type_attribute // ""),
|
|
88
|
+
((.join_lines // 1) | tostring) ] | join("")),
|
|
89
|
+
"\n" ]
|
|
90
|
+
| .[]
|
|
85
91
|
' 2>/dev/null || true)"
|
|
86
92
|
[ -n "$records" ] || exit 0
|
|
87
93
|
|
|
@@ -114,19 +114,21 @@ hook_glob_awk_lib='
|
|
|
114
114
|
'
|
|
115
115
|
|
|
116
116
|
# Does path $1 match any of the newline-separated globs on stdin?
|
|
117
|
+
# Drain stdin after a match: under pipefail, an upstream SIGPIPE would turn success into failure.
|
|
117
118
|
hook_glob_match() {
|
|
118
119
|
CRATIS_GLOB_PATH="$1" awk "$hook_glob_awk_lib"'
|
|
119
120
|
BEGIN { p = ENVIRON["CRATIS_GLOB_PATH"]; found = 0 }
|
|
121
|
+
found { next }
|
|
120
122
|
{ g = $0; sub(/^[ \t]+/, "", g); sub(/[ \t\r]+$/, "", g) }
|
|
121
123
|
g == "" { next }
|
|
122
|
-
{ if (p ~ g2re(g))
|
|
124
|
+
{ if (p ~ g2re(g)) found = 1 }
|
|
123
125
|
END { exit(found ? 0 : 1) }
|
|
124
126
|
'
|
|
125
127
|
}
|
|
126
128
|
|
|
127
129
|
# The other direction: print the FIRST newline-separated path on stdin matching any of the
|
|
128
130
|
# newline-separated globs in $1, and exit 0. Prints nothing and exits 1 when none matches,
|
|
129
|
-
# or when $1 holds no glob.
|
|
131
|
+
# or when $1 holds no glob. Like hook_glob_match, it drains stdin instead of exiting early.
|
|
130
132
|
#
|
|
131
133
|
# hook_glob_match answers "does this one path match?" and costs a process per path, which is
|
|
132
134
|
# right for the handful of changed files a hook sees. Discovery asks the mirror question over
|
|
@@ -142,12 +144,12 @@ hook_glob_first_match() {
|
|
|
142
144
|
}
|
|
143
145
|
found = 0
|
|
144
146
|
}
|
|
145
|
-
count == 0 {
|
|
147
|
+
count == 0 || found { next }
|
|
146
148
|
{ p = $0; sub(/[ \t\r]+$/, "", p) }
|
|
147
149
|
p == "" { next }
|
|
148
150
|
{
|
|
149
151
|
for (i = 1; i <= count; i++) {
|
|
150
|
-
if (p ~ res[i]) { print p; found = 1;
|
|
152
|
+
if (p ~ res[i]) { print p; found = 1; break }
|
|
151
153
|
}
|
|
152
154
|
}
|
|
153
155
|
END { exit(found ? 0 : 1) }
|
|
@@ -4,13 +4,14 @@ applyTo: "**/*"
|
|
|
4
4
|
|
|
5
5
|
# How to Do Pull Requests
|
|
6
6
|
|
|
7
|
-
**Before writing any commit message, committing, pushing, or creating/editing a PR, read the `cratis-commits-and-pull-requests` skill.** It holds the
|
|
7
|
+
**Before writing any commit message, committing, pushing, or creating/editing a PR, read the `cratis-commits-and-pull-requests` skill.** It holds the description shape, forbidden list, examples, labels, grouping and release-action windows. Commit rules: [git-commits.md](./git-commits.md).
|
|
8
8
|
|
|
9
9
|
## The description is the release note
|
|
10
10
|
|
|
11
11
|
**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.
|
|
12
12
|
|
|
13
13
|
- Follow the repository's pull request template within this contract: an optional summary first, then only `## Added`, `## Changed`, `## Fixed`, `## Removed`, `## Security`, `## Deprecated`, each with short, user-facing bullets and none empty.
|
|
14
|
+
- No author-first-person narration, even in summaries or bullets; quoted UI text is allowed.
|
|
14
15
|
- Never put review, verification, test or CI results, provenance, merge or deploy instructions, internal state, relative links or placeholders in the description. **Reviewer-facing information goes in a PR comment** posted right after creating the PR (`gh pr comment <n> --body-file .ai-work/pr-notes.md`), even when the PR is labelled `no-release`.
|
|
15
16
|
- A change to a hook script or its wiring (`.cratis/ai/hooks/**`) needs a release-note line that tells consumers to run `cratis ai update`; a hook fix does not reach a repository until they do.
|
|
16
17
|
|
|
@@ -20,8 +20,9 @@ Loading this skill grants no permission to push, publish, merge or mutate issues
|
|
|
20
20
|
when staging, writing a message or deciding when to commit. Stage specific
|
|
21
21
|
files and inspect `git diff --cached`; never commit an unbuildable unit.
|
|
22
22
|
2. Read [references/pr-description.md](references/pr-description.md) when writing
|
|
23
|
-
or editing a PR or manual release note. Write
|
|
24
|
-
work report. Only fully delivered issues
|
|
23
|
+
or editing a PR or manual release note. Write product-focused summaries and
|
|
24
|
+
bullets, not author narration or a work report. Only fully delivered issues
|
|
25
|
+
get a closing delivery reference.
|
|
25
26
|
3. Read [references/pr-labels-and-release.md](references/pr-labels-and-release.md)
|
|
26
27
|
when choosing or swapping a label, grouping related work, checking gates or
|
|
27
28
|
handling a release-action window. Confirm publication effects before applying
|
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
|
|
4
4
|
# The pull request description
|
|
5
5
|
|
|
6
|
+
## Contents
|
|
7
|
+
|
|
8
|
+
- Allowed shape
|
|
9
|
+
- Describe the product, not the author
|
|
10
|
+
- Issue references
|
|
11
|
+
- Forbidden anywhere outside code
|
|
12
|
+
- Keep the note true to the diff
|
|
13
|
+
- Bad to good
|
|
14
|
+
- Before you create or edit a PR
|
|
15
|
+
|
|
6
16
|
The contract (the description is the release note, the issue-reference rules, the reviewer-note rule) stays always-on in [pull-requests.md](../../../rules/pull-requests.md). This reference holds the detailed shape, the forbidden list and a worked example.
|
|
7
17
|
|
|
8
18
|
**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 `policy / verify` check enforces it on release-bound PRs into the default branch carrying `major`/`minor`/`patch` (it re-runs when the label is added); its release-note step 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, and `release-action` removes them before publishing, so a `(#n)` only inside a comment closes nothing; the check fails it, so never put an issue reference in a comment. The template's own comment can stay: its example issue references are inline code, and the comment is not published.
|
|
@@ -19,6 +29,19 @@ The contract (the description is the release note, the issue-reference rules, th
|
|
|
19
29
|
- Breaking changes and upgrade actions are bullets in `## Changed` or `## Removed` that state the action. A longer migration story goes in the docs, linked by absolute URL.
|
|
20
30
|
- Do not list internal plumbing (storage, converters, gRPC internals, specs, file lists, refactor narration).
|
|
21
31
|
|
|
32
|
+
## Describe the product, not the author
|
|
33
|
+
|
|
34
|
+
Flag and rewrite author-as-subject narration throughout the description, including an unheaded lead, `## Summary` and allowed-section bullets. Use product-focused imperative or declarative wording, not "I added", "we chose not to", "I deliberately" or a third-person work log such as "the author added". The subject is the feature or behavior, not the person or agent who produced it.
|
|
35
|
+
|
|
36
|
+
| Location | Wrong | Right |
|
|
37
|
+
| --- | --- | --- |
|
|
38
|
+
| Lead paragraph | I added resumable uploads. | Uploads resume after a connection interruption. |
|
|
39
|
+
| `## Summary` | We chose not to retry invalid commands because retries hide input errors; configurable retry delays are deferred. | Invalid commands fail without retries. |
|
|
40
|
+
| `## Fixed` bullet | - I deliberately kept failed uploads out of the history. | - Exclude failed uploads from history. |
|
|
41
|
+
| `## Added` bullet | - I added an "I agree" button to the consent dialog. | - Add an "I agree" button to the consent dialog. |
|
|
42
|
+
|
|
43
|
+
Quoted UI language such as a button labeled "I agree" is not author narration; preserve the actual UI text. Reviewer rationale, rejected alternatives and deferred implementation discussion go in the **PR comment**, not the description. For the Summary example, put why retries were rejected and the deferred delay work in that comment; publish only the delivered behavior.
|
|
44
|
+
|
|
22
45
|
## Issue references
|
|
23
46
|
|
|
24
47
|
| Write | Meaning |
|