TTD-105: Add Agentic, Skill, and Context Repository typedefs#901
TTD-105: Add Agentic, Skill, and Context Repository typedefs#901Aryamanz29 merged 11 commits intomainfrom
Conversation
Adds Python SDK support for the new Agentic hierarchy introduced in atlanhq/models#1942 (TTD-105): Agentic supertype under Catalog, with Skill/SkillArtifact and ContextRepository/ContextArtifact concrete types plus a shared Artifact/Context base. - New assets under pyatlan/model/assets/core: agentic, artifact, skill, skill_artifact, context, context_repository, context_artifact. - Creators on the four concrete types use NanoID-based qualifiedName patterns: default/skill/{id}, default/context/{id}, and {parent_qn}/artifact/{kind}/{id} for artifacts. Artifact creators auto-populate the parent relationship ref. - New ContextLifecycleStatus enum (DRAFT/ACTIVE/DEPRECATED/ARCHIVED). - FileType enum bumped to match models 1.1 (adds yaml, sql). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Aryamanz29
left a comment
There was a problem hiding this comment.
Code Review — TTD-105: Agentic, Skill, and Context Repository typedefs
Overall
Clean, well-structured PR that adds the Agentic type hierarchy following existing pyatlan asset patterns closely. The type hierarchy (Catalog → Agentic → Skill/Context → SkillArtifact/ContextArtifact) is sound, creators use NanoID-based qualifiedName patterns correctly, and parent refs are auto-populated. The new ContextLifecycleStatus enum and FileType additions (yaml, sql) match models 1.1.
Positives
- Consistent patterns: All 7 new model files follow the exact same structure as existing assets (type_name validator,
_convenience_properties, getter/setter pairs,Attributesinner class, bottom-of-file circular import resolution) - Creator validation:
validate_required_fieldsis used consistently on all 4 concrete types - NanoID qualifiedNames: Patterns are clean and documented in the PR description
- Relationship wiring:
skill_source/context_repositoryrefs are auto-populated by creators viaref_by_qualified_name - Forward refs: All
update_forward_refscalls are wired incore/__init__.py
Suggestions
-
Docstrings: All 7 new classes have
"""Description"""as their docstring. Would be good to replace with actual descriptions matching the typedef definitions (e.g.,"""A skill represents a reusable capability within the Agentic hierarchy."""). Low priority but improves discoverability. -
Artifact.file_assetstype: Inartifact.py:96,file_assetsis typed asOptional[Asset](singular). Should this beOptional[List[Asset]]based on the relation being namedfileAssets(plural)? Same question forContextArtifact.file_assets. Worth verifying against the metastore typedef. -
Missing
FILE_ASSETSfield re-declaration inContextArtifact:ContextArtifactextendsContext(notArtifact), so it re-declaresARTIFACT_VERSION,FILE_TYPE,FILE_PATH, andFILE_ASSETSclass fields. This is correct for the diamond inheritance pattern, but thefile_assetsattribute inContextArtifact.Attributesshadows the one fromContext.Attributes(which doesn't have it) andArtifact.Attributes(which does). SinceContextArtifactdoesn't extendArtifactin the MRO, this is fine — just noting it's intentional. -
ContextArtifactmissingcontext_repository_qualified_nameinAttributes.creator: The creator correctly setscontext_repository_qualified_nameon the attributes, which is good — this enables theContext.CONTEXT_REPOSITORY_QUALIFIED_NAMEfield to work for search. Looks complete. -
Enum ordering in
FileType:YAMLandSQLare added beforeMD. The enum appears to be in alphabetical order up toHYPER, thenYAML/SQL/MDbreak that pattern. Minor nit — could reorder toMD,SQL,YAMLfor consistency, but this doesn't affect functionality.
Tests
I've written 40 unit tests and integration tests covering:
- Unit (
tests/unit/model/):agentic_test.py— type hierarchy, MRO, isinstance checksskill_test.py— creator validation, unique QN generation, getter/setter, immutabilityskill_artifact_test.py— creator validation (3 params), QN pattern verification, file type variants (YAML/SQL),skill_sourceref populationcontext_repository_test.py— creator validation, lifecycle status enum round-trip, all ContextLifecycleStatus valuescontext_artifact_test.py— creator validation (3 params), QN pattern, file type variants (YAML/SQL/MD),context_repositoryref population, artifact_version/file_path setters
- Integration (
tests/integration/agentic_test.py):- CRUD for all 4 concrete types (Skill, SkillArtifact, ContextRepository, ContextArtifact)
- Retrieve by GUID with relationships
- Certificate update on Skill
- Delete + restore cycle for ContextArtifact
All 40 unit tests pass. Will push the test files to the branch.
Verdict
Approve — solid implementation following established patterns. The docstring and file_assets type suggestions are low priority and can be addressed in a follow-up.
- 40 unit tests covering Agentic, Skill, SkillArtifact, ContextRepository, and ContextArtifact models - Tests validate creators, NanoID QN generation, type hierarchy, getter/setter round-trips, enum variants, parent ref population - Integration tests cover CRUD, retrieve, certificate update, delete+restore for all 4 concrete types
Add asset and attribute method templates for Skill, SkillArtifact, ContextRepository, and ContextArtifact so the code generator can reproduce the hand-written creators.
- Add leading blank line to attribute templates so Jinja2 include does not prepend extra whitespace from the include tag context - Add imports templates for nanoid (generate_nanoid) used by Skill, SkillArtifact, ContextRepository, ContextArtifact creators
Without these entries, the code generator moves Context, ContextArtifact, ContextRepository, Skill out of core/ and incorrectly pulls GCPDataplex into core/ via transitive propagation. Adding them to the seed set keeps the generated layout stable.
Asset has a relationship to GCPDataplexAspectType which causes transitive propagation into core/. Without Google and Cloud in the seed set, GCPDataplex lands in core/ but can't resolve its parent import.
SkillArtifact extends Agentic directly (not Artifact) per the server typedef. Updated test_type_hierarchy assertion accordingly.
a2c3525 to
2a2be74
Compare
- New Context subtypes: ContextDimension, ContextFilter, ContextInstruction, ContextMetric, ContextProduct, ContextRelationship, ContextStudio - Cloud, Google, GCPDataplex, GCPDataplexAspectType moved to core/ - Dremio subtypes moved to core/ - Updated enums and structs from latest server typedefs
2a2be74 to
eb9fba5
Compare
Aryamanz29
left a comment
There was a problem hiding this comment.
LGTM - thanks @suseriAtlan! 🙌
I've updated the generator templates and added unit and integration tests (CRUD has been validated against https://eops1.atlan.com/context-studio). Please double-check the latest code changes - if it looks good, I can merge. Thanks!
Bypasses the daily cache check and forces a fresh typedefs download from the Atlan instance. Updated README with usage.
Regenerated with fresh typedefs download from eops1.atlan.com.
tests/integration/agentic_test.py ✓✓✓✓✓✓✓✓✓ 100% ██████████
Results (21.39s):
9 passed |
Summary
Agenticsupertype underCatalog, withSkill/SkillArtifactandContextRepository/ContextArtifactconcrete types, plus sharedArtifact/Contextbases.ContextLifecycleStatusenum and bumpsFileTypewithyaml,sql(from models 1.1).Type hierarchy
qualifiedName patterns
Skilldefault/skill/{nanoid}SkillArtifact{skill_qn}/artifact/{file_type}/{nanoid}ContextRepositorydefault/context/{nanoid}ContextArtifact{repo_qn}/artifact/{file_type}/{nanoid}End-to-end validation on ai-steward.atlan.com
All 4 concrete types round-trip on a real tenant (the models PR is deployed there):
Skill2976f4cb-c912-411e-bd36-aeead38e16e7ContextRepository9fac2866-5ed4-41ad-b055-0ce36bde70c4SkillArtifact4790ef7f-8946-4090-9213-538507fc0695ContextArtifact82dcde41-d8ff-446f-82f8-556d5097a7d2Test plan
3400 passed, 1 skipped(no regressions) after wiringisinstance, MRO, setter/getter round-trip, JSON camelCase serialization verified locallyskill_source,context_repository)validate_required_fieldsrejects empty inputsFileType.YAML/FileType.SQLonce the 1.1 enum bump ships to tenantsRelated
🤖 Generated with Claude Code