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 7241ddd
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).
feat(console): the sharing-rule object picker lists only the objects a rule can take effect on, business objects first
10
+
11
+
Clause-②: yes (widening) — `field:shareable-object-ref` joins `@object-ui/fields`' registered widget keys (`RegisteredFieldWidgetType`) and the console's known schema types; nothing is narrowed and no translation key is added.
12
+
Metadata-protocol: none
13
+
14
+
The object field of a new sharing rule listed every registered object, most of them platform `sys_*` objects, including ones a save refuses with `SHARING_NOT_ENABLED` and the credential and session objects. It now lists only what `GET /api/v1/sharing/shareable-objects` answers: the objects a rule saved on would take effect on, business objects first and then platform objects, each group by label, in the order the server sends.
15
+
16
+
-**The widget (`@object-ui/fields`).**`field:shareable-object-ref` reads the list through the host's authenticated fetch (`SchemaRendererContext.apiFetch`) and stores the object's name, as `object-ref` does, with the same `Label (name)` spelling. A stored name the list does not hold stays on screen as its own option, so editing a rule never drops it. The read-only face is `object-ref`'s.
17
+
-**When the list is not served.** A `403` (the caller is not a sharing-rule administrator), a `501` (sharing rules do not run on this deployment), any other failed or unreadable answer, and a host with no authenticated fetch all give the `object-ref` picker over every registered object, as before. The field is never an empty picker; the save doors still decide which object a rule may name.
18
+
-**The declaration (`@objectstack/plugin-sharing`).**`sys_sharing_rule.object_name` declares `widget: 'shareable-object-ref'` (was `object-ref`). A console without the widget draws the field as a text box, as with any unregistered widget.
19
+
-**The list cell, the record form and the grid.** The new key draws the same object label cell as `object-ref` (`@object-ui/app-shell`), the record form hands it the data source its fallback reads (`@object-ui/components`), and it is not edited inline in a grid cell, like the other widget-hint pickers.
fix(mcp): a coded refusal from a sandboxed hook or action body answers the body's own sentence, not the sandbox wrapper that names the hook
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
A QuickJS hook or action body that throws with a declared `code` and `status` (for example `throw Object.assign(new Error('Locked.'), { code: 'RECORD_LOCKED', status: 409 })`) reached every MCP tool and the `objectstack://objects/{name}/records/{id}` resource with the sandbox's debug wrapper as its message, `hook '<name>' threw: Error: Locked.`, so an agent saw the hook's internal name. `/api/v1/data` answers the same throw with the body's sentence alone.
11
+
12
+
The MCP tools and the record resource now read that sentence the way the `/data` door does (`sandboxBusinessMessage`, `@objectstack/types`): `{ "error": { "code": "RECORD_LOCKED", "message": "Locked.", "status": 409 } }`. The code and status are unchanged. A coded refusal that does not come from a sandbox keeps its own message byte for byte, and a sandboxed body that crashed keeps today's message.
13
+
14
+
This supersedes one sentence of the `@objectstack/mcp` note for the record data tools' code-less throw ("A thrown error that carries a `code` is answered exactly as before"): a coded refusal from a sandboxed body now answers its inner sentence; its code and status are still answered as before.
fix(plugin-auth): a correct-password sign-in refused afterwards, by an organization's allowed IP ranges, a ban or an unverified address, no longer counts toward the account lockout
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
The ADR-0069 D2 lockout counter read every refused `/sign-in/email` as a wrong password. Three refusals come only after the password verified: an organization's own IP list (`403 IP_NOT_ALLOWED`, judged when the new session is scoped to it), a ban (`403 BANNED_USER`, judged when the session is created) and an address the deployment requires verified (`403 EMAIL_NOT_VERIFIED`). Each raised the count, so an account holder with the right password could lock their own account: a member signing in from outside the organization's network was then refused `ACCOUNT_LOCKED` from inside it, a lifted ban left a lock behind, and a person waiting for their verification mail was locked out once it arrived. These three refusals now leave the counter as it stands, neither counting nor clearing it. A wrong password still counts in every case, and a successful sign-in still clears the count. The refusals' status, code and message and their `login_failed` audit rows are unchanged.
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.
feat(console): the marketplace catalog is filtered and paged by the server
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
The Console's marketplace page read the first 100 listings once and filtered them in the browser, so a catalog of more than 100 listings could never show the rest. It now reads one page at a time from `GET /api/v1/marketplace/packages`, and the search text, the facet selection and the page window travel with the read:
11
+
12
+
-`businessFunctions`, `industries` and `solutionTypes`, each one comma-joined parameter (`?businessFunctions=sales,marketing`), OR inside a facet and AND across facets, as the list door applies them. A facet with nothing selected is left out, never sent empty, and the retired `category` is never sent.
13
+
- The search box sends its text as `q` once typing pauses, and the list door does the matching.
14
+
-`limit` / `offset`: a pager under the cards walks the door's `total`, 24 listings a page. A new search or selection starts again from the first page.
15
+
16
+
`listMarketplacePackages` takes the four filters, `maturity` included, which the page itself does not select.
17
+
18
+
A drawn facet now lists every value the marketplace declares, in the spec's order, and no longer prints a count beside each value: one page of the filtered catalog cannot count the catalog, and the list door answers no counts. A facet appears once some listing the door answered carries it, and stays while a selection narrows the page, so a catalog that serves no taxonomy still draws no filter.
fix(mcp): a sandboxed hook body that crashes while declaring a code is a fault on MCP, not a refusal at its declared status
6
+
7
+
Clause-②: no
8
+
Metadata-protocol: none
9
+
10
+
A QuickJS hook body that crashed while declaring a code, for example `throw Object.assign(new TypeError('boom'), { code: 'RECORD_LOCKED', status: 409 })`, reached every MCP tool and the `objectstack://objects/{name}/records/{id}` resource as `{ code: 'RECORD_LOCKED', message: "hook '<name>' threw: TypeError: boom", status: 409 }`: the hook's internal name and the native error text, at a status that reads as a business refusal. `/api/v1/data`, `/meta` and `/actions` classify such a crash first and answer `500 INTERNAL_ERROR`.
11
+
12
+
MCP now asks the doors' own crash predicate (`isSandboxCrash`, `@objectstack/types`) before it reads a thrown code, so a crash with a declared code is answered as the same crash with no code. The record data tools (`query_records`, `aggregate_records`, `get_record`, `create_record`, `update_record`, `delete_record`) answer `{ "error": { "code": "INTERNAL_ERROR", "message": "Internal server error", "status": 500 } }` and log the crash once on the server, as `/api/v1/data` does. The other tools, `delete_records` and the record resource answer what they answer today for a crash with no code. A sandboxed body's coded refusal (no crash) 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