Skip to content

Commit 796614d

Browse files
committed
docs(spec): say how declared and organization-authored assignment rules combine
The assignment_rule registry entry's comment no longer calls organization-authored routing deferred, and the AssignmentRuleSchema docblock states the order the engine evaluates in: the organization's active sys_assignment_rule rows first (sort_order, then name), the declared rules after them in registry order, the first matching entry deciding across both. No key, shape or describe() text changes; the schema and reference generators produce no diff. Claude-Session: https://claude.ai/code/session_016WV4d14C8K4gMehVb6jBvA Co-authored-by: Claude <noreply@anthropic.com>
1 parent d86cdc3 commit 796614d

2 files changed

Lines changed: 17 additions & 6 deletions

File tree

‎packages/spec/src/automation/assignment-rule.zod.ts‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,20 @@ export const AssignmentRuleEntrySchema = strictObject(
128128
* row's organization, or a failed read leaves the row ownerless (sitting in
129129
* the queue when one was chosen) and is logged once.
130130
*
131-
* Assignment rules are declared only (the stack's `assignmentRules`);
132-
* organization-authored rules are deferred (ADR-0142 merge question 11).
133-
* Switched off through the activation ledger (`sys_metadata_activation`,
134-
* `metadata_type: 'assignment_rule'`) or `active: false`.
131+
* Two sources of rules combine. A package declares rules in the stack's
132+
* `assignmentRules`, the shape below; an organization authors its own as
133+
* `sys_assignment_rule` rows (one rule with one entry per row), which may not
134+
* take a declared rule's name. For a row of an organization the engine tries
135+
* that organization's active rows first, ascending by `sort_order` and then by
136+
* name, and the declared rules after them, in registry order; across both,
137+
* the first entry whose `criteria` match decides, and its target stands even
138+
* when it does not resolve. When the organization's rows cannot be read, the
139+
* row is written as it stood rather than routed by the declared rules alone.
140+
* A user target owns the row only while the user is an active member of the
141+
* row's organization; one that is not leaves the row ownerless and is logged
142+
* once. A declared rule is switched off through the activation ledger
143+
* (`sys_metadata_activation`, `metadata_type: 'assignment_rule'`) or
144+
* `active: false`; an organization's row by its own `active`.
135145
*/
136146
export const AssignmentRuleSchema = lazySchema(() => strictObject(
137147
{

‎packages/spec/src/kernel/metadata-plugin.zod.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1299,8 +1299,9 @@ export const DEFAULT_METADATA_TYPE_REGISTRY: MetadataTypeRegistryEntryParsed[] =
12991299
// members name.
13001300
{ type: 'queue', label: 'Queue', description: 'A named set of people records can sit in until one of them takes the record; organizations staff their own in Setup', filePatterns: ['**/*.queue.ts', '**/*.queue.yml'], supportsOverlay: false, allowEnvironmentOverlay: false, allowRuntimeCreate: false, supportsVersioning: false, executionPinned: false, loadOrder: 16, domain: 'security' },
13011301
// [ADR-0142 D5] Declared assignment rules — code-only for the `queue`
1302-
// reason, and declared only: organization-authored routing is deferred
1303-
// (merge question 11). `loadOrder: 17` — after `queue`, which an entry's
1302+
// reason; an organization authors its own as `sys_assignment_rule` rows,
1303+
// which the engine evaluates before these and which may not take a declared
1304+
// rule's name. `loadOrder: 17` — after `queue`, which an entry's
13041305
// target names. Disabled through the activation ledger or `active: false`;
13051306
// customized by a clone under a new name, never by an overlay.
13061307
{ type: 'assignment_rule', label: 'Assignment Rule', description: 'A rule a package declares to route new records to a queue or a person', filePatterns: ['**/*.assignment-rule.ts', '**/*.assignment-rule.yml'], supportsOverlay: false, allowEnvironmentOverlay: false, allowRuntimeCreate: false, supportsVersioning: false, executionPinned: false, loadOrder: 17, domain: 'security' },

0 commit comments

Comments
 (0)