Gateway v0.9.0: the whole laboratory API as api_spec, api_read, api_write #163
Loading…
Reference in a new issue
No description provided.
Delete branch "oss-oo/gateway-whole-api-20261027"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
The whole laboratory REST API becomes one guarded door on the authenticated MCP gateway, for every client, as gateway v0.9.0:
api_spec/swagger.v1.json, read without credentials, cached 24 h, one fetch at a time); each hit says whether the guard allows itapi_readGETany API path, query parameters inqueryapi_writePOST/PUT/PATCH/DELETEwith a JSON body, for approved project work onlyThis is the contract the laboratory's Claude Code plugin already offers locally (
lab_api_*, OSS-OO/claude-plugin v0.3.x). On the gateway, every agent family gets it./mcp/publickeeps exactly its four tools.How
GETcounts as a read, everything else as a write. The tools can do nothing the token could not do directly.agent-gateway/api_guard.py):GET, in any letter case.PATCHmay change onlydescriptionandwebsite.plugin_api_source.json, 519 operations), that allows 63 writes and refuses 190; it allows 216 reads and refuses 50.POLICY_SHA256(b4e86f74…) digests the decision tables. The plugin'slab/labci.py0.3.1 and 0.3.2 digest to the same value, andapi_specreports it.truncated.api_specqueries are bounded (12 keywords, 256 characters).Location,Content-Type,Link) is bounded and stripped of control characters, and encoded answers are refused./mcpand/mcp/publicanswer 400 for invalid UTF-8, nesting too deep for the parser and over-long integers, and keep serving. Until now these escaped as a handler traceback and a dropped connection.paramsofinitializeortools/callanswers -32602.python3 -I, the gateway finds its sibling modules.scripts/e2e-local.shno longer use-q. Underpipefail, the producer's late write failed the force-expire sweep check with SIGPIPE in this PR's first gate run, although the checked behaviour was right.Evidence
agent-gateway/test_api_tools.pyhas 376 tests, normal and with-O, and runs in CI.lab/test_guard_edges.pyat v0.3.1) is ported row by row with its reasons. The plugin's CLI and argv tables are not ported, because the gateway has no CLI.-O. The Cloud suites need the locked venv, which CI provides.labci.py0.3.1: 28.1 million pure decisions with 0 differences; 13,946 end-to-end comparisons where the only differences are non-object queries, which the gateway refuses (documented).ee79ab8, in an isolated copy with its own compose project and ports.MCP GATEWAY PASS(incl. discovery, reads, a topics write with its undo, and the refusals with the repository unchanged),REMOTE MCP PASS(the three tools over HTTP with the request's bearer),SELFTEST PASS, and the open-join sweep checks.mainon this station: the core image available here predates the evidence headers of #148. The full gate needs the new core image, as for #162.Deploy
See RUNBOOK, Remote MCP service: stage
mcp_forgejo.py,api_guard.pyandremote_server.pyas one bundle bound to the merge commit and their SHA-256 values, then oneoss-oo-mcprestart, with the owner's acceptance. The SSH dispatcher comparesmcp_forgejo.pybetween station and server, so station clients in server mode move to the same module.🤖 Generated with Claude Code
8c00054: the round-2 review nits, reviewed again in round 3 ("mergeable as is").main.nullparamscounts as absent;"",0,falseand[]answer -32602.test_api_tools.py), and reverting any of them fails one.Gate on this tree: isolated copy, own compose project and ports.
MCP GATEWAY PASS(the 600-GET budget probe took 45.8 s),REMOTE MCP PASS,SELFTEST PASSand the open-join checks.mainwith this station's core image.Review, round 3:
paramsbehaviour, the body deadline (four concurrent callers, one fetch, all done at 2.2 s against a 13 s trickle) and the stale description.-O.🤖 Generated with Claude Code
Owner decision (2026-10-27): merge after the new core image is available on the station and
scripts/e2e-local.shpasses in full, including the steps after the native PR diff evidence step, as for #162. Root deploys from the merge commit following the RUNBOOK ("Whole-API tools (gateway v0.9.0)": bundlemcp_forgejo.py,api_guard.py,remote_server.pywith their SHA-256 values, oneoss-oo-mcprestart, acceptance). If #162 lands first, this branch is rebased onto it; agit merge-treeprobe shows no conflict.🤖 Generated with Claude Code
Consolidated in #165, protected squash merge
82357b4cd1675359119148219b86df78613920fc. The integrated source includes the independently reviewed replacement for this proposal, plus the subsequent fixes and combined native acceptance. Required PR and main-branch checks are green.Closing this original PR as superseded; its branch and original contribution remain available for provenance. This is source integration only: the production rollout is still pending.
Pull request closed