Skip to content

moooon

Motir

Vibe your whole project. Bring an idea — Motir's three AI layers plan it, track it, and ship it, end to end. You're looking at Motir, built in Motir.

  • Vibe Project
  • Open Source
  • AI Agent
  • AI Loop
1
requests
0
upvotes
145
planned
1,361
shipped

Motir · Work items

MOTIR-4033Done

isCloud() predicate beside isCloudBilling() — the cloud-build flag, with a single-reader guard test

Add the cloud-build predicate isCloud() to lib/billing/availability.ts, beside the existing isCloudBilling(). Both read the explicit MOTIR_CLOUD flag (default false), but they answer different questions and must stay separate functions (ADR docs/decisions/billing-tiering.md §6): isCloudBilling() answers "is this a billing build?", isCloud() answers "is this a cloud build?". The public-projects gate consumes isCloud(), never isCloudBilling(), and never a raw process.env read.

Approach: isCloud() returns process.env['MOTIR_CLOUD'] === 'true', documented as the cloud-vs-self-host predicate distinct from isCloudBilling(). Add a single-reader guard test in the shape of tests/hosting/appUrlSeam.test.ts: it asserts that no non-billing surface calls isCloudBilling() (they call isCloud()), and that MOTIR_CLOUD is read only through the one named predicate.

Acceptance criteria

  • isCloud() is exported from lib/billing/availability.ts, reads MOTIR_CLOUD (explicit, default false), and is documented as the cloud-vs-self-host predicate distinct from isCloudBilling().
  • A single-reader guard test (shape of tests/hosting/appUrlSeam.test.ts) asserts: every caller of isCloudBilling() outside lib/billing/ is a billing surface, and the public-projects gate calls isCloud() — the test fails if a non-billing surface starts calling isCloudBilling().
  • No existing non-billing caller of isCloudBilling() is left, and no new one is introduced.
  • ≥90% coverage on the touched files.

Context refs

  • lib/billing/availability.tsisCloudBilling(), MOTIR_CLOUD, the explicit-flag discipline
  • docs/decisions/billing-tiering.md §6 — the two-questions-two-functions rule
  • lib/ai/planningConfig.tsisAiPlanningConfigured(), the OTHER flag this must not be confused with
  • tests/hosting/appUrlSeam.test.ts — the single-reader test shape