toolroll 0.9.119 → 0.9.120
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 +31 -0
- package/README.md +8 -8
- package/dist/assignment.js +9 -7
- package/dist/browser/workspace.js +23 -23
- package/dist/builder.js +2 -1
- package/dist/cli-help.js +1 -0
- package/dist/codex-limits.js +40 -22
- package/dist/contracts/console-api.js +2 -0
- package/dist/engine-reads.js +3 -1
- package/dist/flexible-import.js +38 -0
- package/dist/flexible-save.js +128 -0
- package/dist/flexible-session.js +9 -2
- package/dist/flexible-ship.js +3 -3
- package/dist/flexible-thread.js +2 -2
- package/dist/local-checks.js +32 -0
- package/dist/local-landing.js +321 -63
- package/dist/local-owner.js +2 -0
- package/dist/operate.js +25 -7
- package/dist/plan-limits-demand.js +48 -0
- package/dist/result-follow-ups.js +22 -8
- package/dist/review-context.js +2 -1
- package/dist/server/direct-chat.js +24 -3
- package/dist/server/engine-api.js +24 -3
- package/dist/server/render-results.js +6 -4
- package/dist/server/route-table.js +6 -1
- package/dist/server/send-back-build.js +4 -0
- package/dist/server/settings.js +2 -0
- package/dist/server/task-views.js +8 -3
- package/dist/server/tasks.js +51 -9
- package/dist/settings-groups-ui.js +1 -1
- package/dist/subscription-usage.js +11 -5
- package/dist/surface.js +3 -2
- package/dist/task-base.js +23 -4
- package/dist/task-outcome-cli.js +10 -1
- package/dist/tui/darwin-arm64/toolroll-tui +0 -0
- package/dist/tui/darwin-x64/toolroll-tui +0 -0
- package/dist/tui/linux-arm64/toolroll-tui +0 -0
- package/dist/tui/linux-x64/toolroll-tui +0 -0
- package/dist/verification-evidence.js +3 -1
- package/package.json +1 -1
package/dist/server/tasks.js
CHANGED
|
@@ -94,8 +94,10 @@ import {} from "./session.js";
|
|
|
94
94
|
import { approveReleaseCard, releaseApprovalCard, releaseSheetHref, releaseTaskOf } from "../release-approval.js";
|
|
95
95
|
import { releaseSheetPage } from "./render-release.js";
|
|
96
96
|
import { approvalFactsNow, btn } from "./kit.js";
|
|
97
|
-
import { land, landingWords, publishesThroughPullRequests, PULL_REQUESTS_INSTEAD, readLanding } from "../local-landing.js";
|
|
98
|
-
import { localOwnerRefusal, withLocalAct } from "../local-owner.js";
|
|
97
|
+
import { handoffWords, land, landingWords, publishesThroughPullRequests, PULL_REQUESTS_INSTEAD, readLanding } from "../local-landing.js";
|
|
98
|
+
import { localActNow, localOwnerRefusal, withLocalAct } from "../local-owner.js";
|
|
99
|
+
import { localChecksRefusal } from "../local-checks.js";
|
|
100
|
+
import { sessionYesPossible } from "./send-back-build.js";
|
|
99
101
|
import { firstTaskRouted } from "../welcome-facts.js";
|
|
100
102
|
import { plural } from "../design/kit.js";
|
|
101
103
|
export const FIRST_TASK_DETECT_WAIT_MS = 8_000;
|
|
@@ -1088,8 +1090,10 @@ export function createTasksHandlers(runtime) {
|
|
|
1088
1090
|
const typedNote = (body.get("note") ?? "").trim();
|
|
1089
1091
|
const sentNote = withContext(body.get("context"), typedNote);
|
|
1090
1092
|
if (body.get("intent") === "revise") {
|
|
1091
|
-
const
|
|
1092
|
-
const
|
|
1093
|
+
const localBuild = who.via === "cookie" && who.authority === "local-owner" && who.role === "approver";
|
|
1094
|
+
const sessionBuild = who.via === "cookie" && who.authority !== "local-owner" && who.role === "approver" && sessionYesPossible(store, who.name, false);
|
|
1095
|
+
const buildNow = body.get("approve") === "1" && (localBuild || sessionBuild);
|
|
1096
|
+
const result = spendingOnlyOnSuccess(() => requestResultChanges(store, evidenceRoot, {
|
|
1093
1097
|
...(buildNow ? {
|
|
1094
1098
|
currentResult: () => {
|
|
1095
1099
|
const task = store.externalIdFor(found.taskRef);
|
|
@@ -1097,16 +1101,16 @@ export function createTasksHandlers(runtime) {
|
|
|
1097
1101
|
return current !== null && current.activeTaskId === task && current.receipt?.runId === id ? null
|
|
1098
1102
|
: "A newer build of this task came in since this page was drawn. Open the current result, then send it back.";
|
|
1099
1103
|
},
|
|
1100
|
-
approveNow: (child) => withLocalAct("approve-plan", () => {
|
|
1104
|
+
approveNow: localBuild ? (child) => withLocalAct("approve-plan", () => {
|
|
1101
1105
|
const filed = store.getScope(child);
|
|
1102
1106
|
return filed !== null && !approvalOf(filed).approved && approveScope(store, child, who.name, now, filed.digest, "").ok;
|
|
1103
|
-
}),
|
|
1107
|
+
}) : (child) => sessionYesNow(store, child, who.name, now),
|
|
1104
1108
|
} : {}),
|
|
1105
1109
|
run: id, batch: body.get("batch"), source: body.get("source"), actor: who.name,
|
|
1106
1110
|
repos: admissionList(), includeUnplaced: visible(null), allowMode: who.via === "cookie",
|
|
1107
1111
|
origin: who.via === "cookie" ? "person" : "machine", typedWords: who.via === "cookie" ? typedNote : null,
|
|
1108
1112
|
note: sentNote, path: body.get("path") ?? "", line: body.get("line") ?? "", request: body.get("request"), image,
|
|
1109
|
-
}, now);
|
|
1113
|
+
}, now), revised => !revised.ok);
|
|
1110
1114
|
if (answersInPlace(incoming))
|
|
1111
1115
|
return result.ok ? answerActInPlace(response, "done", "Sent back. The revision is filed.", 200) : answerActInPlace(response, "refused", result.message, result.status);
|
|
1112
1116
|
if (!result.ok) {
|
|
@@ -1216,7 +1220,17 @@ export function createTasksHandlers(runtime) {
|
|
|
1216
1220
|
if (store.isDemo())
|
|
1217
1221
|
return refuse(response, who, 403, "The demo runs no checks.", back);
|
|
1218
1222
|
const level = body.get("level") === "full" ? "full" : "quick";
|
|
1219
|
-
const asked =
|
|
1223
|
+
const asked = who.authority === "local-owner"
|
|
1224
|
+
? store.transact(() => {
|
|
1225
|
+
if (localActNow(store, "run-checks") === null)
|
|
1226
|
+
return { ok: false, message: "Sign in with your password to do this." };
|
|
1227
|
+
const task = store.externalIdFor(found.taskRef);
|
|
1228
|
+
const problem = task === null ? "No such result." : localChecksRefusal(store, who.name, task);
|
|
1229
|
+
if (problem !== null)
|
|
1230
|
+
return { ok: false, message: problem };
|
|
1231
|
+
return requestFollowUpChecks(store, { runId: id, level, actor: who.name, why: "local-owner" }, now);
|
|
1232
|
+
})
|
|
1233
|
+
: requestFollowUpChecks(store, { runId: id, level, actor: who.name }, now);
|
|
1220
1234
|
if (!asked.ok)
|
|
1221
1235
|
return refuse(response, who, 409, asked.message, back);
|
|
1222
1236
|
return redirect(response, back.startsWith("/t/") && !/[?&]tab=result(?:[&#]|$)/.test(back) ? back : `${back.split("#")[0]}#follow-ups`);
|
|
@@ -2813,15 +2827,24 @@ export function createTasksHandlers(runtime) {
|
|
|
2813
2827
|
const read = await readLanding(store, act.taskId, access, now, options);
|
|
2814
2828
|
if (!read.ok)
|
|
2815
2829
|
return taskScreen(response, who, act.taskId, read.message, 409);
|
|
2816
|
-
if (!("plan" in read))
|
|
2830
|
+
if (!("plan" in read)) {
|
|
2831
|
+
if (answersInPlace(ctx.request))
|
|
2832
|
+
return answerActInPlace(response, "done", `Already on ${read.landed.ref.replace(/^refs\/heads\//, "")} (${read.landed.commit.slice(0, 7)}).`, 200);
|
|
2817
2833
|
return redirect(response, taskHref(act.taskId));
|
|
2834
|
+
}
|
|
2818
2835
|
const plan = read.plan;
|
|
2836
|
+
if (answersInPlace(ctx.request))
|
|
2837
|
+
return respond(response, 200, "application/json; charset=utf-8", JSON.stringify({ outcome: "land-terms", key: plan.key, lines: landingWords(plan) }));
|
|
2819
2838
|
const title = undo ? "Undo landing" : `Land on ${plan.branch}`;
|
|
2820
2839
|
return sendScreen(response, 200, screen(title, html `<h1>${title}</h1>${landingWords(plan).map(line => html `<p>${line}</p>`)}${postForm(`${taskHref(act.taskId)}/land`, html `${btn(undo ? "Undo it" : "Land it", { variant: "primary", type: "submit" })} ${btn("Cancel", { variant: "ghost", href: taskHref(act.taskId) })}`, { hidden: { key: plan.key, ...(into === "" ? {} : { into }), ...(undo ? { undo: "1" } : {}) } })}`, { chrome: chromeFor(ref.repo, "tasks") }));
|
|
2821
2840
|
}
|
|
2822
2841
|
const done = await land(store, act.taskId, { key, ...(into === "" ? {} : { into }), ...(undo ? { undo: true } : {}) }, principal !== null ? { kind: "person", who: principal } : { kind: "local" }, access, now, { root: evidenceRoot });
|
|
2823
2842
|
if (!done.ok)
|
|
2824
2843
|
return taskScreen(response, who, act.taskId, done.message, done.reason === "authority" ? 403 : 409);
|
|
2844
|
+
if (done.handoff !== null) {
|
|
2845
|
+
const words = `Landing commit ${done.commit.slice(0, 7)} is ready. Your project folder has ${done.branch} checked out, so Toolroll didn't touch it. ${handoffWords(done.handoff, done.commit)}`;
|
|
2846
|
+
return answersInPlace(ctx.request) ? answerActInPlace(response, "done", words, 200) : taskScreen(response, who, act.taskId, words, 200);
|
|
2847
|
+
}
|
|
2825
2848
|
if (answersInPlace(ctx.request))
|
|
2826
2849
|
return answerActInPlace(response, "done", `${done.kind === "undo" ? "Undone" : "Landed"} on ${done.branch} (${done.commit.slice(0, 7)}).`, 200);
|
|
2827
2850
|
return redirect(response, taskHref(act.taskId));
|
|
@@ -3086,3 +3109,22 @@ export function localOwnerRoute(store, taskId, body, now) {
|
|
|
3086
3109
|
const done = localOwnerChangeAgents(store, taskId, { phase, provider, model, sawDigest }, when, now);
|
|
3087
3110
|
return done.ok ? { ok: true, words: done.words } : done;
|
|
3088
3111
|
}
|
|
3112
|
+
const NOT_SEALED = Symbol("not sealed");
|
|
3113
|
+
function sessionYesNow(store, child, by, now) {
|
|
3114
|
+
try {
|
|
3115
|
+
return store.savepoint(() => {
|
|
3116
|
+
const filed = store.getScope(child);
|
|
3117
|
+
if (filed === null || approvalOf(filed).approved)
|
|
3118
|
+
throw NOT_SEALED;
|
|
3119
|
+
const yes = spendingOnlyOnSuccess(() => withFreshness("approve-standard", () => approveScope(store, child, by, now, filed.digest, "")), result => !result.ok);
|
|
3120
|
+
if (!yes.ok)
|
|
3121
|
+
throw NOT_SEALED;
|
|
3122
|
+
return true;
|
|
3123
|
+
});
|
|
3124
|
+
}
|
|
3125
|
+
catch (error) {
|
|
3126
|
+
if (error === NOT_SEALED)
|
|
3127
|
+
return false;
|
|
3128
|
+
throw error;
|
|
3129
|
+
}
|
|
3130
|
+
}
|
|
@@ -360,7 +360,7 @@ export function accessGroup(facts, flags) {
|
|
|
360
360
|
const people = facts.people;
|
|
361
361
|
const links = [
|
|
362
362
|
settingsLink({ href: "/people", title: "People", status: people === null ? "Your own access" : [accessWords({ ...facts, passwordless: null }), people.invites === 0 ? "no open invites" : plural(people.invites, "open invite", "open invites")].join(" · ") }),
|
|
363
|
-
settingsLink({ href: "/settings/sessions", title: "Sessions and tokens", status:
|
|
363
|
+
settingsLink({ href: "/settings/sessions", title: "Sessions and tokens", status: `${plural(facts.access.sessions, "session", "sessions")} signed in · ${plural(facts.access.tokens, "API token", "API tokens")}` }),
|
|
364
364
|
...(facts.operator && (advancedOn(facts) || facts.sso !== null) ? [
|
|
365
365
|
settingsLink({ href: "/settings/sign-in", title: "Sign-in with a provider", status: facts.sso === null ? "Not set up: everyone uses a password" : `People sign in with ${facts.sso}` })
|
|
366
366
|
] : []),
|
|
@@ -8,6 +8,7 @@ import { codingEnvironment } from "./coding-provider.js";
|
|
|
8
8
|
import { readCodexLimits } from "./codex-limits.js";
|
|
9
9
|
import { claudeLimitsOf } from "./provider-limits.js";
|
|
10
10
|
import { billingOf } from "./spend.js";
|
|
11
|
+
import { directChatRunning } from "./plan-limits-demand.js";
|
|
11
12
|
const CLAUDE_STALE_MS = 30 * 60_000;
|
|
12
13
|
const GEMINI_STALE_MS = 15 * 60_000;
|
|
13
14
|
export function subscriptionStatusPath(databaseFile) {
|
|
@@ -187,6 +188,8 @@ function claudeNeedsRefresh(store, now) {
|
|
|
187
188
|
if (store.handle.prepare("SELECT 1 AS live FROM run WHERE provider = 'claude' AND outcome IS NULL AND started_at > ? LIMIT 1").get(recent) !== undefined) {
|
|
188
189
|
return false;
|
|
189
190
|
}
|
|
191
|
+
if (directChatRunning(store, "claude", now))
|
|
192
|
+
return false;
|
|
190
193
|
const rows = store.providerLimits().filter(one => one.provider === "claude");
|
|
191
194
|
if (rows.length === 0)
|
|
192
195
|
return true;
|
|
@@ -205,15 +208,18 @@ function geminiNeedsRefresh(databaseFile, now) {
|
|
|
205
208
|
return now.getTime() - Date.parse(stored.observedAt) > GEMINI_STALE_MS;
|
|
206
209
|
}
|
|
207
210
|
export async function refreshSubscriptions(store, databaseFile, options = {}) {
|
|
211
|
+
const readers = options.readers ?? {};
|
|
212
|
+
const gate = (read, otherwise) => options.stillWanted?.() === false ? otherwise() : read();
|
|
208
213
|
const now = options.now ?? new Date();
|
|
209
214
|
const shouldCodex = options.skipCodex !== true && billingOf("codex") === "subscription";
|
|
210
215
|
const shouldClaude = options.forceClaude === true || claudeNeedsRefresh(store, now);
|
|
211
216
|
const shouldGemini = options.forceGemini === true || geminiNeedsRefresh(databaseFile, now);
|
|
217
|
+
const readGemini = shouldGemini && options.stillWanted?.() !== false;
|
|
212
218
|
const [codex, claude, gemini] = await Promise.all([
|
|
213
|
-
shouldCodex ? readCodexLimits() : Promise.resolve(null),
|
|
214
|
-
shouldClaude ? readClaudeLimits() : Promise.resolve(null),
|
|
215
|
-
|
|
216
|
-
? readGeminiSubscription({ now })
|
|
219
|
+
shouldCodex ? gate(() => (readers.codex ?? (() => readCodexLimits()))(), () => Promise.resolve(null)) : Promise.resolve(null),
|
|
220
|
+
shouldClaude ? gate(() => (readers.claude ?? (() => readClaudeLimits()))(), () => Promise.resolve(null)) : Promise.resolve(null),
|
|
221
|
+
readGemini
|
|
222
|
+
? (readers.gemini ?? (at => readGeminiSubscription({ now: at })))(now)
|
|
217
223
|
: Promise.resolve((databaseFile !== null ? readStoredGeminiStatus(databaseFile) : null) ?? {
|
|
218
224
|
connected: false,
|
|
219
225
|
provider: "antigravity",
|
|
@@ -227,7 +233,7 @@ export async function refreshSubscriptions(store, databaseFile, options = {}) {
|
|
|
227
233
|
store.recordProviderLimits(codex, now);
|
|
228
234
|
if (claude !== null)
|
|
229
235
|
store.recordProviderLimits(claude, now);
|
|
230
|
-
if (databaseFile !== null &&
|
|
236
|
+
if (databaseFile !== null && readGemini)
|
|
231
237
|
writeStoredGeminiStatus(databaseFile, gemini);
|
|
232
238
|
return { claude, codex, gemini, refreshedAt: now.toISOString() };
|
|
233
239
|
}
|
package/dist/surface.js
CHANGED
|
@@ -309,7 +309,7 @@ const GUIDE_ROWS = [
|
|
|
309
309
|
{ name: "digest", takesValue: true, meaning: "the exact receipt from assignment show; accepts and finishes exactly that result" },
|
|
310
310
|
{ name: "despite", takesValue: true, meaning: "accept with this reason, without finishing; never combines with --finish or --digest (--note is its alias)" }],
|
|
311
311
|
notableReasons: ["usage", "unknown-task", "no-run", "not-ready"] },
|
|
312
|
-
{ ...operator("task land", "put accepted work on the project's own branch when it has no pull requests: bare shows exactly what lands where; --yes --key <key> lands it as
|
|
312
|
+
{ ...operator("task land", "put accepted work on the project's own branch when it has no pull requests: bare shows exactly what lands where; --yes --key <key> lands it as one new commit on top; --undo reverts that commit with a new one"),
|
|
313
313
|
positionals: [{ name: "id", required: true, meaning: "the task" }],
|
|
314
314
|
flags: [jsonFlag, dbFlag, { name: "into", takesValue: true, meaning: "land on this branch instead of the recorded one (the yes records it)" },
|
|
315
315
|
{ name: "undo", takesValue: false, meaning: "revert the landing with a new commit on the branch" },
|
|
@@ -438,6 +438,7 @@ const GUIDE_ROWS = [
|
|
|
438
438
|
operator("thread end", "end one of your threads for good (its agent stops; its work can still be shipped for a week)"),
|
|
439
439
|
operator("thread remove", "remove one of your threads' working copy (refused while its agent may run or a Ship is open)"),
|
|
440
440
|
operator("thread ship", "ship one of your threads' committed work: shows its terms, asks, then takes your password typed now"),
|
|
441
|
+
operator("thread save", "save one of your threads' committed work as the branch toolroll/code-<id> in its project (no pull request, no merge); says the git merge that puts it on your branch"),
|
|
441
442
|
operator("setup clear", "clear installation setup"),
|
|
442
443
|
operator("verify set", "approve the one shell command the plane re-runs after every future commit (--quick \"<cmd>\" approves the fast check Quick runs); --self-heal binds one approved-setup replay when a required project executable is missing"),
|
|
443
444
|
operator("verify clear", "revoke a repository's approved verification command; --level quick revokes only the quick command"),
|
|
@@ -486,7 +487,7 @@ const REMOTE_NO = [
|
|
|
486
487
|
"models results",
|
|
487
488
|
"models suggestions", "models accept", "models dismiss", "models turn-off", "models keep", "models try", "models stop",
|
|
488
489
|
"map on", "map off", "map holdout end", "map report",
|
|
489
|
-
"thread list", "thread show", "thread end", "thread remove", "thread ship",
|
|
490
|
+
"thread list", "thread show", "thread end", "thread remove", "thread ship", "thread save",
|
|
490
491
|
"publish", "publish status", "publish merge", "publish refire", "publish unblock", "publish rearm", "publish grant", "publish revoke",
|
|
491
492
|
"enroll", "revoke",
|
|
492
493
|
"flows import", "flows trigger check", "flows script save",
|
package/dist/task-base.js
CHANGED
|
@@ -10,11 +10,29 @@ export const readGit = (cwd, args) => {
|
|
|
10
10
|
};
|
|
11
11
|
const commits = (count) => `${count} commit${count === 1 ? "" : "s"}`;
|
|
12
12
|
export function baseStandingWords(view) {
|
|
13
|
-
const short = view.base.slice(0, 8);
|
|
13
|
+
const short = view.family === true ? `Whole change since ${view.base.slice(0, 8)} (includes earlier attempts' work that's still in it)` : view.base.slice(0, 8);
|
|
14
14
|
if (view.main === null || view.behind === null)
|
|
15
15
|
return short;
|
|
16
16
|
return view.behind === 0 ? `${short} · Up to date with ${view.main}` : `${short} · Behind ${view.main} by ${commits(view.behind)}`;
|
|
17
17
|
}
|
|
18
|
+
export function familyStartOf(store, taskRef) {
|
|
19
|
+
const id = store.externalIdFor(taskRef);
|
|
20
|
+
const ref = id === null ? null : store.lookupRef(id);
|
|
21
|
+
if (id === null || ref === null || ref.revisionOf === null)
|
|
22
|
+
return null;
|
|
23
|
+
const ancestry = store.revisionAncestryStatus(id);
|
|
24
|
+
const rootId = ancestry.chain[ancestry.chain.length - 1];
|
|
25
|
+
const root = ancestry.problem !== null || rootId === undefined || rootId === id ? null : store.lookupRef(rootId);
|
|
26
|
+
if (root === null || root.repo !== ref.repo)
|
|
27
|
+
return null;
|
|
28
|
+
const first = store.runsFor(root.id).filter(one => one.role === "builder" && one.branch !== null && one.baseRevision !== null).sort((a, b) => a.id - b.id)[0];
|
|
29
|
+
if (first === undefined || first.branch === null)
|
|
30
|
+
return null;
|
|
31
|
+
return store.firstBuilderBase(root.id, first.branch) ?? first.baseRevision;
|
|
32
|
+
}
|
|
33
|
+
export function wholeChangeBaseOf(store, taskRef, branch) {
|
|
34
|
+
return familyStartOf(store, taskRef) ?? store.firstBuilderBase(taskRef, branch);
|
|
35
|
+
}
|
|
18
36
|
export function freshBaseFor(store, taskId, branch, main) {
|
|
19
37
|
const ref = store.lookupRef(taskId);
|
|
20
38
|
if (ref === null || ref.revisionOf !== null || store.getScope(taskId)?.candidate != null || store.filedViaOf(taskId)?.startsWith("coding:") === true)
|
|
@@ -30,12 +48,13 @@ export function taskBaseOf(store, taskId, git = readGit) {
|
|
|
30
48
|
return null;
|
|
31
49
|
const branch = latest.branch;
|
|
32
50
|
const move = store.latestBranchBaseMove(ref.id, branch);
|
|
33
|
-
const
|
|
51
|
+
const family = familyStartOf(store, ref.id);
|
|
52
|
+
const base = family ?? (move !== null && move.afterRun >= latest.id ? move.to : store.recordedBranchBase(ref.id, branch) ?? latest.baseRevision);
|
|
34
53
|
const main = git(ref.repo, ["symbolic-ref", "--short", "-q", "HEAD"]) || null;
|
|
35
54
|
const counted = main === null ? null : git(ref.repo, ["rev-list", "--count", `${base}..refs/heads/${main}`]);
|
|
36
55
|
const behind = counted === null || !/^\d+$/.test(counted) ? null : Number(counted);
|
|
37
|
-
const view = { base, branch, main: behind === null ? null : main, behind };
|
|
38
|
-
return { ...view, words: `Base ${baseStandingWords(view)}` };
|
|
56
|
+
const view = { base, branch, main: behind === null ? null : main, behind, ...(family === null ? {} : { family: true }) };
|
|
57
|
+
return { ...view, words: family === null ? `Base ${baseStandingWords(view)}` : baseStandingWords(view) };
|
|
39
58
|
}
|
|
40
59
|
export function recentGitReads(git = readGit, ttlMs = 15_000, entries = 64, now = Date.now) {
|
|
41
60
|
const kept = new Map();
|
package/dist/task-outcome-cli.js
CHANGED
|
@@ -15,6 +15,7 @@ import { proveRunStopped } from './stop-proof.js';
|
|
|
15
15
|
import { familyChangedFiles } from './result-completion.js';
|
|
16
16
|
import { activeRemote } from './remote-run.js';
|
|
17
17
|
import { underAgent } from './prompt.js';
|
|
18
|
+
import { landingOf, publishesThroughPullRequests } from './local-landing.js';
|
|
18
19
|
export async function runTaskOutcomeCommand(action, positional, flags, context) {
|
|
19
20
|
const command = context.command ?? `task ${action}`;
|
|
20
21
|
const emit = (result, lines) => {
|
|
@@ -96,7 +97,7 @@ export async function runTaskOutcomeCommand(action, positional, flags, context)
|
|
|
96
97
|
return emit(changed);
|
|
97
98
|
const assignment = 'body' in changed ? changed.body : changed.assignment;
|
|
98
99
|
return emit({ ok: true, result: assignment }, [`${current.rootId} · Accepted`, `Result: ${current.activeTaskId} · build #${current.receipt.runId} · ${current.receipt.head?.slice(0, 7) ?? 'no commit'}`,
|
|
99
|
-
...(current.readiness?.checksOff ? [] : [current.receipt.checks.detail])]);
|
|
100
|
+
...(current.readiness?.checksOff ? [] : [current.receipt.checks.detail]), ...landNext(store, current.rootId, current.receipt.head)]);
|
|
100
101
|
}
|
|
101
102
|
const feedback = flags.get('feedback'), runFlag = flags.get('run'), sourceFlag = flags.get('source'), keyFlag = flags.get('key');
|
|
102
103
|
if (typeof feedback !== 'string' || !feedback.trim())
|
|
@@ -232,8 +233,16 @@ export async function runLocalCompletion(positional, flags, context) {
|
|
|
232
233
|
`${assignment.rootId} · ${done.replayed ? 'Already accepted' : 'Accepted'}`,
|
|
233
234
|
`Result: ${receipt.taskId} · build #${receipt.runId} · ${receipt.head?.slice(0, 7) ?? 'no commit'}`,
|
|
234
235
|
...(assignment.readiness?.checksOff ? [] : [receipt.checks.detail]),
|
|
236
|
+
...landNext(store, assignment.rootId, receipt.head),
|
|
235
237
|
]);
|
|
236
238
|
}
|
|
239
|
+
function landNext(store, rootId, head) {
|
|
240
|
+
const repo = store.lookupRef(rootId)?.repo ?? null;
|
|
241
|
+
if (repo === null || head === null || publishesThroughPullRequests(store, repo))
|
|
242
|
+
return [];
|
|
243
|
+
const landed = landingOf(store, rootId);
|
|
244
|
+
return landed !== null && !landed.undone ? [] : [`Next: toolroll task land ${rootId}`];
|
|
245
|
+
}
|
|
237
246
|
export function reviseAsLocalOwner(store, taskId, input, now, evidenceRoot) {
|
|
238
247
|
const fail = (reason, message) => ({ ok: false, reason, message });
|
|
239
248
|
try {
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -13,6 +13,7 @@ import { sealedInventorySchema } from "./contracts/release-check.js";
|
|
|
13
13
|
import { purposeCheckMode } from "./contracts/release-terms.js";
|
|
14
14
|
import { provedComposition } from "./release-recheck.js";
|
|
15
15
|
import { checkAttemptOf, verifyCommandAt } from "./store.js";
|
|
16
|
+
import { familyStartOf } from "./task-base.js";
|
|
16
17
|
export const VERIFICATION_RECEIPT_CAPTURE = "machine verification receipt v1";
|
|
17
18
|
const hash = (value) => createHash("sha256").update(JSON.stringify(value)).digest("hex");
|
|
18
19
|
const binding = (a) => ({ artifactId: a.id, sha256: a.sha256, bytesStored: a.bytesStored, bytesOriginal: a.bytesOriginal, truncated: a.truncated, redacted: a.redacted, captureStatus: a.captureStatus });
|
|
@@ -277,7 +278,8 @@ export function assessmentFromSavedEvidence(store, root, runId) {
|
|
|
277
278
|
try {
|
|
278
279
|
const view = readVerificationView(gate.bytes);
|
|
279
280
|
const base = source.branch ? store.firstBuilderBase(source.taskRef, source.branch) ?? source.baseRevision : source.baseRevision;
|
|
280
|
-
const
|
|
281
|
+
const family = familyStartOf(store, source.taskRef);
|
|
282
|
+
const paths = (family === null ? null : savedInventoryPaths(stat, source.headRevision, family)) ?? savedInventoryPaths(stat, source.headRevision, base);
|
|
281
283
|
if (!view.ok || paths === null)
|
|
282
284
|
return null;
|
|
283
285
|
const receipt = view.value;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toolroll",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.120",
|
|
4
4
|
"description": "Your agents build. You decide. A control plane for coding agents — Claude Code, Codex, Gemini: approve the exact scope once, get results back Ready with the diff, the passing check and screenshots. Runs on your machine.",
|
|
5
5
|
"directories": {
|
|
6
6
|
"doc": "docs"
|