FPLAN-0410 repo cleanup + integration test bug fixes
VERA cleanup (FPLAN-0410): - Remove all /home/aipass hardcoded paths (portability) - Remove internal Telegram bot code from public repo (6k+ lines) - Remove runtime logs, .claude/settings.local.json, stale files - Clean READMEs across all branches - Restructure spawn handlers into proper 3-layer architecture - Add __init__.py files for proper package imports - Update seedgo standards for public repo context - Add log_structure standard to seedgo Integration test bug fixes: - Fix double @@ display in drone introspection output - Fix spawn registry resolving to wrong file (walk up from package root) - Fix email sender identity always showing as @ai_mail (pass AIPASS_CALLER_CWD) - Fix branch_detection.py relative path resolution against CWD instead of registry dir - Add .trinity/passport.json detection for spawned agents - Archive duplicate json_ops.py, update imports to canonical json_handler - Update .gitignore for runtime logs and .claude/ dirs Tested end-to-end in Docker container (aipass-test:latest): - Spawn → register → send email → receive → reply all verified working Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
a59f9c006b
commit
3b45824dc6
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"permissions": {
|
||||
"allow": [],
|
||||
"deny": [],
|
||||
"ask": []
|
||||
},
|
||||
"enabledMcpjsonServers": []
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"metadata": {
|
||||
"version": "1.0.0",
|
||||
"created": "2026-03-06T03:16:10.906535",
|
||||
"created": "2026-03-06T14:27:34.810230",
|
||||
"description": "Standards bypass configuration for this branch"
|
||||
},
|
||||
"bypass": [],
|
||||
|
||||
+35
-36
@@ -1,51 +1,50 @@
|
||||
# CLI
|
||||
|
||||
**Purpose:** Terminal display formatting - headers, success, error, warning helpers
|
||||
**Module:** `aipass.cli`
|
||||
**Created:** 2026-03-05
|
||||
Display and output formatting service for AIPass modules. Provides consistent terminal output — headers, success/error/warning messages, section breaks, and operation templates — so every module looks the same without duplicating Rich formatting code.
|
||||
|
||||
---
|
||||
## Usage
|
||||
|
||||
## Overview
|
||||
```python
|
||||
from aipass.cli import header, success, error, warning, section
|
||||
|
||||
### What I Do
|
||||
header("Creating Branch", {"Name": "feature", "Type": "module"})
|
||||
success("Files created", items=12, time="2.3s")
|
||||
error("Path not found", suggestion="Check spelling")
|
||||
warning("Config missing, using defaults")
|
||||
section("Results")
|
||||
```
|
||||
|
||||
### Operation Templates
|
||||
|
||||
### How I Work
|
||||
- **Entry Point:** `apps/cli.py`
|
||||
- **Pattern:** Auto-discovers and routes to modules
|
||||
```python
|
||||
from aipass.cli import operation_start, operation_complete
|
||||
|
||||
---
|
||||
operation_start("Processing", count=10)
|
||||
# ... do work ...
|
||||
operation_complete(created=5, skipped=3, failed=0)
|
||||
```
|
||||
|
||||
### Direct Console Access
|
||||
|
||||
```python
|
||||
from aipass.cli import console
|
||||
|
||||
console.print("[bold cyan]Custom Rich output[/bold cyan]")
|
||||
```
|
||||
|
||||
## Architecture
|
||||
|
||||
```
|
||||
CLI/
|
||||
cli/
|
||||
├── apps/
|
||||
│ ├── cli.py # Entry point
|
||||
│ ├── modules/ # Business logic
|
||||
│ ├── handlers/ # Implementation
|
||||
│ └── plugins/ # Extensions
|
||||
├── docs/
|
||||
├── tests/
|
||||
├── passport.json # Identity
|
||||
├── local.json # Session history
|
||||
├── observations.json # Collaboration patterns
|
||||
└── README.md
|
||||
│ ├── cli.py # Entry point
|
||||
│ ├── modules/
|
||||
│ │ ├── display.py # header, success, error, warning, section
|
||||
│ │ └── templates.py # operation_start, operation_complete
|
||||
│ └── handlers/
|
||||
│ └── json/ # JSON file management
|
||||
└── tests/
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Commands
|
||||
|
||||
*Configure after initialization*
|
||||
|
||||
---
|
||||
|
||||
## Integration Points
|
||||
|
||||
### Depends On
|
||||
|
||||
|
||||
### Provides To
|
||||
|
||||
- `apps/modules/` — Public API. Import from here.
|
||||
- `apps/handlers/` — Internal implementation. Don't import directly.
|
||||
|
||||
@@ -64,7 +64,7 @@ def _find_real_caller():
|
||||
|
||||
def _extract_branch_name(filepath: str) -> str:
|
||||
"""Extract branch name from a file path."""
|
||||
parts = filepath.split("/")
|
||||
parts = Path(filepath).parts
|
||||
for i, part in enumerate(parts):
|
||||
if part == "aipass":
|
||||
if i + 1 < len(parts):
|
||||
|
||||
@@ -15,15 +15,27 @@
|
||||
# - No Prax imports (handler tier 3)
|
||||
# =============================================
|
||||
|
||||
"""JSON Auto-Creating Handler - manages CLI JSON files with templates and auto-rotation."""
|
||||
|
||||
import json
|
||||
from pathlib import Path
|
||||
from datetime import datetime
|
||||
from typing import Dict, List, Any, Optional
|
||||
import sys
|
||||
from typing import Dict, Any, Optional
|
||||
import inspect
|
||||
from aipass.prax.apps.modules.logger import system_logger as logger
|
||||
|
||||
# Constants — package-relative paths (portable across any machine)
|
||||
CLI_ROOT = Path(__file__).resolve().parents[3] # json_handler.py -> json -> handlers -> apps -> cli
|
||||
def _find_repo_root() -> Path:
|
||||
"""Walk up from this file to find the repo root (contains pyproject.toml or AIPASS_REGISTRY.json)."""
|
||||
current = Path(__file__).resolve().parent
|
||||
for parent in [current] + list(current.parents):
|
||||
if (parent / "pyproject.toml").exists() or (parent / "AIPASS_REGISTRY.json").exists():
|
||||
return parent
|
||||
return Path.cwd()
|
||||
|
||||
|
||||
# Constants — resolved via repo root walk-up (portable across any machine)
|
||||
_REPO_ROOT = _find_repo_root()
|
||||
CLI_ROOT = _REPO_ROOT / "src" / "aipass" / "cli"
|
||||
CLI_JSON_DIR = CLI_ROOT / "cli_json"
|
||||
JSON_TEMPLATES_DIR = CLI_ROOT / "apps" / "json_templates"
|
||||
|
||||
@@ -108,9 +120,8 @@ def ensure_json_exists(module_name: str, json_type: str) -> bool:
|
||||
if validate_json_structure(data, json_type):
|
||||
return True
|
||||
# If corrupted, fall through to regenerate
|
||||
except Exception:
|
||||
# If unreadable, fall through to regenerate
|
||||
pass
|
||||
except Exception as exc:
|
||||
logger.warning("JSON unreadable at %s, regenerating: %s", json_path, exc)
|
||||
|
||||
template = load_template(json_type, module_name)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user