Skip to main content

Module intent

Module intent 

Source
Expand description

Intents: what must become true above the milestones that realise it, and whether the recorded evidence says it has.

An intent is a record under .ai/repo/project/intents/ (kind intent, schema majordomus.intent/v1): a statement, the invariants that must stay true, the milestones that realise it, and the satisfaction criteria that settle it, each naming its evidence.

This is a derivation, not a lifecycle. No stage is stored, nothing here transitions and nothing here writes. The stage of an intent is a pure function of two things that already exist: the status crate::plan::Plan derives for each milestone the intent names, and the proof state the evidence ledger holds for each criterion’s test or claim. A second task model beside the plan would be a second source of truth about the same work, which is the defect the plan was built to remove (ADR 0070).

The stages, in order, each implying the one before:

stagederived when
declareda named milestone does not resolve, or none is named
plannedevery milestone resolves
executingany milestone is ACTIVE, VERIFY or DONE
verifyingevery milestone that is not cancelled or superseded is DONE
satisfiedverifying, and every criterion has current evidence

cancelled and superseded are what the record says happened to it, as for a milestone. Nothing else is.

Beside the stage stands the verdict (ADR 0107): the evidence question alone, derived from the criteria and never from the plan. It is satisfied when every criterion is met, unsatisfied when a criterion the ledger or the claim join can settle (test, claim) is not, and unknown when every unmet criterion is of a kind the ledger cannot yet settle (command, deployment) or the intent declares none. DONE neither implies it nor is required for it, so an intent whose criteria all hold while a milestone is open reads a satisfied verdict at stage executing — a disagreement the realization reports as drift.

use majordomus_cli::intent::{IntentStage, IntentVerdictState};
assert_eq!(IntentStage::Satisfied.as_str(), "satisfied");
assert!(IntentStage::Verifying < IntentStage::Satisfied);
assert_eq!(IntentVerdictState::Unknown.as_str(), "unknown");

Structs§

ClaimStanding
What a declared claim’s evidence says: the criterion’s state, and the claim report’s own verdict behind it — proven and inputs_unchanged both meet a criterion, and stay two answers.
CriterionRecord
One satisfaction criterion as the record declares it: what must be observably true, the kind of evidence that settles it, and what that evidence names.
IntentCriterion
One criterion with the evidence behind it: what the record declared, what the ledger says about it, whether that meets it, and the command that would produce the evidence again.
IntentFinding
One validation finding: its level, a stable code a reader greps for, the intent or milestone it is about, one line of what is wrong, and the command that shows it again.
IntentMilestone
One milestone an intent names, as the plan derives it. A milestone that does not resolve is carried with resolved: false rather than dropped, because a name that points at nothing is a finding and not an absence.
IntentPreflight
Which intent a piece of work serves, whether it is maintenance, or why it may not proceed: the issues it resolved to with a verdict each, every intent reached with its link, what those intents require of the worker, and every refusal with its cause.
IntentPreflightCritique
The critique of an intent as a preflight reads it: where it is, when and by whom the plan was reviewed, and the blocking findings still open.
IntentPreflightGap
The recorded gap of an intent as a preflight reads it, bounded to the criteria the work serves: what was observed of each, at which commit, and the risks.
IntentPreflightIntent
One intent the work is held to, with what a worker needs before touching it: the statement, the criteria the work serves with the live state of their evidence, the invariants and non-goals, the governance, the critique and the gap. Only the intents the work reaches are carried, never every intent.
IntentPreflightIssue
One issue the work resolved to, and what the preflight concluded about it.
IntentPreflightMatch
One intent a piece of work serves, and the link that says so: issue to the criteria it declares in serves, each criterion’s intent naming the issue’s milestone.
IntentPreflightRefusal
One reason a preflight refused: which issue, the cause, and one sentence of what is wrong.
IntentRecord
One intent as its file declares it: the statement that must become true, the invariants that must stay true, the milestones that realise it and the criteria that settle it. Nothing derived is stored here.
IntentVerdict
Whether the evidence alone settles an intent, and which criteria hold it back: every unmet criterion, in the order the record declares them. Empty when the verdict is satisfied, and when it is unknown because the intent declares no criterion.
IntentVerdictReason
One criterion that holds a verdict back from satisfied: which one, the kind of evidence it names, and the state that evidence is in — the criterion’s own words, not new ones.
IntentView
One intent, as its record declares it and as the plan and the ledger derive it: the statement and invariants as authored, each milestone with its derived status, each criterion with the state of its evidence, the stage that follows from both, and the verdict that follows from the evidence alone.
Intents
Every intent, derived, with every finding: what majordomus intent validate answers out of, and what the list, the record and the preflight are read from. Nothing here is stored.
Proposed
What propose wrote: the identity, the file, and the record as it now reads.
RepositoryEvidence
The evidence of a real repository: its ledger, its claim matrix joined to that ledger, its index and its tree, judged at the working tree by the evidence module’s own derivation — evidence::report for a claim, evidence::freshness() over the same evidence::compare for a test — so a criterion is current exactly when the rest of Majordomus would call its evidence current. The claim join and the comparisons run git, so each is computed once, and only when a criterion or a governance entry asks.
TestStanding
What one test’s recorded evidence says: whether its source is in the tree at all, and what its latest recorded run came to. A test that is not there cannot settle anything.

Enums§

IntentEvidenceState
What the evidence behind one criterion says, as a word. Only Current meets a criterion: a stale, failing, unrecorded or underivable reference never does, and neither does one that resolves to nothing.
IntentPreflightCause
Why a preflight refused, as a word a reader greps for.
IntentPreflightVerdict
What a preflight concluded, about one issue or about the whole piece of work.
IntentStage
Where an intent stands, derived on every read and stored nowhere.
IntentVerdictState
What the evidence alone says about an intent, as a word: derived from its criteria and never from the plan, so it can read satisfied while a milestone is still open (ADR 0107).
ProposeError
Why propose wrote nothing: the input cannot make a record, a record of that identity already exists, or the file could not be written. Each carries the sentence a caller is shown, and the three are kept apart so that a transport can answer invalid input, a refusal and its own failure differently.

Constants§

FAIL
A failure: the intent model is invalid.
INTENT
The kind of an intent record.
INTENTS_DIR
The directory intent records live in, repository-relative.
REPRODUCE
The command that shows every intent finding again.
WARN
A warning: legal, and worth reading.

Traits§

EvidenceLookup
The facts the derivation reads beyond the plan. The repository answers them from the ledger, the claim matrix and the tree; a test answers them from a table.

Functions§

outlines
What the planning half needs of each record: its criteria, its milestones, whether it is retired, and the criteria its recorded gap observed already satisfied.
propose
Write a new intent record that says what must become true and nothing else yet (ADR 0144).
proposed_id
The identity a proposal takes when none is given: the slug of its title, cut at a word boundary within PROPOSED_ID_MAX (64) characters.
stage
The stage of an intent from the facts it rests on. Pure: no index, no ledger.
verdict
The verdict of an intent from its criteria alone. Pure: no plan, no index, no ledger — the criteria already carry what the evidence said.