Skip to content

Engine-parity host polish: index page, pretty JSON, engine error shape - #19

Merged
acn-ericlaw merged 1 commit into
mainfrom
feature/actuator-polish
Aug 24, 2026
Merged

acn-ericlaw merged 1 commit into
mainfrom
feature/actuator-polish

Conversation

@acn-ericlaw

Copy link
Copy Markdown
Collaborator

What

Three engine-parity refinements to the HTTP host, signatures extracted from the Java
engine first:

  1. GET / index page — the engines' minimal Welcome page (platform-core
    public/index.html style) embedded as a constant, linking /info, /info/routes,
    /env, /health and /livenessprobe. Deliberately no static file service.
  2. Pretty-printed JSON — actuator responses now use the engines' default-serializer
    presentation (Java SimpleMapper = pretty Gson; the Rust port matches): 2-space
    indented JSON.
  3. Host error shape — unknown paths and non-GET methods on known paths answer the
    engines' SimpleHttpUtility signature: {"status": 404, "message": "Resource not found", "type": "error"} (Java key insertion order), pretty-printed
    with application/json. aiohttp's default text error page is no longer reachable
    (catch-all route behind the exact routes).

Content types confirmed live: application/json; charset=utf-8 on all JSON endpoints
and errors, text/plain only on /livenessprobe (engine parity), text/html on /.
Envelope transport errors on /api/event are untouched (octet-stream envelopes).

Why

Operations teams should not be able to tell a Python function host from an engine by
its HTTP presentation: the landing page, the JSON rendering, and the error signature
are part of the one-aggregation surface the polyglot initiative promises.

Verification

57/57 pytest (new pins: index links, error shape for GET-unknown and POST-on-known,
pretty rendering), ruff clean, basedpyright 0. Live demo drive verified all three
shapes plus the content-type map; byte-symmetric with the node twin.

Co-Authored-By: Claude Code noreply@anthropic.com

🤖 Generated with Claude Code

…or shape

GET / serves the engines' minimal index page (embedded, no static file
service by design); actuator JSON responses are pretty-printed (the
engines' default SimpleMapper presentation); unknown paths and non-GET
methods answer the engines' SimpleHttpUtility error shape
{status, message, type: 'error'} with 'Resource not found'.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@acn-ericlaw
acn-ericlaw merged commit 035b636 into main Aug 24, 2026
2 checks passed
@acn-ericlaw
acn-ericlaw deleted the feature/actuator-polish branch August 24, 2026 02:15
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