@clipboard-health/ai-rules 2.41.1 → 2.42.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.json +1 -1
- package/skills/cb-babysit/SKILL.md +4 -4
- package/skills/cb-babysit/scripts/_sentinel.sh +1 -1
- package/skills/cb-ship/references/pr-template.md +1 -1
- package/skills/flaky-closeout/SKILL.md +281 -0
- package/skills/flaky-closeout/references/acceptance-report-2026-07-17.md +110 -0
- package/skills/flaky-closeout/references/comment-templates.md +58 -0
- package/skills/flaky-critic/SKILL.md +41 -2
- package/skills/flaky-critic/references/backtests/2026-07-16-b8-prior-attempts/answer-key.json +242 -0
- package/skills/flaky-critic/references/backtests/2026-07-16-b8-prior-attempts/cohort.md +37 -0
- package/skills/flaky-critic/references/backtests/2026-07-16-b8-prior-attempts/input-hashes.txt +20 -0
- package/skills/flaky-critic/references/backtests/2026-07-16-b8-prior-attempts/inputs/case-01.md +141 -0
- package/skills/flaky-critic/references/backtests/2026-07-16-b8-prior-attempts/inputs/case-02.md +115 -0
- package/skills/flaky-critic/references/backtests/2026-07-16-b8-prior-attempts/inputs/case-03.md +24 -0
- package/skills/flaky-critic/references/backtests/2026-07-16-b8-prior-attempts/inputs/case-04.md +85 -0
- package/skills/flaky-critic/references/backtests/2026-07-16-b8-prior-attempts/inputs/case-05.md +78 -0
- package/skills/flaky-critic/references/backtests/2026-07-16-b8-prior-attempts/inputs/case-06.md +82 -0
- package/skills/flaky-critic/references/backtests/2026-07-16-b8-prior-attempts/inputs/case-07.md +128 -0
- package/skills/flaky-critic/references/backtests/2026-07-16-b8-prior-attempts/inputs/case-08.md +99 -0
- package/skills/flaky-critic/references/backtests/2026-07-16-b8-prior-attempts/inputs/case-09.md +107 -0
- package/skills/flaky-critic/references/backtests/2026-07-16-b8-prior-attempts/inputs/case-10.md +141 -0
- package/skills/flaky-critic/references/backtests/2026-07-16-b8-prior-attempts/inputs/case-11.md +98 -0
- package/skills/flaky-critic/references/backtests/2026-07-16-b8-prior-attempts/inputs/case-12.md +99 -0
- package/skills/flaky-critic/references/backtests/2026-07-16-b8-prior-attempts/inputs/case-13.md +25 -0
- package/skills/flaky-critic/references/backtests/2026-07-16-b8-prior-attempts/inputs/case-14.md +111 -0
- package/skills/flaky-critic/references/backtests/2026-07-16-b8-prior-attempts/inputs/case-15.md +27 -0
- package/skills/flaky-critic/references/backtests/2026-07-16-b8-prior-attempts/inputs/case-16.md +46 -0
- package/skills/flaky-critic/references/backtests/2026-07-16-b8-prior-attempts/inputs/case-17.md +101 -0
- package/skills/flaky-critic/references/backtests/2026-07-16-b8-prior-attempts/inputs/case-18.md +88 -0
- package/skills/flaky-critic/references/backtests/2026-07-16-b8-prior-attempts/inputs/case-19.md +98 -0
- package/skills/flaky-critic/references/backtests/2026-07-16-b8-prior-attempts/inputs/case-20.md +91 -0
- package/skills/flaky-critic/references/backtests/2026-07-16-b8-prior-attempts/verdicts.jsonl +20 -0
- package/skills/flaky-critic/references/backtests/2026-07-16-b8-prior-attempts.md +170 -0
- package/skills/flaky-critic/references/rubric.md +17 -2
package/package.json
CHANGED
|
@@ -19,9 +19,9 @@ Resolve bundled "./scripts" paths relative to SKILL.md.
|
|
|
19
19
|
|
|
20
20
|
The skill uses two sentinels with visible footer lines.
|
|
21
21
|
|
|
22
|
-
**Addressed sentinel**: `<sub>🤖 <code>cb-babysit:addressed v1 core@3.
|
|
22
|
+
**Addressed sentinel**: `<sub>🤖 <code>cb-babysit:addressed v1 core@3.21.0</code></sub>`. Appended on its own line at the end of every reply the skill posts so re-runs know which threads and review-body comments are already handled. Dedupe also recognizes the legacy `babysit-pr:addressed v1` prefix from before this skill was renamed.
|
|
23
23
|
|
|
24
|
-
**Follow-up sentinel**: `<sub>🤖 <code>cb-babysit:followup v1 core@3.
|
|
24
|
+
**Follow-up sentinel**: `<sub>🤖 <code>cb-babysit:followup v1 core@3.21.0</code></sub>`. Attached to replies that defer an out-of-scope comment as a tracked follow-up. The sentinel is additive: the post-reply scripts still append the `addressed` sentinel at the end.
|
|
25
25
|
|
|
26
26
|
**Sentinel recency rules.** The script emits a per-thread `activityState` with three values. Step 6a owns the handling rules for each state.
|
|
27
27
|
|
|
@@ -247,7 +247,7 @@ Body templates (the script appends the `addressed` sentinel if missing):
|
|
|
247
247
|
- **Agree**: `Addressed in <commit-url>. <one-line what-changed>.`
|
|
248
248
|
- **Disagree**: `Leaving current behavior. <reasoning>.`
|
|
249
249
|
- **Already fixed**: `Already handled by <commit-url-or-file:line>. <brief pointer>.`
|
|
250
|
-
- **Defer**: `Out of scope for this PR; this looks like follow-up work rather than something introduced or required by this change. <one-line rationale or pointer if useful>.\n\n<sub>🤖 <code>cb-babysit:followup v1 core@3.
|
|
250
|
+
- **Defer**: `Out of scope for this PR; this looks like follow-up work rather than something introduced or required by this change. <one-line rationale or pointer if useful>.\n\n<sub>🤖 <code>cb-babysit:followup v1 core@3.21.0</code></sub>`
|
|
251
251
|
|
|
252
252
|
For Defer replies, include the follow-up sentinel on its own line as shown. The script will append the `addressed` sentinel after it on its own line, so the final body ends with the follow-up sentinel followed by a blank line followed by the `addressed` sentinel. `grep cb-babysit:followup` finds the deferral and `grep cb-babysit:addressed` still marks the thread handled for dedupe.
|
|
253
253
|
|
|
@@ -263,7 +263,7 @@ The PR-level summary should:
|
|
|
263
263
|
|
|
264
264
|
- Group by source. Use `## Review-body findings` for step-7 work and `## Conversation-tab comments` for step-6b work. Omit a section if its list is empty.
|
|
265
265
|
- Inside each section, group verdicts under **Agree / Disagree / Already fixed / Deferred (out of scope)** subheadings. Omit a subheading if its list is empty.
|
|
266
|
-
- Under **Deferred (out of scope)**, list each deferred item as a bullet, followed on its own line by `<sub>🤖 <code>cb-babysit:followup v1 core@3.
|
|
266
|
+
- Under **Deferred (out of scope)**, list each deferred item as a bullet, followed on its own line by `<sub>🤖 <code>cb-babysit:followup v1 core@3.21.0</code></sub>` so grep catches them individually.
|
|
267
267
|
- Include the commit URL for fixes.
|
|
268
268
|
- End with a fenced fingerprint block listing every current fingerprint (addressed and deferred) one per line. Include both `reviewBodyComments[].fingerprint` (whole-body, one per automated review) and `activeIssueComments[].fingerprint` (per Conversation-tab comment). Future runs dedupe by matching these against `priorBabysitSentinels`.
|
|
269
269
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
SENTINEL_PREFIX='cb-babysit:addressed v1 '
|
|
12
12
|
LEGACY_SENTINEL_PREFIX='babysit-pr:addressed v1 '
|
|
13
|
-
SENTINEL='<sub>🤖 <code>cb-babysit:addressed v1 core@3.
|
|
13
|
+
SENTINEL='<sub>🤖 <code>cb-babysit:addressed v1 core@3.21.0</code></sub>'
|
|
14
14
|
|
|
15
15
|
# Bot author allowlist (JSON array literal). Used by unresolvedPrComments.sh
|
|
16
16
|
# as a fallback when GraphQL's `author.__typename == "Bot"` misses a GitHub
|
|
@@ -17,5 +17,5 @@ Concisely explain the user intent from session history and the meaningful behavi
|
|
|
17
17
|
|
|
18
18
|
Optional, don't fabricate: ticket links, rollout plan, residual risk, or specific areas for reviewers to focus.
|
|
19
19
|
|
|
20
|
-
<sub>🤖 <code>cb-ship:created v1 core@3.
|
|
20
|
+
<sub>🤖 <code>cb-ship:created v1 core@3.21.0</code></sub>
|
|
21
21
|
```
|
|
@@ -0,0 +1,281 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: flaky-closeout
|
|
3
|
+
description: Sweep the flaky-test pipeline after fixes merge by closing out the root-cause KB, closing clearly superseded tickets as Done under D3, and re-dispatching critic-rejected plans for amendment. Use for the recurring flaky close-out task, a post-merge flaky-fix sweep, or a dry-run/backtest of close-out decisions.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<!-- cspell:ignore backtest backtesting groundcrew redispatch worktree -->
|
|
7
|
+
|
|
8
|
+
# Flaky Closeout
|
|
9
|
+
|
|
10
|
+
Run three post-merge sweeps in one read-first, write-later pass. This stage
|
|
11
|
+
maintains the pipeline's learning and dispatch loops; it does not diagnose new
|
|
12
|
+
root causes or implement product fixes.
|
|
13
|
+
|
|
14
|
+
Read these files before deciding or writing:
|
|
15
|
+
|
|
16
|
+
- `../flaky-debug/references/fix.md` for the KB close-out contract.
|
|
17
|
+
- `../flaky-debug/references/root-cause-kb/README.md` and every plausible KB
|
|
18
|
+
entry.
|
|
19
|
+
- `../flaky-critic/SKILL.md` and its rubric for D3, marker, and second-reject
|
|
20
|
+
semantics.
|
|
21
|
+
- `../create-groundcrew-ticket/SKILL.md` for dispatch eligibility.
|
|
22
|
+
- `../blind-backtest/SKILL.md` when running `--backtest`.
|
|
23
|
+
- [Comment templates](./references/comment-templates.md) before posting.
|
|
24
|
+
|
|
25
|
+
## Invariants
|
|
26
|
+
|
|
27
|
+
- Never cancel a ticket. Cancel authority remains human-only.
|
|
28
|
+
- Close a superseded ticket as **Done**, not Canceled or Duplicate. Done enters
|
|
29
|
+
the 21-day verifying window so the recurrence loop can reopen a false
|
|
30
|
+
supersession.
|
|
31
|
+
- Require a clear mechanism match before D3 closure: the same KB entry or
|
|
32
|
+
causal mechanism **and** the same failure-signature class.
|
|
33
|
+
- Decide the complete action ledger before any external write.
|
|
34
|
+
- Search existing comments for the exact marker before every write. A marker is
|
|
35
|
+
a lease for that action, not a substitute for checking current state.
|
|
36
|
+
- Batch all KB changes from one run into one focused `core-utils` PR. Never
|
|
37
|
+
commit directly to the default branch and never auto-merge.
|
|
38
|
+
- Do not schedule or re-arm this skill. When invoked by a recurring task, follow
|
|
39
|
+
re-arm instructions from the task description only after the digest.
|
|
40
|
+
|
|
41
|
+
## Modes and window
|
|
42
|
+
|
|
43
|
+
Support these modes:
|
|
44
|
+
|
|
45
|
+
- **Production:** perform reads, build the ledger, then write.
|
|
46
|
+
- **`--dry-run`:** perform every read and decision, but make no Linear, GitHub,
|
|
47
|
+
git, or repository write. Print the exact proposed comments, state changes,
|
|
48
|
+
and KB diff plan. Represent the unavailable KB PR URL as
|
|
49
|
+
`<future KB PR for run <run-key>>`.
|
|
50
|
+
- **`--backtest`:** imply `--dry-run` and follow `../blind-backtest/SKILL.md`.
|
|
51
|
+
Freeze the requested historical cutoff and keep judgments isolated from the
|
|
52
|
+
answer key. If separate assembler and judge contexts are unavailable, stop
|
|
53
|
+
and report that the blind protocol cannot be satisfied.
|
|
54
|
+
|
|
55
|
+
Before the first production run for a new rule revision, run a backtest and a
|
|
56
|
+
current dry run as separate invocations. Do not promote from historical results
|
|
57
|
+
alone.
|
|
58
|
+
|
|
59
|
+
Use an explicit `--since` value or the last successful-run timestamp supplied
|
|
60
|
+
by the recurring task, subtracting three days for overlap. If neither exists,
|
|
61
|
+
look back 21 days. Accept `--bounce-age-days`; default to 3. Print the effective
|
|
62
|
+
window, overlap, cutoff, and bounce age in the digest.
|
|
63
|
+
|
|
64
|
+
## Phase 1: Build the source manifest
|
|
65
|
+
|
|
66
|
+
Start these independent discovery reads concurrently:
|
|
67
|
+
|
|
68
|
+
- primary merged-PR search;
|
|
69
|
+
- missing-label Linear fallback;
|
|
70
|
+
- non-terminal flaky-ticket universe;
|
|
71
|
+
- bounced-ticket queue.
|
|
72
|
+
|
|
73
|
+
After discovery, deduplicate ticket IDs and fetch each full issue and comment set
|
|
74
|
+
once. Cache the records for the entire run.
|
|
75
|
+
|
|
76
|
+
### Merged-fix manifest
|
|
77
|
+
|
|
78
|
+
Search merged PRs across the `ClipboardHealth` organization:
|
|
79
|
+
|
|
80
|
+
1. Primary source: every merged PR carrying `flaky-test-fix` in the effective
|
|
81
|
+
window. Paginate; do not trust a single result page.
|
|
82
|
+
2. Label-hygiene fallback: recent `flaky-implementation` and chronic deep-dive
|
|
83
|
+
tickets whose linked PR merged in the window and demonstrably fixed a flaky
|
|
84
|
+
mechanism, even when the PR omitted the label. Require the PR body or Linear
|
|
85
|
+
attachment to identify the source ticket. Record a missing-label digest
|
|
86
|
+
risk; do not mutate PR labels.
|
|
87
|
+
3. Exclude closed-unmerged PRs. Deduplicate by repository and PR number.
|
|
88
|
+
|
|
89
|
+
Build a cheap first-pass PR record:
|
|
90
|
+
|
|
91
|
+
- repository, PR URL, merge timestamp, merge commit, title, and labels;
|
|
92
|
+
- source Linear ticket ID from the PR body or attachment;
|
|
93
|
+
- cached source ticket ID and related-ticket IDs.
|
|
94
|
+
|
|
95
|
+
Hydrate changed files, diff, detailed validation evidence, and full related
|
|
96
|
+
tickets only after a pending KB close-out or plausible D3 join makes the PR
|
|
97
|
+
actionable. From the hydrated records, extract `KB match:`, pending
|
|
98
|
+
`Knowledge-base close-out`, causal mechanism, signature class, validation
|
|
99
|
+
evidence, and every flake sighting timestamp.
|
|
100
|
+
|
|
101
|
+
If a PR lacks a source ticket ID, report it as unresolved and take no close-out
|
|
102
|
+
action for it.
|
|
103
|
+
|
|
104
|
+
### Bounce manifest
|
|
105
|
+
|
|
106
|
+
List `flaky-implementation` tickets in Triage. Fetch each issue and all comments;
|
|
107
|
+
list results truncate descriptions.
|
|
108
|
+
|
|
109
|
+
Keep a ticket only when it has:
|
|
110
|
+
|
|
111
|
+
- a critic marker with `mode=enforce` and `verdict=reject`; current markers also
|
|
112
|
+
carry `disposition=amend-and-resubmit` or
|
|
113
|
+
`disposition=substantive-reject`, while legacy markers may omit disposition;
|
|
114
|
+
- a verdict older than the bounce-age threshold;
|
|
115
|
+
- no later plan amendment that addresses the verdict;
|
|
116
|
+
- no completed close-out re-dispatch for that verdict.
|
|
117
|
+
|
|
118
|
+
Use the verdict comment ID when available; otherwise use its timestamp. A later
|
|
119
|
+
issue edit is only a possible amendment: read the current plan and confirm that
|
|
120
|
+
it addresses each cited rule before skipping re-dispatch.
|
|
121
|
+
|
|
122
|
+
Treat `verdict=needs-human disposition=second-reject` as terminal
|
|
123
|
+
`needs-human`. Also classify two enforce-mode rejects separated by a plan
|
|
124
|
+
amendment as `needs-human` when processing older marker formats. Never
|
|
125
|
+
re-dispatch either case; include it in the digest for Rocky.
|
|
126
|
+
|
|
127
|
+
A re-dispatch marker on a ticket that is still Groundcrew-ineligible means
|
|
128
|
+
`eligibility mutation pending`, not `skip`. Resume only the missing eligibility
|
|
129
|
+
changes; do not post the comment again.
|
|
130
|
+
|
|
131
|
+
Phase 1 is complete only when every manifest item has full ticket descriptions
|
|
132
|
+
and comments. Do not decide against truncated list results.
|
|
133
|
+
|
|
134
|
+
## Phase 2: Sweep KB close-outs
|
|
135
|
+
|
|
136
|
+
Inspect both the source ticket and related or superseded implementation tickets.
|
|
137
|
+
A pending close-out can live on a different fingerprint family than the PR that
|
|
138
|
+
fixed its mechanism.
|
|
139
|
+
|
|
140
|
+
For every pending close-out:
|
|
141
|
+
|
|
142
|
+
1. Confirm the target PR merged. If not, leave it pending and report it.
|
|
143
|
+
2. Resolve the plan's `KB match:` to an existing entry. If the plan says none,
|
|
144
|
+
create a new entry only when the evidenced causal terminus is genuinely new.
|
|
145
|
+
3. Compare the plan, merged diff, validation, and related recurrence. Prepare
|
|
146
|
+
the required dry-run statement from `flaky-debug/references/fix.md`.
|
|
147
|
+
4. Record:
|
|
148
|
+
- the recurrence or variant addressed;
|
|
149
|
+
- the landed fix and PR;
|
|
150
|
+
- any newly established partial or failed-scope lesson;
|
|
151
|
+
- affected repository/surface, evidence, current status, and `Last reviewed`;
|
|
152
|
+
- symptom-index changes only when the new signature is more discriminating.
|
|
153
|
+
5. Deduplicate updates by KB entry and mechanism. One PR can close several
|
|
154
|
+
tickets; one KB entry should receive one coherent edit.
|
|
155
|
+
|
|
156
|
+
Use this completed-action marker only after the focused KB PR exists:
|
|
157
|
+
|
|
158
|
+
```html
|
|
159
|
+
<!-- flaky-closeout: kb-done pr=<full-core-utils-pr-url> -->
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
After the action ledger is complete, sort each KB action as
|
|
163
|
+
`<entry-path>|<source-PR>|<affected-ticket-IDs>` and hash the resulting list.
|
|
164
|
+
Derive the run key from the recurring task's scheduled occurrence ID or exact
|
|
165
|
+
UTC cutoff timestamp plus the first 12 characters of that ledger hash. Use
|
|
166
|
+
deterministic branch `flaky-closeout/<run-key>` and put this marker in the PR
|
|
167
|
+
body:
|
|
168
|
+
|
|
169
|
+
```html
|
|
170
|
+
<!-- flaky-closeout: kb-run=<run-key> ledger=<full-hash> -->
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Before creating a branch or PR, search that exact head branch. Reuse an open or
|
|
174
|
+
merged PR only when its trusted PR-body marker has the same run key and full
|
|
175
|
+
ledger hash. A different ledger always gets a different run key, even on the
|
|
176
|
+
same day. This verified PR lookup is the idempotency key when a prior run
|
|
177
|
+
created the KB PR but failed before commenting on every ticket.
|
|
178
|
+
|
|
179
|
+
In production, create a fresh `core-utils` worktree on that branch, apply every
|
|
180
|
+
recorded KB edit, run `node --run sync-ai-rules` and `node --run verify` with the
|
|
181
|
+
repository Node version, and ship one PR through the repository's
|
|
182
|
+
`cb-work`/`cb-ship` workflow. Link the PR in a close-out comment on every
|
|
183
|
+
affected ticket. If the PR cannot be created, do not post the marker; report
|
|
184
|
+
the failure and leave the close-out retryable. If the PR exists, reuse it and
|
|
185
|
+
retry only missing ticket comments.
|
|
186
|
+
|
|
187
|
+
## Phase 3: Sweep supersessions under D3
|
|
188
|
+
|
|
189
|
+
From the Phase 1 cache, build indexes over every non-terminal ticket labeled
|
|
190
|
+
`flaky-investigation` or `flaky-implementation`: normalized KB entry, causal
|
|
191
|
+
mechanism, signature class, source PR, and fingerprint family. Join every
|
|
192
|
+
merged fix against those indexes. Do not limit the join to the source
|
|
193
|
+
fingerprint family and do not repeat the organization-wide ticket scan per PR.
|
|
194
|
+
|
|
195
|
+
Use the KB mechanism as the cross-family join key:
|
|
196
|
+
|
|
197
|
+
1. Resolve each candidate's `KB match:` line. If it has no line, require
|
|
198
|
+
equivalent explicit causal evidence in its plan; text similarity alone is
|
|
199
|
+
insufficient.
|
|
200
|
+
2. Confirm the merged PR fixes the same causal locus, not merely a nearby
|
|
201
|
+
symptom.
|
|
202
|
+
3. Confirm the signature class matches, such as provider-topology remount,
|
|
203
|
+
query-row overlay teardown, Cognito alias lookup, or CDC readiness.
|
|
204
|
+
4. Parse the candidate's earliest relevant sighting timestamp and prove it is
|
|
205
|
+
earlier than the PR merge timestamp. If no reliable sighting time exists, do
|
|
206
|
+
not close.
|
|
207
|
+
5. Check that the ticket has no post-merge recurrence for that mechanism.
|
|
208
|
+
|
|
209
|
+
Classify the candidate:
|
|
210
|
+
|
|
211
|
+
- **Clear match:** stage the D3 comment from
|
|
212
|
+
[comment templates](./references/comment-templates.md), then set the ticket to
|
|
213
|
+
Done. Include the PR, mechanism, sighting and merge timestamps, 21-day
|
|
214
|
+
verifying window, and recurrence-loop reopen safety net.
|
|
215
|
+
- **Ambiguous:** stage one possible-supersession comment tagging Rocky and leave
|
|
216
|
+
state unchanged.
|
|
217
|
+
- **No match:** take no action.
|
|
218
|
+
|
|
219
|
+
Markers:
|
|
220
|
+
|
|
221
|
+
```html
|
|
222
|
+
<!-- flaky-closeout: superseded-by=<full-source-pr-url> -->
|
|
223
|
+
<!-- flaky-closeout: possible-supersession pr=<full-source-pr-url> -->
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Post the clear-match comment before setting Done. If the state update fails,
|
|
227
|
+
retain the comment marker and retry only the missing state change on the next
|
|
228
|
+
run. A supersession marker on a still-open ticket therefore means
|
|
229
|
+
`state-change pending`, not `skip`. Never change a ticket to Canceled.
|
|
230
|
+
|
|
231
|
+
## Phase 4: Sweep bounced plans
|
|
232
|
+
|
|
233
|
+
For each eligible first-bounce ticket:
|
|
234
|
+
|
|
235
|
+
1. Quote the decisive critic verdict and rule IDs.
|
|
236
|
+
2. State the exact plan amendment required; do not propose the implementation
|
|
237
|
+
fix yourself.
|
|
238
|
+
3. Validate every field against the eligibility contract in
|
|
239
|
+
`../create-groundcrew-ticket/SKILL.md`.
|
|
240
|
+
4. Post the re-plan instruction with the verdict-specific marker, then make only
|
|
241
|
+
the state, assignee, and label changes required to restore eligibility. Do
|
|
242
|
+
not rewrite repository, parent, or blocker semantics.
|
|
243
|
+
|
|
244
|
+
Do not re-dispatch when a later plan already addresses the verdict, the same
|
|
245
|
+
verdict marker exists, or this is the second bounce. Leave second bounces in
|
|
246
|
+
Triage and list them as `needs-human`.
|
|
247
|
+
|
|
248
|
+
## Phase 5: Execute and verify
|
|
249
|
+
|
|
250
|
+
In production, execute the already-decided ledger in this order:
|
|
251
|
+
|
|
252
|
+
1. Create the single KB PR and add KB close-out comments.
|
|
253
|
+
2. Post D3 or possible-supersession comments and apply D3 state changes.
|
|
254
|
+
3. Post bounce instructions and restore Groundcrew eligibility.
|
|
255
|
+
|
|
256
|
+
Execute each ticket's ordered mutation bundle, then refetch it once. Verify only
|
|
257
|
+
the marker, state, assignee, labels, relations, and linked PR fields that bundle
|
|
258
|
+
could change. Preserve individual mutation failures in the ledger so the next
|
|
259
|
+
run can reconcile marker versus state. Continue independent actions after one
|
|
260
|
+
failure, but never claim a failed action succeeded.
|
|
261
|
+
|
|
262
|
+
In dry-run or backtest, print the same ordered ledger with exact comment bodies
|
|
263
|
+
and state mutations, prefixed `WOULD`; write nothing.
|
|
264
|
+
|
|
265
|
+
## Phase 6: Digest
|
|
266
|
+
|
|
267
|
+
End with:
|
|
268
|
+
|
|
269
|
+
- effective window, mode, merged PR count, source-ticket resolution count, and
|
|
270
|
+
missing-label fallbacks;
|
|
271
|
+
- KB entries and tickets updated, pending, skipped by marker, and KB PR URL;
|
|
272
|
+
- D3 closed, possible supersessions, no-match candidates, and state failures;
|
|
273
|
+
- bounce candidates, re-dispatched, already amended, marker-skipped, and
|
|
274
|
+
needs-human;
|
|
275
|
+
- every ambiguity, missing timestamp, missing ticket ID, incomplete evidence,
|
|
276
|
+
or failed write.
|
|
277
|
+
|
|
278
|
+
When backtesting, use the blind-backtest output contract. See the checked-in
|
|
279
|
+
[2026-07-17 acceptance report](./references/acceptance-report-2026-07-17.md).
|
|
280
|
+
It records a targeted historical check, not a reusable backtest fixture or
|
|
281
|
+
approval for future live rule revisions.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
<!-- cspell:ignore backtest -->
|
|
2
|
+
|
|
3
|
+
# 2026-07-17 Acceptance Report
|
|
4
|
+
|
|
5
|
+
This is a targeted, write-free acceptance check for the handoff examples. It is
|
|
6
|
+
not a promotion-grade blind backtest, a reusable test fixture, or a replacement
|
|
7
|
+
for live shadow agreement.
|
|
8
|
+
|
|
9
|
+
## Cohort and cutoff
|
|
10
|
+
|
|
11
|
+
- Window: `2026-06-26T00:00:00Z` through `2026-07-17T14:30:00Z`.
|
|
12
|
+
- Primary PR scan: 31 merged `flaky-test-fix` PRs: 23 in
|
|
13
|
+
`cbh-admin-frontend`, five in `cbh-mobile-app`, and three in
|
|
14
|
+
`clipboard-health`.
|
|
15
|
+
- Source-ticket resolution: 30 of 31 primary PRs carry a `STAFF-*` ID in the
|
|
16
|
+
title or body. `clipboard-health#26528` is unresolved and therefore produces
|
|
17
|
+
no action.
|
|
18
|
+
- Merged fix: `ClipboardHealth/cbh-admin-frontend#7608`, merged
|
|
19
|
+
`2026-07-17T13:08:25Z`, source ticket `STAFF-1846`.
|
|
20
|
+
- Supersession candidate: `STAFF-1856`, sighting
|
|
21
|
+
`2026-07-16T14:30:36Z`.
|
|
22
|
+
- Bounce cohort: `STAFF-1860`, `STAFF-1862`, `STAFF-1868`, `STAFF-1873`, and
|
|
23
|
+
`STAFF-1874`; critic verdicts were posted around `2026-07-17T12:09Z`.
|
|
24
|
+
- Bounce evaluation time: `2026-07-17T14:30:00Z` with
|
|
25
|
+
`--bounce-age-days=0`. This override tests verdict detection and routing;
|
|
26
|
+
production retains the three-day default so later amendments can suppress
|
|
27
|
+
re-dispatch.
|
|
28
|
+
|
|
29
|
+
The decision pass uses ticket plans, verdict text, PR body and diff metadata,
|
|
30
|
+
merge time, and sighting time. Human close-out outcomes are used only in the
|
|
31
|
+
result comparison.
|
|
32
|
+
|
|
33
|
+
The KB contract landed at the end of this window. A full-description Linear
|
|
34
|
+
search for `KB close-out` found two implementation plans: `STAFF-1856`, whose
|
|
35
|
+
mechanism was fixed by merged #7608, and `STAFF-1874`, whose proposed fix had
|
|
36
|
+
not merged and therefore remains pending. The bounce scan found the five named
|
|
37
|
+
Triage tickets below.
|
|
38
|
+
|
|
39
|
+
## Proposed dry-run actions
|
|
40
|
+
|
|
41
|
+
### KB close-out
|
|
42
|
+
|
|
43
|
+
`STAFF-1856` contains a pending close-out for
|
|
44
|
+
`query-driven-list-dialog-teardown.md`. PR #7608 fixes the provider-topology
|
|
45
|
+
variant that remounted the authenticated route above the open Home Health menu.
|
|
46
|
+
|
|
47
|
+
Expected update:
|
|
48
|
+
|
|
49
|
+
- Add the provider-topology recurrence as another replaceable-ancestor surface.
|
|
50
|
+
- Record #7608 and its delayed or immediate-token regression coverage.
|
|
51
|
+
- Record that the dialog-only hoist in #7574 was correctly scoped but could not
|
|
52
|
+
prevent a remount from a higher provider boundary.
|
|
53
|
+
- Link the resulting focused `core-utils` KB PR from `STAFF-1856` and
|
|
54
|
+
`STAFF-1846`.
|
|
55
|
+
|
|
56
|
+
### D3 supersession
|
|
57
|
+
|
|
58
|
+
Would close `STAFF-1856` as Done under D3:
|
|
59
|
+
|
|
60
|
+
- same terminal cause: token-dependent `KnockProviderWrapper` topology switch
|
|
61
|
+
remounts the authenticated route;
|
|
62
|
+
- same signature class: an already-resolved menu item detaches before its user
|
|
63
|
+
action starts;
|
|
64
|
+
- sighting `2026-07-16T14:30:36Z` predates merge
|
|
65
|
+
`2026-07-17T13:08:25Z`;
|
|
66
|
+
- #7608 changed the same composition files named by the plan and added the
|
|
67
|
+
requested token-resolution regression.
|
|
68
|
+
|
|
69
|
+
The PR lacked the `flaky-test-fix` label, so it is admitted only through the
|
|
70
|
+
linked flaky deep-dive ticket fallback and reported as a label-hygiene risk.
|
|
71
|
+
|
|
72
|
+
### Bounce re-dispatch
|
|
73
|
+
|
|
74
|
+
Would re-dispatch each first bounce to Todo for plan amendment:
|
|
75
|
+
|
|
76
|
+
| Ticket | Verdict gap to carry into the re-plan instruction |
|
|
77
|
+
| ---------- | ----------------------------------------------------------------------------------------- |
|
|
78
|
+
| STAFF-1860 | C1 requires same-identity reconciliation after ambiguous 504, fresh identity on collision |
|
|
79
|
+
| STAFF-1862 | A3 plan must state fake-timer restoration in `afterEach` |
|
|
80
|
+
| STAFF-1868 | B1 forbids token-minting refresh retries without non-amplifying control |
|
|
81
|
+
| STAFF-1873 | B1/B6/B8 require no uncapped 429 retry and a terminated causal chain |
|
|
82
|
+
| STAFF-1874 | B1/B6/B8 require no uncapped 429 retry and a terminated owning-service cause |
|
|
83
|
+
|
|
84
|
+
No ticket had a prior closeout re-dispatch marker or a second critic rejection
|
|
85
|
+
at the frozen cutoff. Their critic comments use the legacy
|
|
86
|
+
`verdict=reject mode=enforce` marker without a disposition field; the bounce
|
|
87
|
+
scan accepts that enforce-only shape while still excluding shadow markers.
|
|
88
|
+
|
|
89
|
+
## Outcome comparison
|
|
90
|
+
|
|
91
|
+
- **D3:** match. Rocky's `STAFF-1856` close-out cited #7608, the exact mechanism,
|
|
92
|
+
the pre-merge sighting, Done, the 21-day verifying window, and recurrence
|
|
93
|
+
reopen behavior.
|
|
94
|
+
- **KB:** match. The human close-out explicitly transferred the
|
|
95
|
+
provider-topology recurrence, #7608, and the dialog-only-hoist scope lesson to
|
|
96
|
+
the KB close-out.
|
|
97
|
+
- **Bounces:** all five verdicts are detected with the required amendment
|
|
98
|
+
content. This report evaluates routing, not whether the later planner
|
|
99
|
+
produced an acceptable amendment.
|
|
100
|
+
|
|
101
|
+
## Limitations
|
|
102
|
+
|
|
103
|
+
- The cohort was selected from named handoff examples and is not balanced.
|
|
104
|
+
- The #7608 missing-label fallback is necessary for this case but needs live
|
|
105
|
+
monitoring for false inclusion.
|
|
106
|
+
- The acceptance check does not grade ambiguous supersession precision,
|
|
107
|
+
second-bounce handling, KB edit quality across multiple entries, or live
|
|
108
|
+
tool/write idempotency.
|
|
109
|
+
- Before production scheduling, run a larger blind backtest and a live
|
|
110
|
+
write-free shadow pass.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
<!-- cspell:ignore redispatch -->
|
|
2
|
+
|
|
3
|
+
# Flaky Closeout Comment Templates
|
|
4
|
+
|
|
5
|
+
Fill every placeholder from fetched evidence. Do not post a state-changing
|
|
6
|
+
template with an unknown timestamp, mechanism, or PR. A possible-supersession
|
|
7
|
+
comment may use its explicit missing-timestamp statement because it leaves state
|
|
8
|
+
unchanged.
|
|
9
|
+
|
|
10
|
+
## KB close-out
|
|
11
|
+
|
|
12
|
+
```markdown
|
|
13
|
+
<Use the canonical final close-out statement from
|
|
14
|
+
flaky-debug/references/fix.md verbatim.>
|
|
15
|
+
|
|
16
|
+
<!-- flaky-closeout: kb-done pr=<KB PR URL> -->
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Clear D3 supersession
|
|
20
|
+
|
|
21
|
+
```markdown
|
|
22
|
+
Already fixed (D3): covered by merged PR <source PR URL> from <source ticket>.
|
|
23
|
+
It fixes the same mechanism: <mechanism and causal locus>. This ticket's
|
|
24
|
+
<signature class> sighting at <sighting timestamp> predates the merge at
|
|
25
|
+
<merge timestamp>.
|
|
26
|
+
|
|
27
|
+
Closing Done: the family enters the 21-day verifying window. If this mechanism
|
|
28
|
+
flakes again, the recurrence loop reopens the ticket with its history.
|
|
29
|
+
|
|
30
|
+
<!-- flaky-closeout: superseded-by=<source PR URL> -->
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Possible supersession
|
|
34
|
+
|
|
35
|
+
```markdown
|
|
36
|
+
@Rocky Warren possible supersession: merged PR <source PR URL> may cover this
|
|
37
|
+
ticket through <shared mechanism>, but <specific ambiguity> prevents a D3
|
|
38
|
+
closure. The relevant sighting is <timestamp or missing-timestamp statement>.
|
|
39
|
+
Please confirm the mechanism match; state is unchanged.
|
|
40
|
+
|
|
41
|
+
<!-- flaky-closeout: possible-supersession pr=<source PR URL> -->
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Bounce re-dispatch
|
|
45
|
+
|
|
46
|
+
```markdown
|
|
47
|
+
Re-dispatching for plan amendment after the critic verdict at <verdict link or
|
|
48
|
+
timestamp>.
|
|
49
|
+
|
|
50
|
+
Required amendment:
|
|
51
|
+
|
|
52
|
+
- <rule ID>: <specific missing or contradicted plan statement>
|
|
53
|
+
|
|
54
|
+
Amend the plan against the verdict, preserve the existing investigation
|
|
55
|
+
evidence, and resubmit it to the critic before implementation.
|
|
56
|
+
|
|
57
|
+
<!-- flaky-closeout: bounce-redispatch verdict=<comment ID or timestamp> -->
|
|
58
|
+
```
|
|
@@ -47,9 +47,15 @@ VERDICT: reject — B2, B6
|
|
|
47
47
|
- B2: "increase the navigation timeout to 30s" — timeout inflation without a root-cause statement of why the operation is legitimately slow.
|
|
48
48
|
- B6: plan states confidence 3/5 but has no observability-to-reach-5/5 section.
|
|
49
49
|
Fix class claimed: A1 (readiness gate). Missing required evidence: polled signal is not shown to be the one the failing UI path uses.
|
|
50
|
-
<!-- flaky-critic: verdict=reject mode=enforce -->
|
|
50
|
+
<!-- flaky-critic: verdict=reject mode=enforce disposition=substantive-reject statement-missing=B6 substantive=B2 -->
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
+
- Every verdict marker must record `disposition`, `statement-missing`, and `substantive`. Use comma-separated rule tokens and `none` when a bucket is empty. Distinguish B5's checks as `B5-dedup` and `B5-prior-attempts`; use the normal rule ID for every other rule. Use these dispositions:
|
|
54
|
+
- approve: `verdict=approve disposition=release statement-missing=none substantive=none`;
|
|
55
|
+
- statement-only reject: `verdict=reject disposition=amend-and-resubmit`;
|
|
56
|
+
- any demonstrated violation: `verdict=reject disposition=substantive-reject`;
|
|
57
|
+
- low-confidence or out-of-taxonomy escalation: `verdict=needs-human disposition=needs-human`;
|
|
58
|
+
- second reject on revised content: `verdict=needs-human disposition=second-reject`.
|
|
53
59
|
- **enforce**: approve → move the ticket to Todo and assign it to the Linear API user. Reject → comment and leave in Triage; the investigating flow gets one bounce. A second reject on the same ticket → comment `needs-human` and stop touching it.
|
|
54
60
|
- **shadow**: comment only, prefixed `[shadow]`, marker `mode=shadow`.
|
|
55
61
|
- **needs-human**: comment with what the rubric cannot answer; never move the ticket.
|
|
@@ -60,7 +66,40 @@ When you encounter a ticket where a human's action contradicts your prior verdic
|
|
|
60
66
|
|
|
61
67
|
## Phase 5: Digest
|
|
62
68
|
|
|
63
|
-
End with: tickets reviewed, verdicts by type with rule-ID counts, agreement events observed (human actions vs prior verdicts), amendment proposals drafted,
|
|
69
|
+
End with: tickets reviewed, verdicts by type with rule-ID counts, agreement events observed (human actions vs prior verdicts), amendment proposals drafted, tickets skipped as already-current, and the monitoring block below. When run as a recurring task, this digest is the run's final message.
|
|
70
|
+
|
|
71
|
+
### B8 and Prior-attempts monitoring
|
|
72
|
+
|
|
73
|
+
Monitor the first 14 days after both rules are live: **starting 2026-07-16 and ending before 2026-07-30**. During the window, query Groundcrew `flaky-implementation` tickets updated on or after 2026-07-16 across all states and read their full comments; list results and the current queue are not a cumulative data source. Recompute the window from `mode=enforce` critic markers so the result survives separate sessions.
|
|
74
|
+
|
|
75
|
+
On or after 2026-07-30, coordinate finalization on STAFF-1818 with deterministic run key `2026-07-16--2026-07-30`:
|
|
76
|
+
|
|
77
|
+
Only honor coordination markers authored by the configured Linear API user that runs flaky-critic. Read authorship and creation time from Linear's server-provided comment metadata; embedded `claimed-at` and `lease-until` values are descriptive, not authority. Ignore markers from other authors, markers with a mismatched run key, future-dated markers, and leases whose server creation time plus the documented duration has expired. For linked GitHub or Linear actions, also require the expected repository or project, exact title suffix, run key, and an artifact author/creator attributable to the same trusted automation.
|
|
78
|
+
|
|
79
|
+
1. If a trusted `<!-- flaky-critic: b8-prior-monitoring-finalized run=2026-07-16--2026-07-30 -->` is present, omit this monitoring block.
|
|
80
|
+
2. Otherwise post `<!-- flaky-critic: b8-prior-monitoring-claim run=2026-07-16--2026-07-30 claimed-at=<ISO timestamp> -->`, then re-read all comments. The earliest trusted non-stale claim by server creation time wins; later claimants stop. A claim is stale 60 minutes after its server creation time when no trusted action or finalized marker exists, allowing a later run to take over.
|
|
81
|
+
3. Before creating side effects, search STAFF-1818 comments, Linear tickets, and GitHub PRs for a trusted `<!-- flaky-critic: b8-prior-monitoring-action run=2026-07-16--2026-07-30 -->`. Reuse the validated linked action when present.
|
|
82
|
+
4. When a new action is required, the claim winner posts `<!-- flaky-critic: b8-prior-monitoring-action-started run=2026-07-16--2026-07-30 owner=<claim comment ID> lease-until=<ISO timestamp> -->` with a four-hour lease, then re-reads STAFF-1818. The earliest trusted unexpired action lease wins; later action starters stop. Calculate expiry from the server creation time, require `owner` to reference the winning trusted claim, and treat renewals as new trusted comments from that owner. Renew before invoking `cb-work` and at least every three hours while work continues.
|
|
83
|
+
5. Revalidate trusted ownership and repeat the action search immediately before any PR or ticket creation. Search-and-re-read is a secondary guard, not the uniqueness mechanism: the creator must use a server-enforced idempotency key or unique external ID derived from the run key. For GitHub, use deterministic head branch `flaky-critic-monitoring/2026-07-16--2026-07-30`; if branch or PR creation reports that it already exists, look up and reuse the existing PR. A Linear fallback ticket may be created only when the available creator provides an atomic idempotency or uniqueness facility; otherwise post `needs-human` on STAFF-1818 instead of risking a duplicate. The `cb-work` request must carry these requirements through its shipping step. Any new PR or ticket must carry the action marker, an exact `STAFF-1818 monitoring` title suffix, and the deterministic run key. A takeover is allowed only after the prior trusted action lease expires with no validated action marker.
|
|
84
|
+
6. Run the final aggregation and complete any threshold or amendment action below. Post the final digest and all action links to STAFF-1818 with the finalized marker. Write it only after required actions exist.
|
|
85
|
+
|
|
86
|
+
- **Denominator — gated plans:** one verdict marker per unique ticket content-state in the window, including approve, reject, and needs-human. Exclude shadow/backtest verdicts, PR-checkpoint comments, and already-current skips. The one-verdict-per-content-state rule makes each marker one denominator event.
|
|
87
|
+
- **Numerator — statement-missing bounces:** gated plans whose marker has `disposition=amend-and-resubmit` and names `B8` or `B5-prior-attempts` in `statement-missing`. Count a plan once in the headline numerator even when both rules fired; also report per-rule attribution, where one plan may count under both.
|
|
88
|
+
- **Substantive rejects:** report `B8` and `B5-prior-attempts` substantive counts separately. When a human later releases one, compare the cases by mechanism. Any systematic substantive false-reject pattern, regardless of rate, requires a concrete rubric amendment proposal for Rocky's approval using `<!-- flaky-critic: amendment-proposal -->`; never edit or weaken the rubric silently.
|
|
89
|
+
- **Harness-contract watch:** record every plan that invokes B8's harness-contract terminus, including whether the critic accepted an evidenced contract or rejected a generic detach, timeout, 401, or retry-success symptom as laundering. Compare later human outcomes for both accepted and rejected cases. Report any repeated stretch pattern in the substantive-pattern finding; do not broaden the exception from monitoring evidence without Rocky's per-PR approval.
|
|
90
|
+
- **Threshold:** report the cumulative statement-missing numerator, denominator, percentage, and per-rule attribution as provisional during the window. When the denominator is zero, report `N=0`, omit the percentage as not evaluable, and do not trigger a breach. At the window close, **more than 25%** triggers a fix-forward change in the narrowest flaky-debug plan-producing source: normally `references/plan.md` for a missing output field, or `SKILL.md` when the investigation flow failed to collect the required evidence. `plan-e2e.md` and `plan-fast-path.md` already converge on the shared output template; do not duplicate requirements across them. Invoke `core:cb-work`/`cb-work` against `ClipboardHealth/core-utils` with the observed omission and required template change; if that workflow is unavailable, create a linked Groundcrew implementation ticket only through the atomic uniqueness path above. Include the resulting PR or ticket link in the final digest before writing the finalization marker. Do not change B8 or the Prior-attempts gate to reduce the rate.
|
|
91
|
+
|
|
92
|
+
Use this digest shape:
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
New-rule monitoring (2026-07-16..<2026-07-30):
|
|
96
|
+
- gated plans: N
|
|
97
|
+
- statement-missing amend-and-resubmit: N — rate: P% | not evaluable (when gated plans=0) — B8: N, B5-prior-attempts: N
|
|
98
|
+
- substantive rejects — B8: N, B5-prior-attempts: N
|
|
99
|
+
- harness-contract terminus watch: N invoked — accepted: N, laundering rejects: N, human reversals: N
|
|
100
|
+
- threshold: provisional | pass | breached — <fix-forward action or "none">
|
|
101
|
+
- substantive false-reject patterns: <amendment proposal links or "none observed">
|
|
102
|
+
```
|
|
64
103
|
|
|
65
104
|
## PR checkpoint (when the task description asks for it)
|
|
66
105
|
|