Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
MUL-6286: feat(properties): actor / multi_actor custom property types (members) (#7075)
Bohan Jiang9a30c51dacf7
diff --git a/apps/docs/content/docs/cli.ja.mdx b/apps/docs/content/docs/cli.ja.mdxindex 0b218e80eb..75b918a056 100644--- a/apps/docs/content/docs/cli.ja.mdx+++ b/apps/docs/content/docs/cli.ja.mdx@@ -238,7 +238,7 @@ CLI の設定ファイルには、あなたとして Multica にアクセスで| | `subscriber list/add/remove <issue-id>` | 購読者を管理 | `--user`、`--user-id`(省略時は現在のユーザー) || | `label list/add/remove <issue-id>` | イシューのラベルを管理 | || | `metadata list/get/set/delete <issue-id>` | イシューレベルのキー・バリューメタデータを管理 | |-| | `property list/set/unset <issue-id>` | カスタムプロパティの値を設定 | `set`: `--name`、`--value` |+| | `property list/set/unset <issue-id>` | カスタムプロパティの値を設定 | `set`: `--name`、`--value`(`actor` / `multi_actor` はメンバーの名前・メール・id を受け付けます) || | `runs <issue-id>` | 実行履歴を表示 | `--full-id` || | `run-messages <task-id>` | 1 回の実行のメッセージを表示 | `--since`、`--issue` || | `usage <issue-id>` | 集計されたトークン使用量を表示 | |@@ -248,7 +248,7 @@ CLI の設定ファイルには、あなたとして Multica にアクセスで| | `status <id> <status>` | プロジェクトのステータスを変更 | || | `resource list/add/update/remove` | プロジェクトの追加リソースを管理 | `--type`、`--url`、`--local-path`、`--daemon-id`、`--execution-mode`(ローカルディレクトリの `in_place` / `worktree`) || `label` | `list/get/create/update/delete` | ワークスペースのラベルを管理 | |-| `property` | `list/get/create/update/archive/unarchive` | ワークスペースのカスタムプロパティを管理 | `create`: `--name`、`--type`、`--option`(繰り返し可);`list`: `--include-archived`;タイプは作成後に変更できません |+| `property` | `list/get/create/update/archive/unarchive` | ワークスペースのカスタムプロパティを管理 | `create`: `--name`、`--type`(`text`、`number`、`select`、`multi_select`、`date`、`checkbox`、`url`、`actor`、`multi_actor`)、`--option`(繰り返し可、select 系のみ);`list`: `--include-archived`;タイプは作成後に変更できません || `agent` | `list/get/create/update/archive/restore` | エージェントを管理 | `--name`、`--runtime-id`(`create` では必須)、`--instructions`、`--model`、`--thinking-level`、`--mcp-config`、`--permission-mode`、`--max-concurrent-tasks` || | `copy <agent-id>` | 新しいエージェントとして複製。元のエージェントは変更されません | `--name`(デフォルトは元の名前 + ` (copy)`)、`--runtime-id`(別のランタイムへ複製する場合は `--model` の同時指定が必須)、`--no-skills`;`custom_env`、`mcp_config`、`runtime_config` などの機密設定は複製されないため、`create` と同じフラグで再指定してください || | `tasks <id>` | エージェントのタスクを表示 | |diff --git a/apps/docs/content/docs/cli.ko.mdx b/apps/docs/content/docs/cli.ko.mdxindex f29d0ca701..5734bc69e4 100644--- a/apps/docs/content/docs/cli.ko.mdx+++ b/apps/docs/content/docs/cli.ko.mdx@@ -238,7 +238,7 @@ CLI 설정 파일에는 사용자를 대신해 Multica에 접근할 수 있는 t| | `subscriber list/add/remove <issue-id>` | 구독자 관리 | `--user`, `--user-id`(생략하면 현재 사용자) || | `label list/add/remove <issue-id>` | 이슈 라벨 관리 | || | `metadata list/get/set/delete <issue-id>` | 이슈 수준 key-value metadata 관리 | |-| | `property list/set/unset <issue-id>` | 사용자 지정 속성 값 설정 | `set`: `--name`, `--value` |+| | `property list/set/unset <issue-id>` | 사용자 지정 속성 값 설정 | `set`: `--name`, `--value`(`actor` / `multi_actor`는 멤버의 이름, 이메일, id를 받습니다) || | `runs <issue-id>` | 실행 기록 확인 | `--full-id` || | `run-messages <task-id>` | 단일 실행 메시지 확인 | `--since`, `--issue` || | `usage <issue-id>` | 집계 token 사용량 확인 | |@@ -248,7 +248,7 @@ CLI 설정 파일에는 사용자를 대신해 Multica에 접근할 수 있는 t| | `status <id> <status>` | 프로젝트 상태 변경 | || | `resource list/add/update/remove` | 프로젝트 추가 리소스 관리 | `--type`, `--url`, `--local-path`, `--daemon-id`, `--execution-mode`(로컬 디렉터리의 `in_place` / `worktree`) || `label` | `list/get/create/update/delete` | 워크스페이스 라벨 관리 | |-| `property` | `list/get/create/update/archive/unarchive` | 워크스페이스 사용자 지정 속성 관리 | `create`: `--name`, `--type`, `--option`(반복 가능). `list`: `--include-archived`. 유형은 생성 후 변경 불가 |+| `property` | `list/get/create/update/archive/unarchive` | 워크스페이스 사용자 지정 속성 관리 | `create`: `--name`, `--type`(`text`, `number`, `select`, `multi_select`, `date`, `checkbox`, `url`, `actor`, `multi_actor`), `--option`(반복 가능, select 유형만). `list`: `--include-archived`. 유형은 생성 후 변경 불가 || `agent` | `list/get/create/update/archive/restore` | 에이전트 관리 | `--name`, `--runtime-id`(`create`에서 필수), `--instructions`, `--model`, `--thinking-level`, `--mcp-config`, `--permission-mode`, `--max-concurrent-tasks` || | `copy <agent-id>` | 원래 에이전트에 영향 없이 새 에이전트로 복사 | `--name`(기본값은 원래 이름 + ` (copy)`), `--runtime-id`(다른 런타임으로 복사할 때 `--model`도 필수), `--no-skills`. `custom_env`, `mcp_config`, `runtime_config` 같은 기밀 설정은 복사되지 않으며 `create`와 같은 flag로 다시 제공해야 함 || | `tasks <id>` | 에이전트 태스크 확인 | |diff --git a/apps/docs/content/docs/cli.mdx b/apps/docs/content/docs/cli.mdxindex b2da2233a8..fa9690499d 100644--- a/apps/docs/content/docs/cli.mdx+++ b/apps/docs/content/docs/cli.mdx@@ -246,7 +246,7 @@ The tables below cover every current top-level command, grouped the way the CLI| | `subscriber list/add/remove <issue-id>` | Manage subscribers | `--user`, `--user-id` (defaults to the current user) || | `label list/add/remove <issue-id>` | Manage labels on an issue | || | `metadata list/get/set/delete <issue-id>` | Manage issue-level key-value metadata | |-| | `property list/set/unset <issue-id>` | Set custom property values | `set`: `--name`, `--value` |+| | `property list/set/unset <issue-id>` | Set custom property values | `set`: `--name`, `--value` (`actor` / `multi_actor` accept a member name, email, or id) || | `runs <issue-id>` | View run history | `--full-id` || | `run-messages <task-id>` | View the messages of a single run | `--since`, `--issue` || | `usage <issue-id>` | View aggregated token usage | |@@ -256,7 +256,7 @@ The tables below cover every current top-level command, grouped the way the CLI| | `status <id> <status>` | Change project status | || | `resource list/add/update/remove` | Manage project resources | `--type`, `--url`, `--local-path`, `--daemon-id`, `--execution-mode` (`in_place` / `worktree` for a local directory) || `label` | `list/get/create/update/delete` | Manage workspace labels | |-| `property` | `list/get/create/update/archive/unarchive` | Manage workspace custom properties | `create`: `--name`, `--type`, `--option` (repeatable); `list`: `--include-archived`; the type cannot be changed after creation |+| `property` | `list/get/create/update/archive/unarchive` | Manage workspace custom properties | `create`: `--name`, `--type` (`text`, `number`, `select`, `multi_select`, `date`, `checkbox`, `url`, `actor`, `multi_actor`), `--option` (repeatable, select types only); `list`: `--include-archived`; the type cannot be changed after creation || `agent` | `list/get/create/update/archive/restore` | Manage agents | `--name`, `--runtime-id` (required for `create`), `--instructions`, `--model`, `--thinking-level`, `--mcp-config`, `--permission-mode`, `--max-concurrent-tasks` || | `copy <agent-id>` | Copy into a new agent; the original is untouched | `--name` (defaults to the original name plus ` (copy)`), `--runtime-id` (copying to another runtime also requires `--model`), `--no-skills`; secret configuration such as `custom_env`, `mcp_config`, and `runtime_config` is not copied — re-provide it with the same flags as `create` || | `tasks <id>` | View an agent's tasks | |diff --git a/apps/docs/content/docs/cli.zh.mdx b/apps/docs/content/docs/cli.zh.mdxindex cc2333ff8c..03ad24b190 100644--- a/apps/docs/content/docs/cli.zh.mdx+++ b/apps/docs/content/docs/cli.zh.mdx@@ -238,7 +238,7 @@ CLI 配置文件包含可代表你访问 Multica 的令牌。不要提交到仓| | `subscriber list/add/remove <issue-id>` | 管理订阅者 | `--user`、`--user-id`(缺省为当前用户) || | `label list/add/remove <issue-id>` | 管理 issue 上的标签 | || | `metadata list/get/set/delete <issue-id>` | 管理 issue 级键值元数据 | |-| | `property list/set/unset <issue-id>` | 设置自定义属性值 | `set`:`--name`、`--value` |+| | `property list/set/unset <issue-id>` | 设置自定义属性值 | `set`:`--name`、`--value`(`actor` / `multi_actor` 接受成员的名称、邮箱或 id) || | `runs <issue-id>` | 查看执行历史 | `--full-id` || | `run-messages <task-id>` | 查看单次执行的消息 | `--since`、`--issue` || | `usage <issue-id>` | 查看聚合 token 用量 | |@@ -248,7 +248,7 @@ CLI 配置文件包含可代表你访问 Multica 的令牌。不要提交到仓| | `status <id> <status>` | 修改项目状态 | || | `resource list/add/update/remove` | 管理项目附加资源 | `--type`、`--url`、`--local-path`、`--daemon-id`、`--execution-mode`(本地目录的 `in_place` / `worktree`) || `label` | `list/get/create/update/delete` | 管理工作区标签 | |-| `property` | `list/get/create/update/archive/unarchive` | 管理工作区自定义属性 | `create`:`--name`、`--type`、`--option`(可重复);`list`:`--include-archived`;类型创建后不可修改 |+| `property` | `list/get/create/update/archive/unarchive` | 管理工作区自定义属性 | `create`:`--name`、`--type`(`text`、`number`、`select`、`multi_select`、`date`、`checkbox`、`url`、`actor`、`multi_actor`)、`--option`(可重复,仅 select 类型);`list`:`--include-archived`;类型创建后不可修改 || `agent` | `list/get/create/update/archive/restore` | 管理智能体 | `--name`、`--runtime-id`(`create` 必填)、`--instructions`、`--model`、`--thinking-level`、`--mcp-config`、`--permission-mode`、`--max-concurrent-tasks` || | `copy <agent-id>` | 复制为新智能体,原智能体不受影响 | `--name`(默认为原名加 ` (copy)`)、`--runtime-id`(复制到其他运行时时必须同时指定 `--model`)、`--no-skills`;`custom_env`、`mcp_config`、`runtime_config` 等机密配置不会复制,需用与 `create` 相同的 flag 重新提供 || | `tasks <id>` | 查看智能体的 task | |diff --git a/packages/core/types/index.ts b/packages/core/types/index.tsindex 5d659d6d72..885e2f7d5b 100644--- a/packages/core/types/index.ts+++ b/packages/core/types/index.ts@@ -105,8 +105,8 @@ export type { InboxItem, InboxSeverity, InboxItemType, InboxWorkspaceUnread } frexport type { NotificationGroupKey, NotificationGroupValue, NotificationPreferences, NotificationPreferenceResponse } from "./notification-preference";export type { Comment, CommentType, CommentAuthorType, CommentTriggerPreview, CommentTriggerPreviewAgent, CommentTriggerSource, CommentTriggerOutcome, CommentTriggerStatus, Reaction } from "./comment";export type { Label, LabelResourceType, CreateLabelRequest, UpdateLabelRequest, ListLabelsResponse, IssueLabelsResponse, ResourceLabelsResponse } from "./label";-export type { IssueProperty, IssuePropertyType, IssuePropertyOption, IssuePropertyConfig, IssuePropertyValue, IssuePropertyValues, CreatePropertyRequest, UpdatePropertyRequest, ListPropertiesResponse, IssuePropertiesResponse } from "./property";-export { ISSUE_PROPERTY_TYPES, isKnownPropertyType } from "./property";+export type { IssueProperty, IssuePropertyType, IssuePropertyOption, IssuePropertyConfig, IssuePropertyValue, IssuePropertyValues, CreatePropertyRequest, UpdatePropertyRequest, ListPropertiesResponse, IssuePropertiesResponse, IssuePropertyActorKind, IssuePropertyActorRef } from "./property";+export { ISSUE_PROPERTY_TYPES, isKnownPropertyType, ISSUE_PROPERTY_ACTOR_KINDS, MAX_ISSUE_PROPERTY_ACTOR_VALUES, isActorPropertyType, formatActorRef, parseActorRef, actorRefsFromValue, actorRefValuesFromValue, hasUnknownActorRef } from "./property";export type {QuickAction,QuickActionVisibility,diff --git a/packages/core/types/property.test.ts b/packages/core/types/property.test.tsnew file mode 100644index 0000000000..7c98e4d2b9--- /dev/null+++ b/packages/core/types/property.test.ts@@ -0,0 +1,136 @@+import { describe, expect, it } from "vitest";+import {+ actorRefsFromValue,+ actorRefValuesFromValue,+ hasUnknownActorRef,+ formatActorRef,+ isActorPropertyType,+ isKnownPropertyType,+ parseActorRef,+} from "./property";++const MEMBER = "11111111-2222-3333-4444-555555555555";+const SECOND_MEMBER = "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee";+const AGENT = "66666666-7777-8888-9999-000000000000";++describe("isKnownPropertyType", () => {+ it("accepts the actor types", () => {+ expect(isKnownPropertyType("actor")).toBe(true);+ expect(isKnownPropertyType("multi_actor")).toBe(true);+ });++ it("still rejects unknown types", () => {+ expect(isKnownPropertyType("relation")).toBe(false);+ });+});++describe("isActorPropertyType", () => {+ it("covers both actor types and nothing else", () => {+ expect(isActorPropertyType("actor")).toBe(true);+ expect(isActorPropertyType("multi_actor")).toBe(true);+ expect(isActorPropertyType("select")).toBe(false);+ expect(isActorPropertyType("multi_select")).toBe(false);+ });+});++describe("parseActorRef", () => {+ it("parses member references", () => {+ expect(parseActorRef(`member:${MEMBER}`)).toEqual({ kind: "member", id: MEMBER });+ });++ it("rejects kinds outside the V1 range", () => {+ // Agents and squads are assignable but deliberately not referenceable.+ expect(parseActorRef(`agent:${AGENT}`)).toBeNull();+ expect(parseActorRef(`squad:${AGENT}`)).toBeNull();+ expect(parseActorRef(`user:${MEMBER}`)).toBeNull();+ });++ it("rejects malformed input", () => {+ expect(parseActorRef(MEMBER)).toBeNull();+ expect(parseActorRef("member:")).toBeNull();+ expect(parseActorRef(":" + MEMBER)).toBeNull();+ expect(parseActorRef(42)).toBeNull();+ expect(parseActorRef(undefined)).toBeNull();+ });+});++describe("formatActorRef", () => {+ it("round-trips through parseActorRef", () => {+ const ref = formatActorRef("member", MEMBER);+ expect(ref).toBe(`member:${MEMBER}`);+ expect(parseActorRef(ref)).toEqual({ kind: "member", id: MEMBER });+ });+});++describe("actorRefsFromValue", () => {+ it("reads a single actor value as a one-item list", () => {+ expect(actorRefsFromValue(`member:${MEMBER}`)).toEqual([{ kind: "member", id: MEMBER }]);+ });++ it("preserves multi_actor order rather than sorting", () => {+ expect(actorRefsFromValue([`member:${SECOND_MEMBER}`, `member:${MEMBER}`])).toEqual([+ { kind: "member", id: SECOND_MEMBER },+ { kind: "member", id: MEMBER },+ ]);+ });++ it("drops entries a newer backend may ship instead of throwing", () => {+ // A backend that later widens the kind set must not blank the whole value+ // on an older client — the unknown entries drop, the known ones render.+ expect(actorRefsFromValue([`member:${MEMBER}`, `agent:${AGENT}`, "garbage"])).toEqual([+ { kind: "member", id: MEMBER },+ ]);+ });++ it("returns an empty list for unset or wrongly-typed values", () => {+ expect(actorRefsFromValue(undefined)).toEqual([]);+ expect(actorRefsFromValue(true)).toEqual([]);+ expect(actorRefsFromValue(7)).toEqual([]);+ });+});++describe("actorRefValuesFromValue", () => {+ it("keeps kinds this build does not know", () => {+ // The edit path must round-trip through this: a newer backend widening the+ // kind set must not have its values deleted by an older client.+ expect(actorRefValuesFromValue([`member:${MEMBER}`, `agent:${AGENT}`])).toEqual([+ `member:${MEMBER}`,+ `agent:${AGENT}`,+ ]);+ });++ it("reads a single value as a one-item list and preserves order", () => {+ expect(actorRefValuesFromValue(`member:${MEMBER}`)).toEqual([`member:${MEMBER}`]);+ expect(actorRefValuesFromValue([`member:${SECOND_MEMBER}`, `member:${MEMBER}`])).toEqual([+ `member:${SECOND_MEMBER}`,+ `member:${MEMBER}`,+ ]);+ });++ it("returns an empty list for unset or wrongly-typed values", () => {+ expect(actorRefValuesFromValue(undefined)).toEqual([]);+ expect(actorRefValuesFromValue(true)).toEqual([]);+ expect(actorRefValuesFromValue(7)).toEqual([]);+ });+});++describe("hasUnknownActorRef", () => {+ it("is true for a single value this build cannot parse", () => {+ expect(hasUnknownActorRef(`agent:${AGENT}`)).toBe(true);+ expect(hasUnknownActorRef("garbage")).toBe(true);+ });++ it("is true when a multi value mixes known and unknown kinds", () => {+ expect(hasUnknownActorRef([`member:${MEMBER}`, `agent:${AGENT}`])).toBe(true);+ });++ it("is false for values made entirely of known kinds", () => {+ expect(hasUnknownActorRef(`member:${MEMBER}`)).toBe(false);+ expect(hasUnknownActorRef([`member:${MEMBER}`, `member:${SECOND_MEMBER}`])).toBe(false);+ });++ it("is false for an unset value — nothing to lose", () => {+ expect(hasUnknownActorRef(undefined)).toBe(false);+ expect(hasUnknownActorRef([])).toBe(false);+ });+});diff --git a/packages/core/types/property.ts b/packages/core/types/property.tsindex a5aec67bb6..c97f41e3fc 100644--- a/packages/core/types/property.ts+++ b/packages/core/types/property.ts@@ -6,7 +6,8 @@** Values are typed per definition: select stores an option id, multi_select* an array of option ids (config order), date a "YYYY-MM-DD" string, checkbox- * a boolean, number a number, text/url strings.+ * a boolean, number a number, text/url strings, actor a "member:<user_id>"+ * reference string, multi_actor an array of them (insertion order).*/export type IssuePropertyType =| "text"@@ -15,7 +16,9 @@ export type IssuePropertyType =| "multi_select"| "date"| "checkbox"- | "url";+ | "url"+ | "actor"+ | "multi_actor";export const ISSUE_PROPERTY_TYPES: IssuePropertyType[] = ["text",@@ -25,12 +28,102 @@ export const ISSUE_PROPERTY_TYPES: IssuePropertyType[] = ["date","checkbox","url",+ "actor",+ "multi_actor",];export function isKnownPropertyType(type: string): type is IssuePropertyType {return (ISSUE_PROPERTY_TYPES as string[]).includes(type);}+/**+ * Actor properties (MUL-6286) reference a workspace member. The assignee field+ * also accepts agents and squads; actor properties deliberately do not — an+ * agent reference would drag in agent-visibility rules, and a squad is a+ * routing target rather than a person.+ *+ * The stored form is "<kind>:<uuid>", so widening this union later needs no+ * migration and no new property type.+ */+export type IssuePropertyActorKind = "member";++export const ISSUE_PROPERTY_ACTOR_KINDS: IssuePropertyActorKind[] = ["member"];++/** Upper bound on a single multi_actor value; mirrors the server cap. */+export const MAX_ISSUE_PROPERTY_ACTOR_VALUES = 20;++export interface IssuePropertyActorRef {+ kind: IssuePropertyActorKind;+ /** Members are referenced by `user_id`, matching the issue assignee pair. */+ id: string;+}++export function isActorPropertyType(type: string): boolean {+ return type === "actor" || type === "multi_actor";+}++export function formatActorRef(kind: IssuePropertyActorKind, id: string): string {+ return `${kind}:${id}`;+}++/** Returns null for anything that isn't a well-formed reference. */+export function parseActorRef(raw: unknown): IssuePropertyActorRef | null {+ if (typeof raw !== "string") return null;+ const separator = raw.indexOf(":");+ if (separator <= 0) return null;+ const kind = raw.slice(0, separator);+ const id = raw.slice(separator + 1);+ if (!id) return null;+ if (!(ISSUE_PROPERTY_ACTOR_KINDS as string[]).includes(kind)) return null;+ return { kind: kind as IssuePropertyActorKind, id };+}++/**+ * Raw reference strings in stored order, INCLUDING kinds this build does not+ * know about.+ *+ * Editors must round-trip through this rather than through+ * `actorRefsFromValue`: an installed desktop client talking to a newer backend+ * would otherwise drop every unknown-kind entry the moment the user toggles+ * one it does understand — a silent data loss the user never sees.+ */+export function actorRefValuesFromValue(value: IssuePropertyValue | undefined): string[] {+ if (typeof value === "string") return value ? [value] : [];+ if (Array.isArray(value)) {+ return value.filter((entry): entry is string => typeof entry === "string");+ }+ return [];+}++/**+ * Reads an actor property value as a list of refs this build can render.+ * Unknown kinds are dropped rather than thrown on — see+ * `actorRefValuesFromValue` for the edit path, which must keep them.+ */+export function actorRefsFromValue(value: IssuePropertyValue | undefined): IssuePropertyActorRef[] {+ if (typeof value === "string") {+ const ref = parseActorRef(value);+ return ref ? [ref] : [];+ }+ if (Array.isArray(value)) {+ return value.map(parseActorRef).filter((ref): ref is IssuePropertyActorRef => ref !== null);+ }+ return [];+}++/**+ * True when an actor value holds at least one reference this build cannot+ * parse — i.e. a newer backend has widened the accepted kinds.+ *+ * Editors must consult this before offering a normal edit. For `multi_actor`+ * the toggle already round-trips unknown entries, but for single `actor` an+ * unresolvable value renders as empty, and letting the user "fill in the empty+ * field" would overwrite a value they were never shown (MUL-6286 review).+ */+export function hasUnknownActorRef(value: IssuePropertyValue | undefined): boolean {+ return actorRefValuesFromValue(value).length !== actorRefsFromValue(value).length;+}+export interface IssuePropertyOption {id: string;name: string;diff --git a/packages/views/issues/components/filter-chips-bar.test.ts b/packages/views/issues/components/filter-chips-bar.test.tsnew file mode 100644index 0000000000..deb65d7491--- /dev/null+++ b/packages/views/issues/components/filter-chips-bar.test.ts@@ -0,0 +1,95 @@+import { describe, it, expect } from "vitest";+import {+ actorFilterValues,+ buildChipActorNames,+ hasActorPropertyFilterSelection,+} from "./filter-chips-bar";++const ALICE = "11111111-1111-4111-8111-111111111111";+const BOB = "22222222-2222-4222-8222-222222222222";++describe("actorFilterValues", () => {+ it("turns stored references into actor refs for the avatar stack", () => {+ expect(actorFilterValues([`member:${ALICE}`, `member:${BOB}`])).toEqual([+ { type: "member", id: ALICE },+ { type: "member", id: BOB },+ ]);+ });++ it("drops entries it cannot parse instead of rendering a broken avatar", () => {+ expect(actorFilterValues([`member:${ALICE}`, "garbage", `agent:${BOB}`])).toEqual([+ { type: "member", id: ALICE },+ ]);+ });++ it("returns nothing for an empty selection", () => {+ expect(actorFilterValues([])).toEqual([]);+ });+});++describe("hasActorPropertyFilterSelection", () => {+ const properties = [+ { id: "p-actor", type: "actor" },+ { id: "p-multi", type: "multi_actor" },+ { id: "p-select", type: "select" },+ ];++ // The regression Elon flagged: without this the member directory never+ // loads, so a "Reviewer = Bohan" chip can only show a bare count.+ it("is true when an actor property is filtered", () => {+ expect(+ hasActorPropertyFilterSelection({ "p-actor": [`member:${ALICE}`] }, properties),+ ).toBe(true);+ expect(+ hasActorPropertyFilterSelection({ "p-multi": [`member:${ALICE}`] }, properties),+ ).toBe(true);+ });++ it("is false for non-actor property filters", () => {+ expect(hasActorPropertyFilterSelection({ "p-select": ["opt-1"] }, properties)).toBe(+ false,+ );+ });++ it("ignores an actor property whose selection is empty", () => {+ expect(hasActorPropertyFilterSelection({ "p-actor": [] }, properties)).toBe(false);+ });++ it("is false while the property catalog is still loading", () => {+ // The catalog query resolves after this runs on first render; the member+ // query simply enables on the next pass rather than throwing.+ expect(hasActorPropertyFilterSelection({ "p-actor": [`member:${ALICE}`] }, [])).toBe(+ false,+ );+ });+});++describe("buildChipActorNames", () => {+ const members = [{ id: "membership-row-1", user_id: ALICE, name: "Alice" }];+ const agents = [{ id: "agent-1", name: "CodeBot" }];+ const squads = [{ id: "squad-1", name: "Platform" }];++ // The pre-existing bug this locks: filters carry user_id, but the lookup+ // was keyed by the membership row id, so member names never resolved — in+ // the assignee and creator chips either, not just the new actor one.+ it("resolves a member by user_id", () => {+ const lookup = buildChipActorNames(members, agents, squads);+ expect(lookup({ type: "member", id: ALICE })).toBe("Alice");+ });++ it("does not resolve a member by its membership row id", () => {+ const lookup = buildChipActorNames(members, agents, squads);+ expect(lookup({ type: "member", id: "membership-row-1" })).toBeUndefined();+ });++ it("resolves agents and squads by their own id", () => {+ const lookup = buildChipActorNames(members, agents, squads);+ expect(lookup({ type: "agent", id: "agent-1" })).toBe("CodeBot");+ expect(lookup({ type: "squad", id: "squad-1" })).toBe("Platform");+ });++ it("returns undefined for an unknown actor so the chip can omit it", () => {+ const lookup = buildChipActorNames(members, agents, squads);+ expect(lookup({ type: "member", id: BOB })).toBeUndefined();+ });+});diff --git a/packages/views/issues/components/filter-chips-bar.tsx b/packages/views/issues/components/filter-chips-bar.tsxindex f52a0160e8..bb95a34f53 100644--- a/packages/views/issues/components/filter-chips-bar.tsx+++ b/packages/views/issues/components/filter-chips-bar.tsx@@ -18,6 +18,7 @@ import { memberListOptions, agentListOptions, squadListOptions } from "@multica/import { projectListOptions } from "@multica/core/projects/queries";import { labelListOptions } from "@multica/core/labels/queries";import { propertyListOptions } from "@multica/core/properties";+import { isActorPropertyType, parseActorRef } from "@multica/core/types";import {type ActorFilterValue,type FilterDimension,@@ -73,6 +74,59 @@ function IconStack({ children }: { children: ReactNode[] }) {);}+/**+ * Name lookup for chip values, keyed the way filters actually store actors.+ *+ * Members are keyed by `user_id`, NOT by the membership row id: every actor+ * filter value — assignee, creator, and actor properties — carries the user+ * id. Keying by `Member.id` silently resolved nothing (MUL-6286 review).+ *+ * Returns undefined for anything unresolved so the caller can omit it, rather+ * than rendering a placeholder like "Unknown".+ */+export function buildChipActorNames(+ members: readonly { user_id: string; name: string }[],+ agents: readonly { id: string; name: string }[],+ squads: readonly { id: string; name: string }[],+): (actor: ActorFilterValue) => string | undefined {+ const byKey = new Map<string, string>();+ for (const m of members) byKey.set(`member:${m.user_id}`, m.name);+ for (const a of agents) byKey.set(`agent:${a.id}`, a.name);+ for (const s of squads) byKey.set(`squad:${s.id}`, s.name);+ return (actor: ActorFilterValue) => byKey.get(`${actor.type}:${actor.id}`);+}++/**+ * Actor-property filter values ("member:<uuid>") as actor refs, for the avatar+ * stack. Unparseable entries drop out — the chip degrades to fewer avatars+ * rather than rendering a broken one.+ */+export function actorFilterValues(selected: string[]): ActorFilterValue[] {+ return selected+ .map((value) => parseActorRef(value))+ .filter((ref): ref is NonNullable<ReturnType<typeof parseActorRef>> => ref !== null)+ .map((ref) => ({ type: ref.kind, id: ref.id }));+}++/**+ * Whether any active property filter targets an actor-typed definition.+ *+ * The chips bar loads each directory lazily, and actor properties are the one+ * property type whose chip needs the member directory to say anything useful:+ * their values are references, not config options, so without this the chip+ * can only render a bare count (MUL-6286 review).+ */+export function hasActorPropertyFilterSelection(+ propertyFilters: Record<string, string[]>,+ properties: { id: string; type: string }[],+): boolean {+ return Object.entries(propertyFilters).some(+ ([propertyId, selected]) =>+ selected.length > 0 &&+ isActorPropertyType(properties.find((p) => p.id === propertyId)?.type ?? ""),+ );+}+/** Avatar variant of the stack — avatars are already opaque, so they only* need the background-colored separation ring. */function AvatarStack({ actors }: { actors: ActorFilterValue[] }) {@@ -149,9 +203,22 @@ function useFilterChips(const showDateChip = !!onDateFilterChange && !!dateFilter;const enabled = hasStoreFilters;+ const { data: workspaceProperties = [] } = useQuery({+ ...propertyListOptions(wsId),+ enabled: enabled && Object.keys(propertyFilters).length > 0,+ });+ // An active actor-property filter needs the member directory too, or its+ // chip can only render a bare count instead of who was filtered on. The+ // catalog resolves first, so this flips true on its second render.+ const hasActorPropertyFilter = useMemo(+ () => hasActorPropertyFilterSelection(propertyFilters, workspaceProperties),+ [propertyFilters, workspaceProperties],+ );const { data: members = [] } = useQuery({...memberListOptions(wsId),- enabled: enabled && (assigneeFilters.length > 0 || creatorFilters.length > 0),+ enabled:+ enabled &&+ (assigneeFilters.length > 0 || creatorFilters.length > 0 || hasActorPropertyFilter),});const { data: agents = [] } = useQuery({...agentListOptions(wsId),@@ -169,18 +236,10 @@ function useFilterChips(...labelListOptions(wsId),enabled: enabled && labelFilters.length > 0,});- const { data: workspaceProperties = [] } = useQuery({- ...propertyListOptions(wsId),- enabled: enabled && Object.keys(propertyFilters).length > 0,- });-- const actorName = useMemo(() => {- const byKey = new Map<string, string>();- for (const m of members) byKey.set(`member:${m.id}`, m.name);- for (const a of agents) byKey.set(`agent:${a.id}`, a.name);- for (const s of squads) byKey.set(`squad:${s.id}`, s.name);- return (actor: ActorFilterValue) => byKey.get(`${actor.type}:${actor.id}`);- }, [members, agents, squads]);+ const actorName = useMemo(+ () => buildChipActorNames(members, agents, squads),+ [members, agents, squads],+ );// Inside a saved view chips show only the user's additions ON TOP of the// view; removing one returns the dimension to the view's values (never@@ -383,7 +442,15 @@ function useFilterChips(// A stale filter on an archived definition is stripped by the surface// controller before querying; hide its chip rather than render a ghost.if (!definition) continue;+ // Actor properties carry no config options — their values are member+ // references, so names come from the directory and the icons are avatars.+ const actorProperty = isActorPropertyType(definition.type);+ const actorValues = actorProperty ? actorFilterValues(selected) : [];const optionName = (optionId: string): string | undefined => {+ if (actorProperty) {+ const ref = parseActorRef(optionId);+ return ref ? actorName({ type: ref.kind, id: ref.id }) : undefined;+ }if (definition.type === "checkbox") {return optionId === "true"? t(($) => $.pickers.custom_property.true_label)@@ -392,7 +459,7 @@ function useFilterChips(return definition.config.options?.find((o) => o.id === optionId)?.name;};const optionColors =- definition.type === "checkbox"+ definition.type === "checkbox" || actorProperty? []: selected.map((id) => definition.config.options?.find((o) => o.id === id)?.color)@@ -401,7 +468,11 @@ function useFilterChips(key: `property:${propertyId}`,icon: <Tag className={CHIP_ICON_CLASS} />,label: definition.name,- valueIcons: optionColors.length > 0 ? <DotStack colors={optionColors} /> : undefined,+ valueIcons: actorValues.length > 0 ? (+ <AvatarStack actors={actorValues} />+ ) : optionColors.length > 0 ? (+ <DotStack colors={optionColors} />+ ) : undefined,value: summarize(selected.map(optionName)),onRemove: () => clearDimension(`property:${propertyId}`),});diff --git a/packages/views/issues/components/issues-header.tsx b/packages/views/issues/components/issues-header.tsxindex 335d7e3cb1..835b6a3497 100644--- a/packages/views/issues/components/issues-header.tsx+++ b/packages/views/issues/components/issues-header.tsx@@ -75,6 +75,7 @@ import type {IssueTableFacetsResponse,WorkingAgentSummary,} from "@multica/core/types";+import { formatActorRef, isActorPropertyType } from "@multica/core/types";import { ProjectIcon } from "../../projects/components/project-icon";import { ActorAvatar } from "../../common/actor-avatar";import { PropertyIcon } from "../../common/property-icon";@@ -657,7 +658,10 @@ function LabelSubContent({/*** Option checkboxes for one custom property inside the Filter dropdown.* Select/multi_select list the definition's options (dot + name); checkbox- * definitions expose the "true"/"false" pseudo-options with Yes/No labels.+ * definitions expose the "true"/"false" pseudo-options with Yes/No labels;+ * actor definitions have no config options at all, so their candidates come+ * from the member directory instead, with the signed-in member first so+ * "this property is me" stays one click away.*/function PropertyFilterOptions({property,@@ -675,16 +679,50 @@ function PropertyFilterOptions({fixedTitle?: string;}) {const { t } = useT("issues");- const options =- property.type === "checkbox"+ const wsId = useWorkspaceId();+ const currentUserId = useAuthStore((s) => s.user?.id);+ const actorProperty = isActorPropertyType(property.type);+ const { data: actorMembers = [] } = useQuery({+ ...memberListOptions(wsId),+ enabled: actorProperty,+ });++ const actorOptions = useMemo(() => {+ if (!actorProperty) return [];+ return actorMembers+ .slice()+ .sort((a, b) => {+ if (a.user_id === currentUserId) return -1;+ if (b.user_id === currentUserId) return 1;+ return 0;+ })+ .map((m) => ({+ id: formatActorRef("member", m.user_id),+ name: m.name,+ actorType: "member" as const,+ actorId: m.user_id,+ }));+ }, [actorProperty, actorMembers, currentUserId]);++ const options = actorProperty+ ? actorOptions.map((option) => ({+ id: option.id,+ name: option.name,+ color: undefined as string | undefined,+ actorType: option.actorType as string | undefined,+ actorId: option.actorId as string | undefined,+ }))+ : property.type === "checkbox"? [- { id: "true", name: t(($) => $.pickers.custom_property.true_label), color: undefined },- { id: "false", name: t(($) => $.pickers.custom_property.false_label), color: undefined },+ { id: "true", name: t(($) => $.pickers.custom_property.true_label), color: undefined, actorType: undefined, actorId: undefined },+ { id: "false", name: t(($) => $.pickers.custom_property.false_label), color: undefined, actorType: undefined, actorId: undefined },]: (property.config.options ?? []).map((option) => ({id: option.id,name: option.name,color: option.color as string | undefined,+ actorType: undefined as string | undefined,+ actorId: undefined as string | undefined,}));return (@@ -702,6 +740,9 @@ function PropertyFilterOptions({className={FILTER_ITEM_CLASS}><HoverCheck checked={checked} />+ {option.actorType && option.actorId && (+ <ActorAvatar actorType={option.actorType} actorId={option.actorId} size="sm" />+ )}{option.color && (<spanclassName="size-2.5 shrink-0 rounded-full"@@ -1174,8 +1215,12 @@ export function IssueFilterMenu({const { data: workspaceProperties = [] } = useQuery(propertyListOptions(wsId));const filterableProperties = useMemo(() =>- workspaceProperties.filter((p) =>- p.type === "select" || p.type === "multi_select" || p.type === "checkbox",+ workspaceProperties.filter(+ (p) =>+ p.type === "select" ||+ p.type === "multi_select" ||+ p.type === "checkbox" ||+ isActorPropertyType(p.type),),[workspaceProperties],);@@ -1597,8 +1642,12 @@ export function IssueDisplayControls({);const filterableProperties = useMemo(() =>- workspaceProperties.filter((p) =>- p.type === "select" || p.type === "multi_select" || p.type === "checkbox",+ workspaceProperties.filter(+ (p) =>+ p.type === "select" ||+ p.type === "multi_select" ||+ p.type === "checkbox" ||+ isActorPropertyType(p.type),),[workspaceProperties],);diff --git a/packages/views/issues/components/pickers/actor-property-picker.test.ts b/packages/views/issues/components/pickers/actor-property-picker.test.tsnew file mode 100644index 0000000000..7f92bd078c--- /dev/null+++ b/packages/views/issues/components/pickers/actor-property-picker.test.ts@@ -0,0 +1,53 @@+import { describe, it, expect } from "vitest";+import { MAX_ISSUE_PROPERTY_ACTOR_VALUES } from "@multica/core/types";+import { toggleActorRefValue } from "./actor-property-picker";++const A = "member:11111111-1111-4111-8111-111111111111";+const B = "member:22222222-2222-4222-8222-222222222222";+const C = "member:00000000-0000-4000-8000-000000000000";++describe("toggleActorRefValue", () => {+ it("appends in insertion order rather than sorted order", () => {+ // C sorts before A; a canonicalizing sort would reorder this result.+ expect(toggleActorRefValue([A], C)).toEqual([A, C]);+ });++ it("removes an already-selected reference", () => {+ expect(toggleActorRefValue([A, B, C], B)).toEqual([A, C]);+ });++ it("clears the property when the last reference is removed", () => {+ expect(toggleActorRefValue([A], A)).toBeUndefined();+ });++ it("refuses to grow past the server cap", () => {+ const full = Array.from(+ { length: MAX_ISSUE_PROPERTY_ACTOR_VALUES },+ (_, i) => `member:${String(i).padStart(8, "0")}-0000-4000-8000-000000000000`,+ );+ expect(toggleActorRefValue(full, A)).toBe(full);+ // Removal still works at capacity, otherwise the value would be stuck.+ expect(toggleActorRefValue(full, full[0]!)).toHaveLength(+ MAX_ISSUE_PROPERTY_ACTOR_VALUES - 1,+ );+ });++ // The regression Elon flagged: an installed client talking to a newer+ // backend must not silently delete reference kinds it cannot parse.+ describe("unknown kinds from a newer backend", () => {+ const AGENT = "agent:99999999-9999-4999-8999-999999999999";++ it("keeps an unknown kind when adding a member", () => {+ expect(toggleActorRefValue([AGENT], A)).toEqual([AGENT, A]);+ });++ it("keeps an unknown kind when removing a member", () => {+ expect(toggleActorRefValue([A, AGENT, B], A)).toEqual([AGENT, B]);+ });++ it("does not clear the property when the last KNOWN kind is removed", () => {+ // Returning undefined here would wipe the agent reference too.+ expect(toggleActorRefValue([A, AGENT], A)).toEqual([AGENT]);+ });+ });+});diff --git a/packages/views/issues/components/pickers/actor-property-picker.tsx b/packages/views/issues/components/pickers/actor-property-picker.tsxnew file mode 100644index 0000000000..bb117e51b0--- /dev/null+++ b/packages/views/issues/components/pickers/actor-property-picker.tsx@@ -0,0 +1,184 @@+"use client";++import { useState } from "react";+import { useQuery } from "@tanstack/react-query";+import type { IssueProperty, IssuePropertyValue } from "@multica/core/types";+import {+ actorRefsFromValue,+ actorRefValuesFromValue,+ formatActorRef,+ MAX_ISSUE_PROPERTY_ACTOR_VALUES,+} from "@multica/core/types";+import { memberListOptions } from "@multica/core/workspace/queries";+import { useActorName } from "@multica/core/workspace/hooks";+import { useWorkspaceId } from "@multica/core/hooks";+import { ActorAvatar } from "../../../common/actor-avatar";+import { useT } from "../../../i18n";+import { matchesPinyin } from "../../../editor/extensions/pinyin-match";+import { PropertyPicker, PickerItem, PickerSection, PickerEmpty } from "./property-picker";++/**+ * Toggles one reference inside a `multi_actor` value and returns the next+ * value (`undefined` clears the property).+ *+ * Two properties this must hold, both load-bearing:+ *+ * 1. `current` is the RAW stored list, so entries whose kind this build does+ * not understand pass through untouched. An installed desktop client+ * talking to a newer backend must not delete them just because the user+ * ticked a member.+ * 2. Insertion order survives. The server does not canonicalize actor lists+ * (unlike multi_select), so the order here is the order that persists.+ */+export function toggleActorRefValue(current: string[], key: string): string[] | undefined {+ if (current.includes(key)) {+ const next = current.filter((existing) => existing !== key);+ return next.length === 0 ? undefined : next;+ }+ if (current.length >= MAX_ISSUE_PROPERTY_ACTOR_VALUES) return current;+ return [...current, key];+}++/**+ * Value editor for `actor` / `multi_actor` custom properties (MUL-6286).+ *+ * Shaped like AssigneePicker's members section — same rows, same avatars — but+ * members are the only kind an actor property accepts. Agents and squads are+ * assignable but not referenceable: an agent would need the picker to answer+ * visibility and invoke-permission questions that a passive reference has no+ * business asking, and a squad is a routing target rather than a person.+ *+ * `multi_actor` toggles in place and keeps the popover open (mirroring+ * multi_select); `actor` commits and closes.+ */+export function ActorPropertyPicker({+ property,+ value,+ onChange,+ open,+ onOpenChange,+ trigger,+ triggerRender,+ emptyRow,+}: {+ property: IssueProperty;+ value: IssuePropertyValue | undefined;+ onChange: (value: IssuePropertyValue | undefined) => void;+ open: boolean;+ onOpenChange: (open: boolean) => void;+ trigger: React.ReactNode;+ triggerRender?: React.ReactElement<Record<string, unknown>>;+ emptyRow: React.ReactNode;+}) {+ const { t } = useT("issues");+ const [filter, setFilter] = useState("");+ const wsId = useWorkspaceId();+ const { data: members = [] } = useQuery(memberListOptions(wsId));++ const multiple = property.type === "multi_actor";+ // Raw strings, not parsed refs: a kind this build doesn't recognise (a newer+ // backend widening actorPropertyKinds) has to survive an edit here instead+ // of being silently dropped when the user toggles a member.+ const selectedRaw = actorRefValuesFromValue(value);+ const selectedKeys = new Set(selectedRaw);+ const atCapacity = multiple && selectedRaw.length >= MAX_ISSUE_PROPERTY_ACTOR_VALUES;++ const query = filter.trim().toLowerCase();+ const matches = (name: string) => name.toLowerCase().includes(query) || matchesPinyin(name, query);+ const filteredMembers = members.filter((m) => matches(m.name));++ const commit = (kind: "member", id: string) => {+ const key = formatActorRef(kind, id);+ if (!multiple) {+ onChange(key);+ onOpenChange(false);+ return;+ }+ onChange(toggleActorRefValue(selectedRaw, key));+ };++ const rowsEmpty = filteredMembers.length === 0;++ return (+ <PropertyPicker+ open={open}+ onOpenChange={(next: boolean) => {+ onOpenChange(next);+ if (!next) setFilter("");+ }}+ width="w-64"+ align="start"+ searchable+ searchPlaceholder={t(($) => $.pickers.custom_property.actor_search_placeholder)}+ onSearchChange={setFilter}+ trigger={trigger}+ triggerRender={triggerRender}+ >+ {emptyRow}++ {filteredMembers.length > 0 && (+ <PickerSection label={t(($) => $.pickers.assignee.members_group)}>+ {filteredMembers.map((m) => {+ const key = formatActorRef("member", m.user_id);+ const isSelected = selectedKeys.has(key);+ return (+ <PickerItem+ key={m.user_id}+ selected={isSelected}+ disabled={atCapacity && !isSelected}+ onClick={() => commit("member", m.user_id)}+ >+ <ActorAvatar actorType="member" actorId={m.user_id} size="sm" />+ <span className="truncate">{m.name}</span>+ </PickerItem>+ );+ })}+ </PickerSection>+ )}++ {rowsEmpty && <PickerEmpty />}+ </PropertyPicker>+ );+}++/**+ * Read-only rendering of an actor property value: avatar + name per reference.+ *+ * A value holding only references this build cannot parse renders as+ * "unavailable", NOT as empty — showing it as empty would invite the user to+ * "fill in" a field that already has a value they cannot see.+ */+export function ActorPropertyDisplay({+ value,+ emptyLabel,+}: {+ value: IssuePropertyValue | undefined;+ emptyLabel: React.ReactNode;+}) {+ const { t } = useT("issues");+ const { getActorName } = useActorName();+ const refs = actorRefsFromValue(value);+ if (refs.length === 0) {+ if (actorRefValuesFromValue(value).length > 0) {+ return (+ <span className="text-muted-foreground">+ {t(($) => $.pickers.custom_property.unknown_value)}+ </span>+ );+ }+ return <>{emptyLabel}</>;+ }+ return (+ <span className="flex min-w-0 flex-wrap items-center gap-1">+ {refs.map((ref) => (+ <span+ key={formatActorRef(ref.kind, ref.id)}+ className="inline-flex max-w-32 items-center gap-1"+ >+ <ActorAvatar actorType={ref.kind} actorId={ref.id} size="sm" />+ <span className="truncate">{getActorName(ref.kind, ref.id)}</span>+ </span>+ ))}+ </span>+ );+}diff --git a/packages/views/issues/components/pickers/custom-property-picker.test.ts b/packages/views/issues/components/pickers/custom-property-picker.test.tsnew file mode 100644index 0000000000..c224848b19--- /dev/null+++ b/packages/views/issues/components/pickers/custom-property-picker.test.ts@@ -0,0 +1,52 @@+import { describe, it, expect } from "vitest";+import type { IssueProperty } from "@multica/core/types";+import { isCustomPropertyReadOnly } from "./custom-property-picker";++const MEMBER = "member:11111111-1111-4111-8111-111111111111";+const AGENT = "agent:99999999-9999-4999-8999-999999999999";++function property(overrides: Partial<IssueProperty>): IssueProperty {+ return {+ id: "p-1",+ workspace_id: "ws-1",+ name: "Reviewer",+ type: "actor",+ config: {},+ position: 1,+ archived: false,+ created_at: "2026-08-17T00:00:00Z",+ updated_at: "2026-08-17T00:00:00Z",+ ...overrides,+ };+}++describe("isCustomPropertyReadOnly", () => {+ it("allows editing a normal actor value", () => {+ expect(isCustomPropertyReadOnly(property({}), MEMBER)).toBe(false);+ expect(isCustomPropertyReadOnly(property({}), undefined)).toBe(false);+ });++ it("locks an archived definition", () => {+ expect(isCustomPropertyReadOnly(property({ archived: true }), MEMBER)).toBe(true);+ });++ it("locks a type newer than this build", () => {+ expect(isCustomPropertyReadOnly(property({ type: "relation" }), "whatever")).toBe(true);+ });++ // The regression Elon flagged in round two: a single actor value referencing+ // a kind this build cannot parse renders as empty. If it stayed editable the+ // user would "fill in an empty field" and overwrite a value never shown to+ // them — a silent delete.+ it("locks a single actor value whose kind it cannot parse", () => {+ expect(isCustomPropertyReadOnly(property({}), AGENT)).toBe(true);+ });++ // multi_actor is exempt: its toggle round-trips unknown entries instead of+ // replacing the whole value, so editing stays safe and stays available.+ it("keeps multi_actor editable even with an unknown kind present", () => {+ const multi = property({ type: "multi_actor" });+ expect(isCustomPropertyReadOnly(multi, [MEMBER, AGENT])).toBe(false);+ expect(isCustomPropertyReadOnly(multi, [AGENT])).toBe(false);+ });+});diff --git a/packages/views/issues/components/pickers/custom-property-picker.tsx b/packages/views/issues/components/pickers/custom-property-picker.tsxindex 3b9f7f01bc..d3c3178f17 100644--- a/packages/views/issues/components/pickers/custom-property-picker.tsx+++ b/packages/views/issues/components/pickers/custom-property-picker.tsx@@ -4,6 +4,7 @@ import { useEffect, useState } from "react";import { CalendarDays, Check, ExternalLink } from "lucide-react";import { toast } from "sonner";import type { Issue, IssueProperty, IssuePropertyValue } from "@multica/core/types";+import { hasUnknownActorRef } from "@multica/core/types";import {useSetIssueProperty,useUnsetIssueProperty,@@ -23,6 +24,41 @@ import { Button } from "@multica/ui/components/ui/button";import { Input } from "@multica/ui/components/ui/input";import { useT } from "../../../i18n";import { PropertyPicker, PickerItem } from "./property-picker";+import { ActorPropertyPicker, ActorPropertyDisplay } from "./actor-property-picker";++const EDITABLE_PROPERTY_TYPES = [+ "select",+ "multi_select",+ "date",+ "checkbox",+ "text",+ "number",+ "url",+ "actor",+ "multi_actor",+];++/**+ * Whether the editor must degrade to read-only (Clear is still offered, so a+ * stale value can always be cleaned up). Three reasons:+ *+ * 1. The definition is archived.+ * 2. The definition's type is newer than this build.+ * 3. A single `actor` value references a kind this build cannot parse. It+ * would otherwise render as empty and the user, believing the field is+ * unset, would overwrite a value they were never shown. `multi_actor` is+ * exempt: its toggle round-trips unknown entries instead of replacing the+ * whole value (MUL-6286 review).+ */+export function isCustomPropertyReadOnly(+ property: IssueProperty,+ value: IssuePropertyValue | undefined,+): boolean {+ if (property.archived) return true;+ if (!EDITABLE_PROPERTY_TYPES.includes(property.type)) return true;+ if (property.type === "actor" && hasUnknownActorRef(value)) return true;+ return false;+}/*** Value editor for one custom property on one issue. The editor shape@@ -32,6 +68,8 @@ import { PropertyPicker, PickerItem } from "./property-picker";* multi_select → PropertyPicker with toggling items (stays open)* date → Calendar popover (mirrors DueDatePicker)* checkbox → Yes / No picker+ * actor → member picker (commits and closes)+ * multi_actor → member picker with toggling items (stays open)* text/number/url → popover with an input, Enter commits** Archived definitions render read-only: the popover only offers Clear@@ -139,13 +177,7 @@ export function CustomPropertyValueInput({</PickerItem>);- // Archived (or unknown-type) definitions: read-only display; the only- // offered action is Clear so stale values can still be cleaned up.- const readOnly =- property.archived ||- !["select", "multi_select", "date", "checkbox", "text", "number", "url"].includes(- property.type,- );+ const readOnly = isCustomPropertyReadOnly(property, value);if (readOnly) {return (@@ -158,7 +190,9 @@ export function CustomPropertyValueInput({>{emptyRow}<p className="px-2 py-1.5 text-caption text-muted-foreground">- {t(($) => $.pickers.custom_property.archived_hint)}+ {property.archived+ ? t(($) => $.pickers.custom_property.archived_hint)+ : t(($) => $.pickers.custom_property.unknown_value_hint)}</p></PropertyPicker>);@@ -226,6 +260,20 @@ export function CustomPropertyValueInput({</PropertyPicker>);}+ case "actor":+ case "multi_actor":+ return (+ <ActorPropertyPicker+ property={property}+ value={value}+ onChange={onChange}+ open={open}+ onOpenChange={setOpen}+ trigger={valueTrigger}+ triggerRender={triggerRender}+ emptyRow={emptyRow}+ />+ );case "date": {const date = typeof value === "string" ? dateOnlyToLocalDate(value) : undefined;return (@@ -474,6 +522,18 @@ export function CustomPropertyValueDisplay({</span>);}+ case "actor":+ case "multi_actor":+ return (+ <ActorPropertyDisplay+ value={value}+ emptyLabel={+ <span className="text-muted-foreground">+ {t(($) => $.pickers.custom_property.empty)}+ </span>+ }+ />+ );case "date":return (<span className="flex items-center gap-1.5">diff --git a/packages/views/issues/components/table-view.tsx b/packages/views/issues/components/table-view.tsxindex a608935394..d229ae3335 100644--- a/packages/views/issues/components/table-view.tsx+++ b/packages/views/issues/components/table-view.tsx@@ -106,6 +106,11 @@ import type {Project,UpdateIssueRequest,} from "@multica/core/types";+import {+ actorRefsFromValue,+ formatActorRef,+ isActorPropertyType,+} from "@multica/core/types";import {useInfiniteQuery,useQueries,@@ -883,6 +888,9 @@ export function IssueTableGroupRow({function propertyDisplayValue(property: IssueProperty,value: IssuePropertyValue | undefined,+ // Actor values are "<kind>:<uuid>" references; without a resolver they would+ // export as raw ids, so callers that can export an actor column must pass one.+ getActorName?: (type: string, id: string) => string,) {if (value === undefined) return "";const options = property.config.options ?? [];@@ -896,6 +904,11 @@ function propertyDisplayValue(.map((option) => option.name).join(", ");}+ if (isActorPropertyType(property.type)) {+ return actorRefsFromValue(value)+ .map((ref) => (getActorName ? getActorName(ref.kind, ref.id) : formatActorRef(ref.kind, ref.id)))+ .join(", ");+ }return String(value);}@@ -1043,7 +1056,8 @@ function IssueTableHeaderCell({const propertyId = propertyIdFromViewKey(key);const property = propertyId ? meta.propertyById.get(propertyId) : undefined;const staticSort = propertyId- ? property && !["multi_select", "checkbox"].includes(property.type)+ ? property &&+ !["multi_select", "checkbox", "actor", "multi_actor"].includes(property.type)? (`property:${propertyId}` as SortField): undefined: SORTABLE_COLUMNS[key as TableSystemColumnKey];@@ -2247,9 +2261,12 @@ export function TableView({const propertyId = propertyIdFromViewKey(column.key);return !propertyId || exportPropertyById.has(propertyId);});- const needsActors = csvColumns.some(- (column) => column.key === "assignee" || column.key === "creator",- );+ const needsActors = csvColumns.some((column) => {+ if (column.key === "assignee" || column.key === "creator") return true;+ const propertyId = propertyIdFromViewKey(column.key);+ const property = propertyId ? exportPropertyById.get(propertyId) : undefined;+ return property ? isActorPropertyType(property.type) : false;+ });const [rows, exportLookups, exportActorName] = await Promise.all([mode === "all" ? exportIssues() : Promise.resolve(selectedIssues),resolveExportLookups({@@ -2279,7 +2296,11 @@ export function TableView({if (propertyId) {const property = exportPropertyById.get(propertyId);return property- ? propertyDisplayValue(property, issue.properties[propertyId])+ ? propertyDisplayValue(+ property,+ issue.properties[propertyId],+ exportActorName,+ ): "";}switch (column.key) {diff --git a/packages/views/locales/en/issues.json b/packages/views/locales/en/issues.jsonindex cffd66c38c..d88f87017d 100644--- a/packages/views/locales/en/issues.json+++ b/packages/views/locales/en/issues.json@@ -647,8 +647,11 @@"value_placeholder": "Enter value…","url_placeholder": "https://…","number_placeholder": "0",+ "actor_search_placeholder": "Search members…","open_link": "Open link",- "archived_hint": "Archived property — value is read-only"+ "archived_hint": "Archived property — value is read-only",+ "unknown_value": "Unavailable",+ "unknown_value_hint": "This value was set by a newer version of Multica and can't be edited here — update the app, or clear it"},"filter_options_aria": "Filter options","no_results": "No results",diff --git a/packages/views/locales/en/settings.json b/packages/views/locales/en/settings.jsonindex 2761a33c6b..155bb57584 100644--- a/packages/views/locales/en/settings.json+++ b/packages/views/locales/en/settings.json@@ -364,7 +364,9 @@"multi_select": "Multi-select","date": "Date","checkbox": "Checkbox",- "url": "URL"+ "url": "URL",+ "actor": "Member",+ "multi_actor": "Members"},"actions": {"open": "Actions for {{name}}",diff --git a/packages/views/locales/ja/issues.json b/packages/views/locales/ja/issues.jsonindex 4c178487c5..77f08791f6 100644--- a/packages/views/locales/ja/issues.json+++ b/packages/views/locales/ja/issues.json@@ -617,8 +617,11 @@"value_placeholder": "値を入力…","url_placeholder": "https://…","number_placeholder": "0",+ "actor_search_placeholder": "メンバーを検索…","open_link": "リンクを開く",- "archived_hint": "アーカイブ済みプロパティ — 値は読み取り専用です"+ "archived_hint": "アーカイブ済みプロパティ — 値は読み取り専用です",+ "unknown_value": "表示できません",+ "unknown_value_hint": "この値は新しいバージョンの Multica で設定されており、ここでは編集できません。アプリを更新するか、値をクリアしてください"},"filter_options_aria": "フィルターオプション","no_results": "結果なし",diff --git a/packages/views/locales/ja/settings.json b/packages/views/locales/ja/settings.jsonindex 174c3dabee..be0582365a 100644--- a/packages/views/locales/ja/settings.json+++ b/packages/views/locales/ja/settings.json@@ -363,7 +363,9 @@"multi_select": "複数選択","date": "日付","checkbox": "チェックボックス",- "url": "URL"+ "url": "URL",+ "actor": "メンバー",+ "multi_actor": "メンバー(複数選択)"},"actions": {"open": "{{name}} の操作",diff --git a/packages/views/locales/ko/issues.json b/packages/views/locales/ko/issues.jsonindex 6f6276fcbd..0ae914eb1e 100644--- a/packages/views/locales/ko/issues.json+++ b/packages/views/locales/ko/issues.json@@ -617,8 +617,11 @@"value_placeholder": "값 입력…","url_placeholder": "https://…","number_placeholder": "0",+ "actor_search_placeholder": "멤버 검색…","open_link": "링크 열기",- "archived_hint": "보관된 속성 — 값은 읽기 전용입니다"+ "archived_hint": "보관된 속성 — 값은 읽기 전용입니다",+ "unknown_value": "표시할 수 없음",+ "unknown_value_hint": "이 값은 최신 버전의 Multica에서 설정되어 여기서는 편집할 수 없습니다. 앱을 업데이트하거나 값을 지우세요"},"filter_options_aria": "필터 옵션","no_results": "결과 없음",diff --git a/packages/views/locales/ko/settings.json b/packages/views/locales/ko/settings.jsonindex 7927a44600..7114813a41 100644--- a/packages/views/locales/ko/settings.json+++ b/packages/views/locales/ko/settings.json@@ -363,7 +363,9 @@"multi_select": "다중 선택","date": "날짜","checkbox": "체크박스",- "url": "URL"+ "url": "URL",+ "actor": "멤버",+ "multi_actor": "멤버(다중 선택)"},"actions": {"open": "{{name}} 작업",diff --git a/packages/views/locales/zh-Hans/issues.json b/packages/views/locales/zh-Hans/issues.jsonindex 5b8210299b..2b0bfa596b 100644--- a/packages/views/locales/zh-Hans/issues.json+++ b/packages/views/locales/zh-Hans/issues.json@@ -616,8 +616,11 @@"value_placeholder": "输入值…","url_placeholder": "https://…","number_placeholder": "0",+ "actor_search_placeholder": "搜索成员…","open_link": "打开链接","archived_hint": "已归档属性——值为只读",+ "unknown_value": "无法显示",+ "unknown_value_hint": "该值由更新版本的 Multica 设置,当前版本无法编辑——请更新应用,或清除该值","none": "无值"},"filter_options_aria": "筛选选项",diff --git a/packages/views/locales/zh-Hans/settings.json b/packages/views/locales/zh-Hans/settings.jsonindex 35aae7842b..78b3373ef2 100644--- a/packages/views/locales/zh-Hans/settings.json+++ b/packages/views/locales/zh-Hans/settings.json@@ -363,7 +363,9 @@"multi_select": "多选","date": "日期","checkbox": "勾选",- "url": "链接"+ "url": "链接",+ "actor": "成员",+ "multi_actor": "成员(多选)"},"actions": {"open": "{{name}} 的操作",diff --git a/packages/views/settings/components/properties-tab.tsx b/packages/views/settings/components/properties-tab.tsxindex 6e1eafab93..3fccfed486 100644--- a/packages/views/settings/components/properties-tab.tsx+++ b/packages/views/settings/components/properties-tab.tsx@@ -346,6 +346,10 @@ export function PropertyTypeLabel({ type }: { type: string }) {return <>{t(($) => $.properties.types.checkbox)}</>;case "url":return <>{t(($) => $.properties.types.url)}</>;+ case "actor":+ return <>{t(($) => $.properties.types.actor)}</>;+ case "multi_actor":+ return <>{t(($) => $.properties.types.multi_actor)}</>;default:// Forward compat: newer servers may ship types this build doesn't know.return <>{type}</>;diff --git a/server/cmd/multica/cmd_issue.go b/server/cmd/multica/cmd_issue.goindex f64531ba48..1fc9465778 100644--- a/server/cmd/multica/cmd_issue.go+++ b/server/cmd/multica/cmd_issue.go@@ -2546,6 +2546,8 @@ type assigneeKinds struct {var (issueAssigneeKinds = assigneeKinds{member: true, agent: true, squad: true}memberOrAgentKinds = assigneeKinds{member: true, agent: true}+ // Actor property values are members only (MUL-6286).+ memberOnlyKinds = assigneeKinds{member: true})var assigneeResolveRetrySleep = func(ctx context.Context, d time.Duration) bool {@@ -2623,12 +2625,22 @@ func resolveAssignee(ctx context.Context, client *cli.APIClient, name string, kivar errs []errorvar fetchAttempts int- classify := func(entityType, id, displayName string) {+ // exactAliases are additional unique identifiers that select a candidate+ // outright, ranked with id matches rather than name matches — a member's+ // email is as unambiguous as their id, and is what people actually have to+ // hand. Without it, `--value [email protected]` fails to resolve.+ classify := func(entityType, id, displayName string, exactAliases ...string) {match := assigneeMatch{Type: entityType, ID: id, Name: displayName}if id != "" && (strings.EqualFold(id, input) || strings.EqualFold(truncateID(id), input)) {idMatches = append(idMatches, match)return}+ for _, alias := range exactAliases {+ if alias != "" && strings.EqualFold(alias, input) {+ idMatches = append(idMatches, match)+ return+ }+ }if strings.EqualFold(displayName, input) {exactMatches = append(exactMatches, match)return@@ -2646,7 +2658,7 @@ func resolveAssignee(ctx context.Context, client *cli.APIClient, name string, kierrs = append(errs, fmt.Errorf("fetch members: %w", err))} else {for _, m := range members {- classify("member", strVal(m, "user_id"), strVal(m, "name"))+ classify("member", strVal(m, "user_id"), strVal(m, "name"), strVal(m, "email"))}}}diff --git a/server/cmd/multica/cmd_issue_test.go b/server/cmd/multica/cmd_issue_test.goindex 9c3d5805d9..a1582a2cc4 100644--- a/server/cmd/multica/cmd_issue_test.go+++ b/server/cmd/multica/cmd_issue_test.go@@ -1166,11 +1166,14 @@ func TestRunIssueRunMessagesResolvesShortTaskPrefix(t *testing.T) {func TestResolveAssignee(t *testing.T) {membersResp := []map[string]any{- {"user_id": "user-1111", "name": "Alice Smith"},- {"user_id": "user-2222", "name": "Bob Jones"},+ {"user_id": "user-1111", "name": "Alice Smith", "email": "[email protected]"},+ {"user_id": "user-2222", "name": "Bob Jones", "email": "[email protected]"},}agentsResp := []map[string]any{{"id": "agent-3333", "name": "CodeBot"},+ // Deliberate collision: this agent's NAME contains Alice's email, so+ // the substring path would match it. Email must still win outright.+ {"id": "agent-5555", "name": "Mailer for [email protected]"},}squadsResp := []map[string]any{{"id": "squad-4444", "name": "Super Human"},@@ -1213,6 +1216,58 @@ func TestResolveAssignee(t *testing.T) {}})+ // MUL-6286: the CLI documents member email as a way to address an actor+ // property value ("--value [email protected]"), so email has to resolve.+ t.Run("match member by email", func(t *testing.T) {+ aType, aID, err := resolveAssignee(ctx, client, "[email protected]", memberOnlyKinds)+ if err != nil {+ t.Fatalf("unexpected error: %v", err)+ }+ if aType != "member" || aID != "user-1111" {+ t.Errorf("got (%q, %q), want (member, user-1111)", aType, aID)+ }+ })++ t.Run("match member by email case-insensitively", func(t *testing.T) {+ aType, aID, err := resolveAssignee(ctx, client, "[email protected]", issueAssigneeKinds)+ if err != nil {+ t.Fatalf("unexpected error: %v", err)+ }+ if aType != "member" || aID != "user-2222" {+ t.Errorf("got (%q, %q), want (member, user-2222)", aType, aID)+ }+ })++ // An email beats a substring collision on someone else's name, because it+ // is ranked with id matches rather than with name matches. agentsResp+ // carries an agent whose name embeds this exact email, so without the+ // ranking this resolves to that agent (or errors as ambiguous).+ t.Run("email outranks a name substring match", func(t *testing.T) {+ aType, aID, err := resolveAssignee(ctx, client, "[email protected]", issueAssigneeKinds)+ if err != nil {+ t.Fatalf("unexpected error: %v", err)+ }+ if aType != "member" || aID != "user-1111" {+ t.Errorf("got (%q, %q), want (member, user-1111)", aType, aID)+ }+ })++ t.Run("resolveActorPropertyRef renders a prefixed reference", func(t *testing.T) {+ ref, err := resolveActorPropertyRef(ctx, client, "[email protected]")+ if err != nil {+ t.Fatalf("unexpected error: %v", err)+ }+ if ref != "member:user-1111" {+ t.Errorf("got %q, want member:user-1111", ref)+ }+ })++ t.Run("resolveActorPropertyRef rejects a non-member kind", func(t *testing.T) {+ if _, err := resolveActorPropertyRef(ctx, client, "codebot"); err == nil {+ t.Error("expected an agent name to be unresolvable for an actor property")+ }+ })+t.Run("match agent", func(t *testing.T) {aType, aID, err := resolveAssignee(ctx, client, "codebot", issueAssigneeKinds)if err != nil {diff --git a/server/cmd/multica/cmd_property.go b/server/cmd/multica/cmd_property.goindex 7cd5759b9d..8650f85d7a 100644--- a/server/cmd/multica/cmd_property.go+++ b/server/cmd/multica/cmd_property.go@@ -8,6 +8,7 @@ import ("strconv""strings"+ "github.com/google/uuid""github.com/spf13/cobra""github.com/multica-ai/multica/server/internal/cli"@@ -16,13 +17,13 @@ import (// multica property {list|get|create|update|archive|unarchive} — workspace// custom property definitions, and multica issue property {list|set|unset} —// typed values on a single issue. See server/internal/handler/property.go-// for the validation contract (7 types, 20 active definitions/workspace,+// for the validation contract (9 types, 20 active definitions/workspace,// owner/admin-only definition management, agents rejected on definition// writes).//-// CLI ergonomics: properties and select options are addressed BY NAME-// (case-insensitive); the CLI translates names to the UUIDs the API expects,-// so agents never have to juggle option ids.+// CLI ergonomics: properties, select options and actor values are addressed BY+// NAME (case-insensitive); the CLI translates names to the UUIDs the API+// expects, so agents never have to juggle option ids or actor references.type propertyOptionDTO struct {ID string `json:"id"`@@ -69,10 +70,14 @@ var propertyCreateCmd = &cobra.Command{Use: "create",Short: "Create a property definition (workspace owner/admin only)",Long: `Create a property definition. Types: text, number, select, multi_select,-date, checkbox, url. Select types take repeatable --option flags:+date, checkbox, url, actor, multi_actor. Select types take repeatable --option+flags:multica property create --name Severity --type select \--option "Critical:#ef4444" --option "Major:#f59e0b" --option "Minor:#6b7280"-The ":#rrggbb" color suffix is optional.`,+The ":#rrggbb" color suffix is optional.++The actor types hold workspace members; they take no options:+ multica property create --name Reviewer --type actor`,Args: exactArgs(0),RunE: runPropertyCreate,}@@ -119,6 +124,8 @@ var issuePropertySetCmd = &cobra.Command{(case-insensitive) or UUID. Value forms by type:select --value Staging (option name or id)multi_select --value "iOS,Android" (comma-separated option names or ids)+ actor --value Bohan (member name, email, or id)+ multi_actor --value "Bohan,Jiayuan" (comma-separated members)checkbox --value true|falsenumber --value 3.5date --value 2026-07-13@@ -147,7 +154,7 @@ func init() {propertyGetCmd.Flags().String("output", "json", "Output format: table or json")propertyCreateCmd.Flags().String("output", "table", "Output format: table or json")propertyCreateCmd.Flags().String("name", "", "Property name (required)")- propertyCreateCmd.Flags().String("type", "", "Property type: text, number, select, multi_select, date, checkbox, url (required)")+ propertyCreateCmd.Flags().String("type", "", "Property type: text, number, select, multi_select, date, checkbox, url, actor, multi_actor (required)")propertyCreateCmd.Flags().String("description", "", "Property description")propertyCreateCmd.Flags().String("icon", "", "Property icon key from the Web picker (for example, flag, tag, or shield)")propertyCreateCmd.Flags().StringArray("option", nil, `Select option as "Name" or "Name:#rrggbb" (repeatable; select types only)`)@@ -433,9 +440,32 @@ func makePropertyArchiveRun(archive bool) func(*cobra.Command, []string) error {// issue property {list|set|unset}// ---------------------------------------------------------------------------+// resolveActorPropertyRef turns one --value token into a "member:<uuid>"+// actor reference. An already-prefixed token is taken as-is (after checking+// the id parses); anything else goes through the same member lookup+// `--assignee` uses, so names, emails, UUIDs and short ids all work.+func resolveActorPropertyRef(ctx context.Context, client *cli.APIClient, raw string) (string, error) {+ token := strings.TrimSpace(raw)+ if token == "" {+ return "", fmt.Errorf("actor value cannot be empty")+ }+ if kind, id, found := strings.Cut(token, ":"); found && kind == "member" {+ if _, err := uuid.Parse(strings.TrimSpace(id)); err != nil {+ return "", fmt.Errorf("actor id in %q must be a UUID", token)+ }+ return kind + ":" + strings.TrimSpace(id), nil+ }+ actorType, actorID, err := resolveAssignee(ctx, client, token, memberOnlyKinds)+ if err != nil {+ return "", err+ }+ return actorType + ":" + actorID, nil+}+// encodeIssuePropertyValue converts the CLI --value string into the typed-// JSON the API expects, translating option names to ids for select types.-func encodeIssuePropertyValue(property propertyDTO, raw string) (json.RawMessage, error) {+// JSON the API expects, translating option names to ids for select types and+// member names to actor references for actor types.+func encodeIssuePropertyValue(ctx context.Context, client *cli.APIClient, property propertyDTO, raw string) (json.RawMessage, error) {optionNames := make([]string, len(property.Config.Options))for i, opt := range property.Config.Options {optionNames[i] = opt.Name@@ -474,6 +504,29 @@ func encodeIssuePropertyValue(property propertyDTO, raw string) (json.RawMessagereturn nil, fmt.Errorf("--value must list at least one option; valid options: %s", strings.Join(optionNames, ", "))}return json.Marshal(ids)+ case "actor":+ ref, err := resolveActorPropertyRef(ctx, client, raw)+ if err != nil {+ return nil, err+ }+ return json.Marshal(ref)+ case "multi_actor":+ parts := strings.Split(raw, ",")+ refs := make([]string, 0, len(parts))+ for _, part := range parts {+ if strings.TrimSpace(part) == "" {+ continue+ }+ ref, err := resolveActorPropertyRef(ctx, client, part)+ if err != nil {+ return nil, err+ }+ refs = append(refs, ref)+ }+ if len(refs) == 0 {+ return nil, fmt.Errorf("--value must list at least one member")+ }+ return json.Marshal(refs)case "number":if _, err := strconv.ParseFloat(raw, 64); err != nil {return nil, fmt.Errorf("value %q is not a valid number", raw)@@ -490,8 +543,10 @@ func encodeIssuePropertyValue(property propertyDTO, raw string) (json.RawMessage}// formatIssuePropertyValue renders a stored value for humans: option ids-// become option names, everything else prints via formatMetadataValue.-func formatIssuePropertyValue(property propertyDTO, value any) string {+// become option names, actor references become member names, everything+// else prints via formatMetadataValue. actorNames may be nil — references then+// print in their raw "<kind>:<uuid>" form rather than failing.+func formatIssuePropertyValue(property propertyDTO, value any, actorNames map[string]string) string {optionName := func(id string) string {for _, opt := range property.Config.Options {if opt.ID == id {@@ -500,6 +555,12 @@ func formatIssuePropertyValue(property propertyDTO, value any) string {}return id}+ actorName := func(ref string) string {+ if name, ok := actorNames[ref]; ok {+ return name+ }+ return ref+ }switch property.Type {case "select":if s, ok := value.(string); ok {@@ -515,6 +576,20 @@ func formatIssuePropertyValue(property propertyDTO, value any) string {}return strings.Join(names, ", ")}+ case "actor":+ if s, ok := value.(string); ok {+ return actorName(s)+ }+ case "multi_actor":+ if items, ok := value.([]any); ok {+ names := make([]string, 0, len(items))+ for _, item := range items {+ if s, ok := item.(string); ok {+ names = append(names, actorName(s))+ }+ }+ return strings.Join(names, ", ")+ }case "checkbox":if b, ok := value.(bool); ok {if b {@@ -535,7 +610,7 @@ type issuePropertyValueRow struct {Archived bool `json:"archived,omitempty"`}-func buildIssuePropertyRows(properties []propertyDTO, bag map[string]any) []issuePropertyValueRow {+func buildIssuePropertyRows(properties []propertyDTO, bag map[string]any, actorNames map[string]string) []issuePropertyValueRow {rows := make([]issuePropertyValueRow, 0, len(bag))for _, p := range properties {value, present := bag[p.ID]@@ -547,13 +622,40 @@ func buildIssuePropertyRows(properties []propertyDTO, bag map[string]any) []issuName: p.Name,Type: p.Type,Value: value,- Display: formatIssuePropertyValue(p, value),+ Display: formatIssuePropertyValue(p, value, actorNames),Archived: p.Archived,})}return rows}+// fetchActorPropertyNames builds a "member:<uuid>" → display name map, but+// only when the bag actually holds an actor value: every other property type+// renders without a second round trip, and `issue property list` shouldn't pay+// for a request it doesn't need.+func fetchActorPropertyNames(ctx context.Context, client *cli.APIClient, properties []propertyDTO, bag map[string]any) map[string]string {+ needed := false+ for _, p := range properties {+ if _, present := bag[p.ID]; present && (p.Type == "actor" || p.Type == "multi_actor") {+ needed = true+ break+ }+ }+ if !needed || client.WorkspaceID == "" {+ return nil+ }+ names := make(map[string]string)+ var members []map[string]any+ if err := getAssigneeJSON(ctx, client, "/api/workspaces/"+client.WorkspaceID+"/members", &members); err == nil {+ for _, m := range members {+ if id := strVal(m, "user_id"); id != "" {+ names["member:"+id] = strVal(m, "name")+ }+ }+ }+ return names+}+func fetchIssuePropertyBag(ctx context.Context, client *cli.APIClient, issueID string) (map[string]any, error) {var issue struct {Properties map[string]any `json:"properties"`@@ -596,7 +698,7 @@ func runIssuePropertyList(cmd *cobra.Command, args []string) error {if err != nil {return err}- rows := buildIssuePropertyRows(properties, bag)+ rows := buildIssuePropertyRows(properties, bag, fetchActorPropertyNames(ctx, client, properties, bag))output, _ := cmd.Flags().GetString("output")if output == "json" {return cli.PrintJSON(os.Stdout, rows)@@ -634,7 +736,7 @@ func runIssuePropertySet(cmd *cobra.Command, args []string) error {if err != nil {return err}- value, err := encodeIssuePropertyValue(property, rawValue)+ value, err := encodeIssuePropertyValue(ctx, client, property, rawValue)if err != nil {return err}@@ -646,7 +748,7 @@ func runIssuePropertySet(cmd *cobra.Command, args []string) error {if err := client.PutJSON(ctx, path, map[string]any{"value": value}, &result); err != nil {return fmt.Errorf("set property: %w", err)}- rows := buildIssuePropertyRows(properties, result.Properties)+ rows := buildIssuePropertyRows(properties, result.Properties, fetchActorPropertyNames(ctx, client, properties, result.Properties))output, _ := cmd.Flags().GetString("output")if output == "json" {return cli.PrintJSON(os.Stdout, rows)diff --git a/server/internal/handler/issue_table_facets.go b/server/internal/handler/issue_table_facets.goindex 3a860a6ca4..9a9efa9c8c 100644--- a/server/internal/handler/issue_table_facets.go+++ b/server/internal/handler/issue_table_facets.go@@ -246,9 +246,9 @@ GROUP BY a.id`, compiled.where)}propertyKey := "'" + util.UUIDToString(property.ID) + "'"switch property.Type {- case "select":+ case "select", "actor":query = fmt.Sprintf(`SELECT i.properties ->> %s, COUNT(*)::bigint FROM issue i WHERE %s AND jsonb_typeof(i.properties -> %s) = 'string' GROUP BY 1`, propertyKey, compiled.where, propertyKey)- case "multi_select":+ case "multi_select", "multi_actor":query = fmt.Sprintf(`SELECT property_value.value, COUNT(DISTINCT i.id)::bigint FROM issue i JOIN LATERAL jsonb_array_elements_text(CASE WHEN jsonb_typeof(i.properties -> %s) = 'array' THEN i.properties -> %s ELSE '[]'::jsonb END) AS property_value(value) ON TRUE WHERE %s GROUP BY property_value.value`, propertyKey, propertyKey, compiled.where)case "checkbox":query = fmt.Sprintf(`SELECT i.properties ->> %s, COUNT(*)::bigint FROM issue i WHERE %s AND jsonb_typeof(i.properties -> %s) = 'boolean' GROUP BY 1`, propertyKey, compiled.where, propertyKey)diff --git a/server/internal/handler/property.go b/server/internal/handler/property.goindex 52d26f2d79..2dfae49806 100644--- a/server/internal/handler/property.go+++ b/server/internal/handler/property.go@@ -44,9 +44,13 @@ const (maxPropertyDescriptionLen = 500maxPropertyTextValueLen = 2000maxPropertyURLValueLen = 2048+ // multi_actor is capped well below the select cap: the whole properties+ // bag shares one 16KB row budget, and a property holding hundreds of+ // actors would crowd out every other property on the same issue.+ maxPropertyActorValues = 20)-var validPropertyTypes = []string{"text", "number", "select", "multi_select", "date", "checkbox", "url"}+var validPropertyTypes = []string{"text", "number", "select", "multi_select", "date", "checkbox", "url", "actor", "multi_actor"}// Property icons use stable catalog keys that the Web client maps to Lucide// glyphs. Keeping this allowlist at the API boundary prevents arbitrary text@@ -297,6 +301,157 @@ func selectOptionsHint(cfg PropertyConfig) string {return strings.Join(parts, ", ")}+// ---------------------------------------------------------------------------+// Actor values (MUL-6286)+// ---------------------------------------------------------------------------++// actorPropertyKinds is the V1 value range for actor properties: workspace+// members only. The issue assignee also accepts "agent" and "squad", but+// neither belongs in a passive reference yet — an agent reference drags in the+// whole agent-visibility question (private / non-allow-listed agents must not+// become discoverable by id) for no demonstrated use case, and a squad is a+// routing target rather than a person.+//+// The stored form is "<kind>:<uuid>", so widening this list is a one-line+// change: no migration, no new property type, and existing definitions gain+// the new kind in place. Anything added here that is NOT universally visible+// to every workspace member (an agent, for one) must also restore a visibility+// gate on both the write path and the table-facet read path.+var actorPropertyKinds = []string{"member"}++// actorRef is a parsed "<kind>:<uuid>" property value.+type actorRef struct {+ Kind string+ ID string+}++func (a actorRef) String() string { return a.Kind + ":" + a.ID }++func propertyTypeIsActor(t string) bool {+ return t == "actor" || t == "multi_actor"+}++func actorKindsHint() string {+ return strings.Join(actorPropertyKinds, " / ")+}++// parseActorRef splits a stored actor value. Members are referenced by+// user_id — the same id the assignee pair uses — so "who is this" resolves+// identically everywhere in the product.+func parseActorRef(s string) (actorRef, error) {+ kind, id, found := strings.Cut(s, ":")+ if !found {+ return actorRef{}, fmt.Errorf("value must look like \"<kind>:<uuid>\" where kind is one of: %s", actorKindsHint())+ }+ valid := false+ for _, k := range actorPropertyKinds {+ if kind == k {+ valid = true+ break+ }+ }+ if !valid {+ return actorRef{}, fmt.Errorf("unknown actor kind %q; valid kinds: %s", kind, actorKindsHint())+ }+ parsed, err := uuid.Parse(id)+ if err != nil {+ return actorRef{}, fmt.Errorf("actor id in %q must be a UUID", s)+ }+ // Store the canonical lowercase-hyphenated form. uuid.Parse also accepts+ // uppercase, braces and the urn: prefix; every consumer downstream (the+ // member directory lookup in the client, the "= me" filter, @> containment)+ // compares reference strings exactly, so an unnormalized id would store+ // fine and then render as Unknown and never match a filter.+ return actorRef{Kind: kind, ID: parsed.String()}, nil+}++// parseActorRefList validates a multi_actor array: every element must parse,+// duplicates are dropped, and the caller's order is preserved. Unlike+// multi_select there is no config order to canonicalize against, and sorting+// by id would make the avatar row reshuffle on every edit. @> containment is+// order-insensitive, so filtering is unaffected either way.+func parseActorRefList(items []any) ([]actorRef, error) {+ if len(items) == 0 {+ return nil, errors.New("value must be a non-empty array of actor references")+ }+ if len(items) > maxPropertyActorValues {+ return nil, fmt.Errorf("value cannot list more than %d actors", maxPropertyActorValues)+ }+ seen := make(map[string]struct{}, len(items))+ refs := make([]actorRef, 0, len(items))+ for _, item := range items {+ s, ok := item.(string)+ if !ok {+ return nil, errors.New("value must be an array of actor reference strings")+ }+ ref, err := parseActorRef(s)+ if err != nil {+ return nil, err+ }+ if _, dup := seen[ref.String()]; dup {+ continue+ }+ seen[ref.String()] = struct{}{}+ refs = append(refs, ref)+ }+ return refs, nil+}++// actorRefsInValue re-reads the canonical stored JSON for an actor property.+// SetIssueProperty uses it to resolve references against the workspace after+// the pure shape validation has run.+func actorRefsInValue(propType string, stored []byte) ([]actorRef, error) {+ if propType == "actor" {+ var s string+ if err := json.Unmarshal(stored, &s); err != nil {+ return nil, err+ }+ ref, err := parseActorRef(s)+ if err != nil {+ return nil, err+ }+ return []actorRef{ref}, nil+ }+ var list []string+ if err := json.Unmarshal(stored, &list); err != nil {+ return nil, err+ }+ refs := make([]actorRef, 0, len(list))+ for _, s := range list {+ ref, err := parseActorRef(s)+ if err != nil {+ return nil, err+ }+ refs = append(refs, ref)+ }+ return refs, nil+}++// resolveActorRefs checks that every reference points at a real member of this+// workspace. No visibility gate is needed while members are the only kind:+// workspace membership is already visible to every member. Adding a kind that+// is not (an agent) means adding that gate back — see actorPropertyKinds.+func (h *Handler) resolveActorRefs(r *http.Request, workspaceID string, refs []actorRef) (int, string) {+ ctx := r.Context()+ wsUUID, err := util.ParseUUID(workspaceID)+ if err != nil {+ return http.StatusBadRequest, "invalid workspace_id"+ }+ for _, ref := range refs {+ refUUID, err := util.ParseUUID(ref.ID)+ if err != nil {+ return http.StatusBadRequest, fmt.Sprintf("actor id in %q must be a UUID", ref)+ }+ if _, err := h.Queries.GetMemberByUserAndWorkspace(ctx, db.GetMemberByUserAndWorkspaceParams{+ UserID: refUUID,+ WorkspaceID: wsUUID,+ }); err != nil {+ return http.StatusBadRequest, fmt.Sprintf("%q does not refer to a member of this workspace", ref)+ }+ }+ return 0, ""+}+// validatePropertyValue checks a raw JSON value against the definition's type// and returns the canonical JSON to store. Error strings enumerate the legal// values where possible — agents consume these directly to self-correct.@@ -394,6 +549,30 @@ func validatePropertyValue(def db.IssueProperty, raw json.RawMessage) ([]byte, e// (stable @> containment filtering and change detection).sort.SliceStable(ids, func(a, b int) bool { return order[ids[a]] < order[ids[b]] })return json.Marshal(ids)+ case "actor":+ s, ok := v.(string)+ if !ok {+ return nil, fmt.Errorf("value must be an actor reference string like \"member:<uuid>\" (kinds: %s)", actorKindsHint())+ }+ ref, err := parseActorRef(s)+ if err != nil {+ return nil, err+ }+ return json.Marshal(ref.String())+ case "multi_actor":+ items, ok := v.([]any)+ if !ok {+ return nil, fmt.Errorf("value must be an array of actor reference strings like \"member:<uuid>\" (kinds: %s)", actorKindsHint())+ }+ refs, err := parseActorRefList(items)+ if err != nil {+ return nil, err+ }+ out := make([]string, len(refs))+ for i, ref := range refs {+ out[i] = ref.String()+ }+ return json.Marshal(out)default:return nil, fmt.Errorf("unsupported property type %q", def.Type)}@@ -763,6 +942,18 @@ func (h *Handler) SetIssueProperty(w http.ResponseWriter, r *http.Request) {if err != nil {return fail(http.StatusBadRequest, err.Error())}+ // Actor values point at another entity, so shape validation isn't+ // enough: resolve each reference against this workspace before the+ // write, and reject references the caller isn't allowed to see.+ if propertyTypeIsActor(def.Type) {+ refs, err := actorRefsInValue(def.Type, value)+ if err != nil {+ return fail(http.StatusBadRequest, err.Error())+ }+ if status, msg := h.resolveActorRefs(r, uuidToString(issue.WorkspaceID), refs); status != 0 {+ return fail(status, msg)+ }+ }updated, err = q.SetIssuePropertyValue(r.Context(), db.SetIssuePropertyValueParams{ID: issue.ID,WorkspaceID: issue.WorkspaceID,diff --git a/server/internal/handler/property_test.go b/server/internal/handler/property_test.goindex 3d4efeba87..7a1a03ecd6 100644--- a/server/internal/handler/property_test.go+++ b/server/internal/handler/property_test.go@@ -7,6 +7,7 @@ import ("net/http""net/http/httptest""net/url"+ "sort""strings""testing"@@ -580,3 +581,426 @@ func TestListIssuesPropertyFilterAndSort(t *testing.T) {t.Fatalf("unknown-definition sort should fall back to position order, got empty")}}++// ---------------------------------------------------------------------------+// Actor property types (MUL-6286)+// ---------------------------------------------------------------------------++// decodePropertiesBag reads the `{"properties": {...}}` envelope the value+// endpoints return. A fresh struct per call matters: json.Decode merges into a+// pre-populated map, so reusing one would keep keys from an earlier response.+func decodePropertiesBag(t *testing.T, w *httptest.ResponseRecorder) map[string]any {+ t.Helper()+ var resp struct {+ Properties map[string]any `json:"properties"`+ }+ if err := json.NewDecoder(w.Body).Decode(&resp); err != nil {+ t.Fatalf("decode properties bag: %v", err)+ }+ return resp.Properties+}++func TestParseActorRefUnit(t *testing.T) {+ memberID := uuid.NewString()+ ref, err := parseActorRef("member:" + memberID)+ if err != nil {+ t.Fatalf("member reference rejected: %v", err)+ }+ if ref.Kind != "member" || ref.ID != memberID {+ t.Fatalf("unexpected parse: %+v", ref)+ }+ // String() is the canonical storage form, so it must round-trip exactly.+ if ref.String() != "member:"+memberID {+ t.Fatalf("String() round-trip broken: %q", ref.String())+ }++ // uuid.Parse also accepts uppercase, braces and the urn: form. Every+ // consumer compares reference strings exactly, so anything not stored in+ // canonical form would render as Unknown and never match a filter.+ canonical := "6ba7b810-9dad-11d1-80b4-00c04fd430c8"+ for _, variant := range []string{+ strings.ToUpper(canonical),+ "{" + canonical + "}",+ "urn:uuid:" + canonical,+ strings.ReplaceAll(canonical, "-", ""),+ } {+ got, err := parseActorRef("member:" + variant)+ if err != nil {+ t.Fatalf("uuid variant %q rejected: %v", variant, err)+ }+ if got.String() != "member:"+canonical {+ t.Fatalf("uuid variant %q not canonicalized: %q", variant, got.String())+ }+ }++ cases := []struct {+ name string+ value string+ want string+ }{+ {"no colon", uuid.NewString(), `"<kind>:<uuid>"`},+ {"empty string", "", `"<kind>:<uuid>"`},+ // "agent" and "squad" are assignee kinds deliberately left out of the+ // V1 value range; both must read as unknown, not silently accepted.+ {"agent kind", "agent:" + uuid.NewString(), "unknown actor kind"},+ {"squad kind", "squad:" + uuid.NewString(), "unknown actor kind"},+ {"user kind", "user:" + uuid.NewString(), "unknown actor kind"},+ {"empty kind", ":" + uuid.NewString(), "unknown actor kind"},+ {"kind is case-sensitive", "Member:" + uuid.NewString(), "unknown actor kind"},+ {"non-uuid id", "member:not-a-uuid", "must be a UUID"},+ {"empty id", "member:", "must be a UUID"},+ {"nested kind", "member:agent:" + uuid.NewString(), "must be a UUID"},+ }+ for _, tc := range cases {+ _, err := parseActorRef(tc.value)+ if err == nil || !strings.Contains(err.Error(), tc.want) {+ t.Fatalf("%s: expected error containing %q, got %v", tc.name, tc.want, err)+ }+ }+}++// TestParseActorRefListUnit pins the multi_actor list contract, including the+// one place it deliberately differs from multi_select: the caller's order+// survives instead of being canonicalized.+func TestParseActorRefListUnit(t *testing.T) {+ // Fixed ids so the insertion order below is neither ascending nor+ // descending — any sort applied to the result would reorder it.+ first := "member:11111111-1111-4111-8111-111111111111"+ second := "member:22222222-2222-4222-8222-222222222222"+ third := "member:00000000-0000-4000-8000-000000000000"++ if _, err := parseActorRefList(nil); err == nil {+ t.Fatalf("nil list accepted")+ }+ if _, err := parseActorRefList([]any{}); err == nil {+ t.Fatalf("empty array accepted")+ }++ refs, err := parseActorRefList([]any{first, second, third, second})+ if err != nil {+ t.Fatalf("valid list rejected: %v", err)+ }+ got := make([]string, len(refs))+ for i, ref := range refs {+ got[i] = ref.String()+ }+ if len(got) != 3 {+ t.Fatalf("duplicate not dropped: %v", got)+ }+ if got[0] != first || got[1] != second || got[2] != third {+ t.Fatalf("insertion order not preserved: %v", got)+ }+ // Explicit: unlike multi_select there is no canonical order to sort to.+ if sort.StringsAreSorted(got) {+ t.Fatalf("list was canonicalized to sorted order: %v", got)+ }++ over := make([]any, 0, maxPropertyActorValues+1)+ for i := 0; i < maxPropertyActorValues+1; i++ {+ over = append(over, "member:"+uuid.NewString())+ }+ _, err = parseActorRefList(over)+ if err == nil || !strings.Contains(err.Error(), fmt.Sprintf("more than %d", maxPropertyActorValues)) {+ t.Fatalf("over-cap list: expected cap error, got %v", err)+ }+ if refs, err := parseActorRefList(over[:maxPropertyActorValues]); err != nil || len(refs) != maxPropertyActorValues {+ t.Fatalf("list at the cap rejected: %d refs, %v", len(refs), err)+ }++ if _, err := parseActorRefList([]any{first, 42}); err == nil {+ t.Fatalf("non-string element accepted")+ }+ if _, err := parseActorRefList([]any{first, "squad:" + uuid.NewString()}); err == nil {+ t.Fatalf("unknown kind inside a list accepted")+ }+}++func TestValidatePropertyValueActorUnit(t *testing.T) {+ actorDef := makePropertyDef("actor", nil)+ multiDef := makePropertyDef("multi_actor", nil)+ // Fixed ids: memberRef sorts AFTER secondRef, so the insertion order+ // asserted below is proof that no canonicalizing sort ran.+ memberRef := "member:99999999-9999-4999-8999-999999999999"+ secondRef := "member:00000000-0000-4000-8000-000000000000"++ stored, err := validatePropertyValue(actorDef, json.RawMessage(`"`+memberRef+`"`))+ if err != nil {+ t.Fatalf("actor value rejected: %v", err)+ }+ if string(stored) != `"`+memberRef+`"` {+ t.Fatalf("actor value not stored as a plain string: %s", stored)+ }++ // actor is a single reference: no array, no number, no object, no bare id.+ for _, raw := range []string{+ `["` + memberRef + `"]`,+ `3`,+ `true`,+ `{"kind":"member","id":"` + uuid.NewString() + `"}`,+ `null`,+ `"` + uuid.NewString() + `"`,+ `"agent:` + uuid.NewString() + `"`,+ `"squad:` + uuid.NewString() + `"`,+ } {+ if _, err := validatePropertyValue(actorDef, json.RawMessage(raw)); err == nil {+ t.Fatalf("actor accepted %s", raw)+ }+ }++ // multi_actor is always an array, even for a single reference.+ for _, raw := range []string{+ `"` + memberRef + `"`,+ `[]`,+ `3`,+ `[3]`,+ `null`,+ } {+ if _, err := validatePropertyValue(multiDef, json.RawMessage(raw)); err == nil {+ t.Fatalf("multi_actor accepted %s", raw)+ }+ }++ // Duplicates collapse and the caller's order survives.+ stored, err = validatePropertyValue(multiDef, json.RawMessage(+ `["`+memberRef+`","`+secondRef+`","`+memberRef+`"]`))+ if err != nil {+ t.Fatalf("multi_actor value rejected: %v", err)+ }+ if string(stored) != `["`+memberRef+`","`+secondRef+`"]` {+ t.Fatalf("multi_actor not deduped in insertion order: %s", stored)+ }+}++// TestPropertyActorDefinitionRejectsOptions: actor types are resolved against+// the workspace, not against a config option list, so a definition carrying+// options is a modelling mistake and must be refused.+func TestPropertyActorDefinitionRejectsOptions(t *testing.T) {+ for _, propType := range []string{"actor", "multi_actor"} {+ _, err := validatePropertyConfig(propType, &PropertyConfig{+ Options: []PropertyOption{{Name: "Anyone", Color: "#ef4444"}},+ })+ if err == nil || !strings.Contains(err.Error(), "does not accept options") {+ t.Fatalf("%s definition with options: expected rejection, got %v", propType, err)+ }+ cfg, err := validatePropertyConfig(propType, nil)+ if err != nil || string(cfg) != `{}` {+ t.Fatalf("%s definition without config: expected {}, got %s (%v)", propType, cfg, err)+ }+ }++ w := httptest.NewRecorder()+ testHandler.CreateProperty(w, newRequest("POST", "/api/properties", map[string]any{+ "name": "Owner" + uuid.NewString()[:8],+ "type": "actor",+ "config": map[string]any{"options": []map[string]any{+ {"name": "Anyone", "color": "#ef4444"},+ }},+ }))+ if w.Code != http.StatusBadRequest || !strings.Contains(w.Body.String(), "does not accept options") {+ t.Fatalf("CreateProperty actor+options: expected 400, got %d: %s", w.Code, w.Body.String())+ }+}++// TestIssueActorPropertyValues drives the actor / multi_actor pair through the+// real endpoints: a reference must resolve to something that exists in this+// workspace, and the stored bag keeps the prefixed "<kind>:<uuid>" form.+func TestIssueActorPropertyValues(t *testing.T) {+ owner := createTestProperty(t, map[string]any{+ "name": "Owner" + uuid.NewString()[:8], "type": "actor", "icon": "user-round",+ })+ if owner.Type != "actor" || len(owner.Config.Options) != 0 {+ t.Fatalf("unexpected actor definition: %+v", owner)+ }+ reviewers := createTestProperty(t, map[string]any{+ "name": "Reviewers" + uuid.NewString()[:8], "type": "multi_actor",+ })++ memberRef := "member:" + testUserID+ secondRef := "member:" + createPropertyTestMember(t)++ issueID := createPropertyTestIssue(t, "actor property values")++ // A real workspace member round-trips as "member:<user_id>".+ w := setIssuePropertyRaw(t, issueID, owner.ID, memberRef)+ if w.Code != http.StatusOK {+ t.Fatalf("actor set member: expected 200, got %d: %s", w.Code, w.Body.String())+ }+ if got := decodePropertiesBag(t, w)[owner.ID]; got != memberRef {+ t.Fatalf("actor value not stored as %q: %v", memberRef, got)+ }+ // Read back through the issue endpoint, not just the write response.+ wget := httptest.NewRecorder()+ getReq := newRequest("GET", "/api/issues/"+issueID, nil)+ getReq = withURLParam(getReq, "id", issueID)+ testHandler.GetIssue(wget, getReq)+ if wget.Code != http.StatusOK {+ t.Fatalf("GetIssue: expected 200, got %d: %s", wget.Code, wget.Body.String())+ }+ var fetched IssueResponse+ if err := json.NewDecoder(wget.Body).Decode(&fetched); err != nil {+ t.Fatalf("decode issue: %v", err)+ }+ if fetched.Properties[owner.ID] != memberRef {+ t.Fatalf("actor value missing from the issue bag: %v", fetched.Properties)+ }++ // An uppercase id resolves to the same member and must land in the bag in+ // canonical form — otherwise it renders as Unknown and the "= me" filter,+ // which matches the reference string exactly, silently misses it.+ upper := "member:" + strings.ToUpper(testUserID)+ w = setIssuePropertyRaw(t, issueID, owner.ID, upper)+ if w.Code != http.StatusOK {+ t.Fatalf("actor set uppercase member: expected 200, got %d: %s", w.Code, w.Body.String())+ }+ if got := decodePropertiesBag(t, w)[owner.ID]; got != memberRef {+ t.Fatalf("uppercase actor id not canonicalized on write: %v", got)+ }++ // Shape is valid but the referent is not in this workspace → 400.+ rejections := []struct {+ name string+ value any+ want string+ }{+ {"unknown member", "member:" + uuid.NewString(), "does not refer to a member"},+ // Agents and squads are assignable but not referenceable in V1: both+ // must be refused at the kind check, before any workspace lookup.+ {"agent kind", "agent:" + uuid.NewString(), "unknown actor kind"},+ {"squad kind", "squad:" + uuid.NewString(), "unknown actor kind"},+ // writeJSON HTML-escapes the angle brackets, so match the prose part.+ {"bare uuid", uuid.NewString(), "value must look like"},+ {"array into actor", []string{memberRef}, "actor reference string"},+ {"number into actor", 7, "actor reference string"},+ }+ for _, tc := range rejections {+ w := setIssuePropertyRaw(t, issueID, owner.ID, tc.value)+ if w.Code != http.StatusBadRequest || !strings.Contains(w.Body.String(), tc.want) {+ t.Fatalf("actor %s: expected 400 containing %q, got %d: %s", tc.name, tc.want, w.Code, w.Body.String())+ }+ }+ // multi_actor: duplicates dropped, insertion order kept.+ w = setIssuePropertyRaw(t, issueID, reviewers.ID, []string{memberRef, secondRef, memberRef})+ if w.Code != http.StatusOK {+ t.Fatalf("multi_actor set: expected 200, got %d: %s", w.Code, w.Body.String())+ }+ stored, ok := decodePropertiesBag(t, w)[reviewers.ID].([]any)+ if !ok || len(stored) != 2 {+ t.Fatalf("multi_actor not stored as a 2-element array: %v", stored)+ }+ if stored[0] != memberRef || stored[1] != secondRef {+ t.Fatalf("multi_actor lost insertion order: %v", stored)+ }++ multiRejections := []struct {+ name string+ value any+ want string+ }{+ {"bare string", memberRef, "array of actor reference strings"},+ {"empty array", []string{}, "non-empty array"},+ {"unknown member inside", []string{memberRef, "member:" + uuid.NewString()}, "does not refer to a member"},+ }+ for _, tc := range multiRejections {+ w := setIssuePropertyRaw(t, issueID, reviewers.ID, tc.value)+ if w.Code != http.StatusBadRequest || !strings.Contains(w.Body.String(), tc.want) {+ t.Fatalf("multi_actor %s: expected 400 containing %q, got %d: %s", tc.name, tc.want, w.Code, w.Body.String())+ }+ }+ // The cap is enforced on the raw array, before any workspace resolution.+ over := make([]string, 0, maxPropertyActorValues+1)+ for i := 0; i < maxPropertyActorValues+1; i++ {+ over = append(over, "member:"+uuid.NewString())+ }+ if w := setIssuePropertyRaw(t, issueID, reviewers.ID, over); w.Code != http.StatusBadRequest ||+ !strings.Contains(w.Body.String(), fmt.Sprintf("more than %d", maxPropertyActorValues)) {+ t.Fatalf("multi_actor over cap: expected 400 cap error, got %d: %s", w.Code, w.Body.String())+ }+}++// TestIssueActorPropertyFacets: actor and multi_actor values aggregate into+// table facets, which is what backs the "= me" filter in the header. Members+// are the only referenceable kind, and workspace membership is visible to+// every member, so there is no visibility gate to apply here — a plain member+// sees the same keys the owner does.+func TestIssueActorPropertyFacets(t *testing.T) {+ _, _, plainMemberID := privateAgentTestFixture(t)+ property := createTestProperty(t, map[string]any{+ "name": "Facet Owner" + uuid.NewString()[:8], "type": "actor",+ })+ memberRef := "member:" + testUserID+ otherRef := "member:" + plainMemberID++ firstIssueID := createPropertyTestIssue(t, "actor facet first")+ secondIssueID := createPropertyTestIssue(t, "actor facet second")++ if w := setIssuePropertyRaw(t, firstIssueID, property.ID, memberRef); w.Code != http.StatusOK {+ t.Fatalf("set first actor value: expected 200, got %d: %s", w.Code, w.Body.String())+ }+ if w := setIssuePropertyRaw(t, secondIssueID, property.ID, otherRef); w.Code != http.StatusOK {+ t.Fatalf("set second actor value: expected 200, got %d: %s", w.Code, w.Body.String())+ }++ facetKeys := func(userID string) map[string]int64 {+ t.Helper()+ w := httptest.NewRecorder()+ req := newRequestAs(userID, http.MethodPost, "/api/issues/table/facets", map[string]any{+ "query": map[string]any{+ "scope": map[string]any{"kind": "workspace"},+ "filters": map[string]any{},+ "sort": map[string]any{"field": "position", "direction": "asc"},+ },+ "facets": []map[string]any{{"kind": "property", "property_id": property.ID}},+ "include_total": false,+ })+ testHandler.ListIssueTableFacets(w, req)+ if w.Code != http.StatusOK {+ t.Fatalf("ListIssueTableFacets: expected 200, got %d: %s", w.Code, w.Body.String())+ }+ var resp issueTableFacetsResponse+ if err := json.NewDecoder(w.Body).Decode(&resp); err != nil {+ t.Fatalf("decode facets: %v", err)+ }+ counts := map[string]int64{}+ for _, facet := range resp.Facets {+ for _, value := range facet.Values {+ counts[value.Key] = value.Count+ }+ }+ return counts+ }++ // Only these two issues carry this brand-new definition, so the counts are+ // exact regardless of what else lives in the shared fixture workspace.+ ownerCounts := facetKeys(testUserID)+ if ownerCounts[memberRef] != 1 || ownerCounts[otherRef] != 1 {+ t.Fatalf("owner facet counts wrong: %v", ownerCounts)+ }+ memberCounts := facetKeys(plainMemberID)+ if memberCounts[memberRef] != 1 || memberCounts[otherRef] != 1 {+ t.Fatalf("plain member sees different facet keys than the owner: %v", memberCounts)+ }+}++// createPropertyTestMember adds a second real member to the fixture workspace+// so multi_actor ordering can be asserted with two resolvable references.+func createPropertyTestMember(t *testing.T) string {+ t.Helper()+ ctx := context.Background()+ email := "actor-second-" + uuid.NewString()[:8] + "@multica.test"+ var userID string+ if err := testPool.QueryRow(ctx,+ `INSERT INTO "user" (name, email) VALUES ('Actor Second Member', $1) RETURNING id`, email,+ ).Scan(&userID); err != nil {+ t.Fatalf("create second member user: %v", err)+ }+ t.Cleanup(func() {+ testPool.Exec(context.Background(), `DELETE FROM "user" WHERE email = $1`, email)+ })+ if _, err := testPool.Exec(ctx,+ `INSERT INTO member (workspace_id, user_id, role) VALUES ($1, $2, 'member')`,+ testWorkspaceID, userID,+ ); err != nil {+ t.Fatalf("add second member: %v", err)+ }+ return userID+}diff --git a/server/internal/service/builtin_skills/multica-working-on-issues/SKILL.md b/server/internal/service/builtin_skills/multica-working-on-issues/SKILL.mdindex 2a258a1b7d..ba4704e515 100644--- a/server/internal/service/builtin_skills/multica-working-on-issues/SKILL.md+++ b/server/internal/service/builtin_skills/multica-working-on-issues/SKILL.md@@ -151,9 +151,10 @@ string|number|bool` to force a type.## Custom properties: typed workflow stateWorkspaces may define custom issue properties (Severity, Environment, QA-Status, ...). Properties are the typed, user-visible sibling of metadata:-values are validated against the definition (select options, date format,-http(s) URL), visible in the issue sidebar, and addressed by name.+Status, Reviewer, ...). Properties are the typed, user-visible sibling of+metadata: values are validated against the definition (select options, date+format, http(s) URL, member reference), visible in the issue sidebar, and+addressed by name.- Read what exists before writing: `multica property list` shows the catalog;`multica issue property list <issue-id>` shows values set on the issue.@@ -162,10 +163,15 @@ http(s) URL), visible in the issue sidebar, and addressed by name.```bashmultica issue property set <issue-id> --name Environment --value stagingmultica issue property set <issue-id> --name Platforms --value "iOS,Android"+multica issue property set <issue-id> --name Reviewer --value Bohanmultica issue property unset <issue-id> --name Environment```- A validation error lists the legal options — fix the value and retry.+- `actor` / `multi_actor` properties (Reviewer, Escalation contact, ...) hold+ workspace members only. `--value` takes a member name, email, UUID, short id,+ or an explicit `member:<uuid>`; `multi_actor` takes a comma-separated list+ (duplicates dropped, order kept, max 20).- Definitions may include an optional catalog icon for visual identification;it does not change the property's type or value validation.- Agents cannot create or edit property definitions (owner/admin humans only).diff --git a/server/internal/service/builtin_skills/multica-working-on-issues/references/working-on-issues-source-map.md b/server/internal/service/builtin_skills/multica-working-on-issues/references/working-on-issues-source-map.mdindex 21d2604512..bf8e59bbde 100644--- a/server/internal/service/builtin_skills/multica-working-on-issues/references/working-on-issues-source-map.md+++ b/server/internal/service/builtin_skills/multica-working-on-issues/references/working-on-issues-source-map.md@@ -197,6 +197,10 @@ comment-triggered runs otherwise must not change status unless asked.| Definition CRUD, admin gate, agent-actor rejection | `server/internal/handler/property.go` (`requirePropertyAdmin`) || Optional catalog icon field and allowlist validation | `server/internal/handler/property.go` (`PropertyResponse`, `validatePropertyIcon`) || Per-type value validation (self-correcting errors) | `server/internal/handler/property.go` (`validatePropertyValue`) |+| `actor` / `multi_actor` reference parsing, `member` as the only kind, 20-value cap | `server/internal/handler/property.go` (`actorPropertyKinds`, `parseActorRef`, `parseActorRefList`, `maxPropertyActorValues`) |+| Actor references are checked for workspace membership only | `server/internal/handler/property.go` (`resolveActorRefs`) |+| `--value` name / email / id → `member:<uuid>` resolution (same member lookup as `--assignee`) | `server/cmd/multica/cmd_property.go` (`resolveActorPropertyRef`, `memberOnlyKinds`) |+| Shared actor-reference types and helpers | `packages/core/types/property.ts` (`parseActorRef`, `actorRefsFromValue`, `MAX_ISSUE_PROPERTY_ACTOR_VALUES`) || API routes (`/api/properties`, PUT/DELETE `/api/issues/{id}/properties/{propertyId}`) | `server/cmd/server/router.go` |## Verification commanddiff --git a/server/migrations/341_issue_property_actor_types.down.sql b/server/migrations/341_issue_property_actor_types.down.sqlnew file mode 100644index 0000000000..4c272a88fa--- /dev/null+++ b/server/migrations/341_issue_property_actor_types.down.sql@@ -0,0 +1,10 @@+-- Restore the pre-actor type allowlist. Actor definitions have to go first or+-- the constraint cannot be re-added. Their values stay in each issue's+-- property bag, keyed by a definition id that no longer resolves — the same+-- shape the catalog already tolerates for a removed definition, and readers+-- skip those keys. Re-running the up migration does NOT bring the definitions+-- back, so this is a local-rollback tool, not a reversible production step.+DELETE FROM issue_property WHERE type IN ('actor', 'multi_actor');+ALTER TABLE issue_property DROP CONSTRAINT IF EXISTS issue_property_type_check;+ALTER TABLE issue_property ADD CONSTRAINT issue_property_type_check+ CHECK (type IN ('text', 'number', 'select', 'multi_select', 'date', 'checkbox', 'url'));diff --git a/server/migrations/341_issue_property_actor_types.up.sql b/server/migrations/341_issue_property_actor_types.up.sqlnew file mode 100644index 0000000000..2b6373cda8--- /dev/null+++ b/server/migrations/341_issue_property_actor_types.up.sql@@ -0,0 +1,20 @@+-- Custom issue property actor types (MUL-6286).+--+-- Adds 'actor' and 'multi_actor' to the type allowlist. Both store a prefixed+-- reference string ("member:<user_id>"); multi_actor stores an array of them.+-- The kind prefix is what lets the accepted-kind set widen later without+-- another migration or a new property type.+--+-- Keeping the value a plain string (rather than an object) means the existing+-- @> containment filter, the jsonb_path_ops GIN index, and the client value+-- schema all keep working unchanged.+--+-- The type is validated again in the handler, which additionally resolves each+-- reference against the workspace. This constraint is only the outer guard.+--+-- NOT VALID + VALIDATE keeps the ACCESS EXCLUSIVE lock instantaneous; existing+-- rows all carry one of the original seven types, so validation is a formality.+ALTER TABLE issue_property DROP CONSTRAINT IF EXISTS issue_property_type_check;+ALTER TABLE issue_property ADD CONSTRAINT issue_property_type_check+ CHECK (type IN ('text', 'number', 'select', 'multi_select', 'date', 'checkbox', 'url', 'actor', 'multi_actor')) NOT VALID;+ALTER TABLE issue_property VALIDATE CONSTRAINT issue_property_type_check;