/** State of a single slot in a .faf file */ export type SlotState = 'populated' | 'empty' | 'slotignored'; /** Category grouping for slots */ export type SlotCategory = 'project' | 'human' | 'frontend' | 'backend' | 'universal' | 'enterprise_infra' | 'enterprise_app' | 'enterprise_ops'; /** A single slot definition */ export interface SlotDef { /** Slot number (1-33) */ index: number; /** Dot-path in .faf YAML (e.g. "project.name") — current on-wire identifier * used for read/write and kernel scoring. */ path: string; /** Mk4 canonical dot-path (forward spec). Defined for slots where the * current `path` is a legacy name pending lockstep rename with * faf-scoring-kernel + xai-faf-rust. See issue #66. */ canonical?: string; /** Human description */ description: string; /** Canonical short display label for emitted AI-context files (CLAUDE / AGENTS / * copilot-instructions / GEMINI / .cursorrules). The single source of truth for * how a slot is labelled — e.g. `cicd` → "CI/CD", `api_type` → "API". */ label?: string; /** Category this slot belongs to */ category: SlotCategory; } /** Result from WASM kernel score_faf / score_faf_enterprise */ export interface KernelScoreResult { score: number; tier: string; populated: number; empty: number; ignored: number; active: number; total: number; slots: Record; } /** Enriched score result for display */ export interface ScoreResult { score: number; tier: TierInfo; populated: number; empty: number; ignored: number; active: number; total: number; slots: Record; /** * When true, the score is INHERITED from a source codebase (declared via * the `about:` block + `about.source_score`). The scorer did NOT calculate * this — the owner attested to it. About is a repo role, not an app_type. * * Set by scoreFafYaml when the input has `about.represents`. * Consumers (TAF receipt generation, display logic) should distinguish * inherited scores from calculated ones — they're qualitatively different * artifacts. See memory/private-source-public-about-pattern.md. */ inherited?: boolean; /** * For inherited scores: the owner/repo the About Repo represents. * Format: "owner/repo" (e.g. "Wolfe-Jam/faf-mcpaas"). Required when * `inherited: true` per schema validation. */ represents?: string; /** * True when the score is NOT KNOWN: an About Repo with no valid * `about.source_score`. `score` is then -1 and `tier` is White only as a * placeholder — neither is a result. Render it as "unknown" (—), never as a * number or a percentage ("-1/100", "-1%"), and do not seal a receipt or * attest it. Set only when true (absent on every calculated or inherited score). */ unknown?: boolean; } /** Tier boundary info */ export interface TierInfo { name: string; threshold: number; /** Display indicator (branded glyphs + ANSI color) */ indicator: string; } /** Parsed .faf file data */ export interface FafData { faf_version?: string; project?: { name?: string; goal?: string; main_language?: string; type?: string; /** Integration branch agents PR into — `dev`/`develop` for git-flow repos. Default `main`. */ default_branch?: string; [key: string]: unknown; }; /** * Top-level app_type — drives slot selection in APP_TYPE_CATEGORIES. * Must be a real app (cli, library, mcp, …). `about` is not an app_type. */ app_type?: string; /** * About Repo declaration. The `about:` block is the role signal * (`about.represents` required). Scorer short-circuits and emits * `source_score`. See memory/private-source-public-about-pattern.md. */ about?: { /** Required: "owner/repo" pointing at the private source codebase. */ represents?: string; /** Optional: owner-attested score of the source (0-100). Missing = score "—". */ source_score?: number; }; stack?: Record; human_context?: Record; monorepo?: Record; scores?: Record; /** `tech_stack` chunk — flat list of technology components */ tech_stack?: string[]; /** `key_files` chunk — list of important file paths */ key_files?: string[]; /** `commands` chunk — build/test/lint/dev command map */ commands?: Record; /** `architecture` chunk — free-form structural description (user-fill) */ architecture?: string; /** `context` chunk — free-form additional signal (user-fill, NOT human_context) */ context?: string; [key: string]: unknown; } /** FAFb v2 info from kernel decompile / fafb_info */ export interface FafbInfo { version: string; flags: number; section_count: number; total_size: number; source_checksum: string; created?: number; sections: Array<{ name: string; name_index?: number; priority: number; offset?: number; length: number; token_count?: number; classification: string; content?: string; }>; } /** Framework detection result */ export interface DetectedFramework { name: string; slug: string; category: string; confidence: number; version?: string; } /** Signal types for framework detection */ export type SignalType = 'dependency' | 'file' | 'devDependency' | 'content'; export interface Signal { type: SignalType; key?: string; /** File glob/name for `file`/`content`, or package key for dependency types. */ pattern?: string; } export interface FrameworkSignature { name: string; slug: string; category: string; signals: Signal[]; }