@gitroll/tacitt-cli 0.2.0 → 0.3.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.
Files changed (42) hide show
  1. package/dist/{agent-setup-B8DAiQ6Z.mjs → agent-setup-CLXdKr2I.mjs} +1 -1
  2. package/dist/agent-setup-worker.mjs +4 -4
  3. package/dist/cli.mjs +65 -8
  4. package/dist/codex-title-worker.mjs +1 -1
  5. package/dist/configured-preview-worker.mjs +4 -4
  6. package/dist/configured-session-worker.mjs +25 -4
  7. package/dist/{heap-BHcvxWCw.mjs → heap-eO_uWpD1.mjs} +45 -3
  8. package/dist/inspection-worker.mjs +3 -3
  9. package/dist/job-rK-Ho9OD.mjs +613 -0
  10. package/dist/{model-BJdTLNjT.mjs → model-BBAnsFAx.mjs} +1 -1
  11. package/dist/operation-executor.mjs +2 -2
  12. package/dist/preview-worker.mjs +1 -1
  13. package/dist/{query-BA0XCwnR.mjs → query-DN99jiRc.mjs} +273 -551
  14. package/dist/{run-BeLHsZWb.mjs → run-4G_CvdDj.mjs} +2 -2
  15. package/dist/session-process.mjs +6 -1
  16. package/dist/{src-CC95LYYp.mjs → src-B4R5XMEP.mjs} +370 -176
  17. package/dist/{src-k0Ya1Bri.mjs → src-CPbdnGrk.mjs} +118 -47
  18. package/dist/{src-B5SArpVY.mjs → src-qoLRvX-A.mjs} +17 -5
  19. package/dist/store-database-worker.mjs +1 -1
  20. package/dist/web/assets/index-BkuUI3Eu.js +67 -0
  21. package/dist/web/assets/index-Clg6Pfv_.css +1 -0
  22. package/dist/web/index.html +2 -2
  23. package/package.json +1 -1
  24. package/skills/tacitt/SKILL.md +8 -6
  25. package/skills/tacitt/references/commands.md +14 -9
  26. package/skills/tacitt/references/journey.md +10 -6
  27. package/skills/tacitt/references/send.md +1 -1
  28. package/skills/tacitt/scripts/INDEX.md +6 -2
  29. package/skills/tacitt/scripts/journey-card-consolidation.mjs +90 -4
  30. package/skills/tacitt/scripts/journey-card-values.d.mts +17 -0
  31. package/skills/tacitt/scripts/journey-card-values.mjs +116 -0
  32. package/skills/tacitt/scripts/journey-classification.mjs +6 -2
  33. package/skills/tacitt/scripts/journey-panel-host.d.mts +9 -0
  34. package/skills/tacitt/scripts/journey-panel-host.mjs +56 -0
  35. package/skills/tacitt/scripts/journey-state.mjs +10 -4
  36. package/skills/tacitt/scripts/journey-tasks.mjs +1 -1
  37. package/skills/tacitt/scripts/journey.d.mts +2 -0
  38. package/skills/tacitt/scripts/journey.mjs +120 -53
  39. package/skills/tacitt/scripts/review-stream-client.mjs +1 -1
  40. package/dist/job-J3NFw3MH.mjs +0 -194
  41. package/dist/web/assets/index-Bjos73wK.js +0 -67
  42. package/dist/web/assets/index-Bl4C2b2_.css +0 -1
@@ -1,6 +1,6 @@
1
1
  import { Bn as validatePlan, Cn as sessionNonce, Dn as entityDictionaryVersion, En as cleanupImplementationVersion, Fn as frameRecords, Gn as detectStatic, H as codePointLength, Hn as defaultLimits, Ht as ApplicationError, In as retainedMainTextNodes, Jn as jsonSpans, Jt as reviewFamilies, Ln as validateProfile, Nn as nativeText, On as nativeParserVersion, Pn as transformRecords, Qt as sourceSnapshotId, Sn as createReplacementKey, Tn as parseNativeRecord, Un as recordPointerLimits, V as bDigest, Wn as resolveLimits, Wt as safeCode, Xn as createEntityMatcher, Xt as sourceKey, Yn as agentContextLocation, an as withMandatoryCustomTerms, c as textDigest, cn as mainReviewRole, dn as renderNative, fn as createSessionPreparation, gn as createDetectionSummary, in as nativeSourceIdentitySchema, ir as isProcessingCode, j as bDuplicateShift, jn as nativeField, k as bBindingCap, kn as redactionImplementationVersion, ln as reviewRoles, nr as ProcessingError, o as reviewDigest, on as processNativeRecord, pn as bindInspection, qt as familySelected, rr as fail$1, sn as projectNativeReviewInput, tr as defaultDetectionLimits, un as createSentenceContext, vn as walkNativeFields, wn as projectNativeRecord, x as createBAnalysisUnits, zn as buildPlan } from "./locate-U3-nkird.mjs";
2
2
  import { t as createZstdFrameCheck } from "./frame-waS5FnN5.mjs";
3
- import { $r as sourceChangePolicy, It as metadataProcessingVersion, L as sourceIdentityEvidence, Ln as bWordBounded, Nn as bContainment, Pn as bExceptionRanges, R as withSourceEvidence, oi as staticCatalogRef, ot as classifyAgentSetup, pr as resolveSourceSelection, st as defaultAgentSetupInclusion, ti as approvedTreatmentSchema, z as agentSetupKey } from "./src-CC95LYYp.mjs";
3
+ import { Bn as bWordBounded, F as withSourceEvidence, I as agentSetupKey, In as bContainment, Ln as bExceptionRanges, Nt as metadataProcessingVersion, P as sourceIdentityEvidence, gr as resolveSourceSelection, ii as approvedTreatmentSchema, it as defaultAgentSetupInclusion, li as staticCatalogRef, ni as sourceChangePolicy, rt as classifyAgentSetup } from "./src-B4R5XMEP.mjs";
4
4
  import { constants } from "node:fs";
5
5
  import { link, lstat, mkdir, open, readFile, readdir, realpath, rm, rmdir, stat, unlink } from "node:fs/promises";
6
6
  import { execFile, fork, spawn } from "node:child_process";
@@ -678,10 +678,16 @@ const chooseFinal = async (directory, start = 0) => {
678
678
  }
679
679
  return fail("ARTIFACT_LIMIT");
680
680
  };
681
- const createTemporary = async (options) => {
681
+ /**
682
+ * `onPath` receives the temporary path before the file exists, so an owner that stops this
683
+ * process mid-call can remove it. On Windows the privacy checks after creation take ACL helper
684
+ * round trips, so a name reported only afterwards could leave an unreported file.
685
+ */
686
+ const createTemporary = async (options, onPath) => {
682
687
  const directory = await outputDirectory(options);
683
688
  const finalPath = await chooseFinal(directory);
684
689
  const tempPath = join(directory, `.sess-pilot-${randomUUID()}.part`);
690
+ onPath?.(tempPath);
685
691
  const handle = await openPrivateFile(tempPath, constants.O_CREAT | constants.O_EXCL | constants.O_RDWR | constants.O_NOFOLLOW, 384);
686
692
  try {
687
693
  const value = await handle.stat({ bigint: true });
@@ -729,6 +735,13 @@ const removeSpools = async (directory, temporary) => {
729
735
  else if (!name.endsWith(".parallel") && value.isFile()) await unlink(path);
730
736
  }
731
737
  };
738
+ /**
739
+ * Removes the `<temp>.<uuid>.<kind>` spools beside each temporary file a stopped packaging child
740
+ * named (ADR 0228); the child's own cleanup never ran. Other named files are left to their owner.
741
+ */
742
+ const removeNamedTemporarySpools = async (paths) => {
743
+ for (const path of paths) if (/\.sess-pilot-[a-f0-9-]{36}\.part$/.test(basename(path))) await removeSpools(dirname(path), { tempPath: path });
744
+ };
732
745
  //#endregion
733
746
  //#region packages/artifact/src/file/reader.ts
734
747
  var FileReader = class extends Reader {
@@ -3294,6 +3307,7 @@ async function createSessionArchiveSpool(temporary, signal, options = {}) {
3294
3307
  checkAbort(signal);
3295
3308
  const path = options.directory === void 0 ? `${temporary.tempPath}.${randomUUID()}.session` : `${options.directory}/${randomUUID()}.session`;
3296
3309
  let handle;
3310
+ if (options.keepPath === true) options.onPath?.(path);
3297
3311
  try {
3298
3312
  handle = await (options.directory === void 0 ? openPrivateFile : open)(path, constants.O_CREAT | constants.O_EXCL | constants.O_RDWR | constants.O_NOFOLLOW, 384);
3299
3313
  if (options.keepPath !== true) await unlink(path);
@@ -8996,17 +9010,16 @@ async function privateJourneyDirectory(path) {
8996
9010
  //#region packages/artifact/src/configured/journey/output.ts
8997
9011
  /**
8998
9012
  * The same checked private publication used for bases, with a fresh immutable output ID.
8999
- * `onPath` names each file this call may leave behind: a temporary file once created, a published
9000
- * one before it is linked, so a packaging worker's owner can remove them when it stops the worker
9001
- * mid-write (ADR 0181).
9013
+ * `onPath` names each file this call may leave behind: a temporary file before it is created, a
9014
+ * published one before it is linked, so a packaging worker's owner can remove them when it stops
9015
+ * the worker mid-write (ADR 0181).
9002
9016
  */
9003
9017
  async function writeLogicalJourneyOutput(request, signal, onPath) {
9004
9018
  const directory = await privateJourneyDirectory(request.directory);
9005
9019
  const primary = await createTemporary({
9006
9020
  outputDir: directory,
9007
9021
  keepTemp: false
9008
- });
9009
- onPath?.(primary.temporary.tempPath);
9022
+ }, onPath);
9010
9023
  let companion;
9011
9024
  let masks;
9012
9025
  const cleanup = createCleanup(), linked = [];
@@ -9016,15 +9029,11 @@ async function writeLogicalJourneyOutput(request, signal, onPath) {
9016
9029
  companion = await createTemporary({
9017
9030
  outputDir: directory,
9018
9031
  keepTemp: false
9019
- });
9020
- onPath?.(companion.temporary.tempPath);
9021
- if (request.maskEvidence) {
9022
- masks = await createTemporary({
9023
- outputDir: directory,
9024
- keepTemp: false
9025
- });
9026
- onPath?.(masks.temporary.tempPath);
9027
- }
9032
+ }, onPath);
9033
+ if (request.maskEvidence) masks = await createTemporary({
9034
+ outputDir: directory,
9035
+ keepTemp: false
9036
+ }, onPath);
9028
9037
  const written = await rewriteConfiguredOutput({
9029
9038
  ...request,
9030
9039
  bundleId,
@@ -9300,6 +9309,14 @@ function isResult(value) {
9300
9309
  };
9301
9310
  return file("primary") && file("ledger") && typeof pieces === "object" && pieces !== null && Array.isArray(Reflect.get(pieces, "entries")) && Array.isArray(Reflect.get(pieces, "maskEntries")) && Array.isArray(Reflect.get(value, "tokens")) && typeof Reflect.get(value, "tokensComplete") === "boolean";
9302
9311
  }
9312
+ if (Reflect.get(value, "kind") === "journey-base") {
9313
+ const base = Reflect.get(value, "base");
9314
+ const file = (key) => {
9315
+ const item = typeof base === "object" && base !== null ? Reflect.get(base, key) : void 0;
9316
+ return typeof item === "object" && item !== null && typeof Reflect.get(item, "path") === "string";
9317
+ };
9318
+ return typeof base === "object" && base !== null && Reflect.get(base, "kind") === "base" && typeof Reflect.get(base, "bundleId") === "string" && file("primary") && file("companion") && file("maskLedger") && Array.isArray(Reflect.get(base, "sessions")) && Array.isArray(Reflect.get(base, "sourceBindings"));
9319
+ }
9303
9320
  if (Reflect.get(value, "kind") === "journey-output") {
9304
9321
  const output = Reflect.get(value, "output");
9305
9322
  return typeof output === "object" && output !== null && typeof Reflect.get(output, "bundleId") === "string" && typeof Reflect.get(output, "primary") === "object" && typeof Reflect.get(output, "companion") === "object" && Array.isArray(Reflect.get(value, "tokens")) && typeof Reflect.get(value, "tokensComplete") === "boolean";
@@ -9320,6 +9337,8 @@ function isWorkerMessage(value) {
9320
9337
  if (kind === "worker-error") return code === "ARTIFACT_WORKER_MEMORY" || code === "ARTIFACT_PROCESSING_FAILED";
9321
9338
  return kind === "error" && typeof code === "string" && code.length > 0 && (sourceId === void 0 || typeof sourceId === "string");
9322
9339
  }
9340
+ /** How long a stopped controller may take to end its Worker and flush its messages (ADR 0219). */
9341
+ const stopGraceMs = 2e3;
9323
9342
  /** One active request per process; IPC backpressure never causes a resend or another queue. */
9324
9343
  function createSessionProcess(workerUrl, heapMb, onMessage, onFailure) {
9325
9344
  const options = {
@@ -9354,7 +9373,7 @@ function createSessionProcess(workerUrl, heapMb, onMessage, onFailure) {
9354
9373
  closed.then(() => onFailure(memoryFailure ? "ARTIFACT_WORKER_MEMORY" : "ARTIFACT_PROCESSING_FAILED"));
9355
9374
  };
9356
9375
  child.on("message", (message) => {
9357
- if (!closing) onMessage(message);
9376
+ if (!closing || Reflect.get(Object(message), "kind") === "spool") onMessage(message);
9358
9377
  });
9359
9378
  child.on("error", fail);
9360
9379
  child.on("disconnect", fail);
@@ -9376,7 +9395,20 @@ function createSessionProcess(workerUrl, heapMb, onMessage, onFailure) {
9376
9395
  async close() {
9377
9396
  if (!closing) {
9378
9397
  closing = true;
9379
- if (child.exitCode === null && child.signalCode === null) child.kill("SIGKILL");
9398
+ if (child.exitCode === null && child.signalCode === null) {
9399
+ const kill = () => {
9400
+ if (child.exitCode === null && child.signalCode === null) child.kill("SIGKILL");
9401
+ };
9402
+ const timer = setTimeout(kill, stopGraceMs);
9403
+ try {
9404
+ if (child.connected) child.send({ kind: "stop" }, (error) => error && kill());
9405
+ else kill();
9406
+ } catch {
9407
+ kill();
9408
+ }
9409
+ await closed;
9410
+ clearTimeout(timer);
9411
+ }
9380
9412
  }
9381
9413
  await closed;
9382
9414
  }
@@ -9411,6 +9443,34 @@ function sessionWorkerFailure(error) {
9411
9443
  function requestKind(task) {
9412
9444
  return typeof task.message === "object" && task.message !== null ? Reflect.get(task.message, "kind") : void 0;
9413
9445
  }
9446
+ /**
9447
+ * Files one job may name: a journey output its three final files and three temporary files
9448
+ * (ADR 0181), an output shard its two archives and a shard readback none (ADR 0199).
9449
+ */
9450
+ /**
9451
+ * A journey output or base names its three final files and three temporary files (ADR 0181,
9452
+ * ADR 0228); an output shard its two archives and a shard readback none (ADR 0199).
9453
+ */
9454
+ function spoolLimit(task) {
9455
+ const kind = requestKind(task);
9456
+ return kind === "journey-output" || kind === "journey-base" ? 6 : kind === "journey-output-shard" ? 2 : kind === "journey-output-verify" ? 0 : 4;
9457
+ }
9458
+ const factsName = /^(.+)\.[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\.facts$/;
9459
+ /**
9460
+ * Best-effort removal of a stopped job's files: its named spools and the facts files created
9461
+ * beside them (`<spool>.<uuid>.facts`), which are unlinked once open but can keep their name
9462
+ * when the process stops in between; on Windows that spans two ACL helper round trips.
9463
+ */
9464
+ async function removeStoppedSpools(paths) {
9465
+ for (const [directory, spools] of Map.groupBy(paths, (path) => dirname(path))) {
9466
+ for (const path of spools) await unlink(path).catch(() => {});
9467
+ const names = new Set(spools.map((path) => basename(path)));
9468
+ for (const entry of await readdir(directory).catch(() => [])) {
9469
+ const spool = factsName.exec(entry)?.[1];
9470
+ if (spool !== void 0 && names.has(spool)) await unlink(join(directory, entry)).catch(() => {});
9471
+ }
9472
+ }
9473
+ }
9414
9474
  /** Best-effort removal of a worker spool that no longer has an owner. */
9415
9475
  function removeSpool(path) {
9416
9476
  if (path === void 0) return;
@@ -9484,7 +9544,7 @@ function createSessionWorkerPool(url, size, heapMb = workerHeapMb) {
9484
9544
  stopping = Promise.all(slots.map(async (slot) => {
9485
9545
  try {
9486
9546
  await slot.process.close();
9487
- for (const path of slot.task?.spoolPaths ?? []) await unlink(path).catch(() => {});
9547
+ if (slot.task) await removeStoppedSpools(slot.task.spoolPaths);
9488
9548
  } finally {
9489
9549
  slot.task?.reject(blame(slot));
9490
9550
  slot.task = void 0;
@@ -9499,8 +9559,11 @@ function createSessionWorkerPool(url, size, heapMb = workerHeapMb) {
9499
9559
  };
9500
9560
  const onAbort = () => stop(/* @__PURE__ */ new Error("ARTIFACT_ABORTED"));
9501
9561
  const receive = (slot, message) => {
9502
- if (closed) return;
9503
9562
  const task = slot.task;
9563
+ if (closed) {
9564
+ if (task && isWorkerMessage(message) && message.kind === "spool" && (task.spoolPaths.has(message.path) || task.spoolPaths.size < spoolLimit(task))) task.spoolPaths.add(message.path);
9565
+ return;
9566
+ }
9504
9567
  if (!isWorkerMessage(message)) {
9505
9568
  failPool(/* @__PURE__ */ new Error("ARTIFACT_PROCESSING_FAILED"), slot);
9506
9569
  return;
@@ -9516,9 +9579,7 @@ function createSessionWorkerPool(url, size, heapMb = workerHeapMb) {
9516
9579
  try {
9517
9580
  if (message.kind === "source") task.onSourceProgress?.(message.bytes);
9518
9581
  else if (message.kind === "spool") {
9519
- const kind = requestKind(task);
9520
- const spoolLimit = kind === "journey-output" ? 6 : kind === "journey-output-shard" ? 2 : kind === "journey-output-verify" ? 0 : 4;
9521
- if (!task.spoolPaths.has(message.path) && task.spoolPaths.size >= spoolLimit) {
9582
+ if (!task.spoolPaths.has(message.path) && task.spoolPaths.size >= spoolLimit(task)) {
9522
9583
  failPool(/* @__PURE__ */ new Error("ARTIFACT_PROCESSING_FAILED"), slot);
9523
9584
  return;
9524
9585
  }
@@ -9526,7 +9587,7 @@ function createSessionWorkerPool(url, size, heapMb = workerHeapMb) {
9526
9587
  task.onSpool?.(message.path);
9527
9588
  } else if (message.kind === "result") {
9528
9589
  const requestedKind = requestKind(task);
9529
- if ((requestedKind === "render" || requestedKind === "capture" || requestedKind === "scan" || requestedKind === "journey-output" || requestedKind === "journey-output-shard" || requestedKind === "journey-output-verify") && message.result.kind !== requestedKind) {
9590
+ if ((requestedKind === "render" || requestedKind === "capture" || requestedKind === "scan" || requestedKind === "journey-output" || requestedKind === "journey-output-shard" || requestedKind === "journey-output-verify" || requestedKind === "journey-base") && message.result.kind !== requestedKind) {
9530
9591
  failPool(/* @__PURE__ */ new Error("ARTIFACT_PROCESSING_FAILED"), slot);
9531
9592
  return;
9532
9593
  }
@@ -9542,6 +9603,15 @@ function createSessionWorkerPool(url, size, heapMb = workerHeapMb) {
9542
9603
  settle(slot, void 0, message.result);
9543
9604
  return;
9544
9605
  }
9606
+ if (message.result.kind === "journey-base") {
9607
+ const { primary, companion, maskLedger } = message.result.base;
9608
+ if (!task.spoolPaths.has(primary.path) || !task.spoolPaths.has(companion.path) || !task.spoolPaths.has(maskLedger.path)) {
9609
+ failPool(/* @__PURE__ */ new Error("ARTIFACT_PROCESSING_FAILED"), slot);
9610
+ return;
9611
+ }
9612
+ settle(slot, void 0, message.result);
9613
+ return;
9614
+ }
9545
9615
  if (message.result.kind === "journey-output") {
9546
9616
  if (!task.spoolPaths.has(message.result.output.primary.path) || !task.spoolPaths.has(message.result.output.companion.path)) {
9547
9617
  failPool(/* @__PURE__ */ new Error("ARTIFACT_PROCESSING_FAILED"), slot);
@@ -10949,25 +11019,18 @@ async function runConfiguredSessionJob(job, processing, signal, onSourceProgress
10949
11019
  let processingMs = 0;
10950
11020
  const spoolOptions = {
10951
11021
  keepPath: true,
11022
+ ...onSpool === void 0 ? {} : { onPath: onSpool },
10952
11023
  ...job.spoolDirectory === void 0 ? {} : { directory: job.spoolDirectory }
10953
11024
  };
10954
11025
  const spool = await createSessionArchiveSpool(job.temporary, signal, spoolOptions);
10955
- onSpool?.(spool.path);
10956
11026
  let companion;
10957
11027
  let maskSpool;
10958
11028
  let reviewSpool;
10959
11029
  let session;
10960
11030
  try {
10961
11031
  companion = await createSessionArchiveSpool(job.temporary, signal, spoolOptions);
10962
- onSpool?.(companion.path);
10963
- if (job.captureMasks) {
10964
- maskSpool = await createSessionArchiveSpool(job.temporary, signal, spoolOptions);
10965
- onSpool?.(maskSpool.path);
10966
- }
10967
- if (job.captureReview) {
10968
- reviewSpool = await createSessionArchiveSpool(job.temporary, signal, spoolOptions);
10969
- onSpool?.(reviewSpool.path);
10970
- }
11032
+ if (job.captureMasks) maskSpool = await createSessionArchiveSpool(job.temporary, signal, spoolOptions);
11033
+ if (job.captureReview) reviewSpool = await createSessionArchiveSpool(job.temporary, signal, spoolOptions);
10971
11034
  const readPass = /* @__PURE__ */ new Map();
10972
11035
  const captures = new Map((job.captures ?? []).map((capture) => [capture.partId, capture]));
10973
11036
  session = await prepareConfiguredSession({
@@ -14683,13 +14746,18 @@ async function writePrivateReviewPayload(request, signal) {
14683
14746
  }
14684
14747
  //#endregion
14685
14748
  //#region packages/artifact/src/configured/journey/base.ts
14686
- /** Publish an immutable, private base pair for review/resume without a public collection index. */
14687
- async function writeLogicalJourneyBase(request, hooks) {
14749
+ /**
14750
+ * Publish an immutable, private base pair for review/resume without a public collection index.
14751
+ * `onPath` names each file this call may leave behind: a temporary file before it is created, a
14752
+ * published one before it is linked, so a packaging worker's owner can remove them when it stops
14753
+ * the worker mid-write (ADR 0228). Session spools live under `<temporary>.<uuid>.parallel`.
14754
+ */
14755
+ async function writeLogicalJourneyBase(request, hooks, onPath) {
14688
14756
  const directory = await privateJourneyDirectory(request.directory);
14689
14757
  const primary = await createTemporary({
14690
14758
  outputDir: directory,
14691
14759
  keepTemp: false
14692
- });
14760
+ }, onPath);
14693
14761
  const cleanup = createCleanup();
14694
14762
  let companion;
14695
14763
  let masks;
@@ -14710,15 +14778,15 @@ async function writeLogicalJourneyBase(request, hooks) {
14710
14778
  companion = await createTemporary({
14711
14779
  outputDir: directory,
14712
14780
  keepTemp: false
14713
- });
14781
+ }, onPath);
14714
14782
  masks = await createTemporary({
14715
14783
  outputDir: directory,
14716
14784
  keepTemp: false
14717
- });
14785
+ }, onPath);
14718
14786
  if (request.captureReview) review = await createTemporary({
14719
14787
  outputDir: directory,
14720
14788
  keepTemp: false
14721
- });
14789
+ }, onPath);
14722
14790
  const written = await writeLogicalWorkBundle({
14723
14791
  production: request.production,
14724
14792
  work: request.work,
@@ -14734,15 +14802,19 @@ async function writeLogicalJourneyBase(request, hooks) {
14734
14802
  const primaryPath = join(directory, `${bundleId}.primary.zip`);
14735
14803
  const companionPath = join(directory, `${bundleId}.companion.zip`);
14736
14804
  const maskPath = join(directory, `${bundleId}.private-masks.zip`);
14805
+ onPath?.(primaryPath);
14737
14806
  await link(primary.temporary.tempPath, primaryPath);
14738
14807
  linked.push(primaryPath);
14808
+ onPath?.(companionPath);
14739
14809
  await link(companion.temporary.tempPath, companionPath);
14740
14810
  linked.push(companionPath);
14811
+ onPath?.(maskPath);
14741
14812
  await link(masks.temporary.tempPath, maskPath);
14742
14813
  linked.push(maskPath);
14743
14814
  if (!identityMatches(await lstat(primaryPath, { bigint: true }), primary.temporary.identity) || !identityMatches(await lstat(companionPath, { bigint: true }), companion.temporary.identity) || !identityMatches(await lstat(maskPath, { bigint: true }), masks.temporary.identity)) fail("ARTIFACT_IDENTITY_MISMATCH");
14744
14815
  const reviewPath = join(directory, `${bundleId}.private-review.zip`);
14745
14816
  if (review) {
14817
+ onPath?.(reviewPath);
14746
14818
  await link(review.temporary.tempPath, reviewPath);
14747
14819
  linked.push(reviewPath);
14748
14820
  if (!identityMatches(await lstat(reviewPath, { bigint: true }), review.temporary.identity)) fail("ARTIFACT_IDENTITY_MISMATCH");
@@ -15093,16 +15165,14 @@ async function writeOutputShard(request, signal, onPath) {
15093
15165
  const output = await createTemporary({
15094
15166
  outputDir: directory,
15095
15167
  keepTemp: false
15096
- });
15097
- onPath?.(output.temporary.tempPath);
15168
+ }, onPath);
15098
15169
  created.push(output.temporary.tempPath);
15099
15170
  handles.push(output.handle);
15100
15171
  sink = fileWriter(output.handle, signal);
15101
15172
  const ledger = await createTemporary({
15102
15173
  outputDir: directory,
15103
15174
  keepTemp: false
15104
- });
15105
- onPath?.(ledger.temporary.tempPath);
15175
+ }, onPath);
15106
15176
  created.push(ledger.temporary.tempPath);
15107
15177
  handles.push(ledger.handle);
15108
15178
  masks = await createFinalMaskWriter({
@@ -15185,11 +15255,12 @@ function protectedRanges(field, host, ranges) {
15185
15255
  */
15186
15256
  async function runConfiguredScanJob(job, processing, signal, onSourceProgress, onSpool) {
15187
15257
  const directory = await privateJourneyDirectory(job.directory);
15188
- const fields = await openRowFile(join(directory, `${randomUUID()}.scan.jsonl`), signal);
15258
+ const fieldsPath = join(directory, `${randomUUID()}.scan.jsonl`);
15259
+ onSpool?.(fieldsPath);
15260
+ const fields = await openRowFile(fieldsPath, signal);
15189
15261
  const cleanup = createCleanup();
15190
15262
  let success = false;
15191
15263
  try {
15192
- onSpool?.(fields.path);
15193
15264
  const captures = new Map(job.captures.map((capture) => [capture.partId, capture]));
15194
15265
  if (captures.size !== job.captures.length || job.sources.some((source) => !captures.has(source.source.id))) fail("ARTIFACT_SOURCE_CHANGED");
15195
15266
  if (job.sources.length === 0 || job.sources.length > 1e4) fail("ARTIFACT_EMPTY_SCOPE");
@@ -16419,4 +16490,4 @@ async function verifyPreparedSessionSources(prepared, input, signal) {
16419
16490
  }
16420
16491
  }
16421
16492
  //#endregion
16422
- export { exclusiveLock as $, runConfiguredSessionJob as A, writeLogicalJourneyOutput as B, readConfiguredSearchFields as C, captureLogicalJourneySources as D, prepareCollectionProduction as E, sessionWorkerFailure as F, staticMaskCategory as G, readLogicalJourneyFinalMasks as H, privateCollectionDirectory as I, createConfiguredPreviewStream as J, readWorkspacePair as K, defaultParallelism as L, parseCollectionWorkspaceSummary as M, createSharedSessionPool as N, capturedJourneyScope as O, SessionWorkerError as P, safeError as Q, gitSeedsProvider as R, readOriginalSearchFields as S, checkReusableBundle as T, readConfiguredOutputInfo as U, privateJourneyDirectory as V, processJourneyMetadataFields as W, createTemporary as X, createInspectionProcessor as Y, createCleanup as Z, readStaticSessionMasks as _, scanReviewFields as a, windowsAclCodes as at, writePrivateReviewPayload as b, readSessionScanRecords as c, verifyOutputShard as d, makePrivateDirectory as et, writeOutputShard as f, processJourneyMetadata as g, readCapturedOriginalRows as h, buildWorkScanBatches as i, isWindowsAclFailure as it, readCollectionIndex as j, renderJobDigest as k, scanPreparedSession as l, captureConfiguredSessionJob as m, verifyPreparedSessionSources as n, restrictToOwner as nt, createWorkPieces as o, openConfiguredUpload as p, listAgentSetup as q, prepareSessionScans as r, windowsOwnerOnly as rt, readSessionScanFields as s, preparedScanConfiguration as t, openPrivateFile as tt, runConfiguredScanJob as u, staticSessionJobs as v, createCollectionArtifacts as w, readPrivateReviewPayload as x, writeLogicalJourneyBase as y, parallelismLimits as z };
16493
+ export { safeError as $, runConfiguredSessionJob as A, writeLogicalJourneyOutput as B, readConfiguredSearchFields as C, captureLogicalJourneySources as D, prepareCollectionProduction as E, sessionWorkerFailure as F, staticMaskCategory as G, readLogicalJourneyFinalMasks as H, privateCollectionDirectory as I, createConfiguredPreviewStream as J, readWorkspacePair as K, defaultParallelism as L, parseCollectionWorkspaceSummary as M, createSharedSessionPool as N, capturedJourneyScope as O, SessionWorkerError as P, createCleanup as Q, gitSeedsProvider as R, readOriginalSearchFields as S, checkReusableBundle as T, readConfiguredOutputInfo as U, privateJourneyDirectory as V, processJourneyMetadataFields as W, createTemporary as X, createInspectionProcessor as Y, removeNamedTemporarySpools as Z, readStaticSessionMasks as _, scanReviewFields as a, isWindowsAclFailure as at, writePrivateReviewPayload as b, readSessionScanRecords as c, verifyOutputShard as d, exclusiveLock as et, writeOutputShard as f, processJourneyMetadata as g, readCapturedOriginalRows as h, buildWorkScanBatches as i, windowsOwnerOnly as it, readCollectionIndex as j, renderJobDigest as k, scanPreparedSession as l, captureConfiguredSessionJob as m, verifyPreparedSessionSources as n, openPrivateFile as nt, createWorkPieces as o, windowsAclCodes as ot, openConfiguredUpload as p, listAgentSetup as q, prepareSessionScans as r, restrictToOwner as rt, readSessionScanFields as s, preparedScanConfiguration as t, makePrivateDirectory as tt, runConfiguredScanJob as u, staticSessionJobs as v, createCollectionArtifacts as w, readPrivateReviewPayload as x, writeLogicalJourneyBase as y, parallelismLimits as z };
@@ -1,7 +1,7 @@
1
1
  import { An as nativeBoolean, Hn as defaultLimits, In as retainedMainTextNodes, Mn as nativeItems, Nn as nativeText, Qt as sourceSnapshotId, Tn as parseNativeRecord, Zt as observeSource, jn as nativeField, nr as ProcessingError, vn as walkNativeFields } from "./locate-U3-nkird.mjs";
2
- import { Lt as nativeAdapterVersions, Xr as gitMetadataBudgetBytes, it as reviewInventory } from "./src-CC95LYYp.mjs";
3
- import { a as isRecord, i as errorCode, n as checkDiscoveryAbort, o as unresolvedMetadata, r as discoveryBounds, t as DiscoveryWarnings } from "./model-BJdTLNjT.mjs";
4
- import { c as previewLimits, d as checkOpenSource, f as checkSource, h as openSource, i as pageFits, l as previewSourceVersion, m as noSymlinks, p as fileSnapshot, r as previewHeapLimits, s as previewMessageSchema, u as createZstdFrameCheck } from "./run-BeLHsZWb.mjs";
2
+ import { $r as gitMetadataBudgetBytes, Pt as nativeAdapterVersions, tt as reviewInventory } from "./src-B4R5XMEP.mjs";
3
+ import { a as isRecord, i as errorCode, n as checkDiscoveryAbort, o as unresolvedMetadata, r as discoveryBounds, t as DiscoveryWarnings } from "./model-BBAnsFAx.mjs";
4
+ import { c as previewLimits, d as checkOpenSource, f as checkSource, h as openSource, i as pageFits, l as previewSourceVersion, m as noSymlinks, p as fileSnapshot, r as previewHeapLimits, s as previewMessageSchema, u as createZstdFrameCheck } from "./run-4G_CvdDj.mjs";
5
5
  import { a as titleHintLimits, n as titleHeapLimits, o as titleInputSchema, r as decodeTitleError, s as titleReplySchema } from "./heap-1FYhGds4.mjs";
6
6
  import { constants } from "node:fs";
7
7
  import { lstat, open, opendir, readFile, readdir, realpath, stat } from "node:fs/promises";
@@ -377,6 +377,7 @@ function interactionTime(value, harness) {
377
377
  else if (type === "response_item" && isRecord(value["payload"])) {
378
378
  const payload = value["payload"];
379
379
  if (payload["type"] === "message" && payload["role"] === "developer") return { kind: "other" };
380
+ if (payload["type"] === "configuration_update") return { kind: "other" };
380
381
  interaction = payload["type"] === "message" && [
381
382
  "user",
382
383
  "assistant",
@@ -840,6 +841,7 @@ function codexMainProseComplete(root, selection) {
840
841
  const type = typeOf(node);
841
842
  if (type === "message") return message(node);
842
843
  if (type === "agent_message") return message(node, "assistant");
844
+ if (type === "configuration_update") return !selection.diagnostics.some((diagnostic) => diagnostic.code === "unsupported-native-shape" && diagnostic.nodeId === node.id);
843
845
  return excludedItems.has(type ?? "");
844
846
  };
845
847
  const type = typeOf(root);
@@ -1317,7 +1319,8 @@ function codexItem(context, node) {
1317
1319
  "compaction",
1318
1320
  "web_search_call",
1319
1321
  "tool_search_call",
1320
- "tool_search_output"
1322
+ "tool_search_output",
1323
+ "configuration_update"
1321
1324
  ].includes(type ?? "")) {
1322
1325
  context.claim(node, context.origin("unknown", "unknown", "unknown"));
1323
1326
  return;
@@ -1370,7 +1373,10 @@ function codexItem(context, node) {
1370
1373
  "execution",
1371
1374
  "tools"
1372
1375
  ]);
1373
- else schemaKeys(context, node, common);
1376
+ else if (type === "configuration_update") {
1377
+ schemaKeys(context, node, [...common, "reasoning"]);
1378
+ schemaKeys(context, nativeField(node, "reasoning"), ["effort"]);
1379
+ } else schemaKeys(context, node, common);
1374
1380
  protect(context, node, ["timestamp"], "timestamp");
1375
1381
  if (type === "message" || type === "agent_message") codexMessage(context, node, type === "agent_message" ? nativeText(nativeField(node, "author")) : void 0);
1376
1382
  else if ([
@@ -3319,6 +3325,11 @@ function instructions(context, node) {
3319
3325
  function sessionContext(context, payload) {
3320
3326
  for (const key of ["base_instructions", "developer_instructions"]) instructions(context, nativeField(payload, key));
3321
3327
  }
3328
+ /** A harness-authored settings change, such as a new reasoning effort, carries no prose. */
3329
+ function configurationUpdate(context, payload) {
3330
+ const reasoning = nativeField(payload, "reasoning");
3331
+ if (payload.kind !== "object" || payload.properties.some(({ key }) => key.value !== "type" && key.value !== "reasoning") || reasoning !== void 0 && (reasoning.kind !== "object" || reasoning.properties.some(({ value }) => value.kind === "array" || value.kind === "object"))) unsupported(context, payload);
3332
+ }
3322
3333
  function worldState(context, payload) {
3323
3334
  const state = nativeField(payload, "state");
3324
3335
  if (state?.kind !== "object") {
@@ -3539,6 +3550,7 @@ function nativeItem(context, node, calls) {
3539
3550
  "text",
3540
3551
  "encrypted_content"
3541
3552
  ]) selectText(context, nativeField(node, key), key === "encrypted_content" ? "ciphertext" : "compaction", "remove");
3553
+ else if (type === "configuration_update") configurationUpdate(context, node);
3542
3554
  else if (type !== "web_search_call" && type !== "tool_search_call") unsupported(context, node);
3543
3555
  }
3544
3556
  function createCodexRetention(options) {
@@ -1,4 +1,4 @@
1
- import { i as createExecutor, t as assertStoreHeap } from "./heap-BHcvxWCw.mjs";
1
+ import { i as createExecutor, t as assertStoreHeap } from "./heap-eO_uWpD1.mjs";
2
2
  import { parentPort } from "node:worker_threads";
3
3
  //#region packages/local-host/src/store/worker/entry.ts
4
4
  if (!parentPort) throw new Error("STORE_WORKER_REQUIRED");