Skip to content

Commit ba3bdf5

Browse files
committed
docs: clarify direct response continuation
1 parent 77e4458 commit ba3bdf5

6 files changed

Lines changed: 25 additions & 14 deletions

File tree

SDL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ SDL-MCP is the normal repository interface. Native filesystem and shell tools ar
1515
- Use `sdl.workflow` only when steps need result piping, transforms, runtime execution, batch operations, or mutations.
1616
3. Never use `file.read` for indexed source. It is only for non-indexed files such as docs, configs, templates, JSON, and YAML.
1717
4. Treat focus fields as seed priorities, not output boundaries. The task profile and token budget determine expansion and evidence rungs.
18-
5. Keep `responseMode: "auto"` for potentially large responses. If a response handle is returned, continue directly with `sdl.retrieve` using `op: "responseGet"` and `args: { handle, ... }`; request only the needed field or page. For JSON artifacts, prefer `jsonPath` with dot or bracket array paths, add `offset`/`limit` for large arrays, and use `raw: true` only when byte-slicing JSON text is intentional. Use workflow `responseGet` only when an existing multi-step workflow needs the result. A missing path reports the available top-level keys and returns a same-handle direct continuation, preferring `evidence` and then `omitted`.
18+
5. Keep `responseMode: "auto"` for potentially large responses. When a result returns a canonical `response.get` continuation (`nextAction` or `action`) for `sdl.retrieve` with `op: "responseGet"`, replay its returned action and arguments unchanged; do not reconstruct the continuation. The outer `repoId` owns trusted dispatch, while `detail` and `includeDiagnostics` remain outer `sdl.retrieve` controls. Nested `args` contains only artifact view and paging fields; nested `repoId` is invalid. Request only the needed field or page: for JSON artifacts, prefer `jsonPath` with dot or bracket array paths, add `offset`/`limit` for large arrays, and use `raw: true` only when byte-slicing JSON text is intentional. Use workflow `responseGet` only when direct `sdl.retrieve` is unavailable or an existing multi-step workflow needs the result. A missing path reports the available top-level keys and returns a same-handle direct continuation, preferring `evidence` and then `omitted`.
1919
6. Use focused `sdl.manual` only when composing a non-obvious request. Use `sdl.action.search` when the correct SDL action is unclear.
2020

2121
Never call `index.refresh`, directly, through `sdl.workflow`, or via `sdl-mcp index`, without explicit user approval in the current turn. Status flags, graph verification, parser-state/provenance warnings, and refresh recommendations are diagnostics, not approval.

src/mcp/server-instructions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const SDL_MCP_SERVER_INSTRUCTIONS = [
55
'1. Confirm `repo.status` through `sdl.workflow` with `fn: "repoStatus"` and `args: {}`.',
66
"2. If the correct action is unclear, use `sdl.action.search`; load `sdl.manual` only for the focused schema needed to compose a non-obvious request.",
77
'3. Gather task evidence via `sdl.context` with `budget.maxTokens` and flat `focusPaths`, `focusSymbols`, or `chatMentions`; never send `options`, `contextMode`, or `answerFirst`. Use `sdl.retrieve` for one-step `symbolSearch`, `symbolGetCard`, `sliceBuild`, `codeSkeleton`, `codeHotPath`, or bounded `codeNeedWindow` retrieval.',
8-
'4. Use `responseMode: "auto"` for potentially large responses. When a response handle is returned, continue the canonical `response.get` action directly with `sdl.retrieve` using `op: "responseGet"` and `args: { handle, ... }`; request only the needed field or page. Use `sdl.workflow` with `fn: "responseGet"` only when an existing multi-step workflow needs the result.',
8+
'4. Use `responseMode: "auto"` for potentially large responses. When a result returns a canonical `response.get` continuation (`nextAction` or `action`) for `sdl.retrieve` with `op: "responseGet"`, replay its returned action and arguments unchanged; outer `repoId` owns trusted dispatch, `detail` and `includeDiagnostics` stay outer controls, and nested `args.repoId` is invalid. Use workflow `responseGet` only when direct `sdl.retrieve` is unavailable or an existing multi-step workflow needs it.',
99
'5. Reuse `{ ref, unchanged: true }` responses and session short ids (`sN`); pass `refsMode: "off"` only when full content is required.',
1010
"6. Use `sdl.workflow` for multi-step pipelines, runtime execution, data transforms, batch operations, mutations, or result piping between steps; do not wrap a single `sdl.context` call.",
1111
'7. Use `sdl.file` with `op: "read"`; `file.read` only for non-indexed files and prefer targeted reads. `op: "write"` (`file.write`) supports targeted single-file writes, including indexed files with live reconciliation; prefer `op: "symbolEditPreview"`/`op: "symbolEditApply"` (`symbol.edit` preview/apply) for one-symbol indexed edits and `op: "searchEditPreview"`/`op: "searchEditApply"` for cross-file edits.',

templates/SDL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ SDL-MCP is the normal repository interface. Native filesystem and shell tools ar
1515
- Use `sdl.workflow` only when steps need result piping, transforms, runtime execution, batch operations, or mutations.
1616
3. Never use `file.read` for indexed source. It is only for non-indexed files such as docs, configs, templates, JSON, and YAML.
1717
4. Treat focus fields as seed priorities, not output boundaries. The task profile and token budget determine expansion and evidence rungs.
18-
5. Keep `responseMode: "auto"` for potentially large responses. If a response handle is returned, continue directly with `sdl.retrieve` using `op: "responseGet"` and `args: { handle, ... }`; request only the needed field or page. For JSON artifacts, prefer `jsonPath` with dot or bracket array paths, add `offset`/`limit` for large arrays, and use `raw: true` only when byte-slicing JSON text is intentional. Use workflow `responseGet` only when an existing multi-step workflow needs the result. A missing path reports the available top-level keys and returns a same-handle direct continuation, preferring `evidence` and then `omitted`.
18+
5. Keep `responseMode: "auto"` for potentially large responses. When a result returns a canonical `response.get` continuation (`nextAction` or `action`) for `sdl.retrieve` with `op: "responseGet"`, replay its returned action and arguments unchanged; do not reconstruct the continuation. The outer `repoId` owns trusted dispatch, while `detail` and `includeDiagnostics` remain outer `sdl.retrieve` controls. Nested `args` contains only artifact view and paging fields; nested `repoId` is invalid. Request only the needed field or page: for JSON artifacts, prefer `jsonPath` with dot or bracket array paths, add `offset`/`limit` for large arrays, and use `raw: true` only when byte-slicing JSON text is intentional. Use workflow `responseGet` only when direct `sdl.retrieve` is unavailable or an existing multi-step workflow needs the result. A missing path reports the available top-level keys and returns a same-handle direct continuation, preferring `evidence` and then `omitted`.
1919
6. Use focused `sdl.manual` only when composing a non-obvious request. Use `sdl.action.search` when the correct SDL action is unclear.
2020

2121
Never call `index.refresh`, directly, through `sdl.workflow`, or via `sdl-mcp index`, without explicit user approval in the current turn. Status flags, graph verification, parser-state/provenance warnings, and refresh recommendations are diagnostics, not approval.

templates/sdl-mcp-agent-workflow/SKILL.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,15 @@ Use SDL-MCP as the repository boundary.
2222
5. Read non-indexed files through `sdl.file`. Its targeted write operation can
2323
update one indexed file with live reconciliation; prefer symbol or
2424
search-edit preview/apply operations when they can anchor the change.
25-
6. Keep `responseMode: "auto"` for potentially large results. When a handle
26-
is returned, continue the canonical `response.get` action directly with
27-
`sdl.retrieve` using `op: "responseGet"` and `args: { handle, ... }`; request
28-
only the needed field or page. Use workflow `responseGet` only when an
29-
existing multi-step workflow needs it.
25+
6. Keep `responseMode: "auto"` for potentially large results. When a result
26+
returns a canonical `response.get` continuation (`nextAction` or `action`) for
27+
`sdl.retrieve` with `op: "responseGet"`, replay its returned action and
28+
arguments unchanged; do not reconstruct it.
29+
Outer `repoId` owns trusted dispatch, and `detail`/`includeDiagnostics` stay
30+
outer `sdl.retrieve` controls. Nested `args` contains only artifact view and
31+
paging fields; nested `repoId` is invalid. Use workflow `responseGet` only
32+
when direct `sdl.retrieve` is unavailable or an existing multi-step workflow
33+
needs it.
3034
7. Reuse refs and ETags. Set `refsMode: "off"` only for complete or byte-stable
3135
output.
3236
8. Never call `index.refresh`, directly, through `sdl.workflow`, or via

templates/sdl-mcp-agent-workflow/references/tool-recipes.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@
3030

3131
## Large-Response Recovery
3232

33-
When `sdl.context` returns a response artifact handle, continue directly through
34-
`sdl.retrieve` and request only the needed canonical field or page:
33+
When a result returns a canonical `response.get` continuation (`nextAction` or
34+
`action`) for `sdl.retrieve` with `op: "responseGet"`, replay the returned action
35+
and arguments unchanged; do not reconstruct the continuation. A direct
36+
continuation has this shape:
3537

3638
```json
3739
{
@@ -42,9 +44,14 @@ When `sdl.context` returns a response artifact handle, continue directly through
4244
"jsonPath": "evidence",
4345
"offset": 0,
4446
"limit": 10
45-
}
47+
},
48+
"detail": "full",
49+
"includeDiagnostics": true
4650
}
4751
```
4852

49-
Use `cursor` and `maxBytes` for byte paging. Use workflow `responseGet` only
50-
when an existing multi-step workflow needs to pipe the retrieved result.
53+
The outer `repoId` owns trusted dispatch. `detail` and `includeDiagnostics` are
54+
outer `sdl.retrieve` controls; nested `args` contains only artifact view and
55+
paging fields, and nested `repoId` is invalid. Use `cursor` and `maxBytes` for
56+
byte paging. Use workflow `responseGet` only when direct `sdl.retrieve` is
57+
unavailable or an existing multi-step workflow needs to pipe the result.

tests/stress/fixtures/SDL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ SDL-MCP is the normal repository interface. Native filesystem and shell tools ar
1515
- Use `sdl.workflow` only when steps need result piping, transforms, runtime execution, batch operations, or mutations.
1616
3. Never use `file.read` for indexed source. It is only for non-indexed files such as docs, configs, templates, JSON, and YAML.
1717
4. Treat focus fields as seed priorities, not output boundaries. The task profile and token budget determine expansion and evidence rungs.
18-
5. Keep `responseMode: "auto"` for potentially large responses. If a response handle is returned, continue directly with `sdl.retrieve` using `op: "responseGet"` and `args: { handle, ... }`; request only the needed field or page. For JSON artifacts, prefer `jsonPath` with dot or bracket array paths, add `offset`/`limit` for large arrays, and use `raw: true` only when byte-slicing JSON text is intentional. Use workflow `responseGet` only when an existing multi-step workflow needs the result. A missing path reports the available top-level keys and returns a same-handle direct continuation, preferring `evidence` and then `omitted`.
18+
5. Keep `responseMode: "auto"` for potentially large responses. When a result returns a canonical `response.get` continuation (`nextAction` or `action`) for `sdl.retrieve` with `op: "responseGet"`, replay its returned action and arguments unchanged; do not reconstruct the continuation. The outer `repoId` owns trusted dispatch, while `detail` and `includeDiagnostics` remain outer `sdl.retrieve` controls. Nested `args` contains only artifact view and paging fields; nested `repoId` is invalid. Request only the needed field or page: for JSON artifacts, prefer `jsonPath` with dot or bracket array paths, add `offset`/`limit` for large arrays, and use `raw: true` only when byte-slicing JSON text is intentional. Use workflow `responseGet` only when direct `sdl.retrieve` is unavailable or an existing multi-step workflow needs the result. A missing path reports the available top-level keys and returns a same-handle direct continuation, preferring `evidence` and then `omitted`.
1919
6. Use focused `sdl.manual` only when composing a non-obvious request. Use `sdl.action.search` when the correct SDL action is unclear.
2020

2121
Never call `index.refresh`, directly, through `sdl.workflow`, or via `sdl-mcp index`, without explicit user approval in the current turn. Status flags, graph verification, parser-state/provenance warnings, and refresh recommendations are diagnostics, not approval.

0 commit comments

Comments
 (0)