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
@@ -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