Skip to content

Commit 01d2b0f

Browse files
os-warrenclaude
andcommitted
docs(skills): objectstack-platform teaches demoStaff and when to pick it over devLogins
The platform skill named `demoStaff` only in its top-level key list, so an author preparing a demo declared banner logins and hand-wrote user seed rows. The Seed Data section now says what each key does and which to pick, with one example and the refusals an author meets, and the package's eval file gains one prompt for it. Paid under the token ratchet's ruling A: four restatements cut from SKILL.md first, then the two touched CEILINGS rows raised by exactly the measured remainder, each row comment carrying the arithmetic. Claude-Session: https://claude.ai/code/session_01JQwxbX1XjSzpntF9n85TgB Co-authored-by: Claude <noreply@anthropic.com>
1 parent c51aed4 commit 01d2b0f

3 files changed

Lines changed: 68 additions & 13 deletions

File tree

‎scripts/check-skills-token-ratchet.mjs‎

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,27 @@ export const CEILINGS = new Map([
421421
// decision tables at 487 lines.
422422
// 5833 -> 5828: A2′ — the release-stamp line left the count (see
423423
// STAMP_LINE_REPIN); the file's count fell by the same 5, headroom unchanged.
424-
['skills/objectstack-platform/SKILL.md', 5828],
424+
// 5828 -> 5981 (card #26302, the objectstack-platform row of the skills gap
425+
// audit): the Seed Data section gains `demoStaff` against `devLogins` — a
426+
// seed deals records to people and cannot create one, so the people are
427+
// declared in `demoStaff` and `os dev` creates the accounts (position and
428+
// permission sets from the stack's own declarations, the seed password, never
429+
// in the built artifact), while `devLogins` is banner text that creates and
430+
// grants nothing. Maintainer ruling 2026-10-27 on the seat's decision card
431+
// 「skills 修复卡的教学和 eval 都撞 token 天花板,怎么付?」, his tap verbatim
432+
// and untranslated: 「A:先削重复,余额按实测提高」. Paid down first, as the
433+
// ruling asks — four restatements cut, each with a surviving home in the
434+
// file: the `defineStack()` intro (the opening paragraph and the project
435+
// tree say it), the "read the source for the exact shape" paragraph (the
436+
// References section keeps the rule; one pointer line stays), the boot
437+
// sequence's "(see Ports & networking)" aside and the two cheat-sheet port
438+
// comments (the Port resolution paragraph says both). Arithmetic in bytes:
439+
// on `origin/main` the priced text was 23294 bytes (5824 tokens, headroom 4);
440+
// the cuts remove 309 bytes and the section adds 939, so the LANDED priced
441+
// text is 23924 bytes -> 5981 tokens: the 4 tokens of headroom are absorbed
442+
// and the ceiling moves 5828 -> 5981 (+153). Pinned AT the measurement.
443+
// ceil(($(wc -c < skills/objectstack-platform/SKILL.md) - 20) / 4) == ceil(23924 / 4)
444+
['skills/objectstack-platform/SKILL.md', 5981],
425445
// `skills/objectstack-pm-dispatch/SKILL.md` (9708) and its
426446
// `rules/dev-template.md` (1838) left this table on 2026-09-10 with the files:
427447
// the maintainer deleted the published PM skill whole (verbatim:
@@ -689,7 +709,17 @@ export const CEILINGS = new Map([
689709
['skills/objectstack-data/evals/objects-fields-relationships.json', 946],
690710
['skills/objectstack-formula/evals/cel-predicates-formulas.json', 1046],
691711
['skills/objectstack-i18n/evals/bundles-locales-coverage.json', 1004],
692-
['skills/objectstack-platform/evals/config-plugins-ops.json', 1211],
712+
// 1211 -> 1458 (card #26302): one eval for a demo whose seed names people —
713+
// expected: both in `demoStaff` with a declared `position` /
714+
// `permissionSets`, created by `os dev`; NO `role:` alias and NO platform
715+
// set such as `admin_full_access`. Same ruling as the `SKILL.md` row above
716+
// (2026-10-27, tap A: 「A:先削重复,余额按实测提高」); the file's six fixtures
717+
// share no sentence, so there was no duplicate to cut (0 bytes). On
718+
// `origin/main` the file was 4842 bytes (1211 tokens, headroom 0); the
719+
// fixture adds +989 bytes, so the LANDED file is 5831 bytes -> 1458 tokens,
720+
// ceiling +247, pinned AT the measurement.
721+
// ceil($(wc -c < skills/objectstack-platform/evals/config-plugins-ops.json) / 4) == ceil(5831 / 4)
722+
['skills/objectstack-platform/evals/config-plugins-ops.json', 1458],
693723
['skills/objectstack-query/evals/filters-pagination-search.json', 955],
694724
['skills/objectstack-ui/evals/views-apps-actions-pages.json', 1505],
695725
['skills/objectstack-upgrade/evals/protocol-major-upgrade.json', 1033],

‎skills/objectstack-platform/SKILL.md‎

Lines changed: 26 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ development** (plugins, services, kernel hook / event handlers,
3333

3434
## `defineStack()` — The Core Configuration
3535

36-
`objectstack.config.ts` is the single entry point for every project.
37-
It calls `defineStack()` to declare all metadata.
38-
3936
→ Moved verbatim to [references/bootstrap.md](./references/bootstrap.md) § Minimal Example.
4037

4138
### Full Configuration Reference
@@ -78,11 +75,9 @@ keeping straight:
7875
scheduled migration, so a key that only warns today is expected to be
7976
refused later.
8077

81-
For the exact Zod shape — including which keys are optional and what types
82-
the collection items take — read
83-
`node_modules/@objectstack/spec/src/stack.zod.ts`
84-
(`ObjectStackDefinitionSchema`). Each collection's item shape lives in
85-
its own domain folder (`data/object.zod.ts`, `ui/view.zod.ts`, …).
78+
Exact shape: `ObjectStackDefinitionSchema` in
79+
`node_modules/@objectstack/spec/src/stack.zod.ts`; each collection's item
80+
schema sits in its domain folder (`data/object.zod.ts`, `ui/view.zod.ts`, …).
8681

8782
→ Moved verbatim to [references/bootstrap.md](./references/bootstrap.md) § Map Format (Key → Name) · § Barrel Import Pattern.
8883

@@ -348,7 +343,7 @@ CLI: `os serve` / `os dev`
348343
├── DispatcherPlugin
349344
└── AIServicePlugin (cloud / EE only — reverse-mounted by a cloud host; absent in the open framework per cloud ADR-0025)
350345
5. Runtime.start() → init + start all plugins
351-
6. Server listens on the resolved port (see "Ports & networking" in Part 3)
346+
6. Server listens on the resolved port
352347
```
353348

354349
**Port resolution** (both `os dev` and `os start` → `os serve`):
@@ -445,6 +440,26 @@ definition: never write it by hand, and never hand-write a raw
445440
| `ignore` | Insert if not exists, skip otherwise |
446441
| `replace` | ⚠️ **Data loss** — drops and re-inserts all records |
447442

443+
### Demo accounts — `demoStaff` vs `devLogins`
444+
445+
A seed deals records to people (`owner_id: 'Legal Counsel 1'`) but cannot
446+
create one: a `sys_user` row in `data` is refused (ADR-0092). Declare the
447+
people in `demoStaff`; `os dev` creates each account after the development
448+
admin, signing in with the seed password (`--admin-password`, default
449+
`admin123`) — an entry carries no `password`:
450+
451+
```typescript
452+
demoStaff: [{ name: 'Legal Counsel 1', email: 'counsel1@example.com',
453+
position: 'legal_counsel', permissionSets: ['contracts_editor'] }],
454+
```
455+
456+
`name` is what a seed reference resolves by; `position` / `permissionSets`
457+
name only what this stack declares (a platform set such as
458+
`admin_full_access` is refused); `os build` drops the key and a non-dev boot
459+
creates nothing. `devLogins` creates and grants nothing — it only prints an
460+
existing account on the boot banner. Pick `demoStaff` whenever the demo
461+
needs an account to exist.
462+
448463
---
449464

450465
## CLI Commands
@@ -455,12 +470,12 @@ Cheat sheet for the bootstrap loop:
455470
```bash
456471
npx create-objectstack my-app
457472
cd my-app && npm install
458-
os dev --ui # dev server + Console at /_console/ (auto-hops port if taken)
473+
os dev --ui # dev server + Console at /_console/
459474
os validate # metadata cross-reference checks
460475
os compile # produce dist/ artifact
461476
os migrate plan # preview metadata↔DB schema drift (additive sync never alters existing columns)
462477
os migrate apply # reconcile DB to metadata (loosening only; --allow-destructive for drops/tightenings)
463-
PORT=8080 os start # production — pin the port explicitly (see Ports & networking)
478+
PORT=8080 os start # production — pin the port explicitly
464479
```
465480

466481
---

‎skills/objectstack-platform/evals/config-plugins-ops.json‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,16 @@
6060
"must_contain": ["os start", "PORT", "OS_TRUSTED_ORIGINS", "driver-sql"],
6161
"must_not_contain": ["new DriverPlugin", "@objectstack/plugin-prometheus"]
6262
}
63+
},
64+
{
65+
"id": 7,
66+
"prompt": "Prepare a demo of our contracts app: the seed data assigns matters to 'Legal Counsel 1' and 'Paralegal 1', and the demo should open signed in as Legal Counsel 1.",
67+
"expected_output": "Both people go in `demoStaff` — `name` exactly as the seed references them, `email`, and a `position` / `permissionSets` the stack itself declares — and `os dev` creates the accounts with the seed password (`admin123` by default): no `password` key, no `role:` alias, no platform set such as `admin_full_access`, and no hand-written `sys_user` seed row (refused). `devLogins` creates nothing: at most one entry naming Legal Counsel 1's address so the boot banner prints it. Notes that `os build` drops `demoStaff` and a production boot creates no demo account.",
68+
"files": [],
69+
"assertions": {
70+
"must_contain": ["demoStaff", "position", "permissionSets", "os dev"],
71+
"must_not_contain": ["role:", "admin_full_access"]
72+
}
6373
}
6474
]
6575
}

0 commit comments

Comments
 (0)