Commit cedf12b
feat(org-relations, org-tags): org↔org edges + org tags land as six capabilities
Organizations can finally know about each other: parent/child/peer
relations with a typed kind and free-text description, plus the first
org-level tag mechanism (has_tag observations + the existing tag_vocab).
Everything reachable over the wire — no direct DB writes needed.
New module services/record-surrealdb-resolver/src/org-relations.ts serves
organization.relate / relations / unrelate / relation.update and
organization.tag.add / tag.remove. Org→org edges ride the SAME affiliations
RELATE table as person→org edges with an explicit edge_type='org_org'
discriminator; canonical direction in=child/out=parent, stored rel
'child_of'|'peer', parent/child/peer projected at read time relative to the
focused org. One relation per pair (both-direction dedup, client_access
union on re-relate). related_to / relation_removed observations for the
audit trail.
resolver.ts: organization.detail now returns tags: string[] (per-client
has_tag observations — never fields on the shared multi-tenant org row).
domains.ts: ensureTagInVocab exported for reuse; tags keep the house
toDashed behavior (dashes-not-spaces, operator owns casing).
capabilities.ts: six verb→subject entries + 30s timeouts.
Verified: tsc clean on both services; resolver boots with the new
registrations; live NATS checks — relations trichotomy read, self-relate
guard localized ok:false, detail.org.tags present.
Refs #49 #50 (one module, one commit — tags and relations share the slab).
Files changed:
- services/record-surrealdb-resolver/src/org-relations.ts (new)
- services/record-surrealdb-resolver/src/resolver.ts
- services/record-surrealdb-resolver/src/domains.ts
- services/record-surrealdb-resolver/src/server.ts
- services/workspace/src/capabilities.ts
- changelog/2026-07-27_01_Organizations-Learn-Their-Family-Tree-Parent-Child-Peer-Relations-Plus-Org-Tags.md
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RW28dw3kQAKXr2ZNefCukE1 parent 570d0b6 commit cedf12b
6 files changed
Lines changed: 480 additions & 1 deletion
File tree
- changelog
- services
- record-surrealdb-resolver/src
- workspace/src
Lines changed: 47 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
| 119 | + | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
| |||
0 commit comments