Skip to content

contract: freeze the issue codes and data field names the VS Code extension gates on (all fail open) #106

Description

@alpCaner

Summary

alp-sdk-vscode gates real behaviour on exact issue-code strings and unversioned data field names from tan's envelope. Every one of those matches fails open: rename any of them and the extension does not error, does not log, and does not warn — it silently skips the check or falls back to stale data, with CI green on both sides.

v0.4.0 is about to be cut with ~36 commits and six fixes since v0.3.1, and the extension pins SUPPORTED_CLI_VERSION = "0.3.1". This is the last moment before those skew paths are exercised by customers for the first time.

The exact strings the extension matches on

Issue codes (consumer file:line in alplabai/alp-sdk-vscode at d334faa):

code consumer what dies if renamed
bootstrap.windows-unsupported src/alpCli/service.ts:402 host refusal ignored
bootstrap.yocto-host src/alpCli/service.ts:417 (also requires severity === "error") a Yocto-only project is sent into a bootstrap that cannot work on this host
bootstrap.prerequisites-missing src/alpCli/service.ts:447 tan's own refusal is not recognised, so the extension spawns the real bootstrap terminal anyway and the customer watches the identical failure scroll past with the install guidance lost
presets.sdk-root-unresolved src/ideHub/newProjectFlowPanel.ts:167 the New Project wizard silently falls back to a static catalogue

The fail-open is structural, not incidental: prerequisitesMissingIssue returns ?? null and bootstrapHostVerdict returns { refuse: false } for anything unrecognised. That default is deliberate and correct — an unknown issue must not block a user — but it means a rename is indistinguishable from "no problem".

data field names read with ?? [] fallbacks that degrade silently:

  • data.soms[].coressrc/ideHub/newProjectFlowPanel.ts:158,186
  • data.checks[].name / .status, data.summary.{pass,warn,fail}, data.nextStepssrc/toolchain.ts:169-172, plus a literal c.name === "workspace" at :249 and :284
  • data.available.projectTemplatessrc/ideHub/newProjectFlowPanel.ts:225
  • data.examples[].sourceDir:266
  • data.releasessrc/ideHub/sdkManagerMessages.ts:253
  • data.writtensrc/ideHub/buildPlanPanel.ts:222
  • data.targets / .written / .failedsrc/loader.ts:47-49

Worked example of the silent failure

Rename data.soms in a MINOR release. The extension produces no error, no toast and no log line — the New Project wizard falls back to its static E1M_MODULES catalogue, and a heterogeneous SoM scaffolds single-core with no IPC. The reference device E1M-AEN801 is multi-core, so this is the default path, not an edge case. The customer's first project is quietly wrong and builds green.

Ask

  1. A test in tan-cli asserting those four issue-code strings survive, and listing them in docs/CLI.md beside the exit codes as versioned public contract. The extension side should NOT be loosened to prefix matching — a prefix match on bootstrap. would swallow codes it has no verdict for.
  2. Emit one golden JSON envelope per command family into the release assets, so the extension's contract test diffs against a published artefact instead of a hand-copied fixture. The extension can then fail loudly on a field rename at CI time rather than silently at a customer's desk.

Why here and not there

The extension can only detect a rename by hardcoding the names it expects — which is what it already does, and what makes it brittle. The contract belongs to whoever owns the envelope. Freezing it in tan is the fix; a stricter parser in the extension is a workaround.

Related: #98 (workspace reuse comparing only Zephyr MAJOR.MINOR) is the same shape of problem — a comparison too coarse to notice a real change.

Activity

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions