Skip to content

Investigate a market from the Beca chat with Expected Parrot #119

Closed
11 of 11 issues completed
Closed

Description

@beca-oc

Destination

A spec, ready for an unattended build, for the Beca chat on Onyx where someone names a market question and gets the study designed, populated with simulated respondents, run on a real model, charted and explained in that conversation, reliably. Reliable means the eleven Expected Parrot sample flows and three scripted market investigations pass end to end on repeated runs, through the chat, with transcripts and charts as proof.

Notes

  • Owner ask, 2026-11-01: a "magical wow experience so that someone can reliably investigate a market using the Expected Parrot tools". Beca already has every Expected Parrot demo tool registered.
  • What exists: Plan #109 and PR #110 (branch agent/claude-ep): the FastMCP wrapper scripts/subconscious/serve_ep.py over EDSL 1.0.9, persona 3 "EP Research Agent" on the agent-dev stack (Claude Haiku 4.5 on Bedrock), eleven demos passing through the chat on the free test model, the persona prompt docs/subconscious/ep-research-prompt.md, the demo harness ep_demo.py. Test page: https://agent-dev.taila3aadb.ts.net:3011/app?agentId=3 (the persona is public since 5057534; MAX_LLM_CYCLES=20 applied on agent-dev 2026-11-01).
  • Two owner experiences that define the gap. Starter "one open question, run it on the free test model": the answer was the EDSL placeholder "Hello, world X." Starter "choice-based conjoint, run on the test model, show the importance chart": 18 steps, every choice empty, no chart. Both are honest and both are empty. The test model proves mechanics only; the wow needs answers from a real model and sensible defaults the user never has to spell out.
  • Credential facts (names only): Doppler project beca holds OPENAI_API_KEY, GEMINI_API_KEY, AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY, ANTHROPIC_TOKEN. The agent-dev Onyx Bedrock provider uses AWS_BEARER_TOKEN_BEDROCK in us-east-1 with model configurations including us.anthropic.claude-haiku-4-5-20251001-v1:0. The wrapper's venv ~/ep-venv has no boto3. Plan Plan: Beca designs, recruits, runs and analyzes Expected Parrot studies from chat #109 states "no Anthropic API key"; agents run on existing subscriptions and recorded exceptions only.
  • Skills every session consults: prior-art-check before any new capability; research for facts outside the repo; grilling with domain-modeling for decisions; prototype for the reference transcript.
  • Standing preferences: never send external messages; secrets from Doppler, never printed; the eleven demos stay green (36 wrapper tests plus the live-chat demo run); no validation caveats in product UI beyond what the owner locks in the answer-style ticket; one request, one change.
  • Execution override: a wrapper or prompt defect found while resolving a ticket may be fixed on agent/claude-ep (PR feat: Beca designs, runs and analyzes Expected Parrot studies from chat (#109) #110) in the same session, with its demo rerun as proof. Decisions still resolve only through their ticket.
  • Proof for the eventual build: the three scripted market investigations and the eleven demos run through ep_demo.py against persona 3 with a non-admin account (~/.config/ep-mcp/test-user.env on agent-dev), three consecutive passes, transcripts and charts saved.

Decisions so far

Not yet specified

  • Human respondents through EDSL humanize and Prolific (family 12): sharp only after the live-model path works and the owner sets a recruiting budget.
  • PDF and image stimuli (family 13): the chat has no file-path route to the wrapper yet.
  • Memory across conversations: whether a study started in one chat can be continued or compared in another, and how results are named and found later.
  • Validation against human results: how a simulated finding is graded, once a human path exists.

Out of scope

Activity

  1. beca-oc commented on Nov 2, 2026

    @beca-oc
    Author

    Craft stand-up on agent-dev, 2026-11-02 (route from Choose the Onyx surface for the thin layer into Expected Parrot (#130)):

    • Running: upstream Onyx v5.0.3 with the Craft overlay as Compose project craft-ep (~/craft-ep/onyx/deployment/docker_compose), web on http://agent-dev.taila3aadb.ts.net:3390, API health ok. Sandbox image craft-ep/sandbox:v5.0.3-edsl1.0.9 = upstream sandbox plus edsl==1.0.9 and boto3>=1.39.12; ep info runs inside it. Test admin in ~/craft-ep/admin.env (mode 600).
    • Blocked: Craft reports "not available" because upstream v5.0.3 makes Craft require the Business licence tier, and its self-hosted tier comes only from an installed licence (ee/onyx/utils/tier.py _self_hosted_tier). The older LICENSE_ENFORCEMENT_ENABLED=false developer bypass is gone in v5.0.3 but still present in our fork. The Onyx enterprise licence (backend/ee/LICENSE lines 18-20) permits development and testing without a subscription.
    • Also needed: a Bedrock credential for the respondent and Craft model (no provider configured yet on this stack).
  2. beca-oc commented on Nov 2, 2026

    @beca-oc
    Author

    Craft stack rebuilt from fork main (5b4b5dd), 2026-11-02:

    • Running on agent-dev as Compose project craft-fork, http://agent-dev.taila3aadb.ts.net:3390, API healthy. Tier reads Enterprise in developer mode (LICENSE_ENFORCEMENT_ENABLED=false, dev and testing only per backend/ee/LICENSE), so Craft is available and a sandbox session starts.
    • Sandbox image craft-ep/sandbox:fork-5b4b5ddae-edsl1.0.9 (fork sandbox plus edsl==1.0.9, boto3>=1.39.12). Expected Parrot's 15 edsl-research skills imported from expectedparrot/ep-skills at f8ad7545a through Onyx's GitHub skill import, all enabled.
    • Bedrock provider copied from the dev chat stack; Haiku 4.5 set as the default chat and Craft model.
    • Blocked: every Anthropic model call on Bedrock in account 767397963735 fails with INVALID_PAYMENT_INSTRUMENT (AWS Marketplace subscription), from both the dev chat stack and the Craft stack, with the bearer key and with the IAM roles. Open-weight Bedrock models answer from the Craft container: moonshotai.kimi-k2.5, deepseek.v3.2, openai.gpt-oss-120b-1:0.
  3. beca-oc commented on Nov 2, 2026

    @beca-oc
    Author

    First end-to-end Expected Parrot study through Onyx Craft, agent-dev, 2026-11-02 (non-admin test user, session 01694b97):

    Turn User Craft agent (GLM-5)
    1 "Investigate the US meal-kit market: who buys, why they choose or leave, what they would pay per serving." Read Expected Parrot's create-study skill; returned a plan (decision, two segments, questions incl. Van Westendorp, respondent model, sample) and waited.
    2 "Approved. Run the pilot." Built the study in Expected Parrot's layout (study_survey.py, study_agent_list.py, study_model_list.py, Makefile, create_results.py), ran 10 respondents on Llama 4 Maverick through Onyx's gateway, showed answers and a computed cost ($0.02 pilot, $0.24 projected), waited.
    3 "Approved, 100 per segment. Run it and show me the charts." Ran 193 usable respondents, wrote 8 PNG charts and results_full.csv, reported actual cost $0.72.

    What made it work (all configuration, plus one fork fix):

    • Agent model: GLM-5 on Bedrock (Kimi K2.5 and DeepSeek v3.2 skipped the study for desk research in a side-by-side run). Anthropic models stay off per owner.
    • Respondents: EDSL openai_compatible service pointed at Onyx's gateway with the sandbox's own token, so no new keys; openai[aiohttp] added to the sandbox image; EDSL_MAX_CONCURRENT_TASKS=8 because 50 exhausted the API's Redis pool.
    • Craft organization instructions (Onyx setting) route study requests to Expected Parrot's skills, set the gates, the cost rule (Bedrock prices from Rehoboam's tracing.py) and the output folder.
    • OPENCODE_PROMPT_INACTIVITY_TIMEOUT_SECONDS=1800: the 200 s default cut full runs off mid-study.
    • Fork bug fix fix(llm): pass api_base through the patched LiteLLM bridge check (#132): every streamed LLM call on fork main failed since 785d4b4.

    Known gaps: the reply names the chart folder instead of showing charts inline; it called simulated brand shares "market share"; a new user must switch on the 15 shared skills before they apply.

  4. beca-oc commented on Nov 2, 2026

    @beca-oc
    Author

    Three gaps closed and every Expected Parrot demo run through Craft, 2026-11-02. Setup recorded in feat(craft): run Expected Parrot studies in Onyx Craft (#133).

    Gap Fix Proof (brand-new user, no skills switched on)
    Charts named, not shown ep-charts.ts OpenCode plugin appends each new chart's inline Markdown to the tool result; instructions require it meal-kit run: 4 inline charts, all load; rendered in Craft's chat
    "market share" for simulated shares plugin flags market share / penetration / adoption / market size / reach in what the agent writes; shares as "% of simulated respondents" meal-kit and streaming runs: zero banned terms in prose or chart titles
    Per-user skill switching pinned ep-skills copied into the sandbox /tmp at start (Craft's OpenCode rules allow /tmp) agent read create-study and 4 more skill files from /tmp/ep-skills

    Demos (quickstart, survey_logic, agents_scenarios, import_csv, labeling, pretest, results_cache, nps, two_pass, enrich_agents, conjoint): all pass; labeling, pretest and enrich_agents needed instruction fixes and a rerun (the agent coded by hand, used its own sub-agents as reviewers, or swapped a trait for a scenario). Known weak spot: the conjoint explained a noisy n=52 price dip as a positioning effect.

  5. beca-oc commented on Nov 2, 2026

    @beca-oc
    Author

    Final-image rerun (sandbox image with ep-charts.ts and /tmp/ep-skills, final Craft instructions), 2026-11-02, every flow three turns through Craft's API as non-admin users:

    Flow Inline charts that load Banned share terms Errors
    streaming preference 2 0 0
    quickstart 4 0 0
    survey_logic 5 0 0
    agents_scenarios 2 0 0
    import_csv 3 0 0
    labeling (EDSL checkbox + free text coders) 6 0 0
    pretest (EDSL reviewers, no sub-agents) 1 0 0
    results_cache (4 of 4 second-run answers from cache) 2 0 0
    nps 4 0 0
    two_pass 6 0 0
    enrich_agents ({{ agent.career }} trait) 4 0 0
    conjoint (importance, part-worths, price curve, choice shares) 12 0 0

    Earlier brand-new-user meal-kit run on the same image: 4 inline charts, 0 banned terms, skills read from /tmp/ep-skills. Labeling, nps, conjoint and agents_scenarios each needed one rerun because my test script was edited while running; the Craft turns themselves did not fail.

  6. beca-oc commented on Nov 2, 2026

    @beca-oc
    Author

    Plan families 12 and 13 through Craft on the final image, 2026-11-02 (three turns each, non-admin users):

    Flow Result
    AI-moderated interview (guide, interviewer, one follow-up per answer) 20 hybrid + 20 remote simulated workers; themes by group; 3 inline charts load; $0.72
    Question distribution across models same numerical question on Llama 4 Maverick (mean 4.65 h/week) and Kimi K2.5 (4.17); 2 inline charts load
    Google Form rebuild form mapped to MultipleChoice, CheckBox, LinearScale, FreeText; 4 inline charts load; $0.01
    Label validation against gold 120/120 correct, Cohen's kappa 1.000; confusion matrix inline
    Image stimulus (uploaded ad) first run passed only the file path, so the model never saw the ad; after adding the FileStore rule the rerun sent the image, answers quote the ad; 40 shoppers, $0.10
    PDF stimulus (uploaded two-page brief) each page's text as a scenario; 20 simulated brand managers; risk chart inline
    Humanize (real respondents) blocked, reported honestly: .humanize() fails with "The API key you provided is invalid"; no Expected Parrot account or key exists (none in Doppler beca). Needs an Expected Parrot account to recruit humans.

    Banned share terms: 0 in every flow.

  7. beca-oc commented on Nov 2, 2026

    @beca-oc
    Author

    Expected Parrot application tools through Craft, 2026-11-02. Every public package in Expected Parrot's directory except humanize-based spence (skipped per owner) and uxtest (requires Python < 3.13; sandbox has 3.13) ran one three-turn flow as a non-admin user. Pass means the agent ran the tool's own commands, finished every turn, and hit no errors.

    37 of 37 pass: epiq, conversation, aivis, ariel, bewley, bower, burr, dewey, flyvbjerg, green, golden, helmer, ishikawa, kahn, katz, langley, mccall, mcda, messick, niles, oneheart, perla, premortem, pruefung, raiffa, roth, stanton, tommy, treffen, umriss, urteil, vorhersage, voting, zermelo, zugunruhe, zwicky, zwill.

    Examples: aivis measured brand mentions across two models; green ran a choice experiment and charted attribute importance; ishikawa rendered its fishbone SVG inline; langley named low awareness as the least-refuted hypothesis; raiffa computed the expected-value policy; zugunruhe migrated a survey with zugunruhe migrate. Inline charts loaded wherever made; the only banned-term hits were stanton citing Grand View Research's real market size as a source.

    Private packages (AISS, Earnings, Kean, Zitate) could not be tested.

  8. beca-oc commented on Nov 3, 2026

    @beca-oc
    Author

    Reliability pass on Craft + Expected Parrot, 2026-11-03 (agent-dev, non-admin test users, PR #133 head 34aa5f624 + #132).

    Item State
    1. Reliability Not passed. Core + 3 market investigations: c1 41/43, c2 36/43, c3 34/43, c4 39/43 checks; never 3 consecutive all-green runs. Demo (25) and tool (39) cases not run: the $25 Bedrock cap was reached.
    2. Plan gate red/green Passed. Red without the gate (Results written on turn 1), green with it (3/3 gate cases). The gate was bypassable via ep run; fixed.
    3. Wow Passed. "Market research" starter prompts on Craft's welcome page for a non-admin user; first chart 73-274 s after approving the full run, reported by tdd.
    4. Durability Passed. Instructions 3,827 chars; gate, turn rules and banned-term reply check in ep-charts.ts; rebuild.sh rebuilt the running stack; README updated.
    5. Map hygiene Passed. #124-#129 and PR #110 closed as superseded by #130.
    6. Delivery Blocked on a human. #132 and #133 have local gates on the exact heads and independent review passes, no threads; the agent account lacks merge permission.

    Findings that change the plan: GLM-5 cost $141 of agent tokens on 2026-11-02 alone; Craft now runs MiniMax M2.5 (about $0.70-1.00 per full study vs about $1.50). Remaining flaky checks are model compliance: the "simulated respondents" caveat on follow-ups and pilot size on conjoint.

  9. beca-oc commented on Nov 6, 2026

    @beca-oc
    Author

    Closing on the owner's instruction. #133 merged as aae1a142811a89597cec1318d851c5bdaf90ffd3, and #132 as 0eb0fc21a. Not deployed to production; the dev stack on agent-dev runs 8dba9f98b.

    Reliability was not fully reached, and that was accepted:

    Commit Run Result
    d4977e435 core + market, 3 runs 43/43, 38/43, 43/43
    d4977e435 demos 19/25 cases
    d4977e435 tools 31/39 cases
    e60548559 core + market, 2 runs 42/43, 42/43
    8dba9f98b concept_image and gate_small_task 10/10

    The plan gate is red without the gate and green with it. Starter prompts show for a non-admin user. The first chart came 81-367 s after approval in the clean runs, with one miss at 1,097 s against the 900 s limit.

    Open gaps: the agent can use its own EDSL script in place of a tool the user names (7 of 39 tool cases), can answer a small coding task itself in plain text, and sometimes leaves out the simulated caveat. The 14 failed demo and tool cases were not rerun on a later commit. A tool case passes on --help, so it does not prove the tool did the work.

    Lessons are in deployment/craft-ep/README.md under "What we learned". Bedrock spend for this goal: $69.40.

  10. beca-oc commented on Nov 6, 2026

    @beca-oc
    Author

    New finding after the merge of #133, from another session's testing on the final build (8dba9f98b). No code has changed for it yet.

    In session db10138c, turn 4 asked "What market share would BrightBrew get at $2.99?". That session reports a reply that ran no tool and said 71% of office workers (14/20) and 45% of students (9/20) scored 4-5 at $2.99, without the word "simulated" on those shares.

    I recounted results_full.csv for that session: 20/20 office workers and 13/20 students scored 4-5 at $2.99. So the reported numbers do not match the study, and 14/20 is not 71%.

    The tests do not catch this. no_banned_terms and says_simulated read only the reply's wording, and no check compares a follow-up reply's numbers with the Results file. So the 43/43 runs do not show that follow-up numbers are correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    wayfinder:mapDecision map for a bounded product outcome

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions