Skip to content

feat: add stable handles for artifact reversions - #1933

Open
Tech-Circle-48 wants to merge 5 commits into
oceanbase:masterfrom
Tech-Circle-48:s2
Open

Tech-Circle-48 wants to merge 5 commits into
oceanbase:masterfrom
Tech-Circle-48:s2

Conversation

@Tech-Circle-48

@Tech-Circle-48 Tech-Circle-48 commented Oct 11, 2026 •

Copy link
Copy Markdown

Which issue or RFC does this PR close?

Closes #1863

Rationale for this change

Artifact IDs are generated and are not convenient for users or integrations to remember and reuse. This change introduces human-readable, scope-local stable handles that resolve to one exact artifact revision.

What changes are included in this PR?

  • Add the StableHandle domain model with canonical key validation.
  • Add persistent mappings from (scope, family, key) to an exact ArtifactRef.
  • Add SQLite and MySQL migrations for the pc_artifact_handles table.
  • Add public HTTP endpoints for binding and resolving artifact handles.
  • Add corresponding Python client methods and generated API bindings.
  • Return explicit errors for missing handles, missing target artifacts, and conflicting rebinding attempts.
  • Preserve the originally bound revision when newer artifact revisions are created.
  • Update database restore documentation for the new table.
  • Add model, persistence, public API, client, schema, and contract tests.

Are there any user-facing changes?

How was this change tested?

  • make test
    • 4616 passed, 313 skipped, 4 deselected
  • make check
    • All formatting, linting, type checking, and integration manifest checks passed
  • make contract-test
    • 49 passed
  • Added tests covering:
    • stable handle validation and length limits
    • binding and resolving exact artifact revisions
    • idempotent binding
    • conflicting rebinding
    • scope isolation
    • missing handles and target artifacts
    • fixed-revision resolution after a newer revision is created
    • public HTTP and Python client behavior
    • SQLite and MySQL schema definitions

AI usage statement

@hidb4ai

hidb4ai commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

ci failed

@hidb4ai hidb4ai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

One blocking startup issue remains in the current commit.

Comment thread src/powercontext/artifacts/models.py Outdated
Comment thread src/powercontext/artifacts/__init__.py Outdated
Comment thread openapi/powercontext.yaml Outdated
Comment thread src/powercontext/builtin/persistence/artifact_handles.py Outdated

@hidb4ai hidb4ai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Re-reviewed c3e27e0. The previous import blocker is fixed. Public HTTP/SQLite probes passed for idempotent binding, conflicting rebinding, missing targets, revision pinning, and readback after restart. One Desktop contract-generation issue remains below. Real MySQL/OceanBase execution was not verified.

Comment thread openapi/powercontext.yaml
@Tech-Circle-48
Tech-Circle-48 force-pushed the s2 branch 3 times, most recently from af2ec40 to a02aae7 Compare October 11, 2026 12:45
@AlexStocks AlexStocks added the 1.4.0 v1.4.0 release tracking label Oct 11, 2026
Comment thread openapi/powercontext.yaml
Comment thread integrations/dsh/plugins/powercontext/src/operations.generated.ts
Comment thread openapi/powercontext.yaml Outdated

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.4.0 v1.4.0 release tracking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(memory): add stable handles so artifacts stay citable across turns

3 participants