twining_commits
Trace code changes to decision rationale by querying decisions linked to specific Git commit hashes for development traceability.
Instructions
Query decisions by commit hash. Returns all decisions that were linked to a given commit, enabling traceability from code changes back to decision rationale.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| commit_hash | Yes | Git commit hash to look up |
Implementation Reference
- src/tools/decision-tools.ts:273-299 (handler)Registration of the twining_commits tool which calls engine.getByCommitHash.
// twining_commits — Query decisions by commit hash server.registerTool( "twining_commits", { description: "Query decisions by commit hash. Returns all decisions that were linked to a given commit, enabling traceability from code changes back to decision rationale.", inputSchema: { commit_hash: z .string() .describe("Git commit hash to look up"), }, }, async (args) => { try { const result = await engine.getByCommitHash(args.commit_hash); return toolResult(result); } catch (e) { if (e instanceof TwiningError) { return toolError(e.message, e.code); } return toolError( e instanceof Error ? e.message : "Unknown error", "INTERNAL_ERROR", ); } }, ); - src/engine/decisions.ts:372-397 (handler)The implementation of getByCommitHash in DecisionEngine which executes the logic for twining_commits.
* Get decisions linked to a specific commit hash. */ async getByCommitHash(commitHash: string): Promise<{ decisions: Array<{ id: string; summary: string; domain: string; scope: string; confidence: string; timestamp: string; commit_hashes: string[]; }>; }> { const decisions = await this.decisionStore.getByCommitHash(commitHash); return { decisions: decisions.map((d) => ({ id: d.id, summary: d.summary, domain: d.domain, scope: d.scope, confidence: d.confidence, timestamp: d.timestamp, commit_hashes: d.commit_hashes, })), }; }