@pikku/core 0.12.98 → 0.12.99

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 (37) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/dist/services/http-personas.d.ts +10 -4
  3. package/dist/services/index.d.ts +1 -0
  4. package/dist/services/index.js +1 -0
  5. package/dist/services/persona-actor-secret.d.ts +38 -0
  6. package/dist/services/persona-actor-secret.js +39 -0
  7. package/dist/services/persona-sign-in.d.ts +11 -1
  8. package/dist/services/persona-sign-in.js +10 -1
  9. package/dist/services/typed-secret-service.js +4 -1
  10. package/dist/wirings/agent-scorer/agent-scorer.d.ts +14 -0
  11. package/dist/wirings/gateway/gateway.types.d.ts +13 -0
  12. package/dist/wirings/persona/index.d.ts +2 -1
  13. package/dist/wirings/persona/index.js +1 -0
  14. package/dist/wirings/secret/secret.types.d.ts +8 -0
  15. package/knowledge/decisions/internals/a-virtual-user-cadence-is-a-row-not-a-timer.md +1 -1
  16. package/knowledge/decisions/internals/a-virtual-user-run-is-not-a-workflow-but-it-needs-a-trigger.md +65 -0
  17. package/knowledge/decisions/internals/index.md +1 -1
  18. package/knowledge/decisions/security/actor-sign-in-only-works-for-actor-flagged-users.md +19 -15
  19. package/knowledge/decisions/security/an-actor-credential-is-derived-per-persona.md +41 -0
  20. package/knowledge/decisions/security/index.md +2 -1
  21. package/package.json +4 -4
  22. package/src/public-surface.json +12 -0
  23. package/src/services/http-personas-converse.test.ts +3 -3
  24. package/src/services/http-personas.test.ts +13 -5
  25. package/src/services/http-personas.ts +10 -3
  26. package/src/services/index.ts +8 -0
  27. package/src/services/persona-actor-secret.test.ts +68 -0
  28. package/src/services/persona-actor-secret.ts +70 -0
  29. package/src/services/persona-sign-in.ts +20 -2
  30. package/src/services/typed-secret-service.test.ts +26 -1
  31. package/src/services/typed-secret-service.ts +4 -1
  32. package/src/wirings/agent-scorer/agent-scorer.ts +14 -0
  33. package/src/wirings/gateway/gateway.types.ts +20 -1
  34. package/src/wirings/persona/index.ts +9 -0
  35. package/src/wirings/secret/secret.types.ts +8 -0
  36. package/tsconfig.tsbuildinfo +1 -1
  37. package/knowledge/decisions/internals/a-virtual-user-run-is-not-a-workflow-and-not-a-queued-job.md +0 -53
@@ -1,53 +0,0 @@
1
- ---
2
- type: decision
3
- title: A virtual user run is not a workflow and not a queued job
4
- description: runVirtualUser writes its record, dispatches the run without awaiting it, and returns the id — because an exploratory run has nothing to replay and the record already carries what a queue would be holding
5
- tags: virtual-user, storage
6
- ---
7
-
8
- # A virtual user run is not a workflow and not a queued job
9
-
10
- `runVirtualUser` — the RPC `scaffold.virtualUser` generates — does three things
11
- in order: writes a `VirtualUserRunStore` record, dispatches
12
- `executeVirtualUserRun` **without awaiting it**, and returns the `runId`. There
13
- is no workflow, no queue, and no worker.
14
-
15
- Both of the alternatives are the obvious ones, and both are wrong for this.
16
-
17
- **A workflow** is a replayable step graph: its value is that a run can be
18
- resumed at the step it died on, and that the same input reaches the same step.
19
- A virtual user is the opposite by construction — it is an LLM deciding what to
20
- try next, so no two attempts take the same steps, and there is no step to resume
21
- _to_. Recording a run as a workflow puts entries in the workflow store that can
22
- never be replayed, and gives every operator reading that store a row that lies
23
- about what it is. The seed makes a run _reproducible_ — run it again and it
24
- explores the same way — which is a different property from resumable, and one
25
- the record already carries.
26
-
27
- **A queue** buys durability across a restart and a retry on failure. It costs a
28
- broker dependency in every application that turns the scaffold on, plus a worker
29
- whose progress cannot be read anyway: the run's state lives in the store, not in
30
- the queue entry. The queue would be holding a copy of what the record already
31
- has, on the way to the same place.
32
-
33
- So the record is the run's only trace, and that is what `VirtualUserRunStore`
34
- exists for. It is also why `fail()` is a method rather than an absence: a run
35
- that crashed and a run that found nothing are different answers, and a record
36
- left at `running` is neither.
37
-
38
- The cost is real and is stated on the type: **a restart mid-run strands a record
39
- at `running` with nothing left to finish it.** A run older than its budget
40
- window and still `running` is dead, not working — a read-side rule, and cheaper
41
- than the two dependencies avoided. Nothing retries; a stranded run is started
42
- again, with its seed if the caller wants the same exploration.
43
-
44
- Where that rule is actually applied is
45
- [the schedule tick](a-virtual-user-cadence-is-a-row-not-a-timer.md), which has
46
- to: a record stuck at `running` would otherwise block its persona's cadence
47
- forever.
48
-
49
- **What this rules out:** dispatching the run through `startWorkflow`; a
50
- scaffolded queue worker; awaiting the engine inside the request (a run takes
51
- minutes and survives neither a rollout nor a proxy timeout); and inferring
52
- `status` from `finishedAt` being unset, which cannot separate a crash from a run
53
- still going.