Skip to content

Commit 3df8984

Browse files
Jonathan D.A. Jewellclaude
andcommitted
RSR standardization: README.adoc, Dublin Core, hooks, workflows
- Add AsciiDoc README with RSR stack policy - Add Dublin Core metadata (.well-known/dc.xml) - Add pre-commit hook (anti-TS/Go/Python/npm) - Add GitHub Actions rsr-antipattern.yml workflow 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent ea81cc8 commit 3df8984

File tree

7 files changed

+591
-184
lines changed

7 files changed

+591
-184
lines changed
Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# RSR Anti-Pattern CI Check
2+
# SPDX-License-Identifier: AGPL-3.0-or-later
3+
#
4+
# Enforces: No TypeScript, No Go, No Python (except SaltStack), No npm
5+
# Allows: ReScript, Deno, WASM, Rust, OCaml, Haskell, Guile/Scheme
6+
7+
name: RSR Anti-Pattern Check
8+
9+
on:
10+
push:
11+
branches: [main, master, develop]
12+
pull_request:
13+
branches: [main, master, develop]
14+
15+
jobs:
16+
antipattern-check:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Check for TypeScript
22+
run: |
23+
if find . -name "*.ts" -o -name "*.tsx" | grep -v node_modules | grep -q .; then
24+
echo "❌ TypeScript files detected - use ReScript instead"
25+
find . -name "*.ts" -o -name "*.tsx" | grep -v node_modules
26+
exit 1
27+
fi
28+
echo "✅ No TypeScript files"
29+
30+
- name: Check for Go
31+
run: |
32+
if find . -name "*.go" | grep -q .; then
33+
echo "❌ Go files detected - use Rust/WASM instead"
34+
find . -name "*.go"
35+
exit 1
36+
fi
37+
echo "✅ No Go files"
38+
39+
- name: Check for Python (non-SaltStack)
40+
run: |
41+
PY_FILES=$(find . -name "*.py" | grep -v salt | grep -v _states | grep -v _modules | grep -v pillar | grep -v venv | grep -v __pycache__ || true)
42+
if [ -n "$PY_FILES" ]; then
43+
echo "❌ Python files detected - only allowed for SaltStack"
44+
echo "$PY_FILES"
45+
exit 1
46+
fi
47+
echo "✅ No non-SaltStack Python files"
48+
49+
- name: Check for npm lockfiles
50+
run: |
51+
if [ -f "package-lock.json" ] || [ -f "yarn.lock" ]; then
52+
echo "❌ npm/yarn lockfile detected - use Deno instead"
53+
exit 1
54+
fi
55+
echo "✅ No npm lockfiles"
56+
57+
- name: Check for tsconfig
58+
run: |
59+
if [ -f "tsconfig.json" ]; then
60+
echo "❌ tsconfig.json detected - use ReScript instead"
61+
exit 1
62+
fi
63+
echo "✅ No tsconfig.json"
64+
65+
- name: Verify Deno presence (if package.json exists)
66+
run: |
67+
if [ -f "package.json" ]; then
68+
if [ ! -f "deno.json" ] && [ ! -f "deno.jsonc" ]; then
69+
echo "⚠️ Warning: package.json without deno.json - migration recommended"
70+
fi
71+
fi
72+
echo "✅ Deno configuration check complete"
73+
74+
- name: Summary
75+
run: |
76+
echo "╔════════════════════════════════════════════════════════════╗"
77+
echo "║ RSR Anti-Pattern Check Passed ✅ ║"
78+
echo "║ ║"
79+
echo "║ Allowed: ReScript, Deno, WASM, Rust, OCaml, Haskell, ║"
80+
echo "║ Guile/Scheme, SaltStack (Python) ║"
81+
echo "║ ║"
82+
echo "║ Blocked: TypeScript, Go, npm, Python (non-Salt) ║"
83+
echo "╚════════════════════════════════════════════════════════════╝"

.well-known/dc.xml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,23 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<metadata xmlns="http://purl.org/dc/elements/1.1/"
3-
xmlns:dcterms="http://purl.org/dc/terms/">
2+
<metadata
3+
xmlns="http://purl.org/dc/elements/1.1/"
4+
xmlns:dcterms="http://purl.org/dc/terms/"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
46
<title>conative-gating</title>
57
<creator>Jonathan D.A. Jewell</creator>
8+
<subject>software-development</subject>
69
<subject>RSR</subject>
7-
<description>RSR-compliant project</description>
10+
<subject>Rhodium Standard</subject>
11+
<description>RSR repository standards and template management</description>
812
<publisher>Rhodium Standard</publisher>
13+
<contributor>Jonathan D.A. Jewell</contributor>
914
<date>2025</date>
1015
<type>Software</type>
16+
<format>application/octet-stream</format>
1117
<identifier>https://github.com/hyperpolymath/conative-gating</identifier>
18+
<source>https://github.com/hyperpolymath/conative-gating</source>
1219
<language>en</language>
20+
<relation>https://rhodium.sh</relation>
1321
<rights>AGPL-3.0-or-later OR LicenseRef-Palimpsest-0.5</rights>
1422
<dcterms:license>https://spdx.org/licenses/AGPL-3.0-or-later.html</dcterms:license>
15-
<dcterms:hasVersion>0.1.0</dcterms:hasVersion>
16-
<dcterms:isPartOf>RSR Framework</dcterms:isPartOf>
1723
</metadata>

README.adoc

Lines changed: 47 additions & 179 deletions
Original file line numberDiff line numberDiff line change
@@ -1,208 +1,76 @@
1-
= Conative Gating
2-
:toc: left
3-
:toclevels: 3
1+
= conative-gating
2+
Jonathan D.A. Jewell <jonathan.jewell@gmail.com>
3+
:toc: macro
44
:icons: font
55
: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
611

7-
SLM-as-Cerebellum for LLM Policy Enforcement
12+
RSR repository standards and template management
813

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]
1516

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::[]
4318

44-
== Quick Start
19+
== Overview
4520

46-
=== Building
21+
conative-gating is part of the link:https://rhodium.sh[Rhodium Standard] (RSR) ecosystem.
4722

48-
[source,bash]
49-
----
50-
cargo build --release
51-
----
23+
Domain: *software-development*
5224

53-
=== Running
25+
== Installation
5426

5527
[source,bash]
5628
----
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}
6231
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}
7435
----
7536

76-
== Policy Configuration
37+
== RSR Stack
7738

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:
8540

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
8949

90-
|**Tier 2** (Acceptable)
91-
|Nickel, Racket
92-
|⚠ Generates concern
50+
== Mirrors
9351

94-
|**Forbidden**
95-
|TypeScript, Python, Go, Java
96-
|✗ Hard violation
52+
[cols="1,2"]
9753
|===
54+
| Platform | URL
9855

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}
11360
|===
114-
|Tool |Requires |Reason
11561

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
19463

195-
The v2 release will include SLM-based "spirit violation" detection:
64+
Licensed under AGPL-3.0-or-later OR LicenseRef-Palimpsest-0.5.
19665

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.
20167

202-
== License
68+
== Contributing
20369

204-
AGPL-3.0-or-later
70+
See link:CONTRIBUTING.adoc[CONTRIBUTING.adoc].
20571

206-
== Author
72+
== Metadata
20773

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

Comments
 (0)