8000 feat(entities): entity setup per namespace or collection, and types of your own by adeelahmad · Pull Request #63 · adeelahmad/lense · GitHub
[go: up one dir, main page]

Skip to content

feat(entities): entity setup per namespace or collection, and types of your own - #63

Merged
adeelahmad merged 2 commits into
mainfrom
claude/project-thread-2qdx7m
Oct 3, 2026
Merged

adeelahmad merged 2 commits into
mainfrom
claude/project-thread-2qdx7m

Conversation

@adeelahmad
Copy link
Copy Markdown
Owner

Requested by Adeel · project thread

Description

Before: every namespace kept every entity type the extractors found, and the nine built-in types were the only ones.

After: the Entities page has Types and Setup tabs.

  • Setup: a namespace's setup says which types it keeps (names of other types are left out when a recording is analysed) and what the namespace is about. Any collection can have its own setup, which also holds for the collections inside it; a recording follows the nearest collection with one, else its namespace. Editors of the namespace change its setup and any collection's; editors of a collection change that collection's.
  • Types: a namespace can add types of its own ("Client team" becomes CLIENT_TEAM) with a description of what counts as one. Retype and move-mention accept them, lists show their labels, and a type can be deleted once no entity has it.

API: GET/PUT /api/v1/namespaces/{name}/entity-setup, DELETE …/entity-setup/collections/{cid}, POST/PATCH/DELETE /api/v1/namespaces/{name}/entity-types[/{code}], and GET /api/v1/entities/types?ns= now includes the namespace's own types with descriptions. All changes are audited. New tables entity_scope and entity_kind are defined in the schema (SurrealDB server needs them). The default setup reproduces today's behaviour.

The setup's mode is only self for now; fixed and hybrid modes (with Unknown and Unlabeled) come in the next PRs, which is why the API accepts just that one value.

Motivation and Context

Third of a series of small PRs for per-namespace and per-collection entity modes.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change; ! in the title)

Checklist:

  • The title is a Conventional Commit.
  • My code follows the code style of this project (ruff, mypy, eslint, prettier, tsc).
  • I added or updated tests (tests/api/test_entity_setup.py, entities-model.test.ts).
  • My change requires documentation updates, and I have updated docs/ accordingly (processing.md, Entity setup).
  • Users need more than the title to understand it, so I wrote it under ## Unreleased in CHANGELOG.md.

Local checks: backend 342 passed (only test_office_and_text_files_become_documents fails, as on main: this machine's LibreOffice can't load the .docx); frontend jest 544 passed. Checked both tabs in a browser against a seeded archive.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VmPYPheY7aGQv9TiA563P5


Generated by Claude Code

claude added 2 commits October 3, 2026 00:49
…f your own

Entities gets Types and Setup tabs. A namespace's setup says which entity
types it keeps (names of other types are left out when a recording is
analysed) and what it is about; any collection can have its own setup,
which holds for the collections inside it too. Namespaces can add their
own entity types with a description of what counts as one; retyping and
moving mentions accept them, and lists show their labels.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VmPYPheY7aGQv9TiA563P5
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VmPYPheY7aGQv9TiA563P5
@adeelahmad adeelahmad self-assigned this Oct 3, 2026
@adeelahmad
adeelahmad merged commit f08392e into main Oct 3, 2026
1 check failed
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

0