1 2 weeks ago

Deterministic governance and presentation layer that converts AI evaluation outputs into audit‑ready Markdown and JSON reports with strict formatting, audit‑chain extension, and compliance‑focused summaries.

tools
ollama run mladen-gertner/slavkokernel-v8

Details

2 weeks ago

831fa8b2e6d8 · 2.0GB ·

llama
·
3.21B
·
Q4_K_M
<|start_header_id|>system<|end_header_id|> Cutting Knowledge Date: December 2023 {{ if .System }}{{
LLAMA 3.2 COMMUNITY LICENSE AGREEMENT Llama 3.2 Version Release Date: September 25, 2024 “Agreemen
**Llama 3.2** **Acceptable Use Policy** Meta is committed to promoting safe and fair use of its tool
You are SlavkoKernel v8, the governance and presentation layer of the S.L.A.V.K.O.™ orchestration
{ "num_predict": 2048, "repeat_penalty": 1, "stop": [ "<|start_header_id|>",

Readme

🎩 SlavkoKernel v8 – Presentation & Governance Layer

Deterministic Audit_Ready Governance Dual_Output Plugins Formatdisc License

Deterministic reporting. Governance-first summaries.
Every output is both human-readable and machine-readable in a single JSON payload.

📜 Philosophy

S.L.A.V.K.O.™ treats every AI decision as a governance event. The Kernel translates that decision into a format that satisfies auditors, executives, and developers alike.

Core Principles

  1. Deterministic Formatting: Identical indentation, ordering, and wording on every run
  2. Audit-Chain Extension: Adds its own audit ID to the global chain
  3. Governance Summaries: Bullet-point mapping of each rule → compliance outcome
  4. Dual-Output: Markdown for humans, JSON for machines

✨ Core Features

Feature Description
Dual-Output Markdown for people, JSON for machines
Deterministic formatting Identical indentation, ordering, and wording
Audit-chain extension Adds its own audit ID to the global chain
Governance summaries Maps each rule to compliance outcome
Plug-in extensible Add new presentation styles without touching core code

📦 Installation

git clone https://github.com/FormatDisc/slavko-kernel cd slavko-kernel pip install -e .


### Dependencies


python>=3.11
jinja2>=3.1.0
pydantic>=2.0.0
markdown>=3.5.0

## 🚀 Quick Start

python
from slavko_kernel import Kernel
import json

kernel = Kernel()

payload = {
    "summary": "Content review completed successfully",
    "details": {
        "risk_score": 45,
        "compliance_pass": True,
        "rule_breakdown": {
            "KeywordRiskRule": 45,
            "ContrastUXRule": 0,
            "PolicyRule": 0
        }
    },
    "verdict": "PASS",
    "confidence": 0.92
}

report_md, report_json = kernel.render(payload)

print(report_md)
print(json.dumps(report_json, indent=2))


## 📚 Usage Examples

### Compliance Audit

python
from slavko_kernel import Kernel

kernel = Kernel()
compliance_output = {
    "summary": "Document complies with all regulatory requirements",
    "details": {
        "risk_score": 15,
        "compliance_pass": True,
        "rule_breakdown": {
            "GDPR_Compliance": 10,
            "HIPAA_Compliance": 5
        }
    },
    "verdict": "PASS",
    "confidence": 0.95
}

report_md, report_json = kernel.render(compliance_output)
print(report_md)


### UX Review

```python
ux_output = {
    "summary": "UI meets accessibility standards with minor improvements needed",
    "details": {
        "risk_score": 25,
        "compliance_pass": True,
        "rule_breakdown": {
            "ContrastUXRule": 25,
            "WCAG_Compliance": 0
        }
    },
    "verdict": "PASS",
    "confidence": 0.88
}

report_md, report_json = kernel.render(ux_output)
print(report_md)

📋 Governance Summary Template

## Governance Summary

### Verdict
<PASS|FAIL|WARN>

### Risk Assessment
- **Overall Risk Score**: X/100
- **Risk Level**: <Low|Medium|High|Critical>

### Rules Applied
- **RuleName1** → `score: X`
- **RuleName2** → `score: Y`

### Compliance Status
<Compliant|Non-Compliant|Partial>

### Action Items
- **If PASS**: No action required
- **If FAIL**: Remediate according to the `recommendations` field
- **If WARN**: Review and address within SLA

### Audit Trail
- **Audit ID**: `audit-kernel-XXXXXXXX`
- **Timestamp**: ISO-8601
- **Chain**: [audit-shell-XXX, audit-fusion-XXX, audit-score-XXX, audit-kernel-XXX]

🔧 API Reference

Kernel

__init__(self, template_dir: str = None)

Initialize the Kernel with optional custom templates.

kernel = Kernel(template_dir="custom_templates/")

render(self, payload: dict) -> Tuple[str, dict]

Render the input payload into Markdown and JSON outputs.

report_md, report_json = kernel.render(payload)

set_template(self, name: str, content: str)

kernel.set_template("governance", """
## Custom Report
{{ payload.summary }}
""")

🎨 Custom Templates

from slavko_kernel import Kernel

executive_template = """
# Executive Summary

{{ payload.summary }}

## Risk Score: {{ payload.details.risk_score }}/100

{% if payload.verdict == "PASS" %}
✅ Approved
{% elif payload.verdict == "FAIL" %}
❌ Rejected
{% else %}
⚠️ Review Required
{% endif %}
"""

kernel = Kernel()
kernel.set_template("executive", executive_template)
report_md, report_json = kernel.render(payload, template="executive")

📊 Output Schema

{
  "slavko_version": "1.0",
  "component": "Kernel",
  "timestamp": "2025-01-15T10:30:00Z",
  "audit_id": "audit-kernel-8f3e2a1b7c9d",
  "audit_stage": "kernel",
  "audit_chain": [
    "audit-shell-abc123",
    "audit-fusion-def456",
    "audit-score-ghi789",
    "audit-kernel-8f3e2a1b7c9d"
  ],
  "input": { ... },
  "output": { ... },
  "meta": {
    "deterministic": true,
    "pipeline_stage": "kernel",
    "runtime_ms": 1.5
  }
}

📈 Performance

Metric Value
Latency < 2 ms
Memory < 5 MB
Throughput > 10,000 ops/sec
CPU Usage Negligible

🔐 Security Considerations

  • No external dependencies
  • No network calls
  • Deterministic output
  • Full audit trail
  • Template sanitization

🧪 Testing

pytest tests/test_kernel.py -v
pytest tests/integration/test_kernel_integration.py -v
pytest tests/performance/test_kernel_performance.py -v

📞 Contact — Formatdisc

Company: Formatdisc – Computer Programming & Advanced Software Systems
Founder & System Architect: Mladen Gertner
Website: https://formatdisc.hr
Email: mladen@formatdisc.hr
Phone: +385 91 542 1014
Location: Zagreb, Croatia
OIB: 18915075854

GitHub: https://github.com/FormatDisc
LinkedIn: https://linkedin.com/company/formatdisc


Built with S.L.A.V.K.O.™ – Deterministic AI. Sovereign Control.