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
/** Machine-local configuration for a dedicated, ordinarily linked canary seat [H5,H17]. */
import { isAbsolute } from 'node:path';
import { Refused } from './refused.js';
/** Validate only execution settings; credentials remain in the existing board link and device key store. */
export function relayCanaryConfig(value) {
const problem = relayCanaryProblem(value);
if (problem) throw new Refused('RELAY_CANARY_CONFIG', problem);
return normalCanary(value);
}
/**
* Name what is wrong with a stored canary setting, or return null when it is valid or absent.
* Why: machine settings load on every move, so they report a bad canary as BAD_MACHINE_SETTINGS
* without raising the canary command's own refusal from unrelated moves.
*/
export function relayCanaryProblem(value) {
if (value === undefined || value === null) return null;
if (!value || typeof value !== 'object' || Array.isArray(value)
|| typeof value.enabled !== 'boolean' || typeof value.root !== 'string' || !isAbsolute(value.root)
|| typeof value.agentId !== 'string' || !value.agentId || /\s/u.test(value.agentId)
|| Object.keys(value).some(key => !['enabled', 'root', 'agentId', 'deadlineMs'].includes(key))) {
return 'configure a dedicated linked seat with pullboard relay canary on; credentials are never command arguments';
}
const deadlineMs = value.deadlineMs ?? 5000;
if (!Number.isSafeInteger(deadlineMs) || deadlineMs < 100 || deadlineMs > 25000) {
return 'set the canary timeout between 100 and 25000 milliseconds, below its one-minute cadence';
}
return null;
}
/** Copy only the known canary fields, defaulting the deadline; the value is already validated. */
function normalCanary(value) {
if (value === undefined || value === null) return null;
return { enabled: value.enabled, root: value.root, agentId: value.agentId, deadlineMs: value.deadlineMs ?? 5000 };
}