@autobe/agent
Version:
AI backend server code generator
64 lines (63 loc) • 2.31 kB
TypeScript
/**
* A single extracted decision from one file's section content.
*
* Decisions are binary/discrete choices embedded in prose, e.g.:
*
* - "password change requires current password" → topic: "password_change",
* decision: "requires_current_password", value: "yes"
* - "deleted email can be reused" → topic: "deleted_email", decision:
* "can_be_reused", value: "yes"
*/
export interface IExtractedDecision {
/** Normalized topic grouping (e.g., "password_change", "email_reuse") */
topic: string;
/** Specific decision within the topic (e.g., "requires_current_password") */
decision: string;
/** The value of the decision (e.g., "yes", "no", "soft_delete", "hard_delete") */
value: string;
/** Evidence quote from the source text */
evidence: string;
}
/** Decisions extracted from a single file, returned by the extraction LLM. */
export interface IFileDecisions {
/** The filename this was extracted from */
filename: string;
/** All decisions extracted from this file */
decisions: IExtractedDecision[];
}
/**
* A conflict between two or more files that state different values for the same
* topic+decision.
*/
export interface IDecisionConflict {
/** The topic of the conflict */
topic: string;
/** The specific decision that conflicts */
decision: string;
/** All differing values with their source files and evidence */
values: Array<{
value: string;
files: string[];
evidence: string;
}>;
}
/**
* Detect decision-level conflicts across all files.
*
* Groups all extracted decisions by `topic + decision` key, then finds cases
* where different files assign different values to the same key.
*
* This catches prose-level contradictions like:
*
* - File A: "password change requires current password" (yes)
* - File B: "password change does not require current password" (no)
*/
export declare const detectDecisionConflicts: (props: {
fileDecisions: IFileDecisions[];
}) => IDecisionConflict[];
/**
* Build a map from filename → list of decision conflict feedback strings.
*
* Each file involved in a conflict gets feedback describing the contradiction.
*/
export declare const buildFileDecisionConflictMap: (conflicts: IDecisionConflict[]) => Map<string, string[]>;