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
--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.
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]
@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.
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.
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.
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
@bindcan replace one default without copying the whole capability module. @execute functional scheduler: graph-strictturns 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.