multica/server/internal/daemon
Naiyuan Qing 9ede795c5b feat(api): strict workspace isolation + agent parity fixes
Enforce workspace isolation at every layer:

- Router: move RequireWorkspaceMember middleware to group level so ALL
  workspace-scoped routes (issues, agents, skills, runtimes, inbox,
  comments) require workspace context
- SQL: add GetXxxInWorkspace queries that filter by workspace_id,
  eliminating cross-workspace data access at the query level
- Handlers: loadXForUser functions use workspace-scoped queries,
  no fallback to unscoped queries
- Migration 025: add workspace_id column to comment table with backfill
- ListComments: add workspace_id filter for defense-in-depth

Fix daemon workspace mapping:
- Server returns workspace_id in task claim response (from issue)
- Daemon uses task.WorkspaceID directly instead of unreliable
  workspaceIDForRuntime() local map lookup
- Remove workspaceIDForRuntime function

Fix agent/human parity:
- Comment update/delete: use resolveActor for isAuthor check so agents
  can edit/delete their own comments
- Event attribution: replace hardcoded "member" with resolveActor in
  agent, skill, and subscriber publish calls

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-30 16:49:13 +08:00
..
execenv merge: resolve conflicts with main (workdir reuse) 2026-03-29 19:42:51 +08:00
repocache feat(daemon): agent-driven repo checkout with bare clone cache 2026-03-29 19:37:48 +08:00
usage fix(daemon): fix Codex token usage parsing from session logs 2026-03-28 00:03:47 +08:00
client.go feat(daemon): agent-driven repo checkout with bare clone cache 2026-03-29 19:37:48 +08:00
config.go fix(daemon): prevent stuck tasks from blocking queue and add concurrent execution 2026-03-30 03:08:52 +08:00
daemon.go feat(api): strict workspace isolation + agent parity fixes 2026-03-30 16:49:13 +08:00
daemon_test.go refactor: decouple task lifecycle from issue status (#151) 2026-03-27 18:30:21 +08:00
health.go feat(daemon): agent-driven repo checkout with bare clone cache 2026-03-29 19:37:48 +08:00
helpers.go fix(daemon): prevent stuck tasks from blocking queue and add concurrent execution 2026-03-30 03:08:52 +08:00
prompt.go refactor: decouple task lifecycle from issue status (#151) 2026-03-27 18:30:21 +08:00
types.go feat(api): strict workspace isolation + agent parity fixes 2026-03-30 16:49:13 +08:00