feat(system): seedgo v2 operational, full system audit, 14/15 branches at 99%

Three days of intensive work bringing seedgo to full operational status
and driving all branches through comprehensive standards compliance.

Seedgo v2.0.0:
- 22 checkers active (up from 20), standards pack fully operational
- New introspection standard researched from Dev-Pass, FPLAN-0017 open
- Bypass system for false positives (.seedgo config)
- Standards query and audit commands fully functional

System-wide audit (FPLAN-0016):
- All 14 auditable branches at 99%+ compliance
- CLI imports standardized across all branches (console from cli.apps.modules)
- handle_command(command, args) → bool contract added to all modules
- print_help() function naming fixed for checker pattern matching
- Handler extraction: large modules split, file I/O moved to handler layer
- New handlers created across ai_mail, backup, daemon, flow, skills, spawn, seedgo

Branch-specific highlights:
- ai_mail: email.py split 840→420 lines, 4 new handlers
- flow: dplan_flow.py 688→591 lines, 4 new handlers
- seedgo: massive restructure — standards moved to handlers/aipass_standards/,
  old standards/ tree removed, bypass system added, diagnostics module
- commons: database module added, CLI imports fixed
- skills: 5 handle_commands added, help function renamed
- trigger: error reporter handler, handle_command routing
- All branches: consistent architecture, clean drone routing

Culture doc (CLAUDE.md) added — documents AIPass philosophy, identity,
memory system, and collaboration principles.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
AIOSAI
2026-03-10 01:26:42 -07:00
co-authored by Claude Opus 4.6
parent 09e759a8a4
commit babedd9c64
589 changed files with 17140 additions and 24881 deletions
@@ -1,4 +1,4 @@
# =================== META ====================
# =================== AIPass ====================
# Name: change_detection.py
# Description: Template change detection — template vs branch metadata
# Version: 1.0.0
@@ -1,4 +1,4 @@
# =================== META ====================
# =================== AIPass ====================
# Name: class_registry.py
# Description: Citizen class registry — maps class names to template directories
# Version: 1.0.0
+1 -1
View File
@@ -1,4 +1,4 @@
# =================== META ====================
# =================== AIPass ====================
# Name: delete_ops.py
# Description: Delete handler — implementation logic for branch deletion
# Version: 1.0.0
+1 -1
View File
@@ -1,4 +1,4 @@
# =================== META ====================
# =================== AIPass ====================
# Name: file_ops.py
# Description: Template copy and file operations
# Version: 1.0.0
@@ -1,4 +1,4 @@
# =================== META ====================
# =================== AIPass ====================
# Name: json_handler.py
# Description: JSON file read/write operations for spawn
# Version: 1.0.0
+1 -1
View File
@@ -1,4 +1,4 @@
# =================== META ====================
# =================== AIPass ====================
# Name: json_ops.py
# Description: JSON operations — deep merge, migrations, backups
# Version: 1.0.0
+1 -1
View File
@@ -1,4 +1,4 @@
# =================== META ====================
# =================== AIPass ====================
# Name: meta_ops.py
# Description: Branch metadata operations for update tracking
# Version: 1.0.0
+1 -1
View File
@@ -1,4 +1,4 @@
# =================== META ====================
# =================== AIPass ====================
# Name: metadata.py
# Description: Branch name extraction and profile detection
# Version: 1.0.0
@@ -1,4 +1,4 @@
# =================== META ====================
# =================== AIPass ====================
# Name: passport_ops.py
# Description: Passport command — grants birthright citizenship to a directory
# Version: 1.0.0
@@ -1,4 +1,4 @@
# =================== META ====================
# =================== AIPass ====================
# Name: placeholders.py
# Description: Placeholder replacement engine
# Version: 1.0.0
+1 -1
View File
@@ -1,4 +1,4 @@
# =================== META ====================
# =================== AIPass ====================
# Name: reconcile.py
# Description: Branch state reconciliation — filesystem vs metadata
# Version: 1.0.0
+1 -1
View File
@@ -1,4 +1,4 @@
# =================== META ====================
# =================== AIPass ====================
# Name: registry.py
# Description: AIPASS_REGISTRY.json CRUD operations
# Version: 1.0.0
@@ -1,4 +1,4 @@
# =================== META ====================
# =================== AIPass ====================
# Name: sync_registry_ops.py
# Description: Registry sync handler — implementation logic for registry repair
# Version: 1.0.0
@@ -25,6 +25,13 @@ from aipass.spawn.apps.handlers.registry import (
save_registry,
_branches_as_list,
)
from aipass.spawn.apps.handlers.meta_ops import (
load_template_registry,
generate_branch_meta,
save_branch_meta,
)
from aipass.spawn.apps.handlers.file_ops import regenerate_template_registry
from aipass.spawn.apps.handlers.class_registry import get_template_dir
# Repo root — resolved from spawn package location
_REPO_ROOT = Path(__file__).parents[5] # handlers/apps/spawn/aipass/src/AIPass
@@ -158,9 +165,51 @@ def sync_registry(fix: bool = False) -> dict:
else:
logger.error("[sync-registry] Failed to save updated registry")
# Rebuild .spawn/ tracking for branches missing metadata
spawn_rebuilt = []
if fix:
for name in healthy + unregistered_list:
branch_path = filesystem_branches.get(name)
if not branch_path:
continue
# Check/rebuild .spawn/.template_registry.json
spawn_dir = branch_path / ".spawn"
spawn_dir.mkdir(exist_ok=True)
template_reg_path = spawn_dir / ".template_registry.json"
if not template_reg_path.exists():
regenerate_template_registry(branch_path)
# Check/rebuild .spawn/.branch_meta.json
branch_meta_path = spawn_dir / ".branch_meta.json"
if not branch_meta_path.exists():
# Determine citizen class from passport
passport_path = branch_path / ".trinity" / "passport.json"
citizen_class = "builder" # default
if passport_path.exists():
try:
passport = json.loads(passport_path.read_text(encoding="utf-8"))
citizen_class = passport.get("identity", {}).get("citizen_class", "builder")
except (json.JSONDecodeError, IOError):
pass
# Load template registry for that class (fall back to builder if unknown)
try:
template_dir = get_template_dir(citizen_class)
except ValueError:
logger.warning(f"[sync-registry] Unknown class '{citizen_class}' for {name}, falling back to builder")
template_dir = get_template_dir("builder")
template_registry = load_template_registry(template_dir)
if template_registry:
branch_meta = generate_branch_meta(branch_path, template_registry)
save_branch_meta(branch_path, branch_meta)
spawn_rebuilt.append(name)
logger.info(f"[sync-registry] Rebuilt .spawn/ for: {name}")
return {
"stale": stale,
"unregistered": unregistered_list,
"healthy": healthy,
"fixed": fixed,
"spawn_rebuilt": spawn_rebuilt,
}
@@ -1,4 +1,4 @@
# =================== META ====================
# =================== AIPass ====================
# Name: sync_templates_ops.py
# Description: Template sync handler — implementation logic for template sync
# Version: 1.0.0
+1 -1
View File
@@ -1,4 +1,4 @@
# =================== META ====================
# =================== AIPass ====================
# Name: update_ops.py
# Description: Update handler — implementation logic for branch updates
# Version: 1.0.0
+39 -3
View File
@@ -1,4 +1,4 @@
# =================== META ====================
# =================== AIPass ====================
# Name: core.py
# Description: Main orchestrator for agent spawning
# Version: 1.0.0
@@ -23,15 +23,46 @@ from pathlib import Path
from typing import List
from aipass.prax import logger
try:
from aipass.cli.apps.modules.display import console
except ImportError:
from rich.console import Console
console = Console()
from aipass.spawn.apps.handlers.metadata import get_branch_name, normalize_branch_name, detect_profile
from aipass.spawn.apps.handlers.placeholders import build_replacements_dict, validate_no_placeholders
from aipass.spawn.apps.handlers.file_ops import copy_template, rename_placeholder_paths, regenerate_template_registry, ensure_directory
from aipass.spawn.apps.handlers.meta_ops import load_template_registry, generate_branch_meta, save_branch_meta
from aipass.spawn.apps.handlers.registry import find_registry, add_to_registry, get_next_citizen_number
from aipass.spawn.apps.handlers.class_registry import (
validate_class,
get_default_class,
get_available_classes,
get_template_dir as _get_template_dir,
)
# Default template location (relative to spawn package root)
DEFAULT_TEMPLATE = Path(__file__).parents[2] / "templates" / "builder"
def print_introspection():
"""Display module introspection info."""
console.print()
console.print("core Module")
console.print("Agent creation orchestrator — full spawn workflow from template to registry")
console.print()
console.print("Connected Handlers:")
console.print(" handlers/")
console.print(" - metadata.py (get_branch_name, normalize_branch_name, detect_profile — branch identity)")
console.print(" - placeholders.py (build_replacements_dict, validate_no_placeholders — template substitution)")
console.print(" - file_ops.py (copy_template, rename_placeholder_paths, regenerate_template_registry, ensure_directory — filesystem ops)")
console.print(" - meta_ops.py (load_template_registry, generate_branch_meta, save_branch_meta — branch metadata)")
console.print(" - registry.py (find_registry, add_to_registry, get_next_citizen_number — AIPASS_REGISTRY management)")
console.print(" - class_registry.py (validate_class, get_default_class, get_available_classes, get_template_dir — citizen class lookup)")
console.print()
def handle_command(command: str, args: List[str]) -> bool:
"""
Route spawn commands to implementation.
@@ -104,8 +135,7 @@ def _spawn_agent(target_path, role="", traits="", purpose="", profile=None,
if template_dir:
template = Path(template_dir)
else:
from aipass.spawn.apps.handlers.class_registry import get_template_dir as _class_get_template_dir
template = _class_get_template_dir(citizen_class)
template = _get_template_dir(citizen_class)
# Validate
if target.exists():
@@ -140,6 +170,12 @@ def _spawn_agent(target_path, role="", traits="", purpose="", profile=None,
# Step 3: Regenerate .template_registry.json with fresh hashes
regenerate_template_registry(target)
# Step 3b: Generate branch metadata for tracking
template_registry = load_template_registry(target)
if template_registry:
branch_meta = generate_branch_meta(target, template_registry)
save_branch_meta(target, branch_meta)
# Step 4: Register in AIPASS_REGISTRY.json
registry_updated = add_to_registry(
reg_path, branch_upper, str(target), detected_profile,
+32 -1
View File
@@ -1,4 +1,4 @@
# =================== META ====================
# =================== AIPass ====================
# Name: delete.py
# Description: Branch deletion — thin CLI layer for archive and deregister
# Version: 1.1.0
@@ -19,6 +19,37 @@ from aipass.cli.apps.modules import console
from aipass.spawn.apps.handlers.delete_ops import delete_branch
def print_introspection():
"""Display module introspection info."""
console.print()
console.print("delete Module")
console.print("Branch deletion — archive directory and deregister from AIPASS_REGISTRY")
console.print()
console.print("Connected Handlers:")
console.print(" handlers/")
console.print(" - delete_ops.py (delete_branch — resolve path, archive, remove from registry)")
console.print()
# =============================================================================
# DRONE ROUTING
# =============================================================================
def handle_command(command: str, args: list) -> bool:
"""Handle commands routed by the entry point.
Args:
command: The command string (e.g. "delete")
args: List of arguments for the command
Returns:
True if command was handled, False otherwise.
"""
if command == "delete":
return handle_delete(args) == 0
return False
# =============================================================================
# PUBLIC API
# =============================================================================
+28 -1
View File
@@ -1,4 +1,4 @@
# =================== META ====================
# =================== AIPass ====================
# Name: passport.py
# Description: Passport command — thin CLI layer for granting birthright citizenship
# Version: 1.0.0
@@ -20,6 +20,33 @@ from aipass.cli.apps.modules import console
from aipass.spawn.apps.handlers.passport_ops import grant_passport
def print_introspection():
"""Display module introspection info."""
console.print()
console.print("passport Module")
console.print("Grant birthright citizenship — minimal identity (.trinity/, .aipass/, README.md)")
console.print()
console.print("Connected Handlers:")
console.print(" handlers/")
console.print(" - passport_ops.py (grant_passport — create minimal citizen identity and register)")
console.print()
def handle_command(command: str, args: list) -> bool:
"""Handle commands routed by the entry point.
Args:
command: The command string (e.g. "passport")
args: List of arguments for the command
Returns:
True if command was handled, False otherwise.
"""
if command == "passport":
return handle_passport(args) == 0
return False
def handle_passport(args: list[str]) -> int:
"""Parse args and execute passport grant.
+32 -1
View File
@@ -1,4 +1,4 @@
# =================== META ====================
# =================== AIPass ====================
# Name: sync_registry.py
# Description: Registry repair — thin CLI layer for registry synchronization
# Version: 1.1.0
@@ -19,6 +19,37 @@ from aipass.cli.apps.modules import console
from aipass.spawn.apps.handlers.sync_registry_ops import sync_registry
def print_introspection():
"""Display module introspection info."""
console.print()
console.print("sync_registry Module")
console.print("Registry repair — detect and fix mismatches between AIPASS_REGISTRY and filesystem")
console.print()
console.print("Connected Handlers:")
console.print(" handlers/")
console.print(" - sync_registry_ops.py (sync_registry — scan filesystem, detect stale/unregistered, auto-repair)")
console.print()
# =============================================================================
# DRONE ROUTING
# =============================================================================
def handle_command(command: str, args: list) -> bool:
"""Handle commands routed by the entry point.
Args:
command: The command string (e.g. "sync-registry")
args: List of arguments for the command
Returns:
True if command was handled, False otherwise.
"""
if command == "sync-registry":
return handle_sync_registry(args) == 0
return False
# =============================================================================
# PUBLIC API
# =============================================================================
@@ -1,4 +1,4 @@
# =================== META ====================
# =================== AIPass ====================
# Name: sync_templates.py
# Description: Template sync — thin CLI layer for template synchronization
# Version: 1.1.0
@@ -19,6 +19,37 @@ from aipass.cli.apps.modules import console
from aipass.spawn.apps.handlers.sync_templates_ops import sync_templates
def print_introspection():
"""Display module introspection info."""
console.print()
console.print("sync_templates Module")
console.print("Template synchronization — pull managed files from source branches into templates")
console.print()
console.print("Connected Handlers:")
console.print(" handlers/")
console.print(" - sync_templates_ops.py (sync_templates — compare hashes and pull updates from source branches)")
console.print()
# =============================================================================
# DRONE ROUTING
# =============================================================================
def handle_command(command: str, args: list) -> bool:
"""Handle commands routed by the entry point.
Args:
command: The command string (e.g. "sync-templates")
args: List of arguments for the command
Returns:
True if command was handled, False otherwise.
"""
if command == "sync-templates":
return handle_sync_templates(args) == 0
return False
# =============================================================================
# PUBLIC API
# =============================================================================
+33 -2
View File
@@ -1,4 +1,4 @@
# =================== META ====================
# =================== AIPass ====================
# Name: update.py
# Description: Update orchestrator — thin CLI layer for branch updates
# Version: 1.1.0
@@ -22,6 +22,37 @@ from aipass.spawn.apps.handlers.update_ops import (
)
def print_introspection():
"""Display module introspection info."""
console.print()
console.print("update Module")
console.print("Branch updates — sync single or all branches against their class templates")
console.print()
console.print("Connected Handlers:")
console.print(" handlers/")
console.print(" - update_ops.py (update_branch, update_all — renames, additions, JSON merges, pruned file archival)")
console.print()
# =============================================================================
# DRONE ROUTING
# =============================================================================
def handle_command(command: str, args: list) -> bool:
"""Handle commands routed by the entry point.
Args:
command: The command string (e.g. "update")
args: List of arguments for the command
Returns:
True if command was handled, False otherwise.
"""
if command == "update":
return handle_update(args) == 0
return False
# =============================================================================
# PUBLIC API
# =============================================================================
@@ -50,7 +81,7 @@ def handle_update(args: list[str]) -> int:
console.print(" [green]--trace[/green] Enable verbose logging")
return 1
from aipass.spawn.apps.handlers.class_registry import validate_class, get_available_classes
from aipass.spawn.apps.modules.core import validate_class, get_available_classes
dry_run = "--dry-run" in args
trace = "--trace" in args
+24 -3
View File
@@ -1,4 +1,4 @@
# =================== META ====================
# =================== AIPass ====================
# Name: spawn.py
# Description: Entry point CLI for drone @spawn
# Version: 1.0.0
@@ -65,7 +65,7 @@ def print_help():
def handle_create(args):
"""Handle the create command with optional citizen class."""
from aipass.spawn.apps.modules.core import _spawn_agent as spawn_agent
from aipass.spawn.apps.handlers.class_registry import validate_class, get_default_class
from aipass.spawn.apps.modules.core import validate_class, get_default_class
if not args:
console.print("[red]Error: target path required[/red]")
@@ -118,11 +118,32 @@ def handle_create(args):
return 1
def print_introspection():
"""Display module introspection info."""
console.print()
console.print("spawn Entry Point")
console.print("Branch lifecycle manager — create, update, delete, and sync AIPass branches")
console.print()
console.print("Connected Modules:")
console.print(" modules/")
console.print(" - core.py (handle_command, _spawn_agent — agent creation orchestrator)")
console.print(" - update.py (handle_update — single/all branch updates)")
console.print(" - delete.py (handle_delete — archive and deregister branch)")
console.print(" - sync_registry.py (handle_sync_registry — registry repair)")
console.print(" - sync_templates.py (handle_sync_templates — template synchronization)")
console.print(" - passport.py (handle_passport — grant birthright citizenship)")
console.print()
def main():
"""Main entry point."""
args = sys.argv[1:]
if len(args) == 0 or args[0] in ["--help", "-h", "help"]:
if len(args) == 0:
print_introspection()
return 0
if args[0] in ["--help", "-h", "help"]:
print_help()
return 0
@@ -86,7 +86,7 @@ class TestPassportCommand:
result = grant_passport(str(target), role="tester")
assert result["success"] is True
assert (target / ".aipass" / "branch_system_prompt.md").exists()
assert (target / ".aipass" / "aipass_local_prompt.md").exists()
def test_grant_passport_creates_readme(self, tmp_path):
from aipass.spawn.apps.handlers.passport_ops import grant_passport