Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
b1acd4b
docs(conch): update execution guide timestamp to 2025-12-09
Dec 9, 2025
b264953
docs(conch): comprehensive consciousness harvest & persona grounding …
Dec 9, 2025
f42d444
feat(consciousness): complete harvest pipeline with Kuhn taxonomy
Dec 9, 2025
270d2d3
feat(youtube): configure channel monitor and YT management CLI
Dec 9, 2025
9a3bd9c
fix: address CodeRabbit review comments
Dec 9, 2025
183424b
fix(channel-monitor): resolve stats endpoint array dimension error
Dec 9, 2025
c3b9cd6
fix(tests): align work orders tests with actual database schema
Dec 10, 2025
28a5f22
docs: add Flute multimodal communication layer architecture
Dec 10, 2025
3eaad19
feat(phase-10): add messaging-gateway service and activate n8n workflows
Dec 10, 2025
a193357
fix: parameterize hardcoded paths in YT commands
Dec 10, 2025
722fccf
fix: add skip marker for TensorZero tests when service unavailable
Dec 10, 2025
1711666
fix(phase-14): comprehensive validation fixes for image pipeline and …
Dec 10, 2025
679b18c
security: harden secrets management for production deployment
Dec 10, 2025
059675e
docs: add CHIT_PASSPHRASE to required secrets lists
Dec 10, 2025
6c4d821
feat(phase11): n8n update, secrets infrastructure, work orders schema
Dec 11, 2025
d442141
ci(sql-lint): add new migrations to allowlist
Dec 11, 2025
18125f1
fix(pr-294): address CodeRabbit review feedback
Dec 11, 2025
aa0214a
fix(nitpick): improve code quality based on CodeRabbit review
Dec 11, 2025
365ce47
fix(nitpick): improve exception logging in messaging gateway
Dec 11, 2025
c2366d5
fix(pr-294): address critical blockers from code review
Dec 11, 2025
d7b9177
docs(testing): add comprehensive PR test report
Dec 11, 2025
6cfcdab
docs(vision): update Platform Vision to December 2025 state
Dec 11, 2025
0708ecb
fix(pr-294): address critical blockers from code review
Dec 11, 2025
60411e0
fix: wrap bare URL in github-secrets-quickstart.md
Dec 11, 2025
b8c40bd
merge: resolve conflicts with main (take upstream versions)
Dec 11, 2025
a9d4ea2
fix(docker): update Open Notebook to use PMOVES GHCR image
Dec 11, 2025
7a39df7
feat(testing): add testing strategy and /test:pr command
Dec 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 95 additions & 27 deletions .claude/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,77 @@ PMOVES.AI has a sophisticated multi-agent infrastructure (Agent Zero, NATS, Hi-R

```
.claude/
├── CLAUDE.md # Always-on context - READ THIS FIRST
├── README.md # This file
├── commands/ # Custom slash commands
│ ├── agents/
│ │ ├── status.md # /agents:status - Check Agent Zero
│ │ └── mcp-query.md # /agents:mcp-query - Call MCP API
│ ├── search/
│ │ ├── hirag.md # /search:hirag - Query Hi-RAG v2
│ │ ├── supaserch.md # /search:supaserch - Deep research
│ │ └── deepresearch.md # /search:deepresearch - LLM research
│ ├── health/
│ │ ├── check-all.md # /health:check-all - Verify all services
│ │ └── metrics.md # /health:metrics - Prometheus queries
│ └── deploy/
│ ├── smoke-test.md # /deploy:smoke-test - Run integration tests
│ └── services.md # /deploy:services - Docker status
└── context/ # Reference documentation
├── services-catalog.md # Complete service listing
├── nats-subjects.md # NATS event catalog
├── mcp-api.md # Agent Zero MCP reference
├── chit-geometry-bus.md # CHIT structured data format
└── evoswarm.md # Evolutionary optimization system
├── CLAUDE.md # Always-on context (12KB) - loaded automatically
├── README.md # This file
├── settings.local.json # 131 allowed bash command patterns
├── test-self-hosting.sh # NATS + Hi-RAG integration test
│
├── commands/ # 43 custom slash commands
│ ├── agents/ (2) # Agent Zero orchestration
│ │ ├── status.md # /agents:status - service health
│ │ └── mcp-query.md # /agents:mcp-query - MCP API calls
│ ├── botz/ (4) # Bot configuration & CHIT
│ │ ├── init.md # /botz:init - initialize bot
│ │ ├── profile.md # /botz:profile - CHIT profiles
│ │ ├── secrets.md # /botz:secrets - secret management
│ │ └── mcp.md # /botz:mcp - MCP integration
│ ├── crush/ (2) # Compression utilities
│ ├── db/ (3) # Database operations (backup, migrate, query)
│ ├── deploy/ (3) # Service deployment (up, services, smoke)
│ ├── github/ (4) # GitHub integration (actions, issues, PR, security)
│ ├── health/ (2) # Health monitoring (check-all, metrics)
│ ├── k8s/ (3) # Kubernetes operations (deploy, logs, status)
│ ├── search/ (3) # Knowledge retrieval
│ │ ├── hirag.md # /search:hirag - Hi-RAG v2 queries
│ │ ├── supaserch.md # /search:supaserch - holographic research
│ │ └── deepresearch.md # /search:deepresearch - LLM planner
│ ├── workitems/ (3) # BoTZ work tracking (claim, complete, list)
│ ├── worktree/ (4) # Git worktree / TAC patterns
│ │ ├── create.md # /worktree:create - new worktree
│ │ ├── switch.md # /worktree:switch - change context
│ │ ├── list.md # /worktree:list - show all
│ │ └── cleanup.md # /worktree:cleanup - remove stale
│ └── yt/ (10) # YouTube pipeline
│ ├── ingest.md # /yt:ingest - download + transcript
│ ├── status.md # /yt:status - pipeline health
│ ├── channels.md # /yt:channels - monitored channels
│ └── ... (7 more) # Additional YT operations
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
│
├── context/ # Reference documentation (7 files)
│ ├── services-catalog.md # Complete service listing with ports
│ ├── tensorzero.md # TensorZero LLM gateway deep dive
│ ├── evoswarm.md # Evolutionary optimization system
│ ├── chit-geometry-bus.md # Structured multimodal data format
│ ├── nats-subjects.md # NATS event subject catalog
│ ├── mcp-api.md # Agent Zero MCP API reference
│ └── git-worktrees.md # TAC (Tactical Agentic Coding) workflows
│
└── hooks/ # Security & observability (4 files)
├── pre-tool.sh # Security validation gate
│ # Blocks: rm -rf /, DROP DATABASE, etc.
├── post-tool.sh # NATS observability publisher
│ # Publishes: claude.code.tool.executed.v1
├── README.md # Hook configuration guide
└── TEST_RESULTS.md # Validation test results
```

### Slash Command Categories Summary

| Category | Commands | Primary Use |
| --- | --- | --- |
| `/agents:*` | 2 | Agent Zero health and MCP queries |
| `/botz:*` | 4 | CHIT profile management, secrets |
| `/search:*` | 3 | Hi-RAG, SupaSerch, DeepResearch |
| `/yt:*` | 10 | YouTube ingestion pipeline |
| `/deploy:*` | 3 | Service deployment and smoke tests |
| `/worktree:*` | 4 | TAC parallel development |
| `/health:*` | 2 | Platform-wide health checks |
| `/k8s:*` | 3 | Kubernetes operations |
| `/db:*` | 3 | Database backup, migrate, query |
| `/github:*` | 4 | Actions, issues, PRs, security |
| `/crush:*` | 2 | Compression utilities |
| `/workitems:*` | 3 | BoTZ work item tracking |

## Quick Start

### 1. Read CLAUDE.md
Expand Down Expand Up @@ -144,13 +191,34 @@ Additional context, gotchas, tips

Commands are automatically discovered by Claude Code CLI.

## Hooks (Optional)
## Hooks (Active)

The `.claude/hooks/` directory contains security and observability hooks:

### Pre-Tool Hook (`pre-tool.sh`)
Validates commands before execution. **Blocks dangerous operations:**
- `rm -rf /` - Disk wipes
- `DROP DATABASE` - Database destruction
- `docker system prune -a` - Container mass deletion
- Force push to protected branches

### Post-Tool Hook (`post-tool.sh`)
Publishes tool executions to NATS for observability:
```bash
# Events published to:
claude.code.tool.executed.v1

# Payload includes:
# - tool: Tool name
# - status: success/failure
# - timestamp: ISO 8601
# - user: Current user
# - session_id: Claude session
```

Hooks can be configured to:
- **Pre-tool validation** - Block dangerous operations
- **Post-tool logging** - Publish Claude actions to NATS for observability
Fallback logging to `~/.claude/logs/tool-events.jsonl` when NATS unavailable.

See integration plan: `docs/PMOVES-claude code integrate.md`
See: `.claude/hooks/README.md` for configuration details

## Git Worktrees (Advanced)

Expand Down
41 changes: 41 additions & 0 deletions .claude/commands/yt/add-channel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Add YouTube Channel

Add a new YouTube channel to the channel monitor configuration.

## Arguments

- `$ARGUMENTS` - YouTube channel URL (e.g., `https://www.youtube.com/@ChannelName`)

## Instructions

1. Parse the channel URL from arguments
2. Extract channel handle (e.g., @ChannelName)
3. Read current channel_monitor.json
4. Create new channel entry with these defaults:
- `channel_id`: `yt:channel:@{handle}`
- `platform`: `youtube`
- `source_type`: `channel`
- `enabled`: `true`
- `check_interval_minutes`: `240`
- `auto_process`: `false` (require manual approval)
- `priority`: `2`
- `namespace`: `pmoves.youtube.custom`
- `tags`: `["custom"]`
- `filters.min_duration_seconds`: `120`
- `filters.max_age_days`: `90`
- `filters.exclude_keywords`: `["#shorts"]`
5. Add to channels array
6. Write updated config
7. Restart channel-monitor service

```bash
# After editing config (uses PMOVES_ROOT env var or defaults to current git repo root)
PMOVES_ROOT="${PMOVES_ROOT:-$(git rev-parse --show-toplevel)}"
docker compose -f "${PMOVES_ROOT}/pmoves/docker-compose.yml" restart channel-monitor
```
Comment on lines +32 to 40

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

BLOCKER: Unresolved merge conflict in channel-monitor restart command.

Lines 32–40 contain unresolved merge conflict markers within a Bash snippet. The HEAD variant using PMOVES_ROOT is more portable and should be retained:

 ```bash
-<<<<<<< HEAD
-# After editing config (uses PMOVES_ROOT env var or defaults to current git repo root)
-PMOVES_ROOT="${PMOVES_ROOT:-$(git rev-parse --show-toplevel)}"
-docker compose -f "${PMOVES_ROOT}/pmoves/docker-compose.yml" restart channel-monitor
-=======
-# After editing config
-docker compose -f /home/pmoves/PMOVES.AI/pmoves/docker-compose.yml restart channel-monitor
->>>>>>> origin/main
+# After editing config (uses PMOVES_ROOT env var or defaults to current git repo root)
+PMOVES_ROOT="${PMOVES_ROOT:-$(git rev-parse --show-toplevel)}"
+docker compose -f "${PMOVES_ROOT}/pmoves/docker-compose.yml" restart channel-monitor

<details>
<summary>🤖 Prompt for AI Agents</summary>

In .claude/commands/yt/add-channel.md around lines 32 to 40 there are unresolved
git conflict markers; remove the conflict delimiters and the hardcoded path from
the origin/main block, keep the HEAD variant that sets PMOVES_ROOT with a
default to the repo root and uses docker compose with
"${PMOVES_ROOT}/pmoves/docker-compose.yml" to restart channel-monitor, and
ensure the final snippet contains only the portable shell lines (comment,
PMOVES_ROOT assignment, and docker compose restart) with no merge markers.


</details>

<!-- fingerprinting:phantom:triton:mongoose -->

<!-- This is an auto-generated comment by CodeRabbit -->


Ask user for:
- Channel name (display name)
- Namespace (default: pmoves.youtube.custom)
- Tags (comma-separated)
- Priority (1=high, 2=medium, 3=low)
37 changes: 37 additions & 0 deletions .claude/commands/yt/add-playlist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Add YouTube Playlist

Add a new YouTube playlist to the channel monitor configuration.

## Arguments

- `$ARGUMENTS` - YouTube playlist URL or ID (e.g., https://www.youtube.com/playlist?list=PLxxxx or just PLxxxx)

## Instructions

1. Parse playlist ID from arguments
- If URL: extract `list=` parameter
- If ID: use directly (starts with PL)
2. Read current channel_monitor.json
3. Create new playlist entry with these defaults:
- `channel_id`: `yt:playlist:{playlist_id}`
- `platform`: `youtube`
- `source_type`: `playlist`
- `source_url`: `https://www.youtube.com/playlist?list={playlist_id}`
- `enabled`: `true`
- `check_interval_minutes`: `120`
- `auto_process`: `false` (require manual approval)
- `priority`: `1`
- `namespace`: `pmoves.youtube.playlist`
- `tags`: `["playlist"]`
- `filters.min_duration_seconds`: `60`
- `filters.max_age_days`: `365`
- `filters.exclude_keywords`: `["#shorts"]`
4. Add to channels array
5. Write updated config
6. Restart channel-monitor service

Ask user for:
- Playlist name (display name)
- Namespace (default: pmoves.youtube.playlist)
- Tags (comma-separated)
- Priority (1=high, 2=medium, 3=low)
28 changes: 28 additions & 0 deletions .claude/commands/yt/check-now.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Check YouTube Channels Now

Trigger an immediate check for new videos on configured channels.

## Arguments

- `$ARGUMENTS` - Optional: specific channel name to check (or "all" for all channels)

## Instructions

1. If specific channel provided:
- Find channel in config
- Call channel monitor API to check that channel
2. If "all" or no argument:
- Trigger full channel check cycle

```bash
# Check channel monitor health
curl -s http://localhost:8097/healthz

# View recent logs for discovered videos
docker logs pmoves-channel-monitor-1 --tail 50 2>&1 | grep -E "(discovered|new video|checking)"
```

Report:
- Number of videos discovered
- Video titles and durations
- Whether videos are queued for processing or waiting for approval
41 changes: 41 additions & 0 deletions .claude/commands/yt/help.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# YouTube Management Help

List all available YouTube management commands.

## Available Commands

### Channel/Playlist Management
- `/yt:list-channels` - List all configured channels and playlists
- `/yt:add-channel <url>` - Add a new YouTube channel
- `/yt:add-playlist <url>` - Add a new YouTube playlist
- `/yt:remove-channel <name>` - Remove a channel/playlist
- `/yt:toggle-channel <name>` - Enable/disable a channel

### Video Operations
- `/yt:check-now [channel]` - Trigger immediate channel check
- `/yt:ingest-video <url>` - Manually ingest a specific video
- `/yt:pending` - List discovered videos awaiting approval

### Status & Monitoring
- `/yt:status` - Check all YouTube service health
- `/yt:help` - Show this help message

## Quick Start

1. Check current channels: `/yt:list-channels`
2. Add a new channel: `/yt:add-channel https://www.youtube.com/@ChannelName`
3. Check for new videos: `/yt:check-now`
4. Review pending videos: `/yt:pending`
5. Ingest specific video: `/yt:ingest-video https://youtu.be/xxxxx`

## Configuration

All channel configurations are stored in:
`${PMOVES_ROOT}/pmoves/config/channel_monitor.json`
(where `PMOVES_ROOT` defaults to the git repository root)

Key settings:
- `auto_process: false` - Videos require manual approval (default)
- `auto_process: true` - Videos are automatically processed
- `check_interval_minutes` - How often to check for new videos
- `filters` - Duration, age, keyword filters
31 changes: 31 additions & 0 deletions .claude/commands/yt/ingest-video.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Ingest YouTube Video

Manually ingest a specific YouTube video through PMOVES.YT.

## Arguments

- `$ARGUMENTS` - YouTube video URL or video ID

## Instructions

1. Parse video URL/ID from arguments
- If URL: extract video ID from various formats (youtu.be, youtube.com/watch, etc.)
- If ID: use directly (11 characters)
2. Call PMOVES.YT ingest endpoint:

```bash
curl -X POST http://localhost:8077/yt/ingest \
-H "Content-Type: application/json" \
-d '{"url": "https://www.youtube.com/watch?v={video_id}", "namespace": "pmoves.manual"}'
```

3. Monitor progress:
```bash
docker logs pmoves-pmoves-yt-1 --tail 30 -f
```

4. Report:
- Download status
- Transcript extraction status
- MinIO storage location
- NATS events published
26 changes: 26 additions & 0 deletions .claude/commands/yt/list-channels.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# List YouTube Channels

List all configured YouTube channels and playlists in the channel monitor.

## Instructions

Read the channel monitor configuration and display:
1. All configured sources (channels and playlists)
2. Their enabled status
3. Check interval
4. Auto-process setting
5. Priority and namespace

```bash
# Read config (uses PMOVES_ROOT env var or defaults to current git repo root)
PMOVES_ROOT="${PMOVES_ROOT:-$(git rev-parse --show-toplevel)}"
cat "${PMOVES_ROOT}/pmoves/config/channel_monitor.json" | jq '.channels[] | {name: .channel_name, id: .channel_id, source_type: .source_type, enabled: .enabled, auto_process: .auto_process, interval_min: .check_interval_minutes, priority: .priority, namespace: .namespace}'
```

Display results in a clean table format showing:
- Channel Name
- Source Type (playlist/channel)
- Enabled (yes/no)
- Auto-Process (yes/no)
- Check Interval
- Priority
20 changes: 20 additions & 0 deletions .claude/commands/yt/pending.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Pending YouTube Videos

List videos that have been discovered but not yet processed (auto_process=false).

## Instructions

1. Query Supabase for videos with status 'pending' or 'discovered'
2. Show list with:
- Video title
- Channel name
- Duration
- Discovery date
- Video URL

```bash
# Check for pending videos in recent logs
docker logs pmoves-channel-monitor-1 --tail 100 2>&1 | grep -E "(discovered|pending|queued)"
```

If videos are pending, ask user which ones to ingest.
27 changes: 27 additions & 0 deletions .claude/commands/yt/remove-channel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Remove YouTube Channel

Remove a YouTube channel or playlist from the channel monitor configuration.

## Arguments

- `$ARGUMENTS` - Channel name or channel_id to remove

## Instructions

1. Read current channel_monitor.json
2. Find matching channel by:
- `channel_name` (partial match, case-insensitive)
- `channel_id` (exact match)
3. If multiple matches found, list them and ask user to be more specific
4. If single match found, show details and confirm removal
5. Remove from channels array
6. Write updated config
7. Restart channel-monitor service

```bash
# After editing config (uses PMOVES_ROOT env var or defaults to current git repo root)
PMOVES_ROOT="${PMOVES_ROOT:-$(git rev-parse --show-toplevel)}"
docker compose -f "${PMOVES_ROOT}/pmoves/docker-compose.yml" restart channel-monitor
```

Always confirm before removing.
Loading