Extensibility / protocol v1
Extend the output, not the trust boundary.
A plugin can summarize already-authorized results or adapt them to a team's workflow. It should not inherit every credential merely because the CLI launched it.
Discovery and registration
The imagined CLI discovers explicitly registered executables named pulseflow-<name>. Registration records an absolute path, version and expected checksum. It does not execute arbitrary programs found in the current working directory or install code based on command-name typos.
# Illustrative commands only.
pulseflow plugins list --json
pulseflow plugins inspect durations --json
pulseflow plugins run durations --input trace-summary.json --jsonInstallation must be a deliberate, reviewed action outside an untrusted project checkout. Verify the publisher and dependency chain, then pin the expected artifact. A checksum proves integrity relative to a known value; it does not establish that the publisher is trustworthy.
Versioned input
{
"api_version": 1,
"workspace_id": "ws_demo",
"request_id": "req_demo_plugin_12",
"data": {
"traces": [
{"id": "tr_demo_1", "duration_ms": 184, "status": "succeeded"},
{"id": "tr_demo_2", "duration_ms": 620, "status": "failed"}
]
}
}Input arrives as one UTF-8 JSON object on stdin, capped at 1 MiB before parsing. A plugin must reject unsupported protocol versions, validate numeric fields and ignore compatible unknown fields. Raw authorization headers, tokens and unrestricted event payloads are excluded by default.
Versioned output
{
"api_version": 1,
"ok": true,
"summary": {
"trace_count": 2,
"mean_duration_ms": 402,
"failed_count": 1
},
"warnings": []
}Return one result on stdout, human diagnostics on stderr and a nonzero exit code for failure. Avoid mixing progress bars with JSON. Enforce output-size limits so a broken plugin cannot fill memory or a CI artifact store.
Execution controls
| Control | Reference default | Why it matters |
|---|---|---|
| Launch | Argument array; no shell interpolation | Prevents treating trace fields as shell syntax |
| Environment | Explicit allowlist; tokens omitted | Reduces accidental credential exposure |
| Deadline | 5 seconds | Bounds a stalled extension |
| Input / output | 1 MiB each | Limits memory and log growth |
| Cancellation | Terminate child on caller abort | Prevents abandoned background work |
Isolation is not automatic
A child process is not a security sandbox. A real untrusted plugin needs operating-system isolation, constrained filesystem access and explicit network policy. Merely omitting a token does not prevent it from reading other files available to the same user. Run only reviewed plugins on trusted hosts.
Author acceptance checklist
- Test malformed input, unsupported versions and empty result sets.
- Exercise timeout, cancellation and oversized output.
- Ensure results never contain raw secrets or terminal control sequences.
- Document deterministic ordering and numeric rounding rules.
- Keep plugin failure separate from a successful upstream query.
See command output conventions and CI restrictions before wiring an extension into a deployment gate.