Skip to content

Commit 2c60bdf

Browse files
committed
Merge origin/main into claude/issue-36897-list-objectgrid
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzgNtKtppbRbXmHGH8x
2 parents b6b3ae1 + 4f9a3f8 commit 2c60bdf

87 files changed

Lines changed: 2767 additions & 468 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
'@objectstack/lint': minor
3+
'@objectstack/runtime': minor
4+
'@objectstack/spec': minor
5+
---
6+
7+
fix(lint)!: a body whose regular-expression pattern the runtime's QuickJS also refuses is refused, not only warned about
8+
9+
Clause-②: no (narrowing)
10+
Metadata-protocol: narrowed
11+
Skills-docs: follow-up #36727
12+
13+
<!-- adr-0087: registered body-regexp-pattern-refused -->
14+
15+
**BREAKING** only for a body that never ran. `action-body-does-not-compile`, `hook-body-does-not-compile` and `job-body-does-not-compile` compile an L2 body inside the wrapper the runtime runs it in, with the host's JavaScript engine, and reported every failure V8 words as `Invalid regular expression: /PATTERN/FLAGS: REASON` at `warning`, because the host's V8 and the runtime's QuickJS differ on some patterns. Measured over the same wrapper text (Node 22.23.5's V8 12.4, Unicode 17.0 tables, against quickjs-emscripten 0.32.0), they differ on two constructs, a duplicate named capture group in different alternatives (`/(?<a>x)|(?<a>y)/`, V8 `Duplicate capture group name`) and a modifier group (`/(?i:a)/`, V8 `Invalid group`), and on three Unicode property names, `IDS_Unary_Operator` (`IDSU`), `Modifier_Combining_Mark` (`MCM`) and the script `Katakana_Or_Hiragana` (`Hrkt`, under `sc=`, `Script=`, `scx=` or `Script_Extensions=`), V8 `Invalid property name`: every name in QuickJS's own tables was compiled in every key form, under `u` and `v`, bare and in a class, and these twelve spellings were every disagreement. Node 22 refuses them and QuickJS runs them. Every other pattern reason probed is refused by QuickJS too, among them an unterminated group (`/(/`), nothing to repeat (`a**`), a class range out of order (`/[b-a]/`), and under `u` a back-reference to a group the pattern does not name, a Unicode property name neither engine knows (`/\p{Nope}/u`) and an incomplete quantifier (`/a{/u`). Such a body passed `os validate`, `os build`, `os lint` and the runtime publish door, and every run of it failed.
16+
17+
What moves (FROM → TO):
18+
19+
- The three rules (`validateActionBodyCompiles`, `validateHookAndJobBodyCompiles`, `@objectstack/lint`) on a regular-expression pattern failure that is not one of those measured gaps: FROM `warning` TO `error` at `os validate`, `os build`, `os lint` and the runtime publish door (`action`, `object` and `hook` writes, `422 INVALID_METADATA`), with a hint that names the fix. The measured gaps stay a `warning`; a property name is judged by the host's Unicode tables, and on a host whose tables are older than Unicode 17.0 every property name it refuses is a `warning`; a later Node whose V8 accepts a gap reports nothing for it.
20+
- `BodyCompileShape` (`@objectstack/lint`) gains `regexp-dialect-gap`, the one `warning` arm; `regexp-pattern` is now an `error`.
21+
- The unterminated-literal hint names a line terminator inside the literal as a cause (a `\n` written with one backslash in a quoted or JSON-carried `body.source`).
22+
- A hook lowered from an inline `handler` whose body does not compile gets a hint that names the handler instead of `body.source`.
23+
- The runtime's QuickJS runner (`@objectstack/runtime`): a hook or job body that does not compile is reported FROM the generic `hook 'NAME' threw: SyntaxError: …` (the sentence a body that ran and threw gets) TO `hook 'NAME' does not compile: SyntaxError: …` (and `job 'NAME' …`), the way an action body's is. The caller's answer is unchanged: the `/data` door still answers the sanitised `500 INTERNAL_ERROR`.
24+
- `os explain` for the three rules and the ADR-0087 entries `action-body-does-not-compile-refused`, `action-body-regexp-literal-token-refused` and `hook-job-body-does-not-compile-refused` now say which pattern failures warn.
25+
26+
The fix: close every group, give each quantifier something to repeat or escape it, write a class range low to high, reference only a group the pattern names, and use a Unicode property that exists.
27+
28+
No conversion is made (ADR-0087 D3, entry `body-regexp-pattern-refused`): which pattern the author meant is a judgement. Measured first-party exposure: zero.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/platform-objects': patch
3+
'@objectstack/cloud-connection': patch
4+
'@object-ui/app-shell': patch
5+
'@object-ui/i18n': patch
6+
---
7+
8+
feat(console): Setup gets one Packages entry, the package list's administration face; the Installed Apps entry retires
9+
10+
Clause-②: no
11+
Metadata-protocol: none
12+
13+
The maintainer's ruling on objectstack#36834 amends ruling 甲 of #25098: Setup lists what is installed, with the administration actions only, and the marketplace-only "Installed Apps" entry merges into it.
14+
15+
- **Setup → Apps → Packages (`nav_packages`).** `@objectstack/platform-objects` contributes one entry to Setup's `group_apps`, gated on `manage_platform_settings` like Setup's other administration entries. It opens the console's `developer:packages` page with `params: { face: 'admin' }`, so the URL carries `?face=admin`. Its label is translated in every locale the Setup bundle carries.
16+
- **The page's administration face.** With `?face=admin`, the Packages page lists every package of every source, with modules folded under their app. It shows the Name, Version, Status, Source and Update columns, plus a Source filter (All, Code, Marketplace, Authored) that writes `?source=`. Its only header action is New Package, and a package created there opens in Studio, on the address the Studio landing's package card opens. The detail sheet offers View info, Disable / Enable and Delete (keeping the choice to keep the data), plus "Open in Studio" on an authored package. Import, Edit, Publish, Revert, Export, Duplicate, Adopt loose items and the pending changes' Publish and Discard are not offered there. An unknown or repeated `face` value is refused by name. With no `face`, the page is unchanged: Studio's "All packages" link and each package card's Manage keep every action.
17+
- **Installed Apps retires.** `MARKETPLACE_INSTALLED_UI_BUNDLE` (`@objectstack/cloud-connection`) no longer carries `nav_marketplace_installed`. The bundle stays exported under its id, with an empty `navigationContributions`, so a host that imports and registers it keeps working. The entry's labels are removed from the Setup translation bundle, and its id joins the dead-key tombstone. A bookmarked `/apps/setup/component/developer/packages?source=marketplace`, which the marketplace page's "Installed" button also opens, still shows the list filtered to marketplace installs, on the administration face.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@objectstack/spec': patch
3+
'@object-ui/app-shell': patch
4+
---
5+
6+
Clause-②: no
7+
Metadata-protocol: none
8+
9+
The report authoring form's Default Period row (Period & export, then Date Range) now names each choice: Today, This month, Last 30 days, Custom… and so on, instead of the stored preset (`this_month`). The options cover the shared preset table one for one, so a preset added later is offered with a name the day it lands. In the Studio report inspector, a Chinese session reads the names from the console's locale packs, the same words the report page's period chip shows (本月, 近 30 天, 自定义…).
10+
11+
Only the form's option names moved. No key, accepted value or default changed, and nothing an author can write or validate is different.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
---
4+
5+
fix(console): following a record link on a screen flow's result screen closes the flow dialog
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
On the last screen of a multi-screen screen flow, the screen that links the records the flow created, following one of those links now closes the flow dialog. The user lands on the record with nothing on top of it.
11+
12+
Before, the dialog stayed open over the record page and showed the flow's first screen again, with its inputs and a live Next. The record page draws a loading state on every record change, and the dialog was rebuilt from the step the run first paused on. Pressing Next sent the first screen's values to a run that was already on its last screen, and the user saw the engine's English refusal ("Invalid screen input: Unknown screen field …"). A lead conversion and a quote wizard both showed this after their records had been created.
13+
14+
Following a link in the same window now closes the dialog before the page changes:
15+
16+
- On a result screen (only record links, nothing after it), the run is also completed, the same way Done completes it: the completion toast, the refresh, and the host's completion callback.
17+
- On any other screen, the link closes the dialog the way Cancel does and resumes nothing.
18+
- A link opened in a new tab or window leaves the dialog where it is.
19+
20+
`ScreenView` takes an optional `onRecordLinkFollow` callback for this; the Studio preview passes none. Nothing to migrate.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/spec': minor
3+
---
4+
5+
fix(spec): `GetMetaTypesResponseSchema` declares every member `GET /meta/types` serves on an entry
6+
7+
Clause-②: yes (widening: the published response schema declares four members the route already serves)
8+
Metadata-protocol: added
9+
10+
Each `/meta/types` entry has always carried `schemaId`, `schema` (the type's JSON Schema), `form` (its Studio editor layout) and, when the type has any, `actions`, but the wire schema declared none of them, so a typed client and the published JSON Schema could not see them. They are declared now: `schemaId` as a string, `schema` as a JSON Schema record, `form` as a `FormView` and `actions` as `Action[]`, each optional except `schemaId`, as the route serves them. Nothing the server sends changes. Because `form` and `actions` carry defaults, the response now has a parsed shape, named `GetMetaTypesResponseParsed`.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@object-ui/components': patch
3+
---
4+
5+
fix(components): a related-list tab badge keeps following its list after a row action
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
On a record page, after a row action ran in a related list (for example an `update` action such as "Mark done"), every later delete or create in that list left the tab's count badge on its old number until a reload, while the list showed the new one.
11+
12+
A row action reaches the data-change bus twice, a beat apart: the write's own mutation event, then the related list's refresh. The first change sent a re-count; the second overtook it while it was out. `RelatedCountStore.fetch` then resolved with the overtaken read's number without caching it, and the record page's count reader took "resolved, nothing cached" as a failed read and stopped asking for that count for the rest of the record open.
13+
14+
`RelatedCountStore.fetch` now settles on a count the store holds: when a change overtakes the read it joined (an invalidation, a newer seeded read, or a rail card's unmount), it takes the count a newer read installed, joins the read now in flight, or reads again. A read that fails without being overtaken still answers `0` with nothing cached, as before.
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
#!/usr/bin/env bash
2+
# Self-test for guard-dispatch-tier.sh — run it after touching that hook:
3+
#
4+
# .claude/hooks/guard-dispatch-tier.selftest.sh
5+
#
6+
# Feeds the hook the JSON payload shape Claude Code delivers on PreToolUse for an Agent call
7+
# and asserts the block/allow verdict per case. Needs jq (to build payloads and to read
8+
# settings.json) and nothing else: no install, no build, no network. Exit 0 = all cases hold.
9+
#
10+
# The first case is the measured shape: an os-dev dispatch with neither `model` nor `effort`.
11+
12+
set -uo pipefail
13+
14+
here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
15+
hook="$here/guard-dispatch-tier.sh"
16+
settings="$here/../settings.json"
17+
pass=0
18+
fail=0
19+
20+
command -v jq >/dev/null 2>&1 || { echo "selftest needs jq to build payloads" >&2; exit 1; }
21+
22+
LINE='Container & model: `M`, `mode:subagent`, `model: opus (no path-derived mandate)`, `effort: high (M card)`'
23+
PROMPT="No-card order.
24+
25+
$LINE
26+
Branch: claude/issue-7-x"
27+
28+
payload() { # payload <tool> <subagent_type> <model> <effort> <prompt> — an empty value omits the key
29+
jq -nc --arg t "$1" --arg s "$2" --arg m "$3" --arg e "$4" --arg p "$5" \
30+
'{tool_name:$t, tool_input:({description:"d", prompt:$p}
31+
+ (if $s == "" then {} else {subagent_type:$s} end)
32+
+ (if $m == "" then {} else {model:$m} end)
33+
+ (if $e == "" then {} else {effort:$e} end))}'
34+
}
35+
36+
expect() { # expect <block|allow> <label> <tool> <subagent_type> <model> <effort> <prompt> [env…]
37+
local want="$1" label="$2"; shift 2
38+
local body rc got; body="$(payload "$1" "$2" "$3" "$4" "$5")"; shift 5
39+
printf '%s' "$body" | env "$@" "$hook" >/dev/null 2>&1; rc=$?
40+
case "$rc" in 0) got=allow ;; 2) got=block ;; *) got="exit$rc" ;; esac
41+
if [ "$got" = "$want" ]; then pass=$((pass + 1)); printf ' ok %-5s %s\n' "$got" "$label"
42+
else fail=$((fail + 1)); printf ' FAIL want=%s got=%s %s\n' "$want" "$got" "$label"; fi
43+
}
44+
45+
says() { # says <needle> <label> <subagent_type> <model> <effort> <prompt>
46+
local needle="$1" label="$2" out; shift 2
47+
out="$(payload Agent "$1" "$2" "$3" "$4" | "$hook" 2>&1 >/dev/null)"
48+
case "$out" in
49+
*"$needle"*) pass=$((pass + 1)); printf ' ok says %s\n' "$label" ;;
50+
*) fail=$((fail + 1)); printf ' FAIL missing "%s" %s\n' "$needle" "$label" ;;
51+
esac
52+
}
53+
54+
echo "== THE MEASURED SHAPE: an os-dev dispatch with no model and no effort =="
55+
expect block 'no model, no effort, no line' Agent os-dev '' '' 'Implement the card.'
56+
expect block 'no model, no effort — even with the line in the prompt' Agent os-dev '' '' "$PROMPT"
57+
58+
echo "== each half alone is not enough =="
59+
expect block 'effort without model' Agent os-dev '' high "$PROMPT"
60+
expect block 'model without effort' Agent os-dev opus '' "$PROMPT"
61+
expect block 'both parameters, no Container & model line in the prompt' Agent os-dev opus high 'Implement the card.'
62+
expect block 'both parameters, the key off the line start is prose' Agent os-dev opus high "as said, $LINE"
63+
expect block 'both parameters, the line carries no effort slot' Agent os-dev opus high 'Container & model: `M`, `mode:subagent`, `model: opus`'
64+
expect block 'both parameters, the effort slot is the unfilled placeholder' Agent os-dev opus high 'Container & model: `M`, `model: opus`, `effort: <medium | high>`'
65+
expect block 'the line says high and the call passes medium' Agent os-dev opus medium "$PROMPT"
66+
expect block 'the line says medium and the call passes high' Agent os-dev opus high 'Container & model: `S`, `mode:subagent`, `model: opus`, `effort: medium`'
67+
expect block 'the same through the older tool name' Task os-dev '' '' "$PROMPT"
68+
69+
echo "== the dispatch that carries both, and says the same on its line =="
70+
expect allow 'model + effort, line effort equal' Agent os-dev opus high "$PROMPT"
71+
expect allow 'the older tool name' Task os-dev opus high "$PROMPT"
72+
expect allow 'undecorated line' Agent os-dev opus medium 'Container & model: S, mode:subagent, model: opus, effort: medium'
73+
expect allow 'bulleted, bold key' Agent os-dev opus high '- **Container & model:** `L`, `mode:cloud`, `model: opus`, `effort: high`'
74+
expect allow 'the effort compares case-insensitively' Agent os-dev opus HIGH 'Container & model: `M`, `model: opus`, `effort: High`'
75+
expect allow 'a reasoned exception is the claim-time table'"'"'s to judge, not this hook'"'"'s' Agent os-dev opus high 'Container & model: `S`, `model: opus`, `effort: high, reason: not mechanical`'
76+
77+
echo "== precision: only os-dev dispatches are judged =="
78+
expect allow 'another subagent type with nothing set' Agent general-purpose '' '' 'Look something up.'
79+
expect allow 'no subagent_type at all' Agent '' '' '' 'Look something up.'
80+
expect allow 'a longer name that merely starts with os-dev' Agent os-dev-helper '' '' 'x'
81+
82+
echo "== the escape hatch, read from the hook's own environment =="
83+
expect allow 'OS_ALLOW_UNTIERED_DISPATCH=1' Agent os-dev '' '' 'Implement the card.' OS_ALLOW_UNTIERED_DISPATCH=1
84+
expect block 'any other value does not open it' Agent os-dev '' '' 'Implement the card.' OS_ALLOW_UNTIERED_DISPATCH=yes
85+
86+
echo "== the refusal says what is missing and where the rule lives =="
87+
says 'execution-duties.md' 'names the rulebook file' os-dev '' '' 'x'
88+
says 'no `model` parameter' 'names the missing model' os-dev '' high "$PROMPT"
89+
says 'no `effort` parameter' 'names the missing effort' os-dev opus '' "$PROMPT"
90+
says 'says `effort: high` and the call passes `effort: medium`' 'names both sides of a mismatch' os-dev opus medium "$PROMPT"
91+
says 'hook itself runs in' 'names the environment the escape hatch is read from' os-dev '' '' 'x'
92+
93+
echo "== fails OPEN on payloads it cannot parse =="
94+
printf '%s' 'not json at all' | "$hook" >/dev/null 2>&1
95+
if [ $? -eq 0 ]; then pass=$((pass + 1)); printf ' ok allow <malformed payload>\n'
96+
else fail=$((fail + 1)); printf ' FAIL want=allow <malformed payload>\n'; fi
97+
printf '%s' '{"tool_name":"Agent"}' | "$hook" >/dev/null 2>&1
98+
if [ $? -eq 0 ]; then pass=$((pass + 1)); printf ' ok allow <no tool_input>\n'
99+
else fail=$((fail + 1)); printf ' FAIL want=allow <no tool_input>\n'; fi
100+
101+
echo "== wiring: settings.json routes Agent and Task to this hook on PreToolUse =="
102+
for tool in Agent Task; do
103+
routed="$(jq -r --arg t "$tool" '.hooks.PreToolUse[]? | select(.matcher | split("|") | index($t)) | .hooks[]?.command' "$settings" 2>/dev/null)"
104+
case "$routed" in
105+
*guard-dispatch-tier.sh*) pass=$((pass + 1)); printf ' ok wired %s\n' "$tool" ;;
106+
*) fail=$((fail + 1)); printf ' FAIL settings.json routes no %s call to guard-dispatch-tier.sh\n' "$tool" ;;
107+
esac
108+
done
109+
110+
echo
111+
echo "guard-dispatch-tier selftest: $pass passed, $fail failed"
112+
[ "$fail" -eq 0 ] || exit 1
113+
# A floor, so a matrix that ran nothing cannot read as a pass.
114+
[ "$pass" -ge 31 ] || { echo "guard-dispatch-tier selftest: only $pass case(s) ran — the matrix is 31" >&2; exit 1; }
115+
exit 0

0 commit comments

Comments
 (0)