1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
//! 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 synthetic `source_repo = "pack:<id>"` that can never match
//! a real git remote — so the runtime scope gate confines them to the
//! `crossRepoStarter` suggestion-only fallback automatically (no new
//! privileged retrieval path);
//! - start at `confidence_score = 0.55`, below `manual` (0.7) and
//! `conversation` (0.6), so they never start at parity with earned memory;
//! - carry **no fabricated metrics** — `cited_count` / `trust_rate` reflect
//! *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.
pub use ;
pub use ;
pub use ;
/// The `origin` value 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 local `idx_skills_origin` index makes
/// `WHERE origin = 'pack'` cheap.
pub const PACK_ORIGIN: &str = "pack";
/// Base confidence for an installed pack rule. Deliberately below `manual`
/// (0.7) and `conversation` (0.6): pack rules are suggestions and must not
/// start at parity with the team's own earned judgment. `confidence_from_tags`
/// may refine via `severity:` but the install floor stays here.
pub const PACK_CONFIDENCE: f64 = 0.55;
/// Reserved synthetic-`source_repo` namespace prefix. A `pack:` value can never
/// match a real `owner/repo` git remote, which is the isolation key (roadmap
/// §4.2): a pack rule can only ever reach the cross-repo starter fallback.
pub const PACK_SOURCE_REPO_PREFIX: &str = "pack:";
/// Build the synthetic `source_repo` for a pack id (e.g. `difflore/go-http-safety`
/// -> `pack:difflore/go-http-safety`).
/// `pack:<id>@<version>` install-identity tag. `packs list --installed` groups
/// locally-installed rows on this tag; `packs install` treats a row already
/// carrying it as idempotent.
/// `pack-rule:<ruleId>` per-rule identity tag — the lever a version supersede
/// deletes/replaces on, independent of the `@version` suffix.