import type { BranchSnapshotRow, ParsedCommandRun, ParsedEpisode, ParsedNote } from '../db/store.js'; export type MemoryItemState = 'pinned' | 'hot' | 'warm' | 'cold' | 'archived'; export declare function memoryStateForNote(kind: string, status: string): MemoryItemState; /** * One tier colder (FR-4): hot→warm, warm→cold, floor at cold. The floor is the * point — demoting into `archived` would silently re-create the invisibility * this story removes. Pinned is explicit user intent and is never auto-demoted; * archived rows (pre-1.4 supersedes) stay where they were, forward-only. */ export declare function demoteMemoryState(state: MemoryItemState): MemoryItemState; /** * The lines `buildNoteMemoryText` appended, separated from free-form content. * * Note content may contain newlines, so `text` is content lines followed by * the trailer with nothing marking the boundary. Walking back from the end and * requiring the labels to appear in their canonical order recovers it: a real * trailer line always sits after the content, while one typed *into* the * content sits before whatever trailer the projection appended. Matching is * exact-case because the projection only ever emits these literals — * lowercasing would admit shouted text from captured logs. * * Lives here rather than in `query/render.ts` (where Story 1.3 first built it) * because `memory/hotness.ts` needs trailer-scoped reads too and the layer * direction only permits `query/ → memory/`. */ export declare function noteTrailerLines(text: string): string[]; /** * Whether projected note text carries the `Status: superseded` trailer line. * * Trailer-scoped, not merely line-exact — the lesson Story 1.3's review taught * for `Alternatives:` applies identically here: a note whose free-form content * contains its own `Status: superseded` line would otherwise read as retired * while `notes.status` is `active`, and nothing could ever clear it — * `cortex_resolve` writes columns while this reads text. The consequences here * are worse than a label: the demotion cap, the stale penalty, and exclusion * from the SessionStart brief and reflex. The trailer scan rejects a content * line because `Subject:` (mandatory for every kind but `insight`) always * follows content, and a `Status:` above a `Subject:` breaks canonical order. * The residual — a subject-less insight whose content *ends* with the line — * is the same bounded, documented exposure `renderedAlternatives` carries. * * The `touchMemoryItems` SQL CASE necessarily stays a substring LIKE — same * pre-existing divergence the resolved branch has; the derive layer re-settles * any disagreement on the next refresh. */ export declare function isSupersededMemoryText(text: string): boolean; /** * The predicate call sites should use: kind-guarded, because only notes have a * status at all. An episode's captured stderr can contain a `Status: * superseded` line (this repo's own test output does), and without the guard a * fresh command-failure episode — which exists precisely to land hot — would * be demote-capped and stale-penalized by its own log text. */ export declare function isSupersededMemoryItem(item: { kind: string; text: string; }): boolean; export declare function noteImportance(kind: string): number; export declare function buildNoteMemoryText(note: ParsedNote): string; export declare function commandRunState(run: ParsedCommandRun): MemoryItemState; export declare function commandRunImportance(run: ParsedCommandRun): number; export declare function buildCommandMemoryText(run: ParsedCommandRun): string; export declare function episodeState(kind: string): MemoryItemState; export declare function episodeImportance(kind: string): number; export declare function buildEpisodeMemoryText(episode: ParsedEpisode): string; export declare function buildBranchSnapshotMemoryText(snapshot: BranchSnapshotRow): string; export declare function buildProjectSnapshotMemoryText(summary: string, noteDigest?: string | null): string; //# sourceMappingURL=items.d.ts.map