Skip to content

Journal and coordination-log readers require identities the files already carry #812

Description

@drewstone

Consumer story

discovery-lab computes a provenance graph (tools/provenance.mjs) over 236 on-disk supervise run directories using the kernel's own readers — FileSpawnJournal + materializeTreeView for spawn trees and spend, FileCoordinationLog for steering and analyst findings. Both adoptions worked, but each needed a read-the-first-line adapter because the reader demands an identity the file's own records already contain.

What was read (0.132.13 published package, verified live against lab run dirs)

  1. FileSpawnJournal.loadTree(root) requires the root NodeId, and silently returns undefined when the requested root does not match the journal's begin record. In 1 of 204 lab journals the root id differs from the directory name (a GEPA-search id), so loadTree(dirname) reads as "no journal" — indistinguishable from an absent file. The begin record ({"kind":"begin","root":...}) already names the root.
  2. FileCoordinationLog.load(runId, ownerId) requires the ownerId (a profile digest), but every row of the log carries runId and ownerId. A reader that only has the file path must parse the first line manually before it may call the reader.

Required change

  • FileSpawnJournal: a way to read a journal file without pre-knowing the root — either loadTree() defaulting to the begin record's root, or an exported readJournalRoots(path). A root mismatch should be distinguishable from a missing tree.
  • FileCoordinationLog: load() with both arguments optional, defaulting to the identities in the file, or an exported discovery helper.

What this deletes downstream

Two first-line-parse adapters in discovery-lab's tools/provenance.mjs (loadJournal, loadCoordination). Recorded in discovery docs/15-adoption-decisions.md.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions