Skip to content

fix: report API connection in attachments status - #30

Merged
andrei-hasna merged 1 commit into
mainfrom
a84c9f77-617c-4f76-ba6b-d590acc6dbe1
Aug 10, 2026
Merged

fix: report API connection in attachments status#30
andrei-hasna merged 1 commit into
mainfrom
a84c9f77-617c-4f76-ba6b-d590acc6dbe1

Conversation

@andrei-hasna

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

Copy link
Copy Markdown
Contributor

Summary

  • replace the retired Mode: self_hosted/cloud (/v1) status label with Connection: HTTP API (/v1)
  • cover reachable and failed API status paths without changing transport or health behavior

Todos: a84c9f77-617c-4f76-ba6b-d590acc6dbe1

Verification

  • bun test src/cli/commands/status.test.ts (13 pass, 0 fail)
  • bun test src/cli/index.test.ts (2 pass, 0 fail)
  • bun run typecheck
  • real bun src/cli/index.ts status against a local mock /v1 API
  • shield review and redacted staged/commit Gitleaks scans

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] GO — #30 @ 1050ae2 — lens: correctness+security+gates, reviewer Damon (1 of 1)

Reviewed the exact candidate against freshly fetched origin/main at 8e54c7d.

What I read:

  • git log --oneline origin/main..HEAD: one commit, 1050ae2 fix: replace retired status mode label.
  • git diff origin/main...HEAD --stat: 2 files changed, 63 insertions, 2 deletions.
  • Full diff and surrounding source for src/cli/commands/status.ts and src/cli/commands/status.test.ts.
  • The status command's store-resolution path in src/core/store.ts, the HTTP client resolution in src/core/cloud-v1.ts, configuration context in src/core/config.ts, scripts/test.sh, and the declared scripts in package.json.

Commands and results:

  • bun install — exit 0. Setup only; its prepare hook built the package, but this is not reported as the test gate.
  • bun run typecheck — exit 0. The compiler emitted no pass/fail count; one declared typecheck invocation passed and zero failed.
  • bun run test — exit 0. Exact gate summary: Checks: 58 total, 58 passed, 0 failed.
  • git diff --check origin/main...HEAD — exit 0.

Security/correctness trace:

  • The production change replaces only the displayed API connection label on both the successful and failed HTTP status paths.
  • Store selection, API-key handling, request authorization, storage access, mutation behavior, and failure control flow are unchanged.
  • New tests exercise both a successful authorized list response and a thrown network error, assert the replacement label, and reject the retired mode vocabulary.

Blocking P0/P1 findings: none.

Non-blocking follow-ups: none. The declared test gate reported its existing live-PostgreSQL skips because HASNA_ATTACHMENTS_TEST_DATABASE_URL is unset; this PR does not touch PostgreSQL or migration code.

@andrei-hasna
andrei-hasna merged commit 2c43e2f into main Aug 10, 2026
3 checks passed
@andrei-hasna
andrei-hasna deleted the a84c9f77-617c-4f76-ba6b-d590acc6dbe1 branch August 10, 2026 11:15
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