fix: restore contract-set regression coverage and mirror canonical problem bounds
release-manifest.test.ts's fixture derived manifest.contractSet.packages from EXPECTED_CONTRACT_SET_PACKAGES itself, so the equality it checked was satisfied by construction and CONTRACT_SET_PACKAGE_MISSING became unreachable from any test in the repo. Adds two independent checks: a literal (not derived) assertion that EXPECTED_CONTRACT_SET_PACKAGES really contains @tech-log/studio-contract@2.0.0, and a negative test with a manifest that omits a package the real expected set requires, asserting CONTRACT_SET_PACKAGE_MISSING. Confirmed the negative test has teeth by temporarily disabling the missing-package branch in verifyContractSet (src/contracts/contract-set.ts) and observing the test fail before reverting. Also narrows tech-log-studio-contract-contribution.ts's problemSchema to match canonical ProblemDetails exactly: title max 200 (was 240) and type unbounded (was max 512; canonical only constrains it as format: uri-reference). Both prior values were over-permissive, so no previously-accepted document is now rejected. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
66c047cec8
commit
9313018ef5
@@ -47,8 +47,9 @@ const passthrough = <T>(schemaId: string) =>
|
||||
|
||||
const problemSchema = z
|
||||
.object({
|
||||
type: z.string().min(1).max(512),
|
||||
title: z.string().min(1).max(240),
|
||||
// canonical: `format: uri-reference` only, no length bound.
|
||||
type: z.string().min(1),
|
||||
title: z.string().min(1).max(200),
|
||||
status: z.int().min(400).max(599),
|
||||
detail: z.string().min(1).max(5000),
|
||||
code: z.enum(STUDIO_ERROR_CODES as unknown as [string, ...string[]]),
|
||||
|
||||
Reference in New Issue
Block a user