@brainervirus/workit-codex 7.6.0 → 8.0.0
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/.codex-plugin/plugin.json +1 -1
- package/dist/launch-mcp.js +63 -63
- package/dist/workit-hook.js +48 -48
- package/package.json +3 -3
- package/skills/workit-fanout/SKILL.md +46 -46
- package/skills/workit-fanout/references/brief.md +15 -8
- package/skills/workit-fanout/references/orchestration.md +117 -0
- package/skills/workit-ship/SKILL.md +2 -2
package/dist/launch-mcp.js
CHANGED
|
@@ -6624,12 +6624,12 @@ var require_dist = __commonJS(function(exports, module) {
|
|
|
6624
6624
|
import { existsSync as existsSync9, realpathSync as realpathSync7, statSync as statSync3 } from "node:fs";
|
|
6625
6625
|
import path21 from "node:path";
|
|
6626
6626
|
|
|
6627
|
-
// packages/workit-core/src/core.ts
|
|
6627
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core.ts
|
|
6628
6628
|
import { spawnSync as spawnSync12 } from "node:child_process";
|
|
6629
6629
|
import { existsSync as existsSync7, realpathSync as realpathSync5 } from "node:fs";
|
|
6630
6630
|
import path19 from "node:path";
|
|
6631
6631
|
|
|
6632
|
-
// packages/workit-core/src/core/task-contract.ts
|
|
6632
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-contract.ts
|
|
6633
6633
|
import { createHash, randomUUID } from "node:crypto";
|
|
6634
6634
|
|
|
6635
6635
|
// node_modules/zod/v4/core/util.js
|
|
@@ -14203,7 +14203,7 @@ function preprocess(fn, schema) {
|
|
|
14203
14203
|
function datetime2(params) {
|
|
14204
14204
|
return _isoDateTime(ZodISODateTime, params);
|
|
14205
14205
|
}
|
|
14206
|
-
// packages/workit-core/src/core/task-contract.ts
|
|
14206
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-contract.ts
|
|
14207
14207
|
var SCHEMA_VERSION = 1;
|
|
14208
14208
|
var POLICY_VERSION = "1.0.0";
|
|
14209
14209
|
var OPERATION_FAMILIES = [
|
|
@@ -15058,7 +15058,7 @@ function requirementId(input) {
|
|
|
15058
15058
|
}
|
|
15059
15059
|
});
|
|
15060
15060
|
}
|
|
15061
|
-
// packages/workit-core/src/core/operation-input.ts
|
|
15061
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/operation-input.ts
|
|
15062
15062
|
var str = (d, values) => ({
|
|
15063
15063
|
type: "string",
|
|
15064
15064
|
...values ? { enum: values } : {},
|
|
@@ -15454,7 +15454,7 @@ function parseAdvertisedOperation(family, input, host) {
|
|
|
15454
15454
|
}))
|
|
15455
15455
|
});
|
|
15456
15456
|
}
|
|
15457
|
-
// packages/workit-core/src/core/task-store.ts
|
|
15457
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-store.ts
|
|
15458
15458
|
import { createHash as createHash4, randomUUID as randomUUID3 } from "node:crypto";
|
|
15459
15459
|
import * as fs7 from "node:fs";
|
|
15460
15460
|
import path6 from "node:path";
|
|
@@ -16060,7 +16060,7 @@ function acquireFileLockSync(targetPath, options) {
|
|
|
16060
16060
|
}
|
|
16061
16061
|
}
|
|
16062
16062
|
}
|
|
16063
|
-
// packages/workit-core/src/core/package-root.ts
|
|
16063
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/package-root.ts
|
|
16064
16064
|
import { existsSync } from "node:fs";
|
|
16065
16065
|
import path3 from "node:path";
|
|
16066
16066
|
import { fileURLToPath } from "node:url";
|
|
@@ -16079,12 +16079,12 @@ var assetRoot = () => {
|
|
|
16079
16079
|
return existsSync(assets) ? assets : root;
|
|
16080
16080
|
};
|
|
16081
16081
|
|
|
16082
|
-
// packages/workit-core/src/core/store-lock.ts
|
|
16082
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/store-lock.ts
|
|
16083
16083
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
16084
16084
|
import fs5 from "node:fs";
|
|
16085
16085
|
import { hostname } from "node:os";
|
|
16086
16086
|
|
|
16087
|
-
// packages/workit-core/src/store/paths.ts
|
|
16087
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/store/paths.ts
|
|
16088
16088
|
import { spawnSync } from "node:child_process";
|
|
16089
16089
|
import { createHash as createHash2 } from "node:crypto";
|
|
16090
16090
|
import fs4 from "node:fs";
|
|
@@ -16364,7 +16364,7 @@ var checkoutSlug = (root) => {
|
|
|
16364
16364
|
return `${base}-${shortHash(canonical)}`;
|
|
16365
16365
|
};
|
|
16366
16366
|
|
|
16367
|
-
// packages/workit-core/src/core/store-lock.ts
|
|
16367
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/store-lock.ts
|
|
16368
16368
|
var metadataLockSchema = object({
|
|
16369
16369
|
pid: number2().int().nonnegative().safe(),
|
|
16370
16370
|
processStart: string2().nullable(),
|
|
@@ -16495,7 +16495,7 @@ var clearAbandonedReclaimGuard = (lockPath, nowMs = Date.now()) => {
|
|
|
16495
16495
|
}
|
|
16496
16496
|
};
|
|
16497
16497
|
|
|
16498
|
-
// packages/workit-core/src/store/event-log.ts
|
|
16498
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/store/event-log.ts
|
|
16499
16499
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
16500
16500
|
import fs6 from "node:fs";
|
|
16501
16501
|
import path5 from "node:path";
|
|
@@ -16655,7 +16655,7 @@ var retryTransient = (run) => {
|
|
|
16655
16655
|
};
|
|
16656
16656
|
var renameWithRetry = (from, to) => retryTransient(() => fs6.renameSync(from, to));
|
|
16657
16657
|
|
|
16658
|
-
// packages/workit-core/src/store/patch.ts
|
|
16658
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/store/patch.ts
|
|
16659
16659
|
var isPlainObject2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
16660
16660
|
var equal = (left, right) => {
|
|
16661
16661
|
if (left === right)
|
|
@@ -16765,7 +16765,7 @@ var isPatch = (value) => Array.isArray(value) && value.every((op) => {
|
|
|
16765
16765
|
return false;
|
|
16766
16766
|
});
|
|
16767
16767
|
|
|
16768
|
-
// packages/workit-core/src/store/reduce.ts
|
|
16768
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/store/reduce.ts
|
|
16769
16769
|
import { createHash as createHash3 } from "node:crypto";
|
|
16770
16770
|
var OPENING_TYPES = new Set([
|
|
16771
16771
|
"task.opened",
|
|
@@ -16896,7 +16896,7 @@ function eventType(before, after) {
|
|
|
16896
16896
|
return "task.updated";
|
|
16897
16897
|
}
|
|
16898
16898
|
|
|
16899
|
-
// packages/workit-core/src/store/notes.ts
|
|
16899
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/store/notes.ts
|
|
16900
16900
|
var SLOT = Symbol.for("workit.migrationReporter");
|
|
16901
16901
|
var reportMigration = (report) => {
|
|
16902
16902
|
try {
|
|
@@ -16907,7 +16907,7 @@ var reportMigration = (report) => {
|
|
|
16907
16907
|
};
|
|
16908
16908
|
var migrationReporterInstalled = () => typeof globalThis[SLOT] === "function";
|
|
16909
16909
|
|
|
16910
|
-
// packages/workit-core/src/core/task-store.ts
|
|
16910
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-store.ts
|
|
16911
16911
|
var MIGRATION_PENDING = "workit migration pending";
|
|
16912
16912
|
var STORE_FORMAT = 3;
|
|
16913
16913
|
var STORE_MIN_RUNTIME = "3.0.0";
|
|
@@ -18543,18 +18543,18 @@ class TaskStore {
|
|
|
18543
18543
|
return failure2(recovery ? "recovery_required" : "storage_error", `lock operation failed: ${String(error)}`, { path: lockPath });
|
|
18544
18544
|
}
|
|
18545
18545
|
}
|
|
18546
|
-
// packages/workit-core/src/core/workers.ts
|
|
18546
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/workers.ts
|
|
18547
18547
|
var UNCERTAIN_WORKER_STATES = ["dispatching", "running", "cancelling", "unknown"];
|
|
18548
18548
|
var isUncertainWorker = (state) => UNCERTAIN_WORKER_STATES.includes(state);
|
|
18549
18549
|
var workerBlocksTransition = (transition, state) => transition === "pause" ? false : isUncertainWorker(state);
|
|
18550
18550
|
|
|
18551
|
-
// packages/workit-core/src/core/task-evaluation.ts
|
|
18551
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-evaluation.ts
|
|
18552
18552
|
import { createHash as createHash7 } from "node:crypto";
|
|
18553
18553
|
import * as fs11 from "node:fs";
|
|
18554
18554
|
import { spawnSync as spawnSync6 } from "node:child_process";
|
|
18555
18555
|
import path11 from "node:path";
|
|
18556
18556
|
|
|
18557
|
-
// packages/workit-core/src/check-config.ts
|
|
18557
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/check-config.ts
|
|
18558
18558
|
import { spawnSync as spawnSync3 } from "node:child_process";
|
|
18559
18559
|
import fs8 from "node:fs";
|
|
18560
18560
|
import path7 from "node:path";
|
|
@@ -18759,7 +18759,7 @@ function checkCommand(args, version, onPath = workitAvailable()) {
|
|
|
18759
18759
|
return onPath ? `workit check ${args}` : `npx -y @brainervirus/workit-cli@${version} check ${args}`;
|
|
18760
18760
|
}
|
|
18761
18761
|
|
|
18762
|
-
// packages/workit-core/src/git/rev.ts
|
|
18762
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/git/rev.ts
|
|
18763
18763
|
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
18764
18764
|
import { createHash as createHash5 } from "node:crypto";
|
|
18765
18765
|
import fs9 from "node:fs";
|
|
@@ -18940,11 +18940,11 @@ function pushRemoteName(cwd, branch) {
|
|
|
18940
18940
|
return remotes.length === 1 ? remotes[0] : null;
|
|
18941
18941
|
}
|
|
18942
18942
|
|
|
18943
|
-
// packages/workit-core/src/core/policy/derive.ts
|
|
18943
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/policy/derive.ts
|
|
18944
18944
|
import { existsSync as existsSync3 } from "node:fs";
|
|
18945
18945
|
import path10 from "node:path";
|
|
18946
18946
|
|
|
18947
|
-
// packages/workit-core/src/ledger.ts
|
|
18947
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/ledger.ts
|
|
18948
18948
|
import { spawnSync as spawnSync5 } from "node:child_process";
|
|
18949
18949
|
import { createHash as createHash6, randomBytes as randomBytes2 } from "node:crypto";
|
|
18950
18950
|
import fs10 from "node:fs";
|
|
@@ -19295,7 +19295,7 @@ function checkVerdicts(cwd, branch, rows) {
|
|
|
19295
19295
|
}
|
|
19296
19296
|
var OBSERVED_ONLY = new Set(["check", ...PR_ROW_TYPES]);
|
|
19297
19297
|
|
|
19298
|
-
// packages/workit-core/src/core/policy/derive.ts
|
|
19298
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/policy/derive.ts
|
|
19299
19299
|
var RULES = {
|
|
19300
19300
|
test: "check:test",
|
|
19301
19301
|
self: "verdict:self",
|
|
@@ -19483,7 +19483,7 @@ function derivedRuleStatus(task, requirement, root, ledger) {
|
|
|
19483
19483
|
}
|
|
19484
19484
|
}
|
|
19485
19485
|
|
|
19486
|
-
// packages/workit-core/src/core/task-evaluation.ts
|
|
19486
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-evaluation.ts
|
|
19487
19487
|
var digestBytes = (value) => createHash7("sha256").update(value).digest("hex");
|
|
19488
19488
|
var inside = (root, candidate) => candidate === root || candidate.startsWith(`${root}${path11.sep}`);
|
|
19489
19489
|
var relative = (root, candidate) => path11.relative(root, candidate).split(path11.sep).join("/") || ".";
|
|
@@ -20149,7 +20149,7 @@ function evaluateClosure(requestedOutcome, view) {
|
|
|
20149
20149
|
});
|
|
20150
20150
|
}
|
|
20151
20151
|
|
|
20152
|
-
// packages/workit-core/src/core/methods.ts
|
|
20152
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/methods.ts
|
|
20153
20153
|
var METHODS = {
|
|
20154
20154
|
"workit-shape": { dimensions: ["challenge", "decisions", "artifacts", "continuity"] },
|
|
20155
20155
|
"workit-bdd": { dimensions: ["testing"] },
|
|
@@ -20195,7 +20195,7 @@ function selectMethods(policy, capabilities) {
|
|
|
20195
20195
|
});
|
|
20196
20196
|
}
|
|
20197
20197
|
|
|
20198
|
-
// packages/workit-core/src/core/task-context.ts
|
|
20198
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-context.ts
|
|
20199
20199
|
function reconcileResume(view, observations = []) {
|
|
20200
20200
|
if (observations.length > 0)
|
|
20201
20201
|
return failure2("permission_denied", "worker observations require native host verification");
|
|
@@ -20309,7 +20309,7 @@ var exportDigest = (bundle) => sha256({
|
|
|
20309
20309
|
sourceWorkspaceId: bundle.sourceWorkspaceId,
|
|
20310
20310
|
task: bundle.task
|
|
20311
20311
|
});
|
|
20312
|
-
// packages/workit-core/src/core/git.ts
|
|
20312
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/git.ts
|
|
20313
20313
|
import { execFileSync } from "node:child_process";
|
|
20314
20314
|
var run = (cwd, args) => {
|
|
20315
20315
|
try {
|
|
@@ -20377,7 +20377,7 @@ var gitContext = (workspaceRoot, paths = []) => {
|
|
|
20377
20377
|
};
|
|
20378
20378
|
};
|
|
20379
20379
|
|
|
20380
|
-
// packages/workit-core/src/core/config.ts
|
|
20380
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/config.ts
|
|
20381
20381
|
import {
|
|
20382
20382
|
copyFileSync as copyFileSync2,
|
|
20383
20383
|
cpSync as cpSync2,
|
|
@@ -20390,7 +20390,7 @@ import {
|
|
|
20390
20390
|
import os2 from "node:os";
|
|
20391
20391
|
import path12 from "node:path";
|
|
20392
20392
|
|
|
20393
|
-
// packages/workit-core/src/core/boundary.ts
|
|
20393
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/boundary.ts
|
|
20394
20394
|
import { statSync as statSync2 } from "node:fs";
|
|
20395
20395
|
var EVENT = {
|
|
20396
20396
|
initialization: "initialization",
|
|
@@ -20426,7 +20426,7 @@ var changedSourcesSinceLoad = (marker) => {
|
|
|
20426
20426
|
return changed;
|
|
20427
20427
|
};
|
|
20428
20428
|
|
|
20429
|
-
// packages/workit-core/src/core/config.ts
|
|
20429
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/config.ts
|
|
20430
20430
|
var diagnosticLogger;
|
|
20431
20431
|
var PRESETS = {
|
|
20432
20432
|
gitflow: {
|
|
@@ -20579,7 +20579,7 @@ var COMMIT_PRESETS = [
|
|
|
20579
20579
|
"auto"
|
|
20580
20580
|
];
|
|
20581
20581
|
|
|
20582
|
-
// packages/workit-core/src/core/workspaces.ts
|
|
20582
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/workspaces.ts
|
|
20583
20583
|
import { createHash as createHash8 } from "node:crypto";
|
|
20584
20584
|
import { readFileSync as readFileSync4, realpathSync as realpathSync3 } from "node:fs";
|
|
20585
20585
|
import path13 from "node:path";
|
|
@@ -20988,12 +20988,12 @@ function workspaceDefaultTarget(cwd, globalDefault) {
|
|
|
20988
20988
|
return String(ws?.vcs?.defaultTargetBranch ?? (hasWorkspacePolicy ? policyDefault : globalDefault ?? policyDefault) ?? "develop");
|
|
20989
20989
|
}
|
|
20990
20990
|
|
|
20991
|
-
// packages/workit-core/src/core/vcs-config.ts
|
|
20991
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/vcs-config.ts
|
|
20992
20992
|
import fs12 from "node:fs";
|
|
20993
20993
|
import path14 from "node:path";
|
|
20994
20994
|
import { spawnSync as spawnSync8 } from "node:child_process";
|
|
20995
20995
|
|
|
20996
|
-
// packages/workit-core/src/core/release-tracks.ts
|
|
20996
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/release-tracks.ts
|
|
20997
20997
|
import { createHash as createHash9 } from "node:crypto";
|
|
20998
20998
|
import { spawnSync as spawnSync7 } from "node:child_process";
|
|
20999
20999
|
var KNOWN_FIELDS = new Set([
|
|
@@ -21378,7 +21378,7 @@ function resolveTrackFor(cwd, options) {
|
|
|
21378
21378
|
return resolution;
|
|
21379
21379
|
}
|
|
21380
21380
|
|
|
21381
|
-
// packages/workit-core/src/core/vcs-config.ts
|
|
21381
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/vcs-config.ts
|
|
21382
21382
|
var workspacesPath = () => path14.join(configDir(), "workspaces.json");
|
|
21383
21383
|
var vcsCwd = (cwd) => cwd ?? process.env.WORKFLOW_WORKSPACE_ROOT ?? process.cwd();
|
|
21384
21384
|
var remoteProvider = (cwd) => {
|
|
@@ -21659,10 +21659,10 @@ function mergedPrStyle(limit = 6, cwd) {
|
|
|
21659
21659
|
examples
|
|
21660
21660
|
};
|
|
21661
21661
|
}
|
|
21662
|
-
// packages/workit-core/src/core/task-engine.ts
|
|
21662
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-engine.ts
|
|
21663
21663
|
import { realpathSync as realpathSync4 } from "node:fs";
|
|
21664
21664
|
|
|
21665
|
-
// packages/workit-core/src/core/policy-resolver.ts
|
|
21665
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/policy-resolver.ts
|
|
21666
21666
|
function resolvePolicy(input) {
|
|
21667
21667
|
const ids = input.constraints.map((constraint) => constraint.id);
|
|
21668
21668
|
if (new Set(ids).size !== ids.length)
|
|
@@ -21718,7 +21718,7 @@ function diffPolicy(previous, next, reason, now) {
|
|
|
21718
21718
|
return parsed.data;
|
|
21719
21719
|
}
|
|
21720
21720
|
|
|
21721
|
-
// packages/workit-core/src/core/policy/judgment.ts
|
|
21721
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/policy/judgment.ts
|
|
21722
21722
|
var isObject6 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
21723
21723
|
var squash = (key) => key.toLowerCase().replace(/[_-]/g, "");
|
|
21724
21724
|
var ALIASES = {
|
|
@@ -21842,7 +21842,7 @@ function normalizeJudgment(raw, previous) {
|
|
|
21842
21842
|
return success(null, null, { judgment: parsed.data, ignored, legacy });
|
|
21843
21843
|
}
|
|
21844
21844
|
|
|
21845
|
-
// packages/workit-core/src/autonomy.ts
|
|
21845
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/autonomy.ts
|
|
21846
21846
|
import os3 from "node:os";
|
|
21847
21847
|
import path15 from "node:path";
|
|
21848
21848
|
var accountHome = () => {
|
|
@@ -21979,7 +21979,7 @@ function resolveAutonomy(cwd) {
|
|
|
21979
21979
|
var suggested = (kind) => kind === "merge" ? "verified" : "true";
|
|
21980
21980
|
var grantHint = (workspace, kind) => `ask the user to run, in their own terminal: workit grant set ${workspace ?? "<workspace>"} ${kind}=${suggested(kind)}`;
|
|
21981
21981
|
|
|
21982
|
-
// packages/workit-core/src/core/task-engine.ts
|
|
21982
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-engine.ts
|
|
21983
21983
|
var workspaceVerification = (root) => {
|
|
21984
21984
|
try {
|
|
21985
21985
|
return resolveAutonomy(root).verification;
|
|
@@ -23564,7 +23564,7 @@ class WorkitCore {
|
|
|
23564
23564
|
return this.summary(changed.data.task);
|
|
23565
23565
|
}
|
|
23566
23566
|
}
|
|
23567
|
-
// packages/workit-core/src/core/repo-context.ts
|
|
23567
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/repo-context.ts
|
|
23568
23568
|
import { spawnSync as spawnSync9 } from "node:child_process";
|
|
23569
23569
|
import { existsSync as existsSync6, readFileSync as readFileSync5, readdirSync as readdirSync4 } from "node:fs";
|
|
23570
23570
|
import path16 from "node:path";
|
|
@@ -24034,20 +24034,20 @@ function releaseNotesContext(root, rangeOrTag) {
|
|
|
24034
24034
|
return { stdout, stderr: "", exitCode: 0, cwd };
|
|
24035
24035
|
}
|
|
24036
24036
|
|
|
24037
|
-
// packages/workit-core/src/core/tracker-issues.ts
|
|
24037
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/tracker-issues.ts
|
|
24038
24038
|
import { spawnSync as spawnSync11 } from "node:child_process";
|
|
24039
24039
|
|
|
24040
|
-
// packages/workit-core/src/core/pr-create.ts
|
|
24040
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/pr-create.ts
|
|
24041
24041
|
import fs13 from "node:fs";
|
|
24042
24042
|
import path17 from "node:path";
|
|
24043
24043
|
import { spawnSync as spawnSync10 } from "node:child_process";
|
|
24044
|
-
// packages/workit-core/src/forge/pr-body.ts
|
|
24044
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/forge/pr-body.ts
|
|
24045
24045
|
function parseGhIssue(value) {
|
|
24046
24046
|
const m = /issues\/(\d+)/.exec(value);
|
|
24047
24047
|
return m ? m[1] : String(value).trim().replace(/^#/, "");
|
|
24048
24048
|
}
|
|
24049
24049
|
|
|
24050
|
-
// packages/workit-core/src/core/pr-create.ts
|
|
24050
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/pr-create.ts
|
|
24051
24051
|
function whichOnPath(tool) {
|
|
24052
24052
|
const names = process.platform === "win32" ? [tool, `${tool}.exe`, `${tool}.cmd`] : [tool];
|
|
24053
24053
|
for (const dir of (process.env.PATH ?? "").split(path17.delimiter)) {
|
|
@@ -24075,7 +24075,7 @@ var pushRemote = (cwd) => {
|
|
|
24075
24075
|
return urls.length === 1 ? urls[0] : null;
|
|
24076
24076
|
};
|
|
24077
24077
|
|
|
24078
|
-
// packages/workit-core/src/core/tracker-issues.ts
|
|
24078
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/tracker-issues.ts
|
|
24079
24079
|
var repoPathFromRemote = (remote) => {
|
|
24080
24080
|
let rest = (remote || "").trim().replace(/\/+$/, "");
|
|
24081
24081
|
if (!rest)
|
|
@@ -24173,19 +24173,19 @@ var fetchGitLabIssueBody = async (ref, root, deps = {}) => {
|
|
|
24173
24173
|
return tryCliTriple(deps.cli ?? defaultCli("glab", hostingCliAvailable("gitlab")), "glab", ["issue", "view", id, "-R", repoArg, "-F", "json"], root, id, ["iid"], ["description"]);
|
|
24174
24174
|
};
|
|
24175
24175
|
|
|
24176
|
-
// packages/workit-core/src/core/youtrack.ts
|
|
24176
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/youtrack.ts
|
|
24177
24177
|
import fs14 from "node:fs";
|
|
24178
24178
|
import path18 from "node:path";
|
|
24179
24179
|
|
|
24180
|
-
// packages/workit-core/src/core/templates.ts
|
|
24180
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/templates.ts
|
|
24181
24181
|
var repoRoot2 = assetRoot();
|
|
24182
24182
|
|
|
24183
|
-
// packages/workit-core/src/core/scripts.ts
|
|
24183
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/scripts.ts
|
|
24184
24184
|
var PLUGIN_ROOT = packageRoot();
|
|
24185
24185
|
var ASSET_ROOT = assetRoot();
|
|
24186
24186
|
var resolveWorkspaceRoot = (explicit) => explicit || process.cwd();
|
|
24187
24187
|
|
|
24188
|
-
// packages/workit-core/src/core/youtrack.ts
|
|
24188
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/youtrack.ts
|
|
24189
24189
|
var ISSUE_RE = /^[A-Z]+-\d+$/;
|
|
24190
24190
|
var TOKEN_PLACEHOLDER = "YOUR_TOKEN_HERE";
|
|
24191
24191
|
var youTrackConfigPath = () => process.env.WORKFLOW_YOUTRACK_CONFIG ?? path18.join(configDir(), "youtrack.json");
|
|
@@ -24476,7 +24476,7 @@ var fetchYouTrackIssueBody = async (issue, creds = youTrackToken, request = youT
|
|
|
24476
24476
|
}
|
|
24477
24477
|
};
|
|
24478
24478
|
|
|
24479
|
-
// packages/workit-core/src/core/context-read.ts
|
|
24479
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/context-read.ts
|
|
24480
24480
|
var contextReadSchema = object({
|
|
24481
24481
|
kind: _enum([
|
|
24482
24482
|
"git",
|
|
@@ -24571,7 +24571,7 @@ var readExternalContext = async (root, payload) => {
|
|
|
24571
24571
|
}
|
|
24572
24572
|
}
|
|
24573
24573
|
};
|
|
24574
|
-
// packages/workit-core/src/core.ts
|
|
24574
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core.ts
|
|
24575
24575
|
var revision2 = /^[A-Za-z0-9@][A-Za-z0-9@._/~^{}-]*$/;
|
|
24576
24576
|
function gitRevisionParts(value) {
|
|
24577
24577
|
if (!value || value.startsWith("-") || /[\s\\'"`$;|&<>]/.test(value)) {
|
|
@@ -24627,7 +24627,7 @@ function run2(root, executable, args, env = {}) {
|
|
|
24627
24627
|
};
|
|
24628
24628
|
}
|
|
24629
24629
|
|
|
24630
|
-
// packages/workit-core/src/core/support-matrix.ts
|
|
24630
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/support-matrix.ts
|
|
24631
24631
|
var SUPPORT_MATRIX = {
|
|
24632
24632
|
bun: "1.4.1",
|
|
24633
24633
|
node: { minimum: "24", current: "24.20.0" },
|
|
@@ -24637,7 +24637,7 @@ var SUPPORT_MATRIX = {
|
|
|
24637
24637
|
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
|
|
24638
24638
|
};
|
|
24639
24639
|
|
|
24640
|
-
// packages/workit-mcp/src/server.ts
|
|
24640
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-mcp/src/server.ts
|
|
24641
24641
|
import { existsSync as existsSync8, readFileSync as readFileSync6, realpathSync as realpathSync6 } from "node:fs";
|
|
24642
24642
|
import path20 from "node:path";
|
|
24643
24643
|
// node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
|
|
@@ -27014,10 +27014,10 @@ class StdioServerTransport {
|
|
|
27014
27014
|
}
|
|
27015
27015
|
}
|
|
27016
27016
|
|
|
27017
|
-
// packages/workit-mcp/src/server.ts
|
|
27017
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-mcp/src/server.ts
|
|
27018
27018
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
27019
27019
|
|
|
27020
|
-
// packages/workit-core/src/core/logger.ts
|
|
27020
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/logger.ts
|
|
27021
27021
|
import os4 from "node:os";
|
|
27022
27022
|
var REDACTED = "[REDACTED]";
|
|
27023
27023
|
var SECRET_VALUE = /\b(?:Bearer|Basic|Digest|Token)\s+\S+/gi;
|
|
@@ -27074,7 +27074,7 @@ var applyPatterns = (value) => {
|
|
|
27074
27074
|
};
|
|
27075
27075
|
var redactSecrets = (value) => applyPatterns(value);
|
|
27076
27076
|
|
|
27077
|
-
// packages/workit-mcp/src/server.ts
|
|
27077
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-mcp/src/server.ts
|
|
27078
27078
|
class McpCapabilityUnavailableError extends Error {
|
|
27079
27079
|
capability;
|
|
27080
27080
|
constructor(capability) {
|
|
@@ -27369,7 +27369,7 @@ async function runStdioServer(host, contextProvider = defaultContextProvider(hos
|
|
|
27369
27369
|
await server.connect(new StdioServerTransport);
|
|
27370
27370
|
return server;
|
|
27371
27371
|
}
|
|
27372
|
-
// packages/workit-core/src/hooks/descriptor.ts
|
|
27372
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/descriptor.ts
|
|
27373
27373
|
var support = (descriptor, axis) => {
|
|
27374
27374
|
if (axis.startsWith("event:"))
|
|
27375
27375
|
return descriptor.events[axis.slice("event:".length)].support;
|
|
@@ -27393,14 +27393,14 @@ var capabilitiesFor = (descriptor, observed = {}) => descriptor.capabilities.map
|
|
|
27393
27393
|
refs: rule.refs.map((handle) => ({ kind: "host", host: descriptor.host, handle }))
|
|
27394
27394
|
};
|
|
27395
27395
|
});
|
|
27396
|
-
// packages/workit-core/src/hooks/context.ts
|
|
27396
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/context.ts
|
|
27397
27397
|
var signals = new Map;
|
|
27398
27398
|
var cache = new Map;
|
|
27399
|
-
// packages/workit-core/src/hooks/write-gate.ts
|
|
27399
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/write-gate.ts
|
|
27400
27400
|
var CASE_INSENSITIVE = process.platform === "darwin" || process.platform === "win32";
|
|
27401
27401
|
var PREFIXES = new Set(["sudo", "command", "env", "nohup", "time", "exec", "xargs"]);
|
|
27402
27402
|
var cache2 = new Map;
|
|
27403
|
-
// packages/workit-core/src/hooks/hosts/fields.ts
|
|
27403
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/hosts/fields.ts
|
|
27404
27404
|
var SHELLS = new Set(["sh", "bash", "zsh", "dash", "pwsh", "powershell", "cmd"]);
|
|
27405
27405
|
var WRITE_TOOLS = new Set([
|
|
27406
27406
|
"write",
|
|
@@ -27421,15 +27421,15 @@ var WRITE_TOOLS = new Set([
|
|
|
27421
27421
|
"editfile",
|
|
27422
27422
|
"writefile"
|
|
27423
27423
|
]);
|
|
27424
|
-
// packages/workit-core/src/hooks/handle.ts
|
|
27424
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/handle.ts
|
|
27425
27425
|
var offered = new Set;
|
|
27426
27426
|
var CLAUDE_JUDGES = new Set(["workit:verifier", "workit:reviewer"]);
|
|
27427
|
-
// packages/workit-core/src/hooks/hosts/claude-code.ts
|
|
27427
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/hosts/claude-code.ts
|
|
27428
27428
|
var SOURCES = new Set(["startup", "resume", "clear", "compact", "fork"]);
|
|
27429
27429
|
var SHELL_TOOLS = new Set(["Bash", "PowerShell"]);
|
|
27430
27430
|
var CONTEXT_EVENTS = new Set(["SessionStart", "UserPromptSubmit", "SubagentStart"]);
|
|
27431
27431
|
|
|
27432
|
-
// packages/workit-core/src/hooks/hosts/codex.ts
|
|
27432
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/hosts/codex.ts
|
|
27433
27433
|
function detectCodexSurface(env) {
|
|
27434
27434
|
return env.CODEX_INTERNAL_ORIGINATOR_OVERRIDE === "Codex Desktop" || Boolean(env.CODEX_ELECTRON_RESOURCES_PATH) ? "codex_desktop" : "codex_cli";
|
|
27435
27435
|
}
|
|
@@ -27534,10 +27534,10 @@ var codexDescriptor = (host) => ({ ...CODEX_DESCRIPTOR, host });
|
|
|
27534
27534
|
var SHELL_TOOLS2 = new Set(["bash", "unified-exec"]);
|
|
27535
27535
|
var SOURCES2 = new Set(["startup", "resume", "clear", "compact"]);
|
|
27536
27536
|
|
|
27537
|
-
// packages/workit-core/src/hooks/hosts/cursor.ts
|
|
27537
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/hosts/cursor.ts
|
|
27538
27538
|
var BLOCKING = new Set(["preToolUse", "beforeShellExecution", "subagentStart"]);
|
|
27539
27539
|
|
|
27540
|
-
// packages/workit-core/src/hooks/run.ts
|
|
27540
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/run.ts
|
|
27541
27541
|
if (false) {}
|
|
27542
27542
|
// packages/workit-codex/hooks/workit-hook.ts
|
|
27543
27543
|
var codexCapabilities = (host, availability = {}) => capabilitiesFor(codexDescriptor(host), {
|
package/dist/workit-hook.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
4
|
-
// packages/workit-core/src/hooks/descriptor.ts
|
|
4
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/descriptor.ts
|
|
5
5
|
var support = (descriptor, axis) => {
|
|
6
6
|
if (axis.startsWith("event:"))
|
|
7
7
|
return descriptor.events[axis.slice("event:".length)].support;
|
|
@@ -25,10 +25,10 @@ var capabilitiesFor = (descriptor, observed = {}) => descriptor.capabilities.map
|
|
|
25
25
|
refs: rule.refs.map((handle) => ({ kind: "host", host: descriptor.host, handle }))
|
|
26
26
|
};
|
|
27
27
|
});
|
|
28
|
-
// packages/workit-core/src/hooks/context.ts
|
|
28
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/context.ts
|
|
29
29
|
import path15 from "node:path";
|
|
30
30
|
|
|
31
|
-
// packages/workit-core/src/core/methods.ts
|
|
31
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/methods.ts
|
|
32
32
|
var METHODS = {
|
|
33
33
|
"workit-shape": { dimensions: ["challenge", "decisions", "artifacts", "continuity"] },
|
|
34
34
|
"workit-bdd": { dimensions: ["testing"] },
|
|
@@ -136,7 +136,7 @@ Skills: load the skill, never act from memory of it (slash aliases /wk-<name>).
|
|
|
136
136
|
- architecture, deepen modules (user-invoked; offer it): workit-architecture
|
|
137
137
|
`.trim();
|
|
138
138
|
|
|
139
|
-
// packages/workit-core/src/core/task-contract.ts
|
|
139
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-contract.ts
|
|
140
140
|
import { createHash, randomUUID } from "node:crypto";
|
|
141
141
|
|
|
142
142
|
// node_modules/zod/v4/core/util.js
|
|
@@ -7650,7 +7650,7 @@ function refine(fn, _params = {}) {
|
|
|
7650
7650
|
function superRefine(fn, params) {
|
|
7651
7651
|
return _superRefine(fn, params);
|
|
7652
7652
|
}
|
|
7653
|
-
// packages/workit-core/src/core/task-contract.ts
|
|
7653
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-contract.ts
|
|
7654
7654
|
var SCHEMA_VERSION = 1;
|
|
7655
7655
|
var POLICY_VERSION = "1.0.0";
|
|
7656
7656
|
var OPERATION_FAMILIES = [
|
|
@@ -8506,13 +8506,13 @@ function requirementId(input) {
|
|
|
8506
8506
|
});
|
|
8507
8507
|
}
|
|
8508
8508
|
|
|
8509
|
-
// packages/workit-core/src/core/task-evaluation.ts
|
|
8509
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-evaluation.ts
|
|
8510
8510
|
import { createHash as createHash7 } from "node:crypto";
|
|
8511
8511
|
import * as fs11 from "node:fs";
|
|
8512
8512
|
import { spawnSync as spawnSync6 } from "node:child_process";
|
|
8513
8513
|
import path11 from "node:path";
|
|
8514
8514
|
|
|
8515
|
-
// packages/workit-core/src/check-config.ts
|
|
8515
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/check-config.ts
|
|
8516
8516
|
import { spawnSync } from "node:child_process";
|
|
8517
8517
|
import fs from "node:fs";
|
|
8518
8518
|
import path from "node:path";
|
|
@@ -8717,7 +8717,7 @@ function checkCommand(args, version, onPath = workitAvailable()) {
|
|
|
8717
8717
|
return onPath ? `workit check ${args}` : `npx -y @brainervirus/workit-cli@${version} check ${args}`;
|
|
8718
8718
|
}
|
|
8719
8719
|
|
|
8720
|
-
// packages/workit-core/src/git/rev.ts
|
|
8720
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/git/rev.ts
|
|
8721
8721
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
8722
8722
|
import { createHash as createHash2 } from "node:crypto";
|
|
8723
8723
|
import fs2 from "node:fs";
|
|
@@ -8869,7 +8869,7 @@ function currentBranch(cwd) {
|
|
|
8869
8869
|
return line(git2(cwd, ["symbolic-ref", "--short", "-q", "HEAD"]));
|
|
8870
8870
|
}
|
|
8871
8871
|
|
|
8872
|
-
// packages/workit-core/src/core/task-store.ts
|
|
8872
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-store.ts
|
|
8873
8873
|
import { createHash as createHash5, randomUUID as randomUUID3 } from "node:crypto";
|
|
8874
8874
|
import * as fs9 from "node:fs";
|
|
8875
8875
|
import path8 from "node:path";
|
|
@@ -9475,7 +9475,7 @@ function acquireFileLockSync(targetPath, options) {
|
|
|
9475
9475
|
}
|
|
9476
9476
|
}
|
|
9477
9477
|
}
|
|
9478
|
-
// packages/workit-core/src/core/package-root.ts
|
|
9478
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/package-root.ts
|
|
9479
9479
|
import { existsSync } from "node:fs";
|
|
9480
9480
|
import path5 from "node:path";
|
|
9481
9481
|
import { fileURLToPath } from "node:url";
|
|
@@ -9489,12 +9489,12 @@ var packageRoot = () => {
|
|
|
9489
9489
|
}
|
|
9490
9490
|
};
|
|
9491
9491
|
|
|
9492
|
-
// packages/workit-core/src/core/store-lock.ts
|
|
9492
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/store-lock.ts
|
|
9493
9493
|
import { spawnSync as spawnSync4 } from "node:child_process";
|
|
9494
9494
|
import fs7 from "node:fs";
|
|
9495
9495
|
import { hostname } from "node:os";
|
|
9496
9496
|
|
|
9497
|
-
// packages/workit-core/src/store/paths.ts
|
|
9497
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/store/paths.ts
|
|
9498
9498
|
import { spawnSync as spawnSync3 } from "node:child_process";
|
|
9499
9499
|
import { createHash as createHash3 } from "node:crypto";
|
|
9500
9500
|
import fs6 from "node:fs";
|
|
@@ -9774,7 +9774,7 @@ var checkoutSlug = (root) => {
|
|
|
9774
9774
|
return `${base}-${shortHash(canonical)}`;
|
|
9775
9775
|
};
|
|
9776
9776
|
|
|
9777
|
-
// packages/workit-core/src/core/store-lock.ts
|
|
9777
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/store-lock.ts
|
|
9778
9778
|
var metadataLockSchema = object({
|
|
9779
9779
|
pid: number2().int().nonnegative().safe(),
|
|
9780
9780
|
processStart: string2().nullable(),
|
|
@@ -9905,7 +9905,7 @@ var clearAbandonedReclaimGuard = (lockPath, nowMs = Date.now()) => {
|
|
|
9905
9905
|
}
|
|
9906
9906
|
};
|
|
9907
9907
|
|
|
9908
|
-
// packages/workit-core/src/store/event-log.ts
|
|
9908
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/store/event-log.ts
|
|
9909
9909
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
9910
9910
|
import fs8 from "node:fs";
|
|
9911
9911
|
import path7 from "node:path";
|
|
@@ -10065,7 +10065,7 @@ var retryTransient = (run) => {
|
|
|
10065
10065
|
};
|
|
10066
10066
|
var renameWithRetry = (from, to) => retryTransient(() => fs8.renameSync(from, to));
|
|
10067
10067
|
|
|
10068
|
-
// packages/workit-core/src/store/patch.ts
|
|
10068
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/store/patch.ts
|
|
10069
10069
|
var isPlainObject2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
10070
10070
|
var equal = (left, right) => {
|
|
10071
10071
|
if (left === right)
|
|
@@ -10175,7 +10175,7 @@ var isPatch = (value) => Array.isArray(value) && value.every((op) => {
|
|
|
10175
10175
|
return false;
|
|
10176
10176
|
});
|
|
10177
10177
|
|
|
10178
|
-
// packages/workit-core/src/store/reduce.ts
|
|
10178
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/store/reduce.ts
|
|
10179
10179
|
import { createHash as createHash4 } from "node:crypto";
|
|
10180
10180
|
var OPENING_TYPES = new Set([
|
|
10181
10181
|
"task.opened",
|
|
@@ -10306,7 +10306,7 @@ function eventType(before, after) {
|
|
|
10306
10306
|
return "task.updated";
|
|
10307
10307
|
}
|
|
10308
10308
|
|
|
10309
|
-
// packages/workit-core/src/store/notes.ts
|
|
10309
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/store/notes.ts
|
|
10310
10310
|
var SLOT = Symbol.for("workit.migrationReporter");
|
|
10311
10311
|
var reportMigration = (report) => {
|
|
10312
10312
|
try {
|
|
@@ -10317,7 +10317,7 @@ var reportMigration = (report) => {
|
|
|
10317
10317
|
};
|
|
10318
10318
|
var migrationReporterInstalled = () => typeof globalThis[SLOT] === "function";
|
|
10319
10319
|
|
|
10320
|
-
// packages/workit-core/src/core/task-store.ts
|
|
10320
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-store.ts
|
|
10321
10321
|
var MIGRATION_PENDING = "workit migration pending";
|
|
10322
10322
|
var STORE_FORMAT = 3;
|
|
10323
10323
|
var STORE_MIN_RUNTIME = "3.0.0";
|
|
@@ -11954,11 +11954,11 @@ class TaskStore {
|
|
|
11954
11954
|
}
|
|
11955
11955
|
}
|
|
11956
11956
|
|
|
11957
|
-
// packages/workit-core/src/core/policy/derive.ts
|
|
11957
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/policy/derive.ts
|
|
11958
11958
|
import { existsSync as existsSync3 } from "node:fs";
|
|
11959
11959
|
import path10 from "node:path";
|
|
11960
11960
|
|
|
11961
|
-
// packages/workit-core/src/ledger.ts
|
|
11961
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/ledger.ts
|
|
11962
11962
|
import { spawnSync as spawnSync5 } from "node:child_process";
|
|
11963
11963
|
import { createHash as createHash6, randomBytes as randomBytes2 } from "node:crypto";
|
|
11964
11964
|
import fs10 from "node:fs";
|
|
@@ -12309,7 +12309,7 @@ function checkVerdicts(cwd, branch, rows) {
|
|
|
12309
12309
|
}
|
|
12310
12310
|
var OBSERVED_ONLY = new Set(["check", ...PR_ROW_TYPES]);
|
|
12311
12311
|
|
|
12312
|
-
// packages/workit-core/src/core/policy/derive.ts
|
|
12312
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/policy/derive.ts
|
|
12313
12313
|
var RULES = {
|
|
12314
12314
|
test: "check:test",
|
|
12315
12315
|
self: "verdict:self",
|
|
@@ -12508,7 +12508,7 @@ function writeBlockers(task, root) {
|
|
|
12508
12508
|
});
|
|
12509
12509
|
}
|
|
12510
12510
|
|
|
12511
|
-
// packages/workit-core/src/core/task-evaluation.ts
|
|
12511
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-evaluation.ts
|
|
12512
12512
|
var digestBytes = (value) => createHash7("sha256").update(value).digest("hex");
|
|
12513
12513
|
var inside = (root, candidate) => candidate === root || candidate.startsWith(`${root}${path11.sep}`);
|
|
12514
12514
|
var relative = (root, candidate) => path11.relative(root, candidate).split(path11.sep).join("/") || ".";
|
|
@@ -13174,10 +13174,10 @@ function evaluateClosure(requestedOutcome, view) {
|
|
|
13174
13174
|
});
|
|
13175
13175
|
}
|
|
13176
13176
|
|
|
13177
|
-
// packages/workit-core/src/core/task-engine.ts
|
|
13177
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-engine.ts
|
|
13178
13178
|
import { realpathSync as realpathSync4 } from "node:fs";
|
|
13179
13179
|
|
|
13180
|
-
// packages/workit-core/src/core/policy-resolver.ts
|
|
13180
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/policy-resolver.ts
|
|
13181
13181
|
function resolvePolicy(input) {
|
|
13182
13182
|
const ids = input.constraints.map((constraint) => constraint.id);
|
|
13183
13183
|
if (new Set(ids).size !== ids.length)
|
|
@@ -13233,7 +13233,7 @@ function diffPolicy(previous, next, reason, now) {
|
|
|
13233
13233
|
return parsed.data;
|
|
13234
13234
|
}
|
|
13235
13235
|
|
|
13236
|
-
// packages/workit-core/src/core/operation-input.ts
|
|
13236
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/operation-input.ts
|
|
13237
13237
|
var str2 = (d, values) => ({
|
|
13238
13238
|
type: "string",
|
|
13239
13239
|
...values ? { enum: values } : {},
|
|
@@ -13579,7 +13579,7 @@ function normalizeOperationInput(family, input, host) {
|
|
|
13579
13579
|
return request;
|
|
13580
13580
|
}
|
|
13581
13581
|
|
|
13582
|
-
// packages/workit-core/src/core/policy/judgment.ts
|
|
13582
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/policy/judgment.ts
|
|
13583
13583
|
var isObject6 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
13584
13584
|
var squash = (key) => key.toLowerCase().replace(/[_-]/g, "");
|
|
13585
13585
|
var ALIASES = {
|
|
@@ -13703,11 +13703,11 @@ function normalizeJudgment(raw, previous) {
|
|
|
13703
13703
|
return success(null, null, { judgment: parsed.data, ignored, legacy });
|
|
13704
13704
|
}
|
|
13705
13705
|
|
|
13706
|
-
// packages/workit-core/src/autonomy.ts
|
|
13706
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/autonomy.ts
|
|
13707
13707
|
import os3 from "node:os";
|
|
13708
13708
|
import path14 from "node:path";
|
|
13709
13709
|
|
|
13710
|
-
// packages/workit-core/src/core/config.ts
|
|
13710
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/config.ts
|
|
13711
13711
|
import {
|
|
13712
13712
|
copyFileSync as copyFileSync2,
|
|
13713
13713
|
cpSync as cpSync2,
|
|
@@ -13720,7 +13720,7 @@ import {
|
|
|
13720
13720
|
import os2 from "node:os";
|
|
13721
13721
|
import path12 from "node:path";
|
|
13722
13722
|
|
|
13723
|
-
// packages/workit-core/src/core/boundary.ts
|
|
13723
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/boundary.ts
|
|
13724
13724
|
var EVENT = {
|
|
13725
13725
|
initialization: "initialization",
|
|
13726
13726
|
provenance: "provenance",
|
|
@@ -13741,7 +13741,7 @@ var errorDetail = (err) => {
|
|
|
13741
13741
|
return { error_name: "unknown", error: String(err) };
|
|
13742
13742
|
};
|
|
13743
13743
|
|
|
13744
|
-
// packages/workit-core/src/core/config.ts
|
|
13744
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/config.ts
|
|
13745
13745
|
var diagnosticLogger;
|
|
13746
13746
|
var PRESETS = {
|
|
13747
13747
|
gitflow: {
|
|
@@ -13903,7 +13903,7 @@ var resolveCommitPolicy = (config, workspace) => {
|
|
|
13903
13903
|
return config.commitPolicy ?? { preset: "conventional" };
|
|
13904
13904
|
};
|
|
13905
13905
|
|
|
13906
|
-
// packages/workit-core/src/core/workspaces.ts
|
|
13906
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/workspaces.ts
|
|
13907
13907
|
import { createHash as createHash8 } from "node:crypto";
|
|
13908
13908
|
import { readFileSync as readFileSync4, realpathSync as realpathSync3 } from "node:fs";
|
|
13909
13909
|
import path13 from "node:path";
|
|
@@ -14303,7 +14303,7 @@ var resolveRuntimeWorkspacePolicy = (cwd, kind, requestedProfile) => {
|
|
|
14303
14303
|
};
|
|
14304
14304
|
};
|
|
14305
14305
|
|
|
14306
|
-
// packages/workit-core/src/autonomy.ts
|
|
14306
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/autonomy.ts
|
|
14307
14307
|
var accountHome = () => {
|
|
14308
14308
|
try {
|
|
14309
14309
|
return os3.userInfo().homedir;
|
|
@@ -14438,12 +14438,12 @@ function resolveAutonomy(cwd) {
|
|
|
14438
14438
|
var suggested = (kind) => kind === "merge" ? "verified" : "true";
|
|
14439
14439
|
var grantHint = (workspace, kind) => `ask the user to run, in their own terminal: workit grant set ${workspace ?? "<workspace>"} ${kind}=${suggested(kind)}`;
|
|
14440
14440
|
|
|
14441
|
-
// packages/workit-core/src/core/workers.ts
|
|
14441
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/workers.ts
|
|
14442
14442
|
var UNCERTAIN_WORKER_STATES = ["dispatching", "running", "cancelling", "unknown"];
|
|
14443
14443
|
var isUncertainWorker = (state) => UNCERTAIN_WORKER_STATES.includes(state);
|
|
14444
14444
|
var workerBlocksTransition = (transition, state) => transition === "pause" ? false : isUncertainWorker(state);
|
|
14445
14445
|
|
|
14446
|
-
// packages/workit-core/src/core/task-context.ts
|
|
14446
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-context.ts
|
|
14447
14447
|
function reconcileResume(view, observations = []) {
|
|
14448
14448
|
if (observations.length > 0)
|
|
14449
14449
|
return failure2("permission_denied", "worker observations require native host verification");
|
|
@@ -14558,7 +14558,7 @@ var exportDigest = (bundle) => sha256({
|
|
|
14558
14558
|
task: bundle.task
|
|
14559
14559
|
});
|
|
14560
14560
|
|
|
14561
|
-
// packages/workit-core/src/core/task-engine.ts
|
|
14561
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/task-engine.ts
|
|
14562
14562
|
var workspaceVerification = (root) => {
|
|
14563
14563
|
try {
|
|
14564
14564
|
return resolveAutonomy(root).verification;
|
|
@@ -16144,7 +16144,7 @@ class WorkitCore {
|
|
|
16144
16144
|
}
|
|
16145
16145
|
}
|
|
16146
16146
|
|
|
16147
|
-
// packages/workit-core/src/hooks/context.ts
|
|
16147
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/context.ts
|
|
16148
16148
|
var MIGRATION_PENDING_NOTE = "workit migration pending — run `workit task status`";
|
|
16149
16149
|
var migrationPending = (result) => !result.ok && result.code === "needs_input" && (result.error ?? "").startsWith(MIGRATION_PENDING);
|
|
16150
16150
|
var boundTo = (entry, session) => entry.sessions.some((item) => item.host === session.host && item.handle === session.handle);
|
|
@@ -16291,10 +16291,10 @@ var turnContextText = (input, descriptor) => {
|
|
|
16291
16291
|
return null;
|
|
16292
16292
|
}
|
|
16293
16293
|
};
|
|
16294
|
-
// packages/workit-core/src/core/branch.ts
|
|
16294
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/branch.ts
|
|
16295
16295
|
import { createHash as createHash9 } from "node:crypto";
|
|
16296
16296
|
|
|
16297
|
-
// packages/workit-core/src/core/release-tracks.ts
|
|
16297
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/release-tracks.ts
|
|
16298
16298
|
class ReleaseTrackError extends Error {
|
|
16299
16299
|
}
|
|
16300
16300
|
var KNOWN_FIELDS = new Set([
|
|
@@ -16433,7 +16433,7 @@ function workspaceReleaseTracks(cwd) {
|
|
|
16433
16433
|
}
|
|
16434
16434
|
var memo3 = new Map;
|
|
16435
16435
|
|
|
16436
|
-
// packages/workit-core/src/core/branch.ts
|
|
16436
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/branch.ts
|
|
16437
16437
|
var withReleaseTracks = (workspaceRoot, policy) => {
|
|
16438
16438
|
const read = workspaceReleaseTracks(workspaceRoot);
|
|
16439
16439
|
if (read.error)
|
|
@@ -16526,7 +16526,7 @@ var validateBranchNameFor = (workspaceRoot, name) => {
|
|
|
16526
16526
|
}
|
|
16527
16527
|
};
|
|
16528
16528
|
|
|
16529
|
-
// packages/workit-core/src/core/route-intent.ts
|
|
16529
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/core/route-intent.ts
|
|
16530
16530
|
var shellBranchTarget = (command) => {
|
|
16531
16531
|
if (!command.trim() || /[\r\n;&|<>`'"$()\\*?{}~!#]/u.test(command) || command.includes("[") || command.includes("]"))
|
|
16532
16532
|
return null;
|
|
@@ -16542,12 +16542,12 @@ var shellBranchPolicyViolation = (root, command) => {
|
|
|
16542
16542
|
return target === null ? null : validateBranchNameFor(root, target);
|
|
16543
16543
|
};
|
|
16544
16544
|
|
|
16545
|
-
// packages/workit-core/src/hooks/policy.ts
|
|
16545
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/policy.ts
|
|
16546
16546
|
var shellPolicy = (cwd, command) => {
|
|
16547
16547
|
const policy = shellBranchPolicyViolation(cwd, command);
|
|
16548
16548
|
return policy && !policy.ok ? { kind: "deny", reason: `branch_policy_denied: ${policy.error}`, unblock: null } : { kind: "none" };
|
|
16549
16549
|
};
|
|
16550
|
-
// packages/workit-core/src/hooks/write-gate.ts
|
|
16550
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/write-gate.ts
|
|
16551
16551
|
import { realpathSync as realpathSync5 } from "node:fs";
|
|
16552
16552
|
import path16 from "node:path";
|
|
16553
16553
|
var NONE2 = { kind: "none" };
|
|
@@ -16808,7 +16808,7 @@ function writeGate(cwd, paths) {
|
|
|
16808
16808
|
return NONE2;
|
|
16809
16809
|
}
|
|
16810
16810
|
}
|
|
16811
|
-
// packages/workit-core/src/hooks/hosts/fields.ts
|
|
16811
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/hosts/fields.ts
|
|
16812
16812
|
import { existsSync as existsSync6, realpathSync as realpathSync6, statSync as statSync2 } from "node:fs";
|
|
16813
16813
|
import path17 from "node:path";
|
|
16814
16814
|
var isRecord4 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
@@ -16876,7 +16876,7 @@ var writePaths = (input) => {
|
|
|
16876
16876
|
paths.push(match[1].trim());
|
|
16877
16877
|
return [...new Set(paths)];
|
|
16878
16878
|
};
|
|
16879
|
-
// packages/workit-core/src/hooks/handle.ts
|
|
16879
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/handle.ts
|
|
16880
16880
|
var usable2 = (value) => value === "native" || value === "partial";
|
|
16881
16881
|
var NONE3 = { kind: "none" };
|
|
16882
16882
|
var offered = new Set;
|
|
@@ -16972,7 +16972,7 @@ var dispatchHook = (adapter, raw, env = process.env) => {
|
|
|
16972
16972
|
};
|
|
16973
16973
|
}
|
|
16974
16974
|
};
|
|
16975
|
-
// packages/workit-core/src/hooks/hosts/claude-code.ts
|
|
16975
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/hosts/claude-code.ts
|
|
16976
16976
|
var CLAUDE_CODE_DESCRIPTOR = {
|
|
16977
16977
|
host: "claude_code",
|
|
16978
16978
|
label: "Claude Code",
|
|
@@ -17215,7 +17215,7 @@ var claudeCodeAdapter = {
|
|
|
17215
17215
|
render
|
|
17216
17216
|
};
|
|
17217
17217
|
|
|
17218
|
-
// packages/workit-core/src/hooks/hosts/codex.ts
|
|
17218
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/hosts/codex.ts
|
|
17219
17219
|
function detectCodexSurface(env) {
|
|
17220
17220
|
return env.CODEX_INTERNAL_ORIGINATOR_OVERRIDE === "Codex Desktop" || Boolean(env.CODEX_ELECTRON_RESOURCES_PATH) ? "codex_desktop" : "codex_cli";
|
|
17221
17221
|
}
|
|
@@ -17444,7 +17444,7 @@ var codexAdapter = {
|
|
|
17444
17444
|
addendum: (input) => `<workit-codex-mutations>Codex MCP is read-only: unattested callers cannot mutate. Run workit verbs with the workit CLI on the shell (node_modules/.bin/workit, or npx -y @brainervirus/workit-cli): check, git branch|commit|push, pr, ci, stack, ledger, handoff; task-family mutations take --json${input.session.id ? ` --actor ${input.session.id}` : ""}. A verifier or reviewer records workit ledger verdict under a session the lead assigns (WORKIT_SESSION_ID=<lead>-v<n>), never the author's. Merge and release need a workspace grant (workit grant show); a question answer is not host permission.</workit-codex-mutations>`
|
|
17445
17445
|
};
|
|
17446
17446
|
|
|
17447
|
-
// packages/workit-core/src/hooks/hosts/cursor.ts
|
|
17447
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/hosts/cursor.ts
|
|
17448
17448
|
import path18 from "node:path";
|
|
17449
17449
|
var undocumented2 = { support: "undocumented", native: null };
|
|
17450
17450
|
var none = { support: "none", native: null };
|
|
@@ -17688,7 +17688,7 @@ var cursorAdapter = {
|
|
|
17688
17688
|
render: render3
|
|
17689
17689
|
};
|
|
17690
17690
|
|
|
17691
|
-
// packages/workit-core/src/hooks/run.ts
|
|
17691
|
+
// packages/workit-codex/node_modules/@brainervirus/workit-core/src/hooks/run.ts
|
|
17692
17692
|
var HOOK_ADAPTERS = {
|
|
17693
17693
|
claude_code: claudeCodeAdapter,
|
|
17694
17694
|
codex_cli: codexAdapter,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brainervirus/workit-codex",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Workit Codex CLI/desktop plugin — shared MCP transport, hooks, and sixteen method skills",
|
|
6
6
|
"keywords": [
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"build": "bun scripts/build.ts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@brainervirus/workit-core": "^
|
|
42
|
-
"@brainervirus/workit-mcp": "^
|
|
41
|
+
"@brainervirus/workit-core": "^8.0.0",
|
|
42
|
+
"@brainervirus/workit-mcp": "^8.0.0"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
45
|
"node": ">=24"
|
|
@@ -8,60 +8,60 @@ description: Run independent slices in parallel - one worker per isolated worktr
|
|
|
8
8
|
Fan out only independent slices: disjoint files, no shared mutable state, each
|
|
9
9
|
verifiable alone. Code-coupled work stays with one owner, who fans out after
|
|
10
10
|
the blocking part lands. A worker whose whole job is re-running one command is
|
|
11
|
-
ceremony; do it yourself.
|
|
11
|
+
ceremony; do it yourself. Workit never spawns agents; you do.
|
|
12
12
|
|
|
13
13
|
1. **Plan the slices** (read the `workit-shape` skill's SKILL.md and follow it) in a plan file (`references/brief.md`):
|
|
14
|
-
per slice an id, branch, TIER,
|
|
15
|
-
`
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
`workit ledger check --branch <b>` per slice, land in `fanout
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
14
|
+
per slice an id, branch, TIER, SCOPE globs, `owns` for shared files,
|
|
15
|
+
`dependsOn` only for a real dependency, and the brief fields. `workit fanout
|
|
16
|
+
plan <plan.json>` refuses an empty or placeholder brief field (exit 2) and
|
|
17
|
+
two slices that may write one file (exit 3) with a fix; apply it and re-run:
|
|
18
|
+
refuse to spawn while a field is empty or the plan is refused. One PR per
|
|
19
|
+
slice is the default; `"fanIn": "integration"` only when the user wants one
|
|
20
|
+
PR (`references/orchestration.md`).
|
|
21
|
+
2. **Record standing orders** (`workit ledger standing add "<order>"`): every
|
|
22
|
+
user directive all workers share. Directives decay across resumes.
|
|
23
|
+
3. **Brief each worker verbatim** with `workit fanout brief <slice>`: plan
|
|
24
|
+
fields, standing orders, SCRATCH, session id, fan-in rule. Never hand-edit
|
|
25
|
+
it; change the plan or the standing orders and render again.
|
|
26
|
+
4. **Spawn in a rolling window**, in the background, each in its own worktree:
|
|
27
|
+
keep 4-6 in flight and refill from `spawnable` in `workit fanout status` as
|
|
28
|
+
each one finishes. Pick the model from TIER (`references/orchestration.md`).
|
|
29
|
+
Claude Code: the `implementer` agent; elsewhere first `workit fanout
|
|
30
|
+
worktree create <slice>`.
|
|
31
|
+
5. **Judge liveness by side effects only:** `workit fanout status` (head age,
|
|
32
|
+
PR, CI, verdict, landed; STUCK past the TIMEBOX). Stop a stuck worker and
|
|
33
|
+
observe that it exited (a timeout is not proof). Removing a worktree drops
|
|
34
|
+
its uncommitted changes: `workit fanout worktree release <slice>` records
|
|
35
|
+
`git status` in the ledger first and refuses them without `--force`. Never
|
|
36
|
+
two live workers on one branch.
|
|
37
|
+
6. **Retry once, then escalate.** A stuck or failed slice gets one retry with
|
|
38
|
+
a fresh brief (`workit fanout brief <slice> --mode resume`, same branch);
|
|
39
|
+
if that fails too, re-slice it, take it over, or report the gap. Never
|
|
40
|
+
chain resumes. A hard slice may race instead: N attempts, keep the best
|
|
41
|
+
verdict (`references/orchestration.md`).
|
|
42
|
+
7. **Verify by the workspace `verification` setting** (`workit grant show`).
|
|
43
|
+
A report is a pointer, never evidence. `self`: a verifier that wrote none
|
|
44
|
+
of the slices, or you if you wrote none. `independent` or high risk: a
|
|
45
|
+
separate verifier session, never yours (doctrine: the ledger only refuses
|
|
46
|
+
authors). One verifier may take a batch of slices, one verdict per branch
|
|
47
|
+
(`workit ledger verdict <result> --branch <b> --how "<evidence>"`), in a
|
|
48
|
+
session never chosen by the author. A review panel on separate models only at high risk.
|
|
49
|
+
8. **Fan in** with `workit fanout check`: out-of-scope files (any file outside
|
|
50
|
+
it stops the fan-in) and `git merge-tree` conflicts with trunk and between
|
|
51
|
+
siblings. Fix what it names until it exits 0; a merged slice reads as
|
|
52
|
+
landed. Then `workit ledger check --branch <b>` per slice, land in `fanout
|
|
53
|
+
status` order, release the worktrees you made, and `workit ledger standing
|
|
54
|
+
clear`. Only you touch topology: workers never rebase, retarget or merge,
|
|
55
|
+
except the integration-tip merge in integration mode. Then ship
|
|
56
|
+
(read the `workit-ship` skill's SKILL.md and follow it).
|
|
56
57
|
|
|
57
58
|
## Example
|
|
58
59
|
|
|
59
60
|
Bad brief: "Do the API part and add tests." (no scope, no acceptance, no
|
|
60
61
|
verify command, so nobody can tell when it is done)
|
|
61
62
|
|
|
62
|
-
Good brief:
|
|
63
|
-
|
|
64
|
-
`workit check test`; ...).
|
|
63
|
+
Good brief: the output of `workit fanout brief usage-endpoint`
|
|
64
|
+
(`references/brief.md` shows one).
|
|
65
65
|
|
|
66
66
|
## Check
|
|
67
67
|
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
# Worker brief template
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
`workit fanout brief <slice>` renders this brief from the plan, the standing
|
|
4
|
+
orders in force (`workit ledger standing list`) and the slice's scratch dir;
|
|
5
|
+
pass its output verbatim. The template below is what it fills in. Every field
|
|
6
|
+
is required. A brief with an empty field is not spawned. Point to files and
|
|
7
|
+
ledger rows instead of pasting their content. Size the slice so the worker
|
|
8
|
+
finishes it in about 150k tokens of context; split a larger one first.
|
|
6
9
|
|
|
7
10
|
```md
|
|
8
11
|
MODE: <new | resume (a replacement continuing an existing branch)>
|
|
@@ -16,11 +19,12 @@ VERIFY: <exact commands, e.g. `workit check test`, the verify-<app> feature to d
|
|
|
16
19
|
TIER: <mundane | standard | hard: how much model the slice needs>
|
|
17
20
|
TIMEBOX: <wall clock or turn budget; past it without a new commit you will be replaced>
|
|
18
21
|
SCRATCH: <your own temp dir: the one `fanout worktree create` printed, else `mktemp -d`; never a shared path>
|
|
19
|
-
FORBIDDEN: <no edits outside SCOPE; no
|
|
22
|
+
FORBIDDEN: <no edits outside SCOPE; no new dependencies; ...>
|
|
23
|
+
FAN-IN: <one PR per slice: no rebase, retarget, merge or force-push | integration: merge the integration tip before reporting, nothing else>
|
|
20
24
|
REPORT: branch, head SHA, files changed, each VERIFY command with its exit code,
|
|
21
25
|
each ACCEPTANCE line met / not met, rulings you made (`workit ledger ruling`),
|
|
22
26
|
anything out of scope as a follow-up, not a diff.
|
|
23
|
-
STANDING: <the standing orders, verbatim:
|
|
27
|
+
STANDING: <the standing orders, verbatim: `workit ledger standing add` records each one>
|
|
24
28
|
export WORKIT_SESSION_ID=<lead>-w<n> (set by the lead; a verifier brief gets <lead>-v<n>)
|
|
25
29
|
```
|
|
26
30
|
|
|
@@ -40,7 +44,8 @@ VERIFY: `workit check test`; verify-api feature "usage"
|
|
|
40
44
|
TIER: standard
|
|
41
45
|
TIMEBOX: 45 minutes
|
|
42
46
|
SCRATCH: ../app-wt/usage-endpoint/.workit-scratch
|
|
43
|
-
FORBIDDEN: no edits outside SCOPE; no schema migration; no
|
|
47
|
+
FORBIDDEN: no edits outside SCOPE; no schema migration; no new packages
|
|
48
|
+
FAN-IN: one PR per slice. Never rebase, retarget, merge or force-push: the lead owns topology.
|
|
44
49
|
REPORT: as in the template
|
|
45
50
|
STANDING: conventional commits; no comments that restate code; ask nothing, record rulings instead
|
|
46
51
|
```
|
|
@@ -55,7 +60,9 @@ stack); `worktree` defaults to `../<repo>-wt/<id>`. `owns` claims a shared
|
|
|
55
60
|
file another slice's glob also matches. Globs that match no file yet are compared
|
|
56
61
|
through a sample path. Use `/` as the separator; a backslash only escapes
|
|
57
62
|
literal brackets: `"app/\\[id\\]/page.tsx"`. A `timebox` such as `45 minutes`
|
|
58
|
-
is the slice's STUCK threshold in `workit fanout status`.
|
|
63
|
+
is the slice's STUCK threshold in `workit fanout status`. `"fanIn":
|
|
64
|
+
"integration"` (with an integration branch as `trunk`) is the one-PR mode in
|
|
65
|
+
`orchestration.md`; the default `"prs"` lands one PR per slice.
|
|
59
66
|
|
|
60
67
|
```json
|
|
61
68
|
{
|
|
@@ -90,7 +97,7 @@ is the slice's STUCK threshold in `workit fanout status`.
|
|
|
90
97
|
}
|
|
91
98
|
```
|
|
92
99
|
|
|
93
|
-
## Worker rules (
|
|
100
|
+
## Worker rules (`workit fanout brief` appends them as RULES)
|
|
94
101
|
|
|
95
102
|
1. First command. `MODE: new`: `workit git branch <branch> --base <base>` (the
|
|
96
103
|
worktree may start on a name that breaks branch policy). `MODE: resume`:
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Running a fanout
|
|
2
|
+
|
|
3
|
+
How the lead picks models, keeps workers flowing, retries, races, verifies
|
|
4
|
+
and fans in. Workit records and checks; the host's own subagents run the work.
|
|
5
|
+
|
|
6
|
+
## TIER to model
|
|
7
|
+
|
|
8
|
+
TIER is a field of each slice and of its brief. Map it where the host lets you
|
|
9
|
+
pick a model per spawn; nothing in the workspace config routes it.
|
|
10
|
+
|
|
11
|
+
| TIER | Claude Code (`model` on the Agent call) | Hosts without a per-spawn model |
|
|
12
|
+
| --- | --- | --- |
|
|
13
|
+
| scouting (read-only search, not a slice) | `haiku` | host default |
|
|
14
|
+
| mundane | `sonnet` | host default |
|
|
15
|
+
| standard | omit it (inherits yours) | host default |
|
|
16
|
+
| hard | omit it (inherits yours); consider a race | host default |
|
|
17
|
+
|
|
18
|
+
OpenCode takes a subagent's model from its agent config: pick a configured
|
|
19
|
+
agent whose model fits the TIER, else the default. Codex, Cursor and Pi run
|
|
20
|
+
every worker on the host's model, so TIER only sizes the timebox and decides
|
|
21
|
+
whether to race.
|
|
22
|
+
|
|
23
|
+
## Rolling window
|
|
24
|
+
|
|
25
|
+
Keep 4-6 workers in flight on Claude Code; elsewhere as many as the host runs
|
|
26
|
+
in the background, never more than 6. Do not wait for a whole wave: when one
|
|
27
|
+
worker finishes (its notification, or a new head or PR in `workit fanout
|
|
28
|
+
status`), verify it, then spawn the next slice from `spawnable` in the same
|
|
29
|
+
status output. A slice whose dependencies landed, or a stacked child whose
|
|
30
|
+
parent is verified, appears there by itself.
|
|
31
|
+
|
|
32
|
+
## Retry, then escalate
|
|
33
|
+
|
|
34
|
+
A slice is retried when it is STUCK, its worker exits without meeting
|
|
35
|
+
ACCEPTANCE, or its verdict fails. Stop the worker and observe that it exited.
|
|
36
|
+
Release its worktree: `workit fanout worktree release <slice>` (native
|
|
37
|
+
worktrees: record `git -C <wt> status --short` first). Then spawn one fresh
|
|
38
|
+
worker with `workit fanout brief <slice> --mode resume`: same branch, and the
|
|
39
|
+
brief points at its head and its ledger rows (last report, verdicts,
|
|
40
|
+
rulings). If the retry fails too, escalate instead of a third worker:
|
|
41
|
+
re-slice it smaller (`workit fanout plan` again), take it over yourself, or
|
|
42
|
+
report the gap to the user.
|
|
43
|
+
|
|
44
|
+
## Race a hard slice
|
|
45
|
+
|
|
46
|
+
When a hard slice has an uncertain approach and a cheap VERIFY, run 2-3
|
|
47
|
+
attempts at once instead of retrying in series. `workit fanout brief <slice>
|
|
48
|
+
--attempt <n>` gives each attempt its own branch (`<branch>-try<n>`), session
|
|
49
|
+
and scratch dir. Each attempt needs its own worktree: Claude Code's
|
|
50
|
+
`implementer` isolates natively; on other hosts `fanout worktree create` makes
|
|
51
|
+
only the slice's own worktree, so run the attempts one after another there.
|
|
52
|
+
Verify every attempt, keep the one with the best verdict (accepted first,
|
|
53
|
+
then the fewest changed files, then the earliest), point the slice branch at
|
|
54
|
+
it (`git branch <branch> <winner>`), have the verifier record the verdict on
|
|
55
|
+
`<branch>` (same head), and delete the losing attempt branches.
|
|
56
|
+
|
|
57
|
+
## Verification
|
|
58
|
+
|
|
59
|
+
Follow the workspace `verification` setting (`workit grant show`); the
|
|
60
|
+
worker never records a verdict on its own work.
|
|
61
|
+
|
|
62
|
+
- `self` (the default): a verifier that wrote none of the slices records the
|
|
63
|
+
verdicts. A lead that authored none of the slices may record them in its
|
|
64
|
+
own session.
|
|
65
|
+
- `independent`, and any slice at high risk: a separate verifier session
|
|
66
|
+
records them, never the lead's own; at high risk one verifier per slice,
|
|
67
|
+
plus a review panel (below). This is doctrine, not enforced: the ledger
|
|
68
|
+
only tells a branch's authors from everyone else, and a lead that wrote
|
|
69
|
+
none of it counts as independent.
|
|
70
|
+
|
|
71
|
+
Which session id a verdict carries, per host:
|
|
72
|
+
|
|
73
|
+
- Claude Code: subagents inherit your `WORKIT_SESSION_ID`, so the
|
|
74
|
+
SubagentStart hook names each `verifier` and `reviewer` its own session
|
|
75
|
+
(`<lead>:<agent id>`), passed as `--session`; that one wins over any
|
|
76
|
+
`<lead>-v<n>` in a brief. An `implementer` uses the session its brief
|
|
77
|
+
exports for its workit commands.
|
|
78
|
+
- Other hosts: the session the brief sets wins: `export
|
|
79
|
+
WORKIT_SESSION_ID=<lead>-w-<slice>` from `workit fanout brief` for a
|
|
80
|
+
worker, `<lead>-v<n>` (or `--as verifier`) for a verifier you start.
|
|
81
|
+
|
|
82
|
+
A batch verifier takes several slices on one surface in one session: for
|
|
83
|
+
each branch it checks out the head, runs that slice's VERIFY, and records its
|
|
84
|
+
own `workit ledger verdict <result> --branch <b> --how "<evidence>"`. Every
|
|
85
|
+
verdict is keyed to that branch's head SHA; a slice whose head moves after
|
|
86
|
+
it needs a new one. Batch at most what fits one context, about 4 slices.
|
|
87
|
+
|
|
88
|
+
## Review panel (high risk only)
|
|
89
|
+
|
|
90
|
+
At risk=high only, 2-3 fresh reviewers (read the `workit-review` skill's SKILL.md and follow it), each on a model
|
|
91
|
+
other than the author's (Claude Code: a different `model`), each records
|
|
92
|
+
`workit ledger verdict <result> --kind review --branch <b> --how "<findings>"`.
|
|
93
|
+
Land only when every panel verdict passes. Below high risk a panel costs
|
|
94
|
+
more than it finds.
|
|
95
|
+
|
|
96
|
+
## Integration-branch fan-in (one PR)
|
|
97
|
+
|
|
98
|
+
Only when the user wants one PR for the whole fanout:
|
|
99
|
+
|
|
100
|
+
1. Cut the integration branch (`workit git branch <integration> --base
|
|
101
|
+
<trunk>`) and plan with `"fanIn": "integration"` and `--trunk
|
|
102
|
+
<integration>`. Planning refuses integration mode on origin's default
|
|
103
|
+
branch.
|
|
104
|
+
2. Every brief then tells the worker to merge the integration tip into its
|
|
105
|
+
branch before reporting (the fast-forward rule). That merge is the only
|
|
106
|
+
one a worker makes, and only in this mode.
|
|
107
|
+
3. Land each verified slice with `git merge --ff-only <slice-branch>` in the
|
|
108
|
+
integration checkout. Not a fast-forward (the tip moved since the worker
|
|
109
|
+
merged)? Resume the worker to merge again; never a merge commit of your own.
|
|
110
|
+
4. `workit fanout check` gates against the integration branch; a slice whose
|
|
111
|
+
tip is on it reads as landed. When all have landed, ship the integration
|
|
112
|
+
branch as one PR (read the `workit-ship` skill's SKILL.md and follow it).
|
|
113
|
+
|
|
114
|
+
## Stacks
|
|
115
|
+
|
|
116
|
+
For stacked slices (`dependsOn` one parent): `workit stack plan <bottom> …
|
|
117
|
+
<top>` once, then `workit stack sync` and `workit stack land`.
|
|
@@ -51,8 +51,8 @@ the base keeps moving, or after 3 failed fix attempts on the same check.
|
|
|
51
51
|
flake|infra` per head. Real: reproduce with `workit check`, fix the root
|
|
52
52
|
cause, batch fixes into one push.
|
|
53
53
|
6. **Verified.** After the last push a non-author records a verdict
|
|
54
|
-
(read the `workit-review` skill's SKILL.md and follow it). Land only when granted: `workit stack land` (
|
|
55
|
-
|
|
54
|
+
(read the `workit-review` skill's SKILL.md and follow it). Land only when granted: `workit stack land` (verified run
|
|
55
|
+
from the root) or `workit pr merge`; `--unverified --reason` only if user-asked.
|
|
56
56
|
7. **Observe it landed:** `workit verify-delivery pr` or `merge`. After a failed
|
|
57
57
|
verdict or a check red 3+ times, at any endpoint: offer `/wk-retro` in one
|
|
58
58
|
line of the final or stop report; never pause the babysit loop for it.
|