Skip to content

TTD-105: Add Agentic, Skill, and Context Repository typedefs#901

Merged
Aryamanz29 merged 11 commits intomainfrom
TTD-105-agentic-types
Apr 20, 2026
Merged

TTD-105: Add Agentic, Skill, and Context Repository typedefs#901
Aryamanz29 merged 11 commits intomainfrom
TTD-105-agentic-types

Conversation

@suseriAtlan
Copy link
Copy Markdown
Collaborator

Summary

  • 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 shared Artifact/Context bases.
  • Creators on the 4 concrete types use NanoID-based qualifiedName patterns and auto-populate parent refs.
  • Adds ContextLifecycleStatus enum and bumps FileType with yaml, sql (from models 1.1).

Type hierarchy

Catalog
└── Agentic
    ├── Artifact (extends Agentic + File)
    │   └── artifactVersion, fileType, filePath
    ├── Skill
    │   ├── skillVersion
    │   └── skillArtifacts → SkillArtifact
    ├── SkillArtifact (extends Artifact)
    │   └── skillSource → Skill
    └── Context
        ├── contextRepositoryQualifiedName
        ├── ContextRepository
        │   ├── contextRepositoryLifecycleStatus (enum)
        │   ├── contextRepositoryAgentInstructions (text)
        │   ├── contextRepositoryTargetConnectionQualifiedName
        │   └── contextArtifacts → ContextArtifact
        └── ContextArtifact (extends Context + Artifact)
            └── contextRepository → ContextRepository

qualifiedName patterns

Type Pattern
Skill default/skill/{nanoid}
SkillArtifact {skill_qn}/artifact/{file_type}/{nanoid}
ContextRepository default/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):

Type GUID
Skill 2976f4cb-c912-411e-bd36-aeead38e16e7
ContextRepository 9fac2866-5ed4-41ad-b055-0ce36bde70c4
SkillArtifact 4790ef7f-8946-4090-9213-538507fc0695
ContextArtifact 82dcde41-d8ff-446f-82f8-556d5097a7d2

Artifacts were created with FileType.TXT because ai-steward's file_type enum is still at 1.0; yaml/sql/md are rejected server-side until the enum bump is deployed. The Python enum here matches models 1.1 and is ready for that rollout.

Test plan

  • Unit suite green: 3400 passed, 1 skipped (no regressions) after wiring
  • isinstance, MRO, setter/getter round-trip, JSON camelCase serialization verified locally
  • Creators produce expected qualifiedName patterns and populate parent refs (skill_source, context_repository)
  • validate_required_fields rejects empty inputs
  • Real-tenant create+read on ai-steward (GUIDs above)
  • Retest with FileType.YAML / FileType.SQL once the 1.1 enum bump ships to tenants

Related

🤖 Generated with Claude Code

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>
Comment thread pyatlan/model/assets/core/artifact.py
Comment thread pyatlan/model/assets/core/context_artifact.py
@suseriAtlan suseriAtlan requested a review from Aryamanz29 April 17, 2026 11:56
Copy link
Copy Markdown
Member

@Aryamanz29 Aryamanz29 left a comment

Choose a reason for hiding this comment

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

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, Attributes inner class, bottom-of-file circular import resolution)
  • Creator validation: validate_required_fields is used consistently on all 4 concrete types
  • NanoID qualifiedNames: Patterns are clean and documented in the PR description
  • Relationship wiring: skill_source / context_repository refs are auto-populated by creators via ref_by_qualified_name
  • Forward refs: All update_forward_refs calls are wired in core/__init__.py

Suggestions

  1. 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.

  2. Artifact.file_assets type: In artifact.py:96, file_assets is typed as Optional[Asset] (singular). Should this be Optional[List[Asset]] based on the relation being named fileAssets (plural)? Same question for ContextArtifact.file_assets. Worth verifying against the metastore typedef.

  3. Missing FILE_ASSETS field re-declaration in ContextArtifact: ContextArtifact extends Context (not Artifact), so it re-declares ARTIFACT_VERSION, FILE_TYPE, FILE_PATH, and FILE_ASSETS class fields. This is correct for the diamond inheritance pattern, but the file_assets attribute in ContextArtifact.Attributes shadows the one from Context.Attributes (which doesn't have it) and Artifact.Attributes (which does). Since ContextArtifact doesn't extend Artifact in the MRO, this is fine — just noting it's intentional.

  4. ContextArtifact missing context_repository_qualified_name in Attributes.creator: The creator correctly sets context_repository_qualified_name on the attributes, which is good — this enables the Context.CONTEXT_REPOSITORY_QUALIFIED_NAME field to work for search. Looks complete.

  5. Enum ordering in FileType: YAML and SQL are added before MD. The enum appears to be in alphabetical order up to HYPER, then YAML/SQL/MD break that pattern. Minor nit — could reorder to MD, SQL, YAML for 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 checks
    • skill_test.py — creator validation, unique QN generation, getter/setter, immutability
    • skill_artifact_test.py — creator validation (3 params), QN pattern verification, file type variants (YAML/SQL), skill_source ref population
    • context_repository_test.py — creator validation, lifecycle status enum round-trip, all ContextLifecycleStatus values
    • context_artifact_test.py — creator validation (3 params), QN pattern, file type variants (YAML/SQL/MD), context_repository ref 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
Comment thread pyatlan/model/assets/core/skill_artifact.py
Comment thread tests/unit/model/skill_test.py Outdated
Add asset and attribute method templates for Skill,
SkillArtifact, ContextRepository, and ContextArtifact so
the code generator can reproduce the hand-written creators.
Comment thread pyatlan/model/assets/core/context_artifact.py
- 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.
Comment thread pyatlan/model/assets/core/agentic.py
Comment thread pyatlan/model/assets/core/context_artifact.py
Comment thread pyatlan/generator/class_generator.py
SkillArtifact extends Agentic directly (not Artifact) per the
server typedef. Updated test_type_hierarchy assertion accordingly.
@Aryamanz29 Aryamanz29 force-pushed the TTD-105-agentic-types branch from a2c3525 to 2a2be74 Compare April 20, 2026 08:53
- 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
@Aryamanz29 Aryamanz29 force-pushed the TTD-105-agentic-types branch from 2a2be74 to eb9fba5 Compare April 20, 2026 08:54
@Aryamanz29 Aryamanz29 added the feature New feature or request label Apr 20, 2026
Copy link
Copy Markdown
Member

@Aryamanz29 Aryamanz29 left a comment

Choose a reason for hiding this comment

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

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.
@Aryamanz29
Copy link
Copy Markdown
Member

 tests/integration/agentic_test.py ✓✓✓✓✓✓✓✓✓                                                                                                                                           100% ██████████

Results (21.39s):
       9 passed

@Aryamanz29 Aryamanz29 merged commit ec951a7 into main Apr 20, 2026
59 of 73 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants