Wanderland

Wanderland Core: Introspection

The framework's reflective surface: runtime endpoints that report what's registered, what's configured, and what each request actually walked through. Everything the engine knows about its own structure is exposed as HTTP routes, reachable with nothing but curl.

Overview

Every wanderland engine ships with a fixed set of introspection endpoints mounted in Engine::CORE_ROUTES. Sites can override their handler implementations but cannot remove the routes — operators always have a known URL to reach for "what am I looking at?"

Three categories:

Collectively these are the reflective substrate on which JSON Schema synthesis, capability audits, and operational tooling are built.

/inspect/route/:name

Reports the chain composition of a single named route. The :name capture is matched against Engine#named_routes, which only indexes user-declared routes (framework routes like the health triptych and /inspect/* are not listed as targets).

Response shape

{
  "name": "hello",
  "method": "get",
  "path": "/hello",
  "user_chain": ["echo"],
  "compiled_chain": ["enforce_denials", "echo", "trace_emit"],
  "registered_injections": []
}

Fields

Error shape

{
  "error": "unknown route: \"nope\"",
  "available": ["hello", "report"]
}

Unknown name returns 404 with the sorted list of available route names — safe to expose, because named routes are already the site's declared public surface.

/inspect/boundary/:name

Reports the manifest entry for any boundary registered in Wanderland::Boundary. Includes framework-shipped boundaries (echo, enforce_denials, health, etc.) and any site-provided ones loaded from the boundaries directory.

Response shape

{
  "name": "echo",
  "identity": null,
  "requirements": [],
  "capabilities": ["echo"],
  "description": "Echo input params back as result",
  "when_shape": null,
  "source": "Wanderland::Boundaries::Echo"
}

Fields

Error shape

Unknown name returns 404 with the full sorted list of registered boundaries:

{
  "error": "unknown boundary: \"nope\"",
  "available": ["adapter_cli", "adapter_http", "archetype_inspect", ...]
}

What's Not Yet Exposed

The current response covers what the Boundary::Registration struct carries today. Additions will come as the boundary DSL grows:

Each new declaration on the boundary DSL propagates through this response without further plumbing — the endpoint dumps whatever the registration carries.

Relationship to Authentication

Neither inspection endpoint carries authentication or authorization by default. Their payloads describe chain shape and boundary contracts — operational information, not sensitive runtime state. Sites that need to gate introspection add an auth injection (see wanderland-core-injections for the pattern) with position: { before: inspect_route } and position: { before: inspect_boundary }, or target the whole /inspect/* surface with a matched interleave condition.

The Path to JSON Schema

The boundary manifest already carries enough to synthesize partial schema: requirements become scope predicates, capabilities become declared claims, when_shape becomes activation conditions. The two missing pieces — input_shape and output_shape — bring the surface up to full contract:

Introspection is the read path; the DSL additions are the write path. As the DSL grows the endpoints reflect the expanded manifest automatically, and the JSON Schema synthesizer reads through the same surface any operator does over HTTP.

Relationship to runtime_inspect

runtime_inspect is a scenario-only boundary used in spec/scenarios/*. It boots a fresh runtime from a site path, optionally dispatches a request through it, and returns the boot context, request context, and dispatch crossing as a shape for ShapeMatcher assertions. It is not mounted as a route and does not overlap with the live /inspect/* endpoints.