ContractHandler
`artifact:contract` — a read-only look at what an artifact IS: for an enum, its backing type and cases; for a class, its constructor signature and public methods; plus what it extends/implements. The debt this pays (greenhouse ROADMAP D1/D5/D6, from the audit of `work-mthqbzu6`): the agent was discovering signatures and enum cases by TRIGGERING errors — an `implement` refusal that named the missing constructor params, a static-analysis complaint that named the enum's unknown constant. An error is not an introspection API. This is the explicit read: ask the contract, do not provoke it. The reach is universal on purpose. A bare name searches the app's own plugins; a name with a backslash is a FQCN and resolves through the app's autoloader, which reaches installed vendor code — the handler runs inside the host app process, so what the app can execute, the agent can now also ASK about. Before this, installed packages existed for execution but not epistemologically, and an agent burned turns deducing APIs it could have read. An optional `member` narrows the answer — the constructor, the method list, or one method — so a narrow question gets a small answer instead of the whole contract. Not found is `ok:false` with a reason, never an exception — «I looked and it is not there» is a valid observation about the target that was asked for (same contract as {@see ValidateHandler}).
ContractHandler::__construct()
public function __construct(Milpa\DevTools\Support\RootResolver $roots = new RootResolver()):Parameters
| Name | Type | Description |
|---|---|---|
| $roots | Milpa\DevTools\Support\RootResolver |
ContractHandler::handle()
public function handle(array $input): arrayResolves the named artifact and returns its contract, or `ok:false` when there is nothing to read. Enums report their cases; classes report their constructor and methods. A FQCN (any name with a backslash) resolves through the app's autoloader instead of the plugin tree, and `member` narrows the answer to the constructor, the method list, or one method.
Parameters
| Name | Type | Description |
|---|---|---|
| $input | array<string, mixed> |