@aviaratech/ai-delivery 0.3.47 → 0.3.48
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/README.md +1 -1
- package/dist/agentReadiness.test.js +12 -0
- package/dist/agentReadiness.test.js.map +2 -2
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +2 -2
- package/dist/issue.js +1 -4
- package/dist/issue.js.map +2 -2
- package/dist/issueBatchUpdate.test.js +9 -1
- package/dist/issueBatchUpdate.test.js.map +2 -2
- package/dist/issueContract.js +7 -0
- package/dist/issueContract.js.map +2 -2
- package/dist/issueContract.test.js +33 -0
- package/dist/issueContract.test.js.map +2 -2
- package/dist/mcp/index.js +20 -19
- package/dist/mcp/index.js.map +2 -2
- package/dist/services/agentReadinessService.js +6 -2
- package/dist/services/agentReadinessService.js.map +2 -2
- package/dist/staleServer.test.d.ts +1 -0
- package/dist/staleServer.test.js +110 -0
- package/dist/staleServer.test.js.map +7 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +15 -1
- package/dist/version.js.map +2 -2
- package/package.json +1 -1
- package/plugins/ai-delivery/.claude-plugin/plugin.json +2 -2
- package/plugins/ai-delivery/plugin.json +1 -1
- package/plugins/ai-delivery/runtime/dist/cli.js +86 -86
- package/plugins/ai-delivery/runtime/package.json +1 -1
- package/plugins/ai-delivery/skills/intake-create/SKILL.md +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/issueContract.ts"],
|
|
4
|
-
"sourcesContent": ["import { z } from 'zod';\nimport { DeliveryError } from './errors.js';\n\nexport const ISSUE_CONTRACT_VERSION = 'ai-delivery.issue@1' as const;\nexport const ISSUE_BODY_MARKER = '<!-- ai-delivery:issue@1 -->';\nconst DATA_PREFIX = '<!-- ai-delivery:issue-data@1 ';\nconst START_FOOTER =\n /\\n\\n<!-- ai-delivery-start-intent: sha256:[a-f0-9]{64} -->\\n<!-- ai-delivery-start: sha256:[a-f0-9]{64} -->$/u;\nexport function issueStartFooter(body: string): string {\n return START_FOOTER.exec(body)?.[0] ?? '';\n}\nconst CREATE_FOOTER = /\\n\\n<!-- ai-delivery-create: sha256:[a-f0-9]{64} intent: sha256:[a-f0-9]{64} -->$/u;\nexport function issueTrackingFooter(body: string): string {\n return CREATE_FOOTER.exec(body)?.[0] ?? issueStartFooter(body);\n}\nconst Text = z.string();\nconst Strings = z.array(Text);\nexport const IssueExample = z.strictObject({\n input: Text,\n expected: Text,\n failure: z.literal(true).optional().describe('Marks an example of what must be refused or must fail.'),\n});\nconst AcceptanceCriterion = z.strictObject({\n behavior: Text,\n verifiedBy: Text,\n examples: z\n .array(IssueExample)\n .optional()\n .describe('Example Mapping: concrete input and expected result for this criterion, including a failure case.'),\n});\nexport const FrontierReason = z.enum([\n 'state-machine',\n 'concurrency-recovery',\n 'risk-semantics',\n 'unprovable-refactor',\n]);\nexport const BuilderTier = z.discriminatedUnion('tier', [\n z.strictObject({ tier: z.literal('standard') }),\n z.strictObject({ tier: z.literal('frontier'), reason: FrontierReason }),\n]);\nexport type BuilderTierData = z.infer<typeof BuilderTier>;\nexport const SurfaceEntry = z.strictObject({\n path: Text,\n change: z.enum(['add', 'edit', 'delete']),\n signatures: Strings.optional(),\n});\nexport const IssueDeferral = z.strictObject({\n until: z.iso.date().optional(),\n trigger: z.string().trim().min(1).max(2000).optional(),\n});\nexport type IssueDeferralData = z.infer<typeof IssueDeferral>;\nexport const IssueDeferralPatch = {\n defer: IssueDeferral.optional(),\n undefer: z.literal(true).optional(),\n};\n\nexport function requireDeferralPatch(value: { defer?: IssueDeferralData; undefer?: true }): void {\n const parsed = z.strictObject(IssueDeferralPatch).safeParse(value);\n if (!parsed.success || (value.defer !== undefined && value.undefer !== undefined))\n throw new DeliveryError('Choose a valid defer condition or explicit undefer, never both.');\n}\n\n/** Drafts permit incomplete requirements, but never secret-bearing public content. */\nexport const IssueFields = z.strictObject({\n title: Text.describe(\n 'Ready issues need 10\u201380 characters naming the specific change, with no \"Bug:\" or \"[Task]\" prefix.',\n ),\n issueType: Text.optional(),\n points: z\n .number()\n .int()\n .optional()\n .describe(\"Ready non-epic issues need Points 1\u20138 from the Points field's options (usually 1, 2, 3, 5 or 8).\"),\n epic: z.literal(true).optional(),\n problem: Text.default(''),\n outcome: Text.default(''),\n acceptanceCriteria: z.array(AcceptanceCriterion).default([]),\n outOfScope: Strings.default([]),\n openQuestions: Strings.default([]),\n context: z\n .strictObject({ components: Strings.default([]), files: Strings.default([]), evidence: Strings.default([]) })\n .default({ components: [], files: [], evidence: [] }),\n bug: z\n .strictObject({ steps: Strings, expected: Text, actual: Text, reproducibility: Text, environment: Text })\n .optional()\n .describe('Ready Bug issues need non-empty steps, expected, actual, reproducibility and environment.'),\n draft: z.boolean().default(false),\n deferral: IssueDeferral.optional(),\n builder: BuilderTier.optional().describe(\n 'Builder capability: standard (any lighter builder can finish from the issue alone) or frontier with one reason.',\n ),\n extends: Strings.optional().describe('The design decision or existing owner this change uses or extends.'),\n priorWork: Strings.optional().describe(\n \"Searches run for earlier work on this question (closed issues, issue artifacts, decision logs) and what each found, or 'none found' with the searches.\",\n ),\n decisions: Strings.optional().describe('Choices already made; the builder must not reopen them.'),\n moneyPath: z\n .boolean()\n .optional()\n .describe(\n \"True when the change touches a path the repository's review policy gates; ownerOk is then required before its PR is marked ready.\",\n ),\n ownerOk: Strings.optional().describe(\"Link to the owner's comment approving this ticket's live-effect line.\"),\n surface: z\n .array(SurfaceEntry)\n .optional()\n .describe(\n 'The complete change set: each path, its change, and exact signatures. Tests for these paths are implied.',\n ),\n fences: Strings.optional().describe(\"Nearby paths the builder must not touch, with each shared file's owner.\"),\n proof: Strings.optional().describe('Commands or replays to run in order, focused first.'),\n legacyBody: Text.optional(),\n retainLegacyBody: z.boolean().optional(),\n});\n\nconst StatusText = z\n .string()\n .trim()\n .min(1)\n .refine((value) => !/[\\r\\n]/u.test(value), 'Use one status line.');\nexport const CreateIssueStatus = z.strictObject({ nextMilestone: StatusText.optional() });\nexport const IssueStatusPatch = CreateIssueStatus.extend({\n blockers: StatusText.optional(),\n latestJournal: StatusText.optional(),\n});\nexport const ISSUE_COMMENT_BODY_LIMIT = 65_536;\nexport const ProjectStatusPatch = z\n .strictObject({\n status: z.enum(['Todo', 'In Progress', 'Blocked', 'Done']),\n reason: z.string().trim().min(1),\n })\n .superRefine((value, ctx) => {\n if (`Requested Project Status: ${value.status}.\\n\\n${value.reason}`.length > ISSUE_COMMENT_BODY_LIMIT)\n ctx.addIssue({\n code: 'custom',\n path: ['reason'],\n message: 'Shorten the public reason to fit the issue comment limit.',\n });\n if (secrets(value))\n ctx.addIssue({\n code: 'custom',\n path: ['reason'],\n message: 'Remove credentials and private keys from the public reason.',\n });\n });\nexport type ProjectStatusPatchData = z.infer<typeof ProjectStatusPatch>;\n\nconst IssueStatus = z.strictObject({\n state: z.enum(['Ready', 'Draft']),\n lastUpdated: z.iso.datetime(),\n nextMilestone: StatusText,\n blockers: StatusText,\n latestJournal: StatusText,\n});\nexport type IssueStatusData = z.infer<typeof IssueStatus>;\n\nexport function requireIssueStatus<T extends z.ZodType>(schema: T, value: unknown): z.output<T> {\n const result = schema.safeParse(value);\n if (!result.success) throw new IssueValidationError(issueDiagnostics(result.error.issues));\n if (secrets(result.data))\n throw new IssueValidationError([\n hint('secrets', 'status', 'Remove credentials and private keys from public status fields.'),\n ]);\n return result.data;\n}\n\nexport interface IssueDiagnostic {\n code: string;\n field: string;\n fixHint: string;\n message: string;\n}\nconst hint = (code: string, field: string, fixHint: string): IssueDiagnostic => ({\n code,\n field,\n fixHint,\n message: fixHint,\n});\n\n/** A moneyPath issue owes its Owner OK until ownerOk holds an https link; its PR can't go ready before then (#361). */\nexport function ownerOkOwed(issue: DraftIssueData): IssueDiagnostic | undefined {\n if (issue.moneyPath === true && !(issue.ownerOk ?? []).some((item) => item.startsWith('https://')))\n return hint(\n 'ownerOk',\n 'ownerOk',\n \"Link the owner's comment that OKs this ticket's live-effect line in ownerOk before its PR is marked ready.\",\n );\n return undefined;\n}\n\n/** Every string inside value, each with its dotted field path (e.g. `context.evidence.0`). */\nfunction stringEntries(value: unknown, path = ''): [string, string][] {\n if (typeof value === 'string') return [[path, value]];\n if (value === null || typeof value !== 'object') return [];\n return Object.entries(value).flatMap(([key, item]) => stringEntries(item, path ? `${path}.${key}` : key));\n}\n\nfunction secrets(value: unknown): boolean {\n const text = stringEntries(value)\n .map(([, item]) => item)\n .join('\\n');\n return /(?:-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----|\\b(?:gh[pousr]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,}|sk-(?:proj-)?[A-Za-z0-9_-]{20,}|AKIA[A-Z0-9]{16})\\b|\\b(?:password|secret|api[_-]?key|access[_-]?token)\\s*[=:]\\s*[\"']?(?!<|\\$|redacted\\b|placeholder\\b)[A-Za-z0-9_+/-]{8,})/iu.test(\n text,\n );\n}\n\nfunction secretRule(value: z.output<typeof IssueFields>, ctx: z.RefinementCtx): void {\n if (secrets(value))\n ctx.addIssue({\n code: 'custom',\n path: ['body'],\n message: 'Remove credentials and private keys from public issue fields.',\n params: { issueCode: 'secrets' },\n });\n}\n\nexport const DraftIssue = IssueFields.superRefine(secretRule);\nexport type DraftIssueData = z.output<typeof DraftIssue>;\nexport type IssueFieldsInput = z.input<typeof IssueFields>;\n\nconst SKILL_HINT = 'See ai-delivery:ticket-design.';\n\nconst DESIGN_TITLE = /^design:\\s*\\S/iu;\n\n/** A \"Design: <build ticket>\" issue writes no code; Paul, Dec 4 (operating-model#36). */\nexport function isDesignTitle(title: string): boolean {\n return DESIGN_TITLE.test(title);\n}\n\nfunction readyRules(value: DraftIssueData, ctx: z.RefinementCtx): void {\n const add = (code: string, field: (string | number)[], fixHint: string): void =>\n ctx.addIssue({ code: 'custom', path: field, message: fixHint, params: { issueCode: code } });\n if (value.draft) add('draft', ['draft'], 'Resolve the draft fields and set draft to false before starting work.');\n if (!value.epic && (value.points === undefined || value.points < 1 || value.points > 8))\n add('points', ['points'], 'Choose Points from 1 through 8; split a 13-point issue into sub-issues.');\n if (\n value.title.trim().length < 10 ||\n !/[\\p{L}]/u.test(value.title) ||\n /^(?:fix|bug|task|feature|update|improve|test|issue|work)(?:\\s+(?:it|this|stuff|things|issue))?[.!]?$/iu.test(\n value.title.trim(),\n )\n )\n add('title.specific', ['title'], 'Name the specific behavior or component that changes.');\n if (value.title.length > 80)\n add('title.length', ['title'], `The title is ${String(value.title.length)} characters; shorten it to at most 80.`);\n if (/^\\s*(?:\\[\\s*(?:bug|feature|task)\\s*\\]|(?:bug|feature|task)\\s*:)/iu.test(value.title))\n add('title.prefix', ['title'], 'Remove the issue-type prefix; use the native Issue Type field.');\n for (const field of ['problem', 'outcome'] as const)\n if (!value[field].trim()) add(field, [field], `Describe the ${field} in concrete terms.`);\n if (!value.acceptanceCriteria.length)\n add('acceptance-criteria', ['acceptanceCriteria'], 'Add an observable behavior and how it will be verified.');\n value.acceptanceCriteria.forEach((ac, index) => {\n if (!ac.behavior.trim() || !ac.verifiedBy.trim())\n add(\n 'acceptance-criteria.fields',\n ['acceptanceCriteria', index],\n 'Provide both behavior and verifiedBy for this criterion.',\n );\n if (\n /^(?:.{1,100}\\s)?(?:works(?:\\s+(?:correctly|as expected|well|properly))?|(?:is|are)\\s+(?:done|verified|reviewed|robust|seamless|appropriate|user[- ]friendly))[\\s.!]*$/iu.test(\n ac.behavior,\n ) ||\n ac.behavior.trim().length < 12\n )\n add(\n 'acceptance-criteria.vague',\n ['acceptanceCriteria', index, 'behavior'],\n 'Replace vague wording with an observable input and result.',\n );\n });\n if (!value.outOfScope.some((item) => item.trim()))\n add('out-of-scope', ['outOfScope'], 'Name at least one explicit non-goal.');\n if (value.openQuestions.length)\n add('open-questions', ['openQuestions'], 'Resolve each open question before marking the issue Ready.');\n if (value.issueType?.toLowerCase() === 'bug') {\n if (!value.bug)\n add('bug', ['bug'], 'Include steps, expected and actual results, reproducibility, and environment.');\n else {\n if (!value.bug.steps.length || value.bug.steps.some((step) => !step.trim()))\n add('bug.steps', ['bug', 'steps'], 'Provide nonempty ordered reproduction steps.');\n for (const field of ['expected', 'actual', 'reproducibility', 'environment'] as const)\n if (!value.bug[field].trim()) add(`bug.${field}`, ['bug', field], `Describe the bug's ${field}.`);\n }\n }\n if (value.epic || value.builder === undefined || isDesignTitle(value.title)) return;\n if (!(value.decisions ?? []).some((item) => item.trim()))\n add('decisions', ['decisions'], `Record each choice the builder must not reopen. ${SKILL_HINT}`);\n const entries = value.surface ?? [];\n if (!entries.length || entries.some((entry) => !entry.path.trim()))\n add('surface', ['surface'], `List every path to change, each with a path and its change. ${SKILL_HINT}`);\n const examples = value.acceptanceCriteria.flatMap((ac) => ac.examples ?? []);\n if (!examples.length)\n add('examples', ['acceptanceCriteria'], `Give each criterion examples (input and expected). ${SKILL_HINT}`);\n else if (!examples.some((example) => example.failure === true))\n add(\n 'examples.failure',\n ['acceptanceCriteria'],\n `Add one example marked failure: true for what must be refused or must fail. ${SKILL_HINT}`,\n );\n if (!(value.proof ?? []).some((item) => item.trim()))\n add('proof', ['proof'], `List the commands to run in order, focused first. ${SKILL_HINT}`);\n}\n\nconst LOCAL_PATH = /\\.local\\/|\\/Users\\/|~\\//u;\nconst CONTRACT_WORD_LIMIT = 400;\n\nfunction localPathHint(field: string, match: string): IssueDiagnostic {\n return hint(\n 'local-path',\n field,\n `${field} cites a local path (${match}); put that evidence on the issue as a comment or artifact and link it instead.`,\n );\n}\n\n/** Local paths an update adds to an already-Ready issue; paths it already cites only warn (#339). */\nexport function addedLocalPaths(before: DraftIssueData, after: DraftIssueData): IssueDiagnostic[] {\n const existing = stringEntries(before).map(([, text]) => text);\n return stringEntries(after).flatMap(([field, text]) => {\n const added = text\n .split(/\\s+/u)\n .find((word) => LOCAL_PATH.test(word) && !existing.some((item) => item.includes(word)));\n const match = added === undefined ? null : LOCAL_PATH.exec(added);\n return match ? [localPathHint(field, match[0])] : [];\n });\n}\n\n/** Rules the Ready write gate refuses (create and draft-to-Ready); every other path only warns. Paul, Nov 26 (ai#5835, ai#5838). */\nfunction readyWriteRules(issue: DraftIssueData): IssueDiagnostic[] {\n if (issue.draft) return [];\n const results: IssueDiagnostic[] = [];\n if (!issue.epic && !(issue.priorWork ?? []).some((item) => item.trim()))\n results.push(\n hint(\n 'priorWork',\n 'priorWork',\n \"List each search you ran for earlier work on this question and what it found, or 'none found' with the searches.\",\n ),\n );\n for (const [field, text] of stringEntries(issue)) {\n const match = LOCAL_PATH.exec(text);\n if (match) results.push(localPathHint(field, match[0]));\n }\n const { outcome, surface, acceptanceCriteria, proof, priorWork } = issue;\n const words = stringEntries({ outcome, surface, acceptanceCriteria, proof, priorWork })\n .flatMap(([, text]) => text.split(/\\s+/u))\n .filter(Boolean).length;\n if (words > CONTRACT_WORD_LIMIT)\n results.push(\n hint(\n 'contract-words',\n 'contract',\n `The contract (outcome, files, acceptance, tests, prior work) is ${String(words)} words; keep it to 400 and move evidence to a comment or artifact.`,\n ),\n );\n return results;\n}\n\nexport const ReadyIssue = IssueFields.extend({\n title: Text.min(10).max(80),\n points: z.number().int().min(1).max(8).optional(),\n problem: Text.min(1),\n outcome: Text.min(1),\n acceptanceCriteria: z.array(AcceptanceCriterion).min(1),\n outOfScope: Strings.min(1),\n openQuestions: Strings.max(0).default([]),\n draft: z.literal(false).default(false),\n})\n .superRefine(secretRule)\n .superRefine(readyRules)\n .meta({ anyOf: [{ properties: { epic: { const: true } }, required: ['epic'] }, { required: ['points'] }] });\nconst ReadySemantics = IssueFields.superRefine(secretRule).superRefine(readyRules);\n/** Portable structural schemas; semantic refinements are enforced by the write/readiness boundary. */\nexport const ISSUE_JSON_SCHEMAS = {\n version: ISSUE_CONTRACT_VERSION,\n draft: z.toJSONSchema(DraftIssue),\n ready: z.toJSONSchema(ReadyIssue),\n};\n\n/** Patch fields share the canonical validators but deliberately have no defaults. */\nexport const IssueWriteFields = {\n title: IssueFields.shape.title.optional(),\n issueType: IssueFields.shape.issueType,\n points: IssueFields.shape.points,\n epic: IssueFields.shape.epic,\n problem: IssueFields.shape.problem.removeDefault().optional(),\n outcome: IssueFields.shape.outcome.removeDefault().optional(),\n acceptanceCriteria: IssueFields.shape.acceptanceCriteria.removeDefault().optional(),\n outOfScope: IssueFields.shape.outOfScope.removeDefault().optional(),\n openQuestions: IssueFields.shape.openQuestions.removeDefault().optional(),\n context: IssueFields.shape.context.removeDefault().optional(),\n bug: IssueFields.shape.bug,\n builder: IssueFields.shape.builder,\n extends: IssueFields.shape.extends,\n priorWork: IssueFields.shape.priorWork,\n decisions: IssueFields.shape.decisions,\n moneyPath: IssueFields.shape.moneyPath,\n ownerOk: IssueFields.shape.ownerOk,\n surface: IssueFields.shape.surface,\n fences: IssueFields.shape.fences,\n proof: IssueFields.shape.proof,\n draft: IssueFields.shape.draft.removeDefault().optional(),\n retainLegacyBody: IssueFields.shape.retainLegacyBody,\n};\nexport const IssueWriteSchema = z.strictObject(IssueWriteFields);\n\n/** Keep advertised structural schemas while returning domain diagnostics before SDK error wrapping. */\nexport function issueInputSchema<T extends z.ZodObject>(schema: T): T {\n return schema.refine(() => true, {\n when: ({ issues }) => {\n // Parsed values have already lost unknown keys. Preserve the original structural failures.\n if (issues.length) throw new IssueValidationError(issueDiagnostics(issues));\n return true;\n },\n });\n}\n\n/** One refusal for unknown keys on every tool: list what is accepted, never echo the unknown key (#140). */\nexport function acceptedKeysError(issue: z.core.$ZodRawIssue): string | undefined {\n if (issue.code !== 'unrecognized_keys') return undefined;\n const shape = (issue.inst as z.ZodObject | undefined)?.shape;\n return shape === undefined ? undefined : `Unknown argument key. Accepted keys: ${Object.keys(shape).join(', ')}.`;\n}\n\nfunction issueDiagnostics(issues: readonly (z.core.$ZodIssue | z.core.$ZodRawIssue)[]): IssueDiagnostic[] {\n const seen = new Set<string>();\n return issues\n .map((issue) => {\n const field = (issue.path ?? []).map(String).join('.') || 'issue';\n const code =\n issue.code === 'custom' && typeof issue.params?.issueCode === 'string'\n ? issue.params.issueCode\n : field === 'points'\n ? 'points'\n : field === 'title'\n ? 'title.length'\n : field === 'outOfScope'\n ? 'out-of-scope'\n : field === 'openQuestions'\n ? 'open-questions'\n : field === 'acceptanceCriteria'\n ? 'acceptance-criteria'\n : field === 'draft'\n ? 'draft'\n : issue.code === 'unrecognized_keys'\n ? 'field.unknown'\n : 'field.type';\n return hint(\n code,\n field,\n code === 'points'\n ? 'Choose Points from 1 through 8; split a 13-point issue into sub-issues.'\n : issue.code === 'unrecognized_keys'\n ? (acceptedKeysError(issue as z.core.$ZodRawIssue) ?? 'Remove unrecognized fields from ' + field + '.')\n : (issue.message ??\n (issue.code === 'invalid_type'\n ? 'Provide a valid ' + issue.expected + ' value.'\n : 'Provide a value satisfying the declared issue field schema.')),\n );\n })\n .filter((issue) => {\n const key = issue.code + ':' + issue.field;\n if (seen.has(key)) return false;\n seen.add(key);\n return true;\n });\n}\n\nexport function validateIssue(value: unknown, ready = true): { issue?: DraftIssueData; failures: IssueDiagnostic[] } {\n const parsed = (ready ? ReadyIssue : DraftIssue).safeParse(value);\n if (parsed.success) return { issue: parsed.data, failures: [] };\n const semantic = ready ? ReadySemantics.safeParse(value) : undefined;\n const issues = [...(semantic?.success === false ? semantic.error.issues : []), ...parsed.error.issues];\n return { failures: issueDiagnostics(issues) };\n}\n\nexport class IssueValidationError extends DeliveryError {\n constructor(readonly failures: IssueDiagnostic[]) {\n super(JSON.stringify({ contract: ISSUE_CONTRACT_VERSION, failures }));\n }\n}\n\n/** `requireBuilder` is set at Ready create and draft-to-Ready; legacy content updates never set it. */\nexport function requireIssue(value: unknown, options: { requireBuilder?: true } = {}): DraftIssueData {\n const structural = IssueFields.safeParse(value);\n const result = validateIssue(value, !structural.success || !structural.data.draft);\n const gated = options.requireBuilder === true && structural.success && !structural.data.draft;\n const unbuilt =\n gated && !structural.data.epic && structural.data.builder === undefined && !isDesignTitle(structural.data.title);\n const writeFailures = gated ? readyWriteRules(structural.data) : [];\n if (!result.issue || unbuilt || writeFailures.length)\n throw new IssueValidationError([\n ...(unbuilt\n ? [\n hint(\n 'builder.missing',\n 'builder',\n `Add builder, decisions, surface, proof and examples, or pass draft: true to capture it now. ${SKILL_HINT}`,\n ),\n ]\n : []),\n ...result.failures,\n ...writeFailures,\n ]);\n return result.issue;\n}\n\nconst escapeStatus = (value: string): string =>\n value\n .replaceAll('&', '&')\n .replaceAll('<', '<')\n .replaceAll('>', '>')\n .replace(/[\\\\`*_[\\]]/gu, '\\\\$&');\nconst unescapeStatus = (value: string): string =>\n value\n .replace(/\\\\([\\\\`*_[\\]])/gu, '$1')\n .replaceAll('<', '<')\n .replaceAll('>', '>')\n .replaceAll('&', '&');\n\nexport function renderIssueBody(value: DraftIssueData, status?: IssueStatusData, legacyFormatting = false): string {\n const item = DraftIssue.parse(value);\n if (status !== undefined) requireIssueStatus(IssueStatus, status);\n const list = (values: string[]): string => (values.length ? values.map((v) => `- ${v}`).join('\\n') : '(none)');\n const bulletSection = (title: string, values: string[] | undefined): string[] =>\n values?.length ? [`## ${title}`, list(values)] : [];\n const parts = [\n ISSUE_BODY_MARKER,\n '## Status',\n status === undefined\n ? item.draft\n ? 'Draft \u2014 parked; not ready to work.'\n : 'Ready'\n : `- **State:** ${status.state}\\n- **Last updated:** ${status.lastUpdated} UTC\\n- **Next milestone:** ${escapeStatus(status.nextMilestone)}\\n- **Blockers:** ${escapeStatus(status.blockers)}\\n- **Latest journal:** ${escapeStatus(status.latestJournal)}`,\n '## Problem',\n item.problem,\n '## Outcome',\n item.outcome,\n ...(item.deferral === undefined ? [] : ['## Deferral', `Deferred: ${JSON.stringify(item.deferral)}`]),\n ...(item.builder === undefined\n ? []\n : ['## Builder', item.builder.tier === 'standard' ? 'standard' : `frontier: ${item.builder.reason}`]),\n ...bulletSection('Extends', item.extends),\n ...bulletSection('Prior work', item.priorWork),\n ...bulletSection('Decisions', item.decisions),\n ...(item.moneyPath === true ? ['## Money path', 'yes'] : []),\n ...bulletSection('Owner OK', item.ownerOk),\n '## Acceptance criteria',\n item.acceptanceCriteria\n .map(\n (ac) =>\n (legacyFormatting\n ? `- [ ] ${ac.behavior}\\n Verified by: ${ac.verifiedBy}`\n : `- [ ] ${ac.behavior.replace(/\\n/gu, '\\n ')}${ac.behavior.includes('\\n') ? '\\n' : ''}\\n Verified by: ${ac.verifiedBy.replace(/\\n/gu, '\\n ')}`) +\n (ac.examples ?? [])\n .map(\n (example) =>\n `\\n Example: ${example.input.replace(/\\n/gu, '\\n ')} \u2192 ${example.expected.replace(/\\n/gu, '\\n ')}${example.failure === true ? ' (failure)' : ''}`,\n )\n .join(''),\n )\n .join('\\n'),\n ...(item.surface?.length\n ? [\n '## Surface',\n item.surface\n .map((entry) =>\n [`- ${entry.change} \\`${entry.path}\\``, ...(entry.signatures ?? []).map((sig) => ` ${sig}`)].join('\\n'),\n )\n .join('\\n'),\n ]\n : []),\n ...bulletSection('Fences', item.fences),\n ...bulletSection('Proof', item.proof),\n '## Out of scope',\n list(item.outOfScope),\n '## Open questions',\n list(item.openQuestions),\n '## Context',\n `Components:\\n${list(item.context.components)}\\n\\nFiles:\\n${list(item.context.files)}\\n\\nEvidence:\\n${list(item.context.evidence)}`,\n ];\n if (item.bug)\n parts.push(\n '## Bug',\n `Steps:\\n${list(item.bug.steps)}\\n\\nExpected: ${item.bug.expected}\\n\\nActual: ${item.bug.actual}\\n\\nReproducibility: ${item.bug.reproducibility}\\n\\nEnvironment: ${item.bug.environment}`,\n );\n if (item.legacyBody !== undefined && item.retainLegacyBody !== false)\n parts.push('## Preserved legacy body', item.legacyBody);\n // Escape comment delimiters without altering decoded data. Exact render equality detects human/payload divergence.\n parts.push(`${DATA_PREFIX}${JSON.stringify(item).replaceAll('<', '\\\\u003c').replaceAll('>', '\\\\u003e')} -->`);\n return parts.join('\\n\\n') + '\\n';\n}\n\nfunction section(body: string, names: string[]): string {\n const lines = body.split(/\\r?\\n/u);\n const start = lines.findIndex((line) =>\n names.includes(\n line\n .replace(/^#{1,6}\\s+/u, '')\n .trim()\n .toLowerCase(),\n ),\n );\n if (start < 0) return '';\n const end = lines.findIndex((line, index) => index > start && /^#{1,6}\\s/u.test(line));\n return lines\n .slice(start + 1, end < 0 ? undefined : end)\n .join('\\n')\n .trim();\n}\n\nconst REBUILD_HINT =\n 'The issue body was edited outside ai-delivery; send problem, outcome, acceptanceCriteria and outOfScope (plus bug for a Bug, epic for an epic, and any draft, openQuestions or context to keep) in one issue_update to rebuild it.';\n\n/** Lenient conversion retains every legacy byte, and never invents verification or bug evidence. */\nexport function parseIssueBody(\n body: string,\n metadata: { title: string; points?: number; issueType?: string },\n): { issue: DraftIssueData; legacy: boolean; status?: IssueStatusData; legacyFormatting?: boolean } {\n if (body.trimStart().startsWith(ISSUE_BODY_MARKER)) {\n const start = body.lastIndexOf(DATA_PREFIX);\n const end = body.indexOf(' -->', start);\n if (start < 0 || end < 0) throw new IssueValidationError([hint('body.canonical', 'body', REBUILD_HINT)]);\n let decoded: unknown;\n try {\n decoded = JSON.parse(body.slice(start + DATA_PREFIX.length, end));\n } catch {\n throw new IssueValidationError([hint('body.canonical', 'body', REBUILD_HINT)]);\n }\n const result = validateIssue(decoded, false);\n if (!result.issue) throw new IssueValidationError(result.failures);\n const displayed = body.slice((ISSUE_BODY_MARKER + '\\n\\n## Status\\n\\n').length, body.indexOf('\\n\\n## Problem\\n\\n'));\n let status: IssueStatusData | undefined;\n if (displayed !== 'Ready' && displayed !== 'Draft \u2014 parked; not ready to work.') {\n const match =\n /^- \\*\\*State:\\*\\* (Ready|Draft)\\n- \\*\\*Last updated:\\*\\* (\\S+) UTC\\n- \\*\\*Next milestone:\\*\\* ([^\\r\\n]+)\\n- \\*\\*Blockers:\\*\\* ([^\\r\\n]+)\\n- \\*\\*Latest journal:\\*\\* ([^\\r\\n]+)$/u.exec(\n displayed,\n );\n if (!match)\n throw new IssueValidationError([\n hint('body.canonical', 'status', 'Restore the complete unambiguous status block.'),\n ]);\n status = requireIssueStatus(IssueStatus, {\n state: match[1],\n lastUpdated: match[2],\n nextMilestone: unescapeStatus(match[3]!),\n blockers: unescapeStatus(match[4]!),\n latestJournal: unescapeStatus(match[5]!),\n });\n if (status.state !== (result.issue.draft ? 'Draft' : 'Ready'))\n throw new IssueValidationError([\n hint('body.canonical', 'status', 'Status state must agree with the typed draft field.'),\n ]);\n }\n const footer = issueTrackingFooter(body);\n const canonical = footer ? body.slice(0, -footer.length) : body;\n const legacyFormatting = renderIssueBody(result.issue, status) !== canonical;\n if (\n (legacyFormatting && renderIssueBody(result.issue, status, true) !== canonical) ||\n result.issue.title !== metadata.title\n )\n throw new IssueValidationError([hint('body.canonical', 'body', REBUILD_HINT)]);\n return {\n issue: result.issue,\n legacy: false,\n ...(status === undefined ? {} : { status }),\n ...(legacyFormatting ? { legacyFormatting: true } : {}),\n };\n }\n const verification = section(body, ['verification', 'validation', 'tests']);\n const acText = section(body, ['acceptance criteria', 'acceptance']);\n const acceptanceCriteria = acText.split(/\\n(?=\\s*[-*+]\\s+\\[[ xX]\\])/u).flatMap((block) => {\n const match = /^\\s*[-*+]\\s+\\[[ xX]\\]\\s+([\\s\\S]+)/u.exec(block);\n if (!match) return [];\n const [behavior = '', verifiedBy = verification] = match[1]!.split(/\\n\\s*(?:Verified by:|Verified by)\\s*/iu);\n return [{ behavior: behavior.trim(), verifiedBy: verifiedBy.trim() }];\n });\n const items = (s: string): string[] =>\n s\n .split(/\\r?\\n/u)\n .map((line) => line.replace(/^\\s*[-*+]\\s+/u, '').trim())\n .filter(Boolean);\n const scope = section(body, ['scope', 'context']);\n const bug =\n metadata.issueType?.toLowerCase() === 'bug'\n ? {\n steps: items(section(body, ['steps', 'steps to reproduce'])),\n expected: section(body, ['expected', 'expected results']),\n actual: section(body, ['actual', 'actual results']),\n reproducibility: section(body, ['reproducibility']),\n environment: section(body, ['environment']),\n }\n : undefined;\n const converted = validateIssue(\n {\n ...metadata,\n problem: section(body, ['problem']),\n outcome: section(body, ['outcome']),\n acceptanceCriteria,\n outOfScope: items(section(body, ['out of scope', 'non-goals'])),\n openQuestions: items(section(body, ['open questions'])),\n context: { components: [], files: scope ? [scope] : [], evidence: verification ? [verification] : [] },\n ...(bug === undefined ? {} : { bug }),\n draft: /^draft\\b/iu.test(section(body, ['status'])),\n legacyBody: body,\n },\n false,\n );\n if (!converted.issue) throw new IssueValidationError(converted.failures);\n return { issue: converted.issue, legacy: true };\n}\n\nconst CODE_EXTENSIONS = /\\.(?:ts|tsx|js|mjs|cjs|py|go|rs|java|kt|rb|sql|sh)$/iu;\nconst proseWords = (issue: DraftIssueData): number =>\n [issue.problem, issue.outcome, ...issue.acceptanceCriteria.map((ac) => ac.behavior)]\n .flatMap((text) => text.split(/\\s+/u))\n .filter(Boolean).length;\n\nexport function issueWarnings(issue: DraftIssueData): IssueDiagnostic[] {\n const warnings: IssueDiagnostic[] = [];\n const warn = (code: string, field: string, message: string): void => {\n warnings.push(hint(code, field, message));\n };\n if (issue.acceptanceCriteria.length > 7)\n warn('many-criteria', 'acceptanceCriteria', 'Consider slicing more than seven criteria into smaller issues.');\n if (\n issue.builder === undefined &&\n !issue.acceptanceCriteria.some((ac) =>\n /\\b(?:edge|failure|fail|error|invalid|reject|refus|empty|missing|interrupt|timeout|boundary)/iu.test(ac.behavior),\n )\n )\n warn('edge-case', 'acceptanceCriteria', 'Describe an edge or failure case.');\n if (\n issue.issueType?.toLowerCase() === 'bug' &&\n !issue.acceptanceCriteria.some((ac) => /regression/iu.test(ac.behavior + ' ' + ac.verifiedBy))\n )\n warn('bug.regression', 'acceptanceCriteria', 'Add a regression test criterion for the bug.');\n if (issue.builder === undefined && ![...issue.context.files, ...issue.context.components].some((item) => item.trim()))\n warn('context', 'context', 'Name relevant components or files.');\n warnings.push(...readyWriteRules(issue));\n const owed = ownerOkOwed(issue);\n if (owed) warnings.push(owed);\n if (proseWords(issue) > 300)\n warn('body.length', 'body', `Consider cutting the problem, outcome and criteria to 300 words. ${SKILL_HINT}`);\n if (issue.draft || issue.epic) return warnings;\n if (isDesignTitle(issue.title)) {\n if (!issue.acceptanceCriteria.some((ac) => /#\\d+\\b/u.test(ac.behavior)))\n warn(\n 'design.build-ticket',\n 'acceptanceCriteria',\n \"Name the build ticket in an acceptance criterion, e.g. 'Build ticket #<n> filed Ready'.\",\n );\n return warnings;\n }\n if (issue.builder === undefined) {\n warn(\n 'builder.unset',\n 'builder',\n `Set builder, decisions, surface, proof and examples when next editing. ${SKILL_HINT}`,\n );\n return warnings;\n }\n if (issue.points !== undefined && issue.points > 5)\n warn('size.points', 'points', `Consider splitting an issue above 5 points. ${SKILL_HINT}`);\n const entries = issue.surface ?? [];\n if (new Set(entries.map((entry) => entry.path.trim())).size > 6)\n warn('size.surface', 'surface', `Consider splitting an issue that changes more than 6 paths. ${SKILL_HINT}`);\n if (issue.acceptanceCriteria.some((ac) => !ac.examples?.length))\n warn('examples.ac', 'acceptanceCriteria', `Give every criterion at least one example. ${SKILL_HINT}`);\n const unsigned = entries.filter(\n (entry) =>\n entry.change !== 'delete' &&\n CODE_EXTENSIONS.test(entry.path.trim()) &&\n !/\\.test\\.|\\.spec\\.|\\/test/u.test(entry.path) &&\n !entry.signatures?.some((signature) => signature.trim()),\n );\n if (unsigned.length)\n warn(\n 'surface.signature',\n 'surface',\n `Add exact signatures for ${unsigned.map((entry) => entry.path).join(', ')}. ${SKILL_HINT}`,\n );\n if (!(issue.fences ?? []).some((item) => item.trim()))\n warn('fences', 'fences', `Name the nearby paths the builder must not touch. ${SKILL_HINT}`);\n if (!(issue.extends ?? []).some((item) => item.trim()))\n warn('extends', 'extends', `Name the design or owner this change extends; add no parallel path. ${SKILL_HINT}`);\n return warnings;\n}\n\nexport function issueBodyDiff(before: string, after: string): string {\n return [\n '--- prior body',\n '+++ canonical body',\n ...before.split('\\n').map((line) => '-' + line),\n ...after.split('\\n').map((line) => '+' + line),\n ].join('\\n');\n}\n"],
|
|
5
|
-
"mappings": "AAAA,SAAS,SAAS;AAClB,SAAS,qBAAqB;AAEvB,MAAM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I;AAAA,EAC/C,EAAE,KAAK,IAAI;AACb;",
|
|
4
|
+
"sourcesContent": ["import { z } from 'zod';\nimport { DeliveryError } from './errors.js';\n\nexport const ISSUE_CONTRACT_VERSION = 'ai-delivery.issue@1' as const;\nexport const ISSUE_BODY_MARKER = '<!-- ai-delivery:issue@1 -->';\nconst DATA_PREFIX = '<!-- ai-delivery:issue-data@1 ';\nconst START_FOOTER =\n /\\n\\n<!-- ai-delivery-start-intent: sha256:[a-f0-9]{64} -->\\n<!-- ai-delivery-start: sha256:[a-f0-9]{64} -->$/u;\nexport function issueStartFooter(body: string): string {\n return START_FOOTER.exec(body)?.[0] ?? '';\n}\nconst CREATE_FOOTER = /\\n\\n<!-- ai-delivery-create: sha256:[a-f0-9]{64} intent: sha256:[a-f0-9]{64} -->$/u;\nexport function issueTrackingFooter(body: string): string {\n return CREATE_FOOTER.exec(body)?.[0] ?? issueStartFooter(body);\n}\nconst Text = z.string();\nconst Strings = z.array(Text);\nexport const IssueExample = z.strictObject({\n input: Text,\n expected: Text,\n failure: z.literal(true).optional().describe('Marks an example of what must be refused or must fail.'),\n});\nconst AcceptanceCriterion = z.strictObject({\n behavior: Text,\n verifiedBy: Text,\n examples: z\n .array(IssueExample)\n .optional()\n .describe('Example Mapping: concrete input and expected result for this criterion, including a failure case.'),\n});\nexport const FrontierReason = z.enum([\n 'state-machine',\n 'concurrency-recovery',\n 'risk-semantics',\n 'unprovable-refactor',\n]);\nexport const BuilderTier = z.discriminatedUnion('tier', [\n z.strictObject({ tier: z.literal('standard') }),\n z.strictObject({ tier: z.literal('frontier'), reason: FrontierReason }),\n]);\nexport type BuilderTierData = z.infer<typeof BuilderTier>;\nexport const SurfaceEntry = z.strictObject({\n path: Text,\n change: z.enum(['add', 'edit', 'delete']),\n signatures: Strings.optional(),\n});\nexport const IssueDeferral = z.strictObject({\n until: z.iso.date().optional(),\n trigger: z.string().trim().min(1).max(2000).optional(),\n});\nexport type IssueDeferralData = z.infer<typeof IssueDeferral>;\nexport const IssueDeferralPatch = {\n defer: IssueDeferral.optional(),\n undefer: z.literal(true).optional(),\n};\n\nexport function requireDeferralPatch(value: { defer?: IssueDeferralData; undefer?: true }): void {\n const parsed = z.strictObject(IssueDeferralPatch).safeParse(value);\n if (!parsed.success || (value.defer !== undefined && value.undefer !== undefined))\n throw new DeliveryError('Choose a valid defer condition or explicit undefer, never both.');\n}\n\n/** Drafts permit incomplete requirements, but never secret-bearing public content. */\nexport const IssueFields = z.strictObject({\n title: Text.describe(\n 'Ready issues need 10\u201380 characters naming the specific change, with no \"Bug:\" or \"[Task]\" prefix.',\n ),\n issueType: Text.optional(),\n points: z\n .number()\n .int()\n .optional()\n .describe(\"Ready non-epic issues need Points 1\u20138 from the Points field's options (usually 1, 2, 3, 5 or 8).\"),\n epic: z.literal(true).optional(),\n problem: Text.default(''),\n outcome: Text.default(''),\n acceptanceCriteria: z.array(AcceptanceCriterion).default([]),\n outOfScope: Strings.default([]),\n openQuestions: Strings.default([]),\n context: z\n .strictObject({ components: Strings.default([]), files: Strings.default([]), evidence: Strings.default([]) })\n .default({ components: [], files: [], evidence: [] }),\n bug: z\n .strictObject({ steps: Strings, expected: Text, actual: Text, reproducibility: Text, environment: Text })\n .optional()\n .describe('Ready Bug issues need non-empty steps, expected, actual, reproducibility and environment.'),\n draft: z.boolean().default(false),\n deferral: IssueDeferral.optional(),\n builder: BuilderTier.optional().describe(\n 'Builder capability: standard (any lighter builder can finish from the issue alone) or frontier with one reason.',\n ),\n extends: Strings.optional().describe('The design decision or existing owner this change uses or extends.'),\n priorWork: Strings.optional().describe(\n \"Searches run for earlier work on this question (closed issues, issue artifacts, decision logs) and what each found, or 'none found' with the searches.\",\n ),\n decisions: Strings.optional().describe('Choices already made; the builder must not reopen them.'),\n moneyPath: z\n .boolean()\n .optional()\n .describe(\n \"True when the change touches a path the repository's review policy gates; ownerOk is then required before its PR is marked ready.\",\n ),\n ownerOk: Strings.optional().describe(\"Link to the owner's comment approving this ticket's live-effect line.\"),\n surface: z\n .array(SurfaceEntry)\n .optional()\n .describe(\n 'The complete change set: each path, its change, and exact signatures. Tests for these paths are implied.',\n ),\n fences: Strings.optional().describe(\"Nearby paths the builder must not touch, with each shared file's owner.\"),\n proof: Strings.optional().describe('Commands or replays to run in order, focused first.'),\n legacyBody: Text.optional(),\n retainLegacyBody: z.boolean().optional(),\n});\n\nconst StatusText = z\n .string()\n .trim()\n .min(1)\n .refine((value) => !/[\\r\\n]/u.test(value), 'Use one status line.');\nexport const CreateIssueStatus = z.strictObject({ nextMilestone: StatusText.optional() });\nexport const IssueStatusPatch = CreateIssueStatus.extend({\n blockers: StatusText.optional(),\n latestJournal: StatusText.optional(),\n});\nexport const ISSUE_COMMENT_BODY_LIMIT = 65_536;\nexport const ProjectStatusPatch = z\n .strictObject({\n status: z.enum(['Todo', 'In Progress', 'Blocked', 'Done']),\n reason: z.string().trim().min(1),\n })\n .superRefine((value, ctx) => {\n if (`Requested Project Status: ${value.status}.\\n\\n${value.reason}`.length > ISSUE_COMMENT_BODY_LIMIT)\n ctx.addIssue({\n code: 'custom',\n path: ['reason'],\n message: 'Shorten the public reason to fit the issue comment limit.',\n });\n if (secrets(value))\n ctx.addIssue({\n code: 'custom',\n path: ['reason'],\n message: 'Remove credentials and private keys from the public reason.',\n });\n });\nexport type ProjectStatusPatchData = z.infer<typeof ProjectStatusPatch>;\n\nconst IssueStatus = z.strictObject({\n state: z.enum(['Ready', 'Draft']),\n lastUpdated: z.iso.datetime(),\n nextMilestone: StatusText,\n blockers: StatusText,\n latestJournal: StatusText,\n});\nexport type IssueStatusData = z.infer<typeof IssueStatus>;\n\nexport function requireIssueStatus<T extends z.ZodType>(schema: T, value: unknown): z.output<T> {\n const result = schema.safeParse(value);\n if (!result.success) throw new IssueValidationError(issueDiagnostics(result.error.issues));\n if (secrets(result.data))\n throw new IssueValidationError([\n hint('secrets', 'status', 'Remove credentials and private keys from public status fields.'),\n ]);\n return result.data;\n}\n\nexport interface IssueDiagnostic {\n code: string;\n field: string;\n fixHint: string;\n message: string;\n}\nconst hint = (code: string, field: string, fixHint: string): IssueDiagnostic => ({\n code,\n field,\n fixHint,\n message: fixHint,\n});\n\n/** A moneyPath issue owes its Owner OK until ownerOk holds an https link; its PR can't go ready before then (#361). */\nexport function ownerOkOwed(issue: DraftIssueData): IssueDiagnostic | undefined {\n if (issue.moneyPath === true && !(issue.ownerOk ?? []).some((item) => item.startsWith('https://')))\n return hint(\n 'ownerOk',\n 'ownerOk',\n \"Link the owner's comment that OKs this ticket's live-effect line in ownerOk before its PR is marked ready.\",\n );\n return undefined;\n}\n\n/** Every string inside value, each with its dotted field path (e.g. `context.evidence.0`). */\nfunction stringEntries(value: unknown, path = ''): [string, string][] {\n if (typeof value === 'string') return [[path, value]];\n if (value === null || typeof value !== 'object') return [];\n return Object.entries(value).flatMap(([key, item]) => stringEntries(item, path ? `${path}.${key}` : key));\n}\n\nfunction secrets(value: unknown): boolean {\n const text = stringEntries(value)\n .map(([, item]) => item)\n .join('\\n');\n return /(?:-----BEGIN (?:RSA |EC |OPENSSH )?PRIVATE KEY-----|\\b(?:gh[pousr]_[A-Za-z0-9]{20,}|github_pat_[A-Za-z0-9_]{20,}|sk-(?:proj-)?[A-Za-z0-9_-]{20,}|AKIA[A-Z0-9]{16})\\b|\\b(?:password|secret|api[_-]?key|access[_-]?token)\\s*[=:]\\s*[\"']?(?!<|\\$|redacted\\b|placeholder\\b)[A-Za-z0-9_+/-]{8,})/iu.test(\n text,\n );\n}\n\nfunction secretRule(value: z.output<typeof IssueFields>, ctx: z.RefinementCtx): void {\n if (secrets(value))\n ctx.addIssue({\n code: 'custom',\n path: ['body'],\n message: 'Remove credentials and private keys from public issue fields.',\n params: { issueCode: 'secrets' },\n });\n}\n\nexport const DraftIssue = IssueFields.superRefine(secretRule);\nexport type DraftIssueData = z.output<typeof DraftIssue>;\nexport type IssueFieldsInput = z.input<typeof IssueFields>;\n\nconst SKILL_HINT = 'See ai-delivery:ticket-design.';\n\nconst DESIGN_TITLE = /^design:\\s*\\S/iu;\n\nconst START_ORDER =\n /\\b(?:starts?\\s+(?:only\\s+)?(?:after|once|when|until|on or after)|(?:don['\u2019]?t|do not|never)\\s+start|no\\s+(?:start|build)\\s+(?:until|before))\\b/iu;\n\n/** A \"Design: <build ticket>\" issue writes no code; Paul, Dec 4 (operating-model#36). */\nexport function isDesignTitle(title: string): boolean {\n return DESIGN_TITLE.test(title);\n}\n\nfunction readyRules(value: DraftIssueData, ctx: z.RefinementCtx): void {\n const add = (code: string, field: (string | number)[], fixHint: string): void =>\n ctx.addIssue({ code: 'custom', path: field, message: fixHint, params: { issueCode: code } });\n if (value.draft) add('draft', ['draft'], 'Resolve the draft fields and set draft to false before starting work.');\n if (!value.epic && (value.points === undefined || value.points < 1 || value.points > 8))\n add('points', ['points'], 'Choose Points from 1 through 8; split a 13-point issue into sub-issues.');\n if (\n value.title.trim().length < 10 ||\n !/[\\p{L}]/u.test(value.title) ||\n /^(?:fix|bug|task|feature|update|improve|test|issue|work)(?:\\s+(?:it|this|stuff|things|issue))?[.!]?$/iu.test(\n value.title.trim(),\n )\n )\n add('title.specific', ['title'], 'Name the specific behavior or component that changes.');\n if (value.title.length > 80)\n add('title.length', ['title'], `The title is ${String(value.title.length)} characters; shorten it to at most 80.`);\n if (/^\\s*(?:\\[\\s*(?:bug|feature|task)\\s*\\]|(?:bug|feature|task)\\s*:)/iu.test(value.title))\n add('title.prefix', ['title'], 'Remove the issue-type prefix; use the native Issue Type field.');\n for (const field of ['problem', 'outcome'] as const)\n if (!value[field].trim()) add(field, [field], `Describe the ${field} in concrete terms.`);\n if (!value.acceptanceCriteria.length)\n add('acceptance-criteria', ['acceptanceCriteria'], 'Add an observable behavior and how it will be verified.');\n value.acceptanceCriteria.forEach((ac, index) => {\n if (!ac.behavior.trim() || !ac.verifiedBy.trim())\n add(\n 'acceptance-criteria.fields',\n ['acceptanceCriteria', index],\n 'Provide both behavior and verifiedBy for this criterion.',\n );\n if (\n /^(?:.{1,100}\\s)?(?:works(?:\\s+(?:correctly|as expected|well|properly))?|(?:is|are)\\s+(?:done|verified|reviewed|robust|seamless|appropriate|user[- ]friendly))[\\s.!]*$/iu.test(\n ac.behavior,\n ) ||\n ac.behavior.trim().length < 12\n )\n add(\n 'acceptance-criteria.vague',\n ['acceptanceCriteria', index, 'behavior'],\n 'Replace vague wording with an observable input and result.',\n );\n });\n if (!value.outOfScope.some((item) => item.trim()))\n add('out-of-scope', ['outOfScope'], 'Name at least one explicit non-goal.');\n if (value.openQuestions.length)\n add('open-questions', ['openQuestions'], 'Resolve each open question before marking the issue Ready.');\n if (value.issueType?.toLowerCase() === 'bug') {\n if (!value.bug)\n add('bug', ['bug'], 'Include steps, expected and actual results, reproducibility, and environment.');\n else {\n if (!value.bug.steps.length || value.bug.steps.some((step) => !step.trim()))\n add('bug.steps', ['bug', 'steps'], 'Provide nonempty ordered reproduction steps.');\n for (const field of ['expected', 'actual', 'reproducibility', 'environment'] as const)\n if (!value.bug[field].trim()) add(`bug.${field}`, ['bug', field], `Describe the bug's ${field}.`);\n }\n }\n if (value.epic || value.builder === undefined || isDesignTitle(value.title)) return;\n if (!(value.decisions ?? []).some((item) => item.trim()))\n add('decisions', ['decisions'], `Record each choice the builder must not reopen. ${SKILL_HINT}`);\n const entries = value.surface ?? [];\n if (!entries.length || entries.some((entry) => !entry.path.trim()))\n add('surface', ['surface'], `List every path to change, each with a path and its change. ${SKILL_HINT}`);\n const examples = value.acceptanceCriteria.flatMap((ac) => ac.examples ?? []);\n if (!examples.length)\n add('examples', ['acceptanceCriteria'], `Give each criterion examples (input and expected). ${SKILL_HINT}`);\n else if (!examples.some((example) => example.failure === true))\n add(\n 'examples.failure',\n ['acceptanceCriteria'],\n `Add one example marked failure: true for what must be refused or must fail. ${SKILL_HINT}`,\n );\n if (!(value.proof ?? []).some((item) => item.trim()))\n add('proof', ['proof'], `List the commands to run in order, focused first. ${SKILL_HINT}`);\n}\n\nconst LOCAL_PATH = /\\.local\\/|\\/Users\\/|~\\//u;\nconst CONTRACT_WORD_LIMIT = 400;\n\nfunction localPathHint(field: string, match: string): IssueDiagnostic {\n return hint(\n 'local-path',\n field,\n `${field} cites a local path (${match}); put that evidence on the issue as a comment or artifact and link it instead.`,\n );\n}\n\n/** Local paths an update adds to an already-Ready issue; paths it already cites only warn (#339). */\nexport function addedLocalPaths(before: DraftIssueData, after: DraftIssueData): IssueDiagnostic[] {\n const existing = stringEntries(before).map(([, text]) => text);\n return stringEntries(after).flatMap(([field, text]) => {\n const added = text\n .split(/\\s+/u)\n .find((word) => LOCAL_PATH.test(word) && !existing.some((item) => item.includes(word)));\n const match = added === undefined ? null : LOCAL_PATH.exec(added);\n return match ? [localPathHint(field, match[0])] : [];\n });\n}\n\n/** Rules the Ready write gate refuses (create and draft-to-Ready); every other path only warns. Paul, Nov 26 (ai#5835, ai#5838). */\nfunction readyWriteRules(issue: DraftIssueData): IssueDiagnostic[] {\n if (issue.draft) return [];\n const results: IssueDiagnostic[] = [];\n if (!issue.epic && !(issue.priorWork ?? []).some((item) => item.trim()))\n results.push(\n hint(\n 'priorWork',\n 'priorWork',\n \"List each search you ran for earlier work on this question and what it found, or 'none found' with the searches.\",\n ),\n );\n for (const [field, text] of stringEntries(issue)) {\n const match = LOCAL_PATH.exec(text);\n if (match) results.push(localPathHint(field, match[0]));\n }\n const { outcome, surface, acceptanceCriteria, proof, priorWork } = issue;\n const words = stringEntries({ outcome, surface, acceptanceCriteria, proof, priorWork })\n .flatMap(([, text]) => text.split(/\\s+/u))\n .filter(Boolean).length;\n if (words > CONTRACT_WORD_LIMIT)\n results.push(\n hint(\n 'contract-words',\n 'contract',\n `The contract (outcome, files, acceptance, tests, prior work) is ${String(words)} words; keep it to 400 and move evidence to a comment or artifact.`,\n ),\n );\n return results;\n}\n\nexport const ReadyIssue = IssueFields.extend({\n title: Text.min(10).max(80),\n points: z.number().int().min(1).max(8).optional(),\n problem: Text.min(1),\n outcome: Text.min(1),\n acceptanceCriteria: z.array(AcceptanceCriterion).min(1),\n outOfScope: Strings.min(1),\n openQuestions: Strings.max(0).default([]),\n draft: z.literal(false).default(false),\n})\n .superRefine(secretRule)\n .superRefine(readyRules)\n .meta({ anyOf: [{ properties: { epic: { const: true } }, required: ['epic'] }, { required: ['points'] }] });\nconst ReadySemantics = IssueFields.superRefine(secretRule).superRefine(readyRules);\n/** Portable structural schemas; semantic refinements are enforced by the write/readiness boundary. */\nexport const ISSUE_JSON_SCHEMAS = {\n version: ISSUE_CONTRACT_VERSION,\n draft: z.toJSONSchema(DraftIssue),\n ready: z.toJSONSchema(ReadyIssue),\n};\n\n/** Patch fields share the canonical validators but deliberately have no defaults. */\nexport const IssueWriteFields = {\n title: IssueFields.shape.title.optional(),\n issueType: IssueFields.shape.issueType,\n points: IssueFields.shape.points,\n epic: IssueFields.shape.epic,\n problem: IssueFields.shape.problem.removeDefault().optional(),\n outcome: IssueFields.shape.outcome.removeDefault().optional(),\n acceptanceCriteria: IssueFields.shape.acceptanceCriteria.removeDefault().optional(),\n outOfScope: IssueFields.shape.outOfScope.removeDefault().optional(),\n openQuestions: IssueFields.shape.openQuestions.removeDefault().optional(),\n context: IssueFields.shape.context.removeDefault().optional(),\n bug: IssueFields.shape.bug,\n builder: IssueFields.shape.builder,\n extends: IssueFields.shape.extends,\n priorWork: IssueFields.shape.priorWork,\n decisions: IssueFields.shape.decisions,\n moneyPath: IssueFields.shape.moneyPath,\n ownerOk: IssueFields.shape.ownerOk,\n surface: IssueFields.shape.surface,\n fences: IssueFields.shape.fences,\n proof: IssueFields.shape.proof,\n draft: IssueFields.shape.draft.removeDefault().optional(),\n retainLegacyBody: IssueFields.shape.retainLegacyBody,\n};\nexport const IssueWriteSchema = z.strictObject(IssueWriteFields);\n\n/** Keep advertised structural schemas while returning domain diagnostics before SDK error wrapping. */\nexport function issueInputSchema<T extends z.ZodObject>(schema: T): T {\n return schema.refine(() => true, {\n when: ({ issues }) => {\n // Parsed values have already lost unknown keys. Preserve the original structural failures.\n if (issues.length) throw new IssueValidationError(issueDiagnostics(issues));\n return true;\n },\n });\n}\n\n/** One refusal for unknown keys on every tool: list what is accepted, never echo the unknown key (#140). */\nexport function acceptedKeysError(issue: z.core.$ZodRawIssue): string | undefined {\n if (issue.code !== 'unrecognized_keys') return undefined;\n const shape = (issue.inst as z.ZodObject | undefined)?.shape;\n return shape === undefined ? undefined : `Unknown argument key. Accepted keys: ${Object.keys(shape).join(', ')}.`;\n}\n\nfunction issueDiagnostics(issues: readonly (z.core.$ZodIssue | z.core.$ZodRawIssue)[]): IssueDiagnostic[] {\n const seen = new Set<string>();\n return issues\n .map((issue) => {\n const field = (issue.path ?? []).map(String).join('.') || 'issue';\n const code =\n issue.code === 'custom' && typeof issue.params?.issueCode === 'string'\n ? issue.params.issueCode\n : field === 'points'\n ? 'points'\n : field === 'title'\n ? 'title.length'\n : field === 'outOfScope'\n ? 'out-of-scope'\n : field === 'openQuestions'\n ? 'open-questions'\n : field === 'acceptanceCriteria'\n ? 'acceptance-criteria'\n : field === 'draft'\n ? 'draft'\n : issue.code === 'unrecognized_keys'\n ? 'field.unknown'\n : 'field.type';\n return hint(\n code,\n field,\n code === 'points'\n ? 'Choose Points from 1 through 8; split a 13-point issue into sub-issues.'\n : issue.code === 'unrecognized_keys'\n ? (acceptedKeysError(issue as z.core.$ZodRawIssue) ?? 'Remove unrecognized fields from ' + field + '.')\n : (issue.message ??\n (issue.code === 'invalid_type'\n ? 'Provide a valid ' + issue.expected + ' value.'\n : 'Provide a value satisfying the declared issue field schema.')),\n );\n })\n .filter((issue) => {\n const key = issue.code + ':' + issue.field;\n if (seen.has(key)) return false;\n seen.add(key);\n return true;\n });\n}\n\nexport function validateIssue(value: unknown, ready = true): { issue?: DraftIssueData; failures: IssueDiagnostic[] } {\n const parsed = (ready ? ReadyIssue : DraftIssue).safeParse(value);\n if (parsed.success) return { issue: parsed.data, failures: [] };\n const semantic = ready ? ReadySemantics.safeParse(value) : undefined;\n const issues = [...(semantic?.success === false ? semantic.error.issues : []), ...parsed.error.issues];\n return { failures: issueDiagnostics(issues) };\n}\n\nexport class IssueValidationError extends DeliveryError {\n constructor(readonly failures: IssueDiagnostic[]) {\n super(JSON.stringify({ contract: ISSUE_CONTRACT_VERSION, failures }));\n }\n}\n\n/** `requireBuilder` is set at Ready create and draft-to-Ready; legacy content updates never set it. */\nexport function requireIssue(value: unknown, options: { requireBuilder?: true } = {}): DraftIssueData {\n const structural = IssueFields.safeParse(value);\n const result = validateIssue(value, !structural.success || !structural.data.draft);\n const gated = options.requireBuilder === true && structural.success && !structural.data.draft;\n const unbuilt =\n gated && !structural.data.epic && structural.data.builder === undefined && !isDesignTitle(structural.data.title);\n const writeFailures = gated ? readyWriteRules(structural.data) : [];\n if (!result.issue || unbuilt || writeFailures.length)\n throw new IssueValidationError([\n ...(unbuilt\n ? [\n hint(\n 'builder.missing',\n 'builder',\n `Add builder, decisions, surface, proof and examples, or pass draft: true to capture it now. ${SKILL_HINT}`,\n ),\n ]\n : []),\n ...result.failures,\n ...writeFailures,\n ]);\n return result.issue;\n}\n\nconst escapeStatus = (value: string): string =>\n value\n .replaceAll('&', '&')\n .replaceAll('<', '<')\n .replaceAll('>', '>')\n .replace(/[\\\\`*_[\\]]/gu, '\\\\$&');\nconst unescapeStatus = (value: string): string =>\n value\n .replace(/\\\\([\\\\`*_[\\]])/gu, '$1')\n .replaceAll('<', '<')\n .replaceAll('>', '>')\n .replaceAll('&', '&');\n\nexport function renderIssueBody(value: DraftIssueData, status?: IssueStatusData, legacyFormatting = false): string {\n const item = DraftIssue.parse(value);\n if (status !== undefined) requireIssueStatus(IssueStatus, status);\n const list = (values: string[]): string => (values.length ? values.map((v) => `- ${v}`).join('\\n') : '(none)');\n const bulletSection = (title: string, values: string[] | undefined): string[] =>\n values?.length ? [`## ${title}`, list(values)] : [];\n const parts = [\n ISSUE_BODY_MARKER,\n '## Status',\n status === undefined\n ? item.draft\n ? 'Draft \u2014 parked; not ready to work.'\n : 'Ready'\n : `- **State:** ${status.state}\\n- **Last updated:** ${status.lastUpdated} UTC\\n- **Next milestone:** ${escapeStatus(status.nextMilestone)}\\n- **Blockers:** ${escapeStatus(status.blockers)}\\n- **Latest journal:** ${escapeStatus(status.latestJournal)}`,\n '## Problem',\n item.problem,\n '## Outcome',\n item.outcome,\n ...(item.deferral === undefined ? [] : ['## Deferral', `Deferred: ${JSON.stringify(item.deferral)}`]),\n ...(item.builder === undefined\n ? []\n : ['## Builder', item.builder.tier === 'standard' ? 'standard' : `frontier: ${item.builder.reason}`]),\n ...bulletSection('Extends', item.extends),\n ...bulletSection('Prior work', item.priorWork),\n ...bulletSection('Decisions', item.decisions),\n ...(item.moneyPath === true ? ['## Money path', 'yes'] : []),\n ...bulletSection('Owner OK', item.ownerOk),\n '## Acceptance criteria',\n item.acceptanceCriteria\n .map(\n (ac) =>\n (legacyFormatting\n ? `- [ ] ${ac.behavior}\\n Verified by: ${ac.verifiedBy}`\n : `- [ ] ${ac.behavior.replace(/\\n/gu, '\\n ')}${ac.behavior.includes('\\n') ? '\\n' : ''}\\n Verified by: ${ac.verifiedBy.replace(/\\n/gu, '\\n ')}`) +\n (ac.examples ?? [])\n .map(\n (example) =>\n `\\n Example: ${example.input.replace(/\\n/gu, '\\n ')} \u2192 ${example.expected.replace(/\\n/gu, '\\n ')}${example.failure === true ? ' (failure)' : ''}`,\n )\n .join(''),\n )\n .join('\\n'),\n ...(item.surface?.length\n ? [\n '## Surface',\n item.surface\n .map((entry) =>\n [`- ${entry.change} \\`${entry.path}\\``, ...(entry.signatures ?? []).map((sig) => ` ${sig}`)].join('\\n'),\n )\n .join('\\n'),\n ]\n : []),\n ...bulletSection('Fences', item.fences),\n ...bulletSection('Proof', item.proof),\n '## Out of scope',\n list(item.outOfScope),\n '## Open questions',\n list(item.openQuestions),\n '## Context',\n `Components:\\n${list(item.context.components)}\\n\\nFiles:\\n${list(item.context.files)}\\n\\nEvidence:\\n${list(item.context.evidence)}`,\n ];\n if (item.bug)\n parts.push(\n '## Bug',\n `Steps:\\n${list(item.bug.steps)}\\n\\nExpected: ${item.bug.expected}\\n\\nActual: ${item.bug.actual}\\n\\nReproducibility: ${item.bug.reproducibility}\\n\\nEnvironment: ${item.bug.environment}`,\n );\n if (item.legacyBody !== undefined && item.retainLegacyBody !== false)\n parts.push('## Preserved legacy body', item.legacyBody);\n // Escape comment delimiters without altering decoded data. Exact render equality detects human/payload divergence.\n parts.push(`${DATA_PREFIX}${JSON.stringify(item).replaceAll('<', '\\\\u003c').replaceAll('>', '\\\\u003e')} -->`);\n return parts.join('\\n\\n') + '\\n';\n}\n\nfunction section(body: string, names: string[]): string {\n const lines = body.split(/\\r?\\n/u);\n const start = lines.findIndex((line) =>\n names.includes(\n line\n .replace(/^#{1,6}\\s+/u, '')\n .trim()\n .toLowerCase(),\n ),\n );\n if (start < 0) return '';\n const end = lines.findIndex((line, index) => index > start && /^#{1,6}\\s/u.test(line));\n return lines\n .slice(start + 1, end < 0 ? undefined : end)\n .join('\\n')\n .trim();\n}\n\nconst REBUILD_HINT =\n 'The issue body was edited outside ai-delivery; send problem, outcome, acceptanceCriteria and outOfScope (plus bug for a Bug, epic for an epic, and any draft, openQuestions or context to keep) in one issue_update to rebuild it.';\n\n/** Lenient conversion retains every legacy byte, and never invents verification or bug evidence. */\nexport function parseIssueBody(\n body: string,\n metadata: { title: string; points?: number; issueType?: string },\n): { issue: DraftIssueData; legacy: boolean; status?: IssueStatusData; legacyFormatting?: boolean } {\n if (body.trimStart().startsWith(ISSUE_BODY_MARKER)) {\n const start = body.lastIndexOf(DATA_PREFIX);\n const end = body.indexOf(' -->', start);\n if (start < 0 || end < 0) throw new IssueValidationError([hint('body.canonical', 'body', REBUILD_HINT)]);\n let decoded: unknown;\n try {\n decoded = JSON.parse(body.slice(start + DATA_PREFIX.length, end));\n } catch {\n throw new IssueValidationError([hint('body.canonical', 'body', REBUILD_HINT)]);\n }\n const result = validateIssue(decoded, false);\n if (!result.issue) throw new IssueValidationError(result.failures);\n const displayed = body.slice((ISSUE_BODY_MARKER + '\\n\\n## Status\\n\\n').length, body.indexOf('\\n\\n## Problem\\n\\n'));\n let status: IssueStatusData | undefined;\n if (displayed !== 'Ready' && displayed !== 'Draft \u2014 parked; not ready to work.') {\n const match =\n /^- \\*\\*State:\\*\\* (Ready|Draft)\\n- \\*\\*Last updated:\\*\\* (\\S+) UTC\\n- \\*\\*Next milestone:\\*\\* ([^\\r\\n]+)\\n- \\*\\*Blockers:\\*\\* ([^\\r\\n]+)\\n- \\*\\*Latest journal:\\*\\* ([^\\r\\n]+)$/u.exec(\n displayed,\n );\n if (!match)\n throw new IssueValidationError([\n hint('body.canonical', 'status', 'Restore the complete unambiguous status block.'),\n ]);\n status = requireIssueStatus(IssueStatus, {\n state: match[1],\n lastUpdated: match[2],\n nextMilestone: unescapeStatus(match[3]!),\n blockers: unescapeStatus(match[4]!),\n latestJournal: unescapeStatus(match[5]!),\n });\n if (status.state !== (result.issue.draft ? 'Draft' : 'Ready'))\n throw new IssueValidationError([\n hint('body.canonical', 'status', 'Status state must agree with the typed draft field.'),\n ]);\n }\n const footer = issueTrackingFooter(body);\n const canonical = footer ? body.slice(0, -footer.length) : body;\n const legacyFormatting = renderIssueBody(result.issue, status) !== canonical;\n if (\n (legacyFormatting && renderIssueBody(result.issue, status, true) !== canonical) ||\n result.issue.title !== metadata.title\n )\n throw new IssueValidationError([hint('body.canonical', 'body', REBUILD_HINT)]);\n return {\n issue: result.issue,\n legacy: false,\n ...(status === undefined ? {} : { status }),\n ...(legacyFormatting ? { legacyFormatting: true } : {}),\n };\n }\n const verification = section(body, ['verification', 'validation', 'tests']);\n const acText = section(body, ['acceptance criteria', 'acceptance']);\n const acceptanceCriteria = acText.split(/\\n(?=\\s*[-*+]\\s+\\[[ xX]\\])/u).flatMap((block) => {\n const match = /^\\s*[-*+]\\s+\\[[ xX]\\]\\s+([\\s\\S]+)/u.exec(block);\n if (!match) return [];\n const [behavior = '', verifiedBy = verification] = match[1]!.split(/\\n\\s*(?:Verified by:|Verified by)\\s*/iu);\n return [{ behavior: behavior.trim(), verifiedBy: verifiedBy.trim() }];\n });\n const items = (s: string): string[] =>\n s\n .split(/\\r?\\n/u)\n .map((line) => line.replace(/^\\s*[-*+]\\s+/u, '').trim())\n .filter(Boolean);\n const scope = section(body, ['scope', 'context']);\n const bug =\n metadata.issueType?.toLowerCase() === 'bug'\n ? {\n steps: items(section(body, ['steps', 'steps to reproduce'])),\n expected: section(body, ['expected', 'expected results']),\n actual: section(body, ['actual', 'actual results']),\n reproducibility: section(body, ['reproducibility']),\n environment: section(body, ['environment']),\n }\n : undefined;\n const converted = validateIssue(\n {\n ...metadata,\n problem: section(body, ['problem']),\n outcome: section(body, ['outcome']),\n acceptanceCriteria,\n outOfScope: items(section(body, ['out of scope', 'non-goals'])),\n openQuestions: items(section(body, ['open questions'])),\n context: { components: [], files: scope ? [scope] : [], evidence: verification ? [verification] : [] },\n ...(bug === undefined ? {} : { bug }),\n draft: /^draft\\b/iu.test(section(body, ['status'])),\n legacyBody: body,\n },\n false,\n );\n if (!converted.issue) throw new IssueValidationError(converted.failures);\n return { issue: converted.issue, legacy: true };\n}\n\nconst CODE_EXTENSIONS = /\\.(?:ts|tsx|js|mjs|cjs|py|go|rs|java|kt|rb|sql|sh)$/iu;\nconst proseWords = (issue: DraftIssueData): number =>\n [issue.problem, issue.outcome, ...issue.acceptanceCriteria.map((ac) => ac.behavior)]\n .flatMap((text) => text.split(/\\s+/u))\n .filter(Boolean).length;\n\nexport function issueWarnings(issue: DraftIssueData): IssueDiagnostic[] {\n const warnings: IssueDiagnostic[] = [];\n const warn = (code: string, field: string, message: string): void => {\n warnings.push(hint(code, field, message));\n };\n if (issue.acceptanceCriteria.length > 7)\n warn('many-criteria', 'acceptanceCriteria', 'Consider slicing more than seven criteria into smaller issues.');\n if (\n issue.builder === undefined &&\n !issue.acceptanceCriteria.some((ac) =>\n /\\b(?:edge|failure|fail|error|invalid|reject|refus|empty|missing|interrupt|timeout|boundary)/iu.test(ac.behavior),\n )\n )\n warn('edge-case', 'acceptanceCriteria', 'Describe an edge or failure case.');\n if (\n issue.issueType?.toLowerCase() === 'bug' &&\n !issue.acceptanceCriteria.some((ac) => /regression/iu.test(ac.behavior + ' ' + ac.verifiedBy))\n )\n warn('bug.regression', 'acceptanceCriteria', 'Add a regression test criterion for the bug.');\n if (issue.builder === undefined && ![...issue.context.files, ...issue.context.components].some((item) => item.trim()))\n warn('context', 'context', 'Name relevant components or files.');\n if ((issue.fences ?? []).some((fence) => START_ORDER.test(fence)))\n warn(\n 'fences.start-order',\n 'fences',\n \"A fence sets when work may start. Put each issue it waits on in blockedBy, or a date or event in defer; fences keep paths and 'Lands after' merge order.\",\n );\n warnings.push(...readyWriteRules(issue));\n const owed = ownerOkOwed(issue);\n if (owed) warnings.push(owed);\n if (proseWords(issue) > 300)\n warn('body.length', 'body', `Consider cutting the problem, outcome and criteria to 300 words. ${SKILL_HINT}`);\n if (issue.draft || issue.epic) return warnings;\n if (isDesignTitle(issue.title)) {\n if (!issue.acceptanceCriteria.some((ac) => /#\\d+\\b/u.test(ac.behavior)))\n warn(\n 'design.build-ticket',\n 'acceptanceCriteria',\n \"Name the build ticket in an acceptance criterion, e.g. 'Build ticket #<n> filed Ready'.\",\n );\n return warnings;\n }\n if (issue.builder === undefined) {\n warn(\n 'builder.unset',\n 'builder',\n `Set builder, decisions, surface, proof and examples when next editing. ${SKILL_HINT}`,\n );\n return warnings;\n }\n if (issue.points !== undefined && issue.points > 5)\n warn('size.points', 'points', `Consider splitting an issue above 5 points. ${SKILL_HINT}`);\n const entries = issue.surface ?? [];\n if (new Set(entries.map((entry) => entry.path.trim())).size > 6)\n warn('size.surface', 'surface', `Consider splitting an issue that changes more than 6 paths. ${SKILL_HINT}`);\n if (issue.acceptanceCriteria.some((ac) => !ac.examples?.length))\n warn('examples.ac', 'acceptanceCriteria', `Give every criterion at least one example. ${SKILL_HINT}`);\n const unsigned = entries.filter(\n (entry) =>\n entry.change !== 'delete' &&\n CODE_EXTENSIONS.test(entry.path.trim()) &&\n !/\\.test\\.|\\.spec\\.|\\/test/u.test(entry.path) &&\n !entry.signatures?.some((signature) => signature.trim()),\n );\n if (unsigned.length)\n warn(\n 'surface.signature',\n 'surface',\n `Add exact signatures for ${unsigned.map((entry) => entry.path).join(', ')}. ${SKILL_HINT}`,\n );\n if (!(issue.fences ?? []).some((item) => item.trim()))\n warn('fences', 'fences', `Name the nearby paths the builder must not touch. ${SKILL_HINT}`);\n if (!(issue.extends ?? []).some((item) => item.trim()))\n warn('extends', 'extends', `Name the design or owner this change extends; add no parallel path. ${SKILL_HINT}`);\n return warnings;\n}\n\nexport function issueBodyDiff(before: string, after: string): string {\n return [\n '--- prior body',\n '+++ canonical body',\n ...before.split('\\n').map((line) => '-' + line),\n ...after.split('\\n').map((line) => '+' + line),\n ].join('\\n');\n}\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,SAAS;AAClB,SAAS,qBAAqB;AAEvB,MAAM,yBAAyB;AAC/B,MAAM,oBAAoB;AACjC,MAAM,cAAc;AACpB,MAAM,eACJ;AACK,SAAS,iBAAiB,MAAsB;AACrD,SAAO,aAAa,KAAK,IAAI,IAAI,CAAC,KAAK;AACzC;AACA,MAAM,gBAAgB;AACf,SAAS,oBAAoB,MAAsB;AACxD,SAAO,cAAc,KAAK,IAAI,IAAI,CAAC,KAAK,iBAAiB,IAAI;AAC/D;AACA,MAAM,OAAO,EAAE,OAAO;AACtB,MAAM,UAAU,EAAE,MAAM,IAAI;AACrB,MAAM,eAAe,EAAE,aAAa;AAAA,EACzC,OAAO;AAAA,EACP,UAAU;AAAA,EACV,SAAS,EAAE,QAAQ,IAAI,EAAE,SAAS,EAAE,SAAS,wDAAwD;AACvG,CAAC;AACD,MAAM,sBAAsB,EAAE,aAAa;AAAA,EACzC,UAAU;AAAA,EACV,YAAY;AAAA,EACZ,UAAU,EACP,MAAM,YAAY,EAClB,SAAS,EACT,SAAS,mGAAmG;AACjH,CAAC;AACM,MAAM,iBAAiB,EAAE,K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,KACtC,CAAC,4BAA4B,KAAK,MAAM,IAAI,KAC5C,CAAC,MAAM,YAAY,KAAK,CAAC,cAAc,UAAU,KAAK,CAAC;AAAA,EAC3D;AACA,MAAI,SAAS;AACX;AAAA,MACE;AAAA,MACA;AAAA,MACA,4BAA4B,SAAS,IAAI,CAAC,UAAU,MAAM,IAAI,EAAE,KAAK,IAAI,CAAC,KAAK,UAAU;AAAA,IAC3F;AACF,MAAI,EAAE,MAAM,UAAU,CAAC,GAAG,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC;AAClD,SAAK,UAAU,UAAU,qDAAqD,UAAU,EAAE;AAC5F,MAAI,EAAE,MAAM,WAAW,CAAC,GAAG,KAAK,CAAC,SAAS,KAAK,KAAK,CAAC;AACnD,SAAK,WAAW,WAAW,uEAAuE,UAAU,EAAE;AAChH,SAAO;AACT;AAEO,SAAS,cAAc,QAAgB,OAAuB;AACnE,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,GAAG,OAAO,MAAM,IAAI,EAAE,IAAI,CAAC,SAAS,MAAM,IAAI;AAAA,IAC9C,GAAG,MAAM,MAAM,IAAI,EAAE,IAAI,CAAC,SAAS,MAAM,IAAI;AAAA,EAC/C,EAAE,KAAK,IAAI;AACb;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -680,6 +680,39 @@ test("a Design: issue files Ready without builder fields, warns without a build
|
|
|
680
680
|
(error) => error instanceof IssueValidationError && error.failures.some((f) => f.code === "builder.missing")
|
|
681
681
|
);
|
|
682
682
|
});
|
|
683
|
+
test("a fence that sets start order warns fences.start-order once, on drafts too, and never refuses", () => {
|
|
684
|
+
const count = (issue) => issueWarnings(issue).filter((w) => w.code === "fences.start-order").length;
|
|
685
|
+
const ready = { ...validIssue(), fences: ["Start after ai#6481 merges (same files)"] };
|
|
686
|
+
assert.equal(count(ready), 1);
|
|
687
|
+
assert.doesNotThrow(() => requireIssue(ready));
|
|
688
|
+
assert.equal(
|
|
689
|
+
count({
|
|
690
|
+
...validIssue(),
|
|
691
|
+
fences: [
|
|
692
|
+
"Lands after om#50's PR: edit its scan_transcript. Don't start until it merges.",
|
|
693
|
+
"Starts only after rn4's quiet proofs."
|
|
694
|
+
]
|
|
695
|
+
}),
|
|
696
|
+
1
|
|
697
|
+
);
|
|
698
|
+
assert.equal(
|
|
699
|
+
count({
|
|
700
|
+
...validIssue(),
|
|
701
|
+
draft: true,
|
|
702
|
+
fences: ["Money path: no build until Paul's Owner OK passes a fresh check."]
|
|
703
|
+
}),
|
|
704
|
+
1
|
|
705
|
+
);
|
|
706
|
+
});
|
|
707
|
+
test("merge-order and path fences do not warn fences.start-order", () => {
|
|
708
|
+
const fences = [
|
|
709
|
+
"Lands after ai#6373 (PR 6406 edits minute-planner-part.test.ts).",
|
|
710
|
+
"ai#6371 edits the same two files and lands after this; don't change budgeting here",
|
|
711
|
+
"Restart the hub after deploy"
|
|
712
|
+
];
|
|
713
|
+
assert.ok(!issueWarnings({ ...validIssue(), fences }).some((w) => w.code === "fences.start-order"));
|
|
714
|
+
assert.ok(!issueWarnings(validIssue()).some((w) => w.code === "fences.start-order"));
|
|
715
|
+
});
|
|
683
716
|
export {
|
|
684
717
|
validIssue
|
|
685
718
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/issueContract.test.ts"],
|
|
4
|
-
"sourcesContent": ["import assert from 'node:assert/strict';\nimport { test } from 'vitest';\nimport { z } from 'zod';\nimport {\n DraftIssue,\n ReadyIssue,\n IssueFields,\n IssueWriteSchema,\n ISSUE_JSON_SCHEMAS,\n ISSUE_BODY_MARKER,\n requireIssue,\n renderIssueBody,\n parseIssueBody,\n validateIssue,\n issueWarnings,\n IssueValidationError,\n addedLocalPaths,\n} from './issueContract.js';\nimport { AI_DELIVERY_MCP_TOOLS } from './mcp/index.js';\nimport { builderReady } from './fixtures/builderReady.js';\n\nexport const validIssue = () =>\n IssueFields.parse({\n title: 'Reject invalid widget identifiers before persistence',\n issueType: 'Feature',\n points: 2,\n problem: 'Malformed identifiers currently reach persistence.',\n outcome: 'Widget writes reject malformed identifiers before persistence.',\n acceptanceCriteria: [\n {\n behavior: 'An invalid widget identifier returns an error without a persistence call.',\n verifiedBy: 'A mocked persistence regression asserts the error and zero calls.',\n },\n ],\n outOfScope: ['Changing the storage engine.'],\n openQuestions: [],\n context: {\n components: ['widget intake'],\n files: ['src/widget.ts'],\n evidence: ['A portable synthetic identifier fixture.'],\n },\n });\n\ntest('body.length counts prose words in problem, outcome and criteria and warns strictly above 300', () => {\n for (const [words, warning] of [\n [299, false],\n [300, false],\n [301, true],\n ] as const) {\n const issue = validIssue();\n issue.problem = Array.from({ length: words - 2 }, () => 'w').join(' ');\n issue.outcome = 'one';\n issue.acceptanceCriteria[0]!.behavior = 'two';\n assert.equal(\n issueWarnings(issue).some((item) => item.code === 'body.length'),\n warning,\n String(words),\n );\n }\n const structured = validIssue();\n structured.context.evidence.push('A'.repeat(5000));\n assert.ok(!issueWarnings(structured).some((item) => item.code === 'body.length'));\n});\n\ntest('multiline criteria keep nested bullets and verification attached to their own checkbox', () => {\n const issue = validIssue();\n issue.acceptanceCriteria = [\n {\n behavior: 'Reject malformed input:\\n- Empty input\\n - Whitespace only\\n- Invalid shape',\n verifiedBy: 'Regression cases:\\n- Empty and malformed',\n },\n { behavior: 'A valid input is stored once.', verifiedBy: 'One observed write.' },\n ];\n const actual = renderIssueBody(issue).split('## Acceptance criteria\\n\\n')[1]!.split('\\n\\n## Out of scope')[0];\n assert.equal(\n actual,\n '- [ ] Reject malformed input:\\n - Empty input\\n - Whitespace only\\n - Invalid shape\\n\\n Verified by: Regression cases:\\n - Empty and malformed\\n- [ ] A valid input is stored once.\\n Verified by: One observed write.',\n );\n});\n\ntest('MCP create/update fields derive from the canonical schema and patch omissions retain no defaults', () => {\n const create = AI_DELIVERY_MCP_TOOLS.find((t) => t.name === 'issue_create')!;\n const update = AI_DELIVERY_MCP_TOOLS.find((t) => t.name === 'issue_update')!;\n const shape = z.toJSONSchema(IssueWriteSchema).properties;\n for (const name of [\n 'acceptanceCriteria',\n 'context',\n 'outOfScope',\n 'openQuestions',\n 'problem',\n 'outcome',\n 'bug',\n 'draft',\n ]) {\n assert.deepEqual(z.toJSONSchema(create.inputSchema).properties?.[name], shape?.[name]);\n assert.deepEqual(z.toJSONSchema(update.inputSchema).properties?.[name], shape?.[name]);\n }\n assert.deepEqual(update.inputSchema.parse({ issueNumber: 17 }), { issueNumber: 17 });\n assert.ok('issueContract' in create);\n assert.deepEqual(\n create.issueContract,\n ISSUE_JSON_SCHEMAS,\n 'portable output is reachable through the existing packaged MCP export',\n );\n});\n\ntest('portable JSON Schema snapshot carries Ready bounds and distinguishes incomplete drafts', () => {\n const ready = ISSUE_JSON_SCHEMAS.ready;\n assert.deepEqual(\n {\n draft: ready.properties?.draft,\n points: ready.properties?.points,\n title: ready.properties?.title,\n openQuestions: ready.properties?.openQuestions,\n },\n {\n draft: { type: 'boolean', const: false, default: false },\n points: { type: 'integer', minimum: 1, maximum: 8 },\n title: { type: 'string', minLength: 10, maxLength: 80 },\n openQuestions: { default: [], type: 'array', items: { type: 'string' }, maxItems: 0 },\n },\n );\n assert.deepEqual(ready.anyOf, [\n { properties: { epic: { const: true } }, required: ['epic'] },\n { required: ['points'] },\n ]);\n assert.ok(!ISSUE_JSON_SCHEMAS.draft.required?.includes('points'));\n});\n\ntest('concrete domain wording remains Ready while generic completion claims fail', () => {\n for (const behavior of [\n 'The independently reviewed head SHA is sent as the merge guard.',\n 'A failed request leaves the Project Done column unchanged.',\n 'A verified token grants access only to its repository.',\n 'The adapter works with a missing local checkout and returns the selected repository.',\n ]) {\n const issue = validIssue();\n issue.acceptanceCriteria[0]!.behavior = behavior;\n assert.deepEqual(validateIssue(issue).failures, [], behavior);\n }\n for (const behavior of [\n 'The widget works correctly.',\n 'The change is reviewed.',\n 'The request is done.',\n 'The interface is user friendly.',\n ]) {\n const issue = validIssue();\n issue.acceptanceCriteria[0]!.behavior = behavior;\n assert.ok(\n validateIssue(issue).failures.some((f) => f.code === 'acceptance-criteria.vague'),\n behavior,\n );\n }\n});\n\ntest('canonical bodies round trip every typed field, multiline markup and comment delimiters', () => {\n const issue = validIssue();\n issue.context.evidence.push('Observed <!-- text -->\\n## nested heading\\n`code`');\n const body = renderIssueBody(issue);\n assert.ok(body.startsWith(ISSUE_BODY_MARKER + '\\n\\n## Status\\n\\nReady'));\n assert.deepEqual(parseIssueBody(body, { title: issue.title }).issue, issue);\n assert.equal(parseIssueBody(body, { title: issue.title }).legacy, false);\n assert.throws(\n () => parseIssueBody(body.replace('## Status\\n\\nReady', '## Status\\n\\nDraft'), { title: issue.title }),\n /body.canonical/u,\n );\n assert.throws(() => parseIssueBody(body, { title: 'Different native title' }), /body.canonical/u);\n});\n\ntest('lenient legacy conversion retains all bytes, portable verification and marker descriptions', () => {\n const body =\n '## Problem\\nA literal ' +\n ISSUE_BODY_MARKER +\n ' is documentation.\\n## Outcome\\nReject malformed identifiers.\\n## Acceptance Criteria\\n- [ ] Invalid identifiers return an error before persistence.\\n## Verification\\nRun the synthetic identifier tests.\\n## Out of scope\\n- Storage engine changes.\\n## Scope\\nsrc/missing-in-this-checkout.ts\\nUnclassified historical text.\\n';\n const parsed = parseIssueBody(body, { title: validIssue().title, points: 2, issueType: 'Feature' });\n assert.equal(parsed.legacy, true);\n assert.equal(parsed.issue.legacyBody, body);\n assert.equal(parsed.issue.acceptanceCriteria[0]?.verifiedBy, 'Run the synthetic identifier tests.');\n const ready = requireIssue(parsed.issue);\n assert.deepEqual(parseIssueBody(renderIssueBody(ready), { title: ready.title }).issue, ready);\n});\n\ntest('legacy conversion never fabricates missing verification or bug evidence', () => {\n const body =\n '## Problem\\nA failure.\\n## Outcome\\nReject invalid widgets.\\n## Acceptance Criteria\\n- [ ] Invalid widgets are rejected before persistence.\\n## Out of scope\\n- Storage changes.\\n';\n const parsed = parseIssueBody(body, { title: validIssue().title, points: 2, issueType: 'Bug' });\n const codes = validateIssue(parsed.issue).failures.map((f) => f.code);\n assert.ok(codes.includes('acceptance-criteria.fields'));\n assert.ok(codes.includes('bug.steps'));\n assert.ok(codes.includes('bug.environment'));\n});\n\nconst blockingCases: [string, (issue: ReturnType<typeof validIssue>) => void, string][] = [\n [\n 'Points13',\n (i) => {\n i.points = 13;\n },\n 'points',\n ],\n [\n 'Points0',\n (i) => {\n i.points = 0;\n },\n 'points',\n ],\n [\n 'Points9',\n (i) => {\n i.points = 9;\n },\n 'points',\n ],\n [\n 'missing behavior',\n (i) => {\n i.acceptanceCriteria[0]!.behavior = '';\n },\n 'acceptance-criteria.fields',\n ],\n [\n 'missing verifiedBy',\n (i) => {\n i.acceptanceCriteria[0]!.verifiedBy = '';\n },\n 'acceptance-criteria.fields',\n ],\n [\n 'vague AC',\n (i) => {\n i.acceptanceCriteria[0]!.behavior = 'The widget works correctly.';\n },\n 'acceptance-criteria.vague',\n ],\n [\n 'no non-goal',\n (i) => {\n i.outOfScope = [];\n },\n 'out-of-scope',\n ],\n [\n 'open question',\n (i) => {\n i.openQuestions = ['Choose the persistence behavior.'];\n },\n 'open-questions',\n ],\n [\n 'vague title',\n (i) => {\n i.title = 'Fix things';\n },\n 'title.specific',\n ],\n [\n 'long title',\n (i) => {\n i.title = 'x'.repeat(81);\n },\n 'title.length',\n ],\n [\n 'type prefix',\n (i) => {\n i.title = 'Bug: Reject invalid widget identifiers';\n },\n 'title.prefix',\n ],\n [\n 'bug fields',\n (i) => {\n i.issueType = 'Bug';\n },\n 'bug',\n ],\n [\n 'secret',\n (i) => {\n i.problem = 'A fixture contains ' + ['gh', 'p_'].join('') + 'A'.repeat(24);\n },\n 'secrets',\n ],\n];\nfor (const [name, mutate, code] of blockingCases)\n test('Ready blocks ' + name + ' with a field and actionable fix hint', () => {\n const issue = validIssue();\n mutate(issue);\n const failures = validateIssue(issue).failures;\n assert.ok(\n failures.some((f) => f.code === code),\n JSON.stringify(failures),\n );\n assert.ok(failures.every((f) => f.field.length > 0 && f.fixHint.length > 10));\n });\n\nfor (const field of ['steps', 'expected', 'actual', 'reproducibility', 'environment'] as const)\n test('Bug requires ' + field, () => {\n const issue = validIssue();\n issue.issueType = 'Bug';\n issue.bug = {\n steps: ['Submit an invalid identifier.'],\n expected: 'No write.',\n actual: 'A write occurs.',\n reproducibility: 'Every invalid input.',\n environment: 'Synthetic server, Node24.',\n };\n if (field === 'steps') issue.bug.steps = [];\n else issue.bug[field] = '';\n assert.ok(validateIssue(issue).failures.some((f) => f.code === 'bug.' + field));\n });\n\ntest('Ready is the default; explicit drafts park incomplete requirements without permitting secrets', () => {\n assert.equal(requireIssue(validIssue()).draft, false);\n assert.equal(ReadyIssue.safeParse({ title: 'Investigate invalid widget identifiers', draft: true }).success, false);\n const draft = requireIssue({ title: 'Investigate invalid widget identifiers', draft: true });\n assert.equal(draft.draft, true);\n assert.match(renderIssueBody(draft), /Draft \u2014 parked/u);\n assert.equal(DraftIssue.safeParse({ ...draft, problem: 'password=' + 'X'.repeat(16) }).success, false);\n});\n\ntest('independent Ready failures remain actionable together when native Points are missing', () => {\n const failures = validateIssue({\n title: 'Investigate malformed widget identifiers',\n issueType: 'Bug',\n problem: 'A malformed identifier reaches storage.',\n outcome: 'Reject malformed identifiers.',\n acceptanceCriteria: [],\n outOfScope: [],\n openQuestions: ['Choose the return shape.'],\n }).failures;\n for (const code of ['points', 'bug', 'acceptance-criteria', 'out-of-scope', 'open-questions'])\n assert.ok(failures.some((f) => f.code === code));\n assert.equal(new Set(failures.map((f) => f.code + ':' + f.field)).size, failures.length);\n});\n\nconst warningCases: [string, (issue: ReturnType<typeof validIssue>) => void, string][] = [\n [\n 'many criteria',\n (i) => {\n i.acceptanceCriteria = Array.from({ length: 8 }, () => ({ ...i.acceptanceCriteria[0]! }));\n },\n 'many-criteria',\n ],\n [\n 'no edge case',\n (i) => {\n i.acceptanceCriteria[0]!.behavior = 'A valid identifier produces exactly one persisted widget.';\n },\n 'edge-case',\n ],\n [\n 'Bug without regression',\n (i) => {\n i.issueType = 'Bug';\n i.bug = {\n steps: ['Submit an invalid identifier.'],\n expected: 'No write.',\n actual: 'A write occurs.',\n reproducibility: 'Every input.',\n environment: 'Synthetic server.',\n };\n i.acceptanceCriteria[0]!.verifiedBy = 'A mock asserts zero persistence calls.';\n },\n 'bug.regression',\n ],\n [\n 'no context',\n (i) => {\n i.context = { files: [], components: [], evidence: [] };\n },\n 'context',\n ],\n [\n 'local path',\n (i) => {\n i.context.evidence = ['~/runs/READOUT.md'];\n },\n 'local-path',\n ],\n [\n 'long body',\n (i) => {\n i.problem = Array.from({ length: 301 }, () => 'word').join(' ');\n },\n 'body.length',\n ],\n];\nfor (const [name, mutate, code] of warningCases)\n test('Warning does not block ' + name, () => {\n const issue = validIssue();\n mutate(issue);\n assert.equal(validateIssue(issue).failures.length, 0);\n assert.ok(issueWarnings(issue).some((w) => w.code === code));\n });\n\nconst builderFields = {\n builder: { tier: 'frontier' as const, reason: 'state-machine' as const },\n extends: ['src/widget.ts saveWidget (the one widget write path)'],\n decisions: ['Valid id: ^w-[0-9a-f]{8}$. Refuse with InvalidWidgetId.'],\n surface: [\n {\n path: 'src/widget.ts',\n change: 'edit' as const,\n signatures: ['export function saveWidget(w: Widget): void'],\n },\n { path: 'src/old.ts', change: 'delete' as const },\n ],\n fences: ['src/store.ts (storage owner)'],\n proof: ['npx vitest run src/widget.test.ts'],\n};\n\ntest('every builder-ready field renders in order and parses back equal', () => {\n const issue = IssueFields.parse({\n ...validIssue(),\n ...builderFields,\n acceptanceCriteria: [\n {\n behavior: 'An invalid widget identifier returns an error without a persistence call.',\n verifiedBy: 'src/widget.test.ts',\n examples: [\n { input: \"id 'w-0a1b2c3d'\", expected: 'one store.put' },\n {\n input: \"id ' w-0A1B2C3D'\",\n expected: 'InvalidWidgetId',\n failure: true,\n },\n ],\n },\n ],\n });\n const body = renderIssueBody(issue);\n const at = (heading: string) => body.indexOf(`\\n## ${heading}\\n`);\n assert.ok(at('Outcome') < at('Builder') && at('Builder') < at('Extends') && at('Extends') < at('Decisions'));\n assert.ok(at('Decisions') < at('Acceptance criteria') && at('Acceptance criteria') < at('Surface'));\n assert.ok(at('Surface') < at('Fences') && at('Fences') < at('Proof') && at('Proof') < at('Out of scope'));\n assert.ok(body.includes('## Builder\\n\\nfrontier: state-machine\\n'));\n assert.ok(\n body.includes(\n \" Example: id 'w-0a1b2c3d' \u2192 one store.put\\n Example: id ' w-0A1B2C3D' \u2192 InvalidWidgetId (failure)\\n\",\n ),\n );\n assert.ok(\n body.includes('- edit `src/widget.ts`\\n export function saveWidget(w: Widget): void\\n- delete `src/old.ts`\\n'),\n );\n const parsed = parseIssueBody(body, { title: issue.title });\n assert.equal(parsed.legacy, false);\n assert.deepEqual(parsed.issue, issue);\n assert.deepEqual(validateIssue(issue).failures, []);\n});\n\ntest('bodies without builder-ready fields re-render byte for byte with no new data keys', () => {\n const body = renderIssueBody(validIssue());\n assert.ok(!/\\n## (?:Builder|Extends|Decisions|Surface|Fences|Proof)\\n/u.test(body));\n const data = body.split('<!-- ai-delivery:issue-data@1 ')[1]!;\n for (const key of ['builder', 'extends', 'decisions', 'surface', 'fences', 'proof', 'examples'])\n assert.ok(!data.includes(`\"${key}\"`), key);\n const parsed = parseIssueBody(body, { title: validIssue().title });\n assert.equal(renderIssueBody(parsed.issue), body);\n assert.equal(\n body.split('\\n\\n## Acceptance criteria\\n\\n')[1]!.split('\\n\\n## Out of scope')[0],\n '- [ ] An invalid widget identifier returns an error without a persistence call.\\n Verified by: A mocked persistence regression asserts the error and zero calls.',\n );\n});\n\ntest('malformed builder-ready fields fail at their own field', () => {\n const fails = (extra: object, field: string) => {\n const result = validateIssue({ ...validIssue(), ...extra }, false);\n assert.ok(\n result.failures.some((failure) => failure.field.startsWith(field)),\n field,\n );\n };\n fails({ builder: { tier: 'frontier' } }, 'builder');\n fails({ builder: { tier: 'frontier', reason: 'because' } }, 'builder');\n fails({ builder: { tier: 'standard', reason: 'state-machine' } }, 'builder');\n fails({ surface: [{ path: 'src/a.ts', change: 'move' }] }, 'surface');\n});\n\ntest('create and update tools and the portable Ready schema expose the six top-level keys', () => {\n const shape = z.toJSONSchema(IssueWriteSchema).properties;\n for (const tool of ['issue_create', 'issue_update']) {\n const schema = AI_DELIVERY_MCP_TOOLS.find((t) => t.name === tool)!.inputSchema;\n for (const key of ['builder', 'extends', 'decisions', 'surface', 'fences', 'proof'])\n assert.deepEqual(z.toJSONSchema(schema).properties?.[key], shape?.[key], `${tool} ${key}`);\n }\n for (const key of ['builder', 'extends', 'decisions', 'surface', 'fences', 'proof'])\n assert.ok(key in ISSUE_JSON_SCHEMAS.ready.properties!, key);\n assert.ok(!ISSUE_JSON_SCHEMAS.ready.required?.includes('builder'));\n});\n\ntest('builderReady has no failures and no warnings', () => {\n assert.deepEqual(validateIssue(builderReady()).failures, []);\n assert.deepEqual(issueWarnings(builderReady()), []);\n});\n\nconst refusalCases: [string, (i: ReturnType<typeof builderReady>) => void, string][] = [\n ['no decisions', (i) => void (i.decisions = []), 'decisions'],\n ['blank decision', (i) => void (i.decisions = [' ']), 'decisions'],\n ['no surface', (i) => void (i.surface = []), 'surface'],\n ['blank surface path', (i) => void (i.surface = [{ path: ' ', change: 'edit' }]), 'surface'],\n [\n 'no examples',\n (i) => {\n delete i.acceptanceCriteria[0]!.examples;\n },\n 'examples',\n ],\n [\n 'no failure example',\n (i) => {\n i.acceptanceCriteria[0]!.examples = [{ input: 'a', expected: 'b' }];\n },\n 'examples.failure',\n ],\n ['no proof', (i) => void (i.proof = []), 'proof'],\n];\nfor (const [name, mutate, code] of refusalCases)\n test('Ready with builder refuses ' + name, () => {\n const issue = builderReady();\n mutate(issue);\n const failures = validateIssue(issue).failures;\n assert.ok(\n failures.some((f) => f.code === code && f.fixHint.endsWith('See ai-delivery:ticket-design.')),\n code,\n );\n });\n\ntest('builder fields are required only with builder, and never for epics or drafts', () => {\n assert.deepEqual(validateIssue(validIssue()).failures, []);\n const bare = { ...builderReady(), decisions: undefined, surface: undefined, proof: undefined, epic: true as const };\n assert.deepEqual(validateIssue(bare).failures, []);\n assert.deepEqual(validateIssue({ ...bare, epic: undefined, draft: true }, false).failures, []);\n});\n\ntest('requireBuilder refuses a Ready non-epic issue without builder and offers draft', () => {\n assert.throws(\n () => requireIssue(validIssue(), { requireBuilder: true }),\n (error: unknown) =>\n error instanceof IssueValidationError &&\n error.failures.some((f) => f.code === 'builder.missing' && f.fixHint.includes('draft: true')),\n );\n assert.ok(requireIssue(validIssue()));\n assert.ok(requireIssue(builderReady(), { requireBuilder: true }));\n assert.ok(requireIssue({ ...validIssue(), draft: true }, { requireBuilder: true }));\n assert.ok(requireIssue({ ...validIssue(), epic: true }, { requireBuilder: true }));\n});\n\nconst judgmentCases: [string, (i: ReturnType<typeof builderReady>) => void, string][] = [\n ['8 points', (i) => void (i.points = 8), 'size.points'],\n [\n 'seven surface paths',\n (i) =>\n void (i.surface = Array.from({ length: 7 }, (_, n) => ({ path: `src/a${n}.ts`, change: 'delete' as const }))),\n 'size.surface',\n ],\n [\n 'a criterion without examples',\n (i) => {\n i.acceptanceCriteria.push({ behavior: 'saveWidget stores a valid id', verifiedBy: 'src/widget.test.ts' });\n },\n 'examples.ac',\n ],\n [\n 'a code path without signatures',\n (i) => void (i.surface = [{ path: 'src/widget.ts', change: 'edit' }]),\n 'surface.signature',\n ],\n ['no fences', (i) => void (i.fences = []), 'fences'],\n ['blank extends', (i) => void (i.extends = [' ']), 'extends'],\n];\nfor (const [name, mutate, code] of judgmentCases)\n test('Ready with builder warns, never refuses, for ' + name, () => {\n const issue = builderReady();\n mutate(issue);\n assert.deepEqual(validateIssue(issue).failures, []);\n assert.ok(\n issueWarnings(issue).some((w) => w.code === code && w.fixHint.endsWith('See ai-delivery:ticket-design.')),\n );\n });\n\ntest('surface.signature skips deleted paths, tests and non-code files', () => {\n const issue = builderReady();\n issue.surface = [\n { path: 'src/gone.ts', change: 'delete' },\n { path: 'src/widget.test.ts', change: 'edit' },\n { path: 'README.md', change: 'edit' },\n ];\n assert.ok(!issueWarnings(issue).some((w) => w.code === 'surface.signature'));\n});\n\ntest('a legacy Ready issue warns builder.unset and skips builder-only warnings; edge-case and context drop with builder', () => {\n const codes = (issue: Parameters<typeof issueWarnings>[0]) => issueWarnings(issue).map((w) => w.code);\n assert.ok(codes(validIssue()).includes('builder.unset'));\n assert.ok(!codes({ ...validIssue(), draft: true }).includes('builder.unset'));\n assert.ok(!codes({ ...validIssue(), epic: true }).includes('builder.unset'));\n assert.ok(!codes(validIssue()).some((code) => code.startsWith('size.') || code === 'fences' || code === 'extends'));\n const noCopy = builderReady();\n noCopy.acceptanceCriteria[0]!.behavior = 'saveWidget stores valid ids';\n noCopy.context = { components: [], files: [], evidence: [] };\n assert.ok(!codes(noCopy).some((code) => code === 'edge-case' || code === 'context'));\n});\n\ntest('an 85-character title refuses with its length', () => {\n const failure = validateIssue({ ...validIssue(), title: 'x'.repeat(85) }).failures.find(\n (f) => f.code === 'title.length',\n );\n assert.equal(failure?.fixHint, 'The title is 85 characters; shorten it to at most 80.');\n});\n\ntest('the Ready write gate refuses missing Prior work, local paths and a contract over 400 words; other paths warn', () => {\n // builderReady's contract is 40 words outside its one-word outcome.\n const words = (n: number) => Array.from({ length: n }, () => 'w').join(' ');\n const gate = (value: unknown) => {\n try {\n requireIssue(value, { requireBuilder: true });\n return [];\n } catch (error) {\n if (!(error instanceof IssueValidationError)) throw error;\n return error.failures;\n }\n };\n const fit = { ...builderReady(), outcome: words(140) };\n assert.deepEqual(gate(fit), []);\n assert.deepEqual(issueWarnings(fit), []);\n const prior = gate({ ...fit, priorWork: undefined });\n assert.deepEqual(\n prior.map((f) => [f.code, f.fixHint]),\n [\n [\n 'priorWork',\n \"List each search you ran for earlier work on this question and what it found, or 'none found' with the searches.\",\n ],\n ],\n );\n const local = gate({ ...fit, context: { components: [], files: [], evidence: ['~/runs/READOUT.md'] } });\n assert.deepEqual(\n local.map((f) => f.fixHint),\n [\n 'context.evidence.0 cites a local path (~/); put that evidence on the issue as a comment or artifact and link it instead.',\n ],\n );\n const long = gate({ ...fit, outcome: words(390) });\n assert.deepEqual(\n long.map((f) => [f.code, f.fixHint]),\n [\n [\n 'contract-words',\n 'The contract (outcome, files, acceptance, tests, prior work) is 430 words; keep it to 400 and move evidence to a comment or artifact.',\n ],\n ],\n );\n assert.ok(requireIssue({ ...validIssue(), epic: true }, { requireBuilder: true }));\n assert.ok(requireIssue({ ...fit, draft: true, proof: ['.local/operator/run.sh'] }, { requireBuilder: true }));\n const existing = { ...fit, priorWork: undefined, outcome: words(800), proof: ['.local/operator/run.sh'] };\n assert.deepEqual(validateIssue(existing).failures, []);\n assert.ok(requireIssue(existing));\n assert.deepEqual(\n gate(existing).map((f) => f.code),\n ['priorWork', 'local-path', 'contract-words'],\n );\n});\n\ntest('Prior work round-trips after Extends', () => {\n const issue = IssueFields.parse({ ...builderReady(), priorWork: ['ai#3482: 250 ms floor', 'none found'] });\n const body = renderIssueBody(issue);\n assert.ok(body.indexOf('\\n## Extends\\n') < body.indexOf('\\n## Prior work\\n'));\n assert.deepEqual(parseIssueBody(body, { title: issue.title }).issue.priorWork, issue.priorWork);\n});\n\ntest('a moneyPath ticket is Ready without an Owner OK but warns until an https link is set, which round-trips', () => {\n const link = 'https://github.com/aviaratech/operating-model/issues/16#issuecomment-7401711854';\n const ownerOkWarnings = (value: object) =>\n issueWarnings(IssueFields.parse({ ...builderReady(), ...value })).filter((w) => w.code === 'ownerOk');\n const moneyPath = { ...builderReady(), moneyPath: true };\n assert.ok(requireIssue(moneyPath, { requireBuilder: true }));\n assert.deepEqual(validateIssue(moneyPath).failures, []);\n assert.deepEqual(ownerOkWarnings({ moneyPath: true, ownerOk: [link] }), []);\n assert.deepEqual(ownerOkWarnings({}), []);\n for (const ownerOk of [undefined, ['Paul said yes']])\n assert.deepEqual(\n ownerOkWarnings({ moneyPath: true, ownerOk }).map((w) => w.fixHint),\n [\"Link the owner's comment that OKs this ticket's live-effect line in ownerOk before its PR is marked ready.\"],\n );\n const issue = IssueFields.parse({ ...builderReady(), moneyPath: true, ownerOk: [link] });\n const body = renderIssueBody(issue);\n assert.ok(body.indexOf('\\n## Decisions\\n') < body.indexOf('\\n## Money path\\n\\nyes\\n\\n## Owner OK\\n'));\n const parsed = parseIssueBody(body, { title: issue.title }).issue;\n assert.deepEqual([parsed.moneyPath, parsed.ownerOk], [true, [link]]);\n});\n\ntest('addedLocalPaths names only paths no current string already holds, legacy body included', () => {\n const before = IssueFields.parse({ ...builderReady(), legacyBody: 'old notes in .local/operator/x' });\n assert.deepEqual(addedLocalPaths(before, { ...before, outcome: 'see .local/operator/x' }), []);\n assert.deepEqual(\n addedLocalPaths(before, { ...before, proof: ['run ~/run.sh'] }).map((f) => [f.code, f.field]),\n [['local-path', 'proof.0']],\n );\n});\n\ntest('a Design: issue files Ready without builder fields, warns without a build ticket number, and needs the colon', () => {\n const design = (title: string, behavior: string) => ({\n ...validIssue(),\n title,\n priorWork: ['none found: searched Design'],\n acceptanceCriteria: [{ behavior, verifiedBy: 'The build ticket is filed Ready.' }],\n });\n const codes = (issue: Parameters<typeof issueWarnings>[0]) => issueWarnings(issue).map((w) => w.code);\n const named = design('Design: #17 widget id shape', 'Build ticket #17 filed Ready');\n assert.ok(requireIssue(named, { requireBuilder: true }));\n assert.ok(!codes(named).includes('builder.unset') && !codes(named).includes('design.build-ticket'));\n const unnamed = design('Design: #17 widget id shape', 'Shape agreed on this issue');\n assert.ok(requireIssue(unnamed, { requireBuilder: true }));\n assert.ok(codes(unnamed).includes('design.build-ticket'));\n assert.throws(\n () =>\n requireIssue(design('Design builder-ready tickets: contract checks', 'Build ticket #17 filed Ready'), {\n requireBuilder: true,\n }),\n (error: unknown) =>\n error instanceof IssueValidationError && error.failures.some((f) => f.code === 'builder.missing'),\n );\n});\n"],
|
|
5
|
-
"mappings": "AAAA,OAAO,YAAY;AACnB,SAAS,YAAY;AACrB,SAAS,SAAS;AAClB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,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AAClG,QAAM,UAAU,OAAO,+BAA+B,4BAA4B;AAClF,SAAO,GAAG,aAAa,SAAS,EAAE,gBAAgB,KAAK,CAAC,CAAC;AACzD,SAAO,GAAG,MAAM,OAAO,EAAE,SAAS,qBAAqB,CAAC;AACxD,SAAO;AAAA,IACL,MACE,aAAa,OAAO,iDAAiD,8BAA8B,GAAG;AAAA,MACpG,gBAAgB;AAAA,IAClB,CAAC;AAAA,IACH,CAAC,UACC,iBAAiB,wBAAwB,MAAM,SAAS,KAAK,CAAC,MAAM,EAAE,SAAS,iBAAiB;AAAA,EACpG;AACF,CAAC;",
|
|
4
|
+
"sourcesContent": ["import assert from 'node:assert/strict';\nimport { test } from 'vitest';\nimport { z } from 'zod';\nimport {\n DraftIssue,\n ReadyIssue,\n IssueFields,\n IssueWriteSchema,\n ISSUE_JSON_SCHEMAS,\n ISSUE_BODY_MARKER,\n requireIssue,\n renderIssueBody,\n parseIssueBody,\n validateIssue,\n issueWarnings,\n IssueValidationError,\n addedLocalPaths,\n} from './issueContract.js';\nimport { AI_DELIVERY_MCP_TOOLS } from './mcp/index.js';\nimport { builderReady } from './fixtures/builderReady.js';\n\nexport const validIssue = () =>\n IssueFields.parse({\n title: 'Reject invalid widget identifiers before persistence',\n issueType: 'Feature',\n points: 2,\n problem: 'Malformed identifiers currently reach persistence.',\n outcome: 'Widget writes reject malformed identifiers before persistence.',\n acceptanceCriteria: [\n {\n behavior: 'An invalid widget identifier returns an error without a persistence call.',\n verifiedBy: 'A mocked persistence regression asserts the error and zero calls.',\n },\n ],\n outOfScope: ['Changing the storage engine.'],\n openQuestions: [],\n context: {\n components: ['widget intake'],\n files: ['src/widget.ts'],\n evidence: ['A portable synthetic identifier fixture.'],\n },\n });\n\ntest('body.length counts prose words in problem, outcome and criteria and warns strictly above 300', () => {\n for (const [words, warning] of [\n [299, false],\n [300, false],\n [301, true],\n ] as const) {\n const issue = validIssue();\n issue.problem = Array.from({ length: words - 2 }, () => 'w').join(' ');\n issue.outcome = 'one';\n issue.acceptanceCriteria[0]!.behavior = 'two';\n assert.equal(\n issueWarnings(issue).some((item) => item.code === 'body.length'),\n warning,\n String(words),\n );\n }\n const structured = validIssue();\n structured.context.evidence.push('A'.repeat(5000));\n assert.ok(!issueWarnings(structured).some((item) => item.code === 'body.length'));\n});\n\ntest('multiline criteria keep nested bullets and verification attached to their own checkbox', () => {\n const issue = validIssue();\n issue.acceptanceCriteria = [\n {\n behavior: 'Reject malformed input:\\n- Empty input\\n - Whitespace only\\n- Invalid shape',\n verifiedBy: 'Regression cases:\\n- Empty and malformed',\n },\n { behavior: 'A valid input is stored once.', verifiedBy: 'One observed write.' },\n ];\n const actual = renderIssueBody(issue).split('## Acceptance criteria\\n\\n')[1]!.split('\\n\\n## Out of scope')[0];\n assert.equal(\n actual,\n '- [ ] Reject malformed input:\\n - Empty input\\n - Whitespace only\\n - Invalid shape\\n\\n Verified by: Regression cases:\\n - Empty and malformed\\n- [ ] A valid input is stored once.\\n Verified by: One observed write.',\n );\n});\n\ntest('MCP create/update fields derive from the canonical schema and patch omissions retain no defaults', () => {\n const create = AI_DELIVERY_MCP_TOOLS.find((t) => t.name === 'issue_create')!;\n const update = AI_DELIVERY_MCP_TOOLS.find((t) => t.name === 'issue_update')!;\n const shape = z.toJSONSchema(IssueWriteSchema).properties;\n for (const name of [\n 'acceptanceCriteria',\n 'context',\n 'outOfScope',\n 'openQuestions',\n 'problem',\n 'outcome',\n 'bug',\n 'draft',\n ]) {\n assert.deepEqual(z.toJSONSchema(create.inputSchema).properties?.[name], shape?.[name]);\n assert.deepEqual(z.toJSONSchema(update.inputSchema).properties?.[name], shape?.[name]);\n }\n assert.deepEqual(update.inputSchema.parse({ issueNumber: 17 }), { issueNumber: 17 });\n assert.ok('issueContract' in create);\n assert.deepEqual(\n create.issueContract,\n ISSUE_JSON_SCHEMAS,\n 'portable output is reachable through the existing packaged MCP export',\n );\n});\n\ntest('portable JSON Schema snapshot carries Ready bounds and distinguishes incomplete drafts', () => {\n const ready = ISSUE_JSON_SCHEMAS.ready;\n assert.deepEqual(\n {\n draft: ready.properties?.draft,\n points: ready.properties?.points,\n title: ready.properties?.title,\n openQuestions: ready.properties?.openQuestions,\n },\n {\n draft: { type: 'boolean', const: false, default: false },\n points: { type: 'integer', minimum: 1, maximum: 8 },\n title: { type: 'string', minLength: 10, maxLength: 80 },\n openQuestions: { default: [], type: 'array', items: { type: 'string' }, maxItems: 0 },\n },\n );\n assert.deepEqual(ready.anyOf, [\n { properties: { epic: { const: true } }, required: ['epic'] },\n { required: ['points'] },\n ]);\n assert.ok(!ISSUE_JSON_SCHEMAS.draft.required?.includes('points'));\n});\n\ntest('concrete domain wording remains Ready while generic completion claims fail', () => {\n for (const behavior of [\n 'The independently reviewed head SHA is sent as the merge guard.',\n 'A failed request leaves the Project Done column unchanged.',\n 'A verified token grants access only to its repository.',\n 'The adapter works with a missing local checkout and returns the selected repository.',\n ]) {\n const issue = validIssue();\n issue.acceptanceCriteria[0]!.behavior = behavior;\n assert.deepEqual(validateIssue(issue).failures, [], behavior);\n }\n for (const behavior of [\n 'The widget works correctly.',\n 'The change is reviewed.',\n 'The request is done.',\n 'The interface is user friendly.',\n ]) {\n const issue = validIssue();\n issue.acceptanceCriteria[0]!.behavior = behavior;\n assert.ok(\n validateIssue(issue).failures.some((f) => f.code === 'acceptance-criteria.vague'),\n behavior,\n );\n }\n});\n\ntest('canonical bodies round trip every typed field, multiline markup and comment delimiters', () => {\n const issue = validIssue();\n issue.context.evidence.push('Observed <!-- text -->\\n## nested heading\\n`code`');\n const body = renderIssueBody(issue);\n assert.ok(body.startsWith(ISSUE_BODY_MARKER + '\\n\\n## Status\\n\\nReady'));\n assert.deepEqual(parseIssueBody(body, { title: issue.title }).issue, issue);\n assert.equal(parseIssueBody(body, { title: issue.title }).legacy, false);\n assert.throws(\n () => parseIssueBody(body.replace('## Status\\n\\nReady', '## Status\\n\\nDraft'), { title: issue.title }),\n /body.canonical/u,\n );\n assert.throws(() => parseIssueBody(body, { title: 'Different native title' }), /body.canonical/u);\n});\n\ntest('lenient legacy conversion retains all bytes, portable verification and marker descriptions', () => {\n const body =\n '## Problem\\nA literal ' +\n ISSUE_BODY_MARKER +\n ' is documentation.\\n## Outcome\\nReject malformed identifiers.\\n## Acceptance Criteria\\n- [ ] Invalid identifiers return an error before persistence.\\n## Verification\\nRun the synthetic identifier tests.\\n## Out of scope\\n- Storage engine changes.\\n## Scope\\nsrc/missing-in-this-checkout.ts\\nUnclassified historical text.\\n';\n const parsed = parseIssueBody(body, { title: validIssue().title, points: 2, issueType: 'Feature' });\n assert.equal(parsed.legacy, true);\n assert.equal(parsed.issue.legacyBody, body);\n assert.equal(parsed.issue.acceptanceCriteria[0]?.verifiedBy, 'Run the synthetic identifier tests.');\n const ready = requireIssue(parsed.issue);\n assert.deepEqual(parseIssueBody(renderIssueBody(ready), { title: ready.title }).issue, ready);\n});\n\ntest('legacy conversion never fabricates missing verification or bug evidence', () => {\n const body =\n '## Problem\\nA failure.\\n## Outcome\\nReject invalid widgets.\\n## Acceptance Criteria\\n- [ ] Invalid widgets are rejected before persistence.\\n## Out of scope\\n- Storage changes.\\n';\n const parsed = parseIssueBody(body, { title: validIssue().title, points: 2, issueType: 'Bug' });\n const codes = validateIssue(parsed.issue).failures.map((f) => f.code);\n assert.ok(codes.includes('acceptance-criteria.fields'));\n assert.ok(codes.includes('bug.steps'));\n assert.ok(codes.includes('bug.environment'));\n});\n\nconst blockingCases: [string, (issue: ReturnType<typeof validIssue>) => void, string][] = [\n [\n 'Points13',\n (i) => {\n i.points = 13;\n },\n 'points',\n ],\n [\n 'Points0',\n (i) => {\n i.points = 0;\n },\n 'points',\n ],\n [\n 'Points9',\n (i) => {\n i.points = 9;\n },\n 'points',\n ],\n [\n 'missing behavior',\n (i) => {\n i.acceptanceCriteria[0]!.behavior = '';\n },\n 'acceptance-criteria.fields',\n ],\n [\n 'missing verifiedBy',\n (i) => {\n i.acceptanceCriteria[0]!.verifiedBy = '';\n },\n 'acceptance-criteria.fields',\n ],\n [\n 'vague AC',\n (i) => {\n i.acceptanceCriteria[0]!.behavior = 'The widget works correctly.';\n },\n 'acceptance-criteria.vague',\n ],\n [\n 'no non-goal',\n (i) => {\n i.outOfScope = [];\n },\n 'out-of-scope',\n ],\n [\n 'open question',\n (i) => {\n i.openQuestions = ['Choose the persistence behavior.'];\n },\n 'open-questions',\n ],\n [\n 'vague title',\n (i) => {\n i.title = 'Fix things';\n },\n 'title.specific',\n ],\n [\n 'long title',\n (i) => {\n i.title = 'x'.repeat(81);\n },\n 'title.length',\n ],\n [\n 'type prefix',\n (i) => {\n i.title = 'Bug: Reject invalid widget identifiers';\n },\n 'title.prefix',\n ],\n [\n 'bug fields',\n (i) => {\n i.issueType = 'Bug';\n },\n 'bug',\n ],\n [\n 'secret',\n (i) => {\n i.problem = 'A fixture contains ' + ['gh', 'p_'].join('') + 'A'.repeat(24);\n },\n 'secrets',\n ],\n];\nfor (const [name, mutate, code] of blockingCases)\n test('Ready blocks ' + name + ' with a field and actionable fix hint', () => {\n const issue = validIssue();\n mutate(issue);\n const failures = validateIssue(issue).failures;\n assert.ok(\n failures.some((f) => f.code === code),\n JSON.stringify(failures),\n );\n assert.ok(failures.every((f) => f.field.length > 0 && f.fixHint.length > 10));\n });\n\nfor (const field of ['steps', 'expected', 'actual', 'reproducibility', 'environment'] as const)\n test('Bug requires ' + field, () => {\n const issue = validIssue();\n issue.issueType = 'Bug';\n issue.bug = {\n steps: ['Submit an invalid identifier.'],\n expected: 'No write.',\n actual: 'A write occurs.',\n reproducibility: 'Every invalid input.',\n environment: 'Synthetic server, Node24.',\n };\n if (field === 'steps') issue.bug.steps = [];\n else issue.bug[field] = '';\n assert.ok(validateIssue(issue).failures.some((f) => f.code === 'bug.' + field));\n });\n\ntest('Ready is the default; explicit drafts park incomplete requirements without permitting secrets', () => {\n assert.equal(requireIssue(validIssue()).draft, false);\n assert.equal(ReadyIssue.safeParse({ title: 'Investigate invalid widget identifiers', draft: true }).success, false);\n const draft = requireIssue({ title: 'Investigate invalid widget identifiers', draft: true });\n assert.equal(draft.draft, true);\n assert.match(renderIssueBody(draft), /Draft \u2014 parked/u);\n assert.equal(DraftIssue.safeParse({ ...draft, problem: 'password=' + 'X'.repeat(16) }).success, false);\n});\n\ntest('independent Ready failures remain actionable together when native Points are missing', () => {\n const failures = validateIssue({\n title: 'Investigate malformed widget identifiers',\n issueType: 'Bug',\n problem: 'A malformed identifier reaches storage.',\n outcome: 'Reject malformed identifiers.',\n acceptanceCriteria: [],\n outOfScope: [],\n openQuestions: ['Choose the return shape.'],\n }).failures;\n for (const code of ['points', 'bug', 'acceptance-criteria', 'out-of-scope', 'open-questions'])\n assert.ok(failures.some((f) => f.code === code));\n assert.equal(new Set(failures.map((f) => f.code + ':' + f.field)).size, failures.length);\n});\n\nconst warningCases: [string, (issue: ReturnType<typeof validIssue>) => void, string][] = [\n [\n 'many criteria',\n (i) => {\n i.acceptanceCriteria = Array.from({ length: 8 }, () => ({ ...i.acceptanceCriteria[0]! }));\n },\n 'many-criteria',\n ],\n [\n 'no edge case',\n (i) => {\n i.acceptanceCriteria[0]!.behavior = 'A valid identifier produces exactly one persisted widget.';\n },\n 'edge-case',\n ],\n [\n 'Bug without regression',\n (i) => {\n i.issueType = 'Bug';\n i.bug = {\n steps: ['Submit an invalid identifier.'],\n expected: 'No write.',\n actual: 'A write occurs.',\n reproducibility: 'Every input.',\n environment: 'Synthetic server.',\n };\n i.acceptanceCriteria[0]!.verifiedBy = 'A mock asserts zero persistence calls.';\n },\n 'bug.regression',\n ],\n [\n 'no context',\n (i) => {\n i.context = { files: [], components: [], evidence: [] };\n },\n 'context',\n ],\n [\n 'local path',\n (i) => {\n i.context.evidence = ['~/runs/READOUT.md'];\n },\n 'local-path',\n ],\n [\n 'long body',\n (i) => {\n i.problem = Array.from({ length: 301 }, () => 'word').join(' ');\n },\n 'body.length',\n ],\n];\nfor (const [name, mutate, code] of warningCases)\n test('Warning does not block ' + name, () => {\n const issue = validIssue();\n mutate(issue);\n assert.equal(validateIssue(issue).failures.length, 0);\n assert.ok(issueWarnings(issue).some((w) => w.code === code));\n });\n\nconst builderFields = {\n builder: { tier: 'frontier' as const, reason: 'state-machine' as const },\n extends: ['src/widget.ts saveWidget (the one widget write path)'],\n decisions: ['Valid id: ^w-[0-9a-f]{8}$. Refuse with InvalidWidgetId.'],\n surface: [\n {\n path: 'src/widget.ts',\n change: 'edit' as const,\n signatures: ['export function saveWidget(w: Widget): void'],\n },\n { path: 'src/old.ts', change: 'delete' as const },\n ],\n fences: ['src/store.ts (storage owner)'],\n proof: ['npx vitest run src/widget.test.ts'],\n};\n\ntest('every builder-ready field renders in order and parses back equal', () => {\n const issue = IssueFields.parse({\n ...validIssue(),\n ...builderFields,\n acceptanceCriteria: [\n {\n behavior: 'An invalid widget identifier returns an error without a persistence call.',\n verifiedBy: 'src/widget.test.ts',\n examples: [\n { input: \"id 'w-0a1b2c3d'\", expected: 'one store.put' },\n {\n input: \"id ' w-0A1B2C3D'\",\n expected: 'InvalidWidgetId',\n failure: true,\n },\n ],\n },\n ],\n });\n const body = renderIssueBody(issue);\n const at = (heading: string) => body.indexOf(`\\n## ${heading}\\n`);\n assert.ok(at('Outcome') < at('Builder') && at('Builder') < at('Extends') && at('Extends') < at('Decisions'));\n assert.ok(at('Decisions') < at('Acceptance criteria') && at('Acceptance criteria') < at('Surface'));\n assert.ok(at('Surface') < at('Fences') && at('Fences') < at('Proof') && at('Proof') < at('Out of scope'));\n assert.ok(body.includes('## Builder\\n\\nfrontier: state-machine\\n'));\n assert.ok(\n body.includes(\n \" Example: id 'w-0a1b2c3d' \u2192 one store.put\\n Example: id ' w-0A1B2C3D' \u2192 InvalidWidgetId (failure)\\n\",\n ),\n );\n assert.ok(\n body.includes('- edit `src/widget.ts`\\n export function saveWidget(w: Widget): void\\n- delete `src/old.ts`\\n'),\n );\n const parsed = parseIssueBody(body, { title: issue.title });\n assert.equal(parsed.legacy, false);\n assert.deepEqual(parsed.issue, issue);\n assert.deepEqual(validateIssue(issue).failures, []);\n});\n\ntest('bodies without builder-ready fields re-render byte for byte with no new data keys', () => {\n const body = renderIssueBody(validIssue());\n assert.ok(!/\\n## (?:Builder|Extends|Decisions|Surface|Fences|Proof)\\n/u.test(body));\n const data = body.split('<!-- ai-delivery:issue-data@1 ')[1]!;\n for (const key of ['builder', 'extends', 'decisions', 'surface', 'fences', 'proof', 'examples'])\n assert.ok(!data.includes(`\"${key}\"`), key);\n const parsed = parseIssueBody(body, { title: validIssue().title });\n assert.equal(renderIssueBody(parsed.issue), body);\n assert.equal(\n body.split('\\n\\n## Acceptance criteria\\n\\n')[1]!.split('\\n\\n## Out of scope')[0],\n '- [ ] An invalid widget identifier returns an error without a persistence call.\\n Verified by: A mocked persistence regression asserts the error and zero calls.',\n );\n});\n\ntest('malformed builder-ready fields fail at their own field', () => {\n const fails = (extra: object, field: string) => {\n const result = validateIssue({ ...validIssue(), ...extra }, false);\n assert.ok(\n result.failures.some((failure) => failure.field.startsWith(field)),\n field,\n );\n };\n fails({ builder: { tier: 'frontier' } }, 'builder');\n fails({ builder: { tier: 'frontier', reason: 'because' } }, 'builder');\n fails({ builder: { tier: 'standard', reason: 'state-machine' } }, 'builder');\n fails({ surface: [{ path: 'src/a.ts', change: 'move' }] }, 'surface');\n});\n\ntest('create and update tools and the portable Ready schema expose the six top-level keys', () => {\n const shape = z.toJSONSchema(IssueWriteSchema).properties;\n for (const tool of ['issue_create', 'issue_update']) {\n const schema = AI_DELIVERY_MCP_TOOLS.find((t) => t.name === tool)!.inputSchema;\n for (const key of ['builder', 'extends', 'decisions', 'surface', 'fences', 'proof'])\n assert.deepEqual(z.toJSONSchema(schema).properties?.[key], shape?.[key], `${tool} ${key}`);\n }\n for (const key of ['builder', 'extends', 'decisions', 'surface', 'fences', 'proof'])\n assert.ok(key in ISSUE_JSON_SCHEMAS.ready.properties!, key);\n assert.ok(!ISSUE_JSON_SCHEMAS.ready.required?.includes('builder'));\n});\n\ntest('builderReady has no failures and no warnings', () => {\n assert.deepEqual(validateIssue(builderReady()).failures, []);\n assert.deepEqual(issueWarnings(builderReady()), []);\n});\n\nconst refusalCases: [string, (i: ReturnType<typeof builderReady>) => void, string][] = [\n ['no decisions', (i) => void (i.decisions = []), 'decisions'],\n ['blank decision', (i) => void (i.decisions = [' ']), 'decisions'],\n ['no surface', (i) => void (i.surface = []), 'surface'],\n ['blank surface path', (i) => void (i.surface = [{ path: ' ', change: 'edit' }]), 'surface'],\n [\n 'no examples',\n (i) => {\n delete i.acceptanceCriteria[0]!.examples;\n },\n 'examples',\n ],\n [\n 'no failure example',\n (i) => {\n i.acceptanceCriteria[0]!.examples = [{ input: 'a', expected: 'b' }];\n },\n 'examples.failure',\n ],\n ['no proof', (i) => void (i.proof = []), 'proof'],\n];\nfor (const [name, mutate, code] of refusalCases)\n test('Ready with builder refuses ' + name, () => {\n const issue = builderReady();\n mutate(issue);\n const failures = validateIssue(issue).failures;\n assert.ok(\n failures.some((f) => f.code === code && f.fixHint.endsWith('See ai-delivery:ticket-design.')),\n code,\n );\n });\n\ntest('builder fields are required only with builder, and never for epics or drafts', () => {\n assert.deepEqual(validateIssue(validIssue()).failures, []);\n const bare = { ...builderReady(), decisions: undefined, surface: undefined, proof: undefined, epic: true as const };\n assert.deepEqual(validateIssue(bare).failures, []);\n assert.deepEqual(validateIssue({ ...bare, epic: undefined, draft: true }, false).failures, []);\n});\n\ntest('requireBuilder refuses a Ready non-epic issue without builder and offers draft', () => {\n assert.throws(\n () => requireIssue(validIssue(), { requireBuilder: true }),\n (error: unknown) =>\n error instanceof IssueValidationError &&\n error.failures.some((f) => f.code === 'builder.missing' && f.fixHint.includes('draft: true')),\n );\n assert.ok(requireIssue(validIssue()));\n assert.ok(requireIssue(builderReady(), { requireBuilder: true }));\n assert.ok(requireIssue({ ...validIssue(), draft: true }, { requireBuilder: true }));\n assert.ok(requireIssue({ ...validIssue(), epic: true }, { requireBuilder: true }));\n});\n\nconst judgmentCases: [string, (i: ReturnType<typeof builderReady>) => void, string][] = [\n ['8 points', (i) => void (i.points = 8), 'size.points'],\n [\n 'seven surface paths',\n (i) =>\n void (i.surface = Array.from({ length: 7 }, (_, n) => ({ path: `src/a${n}.ts`, change: 'delete' as const }))),\n 'size.surface',\n ],\n [\n 'a criterion without examples',\n (i) => {\n i.acceptanceCriteria.push({ behavior: 'saveWidget stores a valid id', verifiedBy: 'src/widget.test.ts' });\n },\n 'examples.ac',\n ],\n [\n 'a code path without signatures',\n (i) => void (i.surface = [{ path: 'src/widget.ts', change: 'edit' }]),\n 'surface.signature',\n ],\n ['no fences', (i) => void (i.fences = []), 'fences'],\n ['blank extends', (i) => void (i.extends = [' ']), 'extends'],\n];\nfor (const [name, mutate, code] of judgmentCases)\n test('Ready with builder warns, never refuses, for ' + name, () => {\n const issue = builderReady();\n mutate(issue);\n assert.deepEqual(validateIssue(issue).failures, []);\n assert.ok(\n issueWarnings(issue).some((w) => w.code === code && w.fixHint.endsWith('See ai-delivery:ticket-design.')),\n );\n });\n\ntest('surface.signature skips deleted paths, tests and non-code files', () => {\n const issue = builderReady();\n issue.surface = [\n { path: 'src/gone.ts', change: 'delete' },\n { path: 'src/widget.test.ts', change: 'edit' },\n { path: 'README.md', change: 'edit' },\n ];\n assert.ok(!issueWarnings(issue).some((w) => w.code === 'surface.signature'));\n});\n\ntest('a legacy Ready issue warns builder.unset and skips builder-only warnings; edge-case and context drop with builder', () => {\n const codes = (issue: Parameters<typeof issueWarnings>[0]) => issueWarnings(issue).map((w) => w.code);\n assert.ok(codes(validIssue()).includes('builder.unset'));\n assert.ok(!codes({ ...validIssue(), draft: true }).includes('builder.unset'));\n assert.ok(!codes({ ...validIssue(), epic: true }).includes('builder.unset'));\n assert.ok(!codes(validIssue()).some((code) => code.startsWith('size.') || code === 'fences' || code === 'extends'));\n const noCopy = builderReady();\n noCopy.acceptanceCriteria[0]!.behavior = 'saveWidget stores valid ids';\n noCopy.context = { components: [], files: [], evidence: [] };\n assert.ok(!codes(noCopy).some((code) => code === 'edge-case' || code === 'context'));\n});\n\ntest('an 85-character title refuses with its length', () => {\n const failure = validateIssue({ ...validIssue(), title: 'x'.repeat(85) }).failures.find(\n (f) => f.code === 'title.length',\n );\n assert.equal(failure?.fixHint, 'The title is 85 characters; shorten it to at most 80.');\n});\n\ntest('the Ready write gate refuses missing Prior work, local paths and a contract over 400 words; other paths warn', () => {\n // builderReady's contract is 40 words outside its one-word outcome.\n const words = (n: number) => Array.from({ length: n }, () => 'w').join(' ');\n const gate = (value: unknown) => {\n try {\n requireIssue(value, { requireBuilder: true });\n return [];\n } catch (error) {\n if (!(error instanceof IssueValidationError)) throw error;\n return error.failures;\n }\n };\n const fit = { ...builderReady(), outcome: words(140) };\n assert.deepEqual(gate(fit), []);\n assert.deepEqual(issueWarnings(fit), []);\n const prior = gate({ ...fit, priorWork: undefined });\n assert.deepEqual(\n prior.map((f) => [f.code, f.fixHint]),\n [\n [\n 'priorWork',\n \"List each search you ran for earlier work on this question and what it found, or 'none found' with the searches.\",\n ],\n ],\n );\n const local = gate({ ...fit, context: { components: [], files: [], evidence: ['~/runs/READOUT.md'] } });\n assert.deepEqual(\n local.map((f) => f.fixHint),\n [\n 'context.evidence.0 cites a local path (~/); put that evidence on the issue as a comment or artifact and link it instead.',\n ],\n );\n const long = gate({ ...fit, outcome: words(390) });\n assert.deepEqual(\n long.map((f) => [f.code, f.fixHint]),\n [\n [\n 'contract-words',\n 'The contract (outcome, files, acceptance, tests, prior work) is 430 words; keep it to 400 and move evidence to a comment or artifact.',\n ],\n ],\n );\n assert.ok(requireIssue({ ...validIssue(), epic: true }, { requireBuilder: true }));\n assert.ok(requireIssue({ ...fit, draft: true, proof: ['.local/operator/run.sh'] }, { requireBuilder: true }));\n const existing = { ...fit, priorWork: undefined, outcome: words(800), proof: ['.local/operator/run.sh'] };\n assert.deepEqual(validateIssue(existing).failures, []);\n assert.ok(requireIssue(existing));\n assert.deepEqual(\n gate(existing).map((f) => f.code),\n ['priorWork', 'local-path', 'contract-words'],\n );\n});\n\ntest('Prior work round-trips after Extends', () => {\n const issue = IssueFields.parse({ ...builderReady(), priorWork: ['ai#3482: 250 ms floor', 'none found'] });\n const body = renderIssueBody(issue);\n assert.ok(body.indexOf('\\n## Extends\\n') < body.indexOf('\\n## Prior work\\n'));\n assert.deepEqual(parseIssueBody(body, { title: issue.title }).issue.priorWork, issue.priorWork);\n});\n\ntest('a moneyPath ticket is Ready without an Owner OK but warns until an https link is set, which round-trips', () => {\n const link = 'https://github.com/aviaratech/operating-model/issues/16#issuecomment-7401711854';\n const ownerOkWarnings = (value: object) =>\n issueWarnings(IssueFields.parse({ ...builderReady(), ...value })).filter((w) => w.code === 'ownerOk');\n const moneyPath = { ...builderReady(), moneyPath: true };\n assert.ok(requireIssue(moneyPath, { requireBuilder: true }));\n assert.deepEqual(validateIssue(moneyPath).failures, []);\n assert.deepEqual(ownerOkWarnings({ moneyPath: true, ownerOk: [link] }), []);\n assert.deepEqual(ownerOkWarnings({}), []);\n for (const ownerOk of [undefined, ['Paul said yes']])\n assert.deepEqual(\n ownerOkWarnings({ moneyPath: true, ownerOk }).map((w) => w.fixHint),\n [\"Link the owner's comment that OKs this ticket's live-effect line in ownerOk before its PR is marked ready.\"],\n );\n const issue = IssueFields.parse({ ...builderReady(), moneyPath: true, ownerOk: [link] });\n const body = renderIssueBody(issue);\n assert.ok(body.indexOf('\\n## Decisions\\n') < body.indexOf('\\n## Money path\\n\\nyes\\n\\n## Owner OK\\n'));\n const parsed = parseIssueBody(body, { title: issue.title }).issue;\n assert.deepEqual([parsed.moneyPath, parsed.ownerOk], [true, [link]]);\n});\n\ntest('addedLocalPaths names only paths no current string already holds, legacy body included', () => {\n const before = IssueFields.parse({ ...builderReady(), legacyBody: 'old notes in .local/operator/x' });\n assert.deepEqual(addedLocalPaths(before, { ...before, outcome: 'see .local/operator/x' }), []);\n assert.deepEqual(\n addedLocalPaths(before, { ...before, proof: ['run ~/run.sh'] }).map((f) => [f.code, f.field]),\n [['local-path', 'proof.0']],\n );\n});\n\ntest('a Design: issue files Ready without builder fields, warns without a build ticket number, and needs the colon', () => {\n const design = (title: string, behavior: string) => ({\n ...validIssue(),\n title,\n priorWork: ['none found: searched Design'],\n acceptanceCriteria: [{ behavior, verifiedBy: 'The build ticket is filed Ready.' }],\n });\n const codes = (issue: Parameters<typeof issueWarnings>[0]) => issueWarnings(issue).map((w) => w.code);\n const named = design('Design: #17 widget id shape', 'Build ticket #17 filed Ready');\n assert.ok(requireIssue(named, { requireBuilder: true }));\n assert.ok(!codes(named).includes('builder.unset') && !codes(named).includes('design.build-ticket'));\n const unnamed = design('Design: #17 widget id shape', 'Shape agreed on this issue');\n assert.ok(requireIssue(unnamed, { requireBuilder: true }));\n assert.ok(codes(unnamed).includes('design.build-ticket'));\n assert.throws(\n () =>\n requireIssue(design('Design builder-ready tickets: contract checks', 'Build ticket #17 filed Ready'), {\n requireBuilder: true,\n }),\n (error: unknown) =>\n error instanceof IssueValidationError && error.failures.some((f) => f.code === 'builder.missing'),\n );\n});\n\ntest('a fence that sets start order warns fences.start-order once, on drafts too, and never refuses', () => {\n const count = (issue: Parameters<typeof issueWarnings>[0]) =>\n issueWarnings(issue).filter((w) => w.code === 'fences.start-order').length;\n const ready = { ...validIssue(), fences: ['Start after ai#6481 merges (same files)'] };\n assert.equal(count(ready), 1);\n assert.doesNotThrow(() => requireIssue(ready));\n assert.equal(\n count({\n ...validIssue(),\n fences: [\n \"Lands after om#50's PR: edit its scan_transcript. Don't start until it merges.\",\n \"Starts only after rn4's quiet proofs.\",\n ],\n }),\n 1,\n );\n assert.equal(\n count({\n ...validIssue(),\n draft: true,\n fences: [\"Money path: no build until Paul's Owner OK passes a fresh check.\"],\n }),\n 1,\n );\n});\n\ntest('merge-order and path fences do not warn fences.start-order', () => {\n const fences = [\n 'Lands after ai#6373 (PR 6406 edits minute-planner-part.test.ts).',\n \"ai#6371 edits the same two files and lands after this; don't change budgeting here\",\n 'Restart the hub after deploy',\n ];\n assert.ok(!issueWarnings({ ...validIssue(), fences }).some((w) => w.code === 'fences.start-order'));\n assert.ok(!issueWarnings(validIssue()).some((w) => w.code === 'fences.start-order'));\n});\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,YAAY;AACnB,SAAS,YAAY;AACrB,SAAS,SAAS;AAClB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,6BAA6B;AACtC,SAAS,oBAAoB;AAEtB,MAAM,aAAa,MACxB,YAAY,MAAM;AAAA,EAChB,OAAO;AAAA,EACP,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,SAAS;AAAA,EACT,SAAS;AAAA,EACT,oBAAoB;AAAA,IAClB;AAAA,MACE,UAAU;AAAA,MACV,YAAY;AAAA,IACd;AAAA,EACF;AAAA,EACA,YAAY,CAAC,8BAA8B;AAAA,EAC3C,eAAe,CAAC;AAAA,EAChB,SAAS;AAAA,IACP,YAAY,CAAC,eAAe;AAAA,IAC5B,OAAO,CAAC,eAAe;AAAA,IACvB,UAAU,CAAC,0CAA0C;AAAA,EACvD;AACF,CAAC;AAEH,KAAK,gGAAgG,MAAM;AACzG,aAAW,CAAC,OAAO,OAAO,KAAK;AAAA,IAC7B,CAAC,KAAK,KAAK;AAAA,IACX,CAAC,KAAK,KAAK;AAAA,IACX,CAAC,KAAK,IAAI;AAAA,EACZ,GAAY;AACV,UAAM,QAAQ,WAAW;AACzB,UAAM,UAAU,MAAM,KAAK,EAAE,QAAQ,QAAQ,EAAE,GAAG,MAAM,GAAG,EAAE,KAAK,GAAG;AACrE,UAAM,UAAU;AAChB,UAAM,mBAAmB,CAAC,EAAG,WAAW;AACxC,WAAO;AAAA,MACL,cAAc,KAAK,EAAE,KAAK,CAAC,SAAS,KAAK,SAAS,aAAa;AAAA,MAC/D;AAAA,MACA,OAAO,KAAK;AAAA,I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