Autonomous development for real products. Governed agents build from specs you approve, follow the rules you set, and nothing merges until another agent proves it. Your decisions, judgement and taste are the bar that work must clear. Declare your vision and let agents build it.
JavaScript agentic-codingai-agentsai-governanceautonomous-agentsclaude-codeclicode-reviewcodexcoding-agentsdeveloper-toolsgit-hooksllmlocal-firstmulti-agentsoftware-factoryspec-driven-developmentverificationvibe-coding
fix(review): honor runtime parent metadata shapes [V1,B3]
Corey Olson2d026233c3bb
diff --git a/src/board.js b/src/board.jsindex ba99fde5..5642a72d 100644--- a/src/board.js+++ b/src/board.js@@ -74,7 +74,10 @@ import { LOCAL_LANDING_ENGINE } from './land-engine.js';import { SPEC_APPROVAL_ENGINE } from './spec-approval-engine.js';import { Refused } from './refused.js';import { PARENT_SESSION_ENGINE } from './parent-session-engine.js';-import { canonicalSessionDigest, parentSessionDigest } from './parent-session.js';+import {+ canonicalSessionDigest,+ parentSessionDigest,+} from './parent-session.js';import { itemAuthorProblem } from './item-authors.js';import { refuseMaskedExit } from './check-mask.js';import {diff --git a/src/commands/join.js b/src/commands/join.jsindex 2a9b4f2b..c05a4b77 100644--- a/src/commands/join.js+++ b/src/commands/join.js@@ -1,4 +1,8 @@-import { parentIdentity, parentSessionDigest, runtimeSessionIdentity } from '../parent-session.js';+import {+ parentIdentity,+ parentSessionDigest,+ runtimeSessionIdentity,+} from '../parent-session.js';/** The pullboard join command, in its own module so an item adding another command never edits these lines. */import {displayAgentName,diff --git a/src/next-steps.js b/src/next-steps.jsindex 53987649..2b926769 100644--- a/src/next-steps.js+++ b/src/next-steps.js@@ -200,6 +200,7 @@ export const NEXT_STEPS = Object.freeze({BAD_RESOURCE_PRIORITY: 'request the slot as one kind: a landing, an item check or a diagnostic',BAD_RESOURCE_SCOPE: 'use the machine or repo scope',BAD_ROUTE: 'use --route light, mid or strong',+ BAD_PARENT: 'join again with --parent <stable-session-id> from your own runtime session',BAD_SEAT_ID: 'create the seat again from the same checkout without naming it, so Pullboard picks the next free name: pullboard worktree <lane> --model "<model name>"',BAD_SIGNATURE: 'make sure the signer is listed, then record a fresh sign-off: pullboard spec signoff <ids>',BAD_SIGNER: 'set git config user.email, or pass --by <principal>',@@ -453,6 +454,7 @@ export const NEXT_STEPS = Object.freeze({PATH_OWNED: 'choose a folder no existing lane owns, or edit the lane ownership in pullboard.json from the main checkout',PARENT_CLOSED: 'add the item without --parent, or under an open parent',PARENT_LANE: 'add the child in its parent\'s lane',+ PARENT_SESSION_CHANGED: 'create a fresh worktree and join it from the new parent session',PENDING_REFREEZE: 'the coordinator runs pullboard refreeze <id>',PRIVATE_BLUEPRINT: 'choose a blueprint name and title that identify no person or private project, then retry pullboard blueprint save',RATCHET_ROSE: 'fix the new doctrine problems named in the report, commit, and submit again; only the person can sign an increased count',diff --git a/src/parent-session.js b/src/parent-session.jsindex 3e8e5bc5..d2ff1bfe 100644--- a/src/parent-session.js+++ b/src/parent-session.js@@ -1,5 +1,10 @@/** Stable parent identities recorded at join, from an explicit declaration or this runtime's own session metadata [V1,B3]. */-import { closeSync, openSync, readSync, readdirSync } from 'node:fs';+import {+ closeSync,+ openSync,+ readSync,+ readdirSync,+} from 'node:fs';import { homedir } from 'node:os';import { join } from 'node:path';import { Refused } from './refused.js';@@ -53,7 +58,8 @@ export function runtimeSessionIdentity(environment = process.env, home = homedirif (!entry.isFile() || !entry.name.endsWith(`-${session}.jsonl`)) continue;const metadata = ownSessionMetadata(join(entry.parentPath, entry.name), session);if (!metadata) continue;- try { return { session: parentIdentity(session), parent: metadata.parent_thread_id ? parentIdentity(metadata.parent_thread_id) : null }; }+ const parent = metadata.parent_thread_id ?? metadata.source?.subagent?.thread_spawn?.parent_thread_id;+ try { return { session: parentIdentity(session), parent: parent ? parentIdentity(parent) : null }; }catch { /* An invalid runtime record cannot declare another identity. */ }}return null;diff --git a/test/parent-session.test.js b/test/parent-session.test.jsindex 410afbbe..76aef7a6 100644--- a/test/parent-session.test.js+++ b/test/parent-session.test.js@@ -1,16 +1,31 @@/** Parent discovery reads the invoking runtime record and preserves unknown identity [V1,B3]. */import assert from 'node:assert/strict';-import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';+import {+ mkdirSync,+ mkdtempSync,+ rmSync,+ writeFileSync,+} from 'node:fs';import { tmpdir } from 'node:os';import { join } from 'node:path';import { test } from 'node:test';-import { joinParentSession, parentSessionDigest, runtimeParentSession } from '../src/parent-session.js';+import {+ joinParentSession,+ parentSessionDigest,+ runtimeParentSession,+} from '../src/parent-session.js';import * as store from '../src/board.js';import { runFixtureGit } from './fixture-child.js';import { submitFixture } from './board-submit-fixture.js';import { workQueue } from '../src/queue.js';-import { prepareEngineMove, applyEngineMove } from '../src/engine.js';-import { exportBoard, importBoard } from '../src/exchange.js';+import {+ prepareEngineMove,+ applyEngineMove,+} from '../src/engine.js';+import {+ exportBoard,+ importBoard,+} from '../src/exchange.js';import { effectiveAgentParent } from '../src/seats.js';test('[V1,B3] parent discovery reads only matching own runtime metadata and agrees with --parent', (t) => {@@ -24,6 +39,8 @@ test('[V1,B3] parent discovery reads only matching own runtime metadata and agrewriteFileSync(join(sessions, 'rollout-2026-10-23-other-session.jsonl'), '{foreign unreadable metadata');assert.equal(runtimeParentSession(environment), 'root-session');assert.equal(joinParentSession(undefined, environment), joinParentSession('root-session', {}));+ writeFileSync(own, JSON.stringify({ type: 'session_meta', payload: { id: 'own-session', source: { subagent: { thread_spawn: { parent_thread_id: 'root-session' } } } } }) + '\n');+ assert.equal(runtimeParentSession(environment), 'root-session', 'the runtime thread_spawn shape declares the same parent');writeFileSync(own, JSON.stringify({ type: 'session_meta', payload: { id: 'other-session', parent_thread_id: 'foreign-parent' } }) + '\n');assert.equal(runtimeParentSession(environment), null, 'a filename alone cannot authenticate another session record');assert.equal(joinParentSession(undefined, {}), null, 'missing runtime metadata remains unknown');