trellis
Version:
Agentic State Engine — event-sourced causal graph with branching, decision traces, and realtime sync for AI-native applications
47 lines • 1.77 kB
TypeScript
/**
* Causal history graph snapshot — milestones + lane forks + promotes.
* Spec: docs/specs/trellis-admin-causal-graph.md
*/
import type { TrellisVcsEngine } from '../engine.js';
import type { LaneMeta } from '../vcs/lane.js';
import type { MilestoneInfo } from '../vcs/milestone.js';
export type CausalNodeKind = 'milestone' | 'fork' | 'promote' | 'head';
export interface CausalNode {
id: string;
hash: string;
message: string;
lane: number;
parents: string[];
branches?: string[];
tags?: string[];
author?: string;
date?: string;
kind?: CausalNodeKind;
/** Agent lane UUID when node represents fork/head/promote on a lane. */
laneId?: string;
/** True when `laneId` refers to a lane with status `active`. */
active?: boolean;
}
export interface CausalGraphSnapshot {
at: string;
integrationBranch: string;
commits: CausalNode[];
/** Lane ids with status `active` (agent-assigned work in flight). */
activeLaneIds: string[];
stats: {
eventCount: number;
activeForkCount: number;
};
}
export interface CausalGraphInputs {
integrationBranch: string;
lanes: LaneMeta[];
milestones: MilestoneInfo[];
issueTitles?: Record<string, string>;
}
/** Assign graph column indices (0 = trunk). Exported for tests. */
export declare function assignLaneIndices(lanes: LaneMeta[]): Map<string, number>;
export declare function buildCausalGraphFromInputs(input: CausalGraphInputs): CausalGraphSnapshot;
export declare function buildCausalGraphSnapshot(engine: TrellisVcsEngine): CausalGraphSnapshot;
export declare function formatViewMeta(stats: CausalGraphSnapshot['stats'], integrationBranch: string): string;
//# sourceMappingURL=causal-graph-snapshot.d.ts.map