Skip to content

feat(message-policies): expose hub.message_policies to web and pin project capabilities (U0) - #9700

Closed
ptone wants to merge 4 commits into
mainfrom
scion/mp-ui-u0
Closed

ptone wants to merge 4 commits into
mainfrom
scion/mp-ui-u0

Conversation

@ptone

@ptone ptone commented Nov 27, 2026 •

Copy link
Copy Markdown
Owner

U0: web-readable hub.message_policies flag + capability pinning; no UI.

9b207b3's agent_dm qualification is withdrawn (evidence: production path is evaluated); head bd0f143 restores the 964f1d5 coverage wording. No behaviour change.

Summary of changes

  • Web-readable experiment flag (A1):
    • Added LayerWeb to hub.message_policies in pkg/experiments/registry.go (Layers: []Layer{LayerServer, LayerWeb}), updated TestMessagePoliciesExperimentRegistered (pkg/experiments/registry_test.go), added TestResolvedExperiments_IncludesMessagePolicies (pkg/hub/experiments_test.go), and updated docs-site/src/content/docs/reference/experiments.md to mark hub.message_policies as server and web layers.
    • Added MESSAGE_POLICIES_FLAG and messagePoliciesEnabled() in web/src/utils/feature-flags.ts (following SYSTEM_ONE_FLAG) with unit tests in web/src/utils/feature-flags.test.ts. No page, route, or UI is added.
  • Registry Description rewrite:
    • Refreshed the hub.message_policies registry Description (and MessagePolicies doc comment, including the update CLI subcommand) to match current pkg/messagepolicy.Coverage() enforcement: covered surfaces are now agent_to_user, agent_to_conversation, agent_dm, and mention_delivery; uncovered agent paths remain group_post, group_set, mention_fanout, and broadcast (reported in coverage.uncovered_agent_paths). Also documented server vs web layer behavior.
  • Perf-budget fixture refresh:
    • Added hub.message_policies (false / boolean) to /api/v1/experiments in web/e2e-perf/budgets/fixture.mjs and web/e2e-perf/budgets/fixture-schema.json to keep TestPerfBudget_AgentEndpoints and web/e2e-perf/budgets/fixture.test.mjs in parity.
  • Capability pinning test (A5):
    • Added TestProjectCapabilities_MessagePolicyAndSystemOneActions in pkg/hub/capabilities_test.go pinning manage_message_policies, read_message_policies, and manage_system_one_instances on ResourceActions["project"] and GET /api/v1/projects/{id} _capabilities.actions (project-owner, project-admin, hub-admin receive all three; project-member and project-viewer receive read_message_policies only). No authorization changes were made.

Verification gates

Base commit c78a2272f5eac402d893ab1408924199db35d8f8 (all code & test changes):

Gate Command Result
Go fmt make fmt-check PASS
Go build go build -buildvcs=false ./... PASS
Experiments unit tests go test -buildvcs=false -v ./pkg/experiments/... PASS
Scoped golangci-lint GOGC=40 golangci-lint run --new-from-rev=main --concurrency=1 ./pkg/experiments/... PASS
Web typecheck cd web && npm run typecheck PASS
Web lint cd web && npm run lint PASS
Web unit test cd web && npx vitest run src/utils/feature-flags.test.ts PASS
Web perf fixture parity cd web && npm run test:e2e-perf PASS
Web build + orphans + bundle budget cd web && npm run build && npm run check:orphans && node scripts/check-bundle-budget.mjs PASS
Hub shard 6 vet (experiments + perf budget) make vet-hub-shard SHARD=6 PASS
Hub shard 6 test (NOSQLITE=1) make test-hub-shard SHARD=6 NOSQLITE=1 PASS
Hub shard 6 test (SQLite) make test-hub-shard SHARD=6 PASS
Hub shard 7 vet (capabilities) make vet-hub-shard SHARD=7 PASS
Hub shard 7 test (NOSQLITE=1) make test-hub-shard SHARD=7 NOSQLITE=1 PASS
Hub shard 7 test (SQLite) make test-hub-shard SHARD=7 PASS

Follow-up doc/comment commit 964f1d5ef7663286c0cf1c442bd10bf71cc5181d:

Gate Command Result
Go fmt make fmt-check PASS
Experiments unit tests go test -buildvcs=false -v ./pkg/experiments/... PASS
Docs link check make check-docs-links PASS

Revert commit bd0f14325ff378c9c69a62cdf4301a407d831b45 (reverts 9b207b36; tree identical to 964f1d5e):

Gate Command Result
Go fmt make fmt-check PASS
Experiments unit tests go test -buildvcs=false -v ./pkg/experiments/... PASS
Docs link check make check-docs-links PASS

Not run locally (left to CI): golangci-lint --tests=false ./pkg/hub (no non-test pkg/hub files changed), full web Vitest suite, docs-site Astro/D2 build, and untouched hub shards.

@ptone

ptone commented Nov 28, 2026

Copy link
Copy Markdown
Owner Author

Merged upstream in GoogleCloudPlatform#5763 (merge commit 08332633). Closing staging PR.

@ptone ptone closed this Nov 28, 2026
@ptone
ptone deleted the scion/mp-ui-u0 branch November 28, 2026 04:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant