@eir-labs/coltrane 0.24.12 → 0.24.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -20,7 +20,7 @@ import { evolveSkill } from "./skills.js";
20
20
  import { sealAgentDefinition, sealDefinition, sealSkillPackage, recordIdentity } from "./genome_writer.js";
21
21
  import { createOutputStore, defaultOutputsPersistDir, performanceRoot, } from "./outputs.js";
22
22
  import { createOutputMirror, defaultMirrorDir, outputPreview, mirrorStorageRef } from "./output_mirror.js";
23
- import { FileLedger, LedgerError, LEDGER_SCHEMA_VERSION, defaultLedgerPath, } from "./ledger.js";
23
+ import { FileLedger, SplitLedger, LedgerError, LEDGER_SCHEMA_VERSION, defaultLedgerPath, defaultGenomeLedgerPath, } from "./ledger.js";
24
24
  import { sealDrill } from "./seal_drill.js";
25
25
  import { standardSimulate } from "./simulate.js";
26
26
  import { runGig, BudgetExhausted, GigAborted, ResumeRefused, partialGigUsage, partialBudgetState } from "./runtime.js";
@@ -3630,6 +3630,15 @@ function readMcpServerConfigs(root) {
3630
3630
  }
3631
3631
  export function bootstrapServerDeps(genomeRoot) {
3632
3632
  const root = genomeRoot ?? process.env["COLTRANE_GENOME"] ?? process.cwd();
3633
+ // The genome ledger's root follows the SAME isolation the gig ledger's does: an explicit
3634
+ // genomeRoot or COLTRANE_GENOME wins, but when neither is set and COLTRANE_LEDGER_PATH relocates
3635
+ // the gig ledger, the genome ledger resolves beside that override (dirname) instead of leaking to
3636
+ // process.cwd()'s real checkout. Kept separate from `root` on purpose — `root` must stay the real
3637
+ // genome for resolveGenome/registry/mirror, which cannot resolve against a bare ledger spine.
3638
+ const gigLedgerOverride = process.env["COLTRANE_LEDGER_PATH"];
3639
+ const genomeLedgerRoot = genomeRoot ??
3640
+ process.env["COLTRANE_GENOME"] ??
3641
+ (gigLedgerOverride && gigLedgerOverride.length > 0 ? dirname(gigLedgerOverride) : process.cwd());
3633
3642
  const genome = resolveGenome(root); // manifest-aware: honors a consumer's `extends` base
3634
3643
  const registry = loadRegistry(genome);
3635
3644
  const mcpServerConfigs = readMcpServerConfigs(root);
@@ -3669,7 +3678,25 @@ export function bootstrapServerDeps(genomeRoot) {
3669
3678
  // tests/e2e/recorder_durability_mid_crash.spec.ts deliberately pins.
3670
3679
  // FileLedger creates nothing until the first append (#210), so merely bootstrapping deps
3671
3680
  // — as tests/dispatch_tool_resolution.test.ts does with no root — leaves no trace.
3672
- ledger: new FileLedger(defaultLedgerPath(root)),
3681
+ //
3682
+ // WO-F06 — split by kind so genome PROVENANCE ships with the repo while runtime state stays
3683
+ // machine-local. genome_mutation seals route to the git-tracked genome/ledger.jsonl (a sibling
3684
+ // of the genome files at `root` — the same base as genome_dir below, so the seals and the files
3685
+ // they identify travel together); gig/governance rows stay under the gitignored .coltrane/. Both
3686
+ // backing FileLedgers are still lazy, so a bare bootstrap seeds neither store. This is the single
3687
+ // production construction seam, so wiring the split here is what makes the seals ACTUALLY land in
3688
+ // the tracked location — the reads union both, so no existing consumer sees a difference.
3689
+ ledger: new SplitLedger(
3690
+ // WO-F06 fix — the genome ledger MUST isolate to the same root the gig ledger does. When
3691
+ // COLTRANE_LEDGER_PATH relocates the gig ledger (the per-file test spine, or a mounted
3692
+ // volume) with no explicit genomeRoot and no COLTRANE_GENOME, the genome ledger has to sit
3693
+ // beside that override — dirname(COLTRANE_LEDGER_PATH) — not fall back to process.cwd(), which
3694
+ // would leak a genome_mutation seal into the real checkout's genome/ledger.jsonl. An explicit
3695
+ // genomeRoot and COLTRANE_GENOME still win (production sets one), and COLTRANE_GENOME_LEDGER_PATH
3696
+ // — read only inside defaultGenomeLedgerPath — still overrides all; the two env overrides stay
3697
+ // independent (defaultGenomeLedgerPath never reads COLTRANE_LEDGER_PATH). The shared `root`
3698
+ // above is untouched, so resolveGenome/registry/mirror keep resolving against the real genome.
3699
+ new FileLedger(defaultGenomeLedgerPath(genomeLedgerRoot)), new FileLedger(defaultLedgerPath(root))),
3673
3700
  standards: genome.standards, // ← gig_dispatch can now resolve file-defined standards
3674
3701
  charts: genome.charts, // ← gig_dispatch resolves a chart_slug; chart_browse lists them
3675
3702
  venues: genome.venues, // ← the ceiling a chart's venue imposes has to resolve to something