Skip to content

Commit b91f8e6

Browse files
committed
docs(skills): objectstack-data, -automation and -platform teach the .custom customization path ADR-0146 D2 delivers
Claude-Session: https://claude.ai/code/session_01J8VVAjSK8WEK7Uja5NRpTo Co-authored-by: Claude <noreply@anthropic.com>
1 parent ea6f9be commit b91f8e6

9 files changed

Lines changed: 397 additions & 140 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): the ADR-0126 §1.3 promise pages and the skills teach what ADR-0146 D2 delivers — customizations in `.custom`, `__c` fields, the flow override and "new similar", no package-less overlay
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
- **Before.** The skills taught the pre-epic paths: `objectstack-data` named no home for a customer's extension of a shipped object and no `__c` rule, and its lock table still called an edit of a shipped item an "overlay"; `objectstack-automation` said nothing about a flow an installed package ships, so an agent cloned it (two copies running) or edited it in place (refused); `objectstack-platform` taught the declared override's read but not who may declare it, how the pair is created, or what the three non-overridable types do. The docs promise pages (`capabilities/integrations`, `build-without-code`) still said views and dashboards are "yours to edit directly" and sent readers to a Setup packaged-automation page to switch off and clone a flow.
11+
- **Now.** `objectstack-data` says an object an installed package ships is extended from the base's paired `.custom` package, every added field ends in `__c`, the suffix is refused anywhere else and an unsuffixed field is refused in the pair, a base field changes only through `fieldPatches`, and Studio's Add field writes the same extension; its lock table reads "Edit", not "Edit (overlay)". `objectstack-automation` says a packaged flow is customized by a same-named declared override in the pair (armed in the base's place, one activation switch, a suspended run finishes on the body it started on), that an undeclared same name is refused at publish, and that the clone door is "new similar": a copy under a new name, switched off, in the pair, never package-less. `objectstack-platform` adds the ensure door and its two manifest facts, the customizations read, the uninstall refusal, the write gate's one rule for dependents (rename), and "new similar" for permission sets, positions and capabilities. One eval per skill asserts the taught shape and refuses the old one.
12+
- Every file stays under its token ceiling: the new text is paid for by deleting restatement in the same file (a layout tree the Template section and the Naming table already state; a search-mirror maintenance table and a formula aside restating the sentence above them; the dates and money legacy → CEL rows `objectstack-formula`'s table holds; the CEL callout restating that skill's pointer; two `runAs` notes and a `readonly` note tightened, no rule removed). The touched ceilings lower to their new measurements; no ceiling rises, no frontmatter, schema or behaviour changes. The docs site's promise pages, install modes, object extensions, metadata lifecycle, permission sets, CLI and metadata API pages gain the same facts.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ export const CEILINGS = new Map([
490490
// request signing, which the built-in providers serve (recipe 6 and the
491491
// `signed` kind in references/integration-recipes.md). Re-locked AT the
492492
// measurement, headroom 0 tokens.
493-
['skills/objectstack-automation/SKILL.md', 6450],
493+
['skills/objectstack-automation/SKILL.md', 6449],
494494
// 13783 -> 13892 (2026-08-31 app-repo-principles raise, see the block above).
495495
// The invariant-vs-transition-gate choice, placed in the field-conditional-rule
496496
// bullet list where the tool is actually picked. Both wrong picks are silent:
@@ -581,7 +581,7 @@ export const CEILINGS = new Map([
581581
// absorbed and the ceiling moves 5997 -> 6014 (+17), the measured
582582
// remainder only. Pinned AT the measurement.
583583
// ceil(($(wc -c < skills/objectstack-platform/SKILL.md) - 20) / 4) == ceil(24055 / 4)
584-
['skills/objectstack-platform/SKILL.md', 6012],
584+
['skills/objectstack-platform/SKILL.md', 6011],
585585
// `skills/objectstack-pm-dispatch/SKILL.md` (9708) and its
586586
// `rules/dev-template.md` (1838) left this table on 2026-09-10 with the files:
587587
// the maintainer deleted the published PM skill whole (verbatim:
@@ -981,7 +981,7 @@ export const CEILINGS = new Map([
981981
// stale `{ type: 'lookup', reference: 'user' }` fields (an object that does
982982
// not exist) became `type: 'user'`; -10 tokens, the row follows the
983983
// measurement down, zero headroom.
984-
['skills/objectstack-data/references/examples-objects.md', 1769],
984+
['skills/objectstack-data/references/examples-objects.md', 1756],
985985
['skills/objectstack-data/references/lint-rules.md', 970],
986986
// 1299 -> 1566 (#26297): the `columns` dataset key and `applyOn: 'create'`
987987
// — a column a job or an admin owns after the first load is written on

‎skills/objectstack-automation/SKILL.md‎

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ record-change triggers, scheduled automation, vendor integrations and their
2727
callbacks, and **assignment rules** that route a new record to a queue or a person.
2828

2929
> **Predicates and conditions are CEL** — every `condition` / `guard` /
30-
> `entryCondition` / filter `value` here is an **Expression** envelope evaluated
31-
> by `@objectstack/formula`. A slot takes a plain CEL string; the
32-
> `P\`...\`` / `cel\`...\`` tags wrap the same string with author-time validation.
33-
> Both parse — pick one per file. See
34-
> **objectstack-formula** for the CEL contract, stdlib and legacy → CEL table.
30+
> `entryCondition` / filter `value` is an **Expression** envelope: a plain CEL
31+
> string, or the `P\`...\`` / `cel\`...\`` tag (author-time validation); pick one
32+
> per file. Contract, stdlib, legacy → CEL table: **objectstack-formula**.
3533
3634
---
3735

@@ -49,6 +47,19 @@ A **Flow** is a directed graph of nodes — the primary automation building bloc
4947
| `record_change` | Fires automatically on record create/update/delete. `autolaunched` + the same `record-*` binding behaves identically; `record_change` also opts into the trigger-readiness lint |
5048
| `api` | Inbound **webhook** — needs a start-node `secretRef` (or a literal `secret`; see *Inbound webhook triggers* below); a flow only ever started explicitly is `autolaunched` |
5149

50+
**A flow an installed package ships** is read-only. To change what it does, save
51+
a same-named flow in the base's paired `.custom` package declaring
52+
`overrides: { package: '<base>', basedOn: '<base version>' }`
53+
(**objectstack-platform** § Customizing an installed package): it is armed in the
54+
base's place, keeps the base's name and its one activation switch
55+
(`POST /api/v1/automation/:name/toggle`, `{ enabled: false }` = off for this
56+
deployment), and a run suspended on the old body finishes on that body. An
57+
undeclared same-named flow in the pair or in a dependent is refused at publish.
58+
A flow *beside* it is "new similar": `POST /api/v1/automation/:name/clone`
59+
`{ name, label, package? }` lands the copy switched off in the pair, never
60+
package-less; a flow holding a `secret` / `signingSecret` is refused (`409`): author
61+
it anew.
62+
5263
### Flow Node Types
5364

5465
Flows are built from **built-in node types** (plugins register more):
@@ -140,29 +151,25 @@ type: 'text', isInput: true }, { name: 'approval_result', type: 'boolean', isOut
140151
| 404, rate-limit, rejected write, failed subflow | missing required config key (`objectName`, `url`, `flowName`, `connectorId`/`actionId`); filter operand that evaluated to `null`; graph past the nesting ceiling; unscoped run |
141152

142153
> **Writing a `readonly` field? Set `runAs: 'system'`.** Under the default
143-
> `runAs: 'user'` the engine **strips** a `readonly` field from `create_record`
144-
> and `update_record` alike — the step reports success, the value never lands,
145-
> the drop is named in the step's warnings — so a flow maintaining one (approval
146-
> stamps, conversion flags, SLA markers, rollups) runs `runAs: 'system'`.
147-
> `os validate` / `os build` fail a `runAs:'user'` `update_record` writing one
148-
> (`readonlyWhen`: a warning, per record state). Do **not** remove `readonly`
149-
> instead; that loses the field's edit protection.
154+
> `runAs: 'user'` the engine **strips** it from `create_record` / `update_record`
155+
> — the step succeeds, the value never lands, the drop is named in the step's
156+
> warnings — so a flow maintaining one (approval stamps, SLA markers, rollups)
157+
> runs `runAs: 'system'`; `os validate` / `os build` fail a `runAs:'user'`
158+
> `update_record` writing one (`readonlyWhen`: a warning). Do **not** remove
159+
> `readonly` instead.
150160
151161
> **Elevate the write, not the flow.** A `screen` flow stays `runAs: 'user'`; a
152162
> step that must write a `readonly` field moves into a dedicated `runAs: 'system'`
153163
> flow called from a `subflow` node — raising the whole flow silently elevates
154164
> every other write in it.
155165
>
156-
> **Elevation stops at identity assignment.** A `runAs: 'system'` flow's
157-
> insert, update, delete, transfer, restore or purge of `sys_user_position`,
158-
> `sys_user_permission_set`, `sys_invitation` or `sys_member` is refused with
159-
> `PERMISSION_DENIED`, and moving that step into a dedicated `runAs: 'system'`
160-
> subflow does not lift it: a governed identity write is judged by a door that
161-
> judges a person. Grant positions and permission sets from a flow whose
162-
> `runAs` is `'user'` — the delegated-administration gate then judges the user
163-
> the run acts for and records them as the grant's `granted_by`. Invitations
164-
> and memberships change through the organization endpoints (row 1b,
165-
> https://objectstack.ai/docs/permissions/system-context#1-authorization-and-scoping).
166+
> **Elevation stops at identity assignment.** A `runAs: 'system'` write (insert
167+
> through purge) of `sys_user_position`, `sys_user_permission_set`,
168+
> `sys_invitation` or `sys_member` is refused `PERMISSION_DENIED`, a system
169+
> subflow included. Grant positions and permission sets from a `runAs: 'user'`
170+
> flow — the delegated-administration gate judges that user and records them as
171+
> `granted_by`; invitations and memberships change through the organization
172+
> endpoints (row 1b, https://objectstack.ai/docs/permissions/system-context#1-authorization-and-scoping).
166173
>
167174
> **A `runAs: 'system'` sweep must pin its organization.** System context has no
168175
> trigger user, so a scan or rollup with no organization predicate reads and
@@ -219,11 +226,7 @@ write them right the first time:
219226
CEL refuses an absent key where the template wrote nothing, so nothing /
220227
`null` / a default is now YOUR call; `'{record.tags.0}'` → `'record.tags[0]'`;
221228
a deep path guards each step: `has(vars.source) && has(vars.source.id) ? vars.source.id : null`
222-
- money: `source: 'round(x * 100) / 100.0'` — CEL divides two integers as
223-
integers, so `/ 100` turns `123.46` into `123`
224-
- dates: `{TODAY()}` → `isoDate(today())`, `{TODAY() ± N}` →
225-
`isoDate(daysFromNow(N))` / `isoDate(daysAgo(N))`, `{NOW()}` →
226-
`isoDatetime(now())`, `{NOW() ± N}` → `isoDatetime(addDays(now(), N))`
229+
- dates and money: the legacy → CEL table in **objectstack-formula**
227230
- run user: `{$User.Id}` → `current_user.id`; a flow that can run without a
228231
user guards it, `current_user != null ? current_user.id : null`.
229232
`current_user` holds `id`, `positions`, `organizationId`, `isPlatformAdmin`
@@ -420,10 +423,9 @@ reason to write code.
420423

421424
## CRM Automation Blueprint
422425

423-
Model the business lifecycle in Flow / Approval metadata first (integrations:
424-
above): flows in `src/flows/*.flow.ts` with explicit `variables`, `nodes` +
425-
`edges` (approval config: the approvals reference), exported as `allFlows: Flow[]`
426-
from `src/flows/index.ts` and registered centrally in `defineStack({ flows })`.
426+
Lifecycle first, as Flow / Approval metadata: `src/flows/*.flow.ts` with explicit
427+
`variables`, `nodes` + `edges`, exported from `src/flows/index.ts` into
428+
`defineStack({ flows })`.
427429

428430
---
429431

0 commit comments

Comments
 (0)