viewable-one 0.12.9 → 0.12.10

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.
package/CHANGELOG.md CHANGED
@@ -13,6 +13,18 @@ package.
13
13
 
14
14
  ## [Unreleased]
15
15
 
16
+ ## [0.12.10] - 2026-11-25
17
+
18
+ ### Fixed
19
+
20
+ - An ask on Your computer that only reads no longer runs the folder's tests
21
+ and build after its answer (#8611). It changed nothing, so the run ends when
22
+ the session ends instead of up to 5 minutes later, and its result no longer
23
+ says "Ran out of time". The same goes for an ask that worked in the folder
24
+ itself (no copy) and changed nothing there: a git folder is compared with
25
+ how it was when the ask started. An ask that changed files, in its copy or
26
+ in the folder, is checked as before.
27
+
16
28
  ## [0.12.9] - 2026-11-25
17
29
 
18
30
  ### Added
package/SPAWN.md CHANGED
@@ -619,6 +619,8 @@ the same `newOpId` shape the ops channel uses).
619
619
  `Write`, `Edit`, `Bash` or web tools), Codex in its read-only sandbox with
620
620
  its board server kept and no web search. Neither loads the computer's own
621
621
  apps (`computerApps` is ignored). A value that is not a boolean is refused.
622
+ It runs no package checks after it ends (#8611); nor does any run in the
623
+ folder itself (no worktree) that left a git folder as it found it.
622
624
 
623
625
  ### `<id>.claim` - who owns it
624
626
 
@@ -0,0 +1,43 @@
1
+ // Whether a run in the folder itself changed anything (#8611): a run with no
2
+ // copy has no base to diff against, so the runner keeps the folder's state
3
+ // from the start and compares it at the end (runnerLaunch.mjs).
4
+ import { createHash } from "node:crypto";
5
+ import { lstat } from "node:fs/promises";
6
+ import { join } from "node:path";
7
+ import { git } from "./worktree.mjs";
8
+
9
+ // Past this many untracked files the state is not worth reading; the run is
10
+ // checked as before.
11
+ const MAX_UNTRACKED = 5000;
12
+
13
+ /** One hash of what a run in a git folder can change: the commit it is on,
14
+ * every tracked change against it (staged or not), and the untracked files
15
+ * by size and time. Equal hashes before and after a run mean it changed
16
+ * nothing (#8611). Ignored files do not count, the way they do not for a
17
+ * copy's changed files. null when the folder is not a git checkout or git
18
+ * could not answer, which means "may have changed". Reads only: no index
19
+ * refresh (`--no-optional-locks`), so the person's own git is never blocked. */
20
+ export async function folderState(cwd) {
21
+ const run = (args, at = cwd) => git(["--no-optional-locks", "-c", "core.quotePath=false", ...args], at);
22
+ const top = await run(["rev-parse", "--show-toplevel"]);
23
+ if (!top.ok) return null;
24
+ const root = top.stdout.trim();
25
+ const hash = createHash("sha256");
26
+ const head = await run(["rev-parse", "--verify", "-q", "HEAD"], root);
27
+ hash.update(`head ${head.ok ? head.stdout.trim() : "none"}\0`);
28
+ // No commit yet: the staged and unstaged changes, each against what is before it.
29
+ for (const args of head.ok ? [["diff", "--binary", "--no-ext-diff", "HEAD"]] : [["diff", "--binary", "--no-ext-diff"], ["diff", "--binary", "--no-ext-diff", "--cached"]]) {
30
+ const diff = await run(args, root);
31
+ if (!diff.ok) return null;
32
+ hash.update(`${args.join(" ")}\0${diff.stdout}\0`);
33
+ }
34
+ const untracked = await run(["ls-files", "-z", "--others", "--exclude-standard"], root);
35
+ if (!untracked.ok) return null;
36
+ const paths = untracked.stdout.split("\0").filter(Boolean).sort();
37
+ if (paths.length > MAX_UNTRACKED) return null;
38
+ for (const path of paths) {
39
+ const info = await lstat(join(root, path)).catch(() => null);
40
+ hash.update(`${path}\0${info ? `${info.size}:${info.mtimeMs}` : "gone"}\0`);
41
+ }
42
+ return hash.digest("hex");
43
+ }
@@ -18,6 +18,7 @@ import { OUT_OF_TIME, runCodingChecks } from "./codingChecks.mjs";
18
18
  import { beforePicture, checkPage } from "./pagePictures.mjs";
19
19
  import { retainRunEvents, deliverRunEvents, isMissingConversation } from "./runnerSettlement.mjs";
20
20
  import { changedFiles } from "./worktree.mjs";
21
+ import { folderState } from "./folderState.mjs";
21
22
 
22
23
  /** The two notes a fresh session gets in place of a conversation that could
23
24
  * not be resumed: its worktree is gone, or Claude Code has no record of it. */
@@ -155,6 +156,15 @@ async function runStarted(ctx, state, { timing, receipt, preparation, finish })
155
156
  };
156
157
 
157
158
  if (settings.stopped?.has(id)) return await finish({ status: "stopped", result: settings.leaseLost?.has(id) ? "STOPPED\n\nRunner connection expired before the process was started.\n" : "STOPPED\n\nStopped by user request before the process was started.\n", finished_at: new Date().toISOString() });
159
+ // Checking is part of a finished run, before its one closing reply and
160
+ // cleanup. Drafts and chat turns never start scripts or an automatic edit,
161
+ // and nor does a read-only ask (#8611): it changed nothing, so there is
162
+ // nothing to check, and its folder is the person's own checkout.
163
+ const checksFollow = !isChat && request.planMode !== "draft" && request.readOnly !== true;
164
+ // A run in the folder itself has no copy to compare with its base, so its
165
+ // state at the start is kept to tell, at the end, whether it changed
166
+ // anything (#8611). null: not a git checkout, or git could not say.
167
+ const startState = checksFollow && !made.isolated ? await folderState(made.cwd) : null;
158
168
  preparation.complete();
159
169
  timing.launched();
160
170
  const firstRunStartedAt = Date.now();
@@ -173,12 +183,16 @@ async function runStarted(ctx, state, { timing, receipt, preparation, finish })
173
183
  let { outcome, sessionIdSource } = retried;
174
184
  const { resumeNotFound } = retried;
175
185
 
176
- // Checking is part of this run, before its one closing reply and cleanup.
177
- // Drafts and chat turns must never start scripts or an automatic edit.
178
- if (outcome.ok && !isChat && request.planMode !== "draft" && !await stopCheck()) {
179
- ({ outcome, sessionIdSource } = await checkAndRepair(ctx, state, {
180
- outcome, sessionIdSource, stopCheck, firstRunStartedAt, childEnvObj, onChunk, runFn, makeRunOpts, remainingBudget,
181
- }));
186
+ if (outcome.ok && checksFollow && !await stopCheck()) {
187
+ if (startState !== null && await folderState(made.cwd) === startState) {
188
+ // Nothing to check: the row says nothing about checks (#4094's empty result).
189
+ log(`[${id}] no checks: the run changed nothing in ${made.cwd}`);
190
+ outcome.result = { checks: [], filesChanged: false, fixAttempted: false };
191
+ } else {
192
+ ({ outcome, sessionIdSource } = await checkAndRepair(ctx, state, {
193
+ outcome, sessionIdSource, stopCheck, firstRunStartedAt, childEnvObj, onChunk, runFn, makeRunOpts, remainingBudget,
194
+ }));
195
+ }
182
196
  }
183
197
 
184
198
  timing.exited();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "viewable-one",
3
- "version": "0.12.9",
3
+ "version": "0.12.10",
4
4
  "description": "Run coding agents from the Viewable board. Connects your machine to app.viewable.one, launches a session in its own worktree when you press Run, and streams what it does back to the canvas.",
5
5
  "keywords": [
6
6
  "mcp",