diff --git a/changes/fix-shared-difference-unknown-profile.md b/changes/fix-shared-difference-unknown-profile.md new file mode 100644 index 0000000..342de55 --- /dev/null +++ b/changes/fix-shared-difference-unknown-profile.md @@ -0,0 +1,7 @@ +### Fixed + +- **A CLI on cli-core 0.717.0 or later passes `cli-dev audit --family` again.** cli-core 0.715 and 0.716 named an + unknown profile twice, `account-remove.unknown-profile` and `account-rename.unknown-profile`, and the CLIs published + on them still do. The audit blamed every CLI that has the first name, including the one being released, so each + release needed its own exception. It is now a shared difference, reviewed after 2026-12-10, when the family has + moved to `profile.unknown`. diff --git a/src/dev/audit.test.ts b/src/dev/audit.test.ts index 3265086..59bc1cc 100644 --- a/src/dev/audit.test.ts +++ b/src/dev/audit.test.ts @@ -6,7 +6,7 @@ import * as v from "valibot" import { beforeEach, describe, expect, it } from "vitest" import { commandsDocument } from "../commands/document.js" import { annotate } from "../commands/index.js" -import { AUDIT_RULES, PARITY_GROUPS, type ParityGroup, REQUIRED_ROOTS } from "../standards/audit.js" +import { AUDIT_RULES, PARITY_GROUPS, type ParityGroup, REQUIRED_ROOTS, SHARED_DIFFERENCES } from "../standards/audit.js" import { listEnvelopeSchema } from "../standards/output.js" import { VOCABULARY } from "../standards/vocabulary.js" import { type AuditInput, type AuditOptions, auditClis, scorecardTable, snakeKeys } from "./audit.js" @@ -327,6 +327,19 @@ describe("audit rules", () => { "a+c reason sync.failed: code: a: provider_error, c: network_error", ]) }) + + // A CLI on cli-core 0.717.0 or later gives account rename profile.unknown; the published CLIs on an older one still + // name the failure twice, which is theirs to fix with their next bump, not the released CLI's. + it("lets a CLI release while older CLIs still name an unknown profile twice", () => { + const message = "no profile by this name on this computer" + const remove = { reason: "account-remove.unknown-profile", code: "not_found" as const, message, details: [] } + const rename = { reason: "account-rename.unknown-profile", code: "not_found" as const, message, details: [] } + const inputs = [inputOf(tool("a"), { reasons: [remove] }), inputOf(tool("b"), { reasons: [remove, rename] })] + const blocking = (shared: AuditOptions["shared"]) => + auditClis(inputs, options({ only: "a", family: true, shared })).blocking.map((one) => one.target) + expect(blocking([])).toContain("a+b reason account-remove.unknown-profile=account-rename.unknown-profile") + expect(blocking(SHARED_DIFFERENCES)).toEqual([]) + }) }) describe("judging an audit", () => { diff --git a/src/standards/audit.ts b/src/standards/audit.ts index 00ececf..9ca56ce 100644 --- a/src/standards/audit.ts +++ b/src/standards/audit.ts @@ -171,6 +171,12 @@ const FAMILY_SINCE_0_98 = [ "reason profile.unknown: code", "b24 gives it not_found, drive validation_error (measured 2026-11-13)", ), + { + rule: REASON, + target: "reason account-remove.unknown-profile=account-rename.unknown-profile", + reason: "one failure under two names in cli-core 0.715–0.716; 0.717.0 gives account rename profile.unknown", + review_after: "2026-12-10", + }, ] export const PARITY_GROUPS: ParityGroup[] = defineParityGroups([