Skip to content

The batch manager knows no row source; Intake brings rows into a batch - #261

Merged
SimonHeybrock merged 6 commits into
mainfrom
259-intake
Nov 23, 2026
Merged

SimonHeybrock merged 6 commits into
mainfrom
259-intake

Conversation

@SimonHeybrock

Copy link
Copy Markdown
Member

Simon asked, reading the batch guide (#259): why does BatchManager.create take the name of a source and not a table, does the manager need to know a source at all, and why does create return a label?

The manager knows no row source. It did two jobs: keep the batches of a workspace, and bring rows of a source into a batch. The second job has three entrances, which all write considered: making a batch from a source, taking rows by hand, and a step of Follow. They move to a class of their own, Intake, which holds the manager and the row sources:

manager = BatchManager(client, definitions=definitions)
batch = manager.create('loki-iofq', title='By hand', rows=table)        # a table in, the Batch out

intake = Intake(manager, sources={'sample-runs': SAMPLE_RUNS})
batch = intake.create('loki-iofq', title='Afternoon', source='sample-runs',
                      choose=Range(first='60339'), follow=True)
intake.step(); intake.offered(label); intake.take(label, keys); intake.stop()

create returns the Batch. A label is the name of a batch outside the process: its folder, its records, its address on the page and for the command. Code that just made a batch does not need it. Every method that names an existing batch still takes the label.

Names. Source is RowSource, since the file source is a source too. Batch.columns is Batch.parameter_columns: the guide distinguishes parameter columns from note columns since #260.

What is kept on disk changed, with one writer per file:

File Holds Writer
settings.json the spec, the settings, and fills as the blanks of the template Batch
source.json source, considered, follows Intake
following.json gone
format.json the format number of the folder FolderDefinitions
  • fills are the parameter columns where an empty cell means that the row waits, with no setting or default in its place. They are data of the batch, so they left source.json. A blank of ess.apps.Template is a parameter that the template gives no value and that each use must fill, which is what fills means.
  • Whether a batch follows is kept with the batch. The first version kept following.json, and a label removed through the manager and made again then followed again. A fact kept in the label's own files goes with the label. At most one batch follows by the order of writes: the new batch is written, then the old one stops, then the new one follows. A process that stops in between leaves no batch following.
  • A folder written in another format is refused when opened, with a message to make a new folder. A review found that a folder written before this change was read without its fills, and the command then reduced a waiting row with a setting. Nothing is migrated.

Checked by a review that ran the code before and after side by side, on the page over HTTP and on the command, and with 2,400 random calls of the manager and Intake with refused writes and restarts. What a person sees differs in these points:

  • The command's two errors about a source name the type RowSource.
  • Removing the batch that follows, when the definitions refuse the delete: the batch stays and still follows. Before, it stayed and had stopped.
  • The process stops while a new batch that follows is written: after a restart no batch follows. Before, the earlier batch still followed.
  • A request to make a batch that follows without a row source, which the form never sends, is refused by the request's validation with the answer of the framework, where it was a message of the page.

To check by hand:

  • Start a demo in a new folder, make a batch that follows, restart: it still follows.
  • Start a demo on a folder of last week: it refuses with the message about the format.

🤖 Generated with Claude Code

SimonHeybrock and others added 6 commits November 23, 2026 06:47
The dataclass Source becomes RowSource, so that it is not confused with
the file source of the workspace; the function from files to a frame,
which held the name RowSource, becomes RowFunction. Batch.columns becomes
Batch.parameter_columns, the term that the guide uses: a batch table has
note columns too.

The command names the class in its refusal of a source that is none, so
that message names RowSource.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
BatchManager did two jobs: it kept the batches of a workspace, and it
brought the rows of a row source into a batch (create from a source, take,
offered, step, and which batch follows). All of the second job writes
`considered`, so it moves as a whole to Intake, which holds the manager and
the sources. The manager then knows no row source: create takes a table
(rows=, fills=), and both create methods return the Batch, not its label.

The parameters that a row source fills are data of the batch: they are kept
as the blanks of the template in settings.json, which the Batch writes. So
source.json holds the source and the keys considered only, and the Intake is
its one writer, as of following.json. A source.json with other entries is
refused when read.

manager.remove deletes every table of the label and does not write
following.json; Intake.following counts a label without a header as none.
Intake.create makes the batch with the manager, then writes source.json and
following.json, and removes the batch again if one of these is refused.

The page, the command, the demo and LoKI hold an Intake where they need a
row source or Follow, and reach the manager as intake.manager.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guide draws Intake between the callers and the manager, the step and
the row source, and says who writes each file: the intake writes
source.json and following.json, and settings.json holds the fills as the
blanks of its template. A label names a batch to every method but create,
which returns the Batch.

The page README, the developer README, the tour and ADRs 0011 to 0013 get
the identifiers and the sentences that the split made false; the ADRs keep
their decisions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
following.json named a label, and a label can be removed through the
manager and made again; the batch made again then followed. Clearing the
file would need the manager to know of Follow, or every creator to
remember it. So the fact goes with the label: source.json holds
"follows", only the Intake writes it, and removing a label removes it.
following.json goes.

Intake.create with follow first makes the batch, then writes that the
batch that followed follows no more, then writes the batch's source.json
with "follows": true, so no two batches follow, also when a process stops
in between; if a write is refused, the batch is removed and the one before
is written to follow again. Intake.following reads the source.json of
each batch when the manager's version moved, not at each call.

Intake.create checks the label and the spec before it lists the source,
which may be slow or raise; the manager's check of a new label is public
(check_label) and its create uses the same.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- FolderDefinitions keeps definitions/format.json and refuses a folder
  with labels and no or another format, so that a folder whose fills are
  kept in source.json is not read as one without fills. The command, the
  demo and the LoKI page say it and exit non-zero. No folder is migrated.
- Intake.following passes over a source.json that cannot be read, so one
  such file does not break every page.
- BatchManager.check refuses spec, title and label without rows; both
  create methods call it first, so Intake.create refuses in the order of
  the base, before the source is looked up.
- Follow without a row source is refused by the request model NewBatch,
  since no call of the batch layer can express it.
- Guides: Intake in the terms table, what a label is, the entries of
  source.json, what step reaches, and that a process that stops while a
  batch that follows is made may leave the batch and no batch that follows.
- "row source" in place of "source of rows" in the error text.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant