Skip to content

Commit b77cb7f

Browse files
hotlongclaude
andauthored
docs(protocol): rewrite config-resolution onto the shipped SettingsService contract (#5888) (#6031)
The page taught a `context.config` API that has zero implementation: `context.config` itself, `setTenant()`, `setUserPreference()`, `admin.setTenantConfig()`, and the `objectstack_tenant_config` / `objectstack_user_preferences` / `objectstack_secrets` tables all return zero hits across packages/, apps/ and examples/. The whole-page audit found the gap is wider than the three symbols the issue named: YAML/JSON config files, NODE_ENV-selected config files, `defineStack({ database, http, features, secrets })`, deep-merge semantics, and bundled external secret managers are equally unimplemented. The capability itself DOES exist, under a different shape: `SettingsService` (@objectstack/service-settings, ADR-0007), backed by `sys_setting` / `sys_secret` and served over /api/settings. So this is a rewrite onto the real signatures rather than a deletion. Corrections of record: - Cascade is five layers (env > global > tenant > user > default), not six. `global` was missing entirely; `runtime` and `file` do not exist. - First non-null layer wins. There is no deep merge and no array merge. - Scope is DECLARED by the manifest, never chosen by the caller — which is why setTenant()/setUserPreference() cannot exist as written. - `tenant_id` is not a column on `sys_setting`. Platform-wide the tenant identity is the organization: sessions carry `organizationId`, and where an object does declare `tenant_id` it is a lookup to `sys_organization`. - Arrays concat on stack composition — the opposite of what the page claimed. The central manifest example now carries an `{/* os:check */}` marker, so it is type-checked against the built spec by check:skill-examples and cannot rot silently the way this page did. Refs #5888 Co-authored-by: Claude <noreply@anthropic.com>
1 parent dfa8bad commit b77cb7f

1 file changed

Lines changed: 267 additions & 810 deletions

File tree

0 commit comments

Comments
 (0)