Skip to content

feat: add GET /manifest endpoint for mothership service discovery#139

Merged
deanq merged 3 commits intomainfrom
deanq/ae-1643-mothership-manifest
Jan 14, 2026
Merged

feat: add GET /manifest endpoint for mothership service discovery#139
deanq merged 3 commits intomainfrom
deanq/ae-1643-mothership-manifest

Conversation

@deanq
Copy link
Copy Markdown
Member

@deanq deanq commented Jan 12, 2026

Summary

Add a GET /manifest endpoint to LoadBalancer handlers for Mothership-based service discovery. This enables child endpoints to fetch function/resource metadata from the mothership during cross-endpoint routing.

Changes

  1. Reserved Paths: Add /manifest to reserved paths to prevent user function conflicts
  2. Manifest Endpoint: Conditional endpoint in lb_handler factory that:
    • Loads manifest using existing load_manifest() function
    • Returns 200 with manifest JSON on success
    • Returns 404 with error details if manifest not found
    • Only registers when FLASH_IS_MOTHERSHIP=true env var is set
  3. Tests: 18 unit tests and 4 integration tests covering all scenarios

Implementation Details

  • Endpoint: GET /manifest serves flash_manifest.json content
  • Scope: LoadBalancer resources only (LoadBalancerSlsResource, LiveLoadBalancer)
  • Control: Conditionally registered via FLASH_IS_MOTHERSHIP=true environment variable
  • Response: JSONResponse with manifest dict (200 OK or 404)

Implement manifest endpoint on LoadBalancer handlers to serve flash_manifest.json
for cross-endpoint routing. The endpoint is conditionally registered when
FLASH_IS_MOTHERSHIP=true environment variable is set, enabling child endpoints
to fetch function/resource metadata from the mothership.

Changes:
- Add /manifest to reserved paths in manifest builder
- Implement conditional GET /manifest endpoint in lb_handler factory
- Returns 200 with manifest JSON on success, 404 if not found
- Endpoint only registers for LoadBalancer resources with env var set
- Add comprehensive unit and integration tests (18 unit, 4 integration)
@deanq deanq requested a review from Copilot January 12, 2026 06:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a GET /manifest endpoint to enable service discovery for mothership-based LoadBalancer deployments. The endpoint conditionally serves the flash_manifest.json file when the FLASH_IS_MOTHERSHIP=true environment variable is set, allowing child endpoints to fetch function/resource metadata during cross-endpoint routing.

Changes:

  • Added /manifest to reserved paths to prevent conflicts with user-defined routes
  • Implemented conditional /manifest endpoint in create_lb_handler that returns manifest JSON or 404
  • Added comprehensive unit and integration tests covering endpoint registration, responses, and coexistence with other routes

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tests/unit/runtime/test_lb_handler.py Unit tests for manifest endpoint registration, responses, and edge cases
tests/integration/test_lb_remote_execution.py Integration tests verifying manifest endpoint behavior in LiveLoadBalancer and LoadBalancerSlsResource contexts
src/tetra_rp/runtime/lb_handler.py Implementation of conditional /manifest endpoint in handler factory
src/tetra_rp/cli/commands/build_utils/manifest.py Added /manifest to reserved paths list

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@deanq deanq merged commit 2956f09 into main Jan 14, 2026
7 checks passed
@deanq deanq deleted the deanq/ae-1643-mothership-manifest branch January 14, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants