|
1 | | -= Conative Gating |
2 | | -:toc: left |
3 | | -:toclevels: 3 |
| 1 | += conative-gating |
| 2 | +Jonathan D.A. Jewell <jonathan.jewell@gmail.com> |
| 3 | +:toc: macro |
4 | 4 | :icons: font |
5 | 5 | :source-highlighter: rouge |
| 6 | +:experimental: |
| 7 | +:url-github: https://github.com/hyperpolymath/conative-gating |
| 8 | +:url-gitlab: https://gitlab.com/hyperpolymath/conative-gating |
| 9 | +:url-bitbucket: https://bitbucket.org/hyperpolymath/conative-gating |
| 10 | +:url-codeberg: https://codeberg.org/hyperpolymath/conative-gating |
6 | 11 |
|
7 | | -SLM-as-Cerebellum for LLM Policy Enforcement |
| 12 | +RSR repository standards and template management |
8 | 13 |
|
9 | | -== Overview |
10 | | - |
11 | | -Conative Gating implements a dual-layer policy enforcement system for AI-assisted coding: |
12 | | - |
13 | | -1. **Policy Oracle** (deterministic): Fast rule-checking for forbidden languages, toolchain violations, and security patterns |
14 | | -2. **SLM Evaluator** (neural): Spirit-of-policy evaluation for edge cases (future implementation) |
| 14 | +image:https://img.shields.io/badge/RSR-Certified-gold[RSR Certified] |
| 15 | +image:https://img.shields.io/badge/License-AGPL%20v3-blue[License] |
15 | 16 |
|
16 | | -The system acts as a "cerebellum" - receiving proposals from an LLM, blocking obvious violations immediately, and using an SLM for nuanced evaluation of edge cases. |
17 | | - |
18 | | -== Architecture |
19 | | - |
20 | | -[source] |
21 | | ----- |
22 | | - ┌─────────────────┐ |
23 | | - │ LLM Proposal │ |
24 | | - └────────┬────────┘ |
25 | | - │ |
26 | | - ┌────────▼────────┐ |
27 | | - │ Policy Oracle │ ◄── Deterministic rules |
28 | | - │ (this crate) │ |
29 | | - └────────┬────────┘ |
30 | | - │ |
31 | | - ┌──────────────┼──────────────┐ |
32 | | - │ │ │ |
33 | | - ┌─────▼─────┐ ┌─────▼─────┐ ┌─────▼─────┐ |
34 | | - │ BLOCKED │ │ PASS │ │ ESCALATE │ |
35 | | - │ │ │ │ │ to SLM │ |
36 | | - └───────────┘ └───────────┘ └─────┬─────┘ |
37 | | - │ |
38 | | - ┌────────▼────────┐ |
39 | | - │ SLM Consensus │ |
40 | | - │ (PBFT + weight) │ |
41 | | - └─────────────────┘ |
42 | | ----- |
| 17 | +toc::[] |
43 | 18 |
|
44 | | -== Quick Start |
| 19 | +== Overview |
45 | 20 |
|
46 | | -=== Building |
| 21 | +conative-gating is part of the link:https://rhodium.sh[Rhodium Standard] (RSR) ecosystem. |
47 | 22 |
|
48 | | -[source,bash] |
49 | | ----- |
50 | | -cargo build --release |
51 | | ----- |
| 23 | +Domain: *software-development* |
52 | 24 |
|
53 | | -=== Running |
| 25 | +== Installation |
54 | 26 |
|
55 | 27 | [source,bash] |
56 | 28 | ---- |
57 | | -# Scan a directory for policy violations |
58 | | -./target/release/conative scan /path/to/project |
59 | | -
|
60 | | -# Check a single file |
61 | | -./target/release/conative check --file src/main.rs |
| 29 | +# Clone from GitHub (primary) |
| 30 | +git clone {url-github} |
62 | 31 |
|
63 | | -# Check content directly |
64 | | -./target/release/conative check --content "const x: string = 'hello'" |
65 | | -
|
66 | | -# Show the default RSR policy |
67 | | -./target/release/conative policy |
68 | | -
|
69 | | -# Show policy as JSON |
70 | | -./target/release/conative policy --format json |
71 | | -
|
72 | | -# Validate a proposal JSON file |
73 | | -./target/release/conative validate proposal.json |
| 32 | +# Or from mirrors |
| 33 | +git clone {url-gitlab} |
| 34 | +git clone {url-codeberg} |
74 | 35 | ---- |
75 | 36 |
|
76 | | -== Policy Configuration |
| 37 | +== RSR Stack |
77 | 38 |
|
78 | | -The default policy implements RSR (Reasonable Stack Requirements): |
79 | | - |
80 | | -=== Language Tiers |
81 | | - |
82 | | -[cols="1,3,2"] |
83 | | -|=== |
84 | | -|Tier |Languages |Status |
| 39 | +This project follows RSR conventions: |
85 | 40 |
|
86 | | -|**Tier 1** (Preferred) |
87 | | -|Rust, Elixir, Zig, Ada, Haskell, ReScript |
88 | | -|✓ Fully compliant |
| 41 | +* ✅ ReScript for frontend/logic |
| 42 | +* ✅ Deno for JS runtime |
| 43 | +* ✅ WASM for performance-critical code |
| 44 | +* ✅ Rust/OCaml/Haskell for systems/proofs |
| 45 | +* ✅ Guile/Scheme for configuration |
| 46 | +* ❌ No TypeScript |
| 47 | +* ❌ No Go |
| 48 | +* ❌ No npm |
89 | 49 |
|
90 | | -|**Tier 2** (Acceptable) |
91 | | -|Nickel, Racket |
92 | | -|⚠ Generates concern |
| 50 | +== Mirrors |
93 | 51 |
|
94 | | -|**Forbidden** |
95 | | -|TypeScript, Python, Go, Java |
96 | | -|✗ Hard violation |
| 52 | +[cols="1,2"] |
97 | 53 | |=== |
| 54 | +| Platform | URL |
98 | 55 |
|
99 | | -=== Exceptions |
100 | | - |
101 | | -Some languages are permitted in specific paths: |
102 | | - |
103 | | -[source] |
104 | | ----- |
105 | | -Python allowed in: |
106 | | - - salt/ (Salt configuration) |
107 | | - - training/ (ML training scripts) |
108 | | ----- |
109 | | - |
110 | | -=== Toolchain Rules |
111 | | - |
112 | | -[cols="1,2,2"] |
| 56 | +| GitHub (primary) | {url-github} |
| 57 | +| GitLab | {url-gitlab} |
| 58 | +| Bitbucket | {url-bitbucket} |
| 59 | +| Codeberg | {url-codeberg} |
113 | 60 | |=== |
114 | | -|Tool |Requires |Reason |
115 | 61 |
|
116 | | -|npm |
117 | | -|deno |
118 | | -|Node.js must use Deno runtime |
119 | | -|=== |
120 | | - |
121 | | -=== Forbidden Patterns |
122 | | - |
123 | | -* Hardcoded secrets (passwords, API keys in source code) |
124 | | - |
125 | | -== Proposal Format |
126 | | - |
127 | | -When validating proposals programmatically, use this JSON format: |
128 | | - |
129 | | -[source,json] |
130 | | ----- |
131 | | -{ |
132 | | - "id": "550e8400-e29b-41d4-a716-446655440000", |
133 | | - "action_type": {"CreateFile": {"path": "src/util.rs"}}, |
134 | | - "content": "pub fn helper() -> String { ... }", |
135 | | - "files_affected": ["src/util.rs"], |
136 | | - "llm_confidence": 0.95 |
137 | | -} |
138 | | ----- |
139 | | - |
140 | | -=== Action Types |
141 | | - |
142 | | -* `CreateFile { path }` - Creating a new file |
143 | | -* `ModifyFile { path }` - Modifying existing file |
144 | | -* `DeleteFile { path }` - Deleting a file |
145 | | -* `ExecuteCommand { command }` - Running a command |
146 | | - |
147 | | -== API Usage |
148 | | - |
149 | | -[source,rust] |
150 | | ----- |
151 | | -use policy_oracle::{Oracle, Proposal, ActionType}; |
152 | | -use uuid::Uuid; |
153 | | -
|
154 | | -let oracle = Oracle::with_rsr_defaults(); |
155 | | -
|
156 | | -let proposal = Proposal { |
157 | | - id: Uuid::new_v4(), |
158 | | - action_type: ActionType::CreateFile { |
159 | | - path: "src/helper.rs".to_string() |
160 | | - }, |
161 | | - content: "pub fn helper() { }".to_string(), |
162 | | - files_affected: vec!["src/helper.rs".to_string()], |
163 | | - llm_confidence: 0.9, |
164 | | -}; |
165 | | -
|
166 | | -match oracle.check_proposal(&proposal) { |
167 | | - Ok(result) => { |
168 | | - match result.verdict { |
169 | | - PolicyVerdict::Compliant => println!("OK"), |
170 | | - PolicyVerdict::HardViolation(v) => println!("BLOCKED: {:?}", v), |
171 | | - PolicyVerdict::SoftConcern(c) => println!("CONCERN: {:?}", c), |
172 | | - } |
173 | | - } |
174 | | - Err(e) => eprintln!("Error: {}", e), |
175 | | -} |
176 | | ----- |
177 | | - |
178 | | -== Directory Scanning |
179 | | - |
180 | | -[source,rust] |
181 | | ----- |
182 | | -use policy_oracle::Oracle; |
183 | | -use std::path::Path; |
184 | | -
|
185 | | -let oracle = Oracle::with_rsr_defaults(); |
186 | | -let result = oracle.scan_directory(Path::new("./my-project"))?; |
187 | | -
|
188 | | -println!("Files scanned: {}", result.files_scanned); |
189 | | -println!("Violations: {}", result.violations.len()); |
190 | | -println!("Concerns: {}", result.concerns.len()); |
191 | | ----- |
192 | | - |
193 | | -== Future: SLM Evaluation |
| 62 | +== License |
194 | 63 |
|
195 | | -The v2 release will include SLM-based "spirit violation" detection: |
| 64 | +Licensed under AGPL-3.0-or-later OR LicenseRef-Palimpsest-0.5. |
196 | 65 |
|
197 | | -* Integration with llama.cpp for local inference |
198 | | -* PBFT consensus with 3-5 SLM nodes |
199 | | -* Asymmetric weighting (1.5x for inhibition signals) |
200 | | -* Training data from rhodibot categories |
| 66 | +See link:LICENSE[LICENSE] for details. |
201 | 67 |
|
202 | | -== License |
| 68 | +== Contributing |
203 | 69 |
|
204 | | -AGPL-3.0-or-later |
| 70 | +See link:CONTRIBUTING.adoc[CONTRIBUTING.adoc]. |
205 | 71 |
|
206 | | -== Author |
| 72 | +== Metadata |
207 | 73 |
|
208 | | -Jonathan D.A. Jewell <jonathan@hyperpolymath.org> |
| 74 | +* Domain: software-development |
| 75 | +* Framework: RSR (Rhodium Standard Repository) |
| 76 | +* Dublin Core: link:.well-known/dc.xml[.well-known/dc.xml] |
0 commit comments