Skip to content

Commit d660a3c

Browse files
Claude/freeze gating contract j sy xa (#13)
Signed-off-by: Jonathan D.A. Jewell <[email protected]> Co-authored-by: Claude <[email protected]>
1 parent ca8f25a commit d660a3c

File tree

6 files changed

+96
-21
lines changed

6 files changed

+96
-21
lines changed

ROADMAP.adoc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ Development roadmap for the SLM-as-Cerebellum policy enforcement system.
3636
| Interface defined, needs llama.cpp
3737

3838
| Consensus Arbiter
39-
| [red]#*NOT STARTED*#
40-
| Elixir/OTP implementation pending
39+
| [yellow]#*STARTED*#
40+
| GenServer skeleton, Application module, decide/3 logic
4141

4242
| LLM Integration
4343
| [red]#*NOT STARTED*#
@@ -157,13 +157,13 @@ Implement modified PBFT consensus with asymmetric weighting in Elixir/OTP.
157157
=== Tasks
158158

159159
[%interactive]
160-
* [ ] Set up Elixir/OTP project structure
161-
* [ ] Implement GenServer for arbiter
162-
* [ ] Define consensus protocol messages
163-
* [ ] Implement asymmetric weighting (SLM = 1.5x)
164-
* [ ] Add escalation logic
160+
* [x] Set up Elixir/OTP project structure
161+
* [x] Implement GenServer for arbiter
162+
* [x] Define consensus protocol messages
163+
* [x] Implement asymmetric weighting (SLM = 1.5x)
164+
* [x] Add escalation logic
165165
* [ ] Implement audit logging
166-
* [ ] Create supervision tree
166+
* [x] Create supervision tree
167167
* [ ] Add Rustler NIFs for Oracle/SLM calls
168168
* [ ] Write property-based tests
169169

SECURITY.md

Lines changed: 57 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,66 @@
22

33
## Supported Versions
44

5-
Use this section to tell people about which versions of your project are
6-
currently being supported with security updates.
7-
85
| Version | Supported |
96
| ------- | ------------------ |
10-
| 5.1.x | :white_check_mark: |
11-
| 5.0.x | :x: |
12-
| 4.0.x | :white_check_mark: |
13-
| < 4.0 | :x: |
7+
| 0.1.x | :white_check_mark: |
148

159
## Reporting a Vulnerability
1610

17-
Use this section to tell people how to report a vulnerability.
11+
If you discover a security vulnerability in Conative Gating, please report it responsibly:
12+
13+
1. **Email**: [email protected]
14+
2. **Subject**: `[SECURITY] conative-gating: Brief description`
15+
3. **Include**:
16+
- Description of the vulnerability
17+
- Steps to reproduce
18+
- Potential impact assessment
19+
- Any suggested fixes (optional)
20+
21+
### Response Timeline
22+
23+
- **Initial acknowledgment**: Within 48 hours
24+
- **Triage and assessment**: Within 7 days
25+
- **Fix or mitigation**: Depends on severity
26+
- Critical: Within 7 days
27+
- High: Within 30 days
28+
- Medium/Low: Next release cycle
29+
30+
### What to Expect
31+
32+
- We will acknowledge receipt of your report
33+
- We will investigate and keep you informed of progress
34+
- We will credit you in the security advisory (unless you prefer anonymity)
35+
- We will not take legal action against good-faith security researchers
36+
37+
## Security Considerations
38+
39+
### Policy Oracle
40+
41+
The Policy Oracle performs deterministic rule checking:
42+
- File extension and content marker detection
43+
- Pattern matching for forbidden content (secrets, banned languages)
44+
- No external network calls during evaluation
45+
46+
### SLM Evaluator (Planned)
47+
48+
Future SLM integration will:
49+
- Run locally using llama.cpp (no external API calls)
50+
- Use quantized models for reduced attack surface
51+
- Implement input sanitization before inference
52+
53+
### Consensus Arbiter (Planned)
54+
55+
The Elixir arbiter will:
56+
- Use supervision trees for fault tolerance
57+
- Implement rate limiting to prevent DoS
58+
- Log all decisions for audit purposes
59+
60+
## Hardening Recommendations
61+
62+
When deploying Conative Gating:
1863

19-
Tell them where to go, how often they can expect to get an update on a
20-
reported vulnerability, what to expect if the vulnerability is accepted or
21-
declined, etc.
64+
1. Run with minimal privileges
65+
2. Use read-only access to scanned directories where possible
66+
3. Validate all external inputs (proposal JSON schemas)
67+
4. Review audit logs regularly
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell <[email protected]>
2+
# SPDX-License-Identifier: AGPL-3.0-or-later
3+
4+
defmodule ConativeGating.Application do
5+
@moduledoc """
6+
OTP Application for Conative Gating Consensus Arbiter.
7+
8+
Starts the supervision tree for the consensus arbiter and related processes.
9+
"""
10+
11+
use Application
12+
13+
@impl true
14+
def start(_type, _args) do
15+
children = [
16+
# Start the Consensus Arbiter GenServer
17+
ConativeGating.ConsensusArbiter
18+
]
19+
20+
opts = [strategy: :one_for_one, name: ConativeGating.Supervisor]
21+
Supervisor.start_link(children, opts)
22+
end
23+
end

src/arbiter/lib/conative_gating/consensus_arbiter.ex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell <[email protected]>
2+
# SPDX-License-Identifier: AGPL-3.0-or-later
3+
14
defmodule ConativeGating.ConsensusArbiter do
25
@moduledoc """
36
Consensus Arbiter for Conative Gating.

src/arbiter/mix.exs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# SPDX-FileCopyrightText: 2025 Jonathan D.A. Jewell <[email protected]>
2+
# SPDX-License-Identifier: AGPL-3.0-or-later
3+
14
defmodule ConativeGating.MixProject do
25
use Mix.Project
36

src/contract/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -686,8 +686,8 @@ impl ContractRunner {
686686
refusal,
687687
evaluations: EvaluationChain {
688688
oracle: Some(oracle_eval.clone()),
689-
slm: None, // Not yet implemented
690-
arbiter: None, // Not yet implemented
689+
slm: None, // Phase 2: Requires llama.cpp integration
690+
arbiter: None, // Phase 4: Elixir GenServer via Rustler NIF
691691
},
692692
processing: ProcessingMetadata {
693693
duration_us: duration.as_micros() as u64,

0 commit comments

Comments
 (0)