TRUGS 2.0.0 Apache-2.0

TRUGS

Traceable Recursive Universal Graph Specification

A graph specification a machine can check.

TRUGS is a JSON graph format for structured information, and it comes with sixteen validation rules and a reference validator. A graph either satisfies CORE or it does not — the answer is mechanical, and it is the same answer for everyone who asks. The same artifact is also a sentence: TRUGS/L is its human-readable rendering, and the two are one thing written two ways.

What it is

Three components, one file.

A TRUG is a JSON file. Nodes are typed things — functions, pages, chapters, tasks, parties. Edges are named relationships between them. Hierarchy organizes them by parent and child containment, using metric levels as the transition markers.

The specification is the repository. There is nothing to install in order to read it: the Markdown specs and the .trug.json files are the normative text.

TRUG/L sentence
233 words · 9 parts of speech
⇄compile · decompile
TRUG graph
nodes · edges · hierarchy

The sentence is the program. The graph is the AST. They are one artifact in two renderings.

Four types

Describe. Say. Compute. Govern.

Describe
Map sources into graphs with trugs-web 2.1.0. Open a graph in TRUGS-VIEWER, a live demonstration.
Say
Express graphs as sentences with trugs-tools 2.4.0 and its trug trl command family.
Compute
TRUGS-ACCOUNTING-CALCULATOR represents calculations as graphs and compiles them to native executables.
Govern
Use graphs to govern work. The runner is coming after this release.

TRUGS-TRL and TRUGS-LAW are coming after this release. The payment-schedule example joining TRL and the calculator is coming after this release.

The point

It validates.

This is the most important thing about TRUGS. A format anyone can interpret differently is a suggestion; a format with a decision procedure is a contract. Conformance here is decidable — sixteen rules, run mechanically, returning one answer.

That single property is what everything else rests on. You can gate on it, so nothing runs until it passes. You can accept a graph from someone you do not trust, because you can check it yourself. You can put it in CI and fail the build when a graph drifts from what it describes.

VALID
or
INVALID + error code

Those are the nine core structural rules; seven compositional rules complete the sixteen. SPEC_validation.md carries the structural rules, a reference implementation and an error-code reference; CORE defines the compositional rules.

The language

TRUG/L

TRUGS and TRUGS/L say the same thing. They are not two languages — they are one artifact in two renderings. The graph is what a machine reads; the sentence is what a person reads. Either can be produced from the other.

TRUG/L is a formalized subset of English drawn from computation, law, and the SI prefixes. Every word is in the vocabulary; nothing outside it parses.

PARTY system SHALL FILTER ALL ACTIVE RECORD
  THEN SORT RESULT
  THEN WRITE RESULT TO ENDPOINT output
  OR RETRY BOUNDED 3 WITHIN 60s.

Sugar words

Because a person has to read it, TRUG/L allows sugar: tokens matching the 'word pattern, which are stripped before parsing. They carry no meaning and appear nowhere in the graph. They exist so a sentence can read like a sentence.

Without sugar
NO PARTY SHALL WRITE CONFIDENTIAL RESOURCE
  EXCEPT PARTY owner MAY WRITE CONFIDENTIAL RESOURCE
    PROVIDED_THAT PARTY owner AUTHENTICATE TO SERVICE auth.
With sugar
NO PARTY SHALL WRITE CONFIDENTIAL RESOURCE
  EXCEPT PARTY owner 'who MAY WRITE 'such CONFIDENTIAL RESOURCE
    PROVIDED_THAT PARTY owner 'who AUTHENTICATE TO SERVICE auth.

→ both compile to identical graphs

233executable words, plus the sugar pattern
9parts of speech
21SI level prefixes
30parsed examples
The contract

CORE + BRANCH = a complete TRUG.

CORE defines the universal structure every TRUG must satisfy — the boundaries, the primitive classes, the validation rules, and the composition type system. It does not change without a spec revision.

BRANCHES define domain-specific vocabularies on top of it. Medical, financial, legal, robotics — whatever your domain needs that CORE does not already carry.

7boundaries
10primitive classes
~140primitives
16validation rules
Specification

The normative documents.

All of it lives in the repository, versioned with the spec. language.trug.json is the opening TRUG — the language defining itself.

DocumentContents
CORE.mdBoundaries, primitive classes, the 16 validation rules, composition type system
BRANCHES.mdDomain vocabularies — Python, Web, Writer, Knowledge and others
SPEC_fundamentals.mdCore concepts and structure
SPEC_validation.mdValidation rules, with implementations
SCHEMA.mdJSON schema reference
SPEC_vocabulary.mdThe 233 words, 9 parts of speech, formal definitions
SPEC_grammar.mdBNF grammar and composition rules
SPEC_examples.md30 parsed examples
CHEATSHEET.mdThe vocabulary at a glance
language.trug.jsonThe opening TRUG — the language defining itself
Released tooling

Read, write and check graphs.

trugs-tools 2.4.0 provides the trug CLI: validation, TRL compile and decompile, graph CRUD and compliance checking. trugs-store 2.2.0 is the shared graph storage layer. trugs-web 2.1.0 describes folders as graphs and queries them. The language and describe tools require Python 3.11 or later.

TRUGS-AGENT is the onboarding kit. Its installer, trugs-agent 2.0.0, places the entry instructions in your project. Install the kit and run its check.

After installing, inspect the language commands:

trug --help
trug trl --help

Both commands print usage and available subcommands, then exit with status 0.

Examples

Graphs across domains.

Sample TRUGs at varying complexity in the EXAMPLES directory. The repository carries examples to inspect and validate.

knowledgelivingmemorynestedresearchwebwriter
Self-describing

The repository is itself a TRUG.

folder.trug.json at the repository root is a machine-readable index: every top-level folder, every reference document and every public tool has a node, with typed edges to the specs it implements or describes.

CI checks the repository on every push and pull request. The section list in the README, the specification index, and the tool table all correspond to nodes you can traverse programmatically — and when the graph drifts from the prose or the filesystem, the build fails.

Build on it

Branches and implementations.

CORE and the language are maintained by TRUGS LLC. The vocabulary, grammar and validation rules are the specification; they do not change without a spec revision.

Branches are where everyone else builds — domain vocabulary layered on CORE for medicine, finance, law, robotics, or whatever CORE does not already carry.

  1. Define your domain's node types and edge relations.
  2. Use CORE primitives as the foundation.
  3. Declare the extensions your branch requires.
  4. Add your domain's words to your opening TRUG.
  5. Ship a validator for your branch. Your branch's semantics are yours to check — nothing else will.

That last step is the one people skip, and it is the one that matters. The division is fixed:

CORE validates structure

Node identity, edge validity, hierarchy, metric ordering, declared dimensions, required fields, field types, declared extensions, level format.

Universal · unchanged without a spec revision

Branches validate semantics

Whether your domain's vocabulary is used correctly — that an operation spec declares the capability it needs, that your types carry what your domain requires.

Yours to write · yours to maintain

Every TRUG passes CORE validation regardless of branch — so CORE passing is not your branch passing. A branch that ships no validator produces graphs that are structurally sound and semantically unchecked, which forfeits, for your domain, the one property the specification exists to provide.

You don't need permission. Build it, use it, share it.

Once enough people use a branch in the same domain, it can be formalized into the specification through the community. Implementations in any language are welcome — read, write, validate or execute TRUGs however you like. The spec is the contract.

License & citation

Apache 2.0. Anyone may implement it.

The specification and its reference tools are released under the Apache License 2.0. The standard is stewarded by TRUGS LLC, which maintains CORE and the language and holds the specification neutral of any one implementer.

The published record is DOI 10.5281/zenodo.19379454.

Specification
TRUGS-LLC/TRUGS — the normative text, examples, and the self-describing graph
Language CLI
TRUGS-LLC/TRUGS-TOOLS — trugs-tools, the trug binary
Onboarding kit
TRUGS-LLC/TRUGS-AGENT — entry instructions, a primer, examples and an installer for agents
Repositories

The public material.

Companies

One owner holds both TRUGS LLC and Arek Starr LLC. Arek Starr LLC is the only company building TRUGS. TRUGS LLC’s open material needs no Arek Starr LLC product.