Merge fix/weakcheck-next into main
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by oscabriel · committed by oscabriel · parents b7d2873, 1246a35 · Browse files · 5 files·+33 added−3 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
5 files+33 added−3 removed
- tests:+31 added−1 removed
- other:+2 added−2 removed
Provenance
- Commit
95c7310- Tree
d8adef5- Author
oscabriel <oscarhernandeziv@gmail.com>- Committer
oscabriel <oscarhernandeziv@gmail.com>- Parent 1
b7d2873- Parent 2
1246a35
5 files changed+33 added−3 removed
modified:packages/agent-kit/src/refusals.ts+1 added-1 removed
171 unmodified lines172 nextNames: `${code(cli("env", "set", "<key>"))}, with ${code("--acknowledge-short")} when the value is above the floor`,173 todo: "Give a longer value, or acknowledge a short one where the floor allows it.",174 },175 WeakCheck: {176- todo: "Strengthen the check: as it stands, the trivial answer `weakness` names would pass it.",176+ todo: "Strengthen the check: as it stands, the trivial answer `weakness` names would pass it. Then open the ask again with `next`. The local check cannot judge an ask that has not opened.",177 },178 } as const satisfies Record<Exclude<Tag, AnswerTag>, Repair>;179 180 const repairOf = new Map<string, Repair>(Object.entries(repairs));116 unmodified linesmodified:packages/agent-kit/test/golden/full-llms.txt+1 added-1 removed
78 unmodified lines79 | `AttemptsExhausted` | Checks | yes | 75 | `__CLI__ status` | Wait until `resetsAt`: you used every attempt on that area's held-back checks for now. |80 | `Flake` | Never counted against the answerer | yes | 75 | `__CLI__ status` | Nothing: the check failed and then passed on the same tree, and the platform runs it again. |81 | `VerifierBlocked` | Never counted against the answerer | yes | 75 | `__CLI__ status` | Nothing: the platform could not run the checks, and runs them again. |82 | `NotRedFirst` | At ask open | no | 65 | `__CLI__ ask open <ask> --project <owner>/<name>` | Make the ask's check fail on main twice the same way, with a failing assertion, not a load or syntax error: run the lane's command on it yourself, then open the ask again with `next`. The local check cannot judge an ask that has not opened. |83-| `WeakCheck` | At ask open | no | 65 | `__CLI__ check` | Strengthen the check: as it stands, the trivial answer `weakness` names would pass it. |83+| `WeakCheck` | At ask open | no | 65 | `__CLI__ ask open <ask> --project <owner>/<name>` | Strengthen the check: as it stands, the trivial answer `weakness` names would pass it. Then open the ask again with `next`. The local check cannot judge an ask that has not opened. |84 | `IncompleteBrief` | At ask open | no | 65 | `__CLI__ ask open <ask> --project <owner>/<name>` | Fill in the fields `missing` names: the ask's kind requires them. Then open the ask again with `next`. |85 | `LayerContentInPublicTree` | Maintainers only | no | 65 | `__CLI__ check` | Take the paths it names out: their files stay private and never enter a public tree. |86 | `SecretInOutput` | Maintainers only | no | 65 | `__CLI__ check` | Take the write-only value of `item` out of the output or the tree (`where`), then check again. |87 | `UnstatedRequirement` | Maintainers only | no | 65 | `__CLI__ check` | State in public what the area's held-back check holds, or take the check out of the suite. |114 unmodified linesmodified:packages/protocol/src/refusal.ts+1 added-1 removed
258 unmodified lines259 ) {}260 261 export class WeakCheck extends Schema.TaggedError<WeakCheck>()("WeakCheck", {262 ...Final,263- ...nextIs(cli("check")),263+ ...nextIs(cli("ask", "open", ASK, "--project", PROJECT)),264 weakness: Label,265 }) {}266 267 export class IncompleteBrief extends Schema.TaggedError<IncompleteBrief>()(257 unmodified linesmodified:packages/protocol/test/refusal.test.ts+21 added
115 unmodified lines116 117 expect(document).not.toMatch(/Infinity|NaN|"null"/u);118 });119 120+ // At ask open the check has not landed, so the local check has no ask to121+ // judge: each of these is answered by fixing the ask and opening it again.122+ it("points every refusal raised at ask open at opening the ask again", () => {123+ const atAskOpen = new Set(124+ groups125+ .filter((group) => group.name === "At ask open")126+ .flatMap((group) => group.members.map((member) => member.identifier))127+ );128+129+ const raised = examples.filter((refusal) => atAskOpen.has(refusal._tag));130+131+ expect(raised.map((refusal) => refusal._tag)).toStrictEqual([132+ "NotRedFirst",133+ "WeakCheck",134+ "IncompleteBrief",135+ ]);136+ expect(raised.map((refusal) => refusal.next)).toStrictEqual(137+ raised.map(() => `${Brand.cli} ask open <ask> --project <owner>/<name>`)138+ );139+ });140+141 it("files every member under exactly one group, in union order", () => {142 expect(143 groups.flatMap((group) =>144 group.members.map((member) => member.identifier)133 unmodified linesmodified:packages/protocol/test/render.test.ts+9 added
32 unmodified lines33 UnknownDiscussion,34 UnknownProposal,35 UnknownRevision,36 ValueTooShort,37+ WeakCheck,38 Weakened,39 } from "../src/refusal.ts";40 import { explain, headline, receiptLine } from "../src/render.ts";41 import { ask, base, examples, main, path } from "./examples.ts";362 unmodified lines404 " retryable: yes",405 ],406 refusal: DraftInProgress.of(ProposalId.make("prop-000007")),407 },408+ {409+ lines: [410+ "WeakCheck: the ask's check is weak: nullAnswer",411+ ` next: ${Brand.cli} ask open <ask> --project <owner>/<name>`,412+ " retryable: no",413+ ],414+ refusal: new WeakCheck({ weakness: "nullAnswer" }),415+ },416 ])("explains $refusal._tag with its next command", ({ lines, refusal }) => {417 expect(explain([refusal])).toStrictEqual(lines);418 });419 132 unmodified lines