Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .changeset/34434-skills-flow-record-text.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
'@objectstack/skills': patch
---

docs(skills): teach a flow record write's text envelope and its organization-language key

Clause-②: no
Metadata-protocol: none

`objectstack-automation` now says that a `create_record` / `update_record` `fields` value takes a third form beside the literal and the CEL envelope: the text envelope `{ dialect: 'template', source }`, for a sentence people read. Its `source` is a text slot, it is written in the organization's language (the Localization setting when somebody set it, else the app's `i18n.defaultLocale`), never in the language of the person who started the run, a missing translation writes the authored text, and a Localization setting that cannot be read fails the node. A bare string stays a literal and is never translated.

`objectstack-i18n` names the key that translation lives at, `flows.FLOW.records.NODE_ID.fields.FIELD`, beside the other keys that sit deeper than their group's `label`, and says `os i18n extract --no-objects-only` scaffolds it.

To pay for the text, `objectstack-automation` drops three sentences that are said elsewhere: the CEL callout's pointer to `objectstack-formula` (the skill's description already says to load it), the Trigger Configuration lead-in listing a flow's top-level keys (the examples reference shows whole flows), and the pure-function row of the `functions` example (the same item says a flow function is a pure compute step).
24 changes: 23 additions & 1 deletion scripts/check-skills-token-ratchet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,29 @@ export const CEILINGS = new Map([
// status to a flow door: +37 bytes, no further restatement left to cut).
// Pinned AT the measurement.
// ceil(($(wc -c < skills/objectstack-automation/SKILL.md) - 20) / 4) == ceil(27443 / 4)
['skills/objectstack-automation/SKILL.md', 6861],
// 6861 -> 6903 (2026-11-16, card #34434, the skills follow-up of #34062):
// silently-wrong item 1 teaches the third `create_record` / `update_record`
// `fields` form, the text envelope `{ dialect: 'template', source }`: written
// in the organization's language (Localization setting, else the app's
// `i18n.defaultLocale`), never the run starter's; untranslated, the authored
// text; an unreadable setting fails the node; a bare string stays a literal.
// Raise path the standing ruling 「A:先削重复,余额按实测提高」 (ruling record
// 6513306068, letter B). PAID DOWN FIRST — three restatements cut, each keeping
// its other home: the CEL callout's "Contract, stdlib, legacy → CEL table:
// objectstack-formula" (the frontmatter description's "load
// objectstack-formula alongside"); the Trigger Configuration lead-in naming
// the flow's `label` / `type` / `nodes` / `edges` (references/examples-flows.md's
// whole flows); item 3's `// pure — the default` function row (the same item's
// "A flow `function` is a PURE compute step"). The state-introspection route
// after the State Machines pointer is NOT a cut: packages/rest's
// meta-state-route-doc-spelling test pins this file as one of its teaching
// sites. Arithmetic in priced bytes (stamp line excluded), against `main`'s
// 27431 (headroom 3): the diff's added lines carry 441 bytes and its removed
// lines 261 (a trimmed line counted on both sides), net +180, so the LANDED
// priced text is 27611 bytes -> ceil(27611 / 4) = 6903; the ceiling moves +42,
// the measured remainder only. Pinned AT the measurement.
// ceil(($(wc -c < skills/objectstack-automation/SKILL.md) - 20) / 4) == ceil(27611 / 4)
['skills/objectstack-automation/SKILL.md', 6903],
// 13783 -> 13892 (2026-08-31 app-repo-principles raise, see the block above).
// The invariant-vs-transition-gate choice, placed in the field-conditional-rule
// bullet list where the tool is actually picked. Both wrong picks are silent:
Expand Down
12 changes: 7 additions & 5 deletions skills/objectstack-automation/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Also vendor-integration callbacks and **assignment rules**.
> **Predicates and conditions are CEL** — every `condition` / `guard` /
> `entryCondition` / filter `value` is an **Expression** envelope: a plain CEL
> string, or the `P\`...\`` / `cel\`...\`` tag (author-time validation); pick one
> per file. Contract, stdlib, legacy → CEL table: **objectstack-formula**.
> per file.

---

Expand Down Expand Up @@ -251,6 +251,12 @@ Most are caught by `objectstack build`:
is refused with its `{{ }}` spelling. A date or the run user has no hole:
assign it first (`assignments: { v: { dialect: 'cel', source:
'current_user.id' } }`), then write `{{ v }}`.
`create_record` / `update_record` `fields` also take a text slot, marked
`{ dialect: 'template', source }`, for a sentence people read. It is written
in the organization's language (Localization setting if set, else
`i18n.defaultLocale`; key: **objectstack-i18n**), never the run starter's;
untranslated, the authored text; an unreadable setting fails the node. A
bare string stays a literal, never translated.

2. **`create_record`'s `outputVariable` holds the created RECORD, not its id.**
❌ `fields: { ref: { dialect: 'cel', source: 'newRec' } }`
Expand Down Expand Up @@ -294,7 +300,6 @@ Most are caught by `objectstack build`:

```ts
defineStack({ functions: {
'helpdesk.aiTriageStub': (ctx) => ({ ai_category: 'other' }), // pure — the default
'billing.sync': { handler: syncBilling, effect: 'writes' },
} });
```
Expand Down Expand Up @@ -406,9 +411,6 @@ the **start node `config`**:

### Trigger Configuration — on the `start` node

A flow around it also owns `label`, `type`, `nodes` and the `edges`
`FlowSchema` requires:

```typescript
{
id: 'start',
Expand Down
9 changes: 6 additions & 3 deletions skills/objectstack-i18n/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,11 +183,14 @@ book once carried stays retired), `metadataForms`, `settingsCommon`; `reports`,
`datasets.{dataset}.{dimensions,measures}.{member}` (a member's `synonyms` have no key: one
authored list carries every language), and a joined report's block headings sit at
`reports.{report}.blocks.{block_name}.{label,description}`, keyed by the block's required `name`.
Two keys sit deeper than their group's `label`: a `page:tabs` item at
Three keys sit deeper than their group's `label`: a `page:tabs` item at
`pages.{page}.components.{tabs_id}.items.{value}.label` (by the item's `value`; an item without
one has no key) and an approval step at `flows.{flow}.approvals.{node_id}.label`.
one has no key), an approval step at `flows.{flow}.approvals.{node_id}.label`, and the text a
`create_record` / `update_record` writes into a field marked `{ dialect: 'template', source }` at
`flows.{flow}.records.{node_id}.fields.{field}`, picked in the organization's language (the
Localization setting if set, else `i18n.defaultLocale`; never the run starter's).
`os i18n extract --no-objects-only` scaffolds every group above but `messages` and
`settingsCommon`, both keys included. The `inlineTitle` and report-block keys, as the
`settingsCommon`, all three keys included. The `inlineTitle` and report-block keys, as the
shipped `app-crm` and `app-showcase` bundles spell them for `zh-CN`:

```typescript
Expand Down
Loading