Skip to content

feat: add base Assistant entity (#14)#67

Open
martinydeAI wants to merge 1 commit into
feature/issue-2-user-loginfrom
feature/issue-14-assistant-base-entity
Open

feat: add base Assistant entity (#14)#67
martinydeAI wants to merge 1 commit into
feature/issue-2-user-loginfrom
feature/issue-14-assistant-base-entity

Conversation

@martinydeAI

Copy link
Copy Markdown
Collaborator

Summary

Adds the base Assistant Doctrine entity with the six fields you
asked for: id, title, description, languageModel, framework,
and tags (a JSON list of strings). Repository + migration + a small
test class that round-trips the entity through the entity manager to
keep us at 100 % coverage.

What this covers from existing issues

Dependency on PR #59

This branch is cut from feature/issue-2-user-login (PR #59,
currently open) because the Doctrine ORM bundles, the PHPUnit
harness, and the test schema setup all live there. Carries the
do-not-merge label until #59 lands; rebase onto develop after
that and the label can come off.

Changes

  • src/Entity/Assistant.php — entity with the six base fields,
    constructor that requires everything except tags, array_values()
    reindex in setTags() so tags serialises as a JSON array (not an
    object).
  • src/Repository/AssistantRepository.php — standard
    ServiceEntityRepository<Assistant>.
  • migrations/Version20260612120840.php — creates the assistant
    table with the matching columns.
  • tests/Entity/AssistantTest.php — three cases:
    • persist + reload round-trip
    • setter round-trip
    • default-empty + array_values reindex regression
  • CHANGELOG.md — entry under [Unreleased] / Added referencing
    Define assistant data model #14 and Tags and categories for assistants #16.

Test plan

  • task test-coverage → 35 / 35 tests, 86 assertions, 100 %.
  • task coding-standards-check → green across PHP, Twig, YAML,
    JS, CSS, Markdown, Composer.
  • doctrine:migrations:migrate -n applies cleanly on a fresh
    local DB.

Refs #14, #16. Depends on #59.

🤖 Generated with Claude Code

App\Entity\Assistant with the six base fields requested for now: id, title, description, languageModel, framework, and tags (a JSON list<string>). Migration creates the table. Constructor requires all non-tag fields; tags default to an empty list and array_values()-reindex on set so JSON serialises as an array, not an object.

Per ADR 005, languageModel and framework are stored on the assistant as a snapshot (not a live reference through Organization) so an organisation changing its default later doesn't silently rewrite older catalogue rows. The Organization linkage itself, plus the richer #14 scope (system prompt, parameters, OpenWebUI mapping, versioning) and the tag display side of #16, are deferred to follow-on PRs.

Tests: 35 cases, 86 assertions, 100% coverage. Two round-trip tests through the entity manager prove persistence + hydration of every getter/setter, plus a regression test for the tags array_values() reindex.

Refs #14, #16. Depends on PR #59 (Doctrine + PHPUnit foundation).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@martinydeAI martinydeAI added the do-not-merge Block merging until external dependency lands label Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge Block merging until external dependency lands

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant