@milesroxas/design-hub 0.6.2 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/README.md +16 -6
  2. package/core/review/model.ts +124 -6
  3. package/core/review/policy.test.ts +103 -24
  4. package/core/review/policy.ts +43 -7
  5. package/core/review/service.test.ts +569 -33
  6. package/core/review/service.ts +272 -76
  7. package/core/review/store.ts +24 -4
  8. package/dist/core/review/model.d.ts +59 -4
  9. package/dist/core/review/model.js +98 -4
  10. package/dist/core/review/policy.d.ts +21 -2
  11. package/dist/core/review/policy.js +34 -2
  12. package/dist/core/review/service.d.ts +39 -11
  13. package/dist/core/review/service.js +237 -77
  14. package/dist/core/review/store.d.ts +17 -4
  15. package/dist/core/review/store.js +21 -3
  16. package/dist/scripts/bootstrap.d.ts +16 -14
  17. package/dist/scripts/bootstrap.js +56 -39
  18. package/dist/scripts/comments.d.ts +10 -2
  19. package/dist/scripts/comments.js +18 -7
  20. package/dist/scripts/lib/deploy.d.ts +12 -4
  21. package/dist/scripts/lib/deploy.js +47 -13
  22. package/dist/scripts/lib/vercel.d.ts +8 -2
  23. package/dist/scripts/lib/vercel.js +23 -9
  24. package/dist/scripts/people.d.ts +13 -26
  25. package/dist/scripts/people.js +68 -35
  26. package/dist/scripts/preflight.js +2 -2
  27. package/dist/scripts/share.d.ts +2 -3
  28. package/dist/scripts/share.js +18 -10
  29. package/dist/server/api.d.ts +6 -2
  30. package/dist/server/api.js +65 -24
  31. package/dist/server/fake-upstash.js +3 -2
  32. package/dist/server/local.js +2 -0
  33. package/dist/server/session.d.ts +25 -10
  34. package/dist/server/session.js +69 -52
  35. package/dist/server/upstash.js +4 -3
  36. package/dist/vercel/proxy.d.ts +5 -3
  37. package/dist/vercel/proxy.js +183 -157
  38. package/dist/vite/plugin.js +5 -5
  39. package/kit/prefs.ts +19 -2
  40. package/package.json +2 -2
  41. package/shell/review/Bar.tsx +97 -4
  42. package/shell/review/People.tsx +178 -45
  43. package/shell/review/Pins.tsx +39 -24
  44. package/shell/review/Review.tsx +113 -29
  45. package/shell/review/ThreadCard.tsx +25 -13
  46. package/shell/review/client.ts +64 -23
  47. package/shell/review/review.css +16 -2
  48. package/shell/review/view.test.ts +73 -1
  49. package/shell/review/view.ts +49 -3
  50. package/skills/miles-deploy/SKILL.md +44 -16
  51. package/skills/miles-design-hub/SKILL.md +5 -5
  52. package/skills/miles-new-feature/SKILL.md +1 -1
  53. package/skills/miles-review/SKILL.md +10 -6
  54. package/skills/miles-worktrees/SKILL.md +1 -1
  55. package/templates/conductor/settings.toml +1 -1
  56. package/templates/guide.md +1 -1
@@ -3,7 +3,10 @@ import { test } from 'node:test';
3
3
  import {
4
4
  type Draft,
5
5
  draftOf,
6
+ filtered,
7
+ filterNote,
6
8
  initialView,
9
+ lensOf,
7
10
  roundOf,
8
11
  scopeOf,
9
12
  stepFrom,
@@ -18,8 +21,16 @@ const run = (start: View, ...actions: ViewAction[]) => actions.reduce(view, star
18
21
  const wholePage: Draft = { target: null, offset: null };
19
22
 
20
23
  test('the layer starts with comment mode off, hidden or not as it was left', () => {
21
- assert.deepEqual(initialView(false), { hidden: false, commenting: false, card: null, resolved: false });
24
+ assert.deepEqual(initialView(false), {
25
+ hidden: false,
26
+ commenting: false,
27
+ card: null,
28
+ resolved: false,
29
+ filter: 'all',
30
+ clientView: false,
31
+ });
22
32
  assert.equal(initialView(true).hidden, true);
33
+ assert.equal(initialView(false, true).clientView, true);
23
34
  });
24
35
 
25
36
  test('start turns comment mode on with no card; stop turns it off and drops the card', () => {
@@ -153,3 +164,64 @@ test('the toggle reads Page only while a page comment is being written', () => {
153
164
  assert.equal(scopeOf({ type: 'draft', draft: { target: {} as Element, offset: { x: 0, y: 0 } } }), 'pin');
154
165
  assert.equal(scopeOf({ type: 'thread', id: 'x' }), 'pin');
155
166
  });
167
+
168
+ test('the filter narrows by audience and survives the mode turning off and on', () => {
169
+ const state = run(
170
+ initialView(false),
171
+ { type: 'filter', filter: 'internal' },
172
+ { type: 'start' },
173
+ { type: 'open', id: 'c1' },
174
+ { type: 'stop' },
175
+ );
176
+ assert.equal(state.filter, 'internal');
177
+ assert.equal(view(state, { type: 'filter', filter: 'all' }).filter, 'all');
178
+ });
179
+
180
+ test('Client view turns on and off, closes the card and sets the filter back to all', () => {
181
+ const on = run(
182
+ initialView(false),
183
+ { type: 'start' },
184
+ { type: 'filter', filter: 'client' },
185
+ { type: 'open', id: 'c1' },
186
+ { type: 'clientView', on: true },
187
+ );
188
+ assert.deepEqual([on.clientView, on.card, on.filter, on.commenting], [true, null, 'all', true]);
189
+ const off = view(on, { type: 'clientView', on: false });
190
+ assert.deepEqual([off.clientView, off.card], [false, null]);
191
+ // Hiding comments leaves Client view as it was.
192
+ assert.equal(run(on, { type: 'hide' }, { type: 'show' }).clientView, true);
193
+ });
194
+
195
+ test('the lens: Studio sees as Studio until Client view; a Client never does, whatever was stored', () => {
196
+ assert.deepEqual(lensOf(true, { clientView: false }), { asStudio: true, clientView: false });
197
+ assert.deepEqual(lensOf(true, { clientView: true }), { asStudio: false, clientView: true });
198
+ assert.deepEqual(lensOf(false, { clientView: true }), { asStudio: false, clientView: false });
199
+ assert.deepEqual(lensOf(false, { clientView: false }), { asStudio: false, clientView: false });
200
+ });
201
+
202
+ test('filtered lets through all, one audience, or everything the server sent in Client view', () => {
203
+ const threads = [
204
+ { id: 'i', audience: 'internal' },
205
+ { id: 'k', audience: 'client' },
206
+ ];
207
+ const ids = (cs: { id: string }[]) => cs.map((c) => c.id);
208
+ assert.deepEqual(ids(filtered(threads, { filter: 'all', clientView: false })), ['i', 'k']);
209
+ assert.deepEqual(ids(filtered(threads, { filter: 'internal', clientView: false })), ['i']);
210
+ assert.deepEqual(ids(filtered(threads, { filter: 'client', clientView: false })), ['k']);
211
+ assert.deepEqual(ids(filtered(threads, { filter: 'internal', clientView: true })), ['i', 'k']);
212
+ });
213
+
214
+ test('the bar names a narrowing filter, and says nothing with All or in Client view', () => {
215
+ assert.equal(filterNote({ filter: 'all', clientView: false }), null);
216
+ assert.equal(filterNote({ filter: 'internal', clientView: false }), 'Internal only');
217
+ assert.equal(filterNote({ filter: 'client', clientView: false }), 'Client-facing only');
218
+ assert.equal(filterNote({ filter: 'internal', clientView: true }), null);
219
+ // Turning Client view on sets the filter back to All, so leaving it shows no stale note.
220
+ const left = run(
221
+ initialView(false),
222
+ { type: 'filter', filter: 'client' },
223
+ { type: 'clientView', on: true },
224
+ { type: 'clientView', on: false },
225
+ );
226
+ assert.equal(filterNote(left), null);
227
+ });
@@ -4,6 +4,9 @@
4
4
  /** A new comment being placed: the element it is about and where on it, as fractions of its box, or neither for the whole page. */
5
5
  export type Draft = { target: Element | null; offset: { x: number; y: number } | null };
6
6
 
7
+ /** Which threads Studio lists: every one, or one audience. Matches core's Audience values. */
8
+ export type Filter = 'all' | 'internal' | 'client';
9
+
7
10
  /** The one card on screen: a thread, a comment being written, or the people. */
8
11
  export type Card = { type: 'thread'; id: string } | { type: 'draft'; draft: Draft } | { type: 'people' };
9
12
 
@@ -12,13 +15,18 @@ export type Card = { type: 'thread'; id: string } | { type: 'draft'; draft: Draf
12
15
  * field it touches at once and no two fields can disagree. `commenting` is
13
16
  * comment mode: pins on the page and a click anywhere starts a comment. Off,
14
17
  * the page carries only the button. `hidden` tucks even the button into the
15
- * screen's edge; it is the one field that outlives the page (kit/prefs.ts).
18
+ * screen's edge. `filter` narrows Studio's list by audience, in memory like
19
+ * `resolved`. `clientView` is Studio looking as a Client does: the list is
20
+ * fetched as a Client's and Studio's controls step aside. `hidden` and
21
+ * `clientView` outlive the page (kit/prefs.ts).
16
22
  */
17
23
  export type View = {
18
24
  hidden: boolean;
19
25
  commenting: boolean;
20
26
  card: Card | null;
21
27
  resolved: boolean;
28
+ filter: Filter;
29
+ clientView: boolean;
22
30
  };
23
31
 
24
32
  export type ViewAction =
@@ -31,13 +39,17 @@ export type ViewAction =
31
39
  | { type: 'escape' }
32
40
  | { type: 'resolved' }
33
41
  | { type: 'hide' }
34
- | { type: 'show' };
42
+ | { type: 'show' }
43
+ | { type: 'filter'; filter: Filter }
44
+ | { type: 'clientView'; on: boolean };
35
45
 
36
- export const initialView = (hidden: boolean): View => ({
46
+ export const initialView = (hidden: boolean, clientView = false): View => ({
37
47
  hidden,
38
48
  commenting: false,
39
49
  card: null,
40
50
  resolved: false,
51
+ filter: 'all',
52
+ clientView,
41
53
  });
42
54
 
43
55
  export function view(state: View, action: ViewAction): View {
@@ -64,9 +76,43 @@ export function view(state: View, action: ViewAction): View {
64
76
  return { ...state, hidden: true, commenting: false, card: null };
65
77
  case 'show':
66
78
  return { ...state, hidden: false };
79
+ case 'filter':
80
+ return { ...state, filter: action.filter };
81
+ // The other view holds other threads: the card closes, and the filter goes back to all, as a Client has none.
82
+ case 'clientView':
83
+ return { ...state, clientView: action.on, filter: 'all', card: null };
67
84
  }
68
85
  }
69
86
 
87
+ /**
88
+ * How the layer looks to this person. `studio` is whether the policy gives
89
+ * them Studio's view. As Studio: audience marks, the filter and the choice on
90
+ * a new thread. In Client view, Studio sees none of that, as a Client does.
91
+ */
92
+ export function lensOf(studio: boolean, v: Pick<View, 'clientView'>) {
93
+ return { asStudio: studio && !v.clientView, clientView: studio && v.clientView };
94
+ }
95
+
96
+ const FILTER_NOTE = { internal: 'Internal only', client: 'Client-facing only' } as const;
97
+
98
+ /**
99
+ * What the bar says while the filter narrows the list, so Studio never
100
+ * forgets a thread is out of sight; null with All, and in Client view, which
101
+ * has no filter.
102
+ */
103
+ export function filterNote(v: Pick<View, 'filter' | 'clientView'>): string | null {
104
+ return v.clientView || v.filter === 'all' ? null : FILTER_NOTE[v.filter];
105
+ }
106
+
107
+ /** The threads the filter lets through; in Client view, the list is already a Client's. */
108
+ export function filtered<T extends { audience: string }>(
109
+ roots: T[],
110
+ v: Pick<View, 'filter' | 'clientView'>,
111
+ ): T[] {
112
+ if (v.clientView || v.filter === 'all') return roots;
113
+ return roots.filter((c) => c.audience === v.filter);
114
+ }
115
+
70
116
  type Thread = { id: string; status: 'open' | 'resolved' };
71
117
 
72
118
  /** The threads comment mode steps through: the open ones, the resolved too when shown, and always the open card's, so resolving it never pulls the card away. */
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  name: miles-deploy
3
- description: "Deploy the prototypes to Vercel behind the password gate and hand out the share link: the pre-flight (pnpm preflight), the GATE_* env, the review store for comments, the handover message. Load when the user asks to deploy, share, send a link, set or rotate the password, turn on comments, or check the work before any of those. Triggers on: deploy, share, share link, send to the client, send it to the team, put it online, publish, go live, update the link, push the latest, Vercel, sign in to Vercel, vercel login, password, gate, GATE_PASSWORD, production, preview URL, pre-flight, preflight, ready to send, turn on comments, review store, invite someone."
3
+ description: "Deploy the prototypes to Vercel behind the gate and hand out sign-in links: the pre-flight (pnpm preflight), GATE_SECRET, the review store that keeps people and their links, the handover message, adding people, a second device, signing someone out, how long access lasts. Load when the user asks to deploy, share, send a link, add or remove someone, give someone access on another device, change how long access lasts, turn on comments, or check the work before any of those. Triggers on: deploy, share, share link, send to the client, send it to the team, put it online, publish, go live, update the link, push the latest, Vercel, sign in to Vercel, vercel login, gate, GATE_SECRET, sign-in link, one-time link, new link, another device, link stopped working, sign out everywhere, access length, 3 months, 6 months, open-ended, password, production, preview URL, pre-flight, preflight, ready to send, turn on comments, review store, add someone, invite someone, remove someone."
4
4
  ---
5
5
 
6
6
  # Deploy
7
7
 
8
- `pnpm share` deploys the project to the linked Vercel project and checks the live link; the user never types a command. Every path sits behind the gate in `proxy.ts`: the shared password opens it to view, and an invite link opens it to one named person who can comment. The mechanics are scripts; this skill decides when they run and what the user is told.
8
+ `pnpm share` deploys the project to the linked Vercel project and checks the live link; the user never types a command. Every path sits behind the gate in `proxy.ts`. There is no password: each person is named, and signs in with their own one-time link. A link signs in one device, then stops working, so a used link opens nothing. An unused link signs in whoever opens it first, so it goes only to its person. The mechanics are scripts; this skill decides when they run and what the user is told.
9
9
 
10
10
  ## Before every link goes out
11
11
 
@@ -23,7 +23,8 @@ step failed?
23
23
  │ or, only after the user says it is a business contact:
24
24
  │ pnpm preflight --allow-contact <value>
25
25
  ├── states → add the missing rows to that README's States table (miles-prototype), then rerun
26
- ├── gate → pnpm bootstrap --vercel <project> sets GATE_PASSWORD and GATE_SECRET
26
+ ├── gate → pnpm bootstrap --vercel <project> --review sets GATE_SECRET and adds the review store
27
+ │ (KV_REST_API_URL, KV_REST_API_TOKEN): without the store nobody can sign in
27
28
  └── any other → fix what `detail` names; `fix` says how
28
29
  ```
29
30
 
@@ -44,32 +45,59 @@ Signed in, it prints `signedIn: true` and the account. Signed out, it starts the
44
45
  1. `pnpm signin` (above).
45
46
  2. Ask which Vercel team the project goes in when `vercel teams ls` lists more than one. Then, from the project root:
46
47
  ```bash
47
- pnpm bootstrap --vercel <project-name> --team <team-slug> [--review]
48
+ pnpm bootstrap --vercel <project-name> --team <team-slug> --review [--access 3m|6m|open]
48
49
  ```
49
- `--team` is the team the project is created in; without it the CLI's current team wins, which is often not the one the user means. It links the project, connects it to the GitHub repo (`vercel.git`: `connected`, `kept`, or `none` with a warning), turns Vercel Authentication off (the hub's gate is the protection), writes `GATE_PASSWORD` (12 readable characters, or `--gate-password <word>`) and a fresh `GATE_SECRET` to `.env` and to Production and Preview, and prints the password in `share.password`. `--review` also adds the comment store (see Comments). A second run keeps what is set.
50
+ `--team` is the team the project is created in; without it the CLI's current team wins, which is often not the one the user means. It links the project, connects it to the GitHub repo (`vercel.git`: `connected`, `kept`, or `none` with a warning), turns Vercel Authentication off (the hub's gate is the protection), and writes a fresh `GATE_SECRET` to `.env` and to Production and Preview. `--review` adds the review store, which keeps the people and their links (see The review store). Without it nobody can sign in. `--access` sets how long a new client keeps access by default (see Access). A second run keeps what is set.
50
51
  3. Deploy:
51
52
  ```bash
52
53
  pnpm share
53
54
  ```
54
- It runs the pre-flight, deploys, waits for the build, and requests the production URL signed out, which must answer with the password page. Connected to the repo and on a clean `main`, it pushes and follows the build for that commit; otherwise it uploads the folder with the Vercel CLI. It refuses uncommitted changes rather than deploy something other than the commit: ask the user before committing. `ok: false` names the `stage` (`preflight`, `deploy` or `gate`) and the fix; a failed pre-flight step is walked as above, and nothing deploys until it passes.
55
- 4. The handover message, from the JSON's `share`, in one message: the `url`, the `password`, which prototype to open (`share.open`: its path and its walkthrough), and that Controls is the round button at the top of the page. A reviewer who is not told about Controls reviews one state. Never send `GATE_SECRET`.
55
+ It runs the pre-flight, deploys, waits for the build, and requests the production URL as a signed-out browser, which must answer with the sign-in page, and then a made-up sign-in link, which must answer 404: that proves the review store is wired, since nobody signs in without it. Connected to the repo and on a clean `main`, it pushes and follows the build for that commit; otherwise it uploads the folder with the Vercel CLI. It refuses uncommitted changes rather than deploy something other than the commit: ask the user before committing. `ok: false` names the `stage` (`preflight`, `deploy` or `gate`) and the fix; a failed pre-flight step is walked as above, and nothing deploys until it passes.
56
+ 4. Add the first Studio person, the user, and send them their link (see People).
57
+ 5. The handover message, from the JSON's `share`, one per person: their own link, which prototype to open (`share.open`: its path and its walkthrough), that Controls is the round button at the top of the page, and that the link signs in one device, then stops working, so for another device they ask for a new one. A reviewer who is not told about Controls reviews one state. Never send `GATE_SECRET`, and never send one person's link to another.
56
58
 
57
- ## Comments
59
+ ## The review store
58
60
 
59
- Ask the user once whether reviewers should comment on the link; ask before the first deploy, so one `bootstrap` carries `--review`. If yes, `--review [--typesafe-key <key>]` adds Upstash Redis to the project through the Vercel Marketplace and copies the store's credentials into `.env`. The first time on a team it can stop on the Marketplace terms. Send the user the message in its `fix` as written: it links that team's terms page, names the one product to pick (**Upstash for Redis**, Redis Compatible Database) when Vercel lists several, and tells them not to create a database there, since the rerun creates the store and connects it. Rerun when they say it is done; if `stderr` shows another cause, show it to them instead. With TypeSafe on, comments are sorted by kind and state as they arrive. `pnpm share` after it, so the env reaches the site, then invite the first Studio person:
61
+ Every share needs it: it keeps the people, their links and their comments. Ask once whether comments should be sorted by TypeSafe; `--review [--typesafe-key <key>]` adds Upstash Redis to the project through the Vercel Marketplace and copies the store's credentials into `.env`. The first time on a team it can stop on the Marketplace terms. Send the user the message in its `fix` as written: it links that team's terms page, names the one product to pick (**Upstash for Redis**, Redis Compatible Database) when Vercel lists several, and tells them not to create a database there, since the rerun creates the store and connects it. Rerun when they say it is done; if `stderr` shows another cause, show it to them instead. With TypeSafe on, comments are sorted by kind and state as they arrive. `pnpm share` after it, so the env reaches the site. `miles-review` owns working from the comments.
62
+
63
+ ## People
64
+
65
+ Every person is named, and each gets their own link. Add the first Studio person, the user, from here:
60
66
 
61
67
  ```bash
62
- pnpm people invite --name "<user>" --team "<studio>" --kind studio --site <share.url>
68
+ pnpm people add --name "<user>" --team "<studio>" --kind studio --site <share.url>
63
69
  ```
64
70
 
65
- Send them the link; from then on, Studio invites everyone else from the People tab. `miles-review` owns working from the comments.
71
+ Send them the `link`; from then on, Studio adds everyone else in the People tab (the round comments button, then **⋯**, **People**), or ask for it here with `pnpm people add --name "<name>" --team "<company>" --site <share.url>`. A Client is the default kind.
72
+
73
+ - **A link signs in one device, then stops working.** Opening it shows who it is for and a Continue button; Continue uses it up. Why: a mail or chat preview opens links too, and must not use one up. An unused link lasts 14 days.
74
+ - **Another device, or a link that stopped working:** `pnpm people link <id> --site <url>` gives one more link. Their other devices stay signed in.
75
+ - **A lost or shared device:** `pnpm people sign-out <id> --site <url>` ends every session (within five minutes) and every unused link (at once) they hold, and gives one new link.
76
+ - **Someone leaves:** `pnpm people revoke <id>`, or Revoke in the People tab. Their access ends on every device within five minutes, and their links stop working at once.
77
+ - `pnpm people` lists everyone, with their id and when their access ends.
78
+ - Never paste a link into a commit, a document, a ticket or a comment, and never send one to anyone but its person. Why: until it is used, whoever opens it first signs in as that person.
79
+
80
+ ## Access
81
+
82
+ A signed-in device stays signed in until the person's access ends: 3 months, 6 months, or open-ended. A new client gets the project default; a new Studio person is open-ended.
83
+
84
+ - The project default: `pnpm people access` reads it, `pnpm people access --access 6m` sets it. Absent, it is 3 months. Ask the user at the first deploy how long the engagement runs.
85
+ - One person: `pnpm people access <id> --access 3m|6m|open`, counted from today, or `--access` on `pnpm people add`.
86
+ - When someone's access ends their links stop working at once, and every device signs out within five minutes. A changed access length reaches their signed-in devices within five minutes too. Change their access to let them back in, then send a new link.
87
+
88
+ ## A project that shared before one-time links
66
89
 
67
- ## Rotating access
90
+ A project that shared with a password (before one-time links) needs this once, before its next `pnpm share`. The pre-flight `gate` step stops the share until the store is there, so production is never replaced by a gate nobody can pass.
68
91
 
69
- - **Someone leaves:** revoke them in the People tab, or `pnpm people revoke <id>`. Their sessions end on their next page load.
70
- - **The shared password leaked:** `pnpm bootstrap --vercel <project> --gate-password <new>`, then `pnpm share`. Every password visitor signs in again; invited people are not affected.
92
+ 1. The review store is now required: `pnpm bootstrap --vercel <project> --review`. Why: people and their links live in it, so without it nobody can sign in.
93
+ 2. People, links and comments from before are not carried over. Add everyone again with `pnpm people add`, and send each person their own link. Tell the user once that the old comments stay in the old store and in any `comments.md` already pulled, and are not on the new site.
94
+ 3. The old password variable (the `GATE_` one that is not `GATE_SECRET`) is no longer read. Remove it from `.env`, and from the Vercel project: `vercel env ls` names it, then `vercel env rm <name> production` and `preview`.
95
+ 4. Earlier deployments still serve the old password page at their own URLs. Remove them: `vercel ls <project>` lists them; `vercel rm <url>` each one older than the new production deployment, with the user's word.
71
96
 
72
97
  ## Security, never weakened for a prototype
73
98
 
74
- - `vercel.json` sets `noindex`, `X-Frame-Options: DENY`, `nosniff`, HSTS and a same-origin referrer on every path. The gate and invite pages add a hash CSP and send no referrer.
75
- - A wrong password waits 800ms. For a link going to a large client list, add a Vercel Firewall rate-limit rule on `POST` before it goes out.
99
+ - `vercel.json` sets `noindex`, `X-Frame-Options: DENY`, `nosniff`, HSTS and a same-origin referrer on every path. The gate pages add a hash CSP, run no script and send no referrer.
100
+ - A link is 32 random bytes, and the store keeps only its hash. Using one is atomic: of two requests with the same link, only one signs in.
101
+ - The session cookie carries when the store last said yes. After five minutes the gate asks the store again on the next request of any kind and issues a fresh cookie, so a revoke, a sign out everywhere or a changed access length reaches every device within five minutes. A store that does not answer gives 503 and signs nobody out.
102
+ - `--site` needs the deployed store's credentials in `.env`; with only the local store, `people` refuses rather than print a link the site does not know.
103
+ - `GATE_SECRET` signs every session, together with the review store's URL, so two projects that share a secret (a copied folder) never accept each other's cookies. Never send it, never commit it. Replacing it on Vercel signs everyone out.
@@ -52,7 +52,7 @@ The tracks decide everything a shell question used to: product draws `AppShell`,
52
52
 
53
53
  | Header | Question | Options |
54
54
  |---|---|---|
55
- | Share | Put the prototypes on a password-protected link now? | Yes, with comments (Recommended) · Yes, view only · Later. Why now: everything it needs is answered in one sitting, and the first link proves the deploy works before there is client work on it. |
55
+ | Share | Put the prototypes on a private link now? Each person signs in with their own link. | Yes (Recommended) · Later. Why now: everything it needs is answered in one sitting, and the first link proves the deploy works before there is client work on it. |
56
56
  | Front end | Which front end will the site use? | Astro (Recommended) · Next.js |
57
57
 
58
58
  **Round 4: typed answers, one short chat message each, only for what was chosen.**
@@ -88,11 +88,11 @@ The user does nothing in a terminal here; each step that needs them is one link
88
88
 
89
89
  1. `pnpm --dir <path> signin`. Signed out, it prints a `url`: send it to the user to approve, then `pnpm --dir <path> signin --wait 300`.
90
90
  2. `vercel teams ls`; with more than one team, ask which with the question tool (personal account first when it is listed).
91
- 3. `pnpm --dir <path> bootstrap --vercel <name> --team <team-slug>`, plus `--review` for comments. It links the project, connects the GitHub repo, sets the password and turns Vercel's own login off. A first `--review` on a team can stop on the Marketplace terms: send the user the message in `fix` as written (it names **Upstash for Redis** as the product to pick), then rerun.
91
+ 3. `pnpm --dir <path> bootstrap --vercel <name> --team <team-slug> --review`. It links the project, connects the GitHub repo, sets the gate's secret, turns Vercel's own login off and adds the review store, which keeps the people and their sign-in links. A first `--review` on a team can stop on the Marketplace terms: send the user the message in `fix` as written (it names **Upstash for Redis** as the product to pick), then rerun.
92
92
  4. `pnpm --dir <path> share --cli`. `--cli` uploads the folder, since the setup may have left files uncommitted; later deploys push `main`. On `ok: false`, follow `stage` and `fix` (the pre-flight steps are in `miles-deploy`).
93
- 5. With comments: `pnpm --dir <path> people invite --name "<user>" --kind studio --site <share.url>`.
93
+ 5. `pnpm --dir <path> people add --name "<user>" --team "<studio>" --kind studio --site <share.url>`.
94
94
 
95
- Give the user `share.url`, `share.password` and the invite link in the closing message, and say the link shows the samples until the first feature replaces them.
95
+ Give the user `share.url` and their own `link` in the closing message, say the link signs in one device and then stops working, and say the link shows the samples until the first feature replaces them.
96
96
 
97
97
  ## 5. Record what was answered
98
98
 
@@ -111,4 +111,4 @@ Write the shell of each track under `DESIGN.md`, Shell: product is `AppShell`, w
111
111
 
112
112
  The next step is `miles-new-feature`.
113
113
 
114
- Close with the path, the port, the repo URL when there is one, the share link, password and invite when Share was a yes, the tracks and the website platform, whether TypeSafe is on, and the one command that starts the server. Nothing is committed unless the user asks.
114
+ Close with the path, the port, the repo URL when there is one, the share link and the user's own sign-in link when Share was a yes, the tracks and the website platform, whether TypeSafe is on, and the one command that starts the server. Nothing is committed unless the user asks.
@@ -34,7 +34,7 @@ One feature is one slug used in two places: `docs/sprints/<slug>/` and the `feat
34
34
 
35
35
  ## The walkthrough
36
36
 
37
- `docs/sprints/<feature>/guide.md` is for the reviewer who has the password and not the repo. It is written from the States table: one section per workflow, then "Every state, and how to reach it" copied from the README, then what the prototype does not do, then what the review must settle. Screenshots go in `assets/guide/` beside it, named in order (`01-list.jpg`); a missing file fails the build. Write it before the share link goes out (`miles-deploy` checks it exists for a sprint).
37
+ `docs/sprints/<feature>/guide.md` is for the reviewer who has a sign-in link and not the repo. It is written from the States table: one section per workflow, then "Every state, and how to reach it" copied from the README, then what the prototype does not do, then what the review must settle. Screenshots go in `assets/guide/` beside it, named in order (`01-list.jpg`); a missing file fails the build. Write it before the share link goes out (`miles-deploy` checks it exists for a sprint).
38
38
 
39
39
  ## When done means decided
40
40
 
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  name: miles-review
3
- description: "Work from review comments on the deployed prototypes: pull them into the repo, sort them by state and kind, act on each, resolve them, and manage who may comment. Load when the user mentions comments, feedback, review notes, a reviewer, an invite link, or asks what the client said. Triggers on: comments, feedback, review notes, client notes, what did they say, reviewer, invite, people, revoke, resolve, triage, pnpm comments, pnpm people."
3
+ description: "Work from review comments on the deployed prototypes: pull them into the repo, sort them by state and kind, act on each, resolve them, and manage who may comment. Load when the user mentions comments, feedback, review notes, a reviewer, a sign-in link, or asks what the client said. Triggers on: comments, feedback, review notes, client notes, what did they say, reviewer, add someone, invite, sign-in link, new link, people, revoke, resolve, triage, pnpm comments, pnpm people."
4
4
  ---
5
5
 
6
6
  # Review
7
7
 
8
8
  Each comment is pinned to a prototype, its state (the URL and every dial value) and, usually, an element. The repo gets them as `docs/sprints/<feature>/comments.md`, grouped by README state, then by kind. That file is generated: read it, never edit it, and close comments in the store.
9
9
 
10
+ Each thread line starts with its number, as the panel shows it, and its audience: `- #3 (internal) Ed (Studio): ...` or `- #4 (client-facing) Rae (Acme): ...`. A number is fixed and never reused, so gaps are normal. An internal thread is the studio's own note and no client ever sees it; a client-facing one is read by everyone, Studio's replies in it included.
11
+
10
12
  ## Working from comments
11
13
 
12
14
  1. **Pull**, from the project root: `pnpm comments pull`. The JSON's `store` says which store it read: `deployed` when `.env` holds the store's credentials, `local` otherwise. Say which to the user, because local comments are only yours.
@@ -24,15 +26,17 @@ Each comment is pinned to a prototype, its state (the URL and every dial value)
24
26
  ```
25
27
  Why taste waits: one reviewer's preference, built at once, overwrites a decision the team made and the next reviewer argues the other way. The user decides taste; bugs and copy are not taste.
26
28
  4. **Resolve** with `pnpm comments resolve <id>`, or in the panel, only once the change is live. Why: a reviewer who opens a resolved comment and still sees the old state stops trusting the list.
27
- 5. **Report** to the user: what was fixed, by comment id; the taste calls waiting for them; any comment with no state.
29
+ 5. **Report** to the user: what was fixed, by number and comment id; the taste calls waiting for them; any comment with no state. Say which threads were internal, because the client never saw those.
28
30
 
29
31
  ## People
30
32
 
31
- - Every person is **Studio** or **Client**. Both comment, reply, edit their own words, and resolve or reopen any thread. Studio also deletes any comment, sorts comments and invites people; a Client deletes only their own. The studio's team are Studio; everyone on the client's side is Client, the default.
33
+ - Every person is **Studio** or **Client**. Both comment, reply, edit their own words, and resolve or reopen any thread they can see. A Client sees client-facing threads only; Studio sees all, internal ones included. A thread's audience never changes: to tell the client what an internal thread says, Studio writes a new client-facing comment in the panel. Never paste internal words into a client-facing one without the user's say. Studio also deletes any comment, sorts comments and manages people; a Client deletes only their own. The studio's team are Studio; everyone on the client's side is Client, the default.
32
34
  - **Team** is the company: `Studio`, or the client's name. It shows beside every name, so a reviewer reads who said what.
33
- - The first Studio person comes from `pnpm people invite --name <n> --team <t> --kind studio --site <url>`; after that, Studio invites from the People tab.
34
- - A link works for 14 days. `pnpm people reissue <id>` replaces it and signs that person out everywhere; `revoke` ends their access on their next page load.
35
- - Never paste an invite link into a commit, a document, a ticket or a comment. Why: anyone holding it signs in as that person.
35
+ - The first Studio person comes from `pnpm people add --name <n> --team <t> --kind studio --site <url>`; after that, Studio adds people from the People tab.
36
+ - A link signs in one device, then stops working; unused, it lasts 14 days. `pnpm people link <id>` gives another for another device, `sign-out <id>` ends every session and gives one new link, and `revoke <id>` ends their access everywhere within five minutes. `miles-deploy` holds the rest: access length, the handover.
37
+ - Never paste a link into a commit, a document, a ticket or a comment. Why: whoever opens it first signs in as that person.
38
+
39
+ - A project that shared before one-time links lost its people and comments in the move: the new store starts empty. `miles-deploy` has the steps; comments pulled before stay in `comments.md`.
36
40
 
37
41
  ## The words in comments
38
42
 
@@ -16,7 +16,7 @@ pnpm dev
16
16
 
17
17
  Nothing else is needed, in any harness. On its first start `pnpm dev` claims a free port for the folder and writes it to `.env` and `.claude/launch.json`; later starts reuse it. Both files are gitignored because they belong to the folder, so worktrees never conflict on them. `pnpm bootstrap` remains the full setup (TypeSafe key, Vercel) but is not needed to run.
18
18
 
19
- Some harnesses copy `.env` from the main checkout. That is fine: the copied `PORT` is claimed by the other folder, so this folder gets its own and the dev server says so on stderr. The copied `GATE_*` and `TYPESAFE_API_KEY` keep working.
19
+ Some harnesses copy `.env` from the main checkout. That is fine: the copied `PORT` is claimed by the other folder, so this folder gets its own and the dev server says so on stderr. The copied `GATE_SECRET` and `TYPESAFE_API_KEY` keep working.
20
20
 
21
21
  ## Ports
22
22
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  # Each workspace installs the project and serves it on its own
7
7
  # $CONDUCTOR_PORT; the dev server reads that port before .env's PORT. No
8
- # secrets are copied in: the GATE_* values are for Vercel only.
8
+ # secrets are copied in: GATE_SECRET is for Vercel only.
9
9
  [scripts]
10
10
  setup = """
11
11
  git -C "$CONDUCTOR_ROOT_PATH" fetch --prune origin && git -C "$CONDUCTOR_ROOT_PATH" pull --ff-only || true
@@ -13,7 +13,7 @@ This guide walks every workflow and every state the prototype holds. Follow it t
13
13
 
14
14
  ## Before you start
15
15
 
16
- 1. **Open the prototype** in a desktop browser: the password-protected link sent with this guide.
16
+ 1. **Open the prototype** in a desktop browser, with the sign-in link sent to you. It signs in one device, then stops working; for another device, ask for a new one.
17
17
  2. **Find Controls.** The dark round button at the top of the page opens a panel that belongs to the prototype, not the product. It holds the switches a review needs; its last row, **Open the walkthrough**, brings this guide back in a new tab.
18
18
  3. **Start clean.** Name the reset control, and say what persists in the browser until it is used.
19
19