feat(cli): ambient claim reminder in minted directories#1583
feat(cli): ambient claim reminder in minted directories#1583shapirodaniel wants to merge 2 commits into
Conversation
|
bugbot run |
📦 Bundle Stats —
|
| Metric | Value | vs stack/mint-and-claim/a1/05-remint-guardrail (61c9582) |
|---|---|---|
| Internal (raw) | 2.2 KB | - |
| Internal (gzip) | 838 B | - |
| Bundled (raw) | 11.20 MB | - |
| Bundled (gzip) | 2.11 MB | - |
| Import time | 865ms | +2ms, +0.2% |
bin:sanity
| Metric | Value | vs stack/mint-and-claim/a1/05-remint-guardrail (61c9582) |
|---|---|---|
| Internal (raw) | 782 B | - |
| Internal (gzip) | 423 B | - |
| Bundled (raw) | 9.90 MB | - |
| Bundled (gzip) | 1.78 MB | - |
| Import time | 2.09s | +1ms, +0.0% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — @sanity/cli-core
Compared against stack/mint-and-claim/a1/05-remint-guardrail (61c95822)
| Metric | Value | vs stack/mint-and-claim/a1/05-remint-guardrail (61c9582) |
|---|---|---|
| Internal (raw) | 114.1 KB | - |
| Internal (gzip) | 29.2 KB | - |
| Bundled (raw) | 21.76 MB | - |
| Bundled (gzip) | 3.46 MB | - |
| Import time | 765ms | -2ms, -0.3% |
🗺️ View treemap · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — @sanity/cli-build
Compared against stack/mint-and-claim/a1/05-remint-guardrail (61c95822)
@sanity/cli-build/_internal/build
| Metric | Value | vs stack/mint-and-claim/a1/05-remint-guardrail (61c9582) |
|---|---|---|
| Internal (raw) | 113.8 KB | - |
| Internal (gzip) | 28.7 KB | - |
| Bundled (raw) | 17.76 MB | - |
| Bundled (gzip) | 3.56 MB | - |
| Import time | 1.11s | -5ms, -0.5% |
@sanity/cli-build/_internal/env
| Metric | Value | vs stack/mint-and-claim/a1/05-remint-guardrail (61c9582) |
|---|---|---|
| Internal (raw) | 1.8 KB | - |
| Internal (gzip) | 644 B | - |
| Bundled (raw) | 1.31 MB | - |
| Bundled (gzip) | 333.8 KB | - |
| Import time | 121ms | +1ms, +0.7% |
@sanity/cli-build/_internal/extract
| Metric | Value | vs stack/mint-and-claim/a1/05-remint-guardrail (61c9582) |
|---|---|---|
| Internal (raw) | 8.6 KB | - |
| Internal (gzip) | 2.7 KB | - |
| Bundled (raw) | 155.0 KB | - |
| Bundled (gzip) | 39.5 KB | - |
| Import time | 241ms | -0ms, -0.0% |
🗺️ ./_internal/env · ./_internal/extract · @sanity/cli-build:./_internal/build treemap too large to embed · Artifacts
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
📦 Bundle Stats — create-sanity
Compared against stack/mint-and-claim/a1/05-remint-guardrail (61c95822)
| Metric | Value | vs stack/mint-and-claim/a1/05-remint-guardrail (61c9582) |
|---|---|---|
| Internal (raw) | 908 B | - |
| Internal (gzip) | 483 B | - |
| Bundled (raw) | 931 B | - |
| Bundled (gzip) | 491 B | - |
| Import time | ❌ ChildProcess denied: node | - |
Details
- Import time regressions over 10% are flagged with
⚠️ - Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 89fceb8. Configure here.
Coverage Delta
Comparing 11 changed files against main @ Overall Coverage
|
2a8a9ef to
6fd1ab1
Compare
89fceb8 to
0c76d83
Compare
|
bugbot run |
a3c5b99 to
8638226
Compare
aae0c9c to
16b3d9a
Compare
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 16b3d9a. Configure here.
902df26 to
55e28fe
Compare
88b6a10 to
8c23560
Compare
01432a6 to
84d2fe6
Compare
c92f162 to
563ef34
Compare
200134d to
5160e89
Compare
e2e0180 to
97b4f4d
Compare
2f1e555 to
fe566bc
Compare
09a38ca to
a5d9ee8
Compare
6037bb7 to
9f18054
Compare
7fccfad to
076ca58
Compare
e8cf817 to
72fb947
Compare
d8e149d to
c6fb008
Compare
b1dc8c0 to
d2d61a0
Compare
0147139 to
07cd654
Compare
ad4dd7b to
1e0fdca
Compare
f9f492c to
68fdc80
Compare
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 841af5d. Configure here.
ef9239f to
890f1e0
Compare
841af5d to
890f1e0
Compare
890f1e0 to
818801c
Compare
c16606b to
182305a
Compare
5e024e7 to
9c79ff8
Compare
|
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 9c79ff8. Configure here.
When the working directory's .env points at a registered unclaimed project and no other reminder fired, every CLI invocation prints one dim stateless line (project id, time left, claim URL) on stderr. No dedupe marker, no network — the tiered waterfall remains the only state-writing path, and still wins the single reminder slot per invocation. Co-Authored-By: Claude Fable 5 <[email protected]>
c0c3a4d to
61c9582
Compare
a1d8d81 to
f15a4f1
Compare
|
all feedback addressed on #1592, canceling this PR to consolidate after offline sync |
Description
this PR adds terminal reminders on
sanitycommands run inside a mint-and-claim provisioned directory, containing a.envwith pre-claimed project metadata. high level,~/.config/sanity/config.jsonand a project-scoped ledgerStack
(each PR reviews against its base; merge bottom-up only):
stack/mint-and-claim/a1/01-terminal-presentationstack/mint-and-claim/a1/02-mint-corestack/mint-and-claim/a1/03-claim-remindersstack/mint-and-claim/a1/04-init-signpoststack/mint-and-claim/a1/05-remint-guardrailstack/mint-and-claim/a1/06-ambient-reminder← this diffstack/mint-and-claim/a1/07-logout-env-tokenWhat to review
The ambient block in
runClaimNudgesandlookupClaimStateViaProject(the org read) in the mint service.Testing
Layer-scoped unit tests included (test:source ≥ 1:1); every layer validated standalone (full typecheck + targeted tests at each checkout).
🤖 Generated with Claude Code
Note
Low Risk
CLI-only UX and read-only claim checks on every command in minted dirs; fail-open behavior limits incorrect registry updates.
Overview
Adds a stateless ambient reminder when you run any
sanitycommand inside a minted project directory: if.envhas bothSANITY_PROJECT_IDandSANITY_AUTH_TOKENand the project is still on the unclaimed ledger, a dim expiry line (with claim URL) prints on every invocation—unless a tiered waterfall nudge already used the single reminder slot.Claim state for that line is checked via new
lookupClaimStateViaProject, which hits the project-scoped API with the robot token and treatsorganizationId === oSystemUnclaimedas claimable (404 → expired, 401/network → fail open). That path avoids the provision lookup rate budget used by escalated nudges.Tiered nudge copy is split one sentence per line; claimed/expired handling is centralized in shared helpers. Unit tests cover the org read and ambient behavior (tier precedence, no token after claim handoff, ledger fallback).
Reviewed by Cursor Bugbot for commit e02db89. Bugbot is set up for automated code reviews on this repo. Configure here.