Files
OSIT-AE-API-FastAPI/GEMINI.md
2026-01-21 20:30:15 -05:00

5.3 KiB

Gemini Added Memories

My Role and Operating Principles

I am the primary orchestrator and main helper for the development of the Unified Aether AI Agent (UE-AE-01). My goal is to facilitate the creation of a single AI entity with total system awareness across MariaDB, FastAPI, SvelteKit, and Docker.


Project Context - Aether API (FastAPI)

  • Owner/Developer: Scott Idem (user).
  • System Name: Aether (AE).
  • Purpose: Events Presentation Management, Events Badge Printing, Leads, Attendee Tracking, Presentation Launcher, Journals, Archives, Posts.
  • Current API Version (FastAPI): v4.9.0.
  • V3 Implementation: Modern parallel CRUD and Search endpoints under /v3/crud.
  • Summary: This project serves as the backend for the Aether system, providing core API functionalities.

Key Technical Hack/Learnings (Cumulative)

  • Circular Dependencies Fixed: Successfully resolved the fragile startup dependency chain by isolating Auth models and using strictly deferred DB imports in a dedicated dependencies_v3.py module.
  • Bootstrap Paradox Solved: Implemented a guest-access exception for site_domain search, allowing the frontend to resolve site context without a JWT.
  • V3 Searchable Fields: Confirmed that searchable_fields are fully implemented in app/object_definitions/ and utilized by app/lib_sql_search.py for dynamic query generation.
  • ID Vision Mapping Stability: Resolved a critical conflict in app/lib_sql_search.py where backend-injected integer filters (e.g., account_id) were being incorrectly mapped to _random string columns. Mapping now only occurs for non-integer values.
  • API Error Transparency: Modified sql_select to return False on hard database errors (instead of empty results). Updated the V3 search endpoint to return a 500 Internal Server Error in these cases, preventing "silent failures" where frontend developers would see 200 OK with zero results during system errors.
  • NULL Logic in Filters: Confirmed that explicit frontend filters like hide: false will FAIL to match NULL database values in standard SQL equality. It is more robust to rely on the API's built-in hidden=not_hidden URL parameter, which handles (hide = false OR hide IS NULL) automatically.

Session Summary & Progress (Jan 21, 2026)

This session focused on stabilizing the V3 search engine and enhancing the "ID Vision" developer experience.

  • V3 Search Engine Enhancements:
    • Comprehensive ID Vision: Expanded vision_fields mapping to include almost all major Aether objects (Event, Journal, Order, Product, etc.), allowing clean names in frontend filters.
    • Error Handling Refactor: Standardized SQL error bubbling to return 500 status codes with DB details instead of misleading 200 successes.
    • Status Filter Consistency: Added not_enabled alias for the enabled status parameter to align with not_hidden.
  • Object Definitions:
    • Whitelisted clean ID names (e.g., event_id, account_id) in searchable_fields for Events, Badges, and Journals to support the new mapping logic.
  • Database Synchronization:
    • Verified and resolved v_journal_entry missing column errors after user updated the view to include account_id.

Current To-Do List

1. High Priority & Urgent (UE-AE-01 Orchestration)

  • Real-world test of ae_field_manage.py. (ID: 153357623) - Pending user verification of first field addition.
  • Review codebase investigator report for Aether extension and journal management. (ID: 155435511) - In Progress.

2. Infrastructure & Technical Debt

  • Pydantic V2 Migration: Begin impact analysis for the 400+ validators and .dict() calls.
  • Psutil Container Update: Rebuilding the API image with C-build tools (GCC). (Paused)

3. Other Agent Tasks

  • Review and process new messages from various agents. (ID: 134908245) - In Progress (Internal gemini_cli task).

Workflow & Collaboration

  • Storage: Critical assets at /home/scott/OSIT/hosted_files/ (Synced via Syncthing).
  • Agents Sync: Shared documentation and notifications pushed to ~/agents_sync/.
  • Coding Standards: Adhering to prompts/coding_standards.md.

📋 Aether API Development Protocol

  1. Pre-Flight Check: Verify git status. Ensure all previous working changes are committed to maintain a "known good" state before starting a new cycle.

  2. Strategic Plan: Write a concise plan identifying the issue, the specific files to be modified, and the verification steps (including specific curl commands or test scripts).

  3. Implementation: Perform atomic code modifications using the replace or write_file tools.

  4. Syntax Validation: Run python3 -m py_compile <modified_file> immediately. If syntax errors exist, they must be fixed before proceeding to deployment.

  5. Process Cycle: Restart the Docker FastAPI service to apply changes:

    • "docker restart aether_container_env-ae_api-2"
  6. Empirical Testing:

    • Execute the curl commands or test scripts identified in Step 1.
    • Inspect the live log stream for regressions:

    1 "tail -n 20 ~/OSIT_dev/aether_container_env/logs/ae_api/aether_api.log"

  7. Finalize: Once verified, commit the changes with a descriptive message and sync relevant documentation.