Repository navigation
[IDE integrations] Add non-mutating zed inspect --format json diagnostics contract #191
Copy link
Copy link
Open
Description
Goal
Add a stable, credential-free, non-mutating diagnostics endpoint for editor integrations, beginning with the planned zed-pkg/zed-sublimetext plugin and reusable by VS Code, IntelliJ, JetBrains Air, and other IDE clients.
Proposed command:
zed inspect --format json --root /absolute/project/rootRequired behavior
- stdout contains exactly one UTF-8 JSON document; logs/progress go to stderr;
- no project mutation, package downloads, registry contact, credential loading, or build-hook execution by default;
- inspect
.zpkg.toml,.zpkg.lock, configured[install].dir, transaction recovery state, local store references, workspace members, adapter outputs, and frozen-install readiness; - include stable diagnostic codes, severity, message/detail, precise locations, and declarative recommended actions;
- actions use argv arrays, never shell strings, and declare
mutates_project,requires_network, andexecutes_package_code; - absolute or explicitly rooted paths only;
- redact secrets from both streams;
- additive schema evolution within a major version and explicit
schema_version.
Proposed response shape
{
"schema_version": "1.0",
"root": "/work/project",
"package": {
"manifest": "/work/project/.zpkg.toml",
"lockfile": "/work/project/.zpkg.lock",
"materialization_dir": "/work/project/zed_modules"
},
"summary": {
"health": "warning",
"errors": 0,
"warnings": 1
},
"diagnostics": [
{
"code": "LOCK_STALE",
"severity": "warning",
"message": "Manifest intent is newer than the lockfile",
"location": {"path": "/work/project/.zpkg.toml", "line": 12, "column": 1},
"actions": [
{
"id": "refresh-lock",
"title": "Refresh the lockfile",
"kind": "zed-command",
"argv": ["zed", "install"],
"mutates_project": true,
"requires_network": true,
"executes_package_code": false
}
]
}
]
}Acceptance criteria
- Pure inspection is deterministic and does not mutate filesystem state.
- Offline inspection succeeds for all local checks.
- Malformed manifest/lock data returns structured diagnostics rather than unstructured panics.
- The command distinguishes the zed-pkg CLI from the Zed editor launcher in integration tests.
- Linux, macOS, and Windows paths are covered.
- JSON-schema fixtures and compatibility tests are committed.
- An editor can render all recommendations without parsing human CLI output.
- No recommendation is automatically executed by the CLI.
Initial editor fallback
Until this lands, zed-sublimetext can provide a deterministic local subset: manifest/lock/materialization relationships, generated-consumer identity review, interrupted transaction detection, and zed --version/--help executable validation. The IDE should continue to confirmation-gate every mutating action even after this endpoint ships.
Metadata
Metadata
Assignees
Labels
No labels
Activity
linear-code commentedon Aug 5, 2026
DEN-2326
ORESoftware commentedon Aug 8, 2026
Implementation is now in draft PR #235 (
agent/den-2175-inspect-json-v1). The command is intentionally early-dispatched before ordinary startup so inspection cannot trigger credential-aware config, registry access, terminal environment publication, or transaction recovery. It emits one JSON document with schema v1, stable diagnostics, lock/materialization/recovery/store state, and confirmation-gated argv/cwd recommendations. Independent black-box certification is inzed-pkg-test/zed-pkg-e2e#119on Linux/macOS/Windows with poisoned auth state, unreachable registry, and a pending transaction sentinel. Promotion remains gated on exact-head product CI plus that test-org lane.ORESoftware commentedon Aug 8, 2026
Promotion gate update: exact head
d6842bd1219a657bcfbabd8d2cd2361a1a57dfbapassed rustfmt, library tests, inspect integration, and all three fixed-OS adversarial lanes; strict Clippy found only onecollapsible_ifstyle warning. A self-removing one-shot workflow is now installed on the inspect branch to apply only Clippy's structural rewrite and push it only after rustfmt + library tests + inspect integration +clippy --all-targets -D warningsall pass.zed-pkg-test/zed-pkg-e2ealso has a final-head certification workflow that waits for that repaired commit, resolves/binds its immutable SHA to PR #235, reruns strict quality + Ubuntu/macOS/Windows safety contracts, and fails if the product branch moves during certification. Install remediation risk metadata is conservative:zed installrecommendations are markedexecutes_package_code=truebecause manifests support lifecycle/build hooks; inspection itself remains read-only/offline.