feature

Study authoring agent

The study authoring agent writes study Code — which definitions to read, what to collect per event, and what results to publish — and can run studies for you.

It must not author pin_cell / Put on chart layouts. After research results look right, use the Forward insight agent.

Tools (typical)

Tool

Side

Notes

get_study_state / read_study_files

server

Inspect

search_flows / search_indicators / resolve_dependency_contract

server

Deps

list_user_flows / read_flow_full

server

Upstream defs

execute_study_run(s) / get_run_results

server

Run

propose_study_edit / propose_study_code_execution

client

Human approval

update_title

server

Rename entity (emits entity_title_updated)

Hard constraint — no pins

Chart popover / pin_cell authoring is not this agent’s job. Put on chart uses the Forward insight agent / rewrite agent.

Do not ask it to author pin_cell, popover_layout, or bind.expose for Put on chart. Point it at research results only; then use Forward insight agent.

Scope / report handoff

Declare dimensions with explicit roles so pin agents can bind cleanly:

  • role: "scope" (default) — click-known conditioning; must appear in ctx.scopeEvent.

  • role: "report" — measured-later outcomes; valid in report indexedBy and collect rows; never in scopeEvent or pin scope.

Author pin-ready studies: scope-role dims in scopeEvent (before outcome measurement), outcome shares as value columns, report matrices may be wider than pin indexedBy. The rewrite agent adds pin_cell popover_layout later.

Prompting patterns

Good

  • “Count bull_bar events from definition alias bull and publish a metric + table.”

  • “Collect 10-bar forward return in ATR units; publish mean and median.”

  • “Slice by London vs NY session: London role: scope in scopeEvent; NY class role: report in the contingency table.”

Bad

  • “Add pin_cell so I can Put on chart” — wrong agent.

  • “Emit a new definition event when win rate > 55%” — studies do not emit.

  • “Ignore empty ATR and pretend n is 1000” — never inflate n.

  • “Delete next_regime from dimensions.declare” — use role: "report" instead.

Next

  1. Study API

  2. Forward insight agent