Skip to content

[IDE integrations] Add non-mutating zed inspect --format json diagnostics contract #191

Open

Description

@ORESoftware

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/root

Required 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, and executes_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.

Activity

  1. linear-code commented on Aug 5, 2026

    @linear-code
  2. ORESoftware commented on Aug 8, 2026

    @ORESoftware
    ContributorAuthor

    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 in zed-pkg-test/zed-pkg-e2e#119 on 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.

  3. ORESoftware commented on Aug 8, 2026

    @ORESoftware
    ContributorAuthor

    Promotion gate update: exact head d6842bd1219a657bcfbabd8d2cd2361a1a57dfba passed rustfmt, library tests, inspect integration, and all three fixed-OS adversarial lanes; strict Clippy found only one collapsible_if style 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 warnings all pass. zed-pkg-test/zed-pkg-e2e also 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 install recommendations are marked executes_package_code=true because manifests support lifecycle/build hooks; inspection itself remains read-only/offline.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions