vernac / architecture, expressed.
Browse documentation

0.6.0 · Declarative views and executable tests

Outcome. A developer creates a Spring Boot project with the IntelliJ wizard, changes a modeled action, and writes a Vernac scenario that exercises the action and its view. Maven runs that scenario against the application’s existing Java-backed behaviors. CI can run selected scenarios with PostgreSQL. The scenario sources also serve as the compatibility corpus for the 0.7.0 development plan.

Baseline. At revision db264bd on feature/0.6.0, the compiler resolves typed views, generates Thymeleaf resources and binds forms to named MVC endpoints. The wizard’s task board, row component and problem page use this path. View acceptance is in progress. The template already has Java domain, rendered-MVC and opt-in persistence tests. Vernac test declarations, test discovery and their runner are work for this release. View tutorial · Task board source at the planning baseline

The executable test sources are in both wizard templates and in examples/document-workspace-scenarios. The wizard runs the domain and rendered MVC scenarios with the default Maven test lifecycle. The Document Workspace uses the same permission evaluator for its projected action and command guard. Its postgres profile verifies persisted state after successful, denied and rolled-back commands. Release verification checks the named cases in both profile reports. Scenario tutorial

Two applications of the test language

  1. The wizard task board is the user-facing acceptance project. Keep its familiar create, complete and reopen flow. Use the existing Java tests as independent expectations while introducing Vernac scenarios. Exercise a project created by the packaged wizard as well as the template in the repository.
  2. A small Document Workspace fixture makes one authorization rule observable from both a use case and a view. Model a document, a delete permission, a permitted actor, a denied actor, a typed view projection and a deletion event. Compute the projected action visibility from the same permission decision as the command guard. Bind the form through the supported enum condition and named endpoint. The complete SaaS example belongs to the archived extension line. The new fixture uses only core Vernac and also supplies a repeatable workload for 0.7.0.

Milestones and handoffs

Each row is a reviewable implementation increment. The identifiers provide stable references for implementation PRs and their acceptance evidence.

ID Depends on Deliverable Acceptance before advancing
V1 Current view changes Complete the manual wizard review. Turn each discrepancy into a reproduction and regression. Record expected page, action, validation and error behavior. Real wizard project renders the board and problem page. An open row offers Complete, a done row offers Reopen, and a successful submit returns to the board. Record the installed plugin and project revisions.
V2 V1 scenarios Specify test sources, scenario identities, fixtures, actions, observations and profiles. Extend the grammar, AST, symbol resolution and diagnostics. The positive corpus resolves across files. Wrong value types, ambiguous imports, duplicate scenarios, missing endpoints and test-only names in application code produce located errors. A published application/module contains only its production inputs.
V3 V2 Implement discovery and a fast runner against generated Java and the current runtime. Connect it to the Maven test lifecycle. A fresh CLI Maven run discovers the expected case IDs. A deliberately wrong expectation makes the build fail at the right source line. Repeated and parallel runs isolate fixtures, event observations and actors.
V4 V2, V3 Exercise named views and actions through the real MVC renderer. Add the PostgreSQL execution profile and the document fixture. The acceptance matrix below passes on its specified backends. Selecting a required backend that cannot start produces a failing run with its cause. CI retains the executed case IDs and reports.
V5 V2 for editor work, V3–V4 for final verification Extend LSP, IntelliJ, formatter, wizard and documentation. Add release checks and freeze the 0.6 scenario corpus. From the packaged plugin a developer creates a project, navigates from an assertion to a declaration, fixes a diagnostic and runs its tests. Release evidence includes generated-project, database, browser and compatibility checks.

Test contract to settle in V2

This notation is a design specimen for V2. The words and punctuation are provisional. The assertion about the direct use case deliberately stands on its own even if the view would hide the form.

suite DocumentAccess
  scenario MemberCannotDelete
    given workspace = selectedWorkspace
    given document = stored Document("Minutes") in workspace
    given actor = workspaceReader in workspace
    when render DocumentsPage as actor
    expect action DocumentsWeb.delete for document.id is absent
    when invoke DeleteDocument(document.id) as actor
    expect permission denied
    expect stored Document(document.id) equals its initial state
    expect emitted DocumentDeleted count 0
    expect calls to DocumentStore.delete count 0

In this case denial happens at entry. Java-backed modify currently retains field writes if a later invariant fails. A database rollback also cannot rewind an already mutated Java object. V3 must observe the actual object and committed storage separately. The stronger candidate-state guarantee belongs to the interpreted behaviors in 0.7.0. Current failure contract

Execution profiles and integration points

Profile Implementation choice for the first runner Observable evidence
Domain and ports Call the real generated domain/use-case entry point. Supply isolated fixtures and in-memory repositories or recording adapters. Exercise the generated guard for a protected operation. Returned values, state, denial, recorded events and calls. Capture an independent value snapshot before a mutation so two references to one live object cannot yield a false pass.
Rendered MVC Use the existing Spring MVC, Thymeleaf and security setup with a test repository. Resolve a view, component or action in Vernac and check the rendered response/DOM. Form method, resolved URL and row identity, action presence or absence, escaping, validation status and redisplay. Match the intended row when several forms use the same endpoint.
PostgreSQL Reuse the disposable database setup and generated JDBC/Flyway path. Start the service once per suite, isolate test data per case/worker and read committed results through a fresh transaction. Real round trip, rollback and event/outbox visibility where configured. Run tenant isolation and migration proofs against PostgreSQL. An embedded SQL profile can be added if a measured need justifies its separate dialect contract.
Browser smoke Start the packaged or freshly generated application. Visit the board, fill the form, submit and follow navigation in a real browser. The rendered form works with CSRF, validation feedback stays usable and the action appears on the correct row after redirect. Keep browser startup outside the default domain test run.

Pure domain tests can construct objects directly. For a protected use case the fast runner must enter through the generated execute with an active, synchronized Spring transaction, a verified actor and the selected tenant. Use a test transaction manager and recording stores for this profile. The existing AuthorizationGuardTest shows how to establish the transaction and tenant in memory. Expect ACCESS_DENIED for a denied actor with valid scope and a configuration error for a missing transaction. Test these paths independently so an incorrectly wired fixture cannot satisfy the denial case. Use-case authorization contract

Implement V2–V3 next to the existing ANTLR grammar, project loader and resolver in vernac-compiler. Produce a typed scenario plan with fixture, action and assertion nodes. For the first Maven integration, generate a small test-scoped JUnit bridge and register test sources/resources in the Maven test phases. Put execution behind a runner API so future clients can supply the same plan directly. Keep compiler, launcher and test libraries off the production runtime classpath unless the application already needs a particular dependency. Verify this with a built JAR and its dependency scopes.

Map failures back to .vernac file, line, assertion, expected and observed values. Publish JUnit XML with stable case IDs and profile names. Include discovery counts, executed, failed, skipped and setup failures. Give the editor the same main/test visibility rules and compiler diagnostics. Test completion and Go to Declaration for use cases, fields and view actions, including incomplete source and unsaved edits. Formatting twice must preserve meaning and yield the same output.

Release acceptance matrix

Case Required observation Execution
T1 · Task lifecycle Create, complete and reopen preserve the task ID and expose the expected status and row action. The empty board and a second page render correctly. Domain, rendered MVC and one browser journey
T2 · Invalid input A blank title returns 422 with feedback and no task is added. A request missing CSRF is rejected. A title containing markup renders as text. An unknown task reaches the problem page. Rendered MVC, browser for validation and recovery
T3 · Protected deletion With a permitted actor the correct action is visible, direct invocation succeeds and a single deletion and event are observed. With a denied actor the action is hidden. A direct command and a correctly formed direct POST are rejected, with no business write or deletion event. Domain and rendered MVC, database assertions in T4
T4 · Committed effects After successful delete a fresh read sees the removal and expected durable event when configured. After denial or an injected transaction failure a fresh read sees the original document and no new committed event. PostgreSQL, including a repeat run with clean fixtures
T5 · Test-system failure Rename an action, change an assertion to the wrong type, alter one expected result, and select an unavailable required profile in separate runs. Each fails at the appropriate stage with a case or source reference. Compiler, CLI Maven build and CI report audit
T6 · Compatibility Build an existing all-Java-behavior application with its original tests. Build a wizard application containing both Java tests and Vernac tests. Inspect the production JAR for leaked test classes, fixture data and test descriptors. Maven clean build, packaged wizard

Release evidence and handoff to 0.7.0