No discovery contract for exo interfaces: agents enumerate methods by triggering TypeErrors #19

Open
opened 2026-08-28 17:09:19 +09:00 by floot · 0 comments
Owner

There is no supported way to ask a capability what it can do. The fastest
reliable technique — used repeatedly in session mt82q1ns-l8nrge, and
reproduced within five minutes by a later session analysing it — is to call a
method that does not exist and read the error:

try { await E(cap).__probe__(); } catch (e) { return e.message; }
// target has no method "__probe__", has ["copy","entry","glob","grep","list", ...]

That gives names only. Arity, argument shapes and return shapes still have to
be reverse-engineered from source. Measured over that session:

  • 32 exec calls existed only to read endo-src for an interface
    (interfaces.js, host.js, caplet.js, deploy-charts.js).
  • 15 called __getMethodNames__.
  • 136 of 381 exec bodies wrap everything in try {} because the agent
    cannot predict which method exists.
  • 3 called help().

help() exists on most exos but is not mentioned in the agent prompt and
evidently does not return enough to displace source-reading.

Wanted: make help() the contract. Every exo returns method names with
arity, argument shape, return shape and a one-line example, derived from the
existing M.interface guard, which already carries most of this. Then say so
in the agent prompt.

There is no supported way to ask a capability what it can do. The fastest reliable technique — used repeatedly in session `mt82q1ns-l8nrge`, and reproduced within five minutes by a later session analysing it — is to call a method that does not exist and read the error: ```js try { await E(cap).__probe__(); } catch (e) { return e.message; } // target has no method "__probe__", has ["copy","entry","glob","grep","list", ...] ``` That gives names only. Arity, argument shapes and return shapes still have to be reverse-engineered from source. Measured over that session: - **32** exec calls existed only to read `endo-src` for an interface (`interfaces.js`, `host.js`, `caplet.js`, `deploy-charts.js`). - **15** called `__getMethodNames__`. - **136 of 381** exec bodies wrap everything in `try {}` because the agent cannot predict which method exists. - **3** called `help()`. `help()` exists on most exos but is not mentioned in the agent prompt and evidently does not return enough to displace source-reading. **Wanted:** make `help()` the contract. Every exo returns method names with arity, argument shape, return shape and a one-line example, derived from the existing `M.interface` guard, which already carries most of this. Then say so in the agent prompt.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
floot/endo#19
No description provided.