std.code
Snapshot
Section titled “Snapshot”type Snapshot = { version: String, label: String, definitions: List[Definition], errors: List[String], log: List[Entry],}A codebase at one moment. version changes whenever its files do.
Definition
Section titled “Definition”type Definition = { name: String, module: String, label: String, kind: String, public: Bool, doc: String, hash: String, interface: String, source: String, deps: List[String], refs: List[String], impls: List[String], holes: List[String], errors: List[String], verdict: Option[String], last_change: Option[Int],}One definition of a codebase.
nameis qualified by its module (core.run).labelis a test’s
description, else the name.
kindisfn,type,trait,impl,testoruse.interfaceis the signature and contracts, or a whole type or trait.
source is the whole definition. Neither holds the doc.
depsare the definitions it uses,refsthose that use it,impls
the impl blocks of a type or trait.
verdictis the last valid result ofstrata verify(proven,
fuzzed, …).
last_changeis the index inlogof the entry that last changed it.
type Entry = { message: String, time: Option[Int], changes: List[Change] }One strata edit or other change in a package’s log.
time is in seconds since 1970. what of a change is added, removed,
interface or body.
Change
Section titled “Change”type Change = { name: String, what: String }Codebase
Section titled “Codebase”capability Codebase {}The codebase strata is looking at. Only the runtime makes one.
Traits
Section titled “Traits”capability trait Code { /// Cheap. Read the snapshot again only when it changed. fn version(self) -> String /// Fails when a file doesn't decode. fn snapshot(self) -> Result[Snapshot, String]}Reads a codebase.
Implementations
Section titled “Implementations”impl Code for Codebase