ravensight-playtest 0.13.2 → 0.16.0

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.
Files changed (40) hide show
  1. package/README.md +99 -4
  2. package/addons/ravensight_driver/driver.gd +472 -28
  3. package/docs/godot-driver.md +66 -2
  4. package/package.json +7 -5
  5. package/src/api/README.md +8 -1
  6. package/src/api/client.js +24 -1
  7. package/src/cli.js +14 -0
  8. package/src/commands/check.js +5 -2
  9. package/src/commands/fix.js +1 -1
  10. package/src/commands/run.js +26 -4
  11. package/src/commands/setup.js +176 -0
  12. package/src/packs/index.js +37 -5
  13. package/src/packs/keys.json +11 -0
  14. package/src/packs/pack-signing-hashes.json +7 -0
  15. package/src/packs/pack-signing-vectors.json +119 -0
  16. package/src/packs/signature.js +186 -0
  17. package/src/run/anygame/gamenotes.js +74 -12
  18. package/src/run/anygame/index.js +97 -34
  19. package/src/run/anygame/language.js +100 -10
  20. package/src/run/anygame/memory.js +70 -13
  21. package/src/run/anygame/shared-hashes.json +7 -7
  22. package/src/run/anygame/sound.js +59 -16
  23. package/src/run/args.js +2 -0
  24. package/src/run/claimwords.js +43 -7
  25. package/src/run/drivers/godot-cursor.js +96 -0
  26. package/src/run/drivers/godot-observation.js +29 -5
  27. package/src/run/drivers/godot.js +60 -5
  28. package/src/run/drivers/web.js +124 -14
  29. package/src/run/eventclaims.js +102 -6
  30. package/src/run/events.js +64 -6
  31. package/src/run/gameMemory.js +14 -5
  32. package/src/run/honesty.js +49 -2
  33. package/src/run/judge.js +22 -10
  34. package/src/run/liveFeed.js +254 -0
  35. package/src/run/personaLoop.js +103 -25
  36. package/src/run/pixels.js +491 -2
  37. package/src/run/replay.js +11 -0
  38. package/src/run/sdkSession.js +279 -16
  39. package/src/run/synthetic.js +12 -8
  40. package/src/run/tools.js +2 -2
package/README.md CHANGED
@@ -274,6 +274,24 @@ Credential Manager, libsecret on Linux). With no keychain available it falls
274
274
  back to a file with 0600 permissions under your home directory, and says so.
275
275
  In CI, set `RAVENSIGHT_TOKEN` instead and skip `login` entirely.
276
276
 
277
+ Or let `setup` walk you through it after `login`:
278
+
279
+ ```bash
280
+ ravensight-playtest setup # link, where it runs, what to learn, the plan and its price
281
+ ```
282
+
283
+ `setup` links the repo (as `init` does), asks where the game should run (on
284
+ this computer, in the Ravensight cloud from an uploaded web build, or a live
285
+ web address in the cloud) and what you want to learn, then shows Ravensight's
286
+ plan: the personas that fit the goal, what the brief still needs and the price
287
+ of each option, from the same pricing as the real quote. It offers to write
288
+ the brief with the plan's suggestions as the answers to keep, and for a local
289
+ run offers to start it through `run`, which shows the price again and asks
290
+ before anything is charged. A cloud plan ends with the commands that upload
291
+ and quote it. The plan itself is free and starts nothing. Flags: `--game`,
292
+ `--where local|cloud|url`, `--goal <text>`, `--personas <list>`, `--force`, and
293
+ `--json` to print the plan and ask nothing. `--yes` is never passed on to `run`.
294
+
277
295
  ## Upgrading to 0.3.2
278
296
 
279
297
  - **A plain `run` plays one persona, not two.** The default persona set is now
@@ -299,7 +317,7 @@ In CI, set `RAVENSIGHT_TOKEN` instead and skip `login` entirely.
299
317
 
300
318
  ## Commands
301
319
 
302
- Fourteen commands. Flags below are the ones the code accepts, not the ones the
320
+ Fifteen commands, `setup` among them. Flags below are the ones the code accepts, not the ones the
303
321
  prose elsewhere describes; `--help` on any command prints the same list.
304
322
 
305
323
  Every command takes these four:
@@ -506,6 +524,53 @@ godot_driver` and `build: { kind: godot_project, ref: "." }`, so `run` needs no
506
524
  `--driver` or `--godot-project`. The concurrency written is the one `check`
507
525
  recommends for this machine.
508
526
 
527
+ ### setup
528
+
529
+ The guided first playtest, after `login`. Four steps, each printed as it goes:
530
+
531
+ 1. **The game.** A linked repo keeps its link; otherwise `setup` links it
532
+ through `init` (so `--game` and `--force` work as they do there).
533
+ 2. **The plan.** It asks where the game should run (this computer, the
534
+ Ravensight cloud from an uploaded web build, or a live web address played in
535
+ the cloud; Enter lets Ravensight recommend one) and what you want to learn,
536
+ then asks the server for a plan (`POST .../plan`, see
537
+ [docs/api-contract.md](docs/api-contract.md)) and prints it: the personas
538
+ (`fresh-eyes` first, then up to two the goal points at), who plays (Geri
539
+ locally, Geri and Freki in the cloud), the price, the other places it could
540
+ run with theirs, and the exact commands that start it. A place the studio
541
+ cannot use right now prints why and no price.
542
+ 3. **The brief.** When it is not complete, `setup` offers to write it, with the
543
+ plan's suggested goals and success criteria as answers you keep with Enter.
544
+ What the brief already says wins; the controls and how to start come from
545
+ you. A version saved by someone else meanwhile is not overwritten without
546
+ asking.
547
+ 4. **Start it.** A local plan with a complete brief offers to hand over to
548
+ `run` with the plan's personas. `run` quotes again and asks you to confirm before anything is charged; `--yes` is never
549
+ passed on, so the price is always confirmed by a person. A cloud or live
550
+ address plan stops at its commands instead: `build upload` (cloud only),
551
+ `hosted quote ... --output quote.json`, which is your consent to that exact
552
+ price and charges nothing, then `hosted run quote.json`, or the Playtest
553
+ page in the dashboard.
554
+
555
+ The plan is free: nothing is started, held, charged or saved. Its prices come
556
+ from the server's own pricing, the same as `run`'s quote for a local run and a
557
+ combined cloud quote for the cloud (priced on the smallest tier; `hosted quote`
558
+ picks the tier the build needs and shows it before any charge). Any role may
559
+ ask for a plan; only the studio owner sees the balance against it. A plan over
560
+ the balance prints where to add funds.
561
+
562
+ | Flag | Effect |
563
+ |---|---|
564
+ | `--game <gameId>` | The game to link, when this repo is not linked. |
565
+ | `--where <place>` | `local`, `cloud` or `url`. Default: Ravensight recommends one. |
566
+ | `--goal <text>` | What you want to learn, at most 500 characters. Asked for in a terminal when left out; required otherwise. |
567
+ | `--personas <list>` | Persona slugs to use instead of the suggestion, comma separated. An unknown slug is refused with the known ones named. |
568
+ | `--force` | Relink a repo that is already linked to another game. |
569
+ | `--json` | Print the server's plan as JSON and ask nothing: no brief, no hand over to `run`. Needs `--goal`, and `--game` when the repo is not linked. |
570
+
571
+ Your own agent gets the same plan from the MCP tool `plan_playtest`. No MCP
572
+ tool starts a playtest.
573
+
509
574
  ### personas
510
575
 
511
576
  Lists the persona slugs `--personas` accepts, from the content pack this game
@@ -691,6 +756,7 @@ splitting the job in two is what gets everything played.
691
756
  | `--no-upload-step-log` | Keep the step log (`transcript.jsonl`) on this machine. By default it uploads with the reports, because the evidence report in the dashboard is built from it: the inputs sent, what each observation read, the persona's notes and the checks made on its findings, with the local brief's secrets already scrubbed. `"uploads": { "step_log": false }` in the project config does the same for every run. This default applies to projects set up before 0.10.0 too: the older `"uploads": { "transcript": false }` that `init` used to write is not read as an opt out. Every run prints one line saying whether the step log uploads and how to keep it local; without it the dashboard shows the written report, not the evidence report. |
692
757
  | `--upload-step-log` | Upload the step log for this run even when the project config sets `"step_log": false`. `--upload-transcript` is its older name. |
693
758
  | `--no-replay` | `godot_driver` and `playwright_web`. Do not play the findings' recorded inputs again after the report. A replay makes no model call and costs nothing; it opens the game again for a few seconds (a second browser for a web build). |
759
+ | `--no-live` | Send nothing to the job's Watch live tab in the dashboard while the run plays. By default a persona run that uploads sends its recent steps (the input, what it meant to do, whether the screen changed) every few seconds and, only while someone has the tab open, a small picture of the latest changed screen, made in a temporary folder with ffmpeg when it is on this machine (steps only without it). It is free, is never retried, never slows or fails the run, and stops quietly if the server does not answer; the uploaded reports stay the record. `--dry-upload` and a step log kept on this machine (`--no-upload-step-log`, or `"step_log": false`) turn it off too. Every run prints one line saying which. |
694
760
  | `--dry-upload` | List every file and byte that would be sent, and send nothing. |
695
761
  | `--key-modifier <meta\|control>` | The modifier the browser driver uses for editing shortcuts such as select all. Defaults to this machine's own (Command on macOS, Control elsewhere); set it when the browser's platform is not this machine's. `RAVENSIGHT_KEY_MODIFIER` does the same. |
696
762
  | `--build-dir <dir>` | Serve an exported web build folder from this machine and play it: `index.html`, or the folder's one `.html` page (a Godot export named after the project). The local server sends `application/wasm`, Content-Encoding for Unity's Brotli and gzip files (`.br`, `.gz`), and cross-origin isolation, so threaded Godot, love.js and Emscripten builds get SharedArrayBuffer. `resume` serves the same folder again. Not with `--build-url`. The server answers only `127.0.0.1` or `localhost` on its own port and never serves dotfiles. |
@@ -719,10 +785,35 @@ game's own events", in `usage.json` `gameEvents.sessionRefused` and on screen,
719
785
  that no game events were recorded and why. Nothing is counted as a player. A
720
786
  cloud playtest of the same build records them.
721
787
 
788
+ Handing the page the playtest identity is not enough on its own: the game's
789
+ SDK has to read it and send it with its session. An SDK from before it read the
790
+ identity (ravensight-js before 0.3.0, for example) opens an ordinary session, and
791
+ every event in it counts as a real player. So a web run reads each session
792
+ request the game's SDK makes: a POST to the session path on the Ravensight API
793
+ this run uses or the SDKs' default ingest address (your game's own backend at
794
+ the same path is left alone). It reads whether the request carried this run's
795
+ own token, with or without a "Bearer " prefix, and the SDK's own name and
796
+ version when the request gives a plain one; never the key, the token or the
797
+ device id. A session that opened without this run's token (or with another
798
+ value) is untagged, and that is said even when another request could not be
799
+ read. The events are called tagged only when every session the SDK opened
800
+ carried this run's token and no session request went unread. When they were
801
+ not tagged, `report.md` says under "Measured from the game's own events" that
802
+ the game's analytics SDK did not tag them and that they count as a real player
803
+ until the game updates its Ravensight SDK, with the SDK version in a code span.
804
+ When the run cannot tell (a session request it could not read, or events with
805
+ no session seen), it says the CLI could not tell whether they were tagged, and
806
+ never that they were. `usage.json` carries
807
+ `gameEvents.playtestTag` (`tagged`, `state`, `countsAs`, the sessions, the
808
+ events, the SDK version or null, and the sentence), the step log a
809
+ `game_events_tag` line, and the run summary says the same.
810
+
722
811
  With no ingest key configured, a Godot run says "no ingest key configured, so
723
- no synthetic telemetry was sent". A web run says "synthetic telemetry comes from
724
- the game's own SDK on the page, sent with the run's playtest token" instead,
725
- because the page's SDK already sends the game's events marked synthetic.
812
+ no synthetic telemetry was sent". A web run says instead what the page's own
813
+ SDK was seen to do: "synthetic telemetry comes from the game's own SDK on the
814
+ page (js/0.12.1), which opened its session with the run's playtest tag", that
815
+ it "did not tag its 23 events as this playtest ... so they count as a real
816
+ player", or that it "sent no events and opened no session".
726
817
 
727
818
  When a run reaches its model budget before the report step, nothing more is
728
819
  asked of the model. The persona's notes are written to a partial `report.json`
@@ -1886,3 +1977,7 @@ devices and cloud runs of a native build are not available; the cloud still
1886
1977
  needs a web build. The video stays on this machine unless you pass
1887
1978
  `--upload-video`. Prices, budgets and refunds are those of any local persona
1888
1979
  run. Setup, every flag and the limits are in [docs/MOBILE.md](docs/MOBILE.md).
1980
+
1981
+ ## Contributing
1982
+
1983
+ `npm install` installs the local checks (or run `npm run hooks:install`). The pre-push hook then runs the tests on Node 24 before every push, with a time limit, and refuses the push if they fail. CI runs nightly and on demand, not on pushes or pull requests, so this hook is where a change is checked first.