elenchus_get_project_history
Retrieve verification history for a project to access past sessions and baselines, enabling review of previous analysis results without starting from scratch.
Instructions
Get verification history for a project including past sessions and baselines.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| workingDir | Yes | Working directory for the project |
Implementation Reference
- src/tools/diff-tools.ts:191-227 (handler)The handler function that executes the 'elenchus_get_project_history' tool logic. It calls getProjectIndex to load the project index from disk and returns the history (past sessions) and last verified session info.
export async function getProjectHistoryTool( args: z.infer<typeof GetProjectHistorySchema> ): Promise<{ hasHistory: boolean; projectPath: string; history?: Array<{ sessionId: string; timestamp: string; verdict: string; target: string; }>; lastVerified?: { sessionId: string; timestamp: string; gitCommit?: string; }; }> { const index = await getProjectIndex(args.workingDir); if (!index) { return { hasHistory: false, projectPath: args.workingDir }; } return { hasHistory: true, projectPath: args.workingDir, history: index.history, lastVerified: index.lastVerifiedSession ? { sessionId: index.lastVerifiedSession, timestamp: index.lastVerifiedTimestamp || '', gitCommit: index.lastVerifiedCommit } : undefined }; } - src/tools/schemas.ts:239-241 (schema)Zod schema for input validation of the 'elenchus_get_project_history' tool. Takes a single required field: workingDir (string).
export const GetProjectHistorySchema = z.object({ workingDir: z.string().describe('Working directory for the project') }); - src/tools/diff-tools.ts:244-249 (registration)The tool registration entry that maps 'elenchus_get_project_history' to its schema and handler. This is part of the diffTools object exported from diff-tools.ts.
elenchus_get_project_history: { description: 'Get verification history for a project including past sessions and baselines.', schema: GetProjectHistorySchema, handler: getProjectHistoryTool } }; - src/tools/index.ts:41-54 (registration)The final tool composition that spreads diffTools (including elenchus_get_project_history) into the unified tools export.
export const tools = { ...sessionLifecycleTools, ...issueManagementTools, ...mediatorTools, ...roleTools, ...reverifyTools, ...diffTools, ...cacheTools, ...pipelineTools, ...safeguardsTools, ...optimizationTools, ...dynamicRoleTools, ...llmEvalTools, }; - src/diff/baseline.ts:111-121 (helper)Helper function getProjectIndex that reads the project index from disk (index.json). Used by the handler to retrieve history data.
export async function getProjectIndex( projectPath: string ): Promise<ProjectIndex | null> { try { const indexPath = path.join(getProjectDir(projectPath), 'index.json'); const content = await fs.readFile(indexPath, 'utf-8'); return JSON.parse(content); } catch { return null; } }