Repository navigation
Commit 92e660d
docs(skills): objectstack-formula says an unlowerable SharingRule condition fails the build and the rule is skipped at runtime (#36562)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi91tYCagMT6JaQ6YA5YqnWwi)_
Fixes #36516
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 用户能看到什么变化:用公式技能包写共享规则的 AI
和开发者,以前被告知「条件算不出来会让写入失败」,现在读到的是真实情况:这样的共享规则在构建时就报错,运行时整条规则被跳过、不授予任何访问权,只留一行警告日志。
- 为什么做:这是公式技能包教错失效方式的一处文字;权限规则教错,AI 会按错误的预期去设计和排查共享。
- 出错会怎样:只改了技能包里的一句说明和两处重复文字,不改任何运行行为;如果新句子有误,读者会被教错,撤回这一个改动即可恢复原文。
- 要你做什么:批准这一处受管技能包文字改动。
## What changes
`skills/objectstack-formula/SKILL.md`, section "Surfaces that take an
Expression", the fault-open warning paragraph. The sentence used to say
an unevaluable `Hook` / `SharingRule` `condition` or validation
predicate aborts the write. It now reads:
> an unevaluable `Hook` `condition` or validation predicate **aborts the
write** (§5); a `SharingRule` `condition` that does not lower to a
filter fails the build, and at runtime the rule is skipped and grants
nothing (one WARN).
Only the `SharingRule` half changed. The `Hook` and validation-predicate
halves say what they said before.
What the code does, read at `main` d463c46:
- Build:
`packages/lint/src/validate-sharing-rule-enforceability.ts:18-28` and
its "Why `error`" section: a condition that does not lower is reported
as an `error`.
- Runtime:
`packages/plugins/plugin-sharing/src/declared-sharing-rules.ts:154`
compiles the condition with `compileCelToFilter` and no variables;
`:217` turns a refusal into a `condition` skip; `:370-374` calls
`warnOnce` and `continue`s, so the rule never enters the served set;
`:336-348` logs one WARN per rule and cause. A sharing rule's condition
is never evaluated on a write, so there is no write to abort.
No eval case is added: case 14 in
`skills/objectstack-formula/evals/cel-predicates-formulas.json` already
expects "the rule would grant nothing" for a condition that does not
lower.
### Token budget: paid by two cuts, ceiling not raised
The corrected sentence costs +127 bytes. Two restatements in the same
file are cut to pay for it:
| Cut | Bytes | Where the content still lives in the file |
|:---|---:|:---|
| The note under the translation table: `previous.x` fails the write on
an insert unless guarded by `previous != null &&` | -105 | Section 5:
the `previous` table's "Insert events" row (`previous` is `null`, the
two guard spellings, a column read off it faults) and the "An
unevaluable condition ABORTS the operation" paragraph (a column read off
`previous` on an insert fails the write) |
| "Two more dialects ride the same envelope." at the head of "Cron and
template surfaces" (the next sentence now starts "Neither dialect is
CEL") | -34 | "Core contract": "Every expression in metadata is the same
envelope" and the three-dialect table listing `cron` and `template` |
Readings (the ratchet prices `ceil((bytes - 20) / 4)`; the 20 is the
release-stamp line):
| | Before (`main` d463c46) | After (f768c92) |
|:---|---:|---:|
| `skills/objectstack-formula/SKILL.md` lines | 493 | 491 |
| `skills/objectstack-formula/SKILL.md` bytes | 24048 | 24036 |
| `skills/objectstack-formula/SKILL.md` tokens (ceiling 6008) | 6007 |
6004 |
| All `skills/*/SKILL.md` lines | 4951 | 4949 |
| All `skills/*/SKILL.md` bytes | 261175 | 261163 |
| Ratcheted authored bundle tokens (ceiling sum 202541) | 197573 |
197570 |
`scripts/check-skills-token-ratchet.mjs` is not edited; the formula
row's ceiling stays 6008.
## Tests
Text-only change to a published skill; no code, no test file. No
ablation (no tested behaviour changed). All readings at f768c92.
- `node scripts/check-skills-token-ratchet.mjs`: exit 0,
"skills/objectstack-formula/SKILL.md is 6004 tokens (ceiling 6008;
headroom 4)", "60 authored bundle file(s) within their ceilings".
- `pnpm --filter @objectstack/spec run check:skill-docs`: exit 0, "Skill
docs in sync".
- `pnpm --filter @objectstack/lint run check:doc-formula-expressions`
(after building the lint closure under the verify lock, VERDICT
command-exit 0): "26 record-scoped formula example(s) across 593 files /
1864 TS blocks judged clean".
## Acceptance notes
- Gates: `node scripts/pm/dispatch-gates.mjs --commands` derived 49
families; `--ran` answers "49 derived famil(ies) accounted for — 45 run,
4 NOT-MEASURED (4 DERIVED from a recorded exit 3)". The four are
`check:dts-closure`, `check:dual-build-cjs-loads`,
`check:lean-entry-closure` and `check:sourcemap-no-sources-content`:
each refuses without a full `pnpm build`, which this text-only diff does
not owe locally. NOT MEASURED locally; CI reads them.
- `node scripts/pm/overlap-check.mjs` at f768c92: "VERDICT clean exit
0" (one open PR shares the file and merges cleanly).
- The first cut removes a reminder that sat next to the `ISCHANGED(x)`
row. Its content is intact in section 5, which the cheat-sheet's
"Previous record" row already points to.
## Verification
- Read first: `skills/objectstack-formula/SKILL.md` (the changed
sentence near line 447, then the two cuts), then
`.changeset/36516-formula-skill-sharing-rule-skip.md`.
- Two-minute check: `node scripts/check-skills-token-ratchet.mjs` and
read the `objectstack-formula/SKILL.md` line: 6004 tokens, ceiling 6008.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01ADHkmPTDM2MxHR8cvoMVUX
Co-authored-by: Claude <noreply@anthropic.com>1 parent 84853fd commit 92e660d
2 files changed
Lines changed: 16 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
400 | 400 | | |
401 | 401 | | |
402 | 402 | | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | 403 | | |
407 | 404 | | |
408 | 405 | | |
| |||
447 | 444 | | |
448 | 445 | | |
449 | 446 | | |
450 | | - | |
451 | | - | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
452 | 450 | | |
453 | 451 | | |
454 | 452 | | |
| |||
457 | 455 | | |
458 | 456 | | |
459 | 457 | | |
460 | | - | |
| 458 | + | |
461 | 459 | | |
462 | 460 | | |
463 | 461 | | |
| |||
0 commit comments