Skip to content

Explorations: one place chooses the capture strategy, and ARCHITECTURE describes strategies - #76

Draft
brentvatne wants to merge 4 commits into
@brent/capture-strategiesfrom
@brent/capture-strategies-modular
Draft

brentvatne wants to merge 4 commits into
@brent/capture-strategiesfrom
@brent/capture-strategies-modular

Conversation

@brentvatne

@brentvatne brentvatne commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Stacked on #74. It makes the exploration side of Explore modular: a capture strategy is one case in one place, and ARCHITECTURE.md says what a strategy decides and what the host owns. It changes no behaviour.

What and why

One place chooses the strategy. explore:binary and explore:session each picked a strategy with the same branch:

const model = replay ? replayModel(replay, platform, limits) : flows ? await flowsModel(flows, platform, limits, options, environment, say, app)
  : await preflightModelSession(options, environment, say);

src/binary/strategy.ts now holds that choice in three functions:

  • chooseStrategy(options) checks the options before any device starts. It returns a model, a replay plan or a flows file, and refuses options that would do nothing.
  • strategyInputs(choice, hints, environment) reads the {{secret:NAME}} inputs the strategy types.
  • startStrategy(choice, …) returns an ExplorationStrategy: the session that drives the explorer's tools, how the report names it, and whether it takes the flow tools.

A new strategy is one more case of StrategyChoice. The model-session code moves out of run.ts with these functions, and assertAppUrl moves to binary/app-url.ts, so strategy.ts doesn't import run.ts.

The archive readers move down a layer. Three modules imported the tar.gz and zip readers from binary/archive.ts, a layer above them: shared/controller-cache, capture/local-simulator and ci/baseline-wait. The readers now live in src/shared/archive-entries.ts. binary/archive.ts keeps what is specific to apps: plists, manifests, icons and the iOS bundle.

ARCHITECTURE.md:

  • lists binary/ as a folder and a layer, with its real imports;
  • adds a "Capture strategies" section on what a capture decides (what to look at, how to get there, what to record) and where each part lives, in reviews and in explorations;
  • says reviews have no strategy seam yet.

Screenshots

No visible change.

Code examples

No change to usage. A strategy is added in binary/strategy.ts:

export type StrategyChoice = { kind: "model" } | { kind: "replay"; plan: ReplayPlan } | { kind: "flows"; plan: FlowPlan };

Try it

Run the flows from #74 on a simulator build. Its strategy is chosen and started through the new module:

npm ci && npm run build
node dist/cli.js explore:binary path/to/app.tar.gz --simulator local --flows flows.json

Testing

Not in this PR

  • A strategy seam for reviews (capture:review), and flows in reviews.
  • Comparing two flow runs, and the Viewer's step-by-step flow view.
  • A non-LLM crawler, which needs a stricter action policy in the explorer first.

🤖 Generated with Claude Code

…he explorer

binary/strategy.ts holds what explore:binary and explore:session each branched on: chooseStrategy
checks the options before any device starts (a model, a replay plan or a flows file),
strategyInputs reads the {{secret:NAME}} inputs they need, and startStrategy returns the session
that drives the explorer's tools, with how the report names it. A new strategy is one more case
there. assertAppUrl moves to binary/app-url.ts so strategy.ts does not import run.ts.
… describes capture strategies

shared/controller-cache, capture/local-simulator and ci/baseline-wait imported them from
binary/archive, a layer above them. ARCHITECTURE now lists binary/ as a layer, and a new section
says what a strategy decides and what the host (route-capture in a review, the explorer in an
exploration) owns.
@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Viewer preview of 6394778 · reports from brentvatne/euxy#163

Report Changes Open
Android · sdk_gphone64_x86_64 15.0 5 Map · Screens · Compare
iPhone 17 · iPhone 17 26.5 · light + dark 11 Map · Screens · Compare
iPhone Duo (closed) · iPhone Duo 27.1 · light + dark 34 Map · Screens · Compare
iPhone Duo (open) · iPhone Duo 27.1 · light + dark 34 Map · Screens · Compare

The link stays the same on every push. Deploy run

… access by platform, counts turns, and hands the explorer the checkpoints a flows run never attempted
…nputs wait for the session's platform on a flows run

runSessionExploration now chooses its strategy before it knows the platform, so the #74 change
is ported onto strategyInputs: a flows run without --platform reads its secrets once the
session reports its platform.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant