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, it compiles sentence structure to a TRUG graph and decompiles that representation to canonical TRL. Sugar tokens and original formatting are not preserved. Decompiling arbitrary valid TRUG graphs does not guarantee recompilable TRL or preservation of JSON properties. 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 -> the sentence, losslessly
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.3.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.3.0
File Size Uploaded Provenance
trugs_tools-2.3.0.tar.gz 119.7 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 253.3 kB

Release files / trugs_tools-2.3.0.tar.gz

Download URL trugs_tools-2.3.0.tar.gz
Size 119.7 kB
Tags Source
SHA-256 checksum
How to use checksums
69a4b4fb42aee952bef0eecb58bd0e8bfa91eff687958fca105d04c592dee751
BLAKE2b-256 checksum
How to use checksums
68575f738c299fd97e1f37bfb7c51a876278151646260ea43f813ee1fae66d71
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.3.0-py3-none-any.whl

Download URL trugs_tools-2.3.0-py3-none-any.whl
Size 133.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
adedc2483c559116fbee8d6a08c1021c1d79e7fbbca3a5cb0f2e95f0639277d8
BLAKE2b-256 checksum
How to use checksums
efcceed2a18c25d43946cd7f39a7a52061d32fcd5a86990d71db9de78d4c1884
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.3.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