@brainervirus/workit-core 2.1.3 → 2.1.5
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/package.json +2 -2
- package/scripts/analyze-release-scope.ts +3 -3
- package/scripts/doctor-check.ts +1 -2
- package/scripts/sync-release-manifests.ts +4 -4
- package/src/core/authority.ts +8 -8
- package/src/core/auto-approval.ts +6 -6
- package/src/core/branch.ts +4 -4
- package/src/core/config-conversion.ts +1 -1
- package/src/core/config.ts +3 -3
- package/src/core/cutover.ts +6 -6
- package/src/core/doctor.ts +4 -3
- package/src/core/external-action-effects.ts +15 -15
- package/src/core/external-action.ts +16 -19
- package/src/core/host-install.ts +17 -1
- package/src/core/logger.ts +2 -2
- package/src/core/policy-resolver.ts +9 -6
- package/src/core/registration.ts +3 -5
- package/src/core/repo-context.ts +1 -1
- package/src/core/session-context.ts +2 -2
- package/src/core/setup.ts +2 -2
- package/src/core/skill-manifests.ts +1 -1
- package/src/core/support-matrix.ts +1 -1
- package/src/core/task-context.ts +3 -3
- package/src/core/task-contract.ts +8 -8
- package/src/core/task-engine.ts +159 -159
- package/src/core/task-evaluation.ts +3 -3
- package/src/core/task-store.ts +12 -12
- package/src/core/tracker-issues.ts +1 -1
- package/src/core/uninstall.ts +3 -3
- package/src/core/workers.ts +3 -3
- package/src/core/workspaces.ts +4 -6
- package/src/core/youtrack-tools.ts +1 -1
|
@@ -18,7 +18,7 @@ const sessionTaskEntry = (
|
|
|
18
18
|
): TaskIndexEntry | null =>
|
|
19
19
|
entries
|
|
20
20
|
.filter((entry) => entry.status !== "closed" && boundTo(entry, session))
|
|
21
|
-
.
|
|
21
|
+
.toSorted(newestFirst)[0] ?? null;
|
|
22
22
|
|
|
23
23
|
/** Up to `limit` open tasks not bound to `session`, newest first. */
|
|
24
24
|
const unboundOpenTaskEntries = (
|
|
@@ -28,7 +28,7 @@ const unboundOpenTaskEntries = (
|
|
|
28
28
|
): TaskIndexEntry[] =>
|
|
29
29
|
entries
|
|
30
30
|
.filter((entry) => entry.status !== "closed" && !boundTo(entry, session))
|
|
31
|
-
.
|
|
31
|
+
.toSorted(newestFirst)
|
|
32
32
|
.slice(0, limit);
|
|
33
33
|
|
|
34
34
|
/**
|
package/src/core/setup.ts
CHANGED
|
@@ -506,13 +506,13 @@ type ResolvedApply = {
|
|
|
506
506
|
// the same options (defaulting both from env) — tests pass `home` explicitly.
|
|
507
507
|
const resolveSetupPaths = (
|
|
508
508
|
options: ApplySetupOptions,
|
|
509
|
-
|
|
509
|
+
resolvedConfigDir: string,
|
|
510
510
|
): Omit<ResolvedApply, "dev"> => {
|
|
511
511
|
const env = options.env ?? process.env;
|
|
512
512
|
const home = options.home ?? env.HOME ?? os.homedir();
|
|
513
513
|
return {
|
|
514
514
|
home,
|
|
515
|
-
configDir,
|
|
515
|
+
configDir: resolvedConfigDir,
|
|
516
516
|
cwd: options.cwd ?? process.cwd(),
|
|
517
517
|
env,
|
|
518
518
|
opencodeConfig:
|
|
@@ -10,7 +10,7 @@ export const SUPPORT_MATRIX = {
|
|
|
10
10
|
// The object-form dual entry (server() + setup()) only loads from
|
|
11
11
|
// 1.18.29+; the supported floor is 1.18.30 so no host can pass doctor while
|
|
12
12
|
// being unable to load the entry shape.
|
|
13
|
-
opencode: { minimum: "1.18.30", current: "1.18.
|
|
13
|
+
opencode: { minimum: "1.18.30", current: "1.18.34" },
|
|
14
14
|
// Codex is a qualification host, not a runtime dependency: the CLI version
|
|
15
15
|
// below is the one live qualification evidence covers. The doctor warns when
|
|
16
16
|
// an installed CLI drifts ahead so a fresh install never silently outruns
|
package/src/core/task-context.ts
CHANGED
|
@@ -38,7 +38,7 @@ export function reconcileResume(
|
|
|
38
38
|
if (observations.length > 0)
|
|
39
39
|
return failure("permission_denied", "worker observations require native host verification");
|
|
40
40
|
const candidate = captureCandidate(view.workspace.root, view.task.intent.data.scope, []);
|
|
41
|
-
if (!candidate.ok) return candidate
|
|
41
|
+
if (!candidate.ok) return candidate;
|
|
42
42
|
const staleEvidenceIds = evaluateEvidence(view.task, candidate.data)
|
|
43
43
|
.filter((entry) => entry.status === "stale")
|
|
44
44
|
.map((entry) => entry.evidenceId);
|
|
@@ -127,7 +127,7 @@ const compactReference = (ref: Ref): CompactReference => {
|
|
|
127
127
|
export function compactTaskContext(view: TaskView): string {
|
|
128
128
|
const decisions: CompactDecision[] = view.task.decisions
|
|
129
129
|
.slice()
|
|
130
|
-
.
|
|
130
|
+
.toSorted((left, right) => {
|
|
131
131
|
const leftAt = compactTimestamp(left.recordedAt);
|
|
132
132
|
const rightAt = compactTimestamp(right.recordedAt);
|
|
133
133
|
if (leftAt !== rightAt) return leftAt > rightAt ? -1 : 1;
|
|
@@ -162,7 +162,7 @@ export function compactTaskContext(view: TaskView): string {
|
|
|
162
162
|
...view.task.progress.blockers.map((entry) => entry.reason),
|
|
163
163
|
]),
|
|
164
164
|
)
|
|
165
|
-
.
|
|
165
|
+
.toSorted()
|
|
166
166
|
.slice(0, COMPACT_MAX_ITEMS)
|
|
167
167
|
.map((gap) => compactText(gap, COMPACT_TEXT_BYTES)!);
|
|
168
168
|
const context: CompactTaskContext = {
|
|
@@ -1118,7 +1118,7 @@ export function parseOperation(family: OperationFamily, input: unknown): Result<
|
|
|
1118
1118
|
return failure("unsupported_version", "unsupported schema version", { operation: family });
|
|
1119
1119
|
const compiled = compiledOperationSchemas[family].safeParse(input);
|
|
1120
1120
|
const parsed = compiled.success ? operationSchemas[family].safeParse(input) : compiled;
|
|
1121
|
-
if (parsed.success) return success(null, null, parsed.data
|
|
1121
|
+
if (parsed.success) return success(null, null, parsed.data);
|
|
1122
1122
|
const fields = parsed.error.issues.map((issue) => ({
|
|
1123
1123
|
path: issue.code === "unrecognized_keys" ? issue.keys.join(".") : issue.path.join("."),
|
|
1124
1124
|
reason: issue.message,
|
|
@@ -1293,7 +1293,7 @@ function canonical(value: unknown, seen: Set<object>): JsonValue {
|
|
|
1293
1293
|
throw new TypeError("invalid Unicode");
|
|
1294
1294
|
result = Object.fromEntries(
|
|
1295
1295
|
Object.keys(value)
|
|
1296
|
-
.
|
|
1296
|
+
.toSorted()
|
|
1297
1297
|
.map((key) => [key, canonical((value as Record<string, unknown>)[key], seen)]),
|
|
1298
1298
|
);
|
|
1299
1299
|
}
|
|
@@ -1339,13 +1339,13 @@ export function decisionDigest(input: Omit<Decision, "digest"> | Decision): Dige
|
|
|
1339
1339
|
export function candidateDigest(input: Candidate): Digest {
|
|
1340
1340
|
const normalizedScope = {
|
|
1341
1341
|
description: input.scope.description,
|
|
1342
|
-
paths: [...input.scope.paths].
|
|
1343
|
-
exclusions: [...input.scope.exclusions].
|
|
1342
|
+
paths: [...input.scope.paths].toSorted(compareCodeUnits),
|
|
1343
|
+
exclusions: [...input.scope.exclusions].toSorted(compareCodeUnits),
|
|
1344
1344
|
};
|
|
1345
1345
|
return sha256({
|
|
1346
1346
|
scope: normalizedScope,
|
|
1347
1347
|
completeness: input.completeness,
|
|
1348
|
-
files: [...input.files].
|
|
1348
|
+
files: [...input.files].toSorted(
|
|
1349
1349
|
(left, right) =>
|
|
1350
1350
|
compareCodeUnits(left.path, right.path) ||
|
|
1351
1351
|
compareCodeUnits(left.kind, right.kind) ||
|
|
@@ -1354,7 +1354,7 @@ export function candidateDigest(input: Candidate): Digest {
|
|
|
1354
1354
|
),
|
|
1355
1355
|
environment: input.environment
|
|
1356
1356
|
.map(({ name, value }) => ({ name, value }))
|
|
1357
|
-
.
|
|
1357
|
+
.toSorted(
|
|
1358
1358
|
(left, right) =>
|
|
1359
1359
|
compareCodeUnits(left.name, right.name) || compareNullableText(left.value, right.value),
|
|
1360
1360
|
),
|
|
@@ -1372,8 +1372,8 @@ export function requirementId(input: {
|
|
|
1372
1372
|
...input,
|
|
1373
1373
|
scope: {
|
|
1374
1374
|
description: input.scope.description,
|
|
1375
|
-
paths: [...input.scope.paths].
|
|
1376
|
-
exclusions: [...input.scope.exclusions].
|
|
1375
|
+
paths: [...input.scope.paths].toSorted(compareCodeUnits),
|
|
1376
|
+
exclusions: [...input.scope.exclusions].toSorted(compareCodeUnits),
|
|
1377
1377
|
},
|
|
1378
1378
|
});
|
|
1379
1379
|
}
|