Plugin protocol v1
One JSON-RPC 2.0 message of plugin protocol v1, as carried in the body of a Content-Length frame. The root validates a whole message: a request or notification is dispatched on method, a response is checked as a success or an error. Result shapes are separate $defs because a response names no method; validate one against the def of the method it answers. No object here sets additionalProperties false: a reader ignores unknown fields, and keys with the prefix x- never carry meaning. Semantics are in docs/contract/plugin-protocol.md. Owner: slopvac-8l4.2.6.
Lifecycle methods
Section titled “Lifecycle methods”| Method | Type | Params | Result | Summary |
|---|---|---|---|---|
initialize |
request | InitializeParams |
InitializeResult |
First request, from host to plugin. |
initialized |
notification | none | none | |
shutdown |
request | none | null |
|
exit |
notification | none | none | |
$/cancelRequest |
notification | CancelParams |
none | Parameters of $/cancelRequest. |
Hook points
Section titled “Hook points”Hook point name. The v1 kinds are tagger, extractor, binary-extractor, reporter, fixer, scorer, provider and recipe. A reader ignores a kind it does not know, so the schema fixes only the form.
| Kind | Method | Params | Result | Summary |
|---|---|---|---|---|
tagger |
tagger/tag |
TagParams |
TagResult |
Run the named tagger over each document. |
extractor |
extractor/extract |
ExtractParams |
ExtractResult |
Split each document into segments. |
reporter |
reporter/render |
RenderParams |
RenderResult |
report is one lint report with schema_version 3. |
fixer |
fixer/fix |
FixParams |
FixResult |
Propose edits for the selected findings of each document. |
scorer |
scorer/score |
ScoreParams |
ScoreResult |
Compute a score for each document from its findings. |
provider |
provider/complete |
CompleteParams |
CompleteResult |
Ask a model provider about each item. |
recipe |
recipe/plan |
RecipeParams |
RecipeResult |
Plan the files that set up one agent harness. |
binary-extractor |
binary-extractor/extract |
BinaryExtractParams |
BinaryExtractResult |
Extract the prose of each binary document. |
Plugin-local hook identifier. The host qualifies it with the plugin name. Each hook kind has its own id space.
Capabilities
Section titled “Capabilities”Optional capability name. The v1 registry holds one name, document-path. A name with the prefix x- is a private extension and a reader ignores it unless it understands it.
Declaration before spawn
Section titled “Declaration before spawn”Pre-spawn declaration. The plugin manifest embeds it, and the manifest is part of the content that slopvac plugins trust hashes (plugin-manifest schema, owner slopvac-8l4.2.4). The host decides whether to spawn from this declaration, never from the initialize reply. network true allows the plugin to open connections, and the host does not spawn it in offline mode. hooks lists every hook the plugin may offer. features lists the features it may require or request. The initialize reply must stay inside the declaration.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
network |
boolean | yes | ||
hooks |
array of object (HookDecl) |
yes | ||
features |
object | yes | ||
features.required |
array of string (FeatureName) |
yes | unique items | |
features.optional |
array of string (FeatureName) |
yes | unique items |
Offer from the host
Section titled “Offer from the host”First request, from host to plugin. protocolVersion is the highest version the host speaks and minProtocolVersion the lowest (default 1). hooks lists the kinds the host can call. features lists optional capabilities the host offers. offline is true when sticky offline mode is on. limits are the host’s ceilings.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
protocolVersion |
integer (ApiVersion) |
yes | minimum 1 | Protocol version. Same value space as ApiVersion in common.schema.json. |
minProtocolVersion |
integer (ApiVersion) |
no | minimum 1 | Protocol version. Same value space as ApiVersion in common.schema.json. |
hostInfo |
object (Name) |
yes | Program name and version of the host or the plugin. For logs only; never branch on it. | |
capabilities |
object | yes | ||
capabilities.hooks |
array of string (HookKind) |
yes | unique items | |
capabilities.features |
array of string (FeatureName) |
yes | unique items | |
offline |
boolean | yes | ||
limits |
object | yes | ||
limits.maxMessageBytes |
integer | yes | minimum 65536 | |
limits.maxBatchDocuments |
integer | yes | minimum 1 |
Reply from the plugin
Section titled “Reply from the plugin”Reply to initialize. protocolVersion is the negotiated version: the highest version both sides support. It must lie in the host’s range. capabilities repeat the pre-spawn declaration: the host compares them with the manifest and rejects the reply, with plugin-declaration-mismatch, when requiresNetwork differs, a hook is absent from the manifest, or a required feature is absent from it. features.required names features the plugin cannot work without; the host stops the load if it lacks one. limits.maxMessageBytes, maxBatchDocuments and maxInFlight may lower the host ceilings but not raise them; a higher value is plugin-output-invalid.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
protocolVersion |
integer (ApiVersion) |
yes | minimum 1 | Protocol version. Same value space as ApiVersion in common.schema.json. |
pluginInfo |
object (Name) |
yes | Program name and version of the host or the plugin. For logs only; never branch on it. | |
capabilities |
object | yes | ||
capabilities.hooks |
array of object (HookDecl) |
yes | ||
capabilities.features |
object | yes | ||
capabilities.features.required |
array of string (FeatureName) |
yes | unique items | |
capabilities.features.optional |
array of string (FeatureName) |
yes | unique items | |
capabilities.requiresNetwork |
boolean | yes | Must equal PluginDeclaration.network. It informs and cannot grant anything. | |
limits |
object | yes | ||
limits.maxMessageBytes |
integer | yes | minimum 65536 | |
limits.maxBatchDocuments |
integer | yes | minimum 1 | |
limits.maxInFlight |
integer | yes | minimum 1 |
Errors
Section titled “Errors”JSON-RPC error. code follows docs/contract/plugin-protocol.md, section Error codes. data.slopvac_code is the stable kebab-case string code that policies.md section 3.5 requires. A code from -32099 to -32000 is slopvac-defined.
| Code | slopvac_code |
Meaning |
|---|---|---|
| -32700 | parse-error |
The body is not valid JSON. |
| -32600 | invalid-request |
The body is not a valid message, or it is a batch array, or the plugin is shut down. |
| -32601 | method-not-found |
Unknown method, or a hook the plugin did not declare. |
| -32602 | invalid-params |
Params do not match the schema, or name an unknown hook id. |
| -32603 | internal-error |
The plugin failed. |
| -32001 | protocol-version-unsupported |
No common version. data.supported holds the plugin range. |
| -32002 | required-feature-missing |
The host lacks a feature the plugin requires. |
| -32003 | not-initialized |
A request arrived before initialize finished. |
| -32004 | message-too-large |
A message exceeds maxMessageBytes. |
| -32005 | request-cancelled |
The plugin stopped a request after a cancel. |
| -32006 | document-invalid |
The plugin cannot process this document, for example binary content. |
| -32007 | offline |
A provider refused the call because offline mode is on. |
| -32008 | binary-input-declined |
A binary extractor declines this whole document. -32008 has no other meaning. extract-unsupported is a host notice with no number, and a plugin never sends it as an error. A plugin sends this number with data.reason unknown-format or variant-unsupported (section 5.5.4). |
| -32009 | extract-malformed |
The bytes break the format, or an embedded payload does not decode. |
| -32010 | extract-budget |
A binary extractor hit a limit. |
| -32011 | binary-encrypted |
The container is encrypted or protected by a password. A plugin sends it for an encrypted OpenDocument package, and the host raises it for an encrypted Office Open XML package (section 5.5.4). |
The host raises these codes in its own diagnostics. They have no numeric code.
slopvac_code |
Cause |
|---|---|
plugin-untrusted |
The content hash has no recorded trust. The message prints the slopvac plugins trust command. |
plugin-hash-mismatch |
The installed bytes differ from the hash that trust recorded. |
plugin-not-code |
Reserved, not emitted yet: slopvac plugins trust or untrust named a data plugin, which runs no code and needs no trust. |
plugin-timeout |
A timer in section 6.3 expired. |
plugin-exited |
The process ended with requests pending. |
plugin-protocol-violation |
A framing error, a limit breach or a duplicate key. |
plugin-output-invalid |
A result does not match its schema, or breaks a rule such as span bounds. |
plugin-spawn-failed |
The program did not start. |
launcher-not-installed |
The running program did not install the plugin launcher, so the host cannot start a plugin or a git plugin source. Nothing was spawned. |
plugin-declaration-mismatch |
The reply disagrees with the hashed manifest (section 4.3). |
request-id-exhausted |
The request counter reached 2^53-1. |
binary-format-mismatch |
The signature and the name of a file disagree about its format (section 5.5.1). |
binary-no-source |
A binary extractor found no embedded source in a valid container. The level depends on the name (section 5.5.4). |
binary-input-changed |
A binary file grew between the preflight and the read (section 5.5.6). |
binary-format-ambiguous |
Two or more enabled hooks claim a format, and the config maps it to none of them (section 5.5.1). |
input-unsupported |
The host’s existing code for a named input that it does not lint. It also covers a file the user named whose format no enabled extractor reads, such as EPUB or PDF. The document goes in unchecked, data.format names the detected format (section 5.5.1), and the run exits 2. The binary extraction contract adds no code of its own for it. |
extract-unsupported |
An info notice for content that an extractor skipped inside a document it read (section 5.5.4). A plugin lists the content in the result’s unsupported field and sends no error number. The run exits 0. |
extract-output-invalid |
The host validator rejects the output of a first-party (built-in) extractor (section 5.5). Output from a third-party plugin gets plugin-output-invalid instead. The cause is a slopvac bug, and the message points to the issue tracker. It is separate from plugin-output-invalid, which covers plugin output, and has the same severity and exit. |
Response that carries an error. id is null only when the sender could not read the request id, for example after a parse error.
Definitions
Section titled “Definitions”RequestId
Section titled “RequestId”Request id. Integers from 1 to 2^53-1, unique among the requests of one connection and never reused after completion or cancellation. Strings, null, fractions and larger values are invalid in v1.
Type: integer.
Constraints: minimum 1; maximum 9007199254740991.
HookKind
Section titled “HookKind”Hook point name. The v1 kinds are tagger, extractor, binary-extractor, reporter, fixer, scorer, provider and recipe. A reader ignores a kind it does not know, so the schema fixes only the form.
Type: string.
Constraints: pattern ^[a-z][a-z0-9-]*(?![\s\S]).
HookId
Section titled “HookId”Plugin-local hook identifier. The host qualifies it with the plugin name. Each hook kind has its own id space.
Type: string.
Constraints: pattern ^[a-z][a-z0-9-]*(?![\s\S]).
FeatureName
Section titled “FeatureName”Optional capability name. The v1 registry holds one name, document-path. A name with the prefix x- is a private extension and a reader ignores it unless it understands it.
Type: string.
Constraints: pattern ^[a-z][a-z0-9-]*(?![\s\S])|^x-[a-z0-9-]+(?![\s\S]).
ProtocolVersion
Section titled “ProtocolVersion”Protocol version. Same value space as ApiVersion in common.schema.json.
Type: integer (ApiVersion).
Program name and version of the host or the plugin. For logs only; never branch on it.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
name |
string | yes | minimum length 1 | |
version |
string | yes | minimum length 1 |
ErrorObject
Section titled “ErrorObject”JSON-RPC error. code follows docs/contract/plugin-protocol.md, section Error codes. data.slopvac_code is the stable kebab-case string code that policies.md section 3.5 requires. A code from -32099 to -32000 is slopvac-defined.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
code |
integer | yes | minimum -9007199254740991; maximum 9007199254740991 | |
message |
string | yes | ||
data |
object | yes | ||
data.slopvac_code |
string | yes | pattern ^[a-z][a-z0-9]*(-[a-z0-9]+)*(?![\s\S]) |
ErrorResponse
Section titled “ErrorResponse”Response that carries an error. id is null only when the sender could not read the request id, for example after a parse error.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
jsonrpc |
"2.0" |
yes | ||
id |
integer (RequestId) or null |
yes | ||
error |
object (ErrorObject) |
yes | JSON-RPC error. code follows docs/contract/plugin-protocol.md, section Error codes. data.slopvac_code is the stable kebab-case string code that policies.md section 3.5 requires. A code from -32099 to -32000 is slopvac-defined. |
SuccessResponse
Section titled “SuccessResponse”Response that carries a result. The shape of result depends on the method of the request with the same id.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
jsonrpc |
"2.0" |
yes | ||
id |
integer (RequestId) |
yes | minimum 1; maximum 9007199254740991 | Request id. Integers from 1 to 2^53-1, unique among the requests of one connection and never reused after completion or cancellation. Strings, null, fractions and larger values are invalid in v1. |
result |
any | yes |
Response
Section titled “Response”Success or error response.
Type: any.
PluginDocument
Section titled “PluginDocument”One document in a batch. text is the full UTF-8 source. Every span in a result is a byte range into this text. path is present only when the plugin requested the document-path feature and the host granted it. It is relative to the project root, or <stdin>, or <external>/<file name>. It is never absolute.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
id |
string | yes | minimum length 1 | |
text |
string | yes | ||
media_type |
string | no | ||
path |
string | no |
Documents
Section titled “Documents”Batch of documents for one request. The host splits a batch to stay under the limits agreed in initialize. Ids are unique within the array.
Type: array of object (PluginDocument).
Constraints: minimum items 1; unique items.
PluginFinding
Section titled “PluginFinding”A finding as passed to fixers and scorers. Spans index the text of the document that carries the finding.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
rule |
string (RuleId) |
yes | pattern ^[a-z][a-z0-9-]*:[A-Za-z0-9][A-Za-z0-9._-]*(?![\s\S]) |
Qualified rule identifier <plugin>:<id>. A rule from a category file has the id <category>.<rule>, for example core:prose-craft.acronym-periods; a rule a plugin reports may use a bare id such as core:passive-voice. Short names resolve in configuration only where they are unambiguous; every output carries the qualified form. |
severity |
one of "suggestion", "warning", "error" (Severity) |
yes | Finding severity. Excludes off: 2.x config accepts off to disable a rule, so off belongs to config, not to findings. | |
span |
object (Span) |
yes | Half-open range [start, end) of byte offsets into the original file bytes, BOM included. The end is exclusive, start is at most end, and both offsets fall on code point boundaries and never between the CR and LF of one CRLF. See docs/contract/positions.md. | |
message |
string | yes |
DocumentResult
Section titled “DocumentResult”Fields shared by every per-document result. document echoes a Document id. error marks only this document as failed; the host reports the run as incomplete (exit 2) and keeps the other documents.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
document |
string | yes | minimum length 1 | |
error |
object (ErrorObject) |
no | JSON-RPC error. code follows docs/contract/plugin-protocol.md, section Error codes. data.slopvac_code is the stable kebab-case string code that policies.md section 3.5 requires. A code from -32099 to -32000 is slopvac-defined. |
InitializeParams
Section titled “InitializeParams”First request, from host to plugin. protocolVersion is the highest version the host speaks and minProtocolVersion the lowest (default 1). hooks lists the kinds the host can call. features lists optional capabilities the host offers. offline is true when sticky offline mode is on. limits are the host’s ceilings.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
protocolVersion |
integer (ApiVersion) |
yes | minimum 1 | Protocol version. Same value space as ApiVersion in common.schema.json. |
minProtocolVersion |
integer (ApiVersion) |
no | minimum 1 | Protocol version. Same value space as ApiVersion in common.schema.json. |
hostInfo |
object (Name) |
yes | Program name and version of the host or the plugin. For logs only; never branch on it. | |
capabilities |
object | yes | ||
capabilities.hooks |
array of string (HookKind) |
yes | unique items | |
capabilities.features |
array of string (FeatureName) |
yes | unique items | |
offline |
boolean | yes | ||
limits |
object | yes | ||
limits.maxMessageBytes |
integer | yes | minimum 65536 | |
limits.maxBatchDocuments |
integer | yes | minimum 1 |
HookDecl
Section titled “HookDecl”One hook a plugin implements. The host calls only declared hooks. A binary-extractor hook must list the formats it reads, at least one and without duplicates. For other kinds formats is an unknown field and a reader ignores it.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
kind |
string (HookKind) |
yes | pattern ^[a-z][a-z0-9-]*(?![\s\S]) |
Hook point name. The v1 kinds are tagger, extractor, binary-extractor, reporter, fixer, scorer, provider and recipe. A reader ignores a kind it does not know, so the schema fixes only the form. |
id |
string (HookId) |
yes | pattern ^[a-z][a-z0-9-]*(?![\s\S]) |
Plugin-local hook identifier. The host qualifies it with the plugin name. Each hook kind has its own id space. |
InitializeResult
Section titled “InitializeResult”Reply to initialize. protocolVersion is the negotiated version: the highest version both sides support. It must lie in the host’s range. capabilities repeat the pre-spawn declaration: the host compares them with the manifest and rejects the reply, with plugin-declaration-mismatch, when requiresNetwork differs, a hook is absent from the manifest, or a required feature is absent from it. features.required names features the plugin cannot work without; the host stops the load if it lacks one. limits.maxMessageBytes, maxBatchDocuments and maxInFlight may lower the host ceilings but not raise them; a higher value is plugin-output-invalid.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
protocolVersion |
integer (ApiVersion) |
yes | minimum 1 | Protocol version. Same value space as ApiVersion in common.schema.json. |
pluginInfo |
object (Name) |
yes | Program name and version of the host or the plugin. For logs only; never branch on it. | |
capabilities |
object | yes | ||
capabilities.hooks |
array of object (HookDecl) |
yes | ||
capabilities.features |
object | yes | ||
capabilities.features.required |
array of string (FeatureName) |
yes | unique items | |
capabilities.features.optional |
array of string (FeatureName) |
yes | unique items | |
capabilities.requiresNetwork |
boolean | yes | Must equal PluginDeclaration.network. It informs and cannot grant anything. | |
limits |
object | yes | ||
limits.maxMessageBytes |
integer | yes | minimum 65536 | |
limits.maxBatchDocuments |
integer | yes | minimum 1 | |
limits.maxInFlight |
integer | yes | minimum 1 |
CancelParams
Section titled “CancelParams”Parameters of $/cancelRequest. id names a request the sender no longer wants answered.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
id |
integer (RequestId) |
yes | minimum 1; maximum 9007199254740991 | Request id. Integers from 1 to 2^53-1, unique among the requests of one connection and never reused after completion or cancellation. Strings, null, fractions and larger values are invalid in v1. |
A context tag: kind, span, confidence and evidence, as the plan defines for taggers.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
kind |
string (ContextTag) |
yes | pattern ^[a-z][a-z0-9-]*(?![\s\S]) |
Text-context label such as prose or code. |
span |
object (Span) |
yes | Half-open range [start, end) of byte offsets into the original file bytes, BOM included. The end is exclusive, start is at most end, and both offsets fall on code point boundaries and never between the CR and LF of one CRLF. See docs/contract/positions.md. | |
confidence |
number | yes | minimum 0; maximum 1 | |
evidence |
string | yes |
TagParams
Section titled “TagParams”tagger/tag. Run the named tagger over each document.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
tagger |
string (HookId) |
yes | pattern ^[a-z][a-z0-9-]*(?![\s\S]) |
Plugin-local hook identifier. The host qualifies it with the plugin name. Each hook kind has its own id space. |
documents |
array of object (PluginDocument) |
yes | minimum items 1; unique items | Batch of documents for one request. The host splits a batch to stay under the limits agreed in initialize. Ids are unique within the array. |
TagResult
Section titled “TagResult”One entry per requested document. Tags may overlap and may arrive in any order.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
results |
array of object | yes | ||
results[].document |
string | yes | minimum length 1 | |
results[].error |
object (ErrorObject) |
no | JSON-RPC error. code follows docs/contract/plugin-protocol.md, section Error codes. data.slopvac_code is the stable kebab-case string code that policies.md section 3.5 requires. A code from -32099 to -32000 is slopvac-defined. | |
results[].tags |
array of object (Tag) |
no |
Segment
Section titled “Segment”A region of prose that the extractor hands to the rules. span is the source range it came from. text is the converted text when it differs from the source bytes in span; a finding in converted text maps to the whole span. context labels the region, for example prose or code.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
span |
object (Span) |
yes | Half-open range [start, end) of byte offsets into the original file bytes, BOM included. The end is exclusive, start is at most end, and both offsets fall on code point boundaries and never between the CR and LF of one CRLF. See docs/contract/positions.md. | |
context |
string (ContextTag) |
yes | pattern ^[a-z][a-z0-9-]*(?![\s\S]) |
Text-context label such as prose or code. |
text |
string | no |
ExtractParams
Section titled “ExtractParams”extractor/extract. Split each document into segments.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
extractor |
string (HookId) |
yes | pattern ^[a-z][a-z0-9-]*(?![\s\S]) |
Plugin-local hook identifier. The host qualifies it with the plugin name. Each hook kind has its own id space. |
documents |
array of object (PluginDocument) |
yes | minimum items 1; unique items | Batch of documents for one request. The host splits a batch to stay under the limits agreed in initialize. Ids are unique within the array. |
ExtractResult
Section titled “ExtractResult”One entry per requested document. Segments are in source order and do not overlap.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
results |
array of object | yes | ||
results[].document |
string | yes | minimum length 1 | |
results[].error |
object (ErrorObject) |
no | JSON-RPC error. code follows docs/contract/plugin-protocol.md, section Error codes. data.slopvac_code is the stable kebab-case string code that policies.md section 3.5 requires. A code from -32099 to -32000 is slopvac-defined. | |
results[].segments |
array of object (Segment) |
no |
BinaryFormat
Section titled “BinaryFormat”Format id of a binary document, from the 3.0 list in docs/contract/plugin-protocol.md section 5.5.1. The enum is extensible (x-slopvac-extensible): a later release may add ids without a new protocol version. A plugin or reader that receives an id it does not know declines that document with binary-input-declined, reason unknown-format, and does not fail the request. Manifest validation applies the list strictly: the host refuses a manifest that declares an id outside its own list.
Type: one of "docx", "docm", "dotx", "dotm", "pptx", "pptm", "ppsx", "ppsm", "potx", "potm", "xlsx", "xlsm", "xltx", "xltm", "odt", "odp", "ods", "drawio-png", "excalidraw-png", "plantuml-png".
BinaryDocument
Section titled “BinaryDocument”One binary document in a batch. bytes is the whole file in standard base64 (RFC 4648 section 4) with padding and no line breaks; byte_length is the decoded length. format is the id the host detected. path follows PluginDocument.path and the document-path feature. Every BinarySpan in the result indexes the decoded bytes.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
id |
string | yes | minimum length 1 | |
format |
one of "docx", "docm", "dotx", "dotm", "pptx", "pptm", "ppsx", "ppsm", "potx", "potm", "xlsx", "xlsm", "xltx", "xltm", "odt", "odp", "ods", "drawio-png", "excalidraw-png", "plantuml-png" (BinaryFormat) |
yes | Format id of a binary document, from the 3.0 list in docs/contract/plugin-protocol.md section 5.5.1. The enum is extensible (x-slopvac-extensible): a later release may add ids without a new protocol version. A plugin or reader that receives an id it does not know declines that document with binary-input-declined, reason unknown-format, and does not fail the request. Manifest validation applies the list strictly: the host refuses a manifest that declares an id outside its own list. | |
media_type |
string | no | ||
byte_length |
integer | yes | minimum 0; maximum 9007199254740991 | |
bytes |
string | yes | ||
path |
string | no |
BinarySpan
Section titled “BinarySpan”Physical provenance of a segment: a half-open range [start, end) of byte offsets into the decoded bytes of the document, with start at most end and end at most byte_length. The host checks the bounds. It has no character-boundary rule, and unlike common Span it is an open object (plugin-protocol.md section 9). Matching and rendered positions never use it; they use offsets into the segment text.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
start |
integer | yes | minimum 0; maximum 9007199254740991 | |
end |
integer | yes | minimum 0; maximum 9007199254740991 |
BinarySegment
Section titled “BinarySegment”A region of prose that a binary extractor hands to the rules. part names the container member, locator the place inside it; together they identify the segment and are unique within one document result. Both hold 1 to 1024 characters with no control or bidirectional-control characters. The 1024-character bound is a fixed host cap: the host reports a longer value as extract-budget, and the pattern bound is a backstop for other readers. span is physical provenance only. text is the extracted UTF-8 prose that rules match; findings use offsets into it. context is a context tag. role is the structural role, from an extensible set (plugin-protocol.md section 5.5.3).
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
part |
string | yes | ||
locator |
string | yes | ||
span |
object (BinarySpan) |
yes | Physical provenance of a segment: a half-open range [start, end) of byte offsets into the decoded bytes of the document, with start at most end and end at most byte_length. The host checks the bounds. It has no character-boundary rule, and unlike common Span it is an open object (plugin-protocol.md section 9). Matching and rendered positions never use it; they use offsets into the segment text. | |
text |
string | yes | minimum length 1 | |
context |
string (ContextTag) |
yes | pattern ^[a-z][a-z0-9-]*(?![\s\S]) |
Text-context label such as prose or code. |
role |
string | yes | pattern ^[a-z][a-z0-9-]*(?![\s\S]) |
BinaryUnsupported
Section titled “BinaryUnsupported”Content that a binary extractor skipped inside a document it reads, such as an embedded object or a part type it does not handle. part names the container member and locator, when present, the place inside it; both follow the BinarySegment rules. media_type is the content type the container declares for it, when it declares one. The host reports each entry as an info notice extract-unsupported in the root notices of the lint report, and the run still exits 0 (plugin-protocol.md section 5.5.4). Entries count against the segments budget.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
part |
string | yes | ||
locator |
string | no | ||
media_type |
string | no | minimum length 1 |
BinaryBudget
Section titled “BinaryBudget”The budget an extract-budget error names in data.budget. This def is the one list of allowed values; docs/contract/plugin-protocol.md section 5.5.5 gives each value its limit, which an extract-budget error carries in data.limit in the unit of that table. The enum is extensible (x-slopvac-extensible): a reader keeps a value it does not know.
Type: one of "segments", "part", "locator", "text", "in-flight".
BinaryDeclineReason
Section titled “BinaryDeclineReason”Why a binary extractor declines a whole document with binary-input-declined (-32008), carried in data.reason. unknown-format: the format id is not one the extractor knows (plugin-protocol.md section 5.5.1). variant-unsupported: the format is one it lists, but this variant is one it does not handle. The enum is closed: any other value is a protocol violation (plugin-output-invalid). The host renders its own description for each reason and never shows the plugin’s string. A new reason is a contract change.
Type: one of "unknown-format", "variant-unsupported".
BinaryExtractParams
Section titled “BinaryExtractParams”binary-extractor/extract. Extract the prose of each binary document. The host admits a request by a length preflight before it reads or encodes the file, holds it against the in-flight budget, and sends it only when the exact serialized size fits the negotiated maxMessageBytes (plugin-protocol.md section 5.5.6).
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
extractor |
string (HookId) |
yes | pattern ^[a-z][a-z0-9-]*(?![\s\S]) |
Plugin-local hook identifier. The host qualifies it with the plugin name. Each hook kind has its own id space. |
documents |
array of object (BinaryDocument) |
yes | minimum items 1; unique items |
BinaryExtractResult
Section titled “BinaryExtractResult”One entry per requested document. Each entry carries exactly one of outcome or error. outcome extracted carries one or more segments in reading order; empty and no-source carry none. An entry with an outcome may list skipped content in unsupported, which the host reports as extract-unsupported notices; an entry with an error may not. extract-unsupported is never a per-document error. A document the extractor declines, an encrypted container, a malformed file and a budget breach travel as a per-document error: binary-input-declined (-32008) with data.reason, binary-encrypted (-32011), extract-malformed (-32009) and extract-budget (-32010) with data.budget and data.limit. A reader never parses these fields from the message. The reply must fit maxMessageBytes; a document whose segments do not fit gets the error message-too-large instead.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
results |
array of object | yes | ||
results[].document |
string | yes | minimum length 1 | |
results[].error |
object (ErrorObject) |
no | JSON-RPC error. code follows docs/contract/plugin-protocol.md, section Error codes. data.slopvac_code is the stable kebab-case string code that policies.md section 3.5 requires. A code from -32099 to -32000 is slopvac-defined. | |
results[].outcome |
one of "extracted", "empty", "no-source" |
no | ||
results[].segments |
array of object (BinarySegment) |
no | ||
results[].unsupported |
array of object (BinaryUnsupported) |
no | minimum items 1 |
RenderParams
Section titled “RenderParams”reporter/render. report is one lint report with schema_version 3. Its shape is the lint-report schema; this schema checks only the version so that the two schemas can evolve apart. options holds reporter-specific settings from the config.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
reporter |
string (HookId) |
yes | pattern ^[a-z][a-z0-9-]*(?![\s\S]) |
Plugin-local hook identifier. The host qualifies it with the plugin name. Each hook kind has its own id space. |
report |
object | yes | ||
report.schema_version |
3 (SchemaVersion) |
yes | Root artifact schema version. | |
options |
object | no |
RenderResult
Section titled “RenderResult”Rendered text. The host writes it to stdout or to the file the user named. The host strips terminal control characters other than newline and tab before it writes to a terminal.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
output |
string | yes | ||
media_type |
string | yes |
FixParams
Section titled “FixParams”fixer/fix. Propose edits for the selected findings of each document. findings holds only the findings the user selected to fix. They define the envelope of what edits may touch.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
fixer |
string (HookId) |
yes | pattern ^[a-z][a-z0-9-]*(?![\s\S]) |
Plugin-local hook identifier. The host qualifies it with the plugin name. Each hook kind has its own id space. |
documents |
array of object | yes | minimum items 1 | |
documents[].id |
string | yes | minimum length 1 | |
documents[].text |
string | yes | ||
documents[].media_type |
string | no | ||
documents[].path |
string | no | ||
documents[].findings |
array of object (PluginFinding) |
yes |
FixResult
Section titled “FixResult”One entry per requested document. Each edit names the selected finding that authorizes it. The host rejects every edit of a document, and reports that document as failed with plugin-output-invalid, when any edit lies outside its finding span, names no valid finding, or overlaps another edit. v1 has no approval path for broader edits. Edits apply to the text the host sent.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
results |
array of object | yes | ||
results[].document |
string | yes | minimum length 1 | |
results[].error |
object (ErrorObject) |
no | JSON-RPC error. code follows docs/contract/plugin-protocol.md, section Error codes. data.slopvac_code is the stable kebab-case string code that policies.md section 3.5 requires. A code from -32099 to -32000 is slopvac-defined. | |
results[].edits |
array of object (FixEdit) |
no |
ScoreParams
Section titled “ScoreParams”scorer/score. Compute a score for each document from its findings. The scorer may also read the text.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
scorer |
string (HookId) |
yes | pattern ^[a-z][a-z0-9-]*(?![\s\S]) |
Plugin-local hook identifier. The host qualifies it with the plugin name. Each hook kind has its own id space. |
documents |
array of object | yes | minimum items 1 | |
documents[].id |
string | yes | minimum length 1 | |
documents[].text |
string | yes | ||
documents[].media_type |
string | no | ||
documents[].path |
string | no | ||
documents[].findings |
array of object (PluginFinding) |
yes |
ScoreResult
Section titled “ScoreResult”One entry per requested document. score is finite and at least 0. The scale belongs to the scorer; the host applies the gate thresholds from the config.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
results |
array of object | yes | ||
results[].document |
string | yes | minimum length 1 | |
results[].error |
object (ErrorObject) |
no | JSON-RPC error. code follows docs/contract/plugin-protocol.md, section Error codes. data.slopvac_code is the stable kebab-case string code that policies.md section 3.5 requires. A code from -32099 to -32000 is slopvac-defined. | |
results[].score |
number | no | minimum 0 |
CompleteParams
Section titled “CompleteParams”provider/complete. Ask a model provider about each item. task names the review type. The host sends only the text the task needs. model is the model name from the config. A provider that cannot use it answers with an error.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
provider |
string (HookId) |
yes | pattern ^[a-z][a-z0-9-]*(?![\s\S]) |
Plugin-local hook identifier. The host qualifies it with the plugin name. Each hook kind has its own id space. |
task |
one of "fact-check", "update", "rewrite" |
yes | ||
model |
string | yes | minimum length 1 | |
items |
array of object | yes | minimum items 1 | |
items[].id |
string | yes | minimum length 1 | |
items[].text |
string | yes | ||
items[].instruction |
string | no |
CompleteResult
Section titled “CompleteResult”One entry per requested item. model is the model name the provider reports. The host compares it with the author model, as policies.md section 1.5 requires.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
results |
array of object | yes | ||
results[].item |
string | yes | minimum length 1 | |
results[].text |
string | no | ||
results[].model |
string | no | minimum length 1 | |
results[].error |
object (ErrorObject) |
no | JSON-RPC error. code follows docs/contract/plugin-protocol.md, section Error codes. data.slopvac_code is the stable kebab-case string code that policies.md section 3.5 requires. A code from -32099 to -32000 is slopvac-defined. |
RecipeParams
Section titled “RecipeParams”recipe/plan. Plan the files that set up one agent harness. The plugin writes nothing; the host applies the plan. options holds the flags of the setup command.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
recipe |
string (HookId) |
yes | pattern ^[a-z][a-z0-9-]*(?![\s\S]) |
Plugin-local hook identifier. The host qualifies it with the plugin name. Each hook kind has its own id space. |
harness |
string | yes | minimum length 1 | |
options |
object | no |
RecipeFile
Section titled “RecipeFile”One planned file operation. path is relative to the project root, with no .. segment, no drive letter and no backslash. write creates or replaces the file. merge replaces a block that carries a slopvac marker and creates the file otherwise. remove deletes the file or the block. content is required for write and merge.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
path |
string | yes | ||
action |
one of "write", "merge", "remove" |
yes | ||
content |
string | no |
RecipeResult
Section titled “RecipeResult”The plan. The host shows it, checks every path against the project root after symlink resolution, and applies it only when the command allows writes.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
files |
array of object (RecipeFile) |
yes |
A request or notification, dispatched on method. A request carries an id and a notification does not. An unknown method is not a schema error: a reader answers -32601 to a request and drops a notification.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
method |
string | yes | minimum length 1 |
PluginDeclaration
Section titled “PluginDeclaration”Pre-spawn declaration. The plugin manifest embeds it, and the manifest is part of the content that slopvac plugins trust hashes (plugin-manifest schema, owner slopvac-8l4.2.4). The host decides whether to spawn from this declaration, never from the initialize reply. network true allows the plugin to open connections, and the host does not spawn it in offline mode. hooks lists every hook the plugin may offer. features lists the features it may require or request. The initialize reply must stay inside the declaration.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
network |
boolean | yes | ||
hooks |
array of object (HookDecl) |
yes | ||
features |
object | yes | ||
features.required |
array of string (FeatureName) |
yes | unique items | |
features.optional |
array of string (FeatureName) |
yes | unique items |
FixEdit
Section titled “FixEdit”An edit with the finding that authorizes it. finding is the zero-based index into the findings array of the same document in the request. The host accepts the edit only when span lies inside the span of that finding, endpoints included. A zero-width span is an insertion and follows the same rule.
| Field | Type | Required | Constraints | Description |
|---|---|---|---|---|
finding |
integer | yes | minimum 0 | |
span |
object (Span) |
yes | Half-open range [start, end) of byte offsets into the original file bytes, BOM included. The end is exclusive, start is at most end, and both offsets fall on code point boundaries and never between the CR and LF of one CRLF. See docs/contract/positions.md. | |
text |
string | yes |