Skip to content

docs(world-model): describe what the current schema enables#373

Merged
buremba merged 1 commit into
mainfrom
docs/world-model-update
Apr 26, 2026
Merged

docs(world-model): describe what the current schema enables#373
buremba merged 1 commit into
mainfrom
docs/world-model-update

Conversation

@buremba
Copy link
Copy Markdown
Member

@buremba buremba commented Apr 26, 2026

Reframes `docs/plans/world-model.md` from a project-tracking artifact into a clean architecture description.

What changed

  • Drops the PR-tracking sections (Wave 1/2/3/4, "PRs to close", "Lessons learned: install-flow attempt") — those reflected work-in-progress that's no longer relevant
  • Keeps the conceptual content: primitives, org topology, cross-org reference rules, identity, templates, contribution flow, tax / agent-community use cases, invariants, deferred work
  • Adds explicit notes that the current schema supports the world model: `organization.visibility`, `entity_types.id` global FK reference (feat(db)!: convert entities.entity_type to entity_type_id FK #370), `$member` + `entity_identities` auto-provisioned on signup

163 lines, no PR archaeology.

Test plan

  • `bun run check` (Biome) clean

Reframes from a project-tracking artifact into a clean architecture
description. Drops PR/wave tables and revert archeology; explains how the
existing schema (per-org `entities`, `entity_types.id` global FK reference,
`organization.visibility`, `$member` + `entity_identities`) supports the
world-model story end-to-end.

163 lines, organised: TL;DR → primitives → org topology → cross-org
references → identity → templates → contribution flow → tax / agent
community use cases → invariants → deferred work.
@buremba buremba merged commit f394426 into main Apr 26, 2026
12 checks passed
@buremba buremba deleted the docs/world-model-update branch April 26, 2026 21:50
@github-actions github-actions Bot added the triage:needs-human Triage agent escalated for human review label Apr 26, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Triage decision: needs-human

Reasons:

  • PR size exceeds auto-merge threshold (392 lines; limit 300 lines)
  • Documentation change to world-model architecture requires human review

Next: Manual review and merge required due to size threshold

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4355575609

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/plans/world-model.md
Comment on lines +52 to +54
- Write-side guard: when inserting an `entity_relationship`, validate that
the target's org is either the same as the source or has
`visibility='public'`. The relationship's organization_id always matches
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Mark tenant→public relationship writes as not yet implemented

This section describes the cross-org write guard as current behavior, but the code path still rejects all cross-org links: validateScopeRule enforces both entities belong to ctx.organizationId and manage_entity always calls it before insert (packages/owletto-backend/src/utils/relationship-validation.ts, packages/owletto-backend/src/tools/admin/manage_entity.ts). The integration test should reject cross-org relationship in multi-tenant mode also codifies this (packages/owletto-backend/src/__tests__/integration/relationships/entity-relationships.test.ts). As written, readers will expect tenant→public edges to work today when they do not.

Useful? React with 👍 / 👎.

Comment thread docs/plans/world-model.md
Comment on lines +56 to +60
- Lookup of `entity_types` widens at write time via a **schema search path**:
the agent declares which public catalogs it operates over, and the runtime
walks [user's tenant org, then each declared catalog] when resolving a
slug → `entity_type_id`. The resolved id is materialized on the entity row,
so reads never need the search path.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid claiming catalog search-path type resolution exists now

The document now states that write-time entity type lookup walks [tenant org, declared catalogs], but the current writers resolve type slugs only within the current org (WHERE slug = ... AND organization_id = ...) and return unknown-type errors otherwise (packages/owletto-backend/src/utils/entity-management.ts, packages/owletto-backend/src/utils/entity-link-upsert.ts). There is no corresponding uses_catalog-driven lookup in the write path, so this text overstates present functionality and can mislead implementers about cross-org vocabulary support.

Useful? React with 👍 / 👎.

@buremba buremba restored the docs/world-model-update branch May 12, 2026 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

triage:needs-human Triage agent escalated for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant