pub struct Moves<'a> { /* private fields */ }Expand description
The reasoning of one investigation, kept in a store.
Implementations§
Source§impl<'a> Moves<'a>
impl<'a> Moves<'a>
pub fn of(tree: impl Into<String>, kept: &'a dyn Store) -> Self
Sourcepub fn add(&self, writing: Writing<'_>) -> Result<MoveId, Trouble>
pub fn add(&self, writing: Writing<'_>) -> Result<MoveId, Trouble>
Writes a new move and returns its id.
Claims the slot exactly as a trial does: no coordinator, and whoever finds it taken asks for the next. Two people writing at once get two moves, not one lost.
Sourcepub fn went(&self, name: &str) -> Result<MoveId, Trouble>
pub fn went(&self, name: &str) -> Result<MoveId, Trouble>
The move that name reaches. One lookup, no scan.
Sourcepub fn reword(
&self,
id: MoveId,
prose: Option<&str>,
scope: Option<Scope>,
course: Option<Course>,
who: &str,
) -> Result<u32, Trouble>
pub fn reword( &self, id: MoveId, prose: Option<&str>, scope: Option<Scope>, course: Option<Course>, who: &str, ) -> Result<u32, Trouble>
Rewords a move. A new slot, and the last wins: what came before is still there, as in the journal.
What arrives as None stays as it was, so correcting the prose does not
wipe the scope or the other way round. The scope has to be
correctable: in a decision it says which line is meant, and getting it
wrong — reaching a finding, which is not a line, instead of the attempt
it came from — leaves the decision reaching no commit at all with nothing
warning. A course changes but is never removed: a decision that decides
nothing any more is pursue.
Sourcepub fn cite(&self, id: MoveId, cited: Cited, who: &str) -> Result<u32, Trouble>
pub fn cite(&self, id: MoveId, cited: Cited, who: &str) -> Result<u32, Trouble>
Adds one piece of evidence to a move.
A new drafting and the last wins, as with everything here: evidence arrives after the attempt is written, because the trials run afterwards. Citing the same thing twice does not duplicate it — two people looking at one screen would ask for it, and a list with a trial twice says nothing a list with it once does not.
Sourcepub fn hang(&self, child: MoveId, parent: MoveId) -> Result<(), Trouble>
pub fn hang(&self, child: MoveId, parent: MoveId) -> Result<(), Trouble>
Hangs a move under another.
The cycle is refused here, the only place it is cheap: reading it later means discovering it by having a walk hang.
Sourcepub fn say(&self, said: Said) -> Result<(), Trouble>
pub fn say(&self, said: Said) -> Result<(), Trouble>
Says something from a move towards another.
Sourcepub fn all(&self) -> Result<BTreeMap<MoveId, Move>, Trouble>
pub fn all(&self) -> Result<BTreeMap<MoveId, Move>, Trouble>
Every move, by id, with its latest drafting.
Sourcepub fn says(&self) -> Result<Vec<Said>, Trouble>
pub fn says(&self) -> Result<Vec<Said>, Trouble>
Everything anybody said from one move towards another.
The last wins per (from, to, verb), the same rule a drafting follows
in all. Without it a scope could not be corrected: saying it again
would leave both edges and the count would take both, so widening a
scope would look like saying it twice. Saying it again is the gesture
for changing your mind about a scope; withdrawing the verb entirely
still has no gesture.
The triple comes from the meta and not the body, so keeping the last one needs no read of the earlier ones.
Sourcepub fn decided(&self) -> Result<BTreeMap<String, Course>, Trouble>
pub fn decided(&self) -> Result<BTreeMap<String, Course>, Trouble>
What was decided about each commit, derived from the reasoning.
The bridge between the layers, and it runs this way: a commit does not store that it is abandoned. It is reached by going down — decision, its scope, the attempts that scope covers, the commits those attempts cite — so a commit made tomorrow under an abandoned line comes out abandoned with nobody writing anything again.
A decision with no scope is about where it hangs, which is where it parts company with a question or a hypothesis, for which no scope means about everything. In a decision that would be a quiet trap: writing this line is dead while looking at one attempt would mark the whole tree. Abandoning everything means hanging it off the root or naming it.
The last wins: changing your mind is deciding again, and yesterday’s abandonment is still written with its reason.
Sourcepub fn courses(&self) -> Result<BTreeMap<MoveId, (MoveId, Course)>, Trouble>
pub fn courses(&self) -> Result<BTreeMap<MoveId, (MoveId, Course)>, Trouble>
What was decided about each move, and by which decision.
The half of decided that never reaches a commit, and
the one the reasoning is drawn from: an attempt nobody ran cites nothing
and is still abandoned.
Sourcepub fn standing(&self) -> Result<BTreeMap<MoveId, Standing>, Trouble>
pub fn standing(&self) -> Result<BTreeMap<MoveId, Standing>, Trouble>
How each question and hypothesis stands, counting what reached it.
What was withdrawn does not count, which is what
makes a hypothesis go back to open on its own.
Sourcepub fn withdrawn(&self) -> Result<BTreeSet<MoveId>, Trouble>
pub fn withdrawn(&self) -> Result<BTreeSet<MoveId>, Trouble>
The moves whose evidence was judged wrong, so what they said no longer counts towards a standing.
This is where the two layers meet, and it only runs this way. A
verdict is about the code — invalid is deliberately not a Course —
and a finding read off a measurement that lied has nothing behind it.
Nothing is deleted: the edge is still written and still drawn, and a
later sound puts it back, because the journal keeps the last word and
a standing is worked out rather than overwritten.
The direct verdict only. A commit under an invalid one inherits
doubt and not a judgement — walk already draws that line — and
inheriting it needs an ancestry nothing here asks git for.
It reaches up the DAG and not only at the move itself: a finding usually cites the trial it was seen in and hangs under the attempt, and it is the attempt that names the commit. Walking up can only ever pick up an attempt or a finding, since those are the only kinds that cite.