/** * Memory frontmatter schema — executable type definition. * * type = subject axis: who this memory is about * tier = recall axis: how this memory is retrieved * tags = free-form topic keywords (no subject encoding) * * Valid values: * type: user | project | agent-feedback | reference | compaction * tier: L1 | L2 * tags: string[] */ declare const SUBJECTS: readonly ["user", "project", "agent-feedback", "reference", "compaction"]; declare const TIERS: readonly ["L1", "L2"]; export type Subject = typeof SUBJECTS[number]; export type Tier = typeof TIERS[number]; /** Runtime set for O(1) membership checks (subject axis) */ export declare const VALID_SUBJECTS: Set<"user" | "project" | "agent-feedback" | "reference" | "compaction">; /** Runtime set for O(1) membership checks (recall axis) */ export declare const VALID_TIERS: Set<"L1" | "L2">; /** * Legacy L1 types — only used for migration-period tier inference. * NOT valid subjects in the new schema. * These are the old type values that meant "always inject" in pre-Plan-C systems. */ export declare const LEGACY_L1_TYPES: Set; /** * Legacy type → canonical subject mapping. * * ⚠️ Some mappings are lossy — these decisions were made pragmatically: * * - fact → user: "facts about the user" were most common; project-level facts * could also be user decisions but we picked user as the default * - decision → project: decisions are treated as project knowledge; user-level * decisions (preferences) still lose some signal (would be preference→user) * - workflow → project: workflows are project artifacts * * If precise distinction matters, do a targeted re-classification with the LLM. */ export declare const LEGACY_TYPE_MAP: Record; export interface ValidationResult { valid: boolean; errors: string[]; warnings: string[]; } /** * Normalize a legacy or arbitrary type value to a valid subject. * Returns the canonical subject, or null if unclassifiable. */ export declare function normalizeSubject(type: string | undefined | null): Subject | null; export type Triple = readonly [string, string, string]; export type Triples = ReadonlyArray; export interface TriplesValidationResult { valid: boolean; errors: string[]; } /** * Validate a triples value as it would appear in frontmatter. * `value` is whatever was in the `triples:` field — it could be the * parsed array, the raw JSON string, or something malformed from a * hand-edited .md file. * * The return is structured: `valid: true` means the value can be * trusted as input to kg.addTriple (subject/predicate/object all * non-empty strings; the array shape is correct). Empty arrays are * valid (no triples is a legitimate state). Anything else is invalid * with a per-element error message. */ export declare function validateTriples(value: unknown): TriplesValidationResult; export {}; //# sourceMappingURL=schema.d.ts.map