Expand description
Shareable starter rule-pack marketplace (roadmap item ①).
A rule pack is a curated, attributed starter set a brand-new team can
install on day-0 to close the cold-start recall gap (difflore import-reviews
needs gh auth + PR history; packs need neither). The registry is a plain
public GitHub repo exposing an index.json catalog plus per-pack pack.json
manifests — install is a pure HTTPS GET of public content with a sha256
supply-chain pin, so it works logged-out and offline-after-cache.
§Honesty / moat guardrails (non-negotiable, see roadmap §1)
Installed pack rules are suggestions, not ratified memory. They:
- carry
origin = 'pack'(the authoritative “installed, not mined here” marker) and a syntheticsource_repo = "pack:<id>"that can never match a real git remote — so the runtime scope gate confines them to thecrossRepoStartersuggestion-only fallback automatically (no new privileged retrieval path); - start at
confidence_score = 0.55, belowmanual(0.7) andconversation(0.6), so they never start at parity with earned memory; - carry no fabricated metrics —
cited_count/trust_ratereflect this team’s observed behavior and start at 0.
§Rule body format (dependency on item ⑥)
Pack rule bodies are rendered through item ⑥’s public, DB-free renderer
crate::context::rule_render::render_code_spec so an installed pack rule is
byte-for-byte indistinguishable in body from a mined rule — only its
origin / tags / source_repo / confidence differ. We do NOT re-implement
rendering here.
Structs§
- Install
Pack Outcome - Result of an
install_packrun. - Installed
Pack Rule - One installed-rule summary, returned for
--dry-runpreview and the install confirmation. Carries exactly the fields roadmap §5 step 5 says a dry-run must print: id, globs, tags, origin, synthetic source_repo, confidence. - Pack
Index - The registry catalog fetched on
packs list/packs install. - Pack
Index Entry - One pack’s catalog row. Carries the per-version manifest path +
sha256pin used to verify the fetched manifest (supply-chain guard). - Pack
Index Version - Pack
Maintainer - Pack
Manifest - The per-pack
pack.jsonmanifest. - Pack
Provenance - Pack-level provenance default.
kindis the honesty contract (roadmap §3.3):curated|mined|imported. Nokindmay carry trust/acceptance numbers into the installing team’s store. - Pack
Rule - One rule inside a manifest.
bodyis the item-⑥-shaped renderable content;examplesmap to arule_examplesrow when both sides are present. - Pack
Rule Examples - Pack
Rule Provenance - Pack
Target
Enums§
Constants§
- DEFAULT_
PACK_ REGISTRY - Raw GitHub content of the registry repo’s default branch. The
--registryCLI flag overrides this with a fork, a private mirror, or afile://path. - PACK_
CONFIDENCE - Base confidence for an installed pack rule. Deliberately below
manual(0.7) andconversation(0.6): pack rules are suggestions and must not start at parity with the team’s own earned judgment.confidence_from_tagsmay refine viaseverity:but the install floor stays here. - PACK_
ORIGIN - The
originvalue stamped on every installed pack rule. The single strongest provenance marker; downstream consumers key off it to render a “from a starter pack” badge and to exclude pack rules from any “your team’s earned memory” metric or eval. The localidx_skills_originindex makesWHERE origin = 'pack'cheap. - PACK_
SOURCE_ REPO_ PREFIX - Reserved synthetic-
source_reponamespace prefix. Apack:value can never match a realowner/repogit remote, which is the isolation key (roadmap §4.2): a pack rule can only ever reach the cross-repo starter fallback.
Functions§
- fetch_
index - Fetch and parse the registry
index.json. - fetch_
manifest - Fetch a pack
pack.json, verify itssha256against the index pin, and parse it.manifest_relis the index-declared path;expected_sha256is the pin. Refuses to return a manifest whose bytes don’t match the pin. - install_
pack - Install (or dry-run preview) every rule in a fetched pack manifest.
- is_
default_ registry - Whether a
--registryoverride points at the first-party default. Callers use this to demote amaintainer.verifiedbadge to “verified (custom registry)” so the trust signal is never misleading. - manifest_
sha256 - Hex
sha256over the raw manifest bytes, used as the supply-chain integrity check. The index pins this value; install recomputes it over the fetched bytes and refuses on mismatch. - pack_
rule_ tag pack-rule:<ruleId>per-rule identity tag — the lever a version supersede deletes/replaces on, independent of the@versionsuffix.- pack_
source_ repo - Build the synthetic
source_repofor a pack id (e.g.difflore/go-http-safety->pack:difflore/go-http-safety). - pack_
version_ tag pack:<id>@<version>install-identity tag.packs list --installedgroups locally-installed rows on this tag;packs installtreats a row already carrying it as idempotent.