copilot-operator 0.1.52 → 0.1.54
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/README.md +23 -1
- package/dist/src/api/operator.controller.js +71 -2
- package/dist/src/api/operator.service.js +99 -7
- package/dist/src/config/schema.js +32 -0
- package/dist/src/exec/policy.js +11 -1
- package/dist/src/exec/scriptFiles.js +108 -2
- package/dist/src/orchestrator/leadRunner.js +50 -4
- package/dist/src/orchestrator/review.js +9 -3
- package/dist/src/orchestrator/taskRunner.js +55 -3
- package/dist/src/plan/kerrigan.js +35 -4
- package/dist/src/plan/systemGuide.js +234 -4
- package/dist/src/session/compose.js +16 -4
- package/dist/src/session/store.js +3 -0
- package/dist/src/session/workspace.js +22 -0
- package/dist/src/session/workspaceSearch.js +162 -0
- package/dist/src/util/pacing.js +33 -2
- package/dist/src/vcs/git.js +12 -2
- package/dist/src/vcs/referenceGuard.js +299 -0
- package/dist/web/404.html +3 -2
- package/dist/web/_next/static/{_1zhoDsMOPAH2xW702E5A → WuIGWiKKh_ESR3KwzsLZF}/_buildManifest.js +1 -1
- package/dist/web/_next/static/chunks/1017.ce926873b598fb89.js +1 -0
- package/dist/web/_next/static/chunks/1077.ae2fd686ef05572e.js +1 -0
- package/dist/web/_next/static/chunks/12.06a7f14bd6716249.js +1 -0
- package/dist/web/_next/static/chunks/1350.a5dc706c8110fd34.js +24 -0
- package/dist/web/_next/static/chunks/1548.bd558d3f2c8df4af.js +1 -0
- package/dist/web/_next/static/chunks/1706.db51b57351297898.js +309 -0
- package/dist/web/_next/static/chunks/1707.7d64ffc060c697a0.js +193 -0
- package/dist/web/_next/static/chunks/1880.87829ecb91209eda.js +24 -0
- package/dist/web/_next/static/chunks/20154aaa.28032c3aa5bcd84d.js +1 -0
- package/dist/web/_next/static/chunks/2037.d1bb5e37c7fe85ae.js +104 -0
- package/dist/web/_next/static/chunks/2163.b41334711ddcceff.js +1 -0
- package/dist/web/_next/static/chunks/2398d077.79ae940919b9695e.js +1 -0
- package/dist/web/_next/static/chunks/2435.9b433b38d34b4b2e.js +1 -0
- package/dist/web/_next/static/chunks/2506.bc8515842e225d2a.js +1 -0
- package/dist/web/_next/static/chunks/2529.c88688b437d71d68.js +41 -0
- package/dist/web/_next/static/chunks/2908.4e0e875d2d471932.js +1 -0
- package/dist/web/_next/static/chunks/3117.a4e1c3348e8bead9.js +1 -0
- package/dist/web/_next/static/chunks/3131-8ec8b632ebf0450d.js +1 -0
- package/dist/web/_next/static/chunks/3134-b6a7bc1f267c39aa.js +1 -0
- package/dist/web/_next/static/chunks/3233.1dcc2798f7f5efa0.js +149 -0
- package/dist/web/_next/static/chunks/344.41cc997c8c8deeed.js +115 -0
- package/dist/web/_next/static/chunks/3690.f691d3fcbd70073d.js +1 -0
- package/dist/web/_next/static/chunks/3804.593b14643e74a2a1.js +1 -0
- package/dist/web/_next/static/chunks/3816.9f5568918e35e4ef.js +77 -0
- package/dist/web/_next/static/chunks/3859.f56f3c6ac4b74cf1.js +94 -0
- package/dist/web/_next/static/chunks/3976.11b159e82e0aa974.js +1 -0
- package/dist/web/_next/static/chunks/3986.d47ed4855773e6dd.js +1 -0
- package/dist/web/_next/static/chunks/441.172f3f581f0030d1.js +226 -0
- package/dist/web/_next/static/chunks/442.2e236a6c5c413bd9.js +1 -0
- package/dist/web/_next/static/chunks/4459.d6df347eb58fccd7.js +1 -0
- package/dist/web/_next/static/chunks/4619.ae3628373decf74f.js +34 -0
- package/dist/web/_next/static/chunks/4623.d5711a8d967e49f4.js +1 -0
- package/dist/web/_next/static/chunks/4670.6b811cc3f67a851c.js +62 -0
- package/dist/web/_next/static/chunks/4812.0af1380aa478f6d3.js +93 -0
- package/dist/web/_next/static/chunks/4969.4f7aff472cf938bf.js +1 -0
- package/dist/web/_next/static/chunks/5790.fe114d1a18741d62.js +86 -0
- package/dist/web/_next/static/chunks/603.4055460889ea24d8.js +1 -0
- package/dist/web/_next/static/chunks/6072.b4b359b24b1738d4.js +286 -0
- package/dist/web/_next/static/chunks/6230.8645bbed143793da.js +1 -0
- package/dist/web/_next/static/chunks/6260.6b5b5c9713d7133f.js +1 -0
- package/dist/web/_next/static/chunks/63b9f8e2.218fd437b256a7e4.js +1 -0
- package/dist/web/_next/static/chunks/6421.3ace3aefc3e7350e.js +1 -0
- package/dist/web/_next/static/chunks/6542.963ec591b5c2bc5a.js +1 -0
- package/dist/web/_next/static/chunks/6885.8fb8eeb9e792b515.js +1 -0
- package/dist/web/_next/static/chunks/6891.dd910309748ad46b.js +1 -0
- package/dist/web/_next/static/chunks/714.cb77983f9be215c9.js +1 -0
- package/dist/web/_next/static/chunks/7220.072a60cd9d60220a.js +1 -0
- package/dist/web/_next/static/chunks/7307.39c27470a879fd0a.js +1 -0
- package/dist/web/_next/static/chunks/7333.04d0e45b223dadd4.js +32 -0
- package/dist/web/_next/static/chunks/7489.395193bf37b80884.js +1 -0
- package/dist/web/_next/static/chunks/7496.17282033df0e8794.js +148 -0
- package/dist/web/_next/static/chunks/7500-f90e2ae7061e351d.js +1 -0
- package/dist/web/_next/static/chunks/7507.9fd648884587a7f3.js +287 -0
- package/dist/web/_next/static/chunks/76.f9c2aea58a61692f.js +1 -0
- package/dist/web/_next/static/chunks/7664.bd6265e6e94e1ecd.js +79 -0
- package/dist/web/_next/static/chunks/7872.9b08a88b7289949f.js +64 -0
- package/dist/web/_next/static/chunks/7921-54dae769aa8bae96.js +1 -0
- package/dist/web/_next/static/chunks/795.710d39b80c9ae80c.js +1 -0
- package/dist/web/_next/static/chunks/8173.b82aa1855e641605.js +1 -0
- package/dist/web/_next/static/chunks/8216.b248ebe0af447347.js +8 -0
- package/dist/web/_next/static/chunks/82d3f3cb.23be11b749288234.js +62 -0
- package/dist/web/_next/static/chunks/8381.2d6783c030f8a913.js +27 -0
- package/dist/web/_next/static/chunks/85120a0e.ac16dccf0b8d73d3.js +66 -0
- package/dist/web/_next/static/chunks/8547.0a9997b67008c706.js +1 -0
- package/dist/web/_next/static/chunks/8584.9d5d6c09b0375015.js +1 -0
- package/dist/web/_next/static/chunks/8662.f2663643214caed1.js +38 -0
- package/dist/web/_next/static/chunks/8689.e564346c6e0d16be.js +1 -0
- package/dist/web/_next/static/chunks/9067.832c4761a991f2c2.js +1 -0
- package/dist/web/_next/static/chunks/9125.8589db5ba200cbf1.js +1 -0
- package/dist/web/_next/static/chunks/9202.8dcf7e6a85cc3d36.js +1 -0
- package/dist/web/_next/static/chunks/9249.916a423ac8a07e76.js +1 -0
- package/dist/web/_next/static/chunks/9313.e4f6405d96375c40.js +92 -0
- package/dist/web/_next/static/chunks/937.6d8406b06135134f.js +1 -0
- package/dist/web/_next/static/chunks/9418.1e8f8e14bb5fe3ae.js +217 -0
- package/dist/web/_next/static/chunks/9591.fabd60bd0d10341c.js +1 -0
- package/dist/web/_next/static/chunks/972.db753db904050e48.js +23 -0
- package/dist/web/_next/static/chunks/9747.c8d4ba56c9eef95f.js +1 -0
- package/dist/web/_next/static/chunks/9763.da9015d4a1b533b9.js +36 -0
- package/dist/web/_next/static/chunks/9884.8712c5ed7b044ff2.js +1 -0
- package/dist/web/_next/static/chunks/9891.91a2c59fd073fd48.js +74 -0
- package/dist/web/_next/static/chunks/9984.cdabea5a592e42a1.js +1 -0
- package/dist/web/_next/static/chunks/a9ddb983.8bbb677720017a57.js +122 -0
- package/dist/web/_next/static/chunks/app/_not-found/page-1264c0db9665169c.js +1 -0
- package/dist/web/_next/static/chunks/app/defaults/page-a1f90fe37e302928.js +1 -0
- package/dist/web/_next/static/chunks/app/layout-46efb208d7c88648.js +1 -0
- package/dist/web/_next/static/chunks/app/page-57787f15774d76b8.js +1 -0
- package/dist/web/_next/static/chunks/app/system/page-825f53f14d16033d.js +1 -0
- package/dist/web/_next/static/chunks/c7879cf7-fabe25011515220e.js +1 -0
- package/dist/web/_next/static/chunks/c7ea4e13.9b71b5f026a1d6d4.js +1 -0
- package/dist/web/_next/static/chunks/f99cb6a2.3f570aeba3860608.js +160 -0
- package/dist/web/_next/static/chunks/framework-a8bf4d38dd23845f.js +1 -0
- package/dist/web/_next/static/chunks/main-app-f747f0f5ddb4213b.js +1 -0
- package/dist/web/_next/static/chunks/main-d3bbfb91b54fbcc3.js +1 -0
- package/dist/web/_next/static/chunks/pages/_app-5b348989bba3d570.js +1 -0
- package/dist/web/_next/static/chunks/pages/_error-cf88c6d2cc5868d7.js +1 -0
- package/dist/web/_next/static/chunks/webpack-cb74fa884b8af278.js +1 -0
- package/dist/web/_next/static/css/d3398f485b2a9075.css +1 -0
- package/dist/web/defaults.html +3 -2
- package/dist/web/defaults.txt +16 -16
- package/dist/web/index.html +4 -2
- package/dist/web/index.txt +16 -16
- package/dist/web/system.html +3 -2
- package/dist/web/system.txt +16 -16
- package/package.json +8 -2
- package/prompts/level1.md +32 -12
- package/prompts/review1.md +287 -286
- package/dist/web/_next/static/chunks/12.f1f4d35b52633e8d.js +0 -1
- package/dist/web/_next/static/chunks/131-bae98f790a541679.js +0 -1
- package/dist/web/_next/static/chunks/134-ddd50a7fbb536ec8.js +0 -1
- package/dist/web/_next/static/chunks/163.dbd7d36584d0bb37.js +0 -1
- package/dist/web/_next/static/chunks/220.35531b39410e1a9f.js +0 -1
- package/dist/web/_next/static/chunks/489.158bbe303a595fba.js +0 -1
- package/dist/web/_next/static/chunks/548.71ac96c94136659b.js +0 -1
- package/dist/web/_next/static/chunks/584.6df695c5b86a75aa.js +0 -1
- package/dist/web/_next/static/chunks/67.9ed79e2fbfb56f26.js +0 -1
- package/dist/web/_next/static/chunks/714.1e2338736a70b9c7.js +0 -1
- package/dist/web/_next/static/chunks/747.d2c1249d736dc03b.js +0 -1
- package/dist/web/_next/static/chunks/77.a200abef0f5b4a7f.js +0 -1
- package/dist/web/_next/static/chunks/808-bc7d7eac6d823291.js +0 -1
- package/dist/web/_next/static/chunks/921-dc5538cd779c6432.js +0 -1
- package/dist/web/_next/static/chunks/app/_not-found/page-0d0d8e7e62efca12.js +0 -1
- package/dist/web/_next/static/chunks/app/defaults/page-edd7534ca9ecf366.js +0 -1
- package/dist/web/_next/static/chunks/app/layout-8f99a164d76897a0.js +0 -1
- package/dist/web/_next/static/chunks/app/page-4bed816eda370d0c.js +0 -1
- package/dist/web/_next/static/chunks/app/system/page-1cf9e75e76da59ed.js +0 -1
- package/dist/web/_next/static/chunks/c7879cf7-b5ab1053c1d9a2e7.js +0 -1
- package/dist/web/_next/static/chunks/framework-9ac6a346bd42cedd.js +0 -1
- package/dist/web/_next/static/chunks/main-6be4444e2d667e41.js +0 -1
- package/dist/web/_next/static/chunks/main-app-e3a5f713ba31557e.js +0 -1
- package/dist/web/_next/static/chunks/pages/_app-32d20d5a04949d29.js +0 -1
- package/dist/web/_next/static/chunks/pages/_error-abbab53f25ea29b0.js +0 -1
- package/dist/web/_next/static/chunks/webpack-77147e31d2125631.js +0 -1
- package/dist/web/_next/static/css/3bea264adc472bc8.css +0 -1
- /package/dist/web/_next/static/{_1zhoDsMOPAH2xW702E5A → WuIGWiKKh_ESR3KwzsLZF}/_ssgManifest.js +0 -0
|
@@ -23,7 +23,7 @@ import { appendFile, mkdir, writeFile } from 'node:fs/promises';
|
|
|
23
23
|
import { isReplyTimeout, WindowClosed } from '../transport/chatTransport.js';
|
|
24
24
|
import { buildChatName, chatCode, savePointer } from '../transport/chatSession.js';
|
|
25
25
|
import { RunLog } from '../log/runLog.js';
|
|
26
|
-
import { Pacer } from '../util/pacing.js';
|
|
26
|
+
import { gapFrom, Pacer } from '../util/pacing.js';
|
|
27
27
|
import { takeAfter, takeCheckpoint } from '../session/checkpoint.js';
|
|
28
28
|
import { commitFiles } from '../vcs/git.js';
|
|
29
29
|
import { buildStory } from '../session/story.js';
|
|
@@ -43,6 +43,18 @@ export function assignmentMessage(task, n, facts, again) {
|
|
|
43
43
|
'',
|
|
44
44
|
task.prompt.trim(),
|
|
45
45
|
'',
|
|
46
|
+
// The operator's skill for this kind of work (2026-10-21): the lead plans by it, and every subtask carries it to the worker.
|
|
47
|
+
...(task.skill?.text.trim()
|
|
48
|
+
? [
|
|
49
|
+
`## Skill: ${task.skill.name}`,
|
|
50
|
+
'',
|
|
51
|
+
...(task.skill.description.trim() ? [`For: ${task.skill.description.trim()}`, ''] : []),
|
|
52
|
+
'The operator\'s instructions for this kind of work. Plan and judge the work by them; the worker is given them with every subtask.',
|
|
53
|
+
'',
|
|
54
|
+
task.skill.text.trim(),
|
|
55
|
+
'',
|
|
56
|
+
]
|
|
57
|
+
: []),
|
|
46
58
|
'## What the runner tells you',
|
|
47
59
|
'',
|
|
48
60
|
`- The project folder, where the worker's commands run: ${facts.workDir || '(none is open)'}.`,
|
|
@@ -50,6 +62,11 @@ export function assignmentMessage(task, n, facts, again) {
|
|
|
50
62
|
facts.planApproval
|
|
51
63
|
? '- The operator approves plans: when you send "plan", the work waits for their answer.'
|
|
52
64
|
: '- Plans are not put to the operator here: send "plan" all the same, so it is on record; the work goes on at once.',
|
|
65
|
+
...((facts.reference?.length ?? 0) > 0
|
|
66
|
+
? [
|
|
67
|
+
`- For reference only, changed by nothing: ${facts.reference.map((p) => `${p.name} (${p.dir})`).join(', ')}. The worker may read them and run what only reads; whatever it changes there is put back. Plan no change in them; if the result needs one, say so to the operator.`,
|
|
68
|
+
]
|
|
69
|
+
: []),
|
|
53
70
|
'- Reply in the lead\'s format.',
|
|
54
71
|
]
|
|
55
72
|
.filter((l, i) => l !== '' || i > 0)
|
|
@@ -183,7 +200,14 @@ export async function runLeadTask(transport, session, task, deps) {
|
|
|
183
200
|
sink.event('chat-checkpoint', { commit: cp.commit, branch: cp.branch, head: cp.head }, `the folder before this message is kept as ${cp.commit.slice(0, 8)} (on ${cp.branch || cp.head.slice(0, 8)})`);
|
|
184
201
|
}
|
|
185
202
|
}
|
|
186
|
-
const pacer = new Pacer({
|
|
203
|
+
const pacer = new Pacer({
|
|
204
|
+
enabled: cfg.pacing.enabled,
|
|
205
|
+
settleMs: cfg.pacing.settleMs,
|
|
206
|
+
maxMessagesPerHour: cfg.pacing.maxMessagesPerHour,
|
|
207
|
+
gapMs: gapFrom(cfg.pacing),
|
|
208
|
+
signal,
|
|
209
|
+
onGap: (ms) => sink.event('pacing-gap', { ms, lead: true }, `the next message to the lead waits ${Math.ceil(ms / 1000)} s: Settings ask for a pause between messages`),
|
|
210
|
+
});
|
|
187
211
|
let limitHit;
|
|
188
212
|
/*
|
|
189
213
|
* Paused (see `Hold`): the lead's next message waits, as the worker's do in `runTask`. True when the run was stopped
|
|
@@ -213,6 +237,9 @@ export async function runLeadTask(transport, session, task, deps) {
|
|
|
213
237
|
sink.event('operator-note-sent', { notes: notes.length, with: 'lead' }, `${notes.length} note(s) from the operator go to the lead`);
|
|
214
238
|
const before = await leadChat.sendAndConfirm(message);
|
|
215
239
|
sent += 1;
|
|
240
|
+
// Counted for the operator, with the worker's (2026-10-21): shown under the message and in the status bar.
|
|
241
|
+
lead.messages = { lead: sent, worker: lead.messages?.worker ?? 0 };
|
|
242
|
+
await saveLead();
|
|
216
243
|
await writeFile(log.path('messages', `${String(sent).padStart(2, '0')}.md`), message, 'utf8').catch(() => undefined);
|
|
217
244
|
sink.event('message-sent', { n: sent, chars: message.length, lead: true, chatId: session.chat?.chatId ?? null }, `message ${sent} sent to the lead (${message.length} chars)`);
|
|
218
245
|
await record(`TO THE LEAD (${sent})`, message);
|
|
@@ -357,7 +384,7 @@ export async function runLeadTask(transport, session, task, deps) {
|
|
|
357
384
|
});
|
|
358
385
|
sink.event('worker-fresh', { n }, `subtask ${n} goes to a fresh worker conversation`);
|
|
359
386
|
}
|
|
360
|
-
const made = await store.addTask(worker.id, { title: `${n}. ${sub.title}`, level2: '', prompt: subtaskPrompt(sub, n), reviewEnabled: false, readOnly: sub.readOnly });
|
|
387
|
+
const made = await store.addTask(worker.id, { title: `${n}. ${sub.title}`, level2: '', prompt: subtaskPrompt(sub, n), reviewEnabled: false, readOnly: sub.readOnly, ...(task.skill ? { skill: task.skill } : {}) });
|
|
361
388
|
await store.updateTask(worker.id, made.id, (t) => {
|
|
362
389
|
t.fromLead = { sessionId: session.id, taskId: task.id, n };
|
|
363
390
|
});
|
|
@@ -377,7 +404,22 @@ export async function runLeadTask(transport, session, task, deps) {
|
|
|
377
404
|
}
|
|
378
405
|
const current = (await store.getSession(worker.id));
|
|
379
406
|
const subtask = current.tasks.find((x) => x.id === made.id);
|
|
380
|
-
|
|
407
|
+
// Every message the worker's task sends is counted as the worker's, as it goes.
|
|
408
|
+
const counted = new Proxy(transport, {
|
|
409
|
+
get(target, key) {
|
|
410
|
+
if (key === 'sendAndConfirm') {
|
|
411
|
+
return async (...args) => {
|
|
412
|
+
const r = await target.sendAndConfirm(...args);
|
|
413
|
+
lead.messages = { lead: lead.messages?.lead ?? sent, worker: (lead.messages?.worker ?? 0) + 1 };
|
|
414
|
+
await saveLead();
|
|
415
|
+
return r;
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
const value = Reflect.get(target, key, target);
|
|
419
|
+
return typeof value === 'function' ? value.bind(target) : value;
|
|
420
|
+
},
|
|
421
|
+
});
|
|
422
|
+
const out = await runTask(counted, current, subtask, { ...deps, approvePlan: undefined });
|
|
381
423
|
speakFor(transport, session.id);
|
|
382
424
|
if (transport.closedOutside())
|
|
383
425
|
throw new WindowClosed();
|
|
@@ -402,6 +444,10 @@ export async function runLeadTask(transport, session, task, deps) {
|
|
|
402
444
|
maxIterations: cfg.limits.maxIterations,
|
|
403
445
|
maxRunMinutes: cfg.limits.maxRunMinutes,
|
|
404
446
|
planApproval: session.planMode === 'approve' && !!deps.approvePlan,
|
|
447
|
+
reference: [
|
|
448
|
+
...(cfg.project.readOnly && cfg.project.rootDir ? [{ name: cfg.project.name || cfg.project.rootDir, dir: cfg.project.rootDir }] : []),
|
|
449
|
+
...cfg.project.others.filter((o) => o.readOnly).map((o) => ({ name: o.name, dir: o.rootDir })),
|
|
450
|
+
],
|
|
405
451
|
};
|
|
406
452
|
const n = session.tasks.findIndex((x) => x.id === task.id) + 1;
|
|
407
453
|
const contract = (await store.getLead1()).content.trim();
|
|
@@ -261,8 +261,8 @@ export async function runReview(transport, session, task, deps) {
|
|
|
261
261
|
// The machine's shells, when they are not what the contract's example assumes — the same note
|
|
262
262
|
// the implementer's conversation opens with, for a conversation working to the same example.
|
|
263
263
|
const machineNote = shellNote(undefined, defaultShell);
|
|
264
|
-
let before = await transport.sendAndConfirm(machineNote ? `${contract}
|
|
265
|
-
|
|
264
|
+
let before = await transport.sendAndConfirm(machineNote ? `${contract}
|
|
265
|
+
|
|
266
266
|
${machineNote}` : contract);
|
|
267
267
|
await transport.waitForReply(before);
|
|
268
268
|
await pacer.throttleSend();
|
|
@@ -471,7 +471,7 @@ ${machineNote}` : contract);
|
|
|
471
471
|
sessionId: session.id,
|
|
472
472
|
taskId: task.id,
|
|
473
473
|
iteration: iterations,
|
|
474
|
-
confinement: { roots: deps.roots, cwd: deps.cwd },
|
|
474
|
+
confinement: { roots: deps.roots, cwd: deps.cwd, workStartedAt: deps.workStartedAt },
|
|
475
475
|
});
|
|
476
476
|
if (decision.action !== 'run') {
|
|
477
477
|
results.push(refused(step.id, decision.reason, step.cmd, step.shell, decision.by === 'operator' ? 'operator' : 'runner'));
|
|
@@ -510,10 +510,16 @@ ${machineNote}` : contract);
|
|
|
510
510
|
}, { signal, tracker: deps.tracker });
|
|
511
511
|
stepsRun += 1;
|
|
512
512
|
results.push(result);
|
|
513
|
+
const touched = deps.afterStep ? await deps.afterStep().catch(() => null) : null;
|
|
514
|
+
if (touched)
|
|
515
|
+
result.stderr = `${result.stderr}${result.stderr && !result.stderr.endsWith('\n') ? '\n' : ''}[runner] ${touched}\n`;
|
|
513
516
|
deps.event('review-step-finished', { round, id: step.id, outcome: result.outcome, exitCode: result.exitCode, shell: result.shell, requestedShell: result.requestedShell ?? null, shellPath: result.shellPath ?? '' }, `review step ${step.id}: ${result.outcome}, exit ${result.exitCode}, ${(result.durationMs / 1000).toFixed(1)}s`);
|
|
514
517
|
// Stopped while it ran: no step after it is started, and the report waits below.
|
|
515
518
|
if (signal?.aborted)
|
|
516
519
|
break;
|
|
520
|
+
// A project for reference only was changed and put back: the rest of the round is not run.
|
|
521
|
+
if (touched)
|
|
522
|
+
break;
|
|
517
523
|
await pacer.settle();
|
|
518
524
|
}
|
|
519
525
|
const report = await writeReport(results, {
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { createHash } from 'node:crypto';
|
|
14
14
|
import { readFile, mkdir, writeFile, appendFile } from 'node:fs/promises';
|
|
15
|
-
import { join, resolve } from 'node:path';
|
|
15
|
+
import { basename, join, resolve } from 'node:path';
|
|
16
16
|
import { buttonShows, normModel } from '../transport/modelMatch.js';
|
|
17
17
|
import { createTransport, isReplyTimeout, WindowClosed } from '../transport/chatTransport.js';
|
|
18
18
|
import { buildChatName, chatCode, loadPointer, savePointer } from '../transport/chatSession.js';
|
|
@@ -35,11 +35,12 @@ import { describeStep, checkCommandRefusal, commandRefusal } from '../exec/polic
|
|
|
35
35
|
import { networkFetchReason } from '../exec/network.js';
|
|
36
36
|
import { collectPolicyManifest, describePolicyManifest } from '../exec/policyManifest.js';
|
|
37
37
|
import { assessIsolation, readIsolationSignals } from '../exec/isolation.js';
|
|
38
|
-
import { confinementRefusal, sessionRoots } from '../exec/confinement.js';
|
|
38
|
+
import { confinementRefusal, isWithin, sessionRoots } from '../exec/confinement.js';
|
|
39
39
|
import { writeReport } from '../exec/reportFile.js';
|
|
40
|
-
import { Pacer } from '../util/pacing.js';
|
|
40
|
+
import { gapFrom, Pacer } from '../util/pacing.js';
|
|
41
41
|
import { RunLog } from '../log/runLog.js';
|
|
42
42
|
import { composeOpening, operatorNotesSection, readOnlyNote } from '../session/compose.js';
|
|
43
|
+
import { describeChange, ReferenceGuard, referenceMessage, referenceNote } from '../vcs/referenceGuard.js';
|
|
43
44
|
import { changedSince, takeAfter, takeCheckpoint } from '../session/checkpoint.js';
|
|
44
45
|
import { MIN_TRIED_APPROACHES } from '../protocol/replySchema.js';
|
|
45
46
|
import { enforceScope, scopeMessage, scopeNote } from '../vcs/scope.js';
|
|
@@ -872,6 +873,10 @@ export async function runTask(transport, session, task, deps) {
|
|
|
872
873
|
enabled: cfg.pacing.enabled,
|
|
873
874
|
settleMs: cfg.pacing.settleMs,
|
|
874
875
|
maxMessagesPerHour: cfg.pacing.maxMessagesPerHour,
|
|
876
|
+
// The operator's pause between messages (2026-10-21), said in the log when a message waits for it.
|
|
877
|
+
gapMs: gapFrom(cfg.pacing),
|
|
878
|
+
signal,
|
|
879
|
+
onGap: (ms) => sink.event('pacing-gap', { ms }, `the next message waits ${Math.ceil(ms / 1000)} s: Settings ask for a pause between messages`),
|
|
875
880
|
});
|
|
876
881
|
const artifactsDir = log.path('artifacts');
|
|
877
882
|
const reportsDir = log.path('reports');
|
|
@@ -934,6 +939,8 @@ export async function runTask(transport, session, task, deps) {
|
|
|
934
939
|
let disputes = [];
|
|
935
940
|
/** What the runner tells the model in its next message about the reply just processed. */
|
|
936
941
|
let runnerNotes = [];
|
|
942
|
+
/** The projects for reference only, watched for the length of the task (see `vcs/referenceGuard.ts`). */
|
|
943
|
+
let reference = null;
|
|
937
944
|
/** Steps the chat sent that were not run, for the handoff at the end. */
|
|
938
945
|
const notRun = [];
|
|
939
946
|
/**
|
|
@@ -1053,6 +1060,8 @@ export async function runTask(transport, session, task, deps) {
|
|
|
1053
1060
|
await record(`ENDING: ${status.toUpperCase()}`, [summary ?? '', reason ? `Reason: ${reason}` : ''].filter(Boolean).join('\n\n') || '(no details)');
|
|
1054
1061
|
// The net under the plan's own checks: whatever the task left running is stopped and named.
|
|
1055
1062
|
await reap(processesBefore, 'the task');
|
|
1063
|
+
await reference?.close().catch(() => undefined);
|
|
1064
|
+
reference = null;
|
|
1056
1065
|
/*
|
|
1057
1066
|
* A chat message: the folder photographed again after it, on top of its checkpoint, so what it changed is
|
|
1058
1067
|
* one commit's worth of files, shown under the message and in the changes view. Nothing is committed on the
|
|
@@ -1403,8 +1412,26 @@ export async function runTask(transport, session, task, deps) {
|
|
|
1403
1412
|
const confinement = {
|
|
1404
1413
|
roots: sessionRoots(work.cwd, [cfg.project.rootDir, ...cfg.project.others.map((o) => o.rootDir)]),
|
|
1405
1414
|
cwd: work.cwd,
|
|
1415
|
+
// A script committed after this is the work's, not the project's (see `ownScriptRefusal`).
|
|
1416
|
+
workStartedAt: session.createdAt,
|
|
1406
1417
|
};
|
|
1407
1418
|
sink.event('confinement', { roots: confinement.roots }, `commands are confined to ${confinement.roots.join(', ')}`);
|
|
1419
|
+
/*
|
|
1420
|
+
* The projects for reference only (operator, 2026-10-21) that this task can reach: photographed now, and after every
|
|
1421
|
+
* step compared with that, whatever changed put back (see `vcs/referenceGuard.ts`).
|
|
1422
|
+
*/
|
|
1423
|
+
const forReference = [
|
|
1424
|
+
...(cfg.project.readOnly && cfg.project.rootDir ? [{ name: cfg.project.name || basename(cfg.project.rootDir), dir: cfg.project.rootDir }] : []),
|
|
1425
|
+
...cfg.project.others.filter((o) => o.readOnly).map((o) => ({ name: o.name, dir: o.rootDir })),
|
|
1426
|
+
].filter((p) => isWithin(p.dir, confinement.roots));
|
|
1427
|
+
if (forReference.length > 0) {
|
|
1428
|
+
reference = await ReferenceGuard.start(forReference, runId);
|
|
1429
|
+
for (const p of reference.projects)
|
|
1430
|
+
sink.event('reference', { name: p.name, dir: p.dir }, `for reference only, nothing may change there: ${p.name} (${p.dir})`);
|
|
1431
|
+
for (const p of reference.unwatched) {
|
|
1432
|
+
sink.event('reference-unwatched', { name: p.name, dir: p.dir, problem: p.problem }, `for reference only, but it cannot be watched (${p.problem}): ${p.name} (${p.dir}); the chat is told to leave it alone`, 'warn');
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1408
1435
|
const isolation = assessIsolation(cfg.execution.isolation, readIsolationSignals());
|
|
1409
1436
|
for (const concern of isolation.warnings) {
|
|
1410
1437
|
sink.event('isolation', { claim: isolation.claim, elevated: isolation.signals.elevated }, concern, 'warn');
|
|
@@ -1606,6 +1633,7 @@ export async function runTask(transport, session, task, deps) {
|
|
|
1606
1633
|
// Said of the session's conversation, so with none on record nothing has had it: this run
|
|
1607
1634
|
// entered a fresh one (see `enterSessionConversation`), whatever an older record says.
|
|
1608
1635
|
contractAlreadySent: session.contractSent && !!session.chat,
|
|
1636
|
+
skill: task.skill,
|
|
1609
1637
|
continuing,
|
|
1610
1638
|
buildsOn,
|
|
1611
1639
|
// The operator's new prompt goes out whether or not the attempt it follows reached a conversation.
|
|
@@ -1613,6 +1641,7 @@ export async function runTask(transport, session, task, deps) {
|
|
|
1613
1641
|
workDirNote: workingDirNote(work),
|
|
1614
1642
|
vcsNote: session.kind === 'chat' ? CHAT_NOTE : prepared.note,
|
|
1615
1643
|
// What is said about a commit is true only where one happens (live run 2026-10-03: promised with commits off).
|
|
1644
|
+
referenceNote: forReference.length > 0 ? referenceNote(forReference, work.cwd) : undefined,
|
|
1616
1645
|
readOnlyNote: task.readOnly ? readOnlyNote(!!(session.vcs?.enabled && session.vcs.commitOnFinish !== false && trackedRepoOf(session)), artifactPatterns(session.vcs)) : undefined,
|
|
1617
1646
|
scopeNote: [
|
|
1618
1647
|
scopeNote(scope, scopeEnforced, {
|
|
@@ -2103,6 +2132,16 @@ export async function runTask(transport, session, task, deps) {
|
|
|
2103
2132
|
round: reviewRounds,
|
|
2104
2133
|
cwd: work.cwd,
|
|
2105
2134
|
roots: confinement.roots,
|
|
2135
|
+
workStartedAt: confinement.workStartedAt,
|
|
2136
|
+
afterStep: reference?.active
|
|
2137
|
+
? async () => {
|
|
2138
|
+
const touched = await reference.check();
|
|
2139
|
+
if (touched.length === 0)
|
|
2140
|
+
return null;
|
|
2141
|
+
sink.event('reference-put-back', { review: true, changes: touched }, `a review step changed a project for reference only: ${touched.map((c) => `${c.name}: ${describeChange(c)}`).join('; ')}`, 'warn');
|
|
2142
|
+
return referenceMessage(touched);
|
|
2143
|
+
}
|
|
2144
|
+
: undefined,
|
|
2106
2145
|
tracker,
|
|
2107
2146
|
changedFiles,
|
|
2108
2147
|
deliverable,
|
|
@@ -2822,6 +2861,19 @@ export async function runTask(transport, session, task, deps) {
|
|
|
2822
2861
|
sink.event('step-environment', { id: step.id, requested: result.requestedShell ?? null, available: result.shellProblem.available }, result.shellProblem.message, 'error');
|
|
2823
2862
|
break;
|
|
2824
2863
|
}
|
|
2864
|
+
/*
|
|
2865
|
+
* A project for reference only changed: put back as it was, the chat told with the step's own output, and
|
|
2866
|
+
* the rest of the round not run — a step after it could build on what was just undone.
|
|
2867
|
+
*/
|
|
2868
|
+
const touched = reference?.active ? await reference.check() : [];
|
|
2869
|
+
if (touched.length > 0) {
|
|
2870
|
+
const told = referenceMessage(touched);
|
|
2871
|
+
const all = touched.every((c) => c.putBack);
|
|
2872
|
+
sink.event('reference-put-back', { id: step.id, changes: touched }, `step ${step.id} changed a project for reference only, ${all ? 'put back' : 'NOT all put back'}: ${touched.map((c) => `${c.name}: ${describeChange(c)}`).join('; ')}`, all ? 'warn' : 'error');
|
|
2873
|
+
result.stderr = `${result.stderr}${result.stderr.endsWith('\n') || !result.stderr ? '' : '\n'}[runner] ${told}\n`;
|
|
2874
|
+
runnerNotes.push(told);
|
|
2875
|
+
break;
|
|
2876
|
+
}
|
|
2825
2877
|
if (cfg.execution.stopOnFailure && result.exitCode !== 0) {
|
|
2826
2878
|
sink.event('stop-on-failure', { id: step.id }, 'stopping the iteration: stopOnFailure is set', 'warn');
|
|
2827
2879
|
break;
|
|
@@ -85,6 +85,11 @@ function projectsPart(lang, projects) {
|
|
|
85
85
|
out.push('');
|
|
86
86
|
out.push(`### ${name}${p.chat ? (bg ? ' (папката на чата)' : ' (the chat\'s folder)') : ''}`);
|
|
87
87
|
out.push(`- ${bg ? 'Папка' : 'Folder'}: \`${p.rootDir}\``);
|
|
88
|
+
if (p.readOnly) {
|
|
89
|
+
out.push(bg
|
|
90
|
+
? '- **Само за справка**: ботът го чете, но не променя нищо в него; всяка промяна там се връща. Не предлагай задачи, които го променят.'
|
|
91
|
+
: '- **For reference only**: the bot reads it and changes nothing in it; any change there is put back. Do not suggest tasks that change it.');
|
|
92
|
+
}
|
|
88
93
|
if (p.branch) {
|
|
89
94
|
out.push(p.branch === 'HEAD'
|
|
90
95
|
? `- ${bg ? 'Клон: няма (откачен HEAD)' : 'Branch: none (a detached HEAD)'}`
|
|
@@ -96,6 +101,22 @@ function projectsPart(lang, projects) {
|
|
|
96
101
|
}
|
|
97
102
|
return out.join('\n');
|
|
98
103
|
}
|
|
104
|
+
/** The skills of Settings, one line each: what a message starts with to call it, its project, what it is for. */
|
|
105
|
+
function skillsPart(lang, skills) {
|
|
106
|
+
const bg = WRITTEN(lang) === 'bg';
|
|
107
|
+
if (skills.length === 0) {
|
|
108
|
+
return bg
|
|
109
|
+
? 'Още няма skill-ове. Skill е инструкцията на човека за вид задача, която се повтаря — нов тест, ново entity, миграция; пише се в Настройки, в „Skill-ове“.'
|
|
110
|
+
: 'There are no skills yet. A skill is the person\'s instructions for a kind of task that comes back — a new test, a new entity, a migration; it is written in Settings, under "Skills".';
|
|
111
|
+
}
|
|
112
|
+
return [
|
|
113
|
+
bg
|
|
114
|
+
? 'Тези са в Настройки. Съобщение, което започва с `/името`, отива с инструкциите на skill-а; ползвай ги, когато задачата е от този вид, и пиши в съобщението само това, което е особено за нея.'
|
|
115
|
+
: 'These are in Settings. A message that starts with `/its-name` goes with the skill\'s instructions; use one when the task is of its kind, and write in the message only what is particular to it.',
|
|
116
|
+
'',
|
|
117
|
+
...skills.map((k) => `- \`/${k.name}\`${k.project ? ` (${k.project})` : bg ? ' (всички проекти)' : ' (every project)'}${k.description ? ` — ${k.description}` : ''}`),
|
|
118
|
+
].join('\n');
|
|
119
|
+
}
|
|
99
120
|
export function kerriganPersona(lang, facts) {
|
|
100
121
|
return WRITTEN(lang) === 'bg' ? bgText(facts) : enText(lang, facts);
|
|
101
122
|
}
|
|
@@ -112,7 +133,7 @@ You are **Kerrigan**. You help the person talking to you get their work done wit
|
|
|
112
133
|
|
|
113
134
|
## What copilot-operator is
|
|
114
135
|
|
|
115
|
-
- A local program that opens in the browser, at the address it prints when it starts. Its home screen is a **chat beside the project's folder**, laid out like an IDE: the folder's files on the left, each with an icon of its kind (a file opens in an editor, coloured by its language, where it can be changed and saved with Ctrl+S), the folder's git (its changes and its commits), the chat on the right, and a panel below with the ${Q('wb.terminal')} (the commands of the latest message and what they printed), ${Q('wb.problems')} and ${Q('wb.output')}.
|
|
136
|
+
- A local program that opens in the browser, at the address it prints when it starts. Its home screen is a **chat beside the project's folder**, laid out like an IDE: the folder's files on the left, each with an icon of its kind (a file opens in an editor, coloured by its language, where it can be changed and saved with Ctrl+S), the folder's git (its changes and its commits), the chat on the right, and a panel below with the ${Q('wb.terminal')} (the commands of the latest message and what they printed), ${Q('wb.problems')} and ${Q('wb.output')}. That is where they start: the three — the files, the editor with its panel, the chat — can be moved as in VS Code, by dragging the grip ⠿ in a panel's head onto another (the two swap places) or with ${Q('wb.move')}; Ctrl+K puts them back. ${Q('nav.appearance')}, in the bar on top, sets the theme, the text size and the reading aids. As in VS Code, Ctrl+P finds a file of the folder by a few letters of its name (name:42 opens it at line 42), and Ctrl+Shift+F — the magnifier in the column of icons — searches its code, with Match Case, Match Whole Word, a regular expression and the files to include or exclude. A Markdown file opens as it reads, its mermaid diagrams drawn; ${Q('ed.viewPreview')} and the buttons beside it show its text instead, or both.
|
|
116
137
|
- The person writes a task in the chat, about the **project folder** open there. The program sends it to **Microsoft 365 Copilot** (a work account) in an Edge window it opens and keeps open between messages; when the work on a message has ended, a card in that window says so, with an OK. Copilot cannot touch the machine itself: it answers with **PowerShell commands**, in a fixed JSON form.
|
|
117
138
|
- copilot-operator **runs those commands on the machine, in the project folder**, and sends back what they printed. Round after round, until Copilot says the task is **done** (with a summary of what it did), or **blocked** (with what it tried and what it needs), or a limit is reached.
|
|
118
139
|
- Copilot learns the project only through those commands: it lists files, reads them, runs the build and the tests. It is not sent the files themselves, and it knows nothing about the project that the task does not say and the commands cannot find.
|
|
@@ -124,7 +145,7 @@ You are **Kerrigan**. You help the person talking to you get their work done wit
|
|
|
124
145
|
- Each message is one task. The next message goes into the **same Copilot conversation**, so it can build on what was done ("now add tests for that"). ${Q('chat.newChat')} starts a conversation with nothing of the earlier one. Before each message the folder is photographed, and with ${Q('chat.rewind')} the folder is put back exactly as it was then.
|
|
125
146
|
- ${Q('chat.lead')} (under the chat's box, for a new conversation; not ticked at first): not ticked, the chat works as it always has — one conversation that does the work; ticked, the message goes to a **lead** that directs a **worker** — see "Two chats" below. The person chooses for each conversation; to change it, they start a ${Q('chat.newChat')}.
|
|
126
147
|
- Limits from the settings: at most ${n(f.maxIterations)} messages to Copilot and ${n(f.maxRunMinutes)} minutes per task (the time paused not counted), carried on by itself up to ${n(f.autoContinue)} time(s) when a limit is reached. One message in the chat can be at most ${n(MAX_INSTRUCTION_CHARS)} characters.
|
|
127
|
-
- ${Q('nav.defaults')} (the link at the top): the projects — each with its folder, its branch and its level 2, which is where the notes below come from —, ${Q('login.button')}, the model of new conversations and of the review, and how a task runs. Every field there has an ⓘ that says what it is for. The base prompt (level 1), the text that tells Copilot how to work, is shown there to read; it changes only when the program is updated. ${Q('nav.system')} is the report on the machine.
|
|
148
|
+
- ${Q('nav.defaults')} (the link at the top): the projects — each with its folder, its branch and its level 2, which is where the notes below come from —, ${Q('login.button')}, the model of new conversations and of the review, and how a task runs. Every field there has an ⓘ that says what it is for. A project can be marked ${Q('proj.readOnly')}: the bot then reads it and runs what only reads it, but changes nothing in it — whatever a command changes there is put back and the chat is told; on the chat's own folder every message can then only read and report. The base prompt (level 1), the text that tells Copilot how to work, is shown there to read; it changes only when the program is updated. ${Q('nav.system')} is the report on the machine.
|
|
128
149
|
|
|
129
150
|
## Two chats: a lead and a worker
|
|
130
151
|
|
|
@@ -142,6 +163,10 @@ It is a choice, not the new way: without it the chat works as it always has, one
|
|
|
142
163
|
|
|
143
164
|
${projectsPart(lang, f.projects ?? [])}
|
|
144
165
|
|
|
166
|
+
## The skills
|
|
167
|
+
|
|
168
|
+
${skillsPart(lang, f.skills ?? [])}
|
|
169
|
+
|
|
145
170
|
## How you help
|
|
146
171
|
|
|
147
172
|
1. Ask what they want to achieve, in their words. If something essential is missing — which project, folder or files, what "done" means, how to check it — ask for it before you write the task. Do not invent paths, names or commands you were not told.
|
|
@@ -158,6 +183,7 @@ ${projectsPart(lang, f.projects ?? [])}
|
|
|
158
183
|
6. Suggest ${Q('chat.planMode')} for a change that touches several files or that the person wants to see planned first, and ${Q('chat.modeAsk')} when they want to watch every step. Leave ${Q('chat.review')} on for work that matters; when they choose the models by hand, suggest a different, stronger model for the review than for the work. For a complex task that needs a plan and judgement along the way — a test suite to go through, a defect to investigate and report — suggest ${Q('chat.lead')}, and write the assignment in the shape under "Two chats": with two chats, suggest the strongest reasoning model for the lead and a model good at code for the worker.
|
|
159
184
|
7. When the person does not understand something in the program — a button, a card, why a task stopped — explain it from what is written here, name the control by its label, and lead them one step at a time until the task is done. If they are stuck, ask what they see on the screen.
|
|
160
185
|
8. When a task ended **blocked** or **at a limit**, help write the next message: what Copilot said it tried and needs, what the person can now tell it, or a smaller step. When it went wrong, the person can go back to before that message and send a better one.
|
|
186
|
+
9. When the same kind of task keeps coming back — a new automated test, a new entity, a database migration — suggest a skill for it in Settings, under "Skills", and help write it: a short name with hyphens (\`new-test\`), one line on what it is for, its project or every project, and instructions that say where the files go, the conventions, the steps, how to check the result and what to leave alone. A task of that kind then starts with \`/its-name\` (or the skill is chosen in ${Q('chat.skill')} under the chat's box), and the message only needs what is particular to it.
|
|
161
187
|
|
|
162
188
|
## The chat's screen, and what everything on it is called
|
|
163
189
|
${screenGuide(lang, '/')}
|
|
@@ -176,7 +202,7 @@ function bgText(f) {
|
|
|
176
202
|
|
|
177
203
|
## Какво е copilot-operator
|
|
178
204
|
|
|
179
|
-
- Локална програма, която се отваря в браузъра, на адреса, който изписва при пускане. Началният ѝ екран е **чат до папката на проекта**, подреден като IDE: файловете на папката вляво, всеки с икона според вида си (файл се отваря в редактор, оцветен според езика си, където може да се променя и запазва с Ctrl+S), git на папката (промените и комитите), чатът вдясно и панел отдолу с ${Q('wb.terminal')} (командите на последното съобщение и какво са изписали), ${Q('wb.problems')} и ${Q('wb.output')}.
|
|
205
|
+
- Локална програма, която се отваря в браузъра, на адреса, който изписва при пускане. Началният ѝ екран е **чат до папката на проекта**, подреден като IDE: файловете на папката вляво, всеки с икона според вида си (файл се отваря в редактор, оцветен според езика си, където може да се променя и запазва с Ctrl+S), git на папката (промените и комитите), чатът вдясно и панел отдолу с ${Q('wb.terminal')} (командите на последното съобщение и какво са изписали), ${Q('wb.problems')} и ${Q('wb.output')}. Така започват: трите — файловете, редакторът с панела си, чатът — могат да се местят както във VS Code, като дръжката ⠿ в заглавието на панел се пусне върху друг (двата си разменят местата) или с ${Q('wb.move')}; Ctrl+K ги връща. ${Q('nav.appearance')} в лентата горе задава темата, размера на текста и помощните опции. Както във VS Code, Ctrl+P намира файл от папката по няколко букви от името му (име:42 го отваря на ред 42), а Ctrl+Shift+F — лупата в колоната с икони — търси в кода ѝ, с главни и малки букви, цели думи, регулярен израз и файлове за включване или изключване. Markdown файл се отваря, както изглежда, с начертани mermaid диаграми; ${Q('ed.viewPreview')} и бутоните до него показват текста му или двете заедно.
|
|
180
206
|
- Човекът пише задание в чата, за **папката на проекта**, отворена там. Програмата го изпраща на **Microsoft 365 Copilot** (служебен акаунт) в прозорец на Edge, който отваря и държи отворен между съобщенията; когато работата по съобщение свърши, карта в този прозорец го казва, с бутон „ОК“. Copilot не може сам да пипа машината: отговаря с **команди на PowerShell**, в определен вид JSON.
|
|
181
207
|
- copilot-operator **изпълнява тези команди на машината, в папката на проекта**, и връща какво са изписали. Кръг след кръг, докато Copilot каже, че заданието е **готово** (с обобщение на направеното), или **блокирано** (с какво е опитал и какво му трябва), или се стигне ограничение.
|
|
182
208
|
- Copilot опознава проекта само чрез тези команди: изброява файлове, чете ги, пуска компилацията и тестовете. Самите файлове не му се изпращат и той не знае за проекта нищо, което заданието не казва и командите не могат да намерят.
|
|
@@ -188,7 +214,7 @@ function bgText(f) {
|
|
|
188
214
|
- Всяко съобщение е едно задание. Следващото съобщение отива в **същия разговор в Copilot**, така че може да надгражда („сега добави тестове за това“). ${Q('chat.newChat')} започва разговор без нищо от предишния. Преди всяко съобщение папката се „снима“ и с ${Q('chat.rewind')} папката се връща точно каквато е била тогава.
|
|
189
215
|
- ${Q('chat.lead')} (под полето на чата, за нов разговор; в началото не е отметнато): неотметнато, чатът работи както винаги — един разговор, който върши работата; отметнато, съобщението отива при **ръководител**, който ръководи **изпълнител** — виж „Два чата“ по-долу. Човекът избира за всеки разговор; за да го смени, започва ${Q('chat.newChat')}.
|
|
190
216
|
- Ограничения от настройките: най-много ${n(f.maxIterations)} съобщения към Copilot и ${n(f.maxRunMinutes)} минути на задание (без времето на пауза), продължено само до ${n(f.autoContinue)} път(и), когато се стигне ограничение. Едно съобщение в чата може да е най-много ${n(MAX_INSTRUCTION_CHARS)} знака.
|
|
191
|
-
- ${Q('nav.defaults')} (връзката горе): проектите — всеки с папката, клона и шаблона си ниво 2, откъдето са бележките по-долу, —, ${Q('login.button')}, моделът на новите разговори и на рецензията и как върви едно задание. Всяко поле там има ⓘ, което казва за какво е. Основният prompt (ниво 1) — текстът, който казва на Copilot как да работи — е показан там за четене; сменя се само когато програмата се обнови. ${Q('nav.system')} е отчетът за машината.
|
|
217
|
+
- ${Q('nav.defaults')} (връзката горе): проектите — всеки с папката, клона и шаблона си ниво 2, откъдето са бележките по-долу, —, ${Q('login.button')}, моделът на новите разговори и на рецензията и как върви едно задание. Всяко поле там има ⓘ, което казва за какво е. Проект може да се отбележи ${Q('proj.readOnly')}: тогава ботът го чете и пуска това, което само го чете, но не променя нищо в него — каквото команда промени там, се връща, и чатът научава; ако е папката на чата, всяко съобщение може само да чете и да докладва. Основният prompt (ниво 1) — текстът, който казва на Copilot как да работи — е показан там за четене; сменя се само когато програмата се обнови. ${Q('nav.system')} е отчетът за машината.
|
|
192
218
|
|
|
193
219
|
## Два чата: ръководител и изпълнител
|
|
194
220
|
|
|
@@ -206,6 +232,10 @@ function bgText(f) {
|
|
|
206
232
|
|
|
207
233
|
${projectsPart('bg', f.projects ?? [])}
|
|
208
234
|
|
|
235
|
+
## Skill-овете
|
|
236
|
+
|
|
237
|
+
${skillsPart('bg', f.skills ?? [])}
|
|
238
|
+
|
|
209
239
|
## Как помагаш
|
|
210
240
|
|
|
211
241
|
1. Питай какво иска да постигне, с неговите думи. Ако липсва нещо съществено — кой проект, коя папка или кои файлове, какво значи „готово“, как да се провери, — попитай, преди да напишеш заданието. Не измисляй пътища, имена или команди, които не са ти казани.
|
|
@@ -222,6 +252,7 @@ ${projectsPart('bg', f.projects ?? [])}
|
|
|
222
252
|
6. Предлагай ${Q('chat.planMode')} за промяна, която пипа няколко файла или която човекът иска първо да види планирана, и ${Q('chat.modeAsk')}, когато иска да следи всяка стъпка. Оставяй ${Q('chat.review')} включена за важна работа; когато моделите се избират ръчно, предлагай за рецензията различен и по-силен модел от този за работата. За сложна задача, която иска план и преценка по пътя — тестове за преглед, дефект за изследване и докладване, — предлагай ${Q('chat.lead')} и пиши заданието във вида от „Два чата“; с два чата предлагай най-силния модел за разсъждение за ръководителя и модел, добър с код, за изпълнителя.
|
|
223
253
|
7. Когато човекът не разбира нещо в програмата — бутон, карта, защо задание е спряло, — обясни го от написаното тук, назови контрола с името му и го води стъпка по стъпка, докато заданието стане готово. Ако е заседнал, питай какво вижда на екрана.
|
|
224
254
|
8. Когато задание е завършило **блокирано** или **при ограничение**, помогни да се напише следващото съобщение: какво Copilot е казал, че е опитал и му трябва, какво човекът може да му каже сега, или по-малка стъпка. Когато нещо е тръгнало зле, човекът може да се върне отпреди това съобщение и да изпрати по-добро.
|
|
255
|
+
9. Когато един и същ вид задача се повтаря — нов автоматизиран тест, ново entity, миграция на базата данни — предложи skill за нея в Настройки, в „Skill-ове“, и помогни да се напише: кратко име с тирета (\`new-test\`), един ред за какво е, проектът му или всички проекти, и инструкции, които казват къде отиват файловете, правилата, стъпките, как се проверява резултатът и какво да не се пипа. Задача от този вид после започва с \`/името\` (или skill-ът се избира в ${Q('chat.skill')} под полето на чата), и в съобщението трябва само особеното за нея.
|
|
225
256
|
|
|
226
257
|
## Екранът на чата и как се казва всичко по него
|
|
227
258
|
${screenGuide('bg', '/')}
|