diff --git a/src/aipass/devpulse/README.md b/src/aipass/devpulse/README.md index 8892f095..c39324d7 100644 --- a/src/aipass/devpulse/README.md +++ b/src/aipass/devpulse/README.md @@ -3,17 +3,21 @@ **Purpose:** Orchestration hub for AIPass public repo. Manages dev notes, DPLANs, system status dashboards. The DEV_CENTRAL of AIPass. **Module:** `aipass.devpulse` **Created:** 2026-03-06 +**Last Updated:** 2026-03-06 --- ## Overview ### What I Do - +- Coordinate work across all 10 AIPass modules +- Track system health via seedgo audits and recon reports +- Manage DPLANs and development notes +- Test and wire modules in Docker container environment ### How I Work -- **Entry Point:** `apps/devpulse.py` -- **Pattern:** Auto-discovers and routes to modules +- **Entry Point:** `apps/branch.py` +- **Pattern:** Auto-discovers modules in `apps/modules/` with `handle_command()` and routes commands --- @@ -22,15 +26,25 @@ ``` DEVPULSE/ ├── apps/ -│ ├── devpulse.py # Entry point -│ ├── modules/ # Business logic -│ ├── handlers/ # Implementation -│ └── plugins/ # Extensions +│ ├── branch.py # Entry point (auto-discovery + routing) +│ ├── modules/ # Business logic (empty, building out) +│ ├── handlers/ # Implementation +│ └── plugins/ # Extensions +├── .trinity/ +│ ├── passport.json # Identity +│ ├── local.json # Session history +│ └── observations.json # Collaboration patterns +├── .agent/ # System metadata +├── .aipass/ # Branch prompt context +├── artifacts/ # Birth certificate ├── docs/ +│ └── sub_agent_drops/ # Recon reports from sub-agents +├── tools/ +│ └── verify_branch.py # Template verification +├── devpulse_json/ # Branch JSON storage ├── tests/ -├── passport.json # Identity -├── local.json # Session history -├── observations.json # Collaboration patterns +├── DASHBOARD.local.json # System status +├── flow.local.md # Issues and todos └── README.md ``` @@ -38,14 +52,16 @@ DEVPULSE/ ## Commands -*Configure after initialization* +*No modules built yet — commands will be added as modules are created.* --- ## Integration Points ### Depends On - +- `aipass.prax` — Logger +- `aipass.cli` — Display formatting +- `aipass.seedgo` — Standards auditing ### Provides To - +- All modules — orchestration coordination, system health tracking diff --git a/src/aipass/devpulse/devpulse_json/.gitkeep b/src/aipass/devpulse/devpulse_json/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/aipass/devpulse/docs/.gitkeep b/src/aipass/devpulse/docs/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/src/aipass/devpulse/docs/sub_agent_drops/ai_mail_recon.md b/src/aipass/devpulse/docs/sub_agent_drops/ai_mail_recon.md new file mode 100644 index 00000000..1ad2c5ef --- /dev/null +++ b/src/aipass/devpulse/docs/sub_agent_drops/ai_mail_recon.md @@ -0,0 +1,56 @@ +# AI Mail Module Recon +**Date:** 2026-03-06 + +## Summary +Inter-agent communication system. Well-architected but CRITICAL path debt (34 Path.home() hits). + +## Structure +``` +ai_mail/ +├── apps/ +│ ├── ai_mail.py # Entry point (auto-discovers modules) +│ ├── modules/ +│ │ ├── email.py # Email workflow: send, inbox, view, reply, close, contacts +│ │ ├── dispatch.py # Agent spawn: dispatch status, daemon, wake +│ │ └── branch_ping.py # Memory health: ping, status, registry, thresholds +│ ├── handlers/ +│ │ ├── email/ # delivery, inbox, format, lock_utils, purge, dashboard_sync +│ │ ├── dispatch/ # daemon, wake, status, pending_work +│ │ ├── registry/ # read, update, validate +│ │ ├── users/ # user detection, config, branch_detection +│ │ ├── persistence/ # json_ops, logging +│ │ ├── monitoring/ # errors, memory health +│ │ ├── central_writer/ # System-wide stats aggregation +│ │ ├── json/ # json_handler.py +│ │ └── json_utils/ # DUPLICATE json_handler.py +│ ├── plugins/ +│ └── json_templates/ +└── tests/ # Empty (conftest.py only) +``` + +## Path.home() Debt: 34 instances (CRITICAL) +Key offenders: +- email.py:43 — `AIPASS_ROOT = Path.home() / "aipass_core"` +- central_writer.py:54-57 — 4 instances (AI_CENTRAL_DIR, BRANCH_REGISTRY) +- dispatch/daemon.py — 4 instances +- dispatch/wake.py — 3 instances +- email/delivery.py:71 — hardcoded `Path("/home/aipass/BRANCH_REGISTRY.json")` +- registry/read.py:41 — hardcoded `Path("/home/aipass/BRANCH_REGISTRY.json")` +- 20+ files with hardcoded shebangs + +## Integration Points +- Depends on: prax (logger), cli (console), trigger (events), spawn (agent spawning) +- Provides: inter-agent email, dispatch daemon, dashboard updates + +## Working +- Email creation, formatting, send/inbox/reply/close workflows +- Dispatch system, daemon spawning, wake command +- Registry integration, branch detection +- Dashboard sync + +## Broken +- 34 Path.home() instances block portability +- No .trinity files +- No tests +- Duplicate json handlers (json/ AND json_utils/) +- Hardcoded /home/aipass in delivery.py and registry/read.py diff --git a/src/aipass/devpulse/docs/sub_agent_drops/api_recon.md b/src/aipass/devpulse/docs/sub_agent_drops/api_recon.md new file mode 100644 index 00000000..673d8e8f --- /dev/null +++ b/src/aipass/devpulse/docs/sub_agent_drops/api_recon.md @@ -0,0 +1,60 @@ +# API Module Recon +**Date:** 2026-03-06 + +## Summary +LLM access and Telegram multi-bot system. **Heaviest path debt** (31 Path.home()). 46 Python files. + +## Structure +``` +api/ +├── apps/ +│ ├── api.py # Entry point (auto-discovers modules) +│ ├── modules/ +│ │ ├── api_key.py # Key retrieval, validation +│ │ ├── openrouter_client.py # LLM API calls, model listing +│ │ ├── telegram_bot.py # Multi-bot management (PUBLIC) +│ │ ├── telegram_service.py # Systemd service control +│ │ └── usage_tracker.py # Cost tracking +│ ├── handlers/ +│ │ ├── auth/ # Key management, .env fallback +│ │ ├── config/ # Configuration +│ │ ├── openrouter/ # OpenRouter client + retry +│ │ ├── telegram/ # 12 files (BaseBot, factory, registry, plugins) +│ │ ├── telegram_service/ # Service control +│ │ ├── usage/ # Usage tracking +│ │ └── json/ # JSON tracking +│ └── json_templates/ +└── tests/ # Empty +``` + +## Commands +``` +drone @api get-key|validate|test|models +drone @api track|stats +drone @api telegram start|stop|status|logs +drone @api telegram_bot list|create|delete|status|start|stop +``` + +## Path.home() Debt: 31 instances (CRITICAL) +**Telegram handlers (23/31):** +- base_bot.py — 7 hits +- bot_factory.py — 5 hits +- config.py — 2 hits +- branch_plugin.py, response_router.py, notifier.py, tmux_manager.py, botfather_client.py + +**Other:** +- json_handler.py:29 — `API_ROOT = Path.home() / "aipass_core" / "api"` (import-time) +- log_streamer.py:54 — `SYSTEM_LOGS_DIR = Path("/home/aipass/system_logs")` (CRITICAL, import-time) +- auth/env.py:54, telegram_service/service.py:26 + +## Key Insight +23 of 31 Path.home() issues are in **Telegram handlers** — this is Dev-Pass infrastructure. DPLAN-047 recommends stripping it for v1.0 (Option B). + +## Disabled Legacy Files +- `spawner.py(disabled)` — old Claude session spawner +- `output_parser.py(disabled)` — old JSON stream parser + +## Notes +- Entry point is `api.py` not `branch.py` (naming deviation) +- No .trinity files, no tests +- OpenRouter integration is stdlib-only BaseBot (no python-telegram-bot dep) diff --git a/src/aipass/devpulse/docs/sub_agent_drops/claude_config_recon.md b/src/aipass/devpulse/docs/sub_agent_drops/claude_config_recon.md new file mode 100644 index 00000000..4d99e0b5 --- /dev/null +++ b/src/aipass/devpulse/docs/sub_agent_drops/claude_config_recon.md @@ -0,0 +1,36 @@ +# Claude Code Config Recon +**Date:** 2026-03-06 + +## Hooks Active + +### UserPromptSubmit — branch_prompt_loader.py +- Walks up from CWD looking for `.trinity/` or `apps/` to find branch root +- Loads `.aipass/branch_system_prompt.md` or `.aipass/aipass_local_prompt.md` +- Only DevPulse currently has a prompt file + +### PreToolUse — tool_use_sound.py +- Plays ATM key press sound on Bash/Edit/Read/Grep/Glob/Write/etc. +- Sound files NOT present — silent fallback + +### Stop — stop_sound.py +- Plays achievement bell when AI finishes +- Sound files NOT present — silent fallback + +### Notification — notification_sound.py +- Plays announce tone on permission requests +- Sound files NOT present — silent fallback + +## Module Settings +All 10 modules have `.claude/settings.local.json` with empty permissions. No module-specific config. + +## Prompt Architecture +- **Global prompt:** Not present (hook would load `aipass_global_prompt.md` if it existed) +- **Branch prompts:** Only DevPulse has one (`.aipass/aipass_local_prompt.md`) +- **Branch discovery:** Looks for `.trinity/` or `apps/` directory to identify branch root + +## Commands +- `.claude/commands/memo.md` — Guidance for updating .trinity memory files after work + +## Permissions +- Default mode: acceptEdits +- Denied: git reset, rebase, config, force push, EnterPlanMode diff --git a/src/aipass/devpulse/docs/sub_agent_drops/cli_recon.md b/src/aipass/devpulse/docs/sub_agent_drops/cli_recon.md new file mode 100644 index 00000000..a2c32379 --- /dev/null +++ b/src/aipass/devpulse/docs/sub_agent_drops/cli_recon.md @@ -0,0 +1,45 @@ +# CLI Module Recon +**Date:** 2026-03-06 + +## Summary +Display/formatting service provider using Rich. Clean public API. LOW path debt. + +## Structure +``` +cli/ +├── apps/ +│ ├── cli.py # Entry point - showroom & help (v0.2.0) +│ ├── modules/ +│ │ ├── display.py # header(), success(), error(), warning(), section() (v0.4.0) +│ │ └── templates.py # operation_start(), operation_complete() (v0.3.0) +│ ├── handlers/ +│ │ ├── json/json_handler.py # JSON auto-create (PATH.HOME BUG) +│ │ └── templates/ # Empty +│ ├── extensions/ # Stub +│ └── plugins/ # Stub +├── __init__.py # Exports: console, header, success, error, warning, section, operation_start, operation_complete +├── .seed/bypass.json +└── tests/ +``` + +## Public API +```python +from aipass.cli import console, header, success, error, warning, section +from aipass.cli import operation_start, operation_complete +``` + +## Path.home() Debt +- `json_handler.py:27-29` — `CLI_ROOT = Path.home() / "aipass_core" / "cli"` (CRITICAL) +- 8 files with hardcoded shebang `#!/home/aipass/.venv/bin/python3` + +## Working +- Display module with Rich integration +- Templates module with operation patterns +- Handler guard system (cross-branch import protection) +- SEED pattern implementation (introspection, help, demo) + +## Broken +- json_handler.py Path.home() — wrong paths in container +- No .trinity files +- No .aipass branch prompt +- Extensions/plugins empty diff --git a/src/aipass/devpulse/docs/sub_agent_drops/cli_test_results.md b/src/aipass/devpulse/docs/sub_agent_drops/cli_test_results.md new file mode 100644 index 00000000..a92a6cee --- /dev/null +++ b/src/aipass/devpulse/docs/sub_agent_drops/cli_test_results.md @@ -0,0 +1,165 @@ +# CLI Test Results + +**Date:** 2026-03-06 +**Agent:** DevPulse sub-agent +**Environment:** Linux 6.12.72-linuxkit, Python 3.11, aipass 1.0.0 + +--- + +## Test 1: `pip install -e .` + +**Result: PASS (with workaround)** + +Initial attempt failed with `error: externally-managed-environment` (PEP 668). Succeeded with `--break-system-packages` flag. Package installed to `~/.local/` (user install). All dependencies resolved: rich 14.3.3, watchdog 6.0.0, markdown-it-py 4.0.0, pygments 2.19.2. + +**Warning:** The `drone` and `seedgo` scripts installed to `~/.local/bin` which is NOT on PATH by default. Must `export PATH="$HOME/.local/bin:$PATH"` before CLI commands work. + +--- + +## Test 2: `drone --help` + +**Result: PASS** + +Output: +``` +Drone - Command Router & Discovery + +Routes commands to AIPass branches and internal modules. + +Usage: + drone @target command [args] Route command to branch or module + drone @target --help Show help for branch or module + drone systems List registered branches and modules + drone --help Show this help + drone --version Show version + +Examples: + drone @seedgo audit aipass + drone @seedgo list + drone @flow status + drone systems +``` + +--- + +## Test 3: `drone systems` + +**Result: PASS** + +Output: +``` +Modules (2): + @drone Command routing and module discovery + @seedgo Standards compliance through pluggable standard packs + +Branches (10): + @ai_mail + @api + @cli + @devpulse + @drone + @flow + @prax + @seedgo + @spawn + @trigger +``` + +--- + +## Test 4: `drone @seedgo verify` + +**Result: PASS** + +Output: +``` +SEEDGO VERIFY + + Standards directory exists + 1 standard pack(s) installed: aipass + Pack 'aipass': valid manifest (v1.0.0, 20 standards) + Pack 'aipass': entry point exists + Pack 'aipass': all 20 standard check files present + + PASS 5/5 checks passed (100%) +``` + +--- + +## Test 5: `drone @seedgo list` + +**Result: PASS** + +Output: +``` + aipass (20 standards) +``` + +--- + +## Test 6: Registry import + +**Command:** `python3 -c "from aipass.drone.apps.modules.registry import load_registry; print(load_registry())"` + +**Result: PASS** + +Registry loaded successfully. Returns dict with metadata (version 1.0.0, 10 branches) and all 10 branch entries with correct paths under `/home/coder/workspace/src/aipass/`. + +--- + +## Test 7: Prax logger import + +**Command:** `python3 -c "from aipass.prax import logger; logger.info('test')"` + +**Result: PASS** + +No output and no errors. Logger imported and called without issue. Note: no visible output suggests the logger may not have a handler configured or the log level filtered it, but the import and call succeeded without exceptions. + +--- + +## Test 8: CLI console/header import + +**Command:** `python3 -c "from aipass.cli import console, header; header('test')"` + +**Result: PASS** + +Output rendered a Rich-formatted box: +``` ++------+ +| test | ++------+ +``` + +--- + +## Test 9: DevPulse branch import + +**Command:** `python3 -c "from aipass.devpulse.apps.branch import main"` + +**Result: PASS** + +Import succeeded with no output and no errors. + +--- + +## Summary + +| # | Test | Result | +|---|------|--------| +| 1 | `pip install -e .` | PASS (needs `--break-system-packages`) | +| 2 | `drone --help` | PASS | +| 3 | `drone systems` | PASS | +| 4 | `drone @seedgo verify` | PASS | +| 5 | `drone @seedgo list` | PASS | +| 6 | Registry import | PASS | +| 7 | Prax logger import | PASS | +| 8 | CLI console/header import | PASS | +| 9 | DevPulse branch import | PASS | + +**Overall: 9/9 PASS** + +### Notes + +1. **PATH issue:** `~/.local/bin` is not on PATH by default in this environment. The `drone` and `seedgo` CLI entry points install there. Any automation or CI must ensure PATH includes this directory. +2. **PEP 668:** The system Python is externally managed. `--break-system-packages` or a virtualenv is required. +3. **Prax logger:** Imports cleanly but `logger.info('test')` produces no visible output -- may need handler/level configuration review (not necessarily a bug, but worth noting). diff --git a/src/aipass/devpulse/docs/sub_agent_drops/drone_recon.md b/src/aipass/devpulse/docs/sub_agent_drops/drone_recon.md new file mode 100644 index 00000000..c957b2f6 --- /dev/null +++ b/src/aipass/devpulse/docs/sub_agent_drops/drone_recon.md @@ -0,0 +1,64 @@ +# Drone Module Recon +**Date:** 2026-03-06 + +## Summary +Command routing orchestrator. Fundamentally sound and working. LOW path debt. + +## Structure +``` +drone/ +├── apps/ +│ ├── drone.py # Main entry point (router orchestrator, v1.0.0) +│ ├── handlers/ +│ │ ├── executor.py # Safe subprocess execution (no shell=True) +│ │ └── exceptions.py # Custom exception hierarchy +│ ├── modules/ +│ │ ├── config.py # Registry path discovery (walk-up pattern) +│ │ ├── discovery.py # Branch/command discovery +│ │ ├── module_registry.py # Internal module registry (drone, seedgo) +│ │ ├── resolver.py # Symbolic name resolution +│ │ └── router.py # Command routing logic +│ └── plugins/ # Empty +├── cli.py # CLI entry point (pyproject.toml wired) +├── drone_adapter.py # Self-routing bridge (drone @drone) +├── __init__.py # Public API +└── tests/ +``` + +## Commands +``` +drone # Introspection +drone --help / --version # Help/version +drone systems # List all registered branches +drone @target command [args] # Route to branch or module +``` + +## Registry Discovery (config.py) +1. Explicit set via set_registry_path() +2. AIPASS_REGISTRY env var +3. Walk-up from drone package location +4. Walk-up from CWD +5. Fallback: ~/.aipass/AIPASS_REGISTRY.json + +## Internal Module Registry +```python +_MODULE_REGISTRY = { + "drone": "aipass.drone.drone_adapter", + "seedgo": "aipass.seedgo.drone_adapter" +} +``` + +## Path Debt +- cli.py:1 — hardcoded shebang +- tests/conftest.py:1 — hardcoded shebang +- config.py fallback: `Path.home() / ".aipass" / "AIPASS_REGISTRY.json"` (acceptable) + +## Working +- CLI entry, registry discovery, branch listing, module introspection +- Self-routing, help discovery, safe subprocess execution +- All imports use correct `from aipass.drone...` namespace + +## Broken +- Hardcoded shebangs +- No .trinity directory +- README incomplete diff --git a/src/aipass/devpulse/docs/sub_agent_drops/flow_recon.md b/src/aipass/devpulse/docs/sub_agent_drops/flow_recon.md new file mode 100644 index 00000000..3ba1180e --- /dev/null +++ b/src/aipass/devpulse/docs/sub_agent_drops/flow_recon.md @@ -0,0 +1,49 @@ +# Flow Module Recon +**Date:** 2026-03-06 + +## Summary +PLAN lifecycle management. Well-designed architecture but **incomplete** — missing infrastructure dirs. 15 Path.home() hits. + +## Structure +``` +flow/ +├── apps/ +│ ├── flow.py # Entry point (auto-discovery) +│ ├── modules/ # 8 modules +│ │ ├── create_plan.py # FPLAN creation (v1.0.0) +│ │ ├── close_plan.py # Plan closure with async archival (v3.4.0) +│ │ ├── list_plans.py # Plan listing +│ │ ├── restore_plan.py # Plan recovery (4 Path.home() hits) +│ │ ├── registry_monitor.py # Orphan detection (ECOSYSTEM_ROOT = Path("/home/aipass")) +│ │ ├── aggregate_central.py # Cross-branch aggregation +│ │ └── post_close_runner.py +│ ├── handlers/ # 11 categories +│ │ ├── plan/ # 16 files - lifecycle, file ops +│ │ ├── registry/ # 4 files - load, save, auto-heal +│ │ ├── template/ # 2 files - content, loading +│ │ ├── dashboard/ # 3 files - local, central, branch +│ │ ├── summary/ # write_plan_outputs.py (4 Path.home()) +│ │ └── mbank/, json/, config/, events/ +└── tests/ # Empty (conftest only) +``` + +## Plan Naming Convention +`FPLAN-XXXX_slug_YYYY-MM-DD.md` + +## Missing Infrastructure (BLOCKERS) +- `flow_json/` — needs `flow_registry.json` (plan registry) +- `templates/` — needs `default.md`, `master.md`, `proposal.md` +- `.trinity/` — no identity files + +## Path.home() Debt: 15 instances +- registry_monitor.py:83 — `ECOSYSTEM_ROOT = Path("/home/aipass")` (CRITICAL, import-time) +- write_plan_outputs.py:57,81,93,106,142 — CLAUDE.json, AI_CENTRAL paths +- restore_plan.py:159-184 — 4 hits in recovery logic +- push_central.py:54, push_branch_dashboard.py:69, aggregate_central.py:69 +- process.py:55,57 — MEMORY_BANK, PRIVATE_BRANCH_REGISTRY + +## Working (architecturally) +- Plan creation, closure with async archival +- Registry auto-healing and orphan detection +- Central aggregation, dashboard three-tier system +- Template content detection, trigger integration diff --git a/src/aipass/devpulse/docs/sub_agent_drops/path_home_audit.md b/src/aipass/devpulse/docs/sub_agent_drops/path_home_audit.md new file mode 100644 index 00000000..f6d5582e --- /dev/null +++ b/src/aipass/devpulse/docs/sub_agent_drops/path_home_audit.md @@ -0,0 +1,66 @@ +# Path.home() / /home/aipass Full Audit +**Date:** 2026-03-06 | Cross-referenced with DPLAN-047 + +## Executive Summary +- **4 CRITICAL** module-level hardcoded `/home/aipass` (import-time crash) +- **11 HIGH** module-level `Path.home()` bindings (import-time) +- **14+ MEDIUM** runtime function-level `Path.home()` usage +- **203 LOW** shebang references (cosmetic) +- **28+ LOW** docstring/comment references + +## CRITICAL — Import-Time Crashes (4 files) + +| File | Line | Binding | +|------|------|---------| +| ai_mail/apps/handlers/registry/read.py | 41 | `BRANCH_REGISTRY_PATH = Path("/home/aipass/BRANCH_REGISTRY.json")` | +| flow/apps/modules/registry_monitor.py | 83 | `ECOSYSTEM_ROOT = Path("/home/aipass")` | +| trigger/apps/handlers/events/plan_file.py | 42 | `ECOSYSTEM_ROOT = Path("/home/aipass")` | +| api/apps/handlers/telegram/log_streamer.py | 54 | `SYSTEM_LOGS_DIR = Path("/home/aipass/system_logs")` | + +## HIGH — Module-Level Path.home() (11 files) + +| File | Line | Binding | +|------|------|---------| +| trigger/apps/handlers/watchers/log_watcher.py | 44 | `AIPASS_HOME = Path.home()` | +| trigger/apps/handlers/log_watcher.py | 54 | `AIPASS_HOME = Path.home()` | +| trigger/apps/handlers/events/error_detected.py | 61 | `AIPASS_HOME = Path.home()` | +| trigger/apps/handlers/events/error_logged.py | 53 | `AIPASS_HOME = Path.home()` | +| trigger/apps/handlers/events/startup.py | 41 | `AIPASS_HOME = Path.home()` | +| trigger/apps/handlers/events/bulletin_created.py | 40 | `AIPASS_HOME = Path.home()` | +| trigger/apps/handlers/events/memory_template_updated.py | 37 | `AIPASS_HOME = Path.home()` | +| trigger/apps/handlers/events/memory_threshold_exceeded.py | 42 | `AIPASS_HOME = Path.home()` | +| prax/apps/handlers/monitoring/telegram_command_bot.py | 68 | `AIPASS_HOME = Path.home()` | +| ai_mail/apps/handlers/dispatch/wake.py | 46 | `AIPASS_HOME = Path.home()` | +| ai_mail/apps/handlers/dispatch/daemon.py | 54 | `AIPASS_HOME = Path.home()` | + +## MEDIUM — Runtime Function-Level (14+ files) + +Key offenders: +- flow/apps/handlers/summary/write_plan_outputs.py — 4 usages +- flow/apps/modules/restore_plan.py — 4 usages +- prax/apps/handlers/config/load.py:51 — SYSTEM_LOGS_DIR + mkdir at import +- prax/apps/handlers/monitoring/branch_detector.py:191 +- prax/apps/modules/monitor_module.py:597 +- api/apps/handlers/telegram/bot_factory.py:369 +- api/apps/handlers/telegram/response_router.py:228 +- ai_mail/apps/handlers/central_writer.py:54-57 — 4 instances +- ai_mail/apps/handlers/email/delivery.py:71 — hardcoded Path("/home/aipass/...") + +## Module Severity Summary + +| Module | CRITICAL | HIGH | MEDIUM | Shebangs | DPLAN-047 Match | +|--------|----------|------|--------|----------|-----------------| +| api | 1 | 0 | 2 | ~20 | Yes (inflated by docs) | +| ai_mail | 1 | 2 | 6 | ~20 | Yes | +| trigger | 1 | 7 | 0 | ~15 | Yes | +| prax | 0 | 1 | 3 | ~55 | Yes | +| flow | 1 | 0 | 8 | ~7 | Yes | +| seedgo | 0 | 0 | 0 | 1 | DONE | +| drone | 0 | 0 | 0 | 2 | LOW | +| cli | 0 | 0 | 1 | 8 | LOW | +| spawn | 0 | 0 | 0 | 2 | LOW | +| devpulse | 0 | 0 | 0 | 0 | DONE | + +## Safe to Import in Container +- drone, seedgo, cli, devpulse, spawn — no critical violations +- prax (top-level `from aipass.prax import logger`) — works due to lazy init diff --git a/src/aipass/devpulse/docs/sub_agent_drops/prax_recon.md b/src/aipass/devpulse/docs/sub_agent_drops/prax_recon.md new file mode 100644 index 00000000..09af9460 --- /dev/null +++ b/src/aipass/devpulse/docs/sub_agent_drops/prax_recon.md @@ -0,0 +1,56 @@ +# Prax Module Recon +**Date:** 2026-03-06 + +## Summary +Logging and monitoring system. **Import works** (lazy init). 15 Path.home() hits, 4 at import-time. 71 Python files. + +## Public API +```python +from aipass.prax import logger # SystemLogger instance +logger.info("message") # Auto-routes to calling module's log file +``` + +## Structure +``` +prax/ +├── __init__.py # Exports: system_logger as logger +├── apps/ +│ ├── prax.py # Entry point (202 lines) +│ ├── modules/ +│ │ ├── logger.py # SystemLogger class (268 lines) - THE public API +│ │ ├── init_module.py # Initialize logging +│ │ ├── shutdown_module.py +│ │ ├── monitor_module.py # Mission Control (595 lines) +│ │ ├── status_module.py # System status display +│ │ └── 5 more modules +│ ├── handlers/ # 52 files +│ │ ├── logging/ # 12 files - setup, direct, terminal, rotation +│ │ ├── monitoring/ # 14 files - events, telegram, branch detection +│ │ ├── discovery/ # 3 files - module scanning +│ │ ├── registry/ # 7 files - branch registry +│ │ ├── config/ # 2 files - load.py (CRITICAL) +│ │ ├── json/ # 5 files +│ │ └── watcher/, dashboard/ +└── tests/ +``` + +## Path.home() Debt: 15 instances +**Import-time (CRITICAL):** +- config/load.py:51 — `SYSTEM_LOGS_DIR = Path.home() / "system_logs"` + mkdir at line 55 +- log_watchdog.py:44 — SYSTEM_LOGS_DIR at import time +- agent_status_writer.py:45 — BRANCH_REGISTRY at import time +- registry/reader.py:34 — BRANCH_REGISTRY_PATH at import time + +**Function-level:** +- monitoring/branch_detector.py:58, 191 +- monitoring/telegram_command_bot.py:68 (module-level) +- monitor_module.py:161, 597 +- logging/setup.py:125, direct.py:144 + +## Key Finding +`from aipass.prax import logger` **works** because logger.py uses lazy init. But deeper imports into handlers (config/load.py) crash due to Path.home() mkdir at import time. + +## Note +- Circular dependency with CLI properly handled (logger doesn't import CLI) +- File watcher has try/except for inotify limit (graceful degradation) +- `logger.info('test')` produces no visible terminal output (may need config check) diff --git a/src/aipass/devpulse/docs/sub_agent_drops/repo_root_recon.md b/src/aipass/devpulse/docs/sub_agent_drops/repo_root_recon.md new file mode 100644 index 00000000..0b59682a --- /dev/null +++ b/src/aipass/devpulse/docs/sub_agent_drops/repo_root_recon.md @@ -0,0 +1,45 @@ +# Repo Root Recon +**Date:** 2026-03-06 + +## Summary +Well-structured Python package repo with 10 modules, Hatchling build, GitHub Actions CI. + +## Key Files +- `AIPASS_REGISTRY.json` — 10 branches, all active, all at `src/aipass/{module}` +- `pyproject.toml` — aipass v1.0.0, Python >=3.10, Hatchling build +- `CLAUDE.md` — Agent startup protocol +- `Dockerfile` — codercom/code-server base, Python 3.x, isolated venv +- `DPLAN-047_...md` — Critical path purge plan + +## pyproject.toml Details +``` +[project] +name = "aipass", version = "1.0.0", python = ">=3.10" +dependencies = ["rich >= 13.0", "watchdog >= 3.0"] + +[project.scripts] +drone = "aipass.drone.cli:main" +seedgo = "seedgo.cli:main" + +[tool.hatch.build.targets.wheel] +packages = ["src/aipass", "src/seedgo"] +``` + +## CI Pipeline (.github/workflows/ci.yml) +- Python 3.10, 3.11, 3.12, 3.13 +- Steps: ruff check, pytest + +## AIPASS_REGISTRY.json +All 10 modules registered: ai_mail, api, cli, devpulse, drone, flow, prax, seedgo, spawn, trigger. +All status: active. All profile: library. + +## Claude Config (.claude/) +- settings.json: acceptEdits mode, denies git reset/rebase/force-push +- Hooks: prompt loader, tool sounds, notification sounds, stop sounds +- branch_prompt_loader.py: discovers branch root via .trinity/ or apps/, loads .aipass/ prompts +- Sound files referenced but not present (graceful fallback) + +## Notes +- No root-level tests/ (tests live in each module) +- No global aipass_global_prompt.md exists yet (hook would load it if present) +- `your` — empty file at root (cleanup candidate) diff --git a/src/aipass/devpulse/docs/sub_agent_drops/seedgo_recon.md b/src/aipass/devpulse/docs/sub_agent_drops/seedgo_recon.md new file mode 100644 index 00000000..4842b8fe --- /dev/null +++ b/src/aipass/devpulse/docs/sub_agent_drops/seedgo_recon.md @@ -0,0 +1,51 @@ +# Seedgo Module Recon +**Date:** 2026-03-06 + +## Summary +Standards compliance platform with pluggable packs. 20 AIPass standards defined. Path debt: DONE (runtime clean). Two pyproject.toml issues. + +## Structure +``` +seedgo/ +├── apps/ +│ ├── seedgo.py # Entry point (pack discovery + routing) +│ ├── modules/ +│ │ └── seedgo_verify.py # Self-verification (5 checks) +│ ├── handlers/ # Empty at root (handlers live in packs) +│ └── standards/ +│ ├── aipass/ # Main pack (20 standards) +│ │ ├── pack.json # Pack manifest +│ │ ├── pack_entry.py # Pack orchestrator +│ │ ├── modules/ # Audit, verify, list +│ │ ├── handlers/ # Checkers per standard +│ │ └── standards/ # Standard definitions (JSON) +│ ├── app_development.example/ +│ └── website_design.example/ +├── drone_adapter.py # Drone integration +├── cli.py # CLI entry point +└── tests/ +``` + +## Commands +``` +drone @seedgo verify # 5/5 self-checks (WORKING) +drone @seedgo list # Shows installed packs (WORKING) +drone @seedgo audit aipass # Audit repo against standards +``` + +## 20 AIPass Standards +Architecture, CLI, imports, handlers, modules, documentation, testing, logging, meta headers, error handling, JSON structure, naming, permissions, diagnostics, trigger patterns, and more. + +## Path Debt: DONE +- No Path.home() in runtime code +- Shebang in conftest.py: `#!/home/aipass/.venv/bin/python3` (cosmetic) +- Help text references `/home/aipass/standards/...` (display only) + +## Critical Issues +1. **pyproject.toml:** `seedgo = "seedgo.cli:main"` points to non-existent module (should be `aipass.seedgo...`) +2. **pyproject.toml:** packages includes `"src/seedgo"` which doesn't exist + +## Working +- Pack discovery, module auto-discovery, verify (5/5), list, drone adapter +- Standards documentation (20 defined) +- Bypass rules system (.seed/bypass.json) diff --git a/src/aipass/devpulse/docs/sub_agent_drops/spawn_recon.md b/src/aipass/devpulse/docs/sub_agent_drops/spawn_recon.md new file mode 100644 index 00000000..7ac15dd9 --- /dev/null +++ b/src/aipass/devpulse/docs/sub_agent_drops/spawn_recon.md @@ -0,0 +1,44 @@ +# Spawn Module Recon +**Date:** 2026-03-06 + +## Summary +Agent creation utility library. Flat structure (not 3-layer — it's infrastructure, not an agent). Well-designed, stable. + +## Structure +``` +spawn/ +├── spawn.py # Main engine (210 lines, 7-step spawn) +├── file_ops.py # Template copy + path manipulation +├── placeholders.py # {{PLACEHOLDER}} replacement +├── metadata.py # Branch name extraction +├── registry.py # AIPASS_REGISTRY.json CRUD +├── __init__.py # Single export: spawn_agent +├── templates/ +│ ├── agent.template/ # Base template (full agent skeleton) +│ └── agent_mock_branch/ # Reference spawned agent +└── tests/ + └── test_spawn.py # 126 lines, covers full spawn lifecycle +``` + +## How spawn_agent() Works (7 Steps) +1. Validate target doesn't exist +2. Extract branch name from path +3. Get next citizen number from registry +4. Build placeholder mapping (14 variables) +5. Copy template recursively, replacing placeholders +6. Rename `{{BRANCH}}_*` directories +7. Update AIPASS_REGISTRY.json + +## Placeholder Variables +`{{BRANCHNAME}}` (UPPER), `{{branchname}}` (lower), `{{BRANCH}}` (module name), `{{CWD}}`, `{{DATE}}`, `{{MODULE}}`, `{{EMAIL}}`, `{{PROFILE}}`, `{{ROLE}}`, `{{TRAITS}}`, `{{PURPOSE_BRIEF}}`, `{{CITIZEN_NUMBER}}`, `{{KEY_CAPABILITIES}}`, `{{DEPENDS_ON}}`, `{{PROVIDES_TO}}` + +## Path Debt +- No Path.home() in spawn code +- Template conftest.py has hardcoded shebang (propagates to all spawned agents) +- Template branch.py has relative import bug (propagates to all spawned agents) + +## Notes +- Flat structure is intentional — spawn is a utility, not an autonomous agent +- No .trinity files (by design) +- Has actual tests (only module with test_*.py files) +- Skip list: `__pycache__`, `.git`, `.template_registry.json`, `.gitkeep` diff --git a/src/aipass/devpulse/docs/sub_agent_drops/spawn_templates_recon.md b/src/aipass/devpulse/docs/sub_agent_drops/spawn_templates_recon.md new file mode 100644 index 00000000..822d13a6 --- /dev/null +++ b/src/aipass/devpulse/docs/sub_agent_drops/spawn_templates_recon.md @@ -0,0 +1,63 @@ +# Spawn Templates Recon +**Date:** 2026-03-06 + +## Templates Available +1. `agent.template/` — Base agent skeleton +2. `agent_mock_branch/` — Reference implementation (fully spawned example) + +## agent.template Structure +``` +agent.template/ +├── .agent/ # System metadata +│ ├── .migrations.json # Structural migration rules +│ ├── .backup_ignore.json # Backup exclusion patterns +│ ├── .registry_ignore.json # Template update exclusions +│ └── .template_registry.json # File tracking with SHA hashes +├── .aipass/ +│ └── aipass_local_prompt.md # Branch prompt (needs config) +├── .trinity/ +│ ├── passport.json # Identity ({{BRANCHNAME}}, {{ROLE}}, etc.) +│ ├── local.json # Session history +│ └── observations.json # Collaboration patterns +├── .archive/.gitkeep +├── .claude/settings.local.json +├── apps/ +│ ├── branch.py # Entry point (auto-discovery + routing) +│ ├── modules/__init__.py # Empty (agent builds its own) +│ ├── handlers/__init__.py +│ ├── plugins/__init__.py +│ └── extensions/__init__.py # (not in devpulse) +├── artifacts/ +│ └── birth_certificate.json # Citizenship record +├── docs/.gitkeep +├── tests/conftest.py, __init__.py +├── tools/verify_branch.py # Template verification +├── {{BRANCH}}_json/.gitkeep # Renamed on spawn +├── DASHBOARD.local.json +├── flow.local.md +├── README.md +├── pytest.ini +└── .gitignore +``` + +## DevPulse vs Template Comparison + +| Item | Template | DevPulse | Status | +|------|----------|----------|--------| +| .trinity/ | Yes | Yes | Done | +| .agent/ | Yes | Yes | Done | +| .aipass/ | Yes | Yes | Done | +| artifacts/ | Yes | Yes | Done | +| tools/verify_branch.py | Yes | Yes (fixed Path.home) | Done | +| docs/ | Yes | Yes | Done | +| {{BRANCH}}_json/ | Yes | devpulse_json/ | Done | +| .archive/ | Yes | Yes | Done | +| DASHBOARD.local.json | Yes | Yes | Done | +| flow.local.md | Yes | Yes | Done | +| apps/extensions/ | Yes | No | Missing | +| apps/json_templates/ | Yes | No | Missing (optional) | + +## Template Issues +- branch.py:35 uses relative import `apps.modules.{stem}` (propagates to all agents) +- conftest.py has hardcoded `/home/aipass/` shebang (propagates) +- modules/ dir is intentionally empty (agents build their own) diff --git a/src/aipass/devpulse/docs/sub_agent_drops/trigger_recon.md b/src/aipass/devpulse/docs/sub_agent_drops/trigger_recon.md new file mode 100644 index 00000000..6e0ff4eb --- /dev/null +++ b/src/aipass/devpulse/docs/sub_agent_drops/trigger_recon.md @@ -0,0 +1,58 @@ +# Trigger Module Recon +**Date:** 2026-03-06 + +## Summary +Event orchestration hub with error management. 34 Python files. Operational but 1 hardcoded path + many Path.home() hits. + +## Structure +``` +trigger/ +├── apps/ +│ ├── trigger.py # Entry point (auto-discovery) +│ ├── config.py # TRIGGER_ROOT, AIPASS_PKG_ROOT +│ ├── modules/ +│ │ ├── core.py # Event bus (Trigger class: fire/on/off) +│ │ ├── errors.py # Error registry management +│ │ ├── medic.py # Medic toggle (on/off/mute/unmute) +│ │ ├── branch_log_events.py # Branch log watcher +│ │ └── log_events.py # System log watcher +│ ├── handlers/ +│ │ ├── error_registry.py # Fingerprinting, circuit breaker, rate limiting +│ │ ├── medic_state.py # Medic config persistence +│ │ ├── log_watcher.py # Log monitoring +│ │ ├── watchers/ # Watchdog file monitoring +│ │ ├── events/ # 12 event handlers +│ │ │ ├── registry.py # Central handler registration +│ │ │ ├── error_detected.py # Medic v2 error dispatch +│ │ │ ├── error_logged.py # DEPRECATED legacy handler +│ │ │ └── startup, cli, memory, plan_file, bulletin, warning +│ │ └── json/ +├── trigger_json/ +│ └── trigger_data.json # Error catchup state (MODIFIED, unstaged) +└── tests/ # Empty +``` + +## Key Features +- **Event Bus:** Deferred queue prevents recursion during nested events +- **Medic v2:** Circuit breaker (closed/open/half_open) + exponential backoff per error fingerprint +- **Error Registry:** SHA1 fingerprinting, dedup, rate limiting, dispatch gating +- **Auto-healing:** Dispatches fix-it emails via AI_Mail when errors detected + +## Commands +``` +drone @trigger errors list|detail|suppress|resolve|stats|circuit-breaker +drone @trigger medic on|off|status|mute|unmute +``` + +## Path Debt +- **CRITICAL:** `plan_file.py:42` — `ECOSYSTEM_ROOT = Path("/home/aipass")` (hardcoded) +- **HIGH:** 8+ event handlers use `AIPASS_HOME = Path.home()` at module level +- Shebang debt across all files + +## Modified File +`trigger_data.json` — error catchup state with 7 processed hashes, indicates active error processing from Dev-Pass side + +## Notes +- Inotify exhaustion issue documented and resolved (lazy-start disabled) +- error_logged.py DEPRECATED but kept for backward compat +- Handlers can't import Prax logger directly (causes event recursion) — use get_direct_logger() diff --git a/src/aipass/devpulse/docs/sub_agent_drops/trinity_census.md b/src/aipass/devpulse/docs/sub_agent_drops/trinity_census.md new file mode 100644 index 00000000..fec3209f --- /dev/null +++ b/src/aipass/devpulse/docs/sub_agent_drops/trinity_census.md @@ -0,0 +1,37 @@ +# Trinity Census — AIPass Agent Registry +**Date:** 2026-03-06 | **Surveyed by:** DevPulse sub-agent + +## Summary +**1 of 10 modules** has .trinity files (is "alive" as an agent). + +## Active Agents + +### DEVPULSE (alias: "dapfels") +- **Status:** Active +- **Location:** `src/aipass/devpulse/` +- **Module:** `aipass.devpulse` +- **Role:** orchestration_hub +- **Created:** 2026-03-06 +- **Trinity files:** passport.json, local.json, observations.json — all present and healthy +- **DASHBOARD.local.json:** present +- **artifacts/birth_certificate.json:** present (ID: DEVPULSE-001) +- **Session count:** 1 (active) + +## Modules Without .trinity (Not Yet "Born") + +| Module | Location | Notes | +|--------|----------|-------| +| drone | `src/aipass/drone/` | No .trinity | +| seedgo | `src/aipass/seedgo/` | No .trinity | +| prax | `src/aipass/prax/` | No .trinity | +| cli | `src/aipass/cli/` | No .trinity | +| flow | `src/aipass/flow/` | No .trinity | +| ai_mail | `src/aipass/ai_mail/` | No .trinity | +| api | `src/aipass/api/` | No .trinity | +| trigger | `src/aipass/trigger/` | No .trinity | +| spawn | `src/aipass/spawn/` | No .trinity (but has templates for creating them) | + +## Notes +- The spawn module has `agent.template/` with .trinity scaffolds ready for new agents +- Also has `agent_mock_branch/` with example trinity files +- On the Dev-Pass side, all 30+ agents are alive with full .trinity — this repo just needs them initialized diff --git a/src/aipass/trigger/trigger_json/trigger_data.json b/src/aipass/trigger/trigger_json/trigger_data.json index 51887e5b..4af9c15b 100644 --- a/src/aipass/trigger/trigger_json/trigger_data.json +++ b/src/aipass/trigger/trigger_json/trigger_data.json @@ -1,14 +1,14 @@ { "error_catchup": { - "last_scan_timestamp": "2026-03-06T10:29:15.745037", + "last_scan_timestamp": "2026-03-06T11:35:03.559262", "processed_hashes": [ - "c7edc03b", - "68dd0ab6", - "02d93909", "4095ef97", - "ace01637", + "02d93909", + "69de737b", "541e0b9b", - "69de737b" + "ace01637", + "c7edc03b", + "68dd0ab6" ], "max_hashes": 500, "max_lookback_hours": 24