Skip to content

test(enterprise): cover auth route guards#72

Draft
Gracker wants to merge 1 commit intofeature/enterprise-multi-tenant-workspace-selection-uifrom
feature/enterprise-multi-tenant-auth-test-coverage
Draft

test(enterprise): cover auth route guards#72
Gracker wants to merge 1 commit intofeature/enterprise-multi-tenant-workspace-selection-uifrom
feature/enterprise-multi-tenant-auth-test-coverage

Conversation

@Gracker
Copy link
Copy Markdown
Owner

@Gracker Gracker commented May 8, 2026

Summary

  • close §0.2.8 by making the RequestContext/RBAC/owner-guard/legacy-wrapper coverage part of backend test:core
  • add legacy agent API rejection/pass-through tests for removed /api/agent/* paths and mapped successors
  • extend legacy route coverage so agent and provider compatibility paths still run RequestContext auth before handlers
  • mark README §0.2.8 complete

Validation

  • PATH="$HOME/.nvm/versions/node/v24.15.0/bin:$PATH" npx jest --runInBand --forceExit src/middleware/__tests__/auth.test.ts src/services/__tests__/rbac.test.ts src/routes/__tests__/agentRoutesRbac.test.ts src/routes/__tests__/ownerGuardRoutes.test.ts src/routes/__tests__/requestContextRouteCoverage.test.ts src/middleware/__tests__/legacyApiCompatibility.test.ts in backend
  • PATH="$HOME/.nvm/versions/node/v24.15.0/bin:$PATH" npm run test:core in backend
  • git diff --check
  • PATH="$HOME/.nvm/versions/node/v24.15.0/bin:$PATH" npm run verify:pr

mr-torto pushed a commit to mr-torto/SmartPerfetto that referenced this pull request May 8, 2026
, Gracker#33, Gracker#49, Gracker#68, Gracker#69, Gracker#72, Gracker#78, #132)

StartupAnrMethodGraphContract bundles the startup / ANR / method-trace
attribution graph. Four facets, all optional:
- StartupPhaseRow[] with ART verifier / JIT / class loading / Compose
  recomposition / Startup library initializers (Spark Gracker#32, Gracker#68, Gracker#69,
  #132)
- AnrAttribution[] joining traces.txt thread samples to method-trace
  evidence (Spark Gracker#33, Gracker#49)
- MethodTraceNode[] for Matrix / BTrace / RheaTrace / KOOM / bytecode
  imports (Spark Gracker#72, Gracker#78)
- Reused JankDecisionNode (Plan 10) for the decision tree shape

StartupPhase uses string union so future Perfetto stdlib startup phases
do not require an enum bump.

Plan: docs/superpowers/spark/plans/17-startup-anr-memory-graphs.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
buildStartupAnrMethodGraph fuses startup phase rows, ANR attribution and
method-trace nodes into one StartupAnrMethodGraphContract. Coverage is
computed per spark dimension based on input shape:
- Phases with art/JIT/class-loading timings flip Spark #132
- Phases with non-zero recompositionCount flip Spark Gracker#68
- Phases with initializersFired flip Spark Gracker#69
- ANR attribution flips Spark Gracker#33; thread samples flip Spark Gracker#49
- Method-trace nodes with source matrix/btrace/rheatrace/koom flip
  Spark Gracker#72; bytecode source flips Spark Gracker#78

The pruneMethodTraceChildren helper drops dangling child ids from the
node graph so the contract is always renderable even when upstream
importers emit incomplete data.

Tests: 5 cases covering ART promotion, recomposition promotion, dangling
children pruning, source-based promotion, and unsupported.

Plan: docs/superpowers/spark/plans/17-startup-anr-memory-graphs.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