feat(comments): gate organization-wide search with comments.manage #36

Merged
morten-olsen merged 1 commit from mc/aeb1579b-9eed-4312-8a37-efd7634f2438 into main 2026-10-08 15:19:36 +02:00
Contributor

Summary

Organization-wide comment search already supports tags, since and limit. This applies Morten's confirmed permission boundary:

- Organization membership permits search; every agent sees search_comments.
+ Owners and roles with comments.manage can search; only permitted agents see the tool.

The service enforces the permission for HTTP and MCP. Task-local reading/commenting and author-only edit/delete rules stay unchanged. Generated API types and docs include the permission. No migration or automatic grants.

Evidence

  • Before: the service permission test returned comments instead of rejecting; MCP advertised search to an unpermitted role.
  • After: 663 tests across 77 files pass locally, including 26 comment-service/MCP tests. Workspace typecheck, ESLint, dependency rules, formatting and 45 pipeline renderings pass.
  • PR pipeline 179: success (quality, docs, server image and agent image). Push pipeline 180: success. Forge commit statuses confirm success for head 8c0076f6c2.
  • Live baseline: prod/mission-control uses 0.12.0@sha256:d71556bcfd3273415981698eff7ccefa9c7ce0303693c287f39f5d240af4df15. Search by friction tag succeeded before the gate. Not deployed yet.

Merge danger

Door: two-way before role grants; no migration. Later grants must be removed before rollback to a version whose permission enum lacks comments.manage.

Blast radius: app. Search access narrows; owners must grant comments.manage to retrospective roles. No automatic grants or infrastructure changes.

Rollback and verification

  • Roll back: revert the code and return to the prior image; first remove any newly added comments.manage role grants.
  • Verify after rollout: expected image digest, ready replicas and Application revision; hidden tool/denied search for unpermitted roles, tagged results for permitted roles, unchanged task-local commenting/reading.
  • Reviewers: Security Engineer for service/MCP authorization and isolation; Designer for permission wording, docs and generated types consumed by the existing role editor.
## Summary Organization-wide comment search already supports tags, since and limit. This applies Morten's confirmed permission boundary: ```diff - Organization membership permits search; every agent sees search_comments. + Owners and roles with comments.manage can search; only permitted agents see the tool. ``` The service enforces the permission for HTTP and MCP. Task-local reading/commenting and author-only edit/delete rules stay unchanged. Generated API types and docs include the permission. No migration or automatic grants. ## Evidence - **Before:** the service permission test returned comments instead of rejecting; MCP advertised search to an unpermitted role. - **After:** 663 tests across 77 files pass locally, including 26 comment-service/MCP tests. Workspace typecheck, ESLint, dependency rules, formatting and 45 pipeline renderings pass. - [PR pipeline 179](https://woodpecker.olsen.cloud/repos/32/pipeline/179): success (quality, docs, server image and agent image). [Push pipeline 180](https://woodpecker.olsen.cloud/repos/32/pipeline/180): success. Forge commit statuses confirm success for head 8c0076f6c278f7c3ecf1f8351b3d3f7d6feca1ea. - Live baseline: prod/mission-control uses `0.12.0@sha256:d71556bcfd3273415981698eff7ccefa9c7ce0303693c287f39f5d240af4df15`. Search by friction tag succeeded before the gate. Not deployed yet. ## Merge danger **Door:** two-way before role grants; no migration. Later grants must be removed before rollback to a version whose permission enum lacks comments.manage. **Blast radius:** app. Search access narrows; owners must grant comments.manage to retrospective roles. No automatic grants or infrastructure changes. ## Rollback and verification - **Roll back:** revert the code and return to the prior image; first remove any newly added comments.manage role grants. - **Verify after rollout:** expected image digest, ready replicas and Application revision; hidden tool/denied search for unpermitted roles, tagged results for permitted roles, unchanged task-local commenting/reading. - **Reviewers:** Security Engineer for service/MCP authorization and isolation; Designer for permission wording, docs and generated types consumed by the existing role editor.
feat(comments): require permission for organization-wide search
All checks were successful
ci/woodpecker/pr/quality Pipeline was successful
ci/woodpecker/push/quality Pipeline was successful
ci/woodpecker/pr/image-agent Pipeline was successful
ci/woodpecker/pr/docs Pipeline was successful
ci/woodpecker/push/docs Pipeline was successful
ci/woodpecker/pr/image Pipeline was successful
8c0076f6c2
paperclip left a comment

Review record copied by Software Engineer at the validator's request. Original author: Security Engineer. Original task: 5f5f5ed8-a003-44eb-b144-84e46e7707a2

Security review of PR #36, pinned locally to 8c0076f6c2 using review/comments-manage-36. Inspected git log origin/main..HEAD and git diff origin/main...HEAD (one commit), full service/HTTP/MCP authorization paths, tests, permission registry and ADR 0005. Read Homelab AGENTS.md and security runbooks; no applicable Mission Control AGENTS.md exists.

Standards

No blocking security findings. TaskCommentService.search asserts comments.manage before querying; both HTTP and MCP delegate to that service. AccessContext checks organization access first (foreign organization -> NotFound), owners receive registered permissions, ordinary members receive none, and role permissions are read within the requested organization. Search selects only undeleted comments on live tasks/projects in that organization, uses parameterized tag/time filtering and bounded limits. MCP discovery uses server-derived permissions and a fresh request context; no client-supplied organization or permission override. Role create/update enforce grant-only-what-you-hold; restore delegates to update, so roles.manage alone cannot grant comments.manage. No secrets, dependency/image changes, privileged/host access, exposure manifests, migrations or automatic grants in the diff.

Spec

No blocking findings against Morten's confirmed “Yes agreed” scope. Only organization-wide search is gated. Task-local list/add and author-only edit / author-or-owner delete logic are unchanged. Existing tag/since/limit and deleted/foreign-task tests remain; added service test covers owner/permitted success, member/unpermitted denial, task-local reads and foreign organization denial. MCP baseline tool-list tests exclude search for unpermitted roles; permitted tagged search remains exercised.

Evidence and limitations

Static review only for the new behavior. Owner's recorded evidence: local 663 tests/77 files and checks passed; pipeline 179 and 180 success and exact-head Forge statuses green (parent comment 9b2f2641-3c4c-4056-822f-c40d70223f66). Pipeline: https://woodpecker.olsen.cloud/repos/32/pipeline/179 . I could not independently inspect build results: tea has no available login, woodpecker-cli has no configured context; pnpm absent. Software Engineer must confirm current head and build remain green before merge; a changed head or red/missing build blocks merge.

Read live: kubectl get deployment mission-control -n prod -o jsonpath='{.spec.template.spec.containers[*].image}{"\n"}{.status.readyReplicas}{"\n"}' -> code.olsen.cloud/ai/mission-control:0.12.0@sha256:d71556bcfd3273415981698eff7ccefa9c7ce0303693c287f39f5d240af4df15; readyReplicas 1. New behavior is not deployed. No mutation performed.

Non-blocking UNKNOWN verification limit: rollout behavior not yet observed, rather than an identified vulnerability. After rollout owner verifies expected image/digest/readiness; owner and explicitly permitted role search succeeds; ordinary member HTTP search denies (403), unpermitted role tool is hidden and direct invocation cannot succeed; foreign organization search denies (404), permitted search returns no foreign/deleted task comments; tag/since/limit and task-local comment access still work; nonauthor edit/delete still denied except owner delete.

Rollback: revert code/image. Remove any future comments.manage grants before deploying an older permission enum; historical revisions may retain the new string and must not be restored on that older version. Older code restores membership-only organization-wide search, so rollback also restores the broader former access boundary; get Morten's decision if that risk needs acceptance.

Standards: 0 findings; worst none. Spec: 0 findings; worst none. One non-blocking UNKNOWN verification limit; no verified CRITICAL/HIGH finding. Security review complete; Software Engineer retains implementation/merge/rollout ownership.


Review by the Software Engineer role, an agent in Mission Control, for the task Add comment search tool.

Review record copied by Software Engineer at the validator's request. Original author: Security Engineer. Original task: 5f5f5ed8-a003-44eb-b144-84e46e7707a2 Security review of PR #36, pinned locally to 8c0076f6c278f7c3ecf1f8351b3d3f7d6feca1ea using review/comments-manage-36. Inspected git log origin/main..HEAD and git diff origin/main...HEAD (one commit), full service/HTTP/MCP authorization paths, tests, permission registry and ADR 0005. Read Homelab AGENTS.md and security runbooks; no applicable Mission Control AGENTS.md exists. ## Standards No blocking security findings. TaskCommentService.search asserts comments.manage before querying; both HTTP and MCP delegate to that service. AccessContext checks organization access first (foreign organization -> NotFound), owners receive registered permissions, ordinary members receive none, and role permissions are read within the requested organization. Search selects only undeleted comments on live tasks/projects in that organization, uses parameterized tag/time filtering and bounded limits. MCP discovery uses server-derived permissions and a fresh request context; no client-supplied organization or permission override. Role create/update enforce grant-only-what-you-hold; restore delegates to update, so roles.manage alone cannot grant comments.manage. No secrets, dependency/image changes, privileged/host access, exposure manifests, migrations or automatic grants in the diff. ## Spec No blocking findings against Morten's confirmed “Yes agreed” scope. Only organization-wide search is gated. Task-local list/add and author-only edit / author-or-owner delete logic are unchanged. Existing tag/since/limit and deleted/foreign-task tests remain; added service test covers owner/permitted success, member/unpermitted denial, task-local reads and foreign organization denial. MCP baseline tool-list tests exclude search for unpermitted roles; permitted tagged search remains exercised. ## Evidence and limitations Static review only for the new behavior. Owner's recorded evidence: local 663 tests/77 files and checks passed; pipeline 179 and 180 success and exact-head Forge statuses green (parent comment 9b2f2641-3c4c-4056-822f-c40d70223f66). Pipeline: https://woodpecker.olsen.cloud/repos/32/pipeline/179 . I could not independently inspect build results: tea has no available login, woodpecker-cli has no configured context; pnpm absent. Software Engineer must confirm current head and build remain green before merge; a changed head or red/missing build blocks merge. Read live: kubectl get deployment mission-control -n prod -o jsonpath='{.spec.template.spec.containers[*].image}{"\\n"}{.status.readyReplicas}{"\\n"}' -> code.olsen.cloud/ai/mission-control:0.12.0@sha256:d71556bcfd3273415981698eff7ccefa9c7ce0303693c287f39f5d240af4df15; readyReplicas 1. New behavior is not deployed. No mutation performed. Non-blocking UNKNOWN verification limit: rollout behavior not yet observed, rather than an identified vulnerability. After rollout owner verifies expected image/digest/readiness; owner and explicitly permitted role search succeeds; ordinary member HTTP search denies (403), unpermitted role tool is hidden and direct invocation cannot succeed; foreign organization search denies (404), permitted search returns no foreign/deleted task comments; tag/since/limit and task-local comment access still work; nonauthor edit/delete still denied except owner delete. Rollback: revert code/image. Remove any future comments.manage grants before deploying an older permission enum; historical revisions may retain the new string and must not be restored on that older version. Older code restores membership-only organization-wide search, so rollback also restores the broader former access boundary; get Morten's decision if that risk needs acceptance. Standards: 0 findings; worst none. Spec: 0 findings; worst none. One non-blocking UNKNOWN verification limit; no verified CRITICAL/HIGH finding. Security review complete; Software Engineer retains implementation/merge/rollout ownership. --- _Review by the **Software Engineer** role, an agent in Mission Control, for the task [Add comment search tool](https://mission-control.olsen.cloud/home-it/tasks/aeb1579b-9eed-4312-8a37-efd7634f2438)._
paperclip left a comment

Review record copied by Software Engineer at the validator's request. Original author: Designer. Original task: c67bdae2-27b2-4d70-91b8-6ad6facb2b25

Designer review of PR #36 at 8c0076f6c2 — static-only.

Standards

No findings. Reviewed git diff origin/main...HEAD and commit log, permission registry descriptions, existing Role/PermissionOptions → OptionList presentation, docs permission tables, and packages/ui/CLAUDE.md. No applicable AGENTS.md/CONTRIBUTING.md/CODING_STANDARDS.md found. The new action-first description uses the existing identifier-plus-explanation convention. It is shorter than several adjacent descriptions and uses the existing wrapping text container; no component, layout, typography or colour changes.

Spec

No findings. Checked against the parent’s confirmed search-only boundary (Morten’s “Yes agreed”). The visible description is “Search comments across the organization by tag and time.” Although the identifier uses “manage” (Morten’s chosen name), the explanation specifies search. tasks.md explains owners/permitted agents vs ordinary members and unchanged task-local reading/writing; agent-tools.md explicitly excludes editing/deleting another author’s comments and moves search out of the base-tool table. No automatic grants appear in the diff.

Evidence and unverified checks

Static copy/presentation review only; no rendered UI or screenshots captured or supplied. This checkout has no pnpm, installed node_modules, or Chromium/Chrome executable, and no browser/screenshot tool is exposed. Did not run a web runtime or visual interaction checks. Unverified: actual role-editor rendering/wrapping at desktop/mobile viewport sizes, checkbox keyboard/touch interaction and save/reload success, and loading/empty/error/offline presentation. No panel/device viewport was specified; this review concerns the existing web role editor, not a panel design.

Build evidence reviewed from the owner’s parent-task comment: pnpm test 77 files/663 tests passed; typecheck/lint/dependencies/format/pipeline renderings passed; pipeline 179 (PR) and 180 (push) success, six commit checks green. Pipeline: https://woodpecker.olsen.cloud/repos/32/pipeline/179 . Independent command woodpecker-cli pipeline info ai/mission-control 179 could not run because this container’s CLI is not configured. Owner must reconfirm current-head green before merge; no build waiver is given.

After rollout / rollback

Owner should confirm the role editor shows this description, explicit selection saves/reloads without automatic grants, owners/permitted agents can search, ordinary members/unpermitted agents cannot, and task-local comments and author edit/delete restrictions remain unchanged. Remove any later comments.manage grants before reverting to the older code/image.

Standards: 0 findings, worst none. Spec: 0 findings, worst none.


Review by the Software Engineer role, an agent in Mission Control, for the task Add comment search tool.

Review record copied by Software Engineer at the validator's request. Original author: Designer. Original task: c67bdae2-27b2-4d70-91b8-6ad6facb2b25 Designer review of PR #36 at 8c0076f6c278f7c3ecf1f8351b3d3f7d6feca1ea — static-only. ## Standards No findings. Reviewed git diff origin/main...HEAD and commit log, permission registry descriptions, existing Role/PermissionOptions → OptionList presentation, docs permission tables, and packages/ui/CLAUDE.md. No applicable AGENTS.md/CONTRIBUTING.md/CODING_STANDARDS.md found. The new action-first description uses the existing identifier-plus-explanation convention. It is shorter than several adjacent descriptions and uses the existing wrapping text container; no component, layout, typography or colour changes. ## Spec No findings. Checked against the parent’s confirmed search-only boundary (Morten’s “Yes agreed”). The visible description is “Search comments across the organization by tag and time.” Although the identifier uses “manage” (Morten’s chosen name), the explanation specifies search. tasks.md explains owners/permitted agents vs ordinary members and unchanged task-local reading/writing; agent-tools.md explicitly excludes editing/deleting another author’s comments and moves search out of the base-tool table. No automatic grants appear in the diff. ## Evidence and unverified checks Static copy/presentation review only; no rendered UI or screenshots captured or supplied. This checkout has no pnpm, installed node_modules, or Chromium/Chrome executable, and no browser/screenshot tool is exposed. Did not run a web runtime or visual interaction checks. Unverified: actual role-editor rendering/wrapping at desktop/mobile viewport sizes, checkbox keyboard/touch interaction and save/reload success, and loading/empty/error/offline presentation. No panel/device viewport was specified; this review concerns the existing web role editor, not a panel design. Build evidence reviewed from the owner’s parent-task comment: pnpm test 77 files/663 tests passed; typecheck/lint/dependencies/format/pipeline renderings passed; pipeline 179 (PR) and 180 (push) success, six commit checks green. Pipeline: https://woodpecker.olsen.cloud/repos/32/pipeline/179 . Independent command woodpecker-cli pipeline info ai/mission-control 179 could not run because this container’s CLI is not configured. Owner must reconfirm current-head green before merge; no build waiver is given. ## After rollout / rollback Owner should confirm the role editor shows this description, explicit selection saves/reloads without automatic grants, owners/permitted agents can search, ordinary members/unpermitted agents cannot, and task-local comments and author edit/delete restrictions remain unchanged. Remove any later comments.manage grants before reverting to the older code/image. Standards: 0 findings, worst none. Spec: 0 findings, worst none. --- _Review by the **Software Engineer** role, an agent in Mission Control, for the task [Add comment search tool](https://mission-control.olsen.cloud/home-it/tasks/aeb1579b-9eed-4312-8a37-efd7634f2438)._
morten-olsen deleted branch mc/aeb1579b-9eed-4312-8a37-efd7634f2438 2026-10-08 15:19:37 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ai/mission-control!36
No description provided.