From c9a2b201bed50e04896f6a9d14ccefe2a56349d2 Mon Sep 17 00:00:00 2001 From: gsxdsm Date: Wed, 8 Jul 2026 18:17:01 -0700 Subject: [PATCH] FN-7698: update cursor-cli-contract.md with verified model/auth commands Corrects the FN-3396 preflight's assumed Cursor CLI commands with the real, verified contract captured and implemented in FN-7697. - Documents model discovery as plain-text `cursor-agent models` (no --json flag), including output shape, empty-account state, and the unreliable --list-models alternative - Documents the parsing strategy: extract id before first ' - ' per line, filtering header/tip/empty-state lines - Documents authentication as derived from `cursor-agent status --format json` via `isAuthenticated`, distinct from the --version availability probe - Updates the Windows shell-backed probe list to include the auth-status probe and the corrected model-discovery command - Marks the FN-3396 contract-freeze section as superseded by the verified contract, retaining accurate parts (binary candidates, expected failure states, dynamic-first principle) - Adds an update-history note and FNXC:CursorCli comment documenting the correction Files changed: docs/cursor-cli-contract.md | 43 +++++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 14 deletions(-) Fusion-Task-Id: FN-7698 Fusion-Task-Lineage: ae30b81c-f750-4011-85ae-883b1c5eb48b Co-authored-by: Fusion (runfusion.ai) --- docs/cursor-cli-contract.md | 43 +++++++++++++++++++++++++------------ 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/docs/cursor-cli-contract.md b/docs/cursor-cli-contract.md index ad199744a5..57d549ce49 100644 --- a/docs/cursor-cli-contract.md +++ b/docs/cursor-cli-contract.md @@ -2,6 +2,13 @@ Date: 2026-05-07 + + +**Update history:** 2026-07-08 — corrected the model-discovery and auth-status contract from FN-3396's assumed `--json` commands to the verified `cursor-agent models` / `cursor-agent status --format json` contract captured and implemented in FN-7697. + ## Research method - Local runtime inspection in the task environment (`which`, direct command execution). @@ -54,7 +61,8 @@ On Windows, `cursor-agent`, `cursor`, and manual override paths can resolve to ` The Windows shell-backed path applies to every Cursor CLI command Fusion currently runs through the shared runner: - Configured binary / `cursor-agent --version` / `cursor --version` probe attempts. -- Model discovery attempts against the effective probe-selected binary: `models --json`, `model list --json`, and `models`. +- Auth-status probe against the effective probe-selected binary: `cursor-agent status --format json`. +- Model discovery against the effective probe-selected binary: `cursor-agent models` (plain text, no `--json` flag). Non-Windows probes and discovery continue to use direct spawn. Spawn errors such as `ENOENT` or `EACCES` are included in the unavailable probe reason in bounded diagnostic form so a working terminal command is distinguishable from known Cursor runtime/auth states; Fusion does not dump PATH, environment variables, or unbounded stdout/stderr. @@ -75,29 +83,36 @@ Observed command behavior in this environment: ## Structured output and model discovery -- **No stable model-list command was conclusively confirmed in this preflight** due CLI gating by keychain lock and inability to complete bounded remote research in this run. -- No contract evidence yet for a guaranteed `--json` or dedicated model enumeration command. +- **Confirmed:** `cursor-agent models` is the model-list command. Output is plain text — passing an unsupported JSON output flag (e.g. appending `--json` to the `models` subcommand) fails with `error: unknown option '--json'`. +- Output shape: an `Available models` header line, a blank line, then one model per line formatted as ` -