Vitalis_LFM2.5_Cortex.GGUF / src /devcore /adaptive_curriculum.py
FerrellSyntheticIntelligence's picture
Upload folder using huggingface_hub
d2a5f5a verified
Raw
History Blame Contribute Delete
6.5 kB
"""
Adaptive Curriculum — Vitalis FSI
This is the training heart.
Every cycle: pick a domain, pick a complexity tier, generate a task.
Every output: a real module written to generated/.
Each module is more complex than the last.
Domains rotate so she builds breadth AND depth.
Domains covered:
- Systems engineering
- Software architecture
- Programming patterns
- Framework design
- Security engineering
- Data engineering
- Distributed systems
- Compiler/language design
- Networking
- AI/ML systems
- Operating systems
- Database internals
Tiers:
0 - Scaffold (basic structure)
1 - Implement (working logic)
2 - Optimize (performance aware)
3 - Architect (system design)
4 - Frontier (novel/research level)
"""
import time
import json
from pathlib import Path
CURRICULUM = {
"systems": [
("scaffold process scheduler", 0),
("implement thread pool executor", 1),
("optimize context switch handler", 2),
("architect microkernel message bus", 3),
("design capability-based security kernel",4),
],
"architecture": [
("scaffold hexagonal architecture", 0),
("implement ports and adapters pattern", 1),
("optimize dependency injection container",2),
("architect event-driven service mesh", 3),
("design self-healing distributed brain", 4),
],
"programming": [
("scaffold async task runner", 0),
("implement coroutine scheduler", 1),
("optimize hot path with caching layer", 2),
("architect reactive stream processor", 3),
("design zero-cost abstraction engine", 4),
],
"frameworks": [
("scaffold plugin system", 0),
("implement middleware pipeline", 1),
("optimize request routing table", 2),
("architect modular runtime loader", 3),
("design meta-framework with reflection", 4),
],
"security": [
("scaffold auth token validator", 0),
("implement zero-trust policy engine", 1),
("optimize cryptographic key store", 2),
("architect threat detection pipeline", 3),
("design post-quantum key exchange", 4),
],
"data": [
("scaffold schema registry", 0),
("implement columnar storage engine", 1),
("optimize query execution planner", 2),
("architect streaming data lakehouse", 3),
("design adaptive index structure", 4),
],
"distributed": [
("scaffold service registry", 0),
("implement raft consensus protocol", 1),
("optimize gossip dissemination layer", 2),
("architect byzantine fault tolerant mesh",3),
("design self-organizing peer network", 4),
],
"compilers": [
("scaffold lexer tokenizer", 0),
("implement recursive descent parser", 1),
("optimize ast transformation pass", 2),
("architect ir code generator", 3),
("design jit compilation pipeline", 4),
],
"networking": [
("scaffold tcp connection handler", 0),
("implement http/2 frame parser", 1),
("optimize packet routing table", 2),
("architect software defined network", 3),
("design congestion control algorithm", 4),
],
"ml_systems": [
("scaffold feature extraction pipeline", 0),
("implement gradient descent optimizer", 1),
("optimize inference batching layer", 2),
("architect online learning system", 3),
("design neuromorphic compute graph", 4),
],
"os": [
("scaffold virtual memory manager", 0),
("implement page replacement policy", 1),
("optimize interrupt dispatch table", 2),
("architect real-time scheduler", 3),
("design exokernel resource allocator", 4),
],
"databases": [
("scaffold btree index structure", 0),
("implement mvcc transaction engine", 1),
("optimize write-ahead log manager", 2),
("architect distributed query engine", 3),
("design learned index structure", 4),
],
}
DOMAINS = list(CURRICULUM.keys())
class AdaptiveCurriculum:
def __init__(self):
self._path = (Path.home() / ".vitalis_workspace"
/ "curriculum_state.json")
self._cycle = 0
self._history = []
self._load()
def _load(self):
try:
if self._path.exists():
state = json.loads(self._path.read_text())
self._cycle = state.get("cycle", 0)
self._history = state.get("history", [])
except Exception:
pass
def _save(self):
try:
self._path.parent.mkdir(parents=True, exist_ok=True)
self._path.write_text(json.dumps({
"cycle": self._cycle,
"history": self._history[-500:],
}))
except Exception:
pass
def next_task(self) -> dict:
# Domain rotates every cycle across all 12 domains
domain_idx = self._cycle % len(DOMAINS)
domain = DOMAINS[domain_idx]
# Tier advances every 12 cycles (one full domain rotation)
tier = min(self._cycle // len(DOMAINS), 4)
tasks = CURRICULUM[domain]
task_text, _ = tasks[tier]
entry = {
"cycle": self._cycle,
"domain": domain,
"tier": tier,
"task": task_text,
"timestamp": time.time(),
}
self._history.append(entry)
self._cycle += 1
if self._cycle % 10 == 0:
self._save()
return entry
def report(self) -> dict:
current_tier = min(self._cycle // len(DOMAINS), 4)
tier_names = ["SCAFFOLD", "IMPLEMENT", "OPTIMIZE",
"ARCHITECT", "FRONTIER"]
return {
"total_cycles": self._cycle,
"current_tier": tier_names[current_tier],
"current_domain": DOMAINS[self._cycle % len(DOMAINS)]
if self._cycle > 0 else DOMAINS[0],
"domains_covered": len(DOMAINS),
"tasks_logged": len(self._history),
}