Skip to content

feat(enterprise): add workspace resource routes#70

Draft
Gracker wants to merge 1 commit intofeature/enterprise-multi-tenant-legacy-api-wrapperfrom
feature/enterprise-multi-tenant-resource-api
Draft

feat(enterprise): add workspace resource routes#70
Gracker wants to merge 1 commit intofeature/enterprise-multi-tenant-legacy-api-wrapperfrom
feature/enterprise-multi-tenant-resource-api

Conversation

@Gracker
Copy link
Copy Markdown
Owner

@Gracker Gracker commented May 8, 2026

Summary

  • add workspace route context middleware for /api/workspaces/:workspaceId/*
  • mount workspace-scoped trace, report, agent, and provider resource roots on the existing handlers
  • add agent resource aliases for session runs, run SSE lookup, and session respond
  • mark README §0.2.6 complete

Scope note

  • Legacy /api/traces, /api/reports, /api/agent/v1, and /api/v1/providers remain available through the §0.2.5 compatibility wrapper.
  • The new workspace routes intentionally do not emit Deprecation headers.

Verification

  • cd backend && npx jest src/routes/__tests__/workspaceResourceRoutes.test.ts src/routes/__tests__/requestContextRouteCoverage.test.ts src/routes/__tests__/ownerGuardRoutes.test.ts src/middleware/__tests__/legacyApiCompatibility.test.ts --runInBand
  • cd backend && npx jest src/routes/__tests__/agentRoutesRbac.test.ts src/routes/__tests__/enterpriseApiKeyRoutes.test.ts src/middleware/__tests__/auth.test.ts src/services/__tests__/rbac.test.ts --runInBand
  • cd backend && npm run typecheck
  • cd backend && npm run test:scene-trace-regression
  • npm run verify:pr

mr-torto pushed a commit to mr-torto/SmartPerfetto that referenced this pull request May 8, 2026
…Gracker#34, Gracker#51, Gracker#70, Gracker#109, Gracker#112)

MemoryRootCauseContract folds eight memory-class Spark ideas into one
graph contract. Five facets, all optional and provenance-tagged so
missing data surfaces explicitly:
- ProcessMemorySnapshot[] for RSS / Swap / mm_event / oomScoreAdj
  (Spark Gracker#11)
- LmkKillEvent[] tying kills to oom_score_adj and reason (Spark Gracker#12)
- DmaBufAllocation[] for DMA / dmabuf / ion / GPU pressure (Spark Gracker#13)
- MemoryExternalArtifact[] for LeakCanary / KOOM / hprof / baseline
  imports (Spark Gracker#51, Gracker#70, Gracker#109, Gracker#112)
- baselineDiff with topContributors[] for the leak baseline diff graph
  (Spark Gracker#34)

Plan: docs/superpowers/spark/plans/14-memory-lmk-dmabuf.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
mr-torto pushed a commit to mr-torto/SmartPerfetto that referenced this pull request May 8, 2026
…racker#34, Gracker#51, Gracker#70, Gracker#109, Gracker#112)

buildMemoryRootCause folds five orthogonal facets (process snapshots,
LMK events, DMA/DMABUF allocations, external artifacts, baseline diff)
into one MemoryRootCauseContract.

baseline.perCategoryBytes is reduced to topContributors[] sorted by
absolute delta so the largest-impact category surfaces first regardless
of sign (Spark Gracker#34 leak baseline diff graph).

Coverage status is computed per facet: LeakCanary external artifacts
flip Spark Gracker#51/Gracker#70/Gracker#109 to implemented; KOOM artifacts flip Spark
Gracker#112; baselineDiff flips Spark Gracker#34. Missing facets remain scaffolded
so the contract honestly records partial coverage.

When every facet is omitted, the contract is marked unsupportedReason
rather than emitting an empty graph that consumers might mistake for
"no memory pressure observed".

Tests: 4 cases covering facet pass-through, topContributors ordering,
LeakCanary status promotion, and unsupported.

Plan: docs/superpowers/spark/plans/14-memory-lmk-dmabuf.md

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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