feat(mobile): consume generated Theorem contracts - #209
Conversation
|
ECC bundle files are already tracked in this repository. Skipping generation of another bundle PR. |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: cc11e784ca
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -1,37 +0,0 @@ | |||
| [package] | |||
There was a problem hiding this comment.
Retarget the desktop runtime before deleting the API crate
When apps/desktop is built, apps/desktop/src-tauri/Cargo.toml loads crates/commonplace-desktop-runtime, whose manifest still declares commonplace-api = { path = "../../apps/commonplace-api" }. Deleting this manifest therefore makes Cargo fail before compilation with failed to read .../apps/commonplace-api/Cargo.toml; either retain the crate or retarget the desktop runtime dependency as part of this change.
AGENTS.md reference: AGENTS.md:L31-L32
Useful? React with 👍 / 👎.
| pin.updatedAt = process.env.UPDATED_AT; | ||
| fs.writeFileSync(pinPath, `${JSON.stringify(pin, null, 2)}\n`); |
There was a problem hiding this comment.
Preserve the timestamp when the source SHA is unchanged
On a repeated dispatch for a SHA already present on main, UPDATED_AT defaults to the current time and this assignment rewrites the source-pin JSON even though the generated contracts and fixtures are identical. Consequently the later git diff --quiet -- packages/mobile-contracts check can never take its "already current" path for such dispatches and instead creates a timestamp-only update commit/PR; only update this field when the pinned SHA or contract content actually changes.
Useful? React with 👍 / 👎.
| The canonical source tree is `Travis-Gilbert/Theorem/apps/commonplace-api`. Its | ||
| surviving deployment is the Railway service at | ||
| `https://commonplace-api-production.up.railway.app`; the prior Fly deployment is | ||
| undeployed and retired. CommonPlace contains no second `apps/commonplace-api` | ||
| source tree. Railway must be relinked to the Theorem source before its next |
There was a problem hiding this comment.
Retarget the remaining API source paths
After establishing that CommonPlace no longer contains apps/commonplace-api, this authoritative map still directs readers to apps/commonplace-api/src/schema.rs on line 45 and proposes emitting apps/commonplace-api/schema.graphql on lines 93–96; the root README likewise continues to describe the deleted local tree. Anyone following these development and schema-drift instructions now reaches nonexistent paths, so these references need to point to the canonical Theorem tree or explicitly describe a sibling checkout.
Useful? React with 👍 / 👎.
| if [ -z "$SOURCE_SHA" ]; then | ||
| echo "The dispatch must name an exact source SHA." >&2 | ||
| exit 1 |
There was a problem hiding this comment.
Reject non-SHA source refs before checkout
When a manual or repository dispatch accidentally supplies a branch, tag, or abbreviated hash in source_sha, this check accepts it because it only verifies that the value is nonempty, and actions/checkout then resolves that mutable ref while the workflow records it as the supposedly exact source.sha. This defeats the package's immutable provenance guarantee and can make later regeneration produce different bindings from the same recorded pin; require a full 40-character hexadecimal commit ID before checkout, as the existing RustyRed pin updater does.
Useful? React with 👍 / 👎.
Summary
@commonplace/mobile-contractswith generated types and canonical fixtures pinned to Theorem commit148132430859bdf38ac51738430319826fd98925Dependency
Validation
corepack pnpm --filter mobile exec tsc --noEmit/healthzreturned HTTP 200 during implementation validationLive gates
THEOREM_SOURCE_TOKENto this repository with read access to the private Theorem source before exercising the update workflowTravis-Gilbert/Theorem/apps/commonplace-apibefore the next source buildExisting lint debt
expo lintstill reports the pre-existingreact-hooks/set-state-in-effectfinding inapps/mobile/src/lib/waitTier.ts; this PR does not modify that file.