Skip to content

feat(runs): give each import source a folder and an identity of its own - #405

Open
harenome wants to merge 4 commits into
ThinkFlowLab:mainfrom
harenome:feat/import-source-identity
Open

harenome wants to merge 4 commits into
ThinkFlowLab:mainfrom
harenome:feat/import-source-identity

Conversation

@harenome

@harenome harenome commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #400

Stacked on #402 (job identity): its commits show here until #402 merges.

What

Two ATIF or OpenTelemetry sources of one basename were converted into one imported/<format>__<basename> folder: each conversion pruned the other's trials, and both had one derived identity (#399).

  • A source (a tree, by its real path) gets an id at its first conversion: a uuid5 over the format and that path, so every workspace importing the tree agrees. It is written in the job's config.json as nullius.source with nullius.source_path, read back on every reconversion and kept by a copied job.
  • Its folder is the one that records it. A new source takes <format>__<basename>, or -2, -3... when that folder belongs to another source.
  • The job's identity is declared from nullius.source. The shortcut: comment in uid.py is gone.
  • Trial naming inside a job is unchanged.

Touches

  • app/nullius/importers/__init__.py: place(), the folder and id for a source; recorded_as()
  • app/nullius/importers/atif.py, otel.py: use them; each reads the source an older conversion recorded
  • app/nullius/runs/uid.py: declared from nullius.source
  • app/tests/test_import_unchanged_source.py

Verified

Two ATIF sources team-a/run and team-b/run, converted into one imports folder, then team-a/run again.

Before:

convert team-a/run -> ['atif__run']
  atif__run: trials=['alpha'] uid=cdcb2def-... (derived)
convert team-b/run -> ['atif__run']
  atif__run: trials=['beta'] uid=cdcb2def-... (derived)
reconvert team-a/run -> ['atif__run']
  atif__run: trials=['alpha'] uid=cdcb2def-... (derived)

After:

convert team-a/run -> ['atif__run']
  atif__run: trials=['alpha'] uid=05ff5bb9-... (declared)
convert team-b/run -> ['atif__run-2']
  atif__run: trials=['alpha'] uid=05ff5bb9-... (declared)
  atif__run-2: trials=['beta'] uid=2695cefb-... (declared)
reconvert team-a/run -> ['atif__run']
  atif__run: trials=['alpha'] uid=05ff5bb9-... (declared)
  atif__run-2: trials=['beta'] uid=2695cefb-... (declared)

New tests, ATIF and OpenTelemetry: two sources of one basename get two folders and two identities; one source converted into two workspaces gives one identity, and a copy of the job keeps it; reconverting one keeps its identity and leaves the other's files untouched; a conversion without the id is reconverted in place, gains no id and keeps its identity, and another source of its basename gets a new folder.

  • Backend suite: 2873 tests in 174 modules, OK
  • Route suite: 664 tests in 68 modules, OK

Risk

  • Existing imports stay where they are and keep their derived identity and judgements: an old folder is reused for the source its config names (the ATIF default command, the OpenTelemetry dataset path) and is never rewritten to gain an id. An old folder that names no source is claimed by the first source of its basename, as today.
  • A source tree moved or renamed on disk is a new source: a new folder and a new identity, so its judgements stay with the old one.
  • One tree reached by two paths that resolve to one real path is one source.
  • Old folders shared by two sources before this change belong to whichever converted last; the other gets a new folder.

…and moves

A new Nullius standard job declares a UUID, standard.uuid in its
config.json: a run resumed into the same folder keeps it, a merge makes a
new one. The reader exposes Job.uid and Job.uid_source: the declared id,
else a uuid5 derived from fixed facts of the files (format, folder name,
what ran, the start), else pending for a job with no trial and no start.
No path is a fact, so a copy or a move keeps the identity; old files are
never rewritten to gain one. Trial.key names a trial within it, a try by
its attempt.
…it move with the feed

A run resumed under the same name keeps the folder's uuid only when the earlier config names the same benchmark, plugged agent or capability, model and dataset; a job from before standard.uuid is given the uid it was read under. A Harbor job's start is read from result.json only, never from Nullius's feed, which may appear later; a feed that is not UTF-8 is read with replacement. A merge writes its config.json first and whole, so its result is never read without the merge's uuid. Imports' identity by folder name is marked as a known limit.
Two ATIF or OpenTelemetry sources of one basename were converted into one
imported/<format>__<basename> folder, each conversion pruning the other's
trials, and shared one derived identity.

A source's first conversion now gives it an id, written in the job's
config.json as nullius.source with its absolute path, and kept on every
reconversion. Its folder is the one recording it; a new source takes the
default name, or <default>-2, -3... when that belongs to another source.
The job's identity is declared from the id. A folder converted before ids
is reused for its own source, never rewritten to gain one, and keeps its
derived identity.

Refs ThinkFlowLab#400
A random id gave one tree a new identity in each workspace that imported
it, so its judgements stayed behind. nullius.source is now a uuid5 over
the format and the tree's real path ("v": 1), still written at the first
conversion and read back on reconversion, so a copied job keeps it. A tree
moved or renamed on disk is a new source.

Refs ThinkFlowLab#400

This branch has not been deployed

No deployments
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.

Imports: two sources with one base name share one output job folder, prune each other's trials and share an identity

1 participant