Rust Roadmap
Overview
In the near future we plan to introduce new tooling for TSF to replace trudag. The tooling will be written in Rust and is currently in the planning stage. A name for the new tools has not yet been decided.
Motivation
The reason for developing new tools arises from multiple pain points associated with python and the current architecture. With the new tooling, we expect the following improvements:
- Increased Performance: Rust offers better performance and reduced resource usage.
- Ease of Use and Distribution: Single binary rather than convoluted Python environments.
- Extensible Plugins: Plugins that are not tied directly to python objects.
- Improved Remote Graph: Remote graph implementation will be heavily considered in initial design.
Roadmap
The migration from trudag to the new Rust based tools will proceed through the following phases:
-
Documenting Design:
- Document new architecture, schemas and interfaces of the new tool.
- Define an interface for plugins.
- Establish expectations.
-
Acceptance Tests:
- Define an acceptance test framework.
- Setup CI capable of building and testing the new tool.
- Run the acceptance tests against both the old and new tools simultaneously.
-
Migration:
- Release tools enabling existing users to port persistent data to new tools.
- Implement shims to enable compatibility between python trudag plugins and the new tools.
-
Transition:
- Cease development of Python trudag.
Plugin Interface
Currently, trudag plugins are implementations of a Python abstract base class in external modules, which have proven quite restrictive in the follow ways:
- Plugins must be written in Python.
- Plugins cannot be shared, often there is duplicated operations.
- Tight coupling between plugin and trudag code.
- Difficult to version plugins.
In the new tools, we want plugins to satisfy a strict but minimal interface, prioritising extensibility and reliability.
Plugin Protocol
The goal for the new tools is to move computation done in plugins to a structured communication mechanism between the tool and external sources via a remote procedure call. This model decouples plugins from the tool such that they can be developed, tested and deployed completely separately.
Initially, a compatibility shim will be provided to incorporate existing python plugins into the new protocol, which should ease the transition to this new model.
Remote Graphs & Junctions
The integration of multiple projects in TSF is a core part of the design of the new tools.
The new tooling should provide the following functionality:
- Reference and reuse of argumentation from projects that they use in a software context to construct a valid argument about why the integration is Trustable.
- Import templated arguments, for example the TSF tenets and assertions, that can be expanded upon.
- Changes to upstream projects are reflected in the importing project.
The plan is to introduce the "junction" element, separate from statements, that serve as an interface between projects' argumentation.
With junctions, a project implementing TSF can define:
- Argumentation that can utilised by other projects, with accompanying constraints.
- Which argumentation is being imported from other projects and how it integrates into their own argument structure.
This approach enables projects to build upon established arguments rather than reproducing them, whilst maintaining clear separation and tracking of provenance.
Scoring
Current scoring is achieved through representing the graph as an adjacency matrix on which we perform matrix operations to percolate scores up the graph.
With the new tooling, we aim to make scoring more extensible, where different operations of score propagation can occur.
Implementation Architecture
From a technical perspective, the new tooling will be structured as follows:
-
core: Contains primitives - statement, item and graph. Defines core API for interacting with graph as a library, including serialisation to and derserialisation from an artifact.. -
remote: Implementation of junctions. -
resolvers: Defines plugin interface. -
score: Scoring algorithms. -
publish: Report generation. -
cli: Command line frontend.