Repository navigation
refactor(examples): every example-authored metadata name carries its package namespace - #30927
Conversation
…ission set alone The public form doors' submit context requests the permission set named exactly `guest_portal` (packages/rest/src/form-routes.ts), and the result masker resolves a set registered under that name. Renaming it to `<namespace>_guest_portal`, as `naming/namespace-prefix` suggested, would leave the masker with nothing to find. `PLATFORM_REQUESTED_BARE_NAMES` names that one spelling in `permissions`, so phase 3 (#30806) can reuse it. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cyadQ5Zhih2y1GNTQm
…package namespace Ruling C on #30798, phase 2: app-todo (20 names), app-crm (6), app-showcase (12) and app-multi-package (1) now spell every package-authored name `<namespace>_<name>`, so `os lint`'s `naming/namespace-prefix` reports 0 bare names in each. Every reference that spells a renamed name moves with it: dataset, report and dashboard refs, app navigation, flow and sharing recipients, `position:` actor ids, seed position rows, translation keys, the example and dogfood tests, and the QA platform checklist. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cyadQ5Zhih2y1GNTQm
…tract `content/docs/ui/doc-pages.mdx` said the prefix is "no longer load-bearing for uniqueness". Under ruling C on #30798 every package-authored name carries its namespace, and `os lint` now warns on every bare one. The runtime still keeps same-named docs apart by package (ADR-0048), and the page keeps saying so. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cyadQ5Zhih2y1GNTQm
📓 Docs Drift CheckThis PR changes 1 package(s): 2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
What this run could not see
Coarse fallback — 35 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin c14b90ab451502e5879a3ce9cdfcf4b34137cf5f && git checkout c14b90ab451502e5879a3ce9cdfcf4b34137cf5f
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 26c965cb8f61ca59804d55e27e737bf7ff91b383 31f0b054e77ef65ef3712ea5e8dbb955275fdb0a && git checkout -B drift-repro 26c965cb8f61ca59804d55e27e737bf7ff91b383 && git merge --no-ff 31f0b054e77ef65ef3712ea5e8dbb955275fdb0a
node scripts/docs-audit/affected-docs.mjs --json 26c965cb8f61ca59804d55e27e737bf7ff91b383
|
…name the showcase position Two `sys_user_position` rows the fixture writes through the system path still named the bare `contributor` while the door-written row beside them names `showcase_contributor`. All three now name the position the showcase declares. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cyadQ5Zhih2y1GNTQm
|
domain:devx#1 · os-elon-musk · session_016WV4cymvo9YoyLwKCXXBNw 席位核对 · ACCEPT · #30804 · 2026-11-06T14:58ZHead-sha:
|
Requested by Elon · project thread
domain:devx#1 · os-elon-musk · session_016WV4cyadQ5Zhih2y1GNTQm
Part of #30804
Clause-②: no
Metadata-protocol: none
维护者速读
os lint小改:平台按原名索取的权限集guest_portal不再被要求改名。os lintwarns on every bare package-authored metadata name, andos generatewrites them prefixed #30842)的 lint 已合并,本 PR 之后四个示例在该规则下 0 条警告。@objectstack/cli一个 patch。已有的 showcase 开发库里还是旧岗位名,重新播种即可。回滚即 revert。examples/app-showcase/src/security/positions.ts与它在流程、共享规则、种子里的引用;②lint.ts的PLATFORM_REQUESTED_BARE_NAMES。os lint,naming/namespace-prefix应为 0 条;或pnpm --filter @objectstack/example-showcase exec vitest run。guest_portal是否豁免前缀规则(本 PR 按 (a) 豁免实现,见 Acceptance notes)。裁定前本 PR 保持草稿。What changes
Every bare name the examples author now carries the package namespace. Each rename is the
fixPR 1'snaming/namespace-prefixwarning gives, and every reference that spells the name moves with it.app-todo(todo)task_dashboard; reportscompleted_tasks,tasks_by_owner,tasks_by_priority,tasks_by_status,time_tracking; datasettask_metrics; actionsclone_task,complete_task,defer_task,delete_completed,export_csv,mass_complete,set_reminder,start_task; flowstask_reminder,overdue_escalation,task_completion,quick_add_task; hooktask_logicapp-crm(crm)pipeline_dashboard; datasetopportunity_metrics; positionssales_rep,sales_manager,finance_approver; hookopportunity_stage_probabilityapp-showcase(showcase)contributor,manager,exec,auditor,ops,field_ops_delegate,client_liaison,client_portal_user,finance,legal; sharing rulesshare_new_inquiries_with_field_ops,share_key_account_qualified_contacts_with_managersapp-multi-package(packagecrm)multi_crm→crm_multi_crmEach new name is
<namespace>_<old name>. The references that moved with them:dashboardName;register-handlers.tsbinds by name, and the flows' trigger and target names;{ type: 'position', value }),position:<name>actor ids, sharing-rule recipients (sharedWith), and the showcase's seededsys_user_positionrows (seed-approval-demo.ts);path#symbolanchors included; the"change"history lines are left as written).Not renamed, on purpose: dashboard widget ids such as
id: 'tasks_by_status', which are not metadata names; approvergroup:labels such asfinance, which are not position names; and the crm permission setguest_portal, which is the open question below.os lintleaves the platform-requestedguest_portalpermission set alone ('@objectstack/cli': patch). The public form doors' submit context requests the permission set named exactlyguest_portal(permissions: ['guest_portal'],packages/rest/src/form-routes.ts:653), and the grant's result masker resolves a set registered under that name. ADR-0138's ledger keeps the name ("fate: keep") and citesexamples/app-crm/src/security/sales-positions.ts#GuestPortalProfileas its reference declaration. Renaming it tocrm_guest_portal, which the warning suggested, would leave the masker with nothing to find. The exemption is one exported constant,PLATFORM_REQUESTED_BARE_NAMESinpackages/cli/src/commands/lint.ts({ permissions: ['guest_portal'] }), so phase 3 (#30806) can read the same list. The same spelling in any other collection, or any other permission set name, is still judged, and the test pins both twins.content/docs/ui/doc-pages.mdxno longer says the namespace prefix is "no longer load-bearing for uniqueness". It now says the doc prefix is the same contractnaming/namespace-prefixapplies to every package-authored name, and it keeps saying that the runtime resolves docs per package (ADR-0048).Why
Ruling C on #30798 (maintainer, verbatim 「同意 c」): every package-authored metadata name carries its namespace, phased. PR 1 (#30842, merged as
1697d5ca9c) madeos lintwarn on every bare name. This PR brings the examples, which authors copy from, onto that rule. The one-file ADR-0048 §5 bullet PR follows this one and carriesFixes #30804.Acceptance notes
Open question for a ruling: is
guest_portalexempt? This PR builds on option (a), the seat's recommendation: a named exemption in the lint, with the citation above. If the ruling is that it must be prefixed, the constant, its one condition and its test come out, and the form door atform-routes.ts:653and ADR-0138's ledger have to learn the new name first. That is a runtime change outside this card. Phase 3 (Bare-name phase 3: defineStack and the save door refuse a bare package-authored name; ADR-0129 and ADR-0048 amended; migration of stored and external references (ruling C on #30798) #30806) needs the same answer.Bare-name counts under
naming/namespace-prefix, measured withlintConfigon each example'sobjectstack.config.ts. Duplicates are 0 in every row, before and after.1697d5ca9)examples/app-todoexamples/app-crmguest_portalexempt)examples/app-showcaseexamples/app-multi-packagecreate-objectstackblank templateexamples/embed-objectqlTwo of these renames also clear the cross-repo name coincidences phase 1's ADR-0048 text (feat(objectql)!: a picklist, mapping or dataset name holds one package (bare-name phase 1, 1/4) #30836) measured: the datasets
task_metrics(app-todo) andopportunity_metrics(app-crm) shared a bare name with HotCRM's; they are nowtodo_task_metricsandcrm_opportunity_metrics.The showcase's two dotted capabilities (
showcase.export_data,showcase.restricted_ops) carry the namespace under Elon's 2026-11-06T11:08Z ruling (Bare-name phase 2: the namespace-prefix lint warns on every bare non-object name; first-party templates and examples adopt the prefix (ruling C on #30798) #30804, comment 6683456244), so they are not renamed.Fixtures left as written, on purpose. These test files spell the same words as their own self-contained fixtures and load no example, so their names are not the examples' names: the ui workspace tests, the runtime, lint, metadata-protocol and plugin unit tests, the
multi_crmfixtures in the cli and metadata tests, the position-name-fold census,docs/qa/scenarios/*.json, andsharing-rule-criteria-required.dogfood.test.ts(itssales_reprecipient is invented for the test; the showcase has no such position). The illustrative names incontent/docs/**(for example"positions": ["sales_rep"]inpermissions/authentication.mdx) are not tied to an example either. The upgrade harness's historical database snapshots (packages/qa/dogfood/test/upgrade-harness/fixture-18.0.0-next.5/*.sql) andpopulate-fixture.tsrecord an 18.0 boot and stay as they are. TheCHANGELOG.mdfiles are not hand-edited.Held files not touched.
create-objectstack/src/templates/AGENTS.md,blank/README.md(fix(cli,rest)!: os package install takes -u/--url and -t/--token; the /meta permission refusal is localized #30792) andexamples/app-showcase/e2e/global-setup.ts(feat(console): an administrator's first-run checklist on Home replaces the currency and time zone dialog #30552) needed no change, and the showcase e2e specs spell none of the renamed names.An existing showcase dev database keeps its old position rows until it is reseeded. The examples are private packages, and no published data changes.
Out of scope, found on the way.
pnpm --filter @objectstack/example-todo test:mcp(examples/app-todo/test/mcp-actions.e2e.ts) exits 1 at its step 3 on main1697d5ca9too: the seed and the step-3 insert fail withOrganization is requiredbecause the script boots with no organization. Steps 1 and 2, which spell the renamed action names, pass on both. No workflow or script runs it. Reported on the card for the seat to route.Verification
os validatein each of the four examples: exit 0.lint-namespace-prefix,generate-object-namespace-prefix,generate-scaffold-validatesandgenerate-stack-reach, 4 files / 115 tests passed.sharing-rule-criteria-required, 19 files / 205 tests passed;upgrade-18x-harness,multi-package-artifactandinstall-local-purge-sample-data, 3 files / 34 tests passed. After rebasing onto0e882086b(which brought phase 1, feat(objectql)!: a picklist, mapping or dataset name holds one package (bare-name phase 1, 1/4) #30836):bare-name-one-holderandmulti-package-artifact, 2 files / 13 tests passed, and the three example suites again passed in full.node scripts/check-platform-checklist.mjs: OK, everypath#symbolanchor in the changed area files resolves.os lintscope check:naming/namespace-prefixreports 0 bare names and 0 duplicates in all four examples (table above).--no-inline-configon every changed.ts/.mjsfile: exit 0.typecheckfor example-todo, example-crm, example-showcase, example-multi-package, dogfood and cli: exit 0 each.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackat73064de88derived 94 commands; all 94 ran and exited 0. After the rebase, the derivation at367de6725lists the same 94 commands, and--ranthere reconciles 94 derived / 94 run / 0 NOT-MEASURED. The non---commandslisting also namedcheck-issue-citations.mjs --census(ran, exit 0) and three CI-only commands that need the runner's matrix andRUNNER_TEMP(not run locally).Gates run at 73064de88 (94)
Human Minimum
packages/specholds no runtime logic. (packages/specnot touched.)pnpm lintpasses. (eslint--no-inline-configon every changed file: exit 0.)main, one pull request.@objectstack/cliis the only published package touched; the examples and dogfood are private.)packages/spectouched: its generated artifacts are regenerated and committed. (n/a)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_016WV4cyadQ5Zhih2y1GNTQm