Repository navigation
Description
Problem
proTES runs task "middlewares" with its own engine: classes imported by
dotted path from config, rebuilt per request, alternatives sharing one
mutable Flask request, no provenance, routing output smuggled through the
task body (tes_urls). proWES and later gateways need the same stack.
The maintainer decided (2026-10-24) that the engine lives in FOCA,
framework-free, with plugins in a separate monorepo (foca-plugins),
admin control by config only, per-task pipelines chosen by clients, and
full provenance.
Proposal
Add foca.plugins to FOCA 0.18, in these sub-issues (stack order):
- P1
feat(plugins): add plugin engine(feat(plugins): add plugin engine #486,feat/plugin-engine) - P2
feat(plugins): resolve per-request pipelines(feat(plugins): resolve per-request pipelines #487,feat/plugin-pipelines) - P3
feat(plugins): record provenance(feat(plugins): record provenance #488,feat/plugin-provenance) - P5
feat(utils): add a guarded HTTP client(feat(utils): add a guarded HTTP client #490,feat/guarded-http-client) - P10
feat(plugins): add typed backend lists(feat(plugins): add typed backend lists #493,feat/backend-lists) - P6
feat(plugins): add default failover router(feat(plugins): add default failover router #491,feat/failover-router) - P11
feat(plugins): write gateway tags(feat(plugins): write gateway tags #494,feat/gateway-tags) - P4
feat(plugins): list available plugins(feat(plugins): list available plugins #489,feat/plugin-listing) - P7
feat(plugins): add plugin test kit(feat(plugins): add plugin test kit #492,feat/plugin-test-kit)
Not in v0.18.0: P8 feat(plugins): support async hooks (plugins-08,
milestone v1.0.0-rc1, sub-issue of #188); P9 remote plugins (after 1.0).
Key decisions (copied from the design, section 0 and 20):
- Names: plugin / pipeline / step; entry-point group
foca.plugins;
config sectionplugins. - Phases
request,route,forward,response; plugins only after
authentication, validation, access control and sanitation. - Allowlist + pins; no runtime install, no runtime management API, no
runtime enable/disable (config kill switchenabled: false). - Client tags
gateway.pipelineandgateway.backends; any other client
gateway.*tag →400; per-task pipelines on by default. - No capability grants ("everything for all"); capabilities are generic
descriptors in/pluginsand public/service-info. - Default router
foca.routing.ordered(ordered failover; registry
entries shuffled); 5xx/read timeout = outcome unknown (stop);
forward_timeout60 s →503;Via+ self-exclusion against loops. - Old
middlewareskey → startup error with a migration hint.
Surviving the Connexion 3 migration
Hard constraint of the maintainer: nothing here may block FOCA
1.0.0-rc1 (Connexion 3 AsyncApp, no Flask). So foca.plugins has no
flask/werkzeug/connexion/starlette types in interfaces, hook
signatures, models, provenance or the test kit (enforced by an ast-grep
rule); all Connexion 2/Flask glue is in foca.plugins.adapter, which
rc1 replaces; the engine gets an explicit context object instead of
Flask g/request context; hooks become async in P8 by async def
only; the HTTP client and router don't use Werkzeug.
Acceptance criteria
- All sub-issues closed;
foca.pluginsdocumented (operator config,
author guide, API reference); "Migrating to 0.18.0" mentions the new
pluginssection and themiddlewaresstartup error. - proTES can adopt the engine (proTES lane drafts T1–T5) without further
FOCA changes.
Dependencies
- None outside this list (no longer blocked by H1-S draft C or D, which
moved to v0.19.0).
Open questions
- See the sub-issues (
gateway.backendsordersemantics,508vs
400for loops, curation of the capability vocabulary).
Activity
uniqueg commentedon Oct 27, 2026
All nine sub-issues (#486 to #494) are closed, and the 0.18 migration guide now covers the plugin engine (#523, PR #531). Closing as completed for 0.18.0. Follow-up design for client backend selection: #528.