LATTICE FastAPI Endpoint Authoring

Maintain the LATTICE FastAPI sidecar's 33-endpoint contract with JSON-only routes and docs sync.

3|Updated May 11, 2026
One-click install
npx skills add https://github.com/JeromyJSmith/lattice-platform --skill lattice-fastapi-endpoint-authoring
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: LATTICE FastAPI Endpoint Authoring
Source: https://github.com/JeromyJSmith/lattice-platform/tree/main/.agents/skills/lattice-api
Command: npx skills add https://github.com/JeromyJSmith/lattice-platform --skill lattice-fastapi-endpoint-authoring

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents API contract drift between the FastAPI sidecar implementation and the repository’s canonical metadata, which otherwise breaks dependent systems and causes hard-to-debug runtime failures.

Core Features & Use Cases

  • Contract-first route authoring: Add routes only via the pixeltable FastAPI sidecar and ensure the declared endpoint table stays synchronized.
  • JSON-only responses enforcement: Guarantee routes return JSON by banning HTML/file/redirect patterns.
  • Live endpoint count validation: Detect and correct endpoint count drift against meta/API.md and surface architecture counts in meta/ARCHITECTURE.md.
  • Operational verification: Confirm sidecar health, validate Unix socket connectivity in production, and run the scoring script for drift/worker health checks.

Quick Start

Use the LATTICE API skill to add a new FastAPI route under pixeltable/service/routes/<section>.py, then update meta/API.md and meta/ARCHITECTURE.md in the same commit.

Frequently Asked Questions about LATTICE FastAPI Endpoint Authoring

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent FastAPI endpoint contract drift when adding new routes?

To prevent FastAPI endpoint contract drift, implement new routes under pixeltable/service/routes and register routers in pixeltable/service/main.py. You must synchronize the exact endpoint count with meta/API.md and meta/ARCHITECTURE.md in the same commit to avoid breaking dependent systems.

How do I enforce JSON-only responses in FastAPI routes?

To enforce JSON-only responses in FastAPI routes, ban HTML, file, and redirect response patterns in your route implementations. This guarantees routes return strict JSON, preventing unexpected content types from breaking dependent systems or causing runtime failures.

Why does my FastAPI sidecar endpoint count mismatch the API documentation?

A FastAPI sidecar endpoint count mismatch occurs when routes are added without updating canonical metadata. You must synchronize the active route registrations in pixeltable/service/main.py with the declared endpoint tables in meta/API.md and meta/ARCHITECTURE.md prior to commit.

How do I validate FastAPI sidecar health and Unix socket connectivity?

To validate FastAPI sidecar health and Unix socket connectivity, run the operational scoring script to check for drift and worker health. This confirms the sidecar is operational and verifies production Unix socket connectivity prior to committing route changes.

Can I use HTML or redirect responses for FastAPI routes in pixeltable?

No, FastAPI routes in pixeltable require JSON-only responses. HTML, file, and redirect response patterns are explicitly banned to maintain the LATTICE API contract, ensuring consistent JSON data exchange and preventing hard-to-debug runtime failures across dependent systems.

What is the correct workflow for FastAPI route registration and API documentation sync?

The correct workflow for FastAPI route registration involves adding routes under pixeltable/service/routes, registering routers in main.py, and running docs-sync checks. You must update meta/API.md and meta/ARCHITECTURE.md in the same commit to maintain the 33-endpoint contract.