sdl.code.getSkeleton
Rung 2. Returns a deterministic “table of contents” for a symbol or file — signatures and control flow structures with implementation bodies elided. Parses the source file and produces a skeleton view that includes function/method signatures, class declarations, and control flow structures (if, for, while, try), but replaces implementation bodies with /* ... */. This lets agents understand the shape of the code without reading every line.
Provide exactly one of symbolId or file.
Parameters
Repository identifier.
Symbol to skeletonize. Provide either this or
file.File path to skeletonize. Provide either this or
symbolId.Only include exported symbols. Useful in file mode to reduce noise in large library files.
Maximum lines to return.
Maximum tokens to return.
Highlight specific identifiers in the skeleton. Maximum 50.
Resume from a previous truncation point (line offset for pagination). Minimum:
0.Response
The skeleton IR text with bodies elided.
File path.
{startLine, startCol, endLine, endCol}.Token count of the skeleton.
Line count of the original source.
Whether the skeleton was truncated.
Truncation details if applicable, including a resume offset.
Examples
sdl.code.getHotPath
Rung 3. Extracts only the lines containing specific identifiers, plus surrounding context lines, from a symbol’s source code. Given a symbol and a list of identifiers to find, scans the source code for occurrences of those identifiers and returns a minimal excerpt containing just those lines plus a configurable number of context lines above and below. Irrelevant code between matches is skipped. This is the most efficient way to answer targeted questions like “where isthis.cache initialized?” or “how is errorCode used?”
Parameters
Repository identifier.
Symbol to search within.
Identifiers to locate in the source. Range: 1–50.
Lines of context above and below each match. Default:
3. Minimum: 0.Maximum total lines to return.
Maximum tokens to return.
Response
The hot-path excerpt text.
File path.
{startLine, startCol, endLine, endCol}.Token count of the excerpt.
Which of the requested identifiers were actually found in the AST.
Line numbers where matches occurred.
Whether the excerpt was truncated.
Example
sdl.code.needWindow
Rung 4. Requests raw source code for a symbol. This is the most expensive rung of the Iris Gate Ladder and is policy-gated. Returns the full source code for a symbol’s line range. The request must include a justification (reason), expected line count, and identifiers the agent expects to find in the code. The policy engine evaluates whether the request should be approved, denied, or downgraded.
Approval criteria include:
- The requested identifiers exist in the range
- The symbol is in a current slice or frontier
- The scorer utility exceeds the threshold
- The agent invokes break-glass with audit logging
whyDenied reasons and a nextBestAction suggesting an alternative tool and arguments.
Parameters
Repository identifier.
Symbol to read.
Justification for why raw code is needed. Must be non-empty.
How many lines the agent expects to need. Clamped to the policy maximum (default: 180).
Identifiers the agent expects to find in the code. Required by policy. Maximum 50.
Scope of the code window.
Maximum tokens. Clamped to the policy maximum (default: 1,400).
Task context for policy evaluation. Providing this improves approval scoring.
Response (approved)
Always
true when approved.Symbol identifier.
File path.
{startLine, startCol, endLine, endCol}.The raw source code.
Reasons for approval.
Token count.
Set if the request was downgraded (e.g., to skeleton).
Which identifiers were found.
Line numbers of matches.
Response (denied)
Always
false when denied.Reasons the request was denied.
Modified request parameters that might be approved.
{tool, args, rationale} — the alternative tool to try instead.Example
Policy Tools
Policy tools control the gate conditions forsdl.code.needWindow. Policy is per-repository and persists across sessions.
sdl.policy.get
Retrieves the current policy configuration for a repository.Parameters
Repository identifier.
Response
Example
sdl.policy.set
Updates policy settings for a repository. Accepts a partial patch — only the fields provided are updated; omitted fields retain their current values.Parameters
Repository identifier.
Partial policy to apply. All fields are optional.