feat(cave): add the privileged authority tier behind capability gates - #7
Closed
CompleteDotTech wants to merge 1 commit into
Closed
feat(cave): add the privileged authority tier behind capability gates#7CompleteDotTech wants to merge 1 commit into
CompleteDotTech wants to merge 1 commit into
Conversation
Implement the SDK-owned half of issue OpenCoven#43 as far as the authoritative Cave contract allows, stacked on the conversational-control tier: - a capability registry derived from the verified contract fixture that resolves every privileged action class (attachment-transfer, rich-content, attention-response, task-handoff, github-action) against the live operation table per call - frozen descriptors, no cached capability objects; the default snapshot mirrors the pinned fixture and is test-locked to it; - bounded attachment transfer validated fail closed (file count, file size, request size, MIME allowlist with magic-byte signature agreement, filename, traversal, symlink) with the atomic uploader-credential-plus- conversation binding and metadata-only records, so attachment bytes never enter canonical conversation JSON, browser storage, profile config, or diagnostic bundles; the canonical byte digest stays Cave's; - a passive rich-content AST over a closed non-executable node vocabulary: no HTML node type, no event-handler fields, markup-looking text preserved inertly byte for byte, link targets restricted to https:/mailto: with userinfo refused, node-count, depth, and character limits failing closed; - task handoffs with proposed/pending/completed/rejected/failed kept strictly distinct behind a declared transition map, and attention responses over a closed kind union with a bounded note; - the confirmed GitHub action envelope with an intentionally EMPTY curated union typed readonly never[], so no request is constructible - fail closed by construction - with confirmation, operation-UUID idempotency, and bounded-input validation shipping ready for the curated union; - five optional unbound CaveTransport methods and five CaveClient methods that validate requests, resolve the capability gate, and report unsupported_operation with zero transport dispatch under the pinned contract; the operation UUID is attached to every privileged client error. Upstream-contract gap (stated, not invented): the fixture pinned at Cave 4adc97b1 declares the privileged pairing scopes but no attachment, rich-content, attention, task, or GitHub operations and no such capability families, so no route, scope mapping, capability family, or GitHub action kind ships; no CLI command ships for unsupported privileged actions. Changeset targets the release after 0.1.0.
Owner
Author
|
Recreated upstream as OpenCoven#82: OpenCoven#82. Closing this duplicate fork PR; review continues upstream. |
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.
Summary
Implements the SDK-owned half of OpenCoven#43 (rich content, attachments, and explicitly confirmed privileged actions) as far as the authoritative Cave contract allows, stacked directly on PR #6 (
feat/conversational-control-42@927996d). Cave remains the sole executor and canonical owner for storage, grants, confirmation, idempotency, audit, and domain mutation.Assignee: @CompleteDotTech
Advances OpenCoven#43 (maintainer close on merge)
Dependency-graph override by user directive (2026-08-30): started despite
Blocked by: #42— stacked on PR #6; merges only after #1 → #5 → #6.Upstream PR (one click for a maintainer): https://github.com/OpenCoven/sdk/compare/main...CompleteDotTech:sdk:feat/rich-actions-43?expand=1
Fixture audit (what the contract actually declares)
The pinned Cave Client v1 fixture (producer commit
4adc97b1, digestb2694cd1…) declares 13 operations — health, pairing (public/admin), credential admin, familiars/projects/conversations/messages reads — every authenticated oneGET+chat:read. It declares no attachment, rich-content, attention, task-handoff, or GitHub operations and no such capability families. It does declare the pairing scopeschat:write,conversations:write,attachments:write,tasks:write,github:write, so the scope vocabulary is contract-real even though no operation uses it yet. Nothing in this PR invents routes, scopes, capability families, or GitHub action kinds.What ships
createCaveCapabilityRegistry): resolves each privileged action class against the consulted contract's operation table per call, returning fresh frozen descriptors (no cached capability objects). The default snapshot mirrors the pinned fixture and is test-locked to its exact operation table, so a fixture re-import forces a reviewed update. Under the pinned contract every privileged class resolvesundeclared.https:/mailto:(scheme-less targets rejected, userinfo refused), node-count/depth/character limits fail closed. Hostile fixtures (script injection, event handlers,javascript:/data:/file:URLs, oversized, over-deep) all rejected or proven inert.acknowledge/decline) with bounded notes; handoff transitions keeping proposed/pending/completed/rejected/failed strictly distinct behind a declared transition map with terminal states.confirmed: true, operation-UUID idempotency, bounded string input — with the curated action union deliberately empty (readonly never[]), so no request is even constructible: fail closed by construction until the upstream contract curates kinds.CaveClientmethods (uploadAttachment,downloadAttachment,respondToAttention,requestTaskHandoff,submitGitHubAction) that validate first, then resolve the capability gate, then dispatch — reportingunsupported_operationwith zero transport calls under the pinned contract; the operation UUID is attached to every privileged client error. Five matching optional unboundCaveTransportmethods follow the PR feat(cave): add conversational control surface for the mutation authority #6 pattern.Validation
corepack pnpm@10.34.0 verify(typecheck, tests, contracts, package, release, coverage, stress, lint) exit 0 on the pushed head26aead4;git diff --checkclean. 64 test files / 1,321 tests pass (42 new).Deliberately not implemented (and why)
Owed upstream (who owes what — none of it invented here)
pnpm sync:contractsre-imports the new fixture): bind the five transport methods, wire the CLI commands, and extend the registry snapshot — reviewed against the landed contract.Release implications
Changeset
.changeset/rich-actions-43.mdtargets the release after 0.1.0 (minor on@opencoven/cave-client). API baselines regenerated (api-baselines/cave.d.ts,cave.json); public-contract export pin extended. The surface is additive and fail closed: with no Cave supporting these operations, behavior today isunsupported_operationplus the pure validation/AST layer.Stack / merge order
#1 (security review) → #5 (0.1.0 unlock prep) → #6 (conversational control, this PR's base) → this PR. Merges only after all three land.