Describe
mantle describe <target> <manifest>... compiles manifests and prints JSON. An explicit target is required; use the generation target because hashes include the dialect. The command writes no project files. --diff <old.json> prints a JSON array of changes against a saved report.
describeApp(plan) and diffApp(a, b) are exported by @aotter/mantle/describe. The AppDescription TypeScript type is the contract. targetHash(plan, id) is also exported by @aotter/mantle/target-hash. These exports use no Node APIs and load no SQL parser.
The schemaVersion 1 report contains:
access:plan.access.userFields, mapping declared user fields to their type, multiplicity and optional enum.targets: MCP Tool-shaped objects withname,title,description,inputSchema,annotationsand_meta. View and Procedure names follow MCP naming. Route inputs are plain objects with a name selector for known dispatcher variants; theirvariantsretain the selected input schemas.
Each target’s _meta contains:
id:view:<name>,procedure:<name>,rest:<METHOD> <path>oradmin:<METHOD> <path template>. Parameters use:name; Admin paths are relative to the API base. Publishing ids useprocedure:<schema>.<verb>; media tool ids useadmin:tool:<name>.targetHash: a hash of behavior, inputs, requirements, restrictions, related Schema definitions, surfaces, Triggers and reachable hooks. Optional lowering caches do not affect it. Ref registration keys are included; application-owned handler implementations are not.scopeandrestrict: per-Schema owner and user-field terms. Owner terms useowner; user-field terms name theircolumn,fieldandtype.readOnly: true only when all reachable statements are reads. Ref handlers and routes without known dependencies are false.trustedOnly,opaque,unscopedReads: trusted-only execution, ref-handler opacity and reads of Schemas without row scope. Opaque code conservatively includes every Schema available to its Store.surfacesandtriggers: every declared exposure and each Trigger’s id and source. Views includeadminfor developer previews.requires: conjunctive predicates inalland an optionalguardname. Admin-only targets include the admin gate.variants: each selectable target’s id, input schema, requirements, flags and row policies. Route restrictions contain terms common to all variants.
Descriptions contain no SQL or rows. They describe declarations; application router additions and optional module mounting remain application-owned.
Diff records contain id, field, direction and optional before/after. Removing a scope or restrict term widens access; adding one narrows it. Reading another Schema, dropping requirements, adding surfaces or Triggers, removing readOnly or trustedOnly, or enabling opaque or unscopedReads widens access. Variants are compared separately. Adding a target widens; removing one narrows. Every input schema change is changed, as are other behavior changes. Directions describe individual changes, not an overall proof when several fields change.