Skip to content

feat(hosting): service profiles, write-locking, preseed API, and admin exports#139

Open
jack-arturo wants to merge 1 commit intomainfrom
codex/instapods-dedicated-trial-server
Open

feat(hosting): service profiles, write-locking, preseed API, and admin exports#139
jack-arturo wants to merge 1 commit intomainfrom
codex/instapods-dedicated-trial-server

Conversation

@jack-arturo
Copy link
Copy Markdown
Member

Summary

Adds the hosted trial-server infrastructure for InstaPods:

  • RuntimeProfile systemAUTOMEM_SERVICE_TIER (trial/pro/ultimate/archived) and AUTOMEM_SERVICE_MODE (active/read_only/archived) resolve to capability flags that govern write access, admin mutations, export eligibility, and more
  • Write-locking — Mutating endpoints return HTTP 423 when the service is locked; trial-expired pods include upgrade_url for upgrade prompts; read paths (recall, health, service/profile) stay available in all modes
  • New endpoints:
    • POST /api/v1/preseed — Bulk-create onboarding memories with associations (auto-tagged onboarding)
    • GET /api/v1/stats — Lightweight dashboard counters (memory count, associations, types, top tags, graph density)
    • GET /service/profile — Tier, mode, capability, and infrastructure introspection
    • POST /admin/exports + GET /admin/exports/<id> + GET /admin/exports/<id>/download — Gzipped graph+vector export bundles for archived pod data portability
  • MCP SSE server — Surfaces 423 lock states with clear user-facing messages for archived and read-only modes
  • Tests — Unit tests for all new endpoints, profile resolution, write-locking enforcement, and export flow

Test plan

  • make test — all unit tests pass
  • Verify resolve_runtime_profile() defaults for each tier
  • Verify 423 responses on /memory POST when service_mode=read_only and archived
  • Verify /recall still works in locked modes
  • Verify /admin/exports create → status → download flow
  • Verify /api/v1/preseed creates memories with onboarding tag and associations
  • Verify /api/v1/stats returns correct shape
  • Verify MCP SSE server formatToolError explains 423 states

…admin exports

Introduce a RuntimeProfile system that maps SERVICE_TIER (trial, pro,
ultimate, archived) and SERVICE_MODE (active, read_only, archived) to
capability flags (writes_enabled, admin_mutations_enabled, etc.).

Mutating endpoints now return HTTP 423 when the service is locked, with
trial-expired pods including an upgrade_url. Read paths (recall, health,
service/profile) remain available in all modes.

New endpoints:
- POST /api/v1/preseed — bulk-create onboarding memories with associations
- GET  /api/v1/stats  — lightweight dashboard counters
- GET  /service/profile — tier, mode, and capability introspection
- POST /admin/exports + GET status + GET download — gzipped graph+vector
  export bundles for archived pod data portability

MCP SSE server now surfaces 423 lock states with clear user messages.

Includes unit tests for all new endpoints, service profile resolution,
write-locking enforcement, and export flow.
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.

1 participant