Repository navigation
feat(kits): If-Match preconditions and composition metadata for personal kits - #94
Merged
Merged
Conversation
A write may send the expected generation as If-Match (the kit ETag "g<n>" or a bare <n>) instead of, or agreeing with, the body expectedGeneration. A stale If-Match answers 412 kit.generation_conflict; the body field keeps its 409. Also proves a pin on an older or yanked release still stores.
Revision documents may carry AgentKit's extends, include and resolution records under composition. It is strictly validated, never normalized and part of the revision digest; documents without it keep their digests. Rebase and conflict resolution revisions drop it because they move the pins the records describe.
Contributor
Author
|
Controller review: no blockers. Checked
Nits (non-blocking)
|
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.
Refs #88 (does not close it: items 3, 4 and 7 are decisions recorded on the issue).
Summary
Closes the personal-kit API gaps AgentKit hit in G2 (bestagentkits/agentkit#2278) that SkillX can fix in code. Everything stays behind
SKILLX_PERSONAL_KITS_API. No migration, no deploy.Item 2:
If-Matchon kit writesrevisions,rebase,conflicts/:id/resolve,activate,rollback,revisions/:id/reject,revisions/:id/review,proposals,proposals/validate) acceptsIf-Match: "g<n>"(the kitETag) or a bare<n>.expectedGenerationstill works. Both may be sent when they agree; a disagreement, a list,*or a weak tag is 400invalid_request.If-Matchis 412kit.generation_conflictand writes nothing. A stale body field keeps its 409.withIfMatchin the router's body reader, and the 409 → 412 mapping inserveKit.Item 6: pins on older releases
kit.base_unavailable. The rule is now written in the docs.Item 1: optional
compositionon revision documentscomposition: { extends, include?, resolutions? }mirrors AgentKit's manifestextends/includeandagentkit.skill-overlay-resolution/v1records.kit.invalidat the path), nothing normalized or reordered, so client and server digests agree. Limits: 1 to 16 uniqueextends, 256 uniqueinclude, 1,000 records unique by identity, path and category.packages/contracts/src/fixtures/personal-kit-composition-golden.json, digest cross-checked with an independent canonical-JSON hash.diffreports a changedcomposition.Tests
pnpm typecheck: pass.pnpm test: 97 files, 2065 passed, 2 skipped.apps/web/tests/personal-kits/kit-preconditions.test.ts,apps/web/tests/personal-kits/kit-composition.test.ts,packages/contracts/src/personal-kit/kit-composition.test.ts.Docs impact
docs/personal-kits-api.md: concurrency section (If-Match, 412), base pin rule, thecompositionsection and the error table.🤖 Generated with Claude Code