feat(tags): add unified artifact and memory entry tags - #1472
Open
Teingi wants to merge 2 commits into
Open
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?
Closes #1466.
Implements the design proposed in RFC #1467, which is tracked separately. Based on upstream
masterat74b961fbb07165595314726715d412a3d0d90589.Rationale for this change
Customers need to classify reusable knowledge by customer, project, or workflow and find the matching resources without editing their content. Artifact-level labels alone cannot distinguish individual entries within a Memory.
Tags are mutable, Scope-local discovery metadata attached to logical identities. They do not create content revisions, change lineage or embeddings, grant permissions, or become model instructions.
What changes are included in this PR?
pc_artifact_tagsassignment table for Memory, Experience, Skill, Handoff, and nested logical MemoryEntry targets. The owning Artifact head provides the foreign-key and write-serialization boundary; MemoryEntry validity comes from the authoritative current manifest, including inactive entries.If-Matchreturns 428; stale or wrong-target validators return 412.all/anyqueries with current Artifact references or Memory citations, inactive-target filtering, and signed cursors bound to Scope, filters, caller, and expiry.Are there any user-facing changes?
How was this change tested?
Validation used Python 3.14 and Node.js 22. Commands below were run during implementation; the final source/type and staged-diff checks were repeated before submission.
pytest tests/e2e/test_real_artifact_tags.py --run-real-e2e -q --tb=short --show-capture=no: 2 passed. Used the configured real generation and embedding providers, OceanBase, and SQLite. Covered generated Memory, four Artifact families, concurrent ETag writes, FTS/vector/hybrid retrieval, inactive entries, and publication without tag copying. OceanBase runs created and dropped only isolated test databases; SQLite used temporary files. Existing business data and credentials were not changed or committed.pytest tests/e2e/test_artifact_tags.py tests/builtin/test_tags.py tests/builtin/persistence/test_records.py -q: 24 passed. Includes retrieving an eligible tagged entry outside the first 32 unfiltered results in all three search modes.pytest tests -q --tb=short --show-capture=no: 1343 passed, 19 skipped, 1 failed. The remaining OpenCode Host callback timeout was also reproduced from an untouched74b961fsnapshot with its original plugin bundle; stdout/stderr were empty and no capture hook arrived within 30 seconds.pytest src/powercontext --doctest-modules -q: 1 passed.make api-generate-check js-api-generate-check contract-test: passed, including 38 contract tests.pnpm exec vitest run --testTimeout=30000; typecheck passed. Its real CLI cold-start test exceeded the default 5-second timeout and passed with the 30-second window.make docs-test: passed, including lint and the bilingual static site build (556 pages).ruff check src tests,ruff format --check src tests,ty check src/powercontext tests --output-format concise,uv lock --locked, andgit diff --cached --check: passed.prek run -ais not green: the existing Codex hooks have three unresolvedscripts.scope_bindingimports. All other hooks passed withSKIP=ty-check. A standalone DSHtsc --noEmitalso reports existing.tsimport configuration and unrelated test typing errors; the configured build and runtime tests pass. These unrelated integration configuration issues are not hidden or included as tag changes.AI usage statement
Implemented, documented, and validated with OpenAI Codex, including real provider/database and browser testing. No credentials, environment files, or temporary database contents are included in this PR.