Skip to content

Conversation

@mikehostetler
Copy link
Contributor

Summary

  • When lifecycle.status = "deprecated", model.deprecated now correctly returns true
  • Added retired: boolean field to Model schema
  • Added sync logic that synchronizes boolean flags with lifecycle status
  • Added helper functions deprecated?/1 and retired?/1 for a cleaner API

Test plan

Manual Test

{:ok, model} = LLMDB.model("openai:dall-e-3")
model.lifecycle  # %{status: "deprecated", ...}
model.deprecated  # true (was false before)
model.retired  # false (new field)

🤖 Generated with Claude Code

mikehostetler and others added 3 commits February 2, 2026 11:06
When a model has lifecycle.status = \"deprecated\", the model.deprecated
boolean attribute now correctly returns true.

- Add retired: boolean field to Model schema
- Add sync_lifecycle_flags/1 that synchronizes boolean flags with lifecycle status
- Add helper functions deprecated?/1 and retired?/1 for cleaner API
- Add comprehensive tests for lifecycle synchronization

This maintains backwards compatibility with upstream sources that only
provide the simple deprecated: true flag.

Fixes #99

Co-Authored-By: Claude <[email protected]>
Enhance the lifecycle system to support flexible status values beyond
the original 3-state enum. This allows for provider-specific statuses
and future extensibility.

Changes:
- Remove enum constraint from lifecycle.status (now accepts any string)
- Add convenience accessor functions:
  - lifecycle_status/1 - Get the lifecycle status
  - deprecated_at/1 - Get the deprecation date
  - retires_at/1 - Get the retirement date
  - replacement/1 - Get the replacement model ID
  - has_replacement?/1 - Check if there's a replacement
- Update sync_lifecycle_flags to handle new known statuses:
  - Active-like: "beta", "experimental", "alpha"
  - Deprecated-like: "archived", "removed"
  - Unknown statuses preserve existing flags (conservative)
- Add comprehensive tests for flexible status handling

This maintains backwards compatibility while enabling rich lifecycle
metadata through the accessor functions.

Relates to #99

Co-Authored-By: Claude <[email protected]>
Remove helper methods and follow the existing pattern used by other
nested fields like cost, limits, and capabilities. Users now access
lifecycle data directly via model.lifecycle[:status] instead of
helper functions.

Changes:
- Remove lifecycle helper methods (deprecated?, retired?, lifecycle_status, etc.)
- Update Validate.validate_model/1 to call Model.new/2 for sync logic
- Update tests to use direct map access
- Keep sync_lifecycle_flags/1 which now runs during build pipeline

This matches the existing pattern where complex nested fields (cost,
limits, capabilities) are accessed directly without helper methods.

The sync logic now properly runs during the ETL pipeline, ensuring
deprecated/retired booleans are synchronized with lifecycle.status
in the generated packaged JSON.

Relates to #99

Co-Authored-By: Claude <[email protected]>
@mikehostetler
Copy link
Contributor Author

trashing this to start over

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.

2 participants