mirror of
https://github.com/microsoft/BCQuality.git
synced 2026-10-05 14:46:55 +01:00
Fire haandhaevelseslag for [CURABIS-STATE]-tilstandssporet
Michael: "lad os bygge alle 4" - rangeret efter styrke fra sidste samtale. 1. Smiley v6: close-gaten laeser nu det faktiske [CURABIS-STATE]-spor tilbage FOER merge, i stedet for at stole paa sessionens egen hukommelse. Mangler et tidligere checkpoint, blokerer merge - selv hvis testen er groen og reviewet lige sagde APPROVE nu. 2. al-review v3: "state trail complete?" er nu et Titus-tjekpunkt der giver BLOCK, ikke bare en note - et ufuldstaendigt spor er i sig selv et vedligeholdelsesfund. 3. Ny .github/workflows/curabis-task-state-check.yml: reelt deterministisk haandhaevelse for AppSource (parser PR-body'ens tjekliste, fejler hvis en senere fase er tjekket mens en tidligere ikke er). Testet mod fire cases (gyldig raekkefolge, ugyldig, ingen sektion, tom sektion) - alle korrekte. Kraever et manuelt engangs-trin (branch protection required check) som filudrulningen ikke selv kan saette. 4. Roemer v6: ny station 13, retrospektiv - stikprover de sidste ~10 afsluttede BC-opgaver/mergede PR'er for spor-fuldstaendighed, fanger drift ingen enkelt opgaves egen gate fangede. Kun opgaver lukket efter 2026-08-03 flages - reglen fandtes ikke foer. curabis-standard.agent.md: ny artefakt-raekke + Mode A step 4h (deploy workflow-filen, mind om branch protection-trinet) + Mode B repo-tabel-raekke. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
bfc2c59cc9
commit
bcbc4acced
5 changed files with 137 additions and 3 deletions
|
|
@ -1,7 +1,7 @@
|
|||
---
|
||||
kind: action-skill
|
||||
id: curabis-al-review
|
||||
version: 2
|
||||
version: 3
|
||||
title: CURABIS AL independent review (Torvalds & Winters)
|
||||
description: Independent per-change code reviewer. Runs after the TDD green gate and before merge — the fourth checkpoint, separate from the implementer and from portfolio-level rule governance (Rømer/Immanuel/Court, who ask "is the ruleset healthy", not "is THIS change good"). Two lenses - Linus Torvalds (BC/AL domain-technical correctness, backward compatibility, performance, security) and Titus Winters (general software-engineering maintainability, architecture, complexity over time).
|
||||
inputs: [diff, task-description]
|
||||
|
|
@ -102,6 +102,15 @@ remember to request. See `smiley.agent.md`.
|
|||
- Consistency with the rest of the codebase
|
||||
- Should this even be implemented this way at all — not "does it work" but
|
||||
"is this the right way to have solved it"?
|
||||
- **State trail complete?** (2026-08-03) Read back the `[CURABIS-STATE]`
|
||||
comments (PTE) or PR checklist (AppSource) — `TASK_STARTED`,
|
||||
`RED_CONFIRMED`, `GREEN_CONFIRMED` must all be present before this review
|
||||
even runs. A missing earlier checkpoint is a maintainability finding in
|
||||
its own right: the record this task claims to have followed the lifecycle
|
||||
gates can't be trusted after the fact, which defeats the entire point of
|
||||
`[[task-state-lives-in-the-mandatory-artifact]]`. This is a BLOCKing
|
||||
finding, not a note — the fix is trivial (go check what actually happened
|
||||
and record it truthfully), so there's no reason to let it slide.
|
||||
|
||||
## Protocol
|
||||
|
||||
|
|
|
|||
77
custom/setup/templates/curabis-task-state-check.yml
Normal file
77
custom/setup/templates/curabis-task-state-check.yml
Normal file
|
|
@ -0,0 +1,77 @@
|
|||
name: CURABIS task-state check
|
||||
|
||||
# Deterministic enforcement (not LLM diligence) for the AppSource state-trail
|
||||
# format from task-state-lives-in-the-mandatory-artifact.md. Parses the PR
|
||||
# body for a "## CURABIS Task State" checklist and fails if any checked box
|
||||
# appears AFTER an unchecked one - i.e. a later stage claimed without an
|
||||
# earlier one. Silently passes (does nothing) if the section is absent -
|
||||
# this check only applies to PRs that actually opted into the state trail;
|
||||
# it must never block an unrelated PR (docs fix, infra change, etc.).
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [opened, edited, synchronize, reopened]
|
||||
|
||||
jobs:
|
||||
check-task-state-order:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Validate CURABIS Task State checklist order
|
||||
uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const body = context.payload.pull_request.body || "";
|
||||
const heading = "## CURABIS Task State";
|
||||
const headingIdx = body.indexOf(heading);
|
||||
if (headingIdx === -1) {
|
||||
console.log("No '## CURABIS Task State' section found - not a state-tracked PR, skipping.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Take everything after the heading up to the next "## " heading (or end of body).
|
||||
const rest = body.slice(headingIdx + heading.length);
|
||||
const nextHeadingIdx = rest.search(/\n##\s/);
|
||||
const section = nextHeadingIdx === -1 ? rest : rest.slice(0, nextHeadingIdx);
|
||||
|
||||
const lineRe = /^-\s*\[( |x|X)\]\s*(.+)$/gm;
|
||||
const items = [];
|
||||
let m;
|
||||
while ((m = lineRe.exec(section)) !== null) {
|
||||
items.push({ checked: m[1].toLowerCase() === "x", label: m[2].trim() });
|
||||
}
|
||||
|
||||
if (items.length === 0) {
|
||||
core.setFailed(
|
||||
"Found a '## CURABIS Task State' heading but no checklist lines under it " +
|
||||
"(expected '- [ ] ...' / '- [x] ...'). Either add the checklist or remove the heading."
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// Valid order is monotonic: once an item is unchecked, every item after it
|
||||
// must also be unchecked. A checked item after an unchecked one means a
|
||||
// later stage was marked done while an earlier one wasn't.
|
||||
let seenUnchecked = false;
|
||||
let brokenAt = -1;
|
||||
for (let i = 0; i < items.length; i++) {
|
||||
if (!items[i].checked) {
|
||||
seenUnchecked = true;
|
||||
} else if (seenUnchecked) {
|
||||
brokenAt = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (brokenAt !== -1) {
|
||||
const lines = items.map((it, i) =>
|
||||
` ${i === brokenAt ? ">>" : " "} [${it.checked ? "x" : " "}] ${it.label}`
|
||||
).join("\n");
|
||||
core.setFailed(
|
||||
"CURABIS Task State checklist is out of order - a later stage is checked " +
|
||||
"while an earlier one is not. A stage cannot be marked done before the ones " +
|
||||
"before it. Offending line marked with '>>':\n\n" + lines
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
console.log(`CURABIS Task State checklist order OK (${items.filter(i => i.checked).length}/${items.length} checked).`);
|
||||
Loading…
Add table
Add a link
Reference in a new issue