You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 39a525c
Browse filesBrowse the repository at this point in the historyBrowse files
feat(scenarios): a scenario card declares which seed fields hold a user handle and which seed row each scoped persona is, and a refused seed row takes out only the turns whose answer it changes
6
+
7
+
Clause-②: yes (narrowing) — the published card schema (`ScenarioCardSchema` in the `.` entry) gains `run.userHandleFields` and `personas[].record`, and the loader (`loadScenarios`, `loadScenarioFile`) refuses a card it loaded before: a persona `scope` rule ending on a field that is neither `id`, a declared lookup or select, nor a declared user-handle field, and a scoped persona that names no person. `truthsOver` is a new export of the same entry. In `./runner`, `seedDependence` now takes the loaded scenario (it was handed the card) and its `question` takes the persona the turn is asked as, and `RunHalf.seed` gains `rewritten`.
8
+
Metadata-protocol: none
9
+
10
+
<!-- adr-0087: not-required (no-migration-prescription) The card format is QA tooling in a devx package, not the metadata protocol: no key of any platform schema is added, removed, renamed or re-shaped, and nothing an app author writes is refused. What moves is which scenario cards the loader accepts; a card author adds the two declarations the refusal names, and there is nothing for a metadata migration to rewrite. -->
11
+
12
+
**BREAKING** accept-set narrowing at the scenario card loader (`@objectstack/scenarios`): a card that leaves the runner to infer what a scope value names is refused until it declares it. All nine cards in `docs/qa/scenarios/` carry the declarations and load as before.
13
+
14
+
-**User-handle fields, declared.**`run.userHandleFields: [{ object, field }]` lists the seed fields whose text stands for a user (`account.owner` = `u_sam`). The runner loads each such cell with the user's id, and `userHandleFields` (runner `prompts.ts`) reads this list instead of inferring it from what the card does not declare. The loader refuses a scope rule whose last field is none of `id`, a declared lookup, a declared select or a declared handle field, and a handle declaration on the row id, a lookup, a select or a field no seed row carries. The run record's `seed.rewritten` lists the fields the seed rewrote. Across the nine cards the rewritten set is unchanged: `account.owner`, `invoice.owner`, `task.assignee`.
15
+
-**The person a persona is.**`personas[].record: { object, id }` names the seed row that is this person (`{ object: "employee", id: "e06" }`). It is required for a persona with a `scope`, unless the persona is named by a direct scope rule on a declared handle field (the three control cards), and optional for a global persona. The loader refuses a record that names no seeded row. The person object's user field is `user` by name. The runner does not read `record` yet.
16
+
-**Seed dependence per turn.** When the app refuses a seed row, the runner computes each question's truth again over the seed less the refused rows and their children (`truthsOver`, the loader's own rules), and marks not measured only the turns whose expected answer changes. Before, every question on an object holding a refused row was not measured. On `crm_account_with_contacts`, refusing contact `ct4` now leaves `contacts_per_account` as `sdr` (whose scope never reads it) measured.
17
+
18
+
**Who moves.** An author of a scenario card in a private overlay: add `run.userHandleFields` for each field holding a user handle, and `record` on each scoped persona that is a seed row. A caller of `seedDependence` from `@objectstack/scenarios/runner` passes the `LoadedScenario` and asks `question(q, persona)` per turn (`null` for a turn over all rows).
fix(cli): `os build` leaves `devPlugins` out of the artifact, and `os validate --target` no longer reads it as code
6
+
7
+
Clause-②: yes (widening) — two accept-sets widen: `os validate --target` with `allowCode: false` now accepts a stack that declares `devPlugins`, and an unmanaged install (`os package install --install-mode unmanaged`, and the cloud-connection local installs) of a freshly built artifact of such a stack is no longer refused, because that artifact no longer carries the key. Leaving the key out of `objectstack.json` refuses nothing (every stack that built before still builds, and the published stack schema still accepts an artifact that carries it).
8
+
Metadata-protocol: none
9
+
10
+
`devPlugins` is the list a development boot (`os dev`, `os serve --dev`) adds to the plugins it loads, read off the config it loads. Nothing that boots or installs the artifact loads it, yet `os build` wrote it into `objectstack.json`, so `os package publish` and `os deploy` (which send that file) carried a development-only load list to the target. `os build` now drops it at the one place the artifact is written, as it already dropped `demoStaff`.
11
+
12
+
Because the key no longer reaches a target, a target environment's restriction profile has nothing to refuse: `os validate --target` with `allowCode: false` no longer reports a row per dev-only plugin. `plugins`, `functions`, `hooks` and the other code keys are judged as before, and `os dev` / `os serve --dev` still load `devPlugins` from the config.
13
+
14
+
The same goes for an unmanaged install: a freshly built artifact of a stack with `devPlugins` now installs unmanaged, where it was refused as carrying code. A bundle that still carries the key, such as an artifact built before this release, is still refused as code by an unmanaged install: the spec's classification of `devPlugins` is unchanged.
Copy file name to clipboardExpand all lines: docs/qa/scenarios/README.md
+18-2Lines changed: 18 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ question's computed truth; a card that does not load is red in CI.
33
33
| 1 |`prompt`|`{ short, detailed }`, each `{ zh?, en? }` with at least one language. |
34
34
| 2 |`expect`| The structural expectation the deterministic scorer reads, field for field: `objects`, `minFieldsPerObject?`, `selectFields?` (`{ object, field, minOptions }`), `lookups?` (`{ object, field, to }`), `dashboards?`, `appNavTargets?`. The runner's build prompt states every row by name ([Build checks trace to the prompt](#build-checks-trace-to-the-prompt)). |
35
35
| 3 |`capabilities`, `businessFunctions`| Tags `<area>.<name>`, where `<area>` is a closed set: the basenames of `docs/qa/platform-checklist/areas/*.json`, read from the tree. `businessFunctions` is the marketplace taxonomy's business-function facet, read from `@objectstack/spec/marketplace` (`MarketplaceBusinessFunctionsSchema`, defined once in `packages/spec/src/marketplace/taxonomy.zod.ts`): 1-3 distinct values, the primary one first — the card is classified the way the template it graduates into will be listed. |
36
-
| 4 |`run.seed`, `run.questions`, `run.personas`| Seed rows per object; at least five read-only questions, each with a **declarative** truth spec; at least two personas, each a role, the objects or fields it must NOT see, and optionally a row `scope`. |
36
+
| 4 |`run.seed`, `run.userHandleFields?`, `run.questions`, `run.personas`| Seed rows per object, and which seed fields hold a user handle; at least five read-only questions, each with a **declarative** truth spec; at least two personas, each a role, the objects or fields it must NOT see, and optionally a row `scope` and the person `record` it is. |
37
37
| 5 |`run.operations`, `run.guardrails`, `run.agentActions?`| At least two writes, each acting as a persona and declaring its `outcome`; the five guardrail checks; optionally the agent-callable business actions. |
38
38
| 6 |`iterate`| A one-sentence change request plus the `expectDelta` it should add to `expect`. |
39
39
@@ -159,7 +159,23 @@ one of three shapes: `{ kind: "scalar", value }`, `{ kind: "groups", groups: [{
159
159
## Personas, operations and guardrails
160
160
161
161
A persona names at least one object or field it must not see; its references must resolve
162
-
against `expect.objects` and the seed. An operation is a `create` (with `values`), an
162
+
against `expect.objects` and the seed.
163
+
164
+
**What a scope value names is declared, never inferred.** The field a `scope` rule ends on
165
+
(the last hop of a path) is `id` or a declared lookup (the value names a row), a declared
166
+
select (an option), or a **user-handle field**: a seed field listed in
167
+
`run.userHandleFields` (`[{ "object": "account", "field": "owner" }]`), whose text
168
+
(`u_sam`) stands for a user. The runner loads a handle field's cells with that user's id and
169
+
never the text, and the run record lists the fields it rewrote (`seed.rewritten`). The loader
170
+
refuses a scope rule ending on any other field, and a handle declaration on the row id, a
171
+
declared lookup or select, or a field no seed row carries.
172
+
173
+
**A scoped persona names the person it is.**`record: { "object": "employee", "id": "e06" }`
174
+
is the seed row that is this person (an employee, an agent, a customer); the loader refuses
175
+
one naming no seeded row. It is required on a persona with a `scope`, unless that persona is
176
+
named through a handle instead (a direct scope rule on a declared user-handle field,
177
+
`owner: u_sam`, as on the three controls), and optional on a global one. The person object's
178
+
user field is `user`, fixed by name: no card chooses it. An operation is a `create` (with `values`), an
163
179
`update` (with `target` and `values`) or a `delete` (with `target`); a target is a seeded row
164
180
id, and every written field is one the seed carries. Every operation names the persona it
165
181
acts for (`actingAs`) and declares its `outcome`, so grading reads it with code only:
0 commit comments