Initial Model Card: documentation, usage, and benchmarks
Browse files---
license: apache-2.0
base_model: convaiinnovations/laya
tags:
- code-oracle
- modernbert
- neuro-symbolic
- code-verification
- system-one
- typed-decisions
- risk-calibration
language:
- en
pipeline_tag: text-classification
---
# 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/laya` subfolder `typed-decisions`)
- **Base Model License:** Apache 2.0
- **Fine-tuned By:** Wahyu Febri Tamtomo ([frugaldev.biz.id](https://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
```python
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**.
|
@@ -1,3 +1,85 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
base_model: convaiinnovations/laya
|
| 4 |
+
tags:
|
| 5 |
+
- code-oracle
|
| 6 |
+
- modernbert
|
| 7 |
+
- neuro-symbolic
|
| 8 |
+
- code-verification
|
| 9 |
+
- system-one
|
| 10 |
+
- typed-decisions
|
| 11 |
+
- risk-calibration
|
| 12 |
+
language:
|
| 13 |
+
- en
|
| 14 |
+
pipeline_tag: text-classification
|
| 15 |
---
|
| 16 |
+
|
| 17 |
+
# Code Oracle: Laya ModernBERT 421M Decision Head
|
| 18 |
+
|
| 19 |
+
Fine-tuned decision head for **Code Oracle** (Sub-50ms Neuro-Symbolic Verification Oracle for AI Coding Agents).
|
| 20 |
+
|
| 21 |
+
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`).
|
| 22 |
+
|
| 23 |
+
## Model Details
|
| 24 |
+
|
| 25 |
+
- **Base Architecture:** Laya ModernBERT 421M (`convaiinnovations/laya` subfolder `typed-decisions`)
|
| 26 |
+
- **Base Model License:** Apache 2.0
|
| 27 |
+
- **Fine-tuned By:** Wahyu Febri Tamtomo ([frugaldev.biz.id](https://frugaldev.biz.id))
|
| 28 |
+
- **Training Task:** Dual-decision verification & continuous risk scoring over compact Micro-DSL (< 400 tokens)
|
| 29 |
+
- **Dataset:** 2,400 balanced multi-language mutation samples (Python, TypeScript, Go, Rust) with 50/50 PASS/REJECT parity.
|
| 30 |
+
|
| 31 |
+
## Intended Use
|
| 32 |
+
|
| 33 |
+
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).
|
| 34 |
+
|
| 35 |
+
### Quick Usage with Laya / Transformers
|
| 36 |
+
|
| 37 |
+
```python
|
| 38 |
+
import laya
|
| 39 |
+
|
| 40 |
+
# Load the fine-tuned Code Oracle decision head
|
| 41 |
+
agent = laya.load("wxsys/code-oracle-laya-421m")
|
| 42 |
+
|
| 43 |
+
dsl_prompt = """[DIFF_TARGET] src/calc.py::add (MODIFIED)
|
| 44 |
+
[METADATA] File: src/calc.py | OldLines: [1..2] | NewLines: [1..3] | Nodes: 2 | Edges: 1
|
| 45 |
+
[NODES]
|
| 46 |
+
N0: src/calc.py::add [def add(a: int, b: int = 1) -> int] (SEED, MODIFIED)
|
| 47 |
+
N1: src/calc.py::compute [def compute(x: int)] (CALLER)
|
| 48 |
+
[EDGES]
|
| 49 |
+
N1 -> N0 [CALLS]
|
| 50 |
+
[GATE]
|
| 51 |
+
STATUS: APPROVED (conf: 0.98)
|
| 52 |
+
CYCLES: 0
|
| 53 |
+
VIOLATIONS: NONE"""
|
| 54 |
+
|
| 55 |
+
questions = {
|
| 56 |
+
"status": {
|
| 57 |
+
"type": "choice",
|
| 58 |
+
"instructions": "Determine if the proposed patch is valid and safe to apply.",
|
| 59 |
+
"criteria": {
|
| 60 |
+
"APPROVED": "The code patch preserves all AST topological invariants, interface contracts, and call signatures.",
|
| 61 |
+
"REJECTED": "The code patch introduces circular dependencies, arity mismatches, broken references, or syntax errors."
|
| 62 |
+
}
|
| 63 |
+
},
|
| 64 |
+
"risk": {
|
| 65 |
+
"type": "score",
|
| 66 |
+
"instructions": "Calibrate the risk level of applying this code modification.",
|
| 67 |
+
"criteria": [
|
| 68 |
+
"level 0: Zero risk - purely cosmetic or additive with default parameters.",
|
| 69 |
+
"level 1: Low risk - well-typed modifications with full backward compatibility.",
|
| 70 |
+
"level 2: Medium risk - refactoring with multi-call graph dependency propagation.",
|
| 71 |
+
"level 3: High risk - potential broken callers or semantic contract drift.",
|
| 72 |
+
"level 4: Critical risk - cyclic import loops or fatal signature violations."
|
| 73 |
+
]
|
| 74 |
+
}
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
result = agent.predict(dsl_prompt, questions)
|
| 78 |
+
print("Verdict:", result["answers"]["status"]["choice"])
|
| 79 |
+
print("Risk Score:", float(result["answers"]["risk"]["score"]) / 4.0)
|
| 80 |
+
```
|
| 81 |
+
|
| 82 |
+
## Attribution & License
|
| 83 |
+
|
| 84 |
+
- Fine-tuned derivative work of `convaiinnovations/laya`.
|
| 85 |
+
- Released under the **Apache-2.0 License**.
|