feat: unify artifact family reads and registration - #1550
Draft
Zxf-xufeng wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue or RFC does this PR close?\n\nImplements RFC #1549.\n\n## Rationale for this change\n\nTopic Memory is already stored as an Artifact but was not accepted by the standard artifact read contract. Built-in Artifact family registration was also hard-coded in runtime composition, making future family additions easy to miss.\n\n## What changes are included in this PR?\n\n- Adds
topic-memoryto the shared read-only Artifact family contract for list, get, revision list, and revision get.\n- Adapts the existing published Topic Memory browse projection tolist_artifacts, including title, summary, publication time, source count, and signed cursor pagination.\n- Keeps Topic Memory standard writes disabled and preserves the specialized search/get/flush APIs.\n- AddsArtifactFamilyDefinitionandArtifactFamilyRegistry; runtime ArtifactRepository composition now consumes the built-in registry.\n- Keeps Source registration on the existingSourceDefinitionRegistry.\n- Regenerates checked-in API models/schema and adds contract, registry, persistence, and server regression coverage.\n\n## Are there any user-facing changes?\n\nYes.GET /v1/scopes/{scope_id}/artifacts/topic-memoryand the corresponding standard read/revision routes now accept Topic Memory. Topic Memory list items expose optional display metadata. Existing family behavior and specialized Topic Memory endpoints remain compatible.\n\n## How was this change tested?\n\n-make contract-test\n-uv run ty check\n-uv run ruff check ...anduv run ruff format --check ...\n- Targeted persistence and contract tests: 105 passed\n-env -u POWERCONTEXT_SERVER_DASHBOARD_ENABLED -u POWERCONTEXT_SERVER_AUTH_ENABLED -u POWERCONTEXT_SERVER_AUTH_TOKEN -u POWERCONTEXT_CLIENT_API_TOKEN -u POWERCONTEXT_CODEX_AUTHORIZATION uv run pytest tests/test_topic_memory_server.py -q(7 passed)\n-env -u POWERCONTEXT_SERVER_DASHBOARD_ENABLED -u POWERCONTEXT_SERVER_AUTH_ENABLED -u POWERCONTEXT_SERVER_AUTH_TOKEN -u POWERCONTEXT_CLIENT_API_TOKEN -u POWERCONTEXT_CODEX_AUTHORIZATION uv run pytest tests/test_access_http.py -q(18 passed)\n- Fullmake testwas attempted; 1892 passed, 61 skipped, and 175 environment/platform failures occurred because the session injected Dashboard/Auth settings and systemd tests run on macOS.\n\n## AI usage statement\n\nCreated with OpenAI Codex assistance; the implementation and final scope are reviewed by the repository owner.