Skip to content

Commit 5f754fb

Browse files
committed
Merge origin/main into claude/issue-35974-readonly-package-view-saves
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgW85kwjGaz7HqsmEuv # Conflicts: # ui/packages/app-shell/src/views/ObjectView.tsx
2 parents ec456e0 + 55cd85f commit 5f754fb

15 files changed

Lines changed: 932 additions & 46 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/scenarios': patch
3+
---
4+
5+
Clause-②: no
6+
Metadata-protocol: none
7+
8+
skill-evals: a trigger turn installs the round's selection of bundles, not its own bundle alone
9+
10+
A `should_trigger` turn's project now holds every bundle of the round's selection (the `--skills` bundles, or every bundle), so a skill description competes with its neighbours' as it does in a real project. A should-load case passes only when its own bundle loads. Each record lists `installed` and `trigger.othersLoaded`, and the trigger table names the other bundles each case loaded. A turn whose init line misses an installed bundle is `invalid`. `--trigger-field own` installs the case's bundle alone, as rounds recorded before did. `round.json` records `triggerField`, the summary header names it, and `--regrade` keeps it. Under `--triggers-only`, a `--skills` bundle with no trigger case is installed as a competitor instead of being refused, as long as another named bundle has a trigger case.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
'@object-ui/app-shell': patch
3+
---
4+
5+
fix(console): saving a shared view's draft keeps the list on screen, and a second change builds on the first
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
An admin who saved a draft of a shared view (a footer calculation pick, or a view settings change) saw the list redraw on the published view about half a second later, and the change came back only after Publish. A second change before Publish was then built on the published view, so its draft replaced the first: pick Sum, then Latest, then Publish, and only Latest was kept.
11+
12+
Every draft save announces itself on the metadata-refresh pulse, so the pending-drafts surfaces re-read, and every mounted metadata provider refetches its loaded types on that pulse. While the refetched view list was on the wire, the route's object scope read as unanswered, so the console dropped the route to its loading skeleton and mounted the list again, on the published view. A type that is refetching over an answer it still holds now counts as answered: the scope stays settled on the views in hand, the route stays mounted, and the list keeps the draft on screen. This holds for every refresh pulse (a publish, a package install, a change noticed in another tab), not only a draft save. On an app with a metadata bundle, the pulse also drops the bundle, and it answers nothing until it is downloaded again; meanwhile the scope's views now come from the bundle that last answered, when it holds every object the route asked for, so the route stays mounted there too. A type the provider drops (an invalidation, an organization switch) still waits for its new answer, and an organization or session switch forgets the last bundle.
13+
14+
Publish and Discard in view settings now drop the list's local copy of the draft once the saved views have been read again, so the list then shows what is stored. A reader who is not an admin still sees the published view until Publish. No props, exports or locale keys change.

‎packages/qa/scenarios/README.md‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ wrapper, with no change to the runner.
895895
Every published skill bundle carries eval cases (`skills/BUNDLE/evals/*.json`: a `prompt`, an `expected_output` and
896896
`assertions.must_contain` / `must_not_contain`). `skill-evals` sends each case to the local Claude Code login twice,
897897
once with the bundle installed and once without, and grades each answer by the case's own tokens. A trigger case
898-
asks instead whether the skill was loaded, and runs with the bundle installed only. It runs from this checkout only. It is not part of the published `bin` or `exports`, not a CI job and not a merge gate. The cases are
898+
asks instead whether the skill was loaded, and runs with the bundle installed beside its competitors only. It runs from this checkout only. It is not part of the published `bin` or `exports`, not a CI job and not a merge gate. The cases are
899899
the skill authors' and the runner never edits them.
900900

901901
```bash
@@ -907,6 +907,7 @@ pnpm --filter @objectstack/scenarios skill-evals # every case ×
907907
pnpm --filter @objectstack/scenarios skill-evals --skills objectstack-query --repeats 3 # a touched skill
908908
pnpm --filter @objectstack/scenarios skill-evals --skills-from 18.5.0 # a published @objectstack/skills version's bundles and cases
909909
pnpm --filter @objectstack/scenarios skill-evals --skills objectstack-query --triggers-only # its trigger cases alone
910+
pnpm --filter @objectstack/scenarios skill-evals --skills objectstack-query,objectstack-ask --triggers-only # both installed in every trigger turn
910911
pnpm --filter @objectstack/scenarios skill-evals --regrade DIR # re-draw a recorded round's verdicts from its records; no model call
911912
pnpm --filter @objectstack/scenarios skill-evals --self-test # the runner's own fixtures; no model call
912913
```
@@ -938,10 +939,19 @@ pnpm --filter @objectstack/scenarios skill-evals --self-test # the runner's o
938939
cases are all positive, or all negative, is refused. The summary reports trigger cases in their own section beside
939940
the behaviour cases, never inside their pass rates: per bundle, loaded when it should, left alone when it should
940941
not, the missed loads and the false loads.
942+
- **The competing set (`--trigger-field`)**: a trigger turn's project holds every bundle of the round's selection
943+
(the `--skills` bundles, or every bundle of the catalog), so a description competes with its neighbours' as it does
944+
in a real project. Installed alone, a should-load case sits at the ceiling and a false load is a turn reading the
945+
only skill in an empty directory. A should-load case passes only when its own bundle loads. Each record lists
946+
`installed` and `trigger.othersLoaded`, and the trigger table names the other bundles each case loaded. A turn whose
947+
init line misses an installed bundle is `invalid`. `--trigger-field own` installs the case's bundle alone, as every
948+
round recorded before did. `round.json` records `triggerField`, the summary header names it, and `--regrade DIR`
949+
keeps it (the flag is refused there). Behaviour cases keep one bundle, so their two arms still differ only in it.
941950
- **`--triggers-only`**: the selected bundles' trigger cases alone, on the with-skill arm, for a change that only
942951
touches when a skill loads (its `description`). The summary is the trigger section alone, and `round.json` records
943-
`scope.triggersOnly`, so `--regrade DIR` keeps that scope. A bundle `--skills` names with no trigger case is refused
944-
(a published version before trigger cases has none), and so is the flag beside `--regrade` or `--self-test`.
952+
`scope.triggersOnly`, so `--regrade DIR` keeps that scope. A bundle `--skills` names with no trigger case is
953+
installed as a competitor while another named bundle has one; alone, or under `--trigger-field own`, it is refused
954+
(a published version before trigger cases has none). The flag is refused beside `--regrade` or `--self-test`.
945955
`--dry-run` prints the reduced plan, and `--skills-from VERSION` runs it on the published bundles.
946956
- **Case files**: a case's `files` entries are paths under the bundle's `evals/files/` (anything else is refused, and
947957
so is a path the bundle lacks or one with a `.claude` segment, since `.claude/` is where the runner places the skill). Each is copied, a directory whole, into both arms' directories at its path below

‎packages/qa/scenarios/src/skill-evals/arms.ts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
* The two arms one case runs under, as the directory a `claude -p` turn starts
55
* in and the argv it is given. The arms differ in exactly one thing — whether
66
* the case's bundle sits in the turn's project skills
7-
* (`.claude/skills/BUNDLE/`) — and share everything else:
7+
* (`.claude/skills/BUNDLE/`) — and share everything else. A trigger case runs
8+
* on the with-skill arm alone, with the round's competing set of bundles
9+
* installed beside its own (`installedFor` in `run.ts`). Both arms share:
810
*
911
* - a fresh temporary directory as the working directory, so nothing of this
1012
* checkout is in reach (a read outside the working directory needs a
@@ -76,20 +78,20 @@ export interface ArmWorkdir {
7678

7779
/**
7880
* Make one turn's directory: `ROOT/project` as the working directory, holding
79-
* `.claude/skills/BUNDLE/` (without `evals/`) on the with-skill arm and
80-
* nothing on the no-skill arm, and `ROOT/mcp.json` beside it.
81+
* `.claude/skills/BUNDLE/` (without `evals/`) for each of `bundles` on the
82+
* with-skill arm and nothing on the no-skill arm, and `ROOT/mcp.json` beside it.
8183
*
8284
* `ROOT` is always under the system temp directory, spelled at the call so the
8385
* dispatch-gates scratch scan reads it as outside the tree; a caller that
8486
* wants it gone removes `root` itself.
8587
*/
86-
export function prepareArmWorkdir(arm: Arm, bundle: string, skillsRoot: string): ArmWorkdir {
88+
export function prepareArmWorkdir(arm: Arm, bundles: string | readonly string[], skillsRoot: string): ArmWorkdir {
8789
const root = mkdtempSync(join(tmpdir(), 'skill-eval-'));
8890
const cwd = join(root, 'project');
8991
mkdirSync(cwd);
9092
const mcpConfigPath = join(root, 'mcp.json');
9193
writeFileSync(mcpConfigPath, JSON.stringify({ mcpServers: {} }));
92-
if (arm === 'with-skill') {
94+
for (const bundle of arm === 'with-skill' ? [bundles].flat() : []) {
9395
const from = join(skillsRoot, bundle);
9496
const withheld = join(from, WITHHELD_BUNDLE_DIR);
9597
cpSync(from, join(cwd, '.claude', 'skills', bundle), {

‎packages/qa/scenarios/src/skill-evals/cases.ts‎

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,11 @@ export function notUserInvocable(skillMd: string): boolean {
267267
* `triggersOnly` (`--triggers-only`), to their trigger cases. A name that is
268268
* not a bundle of the catalog, or names one with no case left to run, is
269269
* refused, never dropped: a misspelt touched skill would otherwise run nothing
270-
* and read as a clean round. So is a trigger-only selection with no case.
270+
* and read as a clean round. So is a trigger-only selection with no case. With
271+
* `competing` (trigger turns install the selection), a named bundle with no
272+
* case is kept while a trigger case is selected: it is installed as a competitor.
271273
*/
272-
export function selectBundles(catalog: SkillEvalCatalog, names: readonly string[] | undefined, triggersOnly = false): SkillEvalCase[] {
274+
export function selectBundles(catalog: SkillEvalCatalog, names: readonly string[] | undefined, triggersOnly = false, competing = false): SkillEvalCase[] {
273275
const pool = triggersOnly ? catalog.cases.filter((c) => c.shouldTrigger !== undefined) : catalog.cases;
274276
const kind = triggersOnly ? 'trigger case (`should_trigger`)' : 'eval case';
275277
if (!names || names.length === 0) {
@@ -279,7 +281,7 @@ export function selectBundles(catalog: SkillEvalCatalog, names: readonly string[
279281
const unknown = names.filter((n) => !catalog.bundles.includes(n));
280282
if (unknown.length) throw new Error(`--skills names ${unknown.map((n) => `\`${n}\``).join(', ')}, not a bundle under ${catalog.root} (bundles: ${catalog.bundles.join(', ')})`);
281283
const noCases = names.filter((n) => !pool.some((c) => c.bundle === n));
282-
if (noCases.length) throw new Error(`--skills names ${noCases.map((n) => `\`${n}\``).join(', ')}, a bundle with no ${kind} under ${catalog.root}`);
283-
const set = new Set(names);
284-
return pool.filter((c) => set.has(c.bundle));
284+
const picked = pool.filter((c) => names.includes(c.bundle));
285+
if (noCases.length && !(competing && picked.some((c) => c.shouldTrigger !== undefined))) throw new Error(`--skills names ${noCases.map((n) => `\`${n}\``).join(', ')}, a bundle with no ${kind} under ${catalog.root}`);
286+
return picked;
285287
}

0 commit comments

Comments
 (0)