Skip to content

feat(pack-kg): EntityTypeRegistry, param aliases, actor filter (#345, #274, #395, #497)#500

Merged
ohdearquant merged 4 commits into
mainfrom
feat/entity-type-registry
May 27, 2026
Merged

feat(pack-kg): EntityTypeRegistry, param aliases, actor filter (#345, #274, #395, #497)#500
ohdearquant merged 4 commits into
mainfrom
feat/entity-type-registry

Conversation

@ohdearquant
Copy link
Copy Markdown
Owner

Summary

  • New EntityTypeRegistry with OnceLock global, alias resolution ("algo" → "algorithm"), kind inference
  • entity_type validated against registry in create/list/search handlers
  • merge aliases: winner_id/loser_id, target_id/source_id
  • traverse alias: start_ids
  • Actor-scoped proposal listing (defaults to caller, "*" for all)

Closes #345, #274, #395, #497

Stacked on #499 (authorize → Result)

Test plan

  • cargo check --workspace passes
  • Entity type validation rejects unknown subtypes with helpful error
  • Alias params accepted by merge/traverse

🤖 Generated with Claude Code

@ohdearquant
Copy link
Copy Markdown
Owner Author

Merge sequence

Order PR Description Base Status
1 #499 authorize() → Result main Codex: fixed
2 #500 EntityType registry #499 Codex: fixed
3 #501 Lifecycle tests main Codex: fixed
4 #502 Memory/brain/knowledge #499 Codex: fixed
5 #503 Write-key conflicts #499 Codex: fixed
6 #504 Vamana ANN index main Codex: fixed
7 #505 Brain section posteriors main Codex: fixed
8 #506 Runtime backfill/sweep/pipeline main Codex: fixed
9 #507 KG namespace isolation main New

Merge #499 first — PRs #500, #502, #503 depend on it (GitHub auto-retargets on merge).

@ohdearquant
Copy link
Copy Markdown
Owner Author

@codex review

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: 0a1c710583

ℹ️ 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 on lines +1859 to +1860
let norm = raw_et.trim().to_ascii_lowercase();
Some(norm)
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 Normalize unscoped entity_type aliases before filtering

When callers filter across all entity kinds, e.g. list(kind="entity", entity_type="algo"), this branch only lowercases the alias and then passes it to the exact entity_type filter. The same change now normalizes creates through the registry, so entity_type="algo" is stored as algorithm; listing or searching without also specifying entity_kind="concept" will therefore return no matches for accepted aliases. Please resolve the unscoped value through the registry's bare lookup (or reject aliases without a kind) before building the filter; the search path has the same fallback at lines 2421-2426.

Useful? React with 👍 / 👎.

Base automatically changed from fix/authorize-result to main May 27, 2026 21:59
ohdearquant and others added 3 commits May 27, 2026 18:08
F1 [CRITICAL]: Remove "service"/"svc" from Project subtypes — they collided
with EntityKind::Service.  EntityKind::from_str("service") resolves to
EntityKind::Service, not Project, making the old entry unreachable and
semantically wrong.

F2 [MAJOR]: Fix double-filter on proposal list when explicit proposer param
is provided.  The actor default (caller ID) was applied unconditionally, so
`proposer="alice"` produced `AND proposer = 'alice' AND proposer = '<caller>'`
and silently returned zero rows.  Now the actor default is skipped when the
caller supplies an explicit proposer.

F3 [MAJOR]: Align BUILTIN_DEFS with ADR-001 canonical subtype tables:
- Concept: add theory, design_pattern, mathematical_operation, metric,
  objective; rename "model" canonical to "model_family" (alias: "model")
- Dataset: add all six ADR-001 subtypes (benchmark, corpus, training_set,
  evaluation_set, test_set, synthetic_dataset); benchmark moved from Concept
- Document: add blog_post, book, documentation, thesis
- Project: replace removed "service"/"svc" with framework, application,
  repository per ADR-001
- Org: normalise to ADR-001 names (academic_institution replaces university,
  research_lab replaces lab; add nonprofit, government_agency, consortium,
  standards_body)
- Artifact: add snapshot, export, embedding_index, state_bundle, profile
- Service: add all seven ADR-001 subtypes (inference_engine, retrieval_engine,
  embedding_engine, api, database, search_engine, mcp_server)

Add 8 new unit tests covering each fix. All 78 lib tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ohdearquant ohdearquant force-pushed the feat/entity-type-registry branch from 0a1c710 to 233e779 Compare May 27, 2026 22:10
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ohdearquant ohdearquant merged commit 0377013 into main May 27, 2026
1 of 3 checks passed
@ohdearquant ohdearquant deleted the feat/entity-type-registry branch May 27, 2026 22:22
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.

[follow-up to #337] Implement EntityTypeRegistry per ADR-001 — currently entity_type stored without validation

1 participant