Skip to content

docs: add ADR 005 — Organization entity and assistant derivation#66

Open
martinydeAI wants to merge 1 commit into
developfrom
feature/issue-65-adr-organization-entity
Open

docs: add ADR 005 — Organization entity and assistant derivation#66
martinydeAI wants to merge 1 commit into
developfrom
feature/issue-65-adr-organization-entity

Conversation

@martinydeAI

Copy link
Copy Markdown
Collaborator

Summary

Adds ADR 005 recording the Organization entity, its metadata,
its relations to User and Assistant, and the derivation flow
that pre-fills framework + language model on new assistants from
the creator's organisation.

Closes #65.

Highlights

  • Organization is a first-class entity with name, e-mail
    domain(s), defaultFramework, defaultLanguageModel.
  • UserOrganization is M:1, set at signup time by
    matching the user's e-mail domain against
    Organization.emailDomains.
  • AssistantOrganization is M:N — multiple kommuner can
    use the same assistant.
  • Assistant.framework and Assistant.languageModel are stored
    on the assistant as a snapshot at creation, not joined
    through the org at read time. An org switching its default LM
    next year must not silently rewrite last year's catalogue.

Interaction with ADR 004

ADR 004's REGISTRATION_ALLOWED_EMAIL_DOMAINS env var is
superseded by Organization.emailDomains once Organization
lands. Until that happens, the env var stays as the bootstrap
mechanism. ADR 004 itself doesn't need re-deciding — this is
exactly the "graduate to a Domain entity" follow-up it
anticipated.

Implementation outline

The ADR sketches three downstream pieces (issues to file alongside
or shortly after):

  1. Organization entity + migration + User.organization_id FK.
  2. Registration allow-list switchover (/register validates
    against registered orgs instead of the env var).
  3. Assistant entity (Define assistant data model #14) gets framework, languageModel, and
    the organizations M:N; the creation flow derives defaults
    from the creator's org.

Test plan

  • task coding-standards-markdown-check → clean.
  • Reviewer confirms snapshot-vs-live-derive is the desired
    durability story (i.e. existing assistants keep their
    original framework / LM if an org changes its default
    later).
  • Reviewer confirms one-org-per-user is acceptable as the
    starting model (consultants / cross-org users would need a
    future M:N).

Closes #65

🤖 Generated with Claude Code

Records Organization as a first-class entity with name, e-mail domain(s), default framework, and default language model. User belongs to one organisation (M:1, matched on the user's email domain at signup); Assistant is used by many (M:N). framework and languageModel on new assistants are populated from the creator's organisation as a snapshot at creation time, not joined live, so an org switching its default LM later does not silently rewrite older catalogue rows.

Supersedes ADR 004's env-var REGISTRATION_ALLOWED_EMAIL_DOMAINS as soon as Organization lands — that env var becomes the bootstrap mechanism only and is removed in the registration switchover.

Closes #65. Status: Draft.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@martinyde

martinyde commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

In my opinion this makes sense.

We will however need a crud setup for administering the entity. The entities can also be maintained through an API, if the project owner has a centralized data source of orgnaizations and their AI setup, or this site could act as data source and expose an API of Organizations and their AI setup.

The right approach depends on how the project owner wants their flow of data

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.

Decide on Organization entity, metadata, and assistant-creation derivation flow

2 participants