KnowledgeProjectFiles class final

The project files a write's Profile selection came from, which KnowledgeWriter.commit checks under okf's exclusive bundle lock: each absolute path with the SHA-256 of the bytes it held, or null for a file that was absent.

For a bundle a wayfinder.json binds, they are that file, the wayfinder.lock beside it, and each closer wayfinder.json path binding looked at first, absent, since a configuration that appears there would bind the bundle instead. For a bundle none binds, they are the wayfinder.json paths binding looked at, each absent, so a configuration that appears there, which would select a Profile, makes a plan judged without one stale too.

A host captures them together with its own selection, before it selects (forBundle, read) or from the bytes it read itself (the default constructor), so a change between its selection and prepare is caught as well.

Constructors

KnowledgeProjectFiles(Map<String, String?> sha256)
sha256 maps each path to the lowercase hexadecimal SHA-256 of the bytes a host read (digest), or to null for a file that was absent.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sha256 → Map<String, String?>
Each tracked absolute path, with the SHA-256 of its bytes or null for a file that was absent.
final

Methods

changed() → Future<List<String>>
The tracked paths whose bytes differ now from sha256, in its order: changed, created or deleted. A path that is absent is null, the same as one that was absent when these files were captured. A path that exists but cannot be read throws FileSystemException; it is not treated as absent.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

none → KnowledgeProjectFiles
No project file, as for a selection a host built itself: a plan with them is stale only when its bundle changes.
final

Static Methods

digest(List<int> bytes) → String
The SHA-256 of bytes as sha256 records it: lowercase hexadecimal.
forBundle(String bundle, {String? configPath, String? projectRoot}) → Future<KnowledgeProjectFiles>
The files binding bundle reads, as they are now, found as WayfinderProjectConfig.bind finds them: configPath with the wayfinder.lock beside it; or else each wayfinder.json path the search above the bundle, never above projectRoot, looked at, closest first, ending with the one it found and the wayfinder.lock beside it. The paths before the one it found are absent, and one that appears would bind the bundle instead. Reads no configuration's content.
read(String configPath) → Future<KnowledgeProjectFiles>
wayfinder.json at configPath and the wayfinder.lock beside it, as they are now.