ES
AI & Agent-First EcosystemMCP · Graph · Sandbox

An agent-first coding workflow with Wysna

Trace a change across three targets, inspect a structured compiler error, and test and apply a two-file patch with the Wysna 1.1.0 Native SDK.

An AI coding agent is asked to raise the quantity limit of a quote from 1,000 to 1,200. In the shared-browser-app example, the same validation function serves a native CLI, a WebAssembly target, and a service. The agent queries the compiler to find those dependencies and checks the proposed change together with its test.

The commands below use the Wysna 1.1.0 Native SDK, Git, curl, and a POSIX shell such as Bash or zsh. On Windows, use Git Bash or WSL with the corresponding SDK. Start from a fresh checkout in a scratch directory.

Terminal window
git clone --depth 1 --branch v1.1.0 https://github.com/WashingtonYandun/Wysna.git wysna-workflow
cd wysna-workflow/examples/shared-browser-app
  1. Find what the change affects.

    Terminal window
    wysna graph --manifest wysna.toml --symbol quote_validation_code --rel impact --output-format=json-v1

    In result.entries, app, web, service and shared-pricing-contract are all marked affected. The report also records boundaries it cannot follow, such as JavaScript on the web target and C FFI in the service.

  2. Read a compiler error. In a separate file, try the new limit as a string.

    Terminal window
    sed 's/quantity > 1000/quantity > "1200"/' src/pricing.wysna > ../../pricing-invalid.wysna
    wysna check --output-format=json-v1 ../../pricing-invalid.wysna

    This check is expected to fail. The diagnostic contains code W2001, the byte span of the incorrect operand, and the types the agent needs to repair it:

    {
    "code": "W2001",
    "data": { "kind": "type_mismatch", "expected": "int", "found": "str" }
    }
  3. Preview and test a two-file patch. The JSON patch uses the integer 1200 and updates the test boundaries to accept 1200 and reject 1201.

    Terminal window
    curl -fsSL https://wysna.wysofia.com/agent-workflow/edit.json -o ../../edit.json
    wysna patch --manifest wysna.toml --edits ../../edit.json --test --output-format=json-v1

    Review result.changes and result.test_verification. The compiler reported status: "passed" for test:shared-pricing-contract and written: false in the preview.

  4. Apply the plan and run the project test. Replace PASTE_PLAN_HASH with the value of result.plan_hash from your preview.

    Terminal window
    PLAN_HASH=PASTE_PLAN_HASH
    wysna patch --manifest wysna.toml --edits ../../edit.json --test --expect-plan-hash "$PLAN_HASH" --apply --output-format=json-v1
    wysna project test --manifest wysna.toml
    git diff -- src/pricing.wysna tests/pricing.wysna

    The apply step checks the same plan and runs the test again. A successful apply reports written: true. If an input has changed, preview again to obtain a current plan.

This run verifies the shared pricing test. The JavaScript host, C adapter, and deployed service require their own tests.

The MCP guide shows how to expose graph queries, diagnostics and patches to a compatible client. Use the capability reference to understand compiler reports and runtime boundaries. The benchmark methodology documents the models, tasks and limitations of the separate AI evaluations.