Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

StopOrchestrator missing TranscriptParser module - Stop hooks fail on fresh install

Open fayerman-source opened this issue 10 months ago • 2 comments

Description

Performing a clean-slate install of PAI v2.3.0 on a fresh machine with Claude Code produces an error on every Stop hook:

Stop hook error: Failed with non-blocking status code: error: Cannot find module '../skills/CORE/Tools/TranscriptParser' from '/home/user/.claude/hooks/StopOrchestrator.hook.ts'

Root Cause

StopOrchestrator.hook.ts and its handlers import from a module that doesn't exist:

// StopOrchestrator.hook.ts:56
import { parseTranscript } from '../skills/CORE/Tools/TranscriptParser';

// handlers/voice.ts:14
import type { ParsedTranscript } from '../../skills/CORE/Tools/TranscriptParser';

// handlers/capture.ts:15
import type { ParsedTranscript, StructuredResponse } from '../../skills/CORE/Tools/TranscriptParser';

The directory skills/CORE/Tools/ exists but contains only:

  • FeatureRegistry.ts
  • Inference.ts
  • SessionProgress.ts
  • SkillSearch.ts

TranscriptParser.ts was never created or was accidentally omitted from the distribution.

Affected Files

  • hooks/StopOrchestrator.hook.ts
  • hooks/handlers/voice.ts
  • hooks/handlers/capture.ts
  • hooks/handlers/tab-state.ts
  • hooks/handlers/SystemIntegrity.ts

Environment

  • PAI version: v2.3.0 (clean-slate install)
  • Platform: Ubuntu 24.04 / WSL2
  • Claude Code: Latest

Related Issues

This follows a pattern of phantom references in PAI:

  • #362 - pai-history-system missing metadata-extraction.ts
  • #353 - observability.ts library referenced but absent
  • #377 - pai-hook-system pack missing observability.ts

Proposed Fix

Create skills/CORE/Tools/TranscriptParser.ts that exports:

  • parseTranscript(path: string): ParsedTranscript
  • ParsedTranscript interface
  • StructuredResponse interface

I can submit a PR with the implementation.

fayerman-source avatar Jan 17 '26 00:01 fayerman-source

Update: This is an Installation Bug, Not a Missing File

After further investigation, I discovered that TranscriptParser.ts does exist in the repo at:

Releases/v2.3/.claude/skills/CORE/Tools/TranscriptParser.ts

The actual bug: The AI-assisted installation method (recommended in README) does not copy this file to the user's machine.

I installed PAI on a fresh Ubuntu 24.04/WSL2 machine using the recommended method:

"Give this URL to your DA assistant and say 'Walk me through installing PAI and customize it for me.'"

The installation completed but TranscriptParser.ts was not present in ~/.claude/skills/CORE/Tools/, causing the Stop hook errors.

Root cause: The AI-assisted installation process doesn't copy all files from Releases/v2.3/.claude/ to the user's installation.

Workaround: Manually copy the file from the repo:

cp Releases/v2.3/.claude/skills/CORE/Tools/TranscriptParser.ts ~/.claude/skills/CORE/Tools/

The fix should be in the installation process/documentation, not adding a missing file.

fayerman-source avatar Jan 17 '26 01:01 fayerman-source

Fix Deployed

This issue has been resolved in commit e75b18f.

Root Cause

TranscriptParser.ts was present in the Releases/v2.3 directory but was not included in any Pack. When users install via the Pack system (the recommended method), the file was missing, causing all Stop hooks to fail.

The affected files that import TranscriptParser:

  • StopOrchestrator.hook.ts
  • handlers/voice.ts
  • handlers/capture.ts
  • handlers/tab-state.ts
  • handlers/SystemIntegrity.ts

Fix

Added TranscriptParser.ts to the pai-hook-system pack at src/skills/CORE/Tools/TranscriptParser.ts. This is the correct location since:

  1. TranscriptParser is a hook utility (used only by Stop hooks)
  2. It depends on hooks/lib/identity.ts which is already in the hook-system pack

For Users Experiencing This Issue

Option 1: Re-install the hook-system pack Pull the latest version and reinstall pai-hook-system.

Option 2: Manual fix Copy the TranscriptParser.ts file manually:

# From the release directory
cp ~/.claude/Releases/v2.3/.claude/skills/CORE/Tools/TranscriptParser.ts ~/.claude/skills/CORE/Tools/

Pattern Note

This is the fourth instance (#362, #353, #377, #417) of missing files in Pack distributions. We should add Pack validation to the release process to catch missing dependencies before release.

danielmiessler avatar Jan 17 '26 02:01 danielmiessler