import type { Spec, SpecProposals } from "@slowcook-ai/core";
/**
* 0.19.0-α.30 (sc#63) — load the consumer's existing column-set by
* scanning migration files. Returns Map
> indexed
* by lower-case names. Used by deriveSchema to distinguish columns
* that already exist (skip) from those that need an ALTER TABLE.
*
* Returns null if no migrations found (greenfield / first slowcook
* story); deriveSchema falls back to its existing CREATE TABLE flow.
*/
export declare function loadExistingColumns(repoRoot: string): Map> | null;
/**
* Deterministic post-processor that derives proposals from the spec
* body when the LLM inlined decisions into `invariants` / `api_contract`
* / `ui_behavior` without populating `proposals`. Two attempts at prompt
* steering failed to get the LLM to emit proposals reliably when the PM
* answered clarifying questions in detail; this is the structural fix.
*
* Philosophy: we don't override what the LLM explicitly chose to put
* in proposals — LLM-emitted proposals always win. We only fill in
* categories the LLM left empty, sourcing the content from the spec's
* traditional fields. The synthesized proposals carry
* `proposed_by: "spec-body-synth"` so reviewers can tell the difference.
*
* Categories covered with high-signal synthesis:
* - `routes`: extract page-like paths from `api_contract` + `ui_behavior`
* prose, map to Next.js App Router file locations
* - `auth`: extract "authenticated" / "auth.uid()" / "RLS policy" hints
* from invariants
* - `schema`: detect DDL-implying invariants; flag as needing completion
* if the LLM didn't emit structured DDL (prose alone isn't
* reconstructable into Mermaid without another LLM call)
*
* Categories NOT covered (low signal — leave to LLM or skip):
* - perf_budget, observability, infra, api_shape
*
* 0.14.0-α.3+ (V7 hard-signal track): ui_layout + fixtures synthesizers
* landed when the LLM-side prompt steering proved soft (refine 0.13.6
* told the agent to emit ui_layout when ui_behavior was present, but on
* rewo story-015 the agent put real tokens in prose ui_behavior and
* skipped the structured proposal). The synthesizers below are the
* hard-signal backstop: when the LLM doesn't elevate to a structured
* block, the synth derives one from prose + brownfield extracts.
*/
export declare function synthesizeProposalsFromSpec(spec: Spec, opts?: {
repoRoot?: string;
}): SpecProposals;
/**
* Map a URL path to a candidate Next.js App Router file location.
* Uses the `(main)` route group by default (authenticated app pages).
* Consumer can edit post-emit if their layout differs.
*/
/**
* 0.19.0-α.29 (sc#64) — app-shape detection for multi-app monorepos.
*
* - `single-flat` — `src/app//page.tsx` (no route group)
* - `single-grouped` — `src/app/(main)//page.tsx` (rewo convention)
* - `multi-app` — `apps//src/app//page.tsx` (delgoosh)
*
* Detection walks the consumer's filesystem:
* - If `apps//src/app/` exists for two or more apps → multi-app.
* - Else if `src/app/(main)/` exists → single-grouped.
* - Else default to single-flat.
*
* When no repoRoot is provided (older callers / tests that pass spec
* only), defaults to `single-grouped` for backward compat with rewo.
*
* In multi-app mode, route → app assignment heuristic:
* - Path's first segment matches an app name → that app owns it
* (e.g., /patient/dashboard → apps/patient/src/app/dashboard/page.tsx,
* the /patient prefix gets STRIPPED since it's already in the app dir)
* - Path matches no app → first app gets it (caller can edit)
*/
export type AppShape = {
kind: "single-flat";
prefix: string;
} | {
kind: "single-grouped";
prefix: string;
} | {
kind: "multi-app";
apps: string[];
};
export declare function detectAppShape(repoRoot: string): AppShape;
//# sourceMappingURL=proposals-synth.d.ts.map