Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions docs/qa/studio-benchmark/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Studio task benchmark

One fixed task — **build a repair-ticket app with no code** — run against a fresh showcase boot,
timed, counting every red error, failed write, code-shaped entry and dead end the author meets.
Its numbers are the Studio UX baseline, re-measured every release.

| file | what it is |
|---|---|
| [SCENARIO.md](./SCENARIO.md) | the fixed script: environment, the eight steps, the server-side oracle for each |
| [SCORING.md](./SCORING.md) | what is counted, how each red error is classified, the headline row |
| [SCORESHEET.md](./SCORESHEET.md) | the blank sheet a run fills in |
| [USER-SESSIONS.md](./USER-SESSIONS.md) | the protocol for 3–5 think-aloud sessions with real low-code authors |
| [`baselines/`](./baselines/) | one filled sheet per release, named `YYYY-MM-DD-OBJECTSTACKSHA8-OBJECTUISHA8.md` |

## Current baseline

[`baselines/2026-10-08-8fc50b76-a58626c8.md`](./baselines/2026-10-08-8fc50b76-a58626c8.md):

```text
completed 8/8 · total 1511 s · 16 red errors · 13 failed writes · 10 code-shaped entries · 0 dead ends
```

(agent run — the time is agent time, not a human completion time; see SCORING.md.)

## Each release

1. Boot fresh, exactly as SCENARIO.md → *Environment* says, with the console built at the release's
`.objectui-sha` pin.
2. Run the eight steps unchanged; fill a copy of SCORESHEET.md.
3. Commit it under `baselines/` with both SHAs in the name, and compare its headline and per-step
rows with the previous file. A number moving the wrong way, or a step that stops completing, is a
regression — report it per step.
4. Every red error, failed write, code-shaped entry and dead end carries a card reference. One with
no card goes to the reviewing seat to file; the runner does not file cards from a benchmark run.

## Why the baseline is a committed file, not a `qa-run` issue

The next run has to **read** the previous one, field by field, to compare. A markdown file keyed to
both SHAs sits next to the script it scores, survives in history alongside script changes, and is
diffable. The platform checklist's `qa-run` issue contract belongs to checklist runs (its title
grammar is parsed by `scripts/qa/qa-rollup.mjs` and counts checklist verdicts), and its `runs/`
directory is git-ignored — neither fits a recurring comparison point.

## Running it as an agent

Follow `.claude/skills/dogfood-verification` and `docs/qa/platform-checklist/RUNNER.md` for the
boot, the oracle hierarchy and the trap vocabulary. What this benchmark adds:

- **Record everything as it happens.** Attach a listener to the browser (Playwright over CDP works)
that logs every non-GET `/api` answer and every 4xx/5xx with its body, and polls the page for
visible red elements (`role=alert`, error toasts, `destructive` / `red-` classes), logging each
new text with a timestamp. Write a `MARK stepN-start` / `MARK stepN-end` line into the same log at
each clock edge. The sheet is then filled from one timeline. Make the listener survive page
dialogs (`beforeunload` on sign-out) — a crashed recorder silently stops counting.
- **Drive like an author.** Real clicks and keyboard input; never set a value through the DOM. Read
each screen before acting — the benchmark is about what the console offers, not about a script
that already knows the answer.
- **Verify each step server-side** with SCENARIO.md's oracle (the draft read is
`GET /api/v1/meta/TYPE/NAME?state=draft&package=PACKAGE`), and prove step 4's rule after publish
with a forged create that should be refused with the rule's own message.
- **Tear down** the server, the browser and the recorder by the PIDs you recorded.
72 changes: 72 additions & 0 deletions docs/qa/studio-benchmark/SCENARIO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Studio task benchmark — the fixed scenario

**Build a repair-ticket app with no code.** One script, run unchanged every release, so the
numbers compare. ⛔ Do not reword, reorder or extend a step between runs: a changed script is a
new benchmark and its first run is a new baseline, recorded as such in [`baselines/`](./baselines/).

Scoring rules live in [SCORING.md](./SCORING.md); the sheet a run fills in is
[SCORESHEET.md](./SCORESHEET.md); the human-author protocol is [USER-SESSIONS.md](./USER-SESSIONS.md).

## Environment (every run)

| what | value |
|---|---|
| app | `examples/app-showcase`, a **fresh** boot — empty database, nothing left from an earlier run |
| boot | `OS_PORT=PORT pnpm -C ABS/examples/app-showcase exec objectstack dev --ui --seed-admin -p PORT -d file:/tmp/RUN/data.db` (the dogfood-verification §0 line; `OS_PORT` exported, not only `-p`) |
| console | the vendored build at the `.objectui-sha` pin (`pnpm objectui:build`), served at `/_console/` — **never** an objectui HEAD dev server: the benchmark measures what users get |
| author | the seeded platform admin `admin@objectos.ai` / `admin123`, signed in through the form |
| end user | a second identity minted by admin create (`POST /api/v1/auth/admin/create-user`, then `change-password`), or by invite + sign-up — a stock showcase refuses self-registration |
| browser | Chromium at 1440×900 |

Record both SHAs before step 1: `git rev-parse HEAD` of the objectstack tree you booted, and the
contents of `.objectui-sha` (cross-check `packages/console/dist/.objectui-sha` — `os dev` refuses
to mount a console whose stamp differs).

## The rules of the run

- **No code.** The author works only in the console. A step that can be finished only by
writing a file, calling an API by hand, or running a CLI command is a **dead end** for that
step (SCORING.md). Typing JSON, CEL or a machine name into a console field is allowed but
**counted** — it is the thing the benchmark exists to drive to zero.
- **The clock.** A step starts when the author begins it (first click towards it) and stops when
its result is **verified server-side** with the oracle in the table below — a REST read of the
draft, the published metadata or the record, never the UI alone. A step the author abandons
stops the clock at abandonment and is scored as a dead end.
- **Errors.** Every red banner, red toast or red inline error box the author sees is logged with
its verbatim text, the step, and whether the author caused it (a wrong input) or the product
showed it on a valid intermediate state. Every 4xx/5xx answer to a draft write or a publish
write is logged with method, path, status and error code (read from the browser's network log).
- **No retries off the clock.** Re-doing a step after an error is part of that step's time.

## The steps

Machine names below are what a run *expects the console to derive*; the author never has to type
them. If the console makes the author type one, that is a counted machine-name entry.

| # | step | what "done" means | server-side oracle |
|---|---|---|---|
| 1 | Create package **Repair Center** | a writable package exists, owned by the author's org | `GET /api/v1/packages` lists it (read the id the console derived) |
| 2 | Object **Repair Ticket** with fields **Name** (text), **Status** (picklist: New / In Progress / Done), **Due Date** (date), **Problem Description** (long text), **Technician** (lookup → user) | the object draft carries all five fields with those types and the three picklist options | the object's draft read back through the drafts API, or (after step 7) `GET /api/v1/meta/object/OBJECT` |
| 3 | **Group the form** — at least two sections (e.g. *Ticket* with Name / Status / Due Date / Technician, *Details* with Problem Description) | the object's form layout declares the sections | the form view/layout draft read back |
| 4 | Validation **"Due date required when Done"** | a validation rule that refuses `status = Done` with an empty due date, with a readable message | the rule in the object draft; after step 7, a forged create with `status=done` and no due date answers 4xx with the rule's message |
| 5 | Automation **"Notify the technician when Done"** | a record-triggered flow on Repair Ticket, firing when Status becomes Done, whose notify step addresses the Technician field | the flow draft read back: trigger object, condition, notify recipients |
| 6 | An **app with navigation** — an app *Repair Center* whose nav reaches the Repair Ticket list | an app definition with a nav item for the object | the app draft read back; after step 7 `GET /api/v1/meta/app` lists it |
| 7 | **Publish** | every draft from steps 2–6 is live | `GET /api/v1/meta/object/OBJECT`, the flow, the app — all answer with the published shape |
| 8 | **As the end user**: open the app, create a ticket (assign the Technician), move it to **Done**, see the notification arrive | the record exists in status Done; the technician has an inbox message for it | `GET /api/v1/data/OBJECT/ID`; a `sys_inbox_message` row whose recipient is the technician (read as the technician) |

Step 8's notification is the end-to-end proof that steps 4–7 composed: the validation must let a
ticket with a due date through, the flow must fire on the status change, and the recipient must
resolve from the lookup. The end user assigns **themselves** as the Technician, so the notification
lands in the inbox of the person driving step 8.

The script deliberately names **no access step**. A low-code author expects a published app to
work for its users; if the end user is refused, the author grants access where they find it, and
the run scores it as rework (SCORING.md, *Rework the script does not name*) with the refusal
classed `missing-step`. ⛔ Do not add the grant to the script to make step 8 pass.

## What a run hands back

One filled [SCORESHEET.md](./SCORESHEET.md) copy, committed under [`baselines/`](./baselines/)
when it is a baseline (the first run of a release), named
`YYYY-MM-DD-OBJECTSTACKSHA8-OBJECTUISHA8.md`. Every red banner and dead end in it carries a card
reference — an existing card, or one filed by the seat that reviews the run.
65 changes: 65 additions & 0 deletions docs/qa/studio-benchmark/SCORESHEET.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Studio task benchmark — score sheet (template)

Copy this file to `baselines/YYYY-MM-DD-OBJECTSTACKSHA8-OBJECTUISHA8.md` (a baseline) or to the
session folder (a human session), then fill it in. Rules: [SCORING.md](./SCORING.md).

## Run

| field | value |
|---|---|
| date (UTC) | |
| run type | agent / human session (participant code only — no names) |
| objectstack commit booted | |
| objectui commit (`.objectui-sha`, and the console stamp) | |
| boot line | |
| browser / viewport | |
| author identity | |
| end-user identity | |
| setup time (boot → signed in) | |

## Headline

```text
completed _/8 · total _ s · _ red errors · _ failed writes · _ code-shaped entries · _ dead ends
```

## Per step

| # | step | result (`completed` / `dead-end` / `not-reached`) | time (s) | red errors | failed writes | code-shaped | oracle evidence |
|---|---|---|---|---|---|---|---|
| 1 | package Repair Center | | | | | | |
| 2 | object Repair Ticket + 5 fields | | | | | | |
| 3 | group the form | | | | | | |
| 4 | validation: due date required when Done | | | | | | |
| 5 | automation: notify technician when Done | | | | | | |
| 6 | app with navigation | | | | | | |
| 7 | publish | | | | | | |
| 8 | end user: create, move to Done, notification arrives | | | | | | |

## Red errors (verbatim)

| n | step | verbatim text | where shown | class | card |
|---|---|---|---|---|---|
| | | | | | |

## Failed writes

| n | step | method · path | status · code | card |
|---|---|---|---|---|
| | | | | |

## Code-shaped entries

| n | step | field | kind (`json` / `cel` / `machine-name`) | card |
|---|---|---|---|---|
| | | | | |

## Dead ends

| n | step | what could not be done in the console | the code path that would finish it | card |
|---|---|---|---|---|
| | | | | |

## Warnings and notes

Non-red observations worth keeping (amber warnings, confusing copy, slow screens). Not scored.
63 changes: 63 additions & 0 deletions docs/qa/studio-benchmark/SCORING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Studio task benchmark — scoring

How a run of [the scenario](./SCENARIO.md) turns into numbers. The sheet a run fills in is
[SCORESHEET.md](./SCORESHEET.md). The same rules score an agent run and a human session
([USER-SESSIONS.md](./USER-SESSIONS.md)); only the time column means something different (below).

## The metrics

| metric | unit | counted when | not counted |
|---|---|---|---|
| **Wall time** | seconds, per step and total | from the author's first gesture towards the step to the server-side oracle confirming it (SCENARIO.md, *The clock*) | the oracle read itself; boot and sign-in (recorded separately as *setup*) |
| **Red errors** | count + verbatim text | every red banner, red toast, red inline error box, red canvas chip, red field message or red error panel **shown** to the author — one per red element per author gesture. Two appearances of the same text after two separate gestures count twice; a banner that gains a new bullet after a new gesture counts again | a red required-field asterisk; a red count badge (notifications, *Problems N*); a red *Delete* / *Remove* button; a yellow/amber warning or publish advisory (logged under *warnings*) |
| **Failed writes** | count + `METHOD path → status CODE` | every 4xx/5xx answer to a draft write (`PUT`/`POST`/`PATCH`/`DELETE` on a metadata, draft or package route), to the publish call, and to a record write the end user makes through the console in step 8, read from the browser network log | reads (`GET`) — including background reads the console makes for the end user —, auth refreshes, telemetry, and the runner's own forged oracle requests |
| **Code-shaped entries** | count, each with step and field | each console field where the author had to type **JSON**, a **CEL / formula expression**, or a **machine name** (snake_case identifier, object or field API name, user id) because no picker or derived default existed | a label the console turned into a machine name by itself; choosing from a closed picker (a select or combobox that accepts nothing else), even one that displays machine names. A free-text field with a browser suggestion list *is* counted: it accepts any text, and a label typed into it is stored as a wrong machine name |
| **Dead ends** | count, each named with its step | a step, or a required part of one, that cannot be finished in the console at all — the only way through is a file, a hand-written API call or a CLI command | a step that is slow or error-prone but completable |

## Classifying each red error

Each red error gets exactly one class — the class says who has to move:

| class | meaning |
|---|---|
| `intermediate-state` | the product flagged a valid, unfinished state as an error (e.g. a half-built flow, a field not yet filled) |
| `author-input` | the author entered something wrong and the message said so |
| `product-defect` | a valid, finished input was refused, or the message is wrong or unreadable |
| `missing-step` | the refusal is correct, but it needs a step the script does not name and the authoring flow never surfaced (e.g. granting end users access to a new object) |
| `environment` | the boot or fixture, not the product (record it, do not count it in the headline) |

## Rework the script does not name

When a later step reveals that an earlier one needs more work (a missing grant, a rule that does
not evaluate), the author does that work where they found it. Time it as a lettered sub-step of
the step that revealed it (`8a`, `8b`, …), count its errors and entries in that step, and say in
one line what it repaired. ⛔ Do not move the time back into the earlier step: when the author
discovers a problem is part of what the benchmark measures.

## Headline numbers

The headline row of every run, in this order, is what the next release compares against:

```text
completed STEPS/8 · total TIME · RED red errors · FAILED failed writes · CODE code-shaped entries · DEAD dead ends
```

- *completed* counts steps whose oracle confirmed the result; a dead-ended step is not completed,
and a step that depends on a dead-ended step is recorded `not-reached`, never `fail`.
- A **regression** is any headline number moving the wrong way between two runs on the same
script, or a step changing from completed to not. Report it per step, never only as a total.

## Agent runs vs human sessions

An agent run measures **the product**: which steps are possible without code, what errors a
correct author meets, which fields demand code-shaped input. Its wall time includes the agent's
own driving and is not a human completion time — record it, compare it only against other agent
runs, and never quote it as "an author takes N minutes". Human completion time comes from the
[user sessions](./USER-SESSIONS.md), scored on the same sheet.

## Evidence

Each counted item carries text evidence in the sheet: the verbatim banner text, the network line,
the field name. Screenshots are live judgment aids and are not committed (the platform
checklist's `RUNNER.md` rule). A red error or dead end is cross-referenced to a card — an
existing one, or the card the reviewing seat files for it.
Loading
Loading