Skip to content

feat(self-hosting): add an authenticated self-check and a helm test that proves a real install works - #10769

Merged
waleedlatif1 merged 6 commits into
stagingfrom
waleed/selfhost-selfcheck
Dec 5, 2026
Merged

waleedlatif1 merged 6 commits into
stagingfrom
waleed/selfhost-selfcheck

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • New GET /api/cron/self-check (cron-secret auth): database, migrations (journal vs applied), Redis, and app→realtime checks; returns a JSON report, 200 when everything passes and 503 otherwise. Details are fixed phrases plus error codes, never hosts or messages
  • With the Kubernetes sandbox provider it also starts a real sandbox and proves confinement: execution, uid 1000 and no agent secrets readable, agent refuses missing/forged tokens, no cloud metadata credentials, kube API never lists pods, the app pod and private DB/Redis addresses unreachable, and a neighbor sandbox's agent port unreachable (with the app reaching that neighbor as the positive control). One run per replica at a time, cached 30s
  • The confinement probe moves out of the live test into a shared module, so the live suite and the self-check can't drift
  • Chart (1.22.0): helm test runs the self-check (skips cleanly when CRON_SECRET is unset or the app predates the route), test pods use curl, and the app/realtime NetworkPolicies admit the test pods (they were refused with networkPolicy.enabled and ingress off)
  • Image inventory: adds pause and the Mothership sandbox placeholders; drops busybox; the published chart's images.yaml also lists the sandbox images for its appVersion (written at publish from that release tag)
  • CI: the sandbox e2e-app job runs helm test against the PR's image and a negative step that opens the sandbox network and asserts the self-check fails

Type of Change

  • New feature

Testing

  • Vitest: confinement rules (one case per rule, incl. leaked agent env and token checks), malformed probe results, run/caching failure path — red against the pre-fix code; 35 self-check + 25 sandbox tests pass
  • helm-unittest 241/241 (12 new self-check cases); helm lint; script tests 1033 pass; images:check; check:api-validation:strict; actionlint
  • Test-pod script run against a local stub (200 pass; 503/401/refused fail; 404 and missing secret skip). The real-cluster proof is the sandbox e2e-app job on this PR

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing (new tests pass the test-audit authoring gate)
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@waleedlatif1
waleedlatif1 requested a review from a team as a code owner December 4, 2026 16:38
@vercel

vercel Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Dec 5, 2026 1:21am UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 29 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/self-check/confinement.ts Resolved
Comment thread apps/sim/lib/self-check/sandbox.ts Resolved
Comment thread .github/workflows/sandbox.yml Resolved
Comment thread helm/sim/images.yaml Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 34 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/self-check/sandbox.ts Resolved
Comment thread .github/workflows/sandbox.yml Resolved
@waleedlatif1
waleedlatif1 force-pushed the waleed/selfhost-selfcheck branch from 71e3dd9 to 224ab35 Compare December 5, 2026 00:43
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 42 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread helm/sim/templates/NOTES.txt Resolved
Comment thread apps/sim/lib/self-check/confinement.ts Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 43 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Dec 5, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 43 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

You've manually re-run cubic several times on this PR. Each manual re-review checks the full PR again and counts toward your usage quota. To preserve your usage limits, we recommend letting cubic automatically review new commits.

Turn on auto-fix | Re-trigger cubic

@waleedlatif1
waleedlatif1 merged commit 98cee77 into staging Dec 5, 2026
102 checks passed

This branch was previously deployed

1 inactive deployment
Preview — 0fe9620c Deployed Dec 5, 2026 by vercel[bot]
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