track_concept_evolution
Analyze how a concept's definition changes throughout a manuscript's development to maintain consistency and track evolution.
Instructions
Track how a concept's definition evolved over time
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | No | Path to manuscript directory (defaults to current directory) | |
| concept_name | Yes | Name of the concept to track |
Implementation Reference
- src/tools/WriterToolHandlers.ts:130-135 (handler)MCP tool handler: extracts concept_name and limit from args, applies pagination limit, delegates to WritersAid.trackConceptEvolutionprivate async trackConceptEvolution(args: Record<string, unknown>) { const conceptName = args.concept_name as string; const limit = resolvePaginationLimit("track_concept_evolution", args.limit as number | undefined); return this.writersAid.trackConceptEvolution({ conceptName, limit }); }
- src/WritersAid.ts:662-694 (handler)Core tool logic: calls ConceptTracker.getConceptEvolution, handles not found case, applies limit slicing, formats response with version detailstrackConceptEvolution(options: { conceptName: string; limit?: number }) { const evolution = this.conceptTracker.getConceptEvolution(options.conceptName); if (!evolution) { return { conceptName: options.conceptName, found: false, message: "No versions found for this concept", }; } // Trim versions to limit (default handled by pagination resolver in handler) const versionsToReturn = options.limit ? evolution.versions.slice(0, options.limit) : evolution.versions; return { conceptName: evolution.conceptName, found: true, versions: versionsToReturn.map((v) => ({ versionNumber: v.versionNumber, definition: v.definition, filePath: v.filePath, timestamp: new Date(v.timestamp).toISOString(), changeRationale: v.changeRationale, commitHash: v.commitHash, })), totalVersions: evolution.totalVersions, changeCount: evolution.changeCount, firstDefinition: evolution.firstDefinition.definition, latestDefinition: evolution.latestDefinition.definition, }; }
- Input schema definition for the tool, specifying concept_name as required parametername: "track_concept_evolution", description: "Track how a concept's definition evolved over time", inputSchema: { type: "object", properties: { project_path: { type: "string", description: "Path to manuscript directory (defaults to current directory)" }, concept_name: { type: "string", description: "Name of the concept to track" }, }, required: ["concept_name"], }, },
- src/memory/ConceptTracker.ts:137-155 (helper)Database-backed helper: retrieves all versions of a concept, sorts chronologically, computes evolution summary (first/latest defs, change count)getConceptEvolution(conceptName: string): ConceptEvolution | undefined { const versions = this.getConceptVersions(conceptName); if (versions.length === 0) { return undefined; } // Versions are sorted DESC, so reverse for chronological order const chronological = [...versions].reverse(); return { conceptName, versions: chronological, totalVersions: versions.length, firstDefinition: chronological[0], latestDefinition: versions[0], // Latest is first in DESC order changeCount: versions.length - 1, }; }
- src/utils/pagination.ts:13-22 (helper)Pagination configuration defining default (10) and max (50) limits for track_concept_evolution tool, used by resolvePaginationLimitexport const PAGINATION_DEFAULTS: Record<string, { default: number; max: number }> = { find_gaps: { default: 20, max: 100 }, find_todos: { default: 50, max: 200 }, find_duplicates: { default: 30, max: 100 }, check_terminology: { default: 20, max: 50 }, find_broken_links: { default: 50, max: 200 }, track_concept_evolution: { default: 10, max: 50 }, suggest_cross_references: { default: 25, max: 100 }, analyze_link_graph: { default: 100, max: 500 }, };