tryharness 0.7.67 → 0.7.69
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/lib/boardFileCommands.mjs +5 -7
- package/lib/boardFiles.mjs +5 -0
- package/lib/boardProtocol.json +50 -64
- package/lib/boardWaits.mjs +6 -0
- package/lib/cards.mjs +13 -1
- package/lib/comfyExecution.mjs +545 -0
- package/lib/context.mjs +34 -20
- package/lib/contextWorker.mjs +199 -0
- package/lib/coordinator.mjs +224 -22
- package/lib/daemon.mjs +196 -14
- package/lib/dispatchContract.json +313 -0
- package/lib/dispatchTools.js +87 -0
- package/lib/dispatches.mjs +975 -0
- package/lib/environment.mjs +54 -69
- package/lib/files.mjs +35 -0
- package/lib/frames.mjs +5 -9
- package/lib/goalCommands.mjs +13 -10
- package/lib/kept.mjs +131 -0
- package/lib/landed.mjs +1 -34
- package/lib/library.mjs +18 -11
- package/lib/live.mjs +30 -11
- package/lib/localAgentAsk.mjs +27 -4
- package/lib/localStack.mjs +17 -13
- package/lib/machineRoutes.mjs +5 -0
- package/lib/machineRuns.mjs +2 -1
- package/lib/mcp-stdio.mjs +42 -1
- package/lib/openHere.mjs +36 -0
- package/lib/openRequests.mjs +56 -0
- package/lib/ownMachines.mjs +232 -24
- package/lib/phones.mjs +29 -4
- package/lib/places.mjs +44 -11
- package/lib/portCalls.mjs +54 -0
- package/lib/promptDecider.mjs +471 -0
- package/lib/promptFlow.mjs +562 -0
- package/lib/promptScopes.mjs +670 -0
- package/lib/provenance.mjs +3 -2
- package/lib/runAuthority.mjs +14 -2
- package/lib/runBrief.mjs +2 -2
- package/lib/runWorker.mjs +25 -5
- package/lib/runner.mjs +62 -6
- package/lib/sealed.mjs +37 -0
- package/lib/sessionControl.mjs +47 -14
- package/lib/sessionIndex.mjs +11 -3
- package/lib/store.mjs +362 -40
- package/lib/swarm.mjs +85 -34
- package/lib/swarmMemory.mjs +39 -16
- package/lib/taskCommands.mjs +125 -1
- package/lib/team.json +10 -0
- package/lib/team.mjs +287 -26
- package/lib/threadBriefs.mjs +43 -31
- package/lib/threadRuns.mjs +47 -3
- package/npm-shrinkwrap.json +14 -14
- package/package.json +4 -4
- package/release.json +55 -43
package/lib/daemon.mjs
CHANGED
|
@@ -34,6 +34,8 @@ import { keepProfile } from "./profile.mjs";
|
|
|
34
34
|
import { createSwarmMemory } from "./swarmMemory.mjs";
|
|
35
35
|
import { createWorktrees } from "./worktrees.mjs";
|
|
36
36
|
import { createLanded } from "./landed.mjs";
|
|
37
|
+
import { createOpenRequests } from "./openRequests.mjs";
|
|
38
|
+
import { openHere } from "./openHere.mjs";
|
|
37
39
|
import { createFolders, repositoryName } from "./folders.mjs";
|
|
38
40
|
import { createRepoLinks } from "./repoLinks.mjs";
|
|
39
41
|
import { notifyDesktop } from "./notify.mjs";
|
|
@@ -156,6 +158,10 @@ import {
|
|
|
156
158
|
} from "./taskRooms.mjs";
|
|
157
159
|
import { createThreadActions, inRoom, mentionsIn } from "./threadActions.mjs";
|
|
158
160
|
import { createThreadAuthority } from "./threadAuthority.mjs";
|
|
161
|
+
import { createDispatches } from "./dispatches.mjs";
|
|
162
|
+
import { createPromptFlow } from "./promptFlow.mjs";
|
|
163
|
+
import { createComfyExecution } from "./comfyExecution.mjs";
|
|
164
|
+
import { createPromptDecider } from "./promptDecider.mjs";
|
|
159
165
|
import { createThreadBriefs } from "./threadBriefs.mjs";
|
|
160
166
|
|
|
161
167
|
// claude-mem 13.35.0, scratch worker with 3,000 observations, on the same machine: the whole lookup (git calls,
|
|
@@ -887,6 +893,117 @@ export async function startDaemon() {
|
|
|
887
893
|
worktreeRoot: path.join(paths.home, "worktrees"),
|
|
888
894
|
projectRoot: path.join(paths.home, "projects"),
|
|
889
895
|
});
|
|
896
|
+
const promptArtifact = ({
|
|
897
|
+
taskId,
|
|
898
|
+
name,
|
|
899
|
+
bytes,
|
|
900
|
+
author,
|
|
901
|
+
mime = "text/plain",
|
|
902
|
+
}) => {
|
|
903
|
+
const sha256 = keepBlob(bytes);
|
|
904
|
+
const prior = store
|
|
905
|
+
.taskFiles(taskId)
|
|
906
|
+
.find(
|
|
907
|
+
(file) =>
|
|
908
|
+
file.sha256 === sha256 && file.name === name && file.author === author
|
|
909
|
+
);
|
|
910
|
+
if (prior) return prior;
|
|
911
|
+
const file = store.addFile({
|
|
912
|
+
taskId,
|
|
913
|
+
name,
|
|
914
|
+
mime,
|
|
915
|
+
bytes: bytes.length,
|
|
916
|
+
sha256,
|
|
917
|
+
author,
|
|
918
|
+
});
|
|
919
|
+
store.addContribution({
|
|
920
|
+
taskId,
|
|
921
|
+
kind: "file",
|
|
922
|
+
author,
|
|
923
|
+
text: `${author} attached ${fileLine(file)}`,
|
|
924
|
+
source: `file:${file.id}`,
|
|
925
|
+
});
|
|
926
|
+
notifyBoard(store.getTask(taskId));
|
|
927
|
+
return file;
|
|
928
|
+
};
|
|
929
|
+
const dispatches = createDispatches({
|
|
930
|
+
store,
|
|
931
|
+
machineId: () => machine.id,
|
|
932
|
+
installedAgents,
|
|
933
|
+
setToWait: threadAuthority.setToWait,
|
|
934
|
+
guard: (text) => local.readByGuard(text),
|
|
935
|
+
notifyBoard,
|
|
936
|
+
inferenceRefusal: (agent) => cloudAi?.refusal(agent) ?? null,
|
|
937
|
+
projectRoom: (id) => projects?.isProjectRoom(id) ?? false,
|
|
938
|
+
standingRules: authority.standingRules,
|
|
939
|
+
standingVerdict: authority.standingVerdict,
|
|
940
|
+
computers: () => [
|
|
941
|
+
...new Map(
|
|
942
|
+
[
|
|
943
|
+
{ id: machine.id, label: machine.label },
|
|
944
|
+
...(ownMachines?.all() ?? []),
|
|
945
|
+
...store
|
|
946
|
+
.ownMachines()
|
|
947
|
+
.map((c) => ({ id: c.machine_id, label: c.label })),
|
|
948
|
+
]
|
|
949
|
+
.filter((c) => c.label)
|
|
950
|
+
.map((c) => [c.id, c])
|
|
951
|
+
).values(),
|
|
952
|
+
],
|
|
953
|
+
privacy: () => coordinatorMode() === "local",
|
|
954
|
+
artifact: promptArtifact,
|
|
955
|
+
});
|
|
956
|
+
const comfyExecution = createComfyExecution({
|
|
957
|
+
store,
|
|
958
|
+
configuration: () => readJson(paths.config, {}).comfy,
|
|
959
|
+
machine: () => machine,
|
|
960
|
+
publish: async (execution) => {
|
|
961
|
+
const call = {
|
|
962
|
+
command: "board.prompt.receipt",
|
|
963
|
+
agent: "user",
|
|
964
|
+
execution,
|
|
965
|
+
};
|
|
966
|
+
if (machine.role === "worker") {
|
|
967
|
+
if (store.meta("machine-home") !== execution.from) return { ok: false };
|
|
968
|
+
return ownMachines?.callHome(call);
|
|
969
|
+
}
|
|
970
|
+
return promptFlow.localReceipt(execution);
|
|
971
|
+
},
|
|
972
|
+
});
|
|
973
|
+
const promptFlow = createPromptFlow({
|
|
974
|
+
store,
|
|
975
|
+
machine: () => machine,
|
|
976
|
+
computers: () => [
|
|
977
|
+
{ id: machine.id, label: machine.label },
|
|
978
|
+
...new Map(
|
|
979
|
+
[
|
|
980
|
+
...store.ownMachines().map((c) => ({
|
|
981
|
+
id: c.machine_id,
|
|
982
|
+
label: c.label,
|
|
983
|
+
connected: false,
|
|
984
|
+
})),
|
|
985
|
+
...(ownMachines?.all() ?? []),
|
|
986
|
+
]
|
|
987
|
+
.filter((c) => c.id !== machine.id)
|
|
988
|
+
.map((c) => [c.id, c])
|
|
989
|
+
).values(),
|
|
990
|
+
],
|
|
991
|
+
remote: (id, call) => ownMachines?.promptTo(id, call),
|
|
992
|
+
executeHere: comfyExecution.answer,
|
|
993
|
+
authority,
|
|
994
|
+
privacy: () => coordinatorMode() === "local",
|
|
995
|
+
artifact: promptArtifact,
|
|
996
|
+
notify: notifyBoard,
|
|
997
|
+
dispatch: dispatches.command,
|
|
998
|
+
decider: createPromptDecider({
|
|
999
|
+
configuration: () => readJson(paths.config, {}),
|
|
1000
|
+
record: (trace) =>
|
|
1001
|
+
store.meta(
|
|
1002
|
+
`prompt-flow-response:${trace.requestRef}`,
|
|
1003
|
+
JSON.stringify(trace)
|
|
1004
|
+
),
|
|
1005
|
+
}),
|
|
1006
|
+
});
|
|
890
1007
|
|
|
891
1008
|
// Threads: one objective the person set for a team, worked in a room. A post wakes the agents it names; a job posted
|
|
892
1009
|
// in the thread runs on the thread's authority; Harness facilitates and answers once. Backstops pause the room
|
|
@@ -1058,7 +1175,6 @@ export async function startDaemon() {
|
|
|
1058
1175
|
goals,
|
|
1059
1176
|
teams,
|
|
1060
1177
|
projects: () => projects,
|
|
1061
|
-
roster: actors,
|
|
1062
1178
|
files: boardFiles,
|
|
1063
1179
|
runsHere: (agent) => RUNNERS.has(agent),
|
|
1064
1180
|
computerOf,
|
|
@@ -1357,7 +1473,6 @@ export async function startDaemon() {
|
|
|
1357
1473
|
pauseGoal: actions.pause,
|
|
1358
1474
|
relayRequest: sealed.request,
|
|
1359
1475
|
replaceHeld,
|
|
1360
|
-
searchContext: local.searchContext,
|
|
1361
1476
|
sendThreadMessage: sealed.sendMessage,
|
|
1362
1477
|
setupNote,
|
|
1363
1478
|
slotOf: (...args) => slotOf(...args),
|
|
@@ -1517,13 +1632,15 @@ export async function startDaemon() {
|
|
|
1517
1632
|
store,
|
|
1518
1633
|
environment,
|
|
1519
1634
|
worktrees,
|
|
1520
|
-
|
|
1521
|
-
|
|
1635
|
+
resolveNamed: (text, folder) =>
|
|
1636
|
+
local.ready(["search"]) && folder
|
|
1637
|
+
? local.contextEngine.mentions(text, folder)
|
|
1638
|
+
: { files: [], symbols: [] },
|
|
1522
1639
|
log,
|
|
1523
1640
|
});
|
|
1524
|
-
const frameFor = (threadId, options) => {
|
|
1641
|
+
const frameFor = async (threadId, options) => {
|
|
1525
1642
|
try {
|
|
1526
|
-
return frames.build(threadId, options);
|
|
1643
|
+
return await frames.build(threadId, options);
|
|
1527
1644
|
} catch (error) {
|
|
1528
1645
|
log(`task frame for ${threadId}: ${error.message}`);
|
|
1529
1646
|
return null;
|
|
@@ -1699,15 +1816,17 @@ export async function startDaemon() {
|
|
|
1699
1816
|
),
|
|
1700
1817
|
machinesOf: (agent, workspace) =>
|
|
1701
1818
|
ownMachines?.computersFor(agent, workspace),
|
|
1819
|
+
computerOf: threadRuns.computerOf,
|
|
1702
1820
|
placeable: (agent, workspace) =>
|
|
1703
1821
|
installedAgents.includes(agent) ||
|
|
1704
1822
|
Boolean(ownMachines?.placeElsewhere(agent, workspace)),
|
|
1705
1823
|
// A round's hand-ons carry the person's go whoever decided it, Harness's server included (owner, October 13, kept
|
|
1706
1824
|
// October 26 over security audit S4: waiting on every round's Start costs the swarm acting on its own).
|
|
1707
|
-
handOn: (goalId, agent, reason, { review, words }) =>
|
|
1825
|
+
handOn: (goalId, agent, reason, { review, words, routeMachine }) =>
|
|
1708
1826
|
RUNNERS.has(agent)
|
|
1709
1827
|
? threadRuns.wake(goalId, agent, reason, {
|
|
1710
1828
|
review,
|
|
1829
|
+
routeMachine,
|
|
1711
1830
|
go: threadAuthority.personsGo("harness", agent),
|
|
1712
1831
|
})
|
|
1713
1832
|
: actions.ask(goalId, agent, reason, "harness", words),
|
|
@@ -1722,9 +1841,9 @@ export async function startDaemon() {
|
|
|
1722
1841
|
why,
|
|
1723
1842
|
}),
|
|
1724
1843
|
log,
|
|
1725
|
-
frame: (threadId) =>
|
|
1844
|
+
frame: async (threadId) =>
|
|
1726
1845
|
coordinatorMode() === "local" || bridge.has("swarm_frame")
|
|
1727
|
-
? frames.roundFacts(frameFor(threadId))
|
|
1846
|
+
? frames.roundFacts(await frameFor(threadId))
|
|
1728
1847
|
: null,
|
|
1729
1848
|
});
|
|
1730
1849
|
const guestRequests = createGuestRequests({
|
|
@@ -1868,6 +1987,38 @@ export async function startDaemon() {
|
|
|
1868
1987
|
activeRuns: () => activeRuns.values(),
|
|
1869
1988
|
scrub: (value) => vault.scrubDeep(value),
|
|
1870
1989
|
});
|
|
1990
|
+
// Open, asked for by the person at another of their computers: planned here, carried out by this computer's buddy.
|
|
1991
|
+
const openRequests = createOpenRequests({
|
|
1992
|
+
plan: async (open) => {
|
|
1993
|
+
// A thread in this computer's T3 Code opens by T3's own link to it, read here.
|
|
1994
|
+
if (open.thread) {
|
|
1995
|
+
await environments.ready()?.catch(() => null);
|
|
1996
|
+
const thread = environments
|
|
1997
|
+
.roots()
|
|
1998
|
+
.find((root) => root.id === String(open.thread));
|
|
1999
|
+
return thread?.source?.url
|
|
2000
|
+
? {
|
|
2001
|
+
ok: true,
|
|
2002
|
+
opensIn: thread.source.environmentName,
|
|
2003
|
+
link: thread.source.url,
|
|
2004
|
+
}
|
|
2005
|
+
: { ok: false, error: "that thread is not in T3 Code here" };
|
|
2006
|
+
}
|
|
2007
|
+
return liveCommand(
|
|
2008
|
+
{
|
|
2009
|
+
command: "board.live.focus",
|
|
2010
|
+
to: open.to,
|
|
2011
|
+
sessionId: open.sessionId ?? null,
|
|
2012
|
+
folder: open.folder ?? null,
|
|
2013
|
+
fresh: open.fresh === true,
|
|
2014
|
+
},
|
|
2015
|
+
"user"
|
|
2016
|
+
);
|
|
2017
|
+
},
|
|
2018
|
+
waits: boardWaits,
|
|
2019
|
+
openHere,
|
|
2020
|
+
log,
|
|
2021
|
+
});
|
|
1871
2022
|
|
|
1872
2023
|
// Lid-Closed Mode's Standby: when anything last came in (a phone message, a wake, a new task).
|
|
1873
2024
|
let listenerAt = Date.now();
|
|
@@ -1961,7 +2112,12 @@ export async function startDaemon() {
|
|
|
1961
2112
|
places
|
|
1962
2113
|
? places.command(request, agent)
|
|
1963
2114
|
: { ok: false, error: "the daemon is still starting" },
|
|
1964
|
-
live: (request, { agent }) =>
|
|
2115
|
+
live: (request, { agent }) =>
|
|
2116
|
+
request.command !== "board.live.opens"
|
|
2117
|
+
? liveCommand(request, agent)
|
|
2118
|
+
: agent === "user"
|
|
2119
|
+
? openRequests.take()
|
|
2120
|
+
: { ok: false, error: "only the person's buddy opens things here" },
|
|
1965
2121
|
prompt: (request, { agent }) => {
|
|
1966
2122
|
// A session a run started is that run's, never one the person typed in.
|
|
1967
2123
|
if (!request[RUN_CALLER]) authority.markPrompt(request.pids, agent);
|
|
@@ -2014,6 +2170,8 @@ export async function startDaemon() {
|
|
|
2014
2170
|
}),
|
|
2015
2171
|
},
|
|
2016
2172
|
task: createTaskCommands({
|
|
2173
|
+
dispatches,
|
|
2174
|
+
promptFlow,
|
|
2017
2175
|
outside: () => environments,
|
|
2018
2176
|
CLOUD_TARGETS,
|
|
2019
2177
|
desk,
|
|
@@ -2151,6 +2309,7 @@ export async function startDaemon() {
|
|
|
2151
2309
|
wakeBrief: threadRuns.worker.wakeBrief,
|
|
2152
2310
|
});
|
|
2153
2311
|
const worker = createRunWorker({
|
|
2312
|
+
dispatches,
|
|
2154
2313
|
threadRuns,
|
|
2155
2314
|
RESCAN_MS,
|
|
2156
2315
|
machineId: () => machine.id,
|
|
@@ -2252,6 +2411,7 @@ export async function startDaemon() {
|
|
|
2252
2411
|
});
|
|
2253
2412
|
return result?.pending ? await result.pending : result;
|
|
2254
2413
|
}
|
|
2414
|
+
if (live?.open) return openRequests.open(live.open);
|
|
2255
2415
|
if (live?.read)
|
|
2256
2416
|
return liveCommand(
|
|
2257
2417
|
{
|
|
@@ -2376,12 +2536,12 @@ export async function startDaemon() {
|
|
|
2376
2536
|
// The folders worked in here and the repository each holds (folders.mjs keeps the
|
|
2377
2537
|
// folders): where work for a repository can go on this computer.
|
|
2378
2538
|
let repositoriesRead = { at: null, list: [] };
|
|
2379
|
-
const machineFolders = () => {
|
|
2539
|
+
const machineFolders = ({ fresh = false } = {}) => {
|
|
2380
2540
|
// Read again once the sessions indexed here change, which is where new folders come from.
|
|
2381
2541
|
const indexed = JSON.stringify(store.counts());
|
|
2382
|
-
if (repositoriesRead.at === indexed) return repositoriesRead.list;
|
|
2542
|
+
if (!fresh && repositoriesRead.at === indexed) return repositoriesRead.list;
|
|
2383
2543
|
const list = folders
|
|
2384
|
-
.known()
|
|
2544
|
+
.known({ own: true })
|
|
2385
2545
|
.map((place) => ({
|
|
2386
2546
|
path: place.path,
|
|
2387
2547
|
repository: repositoryName(place.path),
|
|
@@ -2424,18 +2584,24 @@ export async function startDaemon() {
|
|
|
2424
2584
|
boardCommand: (request) => boardCommand(request),
|
|
2425
2585
|
filesRoot: paths.files,
|
|
2426
2586
|
changed: saveStatus,
|
|
2427
|
-
folders: () => machineFolders(),
|
|
2587
|
+
folders: (options) => machineFolders(options),
|
|
2428
2588
|
repositoryOf: (folder) => repositoryName(folder),
|
|
2589
|
+
inventoryChanged: () => {
|
|
2590
|
+
for (const goal of store.goals())
|
|
2591
|
+
if (store.meta(`inventory-wait:${goal.id}`)) coordinator.poke(goal.id);
|
|
2592
|
+
},
|
|
2429
2593
|
homeBack: () => {
|
|
2430
2594
|
viewCopies.reset();
|
|
2431
2595
|
void machineRuns.check();
|
|
2432
2596
|
void boardMirror.sync();
|
|
2433
2597
|
void swarmDevices.report();
|
|
2598
|
+
void comfyExecution.resume();
|
|
2434
2599
|
},
|
|
2435
2600
|
answerMirror: (call) => boardMirror.since(call),
|
|
2436
2601
|
answerMerge: (page, options) => boardMirror.merge(page, options),
|
|
2437
2602
|
answerDevices: (from, call, options) =>
|
|
2438
2603
|
swarmDevices.answer(from, call, options),
|
|
2604
|
+
answerPrompt: comfyExecution.answer,
|
|
2439
2605
|
// A worker takes Home's place only once Home has been away about a week; a deadline in the person's config replaces
|
|
2440
2606
|
// it.
|
|
2441
2607
|
standInAfterMs: Number.isFinite(config.standInAfterMs)
|
|
@@ -2463,6 +2629,7 @@ export async function startDaemon() {
|
|
|
2463
2629
|
},
|
|
2464
2630
|
});
|
|
2465
2631
|
// The board's encrypted backup, for Residents: home seals it, Harness keeps what it cannot read (boardBackup.mjs).
|
|
2632
|
+
void comfyExecution.resume();
|
|
2466
2633
|
const boardBackup = createBoardBackup({
|
|
2467
2634
|
store,
|
|
2468
2635
|
log,
|
|
@@ -2690,6 +2857,16 @@ export async function startDaemon() {
|
|
|
2690
2857
|
// List them, add or confirm a new one on home, name this one, make this one home, take this one off the account
|
|
2691
2858
|
// (npx tryharness uninstall); take another off, and each one's agents' models, set on the computer they run on.
|
|
2692
2859
|
"machines.list": onMachines(() => ownMachines.list()),
|
|
2860
|
+
"machines.refresh": onMachines((request) =>
|
|
2861
|
+
request.agent === "user"
|
|
2862
|
+
? ownMachines.refreshInventory(String(request.computer || ""), {
|
|
2863
|
+
force: true,
|
|
2864
|
+
})
|
|
2865
|
+
: {
|
|
2866
|
+
ok: false,
|
|
2867
|
+
error: "only the person refreshes a computer's inventory",
|
|
2868
|
+
}
|
|
2869
|
+
),
|
|
2693
2870
|
"machines.confirm": onMachines((request) =>
|
|
2694
2871
|
ownMachines.confirm(request.code, { hosted: request.hosted === true })
|
|
2695
2872
|
),
|
|
@@ -2723,6 +2900,11 @@ export async function startDaemon() {
|
|
|
2723
2900
|
? ownMachines.readSession(request)
|
|
2724
2901
|
: { ok: false, error: "only the person reads their sessions" }
|
|
2725
2902
|
),
|
|
2903
|
+
"machines.live.open": onMachines((request) =>
|
|
2904
|
+
request.agent === "user"
|
|
2905
|
+
? ownMachines.openSession(request)
|
|
2906
|
+
: { ok: false, error: "only the person opens their sessions" }
|
|
2907
|
+
),
|
|
2726
2908
|
"machines.model": onMachines((request) =>
|
|
2727
2909
|
request.agent === "user"
|
|
2728
2910
|
? ownMachines.setModel(request)
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contract_version": 1,
|
|
3
|
+
"source": {
|
|
4
|
+
"room_post": 251,
|
|
5
|
+
"reviewed_decision_sha256": "bfe002b51b9c4df9791558030f4c270d2b2c5bf094dc15868a2beffb5a6982d5"
|
|
6
|
+
},
|
|
7
|
+
"implemented_capabilities": ["start-exact-owner-run", "start-owner-template", "workspace-read@1", "workspace-files@1"],
|
|
8
|
+
"accounting_unit": "one native task start; no financial or service-dollar allowance is created",
|
|
9
|
+
"decision_output_schema": {
|
|
10
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
11
|
+
"title": "Relay decision v1 closed action grammar; initial executor supports dispatch only",
|
|
12
|
+
"type": "object",
|
|
13
|
+
"properties": {
|
|
14
|
+
"contract_version": {
|
|
15
|
+
"const": 1
|
|
16
|
+
},
|
|
17
|
+
"input_ref": {
|
|
18
|
+
"$ref": "#/definitions/ref"
|
|
19
|
+
},
|
|
20
|
+
"owner_epoch": {
|
|
21
|
+
"type": "integer",
|
|
22
|
+
"minimum": 1
|
|
23
|
+
},
|
|
24
|
+
"basis_ref": {
|
|
25
|
+
"$ref": "#/definitions/ref"
|
|
26
|
+
},
|
|
27
|
+
"action": {
|
|
28
|
+
"oneOf": [
|
|
29
|
+
{
|
|
30
|
+
"type": "object",
|
|
31
|
+
"properties": {
|
|
32
|
+
"kind": {
|
|
33
|
+
"const": "inspect"
|
|
34
|
+
},
|
|
35
|
+
"candidate_ref": {
|
|
36
|
+
"$ref": "#/definitions/ref"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"required": ["kind", "candidate_ref"],
|
|
40
|
+
"additionalProperties": false
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"type": "object",
|
|
44
|
+
"properties": {
|
|
45
|
+
"kind": {
|
|
46
|
+
"const": "dispatch"
|
|
47
|
+
},
|
|
48
|
+
"work_ref": {
|
|
49
|
+
"$ref": "#/definitions/ref"
|
|
50
|
+
},
|
|
51
|
+
"assignment_refs": {
|
|
52
|
+
"type": "array",
|
|
53
|
+
"items": {
|
|
54
|
+
"$ref": "#/definitions/ref"
|
|
55
|
+
},
|
|
56
|
+
"minItems": 1,
|
|
57
|
+
"uniqueItems": true
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"required": ["kind", "work_ref", "assignment_refs"],
|
|
61
|
+
"additionalProperties": false
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"type": "object",
|
|
65
|
+
"properties": {
|
|
66
|
+
"kind": {
|
|
67
|
+
"const": "continue"
|
|
68
|
+
},
|
|
69
|
+
"work_ref": {
|
|
70
|
+
"$ref": "#/definitions/ref"
|
|
71
|
+
},
|
|
72
|
+
"message_ref": {
|
|
73
|
+
"$ref": "#/definitions/ref"
|
|
74
|
+
}
|
|
75
|
+
},
|
|
76
|
+
"required": ["kind", "work_ref", "message_ref"],
|
|
77
|
+
"additionalProperties": false
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"type": "object",
|
|
81
|
+
"properties": {
|
|
82
|
+
"kind": {
|
|
83
|
+
"const": "execute"
|
|
84
|
+
},
|
|
85
|
+
"prepared_effect_ref": {
|
|
86
|
+
"$ref": "#/definitions/ref"
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"required": ["kind", "prepared_effect_ref"],
|
|
90
|
+
"additionalProperties": false
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"type": "object",
|
|
94
|
+
"properties": {
|
|
95
|
+
"kind": {
|
|
96
|
+
"const": "ask_owner"
|
|
97
|
+
},
|
|
98
|
+
"question_ref": {
|
|
99
|
+
"$ref": "#/definitions/ref"
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"required": ["kind", "question_ref"],
|
|
103
|
+
"additionalProperties": false
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"type": "object",
|
|
107
|
+
"properties": {
|
|
108
|
+
"kind": {
|
|
109
|
+
"const": "deliver"
|
|
110
|
+
},
|
|
111
|
+
"artifact_ref": {
|
|
112
|
+
"$ref": "#/definitions/ref"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"required": ["kind", "artifact_ref"],
|
|
116
|
+
"additionalProperties": false
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
"type": "object",
|
|
120
|
+
"properties": {
|
|
121
|
+
"kind": {
|
|
122
|
+
"const": "wait"
|
|
123
|
+
},
|
|
124
|
+
"wait_set_ref": {
|
|
125
|
+
"$ref": "#/definitions/ref"
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"required": ["kind", "wait_set_ref"],
|
|
129
|
+
"additionalProperties": false
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"type": "object",
|
|
133
|
+
"properties": {
|
|
134
|
+
"kind": {
|
|
135
|
+
"const": "cancel"
|
|
136
|
+
},
|
|
137
|
+
"work_ref": {
|
|
138
|
+
"$ref": "#/definitions/ref"
|
|
139
|
+
},
|
|
140
|
+
"cancellation_ref": {
|
|
141
|
+
"$ref": "#/definitions/ref"
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
"required": ["kind", "work_ref", "cancellation_ref"],
|
|
145
|
+
"additionalProperties": false
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
"type": "object",
|
|
149
|
+
"properties": {
|
|
150
|
+
"kind": {
|
|
151
|
+
"const": "finish"
|
|
152
|
+
},
|
|
153
|
+
"completion_ref": {
|
|
154
|
+
"$ref": "#/definitions/ref"
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
"required": ["kind", "completion_ref"],
|
|
158
|
+
"additionalProperties": false
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"type": "object",
|
|
162
|
+
"properties": {
|
|
163
|
+
"kind": {
|
|
164
|
+
"const": "abstain"
|
|
165
|
+
},
|
|
166
|
+
"reason": {
|
|
167
|
+
"enum": ["insufficient_context", "no_suitable_candidate"]
|
|
168
|
+
}
|
|
169
|
+
},
|
|
170
|
+
"required": ["kind", "reason"],
|
|
171
|
+
"additionalProperties": false
|
|
172
|
+
}
|
|
173
|
+
]
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
"required": [
|
|
177
|
+
"contract_version",
|
|
178
|
+
"input_ref",
|
|
179
|
+
"owner_epoch",
|
|
180
|
+
"basis_ref",
|
|
181
|
+
"action"
|
|
182
|
+
],
|
|
183
|
+
"additionalProperties": false,
|
|
184
|
+
"definitions": {
|
|
185
|
+
"ref": {
|
|
186
|
+
"type": "string",
|
|
187
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9_.:@-]*$"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
"assignment_candidate_schema": {
|
|
192
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
193
|
+
"type": "object",
|
|
194
|
+
"properties": {
|
|
195
|
+
"assignment_ref": {
|
|
196
|
+
"$ref": "#/definitions/ref"
|
|
197
|
+
},
|
|
198
|
+
"work_ref": {
|
|
199
|
+
"$ref": "#/definitions/ref"
|
|
200
|
+
},
|
|
201
|
+
"agent_ref": {
|
|
202
|
+
"$ref": "#/definitions/ref"
|
|
203
|
+
},
|
|
204
|
+
"computer_ref": {
|
|
205
|
+
"$ref": "#/definitions/ref"
|
|
206
|
+
},
|
|
207
|
+
"basis_ref": {
|
|
208
|
+
"$ref": "#/definitions/ref"
|
|
209
|
+
},
|
|
210
|
+
"eligibility_ref": {
|
|
211
|
+
"$ref": "#/definitions/ref"
|
|
212
|
+
},
|
|
213
|
+
"role": {
|
|
214
|
+
"enum": [
|
|
215
|
+
"frame",
|
|
216
|
+
"make",
|
|
217
|
+
"check",
|
|
218
|
+
"research",
|
|
219
|
+
"assemble",
|
|
220
|
+
"prepare_effect",
|
|
221
|
+
"recover"
|
|
222
|
+
]
|
|
223
|
+
},
|
|
224
|
+
"mode": {
|
|
225
|
+
"enum": ["work", "review"]
|
|
226
|
+
},
|
|
227
|
+
"workspace_ref": {
|
|
228
|
+
"$ref": "#/definitions/ref"
|
|
229
|
+
},
|
|
230
|
+
"checkout_ref": {
|
|
231
|
+
"$ref": "#/definitions/ref"
|
|
232
|
+
},
|
|
233
|
+
"capability_ref": {
|
|
234
|
+
"$ref": "#/definitions/ref"
|
|
235
|
+
},
|
|
236
|
+
"cost_bound": {
|
|
237
|
+
"type": "integer",
|
|
238
|
+
"minimum": 0,
|
|
239
|
+
"description": "Runtime-offered bound in the grant ledger\u2019s exact accounting units; never a model-authored amount."
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
"required": [
|
|
243
|
+
"assignment_ref",
|
|
244
|
+
"work_ref",
|
|
245
|
+
"agent_ref",
|
|
246
|
+
"computer_ref",
|
|
247
|
+
"basis_ref",
|
|
248
|
+
"eligibility_ref",
|
|
249
|
+
"role",
|
|
250
|
+
"mode",
|
|
251
|
+
"workspace_ref",
|
|
252
|
+
"checkout_ref",
|
|
253
|
+
"capability_ref",
|
|
254
|
+
"cost_bound"
|
|
255
|
+
],
|
|
256
|
+
"additionalProperties": false,
|
|
257
|
+
"definitions": {
|
|
258
|
+
"ref": {
|
|
259
|
+
"type": "string",
|
|
260
|
+
"pattern": "^[A-Za-z0-9][A-Za-z0-9_.:@-]*$"
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
"scope_capability": {
|
|
265
|
+
"authority": "trusted owner socket command only; fixed owner templates, local eligible agents and clean checkout revision",
|
|
266
|
+
"identity": "scope + template, once; independent of proposer or transport wake",
|
|
267
|
+
"accounting": "one cumulative native-start counter across all tasks and assignments; reservations never refunded after unknown outcomes",
|
|
268
|
+
"scope_invalidation": [
|
|
269
|
+
"owner revoke",
|
|
270
|
+
"root source or active state changes",
|
|
271
|
+
"checkout changes",
|
|
272
|
+
"owner off",
|
|
273
|
+
"unavailable selected agent/provider"
|
|
274
|
+
],
|
|
275
|
+
"limitations": [
|
|
276
|
+
"no arbitrary agent-authored executable brief",
|
|
277
|
+
"no narrower filesystem sandbox",
|
|
278
|
+
"no source advancement",
|
|
279
|
+
"no remote execution lease",
|
|
280
|
+
"no financial allowance"
|
|
281
|
+
]
|
|
282
|
+
},
|
|
283
|
+
"prompt_scope": {
|
|
284
|
+
"entry": "owner natural-language objective with application-supplied workspace/message identity; no fixed child templates",
|
|
285
|
+
"permissions": "existing standing scope and cumulative native-start reservations; generated fields never raise it",
|
|
286
|
+
"interpreter": "temporary tool-free native Claude adapter; not the Relay-shipped fine-tuned model; private mode refuses unverified transport",
|
|
287
|
+
"capabilities": {
|
|
288
|
+
"workspace-read@1": [
|
|
289
|
+
"list source names",
|
|
290
|
+
"read ordinary source/staged text"
|
|
291
|
+
],
|
|
292
|
+
"workspace-files@1": [
|
|
293
|
+
"list source names",
|
|
294
|
+
"read ordinary source/staged text",
|
|
295
|
+
"write private staged text artifacts"
|
|
296
|
+
]
|
|
297
|
+
},
|
|
298
|
+
"execution": "Claude Code >=2.1.248, bare/restricted with built-ins disabled and only scoped MCP",
|
|
299
|
+
"bounds": {
|
|
300
|
+
"observed_files": 100,
|
|
301
|
+
"file_bytes": 64000
|
|
302
|
+
},
|
|
303
|
+
"source": "original owner prompt, named computer source spans, pinned source revision and observed file/absence receipts",
|
|
304
|
+
"children": "free objectives/briefs are agent data; identical proposals deduplicate; children wait for their proposing task to finish successfully",
|
|
305
|
+
"limits": [
|
|
306
|
+
"no native shell or direct filesystem tools",
|
|
307
|
+
"no network, vault, wallet or financial adapter",
|
|
308
|
+
"remote execution refuses rather than falling back to Home",
|
|
309
|
+
"no automatic application of generated code to the source checkout",
|
|
310
|
+
"normal app routing, full controller and live semantic evaluation remain work"
|
|
311
|
+
]
|
|
312
|
+
}
|
|
313
|
+
}
|