Repository navigation
feat(messaging): Slack DM delivery — slack channel, per-person link store, approval requests by DM (Part of #34730) - #35789
Conversation
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
… hunk Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
…ch step Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
…ck DM Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
…R-0013, changeset Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
…cale Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
…hannel Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
… read it Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
…gate Every body slack-link-routes.ts answers goes through the shared sendOk / sendError / sendServerFault pair, so the module is declared conformant at zero hand-built bodies, as its three messaging siblings are. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
📓 Docs Drift CheckThis PR changes 5 package(s): 117 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 22 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 185 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 4119acc30162dc12dcc876fdface88a8d182b62f && git checkout 4119acc30162dc12dcc876fdface88a8d182b62f
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 2ad42b5d056322b179fbf7decb68731831e3b4f2 938fa8f8c8509655ef8fc84855b2866b1821850b && git checkout -B drift-repro 2ad42b5d056322b179fbf7decb68731831e3b4f2 && git merge --no-ff 938fa8f8c8509655ef8fc84855b2866b1821850b
node scripts/docs-audit/affected-docs.mjs --json 2ad42b5d056322b179fbf7decb68731831e3b4f2
|
…ng no one before it is confirmed - A proposal looks a Slack user up only while the person's sys_user email is verified; an unverified email is answered as no match. - Before the person confirms, no answer names the Slack user (no name, no Slack id); the person's view says only that a match was found. - A confirmation holds only while the email is still verified and still the one the proposal was made for (a digest kept on the link); otherwise 409 RESOURCE_CONFLICT, its sentence in all eleven locales. A new proposal replaces one made for another email. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
…the changeset A Slack link is proposed only for a verified email and names no one before it is confirmed. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
…al that was checked The confirm write is conditioned on the link's id, its proposed state and the digest of the email it was proposed for; a write that matches no row answers the same 409 RESOURCE_CONFLICT as an outdated proposal. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
…erged tree The merge with origin/main took the census without a text merge; the generator, run on the merged tree, adds main's two working-calendar objects beside this branch's two Slack link objects (108 registered, 57 in reach). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
|
repo:objectstack#4 · os-elon-musk · session_016WV4czsTwiYB5WxgWqEVcu L1 verdict (L1-a): ACCEPT at head Gates on this head: What I checked (holds):
Non-blocking notes:
Landing: governed, Tier H (touches Generated by Claude Code |
|
repo:objectstack#4 · os-elon-musk · session_016WV4d1PJ4isQ3eD7Fk1fnF Served-tier: Contract review — FAIL at 73b116f · 2026-11-20T11:00ZHead-sha: Read for this record: the diff against merge base This is the newest head. The changeset fix for the approvals sentence (L1 note 1) is not on it. The PR is a draft with no auto-merge armed, so nothing is owed to disarm. One must-fix, two should-fix, six nits. Everything else asked of this review holds. FindingsF1 (must-fix):
S1 (should-fix): two existing doors answer differently on every deployment, and the body says they do not.
S2 (should-fix): the administrator's removal filters in the application, over a capped read (Prime Directive 5).
Nits
① Derived judgmentsEach new face against the addendum text on
② Semver levelWrong at this head: F1. All five published packages the diff touches are in the changeset, and ③ Boundary flags
④ Design judgment
Implemented-by: VERDICT: FAIL |
…k is composed MessagingServicePlugin registers the slack channel provider at kernel:ready only when connector-slack's slack client service resolves. Without it the messaging service does not know slack, so the /automation save doors still refuse a notify node naming it and the two preference doors do not list it. With it, a notify node may name slack: Metadata-protocol added, and service-messaging moves to minor. Pinned on both sides: the preference doors over a real MessagingServicePlugin (service-messaging), and the /automation save door over the same plugin (runtime). ApprovalMessagingSurface declares the optional getChannel it reads. The changeset names the doors that accept and list slack where connector-slack is composed, the condition approval.requested asks for slack under, and the Slack app scopes the calls need. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
… of token input and proposal audit An administrator's removal of one link reads it by a pushed-down findOne on its id and the install. The uninstall reads the install's links in pages, in id order, until a page comes back short, so every linked person is told. A person's links (rider 3) go in one predicate delete; the engine runs the delete hooks once per row it removes, so each removal is audited as before. Hardening of token input and proposal audit. Pins: a removal by another organization's administrator, the uninstall over more than one page, and rider 3's membership moved to another organization. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
… through the dispatch helpers The fake engines behind the slack composition pins dispatch update, delete and findOne through assertEngineUpdateDispatch, assertEngineDeleteDispatch and assertEngineFindOnePredicate (@objectstack/metadata-core), so they refuse what a real engine refuses. The pinned ledger records the six new seams (check-engine-double-contract --write). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
… in one write, each audited Rider 3's removal is one predicate delete; measured here over two installs: one engine delete on sys_channel_user_link, two afterDelete dispatches, each attributed to who banned the person. The token input cases use plain malformed values. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
|
repo:objectstack#4 · os-elon-musk · session_016WV4d1eW7iLBvc8c6xv9Fx L1 delta verdict (L1-a): CHANGES at head C1. The What I checked in the delta (holds):
Left to others: the hardening part of Generated by Claude Code |
|
repo:objectstack#4 · os-elon-musk · session_016WV4czfXrDs6fBNTtekWrL L1 delta verdict (L1-a): ACCEPT at head C1 closed: the
Gates on this head. Not read here. The new Size bullet's breakdown (tests 1164, generated files and ledgers 718, provider/link code ~1410, docs 36) is the seat's ruling, and the area reports the seat has accepted it. The one Landing: governed (as in 7037456539), so it goes to the seat's contract delta read, then Tier H. Generated by Claude Code |
|
repo:objectstack#4 · os-elon-musk · session_016WV4d1PJ4isQ3eD7Fk1fnF Served-tier: Contract review — PASS at 938fa8f · 2026-11-20T13:35ZHead-sha: This is the delta read from my FAIL Read for this record: the diff between the two heads over the PR's 52 files (11 of them differ: four commits and one merge of No must-fix and no should-fix. Five nits. The PR is a draft with no auto-merge armed. Closure of 7037841566F1: closed, by both arms.
S1: closed.
S2: closed, for what it asked here.
Changeset sentences. The approvals sentence (L1 note 1) is on this head: "only while the Nits of 7037841566.
Findings on this headN1. The deferred half of S2 has no card number.
N2. One topic joins both preference doors on every deployment.
N3. For the approver, unchanged from N2 of N4. ADR line 793 still carries the either/or on who requests N5. The ① Derived judgments
② Semver levelRight at this head.
③ Boundary flags
④ Design judgment
Implemented-by: VERDICT: PASS |
|
repo:objectstack#4 · os-elon-musk · session_016WV4d1PJ4isQ3eD7Fk1fnF 席位核对 — ACCEPT · repo:objectstack#4 · head
|
objectstack-ai#35928) (objectstack-ai#36316) <!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XTRdLmK9YYgMSCJ7NH2PuUY)_ repo:objectstack#7 · zhuangjianguo · session_01QsR2jVTYADzVWfarACx5j3 Fixes objectstack-ai#35928 Clause-②: yes (widening: one new public read, `POST /api/v1/automation/_record-starts`, and the UI exports that read it) Metadata-protocol: added Skills-docs: none — no skill under `skills/**` teaches the console's stage confirms; `content/docs/automation/flows.mdx` and `content/docs/frontend/plugins/plugin-grid.mdx` document the read and the list in this change. Ruling-ref: 7073655354 ## 维护者速读 - 用户在列表单元格或记录页改阶段时,确认框在原来那句话下面列出这次改动会启动的流程名称(按用户语言显示),带审批的流程标「发起审批」;以前只写「可能触发相关自动化」。 - 属于行内编辑专题,按维护者的裁定「能改这条记录的人都看到流程名称」,让用户确认前就知道保存后会发生什么。 - 出错时最多是清单少列或不显示,确认框退回今天那句话,保存本身不受影响;整个改动可以直接撤回。 - 无。 ## What changes **Server (one new read).** - `@objectstack/spec/api`: `RecordUpdateStartsRequestSchema` (`{ object, recordId, changes }`, strict), `RecordUpdateStartSchema` (`{ name, label, startsApproval }`), `RecordUpdateStartsResponseSchema`, and the contract entry `listRecordUpdateStarts` (`POST /api/v1/automation/_record-starts`). `_record-starts` joins the `/automation` domain's reserved position literals (underscore-led, so the package-namespace install gate is not narrowed). - `@objectstack/spec/contracts`: `RecordUpdateStartsInput` and the optional `IAutomationService.listRecordUpdateStarts`. - `@objectstack/spec/automation`: `recordChangeTriggerHookEvents` / `recordChangeTriggerFiresOnUpdate`, the record-change token grammar MOVED out of `@objectstack/trigger-record-change` (whose `triggerTypeToHookEvents` now delegates to it), so the trigger and the preview read one rule. - `@objectstack/service-automation`: `AutomationEngine.listRecordUpdateStarts` (`record-update-starts.ts`). A flow is asked only when it is enabled and armed on a `record_change` trigger for this object whose token binds an update; whether it starts is `startConditionHolds`, the one start-condition gate every run attempt passes, over the variables `seedRunVariables` seeds (`record`, its flattened fields, `previous`). The approval mark is the presence of an `APPROVAL_NODE_TYPE` node (ADR-0019). A condition that throws is not listed. Hooks are never listed (ADR-0077 §2). - `@objectstack/runtime`: the `/automation` domain's `_record-starts` door, mounted in the dispatcher plugin and recorded in the route ledger. Order: query parameters refused `400 VALIDATION_ERROR`; body parsed through the request schema (`400 VALIDATION_FAILED`); `501` when the engine has no preview; the record read AS THE CALLER through the `/data` door's own `get` (`callData`), so an unreadable record answers `404 RECORD_NOT_FOUND` exactly like an absent one and the engine is never asked; a read that answers no record is refused the same `404`; every `changes` key must be a declared field of the object (else `400 VALIDATION_FAILED` on `changes.KEY`, the engine never asked); then the engine is handed `previous` = the record read, `record` = that record with `changes` applied, and the caller's `userId` / `tenantId`. Anonymous `401`. - `@objectstack/client`: `client.automation.listRecordUpdateStarts(request)`. **UI (two confirms, one reader).** - `@object-ui/plugin-detail`: `stageChangeStarts.tsx` — `useRecordUpdateStarts(ask)` (asks the route once per pending move through the host's `apiFetch`, parses the answer through `RecordUpdateStartsResponseSchema`, answers `[]` while in flight, refused, failing, malformed or empty) and `StageChangeStarts` (the list under the sentence: each flow by its label translated through `activeFlowsBundle` + the spec's `translateFlow`, the flow runner's reading; an approval flow marked). Exported for the grid. - Record page: `recordPathStageChange.tsx` draws it in both confirmations (the path's `AlertDialog` and the header stage menu's `RequiredFieldsDialog`, via a new optional `notice` slot in `@object-ui/fields`). - List cell: `ObjectGrid`'s state-machine confirm draws it; `StateChangeConfirm` gains an optional `ask` (the row's record id and the move). - `@object-ui/i18n`: `activeFlowsBundle` moves here from `@object-ui/app-shell`'s module-internal `utils/flowsBundle` (its three app-shell importers repointed), since the confirms' packages do not depend on the console; two keys in all eleven packs: `detail.stageChangeStartsHeading`, `detail.stageChangeStartsApproval`. - The confirm's sentence is never replaced (not this card: objectstack-ai#35685 S3). A move that starts nothing, and a failed read, leave the confirm exactly as today. Docs: `content/docs/automation/flows.mdx` (§ Which flows a record update would start), `content/docs/frontend/plugins/plugin-grid.mdx` (the confirm now names the flows). Changesets: `35928-record-update-starts-read.md`, `35928-stage-confirm-names-flows.md`, both carrying the Clause-② and Metadata-protocol lines. ## Tests - Engine `record-update-starts.test.ts` (8): condition holds / does not hold; approval mark CONTROL (an approval flow and a plain flow side by side); no condition; create / delete / other object / obsolete never named while `record-before-write` is; an unevaluable condition not named; an unarmed engine answers nothing; `current_user` evaluated as the writer named. - Door `automation-record-update-starts.test.ts` (13): a member is answered (body parsed through the response schema) and the engine is handed exactly the record read as the caller; empty list; unreadable record `404 RECORD_NOT_FOUND` with the engine never asked; unreadable and absent answer alike; anonymous `401` before any read; malformed body `400 VALIDATION_FAILED`; query parameter `400 VALIDATION_ERROR`; `501` without the preview; a GET of the literal is not this door.; a change key that is not a field `400 VALIDATION_FAILED` on that key (an undeclared key, a key off the field-name grammar, an inherited member name), the engine never asked; a change on an object the registry does not declare refused alike; a read that answers no record `404 RECORD_NOT_FOUND`, never previewed; and the ledger row names `RecordUpdateStartsRequestSchema` / `RecordUpdateStartsResponseSchema`, as the clone and publish-drafts suites pin theirs. - Spec `automation-api.zod.test.ts`: contract count and the new entry's method/path; request strictness; a leaked `condition` / `nodes` dropped by the response parse. Each `changes` key is held to the field-name grammar (refused: a dotted, an upper-case, a digit-initial, a spaced and an empty key). - List cell, in its confirm's harness `ObjectGrid.autosave-35685.test.tsx` (new top-level describe, 3): list (request body pinned, labels, approval mark under the unchanged sentence), empty, failure (and Change still saves the move). - Record page, in each confirm's harness (new top-level describe in each, 3 + 3): `record-path.stageChange-28199.test.tsx` (the path's confirmation) and `RecordStageMenu-35891.test.tsx` (the header stage menu's dialog): list, empty, failure (a refused read, a network error and a malformed envelope each draw no list). - `stageChangeStarts-label-35928.test.tsx` (2): a flow named by its translation where the app's `flows` bundle has one, by its authored label where not; nothing drawn for no flows. - Ablation (one-shot under the verify lock, restored by trap, `git diff HEAD` on both sources empty): removing the `StageChangeStarts` render from `ObjectGrid.tsx` and from both confirmations in `recordPathStageChange.tsx` turns exactly the three `list:` pins red (`Tests 3 failed | 6 passed`); empty and failure pins stay green, as they should. ## Acceptance notes - Card acceptance: "Changing a stage that starts a flow shows that flow by name in both confirms" — pinned in both confirms (list cell, and both record-page confirmations) and measured live (below); "a stage with nothing attached shows no list" — the empty pins; "a read failure falls back to the generic sentence" — the failure pins. - Residual, stated in the contract docblocks and `flows.mdx`: the preview binds the caller's user id and tenant only, not their positions, request params or expand as a live run does, so for a condition reading those the preview can differ from the save in either direction (it can miss a flow, or list one a negated test of the writer would stop); the seat files the follow-up for positions. - Residual (not widened here): conditions are judged on the record as the CALLER reads it (field-level security applied), so a condition that reads a field the caller cannot see is judged on what they see, and one that throws on a missing field is not listed. The preview can therefore under-list for a caller with masked fields; it never reveals a masked value. Documented in `flows.mdx`. - Residual: the header stage menu's dialog asks with the stage alone; values typed into that dialog for required fields are not part of the preview's `changes`. - Two existing confirm suites (`RecordStageMenu-35891`, `record-path.stageChange-28199`) now stub `fetch` with a `501` answer in `beforeEach`, so the new read does not leave for the network under test; no existing assertion changed. Across the touched UI packages the run shows 0 `ECONNREFUSED`. - The approval mark is the ruling's test, "the flow contains an approval node". Measured live, showcase's `showcase_project_closure` reaches its sign-off approval through a `subflow` node (the approval node lives in `showcase_closure_signoff`), so the preview lists it with `startsApproval: false`. Following subflow references for the mark is a reading beyond the ruling: filed objectstack-ai#36322. - Overlap (`overlap-check.mjs` at the head below, exit 1, reported and not merged around): objectstack-ai#36296 and objectstack-ai#36236 have landed and are merged in. objectstack-ai#36335 (part of objectstack-ai#35979) moves `activeFlowsBundle` into `@object-ui/i18n` too and conflicts in `ui/packages/i18n/src/flowsBundle.ts`, `ui/packages/i18n/src/index.ts` and `ui/packages/app-shell/src/views/metadata-admin/previews/flow-label-translations.tsx`; it lands after this PR and drops its copy of the move. Every other open PR that shares a file merges cleanly. - Declaration correction: the claim and ruling 7073655354 read `Metadata-protocol: none`, but the three new `@objectstack/spec/api` schemas enter the `api` authorable-surface shard (10 keys), which `Check Changeset` reads as `added` (`none-baseline-moved`). The line is `added` and `@objectstack/spec` is graded `minor`, as objectstack-ai#32251, objectstack-ai#35789 and objectstack-ai#31883 were for new api request/response schemas. No flow or other metadata key is added, so the ruling's "no new authorable key" still holds. ## Verification - Read first: `packages/runtime/src/domains/automation.ts` `respondToRecordUpdateStarts` (the order of refusals and the caller-scoped read that admits the engine), then `packages/services/service-automation/src/record-update-starts.ts` (which flows are asked and the one gate they pass). - Live, on a fresh showcase (`pnpm dev -- --fresh`), as a member created by the admin (`role: user`, not an admin): - `Website Relaunch` `status: active → completed`: `200 {"flows":[{"name":"showcase_project_closure","label":"Project Closure with Sign-off (nested pause)","startsApproval":false}]}` - same record `→ on_hold` (CONTROL): `200 {"flows":[]}` - same record `budget 150000 → 250000`: `200 {"flows":[{"name":"showcase_budget_approval","label":"Project Budget Approval","startsApproval":true}]}` - an absent record: `404 RECORD_NOT_FOUND`; anonymous: `401 UNAUTHENTICATED`; a body without `changes`: `400 VALIDATION_FAILED` naming `changes`. - Zone 2 premise, measured before any code: the same kind of member reads `GET /api/v1/meta/flow` (200, 33 flows with labels, the admin's set) and `GET /api/v1/meta/flow/showcase_closure_signoff` (200, its nodes). - The console itself was not driven in a browser (its dist is not built in this container); both confirms are pinned through the real components above. - Local, all under `scripts/pm/os-verify-lock.sh` (shared box): - touched UI packages (`plugin-detail`, `plugin-grid`, `fields`, `i18n`): `Test Files 1131 passed | 2 skipped` · `Tests 13186 passed | 38 skipped`; after folding the pins into their harness files the three files plus the label file: `Tests 77 passed (77)`. - type-check: `tsc --noEmit` (src and test projects) for `i18n`, `fields`, `plugin-detail`, `plugin-grid`, and src for `app-shell`; `service-automation`, `runtime`, `client` exit 0. - server: engine 8/8, door 9/9, `route-ledger.conformance` + `automation-api-contract-mounts` + `http-dispatcher` green, client conformance 11, spec `automation-api.zod` + `address-grammar` 87, `trigger-record-change` 122. - `dispatch-gates.mjs --commands` (129 families) run and reconciled with `--ran`: `129 run, 0 NOT-MEASURED`. First pass reds were all this diff's own owed artefacts, fixed and re-run green: spec `gen:api-surface` / `gen:docs` / `gen:export-origins` / `gen:declaration-map` / `gen:strictness-ledger` (api count 533 → 536: the three new schemas), the route-ledger census sentence (149 → 150), and `check:test-source-alias` (a spec/automation alias in the trigger package's vitest config; the door test pays `@objectstack/metadata` at collection). - Re-verified after the hand-over (seat 7), main `b3bcfefc` merged in at `472457d9`, the generated surfaces regenerated at `6bd111ff` (`gen:schema` → spec build → `gen:api-surface` → `gen:export-origins` → `gen:declaration-map` → `gen:docs` → `gen:strictness-ledger`; `check-regen-pending` clear), the changeset correction at `99bfd857`. Under the verify lock at `6bd111ff`: - type-check exit 0: `@object-ui/i18n`, `fields`, `plugin-detail` (src and test; the hand-over's stale-dist red is gone after the closure build), `plugin-grid`, `app-shell`; `@objectstack/spec`, `runtime` (src and test layer, after building `@objectstack/driver-turso`), `service-automation`, `client`, `trigger-record-change`. - tests: `runtime` Tests 11745 passed | 25 skipped; `service-automation` 4224 passed; `client` 820 passed; `trigger-record-change` 122 passed; spec `automation-api.zod` + `address-grammar` 87 passed; `plugin-detail` + `plugin-grid` + `fields` + `i18n` Test Files 1135 passed | 2 skipped, Tests 13300 passed | 38 skipped. - `dispatch-gates.mjs --commands` (129 families): run at `99bfd857` (the six that started before that commit re-run on it) and reconciled with `--ran`: `129 derived, 128 run, 1 NOT-MEASURED, 0 UNRUN`. The one NOT-MEASURED is `check:dual-build-cjs-loads` (exit 3, PREREQUISITE NOT MET: it needs every package's dist, which this container does not build); CI runs it in its Lint jobs, green at this head. - CI at `99bfd857`: every check-run green or skipped by design. Check Changeset shows two runs: the `synchronize` run (09:07Z, before the body said `added`) red, the `edited` run (09:08Z) green. - Contract review rework (L2 at `99bfd857`), at `3ba211dc` and `d2279e6c` (head): - the door refuses a change key that is not a declared field of the object and a read that answers no record; the request schema holds each change key to the field-name grammar; the ledger row is pinned; the preview's caller binding is stated in the contract docblocks and `flows.mdx`; `_record-starts` joins the address module's literal list. - ablation, one-shot under the verify lock (`ablation-replace.mjs`, restored by trap, blob == HEAD and `git diff HEAD` empty after each): the declared-field refusal disabled → `Tests 2 failed | 11 passed` (the two refusal pins); the no-record refusal disabled → `Tests 1 failed | 12 passed` (its pin). - local: `runtime` Test Files 637 passed, Tests 11749 passed | 25 skipped; door suite 13/13 at the head; spec `automation-api.zod` + `address-grammar` 88 passed; type-check exit 0 for `spec`, `runtime` (src and test layer, at `d2279e6c`), `service-automation`, `client`, `plugin-detail`. - `dispatch-gates.mjs --commands` at `3ba211dc`: `129 derived, 129 run, 0 NOT-MEASURED, 0 UNRUN`; the 37 families that read test files re-run at `d2279e6c` (a one-line test-type fix), all exit 0. - CI at `d2279e6c`: 70 check-runs, 61 success and 9 skipped by design, Check Changeset green. - Delta round (L1-d 7078831268, L2 nit N3 from 7078841748), at `41487226` (head): the 401 and 501 pins assert `body.error.code` (`UNAUTHENTICATED`, `NOT_IMPLEMENTED`) beside the status; the spec changeset names the undeclared-change-key `400 VALIDATION_FAILED` and the no-record `404` among the door's refusals; the caller-binding limit reads "can differ from the save in either direction" in the request schema's docblock, `RecordUpdateStartsInput` and `flows.mdx`. Door suite 13/13; type-check exit 0 for `spec` and `runtime` (src and test layer); `dispatch-gates.mjs --commands` at `41487226`: `129 derived, 129 run, 0 NOT-MEASURED, 0 UNRUN`; CI at `41487226`: 70 check-runs, 61 success and 9 skipped by design. https://claude.ai/code/session_01FEkQ5keqTTiV8ptWFNc6ZF https://claude.ai/code/session_01QsR2jVTYADzVWfarACx5j3 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- signed: repo:objectstack#7 · zhuangjianguo · session_01QsR2jVTYADzVWfarACx5j3 --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Elon · project thread
Part of #34730
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: none — skills/objectstack-automation states
channelsas RAW with default inbox and lists no channel values (its evals useinbox/emailonly), so no skill sentence becomes false;slackdelivers only where connector-slack is composed.维护者速读
messaging.slack_link_removed,所有部署都会列出,但只有接入 Slack 的部署才会真的发出);整个改动可以直接撤回。What changes
Server side of step 2 of #34730 (ADR-0013 addendum of 2026-11-19, ruling of record 7023437637, riders of 7024100939). One PR, as ordered; the settings page UI is step 3.
service-messaging): two new engine-owned objects.sys_channel_accountis one organization's Slack install, one row per organization (unique per organization onchannel_id), with the bot token inbot_token, asecretfield.sys_channel_user_linkis a person's link to their own Slack user,proposedthenconfirmed;user_idcascades (assys_user_device),account_idcascades, and the indexes allow one link per person per install and one person per Slack user per install.SlackLinkStore(slack-links.ts) does every read and write; each write is an engine write under a system context naming who acted, so the platform's write audit records each creation, confirmation and removal with its actor.users.lookupByEmailonly whilesys_user.email_verifiedreads verified (isEmailVerifiedUserRow); an unverified email gets exactly the answer no match gets, and Slack is not asked. No match, a deleted or bot Slack user, or a Slack user already linked in the install proposes nothing. Before the person confirms, no answer names the Slack user: the person's own view of a proposal is{ state: 'proposed' }, and the administrator's list shows it withslackUserIdandslackUserNamenull. A confirmation holds only while the email is still verified and still the one the proposal was made for (the link keeps its SHA-256 digest,proposal_email_hash); otherwise409 RESOURCE_CONFLICT, whose sentence is in all eleven locales and answered as the envelope'suserMessagein the caller's language. Confirm applies only to the proposal that was checked: the write is conditioned on the link's id, itsproposedstate and that email digest (a predicate write,multi: true), and a write that changes no row answers the same409. A new proposal replaces one made for another email. A proposal delivers nothing until the person confirms it.slack-link-routes.ts, nine routes, all in the messaging route ledger, all with an empty closed query set):GET/DELETE /api/v1/messaging/me/slack-link,POST /api/v1/messaging/me/slack-link/proposal,POST /api/v1/messaging/me/slack-link/confirm;GET/PUT/DELETE /api/v1/messaging/slack/account(PUTtakes only{ token }, proven with Slackauth.testbefore anything is saved; a token for another workspace than the installed one is refused 409),GET /api/v1/messaging/slack/links,DELETE /api/v1/messaging/slack/links/:id.SLACK_ADMIN_CAPABILITY = 'setup.write', held in the caller's current organization (ExecutionContext.systemPermissions), the capability the in-app message door already asks of an organization administrator; notisPlatformAdmin.messaging.slack_link_removedto the person on inbox and email, translated in all eleven locales (keyed text); one link is found by a pushed-down read on its id and the install, and the uninstall reads the install's links in pages, in id order, so every linked person is told; (3) a link goes with the person (cascade), when they are banned (sys_userupdate settingbanned), and when theirsys_memberrow in that organization is deleted or moved, through engine hooks registered by the plugin and unregistered ondestroy; (4) an administrator's removal deletes the link, so the person can propose and confirm again at once.slackchannel (slack-channel.ts): registered only on a composition where connector-slack'sslackclient service resolves atkernel:ready(ConnectorSlackPluginregisters it at init), then mounted per lookup like email/sms/push. Without it the messaging service does not knowslack, so the/automationsave doors still refuse anotifynode naming it (400) and the two preference doors do not list it, as onmain. With it,slackis a new accepted value on anotifynode, henceMetadata-protocol: added.isAvailableanswers the organization (an active install, elsetransport_not_configured). It sendsconversations.openthenchat.postMessagewith the title in bold, linked to the notification's deep link made absolute underOS_AUTH_URL(legacyBETTER_AUTH_URL), thenOS_BASE_URL(the same chain the approval email's link defaults to), then the body; Slack's control characters are escaped and unfurling is off. Classification: a refused token (invalid_auth,token_revoked,token_expired,account_inactive,not_authed) ispermanentand marks the installrevoked; a person Slack cannot DM, or a link gone by send time, isinvalid_recipient(suppressed, never dead); HTTP 429 orratelimitedisrate_limited(retried); anything else is retryable. The DM carries no text of its own, so it needs no catalog keys.channel.ts,messaging-service.ts):MessagingChannelgains an optionalreachableRecipients. Fan-out asks each channel that has it once per emit, after the preference filter, and drops the recipients it cannot reach on that channel before any delivery row exists: no row, no send, no failure, nosuppressed_channelsentry. A throw keeps everyone (fail-open,warn). Preferences, digest and quiet hours run before it as for every channel.ConnectorSlackPluginregisters aslackservice,createSlackClientService(options), whoseclient(token)sends with a token the caller holds (each organization's own), over the plugin's transport options. service-messaging reaches it through the service registry because importing connector-slack would close a workspace cycle (measured: turboCyclic dependency detected, via connector-slack's devDependency on service-automation).plugin-approvals, one hunk at the emit site):approval.requestedalso asks forslack, and only while the composition mounts the channel, so a deployment without connector-slack does not log a refusal on every request.ApprovalMessagingSurfacedeclares the optionalgetChannelit reads.slack-link-routes.ts,slack-links.ts), pinned inslack-links.integration.test.ts.PLATFORM_OBJECTS_BY_PACKAGE['service-messaging']lists the two objects (the registry's own contract: "Each group is the exact set that package registers"), the organization ownership inventory gives each a row (fateattribution; a link's install carries its organization), the tenancy census is regenerated, the objects are provisioned at boot and in the manifest,messaging.slack_link_removedjoins the platform topic list, and the route-envelope gate's module list declaresslack-link-routes.tsconformant (every body through the sharedsendOk/sendError/sendServerFault). Touchingpackages/specmakes this Tier H, so per the claim amendment's fold rule ADR-0013's addendum is edited here (below).Step-2 choices (for the ADR follow-up)
ADR-0013's addendum records, in this PR (fold rule of the claim amendment), the admin permission, the token store and the proposal rule, the choices its addendum asks step 2 to name; the other choices below are recorded in this body only:
setup.writein the caller's current organization.sys_channel_account.bot_token, asecretfield (ADR-0100), the channelsys_connector_credentialuses (ADR-0143). The engine encrypts it on write through the host'sICryptoProvider, with scopeobject_secret_field, namespacesys_channel_account, keybot_tokenand the organization astenantIdin the context; the ciphertext is asys_secretrow and the column holds only its reference; every read path masks it; the write audit masks it; onlyresolveSecretField()dereferences it, server side, called bySlackLinkStore.slackForalone. No route answers it. The object is engine-owned,apiEnabled: falsewith no API methods, andaccess: private. With no crypto provider the write is refused (fail-closed).sys_users sharing one email) stays open; the cite in the addendum is corrected from "§8 risk 4".slack: the producer (approvals) names the channel; fan-out is not changed to add channels.reachableRecipients, a per-recipient counterpart ofisAvailable.OS_AUTH_URL/OS_BASE_URLchain.Scope out
publicBaseUrland neitherOS_AUTH_URLnorOS_BASE_URLgets an absolute link in the e-mail and none in the DM; one origin source for both is approvals/messaging: the approval Slack DM and the approval email build their deep link from different origins — share one source so a host that sets only publicBaseUrl still gets an absolute DM link #35844.ConnectorSlackPluginstill takes its static token option; making it optional is connector-slack: make ConnectorSlackPlugin's static bot token optional, so a deployment that only uses per-organization Slack tokens (the Slack DM channel) composes the plugin without a placeholder #35791.GET /api/v1/messaging/slack/links), which today answers at most 10,000 links. The removals do not depend on that list: one link is read by its id and install, and the uninstall reads every link in pages.messaging.slack_link_removedjoins the platform topic list, soGET /api/v1/messaging/preference-optionsandGET /api/v1/messaging/me/preferenceslist it as a topic on every deployment, with or without connector-slack; only a deployment that composes connector-slack ever emits it. The changeset's channel bullet does not say so. It is not amended here, so as not to move the reviewed head; the next commit on this branch, or the step-3 PR, carries the sentence.Generated files (reviewers can skip)
node scripts/check-i18n-bundles.mjs --write --filter=service-messaging(the non-English labels then translated in place):packages/services/service-messaging/src/translations/ar.objects.generated.ts,de.objects.generated.ts,en.objects.generated.ts,es-ES.objects.generated.ts,fr.objects.generated.ts,ja-JP.objects.generated.ts,ko.objects.generated.ts,pt-BR.objects.generated.ts,ru.objects.generated.ts,zh-CN.objects.generated.ts,zh-Hant.objects.generated.ts.packages/services/service-messaging/src/translations/de.source-hashes.generated.ts,pt-BR.source-hashes.generated.ts.scripts/platform-object-tenancy-census.json(node scripts/platform-object-tenancy-census.mjs --write) andpnpm-lock.yaml(the approvals devDependency, +3).Evals
This round (the review of
73b116f0fe) runs on head938fa8f8c8: the round's commits, a merge oforigin/mainwith no conflicts, and one test commit;origin/mainhad nothing newer at push time. The readings below this round's are from73b116f0feand earlier, as each one names.This round, on 938fa8f: typecheck and full suites of service-messaging (78 files, 1054 tests), plugin-approvals (126 files, 1792 tests), connector-slack (3 files, 11 tests); runtime's touched files (21 tests)
Under the shared verify lock (
VERDICT command-exit 0), after building the dependency closure of runtime, plugin-approvals and cli under it (VERDICT command-exit 0):typecheckexit 0;vitest runTest Files 78 passed (78), Tests 1054 passed (1054).typecheckexit 0;vitest runTest Files 126 passed (126), Tests 1792 passed (1792).automation-notify-slack-composition.test.tsandautomation-authoring-doors-durable.test.ts: Test Files 2 passed (2), Tests 21 passed (21). The rest of runtime's suite is CI's (Test Core); runtime's published surface is unchanged.938fa8f8c8:node scripts/pm/dispatch-gates.mjs --commands(137), every command run with its exit code captured before any pipe;--ranreconciliation: 137 derived, 135 run, 2 NOT MEASURED, 0 UNRUN. The two NOT MEASURED arecheck:dual-build-cjs-loadsandcheck:i18n-coverage(exit 3, PREREQUISITE NOT MET: they read a full workspace build this box does not hold); CI runs both.check:i18nandcheck:i18n-walk-parityfirst answered exit 3 (the CLI not built) and are recorded from their rerun after building the CLI and the packages they extract under the lock: both exit 0,check-i18n-bundles: OK (10 package(s) — all bundles in sync).check:engine-double-contractexit 0 (OK — 1370 pinned; the six seams this round adds are in the pinned ledger, written with--write; no baseline entry added);check:platform-object-tenancy-censusexit 0 (108 objects, 57 in reach);check:route-envelopeexit 0. The changeset gates with this body as thepull_requestevent:check-changeset-no-major.mjs --base origin/mainexit 0, its level axis readingMetadata-protocol: addedand@objectstack/service-messaging: minor; its--self-test,check-adr-0087-registration,check-changeset-fixedandcheck-empty-changesetexit 0.overlap-check --branch=claude/area-a4W-34730-s2:VERDICT clean exit 0(origin/main, chore: version packages #35129, fix(settings)!: offer the knowledge settings only where the knowledge service is mounted #34223).New pins:
slack-channel-composition.test.ts(service-messaging, 2): a realMessagingServicePluginwithout aslackservice does not know or mountslack, and neither preference door lists it; with one,slackis known, mounted and listed by both.automation-notify-slack-composition.test.ts(runtime, 2): over the same real plugin, anotifynode namingslackis refused400 VALIDATION_FAILEDatPOST /automationwithout connector-slack and nothing is saved (a node naminginboxandemailsaves), and saves with it.slack-links.integration.test.ts(now 20): an administrator removes only a link to their own organization's install (404otherwise); the uninstall tells every linked person across more than one page of links; rider 3's membership moved to another organization removes the link, audited as who moved it, and a membership write that keeps the organization removes nothing; a ban removes the person's links in every organization in one engine delete, with one auditedafterDeleteper removed link (measured over two installs: onedeletecall onsys_channel_user_link, two dispatches, each naming who banned); and the hardening of token input and proposal audit (3 cases).service-messaging on 73b116f: typecheck + full suite (77 files, 1045 tests)
pnpm --filter @objectstack/service-messaging typecheckexit 0;vitest runTest Files 77 passed (77), Tests 1045 passed (1045). New:slack-links.integration.test.ts(13: the token encrypted in the stored row, never in an answer, opening only under its organization; proposal and confirm; refusals; riders 1 to 5; the proposal rule: an unverified email answered exactly as no match with nousers.lookupByEmailcall made, a match naming no Slack user or Slack id to the person or an administrator before confirmation, a confirmation refused409once the email changed or is no longer verified with the sentence in the caller's language, an unchanged verified email confirming, a proposal row changed between the check and the write answered409and left unconfirmed, and a new proposal replacing one made for another email),slack-channel.test.ts(10: send, the five error classes, the unlinked recipient, the deep link and origin chain),recipient-reach.test.ts(3), ledger conformance (now enumerates the Slack doors).plugin-approvals on 73b116f: typecheck + full suite (126 files, 1792 tests), including the Slack DM end to end (its approver's email now verified)
typecheck(tsc, scripts tsconfig,check:test-typecheckOK at its recorded debt) exit 0; Test Files 126 passed (126), Tests 1792 passed (1792).approval-requested-slack-dm.integration.test.ts, real ObjectQL on SqlDriver, the real MessagingServicePlugin with its outbox and dispatcher, the real ApprovalsServicePlugin, connector-slack's real client stubbed atfetch: a confirmed link gets aslackdelivery atsuccess,conversations.openwith the linked user, and achat.postMessagewhose link opens the same page as the approval email's (the same string, for the test's canonical origin); a mutedslackand quiet hours send no DM; a proposed link and no link giveemail+inboxrows only; no connector-slack: noslackask and no refusal logged.connector-slack, spec, cli
On
73b116f0fe, after the merge: specplatform-object-names.test.ts14/14 and cliorganization-ownership-inventory.test.ts26/26 (main's two working-calendar objects and this branch's two Slack objects both listed);check:platform-object-tenancy-census(self-test and check) green on the regenerated census, 108 objects, 57 in reach. On99277cfb01: connector-slack typecheck exit 0, Test Files 3 passed (3), Tests 11 passed (11), the client service sending with the caller's token, not the plugin's static one; spectypecheckexit 0,platform-object-names.test.ts+scripts/platform-catalog.test.ts34/34; clitypecheckexit 0,vitest run --project unitTest Files 433 passed (433), Tests 6176 passed (6176). The cli integration layer is left to CI.Derived gates on 73b116f: 137 derived, 135 run green, 2 NOT MEASURED
node scripts/pm/dispatch-gates.mjs --commandson73b116f0fe, every command run and recorded with its exit code;--ranreconciliation: 137 derived, 135 run, 2 NOT-MEASURED, 0 UNRUN. The two NOT MEASURED arecheck:dual-build-cjs-loadsandcheck:i18n-coverage(exit 3, PREREQUISITE NOT MET: they read a full workspace build this box does not hold); CI runs both.check:platform-object-tenancy-census(self-test and check) green on the census regenerated after the merge: on11ef4c3d74CI's merge withorigin/mainhad found the committed census stale beside main's two new working-calendar objects.check:route-envelopegreen since the Slack route module's declaration.check:type-check-debtre-measured under the lock: 0 raw errors above any recorded number.check:i18nandcheck:i18n-stale-fillgreen. overlap-check: clean againstorigin/main, #35129 and #34223. CI on73b116f0fe: 62 success, 9 skipped, no failure.Ablations (one per behaviour, each restored with `git diff HEAD` empty)
messaging-service.ts(const reached = targets): 4 red,recipient-reach2 and the approvals end-to-endproposed/nonecases, which receivedslack:u_approver:suppressed. Restored to the HEAD blob.approval-service.ts(always ask forslack), throughscripts/ablation-replace.mjsunder the lock (anchor 1 to 0, blobc0a7c038924bto7098bc5123b7): thewithout connector-slackcase red, receiving the warningchannel 'slack' is not registered; refused 1 delivery row(s). Restored: blob equals HEAD (c0a7c038924b) andgit diff HEADempty. A first attempt never got the lock (exit 99, not measured) and was restored the same way.SlackLinkStore(any email used): 2 red, the unverified-email case and the unverified half of the confirmation case.{ where: { id } }, by-id): 1 red, the row-changed-before-the-write case.Ablations 3 to 8 ran through
scripts/ablation-replace.mjsunder the lock againstslack-links.integration.test.ts(12 tests; 13 for ablation 8), each mutation landing (anchor 1 to 0) and each restored with its blob equal to HEAD andgit diff HEADempty.This round, on
b6e7b432f7(its slack-links, routes and plugin sources are byte-identical atdfa7308cb9), throughscripts/ablation-replace.mjsoutside the lock (the narrowing above), each mutation landing (anchor 1 to 0) and restored with its blob equal to HEAD andgit diff HEADempty:slackregistration made unconditional:slack-channel-composition.test.ts1 failed | 1 passed, the without-a-slack-service case.Verification
Read first, by risk:
packages/services/service-messaging/src/slack-links.ts:proposeandconfirm(the proposal rule),install(the token proven, then written as a secret under the organization),slackFor(the one reader),removeLink(the notice),bindSlackLinkRemovalTriggers.packages/services/service-messaging/src/slack-link-routes.ts:door(), the gate order and thesetup.writecheck;linkView/ownLinkView(nothing named before confirmation).packages/services/service-messaging/src/messaging-service.ts:dropUnreachableand where step 3c sits inemit.Two-minute check:
pnpm --filter @objectstack/plugin-approvals exec vitest run src/approval-requested-slack-dm.integration.test.tsshows 6 passed, the first case printing nothing and asserting the DM link equals the email's.Acceptance notes
938fa8f8c8: 52 files, +3330 / -30, net 3300 (the order's soft size ~900, hard stop 2700). On73b116f0feit was 2866; this round's four commits added 434: the two composition test files 241,slack-links.integration.test.ts107, source 56 (slack-links.ts40, approvals 7, the plugin 6, the routes 3), and the engine-double ledger 30. It is past the stop and reported to the seat, not trimmed. What drives the total (additions on938fa8f8c8): tests 1164; generated files and ledgers 718 (the 11*.objects.generated.tstranslation bundles, 638 of it, plus the route ledger, census, inventory and engine-double ledger); provider and link code about 1410, mostlyslack-links.ts561,slack-link-routes.ts222,slack-channel.ts172 and the two new objects 124; docs and changeset 36. The seat accepted the size with no split, since the PR is Tier H and a maintainer reads it anyway.packages/spec(registry constant and its test),packages/cli(one inventory row per object),scripts/platform-object-tenancy-census.json(regenerated),scripts/check-route-envelope.mjs(one module declared),docs/adr/0013(fold rule),plugin-approvalspackage.json/vitest.config.ts(connector-slack as a devDependency, aliased to source) and the lockfile.slackchannel is not mounted and approvals do not ask for it. With it composed and an organization with no install,isAvailablerecordstransport_not_configuredon that event, as for email without a transport.PUTtoken and every Slack answer are never logged; refusals name Slack's error code only.Session: https://claude.ai/code/session_016WV4czKnDE6hsyXQzB9wB2
🤖 Generated with Claude Code