From 2e41b75fe9935b64bcb71e3d73289f1fefed7725 Mon Sep 17 00:00:00 2001 From: AIOSAI Date: Tue, 14 Apr 2026 06:33:50 -0700 Subject: [PATCH] feat(system): Compass devpulse personal layer scaffold (DPLAN-0125 Track I): triple-layer gitignore protection, compass_wrapper.py stub (query_top/ingest_learning/stats signatures), seedgo bypass entries. Design doc at devpulse/.trinity/night_shift_reports/compass_layer_design.md. Scaffold ready for future implementation session. Co-Authored-By: @devpulse --- .git_pr.lock | 4 +- STATUS.md | 2 +- src/aipass/devpulse/.gitignore | 6 +- src/aipass/devpulse/.seedgo/bypass.json | 10 ++ .../devpulse/apps/modules/compass_wrapper.py | 107 ++++++++++++++++++ 5 files changed, 125 insertions(+), 4 deletions(-) create mode 100644 src/aipass/devpulse/apps/modules/compass_wrapper.py diff --git a/.git_pr.lock b/.git_pr.lock index d2fa7a04..92ce95a1 100644 --- a/.git_pr.lock +++ b/.git_pr.lock @@ -1,6 +1,6 @@ { "branch": "devpulse", "feature_branch": "", - "started": "2026-04-14T13:14:01.042006+00:00", - "pid": 219648 + "started": "2026-04-14T13:33:48.394474+00:00", + "pid": 233423 } \ No newline at end of file diff --git a/STATUS.md b/STATUS.md index 2361622d..ebbab835 100644 --- a/STATUS.md +++ b/STATUS.md @@ -2,7 +2,7 @@ > Auto-generated by `drone @prax status sync`. Do not edit manually. -**Last sync:** 2026-04-14 06:14 +**Last sync:** 2026-04-14 06:33 **Summary:** 8 operational | 0 in-progress | 0 not started --- diff --git a/src/aipass/devpulse/.gitignore b/src/aipass/devpulse/.gitignore index a52ddd16..1d9a9423 100644 --- a/src/aipass/devpulse/.gitignore +++ b/src/aipass/devpulse/.gitignore @@ -12,4 +12,8 @@ build/ *.log *.tmp *.swp -my-project \ No newline at end of file +my-project + +# Private Compass personal layer — never commit +.trinity/compass/ +.trinity/compass/** diff --git a/src/aipass/devpulse/.seedgo/bypass.json b/src/aipass/devpulse/.seedgo/bypass.json index ea5d67c0..42296403 100644 --- a/src/aipass/devpulse/.seedgo/bypass.json +++ b/src/aipass/devpulse/.seedgo/bypass.json @@ -40,6 +40,16 @@ "standard": "cli", "file": "apps/devpulse.py", "reason": "Manager branch — not a CLI module. Entry point auto-generated by spawn template. --help is implemented via print_introspection()." + }, + { + "standard": "encapsulation", + "file": "apps/modules/compass_wrapper.py", + "reason": "Scaffold/stub for private Compass personal layer. Inherits branch-level gap: devpulse has no apps/handlers/__init__.py security guard. Local handle_command() does enforce cross-branch caller rejection." + }, + { + "standard": "json_structure", + "file": "apps/modules/compass_wrapper.py", + "reason": "Scaffold/stub. Devpulse branch has no apps/handlers/json/json_handler module (manager branch). Real implementation in a later session will wire logging through the devpulse json handler once it exists, or via ingest_log.jsonl directly." } ], "notes": { diff --git a/src/aipass/devpulse/apps/modules/compass_wrapper.py b/src/aipass/devpulse/apps/modules/compass_wrapper.py new file mode 100644 index 00000000..074baec7 --- /dev/null +++ b/src/aipass/devpulse/apps/modules/compass_wrapper.py @@ -0,0 +1,107 @@ +# =================== AIPass ==================== +# Name: compass_wrapper.py +# Description: Scaffold for devpulse private Compass personal layer +# Version: 0.1.0 +# Created: 2026-04-14 +# Modified: 2026-04-14 +# ============================================= + +"""Devpulse -> Compass personal layer wrapper (SCAFFOLD / STUB). + +This module is the intended entry point for devpulse's private Compass +personal layer. It is a scaffold only -- no logic is implemented yet. + +Design doc: + src/aipass/devpulse/.trinity/night_shift_reports/compass_layer_design.md + +Storage (gitignored, never committed): + src/aipass/devpulse/.trinity/compass/ + devpulse_config.json -- collection identity / metadata + ingest_log.jsonl -- idempotency log for ingest attempts + .chroma/ -- future ChromaDB data directory + +Intended interface: + - query_top(context, n) -> top-N relevant fragments + - ingest_learning(key, text, sid) -> write a new learning fragment + - stats() -> collection health / counts + +No ``chromadb`` import is performed here on purpose: we don't want to +pull the dependency in until the real implementation lands. A future +session will replace the ``NotImplementedError`` bodies with actual +Compass engine calls (via subprocess or a direct import from the +Compass navigator package). +""" + +from __future__ import annotations + +from pathlib import Path + +from aipass.prax import logger +from aipass.cli.apps.modules import console, err_console + +MODULE_NAME = "compass_wrapper" + + +# ============================================================================= +# PUBLIC INTERFACE (stub) +# ============================================================================= + +def query_top(context: str, n: int = 5) -> list[dict]: + """Query the devpulse-compass layer for top-N fragments matching the context.""" + raise NotImplementedError("compass_wrapper.query_top not yet implemented") + + +def ingest_learning(learning_key: str, learning_text: str, session_id: int) -> bool: + """Ingest a new learning into the devpulse-compass layer.""" + raise NotImplementedError("compass_wrapper.ingest_learning not yet implemented") + + +def stats() -> dict: + """Return collection stats: fragment count, last ingest, schema version.""" + raise NotImplementedError("compass_wrapper.stats not yet implemented") + + +# ============================================================================= +# INTROSPECTION +# ============================================================================= + +def print_introspection() -> None: + """Print module introspection -- scaffold status and intended interface.""" + console.print("[bold cyan]compass_wrapper[/bold cyan] -- devpulse private Compass layer (SCAFFOLD)") + console.print(" status: stub / not implemented") + console.print(" storage: .trinity/compass/ (gitignored)") + console.print(" interface:") + console.print(" - query_top(context, n)") + console.print(" - ingest_learning(learning_key, learning_text, session_id)") + console.print(" - stats()") + console.print(" design: .trinity/night_shift_reports/compass_layer_design.md") + + +# ============================================================================= +# HANDLER SECURITY GUARD +# ============================================================================= + +def handle_command(command: str, args: list) -> bool: + """Entry point for drone routing. Guards against cross-branch imports misuse.""" + caller = Path.cwd().name + if caller != "devpulse" and not any( + p.name == "devpulse" for p in Path.cwd().parents + ): + logger.warning( + f"[COMPASS_WRAPPER] Cross-branch call from {caller} -- use ai_mail instead" + ) + return False + + if command != "compass": + return False + + if not args or args[0] in ("--help", "-h", "help"): + print_introspection() + return True + + # All subcommands are stubs until implementation lands. + err_console.print( + "[yellow]compass_wrapper is a scaffold -- no subcommands implemented yet.[/yellow]" + ) + err_console.print("See design doc: .trinity/night_shift_reports/compass_layer_design.md") + return True