Highly experimental. WeaveMark’s notation, Processor, examples, and public interfaces are still evolving — expect rough edges, surprising results, and breaking changes.

Executable report tutorial

Turn live evidence into a finished market report.

Follow the checked-in VALE3 market snapshot from reusable finance capabilities and trusted Python bindings, through a strict execution graph, to a grounded Markdown analysis and a polished standalone HTML dashboard.

You inspect Reusable definitions, default bindings, and a strict functional graph.
You run Finance and web-search capabilities before grounded synthesis.
You produce A report, execution trace, and responsive HTML dashboard.

In the repository

Source and folder links open GitHub. Commands assume the repository-root setup from Tutorial 1.

0. Setup and trust boundary

Work from the repository root. This workflow calls live finance and search providers, runs text-model synthesis, and executes reviewed local Python bindings. It consumes provider/model quota.

cd weavemark
pip install -e ".[examples]"
weavemark --help
Trust boundary: --no-protections allows the checked-in companion module to run. Review promplets/domains/finance/definitions/companions/market_data.py before granting that capability, and never use this flag for code you do not trust.

1. Import reusable finance capabilities

The entrypoint does not redefine generic market-research operations. It imports two execute-phase semantic definitions from the finance domain library:

@use weavemark.domains.finance.market_research exposing fetch_asset_snapshot search_asset_context

The shared module declares each capability’s parameters, return behavior, effects, and semantic purpose. For example:

@define fetch_asset_snapshot
  @phase execute
  @scope self
  @returns value

  @param ticker
    Provider-compatible ticker symbol to fetch.

  @effect finance_data read

  @body
    Fetch quote, company profile, financial metrics, and analyst context for
    @{ticker} using the bound finance-data implementation.
Why this matters: the module packages both the semantic interface and a reviewed default adapter. Importing selects the adapter as metadata, but composition does not execute Python. Runtime protection still decides whether the helper may run.

2. Activate defaults and declare the execution graph

The finance module owns its default effect bindings next to the semantic definitions:

@bind finance_data language: python from: "./companions/market_data.py" symbol: fetch_asset_snapshot
@bind web_search language: python from: "./companions/market_data.py" symbol: search_asset_context

These defaults enter the compiled artifact with their module origin intact. The entrypoint only needs to select the functional engine and strict scheduler:

@execute functional
  scheduler: graph-strict
  allow_effects: [finance_data, web_search]
Override later: add a local @bind finance_data ... with the same capability name to replace only that imported default. Explicit local bindings always win.

Calls in the readable document become named graph nodes. The uses: edge makes the research-context node wait for the finance snapshot:

@fetch_asset_snapshot ticker: "@{provider_ticker}" as: asset_snapshot

@search_asset_context ticker: "@{display_ticker}" company_name: "@{company_name}" focus: "@{research_focus}" as: web_context uses: asset_snapshot

Compilation validates effects, arguments, result names, and dependencies before execution imports or runs the companion.

3. Ground the report in named results

After the two capability nodes run, their values enter the document as @{asset_snapshot} and @{web_context}. The remaining Markdown is the final synthesis instruction:

## Draft Report

Use @{asset_snapshot} and @{web_context} to write a rigorous market-learning
brief about @{company_name} (@{display_ticker}). Ground news and outside-context
claims only in the web-search result titles, snippets, source labels, and URLs.
Clearly label snippets as search-result evidence rather than full-page readings.

The promplet asks for an executive snapshot, operating drivers, provider metrics, source-grounded context, evidence tensions, scenarios, uncertainties, and next primary-source checks. It also forbids a buy/sell recommendation.

Evidence boundary: the search binding filters irrelevant hits and restricts the official-context bucket to Vale-owned domains. The final prompt still labels search snippets as limited evidence rather than pretending they were full-page reads.

4. Apply a reusable presentation promplet

The functional engine returns a complete Markdown report. One @package step then applies reusable HTML-dashboard instructions to that canonical @{output}:

@package instructions: module:weavemark.std.presentation.information_dashboard_html file: vale3-market-dashboard.html
  Title the deliverable "VALE3 Market Learning Dashboard" and identify the
  analyzed security as Vale S.A. on B3 under ticker VALE3. The finance provider
  may label the instrument VALE3.SA; explain that notation once, compactly.

  Give the dashboard an extractive-industry research character without adding
  decorative imagery: make commodity exposure, operational drivers, balance
  sheet signals, evidence quality, cyclical risks, and watchlist items easy to
  scan. Use the current company name, Vale S.A.; mention the historical
  Companhia Vale do Rio Doce name only if useful for identification.

  Retain Portuguese-real amounts and Brazilian-market terminology exactly when
  supplied. Never convert currencies or infer missing values. Keep the final
  educational, non-recommendation disclaimer visible but quiet.

The referenced promplet supplies reusable accessibility, responsive layout, source-link, security, print, and visual-design obligations. The local body adds VALE3-specific guidance and wins if the two ever conflict. Both are compiled and executed in one semantic application call.

Transform the completed Markdown report below into an exceptional standalone
HTML information dashboard. Preserve its meaning, evidence, qualifications,
source URLs, and uncertainty. Do not add facts, metrics, dates, quotations,
citations, or links that are absent from the report.

<source-report>
@{output}
</source-report>

5. Run the checked-in VALE3 workflow

The saved-artifact runner targets Vale S.A. on B3 under ticker VALE3. Its provider symbol is VALE3.SA.

bash examples/saved-artifact-workflows/market-snapshot/run.sh

The runner expands to this command:

weavemark promplets/catalog/executable/market-snapshot.weavemark.md \
  --vars-file examples/saved-artifact-workflows/market-snapshot/inputs/vars.json \
  --run \
  --no-protections \
  --output examples/saved-artifact-workflows/market-snapshot/outputs/execution-output.md \
  --show-output \
  --no-file-summary \
  --trace-output examples/saved-artifact-workflows/market-snapshot/outputs/execution-trace.md \
  --verbose \
  --batch-only \
  --open

The final --open asks WeaveMark to open every successfully packaged artifact after the run. Remove it for CI, remote shells, or other headless environments.

6. Inspect the complete artifact chain

The successful run writes three complementary artifacts:

  • execution-output.md — the grounded market-learning report.
  • execution-trace.md — execution metadata, graph steps, prompts, and responses.
  • vale3-market-dashboard.html — the standalone responsive report produced by semantic packaging.
See the finished result: open the live VALE3 dashboard, or inspect the Markdown report and execution trace.

The trace shows three functional steps: finance data, search context, and document synthesis. Packaging is a subsequent promplet-application step that persists the HTML deliverable.

Final step: Use the output

This workflow finishes with a human-facing report, not a prompt that still needs to be pasted into another assistant.

What to do with the output: open vale3-market-dashboard.html to review, share, or print the analysis; use execution-output.md in downstream text workflows; and retain execution-trace.md when you need to audit the evidence and model lineage. Re-run before relying on time-sensitive market data.

What you learned

  • Execute-phase semantic definitions make host capabilities reusable without hiding their effects.
  • Importing a capability module selects its reviewed default implementations without running them during composition.
  • Protection policy still authorizes, prompts for, or blocks Python execution at runtime.
  • A local @bind can replace one default without copying the whole capability module.
  • @execute functional scheduler: graph-strict turns readable calls into a validated dependency graph.
  • Named results ground final synthesis in real capability outputs.
  • @package instructions: applies a reusable promplet to @{output} and persists the result.
  • One run can produce raw analysis, an audit trace, and a polished final deliverable.
Next: turn a compiled software specification into a generated project in Spec to app, or generate finished media in Illustrated stories.