feat(pack-kg): EntityTypeRegistry, param aliases, actor filter (#345, #274, #395, #497)#500
Conversation
Merge sequence
Merge #499 first — PRs #500, #502, #503 depend on it (GitHub auto-retargets on merge). |
|
@codex review |
There was a problem hiding this comment.
💡 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".
| let norm = raw_et.trim().to_ascii_lowercase(); | ||
| Some(norm) |
There was a problem hiding this comment.
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 👍 / 👎.
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>
0a1c710 to
233e779
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
EntityTypeRegistrywith OnceLock global, alias resolution ("algo" → "algorithm"), kind inferenceentity_typevalidated against registry increate/list/searchhandlersmergealiases:winner_id/loser_id,target_id/source_idtraversealias:start_ids"*"for all)Closes #345, #274, #395, #497
Stacked on #499 (authorize → Result)
Test plan
cargo check --workspacepasses🤖 Generated with Claude Code