Entitled skill surface tier: resolver staging gate + leak-guard + ADR-0011 - #618
Merged
Conversation
resolveLibrarySkills semantics for the third surface tier (spec §Amendment A1, amicode#614; ADR-0011): surface:entitled + entitlement:<code> stages IFF the session's resolved entitlements include the code; malformed/missing entitlement codes follow the skip+warn philosophy (never throw); public entries stage unconditionally; the per-root surfaces guard still applies first. DEFAULT_LIBRARY_ROOTS in-repo root admits public + entitled. Red here: (b) absent/wrong code still stages, (c) missing/malformed codes still stage, DEFAULT shape still public-only. (a)/(d)/(e) pin the positive contract + unchanged behavior and are satisfied by the same GREEN change that fixes the gate — they guard against an implementation that skips entitled entries entirely or drops the per-root guard.
Third surface tier (spec §Amendment A1, amicode#614; ADR-0011):
surface:entitled + entitlement:<code> stages IFF the session's resolved
entitlements include the code. The gate lives in resolveLibrarySkills
(roots, entitlements) — a PREP-time decision, not a run-gate; entitlements
come from the same LocalEntitlementProvider read the score filter already
does, passed through from prepareOpencodeProject for every session type
(headless included). Entitled is a STAGING gate, not a location: entitled
skills share the in-repo library with public ones, and DEFAULT_LIBRARY_ROOTS'
in-repo root now admits {public, entitled}. Missing/malformed entitlement
codes are skip+warn (never throw); a well-formed code the session lacks is
a silent skip. No LLM anywhere in the gating path.
The shipped-library leak guard widens to the three-tier model (spec §A1.3(b), ADR-0011): a shipped SKILL.md must carry surface: public (loads for all) or surface: entitled with a non-empty entitlement code (stages only for entitled sessions) — internal, untagged, and missing tags remain offenders, and the internal dev-workflow hard-refusal (implement-issue, break-into-subissues) is unchanged: the repo boundary remains the internal gate. Same widening applied to the twin source-level guard in package_skills.test.ts. Entitlement raw values are quote-stripped before the emptiness check so entitlement: "" reads as missing (the resolver already refuses it at runtime — guard agrees). Both guards verified against synthetic frontmatter: public/entitled+code admitted; entitled without a code, quoted-empty code, internal, untagged refused.
Documents the entitled surface tier amending ADR-0003 (spec §A1 as design of record): public (ships, loads for all) / entitled (ships in the .vsix, stages only for entitled sessions — a staging gate, not a location; same in-repo library as public) / internal (private vault, never ships). Covers the safe-to-possess content policy for the entitled tier (usage-only, the per-line usage-vs-internals test, review-time enforcement) and the entitlement staging gate via LocalEntitlementProvider at prep time for every session type, headless included. No LLM in the gating path.
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…; name the server boot lane as the open enforcement point (review finding)
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.
Closes #614.
Third surface tier per spec §Amendment A1 (reviewed APPROVED-WITH-ADVISORIES):
surface: entitled+entitlement: <code>ships in the .vsix but stages only for sessions whose resolved entitlements include the code — prep-time, every session type, headless included. Reuses LocalEntitlementProvider (the scores' mechanism); no new entitlement plumbing. Leak guard widens to admit public + entitled while still hard-refusing internal (the repo boundary remains the internal gate). ADR-0011 documents the three-tier model.TDD history with two findings worth noting: the synthetic-frontmatter probe caught
entitlement: ""slipping through the widened regex guard (fixed — quote-strip before emptiness); settings-level bare-string root overrides stay public-only by design (a custom root wanting entitled must declare it in its surfaces list).