@bakers-build/conductor 0.5.1-next.853 → 0.5.1-next.855
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/dist/src/cli/config-plan.d.ts +0 -1
- package/dist/src/cli/config-plan.js +0 -7
- package/dist/src/cli/config-templates.d.ts +0 -1
- package/dist/src/cli/config-templates.js +4 -4
- package/dist/src/config.js +3 -11
- package/dist/src/core/conductor.js +7 -6
- package/dist/src/plugins/remote.d.ts +1 -2
- package/dist/src/types.d.ts +0 -5
- package/package.json +4 -4
|
@@ -128,7 +128,6 @@ export function planConfig(options = {}) {
|
|
|
128
128
|
editors.set(machine.path, new ConfigSourceEditor(renderHostMachine({
|
|
129
129
|
machineId: randomUUID(),
|
|
130
130
|
...(options.inputs?.label ? { label: options.inputs.label } : {}),
|
|
131
|
-
maxParallel: options.inputs?.maxParallel ?? 1,
|
|
132
131
|
})));
|
|
133
132
|
const authType = options.inputs?.authType ?? 'oauth2_client_credentials';
|
|
134
133
|
if (connection.selected &&
|
|
@@ -461,7 +460,6 @@ export function planConfig(options = {}) {
|
|
|
461
460
|
editor(file).remove('user_id');
|
|
462
461
|
fill(file, 'machine_id', randomUUID());
|
|
463
462
|
fill(file, 'label', options.inputs?.label);
|
|
464
|
-
fill(file, 'max_parallel', options.inputs?.maxParallel);
|
|
465
463
|
editor(file).stamp(1);
|
|
466
464
|
}
|
|
467
465
|
if (file.kind === 'conductor' || file.kind === 'local') {
|
|
@@ -563,11 +561,6 @@ export function planConfig(options = {}) {
|
|
|
563
561
|
problem(file, 'unsupported_source_shape', null, 'The supported connection migration chain completes safely.');
|
|
564
562
|
}
|
|
565
563
|
}
|
|
566
|
-
if (machine.selected &&
|
|
567
|
-
!protectedFile(machine) &&
|
|
568
|
-
editors.has(machine.path) &&
|
|
569
|
-
!editor(machine).property('max_parallel'))
|
|
570
|
-
editor(machine).set('max_parallel', '1');
|
|
571
564
|
const overlay = new Map([...editors].map(([path, e]) => [path, e.text]));
|
|
572
565
|
for (const [path] of original)
|
|
573
566
|
if (!editors.has(path))
|
|
@@ -13,7 +13,6 @@ export declare function renderGlobalConnection(inputs: ConnectionInputs): string
|
|
|
13
13
|
export declare function renderHostMachine(inputs: {
|
|
14
14
|
machineId: string;
|
|
15
15
|
label?: string;
|
|
16
|
-
maxParallel: number;
|
|
17
16
|
}): string;
|
|
18
17
|
export declare function renderCommittedConfig(inputs: {
|
|
19
18
|
project: string;
|
|
@@ -33,12 +33,12 @@ ${inputs.workspaceId ? ` workspace_id: ${JSON.stringify(inputs.workspaceId)},\n
|
|
|
33
33
|
}
|
|
34
34
|
export function renderHostMachine(inputs) {
|
|
35
35
|
return `// @bakers-schema-version 1
|
|
36
|
-
// Local host identity
|
|
36
|
+
// Local host identity. The run budget is set on the machine in the backend;
|
|
37
|
+
// server credentials belong to bakers.config.js.
|
|
37
38
|
export default {
|
|
38
39
|
schema_version: 1,
|
|
39
40
|
machine_id: ${JSON.stringify(inputs.machineId)},
|
|
40
|
-
${inputs.label ? ` label: ${JSON.stringify(inputs.label)},\n` : ''}
|
|
41
|
-
};
|
|
41
|
+
${inputs.label ? ` label: ${JSON.stringify(inputs.label)},\n` : ''}};
|
|
42
42
|
`;
|
|
43
43
|
}
|
|
44
44
|
export function renderCommittedConfig(inputs) {
|
|
@@ -57,7 +57,7 @@ export function renderCommittedConfig(inputs) {
|
|
|
57
57
|
|
|
58
58
|
export default {
|
|
59
59
|
bakers: { project: ${JSON.stringify(inputs.project)}${inputs.bakersWorkspace ? `, workspace: ${JSON.stringify(inputs.bakersWorkspace)}` : ''} },
|
|
60
|
-
//
|
|
60
|
+
// The run budget (max_parallel) is set on the machine in the backend.
|
|
61
61
|
// Set to false to keep this conductor's transcripts out of the log store
|
|
62
62
|
// (e.g. large, uninteresting, or subject to a local policy). Default true;
|
|
63
63
|
// metrics are unaffected either way.
|
package/dist/src/config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readdirSync } from 'node:fs';
|
|
2
2
|
import { basename, resolve } from 'node:path';
|
|
3
3
|
import { pathToFileURL } from 'node:url';
|
|
4
|
-
import { assertSchemaVersion1, discoverAddons, discoverScoped, findDefaultExportObject, machineContextPath, matchDelimiter, readMachineContext, resolveConductorSlots, resolveModuleEslintStyle, scanTopLevelProperties, scopeAddons, stemForConfigFile, } from '@bakers-build/core';
|
|
4
|
+
import { assertSchemaVersion1, discoverAddons, discoverScoped, findDefaultExportObject, machineContextPath, matchDelimiter, readMachineContext, resolveConductorSlots, resolveModuleEslintStyle, scanTopLevelProperties, scopeAddons, stemForConfigFile, warnIgnoredMaxParallel, } from '@bakers-build/core';
|
|
5
5
|
import { readBbProjectSelection } from './cli/project-context.js';
|
|
6
6
|
import { loadInbox } from './plugins/message.js';
|
|
7
7
|
import { narrowConductorContributions, } from './plugins/preset.js';
|
|
@@ -308,16 +308,9 @@ export async function loadConductorConfig(configFile) {
|
|
|
308
308
|
const states = Array.isArray(config.states)
|
|
309
309
|
? config.states.map((state) => requireNonEmptyString(state, 'states'))
|
|
310
310
|
: [];
|
|
311
|
-
|
|
312
|
-
if (config.max_parallel !== undefined) {
|
|
313
|
-
throw new Error(`${configPath}: misplaced max_parallel belongs in ${machineContextPath()}; move it there`);
|
|
314
|
-
}
|
|
311
|
+
warnIgnoredMaxParallel(configPath, config);
|
|
315
312
|
const machineCtx = await readMachineContext();
|
|
316
|
-
|
|
317
|
-
Number.isFinite(machineCtx.max_parallel) &&
|
|
318
|
-
machineCtx.max_parallel >= 1
|
|
319
|
-
? Math.floor(machineCtx.max_parallel)
|
|
320
|
-
: 1;
|
|
313
|
+
warnIgnoredMaxParallel(machineContextPath(), machineCtx);
|
|
321
314
|
const tunnel = machineCtx.tunnel === true;
|
|
322
315
|
const variant = stemForConfigFile(basename(configPath)) ?? 'conductor';
|
|
323
316
|
// BB-215: discover the conductor `addons: []` surface (last-wins singletons,
|
|
@@ -549,7 +542,6 @@ export async function loadConductorConfig(configFile) {
|
|
|
549
542
|
prompt: typeof config.prompt === 'string' && config.prompt.trim() !== ''
|
|
550
543
|
? config.prompt
|
|
551
544
|
: DEFAULT_AGENT_PROMPT,
|
|
552
|
-
max_parallel: maxParallel,
|
|
553
545
|
tunnel,
|
|
554
546
|
poll_interval_ms: optionalPositiveInteger(config.poll_interval_ms, 5000, 'poll_interval_ms'),
|
|
555
547
|
lease_seconds: optionalPositiveInteger(config.lease_seconds, 300, 'lease_seconds'),
|
|
@@ -172,7 +172,6 @@ export function registrationOf(config, checkoutRoot) {
|
|
|
172
172
|
workspace: checkoutRoot,
|
|
173
173
|
label: config.label,
|
|
174
174
|
...(config.machine_label ? { machine_label: config.machine_label } : {}),
|
|
175
|
-
max_parallel: config.max_parallel,
|
|
176
175
|
conductor_name: stem ?? config.variant,
|
|
177
176
|
};
|
|
178
177
|
}
|
|
@@ -313,17 +312,19 @@ export class Conductor {
|
|
|
313
312
|
// pending dispatches count without a second round-trip.
|
|
314
313
|
const capacity = await this.remote.machineCapacity(this.hostKey);
|
|
315
314
|
let machineLoad = capacity?.currentLoad ?? count;
|
|
316
|
-
//
|
|
317
|
-
//
|
|
318
|
-
|
|
319
|
-
|
|
315
|
+
// The machine row is the only budget; when it is unreadable, claim
|
|
316
|
+
// nothing this tick and retry on the next.
|
|
317
|
+
const maxParallel = capacity?.maxParallel ?? 0;
|
|
318
|
+
if (!capacity) {
|
|
319
|
+
this.logger.warn({ conductorId: this.id }, 'machine budget unreadable; claiming nothing this tick');
|
|
320
|
+
}
|
|
320
321
|
this.logger.info({
|
|
321
322
|
conductorId: this.id,
|
|
322
323
|
active: count,
|
|
323
324
|
machineLoad,
|
|
324
325
|
capacity: maxParallel,
|
|
325
326
|
}, 'conductor tick');
|
|
326
|
-
if (machineLoad > maxParallel) {
|
|
327
|
+
if (capacity && machineLoad > maxParallel) {
|
|
327
328
|
// BB-464 D4: a breach is its own signal, not merely the reason no
|
|
328
329
|
// further claim was made — this server-side ceiling (TicketClaimService)
|
|
329
330
|
// is the actual guard; this is visibility into how it was reached.
|
|
@@ -20,7 +20,6 @@ export interface ConductorRegistration {
|
|
|
20
20
|
states: string[];
|
|
21
21
|
workspace: string;
|
|
22
22
|
label: string;
|
|
23
|
-
max_parallel: number;
|
|
24
23
|
/**
|
|
25
24
|
* The pid of the serve-loop process, when this conductor *is* that process.
|
|
26
25
|
*
|
|
@@ -326,7 +325,7 @@ export interface BbRemote {
|
|
|
326
325
|
* Shared host capacity for this `host_key` (bb_machine, BB-353 D5).
|
|
327
326
|
* After a heartbeat that reported this process's load, `currentLoad` is the
|
|
328
327
|
* sum of online conductors on the machine (peers + self). Null when the
|
|
329
|
-
*
|
|
328
|
+
* machine row or its budget is unreadable — callers claim nothing.
|
|
330
329
|
*/
|
|
331
330
|
machineCapacity(hostKey: string): Promise<{
|
|
332
331
|
maxParallel: number;
|
package/dist/src/types.d.ts
CHANGED
|
@@ -36,11 +36,6 @@ export interface ConductorSettings {
|
|
|
36
36
|
* `{state}`, `{runUuid}`, `{ticketUuid}`. Defaults to `DEFAULT_AGENT_PROMPT`.
|
|
37
37
|
*/
|
|
38
38
|
prompt: string;
|
|
39
|
-
/**
|
|
40
|
-
* Host concurrent-run budget. Sourced from machine context max_parallel
|
|
41
|
-
* (BB-353); engine-config leftovers are ignored with a warning.
|
|
42
|
-
*/
|
|
43
|
-
max_parallel: number;
|
|
44
39
|
/**
|
|
45
40
|
* Machine preview-link policy. True when `machine.config.js` sets `tunnel: true`.
|
|
46
41
|
* Runtime-derived; ticket and project env cannot override it.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bakers-build/conductor",
|
|
3
|
-
"version": "0.5.1-next.
|
|
3
|
+
"version": "0.5.1-next.855",
|
|
4
4
|
"description": "bakers.build conductor engine + CLI: registers, claims tickets via JSON:API, dispatches agents.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,13 +32,13 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@dropsh/plugin-jsonapi-schema": "^0.8.2",
|
|
34
34
|
"@dropsh/plugin-oauth2": "^0.8.2",
|
|
35
|
-
"@bakers-build/core": "^0.5.1-next.
|
|
36
|
-
"@bakers-build/message": "^0.5.1-next.
|
|
35
|
+
"@bakers-build/core": "^0.5.1-next.855",
|
|
36
|
+
"@bakers-build/message": "^0.5.1-next.855",
|
|
37
37
|
"commander": "^12.1.0",
|
|
38
38
|
"dropsh": "^0.8.2"
|
|
39
39
|
},
|
|
40
40
|
"bakersBuild": {
|
|
41
|
-
"commit": "
|
|
41
|
+
"commit": "bea27960d8d0cfb827f72aae305ed5820ecd28f3",
|
|
42
42
|
"channel": "next"
|
|
43
43
|
}
|
|
44
44
|
}
|