A protocol that turns human intentions into verifiable, executable policies — and proves every transformation along the way.
TDLN solves a fundamental problem in computing: the gap between what we mean and what machines do. Traditional systems lose the original intent in layers of compilation, configuration, and execution. TDLN preserves it.
What makes TDLN different:
- Deterministic translation: Same intention → same execution, every time
- Cryptographic proof: Every step from idea to implementation is verified
- Fractal structure: Policies compose like building blocks, infinitely
- Cost revolution: A complex silicon chip's logic fits in 50KB of text
- Universal auditability: Hash-based verification, not trust-based
Imagine if every business rule, security policy, or decision logic could be:
- Written once in a format that never ambiguates
- Verified cryptographically so tampering is impossible
- Executed anywhere — software, hardware, distributed systems
- Audited completely with perfect historical record
- Composed infinitely like LEGO blocks
That's TDLN.
At its heart, TDLN introduces the SemanticUnit — a fractal data structure where:
- Each level carries its own hash (cryptographic fingerprint)
- Policies compose into graphs of decisions
- The same text file can become software, hardware, or formal proof
- Nothing is lost in translation; everything is traceable
Real-world impact:
- A 200-million-gate chip can be specified in 50KB of text
- 7x better energy efficiency than general-purpose processors
- 20,000x cost reduction (text file vs fabricated silicon)
- Infinite prototyping before committing to hardware
This isn't incremental improvement. It's an exponential jump in how we think about computation.
TDLN/
├── tdln_core/ # ⭐ Core protocol (Rust)
│ ├── src/lib.rs # SemanticUnit, PolicyBit, Expression
│ └── Cargo.toml
│
├── tdln_runtime/ # CPU evaluator/interpreter
│ ├── src/lib.rs # Runtime para execução de políticas
│ └── Cargo.toml
│
├── specs/ # Especificações canônicas
│ └── tdln-core-v2.0.schema.json
│
├── docs/ # Documentação completa
│ ├── TDLN_FORMAT.md # Especificação do formato .tdln
│ ├── ARCHITECTURE.md # Arquitetura do sistema
│ ├── QUICKSTART.md # Tutorial rápido
│ └── API_REFERENCE.md # Referência de tipos
│
├── examples/ # Exemplos de uso
│ ├── .tdln files # Arquivos de política
│ └── 01_chip/ # Uso: compilação para hardware
│ └── 02_translator/ # Uso: tradutor LN → TDLN
│ └── 03_validator/ # Uso: validação de políticas
│
└── Cargo.toml # Workspace Rust
TDLN operates on three levels:
A .tdln file is a structured JSON document representing a Semantic Unit — a complete, self-contained policy graph:
{
"tdln_spec_version": "2.0.0",
"node_type": "semantic_unit",
"id": "su_550e8400-e29b-41d4-a716-446655440000",
"hash": "blake3_f4a8b2c1d3e5...",
"policies": [
{
"node_type": "policy_bit",
"condition": {
"type": "binary",
"operator": "EQ",
"left": {"type": "context_ref", "path": ["user", "role"]},
"right": {"type": "literal", "value": "admin"}
}
}
]
}Key properties:
- Fractal: Every node (SemanticUnit → PolicyBit → Expression) has
node_type,id,hash - Deterministic: Same semantic meaning → same canonical hash
- Composable: Policies combine in serial, parallel, or conditional graphs
- Verifiable: Cryptographic hashes ensure integrity
TDLN provides the translation layer between human intent and machine execution:
Natural Language → TDLN Core → Executable Format
"Premium users can..." → .tdln file → Python/Metal/Verilog
Every transformation carries a cryptographic proof:
- Source text hash
- Translation steps
- Canonical output hash
- Optional digital signature
This creates an unbroken chain of custody from idea to implementation.
TDLN is infrastructure. Others build on it:
- TDLN-Chip: Compiles policies to hardware (GPU/FPGA/ASIC)
- Translators: Convert natural language to .tdln
- Validators: Prove policy correctness
- Auditors: Track all decisions to their source
- Your application: Any system needing deterministic rules
- Write business rules in English
- Developer interprets and codes them
- Code gets compiled, optimized, obfuscated
- Deploy to production
- Original intent is lost
- Auditing requires reverse-engineering
- Changes risk breaking everything
- Write rules in .tdln format (or have LLM generate them)
- Validate against schema automatically
- Compile to any target (software/hardware)
- Original intent preserved in hash
- Auditing is reading the .tdln file
- Changes are deterministic updates
- Old versions remain valid and verifiable
Result: Faster iteration, perfect auditability, zero ambiguity.
cd TDLN
cargo build --release# Cargo.toml
[dependencies]
tdln_core = { path = "../TDLN/tdln_core" }
tdln_runtime = { path = "../TDLN/tdln_runtime" }use tdln_core::{SemanticUnit, PolicyBit, Expression};
use tdln_runtime::Evaluator;
// Criar uma política
let policy = PolicyBit {
node_type: "policy_bit",
id: "pb_admin_check",
condition: Expression::Binary { /* ... */ }
};
// Avaliar
let evaluator = Evaluator::new();
let result = evaluator.evaluate(&policy, &context);# Validar contra schema
jsonschema -i arquivo.tdln specs/tdln-core-v2.0.schema.json
# Scripts utilitários
./scripts/validate-all.sh
./scripts/check-integrity.sh| Documento | Descrição |
|---|---|
| TDLN_FORMAT.md | Especificação completa do formato .tdln |
| README.examples.md | Guia dos exemplos incluídos |
| tdln-core-v2.0.schema.json | JSON Schema canônico |
TDLN é o protocolo fundacional. Dele derivam aplicações específicas:
- TDLN-Chip 🔩
- Compila políticas TDLN para hardware
- Backends: Metal (GPU), CUDA (NVIDIA), Verilog (FPGA/ASIC)
- Usa:
tdln_core+tdln_runtimedeste repo
TDLN Protocol
├─→ TDLN-Chip (compilar para hardware)
├─→ Tradutor LN (natural language → .tdln)
├─→ Validador (verificação formal)
├─→ Sistema Audit (compliance/rastreabilidade)
└─→ Seu projeto (qualquer aplicação de políticas)
Ver exemplos em examples/ para cada use case.
Arquivos marcados como EXAMPLE ONLY:
examples/premium-user-access.tdln.json— Exemplo completoexamples/chip-minimal.tdln.json— Exemplo mínimogrammar/— Gramáticas de referênciapolicies/— Política neutra de sandbox
.example.* em produção!
- Formato
.tdlnfractal (SemanticUnit) - JSON Schema completo
- Exemplos de referência
- Documentação completa
- Scripts de validação
- Validador TDLN em Rust (standalone binary)
- VSCode extension (syntax highlighting)
- Python library (
tdln-pure) - GitHub Actions workflow para CI/CD
- Showcase com 10+ exemplos .tdln
- TDLN REPL (interpretador interativo)
- Visualizador de grafos (PolicyComposition)
- Ferramenta de diff semântico
- Certificação de conformidade (TDLN Compliant™)
TDLN é um protocolo extensível. Você pode customizar:
- ✅ Operadores customizados via
SemanticOp::Custom(String) - ✅ Metadados para qualquer finalidade
- ✅ Novos backends de compilação (WebGPU, Python, etc.)
- ✅ Novos tipos de units (via fork)
- ✅ Integrações com qualquer linguagem
Limites importantes:
- ❌ Não modifique estruturas core (quebra compatibilidade)
- ❌ Mantenha determinismo (hash consistente)
- ❌ Implemente todas políticas declaradas
➡️ Guia completo: CUSTOMIZATION.md
➡️ Exemplos categorizados: examples/
Categorias de exemplos:
- 01_core_usage/ - Uso básico sem customização
- 02_custom_operators/ - Operadores específicos (AudioFFT, etc.)
- 03_custom_types/ - Extensões de tipos (via fork)
- 04_custom_backends/ - Novos targets de compilação
- 05_integrations/ - Python, JS, REST API, etc.
TDLN Pure = Protocolo (formato .tdln, specs, docs)
TDLN Chip = Implementação (compila .tdln → Metal/CUDA/Verilog)
Analogia: Pure = MP3 spec, Chip = VLC player
Sim! TDLN Pure é independente. Use para:
- Auditoria de políticas
- Validação de workflows
- Documentação formal
- Análise semântica
Blake3 é:
- 10x mais rápido que SHA-256
- Paralelizável (multi-core)
- Mesmo nível de segurança (256-bit)
- Mais moderno (2020 vs 2001)
Garantia de estabilidade:
- Versões
2.xsão backward compatible - Breaking changes só em versões major (
3.0,4.0, etc) - Deprecações anunciadas com 6 meses de antecedência
Leia CONTRIBUTING.md. Em resumo:
- Fork o repo
- Crie branch (
feat/minha-feature) - Siga convenções (JSON Schema, exemplos)
- Abra Pull Request
MIT License © 2025 LogLine Foundation
Ver LICENSE para detalhes completos.
- 📖 Docs: docs/TDLN_FORMAT.md
- 🐛 Issues: GitHub Issues
- 💬 Discussão: GitHub Discussions
TDLN — O protocolo fundacional para aplicação determinística de políticas. 🎯