agenthropic

ADR-0001: LB1 — Ingest primacy (the data-foundation seam)

Empirical update — 2026-07-04 desktop probe

An 8-agent read-only probe of the real ~/.claude/projects corpus (phase0-probe.md) empirically pre-answers CD-1 as CONDITIONAL-GO → build (confidence 85/100). It de-risks this ADR’s open branch but does not replace the formal Phase-0 spike: WP-S1/WP-S5 still need the paired-capture corpus and Ivan’s tree sign-off, and the WP-S7 GO gate below still stands (no production ingest code before it). Three points the probe forces on the prose that follows:

As-built update — 2026-07-30

Verdict: the branch resolved JSONL-primary and was built; the golden-corpus criterion that was supposed to certify it has not been run.

What is settled. Ingest is JSONL-primary. Hooks carry liveness only and cannot write structure or tokens. The DAG rebuilds from JSONL alone after a simulated outage, and a double replay is byte-identical — both asserted by merge-blocking P0 proofs. The Agent/Workflow correction from the desktop probe held: nothing keys on Task.

The dual-path complexity named in Consequences did not materialize — but not because it was avoided. SubagentStart does not exist, so the “forward-link if it exists” arm was never needed and the reconstructor is post-hoc only. That is the probe’s suspicion confirmed by the shipped hook installer, which wires four hooks (UserPromptSubmit, Stop, SubagentStop, PreCompact). Edge detection turned out to need four mechanisms rather than two, recorded per-row in orchestration_edges.source: tool_use, directory, task_notification, queue_operation.

Two acceptance criteria below are not met as written:

  1. “Both hooks and JSONL land in events_raw” — as built, only hooks do. JSONL is parsed straight into the projections; see ADR-0004’s as-built update. The replay guarantee survives via re-reading the corpus, not via replaying rows.
  2. “Hierarchy correctness ≥95% vs a labeled golden corpus of ≥3 real sessions including crashed-no-Stop, deep nesting, mid-session PreCompact, two concurrent instances” — this has not been measured. No hand-labelled corpus exists. The parser’s thresholds are marked PROVISIONAL (LABEL-ME) throughout the source and await ratification. The P0 proofs run against fixtures, which prove the reconstruction is self-consistent and outage-surviving; they do not prove it matches a human-labelled ground truth on real sessions. Those are different claims, and only the first one has evidence.

The WP-S7 gate this ADR defers to was overridden, not passed — see ADR-0010.

As-built update — 2026-08-15

One word above needs narrowing, and nothing else has moved. The two P0 proofs called merge-blocking — the rebuild of the DAG from JSONL alone after a simulated outage, and the byte-identical double replay — do run in CI on every push and pull request, and they fail the run when violated. Until 2026-08-25 that was all they did: main was unprotected (gh api repos/IvanBBaev/agenthropic/branches/main/protection → 404 Branch not protected, verified 2026-08-15), so a red run withheld nothing. Since 2026-08-25 main requires the ci check, so a red run does withhold the merge button — from a contributor, and not from the repository owner, who is exempt on purpose (enforce_admins: false) because this repository has a single maintainer whose normal mode is a direct push to main. Read “merge-blocking” here, and everywhere in this ADR set, as “merge-blocking for anyone who is not the repository owner” — see the standing correction.

The rest of the verdict stands unchanged, including the part that matters most: the golden-corpus criterion that was supposed to certify this decision has still not been run. No hand-labelled corpus exists, the ≥95% hierarchy-accuracy gate still reports substrate unavailable rather than a number, and every parser threshold remains PROVISIONAL (LABEL-ME). Green CI against fixtures the same author wrote is not the measurement this ADR named, and no amount of it becomes that measurement.

(As built — 2026-08-15, recorded 2026-09-22: a fifth edge mechanism, legacy_explore, was added by migration 13 on 2026-08-15 for pre-2.1.71 Explore sidecars that carry no toolUseId; orchestration_edges.source now admits five values, not four. The hook count and the JSONL-only reconstruction are unchanged.)

Context

agenthropic ingests from two sources: Claude Code lifecycle hooks (sub-second, live) and the durable ~/.claude/projects/*.jsonl transcript log (ground-truth tokens, replayable). The single biggest architectural unknown is whether the JSONL log carries the subagent parent→child linkage (Agent/Workflow spawn tool → child sessionId → parent ref) well enough to rebuild the whole orchestration DAG from the durable log alone, after an outage, with no hook input.

This is not a preference — it is make-or-break for the persistent-DAG moat (docs/ai/DESIGN.md §2.1) and for the ground-truth-tokens invariant. Both externally-produced parallel reports (BASE, EXPANDED) silently default to hooks-primary ingest with no durability contract, which concept-analysis-v2 identifies as their shared blind spot. It cannot be settled on paper: a Phase-0 empirical spike (see ADR-0010, CD-8) must answer it before any production ingest code is written.

Decision

Ingest is JSONL-primary + replay-on-startup, with hooks providing sub-second liveness only, and every write is an idempotent upsert on a stable event id — contingent on the Phase-0 spike proving JSONL carries the subagent parent→child linkage. If it does not, fall back to hooks-primary + a durable local outbox/spool (at-least-once, idempotent upsert), and only then.

The primacy decision is an output of Phase-0, not an assumption baked in ahead of it — the precise inversion of EXPANDED’s error.

Acceptance criteria

From concept-analysis-v2.md §6 (“Data foundation & reconciliation” and “Tree correctness”):

The Phase-0 verdict rule itself (development-plan.md WP-S2): JSONL-alone edge accuracy ≥95% survives a simulated outage → JSONL-primary; else hooks-primary+outbox; else NO-GO.

Consequences

Alternatives considered