Skip to content

fix(api): remove retired deployment mode responses - #205

Open
andrei-hasna wants to merge 1 commit into
mainfrom
fix/loo3-00149-version-health-mode
Open

fix(api): remove retired deployment mode responses#205
andrei-hasna wants to merge 1 commit into
mainfrom
fix/loo3-00149-version-health-mode

Conversation

@andrei-hasna

@andrei-hasna andrei-hasna commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • remove retired deployment mode output and mode-derived response branching from version, health, readiness, and version aliases
  • report only canonical sqlite or postgresql backend values on health and healthz
  • update OpenAPI, generated SDK, regression coverage, smoke checks, and the repository health conformance sample

Verification

  • affected endpoint, API, serve, and SDK tests: 99 pass, 0 fail
  • backend-selection tests: 121 pass, 0 fail
  • typecheck: exit 0
  • build: exit 0
  • private boundary scan: exit 0
  • staged Shield: exit 0, no security issues found
  • exact-range Gitleaks from 41ff1df through 149371b: exit 0, one commit scanned, no leaks found
  • built version output and all six foundation aliases omit mode, deploymentMode, self_hosted, remote, and hybrid
  • health runtime controls cover both backend values: sqlite and postgresql

Pending dependency

check:contracts remains pending on task a0919e4a-1ed8-4e9c-9f33-05cf756fdfd6 / Loops PR #200. The current pinned contracts 0.5.2 rejects the canonical backend shape with: health payload invalid: mode Required; root Unrecognized key backend. This PR does not modify hasna.contract.json, package.json, bun.lock, or waive the gate.

Task: 263659dd-2311-4ea3-bc56-6c2199e2155c
Commit: 149371b
Tree: 8598de8d6ed3f92c80768f64fd6d47e22575fcc1


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@andrei-hasna

Copy link
Copy Markdown
Contributor Author

[REVIEW] NO_GO — #205 @ 149371b — lens: correctness+security+gates, reviewer Timon (1 of 1)

What I ran:

  • bun install — exit 0. Setup only; its prepare hook also completed the repository build.
  • bun run typecheck — exit 0; 0 TypeScript diagnostics.
  • bun run test — exit 1; 1173 pass, 60 skip, 1 fail, 11 snapshots, 9433 expect() calls, 1234 tests across 77 files.
  • bun -e 'import { apiStatus } from "./src/api/index.ts"; console.log(JSON.stringify(apiStatus()))' — exit 0; the returned status still contains deploymentMode, activeDeploymentMode, self_hosted, and other retired mode-derived fields.

What I read:

  • The complete base-to-head diff for all eight changed files against origin/main at 41ff1dfa32b89f7fe5a0a22f597d2b29566e2273.
  • Surrounding API routing and response code, storage-backend contracts and implementations, API server call sites, OpenAPI schemas, generated SDK code, contract-conformance code/tests, smoke code, and the declared package scripts.

Blocking P0/P1 findings:

  1. P1 — the repository's required test gate is broken. scripts/check-contract-conformance.test.mjs fails because the installed @hasna/contracts@0.5.2 health schema still requires mode and rejects the new backend field. The literal gate output is: health payload invalid: mode Required; <root> Unrecognized key(s) in object: 'backend'. A PR whose declared test command exits 1 cannot merge.
  2. P1 — the stated removal is incomplete on currently reachable API paths. Authenticated GET /status and GET /v1/status still return apiStatus(), whose live output contains the retired deployment-mode vocabulary. The new regression test explicitly leaves /status as an unconstrained object and never exercises that payload, so it cannot catch this remaining response.

Non-blocking follow-ups:

  • None.

Remedy:

  • Update the repository to a contracts version whose health schema accepts {status, version, backend} and make the contract-conformance gate pass.
  • Remove retired deployment-mode fields from the two status responses, add direct response tests for both paths, then rerun the affected contract/API lanes plus the declared typecheck and test gates.

@andrei-hasna

Copy link
Copy Markdown
Contributor Author

Remediation investigation for the current NO_GO:

  • The status-response fix is local and bounded: route authenticated /status and /v1/status to the new {status, version, backend} envelope and type both OpenAPI operations accordingly.
  • The contract failure is not a small bump. The first compatible published contracts line accepts backend but also activates currently unmet required gates for SDK/MCP/CLI surface declarations, PostgreSQL live-gate metadata, public-manifest safety, packed-artifact scanning, and the shared credential-resolution seam.
  • I restored this worktree to the exact reviewed head. No remediation commit was created or pushed.

The PR must remain open until the contracts migration is completed without waiving required checks, the two status responses are corrected, and the declared bun run test gate exits 0.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant