@ornexus/neocortex 4.60.81 → 4.61.2
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.
- package/dist/release-source.json +1 -1
- package/install.ps1 +33 -1
- package/install.sh +35 -1
- package/package.json +2 -2
- package/packages/client/dist/adapters/platform-detector.d.ts +1 -1
- package/packages/client/dist/adapters/platform-detector.js +6 -0
- package/packages/client/dist/cli.js +7 -0
- package/packages/client/dist/commands/invoke.d.ts +15 -8
- package/packages/client/dist/commands/invoke.js +75 -1
- package/packages/client/dist/commands/story-checkpoint.d.ts +2 -1
- package/packages/client/dist/commands/story-checkpoint.js +34 -2
- package/packages/client/dist/commands/story-worktree.d.ts +46 -0
- package/packages/client/dist/commands/story-worktree.js +258 -0
- package/packages/client/dist/config.js +1 -0
- package/packages/client/dist/git/direct-yolo-checkpoint.d.ts +46 -0
- package/packages/client/dist/git/direct-yolo-checkpoint.js +137 -1
- package/packages/client/dist/git/git-lifecycle-store.d.ts +84 -0
- package/packages/client/dist/git/git-lifecycle-store.js +314 -4
- package/packages/client/dist/git/story-worktree-cleanup.d.ts +226 -0
- package/packages/client/dist/git/story-worktree-cleanup.js +1058 -0
- package/packages/client/dist/git/story-worktree-integration.d.ts +91 -0
- package/packages/client/dist/git/story-worktree-integration.js +603 -0
- package/packages/client/dist/git/story-worktree-manager.d.ts +205 -0
- package/packages/client/dist/git/story-worktree-manager.js +843 -0
- package/packages/client/dist/git/story-worktree-paths.d.ts +65 -0
- package/packages/client/dist/git/story-worktree-paths.js +150 -0
- package/packages/client/dist/policy/subagent-approval-policy.js +3 -1
- package/packages/client/dist/runner/headless/continuous-story-workspace.d.ts +49 -1
- package/packages/client/dist/runner/headless/continuous-story-workspace.js +175 -27
- package/packages/client/dist/runner/headless/run-yoloop.d.ts +39 -0
- package/packages/client/dist/runner/headless/run-yoloop.js +71 -0
- package/packages/client/dist/runner-cli.js +0 -0
- package/packages/client/dist/state/project-state-snapshot.js +3 -0
- package/packages/shared/dist/yoloop/epic-terminal-git.js +27 -3
- package/targets-stubs/antigravity/gemini.md +1 -1
- package/targets-stubs/antigravity/neocortex.md +21 -0
- package/targets-stubs/antigravity/skill/SKILL.md +1 -1
- package/targets-stubs/claude-code/README.md +17 -0
- package/targets-stubs/claude-code/neocortex-root.agent.yaml +1 -1
- package/targets-stubs/claude-code/neocortex-root.md +57 -49
- package/targets-stubs/claude-code/neocortex.agent.yaml +1 -1
- package/targets-stubs/claude-code/neocortex.md +28 -25
- package/targets-stubs/codex/AGENTS.md +31 -30
- package/targets-stubs/codex/neocortex.toml +10 -0
- package/targets-stubs/cursor/agent.md +13 -2
- package/targets-stubs/deepseek-harness/SKILL.md +13 -0
- package/targets-stubs/gemini-cli/agent.md +23 -2
- package/targets-stubs/grok/SKILL.md +21 -0
- package/targets-stubs/kimi/neocortex.md +21 -0
- package/targets-stubs/openclaw/SKILL.md +21 -0
- package/targets-stubs/opencode/neocortex-root.md +19 -15
- package/targets-stubs/opencode/neocortex.md +10 -0
- package/targets-stubs/vscode/neocortex.agent.md +13 -2
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license FSL-1.1
|
|
3
|
+
* Copyright (c) 2026 OrNexus AI
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Neocortex CLI, licensed under the
|
|
6
|
+
* Functional Source License, Version 1.1 (FSL-1.1).
|
|
7
|
+
*
|
|
8
|
+
* Change Date: February 20, 2029
|
|
9
|
+
* Change License: MIT
|
|
10
|
+
*
|
|
11
|
+
* See the LICENSE file in the project root for full license text.
|
|
12
|
+
*/
|
|
13
|
+
/** Windows keeps the default worktree path well below MAX_PATH-sensitive tools. */
|
|
14
|
+
export declare const STORY_WORKTREE_WIN32_MAX_PATH = 80;
|
|
15
|
+
export declare const STORY_WORKTREE_ROOT_ENV = "NEOCORTEX_STORY_WORKTREE_ROOT";
|
|
16
|
+
export declare const STORY_WORKTREE_ID_ENV = "NEOCORTEX_STORY_WORKTREE_ID";
|
|
17
|
+
export type StoryWorktreePlatform = 'linux' | 'darwin' | 'win32';
|
|
18
|
+
export type StoryWorktreePathReasonCode = 'story-worktree-identity-invalid' | 'story-worktree-platform-unsupported' | 'story-worktree-root-invalid' | 'story-worktree-path-too-long' | 'story-worktree-path-inside-repository' | 'story-worktree-root-unsafe';
|
|
19
|
+
export type StoryWorktreePathResult<T> = {
|
|
20
|
+
readonly ok: true;
|
|
21
|
+
readonly value: T;
|
|
22
|
+
} | {
|
|
23
|
+
readonly ok: false;
|
|
24
|
+
readonly reasonCode: StoryWorktreePathReasonCode;
|
|
25
|
+
};
|
|
26
|
+
export interface StoryWorktreeIdentity {
|
|
27
|
+
readonly epicId: string;
|
|
28
|
+
readonly storyId: string;
|
|
29
|
+
readonly dispatchId: string;
|
|
30
|
+
/** First 8 hex characters of sha256("<epic>|<story>|<dispatch>"). */
|
|
31
|
+
readonly hash8: string;
|
|
32
|
+
readonly temporaryBranch: string;
|
|
33
|
+
readonly executionBranch: string;
|
|
34
|
+
readonly leaseId: string;
|
|
35
|
+
/** Opaque ID exported to the child as NEOCORTEX_STORY_WORKTREE_ID. */
|
|
36
|
+
readonly worktreeId: string;
|
|
37
|
+
/** Public relative ref (relative to the private worktree root). */
|
|
38
|
+
readonly worktreeRef: string;
|
|
39
|
+
}
|
|
40
|
+
export interface StoryWorktreeRootInput {
|
|
41
|
+
readonly platform?: string;
|
|
42
|
+
readonly env?: Readonly<Record<string, string | undefined>>;
|
|
43
|
+
readonly homedir?: string;
|
|
44
|
+
/** Explicit absolute root (option or NEOCORTEX_STORY_WORKTREE_ROOT). */
|
|
45
|
+
readonly override?: string;
|
|
46
|
+
}
|
|
47
|
+
export declare function storyWorktreeIdentity(input: {
|
|
48
|
+
readonly epicId: string;
|
|
49
|
+
readonly storyId: string;
|
|
50
|
+
readonly dispatchId: string;
|
|
51
|
+
}): StoryWorktreePathResult<StoryWorktreeIdentity>;
|
|
52
|
+
/** Resolve the private root `<cache>/nx/wt` for the given platform. */
|
|
53
|
+
export declare function resolveStoryWorktreeRoot(input?: StoryWorktreeRootInput): StoryWorktreePathResult<string>;
|
|
54
|
+
/** Compute `<root>/<hash8>` and enforce length and out-of-repository rules. */
|
|
55
|
+
export declare function resolveStoryWorktreePath(input: {
|
|
56
|
+
readonly root: string;
|
|
57
|
+
readonly hash8: string;
|
|
58
|
+
readonly repositoryRoot: string;
|
|
59
|
+
readonly platform?: string;
|
|
60
|
+
}): StoryWorktreePathResult<string>;
|
|
61
|
+
/**
|
|
62
|
+
* Create the private root (0700 on POSIX), refusing symlinked or non-directory
|
|
63
|
+
* segments that already exist under the deepest existing ancestor.
|
|
64
|
+
*/
|
|
65
|
+
export declare function ensurePrivateStoryWorktreeRoot(root: string, platform?: string): Promise<StoryWorktreePathResult<string>>;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license FSL-1.1
|
|
3
|
+
* Copyright (c) 2026 OrNexus AI
|
|
4
|
+
*
|
|
5
|
+
* This file is part of Neocortex CLI, licensed under the
|
|
6
|
+
* Functional Source License, Version 1.1 (FSL-1.1).
|
|
7
|
+
*
|
|
8
|
+
* Change Date: February 20, 2029
|
|
9
|
+
* Change License: MIT
|
|
10
|
+
*
|
|
11
|
+
* See the LICENSE file in the project root for full license text.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* P225.05 -- short, private, cross-OS story worktree paths (P225-CON-WORKTREE).
|
|
15
|
+
*
|
|
16
|
+
* Identity and root computation are pure: platform, environment and home
|
|
17
|
+
* directory are injected seams so linux/darwin/win32 rules are testable on any
|
|
18
|
+
* host. Absolute paths returned here are private and must never be printed;
|
|
19
|
+
* public output uses `worktreeRef` (`wt/<hash8>`) only.
|
|
20
|
+
*/
|
|
21
|
+
import { createHash } from 'node:crypto';
|
|
22
|
+
import { lstat, mkdir, chmod } from 'node:fs/promises';
|
|
23
|
+
import { posix, win32 } from 'node:path';
|
|
24
|
+
/** Windows keeps the default worktree path well below MAX_PATH-sensitive tools. */
|
|
25
|
+
export const STORY_WORKTREE_WIN32_MAX_PATH = 80;
|
|
26
|
+
export const STORY_WORKTREE_ROOT_ENV = 'NEOCORTEX_STORY_WORKTREE_ROOT';
|
|
27
|
+
export const STORY_WORKTREE_ID_ENV = 'NEOCORTEX_STORY_WORKTREE_ID';
|
|
28
|
+
const STORY_ID = /^P[1-9][0-9]*(?:\.[0-9]+)*$/;
|
|
29
|
+
const DISPATCH_ID = /^[A-Za-z0-9][A-Za-z0-9_-]{7,95}$/;
|
|
30
|
+
export function storyWorktreeIdentity(input) {
|
|
31
|
+
const { epicId, storyId, dispatchId } = input;
|
|
32
|
+
if (typeof epicId !== 'string' || !STORY_ID.test(epicId) || epicId.includes('.')
|
|
33
|
+
|| typeof storyId !== 'string' || !STORY_ID.test(storyId) || !storyId.startsWith(`${epicId}.`)
|
|
34
|
+
|| typeof dispatchId !== 'string' || !DISPATCH_ID.test(dispatchId)) {
|
|
35
|
+
return { ok: false, reasonCode: 'story-worktree-identity-invalid' };
|
|
36
|
+
}
|
|
37
|
+
const digest = createHash('sha256').update(`${epicId}|${storyId}|${dispatchId}`).digest('hex');
|
|
38
|
+
const hash8 = digest.slice(0, 8);
|
|
39
|
+
return {
|
|
40
|
+
ok: true,
|
|
41
|
+
value: Object.freeze({
|
|
42
|
+
epicId,
|
|
43
|
+
storyId,
|
|
44
|
+
dispatchId,
|
|
45
|
+
hash8,
|
|
46
|
+
temporaryBranch: `nx/${epicId}/${hash8}`,
|
|
47
|
+
executionBranch: `epic/${epicId}`,
|
|
48
|
+
leaseId: `swt-${digest.slice(0, 24)}`,
|
|
49
|
+
worktreeId: `nxwt-${hash8}`,
|
|
50
|
+
worktreeRef: `wt/${hash8}`,
|
|
51
|
+
}),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function pathApi(platform) {
|
|
55
|
+
return platform === 'win32' ? win32 : posix;
|
|
56
|
+
}
|
|
57
|
+
function normalizePlatform(value) {
|
|
58
|
+
return value === 'linux' || value === 'darwin' || value === 'win32' ? value : undefined;
|
|
59
|
+
}
|
|
60
|
+
/** Resolve the private root `<cache>/nx/wt` for the given platform. */
|
|
61
|
+
export function resolveStoryWorktreeRoot(input = {}) {
|
|
62
|
+
const platform = normalizePlatform(input.platform ?? process.platform);
|
|
63
|
+
if (!platform)
|
|
64
|
+
return { ok: false, reasonCode: 'story-worktree-platform-unsupported' };
|
|
65
|
+
const api = pathApi(platform);
|
|
66
|
+
const env = input.env ?? process.env;
|
|
67
|
+
const explicit = input.override ?? env[STORY_WORKTREE_ROOT_ENV];
|
|
68
|
+
if (explicit !== undefined && explicit !== '') {
|
|
69
|
+
if (!api.isAbsolute(explicit))
|
|
70
|
+
return { ok: false, reasonCode: 'story-worktree-root-invalid' };
|
|
71
|
+
return { ok: true, value: api.normalize(explicit) };
|
|
72
|
+
}
|
|
73
|
+
const home = input.homedir;
|
|
74
|
+
const absoluteOrUndefined = (value) => value && api.isAbsolute(value) ? value : undefined;
|
|
75
|
+
let base;
|
|
76
|
+
if (platform === 'linux') {
|
|
77
|
+
base = absoluteOrUndefined(env.XDG_CACHE_HOME)
|
|
78
|
+
?? (absoluteOrUndefined(home) ? api.join(home, '.cache') : undefined);
|
|
79
|
+
}
|
|
80
|
+
else if (platform === 'darwin') {
|
|
81
|
+
base = absoluteOrUndefined(home) ? api.join(home, 'Library', 'Caches') : undefined;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
base = absoluteOrUndefined(env.LOCALAPPDATA)
|
|
85
|
+
?? (absoluteOrUndefined(home) ? api.join(home, 'AppData', 'Local') : undefined);
|
|
86
|
+
}
|
|
87
|
+
if (!base)
|
|
88
|
+
return { ok: false, reasonCode: 'story-worktree-root-invalid' };
|
|
89
|
+
return { ok: true, value: api.join(base, 'nx', 'wt') };
|
|
90
|
+
}
|
|
91
|
+
function isInside(api, parent, child, caseInsensitive) {
|
|
92
|
+
const fold = (value) => (caseInsensitive ? value.toLowerCase() : value);
|
|
93
|
+
const relative = api.relative(fold(parent), fold(child));
|
|
94
|
+
const escapes = relative === '..' || relative.startsWith(`..${api.sep}`);
|
|
95
|
+
return relative === '' || (!escapes && !api.isAbsolute(relative));
|
|
96
|
+
}
|
|
97
|
+
/** Compute `<root>/<hash8>` and enforce length and out-of-repository rules. */
|
|
98
|
+
export function resolveStoryWorktreePath(input) {
|
|
99
|
+
const platform = normalizePlatform(input.platform ?? process.platform);
|
|
100
|
+
if (!platform)
|
|
101
|
+
return { ok: false, reasonCode: 'story-worktree-platform-unsupported' };
|
|
102
|
+
const api = pathApi(platform);
|
|
103
|
+
if (!/^[a-f0-9]{8}$/.test(input.hash8))
|
|
104
|
+
return { ok: false, reasonCode: 'story-worktree-identity-invalid' };
|
|
105
|
+
if (!api.isAbsolute(input.root) || !api.isAbsolute(input.repositoryRoot)) {
|
|
106
|
+
return { ok: false, reasonCode: 'story-worktree-root-invalid' };
|
|
107
|
+
}
|
|
108
|
+
const path = api.join(api.normalize(input.root), input.hash8);
|
|
109
|
+
if (platform === 'win32' && path.length > STORY_WORKTREE_WIN32_MAX_PATH) {
|
|
110
|
+
return { ok: false, reasonCode: 'story-worktree-path-too-long' };
|
|
111
|
+
}
|
|
112
|
+
const caseInsensitive = platform !== 'linux';
|
|
113
|
+
if (isInside(api, input.repositoryRoot, path, caseInsensitive)
|
|
114
|
+
|| isInside(api, path, input.repositoryRoot, caseInsensitive)) {
|
|
115
|
+
return { ok: false, reasonCode: 'story-worktree-path-inside-repository' };
|
|
116
|
+
}
|
|
117
|
+
return { ok: true, value: path };
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Create the private root (0700 on POSIX), refusing symlinked or non-directory
|
|
121
|
+
* segments that already exist under the deepest existing ancestor.
|
|
122
|
+
*/
|
|
123
|
+
export async function ensurePrivateStoryWorktreeRoot(root, platform = process.platform) {
|
|
124
|
+
const api = platform === 'win32' ? win32 : posix;
|
|
125
|
+
if (!api.isAbsolute(root))
|
|
126
|
+
return { ok: false, reasonCode: 'story-worktree-root-invalid' };
|
|
127
|
+
// Validate the two private leaf segments (`nx/wt` or the override itself).
|
|
128
|
+
const leaves = [api.dirname(root), root];
|
|
129
|
+
try {
|
|
130
|
+
await mkdir(root, { recursive: true, mode: 0o700 });
|
|
131
|
+
for (const segment of leaves) {
|
|
132
|
+
const info = await lstat(segment);
|
|
133
|
+
if (info.isSymbolicLink() || !info.isDirectory())
|
|
134
|
+
return { ok: false, reasonCode: 'story-worktree-root-unsafe' };
|
|
135
|
+
}
|
|
136
|
+
if (platform !== 'win32') {
|
|
137
|
+
await chmod(root, 0o700);
|
|
138
|
+
const info = await lstat(root);
|
|
139
|
+
if ((info.mode & 0o077) !== 0)
|
|
140
|
+
return { ok: false, reasonCode: 'story-worktree-root-unsafe' };
|
|
141
|
+
if (typeof process.getuid === 'function' && info.uid !== process.getuid()) {
|
|
142
|
+
return { ok: false, reasonCode: 'story-worktree-root-unsafe' };
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
return { ok: false, reasonCode: 'story-worktree-root-unsafe' };
|
|
148
|
+
}
|
|
149
|
+
return { ok: true, value: root };
|
|
150
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const SUBAGENT_APPROVAL_POLICY_SCHEMA_VERSION = 1;
|
|
2
2
|
export const SUBAGENT_APPROVAL_MANAGED_DEFAULT = 'max';
|
|
3
3
|
export const SUBAGENT_APPROVAL_EVIDENCE = '[P201-EV-MAX-POLICY]';
|
|
4
|
-
const TARGETS = new Set(['claude-code', 'cursor', 'vscode', 'gemini', 'codex', 'opencode', 'github-copilot-cli', 'kimi', 'antigravity', 'openclaw', 'grok', 'runner', 'unknown']);
|
|
4
|
+
const TARGETS = new Set(['claude-code', 'cursor', 'vscode', 'gemini', 'codex', 'opencode', 'github-copilot-cli', 'kimi', 'antigravity', 'openclaw', 'grok', 'deepseek', 'runner', 'unknown']);
|
|
5
5
|
const normalizeTarget = (value) => TARGETS.has(value) ? value : 'unknown';
|
|
6
6
|
const MATRIX = Object.freeze({
|
|
7
7
|
'claude-code': { status: 'validated', scope: 'child', fallbackMode: 'none', fallbackReasonCode: null },
|
|
@@ -15,6 +15,8 @@ const MATRIX = Object.freeze({
|
|
|
15
15
|
antigravity: { status: 'unvalidated', scope: 'inherited', fallbackMode: 'shell-loop', fallbackReasonCode: 'platform-child-unvalidated' },
|
|
16
16
|
grok: { status: 'unvalidated', scope: 'inherited', fallbackMode: 'shell-loop', fallbackReasonCode: 'platform-child-unvalidated' },
|
|
17
17
|
openclaw: { status: 'unsupported', scope: 'none', fallbackMode: 'root-inline', fallbackReasonCode: 'platform-child-unsupported' },
|
|
18
|
+
// P225.09 (RQ-05): DeepSeek Harness has no recorded delegation smoke.
|
|
19
|
+
deepseek: { status: 'unsupported', scope: 'none', fallbackMode: 'root-inline', fallbackReasonCode: 'platform-child-unsupported' },
|
|
18
20
|
runner: { status: 'unsupported', scope: 'none', fallbackMode: 'shell-loop', fallbackReasonCode: 'platform-child-unsupported' },
|
|
19
21
|
unknown: { status: 'unsupported', scope: 'none', fallbackMode: 'shell-loop', fallbackReasonCode: 'platform-target-unknown' },
|
|
20
22
|
});
|
|
@@ -4,7 +4,12 @@
|
|
|
4
4
|
* A child receives an independent Git index at a detached HEAD, but no branch
|
|
5
5
|
* and no Git worktree are created. Only the root applies the validated result
|
|
6
6
|
* and creates the single logical story commit on the epic branch.
|
|
7
|
+
*
|
|
8
|
+
* P225.09: v4 `client_managed_worktree` plans select the `story_worktree`
|
|
9
|
+
* strategy instead; its worktree is created by the client-owned
|
|
10
|
+
* `StoryWorktreeManager` (never by this module) and integrated root-only.
|
|
7
11
|
*/
|
|
12
|
+
import { type StoryWorktreeCreateInput, type StoryWorktreeLeaseValue, type StoryWorktreeResult } from '../../git/story-worktree-manager.js';
|
|
8
13
|
import type { StoryCommitCheckpoint } from '../../../../shared/dist/yoloop/branch-unit.js';
|
|
9
14
|
import type { YoloopPreparationBundleAdmission } from '../../../../shared/dist/yoloop/execution-plan.js';
|
|
10
15
|
import { type AnchoredDirectoryIdentity } from '../../git/secure-filesystem-boundary.js';
|
|
@@ -23,10 +28,17 @@ interface ContinuousContextSnapshot {
|
|
|
23
28
|
readonly path: string;
|
|
24
29
|
readonly content?: Buffer;
|
|
25
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* P225.09: `branchless_sandbox` (v3 continuous DAG, default and fallback) or
|
|
33
|
+
* `story_worktree` (v4 `client_managed_worktree` plans).
|
|
34
|
+
*/
|
|
35
|
+
export type ContinuousStoryWorkspaceStrategy = 'branchless_sandbox' | 'story_worktree';
|
|
26
36
|
export interface ContinuousStoryWorkspaceLease {
|
|
27
37
|
readonly projectRoot: string;
|
|
28
38
|
readonly workspacePath: string;
|
|
29
|
-
readonly workspaceStrategy:
|
|
39
|
+
readonly workspaceStrategy: ContinuousStoryWorkspaceStrategy;
|
|
40
|
+
/** P225.09: opaque `story-worktree` lease id; present only for `story_worktree`. */
|
|
41
|
+
readonly storyWorktreeLeaseId?: string;
|
|
30
42
|
readonly storyId: string;
|
|
31
43
|
readonly targetRef: string;
|
|
32
44
|
readonly epicId: string;
|
|
@@ -128,4 +140,40 @@ export declare function createAnchoredContinuousStoryCommandRunner(lease: Pick<C
|
|
|
128
140
|
}): HeadlessCommandRunner;
|
|
129
141
|
/** Default continuous-DAG workspace policy. It never creates a Git worktree. */
|
|
130
142
|
export declare function createBranchlessContinuousStoryWorkspaceManager(options?: ContinuousStoryWorkspaceManagerOptions): ContinuousStoryWorkspaceManager;
|
|
143
|
+
/** P225.09: minimal `StoryWorktreeManager` surface used by the runner strategy. */
|
|
144
|
+
export interface ContinuousStoryWorktreeProvider {
|
|
145
|
+
create(input: StoryWorktreeCreateInput): Promise<StoryWorktreeResult<StoryWorktreeLeaseValue>>;
|
|
146
|
+
}
|
|
147
|
+
export interface StoryWorktreeContinuousStoryWorkspaceManagerOptions {
|
|
148
|
+
/** Test/operator seam; production uses `new StoryWorktreeManager({ projectRoot })`. */
|
|
149
|
+
readonly storyWorktrees?: (projectRoot: string) => ContinuousStoryWorktreeProvider;
|
|
150
|
+
/** Deterministic adversarial seam immediately before a private lease write commit. */
|
|
151
|
+
readonly beforeSandboxWriteCommit?: ContinuousStoryWorkspaceManagerOptions['beforeSandboxWriteCommit'];
|
|
152
|
+
}
|
|
153
|
+
/** Root-only integration (P225.07): the runner strategy never commits on `epic/<ID>`. */
|
|
154
|
+
export declare const STORY_WORKTREE_INTEGRATION_ROOT_OWNED = "story-worktree-integration-root-owned";
|
|
155
|
+
/**
|
|
156
|
+
* P225.09 (AC4, ADR-4): `story_worktree` strategy for v4
|
|
157
|
+
* `client_managed_worktree` plans. It reuses the branchless dispatch lease
|
|
158
|
+
* (`leases/<dispatchId>/owner.json`) and returns the anchored workspace
|
|
159
|
+
* identity, so `createAnchoredContinuousStoryCommandRunner` runs the child
|
|
160
|
+
* inside the managed worktree unchanged. Integration stays root-only through
|
|
161
|
+
* `executeYoloopV4IntegrationOrder`; worktree removal stays with the
|
|
162
|
+
* client-owned `story-worktree` release/cleanup lifecycle.
|
|
163
|
+
*/
|
|
164
|
+
export declare function createStoryWorktreeContinuousStoryWorkspaceManager(options?: StoryWorktreeContinuousStoryWorkspaceManagerOptions): ContinuousStoryWorkspaceManager;
|
|
165
|
+
/**
|
|
166
|
+
* P225.09 (AC4): select the runner workspace strategy from the server plan.
|
|
167
|
+
* Only a server-authorized v4 `client_managed_worktree` plan selects
|
|
168
|
+
* `story_worktree`; every other plan keeps the v3 `branchless_sandbox`
|
|
169
|
+
* fallback.
|
|
170
|
+
*/
|
|
171
|
+
export declare function selectContinuousStoryWorkspaceStrategy(plan: unknown): ContinuousStoryWorkspaceStrategy;
|
|
172
|
+
export declare function selectContinuousStoryWorkspaceManager(plan: unknown, managers?: {
|
|
173
|
+
readonly branchless?: ContinuousStoryWorkspaceManager;
|
|
174
|
+
readonly storyWorktree?: ContinuousStoryWorkspaceManager;
|
|
175
|
+
}): {
|
|
176
|
+
readonly strategy: ContinuousStoryWorkspaceStrategy;
|
|
177
|
+
readonly manager: ContinuousStoryWorkspaceManager;
|
|
178
|
+
};
|
|
131
179
|
export {};
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
* A child receives an independent Git index at a detached HEAD, but no branch
|
|
5
5
|
* and no Git worktree are created. Only the root applies the validated result
|
|
6
6
|
* and creates the single logical story commit on the epic branch.
|
|
7
|
+
*
|
|
8
|
+
* P225.09: v4 `client_managed_worktree` plans select the `story_worktree`
|
|
9
|
+
* strategy instead; its worktree is created by the client-owned
|
|
10
|
+
* `StoryWorktreeManager` (never by this module) and integrated root-only.
|
|
7
11
|
*/
|
|
8
12
|
import { execFile, spawn } from 'node:child_process';
|
|
9
13
|
import { createHash, randomBytes } from 'node:crypto';
|
|
@@ -11,6 +15,7 @@ import { lstat, readFile, realpath, stat } from 'node:fs/promises';
|
|
|
11
15
|
import { basename, dirname, isAbsolute, join, relative, resolve } from 'node:path';
|
|
12
16
|
import { promisify } from 'node:util';
|
|
13
17
|
import { admitPreparedStoryBundle } from './prepared-story-bundle.js';
|
|
18
|
+
import { StoryWorktreeManager, } from '../../git/story-worktree-manager.js';
|
|
14
19
|
import { acquireGitLifecyclePhysicalIntegrationLock, assertGitLifecyclePrivateDirectory, assertGitLifecyclePrivateFile, applyGitLifecycleRuntimeOverlay, computeImmutableStoryQaEvidenceDigest, computeP205StoryQaEvidenceDigest, ensureGitLifecyclePrivateChildDirectory, ensureRuntimeEpic, ensureRuntimeStory, gitLifecycleRuntimeDirectory, mutateGitLifecycleRuntime, P205_COMPLETE_COMMAND, readGitLifecycleRuntime, releaseGitLifecyclePhysicalIntegrationLock, removeGitLifecyclePrivateDirectory, verifyAcceptedGitLifecycleStoryCheckpoint, verifyGitLifecyclePhysicalIntegrationLock, } from '../../git/git-lifecycle-store.js';
|
|
15
20
|
import { anchoredAtomicWriteFile, anchoredCreateDirectory, anchoredDirectoryIdentity, anchoredExecuteGit, anchoredEnsureDirectory, anchoredRemoveFile, } from '../../git/secure-filesystem-boundary.js';
|
|
16
21
|
import { GIT_LIFECYCLE_COMMIT_PUSH_STEP_ID, GIT_LIFECYCLE_REVIEW_PR_STEP_ID, } from '../../git/git-lifecycle-step-ids.js';
|
|
@@ -105,32 +110,10 @@ export function createBranchlessContinuousStoryWorkspaceManager(options = {}) {
|
|
|
105
110
|
const graphAuthority = await readCurrentGraphAuthoritySnapshot(projectRoot, input.epicId, input.storyId);
|
|
106
111
|
const graphAuthorityRevision = graphAuthority.revision;
|
|
107
112
|
const runtimeDirectory = await gitLifecycleRuntimeDirectory(projectRoot);
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
await assertGitLifecyclePrivateDirectory(leasePath, leasesRoot);
|
|
113
|
-
}
|
|
114
|
-
catch (error) {
|
|
115
|
-
if (!isNodeError(error, 'EEXIST'))
|
|
116
|
-
throw error;
|
|
117
|
-
await assertGitLifecyclePrivateDirectory(leasePath, leasesRoot);
|
|
118
|
-
const owner = await readLeaseOwner(leasePath, leasesRoot);
|
|
119
|
-
if (owner !== undefined && processExists(owner.pid))
|
|
120
|
-
return failure('continuous-sandbox-lease-active');
|
|
121
|
-
if (!owner || !(await removeGitLifecyclePrivateDirectory(leasePath, leasesRoot, async (renamed) => sameLeaseOwner(await readLeaseOwner(renamed, leasesRoot), owner))))
|
|
122
|
-
return failure('continuous-sandbox-lease-owner-replaced');
|
|
123
|
-
await anchoredCreateDirectory(leasesRoot, input.dispatchId);
|
|
124
|
-
await assertGitLifecyclePrivateDirectory(leasePath, leasesRoot);
|
|
125
|
-
}
|
|
126
|
-
acquiredLeasePath = leasePath;
|
|
127
|
-
acquiredLeaseOwner = Object.freeze({
|
|
128
|
-
pid: process.pid,
|
|
129
|
-
createdAt: new Date().toISOString(),
|
|
130
|
-
nonce: randomBytes(16).toString('hex'),
|
|
131
|
-
});
|
|
132
|
-
await writeOptional(leasePath, 'owner.json', Buffer.from(JSON.stringify(acquiredLeaseOwner)), options.beforeSandboxWriteCommit);
|
|
133
|
-
await assertGitLifecyclePrivateFile(join(leasePath, 'owner.json'), leasePath);
|
|
113
|
+
const dispatchLease = await acquireContinuousDispatchLease(runtimeDirectory, input.dispatchId, (leasePath, owner) => { acquiredLeasePath = leasePath; acquiredLeaseOwner = owner; }, options.beforeSandboxWriteCommit);
|
|
114
|
+
if (!dispatchLease.ok)
|
|
115
|
+
return dispatchLease;
|
|
116
|
+
const { leasePath } = dispatchLease.value;
|
|
134
117
|
const sandboxesRoot = await ensureGitLifecyclePrivateChildDirectory(runtimeDirectory, 'sandboxes');
|
|
135
118
|
const workspacePath = join(sandboxesRoot, input.dispatchId.slice(0, 20));
|
|
136
119
|
const recovered = await readSandboxMetadata(workspacePath, sandboxesRoot);
|
|
@@ -214,7 +197,7 @@ export function createBranchlessContinuousStoryWorkspaceManager(options = {}) {
|
|
|
214
197
|
dispatchId: input.dispatchId,
|
|
215
198
|
preparedAt,
|
|
216
199
|
leasePath,
|
|
217
|
-
leaseOwnerNonce:
|
|
200
|
+
leaseOwnerNonce: dispatchLease.value.owner.nonce,
|
|
218
201
|
workspaceOwnerNonce,
|
|
219
202
|
workspaceIdentity,
|
|
220
203
|
contextSnapshots,
|
|
@@ -583,6 +566,171 @@ export function createBranchlessContinuousStoryWorkspaceManager(options = {}) {
|
|
|
583
566
|
},
|
|
584
567
|
};
|
|
585
568
|
}
|
|
569
|
+
/** Root-only integration (P225.07): the runner strategy never commits on `epic/<ID>`. */
|
|
570
|
+
export const STORY_WORKTREE_INTEGRATION_ROOT_OWNED = 'story-worktree-integration-root-owned';
|
|
571
|
+
/**
|
|
572
|
+
* P225.09 (AC4, ADR-4): `story_worktree` strategy for v4
|
|
573
|
+
* `client_managed_worktree` plans. It reuses the branchless dispatch lease
|
|
574
|
+
* (`leases/<dispatchId>/owner.json`) and returns the anchored workspace
|
|
575
|
+
* identity, so `createAnchoredContinuousStoryCommandRunner` runs the child
|
|
576
|
+
* inside the managed worktree unchanged. Integration stays root-only through
|
|
577
|
+
* `executeYoloopV4IntegrationOrder`; worktree removal stays with the
|
|
578
|
+
* client-owned `story-worktree` release/cleanup lifecycle.
|
|
579
|
+
*/
|
|
580
|
+
export function createStoryWorktreeContinuousStoryWorkspaceManager(options = {}) {
|
|
581
|
+
const provider = options.storyWorktrees ?? ((projectRoot) => new StoryWorktreeManager({ projectRoot }));
|
|
582
|
+
let preparationTail = Promise.resolve();
|
|
583
|
+
return {
|
|
584
|
+
async prepare(input) {
|
|
585
|
+
if (!/^[a-f0-9]{64}$/.test(input.dispatchId))
|
|
586
|
+
return failure('continuous-sandbox-dispatch-invalid');
|
|
587
|
+
if (!safeRelativePath(input.targetRef))
|
|
588
|
+
return failure('continuous-sandbox-target-invalid');
|
|
589
|
+
if (!safeBranch(input.executionBranch))
|
|
590
|
+
return failure('continuous-execution-branch-invalid');
|
|
591
|
+
if (!/^[a-f0-9]{64}$/.test(input.graphRevision))
|
|
592
|
+
return failure('continuous-graph-revision-invalid');
|
|
593
|
+
const authorizedWriteSet = normalizeWriteSet(input.authorizedWriteSet);
|
|
594
|
+
if (authorizedWriteSet.length === 0 || authorizedWriteSet.length !== input.authorizedWriteSet.length) {
|
|
595
|
+
return failure('continuous-authorized-write-set-invalid');
|
|
596
|
+
}
|
|
597
|
+
const claimRevision = hashCanonical(authorizedWriteSet);
|
|
598
|
+
const previousPreparation = preparationTail;
|
|
599
|
+
let unlockPreparation = () => undefined;
|
|
600
|
+
preparationTail = new Promise((resolvePreparation) => { unlockPreparation = resolvePreparation; });
|
|
601
|
+
await previousPreparation;
|
|
602
|
+
let acquired;
|
|
603
|
+
try {
|
|
604
|
+
const projectRoot = await canonicalRoot(input.projectRoot);
|
|
605
|
+
const baseSha = await git(projectRoot, ['rev-parse', '--verify', `refs/heads/${input.executionBranch}^{commit}`]);
|
|
606
|
+
const graphAuthority = await readCurrentGraphAuthoritySnapshot(projectRoot, input.epicId, input.storyId);
|
|
607
|
+
const runtimeDirectory = await gitLifecycleRuntimeDirectory(projectRoot);
|
|
608
|
+
const dispatchLease = await acquireContinuousDispatchLease(runtimeDirectory, input.dispatchId, (leasePath, owner) => { acquired = { leasePath, owner }; }, options.beforeSandboxWriteCommit);
|
|
609
|
+
if (!dispatchLease.ok)
|
|
610
|
+
return dispatchLease;
|
|
611
|
+
const created = await provider(projectRoot).create({
|
|
612
|
+
epicId: input.epicId,
|
|
613
|
+
storyId: input.storyId,
|
|
614
|
+
dispatchId: input.dispatchId,
|
|
615
|
+
baseSha,
|
|
616
|
+
graphRevision: input.graphRevision,
|
|
617
|
+
});
|
|
618
|
+
if (!created.ok || !created.privatePath || !isAbsolute(created.privatePath)) {
|
|
619
|
+
// Preserve the provider reason code even if the lease release fails.
|
|
620
|
+
acquired = undefined;
|
|
621
|
+
await releaseContinuousDispatchLease(dispatchLease.value.leasePath, dispatchLease.value.owner.nonce)
|
|
622
|
+
.catch(() => undefined);
|
|
623
|
+
return failure(created.ok ? 'story-worktree-path-unavailable' : created.reasonCode);
|
|
624
|
+
}
|
|
625
|
+
const workspacePath = resolve(created.privatePath);
|
|
626
|
+
const workspaceIdentity = await anchoredDirectoryIdentity(workspacePath);
|
|
627
|
+
acquired = undefined;
|
|
628
|
+
return {
|
|
629
|
+
ok: true,
|
|
630
|
+
value: {
|
|
631
|
+
projectRoot,
|
|
632
|
+
workspacePath,
|
|
633
|
+
workspaceStrategy: 'story_worktree',
|
|
634
|
+
storyWorktreeLeaseId: created.value.lease.leaseId,
|
|
635
|
+
storyId: input.storyId,
|
|
636
|
+
targetRef: input.targetRef,
|
|
637
|
+
epicId: input.epicId,
|
|
638
|
+
executionBranch: input.executionBranch,
|
|
639
|
+
graphRevision: input.graphRevision,
|
|
640
|
+
graphAuthorityRevision: graphAuthority.revision,
|
|
641
|
+
graphAuthorityEpoch: graphAuthority.epoch,
|
|
642
|
+
graphAuthorityStoryStatus: graphAuthority.storyStatus,
|
|
643
|
+
authorizedWriteSet,
|
|
644
|
+
claimRevision,
|
|
645
|
+
baseSha: created.value.baseSha,
|
|
646
|
+
preparedAt: new Date().toISOString(),
|
|
647
|
+
dispatchId: input.dispatchId,
|
|
648
|
+
leasePath: dispatchLease.value.leasePath,
|
|
649
|
+
leaseOwnerNonce: dispatchLease.value.owner.nonce,
|
|
650
|
+
workspaceOwnerNonce: dispatchLease.value.owner.nonce,
|
|
651
|
+
workspaceIdentity,
|
|
652
|
+
contextSnapshots: [],
|
|
653
|
+
},
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
catch {
|
|
657
|
+
const pending = acquired;
|
|
658
|
+
if (pending)
|
|
659
|
+
await releaseContinuousDispatchLease(pending.leasePath, pending.owner.nonce).catch(() => undefined);
|
|
660
|
+
return failure('story-worktree-prepare-failed');
|
|
661
|
+
}
|
|
662
|
+
finally {
|
|
663
|
+
unlockPreparation();
|
|
664
|
+
}
|
|
665
|
+
},
|
|
666
|
+
async integrate(lease) {
|
|
667
|
+
if (lease.workspaceStrategy !== 'story_worktree')
|
|
668
|
+
return failure('continuous-workspace-strategy-mismatch');
|
|
669
|
+
return failure(STORY_WORKTREE_INTEGRATION_ROOT_OWNED);
|
|
670
|
+
},
|
|
671
|
+
async release(lease) {
|
|
672
|
+
// The managed worktree is preserved for root integration (P225.07) and
|
|
673
|
+
// client-owned cleanup (P225.05/.06); only the dispatch lease ends here.
|
|
674
|
+
await releaseContinuousDispatchLease(lease.leasePath, lease.leaseOwnerNonce);
|
|
675
|
+
},
|
|
676
|
+
};
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* P225.09 (AC4): select the runner workspace strategy from the server plan.
|
|
680
|
+
* Only a server-authorized v4 `client_managed_worktree` plan selects
|
|
681
|
+
* `story_worktree`; every other plan keeps the v3 `branchless_sandbox`
|
|
682
|
+
* fallback.
|
|
683
|
+
*/
|
|
684
|
+
export function selectContinuousStoryWorkspaceStrategy(plan) {
|
|
685
|
+
const record = plan && typeof plan === 'object' && !Array.isArray(plan) ? plan : undefined;
|
|
686
|
+
return record?.version === 4 && record.mode === 'two_phase_worktree_dag'
|
|
687
|
+
&& record.authorization === 'server_authorized'
|
|
688
|
+
&& record.workspaceMechanism === 'client_managed_worktree'
|
|
689
|
+
? 'story_worktree'
|
|
690
|
+
: 'branchless_sandbox';
|
|
691
|
+
}
|
|
692
|
+
export function selectContinuousStoryWorkspaceManager(plan, managers = {}) {
|
|
693
|
+
const strategy = selectContinuousStoryWorkspaceStrategy(plan);
|
|
694
|
+
return strategy === 'story_worktree'
|
|
695
|
+
? { strategy, manager: managers.storyWorktree ?? createStoryWorktreeContinuousStoryWorkspaceManager() }
|
|
696
|
+
: { strategy, manager: managers.branchless ?? createBranchlessContinuousStoryWorkspaceManager() };
|
|
697
|
+
}
|
|
698
|
+
/** Exclusive per-dispatch lease shared by both runner workspace strategies. */
|
|
699
|
+
async function acquireContinuousDispatchLease(runtimeDirectory, dispatchId, onAcquired, beforeCommit) {
|
|
700
|
+
const leasesRoot = await ensureGitLifecyclePrivateChildDirectory(runtimeDirectory, 'leases');
|
|
701
|
+
const leasePath = join(leasesRoot, dispatchId);
|
|
702
|
+
try {
|
|
703
|
+
await anchoredCreateDirectory(leasesRoot, dispatchId);
|
|
704
|
+
await assertGitLifecyclePrivateDirectory(leasePath, leasesRoot);
|
|
705
|
+
}
|
|
706
|
+
catch (error) {
|
|
707
|
+
if (!isNodeError(error, 'EEXIST'))
|
|
708
|
+
throw error;
|
|
709
|
+
await assertGitLifecyclePrivateDirectory(leasePath, leasesRoot);
|
|
710
|
+
const owner = await readLeaseOwner(leasePath, leasesRoot);
|
|
711
|
+
if (owner !== undefined && processExists(owner.pid))
|
|
712
|
+
return failure('continuous-sandbox-lease-active');
|
|
713
|
+
if (!owner || !(await removeGitLifecyclePrivateDirectory(leasePath, leasesRoot, async (renamed) => sameLeaseOwner(await readLeaseOwner(renamed, leasesRoot), owner))))
|
|
714
|
+
return failure('continuous-sandbox-lease-owner-replaced');
|
|
715
|
+
await anchoredCreateDirectory(leasesRoot, dispatchId);
|
|
716
|
+
await assertGitLifecyclePrivateDirectory(leasePath, leasesRoot);
|
|
717
|
+
}
|
|
718
|
+
const owner = Object.freeze({
|
|
719
|
+
pid: process.pid,
|
|
720
|
+
createdAt: new Date().toISOString(),
|
|
721
|
+
nonce: randomBytes(16).toString('hex'),
|
|
722
|
+
});
|
|
723
|
+
onAcquired(leasePath, owner);
|
|
724
|
+
await writeOptional(leasePath, 'owner.json', Buffer.from(JSON.stringify(owner)), beforeCommit);
|
|
725
|
+
await assertGitLifecyclePrivateFile(join(leasePath, 'owner.json'), leasePath);
|
|
726
|
+
return { ok: true, value: { leasePath, owner } };
|
|
727
|
+
}
|
|
728
|
+
async function releaseContinuousDispatchLease(leasePath, ownerNonce) {
|
|
729
|
+
await removeGitLifecyclePrivateDirectory(leasePath, dirname(leasePath), async (renamed) => {
|
|
730
|
+
const owner = await readLeaseOwner(renamed, dirname(leasePath)).catch(() => undefined);
|
|
731
|
+
return owner?.nonce === ownerNonce;
|
|
732
|
+
});
|
|
733
|
+
}
|
|
586
734
|
async function copyCurrentContext(projectRoot, workspacePath, epicId, targetRef, beforeCommit) {
|
|
587
735
|
const paths = [...new Set(['.neocortex/state.json', targetRef, `docs/epics/epic-${safeRef(epicId)}.md`])];
|
|
588
736
|
const snapshots = [];
|
|
@@ -10,6 +10,7 @@ import { HeadlessAdapterRegistry } from './adapters.js';
|
|
|
10
10
|
import { type HeadlessAdapterExecutionOptions, type HeadlessAdapterId, type HeadlessRedactionEvidence } from './types.js';
|
|
11
11
|
import { type ContinuousStoryWorkspaceManager } from './continuous-story-workspace.js';
|
|
12
12
|
import { type EpicTerminalGitAdapter } from './epic-terminal-git-runner.js';
|
|
13
|
+
import { type IntegrateStoryWorktreesInOrderOptions, type StoryWorktreeDependentSyncResult, type StoryWorktreeOrderedIntegrationSummary } from '../../git/story-worktree-integration.js';
|
|
13
14
|
import { type ReleaseBlockedResultV1 } from '../../../../shared/dist/yoloop/release-blocked.js';
|
|
14
15
|
export type { ContinuousStoryWorkspaceManager } from './continuous-story-workspace.js';
|
|
15
16
|
export declare const DEFAULT_HEADLESS_YOLOOP_MAX_ITERATIONS = 20;
|
|
@@ -83,7 +84,17 @@ export interface RunYoloopExecutionPhaseOptions {
|
|
|
83
84
|
readonly serverUrl?: string;
|
|
84
85
|
readonly continuousWorkspaceManager?: ContinuousStoryWorkspaceManager;
|
|
85
86
|
readonly terminalGitAdapter?: EpicTerminalGitAdapter;
|
|
87
|
+
/**
|
|
88
|
+
* P225.06 orphan sweep run once before scheduling (best-effort; refusals
|
|
89
|
+
* become reason codes, never a phase failure). `false` disables it.
|
|
90
|
+
*/
|
|
91
|
+
readonly storyWorktreeSweeper?: RunYoloopStoryWorktreeSweeper | false;
|
|
92
|
+
/** P225.06 opt-in: sweep once on SIGINT/SIGTERM, then re-raise the signal. */
|
|
93
|
+
readonly storyWorktreeSignalSweep?: boolean;
|
|
86
94
|
}
|
|
95
|
+
export type RunYoloopStoryWorktreeSweeper = (projectRoot: string) => Promise<{
|
|
96
|
+
readonly reasonCodes: readonly string[];
|
|
97
|
+
}>;
|
|
87
98
|
export interface RunYoloopAggregateCounts {
|
|
88
99
|
readonly iterations: number;
|
|
89
100
|
readonly childCount: number;
|
|
@@ -134,6 +145,34 @@ export interface RunYoloopExecutionPhaseSummary {
|
|
|
134
145
|
readonly reasonCodes: readonly string[];
|
|
135
146
|
readonly publicSafe: true;
|
|
136
147
|
}
|
|
148
|
+
/** P225.07: root-owned integration step for a server-authorized v4 plan. */
|
|
149
|
+
export interface YoloopV4IntegrationOrderOptions {
|
|
150
|
+
readonly projectRoot: string;
|
|
151
|
+
/** Stories whose phase 2 finished (C08 on their temporary branch). */
|
|
152
|
+
readonly readyStoryIds: readonly string[];
|
|
153
|
+
/** Server `DependencyReleaseDirective`s to apply after the integrations. */
|
|
154
|
+
readonly releaseDirectives?: readonly unknown[];
|
|
155
|
+
readonly push?: boolean;
|
|
156
|
+
readonly remote?: string;
|
|
157
|
+
readonly integrateInOrder?: (options: IntegrateStoryWorktreesInOrderOptions) => Promise<StoryWorktreeOrderedIntegrationSummary>;
|
|
158
|
+
readonly syncDependents?: (input: {
|
|
159
|
+
readonly projectRoot: string;
|
|
160
|
+
readonly directives: readonly unknown[];
|
|
161
|
+
}) => Promise<readonly StoryWorktreeDependentSyncResult[]>;
|
|
162
|
+
}
|
|
163
|
+
export interface YoloopV4IntegrationOrderSummary {
|
|
164
|
+
readonly ok: boolean;
|
|
165
|
+
readonly reasonCode?: string;
|
|
166
|
+
readonly integration?: StoryWorktreeOrderedIntegrationSummary;
|
|
167
|
+
readonly synced: readonly StoryWorktreeDependentSyncResult[];
|
|
168
|
+
readonly publicSafe: true;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* P225.07-ADR-8: validate the v4 integration fields (root-owned, one
|
|
172
|
+
* integrator) and integrate in `integrationOrder`, then sync released
|
|
173
|
+
* dependents. Phase dispatch of v4 children is wired by P225.09.
|
|
174
|
+
*/
|
|
175
|
+
export declare function executeYoloopV4IntegrationOrder(plan: unknown, options: YoloopV4IntegrationOrderOptions): Promise<YoloopV4IntegrationOrderSummary>;
|
|
137
176
|
export declare function isCanonicalDelegatedStoryPrompt(prompt: string): boolean;
|
|
138
177
|
export declare function defaultYoloopRootInvoker(input: RunYoloopRootInvokeInput, invokeTransport?: RunYoloopRootInvokeTransport): Promise<RunYoloopRootInvokeResult>;
|
|
139
178
|
export declare function runYoloopExecutionPhase(options: RunYoloopExecutionPhaseOptions): Promise<RunYoloopExecutionPhaseSummary>;
|