Skip to content

Kinds

A kind is a list of stages. Each stage names a prompt and the one deliverable that ends it, and the kind says whether its work lands. A launch names its kind, --kind fix, and flume runs that kind’s stages in order in the place, a fresh agent for each.

flume’s three kinds, each a track of stages that end on their deliverablesThree tracks side by side. A fix, on fix/bump-mise from a release tool’s fix key: code waits on a new commit, then the merge queue lands it, and the place is tidied. A change, on change/csv-export from an inbox’s send: construct waits on the OpenSpec change written; code waits on every task ticked, and its six tasks tick one by one; verify waits on the change archived; the merge queue lands it; the place is tidied. A chore, on chore/bump-deps from your /launch: code works, its place waits on you once under a hold, works again and commits; the merge queue lands it, and the place is tidied. Each stage starts a fresh agent and lights the next only once its deliverable exists. A repository or a launch may declare kinds of its own in the same form. fix fix/bump-mise launched here by a release tool’s fix key code not started agent 1 · working waits on a new commit committed: bump mise landing not started submitted waits on the merge queue landed on main then flume tidies it tidied: place and branch change change/csv-export launched here by an inbox’s send construct not started agent 1 · working waits on the OpenSpec change the change, written code not started agent 2 · working waits on every task ticked 6 of 6 tasks ticked verify not started agent 3 · working waits on the change archived the change, archived landing not started submitted waits on the merge queue landed on main then flume tidies it tidied: place and branch chore chore/bump-deps launched here by your /launch code not started working waiting on you working waits on a new commit committed: bump deps landing not started submitted waits on the merge queue landed on main then flume tidies it tidied: place and branch A repository or a launch may declare kinds of its own: each stage names its prompt and its deliverable.
flume’s three kinds, each a track of stages that end on their deliverablesThree tracks side by side. A fix, on fix/bump-mise from a release tool’s fix key: code waits on a new commit, then the merge queue lands it, and the place is tidied. A change, on change/csv-export from an inbox’s send: construct waits on the OpenSpec change written; code waits on every task ticked, and its six tasks tick one by one; verify waits on the change archived; the merge queue lands it; the place is tidied. A chore, on chore/bump-deps from your /launch: code works, its place waits on you once under a hold, works again and commits; the merge queue lands it, and the place is tidied. Each stage starts a fresh agent and lights the next only once its deliverable exists. A repository or a launch may declare kinds of its own in the same form. fix fix/bump-mise launched here by a release tool’s fix key code not started agent 1 · working waits on a new commit committed: bump mise landing not started submitted waits on the merge queue landed on main then flume tidies it tidied: place and branch change change/csv-export launched here by an inbox’s send construct not started agent 1 · working waits on the OpenSpec change the change, written code not started agent 2 · working waits on every task ticked 6 of 6 tasks ticked verify not started agent 3 · working waits on the change archived the change, archived landing not started submitted waits on the merge queue landed on main then flume tidies it tidied: place and branch chore chore/bump-deps launched here by your /launch code not started working waiting on you working waits on a new commit committed: bump deps landing not started submitted waits on the merge queue landed on main then flume tidies it tidied: place and branch A repository or a launch may declare its own kinds, each stage with its prompt and its deliverable.
flume’s three kinds side by side. Each stage waits on its deliverable, and the next starts only once it exists. A change's tasks tick one by one, flume submits the work to the merge queue once the last stage delivers, and tidies the place once it lands.

flume carries three kinds in its binary:

Kind Stage Its deliverable Prefix Starts unready
fix code commits on the place’s branch fix yes
chore code commits on the place’s branch chore yes
change construct the OpenSpec change written, its planning complete change no
code every task of the change ticked
verify the change archived

All three land: once the last stage delivers, flume submits the place to the merge queue. A failed or conflicting submission goes back to code, the stage each kind names for a failure, with the merge queue’s words in its prompt.

Starts unready says what happens when the place could not be made ready. A fix or a chore starts its first stage anyway, and the prompt says which step failed and what it printed, since the fix may be the failing step. A change waits instead, and flume status shows the failed step.

A change’s three stages each read the change at openspec/changes/<name>, named for the place. A launch is refused when the base already holds a change of that name, archived or not, or when another live place of the repository is building one. The verify stage writes its report to verify.md in the change, and where the work falls short it archives nothing and stops short having found work, which sends the place back to code with its words.

A kind runs through on its own:

  1. flume starts the first stage’s agent with the stage’s prompt.
  2. Once the deliverable exists at the place’s branch head and the agent is quiet, flume ends the agent and starts the next stage’s.
  3. Once the last stage delivers, flume submits the place, when the kind lands. A kind that does not land waits for flume done.
  4. Once the merge queue lands the work, flume tidies the place.

Nothing waits on your word unless the launch or a hold asks for it (callers, holds and ends). Three things send the work back to the stage the kind names for a failure, with words for its agent: a failed submission, a conflicting one, and found work from the kind’s last stage, flume needs --found, where the stage it names is one before the last, as a change’s code is before its verify. Each going-back counts toward the kind’s bound, three unless the last stage sets max_send_backs. Past the bound the place waits for you. A conflict’s words name the contested files and the base revision the merge queue tested against. The built-in prompts tell the agent to merge that revision into the place’s branch, resolve the files and commit, never to rebase.

A stop-short that needs an answer, flume needs "<words>", starts no next stage: the place waits until a retry carries the answer, or a message while its agent is kept open for it (the agent kept open). Found work is work a stage before the agent’s own must do again, so found work from any stage but the last waits the same way, and so does found work from a last stage whose on_fail names that stage itself or names none, as fix’s and chore’s code does: no stage before it can do the work again. The answer carries the findings with your words, and counts no going-back.

A kind has an identity, <source>/<name>@<version>, such as flume/fix@1 or acme/review@2. Its source says where it lies:

Source Its kinds
flume flume’s own, carried in its binary
repo the repository’s .config/flume.toml, read at the base’s current revision
launch the file the launch names with --kinds <file>
any other name the packages of a source the host declares (kinds from a source on the host)

A launch names its kind with or without its source and version:

--kind flume looks in and takes the version
review the launch’s file, else the repository’s, else flume’s own the one that declaration holds, or, for flume’s own, as the locks pick it
review@2 the same 2, refused where the declaration holding the name holds another
acme/review the source acme alone as the locks pick it
acme/review@2 the source acme alone 2

flume/change, repo/bump and launch/spike name flume’s own, the repository’s and the launch’s file alone, with or without a version, in the same way. So a repository that declares fix stands its own over flume’s for a bare fix, and flume/fix still names flume’s. A name that resolves to nothing refuses the launch, naming what each source holds, and makes nothing.

flume’s own kinds are flume/fix@1, flume/fix@2, flume/chore@1, flume/chore@2 and flume/change@1 to flume/change@5. A bare name takes the newest, change@5, chore@2 or fix@2, unless a lock records another. The versions of change share their stages and differ in how they code a change:

  • change@1 codes the whole change with one agent.
  • change@2 codes it with a fresh agent for each task group, one after another.
  • change@3 codes it with one agent that checks each task by its own check, the narrowest that shows it done, and its verify runs the repository’s whole checks once.
  • change@4 codes it as change@3 does.
  • change@5 codes it as change@4 does, works the change through OpenSpec’s own commands, and hands its change to code only once OpenSpec’s strict check, openspec validate --strict, passes.

change@4, chore@2 and fix@2 are each the version before it, but that they give their agents full (flume’s own kinds) and say in each prompt that stopping short is the agent’s one way to ask. change@5 does both too.

A place keeps the kind its launch read for its whole life (a place keeps its kind). flume status gives each place’s kind with its version and where it came from, as in fix@1 (flume) or spike@1 (repository). The line after it gives the kind’s identity and where it came from, and for a package its hash and the lock that recorded it:

kind flume/fix@1, flume's own, its hash sha256:59dee7a3…
kind repo/spike@1 from the repository at 9ba6b13
kind acme/review@1 from the source acme (~/.config/flume/sources/acme.toml) at ~/.local/share/flume/kinds/acme/review@1, its hash sha256:ab12…, locked in ~/.config/flume/flume.lock

Kinds are TOML, one table per kind under [kinds], each with its stages as an array of tables in order. This kind explores an idea and commits a note, and lands nothing:

.config/flume.toml
[profiles]
place = "git-worktree"
merge_queue = "sluice"
[kinds.spike]
branch = "spike"
[[kinds.spike.stages]]
name = "explore"
prompt = "prompts/spike.md"
deliverables = ["committed:notes/spike.md"]
makes = ["preview"]
agents = [{}]

and its prompt, .config/prompts/spike.md, beside the file:

You are the {{stage}} stage of the spike {{name}}, in {{place}} on {{branch}}.
{{brief}}
Write what you found to {{report}} and commit it. Record each thing you
bring up as one JSON line in {{made}}.

flume launch --kind spike --name try-it --brief "Try a faster tokenizer." then makes the place spike--try-it on spike/try-it and starts explore. Since the kind does not land, the place waits once the note is committed, until flume done spike--try-it declares the work complete and flume tidies it.

Field Meaning Left out
version a whole number of at least 1, shown with the kind’s name 1
branch the prefix of its places’ branches the kind’s name
starts_unready the first stage starts in a place that could not be made ready false
lands flume submits the place once the last stage delivers false
agents settings for every stage’s agent, and for the stages named under agents.stages.<stage> none
stages the stages, in order: at least one, or stages = [] for a kind that lands with no stages (a kind with no stages) refused
landing_fix on a kind that lands with no stages, the kind its fixes run as when the merge queue sends its branch back, by that kind’s identity with its version, as flume/fix@1 no fix
max_landing_fixes on such a kind, how many fixes it runs before its place waits on you 3

A kind that lands may declare stages = []. Its place is a base place: a branch other places land on, which lands in its turn. It runs no agent, has no worktree, and is submitted only when you retry its submission once every place on its branch is over:

[kinds.train]
branch = "train"
lands = true
stages = []
landing_fix = "flume/fix@1"
max_landing_fixes = 2

landing_fix names the kind a fix of the branch runs as, launched when the merge queue forecasts the branch in conflict with its base or its submission fails. It’s that kind’s whole identity, its source and its version: flume/fix@1 for flume’s own fix, or repo/mend@1 for a kind the repository declares. A bare name, or an identity with no version, refuses the launch, naming the field. flume resolves it when the base place launches. Where it names no kind, or a kind that does not land or has no stages, the launch is refused. It’s no part of a package that names it, or of the package’s hash. max_landing_fixes is how many fixes it runs before its place waits on you; left out, three. A kind with stages that gives either field refuses the launch, naming it: such a kind sends a failed submission back to a stage, by on_fail. A base place whose kind names no landing fix waits on you after a failed or conflicting submission. Its fixes follows one through.

A kind that does not land and declares stages = [] refuses the launch, naming its stages. A table that leaves stages out is no kind: it gives settings to a kind declared elsewhere (settings). flume carries no kind with no stages; a repository, a source on the host or a launch declares one. Branches that land on branches follows a base place from its launch to its tidy.

Field Meaning Left out
name the stage’s name, unique in its kind refused
prompt the path of its prompt, relative to the declaration’s own folder refused
deliverables its one deliverable, in a list of one refused, unless a conversation
conversation true for a stage with no deliverable, ended by flume finish false
agents a list of exactly one table: the stage’s agent and its settings refused by flume
makes names of what the stage makes besides its deliverable none
wait the stage is held before it starts, until a retry names it false
hibernate flume hibernates the stage: its agent ended and its session kept, a conversation once it idles its hibernate_after, any such stage’s agent kept open for an answer once its time passes, and either at flume hibernate; a resume, a message or its answer wakes it in its own session (hibernating) false
quiet how long its agent may be quiet with nothing delivered before it is stuck and flume ends the stage short, as 45m 30 minutes
on_fail the stage a failed submission sends the place back to, and found work from the last stage where it names a stage before the last, read from the last stage; that stage and every one after it run again. Found work from a last stage that names itself or none waits on an answer the last stage
max_send_backs how many times the place may go back, read from the last stage 3

flume ignores every table and key it does not know, so a declaration can carry sections another tool reads. A field of the wrong type, a deliverable flume cannot read or an on_fail naming no stage refuses the launch, naming each field that fails.

flume runs one agent per stage and one deliverable per stage, so a stage that names no agent, or several, refuses the launch: write agents = [{}] for a stage with no settings of its own. A kind that lands needs the repository to bind a merge queue, and a kind with a change deliverable needs it to bind a change tool; a launch of either without the binding is refused.

Spelling The stage ends when, since it started
commits a commit is on the place’s branch
change the place’s OpenSpec change is written, its planning complete, in a commit
tasks every task of the change is ticked, in a commit
archived the change is archived on the place’s branch, in a commit
report:<path> the file at the path is written; a path starting {{state}} lies in the place’s own folder on the host, outside the worktree
committed:<path> a commit touches the file at the path

flume reads a deliverable at one head of the place’s branch and counts it only when made since the stage started. Once it exists flume waits until the agent is quiet, then ends the agent.

A stage started, for its deliverable, at the first of its starts since it last delivered, so a retry counts what an earlier start made. Where an agent commits its work and then stops short to ask, the retry’s agent finds the work done and ends its turn, and the stage delivers with no commit of its own. A repetition counts from the first start given its group. A fix round, and a retry of a stage that has delivered, count only what is made after them.

makes names things a stage leaves besides its deliverable: a preview, a branch for someone to try, a document. The stage’s run records each as one JSON line in made.jsonl in the place’s own folder, whose path the prompt part {{made}} gives. A line names the thing by name and says what it is, with its address, or the branch and revision that bring it up.

A stage is not delivered while a thing it declares has no line, and the Stop hook sends the agent back naming it. flume carries each line as written in the stage’s end, in status, and in a wait’s and the inbox’s answer. It builds, checks and rewrites no address, and keeps none of the lines once the place is tidied.

A kind’s agents table, and a stage’s one agent table, give the agent’s program, model, effort and instructions, beside for where its pane opens, mode and programs. The mode says how far the agent may act without asking a person: one of plan, ask, edits and full, or a table of programs such as { claude = "auto" } (the mode). A mode that is neither refuses the launch, naming the field.

The effort says how hard the agent’s model works on each turn, as its program’s own word, such as Claude Code’s xhigh (the effort). A kind that runs a deep stage harder than the rest gives that stage its own:

[[kinds.spike.stages]]
name = "explore"
prompt = "prompts/spike.md"
deliverables = ["committed:notes/spike.md"]
agents = [{ effort = "xhigh" }]

An effort that is not a string refuses the launch, naming the field, and a word the agent’s program does not take refuses it naming the word, the stage and the program.

programs gives each program’s own settings, in that program’s own words: a settings file the table names, file, and keys it gives inline, settings (a program’s own settings). A kind’s file lies beside its prompts, by a path relative to the declaration’s own folder. flume reads it where it reads them: at the launch’s revision for a repository’s kind, and from disk for a launch’s:

[kinds.spike.agents.programs.claude.settings]
tui = "fullscreen"
[[kinds.spike.stages]]
name = "explore"
prompt = "prompts/spike.md"
deliverables = ["committed:notes/spike.md"]
agents = [{ programs = { claude = { file = "claude-explore.json" } } }]

Here every stage’s agent gets tui, and explore’s gets the keys of .config/claude-explore.json as well, its file coming before the kind’s inline keys since a stage’s table comes first. A file outside the repository, by .., an absolute path or a link, refuses the launch. So does a file the revision does not hold or that does not parse, and an entry with any key but file and settings.

A repository may also give settings to a kind it does not declare, flume’s own among them, with a table that holds only agents:

[kinds.change.agents.stages.verify]
model = "opus"
mode = "edits"

A repository gives settings to every kind it runs, its own and flume’s, in [agents], flume’s own table beside [profiles], which no kind holds. This repository’s agents write its own words into every commit and pull request (what a commit says about who made it):

.config/flume.toml
[profiles]
merge_queue = "sluice"
[agents.programs.claude.settings]
attribution = { commit = "Assisted-by: Claude Code", pr = "" }

[agents] gives what a kind’s table gives, and names no stage, no stream, no environment and no pane beside: a stages, a streams, an env or a beside there refuses the launch, naming the field. A repository’s table for one kind comes before its [agents], and [agents] before a kind the repository declares. A launch’s declaration is not read for [agents], as it is not for [profiles].

A declaration gives no environment: an env in any agents table refuses the launch, naming the field, since an agent’s environment is its account’s on the host. Agent settings gives the layers in order.

A prompt is text with parts in double braces, filled at each start: {{brief}}, {{name}}, {{place}}, {{branch}} and the rest. {{#words}}…{{/words}} holds text sent only with a retry’s or a failure’s words. A part with nothing to fill it refuses the stage, naming the part, and starts no agent. The way to stop short is always in the prompt: where the template does not place {{needs}}, flume adds it at the end. Prompt parts lists every part.

A kind may instead be a statechart: regions of states, each region in one state at a time, moving by the transitions its states declare. A stage is a state that runs flume’s stage template, stage. Such a kind fits work that is not one line of stages: a stage that runs one agent per file, a stage sent back to an earlier one by what a later one found, or regions that run side by side. Both formats are read on one branch, and a repository may declare kinds of each beside one another.

.config/flume.toml
[kinds.persona]
title = "Persona test"
branch = "persona"
lands = true
[kinds.persona.regions.stages]
initial = "build"
[kinds.persona.regions.stages.states.build]
machine = "stage"
params = { agents = [{ model = "opus" }], deliverables = ["commits"], prompt = "prompts/build.md" }
transitions = [
{ when = { final = "passed" }, to = "test" },
{ when = { final = "stopped" }, to = "stopped" },
]
[kinds.persona.regions.stages.states.test]
machine = "stage"
params = { agents = { rule = "every-file", pattern = "personas/*.md" }, join = "all", on_fail = "build", max_send_backs = 2, deliverables = ["committed:results/{{file}}"], prompt = "prompts/test.md" }
transitions = [
{ when = { final = "passed" }, to = "passed" },
{ when = { final = "sent-back" }, to = "build" },
{ when = { final = "stopped" }, to = "stopped" },
]
[kinds.persona.regions.stages.states.passed]
final = true
[kinds.persona.regions.stages.states.stopped]
decision = { kind = "stalled", answers = ["retry", "drop"] }
transitions = [
{ when = { response = "retry" }, to = "build" },
{ when = { response = "drop" }, to = "dropped" },
]
[kinds.persona.regions.stages.states.dropped]
final = true

A table holds either stages or regions: one that holds both refuses the launch, naming the field. A statechart kind’s title, label, branch and lands mean what a simple kind’s do.

A state whose machine is stage is a stage, named by its path: its regions’ names and its own, joined by ., as stages.test. Its params give the stage template what it runs:

Parameter Meaning Left out
agents a list of tables, one session for each with its settings; or { rule = "every-file", pattern = "<glob>" }, one session for each file of the place’s branch the glob matches refused
join how many sessions must deliver for the stage to pass: all, any or count:<n> all
deliverables what each session delivers, in the spellings of deliverables refused
prompt the path of the sessions’ prompt, relative to the declaration’s own folder refused
on_fail the stage it sends the place back to, which the kind’s transition out of a sent-back end names none
max_send_backs how many times the stage is sent back before it stops 3

A session is one agent’s life, run by the rules a simple kind’s stage runs by: it waits for room, takes an account, is prompted, ends on its deliverable, stops short, is answered, held and retried. Each is named <path>#<entry>/<n>, as stages.test#1/2: the stage’s path, how many times the stage has been entered, and the session’s number, each from

  1. A statechart place runs as many agents as it has live sessions.

The rule every-file matches the glob against every file of the place’s branch at the head flume reads when the stage starts: * within one part of a path, ** across parts, ? one character. Its sessions are numbered in path order. Settings for every stage reach each session, and a list entry’s settings stand as its own stage’s settings.

A session’s prompt and deliverables may name two parts a simple stage does not have: {{session}}, the session’s number, and {{file}}, the file its rule gave it. Write committed:results/{{file}} so each session delivers its own file: a deliverable naming neither part is the same file for every session.

flume runs a statechart kind on the family’s engine and decides no move of its own. Each settle of the place steps its sessions as it steps a simple kind’s stage, then reads the place’s branch’s head once and ticks the statechart once over what it read there. In each region, the first transition out of its state whose guard holds fires, and a region reading another’s state sees a move made at that tick only at the next. A stage’s sessions start at the tick after it is entered, so going from one stage to the next takes three settles. An agent going quiet and the host’s watch settle a place, so the watch’s bound sets the pace.

A stage ends when its sessions say so:

  • passed once its join is met by sessions that delivered;
  • sent back once a session stops short with flume needs --found, while the stage has been sent back fewer times than its max_send_backs;
  • stopped once a session finds work past that bound, its rule matched no file, or too few of its sessions are left for its join.

A session that asks, is lost or stuck, or never begins keeps its stage working while the place waits on you, as a simple kind’s stage does. The kind’s own transitions take each end, { final = "passed" } and the like, and a session still live once its stage ended is ended once quiet. The finding’s words go to the sessions of the stage the kind enters next, in {{words}}.

The run is over once every top region holds a final state. A kind that lands is then submitted through the merge queue, once none of its sessions is live; one that does not land waits on you, and flume done ends it. The submission’s outcome is evidence the statechart reads: place.submission reads open while it is in flight, then landed, failed, conflict, withdrawn or refused. A transition out of a final state that reads failed can take the run back to a stage, whose sessions start with the merge queue’s words. A failure no transition takes leaves the place waiting on you, and flume retry <place> --submission submits it again.

A state may carry a decision, decision = { kind, answers, shows }, that a person answers while its region holds the state. The place waits on you while one stands, status gives its region, its kind, the answers it takes and what it shows, and the place stalls as for any wait. Answer it with its region and one of its answers:

Terminal window
flume answer persona--checkout stages retry

The next settle gives the answer to the statechart, and a transition reading { response = "retry" } moves the region on. An answer is taken once: a second one given before the first is applied is refused, naming the first, who gave it and when.

flume binds one template, stage, one rule, every-file, and three evidences a transition may read: region.entered, when its region entered the state it holds; place.submission, the outcome of the place’s newest submission; and place.submissions, how many times flume submitted it. A kind performs no effect of its own: the stage template starts its sessions.

A launch of a statechart kind is refused, naming what it found and making nothing, where it names:

  • a template other than stage, or a rule other than every-file;
  • an evidence other than those three, or any effect;
  • a stage with no prompt, no deliverable, or one flume cannot read;
  • {{file}} in a deliverable of a stage whose agents are a list;
  • a count:<n> join above the agents a stage lists;
  • a landing_fix. How a statechart kind’s landing fix lands beside its own place is designed in a change of its own, and until then the field refuses the launch.

A launch’s --hold names a statechart kind’s stage by its path, and a path the kind does not hold refuses the launch. Otherwise a launch of a statechart kind is taken as any other: it makes the place, keeps the kind and the stage template as it read them, and records each region at its initial state.

A kind that another project ships reaches the host’s places through a source: a directory of packages the host’s configuration declares. A launch names such a kind by its source, acme/review or acme/review@2, and it runs only once a lock records its content.

The host declares each source in a file of its own, in the sources directory beside its configuration:

~/.config/flume/sources/acme.toml
kinds_dir = "~/.local/share/flume/kinds/acme"

The file’s name, less .toml, is the source’s name. Its key kinds_dir names the directory that holds the source’s packages: an absolute path, or one whose leading ~ is your home. Its key roles, where it gives one, names the file declaring the roles the source answers (roles come from a source). flume reads the sources directory as it stands at each launch, each wake of a role, each flume kinds lock and each status. It writes nothing in it, or in a source’s kinds_dir.

Each source is one file. A person or a program adds a source by writing its file, replaces it by renaming a new file over it, and removes it by deleting it. None of these touches another file of the configuration. flume reads no file whose name begins with ., so .acme.toml.tmp can be written whole and renamed to acme.toml, and no launch reads half a file.

A source’s file that cannot be read refuses only the launches that name its source, naming the file and its fault. Every other launch goes on, and the host’s part of flume status names the fault. Configuration gives each fault.

A source’s packages lie in its kinds_dir, one directory per version of each kind:

~/.local/share/flume/kinds/acme/
review@1/
kind.toml
prompts/code.md
review@2/
kind.toml
prompts/code.md

A package’s kind.toml declares exactly one kind, in the format of writing a kind, with the name and version of the directory it lies in. Every prompt it names lies inside the package. Any number of versions of one kind stand side by side. A launch of a package is refused, naming the package and the field, when:

  • the kind’s name or version is not its directory’s;
  • it declares no kind, or more than one;
  • it names a file outside the package, by .., an absolute path or a link;
  • an agents table gives an env, or a program by a path.

A package’s content has a hash, sha256: and its hex, over each file’s path within the package, its length and its bytes. The same package hashes the same wherever it lies. A change to a package’s content is a new version: write review@3/ beside review@2/, and leave review@2/ as it stands.

A kind from a source on the host runs only where a lock records its identity at its content’s hash. Two locks can record it:

  • the repository’s, .config/flume.lock, read at the base’s current revision as its kinds are;
  • the host’s, ~/.config/flume/flume.lock, read as it stands at the launch.

A lock is TOML, one entry per kind:

[[kinds]]
kind = "acme/review@1"
hash = "sha256:ab12…"

At each launch of a kind a lock records, flume reads the package as the host holds it, hashes it, and checks the hash against every lock that records the identity. It refuses the launch, making nothing, where:

  • no lock records the kind, naming both ways to record it;
  • the content’s hash is not the lock’s, naming the lock and both hashes;
  • the two locks give the kind two hashes, naming both;
  • a lock it reads cannot be read, naming the file and its fault.

A launch of the repository’s kind or of the launch’s file reads no lock, since neither needs one. So a lock that cannot be read refuses only the launches of flume’s own and of a source’s kinds.

Locks record flume’s own kinds only to pick a version. A version of flume’s own that no lock records runs, since flume carries it, and one that a lock records is checked against the hash flume carries. A version of flume’s own keeps its content in every later release: a change to it is a new version.

A launch that names no version, as acme/review or a bare change, takes:

  1. the newest version of the kind that the repository’s lock records; else
  2. the newest that the host’s lock records; else
  3. the newest its source holds.

So a repository that records flume/change@1 keeps launching change@1 with a bare change. For a source on the host, the third step picks a version no lock records, and the launch is refused as unlocked. A version installed and not yet locked never runs, and until it is locked a launch takes the newest a lock records.

Terminal window
flume kinds lock acme/review@1
flume kinds lock --host acme/review@1
flume kinds lock --host --hash sha256:ab12… acme/review@2
flume kinds lock --host --remove acme/review@1

flume kinds lock records each kind it names, whole, at its content’s hash, beside any other version of the same kind the lock holds. Without --host it writes .config/flume.lock in the working copy it runs in, and the repository’s places read it once you commit it on their base. With --host it writes the host’s lock. --hash records the one kind named only where its content hashes to that value, and otherwise refuses, naming both hashes, and leaves the lock as it was. --remove takes each named entry out, reading no package. It fetches nothing and commits nothing, and run twice it leaves the same lock (commands).

A kind named with no source resolves among the launch’s file, the repository’s and flume’s own alone. It never reaches a source on the host, locked or not. So adding a source never changes what a bare fix runs: a source’s own fix is launched as acme/fix. Where none of the three holds a bare name, the refusal ends naming each identity the host’s sources hold under it: the host's sources hold acme/review@1, which a launch names by its source.

A place keeps the whole kind its launch read, its prompts among it, with its identity, where it came from and its hash. None of these reaches a place already launched, only the next launch:

  • a source’s file renamed over, or naming another kinds_dir;
  • a package edited, or its directory removed;
  • a lock moved, or its entry removed;
  • a change to the repository’s .config/flume.toml or to a launch’s file.

A program that installs kinds on the host, with no person at it, does each step as a whole file written, a rename, a delete or a flume command, and touches no running place.

Install acme/review@2:

  1. Write the package to a directory of the program’s own, such as ~/.local/share/flume/kinds/acme/review@2/.
  2. Write .acme.toml.tmp in the sources directory and rename it to acme.toml.
  3. Run flume kinds lock --host --hash sha256:… acme/review@2, with the hash the package’s publisher gave, so the lock records exactly the content published and not whatever lies on disk.

Update to review@3. Write review@3/ beside review@2/ and lock it. A launch of acme/review then takes review@3, the host lock’s newest, unless the repository’s lock records another. Places on review@2 run on.

Retire review@2. Run flume kinds lock --host --remove acme/review@2, then remove its directory. Places on review@2 run on.

Remove the source. Remove its kinds’ entries from the lock, then its file.

Read back. flume status --json gives status.host.sources: each source, the identities it holds, and each fault.

Between any two steps flume refuses only the launches that name what is half installed. It refuses a version not yet locked as unlocked, and a locked one whose directory is gone as one the source does not hold. It never runs content no lock recorded.