Skip to content

docs: Ambient ERD and RBAC Software Factory proposal#759

Open
markturansky wants to merge 1 commit intoambient-code:mainfrom
markturansky:docs/rbac-proposal
Open

docs: Ambient ERD and RBAC Software Factory proposal#759
markturansky wants to merge 1 commit intoambient-code:mainfrom
markturansky:docs/rbac-proposal

Conversation

@markturansky
Copy link
Contributor

@markturansky markturansky commented Mar 2, 2026

Jira: RHOAIENG-51884

Summary

  • Adds docs/internal/design/ambient-erd.md — canonical Mermaid ERD of the current Ambient data model, derived directly from openapi.yaml. This is the living spec: future Kind additions are proposed as diffs against it.
  • Adds docs/internal/proposals/rbac-rolebinding.md — proposal to add first-class RBAC using the Software Factory pattern.

Design Decisions

Static vs Dynamic:

  • Permission and Role are static Go constants/structs — compile-time safety, TDD-friendly, no DB table
  • RoleBinding is the only new database-backed Kind (one TRex generator invocation)

Three binding scopes:

  • Global (project_id = null, session_id = null)
  • Workspace (project_id = <id>, session_id = null)
  • Session (project_id = <id>, session_id = <id>)

API-native enforcement — permission middleware in ambient-api-server only; no Kubernetes RBAC sync required.

How to use these docs

  1. Review ambient-erd.md as the current state spec
  2. Review rbac-rolebinding.md as the proposed diff (adds RoleBinding Kind, removes group_access JSON blob)
  3. If accepted, update ambient-erd.md to include RoleBinding and the Software Factory executes the cascade

🤖 Generated with Claude Code

- docs/internal/design/ambient-erd.md: canonical Mermaid ERD of the
  current ambient-api-server data model (User, Project, ProjectSettings,
  Session) derived directly from openapi.yaml. This document is the
  living spec — future Kind additions are proposed as diffs against it.

- docs/internal/proposals/rbac-rolebinding.md: proposal to add
  first-class RBAC to the API using the Software Factory pattern.
  Permissions and Roles are static Go (type-safe, TDD-friendly);
  RoleBinding is the only new database-backed Kind (generated by TRex).
  Three binding scopes: global, workspace, session. Enforced entirely
  within ambient-api-server — no Kubernetes RBAC sync required.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@ambient-code ambient-code bot added this to the Merge Queue milestone Mar 2, 2026
@jeremyeder
Copy link
Contributor

This feature falls into what we might consider a "core" feature of ACP. I propose we start picking up spec-kit opportunistically for "core" work. This could be the first one to do it. We have to agree together. I added a note for standup.

@ambient-code ambient-code bot modified the milestones: Merge Queue, Review Queue Mar 12, 2026
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.

2 participants