Skip to main content

TRUGS Tools

The TRUGS language CLI. One binary, trug — validate TRUG graphs, compile and decompile TRL, graph-node CRUD, Dark Code compliance, and corpus audit. Implements TRUGS 2.0 (core_v2.0.0).

TRUG/L (TRL) is a constrained subset of English. For the syntax this compiler supports, compilation returns a CORE-valid TRUG graph or fails. Decompilation adds generated-looking identifiers only when needed for graph identity. For compiled sources, defined-term stative clauses follow their definitions and retain stative and conjunction edge occurrences. Node type checks apply only to edge endpoints or operation nodes, independently of hierarchy fields. Every edge relation is checked; unsupported rendered words or uncompilable output cause failure. Successful decompilation returns canonical TRL that compiles. The compilable source contracts and hello.trl preserve node identifiers, node types and edge triples in the round trip. Sugar, original formatting and arbitrary JSON properties need not be preserved. Write TRL when communicating; store and validate TRUGS (the JSON graph) when executing.

Install

pip install trugs-tools

Quickstart

trug --help                          # the verb list, one summary per verb
trug validate first.trug.json        # the 16 CORE rules -> VALID / INVALID
trug trl compile hello.trl > hello.trug.json   # TRL sentence -> TRUG graph (saved to file)
trug trl decompile hello.trug.json             # graph -> compilable canonical TRL, or an error
trug compliance src/                 # Dark Code compliance scan

New to TRUGS? The five-minute on-ramp: GETTING_STARTED.md

Command surface

Eight verbs on the trug binary:

verb what it does
validate Validate a TRUG JSON file against the 16 CORE rules
trl Compile / decompile / validate TRL ↔ TRUG
get Read full content of a node in a TRUG graph
update Update properties on an existing node
delete Remove nodes and their connected edges
unlink Remove specific edges from a TRUG graph
compliance Dark Code compliance check over a source tree
audit Corpus-side audit bridges (markdown / vocab)

Every verb documents examples and exit codes: trug <verb> --help. For trug trl, content syntax, grammar, vocabulary and validation failures exit 1; usage errors (bad arguments, missing or unreadable files, or expected JSON) exit 2.

Role in the TRUGS-LLC portfolio

  • TRUGS — the specification (CORE + TRL + reference papers) and the getting-started guide.
  • TRUGS-TOOLS (this repo) — the language CLI trug (this package).
  • TRUGS-STORE — the swappable graph-storage backend used by the language CLI.

Documentation

Development

make dev      # editable install of the trug CLI with test dependencies (.[test])
make check    # pytest tests/, then trug validate folder.trug.json

The last make check step is Layer-4 self-description: the engine validates the repo's own folder.trug.json against the TRUGS CORE rules it implements.

Scope

This software does not include self-modifying TRUGS: graphs that change their own structure while they run.

License

Apache-2.0 — see LICENSE and NOTICE.

Metadata

Release files for trugs-tools 2.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trugs-tools 2.4.0
File Size Uploaded Provenance
trugs_tools-2.4.0.tar.gz 134.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for trugs-tools 2.4.0
File Interpreter ABI Platform
trugs_tools-2.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 271.5 kB

Release files / trugs_tools-2.4.0.tar.gz

Download URL trugs_tools-2.4.0.tar.gz
Size 134.8 kB
Tags Source
SHA-256 checksum
How to use checksums
9aefc6641a6a60080246eae9062215cb293a52fa329dd86926653ab018c61e3b
BLAKE2b-256 checksum
How to use checksums
ae9141b8bc1e1aafe7ca9865048dceab6873103e4525077fda7391885205f1bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Release files / trugs_tools-2.4.0-py3-none-any.whl

Download URL trugs_tools-2.4.0-py3-none-any.whl
Size 136.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
294ab5cae10a75624a6f5f98a653f7fb0d257b36466361a32057cfdd2fb0537d
BLAKE2b-256 checksum
How to use checksums
1b09020e41e26ba1cc93b74791cbf81cd55581ea69439587519d0bbe18e95ec6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.4

Security for trugs-tools 2.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page