@aarwitz/tapp 0.16.4 → 0.17.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/browser/app.js CHANGED
@@ -243,12 +243,14 @@ function renderDecision(run) {
243
243
  return;
244
244
  }
245
245
  const report = latest.report;
246
- const failed = report.gate?.failed === true;
247
- const verdict = failed ? "blocked" : report.inconclusive ? "caution" : report.verdict || "caution";
248
- card.className = `decision-card ${verdict}`;
249
- $("#decision-title").textContent = failed ? "Do not merge" : report.inconclusive ? "Inconclusive" : report.verdict === "ready" ? "Ready to merge" : "Review required";
246
+ // The decision reflects the GATE outcome (pass/fail/inconclusive), not a ship verdict — exploration
247
+ // only observes (ADR-0005). Without a gate, it's an observation, not a merge decision.
248
+ const outcome = report.gate?.outcome || (report.gate?.failed === true ? "fail" : report.inconclusive ? "inconclusive" : report.gate ? "pass" : null);
249
+ const cssClass = { pass: "ready", fail: "blocked", inconclusive: "caution" }[outcome] || "caution";
250
+ card.className = `decision-card ${cssClass}`;
251
+ $("#decision-title").textContent = outcome === "fail" ? "Do not merge" : outcome === "inconclusive" ? "Inconclusive" : outcome === "pass" ? "Ready to merge" : "Observed — not a release decision";
250
252
  $("#decision-detail").textContent = report.gate?.reasons?.join(" · ") || report.headline || "Review the evidence below.";
251
- $("#overview-evidence").innerHTML = `<div class="latest-run-line"><span class="verdict-dot ${esc(verdict)}"></span><div><strong>${esc(report.headline || pretty(verdict))}</strong><small>${esc(pretty(report.platform || "unknown"))} · ${compactDate(latest.createdAt)} · ${(report.contracts || []).filter((item) => item.passed).length}/${(report.contracts || []).length} contracts passed</small></div></div><p>${esc((report.gate?.reasons || ["No blocking release-gate reason reported."])[0])}</p>${reportLink(report)}`;
253
+ $("#overview-evidence").innerHTML = `<div class="latest-run-line"><span class="verdict-dot ${esc(cssClass)}"></span><div><strong>${esc(report.headline || pretty(cssClass))}</strong><small>${esc(pretty(report.platform || "unknown"))} · ${compactDate(latest.createdAt)} · ${(report.contracts || []).filter((item) => item.passed).length}/${(report.contracts || []).length} contracts passed</small></div></div><p>${esc((report.gate?.reasons || ["No blocking release-gate reason reported."])[0])}</p>${reportLink(report)}`;
252
254
  }
253
255
 
254
256
  function renderEvidence(runs) {
@@ -284,7 +286,11 @@ function renderRuns(runs) {
284
286
  $("#runs-list").innerHTML = runs.length ? runs.map((run) => {
285
287
  const report = run.report;
286
288
  const failed = report?.gate?.failed === true;
287
- const status = !report ? run.status : failed ? "blocked" : report.inconclusive ? "inconclusive" : report.verdict || "completed";
289
+ // Status reflects the gate outcome (pass/fail/inconclusive), mapped to the existing CSS classes.
290
+ const status = !report ? run.status
291
+ : report.gate?.outcome === "fail" || failed ? "blocked"
292
+ : report.gate?.outcome === "inconclusive" || report.inconclusive ? "inconclusive"
293
+ : report.gate?.outcome === "pass" ? "ready" : "completed";
288
294
  return `<button class="run-row ${run.id === state.selectedRunId ? "selected" : ""}" data-run-id="${esc(run.id)}"><span class="run-status ${esc(status)}">${failed ? "×" : report ? "✓" : "…"}</span><span><strong>${esc(report?.headline || `Release run ${run.id.slice(-8)}`)}</strong><small>${compactDate(run.createdAt)} · ${esc(pretty(report?.platform || "unknown"))}</small></span><em>${esc(pretty(status))}</em></button>`;
289
295
  }).join("") : '<div class="empty">No release runs yet.</div>';
290
296
  const selected = runs.find((run) => run.id === state.selectedRunId) || runs[0];
@@ -0,0 +1,75 @@
1
+ # Browser Release Studio
2
+
3
+ Status: current local-product contract as of 2026-08-08.
4
+
5
+ The browser Release Studio is an **optional local workspace**, not the current launch surface — the
6
+ **npm package (CLI + MCP + the GitHub Action) is the current objective** (ADR-0005). The Studio, the
7
+ VS Code extension, the desktop app, and the future managed SaaS are separate/paused tracks. Web is
8
+ also one application target beside iOS and Android; it is not a separate QA product. CLI, MCP, VS
9
+ Code, the Action, desktop, and future managed SaaS all adapt the shared product operations described
10
+ in [`PRODUCT-ENGINE.md`](PRODUCT-ENGINE.md).
11
+
12
+ ## Start locally
13
+
14
+ ```bash
15
+ npx -y @aarwitz/tapp app
16
+ ```
17
+
18
+ Tapp prints an authenticated one-time launch URL and opens it in the default browser. Use
19
+ `--no-open` when copying the URL manually and `--port 4317` only when a fixed loopback port is
20
+ needed. Drag/drop or Browse Folder copies source into a Tapp-owned workspace. Connect GitHub lists
21
+ repositories authorized to the local `gh` session and makes a shallow isolated clone.
22
+ `tapp app /path/to/repo` intentionally works directly in that checkout.
23
+
24
+ The local server binds to `127.0.0.1`. It owns workspace paths; browser requests cannot submit an
25
+ arbitrary server path. Mutations require an `HttpOnly` same-site session cookie, the exact local
26
+ Origin, and an in-memory CSRF token. Application runtimes, repository credentials, and evidence stay
27
+ in the local process/filesystem. This is a local trust boundary, not hosted multi-tenancy.
28
+
29
+ ## Product journey
30
+
31
+ 1. **Connect** a copied folder, an explicit checkout, or a repository authorized by local `gh`.
32
+ 2. **Detect and choose** an iOS, Android, or web target. Continue automatically only when the target
33
+ and configuration are conclusive.
34
+ 3. **Build, launch, and explore** the real simulator, emulator/device, or browser surface.
35
+ 4. **Understand the UI Map** through observed states, transitions, controls, provenance, and gaps.
36
+ 5. **Review intent** by approving, rejecting, deferring, or constraining a compact release plan.
37
+ 6. **Generate drafts** of Tasks and contracts. Drafts remain visibly untrusted.
38
+ 7. **Validate** approved drafts deterministically against the real target.
39
+ 8. **Promote** only validated artifacts into the canonical suite and refreshed Application Model.
40
+ 9. **Gate** with autonomous evidence plus the promoted deterministic suite.
41
+ 10. **Baseline** only a passing, conclusive, target-scoped gate.
42
+ 11. **Install CI** by previewing and writing a reviewable repository patch. Tapp does not commit,
43
+ push, create GitHub secrets, or enable branch protection.
44
+
45
+ Successful semantic actions can be saved in `.tapp/flows/`; credential values are templated to
46
+ environment references. Long-lived repository artifacts store binding names, not resolved secret
47
+ values.
48
+
49
+ ## Verified reference journey
50
+
51
+ `tests/browser-journey.test.js` drives the visible local browser against a fresh CommerceDemo copy.
52
+ It exercises startup, a real live web surface and semantic action, UI Map creation, Flow recording
53
+ and replay, proposal review, generation, deterministic validation, promotion, a first gate,
54
+ baseline-aware rerun, and CI preview.
55
+
56
+ The opt-in `tests/browser-native-journey.test.js` passed on 2026-08-06 against a booted iOS
57
+ simulator: the browser built and installed a disposable DemoApp checkout, ran shared target
58
+ preparation and exploration, rendered an observed UI Map, drove the live surface, and saved a
59
+ repository-native iOS Flow. The equivalent Android browser journey was not verified in that audit
60
+ because no emulator/device was connected.
61
+
62
+ This evidence proves representative local journeys. It does not prove arbitrary frameworks,
63
+ production credentials, third-party services, hosted execution, or complete inference of business
64
+ intent.
65
+
66
+ ## Hosted relationship
67
+
68
+ The future hosted application will present the same product journey through a different adapter: application
69
+ accounts/organizations, GitHub App repository authorization, private storage, a durable queue, and
70
+ isolated managed workers. It cannot reuse the loopback session, local `gh` authority, filesystem
71
+ boundary, or in-memory ownership assumptions.
72
+
73
+ The old hosted preview and `cloud/` prototype do not satisfy this boundary. The managed SaaS is a
74
+ separate, paused track (see the private source repository); do not market or accept private
75
+ repositories until its readiness gate passes.
@@ -0,0 +1,107 @@
1
+ # One Tapp product engine
2
+
3
+ Status: current product-engine contract as of 2026-08-08.
4
+
5
+ Tapp has several interfaces, not several products. The source of truth for customer-critical
6
+ operations is [`mcp-server/src/product-operations.js`](../mcp-server/src/product-operations.js).
7
+ An interface may validate its transport and render a result; it must not redefine onboarding,
8
+ review, trust, baseline, or gate semantics.
9
+
10
+ ## Product operation contract
11
+
12
+ The shared engine owns these operations:
13
+
14
+ | Operation | Authoritative result |
15
+ |---|---|
16
+ | `initializeProductProject` | detected targets, real exploration, Application Model, UI Map, release plan |
17
+ | `readProductProject` | one current, read-only product snapshot for any interface |
18
+ | `reviewProductPlan` | explicit approve/reject/defer decisions |
19
+ | `generateProductPlan` | compile-checked but untrusted Task/contract drafts |
20
+ | `validateProductPlan` | real-target, deterministic replay evidence |
21
+ | `promoteProductPlan` | canonical Tasks/contracts, refreshed model/plan, updated map coverage |
22
+ | `prepareProductCi` / `installProductCi` | target-aware workflow and machine-readable CI manifest |
23
+ | `runProductGate` | autonomous evidence plus the committed deterministic suite and one gate decision |
24
+ | `createProductBaseline` | conclusive, platform-and-target-specific comparison state |
25
+
26
+ Deterministic contract execution is in
27
+ [`mcp-server/src/product-execution.js`](../mcp-server/src/product-execution.js). It invokes platform
28
+ executors directly; MCP does not shell through the CLI, and the browser does not shell through MCP.
29
+
30
+ ## Interfaces
31
+
32
+ ```text
33
+ Browser Release Studio ─┐
34
+ CLI ├── product-operations ── application model / UI Map / Tasks / contracts
35
+ MCP ┘ │
36
+ └── deterministic executors / portable gate / evidence
37
+
38
+ VS Code ── MCP client
39
+ Desktop ── canonical artifact reader (migration to operation client remains)
40
+ Action ── portable gate adapter
41
+ Hosted ── tenant-aware SaaS adapter + queued isolated shared-operation workers (not built)
42
+ ```
43
+
44
+ Current convergence:
45
+
46
+ - the browser calls only shared product operations;
47
+ - CLI initialization, plan lifecycle, deterministic draft validation, promotion, gate/baseline
48
+ lifecycle, and CI installation call the same operations. Native build preparation remains at the
49
+ adapter boundary and passes a resolved `.app` or APK into the shared gate;
50
+ - MCP initialization, plan lifecycle, deterministic draft validation, promotion, baseline, and CI
51
+ installation call the same operations;
52
+ - the GitHub Action and `runProductGate` call the same portable gate and evidence protocol;
53
+ - VS Code remains a thin MCP client;
54
+ - desktop reads the same `.tapp` artifacts but still has legacy import/build orchestration. It is
55
+ retained, not the launch UX, until that orchestration is removed;
56
+ - `cloud/runner` is retained prototype evidence for exact checkout, versioned operation envelopes,
57
+ leases, and cleanup. It is not the production hosted adapter or an adequate arbitrary-customer
58
+ isolation boundary. The new SaaS must call these shared operations only through a tenant-aware,
59
+ queued worker contract (defined in the private source repository's SaaS architecture doc).
60
+
61
+ ## Canonical repository protocol
62
+
63
+ New product behavior writes only `.tapp/`:
64
+
65
+ ```text
66
+ .tapp/
67
+ project.json # actors, env binding names, controlled lifecycle; never secret values
68
+ application-model.json # detected/observed/declared product facts
69
+ ui-map.json # grounded screen/action/transition graph
70
+ release-plan.json # proposals and explicit human decisions
71
+ tasks/ # reusable deterministic semantic operations
72
+ contracts/ # reviewed business guarantees
73
+ baselines/<platform>/ # conclusive target-specific comparison state
74
+ ci.json # generated CI installation manifest
75
+ ```
76
+
77
+ `.tapp.yml` is the canonical run configuration, and `.tapp/` holds repository artifacts. These are
78
+ the only names the runtime reads; the pre-rename `.autotap.yml`, `.autotap/`, and `AUTOTAP_*` inputs
79
+ are no longer supported. Do not add another configuration format, and do not reintroduce a legacy
80
+ reader. Only an explicit reviewed operation may write new repository artifacts.
81
+
82
+ ## Anti-duplication rules
83
+
84
+ 0. Exploration (`explore`, formerly `qa`) observes and surfaces findings + evidence + UI Map; it must
85
+ not render a release outcome. Only the gate (`runProductGate`) applies versioned deterministic
86
+ policy to findings + coverage + selected suites + an optional baseline and computes
87
+ `pass | fail | inconclusive` (ADR-0005, in the private source repository).
88
+ 1. Trust states (`pending`, `approved`, `validated-draft`, `promoted`) are computed by the engine.
89
+ 2. Interfaces render `readProductProject`; they do not infer readiness from file existence.
90
+ 3. Re-exploration refreshes evidence while preserving reviewed decisions everywhere.
91
+ 4. Promotion refreshes the Application Model immediately; no interface may show stale pre-promotion
92
+ requirements.
93
+ 5. Baselines are identified by platform and stable target id everywhere.
94
+ 6. An adapter-specific feature is not complete until its engine operation is useful without that
95
+ adapter.
96
+ 7. Equivalence tests should assert artifacts and structured results, not merely matching copy.
97
+
98
+ ## Remaining migration
99
+
100
+ The next safe convergence work is deliberately narrow:
101
+
102
+ 1. replace desktop import/build orchestration with a local product-operation client;
103
+ 2. delete the two desktop detection/scaffolding paths only after equivalence fixtures pass;
104
+ 3. implement managed account, organization, and tenant authorization before connecting repositories;
105
+ 4. implement scoped GitHub authorization, private evidence, and disposable per-job
106
+ identity/simulator/credential isolation before accepting customer code;
107
+ 5. preserve CLI/MCP/VS Code/Action as adapters—do not rebuild their product logic.
@@ -0,0 +1,271 @@
1
+ # Application model and `tapp init`
2
+
3
+ `tapp init` is the deterministic import, exploration, and planning entrypoint of Tapp's customer
4
+ journey. It turns a repository into three platform-neutral, repository-native artifacts:
5
+
6
+ - `.tapp/ui-map.json` — observed UI states, controls, and transitions from real exploration;
7
+ - `.tapp/application-model.json` — what Tapp can support with evidence;
8
+ - `.tapp/release-plan.json` — the compact set of committed and proposed business guarantees a
9
+ customer must review before generation.
10
+
11
+ Plain `tapp init` performs source/artifact inspection only. `tapp init --explore` additionally uses
12
+ the same keyless QA engine as `tapp explore` to build/install/launch or connect to one selected real
13
+ target, merge the observed map, and construct the model and plan from that runtime evidence. It
14
+ does not generate or approve tests, call AI, or claim contract validation. When iOS repository
15
+ resolution actually builds and installs the detected Xcode container, the model records the exact
16
+ scheme as runtime-observed validation and removes the corresponding confirmation blocker. Merely
17
+ supplying a bundle id or prebuilt `.app` does not prove repository build configuration.
18
+
19
+ ## First inspection
20
+
21
+ ```bash
22
+ # Read-only preview. For web, provide the owned runtime URL if already known.
23
+ tapp init . --url http://127.0.0.1:3000 --dry-run \
24
+ --json-out /tmp/tapp-init-preview.json
25
+
26
+ # Create canonical artifacts. Existing files are never overwritten implicitly.
27
+ tapp init . --url http://127.0.0.1:3000
28
+
29
+ # Build/start the detected web target, explore it, persist its UI Map, then stop it.
30
+ tapp init . --explore --platform web --actions 40 --timeout 600
31
+
32
+ # Or connect to an already-running owned environment.
33
+ tapp init . --explore --platform web --url http://127.0.0.1:3000 \
34
+ --actions 40 --timeout 600
35
+
36
+ # iOS can resolve a repository/Xcode container/.app/bundle id and build when needed.
37
+ tapp init . --explore --platform ios --target .
38
+
39
+ # Android can install an APK, then launch the explicit application id.
40
+ tapp init . --explore --platform android \
41
+ --apk app/build/outputs/apk/debug/app-debug.apk --app-id com.acme.app
42
+
43
+ # Re-inspect after source/UI Map changes while preserving explicit review decisions.
44
+ tapp init . --url http://127.0.0.1:3000 --refresh
45
+
46
+ # Re-explore after review without losing approve/reject/defer choices.
47
+ tapp init . --refresh --explore --platform web --url http://127.0.0.1:3000
48
+ ```
49
+
50
+ MCP clients use `tapp_init` with `operation: inspect|write|refresh|explore`. `inspect` is the safe
51
+ default. `explore` writes real evidence, so the CLI rejects `--explore --dry-run`; the CLI also
52
+ requires `--refresh --explore` once model/plan artifacts exist. Credentials are passed only to the
53
+ runtime and are never written into the model, map, or plan.
54
+
55
+ Successful repository-driven iOS build validation is portable and durable. The application model
56
+ stores the repository-relative container, scheme, configuration, bundle id, and a
57
+ `tapp-capture:<id>` evidence reference—never the local DerivedData or checkout path. A later
58
+ source-only `tapp init --refresh` retains that validation when it still names the same detected
59
+ container. Tapp does not infer equivalent proof from an installed application, an explicit bundle
60
+ id, or a prebuilt artifact; those paths can demonstrate runtime reachability but cannot silently
61
+ confirm the repository's Xcode scheme.
62
+
63
+ ## Actors and credential bindings
64
+
65
+ Configure named actors once instead of repeating credentials or session policy across tests:
66
+
67
+ ```bash
68
+ tapp actor set alice . --role member --session isolated --provisioning seeded \
69
+ --credential email=ALICE_EMAIL --credential password=ALICE_PASSWORD
70
+ tapp actor set bob . --role member --session isolated --provisioning seeded \
71
+ --credential email=BOB_EMAIL --credential password=BOB_PASSWORD
72
+ tapp actor list .
73
+ tapp init . --refresh
74
+ ```
75
+
76
+ This writes `.tapp/project.json`. The file contains roles, `default`/`isolated` session policy,
77
+ provisioning mode, same-origin lifecycle declarations, and environment-variable *names*. The CLI
78
+ and MCP `tapp_actor_config` reject credential values and refuse to replace an actor without an
79
+ explicit `--replace`/`replace: true`. Contracts refer to `$ALICE_EMAIL`-style placeholders. Tapp
80
+ merges those reviewed placeholders with the central configuration, blocks missing/conflicting
81
+ bindings, and never copies resolved values into the application model, release plan, UI Map, CI
82
+ manifest, or generated workflow.
83
+
84
+ When web `--url` is omitted, Tapp selects one detected browser target, runs only its internally
85
+ derived lockfile-backed install command, runs its declared build script when present, and starts its
86
+ `start`, `dev`, `serve`, or `preview` package script with argument-array process execution (never
87
+ generated shell source). A static site with no script uses Tapp's local read-only static server. The
88
+ runtime binds to an available loopback port, writes its log under the Tapp runtime directory, and is
89
+ terminated after exploration even when QA fails. Multiple web targets, an unlocked dependency
90
+ graph, an unrecognized start path, or backend-specific configuration produce explicit remediation;
91
+ provide `--target` and/or an already-running owned `--url` in those cases. Running repository build
92
+ scripts executes repository code and should only be used for a checkout the customer trusts.
93
+ The managed loop never persists its ephemeral loopback URL as customer configuration. The model
94
+ records `runtime.management: tapp-managed`, and the portable gate/Action reconstructs the same
95
+ start/wait/stop lifecycle later. An explicitly supplied owned URL remains `customer-managed`.
96
+
97
+ ## What the model records
98
+
99
+ Application Model v1 records:
100
+
101
+ - detected iOS simulator, Android application, and browser targets;
102
+ - inspectable build commands, project/module/container paths, scheme candidates, application ids,
103
+ owned URLs, missing confirmations, and exact runtime-observed target validation where Tapp itself
104
+ completed the repository build/install path;
105
+ - actors, roles, provisioning modes, credential requirements/environment bindings, and
106
+ session-isolation boundaries without credential values;
107
+ - business entities and capabilities explicitly declared by reviewed contracts or conservatively
108
+ derived from reusable Task names;
109
+ - authored critical journeys, revenue paths, and cross-actor system invariants;
110
+ - the shared UI Map's observed state/transition/control counts and uncovered ids;
111
+ - the latest import exploration's finding count and explicit inconclusive status, when available;
112
+ - existing Tasks and contracts;
113
+ - blocking requirements and exact remediation.
114
+
115
+ Every fact identifies its evidence class. The current deterministic importer uses:
116
+
117
+ - `source-observed` for repository files and build metadata;
118
+ - `runtime-observed` for a successful exact target build/install/exploration, with portable evidence;
119
+ - `reviewed-artifact` for committed Tasks, contracts, and UI Map evidence;
120
+ - `task-derived` or another source-derived status when a fact still requires review;
121
+ - `authored-unvalidated` when a committed contract exists without current-revision replay proof.
122
+
123
+ Runtime observation, source inference, optional AI proposals, and human decisions must not be
124
+ collapsed into one confidence label. The artifact explicitly records that remote AI was not used.
125
+
126
+ ## Release-plan quality
127
+
128
+ The deterministic planner starts with committed contracts, then proposes only evidence-grounded
129
+ gaps:
130
+
131
+ - a conservative cross-actor propagation guarantee when two explicitly configured isolated actors,
132
+ deterministic setup/teardown, compatible authentication/precondition screens, and an exact
133
+ content-producing Task output jointly prove that the proposal is grounded;
134
+ - reusable Tasks not composed by a reviewed contract;
135
+ - uncovered UI states carrying business signals such as authentication, pricing, checkout,
136
+ account, messaging, or settings behavior.
137
+
138
+ Error pages, blank pages, loading surfaces, changelogs, and generic feature-description pages remain
139
+ visible as UI Map coverage gaps but do not automatically become business contracts. The target is
140
+ approximately 5–15 contracts for a sufficiently rich product, not an artificial quota for a small
141
+ fixture. Every proposal includes business value, risk, criticality, actors, platforms, grounding,
142
+ and the real-surface validation required before it can be trusted.
143
+
144
+ ## Explicit review
145
+
146
+ ```bash
147
+ tapp plan show .tapp/release-plan.json
148
+ tapp plan review .tapp/release-plan.json \
149
+ --approve signInWorks,checkoutWorks \
150
+ --reject marketingPageReachable \
151
+ --defer adminAuditWorks
152
+
153
+ # Only after review: generate grounded Task + contract drafts under .tapp/proposals/.
154
+ tapp plan generate .tapp/release-plan.json --project-dir .
155
+
156
+ # Replay the draft on the real target and attach evidence to the plan.
157
+ # Omit --url to build/start/stop the detected managed browser target.
158
+ tapp plan validate .tapp/release-plan.json --project-dir . --platform web
159
+ # Or connect to an already-running owned environment.
160
+ tapp plan validate .tapp/release-plan.json --project-dir . \
161
+ --platform web --url http://127.0.0.1:3000
162
+
163
+ # Explicitly accept only fully validated drafts into canonical reviewed locations.
164
+ tapp plan promote .tapp/release-plan.json --project-dir . \
165
+ --item checkoutWorks
166
+ ```
167
+
168
+ The MCP equivalent is `tapp_release_plan` with `read|review|generate|validate|promote`. Review
169
+ changes decision metadata only. It cannot silently
170
+ edit a Task, contract, selector, or assertion. On `tapp init --refresh`, decisions, constraints, and
171
+ review notes are carried forward by stable item id; reviewed items no longer derived from current
172
+ evidence are retained and marked stale instead of disappearing.
173
+
174
+ A source-only refresh preserves recorded replay evidence. `tapp init --refresh --explore` carries
175
+ the history forward but invalidates trust for affected generated Tasks and contracts: prior
176
+ platform results move to historical evidence, status becomes `requires-revalidation`, and replay is
177
+ required before the draft can be trusted against the newly observed revision. Exploration never
178
+ silently self-heals or accepts the prior selector path.
179
+
180
+ The macOS desktop Coverage experience reads these same files. Its **Application** tab explains
181
+ detected targets, actors, capabilities, journeys, Tasks, contracts, and exact remediation. Its
182
+ **Release Plan** tab writes explicit approve/reject/defer decisions atomically into the canonical
183
+ plan while preserving fields from newer engine versions; committed contract intent is not editable
184
+ through these proposal controls. Flow Map merges the repository `.tapp/ui-map.json` with current
185
+ run evidence instead of building a separate desktop-only graph.
186
+
187
+ Schema compatibility is exercised by the repository's protocol tests and retained desktop reader.
188
+
189
+ `plan generate` handles only explicitly approved proposals. Grounded cross-actor proposals preserve
190
+ actor-attributed Task calls, captured output variables, bounded eventual assertions, and the
191
+ reviewed project lifecycle, then compile through the isolated Scenario executor. Existing
192
+ Task-backed proposals compose those reviewed Tasks. For UI-Map-only proposals, it finds an observed path from each platform's
193
+ recorded entry state, deduplicates shared semantic transitions into compositional Task drafts under
194
+ `.tapp/proposals/tasks/`, grounds every Task in exact node/edge ids, and writes the contract draft
195
+ under `.tapp/proposals/contracts/`. Proposal Tasks are visible only to proposal contracts; an
196
+ ordinary committed contract or CI glob cannot silently consume one.
197
+
198
+ Generation blocks when entry-state evidence is missing, the target is unreachable, an observed
199
+ action cannot be represented deterministically, or platform paths require incompatible semantic
200
+ composition. It never overwrites a draft, statically compiles each declared platform, and marks all
201
+ outputs untrusted. Missing non-secret Task inputs stay blocked until the plan has explicit bindings;
202
+ standard email/password secrets remain placeholders. Successful grounding and compilation are not
203
+ real-surface evidence and never promote drafts into `.tapp/tasks` or `.tapp/contracts`.
204
+
205
+ `plan validate` invokes the ordinary deterministic contract executor and records pass/fail evidence
206
+ per declared platform. A multi-platform draft remains only partially validated until every declared
207
+ platform passes. Failed replay remains visible and sets `trusted: false`; there is no selector
208
+ substitution or automatic assertion update.
209
+
210
+ `plan promote` is the explicit acceptance boundary. It refuses any contract or generated Task that
211
+ has not passed every declared platform, preflights every destination, never overwrites a reviewed
212
+ artifact, moves accepted files from `.tapp/proposals/{tasks,contracts}` into
213
+ `.tapp/{tasks,contracts}`, and applies their exact node/edge coverage to the canonical UI Map.
214
+ Shared Task paths in still-unpromoted proposals are rewritten to the canonical file. Promotion does
215
+ not commit, push, or install CI; the resulting repository patch remains reviewable by the customer.
216
+
217
+ ## Baseline and CI handoff
218
+
219
+ After promotion, complete the local onboarding loop with:
220
+
221
+ ```bash
222
+ # Runs the ordinary exploration + committed suites gate. Builds native targets when possible;
223
+ # web targets can be detected, built, started, awaited, and stopped without a durable URL.
224
+ tapp baseline create . --platform web
225
+
226
+ # Or import an already-retained successful full-gate report after review.
227
+ tapp baseline create . --platform web --from /path/to/tapp-report.json
228
+
229
+ # Generate one target-aware job per model target plus a machine-readable manifest.
230
+ tapp ci install . --action-ref aarwitz/tapp@v0.13.1
231
+ ```
232
+
233
+ Baseline creation rejects non-gate JSON, missing or mismatched target identity, platform mismatch,
234
+ failed Flows/Scenarios/contracts, `blocked`, and `inconclusive`. It writes atomically to
235
+ `.tapp/baselines/<platform>/<target-id>.json` and requires `--replace` to supersede reviewed
236
+ evidence. Capture-local paths are replaced with portable `tapp-capture:` references before the
237
+ repository artifact is written. The gate also checks baseline platform and target identity before
238
+ comparing findings. On iOS, the same validated launch arguments and string-valued launch
239
+ environment are passed to autonomous exploration and deterministic Flow/contract replay; invalid
240
+ JSON or unsupported value types fail before execution rather than silently testing different app
241
+ configurations.
242
+
243
+ CI installation writes `.github/workflows/tapp.yml` and `.tapp/ci.json`, never overwrites by
244
+ default, and refuses unresolved iOS schemes, Android ids, browser lockfiles, or runtimes. The
245
+ workflow uses exact contract paths, maps each actor environment binding to a same-named GitHub
246
+ Secret, uses the first/default actor for autonomous-login inputs, preserves the remaining bindings
247
+ for deterministic multi-actor replay, and supports managed web startup, Android emulator
248
+ provisioning, and the target-specific baseline. It does not commit,
249
+ push, enable branch protection, or create remote resources. Use MCP `tapp_ci_setup` for the same
250
+ read-only render, baseline import, and guarded install engine.
251
+
252
+ ## Current boundary
253
+
254
+ Repository detection, one-target real exploration, first-map merge, evidence classification,
255
+ runtime-observed iOS scheme confirmation, durable source-only refresh, deterministic planning, safe
256
+ persistence, approve/reject/defer review, and compile-checked Task-backed draft generation are
257
+ implemented. An empty map or a latest exploration marked inconclusive remains a blocking
258
+ requirement; observing a login wall is not treated as useful coverage.
259
+
260
+ `tapp init` does not yet orchestrate every detected target in one invocation, provision arbitrary
261
+ web backends/services, automatically replay every approved draft, or promote validated drafts without
262
+ explicit customer acceptance. Baseline creation and a reviewable per-target GitHub CI patch are now
263
+ implemented as explicit post-promotion commands, but the generated workflow has not yet passed on
264
+ current GitHub-hosted iOS, Android, and web runners. Task generation currently handles observed
265
+ reachable navigation. Deterministic business planning is deliberately limited to cross-actor
266
+ content propagation and one checkout-to-order-history persistence pattern supported by exact Task
267
+ input/output, screen, actor, UI Map, and lifecycle evidence. General forms, broader payment shapes,
268
+ dynamic value capture, messaging/reactions, role-asymmetric invariants, and incompatible platform
269
+ journeys still require reviewed authoring. Optional
270
+ AI business reasoning is also not wired into this path. Those missing stages remain completion
271
+ blockers.
@@ -0,0 +1,95 @@
1
+ # Multi-actor Scenarios
2
+
3
+ A Scenario is Tapp's low-level deterministic multi-actor execution format in `.tapp/scenarios/*.yml`. It uses the same semantic actions, polling assertions, timeouts, evidence markers, and merge policy as a Flow, but adds isolated named actors, shared variables, and explicit lifecycle steps. The customer-facing business authoring layer is a TypeScript **release contract**, which composes reusable Tasks and compiles to this runtime instead of duplicating UI steps.
4
+
5
+ Ordinary replay is keyless. AI may propose a Scenario during authoring, but no model, API key, or coding agent participates when CI executes it.
6
+
7
+ ## Current support
8
+
9
+ Web replay is implemented through one isolated Playwright browser context per actor. Cookies, local storage, and in-browser session state cannot leak between actors; all contexts point at the same deployed application and backend. The Action, portable gate, CLI, and MCP surface all consume the same file.
10
+
11
+ iOS and Android still support sequential account switching inside ordinary Flows, but do not yet have first-class isolated multi-actor Scenario drivers. Tapp rejects those platform combinations instead of presenting sequential login/logout as equivalent proof.
12
+
13
+ ## Contract
14
+
15
+ ```yaml
16
+ name: Alice publishes and Bob sees it
17
+ kind: scenario
18
+ platform: web
19
+ url: http://127.0.0.1:4180
20
+ timeoutMs: 6000
21
+ vars: # shared deterministic data
22
+ POST: Scenario post 7319
23
+ actors:
24
+ alice:
25
+ vars: # actor-scoped credentials/session inputs
26
+ EMAIL: alice@example.test
27
+ PASSWORD: demo
28
+ bob:
29
+ vars:
30
+ EMAIL: bob@example.test
31
+ PASSWORD: demo
32
+ setup:
33
+ - request: # bounded, same-origin HTTP; never arbitrary shell
34
+ method: POST
35
+ path: /__tapp/reset
36
+ status: 200
37
+ steps:
38
+ - actor: alice
39
+ type: { field: Email, value: $EMAIL }
40
+ - actor: alice
41
+ type: { field: Password, value: $PASSWORD }
42
+ - actor: alice
43
+ tap: Sign in
44
+ - actor: alice
45
+ type: { field: Post text, value: $POST }
46
+ - actor: alice
47
+ tap: Publish
48
+ - actor: bob
49
+ assert_exists: { target: $POST, timeoutMs: 6000 }
50
+ teardown:
51
+ - request: { method: POST, path: /__tapp/reset, status: 200 }
52
+ ```
53
+
54
+ - `actors` must contain at least two names. Every journey step names one of them.
55
+ - Actor variables override shared variables. A committed value such as `$ALICE_PASSWORD` resolves only that explicitly referenced environment variable at run time; Tapp does not serialize the surrounding environment.
56
+ - `setup` and `teardown` currently accept bounded HTTP request steps on the target origin. Teardown runs after a journey failure so state is still cleaned up.
57
+ - Flow assertions poll until their bounded timeout. This models eventual consistency without blind sleeps or unbounded retries. A condition that never becomes true fails visibly.
58
+ - Typed values are not written to step evidence. Results include actor, action, selector, status, and error; failures capture that actor's screen and final screenshots for all actors.
59
+ - A failed Scenario always blocks the release gate, independently of whether autonomous single-user exploration found a problem.
60
+
61
+ ## Run it
62
+
63
+ ```bash
64
+ tapp scenario validate .tapp/scenarios/social-system.yml
65
+ ALICE_EMAIL=alice@example.test ALICE_PASSWORD=demo \
66
+ BOB_EMAIL=bob@example.test BOB_PASSWORD=demo \
67
+ tapp scenario run .tapp/scenarios/social-system.yml
68
+
69
+ tapp ci --platform web --url http://127.0.0.1:4180 \
70
+ --scenarios '.tapp/scenarios/*.yml' \
71
+ --json-out tapp-report.json --md-out tapp-report.md
72
+ ```
73
+
74
+ GitHub Action:
75
+
76
+ ```yaml
77
+ - uses: aarwitz/tapp@main
78
+ with:
79
+ platform: web
80
+ url: http://127.0.0.1:4180
81
+ scenarios: .tapp/scenarios/*.yml
82
+ ```
83
+
84
+ MCP clients call `tapp_scenario_run` with `scenarioPath`, or an inline reviewed Scenario. The structured result identifies `kind: scenario`, actual executed/total steps, and actor-tagged steps.
85
+
86
+ ## Verified fixture and boundaries
87
+
88
+ `SocialDemo/.tapp/contracts/social-system.contract.ts` is the reference system guarantee; the Scenario remains its low-level execution proof and backwards-compatible escape hatch. On 2026-08-04 the contract passed 41/41 compiled steps using two isolated contexts against one delayed shared backend. With `SOCIAL_DEMO_FAULT=hide-cross-actor-posts`, the unchanged contract failed for Bob at 19/41 and the portable merge gate exited non-zero specifically because one release contract failed.
89
+
90
+ The fixture's `.tapp/project.json` is the central actor contract. It records Alice and Bob's
91
+ roles, isolated sessions, seeded provisioning, reset lifecycle, and four environment-variable
92
+ names. The release contract and Scenario consume those names; neither stores the public fixture
93
+ values. Customer values belong in the local environment or CI secret store.
94
+
95
+ This proves the contract and web implementation, not universal multi-user reliability. Real customers still need reset/provisioning hooks or dedicated test data, enough accessibility semantics to select controls, and a test backend whose eventual-consistency budget is known.
@@ -114,8 +114,8 @@ function applyRuntimeTargetValidation(root, targets, validation) {
114
114
  build: { container, scheme, configuration },
115
115
  evidence: {
116
116
  ...(captureId ? { capture: portableEvidenceReference(`tapp-capture:${captureId}`) } : {}),
117
- verdict: String(validation.evidence?.verdict || "unknown"),
118
117
  inconclusive: validation.evidence?.inconclusive === true,
118
+ findingCount: Number(validation.evidence?.findingCount || 0),
119
119
  ...(validation.evidence?.observedAt ? { observedAt: String(validation.evidence.observedAt) } : {}),
120
120
  },
121
121
  detail: "Tapp built this repository target with the recorded scheme, installed it, launched it, and produced UI Map evidence.",
@@ -149,8 +149,8 @@ function persistedTargetValidations(root, outDir) {
149
149
  },
150
150
  evidence: {
151
151
  captureId: capture.startsWith("tapp-capture:") ? capture.slice("tapp-capture:".length) : "",
152
- verdict: validation.evidence?.verdict,
153
152
  inconclusive: validation.evidence?.inconclusive === true,
153
+ findingCount: Number(validation.evidence?.findingCount || 0),
154
154
  observedAt: validation.evidence?.observedAt,
155
155
  },
156
156
  }];
@@ -569,7 +569,9 @@ export async function inspectApplicationRepository({ projectDir, ownedUrl = "",
569
569
 
570
570
  const model = {
571
571
  schemaVersion: 1, kind: "tapp-application-model",
572
- application: { name: applicationName(root, targets), repositoryRoot: ".", platforms: [...new Set(targets.map((target) => target.platform))].sort(), targetIds: targets.map((target) => target.id) },
572
+ // defaultTargetId: which target a bare `tapp explore` prepares when the repo has several (ADR-0005
573
+ // §5 resolution ladder). First detected; an explicit --target/--platform always overrides it.
574
+ application: { name: applicationName(root, targets), repositoryRoot: ".", platforms: [...new Set(targets.map((target) => target.platform))].sort(), targetIds: targets.map((target) => target.id), defaultTargetId: targets[0]?.id || "" },
573
575
  targets,
574
576
  actors,
575
577
  entities,
@@ -1415,8 +1417,8 @@ export function recordContractProposalValidation(plan, { id = "", name = "", pla
1415
1417
  export function recordGeneratedTaskProposalValidation({ projectDir, item, platform, evidence = "", detail = "" } = {}) {
1416
1418
  if (!["ios", "android", "web"].includes(platform)) throw new Error("platform must be ios|android|web");
1417
1419
  const root = fs.realpathSync(path.resolve(projectDir || process.cwd()));
1418
- const proposalMarkers = [".tapp", ".autotap"].map((directory) => `${path.sep}${directory}${path.sep}proposals${path.sep}tasks${path.sep}`);
1419
- const reviewedMarkers = [".tapp", ".autotap"].map((directory) => `${path.sep}${directory}${path.sep}tasks${path.sep}`);
1420
+ const proposalMarkers = [`${path.sep}.tapp${path.sep}proposals${path.sep}tasks${path.sep}`];
1421
+ const reviewedMarkers = [`${path.sep}.tapp${path.sep}tasks${path.sep}`];
1420
1422
  const updated = [];
1421
1423
  for (const taskPath of item?.generation?.taskPaths || []) {
1422
1424
  const absolute = path.resolve(root, taskPath);
@@ -1461,8 +1463,7 @@ export function mergeGeneratedTaskProposalValidation(plan, updates = []) {
1461
1463
  }
1462
1464
 
1463
1465
  function promotedDestination(root, source, kind) {
1464
- const marker = [".tapp", ".autotap"]
1465
- .map((directory) => `${path.sep}${directory}${path.sep}proposals${path.sep}${kind}${path.sep}`)
1466
+ const marker = [`${path.sep}.tapp${path.sep}proposals${path.sep}${kind}${path.sep}`]
1466
1467
  .find((candidate) => source.includes(candidate));
1467
1468
  if (!marker) throw new Error(`Proposal ${kind.slice(0, -1)} is outside .tapp/proposals/${kind}: ${relative(root, source)}`);
1468
1469
  const index = source.indexOf(marker);
@@ -1505,7 +1506,7 @@ export async function promoteValidatedProposals(plan, { projectDir, ids = [] } =
1505
1506
  for (const taskPath of item.generation.taskPaths || []) {
1506
1507
  const source = path.resolve(root, taskPath);
1507
1508
  if (!fs.existsSync(source)) throw new Error(`Generated Task is missing: ${taskPath}`);
1508
- if (![".tapp", ".autotap"].some((directory) => String(source).includes(`${path.sep}${directory}${path.sep}proposals${path.sep}tasks${path.sep}`))) continue;
1509
+ if (!String(source).includes(`${path.sep}.tapp${path.sep}proposals${path.sep}tasks${path.sep}`)) continue;
1509
1510
  const destination = promotedDestination(root, source, "tasks");
1510
1511
  moves.set(source, destination);
1511
1512
  let task = taskRecords.get(source);