Node-based terminal manager for AI coding agents — tmux-backed terminals and parallel agent sessions as draggable nodes on an infinite pan/zoom canvas. macOS, Linux, and a browser Server Edition.
TypeScript adhdagent-orchestrationai-agentscanvasclaude-codecodexcoding-agentsdeveloper-toolselectrongeminilinuxmacosmultiplexeropencodeparallel-agentsterminalterminal-emulatorterminal-multiplexertmuxworkspace-manager
docs(project-limit): comments stand alone instead of citing an out-of-repo spec
review8b977a2f38f6
diff --git a/docs/project-limit.md b/docs/project-limit.mdindex c265ea4ab..bfd2e7c75 100644--- a/docs/project-limit.md+++ b/docs/project-limit.md@@ -163,8 +163,9 @@ if (g !== true && !(await g)) returnguidance rides the refusal: the agent-facing verb help (`buildCanvasSkillBody` /`buildCanvasControlInstructions`) says nothing about the limit, so nothing about it is printed toagents while it is off, and the refusal — which exists only while it is on — is its documentation- (the agent-text-in-sync rule is met by the outcome text itself). A headless start of a node in a CLOSED project at the limit starts the- session but does not unhide the project (the existing "reopen it from the welcome screen" reply).+ (the agent-text-in-sync rule is met by the outcome text itself). A headless start of a node in a+ CLOSED project at the limit starts the session but does not unhide the project (the existing+ "reopen it from the welcome screen" reply).- A new way to open a project must call the gate. `src/renderer/canvas/project-limit-opens.source.test.ts`pins the five call sites.diff --git a/src/core/license.test.ts b/src/core/license.test.tsindex cdd8ed291..a87a263b2 100644--- a/src/core/license.test.ts+++ b/src/core/license.test.ts@@ -991,7 +991,7 @@ describe('license clock anchor + project-limit Pro grace + DO_NOT_TRACK consent'it('ends with the token a 2xx active:false deletes', async () => {// The device-bound refresh drops the token on the server's "no longer entitled" answer, so a- // stored token is itself the proof that no such answer has arrived since (spec §6).+ // stored token is itself the proof that no such answer has arrived since.store({ token: mint(-10 * DAY_S) })fetchMock.mockResolvedValue(jsonResponse({ active: false }))const { initLicense, proForProjectLimit } = await import('./license')diff --git a/src/core/license.ts b/src/core/license.tsindex 5618351e3..6186fdb9d 100644--- a/src/core/license.ts+++ b/src/core/license.ts@@ -33,7 +33,7 @@ export function isDntEnv(): boolean {return !!(process.env.DO_NOT_TRACK || process.env.NODETERM_TELEMETRY_DISABLED)}-// The user's consent to license calls while DO_NOT_TRACK is set (spec §7.4: a setting shown and+// The user's consent to license calls while DO_NOT_TRACK is set (a setting shown and// revocable in Settings → Privacy, wired in by the shell). Unwired — the default, and any shell that// never wires it — there is no consent, which is the pre-consent behavior: no license call under DNT.let networkConsent: () => boolean = () => false@@ -41,7 +41,7 @@ let networkConsent: () => boolean = () => false/*** Install the consent callback. It is read on EVERY gated call, so revoking consent takes effect at* once. Only callers of `licenseNetworkGate()` honor it — the license routes in this file, and the- * project-limit claim (spec §7.4) — never telemetry or the check feed, which keep their own+ * project-limit claim (docs/project-limit.md) — never telemetry or the check feed, which keep their own* unconditional DNT guard.*/export function setLicenseNetworkConsent(fn: () => boolean): void {@@ -302,11 +302,12 @@ export function isPremium(): boolean {export const PRO_LIMIT_GRACE_MS = 30 * 24 * 60 * 60 * 1000/**- * Pro for the purposes of the free-tier open-project limit (spec §6), and for NOTHING else — every- * other Pro feature gates on `isPremium()`. True when `isPremium()` is, or when the stored token- * passes the same signature + deviceId verification and expired less than `PRO_LIMIT_GRACE_MS` ago- * by the clock anchor. A paying user offline past the 7-day token TTL must not be blocked from- * opening a project; the cost is that cancelling and then blocking the API buys at most 30 days.+ * Pro for the purposes of the free-tier open-project limit (docs/project-limit.md), and for NOTHING+ * else — every other Pro feature gates on `isPremium()`. True when `isPremium()` is, or when the+ * stored token passes the same signature + deviceId verification and expired less than+ * `PRO_LIMIT_GRACE_MS` ago by the clock anchor. A paying user offline past the 7-day token TTL must+ * not be blocked from opening a project; the cost is that cancelling and then blocking the API buys+ * at most 30 days.** "No 2xx `active:false` since" needs no record of its own: the device-bound refresh deletes the* stored token on exactly that answer, so a token still on disk means the server has not saiddiff --git a/src/core/machine-id.ts b/src/core/machine-id.tsindex 672a1e62b..309a75f56 100644--- a/src/core/machine-id.ts+++ b/src/core/machine-id.ts@@ -1,10 +1,10 @@/**- * The `machine` claim of a project-allowance token (spec §6): a salted SHA-256 of the OS machine- * id, so one legacy `device-id` file copied to many computers cannot carry one allowance to all of- * them. It is a new stable identifier, which is why it is read LAZILY — only when an install first- * claims an allowance — and why the raw id never leaves this module: not logged, not returned, not- * sent. Only the hash goes to the server, and the server refuses anything that is not 64 lowercase- * hex, so every path here — the fallback included — ends in `machineHashOf`.+ * The `machine` claim of a project-allowance token (docs/project-limit.md): a salted SHA-256 of the+ * OS machine id, so one legacy `device-id` file copied to many computers cannot carry one allowance+ * to all of them. It is a new stable identifier, which is why it is read LAZILY — only when an+ * install first claims an allowance — and why the raw id never leaves this module: not logged, not+ * returned, not sent. Only the hash goes to the server, and the server refuses anything that is not+ * 64 lowercase hex, so every path here — the fallback included — ends in `machineHashOf`.** Only a hash that came from the OS is memoized. A failed read is retried once, and if that fails* too the `host:<hostname>` fallback is returned but NOT kept: a timeout or a spawn hiccup is notdiff --git a/src/core/project-allowance-key.ts b/src/core/project-allowance-key.tsindex 0ba58705c..f74affaf3 100644--- a/src/core/project-allowance-key.ts+++ b/src/core/project-allowance-key.ts@@ -2,7 +2,7 @@// half of the backend's PROJECT_ALLOWANCE_PRIVATE_KEY (held only in the server env). It is NOT a// secret — it can only verify, not sign. If you rotate the server key, update this too.//-// It is a DIFFERENT key from ENTITLEMENT_PUBLIC_KEY on purpose (spec §6): shipped clients accept any+// It is a DIFFERENT key from ENTITLEMENT_PUBLIC_KEY on purpose: shipped clients accept any// entitlement-key signature that carries their deviceId and a live `exp`, checking neither `typ`// nor `tier`, so an allowance token signed with the entitlement key would read as Pro everywhere.//diff --git a/src/core/project-allowance-token.ts b/src/core/project-allowance-token.tsindex a9a6ba8ed..b3929753e 100644--- a/src/core/project-allowance-token.ts+++ b/src/core/project-allowance-token.ts@@ -1,6 +1,6 @@/**- * Offline verification of the project-allowance token (spec §6) — how many open projects a free- * install may keep, for one device, on one machine, under one policy epoch.+ * Offline verification of the project-allowance token (docs/project-limit.md) — how many open+ * projects a free install may keep, for one device, on one machine, under one policy epoch.** Wire format, as nodeterm-server's `createAllowanceSigner` writes it: `${P}.${S}`, where* `P = base64url(JSON payload)` with keys `typ, deviceId, machine, allowance, epoch, iat` anddiff --git a/src/core/project-limit.ts b/src/core/project-limit.tsindex 6339131a8..6bc68a372 100644--- a/src/core/project-limit.ts+++ b/src/core/project-limit.ts@@ -31,9 +31,9 @@* machine check applies. A successful claim also caches the hash it sent, if it came from the OS.** CLAIMS are lazy and never reject: one request shared by concurrent callers, an 8 s timeout over- * the whole request including the body (the machine read before it is bounded by machine-id.ts's own- * per-attempt timeout), and every failure folded into a `ClaimError`. While the- * limit is off a claim asks nobody (no request, no machine read), whoever calls it.+ * the whole request including the body (the machine read before it is bounded by machine-id.ts's+ * own per-attempt timeout), and every failure folded into a `ClaimError`. While the limit is off a+ * claim asks nobody (no request, no machine read), whoever calls it.** `projectLimit:changed` goes to THIS machine's windows only, through the shell's `notify`. Never* `platform().broadcast`: on the desktop that fans out to every relay peer, and this state carries@@ -206,8 +206,8 @@ function compute(): ProjectLimitState {}}-/** The count at the first launch of a limit-capable build (spec §4's late-updater basis): the first- * number `openProjects()` gives, kept for good. */+/** The count at the first launch of a limit-capable build (the late-updater basis,+ * docs/project-limit.md): the first number `openProjects()` gives, kept for good. */function recordFirstLaunchOpenCount(): void {if (stored.firstLaunchOpenCount !== undefined) returnlet n: number | undefineddiff --git a/src/main/index.ts b/src/main/index.tsindex 99e3b49a2..e349dd0d5 100644--- a/src/main/index.ts+++ b/src/main/index.ts@@ -4896,11 +4896,12 @@ app.whenReady().then(async () => {ready: bootWorkspaceLoad})settingsStore.onChange(() => projectLimit.pushIfChanged())- // DO_NOT_TRACK consent for license and allowance calls (spec §7.4): Settings → Privacy, read on- // every gated call so revoking it applies at once. Installed BEFORE initLicense, whose launch- // refresh runs immediately. Only `licenseNetworkGate()` callers read it — never telemetry or the- // check feed. (Giving consent does not trigger a refresh: license.ts exposes none, so the next- // license call is the 6 h refresh, an activate or an upgrade; a claim reads the gate itself.)+ // DO_NOT_TRACK consent for license and allowance calls (docs/project-limit.md): Settings →+ // Privacy, read on every gated call so revoking it applies at once. Installed BEFORE initLicense,+ // whose launch refresh runs immediately. Only `licenseNetworkGate()` callers read it — never+ // telemetry or the check feed. (Giving consent does not trigger a refresh: license.ts exposes+ // none, so the next license call is the 6 h refresh, an activate or an upgrade; a claim reads the+ // gate itself.)setLicenseNetworkConsent(() => settingsStore.get().licenseNetworkConsent === true)// A license change (activate, refresh, a lapsed token replaced) re-arms every live link the API// refused: a link host whose 7-day entitlement expired under it stops minting until then (R41).diff --git a/src/renderer/bridge/stubs.test.ts b/src/renderer/bridge/stubs.test.tsindex 9d6f855fa..7c71792af 100644--- a/src/renderer/bridge/stubs.test.ts+++ b/src/renderer/bridge/stubs.test.ts@@ -101,9 +101,10 @@ describe('bridge stubs', () => {})it('the project limit is inactive on the Server Edition: no gate, no claim', async () => {- // Spec §10: the Server Edition has no gate. `state` answers the dormant default so every open- // stays synchronous, and `claim` answers `disabled` instead of rejecting — a gate that somehow- // reached it reads a typed refusal, never a thrown E_UNSUPPORTED it has no branch for.+ // The Server Edition has no gate (docs/project-limit.md, Three surfaces). `state` answers the+ // dormant default so every open stays synchronous, and `claim` answers `disabled` instead of+ // rejecting — a gate that somehow reached it reads a typed refusal, never a thrown+ // E_UNSUPPORTED it has no branch for.const s = buildStubApi()await expect(s.projectLimit.state()).resolves.toEqual(INACTIVE_PROJECT_LIMIT)await expect(s.projectLimit.claim()).resolves.toEqual({ ok: false, error: 'disabled', state: INACTIVE_PROJECT_LIMIT })diff --git a/src/renderer/bridge/stubs.ts b/src/renderer/bridge/stubs.tsindex 928f306d9..b9550ae89 100644--- a/src/renderer/bridge/stubs.ts+++ b/src/renderer/bridge/stubs.ts@@ -285,11 +285,12 @@ export function buildStubApi(): Omit<onChange: noopUnsub},projectLimit: {- // Spec §10: the Server Edition has no open-project gate, so it answers the dormant state and- // every open stays synchronous. Resolved, not rejected: unlike `license.getStatus`, this is- // read on the open path, and "inactive" is the true answer here rather than "unknown".- // `claim` answers `disabled` (this shell never talks to the license server) for the same- // reason: a refusal `ClaimResult` names, where an E_UNSUPPORTED throw is outside the contract.+ // The Server Edition has no open-project gate (docs/project-limit.md), so it answers the+ // dormant state and every open stays synchronous. Resolved, not rejected: unlike+ // `license.getStatus`, this is read on the open path, and "inactive" is the true answer here+ // rather than "unknown". `claim` answers `disabled` (this shell never talks to the license+ // server) for the same reason: a refusal `ClaimResult` names, where an E_UNSUPPORTED throw is+ // outside the contract.state: (): Promise<ProjectLimitState> => Promise.resolve(INACTIVE_PROJECT_LIMIT),claim: (): Promise<ClaimResult> =>Promise.resolve({ ok: false, error: 'disabled', state: INACTIVE_PROJECT_LIMIT }),diff --git a/src/renderer/canvas/Canvas.tsx b/src/renderer/canvas/Canvas.tsxindex 8e024c681..7fdd15d28 100644--- a/src/renderer/canvas/Canvas.tsx+++ b/src/renderer/canvas/Canvas.tsx@@ -20735,7 +20735,7 @@ export function Canvas() {)}<UpgradeDialog />- {/* The free-tier limit moment (spec §7). Close is the ordinary non-destructive close — never+ {/* The free-tier limit moment (docs/project-limit.md). Close is the ordinary non-destructive close — never`endSessions`: the limit only ever blocks a NEW open, it never ends anything. */}<ProjectLimitDialog onCloseProject={(id) => performCloseProject(id)} />{liveLinkDialog && (diff --git a/src/renderer/components/ProjectLimitDialog.test.tsx b/src/renderer/components/ProjectLimitDialog.test.tsxindex 3b4ab29ed..d44b8ce28 100644--- a/src/renderer/components/ProjectLimitDialog.test.tsx+++ b/src/renderer/components/ProjectLimitDialog.test.tsx@@ -1,10 +1,10 @@// @vitest-environment jsdom//-// The limit dialog (spec §7, option A). The open gate (lib/projectLimitGate.ts) holds a promise for-// every dialog it shows and refuses every other open while that promise is pending, so the one rule-// above all others here: EVERY way out of the dialog goes through `resolveDialog`. A dialog that-// vanishes any other way (or stays unsettled behind an unmounted component) latches every later-// at-limit open to `false` for the rest of the session.+// The limit dialog (docs/project-limit.md, The limit moment). The open gate+// (lib/projectLimitGate.ts) holds a promise for every dialog it shows and refuses every other open+// while that promise is pending, so the one rule above all others here: EVERY way out of the dialog+// goes through `resolveDialog`. A dialog that vanishes any other way (or stays unsettled behind an+// unmounted component) latches every later at-limit open to `false` for the rest of the session.import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'import { act } from 'react'import { createRoot, type Root } from 'react-dom/client'@@ -283,7 +283,7 @@ describe('ProjectLimitDialog — error and mismatch', () => {const pending = show({ mode: 'error' })expect(text()).toContain('5 of 5 free projects are open')expect(text()).toContain("Couldn't check your free allowance with api.nodeterm.dev.")- // Close and Pro still work (§7.3).+ // Close and Pro still work: a failed check never takes the ways out away.expect(rows()).toHaveLength(5)expect(button('Unlimited with Pro — $10/mo')).toBeTruthy()click(button('Retry'))diff --git a/src/renderer/components/ProjectLimitDialog.tsx b/src/renderer/components/ProjectLimitDialog.tsxindex 286c6d6b5..1d7bb7941 100644--- a/src/renderer/components/ProjectLimitDialog.tsx+++ b/src/renderer/components/ProjectLimitDialog.tsx@@ -9,7 +9,7 @@ import { confirmKeyAction } from './confirm-key'import { useDialogStack } from './dialog-stack'/**- * The free-tier limit moment (spec §7, option A): the dialog the open gate+ * The free-tier limit moment (docs/project-limit.md): the dialog the open gate* (lib/projectLimitGate.ts) shows when a new open would go past the allowance, plus the brief* "Checking…" panel while a person's claim is in flight. Mounted once, in Canvas, beside* `UpgradeDialog`; it renders only what `useProjectLimit` asks for.diff --git a/src/renderer/components/UpgradeDialog.test.tsx b/src/renderer/components/UpgradeDialog.test.tsxindex cf7849dcc..9976224a5 100644--- a/src/renderer/components/UpgradeDialog.test.tsx+++ b/src/renderer/components/UpgradeDialog.test.tsx@@ -1,10 +1,10 @@// @vitest-environment jsdom//// The Pro upgrade prompt. Only live links open it today, yet its body never mentioned them, and it-// still promised "unlimited remote access from your phone" months after the relay quota was removed-// (spec §8). The body is pinned verbatim, and it names unlimited open projects only while the-// free-tier limit is on (spec §2: no "unlimited" claim the limit would contradict — and, inactive,-// no claim about a limit that does not exist).+// still promised "unlimited remote access from your phone" months after the relay quota was removed.+// The body is pinned verbatim, and it names unlimited open projects only while the free-tier limit+// is on (docs/project-limit.md: no "unlimited" claim the limit would contradict — and, inactive, no+// claim about a limit that does not exist).import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'import { act } from 'react'import { createRoot, type Root } from 'react-dom/client'diff --git a/src/renderer/components/UpgradeDialog.tsx b/src/renderer/components/UpgradeDialog.tsxindex f3c90c459..da09b20a7 100644--- a/src/renderer/components/UpgradeDialog.tsx+++ b/src/renderer/components/UpgradeDialog.tsx@@ -13,7 +13,8 @@ export function UpgradeDialog() {const isPremium = useEntitlement((s) => s.isPremium)const upgrade = useEntitlement((s) => s.upgrade)// While the free-tier project limit is on, unlimited open projects is part of what Pro adds- // (spec §8); while it is off there is no limit to lift, so the sentence does not mention one.+ // (docs/project-limit.md); while it is off there is no limit to lift, so the sentence does not+ // mention one.const limitActive = useProjectLimit((s) => s.state.active)if (!open || isPremium) return nullreturn createPortal(diff --git a/src/renderer/components/settings/sections/ProCompare.test.tsx b/src/renderer/components/settings/sections/ProCompare.test.tsxindex 08d83d572..4e54d3ddd 100644--- a/src/renderer/components/settings/sections/ProCompare.test.tsx+++ b/src/renderer/components/settings/sections/ProCompare.test.tsx@@ -1,7 +1,7 @@// @vitest-environment jsdom//-// The Core vs Pro comparison follows the free-tier open-project limit (spec §8, and the §2-// anti-goal: the app must not say "unlimited / free forever" while the limit is on). Inactive — the+// The Core vs Pro comparison follows the free-tier open-project limit (docs/project-limit.md; the+// app must not say "unlimited / free forever" while the limit is on). Inactive — the// Server Edition's permanent answer, and every install until the flip — it is byte-identical to the// copy that shipped before the limit existed. Rendered through a real root, not// `renderToStaticMarkup`: a zustand hook reads the store's INITIAL state on the server render, so adiff --git a/src/renderer/components/settings/sections/ProCompare.tsx b/src/renderer/components/settings/sections/ProCompare.tsxindex 4b7cf5647..c9aca6da2 100644--- a/src/renderer/components/settings/sections/ProCompare.tsx+++ b/src/renderer/components/settings/sections/ProCompare.tsx@@ -20,8 +20,8 @@ const PRO = []/** Core vs Pro comparison. While the open-project limit is on, Core must not read "free forever" or- * an unqualified "unlimited" (spec §2/§8): it names the user's allowance, and Pro gains unlimited- * open projects. */+ * an unqualified "unlimited" (docs/project-limit.md): it names the user's allowance, and Pro gains+ * unlimited open projects. */export function ProCompare(): React.JSX.Element {const limitState = useProjectLimit((s) => s.state)const active = limitState.activediff --git a/src/renderer/lib/headlessRun.ts b/src/renderer/lib/headlessRun.tsindex 31a825ab4..467ca0370 100644--- a/src/renderer/lib/headlessRun.ts+++ b/src/renderer/lib/headlessRun.ts@@ -111,14 +111,14 @@ export function unhidesForHeadlessStart(}/**- * `unhidesForHeadlessStart`, under the free-tier project limit- * (docs/project-limit.md). Restoring a closed tab- * makes a project open, so at the limit the tab simply stays in Recently closed: the session still- * starts, nothing is refused and no dialog is shown (nobody pressed anything), and the reply keeps- * its "reopen it from the welcome screen" hint — exactly the branch where the predicate says no.- * A claim still due is a no as well: a headless start never claims. While the limit is off,- * `decideOpen` always allows, so this answers what the predicate answers. A relay tab never counts- * as open (spec §3), so un-closing one is not an open the limit has a say in.+ * `unhidesForHeadlessStart`, under the free-tier project limit (docs/project-limit.md). Restoring a+ * closed tab makes a project open, so at the limit the tab simply stays in Recently closed: the+ * session still starts, nothing is refused and no dialog is shown (nobody pressed anything), and+ * the reply keeps its "reopen it from the welcome screen" hint — exactly the branch where the+ * predicate says no. A claim still due is a no as well: a headless start never claims. While the+ * limit is off, `decideOpen` always allows, so this answers what the predicate answers. A relay tab+ * never counts as open (docs/project-limit.md, Definitions), so un-closing one is not an open the+ * limit has a say in.*/export function shouldUnhideForHeadlessStart(project: { closed?: boolean; ssh?: Project['ssh']; remote?: Project['remote'] },diff --git a/src/renderer/lib/projectLimitGate.ts b/src/renderer/lib/projectLimitGate.tsindex 46fc12aa9..a94adc6e6 100644--- a/src/renderer/lib/projectLimitGate.ts+++ b/src/renderer/lib/projectLimitGate.ts@@ -40,10 +40,11 @@ import { useSettings } from '../state/settings'* (under it the open stays synchronous and claims nothing).*/-/** §7's "brief spinner": raised only for a claim still in flight after this long. */+/** The limit moment's "brief spinner" (the "Checking…" panel): raised only for a claim still in+ * flight after this long. */export const CHECKING_DELAY_MS = 300-/** An agent's refusal shows the user the limit dialog at most once in this window (§7.5: once per+/** An agent's refusal shows the user the limit dialog at most once in this window (once per* refusal burst, not per retry). Measured from when the dialog was last shown for an agent. */export const AGENT_DIALOG_QUIET_MS = 60_000diff --git a/src/renderer/lib/projectOpens.test.ts b/src/renderer/lib/projectOpens.test.tsindex 0e2405238..e5f2d3e1c 100644--- a/src/renderer/lib/projectOpens.test.ts+++ b/src/renderer/lib/projectOpens.test.ts@@ -6,9 +6,10 @@ import { opensProject } from './projectOpens'import { useProjects } from '../state/projects'/**- * `opensProject` decides whether the project-limit gate is asked at all (spec §3: "Activating a- * project that is already open is not an open"). Each case is checked against the store action the- * call site runs right after it, so the prediction cannot drift from what the store does.+ * `opensProject` decides whether the project-limit gate is asked at all (docs/project-limit.md,+ * Definitions: "Activating a project that is already open is not an open"). Each case is checked+ * against the store action the call site runs right after it, so the prediction cannot drift from+ * what the store does.*/const server = (over: Partial<SshServer> = {}): SshServer => ({diff --git a/src/renderer/lib/projectOpens.ts b/src/renderer/lib/projectOpens.tsindex 011bbda66..e27f854f3 100644--- a/src/renderer/lib/projectOpens.ts+++ b/src/renderer/lib/projectOpens.ts@@ -16,7 +16,7 @@ export type OpenAction =| { kind: 'reopen'; id: string }| { kind: 'register'; cwd: string }-/** Un-closing `p` makes it open: it is closed, and not a relay tab (those never count, spec §3). */+/** Un-closing `p` makes it open: it is closed, and not a relay tab (those never count). */const reopens = (p: Project): boolean => !!p.closed && !p.remote/**diff --git a/src/renderer/state/projectLimit.test.ts b/src/renderer/state/projectLimit.test.tsindex 0d20d615f..7c756e91b 100644--- a/src/renderer/state/projectLimit.test.ts+++ b/src/renderer/state/projectLimit.test.ts@@ -7,7 +7,7 @@ import { INACTIVE_PROJECT_LIMIT, type ProjectLimitState } from '@shared/project-// The renderer's copy of core's project-limit state (src/core/project-limit.ts). Two things matter// here: it follows core — the hydrate read AND every `projectLimit:changed` push replace it — and a// failed read leaves it DORMANT. Inactive is the state in which every open behaves exactly as it did-// before the limit existed (spec §2), so it is the only safe thing to hold when core cannot be asked.+// before the limit existed, so it is the only safe thing to hold when core cannot be asked.const stateCall = vi.fn<() => Promise<ProjectLimitState>>()let pushed: ((s: ProjectLimitState) => void) | null = nulldiff --git a/src/renderer/state/projectLimit.ts b/src/renderer/state/projectLimit.tsindex 8afbbb5db..70c7d9e7a 100644--- a/src/renderer/state/projectLimit.ts+++ b/src/renderer/state/projectLimit.ts@@ -12,9 +12,10 @@ import { INACTIVE_PROJECT_LIMIT, type ProjectLimitState } from '@shared/project-* A relay tab keeps the LOCAL preload's api (the allowance is this machine's, never the host's).*//**- * What the limit dialog (components/ProjectLimitDialog.tsx) is asked to show — spec §7:+ * What the limit dialog (components/ProjectLimitDialog.tsx) is asked to show (docs/project-limit.md,+ * The limit moment):* - `limit`: still at the limit after any claim; Close / Cancel / Pro.- * - `consent`: DO_NOT_TRACK without consent; a claim needs the user's yes first (§7.4).+ * - `consent`: DO_NOT_TRACK without consent; a claim needs the user's yes first.* - `error`: the claim could not get an answer (offline, server error); adds Retry.* - `mismatch`: the allowance is tied to another computer; `retryAfter` (unix seconds) says when* it may move to this one.@@ -35,7 +36,7 @@ interface ProjectLimitStore {* open while that is pending, so clearing this field any other way (`setState({ dialog: null })`)* leaves the promise unsettled and latches every later at-limit open to `false`. */dialog: LimitDialogRequest | null- /** §7's "brief spinner": a person's claim is still in flight after `CHECKING_DELAY_MS`. */+ /** The "Checking…" panel: a person's claim is still in flight after `CHECKING_DELAY_MS`. */checking: boolean/** Read core's current state. Never rejects: a failed read keeps whatever is held (inactive until* core has said otherwise). Called from the boot effect AFTER the projects store is hydrated —diff --git a/src/shared/project-limit.ts b/src/shared/project-limit.tsindex 39f992ec4..bb0466690 100644--- a/src/shared/project-limit.ts+++ b/src/shared/project-limit.ts@@ -17,16 +17,17 @@ export function countOpenProjects(projects: readonly { closed?: boolean; remote?/*** The compiled FREE: how many open projects a non-Pro install may have before the server has said- * otherwise. The server owns the real number (spec §4) and sends it on every check while the limit+ * otherwise. The server owns the real number and sends it on every check while the limit* is on, so changing FREE never needs a release; this is only the value used until it has spoken.*/export const PROJECT_LIMIT_DEFAULT_FREE = 5/**- * The embedded deadline (spec §5): past this instant a client that never heard from the server —- * DO_NOT_TRACK, `NODETERM_TELEMETRY_DISABLED`, a blocked host — treats the limit as on. In practice- * that only means "ask the server (claim) before opening beyond FREE"; a `not_active` answer turns- * it off again. Compared against the clock anchor, never the bare wall clock.+ * The embedded deadline (docs/project-limit.md): past this instant a client that never heard from+ * the server — DO_NOT_TRACK, `NODETERM_TELEMETRY_DISABLED`, a blocked host — treats the limit as+ * on. In practice that only means "ask the server (claim) before opening beyond FREE"; a+ * `not_active` answer turns it off again. Compared against the clock anchor, never the bare wall+ * clock.** RELEASE CHECKLIST: this is BUMPED IN EVERY RELEASE BEFORE THE FLIP, to a date past the planned* flip — otherwise DNT users are gated before anyone else. At the flip it is set to the flip date@@ -53,12 +54,12 @@ export interface ProjectLimitState {free: number/** The allowance a verified, server-signed token grants this device; `null` = not claimed yet. */allowance: number | null- /** DO_NOT_TRACK is set: a claim (and a purchase) needs the user's consent first (spec §7.4). */+ /** DO_NOT_TRACK is set: a claim (and a purchase) needs the user's consent first. */dnt: boolean}/**- * The answer while the limit is off, and the Server Edition's permanent answer (spec §10): every+ * The answer while the limit is off, and the Server Edition's permanent answer: every* open is allowed synchronously, nothing is claimed, nothing is shown.*/export const INACTIVE_PROJECT_LIMIT: ProjectLimitState = {diff --git a/src/shared/settings-verb.test.ts b/src/shared/settings-verb.test.tsindex 250d32695..7d2566db9 100644--- a/src/shared/settings-verb.test.ts+++ b/src/shared/settings-verb.test.ts@@ -92,7 +92,7 @@ describe('the allowlist is the gate, and the forbidden set outranks it', () => {it('an agent can never grant network consent under DO_NOT_TRACK on the user\'s behalf', () => {// `licenseNetworkConsent` lets license and allowance calls reach api.nodeterm.dev while- // DO_NOT_TRACK is set (spec §7.4). It is a privacy decision the user makes in Settings → Privacy;+ // DO_NOT_TRACK is set. It is a privacy decision the user makes in Settings → Privacy;// a CLI that could set it would turn the user's DO_NOT_TRACK into a suggestion. Named in the set// AND caught by the `consent` name class, so neither fence alone carries it.expect((SETTINGS_VERB_FORBIDDEN as ReadonlySet<string>).has('licenseNetworkConsent')).toBe(true)diff --git a/src/shared/settings-verb.ts b/src/shared/settings-verb.tsindex 8a4ad8c18..eca47f3b8 100644--- a/src/shared/settings-verb.ts+++ b/src/shared/settings-verb.ts@@ -156,7 +156,7 @@ export const SETTINGS_VERB_FORBIDDEN = new Set<keyof Settings | keyof Project>(['agentMessagingDefault',// Telemetry.'telemetryEnabled',- // Consent to license and allowance calls while DO_NOT_TRACK is set (spec §7.4). A privacy decision:+ // Consent to license and allowance calls while DO_NOT_TRACK is set. A privacy decision:// an agent that could grant it would turn the user's DO_NOT_TRACK into a suggestion. The `consent`// name class below catches it too; it is named here so the snapshot test pins it either way.'licenseNetworkConsent',diff --git a/src/shared/types.ts b/src/shared/types.tsindex 0cb825d71..bf845851a 100644--- a/src/shared/types.ts+++ b/src/shared/types.ts@@ -2361,7 +2361,7 @@ export interface Settings {* install count also rides the /v1/check call and is NOT gated on this toggle — see core/check.ts. */telemetryEnabled: boolean/** The user's consent to license and free-project-allowance calls to api.nodeterm.dev while- * DO_NOT_TRACK / NODETERM_TELEMETRY_DISABLED is set (spec §7.4). Default off: under DNT nothing+ * DO_NOT_TRACK / NODETERM_TELEMETRY_DISABLED is set. Default off: under DNT nothing* license-related leaves the machine until the user says so. Covers ONLY the calls behind* `licenseNetworkGate()` (core/license.ts) — never telemetry or the check feed, which stay off* under DNT whatever this says. Read as `=== true` (main installs it via@@ -4190,7 +4190,7 @@ export interface LicenseApi {}/** The free-tier open-project limit (src/shared/project-limit.ts; core computes the state). Desktop- * only: the Server Edition's stub answers `INACTIVE_PROJECT_LIMIT` and claims `disabled` (spec §10),+ * only: the Server Edition's stub answers `INACTIVE_PROJECT_LIMIT` and claims `disabled`,* and a relay tab keeps the local preload — the allowance is this machine's, never the host's. */export interface ProjectLimitApi {/** The current state. Cheap and offline: it never waits on the network. */