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
feat(core): reserve public acknowledgement for the person [C7,B26,H16]
Corey Olson105517d6676f
diff --git a/src/board.js b/src/board.jsindex 4e5f9f12..a1a44c62 100644--- a/src/board.js+++ b/src/board.js@@ -1,7 +1,7 @@import { foreignBlockers } from './cross-repo-dependencies.js';import { REFERENCE_ENGINE } from './reference-engine.js';import { validateReferenceTargets } from './reference-lines.js';-import { validateReferenceAuthors } from './reference-authors.js';+import { validateReferenceAuthors, validateReferenceAuthority } from './reference-authors.js';import {dependencyValues,validateNativeDependencies,@@ -692,9 +692,9 @@ function checkRouted({ brief, route, criterion, check }, engine = ENGINE_VERSION* @param {{ by: string, lane: string, title: string, criterion?: string, specIds?: string[], parentId?: number | null, after?: (number | string)[], brief?: string, route?: string, check?: string }} item* @returns {number} The new item's id.*/-export function addItem(board, { by, lane, title, criterion = '', specIds = [], parentId = null, after = [], brief = '', route = 'strong', check, checkBaseline, barActor, referenceAuthors }) {+export function addItem(board, { by, lane, title, criterion = '', specIds = [], parentId = null, after = [], brief = '', route = 'strong', check, checkBaseline, barActor, referenceAuthors, referenceAuthority }) {return atomic(board, () => {- const item = { by, lane, title, criterion, specIds, parentId, after, brief, route, check, checkBaseline, barActor, referenceAuthors };+ const item = { by, lane, title, criterion, specIds, parentId, after, brief, route, check, checkBaseline, barActor, referenceAuthors, referenceAuthority };return insertItem(board, item, validateItemAddition(board, item));});}@@ -751,13 +751,13 @@ function validateItemDependencies(board, itemId, after) {}/** Validate an addition before its sender runs a new check, and again when the ordered move applies. */-export function validateItemAddition(board, { by, lane, title, criterion = '', parentId = null, after = [], brief = '', route = 'strong', check, referenceAuthors }) {+export function validateItemAddition(board, { by, lane, title, criterion = '', parentId = null, after = [], brief = '', route = 'strong', check, referenceAuthors, referenceAuthority }) {const command = coordinatorCheck(by, check) ?? '';const cleanTitle = title.trim();if (!cleanTitle) throw new Refused('NO_TITLE', 'an item needs a title');checkRoute(route);const engine = board.executionEngineVersion ?? ENGINE_VERSION;- if (engine >= REFERENCE_ENGINE) { validateReferenceTargets(brief); validateReferenceAuthors(brief, referenceAuthors); }+ if (engine >= REFERENCE_ENGINE) { validateReferenceTargets(brief); validateReferenceAuthority(by, brief, referenceAuthority); validateReferenceAuthors(brief, referenceAuthors); }checkRouted({ brief: brief.trim(), route, criterion, check: command }, engine);if (parentId !== null) {const parent = itemById(board, parentId);@@ -781,11 +781,11 @@ export function validateItemAddition(board, { by, lane, title, criterion = '', p* @param {number} id* @param {{ agentId: string, brief?: string, route?: string, criterion?: string, check?: string, after?: (number | string)[] }} change*/-export function editItem(board, id, { agentId, brief, route, criterion, check, after, checkBaseline, reason, barActor, referenceAuthors }) {+export function editItem(board, id, { agentId, brief, route, criterion, check, after, checkBaseline, reason, barActor, referenceAuthors, referenceAuthority }) {atomic(board, () => {const stored = itemById(board, id);const expiredHolder = stored.item_status === 'claimed' && !isHeld(board, stored) ? stored.item_owner : null;- const { item, next, command, unfreeze, bar } = validateItemEdit(board, id, { agentId, brief, route, criterion, check, after, reason, referenceAuthors });+ const { item, next, command, unfreeze, bar } = validateItemEdit(board, id, { agentId, brief, route, criterion, check, after, reason, referenceAuthors, referenceAuthority });const baseline = normalizeCheckBaseline(agentId, command, checkBaseline);const pendingFields = [...(next.item_criterion !== item.item_criterion ? ['criterion'] : []),@@ -847,7 +847,7 @@ function notifyFileGrowth(board, before, after) {}/** Validate an edit without side effects, so a refused change never starts a shell baseline; a bar correction needs a reason [B31]. */-export function validateItemEdit(board, id, { agentId, brief, route, criterion, check, after, reason, referenceAuthors }) {+export function validateItemEdit(board, id, { agentId, brief, route, criterion, check, after, reason, referenceAuthors, referenceAuthority }) {const engine = board.executionEngineVersion ?? ENGINE_VERSION;if (after !== undefined && engine < 10) {throw new Refused('ENGINE_VERSION', `editing item dependencies requires engine 10; this board uses engine ${engine}; upgrade Pullboard before using --after`);@@ -890,7 +890,7 @@ export function validateItemEdit(board, id, { agentId, brief, route, criterion,if (moved.length && item.item_status !== 'open' && (routeChanged || !correctionWhileClaimed)) {throw new Refused('HELD', `item #${id} is ${item.item_status}; change its route, criterion or check only while it is open`);}- if (brief !== undefined && engine >= REFERENCE_ENGINE) { validateReferenceTargets(brief); validateReferenceAuthors(brief, referenceAuthors); }+ if (brief !== undefined && engine >= REFERENCE_ENGINE) { validateReferenceTargets(brief); validateReferenceAuthority(agentId, brief, referenceAuthority, item.item_brief); validateReferenceAuthors(brief, referenceAuthors); }checkRouted({ brief: next.item_brief, route: next.item_route, criterion: next.item_criterion, check: next.item_check }, engine);const unfreeze = next.item_criterion !== item.item_criterion || next.item_check !== item.item_check;return { item, next, command, unfreeze, bar: barCorrectionFields(board, item, next, { reason }) };diff --git a/src/commands/add.js b/src/commands/add.jsindex 9cf4e719..cff0ccbe 100644--- a/src/commands/add.js+++ b/src/commands/add.js@@ -1,5 +1,5 @@import { dependencyValues } from '../item-dependencies.js';-import { referenceAuthors } from '../reference-authors.js';+import { referenceAuthors, referenceAuthority } from '../reference-authors.js';/** The pullboard add command, in its own module so an item adding another command never edits these lines. */import * as store from '../board.js';import {@@ -72,6 +72,8 @@ export async function run(io, args) {check: values.check,};buildInFilelessLane(ctx.config, first, after);+ const authority = referenceAuthority(ctx, me.id, item.brief);+ if (authority) item.referenceAuthority = authority;const authors = referenceAuthors(ctx.info.root, item.brief);if (authors.length) item.referenceAuthors = authors;const { command } = store.validateItemAddition(board, item);diff --git a/src/commands/edit.js b/src/commands/edit.jsindex d8bde749..3aaa265e 100644--- a/src/commands/edit.js+++ b/src/commands/edit.js@@ -1,5 +1,5 @@import { barReadySetting } from '../bar-readiness.js';-import { referenceAuthors } from '../reference-authors.js';+import { referenceAuthors, referenceAuthority } from '../reference-authors.js';/** The pullboard edit command, in its own module so an item adding another command never edits these lines. */import * as store from '../board.js';import {@@ -52,6 +52,8 @@ export async function run(io, args) {...(values.reason !== undefined ? { reason: values.reason } : {}),};if (change.brief !== undefined) {+ const authority = referenceAuthority(ctx, me.id, change.brief, store.getItem(board, id).item_brief);+ if (authority) change.referenceAuthority = authority;const authors = referenceAuthors(ctx.info.root, change.brief);if (authors.length) change.referenceAuthors = authors;}diff --git a/src/moves/addItem.js b/src/moves/addItem.jsindex 7258141e..c522aefd 100644--- a/src/moves/addItem.js+++ b/src/moves/addItem.js@@ -19,7 +19,7 @@ function existingEngine(args, board, at) {/** Preserve every historical floor while preventing older replicas from flattening foreign references. */function minimumEngine(args, board, at) {- return Math.max(args[0]?.referenceAuthors !== undefined ? REFERENCE_ENGINE : 1, existingEngine(args, board, at), hasForeignDependencies(args[0]?.after) ? CROSS_REPO_DEPENDENCY_ENGINE : 1);+ return Math.max((args[0]?.referenceAuthors !== undefined || args[0]?.referenceAuthority !== undefined) ? REFERENCE_ENGINE : 1, existingEngine(args, board, at), hasForeignDependencies(args[0]?.after) ? CROSS_REPO_DEPENDENCY_ENGINE : 1);}/** Read precisely the actor argument used by this operation [H2,H16]. */diff --git a/src/moves/editItem.js b/src/moves/editItem.jsindex ca1795b8..3c3106e1 100644--- a/src/moves/editItem.js+++ b/src/moves/editItem.js@@ -25,7 +25,7 @@ function existingEngine(args, board, at) {/** Preserve every historical floor while preventing older replicas from flattening foreign references. */function minimumEngine(args, board, at) {- return Math.max(args[1]?.referenceAuthors !== undefined ? REFERENCE_ENGINE : 1, existingEngine(args, board, at), hasForeignDependencies(args[1]?.after) ? CROSS_REPO_DEPENDENCY_ENGINE : 1);+ return Math.max((args[1]?.referenceAuthors !== undefined || args[1]?.referenceAuthority !== undefined) ? REFERENCE_ENGINE : 1, existingEngine(args, board, at), hasForeignDependencies(args[1]?.after) ? CROSS_REPO_DEPENDENCY_ENGINE : 1);}/** Read precisely the actor argument used by this operation [H2,H16]. */diff --git a/src/reference-authors.js b/src/reference-authors.jsindex c3ae8b48..4a8baf30 100644--- a/src/reference-authors.js+++ b/src/reference-authors.js@@ -2,6 +2,29 @@import { handledReferences } from './reference-lines.js';import { githubPullClient } from './pr-github.js';import { Refused } from './refused.js';+import { requirePersonChannel } from './person.js';++/** Changing a handled target or handle is a new public acknowledgement; retaining one is ordinary triage. */+function newAcknowledgements(brief, previous = '') {+ const old = new Set(handledReferences(previous).map(reference => JSON.stringify([reference.target, reference.handle.toLowerCase()])));+ return handledReferences(brief).some(reference => !old.has(JSON.stringify([reference.target, reference.handle.toLowerCase()])));+}++/** Authorize public acknowledgement through the same authenticated person channels as outside approval. */+export function referenceAuthority(ctx, actor, brief, previous = '') {+ if (!newAcknowledgements(brief, previous)) return undefined;+ if (ctx.io.personRequest?.phase !== 'execute') requirePersonChannel(ctx.io.personChannel);+ if (!ctx.info.isMain || actor !== 'coordinator') throw new Refused('B26_PERSON_CHANNEL', 'the person acknowledges an outside reference from the main checkout or its authenticated view; leave the reference unhandled for triage.');+ return 'person';+}++/** Replay person acknowledgement authority without consulting another device's shell. */+export function validateReferenceAuthority(actor, brief, authority, previous = '') {+ if (!newAcknowledgements(brief, previous)) return;+ if (!['coordinator', 'person'].includes(actor) || authority !== 'person') {+ throw new Refused('B26_PERSON_CHANNEL', 'only the authenticated person marks an outside reference handled; keep it without a handle for ordinary triage.');+ }+}/** Recognize only a fixed GitHub issue or PR route; arbitrary references never become fetch URLs. */function githubReference(target) {diff --git a/src/relay-sender.js b/src/relay-sender.jsindex 2f69d18c..2656283b 100644--- a/src/relay-sender.js+++ b/src/relay-sender.js@@ -27,13 +27,19 @@ function personBarMove(move) {return at !== null && move.args?.[at]?.barActor?.authority === 'person';}+/** Public acknowledgement follows authenticated person credentials even when the actor is the coordinator. */+function personReferenceMove(move) {+ const options = move?.operation === 'addItem' ? move.args?.[0] : move?.operation === 'editItem' ? move.args?.[1] : null;+ return options?.referenceAuthority === 'person';+}+/*** True for a move only the person may make: a row decision, a sentinel decision, an answer or hold as the person, a* person fact or request, or any move whose actor is the person. On a board that names approvers, only an approver's* session makes one [E4].*/function personAuthority(move) {- return personBarMove(move) || personFact(move) || ['recordRowDecisions', 'decideSpecRevisions', 'decideSentinel'].includes(move?.operation) || move?.operation === 'answerDecision' && Boolean(move.args?.[1]?.asPerson) ||+ return personReferenceMove(move) || personBarMove(move) || personFact(move) || ['recordRowDecisions', 'decideSpecRevisions', 'decideSentinel'].includes(move?.operation) || move?.operation === 'answerDecision' && Boolean(move.args?.[1]?.asPerson) ||move?.operation === 'shout' && Boolean(move.args?.[0]?.request) || relayMoveActor(move) === 'person';}@@ -75,7 +81,7 @@ export function relaySenderProblem(move, sender, kind, { phoneReceipt = false }move.operation === 'ensureCoordinator' && typeof move.args?.[0] === 'string')) return null;return new Refused('RELAY_PERSON_ONLY', 'a machine cannot act as the person; approve this action on the paired phone');}- if (personBarMove(move) || kind === 'snapshot' || ['recordRowDecisions', 'decideSpecRevisions'].includes(move?.operation) || move?.operation === 'decideSentinel' || move?.operation === 'answerDecision' && move.args?.[1]?.asPerson ||+ if (personReferenceMove(move) || personBarMove(move) || kind === 'snapshot' || ['recordRowDecisions', 'decideSpecRevisions'].includes(move?.operation) || move?.operation === 'decideSentinel' || move?.operation === 'answerDecision' && move.args?.[1]?.asPerson ||move?.operation === 'shout' && move.args?.[0]?.request || relayMoveActor(move) === 'person') {return new Refused('RELAY_PERSON_ONLY', `agent ${sender.agent} cannot make a person-only relay ${kind}; use the person's authenticated session`);}@@ -92,7 +98,7 @@ export function credentialActor(move) {return typeof creator === 'string' && creator !== 'machine' ? creator : 'machine';}if (move.personRequest || ['register', 'ensureCoordinator'].includes(move.operation)) return 'machine';- if (personBarMove(move) || ['recordRowDecisions', 'decideSpecRevisions', 'recordLandingWaiver'].includes(move.operation)+ if (personReferenceMove(move) || personBarMove(move) || ['recordRowDecisions', 'decideSpecRevisions', 'recordLandingWaiver'].includes(move.operation)|| move.operation === 'answerDecision' && args[1]?.asPerson|| move.operation === 'shout' && args[0]?.request) return 'person';return relayMoveActor(move);