Add safe domain retirement lifecycle

This commit is contained in:
thePR0M3TH3AN committed 2026-09-27 18:02:28 -04:00
1 parent 104f5f4469
commit acfbc6d32e
8 files changed
+297 -17

No files matched your search

+7
View File
@@ -106,6 +106,13 @@ export const projectConfigSchema = z.object({
worktree_name: text.regex(/^[A-Za-z0-9][A-Za-z0-9._-]*$/).nullable().optional(),
}).strict(),
domains: z.array(domain).min(1),
retired_domains: z.array(z.object({
id,
title: text,
branch: text,
change_id: text,
retired_at: text,
}).strict()).optional(),
}).strict().superRefine((config, context) => {
const runtimeNames = new Set(Object.keys(config.runtimes).filter((name) => name !== 'default'));
if (!runtimeNames.has(config.runtimes.default)) {
+1 -1
View File
@@ -90,7 +90,7 @@ function initialFiles({ repository, projectId, createdAt, proposal }) {
const managerPrompt = `${promptContent(
proposal.session_manager?.prompt_source,
'# TORCH Session Manager\n\nRoute owner requests, establish ownership and priority, and keep routine coordination inside the fleet.\n',
).trimEnd()}\n\n## Fleet evolution\n\nWhen recurring work has no coherent owner, or a durable specialist would materially improve context locality, ownership clarity, or verification, use \`torch_propose_domain\` to submit an evidence-backed Fleet change. Use \`torch_list_fleet_changes\` to follow its state. Never create, approve, or activate a persistent identity yourself; owner approval and CLI activation are separate. Also recommend merge or retirement when coordination cost exceeds the value of a persistent session.\n`;
).trimEnd()}\n\n## Fleet evolution\n\nWhen recurring work has no coherent owner, or a durable specialist would materially improve context locality, ownership clarity, or verification, use \`torch_propose_domain\` to submit an evidence-backed Fleet change. When a specialist no longer earns its coordination cost, use \`torch_propose_domain_retirement\`; retirement preserves its branch and refuses active or unrecoverable work. Use \`torch_list_fleet_changes\` to follow change state. Never create, retire, approve, or activate a persistent identity yourself; owner approval and CLI activation are separate. Recommend a merge or split for owner review when boundaries should change but do not silently rewrite ownership.\n`;
const files = new Map([
['torch.yaml', jsonYaml(config)],
['roster.yaml', jsonYaml(roster)],