@brainervirus/workit-pi 2.9.0 → 4.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/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  [![CI](https://github.com/BrainerVirus/workit/actions/workflows/ci.yml/badge.svg)](https://github.com/BrainerVirus/workit/actions/workflows/ci.yml)
4
4
  [![license: MIT](https://img.shields.io/badge/license-MIT-green.svg)](../../LICENSE)
5
5
 
6
- Workit native extension for Pi (stock 0.85.1 package contract) — eight core-backed operation tools, fourteen method skills, session/compaction continuity, and a coordinator that supervises fresh reviewer/investigator processes plus explicitly scoped implementers.
6
+ Workit native extension for Pi (stock 0.85.1 package contract) — eight core-backed operation tools, sixteen method skills, session/compaction continuity, and a coordinator that supervises fresh reviewer/investigator processes plus explicitly scoped implementers.
7
7
 
8
8
  ## Requirements
9
9
 
package/dist/worker.js CHANGED
@@ -8192,16 +8192,6 @@ var stateOperations = {
8192
8192
  expectedWorkspaceRevision: revision.nullable().optional(),
8193
8193
  bundle: exportBundleSchema,
8194
8194
  authorityRefs: array(refSchema)
8195
- }),
8196
- recover: operation({
8197
- action: literal("recover"),
8198
- taskId: id.optional(),
8199
- expectedWorkspaceRevision: revision.optional(),
8200
- target: _enum(["task", "workspace"]),
8201
- expectedBytes: digest,
8202
- snapshotDigest: digest,
8203
- reason: text,
8204
- authorityRefs: array(refSchema)
8205
8195
  })
8206
8196
  };
8207
8197
  var operationSchemas = {
@@ -8214,10 +8204,17 @@ var operationSchemas = {
8214
8204
  writer: discriminatedUnion("action", Object.values(writerOperations)),
8215
8205
  state: discriminatedUnion("action", Object.values(stateOperations))
8216
8206
  };
8217
- var { recover: _unadvertisedRecover, ...advertisedStateOperations } = stateOperations;
8207
+ var withImplicitTask = (options) => Object.values(options).map((option) => ("taskId" in option.shape) ? option.extend({ taskId: id.optional() }) : option);
8208
+ var advertised = (options) => discriminatedUnion("action", withImplicitTask(options));
8218
8209
  var advertisedOperationSchemas = {
8219
- ...operationSchemas,
8220
- state: discriminatedUnion("action", Object.values(advertisedStateOperations))
8210
+ task: advertised(taskOperations),
8211
+ policy: advertised(policyOperations),
8212
+ evidence: advertised(evidenceOperations),
8213
+ finding: advertised(findingOperations),
8214
+ decision: advertised(decisionOperations),
8215
+ worker: advertised(workerOperations),
8216
+ writer: advertised(writerOperations),
8217
+ state: advertised(stateOperations)
8221
8218
  };
8222
8219
  var compiledOperationSchemas = Object.fromEntries(OPERATION_FAMILIES.map((family) => [family, compile(operationSchemas[family])]));
8223
8220
  var success = (revisionValue, workspaceRevisionValue, data) => ({
@@ -8309,15 +8306,42 @@ var metadataLockSchema = object({
8309
8306
  }).strict();
8310
8307
  var FOREIGN_LOCK_TTL_MS = 10 * 60000;
8311
8308
 
8309
+ // packages/workit-core/src/store/event-log.ts
8310
+ var TRANSIENT_WINDOWS_CODES = new Set(["EPERM", "EACCES", "EBUSY"]);
8311
+
8312
+ // packages/workit-core/src/store/reduce.ts
8313
+ var OPENING_TYPES = new Set([
8314
+ "task.opened",
8315
+ "task.imported",
8316
+ "migrated.from_v2",
8317
+ "task.checkpoint"
8318
+ ]);
8319
+ var KNOWN_TYPES = new Set([
8320
+ ...OPENING_TYPES,
8321
+ "task.bound",
8322
+ "task.noted",
8323
+ "task.revised",
8324
+ "task.judged",
8325
+ "task.paused",
8326
+ "task.resumed",
8327
+ "task.closed",
8328
+ "task.updated",
8329
+ "check.ran",
8330
+ "evidence.recorded",
8331
+ "finding.recorded",
8332
+ "finding.updated",
8333
+ "decision.recorded",
8334
+ "decision.updated",
8335
+ "worker.updated"
8336
+ ]);
8337
+
8338
+ // packages/workit-core/src/store/notes.ts
8339
+ var SLOT = Symbol.for("workit.migrationReporter");
8340
+
8312
8341
  // packages/workit-core/src/core/task-store.ts
8342
+ var AUTO_COMPACT_BYTES = 2 * 1024 * 1024;
8343
+ var TOMBSTONE = Symbol("tombstone");
8313
8344
  var STALE_TEMPORARY_MS = 60 * 60000;
8314
- var processEvidenceSchema = object({
8315
- state: _enum(["stopped", "accounted_for"]),
8316
- pid: number2().int().nonnegative(),
8317
- processStart: string2().nullable(),
8318
- ownerDigest: string2().regex(/^[0-9a-f]{64}$/).nullable()
8319
- }).strict();
8320
- var TRANSIENT_WINDOWS_CODES = new Set(["EPERM", "EACCES", "EBUSY"]);
8321
8345
  var externalActionLockRoots = new AsyncLocalStorage;
8322
8346
  var heldInProcess = new Map;
8323
8347
  // packages/workit-core/src/core/workspaces.ts
@@ -8598,6 +8622,38 @@ var resolverInputSchema = object({
8598
8622
  // packages/workit-core/src/core/task-engine.ts
8599
8623
  var verifiedWorkers = new WeakMap;
8600
8624
  var dispatchReservations = new WeakMap;
8625
+ var TASK_SCOPED_ACTIONS = new Set([
8626
+ "task.inspect",
8627
+ "task.revise",
8628
+ "task.progress",
8629
+ "task.pause",
8630
+ "task.resume",
8631
+ "task.close",
8632
+ "policy.assess",
8633
+ "policy.preview",
8634
+ "policy.explain",
8635
+ "evidence.record",
8636
+ "finding.record",
8637
+ "finding.resolve",
8638
+ "decision.record",
8639
+ "decision.revoke",
8640
+ "worker.assign",
8641
+ "worker.report",
8642
+ "worker.cancel",
8643
+ "writer.acquire",
8644
+ "writer.release",
8645
+ "state.export"
8646
+ ]);
8647
+ var CREATING_ACTIONS = new Set([
8648
+ "task.revise",
8649
+ "task.progress",
8650
+ "policy.assess",
8651
+ "evidence.record",
8652
+ "finding.record",
8653
+ "decision.record",
8654
+ "worker.assign",
8655
+ "writer.acquire"
8656
+ ]);
8601
8657
  var retryPause = new Int32Array(new SharedArrayBuffer(4));
8602
8658
  // packages/workit-pi/src/worker-protocol.ts
8603
8659
  var MAX_WORKER_LINE_BYTES = 64 * 1024;