Skip to content

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

Merged
harenome merged 10 commits into
ThinkFlowLab:mainfrom
harenome:feat/import-source-identity
Nov 25, 2026
Merged

harenome merged 10 commits into
ThinkFlowLab:mainfrom
harenome:feat/import-source-identity

Conversation

@harenome

@harenome harenome commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #400

What

  • Two ATIF or OpenTelemetry sources of one basename shared imported/<format>__<basename>: each pruned the other's trials; both had one identity (Give every job an identity that survives a copy or a move, apart from its folder name #399).
  • A source is its format and real path. Its id is a uuid5 of both, so every workspace importing it agrees.
    • Recorded in config.json (nullius.source, nullius.source_path); a copy keeps it.
    • The job's uid is declared from it.
  • A source's folder records its id. A new source takes <format>__<basename>, else -2.
  • A folder is reused only when it records this source, or predates ids with its format and is the one source root its trials name (fix(runs): give each imported document a trial of its own, never renaming one already there #404's longer names included). Otherwise --job-name is refused; an automatic name takes -2.
  • The source is read again under the lock; the job's files are written whole.
  • parse.SCHEMA is 21: cached jobs are parsed again.
  • Conversions into one imports folder take turns.
  • An import from before ids keeps its folder, its recorded source path and its uid.

Verified

team-a/run, then team-b/run, then team-a/run again.

Main:

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

Here:

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']

Risk

  • A source tree moved on disk is a new source; its judgements stay with the old uid.
  • An old folder two sources shared belongs to whichever converted last.
  • An old import with a relative source goes to the first source of its basename.
  • An empty .nullius-import.lock stays in the imports folder.
  • Undo: revert.

Agents

  • Claude Code, Opus 5.5: code, tests
  • Claude Code, Fable 5.2: review
  • Codex, GPT-6.2-Astra: review

@github-actions github-actions Bot added the merge conflict Conflicts with its base: merge or rebase it label Nov 25, 2026
@harenome
harenome force-pushed the feat/import-source-identity branch from 9343456 to de6c9b5 Compare November 25, 2026 14:12
@github-actions github-actions Bot added needs review Tests pass, no conflict, no verdict on its latest commit merge conflict Conflicts with its base: merge or rebase it and removed merge conflict Conflicts with its base: merge or rebase it needs review Tests pass, no conflict, no verdict on its latest commit labels Nov 25, 2026
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
…named folder and convert one at a time

A path converted in another format no longer takes over the first format's folder and id. A --job-name that names another source's folder, recorded or from before ids, is refused before anything is written. Conversions into one folder hold a lock from choosing the folder through the write. The source is resolved to its real path once, so a relative root or a link records one spelling. An import from before ids derives its identity from its recorded source path as well as its folder.
…t and source are shown

A folder converted before source ids is reused only when it stored the
same format and names this source: by the absolute path it recorded, or
else by where each of its trials says its document was read. A folder that
cannot be tied to the source (another format, no recorded path, a relative
one, an unreadable config) is never written into: a named job is refused
and an automatic name takes a folder of its own.
…ugh reconversion

A reconversion into a folder converted before source ids keeps the
command (ATIF) or export path (OpenTelemetry) it recorded, as typed: that
string is what the folder's derived uid was made from, so rewriting it
as a real path would give the job another identity.
… the bytes parsed

A conversion reads its source again once it holds the lock, so one that
read an older source never publishes it over trials a later conversion
published meanwhile; a refused tree is still refused before anything is
written. An ATIF document is read once: its trial's copy and digest are
the bytes parsed.
…rded source

A job cached before an import's id took in its recorded source path kept its
older id once read back, while a fresh parse of the same folder gave another.
… its trials are named from

A folder converted from a relative path was reused for any tree holding
every document its trials were read from: converting a parent into it
added the parent's documents under the child's identity. The folder is
now the source's only when the source is the one tree that names its
trials as they are and ends with the path recorded. Otherwise a named
conversion is refused and an automatic one takes a folder of its own.
…t keeps its source

A conversion rewrote config.json in place: a refresh stopped mid-write left it
truncated, and with it the source the job was converted from. Each file is
now written beside the old one and renamed over it.
… longer name of colliding paths

Two paths that flatten to one name (a/b.json, a__b.json) each take that name
with a digest of their path. A folder converted before ids with such trials
was never shown to be its own tree's, so its source got a new folder and
identity. Those names now count as named from the tree too.
@harenome
harenome force-pushed the feat/import-source-identity branch from de6c9b5 to 4d2ebfb Compare November 25, 2026 14:29
@github-actions github-actions Bot added needs review Tests pass, no conflict, no verdict on its latest commit and removed merge conflict Conflicts with its base: merge or rebase it labels Nov 25, 2026
@harenome
harenome merged commit 58acb0c into ThinkFlowLab:main Nov 25, 2026
4 checks passed
@harenome
harenome deleted the feat/import-source-identity branch November 25, 2026 15:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs review Tests pass, no conflict, no verdict on its latest commit

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