Code Oracle: Laya ModernBERT 421M Decision Head
Fine-tuned decision head for Code Oracle (Sub-50ms Neuro-Symbolic Verification Oracle for AI Coding Agents).
This model evaluates linearized Micro-DSL subgraphs (AST diffs, call graphs, import graphs, and invariant gate states) across 4 Tier 1 programming languages (Python, TypeScript, Go, and Rust) to produce dual-decision verdicts (APPROVED vs REJECTED) and continuous calibrated risk scores (0.0 to 1.0).
Model Details
- Base Architecture: Laya ModernBERT 421M (
convaiinnovations/layasubfoldertyped-decisions) - Base Model License: Apache 2.0
- Fine-tuned By: Wahyu Febri Tamtomo (frugaldev.biz.id)
- Training Task: Dual-decision verification & continuous risk scoring over compact Micro-DSL (< 400 tokens)
- Dataset: 2,400 balanced multi-language mutation samples (Python, TypeScript, Go, Rust) with 50/50 PASS/REJECT parity.
Intended Use
Integrated directly into code-oracle as an in-memory neural decision head paired with deterministic symbolic gates (Tarjan's SCC cycle detector and AST contract invariant checkers).
Quick Usage with Laya / Transformers
import laya
# Load the fine-tuned Code Oracle decision head
agent = laya.load("wxsys/code-oracle-laya-421m")
dsl_prompt = """[DIFF_TARGET] src/calc.py::add (MODIFIED)
[METADATA] File: src/calc.py | OldLines: [1..2] | NewLines: [1..3] | Nodes: 2 | Edges: 1
[NODES]
N0: src/calc.py::add [def add(a: int, b: int = 1) -> int] (SEED, MODIFIED)
N1: src/calc.py::compute [def compute(x: int)] (CALLER)
[EDGES]
N1 -> N0 [CALLS]
[GATE]
STATUS: APPROVED (conf: 0.98)
CYCLES: 0
VIOLATIONS: NONE"""
questions = {
"status": {
"type": "choice",
"instructions": "Determine if the proposed patch is valid and safe to apply.",
"criteria": {
"APPROVED": "The code patch preserves all AST topological invariants, interface contracts, and call signatures.",
"REJECTED": "The code patch introduces circular dependencies, arity mismatches, broken references, or syntax errors."
}
},
"risk": {
"type": "score",
"instructions": "Calibrate the risk level of applying this code modification.",
"criteria": [
"level 0: Zero risk - purely cosmetic or additive with default parameters.",
"level 1: Low risk - well-typed modifications with full backward compatibility.",
"level 2: Medium risk - refactoring with multi-call graph dependency propagation.",
"level 3: High risk - potential broken callers or semantic contract drift.",
"level 4: Critical risk - cyclic import loops or fatal signature violations."
]
}
}
result = agent.predict(dsl_prompt, questions)
print("Verdict:", result["answers"]["status"]["choice"])
print("Risk Score:", float(result["answers"]["risk"]["score"]) / 4.0)
Attribution & License
- Fine-tuned derivative work of
convaiinnovations/laya. - Released under the Apache-2.0 License.
Model tree for wxsys/code-oracle-laya-421m
Base model
convaiinnovations/laya