Find a use case and its tests
Vernac 0.7.0 can inspect the saved model through the CLI or MCP. Start at the application root. Use the exact symbol IDs returned by Vernac.
CLI for Pi and other shell agents
vernac model list --kind use_case --query delete --limit 5
vernac model describe --symbol example.documents.DeleteDocument
vernac model relationships --symbol example.documents.DeleteDocument --direction incoming --kind scenario_reference
This example uses Document Workspace. The first command finds the use case. The
second shows its inputs and permission requirement. The third links to scenarios
that refer directly to it. A browser-facing scenario may instead refer to the HTTP
adapter. Follow the incoming invokes edge to that adapter and then look for its
incoming scenario_reference edges.
To run one scenario, describe its symbol, then copy its scenarioId and profile.
vernac model describe --symbol scenario:example.documents.PermittedDeletion.deletesAndEmits
vernac test --warm --scenario example.documents.PermittedDeletion.deletesAndEmits
For JVM fixtures, prepare the project’s compiled classes and dependency classpath first.
Pass the classpath through VERNAC_PROJECT_CLASSPATH when needed. Keep the profile
consistent when reusing a warm daemon. CLI model commands accept --workspace
and --profile domain|mvc|postgres.
MCP calls
Call list_symbols with {"kind":"use_case","query":"delete","limit":5}.
Call describe_symbol with {"symbol":"example.documents.DeleteDocument"}.
Call find_relationships with
{"symbol":"example.documents.DeleteDocument","kind":"emits","direction":"outgoing"}
to find events the native body can emit. Read structuredContent.
These calls inspect saved files by default. To inspect edits in a private overlay,
include both client and revision from the overlay operation in every query.
The saved query’s revision belongs to the warm daemon. To create an overlay, first
get the session’s workspace_revision, refresh with check_saved, and use that
returned revision for open_overlay. On stale_revision, reconcile the current
overlay revision before continuing.
Read and change terms and validation rules
List terms in a namespace or validation rules on a declaration. Copy the exact ID from the results before describing a symbol or following its edges.
vernac model list --kind term --namespace example.documents
vernac model list --kind validation --owner example.documents.Document
vernac model describe --symbol example.documents.Document
vernac model list --kind validation --query EmptyDocumentTitle
A term description includes its name, description, examples, notes and source
position. A term ID has the form term:<namespace>:<name>. The documents edge
points to the same-named modeled definition when one exists. A standalone or
quoted term can be queried by its own ID.
A validation description includes the condition source, language, owning
declaration, position and rejection code or message. Its scope distinguishes
state, usecase input and operation_input. For method input validation, the
result also identifies the operation and parameter types. Validation IDs contain
a declaration-local ordinal. Refresh them after a source revision changes.
validates points from the rule to the declaration it belongs to. The owning
declaration lists its rules in validations and reports
validationAvailability: unavailable for a dependency built before the validation
inventory was added. Rebuild such a dependency with 0.7.0 to see exported rules.
Published rule positions are relative to the producer’s source root and prefixed
with dependency/<module>/. Edit those rules in the producer checkout.
In MCP, pass the same filters to list_symbols, with owner in place of
--owner, then use describe_symbol and find_relationships as above. To
change a term or rule, open its reported file and edit the relevant block.
With a shell editor, save and run vernac check --warm and the affected scenario.
With MCP, send a put edit with the workspace-relative path and complete
updated file text to apply_checked on a private overlay. Inspect the new
revision and run its scenario before saving the intended change through your
file editor. The overlay stays in memory. For imported vocabulary, change the
producer source and rebuild the dependency.
Inspect behavior guards, view elements and adapter mappings
vernac model list --kind guard --query TooManyToReview
vernac model list --kind view_element --owner view:example.documents.DocumentPage --query button
vernac model list --workspace examples/dispatch --kind mapping --owner showcase.web.TourApi
For MCP, send the same kind, query and owner to list_symbols. Describe
the returned IDs. Inspect the exact revision of your source or overlay.
| Kind | Details |
|---|---|
guard |
Native require … else … condition, rejection, owning operation, position and enclosing branch arms. The guards edge leads back to the declaration. |
view_element |
Element type, parent, slot, literal or bindings as applicable, and children. Follow contains for repeats, empty arms, conditionals and form controls. A form includes its endpoint and path bindings. |
mapping |
Adapter-local name, source and target types, implementation form and declarative assignments. Follow uses_mapping from a mapping or its adapter to find calls to named conversions. Java bodies and delegates are identified by implementation form. |
Owners retain their existing symbol IDs. Numbered guard and view-element IDs are positions in the current revision. Fetch them again after editing. Change the reported Vernac declaration and use the same save-and-check or checked overlay process as for validation rules. Binary module metadata exposes declared rules for exported definitions and public operations. Guards, views and mappings are inspected in the checkout that declares them.
Read only what you need
- Use
namespacefor a namespace and its descendants, ormodulefor a declared module. Scope follows the selected application workspace. A namespace or module is not a declaration of a DDD bounded context. - List and relationship results default to 20 entries, with a maximum of 50.
Pass
nextOffsetasoffsetto continue. If the revision changes, restart pagination.directiondefaults toboth. - Each relationship names one direct reference. Scenario references do not establish
test coverage, and native event references describe possible emissions.
Java implementations, providers and fixtures can hide other relationships.
If
modelHasErrorsis true orscenarioCatalogisunavailable, runvernac check --warmorcheck_overlayon the same sources before relying on missing results. - Open the reported source location when the structured answer lacks a detail you need. For edits, use the AI task index.
Trace aggregate containment and native commands
For an aggregate or entity, outgoing contains relationships identify declared
containment fields and the entity type they reach, including through lists and sets.
The field_type relationship still reports the collection type itself. Outgoing
modifies relationships describe typed native sends to the referenced domain type.
Use the same relationship filters in the CLI and MCP. These are source relationships.
The command checks the membership of a particular entity instance at runtime.