Personal_AI_Infrastructure icon indicating copy to clipboard operation
Personal_AI_Infrastructure copied to clipboard

Issue: pai-observability-server pack missing 2 files in src/ - installation fails

Open Gerkinfeltser opened this issue 10 months ago • 2 comments

The Problem

The pai-observability-server pack is missing 2 files that INSTALL.md references. The install wizard expects these in src/ but they're not there.

Expected Files (per INSTALL.md)

File Expected Location Status
capture-all-events.ts src/hooks/ ❌ MISSING
manage.sh src/observability/ ❌ MISSING

Evidence

From INSTALL.md lines 226-241 (Step 4.2 - Copy Server Files):

# Copy server source files
cp "$PACK_DIR/src/observability/apps/server/src/types.ts" "$PAI_DIR/observability/apps/server/src/"
cp "$PACK_DIR/src/observability/apps/server/src/file-ingest.ts" "$PAI_DIR/observability/apps/server/src/"
cp "$PACK_DIR/src/observability/apps/server/src/index.ts" "$PAI_DIR/observability/apps/server/src/"
cp "$PACK_DIR/src/observability/apps/server/package.json" "$PAI_DIR/observability/apps/server/"

From INSTALL.md lines 276-293 (Step 4.4 - Copy Hook Files):

# Copy capture hook
cp "$PACK_DIR/src/hooks/capture-all-events.ts" "$PAI_DIR/hooks/"

# Copy metadata extraction library
cp "$PACK_DIR/src/hooks/lib/metadata-extraction.ts" "$PAI_DIR/hooks/lib/"

From INSTALL.md lines 295-310 (Step 4.5 - Copy Management Script):

# Copy management script
cp "$PACK_DIR/src/observability/manage.sh" "$PAI_DIR/observability/"

# Make executable
chmod +x "$PAI_DIR/observability/manage.sh"

Actual src/ Contents

src/
├── hooks/
│   └── lib/
│       └── metadata-extraction.ts  ✓ exists
└── observability/
    ├── apps/
    │   ├── client/
    │   │   ├── index.html          ✓
    │   │   ├── package.json        ✓
    │   │   ├── postcss.config.js    ✓
    │   │   ├── src/
    │   │   │   ├── App.vue         ✓
    │   │   │   ├── main.ts         ✓
    │   │   │   └── style.css       ✓
    │   │   ├── tailwind.config.js   ✓
    │   │   └── vite.config.ts      ✓
    │   └── server/
    │       ├── package.json        ✓
    │       └── src/
    │           ├── file-ingest.ts  ✓
    │           ├── index.ts        ✓
    │           └── types.ts        ✓
    └── manage.sh                  ❌ MISSING
hooks/
└── capture-all-events.ts           ❌ MISSING

Impact

Installation fails - The INSTALL wizard cannot complete without these files:

  • Step 4.4 fails: cp: cannot stat 'src/hooks/capture-all-events.ts': No such file or directory
  • Step 4.5 fails: cp: cannot stat 'src/observability/manage.sh': No such file or directory

Suggested Fix

Add the missing files to the pack:

  1. src/hooks/capture-all-events.ts - PostToolUse hook that captures all events to JSONL
  2. src/observability/manage.sh - Start/stop/restart control script for the observability server

These should be the same files referenced in the INSTALL.md installation guide.

Additional Note

The VERIFY.md also references these missing files:

  • Line 18: $PAI_DIR/hooks/capture-all-events.ts exists
  • Line 25: $PAI_DIR/observability/manage.sh exists and is executable

Version

  • Pack: pai-observability-server
  • Version: 1.0.0
  • Pack ID: danielmiessler-pai-observability-server-core-v1.0.0

Recovered Files from Git History

The following files were found in git history (commit 6cfdc0a, before the kai->pai rebrand). Need assessment: Are these compatible with PAI 2.1.0?

src/hooks/capture-all-events.ts

View at commit: https://github.com/danielmiessler/Personal_AI_Infrastructure/blob/6cfdc0a23ed041e83ddbd2b80fd317cbd363fa1b/Packs/kai-observability-server/src/hooks/capture-all-events.ts

src/observability/manage.sh

View at commit: https://github.com/danielmiessler/Personal_AI_Infrastructure/blob/6cfdc0a23ed041e83ddbd2b80fd317cbd363fa1b/Packs/kai-observability-server/src/observability/manage.sh

Questions for reviewers:

  1. Are these files compatible with PAI 2.1.0 hook system?
  2. Is process.env.DA still valid in 2.1.0, or should it be process.env.CLAUDE_CODE_AGENT?
  3. Does the metadata-extraction.ts import path still work with the current structure?

Gerkinfeltser avatar Jan 11 '26 15:01 Gerkinfeltser

Found the root cause and a few additional items that might help:

Root cause: The missing files were part of pai-history-system, which was retired in commit 45bb441 (Jan 9). The hooks were deleted but not migrated to pai-hook-system or included in pai-observability-server.

You can recover the files from git history: git show 45bb441^:Packs/pai-history-system/src/capture-all-events.ts > ~/.claude/hooks/capture-all-events.ts git show 45bb441^:Packs/pai-history-system/src/stop-hook.ts > ~/.claude/hooks/stop-hook.ts

etc.

Additional issue: App.vue has hardcoded ws://localhost:4000/stream which breaks LAN access. Fix: const wsHost = window.location.hostname || 'localhost' ws = new WebSocket(ws://${wsHost}:4000/stream)

Note: The current UI also differs from the https://www.youtube.com/watch?v=Le0DLrn7ta0 (e.g., missing active skills display at top) - might still be WIP.

MarkoSteenbergen avatar Jan 12 '26 23:01 MarkoSteenbergen

Thanks for reporting! The pack-based observability server was restructured in v3.0 (now released). Please upgrade to v3.0.

kaimagnus avatar Feb 15 '26 17:02 kaimagnus