@try-works/dsh-recursive-mode 0.1.3 → 0.1.5
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/cordis.patch.yml +15 -10
- package/lib/bootstrap.d.ts +9 -2
- package/lib/client/apply-guard.d.ts +14 -0
- package/lib/client/board.d.ts +5 -4
- package/lib/client/contract.d.ts +57 -24
- package/lib/client/host-api.d.ts +26 -0
- package/lib/client/index.d.ts +16 -9
- package/lib/client/inspector.d.ts +3 -3
- package/lib/client/slots.d.ts +4 -6
- package/lib/client/strip.d.ts +4 -3
- package/lib/client/use-live.d.ts +9 -0
- package/lib/client.js +252 -174
- package/lib/fs-intent.d.ts +34 -0
- package/lib/index.d.ts +12 -11
- package/lib/index.js +1008 -4507
- package/lib/init-templates.d.ts +41 -0
- package/lib/live-route.d.ts +69 -0
- package/lib/phase-rules.d.ts +34 -0
- package/lib/policy.d.ts +1 -1
- package/lib/runtime.d.ts +24 -17
- package/lib/snapshot.d.ts +11 -0
- package/package.json +4 -3
- package/preset/recursive/agent.cordis.yml +7 -4
- package/preset/recursive/preset.yml +1 -1
- package/references/agents-block.md +95 -0
- package/references/artifact-template.md +2574 -0
- package/references/bodies/claude.md +7 -0
- package/references/bodies/codex-agents.md +95 -0
- package/references/bodies/copilot.md +7 -0
- package/references/bodies/cursorrules.md +7 -0
- package/references/bodies/decisions.md +5 -0
- package/references/bodies/delegated-verification.md +49 -0
- package/references/bodies/memory-router.md +45 -0
- package/references/bodies/phase8-skill-memory.md +48 -0
- package/references/bodies/plans-bridge.md +43 -0
- package/references/bodies/recursive-agents-router.md +64 -0
- package/references/bodies/skill-discovery.md +51 -0
- package/references/bodies/skill-memory-router.md +42 -0
- package/references/bodies/state.md +5 -0
- package/references/bootstrap/RECURSIVE.md +2362 -0
- package/references/scripts/__pycache__/recursive_phase_rules.cpython-314.pyc +0 -0
- package/references/scripts/lint-recursive-run.ps1 +25 -0
- package/references/scripts/lint-recursive-run.py +2870 -0
- package/references/scripts/recursive-closeout.ps1 +38 -0
- package/references/scripts/recursive-closeout.py +541 -0
- package/references/scripts/recursive-init.ps1 +515 -0
- package/references/scripts/recursive-init.py +356 -0
- package/references/scripts/recursive-lock.ps1 +26 -0
- package/references/scripts/recursive-lock.py +302 -0
- package/references/scripts/recursive-review-bundle.ps1 +58 -0
- package/references/scripts/recursive-review-bundle.py +503 -0
- package/references/scripts/recursive-router-cli-configure.ps1 +2 -0
- package/references/scripts/recursive-router-cli-configure.py +9 -0
- package/references/scripts/recursive-router-cli-init.ps1 +2 -0
- package/references/scripts/recursive-router-cli-init.py +9 -0
- package/references/scripts/recursive-router-cli-invoke.ps1 +2 -0
- package/references/scripts/recursive-router-cli-invoke.py +9 -0
- package/references/scripts/recursive-router-cli-probe.ps1 +2 -0
- package/references/scripts/recursive-router-cli-probe.py +9 -0
- package/references/scripts/recursive-router-cli-resolve.ps1 +2 -0
- package/references/scripts/recursive-router-cli-resolve.py +9 -0
- package/references/scripts/recursive-router-cli-validate.ps1 +2 -0
- package/references/scripts/recursive-router-cli-validate.py +9 -0
- package/references/scripts/recursive-router-configure.ps1 +27 -0
- package/references/scripts/recursive-router-configure.py +74 -0
- package/references/scripts/recursive-router-init.ps1 +17 -0
- package/references/scripts/recursive-router-init.py +29 -0
- package/references/scripts/recursive-router-invoke.ps1 +47 -0
- package/references/scripts/recursive-router-invoke.py +103 -0
- package/references/scripts/recursive-router-probe.ps1 +25 -0
- package/references/scripts/recursive-router-probe.py +44 -0
- package/references/scripts/recursive-router-resolve.ps1 +26 -0
- package/references/scripts/recursive-router-resolve.py +46 -0
- package/references/scripts/recursive-router-validate.ps1 +17 -0
- package/references/scripts/recursive-router-validate.py +27 -0
- package/references/scripts/recursive-status.ps1 +23 -0
- package/references/scripts/recursive-status.py +2124 -0
- package/references/scripts/recursive-subagent-action.ps1 +98 -0
- package/references/scripts/recursive-subagent-action.py +197 -0
- package/references/scripts/recursive-training-extract.ps1 +23 -0
- package/references/scripts/recursive-training-extract.py +99 -0
- package/references/scripts/recursive-training-grpo.ps1 +52 -0
- package/references/scripts/recursive-training-grpo.py +1341 -0
- package/references/scripts/recursive-training-loader.ps1 +78 -0
- package/references/scripts/recursive-training-loader.py +558 -0
- package/references/scripts/recursive-training-mcp.ps1 +29 -0
- package/references/scripts/recursive-training-mcp.py +261 -0
- package/references/scripts/recursive-training-phase8-trigger.ps1 +55 -0
- package/references/scripts/recursive-training-phase8-trigger.py +137 -0
- package/references/scripts/recursive-training-sync.ps1 +29 -0
- package/references/scripts/recursive-training-sync.py +183 -0
- package/references/scripts/recursive_phase_rules.py +367 -0
- package/references/scripts/recursive_router_cli_lib.py +2 -0
- package/references/scripts/recursive_router_lib.py +2282 -0
- package/references/scripts/verify-locks.ps1 +25 -0
- package/references/scripts/verify-locks.py +353 -0
- package/scripts/__pycache__/lint-recursive-run.cpython-314.pyc +0 -0
- package/scripts/__pycache__/recursive_phase_rules.cpython-314.pyc +0 -0
- package/scripts/install-preset.cmd +7 -0
- package/scripts/install-preset.js +101 -0
- package/scripts/lint-recursive-run.py +7 -5
- package/scripts/test-recursive-mode-smoke.ts +29 -28
- package/src/bootstrap.ts +253 -39
- package/src/client/apply-guard.ts +23 -0
- package/src/client/board.tsx +0 -0
- package/src/client/contract.ts +72 -24
- package/src/client/host-api.ts +90 -0
- package/src/client/index.ts +22 -11
- package/src/client/inspector.tsx +7 -9
- package/src/client/slots.ts +70 -26
- package/src/client/strip.tsx +9 -9
- package/src/client/use-live.ts +52 -0
- package/src/fs-intent.ts +84 -0
- package/src/index.ts +100 -155
- package/src/init-templates.ts +276 -0
- package/src/live-route.ts +163 -0
- package/src/phase-rules.ts +262 -0
- package/src/policy.ts +29 -5
- package/src/runtime.ts +129 -77
- package/src/snapshot.ts +104 -0
- package/lib/client/node.d.ts +0 -71
- package/lib/events.d.ts +0 -173
- package/lib/projection.d.ts +0 -29
- package/src/client/node.ts +0 -156
- package/src/events.ts +0 -173
- package/src/projection.ts +0 -237
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export interface GitContext {
|
|
2
|
+
baselineType: string;
|
|
3
|
+
baselineReference: string;
|
|
4
|
+
comparisonReference: string;
|
|
5
|
+
normalizedBaseline: string;
|
|
6
|
+
normalizedComparison: string;
|
|
7
|
+
normalizedDiffCommand: string;
|
|
8
|
+
baseBranch: string;
|
|
9
|
+
worktreeBranch: string;
|
|
10
|
+
baseCommit: string;
|
|
11
|
+
notes: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* detect_git_context(): canonical parity. Returns {context, error} — never
|
|
15
|
+
* throws on missing git; error is surfaced in the worktree template note.
|
|
16
|
+
*/
|
|
17
|
+
export declare function detectGitContext(repoRoot: string): {
|
|
18
|
+
context: Partial<GitContext>;
|
|
19
|
+
error: string | null;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* requirements_content(run_id, template, from_issue): byte-identical to the
|
|
23
|
+
* canonical recursive-init.py function (LF, template flavor in Scope note).
|
|
24
|
+
*/
|
|
25
|
+
export declare function requirementsContent(runId: string, template?: string, fromIssue?: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* worktree_content(run_id, repo_root, git_context, prefill_error): byte-identical
|
|
28
|
+
* to the canonical recursive-init.py function.
|
|
29
|
+
*/
|
|
30
|
+
export declare function worktreeContent(runId: string, repoRoot: string, git: Partial<GitContext>, prefillError: string | null): string;
|
|
31
|
+
/**
|
|
32
|
+
* Later-phase template: required sections (canonical get_artifact_required_
|
|
33
|
+
* sections) as ## headings + TODO + FAIL gates. Structural scaffold: the phase
|
|
34
|
+
* author fills each section; lint stays FAIL until Coverage/Approval are set.
|
|
35
|
+
*/
|
|
36
|
+
export declare function laterPhaseContent(runId: string, fileName: string, workflowProfile?: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* Scaffold dirs under a run (addenda/subagents/router-prompts/evidence + subs).
|
|
39
|
+
* Mirrors canonical recursive-init.py's ensure_directory sequence.
|
|
40
|
+
*/
|
|
41
|
+
export declare const RUN_SCAFFOLD_DIRS: string[];
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Live recursive board/strip route (SP2 R1): host HTTP + SSE serving the
|
|
3
|
+
* filesystem fold, keyed per-WORKSPACE. The board/strip read this instead of
|
|
4
|
+
* useProjection('recursive'); cold resume and every GET are a fresh fs read.
|
|
5
|
+
*
|
|
6
|
+
* Keying (creator steer): the client passes its session cwd verbatim; the HOST
|
|
7
|
+
* resolves the recursive control-plane root server-side (cwd == workspace root,
|
|
8
|
+
* cwd == subdir, cwd == repo root). Multiple sessions in one workspace collapse
|
|
9
|
+
* to one fold; a workspace switch shows the new root.
|
|
10
|
+
*
|
|
11
|
+
* R9 read-only: GET state + GET events only. No POST/action route; the client
|
|
12
|
+
* never mutates the host.
|
|
13
|
+
*
|
|
14
|
+
* Registration is mountOnce-global because apply() runs PER-SESSION while
|
|
15
|
+
* WebServer.register throws on a duplicate (kind, path). The first mount wins;
|
|
16
|
+
* later mounts no-op (the state is per-workspace, so per-session registration
|
|
17
|
+
* would be both wrong and a crash).
|
|
18
|
+
*/
|
|
19
|
+
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
20
|
+
import type { RecursiveProjection } from './types.ts';
|
|
21
|
+
/** API prefix the board/strip fetch. */
|
|
22
|
+
export declare const RECURSIVE_API_PREFIX = "/.recursive/api";
|
|
23
|
+
/** The host seam the route builder needs: root resolution + the fs fold + a revision. */
|
|
24
|
+
export interface RecursiveRouteHost {
|
|
25
|
+
/**
|
|
26
|
+
* Resolve the recursive control-plane root. sessionId is PRIMARY (the host
|
|
27
|
+
* prefers the attached session header cwd — never trusts a client path); cwd
|
|
28
|
+
* is a fallback hint only while the session is hydrating / for headless callers.
|
|
29
|
+
*/
|
|
30
|
+
resolveRoot(sessionId: string | undefined, cwd: string): Promise<string | null>;
|
|
31
|
+
/** Fresh filesystem fold for one workspace root (per-workspace state). */
|
|
32
|
+
snapshot(root: string): Promise<RecursiveProjection> | RecursiveProjection;
|
|
33
|
+
/** Monotone revision; bump whenever the fs fold changes (SSE frame + state). */
|
|
34
|
+
revision(root: string): number;
|
|
35
|
+
}
|
|
36
|
+
/** The state payload the board/strip read. */
|
|
37
|
+
export interface RecursiveStatePayload {
|
|
38
|
+
root: string | null;
|
|
39
|
+
projection: RecursiveProjection;
|
|
40
|
+
revision: number;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Build the two read-only routes. Returns [state, events] in registration order.
|
|
44
|
+
* @param host - the resolved-root + fs-fold seam (the RecursiveRuntime adapter).
|
|
45
|
+
*/
|
|
46
|
+
export declare function makeRecursiveRoutes(host: RecursiveRouteHost): readonly {
|
|
47
|
+
kind: 'exact';
|
|
48
|
+
path: string;
|
|
49
|
+
handler: (req: IncomingMessage, res: ServerResponse) => void | Promise<void>;
|
|
50
|
+
}[];
|
|
51
|
+
export interface WebServerLike {
|
|
52
|
+
register(route: {
|
|
53
|
+
kind: string;
|
|
54
|
+
path: string;
|
|
55
|
+
handler: unknown;
|
|
56
|
+
}): () => void;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* mountOnce wrapper for the route registration. Returns the disposer of the
|
|
60
|
+
* registration (or a no-op for a later mount).
|
|
61
|
+
* @param packageName - npm package identity (every install source shares it).
|
|
62
|
+
* @param makeRoutes - builds the routes (called once, on the first mount).
|
|
63
|
+
* @param webServer - the host webserver service (or a structural fake).
|
|
64
|
+
*/
|
|
65
|
+
export declare function mountRecursiveRoutesOnce(packageName: string, makeRoutes: () => readonly {
|
|
66
|
+
kind: string;
|
|
67
|
+
path: string;
|
|
68
|
+
handler: unknown;
|
|
69
|
+
}[], webServer: WebServerLike): () => void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase rules (R5): canonical parity port of lint-recursive-run.py's
|
|
3
|
+
* get_artifact_required_sections + workflow/audit constants. Single source of
|
|
4
|
+
* truth for per-phase required section headings and audit extras; consumed by
|
|
5
|
+
* initRun templates, renderRecursivePolicy, and the pre-step lint-rules
|
|
6
|
+
* injection. Values are byte-identical to the canonical linter (recursive-
|
|
7
|
+
* mode-audit-v2).
|
|
8
|
+
*/
|
|
9
|
+
export declare const CURRENT_WORKFLOW_PROFILE = "recursive-mode-audit-v2";
|
|
10
|
+
export declare const STRICT_WORKFLOW_PROFILE = "recursive-mode-audit-v1";
|
|
11
|
+
export declare const COMPAT_WORKFLOW_PROFILE = "memory-phase8";
|
|
12
|
+
export declare const STRICT_WORKFLOW_PROFILES: Set<string>;
|
|
13
|
+
export declare const LATE_PHASE_ARTIFACTS: string[];
|
|
14
|
+
export declare const AUDITED_PHASE_FILES: Set<string>;
|
|
15
|
+
export declare const PRIOR_RECURSIVE_EVIDENCE_FILES: Set<string>;
|
|
16
|
+
export declare const DIFF_AUDITED_FILES: Set<string>;
|
|
17
|
+
export declare const TRACEABILITY_REQUIRED_FILES: Set<string>;
|
|
18
|
+
export declare const AUDIT_REQUIRED_HEADINGS: string[];
|
|
19
|
+
export declare const DIFF_BASIS_FIELDS: string[];
|
|
20
|
+
/**
|
|
21
|
+
* get_artifact_required_sections(file_name, workflow_profile): canonical-parity
|
|
22
|
+
* required section headings for a phase artifact. Defaults to TODO + Coverage
|
|
23
|
+
* Gate + Approval Gate for unknown files. Audited phases in strict profiles get
|
|
24
|
+
* the audit headings appended (plus Prior Recursive Evidence Reviewed for the
|
|
25
|
+
* prior-evidence file set).
|
|
26
|
+
*/
|
|
27
|
+
export declare function getArtifactRequiredSections(fileName: string, workflowProfile?: string): string[];
|
|
28
|
+
/**
|
|
29
|
+
* Compact lint-rules message for the pre-step injection (R5): this phase's
|
|
30
|
+
* required sections + phase-specific gate notes, derived from the canonical
|
|
31
|
+
* artifact-template sections. Kept short enough to prepend as a system-style
|
|
32
|
+
* reminder without bloating the step context.
|
|
33
|
+
*/
|
|
34
|
+
export declare function phaseLintRulesMessage(fileName: string, workflowProfile?: string): string;
|
package/lib/policy.d.ts
CHANGED
package/lib/runtime.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ import { type SubagentProviderLike, type RouteDecision, type CapabilityProbe } f
|
|
|
7
7
|
import { type SubagentsRuntimeLike, type SubagentStartRequestLike, type SubagentResultLike, type Reference } from './delegation.ts';
|
|
8
8
|
import { type PhaseTransitionIntent, type SessionEventLike, type RecursivePhaseState, type GateCheckResult } from './lifecycle.ts';
|
|
9
9
|
import { type EnforcementConfig, type PreStepGateDecision, type ToolGuardDecision, type ToolExecLike } from './enforcement.ts';
|
|
10
|
-
import { type RecursiveEventLike, type RecursiveFoldState } from './projection.ts';
|
|
11
10
|
declare module '@deepseek-ai/cordis' {
|
|
12
11
|
interface Context {
|
|
13
12
|
recursive: RecursiveRuntime;
|
|
@@ -154,11 +153,19 @@ export declare class RecursiveRuntime extends Service {
|
|
|
154
153
|
};
|
|
155
154
|
} | null): Promise<string | null>;
|
|
156
155
|
/**
|
|
157
|
-
*
|
|
158
|
-
*
|
|
159
|
-
* the
|
|
156
|
+
* SP2 R1 route adapter: resolve the control-plane root for the live route.
|
|
157
|
+
* sessionId PRIMARY — the host looks up the attached session header cwd and
|
|
158
|
+
* resolves the root from THAT; the client-passed cwd is a fallback hint only
|
|
159
|
+
* (hydration / headless callers). Two sessions in one workspace collapse to
|
|
160
|
+
* one root; a subdir cwd resolves up to the workspace root.
|
|
160
161
|
*/
|
|
161
|
-
|
|
162
|
+
resolveRootForRoute(sessionId: string | undefined, cwd: string, sessionsStore?: {
|
|
163
|
+
get?: (id: string) => {
|
|
164
|
+
header?: {
|
|
165
|
+
cwd?: string;
|
|
166
|
+
};
|
|
167
|
+
} | undefined;
|
|
168
|
+
} | null): Promise<string | null>;
|
|
162
169
|
status(runId?: string, agent?: {
|
|
163
170
|
session?: {
|
|
164
171
|
header?: {
|
|
@@ -167,8 +174,12 @@ export declare class RecursiveRuntime extends Service {
|
|
|
167
174
|
};
|
|
168
175
|
} | null): Promise<RecursiveStatusResult | null>;
|
|
169
176
|
/**
|
|
170
|
-
* Scaffold a run directory with
|
|
171
|
-
*
|
|
177
|
+
* Scaffold a run directory with FULL per-phase templates (no-op if exists).
|
|
178
|
+
* 00-requirements.md + 00-worktree.md are byte-identical to canonical
|
|
179
|
+
* recursive-init.py (incl. git-context prefill); later phases carry every
|
|
180
|
+
* required section (get_artifact_required_sections) + TODO + FAIL gates.
|
|
181
|
+
* Also scaffolds addenda/subagents/router-prompts/evidence dirs. Returns the
|
|
182
|
+
* run dir + created artifacts.
|
|
172
183
|
*/
|
|
173
184
|
initRun(runId: string, agent?: {
|
|
174
185
|
session?: {
|
|
@@ -196,8 +207,12 @@ export declare class RecursiveRuntime extends Service {
|
|
|
196
207
|
/** Reopen a LOCKED artifact to DRAFT (delete LockedAt/LockHash, invalidate downstream receipts). */
|
|
197
208
|
private reopenArtifact;
|
|
198
209
|
/**
|
|
199
|
-
* Lint an artifact
|
|
200
|
-
*
|
|
210
|
+
* Lint an artifact with FULL canonical parity: shells out to the vendored
|
|
211
|
+
* lint-recursive-run.py (byte-identical to canonical) and parses its
|
|
212
|
+
* [FAIL]/[WARN] lines + Summary counts. `errors` = FAIL lines, `warnings` =
|
|
213
|
+
* WARN lines, `passed` = no FAIL (WARN-only passes, matching the canonical
|
|
214
|
+
* non-strict verdict). Falls back to the structural check only if the vendored
|
|
215
|
+
* script is unavailable (e.g. bundled lib without references/).
|
|
201
216
|
*/
|
|
202
217
|
lintArtifact(runId: string, artifact?: string, agent?: {
|
|
203
218
|
session?: {
|
|
@@ -227,14 +242,6 @@ export declare class RecursiveRuntime extends Service {
|
|
|
227
242
|
code: string;
|
|
228
243
|
message: string;
|
|
229
244
|
}): boolean;
|
|
230
|
-
/** Phase D R1: append a recursive/* event through the host session adapter (worktree-keyed). */
|
|
231
|
-
emitRecursiveEvent(session: unknown, type: string, data: Record<string, unknown>): void;
|
|
232
|
-
/** Phase D R2/R9: fold a session log into the worktree-grouped projection. */
|
|
233
|
-
foldRecursiveProjection(events: readonly RecursiveEventLike[], workspaceRoot?: string): RecursiveFoldState;
|
|
234
|
-
/** Phase D R2: the registered projection unit (key 'recursive'). */
|
|
235
|
-
get projectionUnit(): import("@deepseek-ai/dsh-session-projection").ProjectionDefinition<"recursive", RecursiveFoldState>;
|
|
236
|
-
/** Phase D R9: whether a worktreeRoot is inside the workspace control-plane root. */
|
|
237
|
-
isInsideWorkspace(worktreeRoot: string, workspaceRoot: string): boolean;
|
|
238
245
|
/** Phase C R7: resolve the enforcement config (strict|advisory, default advisory). */
|
|
239
246
|
get enforcementConfig(): EnforcementConfig;
|
|
240
247
|
setEnforcementConfig(config: unknown): EnforcementConfig;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RecursiveProjection, RecursiveRunCard } from './types.ts';
|
|
2
|
+
/**
|
|
3
|
+
* Fold one run directory into a RecursiveRunCard (the wire shape the board renders).
|
|
4
|
+
* Runs that no longer exist on disk are omitted (the fs is the source of truth).
|
|
5
|
+
*/
|
|
6
|
+
export declare function foldRunCard(runDir: string, runId: string, worktreeRoot: string): RecursiveRunCard;
|
|
7
|
+
/**
|
|
8
|
+
* Fold every run under <root>/.recursive/run/ into the projection, grouped by
|
|
9
|
+
* worktree root then runId. A fresh fs read on every call (cold-resume live).
|
|
10
|
+
*/
|
|
11
|
+
export declare function snapshotWorkspace(root: string): RecursiveProjection;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@try-works/dsh-recursive-mode",
|
|
3
3
|
"description": "recursive-mode workflow as a DeepSeek Harness bundle: RecursiveRuntime service + recursive_status tool",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.5",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"cordis.patch.yml",
|
|
24
24
|
"src",
|
|
25
25
|
"preset",
|
|
26
|
-
"scripts"
|
|
26
|
+
"scripts",
|
|
27
|
+
"references"
|
|
27
28
|
],
|
|
28
29
|
"license": "MIT",
|
|
29
30
|
"dsh": {
|
|
@@ -78,7 +79,7 @@
|
|
|
78
79
|
"zod": "^4.4.3"
|
|
79
80
|
},
|
|
80
81
|
"scripts": {
|
|
81
|
-
"build": "tsc -p tsconfig.build.json && tsdown",
|
|
82
|
+
"build": "node -e \"require('node:fs').rmSync('lib',{recursive:true,force:true})\" && tsc -p tsconfig.build.json && tsdown",
|
|
82
83
|
"bundle": "tsdown",
|
|
83
84
|
"test": "vitest run",
|
|
84
85
|
"typecheck": "tsc --noEmit"
|
|
@@ -33,6 +33,12 @@
|
|
|
33
33
|
# The recursive workflow realm: per-session isolated RecursiveRuntime service +
|
|
34
34
|
# the recursive_* tools + the /recursive command + the policy prompt section.
|
|
35
35
|
# isolate.recursive keeps `provide('recursive')` from colliding across sessions.
|
|
36
|
+
#
|
|
37
|
+
# R2 (02-to-be-plan.addendum-r4-r2-mount-resolution.md): the server-surface row
|
|
38
|
+
# is a PLACEHOLDER here; scripts/install-preset.js replaces it with an ABSOLUTE
|
|
39
|
+
# file URL into the profile-installed package so its own @deepseek-ai/* imports
|
|
40
|
+
# resolve through the profile flat-fallback junctions (Service identity intact).
|
|
41
|
+
# commands.ts is bundled INTO lib/index.js, so a single row is sufficient.
|
|
36
42
|
- id: recursive-realm
|
|
37
43
|
name: cordis:group
|
|
38
44
|
group: true
|
|
@@ -40,10 +46,7 @@
|
|
|
40
46
|
recursive: true
|
|
41
47
|
config:
|
|
42
48
|
- id: recursive
|
|
43
|
-
name: '
|
|
44
|
-
|
|
45
|
-
- id: recursive-command
|
|
46
|
-
name: '@try-works/dsh-recursive-mode/src/commands.ts'
|
|
49
|
+
name: '@@RECURSIVE_SERVER_ENTRY@@'
|
|
47
50
|
|
|
48
51
|
# The recursive:policy prompt section is registered in code (Stage A,
|
|
49
52
|
# src/index.ts via ctx.systemPrompt.section) — see plan-mode's pattern.
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
name: Recursive 模式
|
|
2
|
-
description: recursive-mode 工作流代理:在会话的当前工作区内运行递归工作流(Phase A: status/spec/worktree/init/lock/qa/closeout/addendum/review/scratch + 全局 bootstrap/list/help)。
|
|
2
|
+
description: 'recursive-mode 工作流代理:在会话的当前工作区内运行递归工作流(Phase A: status/spec/worktree/init/lock/qa/closeout/addendum/review/scratch + 全局 bootstrap/list/help)。'
|
|
3
3
|
order: 5
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
## recursive-mode bridge
|
|
2
|
+
|
|
3
|
+
This repository uses `recursive-mode`.
|
|
4
|
+
|
|
5
|
+
The single canonical workflow spec lives in `/.recursive/RECURSIVE.md`.
|
|
6
|
+
Read that file before starting or resuming any recursive-mode work.
|
|
7
|
+
|
|
8
|
+
For Codex, the primary AGENTS bridge target is `/.codex/AGENTS.md`.
|
|
9
|
+
If the repo also carries other `AGENTS.md` files, they may mirror this same bridge block.
|
|
10
|
+
|
|
11
|
+
Bridge guidance only:
|
|
12
|
+
|
|
13
|
+
- Treat this file as a harness adapter, not as a second workflow spec.
|
|
14
|
+
- If this file conflicts with `/.recursive/RECURSIVE.md`, follow `/.recursive/RECURSIVE.md`.
|
|
15
|
+
- Control-plane docs live under `/.recursive/`.
|
|
16
|
+
- Runs live under `/.recursive/run/<run-id>/`.
|
|
17
|
+
- Durable memory lives under `/.recursive/memory/`.
|
|
18
|
+
- If recursive-mode is invoked in a repo that does not yet contain the `/.recursive/` scaffold, bootstrap it automatically with the supported install script before continuing. Do not require the user to run a separate manual bootstrap step unless no supported runtime is available.
|
|
19
|
+
|
|
20
|
+
How users can invoke the skill:
|
|
21
|
+
|
|
22
|
+
- Treat short prompts such as `Implement the run`, `Implement run 75`, `Implement the plan`, `Create a new run based on the plan`, and `Start a recursive run` as valid recursive-mode entry commands.
|
|
23
|
+
- If a run id is given, use that run.
|
|
24
|
+
- If no run id is given and exactly one active/incomplete run exists, resume that run.
|
|
25
|
+
- If the user asks to implement/start based on a plan, create a new run only when a unique source plan or requirements artifact can be identified from repo docs or immediate task context.
|
|
26
|
+
- If the command is ambiguous, ask for the run id or the repo path of the source plan/requirements artifact.
|
|
27
|
+
- Prompts are still commands, not specifications: read the repo docs that define the run before proceeding.
|
|
28
|
+
|
|
29
|
+
Required recursive-mode audit behavior:
|
|
30
|
+
|
|
31
|
+
- Audited phases must follow `draft -> audit -> repair -> re-audit -> pass -> lock`.
|
|
32
|
+
- When subagents are unavailable, perform the same audit as `self-audit`; do not weaken or skip it.
|
|
33
|
+
- Delegate audits only when you can provide the full context bundle:
|
|
34
|
+
- phase name and artifact path
|
|
35
|
+
- upstream artifact paths reread for the audit
|
|
36
|
+
- diff basis from `00-worktree.md`
|
|
37
|
+
- changed file list and targeted code references
|
|
38
|
+
- phase-specific audit questions/checklist
|
|
39
|
+
- If the context bundle is incomplete, do not delegate; perform the audit yourself and record `Audit Execution Mode: self-audit`.
|
|
40
|
+
- If subagents are available and the context bundle is complete, delegated audit/review is the default path.
|
|
41
|
+
- If subagents are available but the controller still chooses `self-audit`, record a concrete `Delegation Override Reason`.
|
|
42
|
+
- Do not set `Coverage: PASS` or `Approval: PASS` for an audited phase unless the artifact ends with `Audit: PASS`.
|
|
43
|
+
- Record `Subagent Capability Probe` and `Delegation Decision Basis` in every audited phase.
|
|
44
|
+
- If meaningful subagent work contributes to a phase, require a durable action record under `/.recursive/run/<run-id>/subagents/` and verify it against actual files, actual recursive artifacts, and the actual diff before acceptance. For review/audit delegation, prefer a stable reviewed artifact for `Current Artifact`.
|
|
45
|
+
- Store routed assistant output, raw transcripts, stdout/stderr captures, and invocation metadata under `/.recursive/run/<run-id>/evidence/router/`; cite them from action records rather than placing raw transcript Markdown directly under `subagents/`.
|
|
46
|
+
- Store initial routed prompt bundles only under run-scoped paths such as `/.recursive/run/<run-id>/router-prompts/`; do not bootstrap top-level `/.recursive/router-prompts/`.
|
|
47
|
+
- Treat `success: false` or any nonzero routed-assistant exit code as a failed attempt: preserve diagnostics, instruct the bounded routed role to repair owned issues when applicable, rerun the route, then verify the result before acceptance or record an explicit fallback.
|
|
48
|
+
- If delegated work is accepted after main-agent checks reveal issues, record the concrete repair performed after verification; do not accept stale delegated context silently.
|
|
49
|
+
- For Phase 3, declare `TDD Mode: strict|pragmatic`. Strict mode requires RED and GREEN evidence paths. Pragmatic mode requires an explicit exception rationale plus compensating evidence.
|
|
50
|
+
- For Phase 5, declare `QA Execution Mode: human|agent-operated|hybrid`. Human and hybrid require user sign-off. Agent-operated and hybrid require execution metadata plus evidence paths.
|
|
51
|
+
- For delegated review, prefer `recursive-review-bundle` and record `Review Bundle Path` in Phase 3.5 when review is delegated.
|
|
52
|
+
- Treat addenda as authoritative effective inputs. If relevant addenda exist, list them in `Inputs`, re-read them, and reconcile them explicitly.
|
|
53
|
+
- Review bundles should include relevant addenda automatically, and the written review should cite upstream artifacts, relevant addenda, prior recursive evidence, and changed files/code refs from that bundle in the review narrative.
|
|
54
|
+
- Audited phases must include machine-checkable `Requirement Completion Status` entries for every in-scope `R#`; Traceability alone is not enough.
|
|
55
|
+
- `implemented` and `verified` requirement dispositions must cite concrete `Changed Files`, and `verified` also requires distinct verification evidence.
|
|
56
|
+
- `00-worktree.md` is the source of truth for diff basis. Record baseline type/reference, comparison reference, normalized baseline/comparison, and normalized diff command; do not silently substitute a different basis later.
|
|
57
|
+
- Diff audit ignores incidental runtime byproducts such as `__pycache__/`, `*.pyc`, `.pytest_cache/`, `.mypy_cache/`, and `.ruff_cache/` unless the repo intentionally tracks them.
|
|
58
|
+
- Treat Phase 6, Phase 7, and Phase 8 receipts as concise delta receipts that point to final control-plane docs instead of duplicating them.
|
|
59
|
+
- Phase 8 should capture run-local skill usage and update skill memory under `/.recursive/memory/skills/` when the run teaches the repo something durable about skill availability, skill fit, delegated-review quality, or skill-discovery outcomes.
|
|
60
|
+
- If a run needs missing specialized capability, prefer the `find-skills` skill when available. Otherwise use the Skills CLI (`npx skills find`, `npx skills add`, `npx skills check`, `npx skills update`) and record the outcome when skill usage is relevant.
|
|
61
|
+
- When working inside a reusable skill/workflow repo, do not leave committed run residue such as concrete `/.recursive/run/<run-id>/` folders, evidence logs, review bundles, action records, or temp-path references unless they are intentional fixtures or examples.
|
|
62
|
+
|
|
63
|
+
Useful helpers:
|
|
64
|
+
|
|
65
|
+
Invoke these helper names from the installed recursive-mode skill directory or the source package checkout:
|
|
66
|
+
|
|
67
|
+
- `install-recursive-mode`
|
|
68
|
+
- `recursive-init`
|
|
69
|
+
- `recursive-status`
|
|
70
|
+
- `lint-recursive-run`
|
|
71
|
+
- `recursive-review-bundle`
|
|
72
|
+
- `recursive-closeout`
|
|
73
|
+
- `recursive-subagent-action`
|
|
74
|
+
- `recursive-training-grpo`
|
|
75
|
+
- `recursive-training-extract`
|
|
76
|
+
- `recursive-training-phase8-trigger`
|
|
77
|
+
- `recursive-training-sync`
|
|
78
|
+
- `recursive-training-loader`
|
|
79
|
+
- `recursive-training-mcp`
|
|
80
|
+
- `recursive-lock`
|
|
81
|
+
- `verify-locks`
|
|
82
|
+
- `check-reusable-repo-hygiene`
|
|
83
|
+
|
|
84
|
+
Diff ownership rules:
|
|
85
|
+
|
|
86
|
+
- Phase 2 owns planned product/worktree scope only.
|
|
87
|
+
- Phase 3, Phase 3.5, and Phase 4 own actual product/worktree drift reconciliation.
|
|
88
|
+
- Phase 6 owns `/.recursive/DECISIONS.md`.
|
|
89
|
+
- Phase 7 owns `/.recursive/STATE.md`.
|
|
90
|
+
- Phase 8 owns `/.recursive/memory/**`.
|
|
91
|
+
- Do not treat later control-plane or memory churn as retroactive invalidation of earlier locked phases.
|
|
92
|
+
|
|
93
|
+
Locking rule:
|
|
94
|
+
|
|
95
|
+
- Use `recursive-lock` as the primary supported way to write `Status: LOCKED`, `LockedAt`, and `LockHash`.
|