/** * crew#372 slice 2: `POST /api/v1/projects/:id/product/compose` — draft epics → features → stories * from a project's selected requirements, as a GOVERNED RUN (design: DES-W4-CR5, posted on the * issue). There is no new execution path: the route re-reads every selected requirement on the * server (client text is never trusted), composes a two-step plan over the phase catalog — * `produce` (creator: the draft) then `review` (evaluator, a human gate before anything leaves) — * and launches it through `POST /runs` itself, so the run gets the same roster, project filing, * audit and launch policy as any other run. `deliver: "none"`: nothing is published here. * * Publish (the second half of #372) is NOT registered: it is a remote write whose "published" must * be re-derived from a deterministic created-issue manifest plus a read-back, which does not exist * yet. An absent route is the honest answer until it does. */ import type { FastifyInstance } from 'fastify'; import { z } from 'zod'; import type { CoreAdapter } from '../core/adapter.js'; /** At most this many requirements per compose: the step instructions ride `plan.proposed`, which * the engine caps at 8 KB, and every line here must reach the drafting seat whole. */ export declare const COMPOSE_MAX_REQUIREMENTS = 40; /** The draft step's instructions stay under this many UTF-8 bytes (the engine caps a step's * instructions at 8 KB on `plan.proposed`, and a cut there would lose the artifact shape). */ export declare const COMPOSE_INSTRUCTIONS_MAX_BYTES = 7600; export declare const ProductComposeSchema: z.ZodObject<{ requirements: z.ZodArray, "many">; /** The operator's own steer for the draft (grouping, scope, tone). */ instructions: z.ZodOptional; }, "strict", z.ZodTypeAny, { requirements: { repoId: string; key: string; }[]; instructions?: string | undefined; }, { requirements: { repoId: string; key: string; }[]; instructions?: string | undefined; }>; type ComposeRow = { repoId: string; key: string; title: string; statement: string; }; /** The selection does not fit the step cap even with every description cut: its refs alone are * too long. The route answers 400 (smaller selection) rather than hand a seat clipped refs. */ export declare class ComposeSelectionTooLargeError extends Error { } /** The draft step's instructions: the requirements as the server read them, and the artifact. */ export declare function composeInstructions(projectId: string, rows: ReadonlyArray, steer: string | undefined): string; /** The review step's instructions: the SAME requirement list (codex review of the compose PR: the engine hands the * evaluator the draft's output, not the draft's instructions), so a gap or an invented ref is * checkable against what was selected. */ export declare function reviewInstructions(projectId: string, rows: ReadonlyArray): string; export declare function registerProductRoutes(app: FastifyInstance, adapter: CoreAdapter): void; export {}; //# sourceMappingURL=product.d.ts.map