@gitroll/tacitt-cli 0.4.0 → 0.4.2

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 (39) hide show
  1. package/dist/{agent-setup-CQRWVUWR.mjs → agent-setup-Bpsi-BCv.mjs} +2 -2
  2. package/dist/agent-setup-worker.mjs +5 -5
  3. package/dist/cli.mjs +81 -27
  4. package/dist/codex-title-worker.mjs +1 -1
  5. package/dist/configured-preview-worker.mjs +5 -5
  6. package/dist/configured-session-worker.mjs +5 -5
  7. package/dist/{frame-waS5FnN5.mjs → frame-IeDOLy1o.mjs} +1 -1
  8. package/dist/{heap-BaTNC9kf.mjs → heap-DiOlSa8T.mjs} +6 -6
  9. package/dist/inspection-worker.mjs +4 -4
  10. package/dist/{job-DrcpSL_9.mjs → job-BII94L2c.mjs} +3 -3
  11. package/dist/{locate-U3-nkird.mjs → locate-CBiw-CJK.mjs} +5 -0
  12. package/dist/{model-D7UnGeag.mjs → model-DGTsARtV.mjs} +1 -1
  13. package/dist/operation-executor.mjs +3 -3
  14. package/dist/preview-worker.mjs +1 -1
  15. package/dist/privacy-validator.mjs +1 -1
  16. package/dist/{query-ByD0Rp_o.mjs → query-CVqWNFYf.mjs} +886 -269
  17. package/dist/{run-3UIkr7GZ.mjs → run-BGlf-W0M.mjs} +4 -4
  18. package/dist/{src-DES7hBAP.mjs → src-37kIclGK.mjs} +170 -41
  19. package/dist/{src-DNn7SifS.mjs → src-CBTvOa44.mjs} +46 -3
  20. package/dist/{src-CmP73EcD.mjs → src-D4nrfC2S.mjs} +222 -19
  21. package/dist/store-database-worker.mjs +1 -1
  22. package/dist/web/assets/index-D3g_ATU-.js +69 -0
  23. package/dist/web/assets/{index-Clg6Pfv_.css → index-D5DEG5Ue.css} +1 -1
  24. package/dist/web/index.html +2 -2
  25. package/package.json +1 -1
  26. package/skills/tacitt/SKILL.md +3 -3
  27. package/skills/tacitt/references/INDEX.md +10 -10
  28. package/skills/tacitt/references/commands.md +2 -0
  29. package/skills/tacitt/references/journey.md +3 -3
  30. package/skills/tacitt/references/send.md +38 -12
  31. package/skills/tacitt/scripts/INDEX.md +36 -36
  32. package/skills/tacitt/scripts/journey-card-consolidation.mjs +2 -4
  33. package/skills/tacitt/scripts/journey-state.d.mts +30 -0
  34. package/skills/tacitt/scripts/journey-state.mjs +56 -3
  35. package/skills/tacitt/scripts/journey-tasks.d.mts +8 -0
  36. package/skills/tacitt/scripts/journey-tasks.mjs +4 -1
  37. package/skills/tacitt/scripts/privacy-validator.mjs +2 -0
  38. package/skills/tacitt/scripts/review.mjs +110 -9
  39. package/dist/web/assets/index-BkuUI3Eu.js +0 -67
@@ -1,5 +1,5 @@
1
- import "./locate-U3-nkird.mjs";
2
- import "./src-DNn7SifS.mjs";
1
+ import "./locate-CBiw-CJK.mjs";
2
+ import "./src-CBTvOa44.mjs";
3
3
  import { z } from "zod";
4
4
  import { Worker } from "node:worker_threads";
5
5
  //#region apps/cli/src/agent-setup/index.ts
@@ -1,8 +1,8 @@
1
- import { q as listAgentSetup } from "./src-CmP73EcD.mjs";
2
- import { rn as workspaceSchema, tn as sessionSchema, yn as createStaticProcessor } from "./locate-U3-nkird.mjs";
3
- import { l as createNativeAdapters, u as createGitNameSeedProvider } from "./src-DES7hBAP.mjs";
4
- import { at as maximumAgentSetupSessions, ci as effectiveTreatmentSchema } from "./src-DNn7SifS.mjs";
5
- import "./agent-setup-CQRWVUWR.mjs";
1
+ import { J as listAgentSetup } from "./src-D4nrfC2S.mjs";
2
+ import { rn as workspaceSchema, tn as sessionSchema, yn as createStaticProcessor } from "./locate-CBiw-CJK.mjs";
3
+ import { l as createNativeAdapters, u as createGitNameSeedProvider } from "./src-37kIclGK.mjs";
4
+ import { at as maximumAgentSetupSessions, ci as effectiveTreatmentSchema } from "./src-CBTvOa44.mjs";
5
+ import "./agent-setup-Bpsi-BCv.mjs";
6
6
  import { z } from "zod";
7
7
  import { parentPort, workerData } from "node:worker_threads";
8
8
  //#region apps/cli/src/agent-setup/worker.ts
package/dist/cli.mjs CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import { _ as createExecutionPort, a as readAgentPresence, d as parseOptions, f as businessCommands, g as readStateDump, h as startupFailure, i as invoke, l as createRenderActivity, m as permissionDiagnostic, n as readOperation, o as createRuntime, p as longCommands, r as waitOperation, s as executorEventSchema, t as cancelOperation, u as helpText, v as startHost, y as traceStartup } from "./query-ByD0Rp_o.mjs";
3
- import { nt as openPrivateFile, tt as makePrivateDirectory } from "./src-CmP73EcD.mjs";
4
- import { Gt as safeField, Ht as ApplicationError, Wt as safeCode } from "./locate-U3-nkird.mjs";
5
- import { Zn as reviewTransportBytes, et as readWorkspaceOutcomes, ii as stateSchema, st as resolveFailureLocation } from "./src-DNn7SifS.mjs";
6
- import { _t as isCoordinationBusy } from "./heap-BaTNC9kf.mjs";
2
+ import { _ as readStateDump, a as readAgentPresence, b as traceStartup, d as helpText, f as parseOptions, g as startupFailure, h as permissionDiagnostic, i as invoke, l as awaitingPassport, m as longCommands, n as readOperation, o as createRuntime, p as businessCommands, r as waitOperation, s as executorEventSchema, t as cancelOperation, u as createRenderActivity, v as createExecutionPort, y as startHost$1 } from "./query-CVqWNFYf.mjs";
3
+ import { nt as makePrivateDirectory, rt as openPrivateFile } from "./src-D4nrfC2S.mjs";
4
+ import { Gt as safeField, Ht as ApplicationError, Wt as safeCode } from "./locate-CBiw-CJK.mjs";
5
+ import { Zn as reviewTransportBytes, et as readWorkspaceOutcomes, ii as stateSchema, st as resolveFailureLocation } from "./src-CBTvOa44.mjs";
6
+ import { _t as isCoordinationBusy } from "./heap-DiOlSa8T.mjs";
7
7
  import { constants, createReadStream, write } from "node:fs";
8
8
  import { z } from "zod";
9
9
  import { lstat, mkdir, mkdtemp, open, readFile, readdir, realpath, rename, rm, writeFile } from "node:fs/promises";
@@ -140,6 +140,13 @@ function reportOwnershipCheckDeferred() {
140
140
  })}\n`, (_error) => {});
141
141
  } catch {}
142
142
  }
143
+ /**
144
+ * A focused host stops 30 minutes after its journey ended and Passport finished with the last
145
+ * Send, and at most 3 hours after the journey ended (ADR 0233).
146
+ */
147
+ function hostFinished(now, endedAt, settledAt) {
148
+ return now - endedAt >= 108e5 || settledAt !== void 0 && now - settledAt >= 18e5;
149
+ }
143
150
  async function serve(options, journeyId) {
144
151
  let initializing;
145
152
  let shutdownPhase = "application-and-account";
@@ -147,6 +154,7 @@ async function serve(options, journeyId) {
147
154
  let host;
148
155
  let ownerTimer;
149
156
  let finishTimer;
157
+ const hostLife = new AbortController();
150
158
  let observedStore = void 0;
151
159
  const timing = process.env["CI"] ? createHostTimingSampler() : void 0;
152
160
  const timingTimer = process.env["CI"] ? setInterval(() => {
@@ -197,6 +205,7 @@ async function serve(options, journeyId) {
197
205
  }, 5e3);
198
206
  if (ownerTimer) clearInterval(ownerTimer);
199
207
  if (finishTimer) clearInterval(finishTimer);
208
+ hostLife.abort();
200
209
  host?.beginStop();
201
210
  try {
202
211
  await runtime.close();
@@ -246,7 +255,7 @@ async function serve(options, journeyId) {
246
255
  await runtime.application.getSensitiveTerms();
247
256
  if (journeyId && !await runtime.application.journey?.get({ journeyId })) throw new ApplicationError("INVALID_TRANSITION");
248
257
  traceStartup("host-start");
249
- host = await startHost({
258
+ host = await startHost$1({
250
259
  application: runtime.application,
251
260
  account: runtime.account,
252
261
  nativeInspection: runtime.nativeInspection,
@@ -286,12 +295,29 @@ async function serve(options, journeyId) {
286
295
  process.on("SIGTERM", onSignal);
287
296
  if (journeyId) {
288
297
  let endedAt;
298
+ let settledAt;
299
+ let following = false;
289
300
  finishTimer = setInterval(() => {
290
- runtime.application.journey?.get({ journeyId }).then((journey) => {
291
- endedAt = journey?.phase === "completed" || journey?.abandonedAt !== void 0 ? endedAt ?? Date.now() : void 0;
292
- if (endedAt !== void 0 && Date.now() - endedAt >= 18e5) scheduleStop();
293
- }).catch(() => {});
294
- }, 6e4);
301
+ if (following) return;
302
+ following = true;
303
+ (async () => {
304
+ const { journey: journeys, journeySend } = runtime.application;
305
+ const journey = await journeys?.get({ journeyId });
306
+ const ended = journey?.phase === "completed" || journey?.abandonedAt !== void 0;
307
+ const send = (await journeys?.get({}))?.journeyId === journeyId ? (await journeySend?.get({ journeyId }))?.send : null;
308
+ const waiting = Boolean(send && awaitingPassport(send));
309
+ const now = Date.now();
310
+ endedAt = ended ? endedAt ?? now : void 0;
311
+ settledAt = ended && !waiting ? settledAt ?? now : void 0;
312
+ if (endedAt !== void 0 && hostFinished(now, endedAt, settledAt)) return scheduleStop();
313
+ if (waiting && send) await journeySend?.advance({
314
+ journeyId,
315
+ sendId: send.id
316
+ }, hostLife.signal);
317
+ })().catch(() => {}).finally(() => {
318
+ following = false;
319
+ });
320
+ }, 15e3);
295
321
  finishTimer.unref();
296
322
  const url = new URL(host.url);
297
323
  url.searchParams.set("view", "skill");
@@ -931,6 +957,10 @@ const readySchema = z.object({
931
957
  journeyId: z.string()
932
958
  })
933
959
  });
960
+ const failureSchema = z.object({
961
+ ok: z.literal(false),
962
+ error: z.object({ code: z.string() })
963
+ });
934
964
  const recordSchema = z.object({
935
965
  url: z.string(),
936
966
  journeyId: z.string(),
@@ -998,18 +1028,36 @@ async function serveDetached(args, stateDir, journeyId) {
998
1028
  recursive: true,
999
1029
  mode: 448
1000
1030
  });
1001
- const existing = await liveHost(directory, journeyId);
1002
- if (existing) {
1003
- process.stdout.write(`${JSON.stringify({
1004
- ok: true,
1005
- event: "ready",
1006
- result: {
1007
- ...existing,
1008
- reused: true
1009
- }
1010
- })}\n`);
1011
- return;
1031
+ let retries = 0;
1032
+ let delay = 500;
1033
+ for (;;) {
1034
+ const existing = await liveHost(directory, journeyId);
1035
+ if (existing) {
1036
+ process.stdout.write(`${JSON.stringify({
1037
+ ok: true,
1038
+ event: "ready",
1039
+ result: {
1040
+ ...existing,
1041
+ reused: true
1042
+ }
1043
+ })}\n`);
1044
+ return;
1045
+ }
1046
+ const result = await startHost(args, directory, journeyId, Date.now() + 6e4);
1047
+ if (!result) return;
1048
+ if (!result.busy || retries >= 5) {
1049
+ process.stderr.write(`The panel host did not start. Its output is in ${result.log}.\n`);
1050
+ process.exitCode = 1;
1051
+ return;
1052
+ }
1053
+ process.stderr.write("COORDINATION_BUSY: retrying panel host startup.\n");
1054
+ retries += 1;
1055
+ await setTimeout$1(delay);
1056
+ delay = Math.min(delay * 2, 4e3);
1012
1057
  }
1058
+ }
1059
+ /** Retry only an exited child's explicit busy refusal; never start two live owners. */
1060
+ async function startHost(args, directory, journeyId, deadline) {
1013
1061
  const id = randomUUID();
1014
1062
  const input = join(directory, `${id}.json`);
1015
1063
  const log = join(directory, `${id}.log`);
@@ -1033,10 +1081,14 @@ async function serveDetached(args, stateDir, journeyId) {
1033
1081
  child.once("exit", (code) => exited = code ?? 1);
1034
1082
  child.unref();
1035
1083
  await output.close();
1036
- for (let waited = 0; waited < 6e4; waited += 100) {
1084
+ let busy = false;
1085
+ while (Date.now() < deadline) {
1037
1086
  const ready = (await readFile(log, "utf8")).split("\n").flatMap((line) => {
1038
1087
  try {
1039
- const value = readySchema.safeParse(JSON.parse(line));
1088
+ const parsed = JSON.parse(line);
1089
+ const failure = failureSchema.safeParse(parsed);
1090
+ if (failure.success) busy = failure.data.error.code === "COORDINATION_BUSY";
1091
+ const value = readySchema.safeParse(parsed);
1040
1092
  return value.success ? [value.data.result] : [];
1041
1093
  } catch {
1042
1094
  return [];
@@ -1062,11 +1114,13 @@ async function serveDetached(args, stateDir, journeyId) {
1062
1114
  return;
1063
1115
  }
1064
1116
  if (exited !== null) break;
1065
- await setTimeout$1(100);
1117
+ await setTimeout$1(Math.min(100, Math.max(0, deadline - Date.now())));
1066
1118
  }
1067
1119
  if (exited === null) child.kill();
1068
- process.stderr.write(`The panel host did not start. Its output is in ${log}.\n`);
1069
- process.exitCode = 1;
1120
+ return {
1121
+ busy: exited !== null && busy,
1122
+ log
1123
+ };
1070
1124
  }
1071
1125
  //#endregion
1072
1126
  //#region apps/cli/src/business-input.ts
@@ -1,4 +1,4 @@
1
- import { i as errorCode } from "./model-D7UnGeag.mjs";
1
+ import { i as errorCode } from "./model-DGTsARtV.mjs";
2
2
  import { a as titleHintLimits, i as encodeTitleError, o as titleInputSchema, t as assertTitleHeap } from "./heap-1FYhGds4.mjs";
3
3
  import { stat } from "node:fs/promises";
4
4
  import { isAbsolute, join } from "node:path";
@@ -1,8 +1,8 @@
1
- import { J as createConfiguredPreviewStream } from "./src-CmP73EcD.mjs";
2
- import { rn as workspaceSchema, tn as sessionSchema, yn as createStaticProcessor } from "./locate-U3-nkird.mjs";
3
- import { l as createNativeAdapters, u as createGitNameSeedProvider } from "./src-DES7hBAP.mjs";
4
- import { ci as effectiveTreatmentSchema } from "./src-DNn7SifS.mjs";
5
- import { a as classifyRecord, n as assertPreviewHeap, t as runPreview } from "./run-3UIkr7GZ.mjs";
1
+ import { Y as createConfiguredPreviewStream } from "./src-D4nrfC2S.mjs";
2
+ import { rn as workspaceSchema, tn as sessionSchema, yn as createStaticProcessor } from "./locate-CBiw-CJK.mjs";
3
+ import { l as createNativeAdapters, u as createGitNameSeedProvider } from "./src-37kIclGK.mjs";
4
+ import { ci as effectiveTreatmentSchema } from "./src-CBTvOa44.mjs";
5
+ import { a as classifyRecord, n as assertPreviewHeap, t as runPreview } from "./run-BGlf-W0M.mjs";
6
6
  import { z } from "zod";
7
7
  import { parentPort, workerData } from "node:worker_threads";
8
8
  //#region apps/cli/src/preview/run.ts
@@ -1,8 +1,8 @@
1
- import { $ as safeError, A as runConfiguredSessionJob, R as gitSeedsProvider, m as captureConfiguredSessionJob, u as runConfiguredScanJob } from "./src-CmP73EcD.mjs";
2
- import { Wt as safeCode, yn as createStaticProcessor } from "./locate-U3-nkird.mjs";
3
- import { l as createNativeAdapters } from "./src-DES7hBAP.mjs";
4
- import "./src-DNn7SifS.mjs";
5
- import { d as runJourneyBaseJob, i as runJourneyOutputVerifyJob, n as runJourneyOutputJob, r as runJourneyOutputShardJob } from "./job-DrcpSL_9.mjs";
1
+ import { et as safeError, h as captureConfiguredSessionJob, j as runConfiguredSessionJob, u as runConfiguredScanJob, z as gitSeedsProvider } from "./src-D4nrfC2S.mjs";
2
+ import { Wt as safeCode, yn as createStaticProcessor } from "./locate-CBiw-CJK.mjs";
3
+ import { l as createNativeAdapters } from "./src-37kIclGK.mjs";
4
+ import "./src-CBTvOa44.mjs";
5
+ import { d as runJourneyBaseJob, i as runJourneyOutputVerifyJob, n as runJourneyOutputJob, r as runJourneyOutputShardJob } from "./job-BII94L2c.mjs";
6
6
  import { parentPort } from "node:worker_threads";
7
7
  //#region apps/cli/src/configured-session-worker.ts
8
8
  const port = parentPort;
@@ -1,4 +1,4 @@
1
- import { nr as ProcessingError } from "./locate-U3-nkird.mjs";
1
+ import { nr as ProcessingError } from "./locate-CBiw-CJK.mjs";
2
2
  //#region packages/processing/src/compression/frame.ts
3
3
  function createZstdFrameCheck(fail = () => {
4
4
  throw new ProcessingError("PROCESSING_INVALID_RECORD");
@@ -1,6 +1,6 @@
1
- import { b as writePrivateReviewPayload, et as exclusiveLock, it as windowsOwnerOnly, nt as openPrivateFile, rt as restrictToOwner, x as readPrivateReviewPayload } from "./src-CmP73EcD.mjs";
2
- import { $t as fileIdentitySchema, At as journeyTermSchema, Ht as ApplicationError, It as termTypeSchema, Jt as reviewFamilies, Kn as isStaticCategory, Mt as reviewTermsResultSchema, _ as semanticFindingSchema, b as validateBReview, c as textDigest, d as reviewAlignmentAudit, dt as nativeJourneySchema, ft as journeyGuidanceSchema, g as validateReviewAlignment, gn as createDetectionSummary, gt as journeyWorkSuggestionSchema, ht as journeyDescribeSchema, i as reviewBatchSchema, it as journeyDigestSchema, jt as reviewTermsInputSchema, kt as privacyTermSchema, l as validateReview, m as reviewAlignmentSchema, o as reviewDigest, ot as journeyIdSchema, qn as staticCategories, qt as familySelected, r as reviewBatchChunks, s as reviewSubmitSchema, u as findingReferenceKey, v as bContextEvidence } from "./locate-U3-nkird.mjs";
3
- import { $n as mergeBRepair, $t as journeyResourceSchema, At as validateAttemptAppend, B as validateInspectionBatch, Bt as newJourneyWork, Et as obsoleteJourney, Fn as confirmedHideGroupIds, Ft as applyClassificationProposal, G as validateInspectionFence, Gn as workPrivacyDecisions, Gr as withReadingProgress, Gt as hideFinishSchema, Hn as syncTermGroups, Hr as isReadingComplete, Ht as journeyContextQuerySchema, In as confirmedHideKey, It as classificationCommitSchema, J as validateInspectionQuery, Jn as reviewCandidateResourceSchema, Jt as journeySearchSaveSchema, K as validateInspectionHead, Kr as mergePrivacyTerms, Kt as hidePublishSchema, Mn as bMaskedHits, Nt as journeyBatchReadSchema, Pr as journeySendSchema, Pt as journeyReviewStorageQuerySchema, Qn as bReviewDigest, Qt as journeyResourceQuerySchema, Rn as confirmedHideTerms, Un as retireWorkDescription, Ur as isSelectedWork, Ut as journeyContextSchema, V as validateInspectionBatches, Vn as maskedHitsStale, W as validateInspectionClaim, Wn as workDecisionDigest, Wr as selectedWorks, Wt as hideBeginSchema, X as validateDetectionSummary, Xn as reviewRepairResourceSchema, Xt as journeyPolicyRespondSchema, Y as validateInspectionContribution, Yt as searchScopeDigest, Z as inspectionInputs, Zt as projectPreparationProgress, _ as projectJourneyInventory, _n as journeyCommitResultSchema, _r as preparationSettlementSchema, an as reviewAttemptsResultSchema, ar as scanGitSeedsId, b as bReviewScope, c as reconstructBFields, cn as sessionReconciliationResourceSchema, en as journeyIsolateSchema, fn as sessionReviewQuerySchema, fr as journeyInventoryReadSchema, gn as sessionUsefulnessResourceSchema, gr as preparationBeginSchema, h as semanticGroupKey, hn as sessionUsefulnessInputSchema, ht as candidateSortAvailable, ii as stateSchema, in as reviewAttemptsQuerySchema, ir as scanSessionResourceSchema, jt as journeyGuidance, kr as staticSessionId, kt as attemptBudgetCodePoints, l as reviseGroupMembership, lr as validateScanExclusion, m as hideScopeDigest, mn as sessionReviewStatusSchema, mr as journeyPreparationProgressSchema, nn as sortingApplySchema, nr as scanCanonicalResourceSchema, o as bRereadDigest, pn as sessionReviewResourceSchema, pr as journeyInventorySchema, pt as manualUploadSchema, q as validateInspectionInputs, qt as journeySearchResultSchema, rn as reviewAttemptResourceSchema, s as reconcileBSession, sn as sessionReconcileResultSchema, t as scanBatchContextDigest, tn as journeyPlaceSchema, tr as scanAliasResourceSchema, u as resolveGroupSplit, un as sessionRereadResourceSchema, ut as manualUploadBindingSchema, v as preparationScope, vn as journeyCommitSchema, vr as preparationStartSchema, wn as settleConfirmedHides, wt as settleCorrections, xn as confirmedHideDeltaSchema, xr as applyCardAnswers, yn as journeyEventSchema, yr as validatePreparationFacts, zn as dictionaryHides } from "./src-DNn7SifS.mjs";
1
+ import { S as readPrivateReviewPayload, at as windowsOwnerOnly, it as restrictToOwner, rt as openPrivateFile, tt as exclusiveLock, x as writePrivateReviewPayload } from "./src-D4nrfC2S.mjs";
2
+ import { $t as fileIdentitySchema, At as journeyTermSchema, Ht as ApplicationError, It as termTypeSchema, Jt as reviewFamilies, Kn as isStaticCategory, Mt as reviewTermsResultSchema, _ as semanticFindingSchema, b as validateBReview, c as textDigest, d as reviewAlignmentAudit, dt as nativeJourneySchema, ft as journeyGuidanceSchema, g as validateReviewAlignment, gn as createDetectionSummary, gt as journeyWorkSuggestionSchema, ht as journeyDescribeSchema, i as reviewBatchSchema, it as journeyDigestSchema, jt as reviewTermsInputSchema, kt as privacyTermSchema, l as validateReview, m as reviewAlignmentSchema, o as reviewDigest, ot as journeyIdSchema, qn as staticCategories, qt as familySelected, r as reviewBatchChunks, s as reviewSubmitSchema, u as findingReferenceKey, v as bContextEvidence } from "./locate-CBiw-CJK.mjs";
3
+ import { $n as mergeBRepair, $t as journeyResourceSchema, At as validateAttemptAppend, B as validateInspectionBatch, Bt as newJourneyWork, Et as obsoleteJourney, Fn as confirmedHideGroupIds, Ft as applyClassificationProposal, G as validateInspectionFence, Gn as workPrivacyDecisions, Gr as withReadingProgress, Gt as hideFinishSchema, Hn as syncTermGroups, Hr as isReadingComplete, Ht as journeyContextQuerySchema, In as confirmedHideKey, It as classificationCommitSchema, J as validateInspectionQuery, Jn as reviewCandidateResourceSchema, Jt as journeySearchSaveSchema, K as validateInspectionHead, Kr as mergePrivacyTerms, Kt as hidePublishSchema, Mn as bMaskedHits, Nt as journeyBatchReadSchema, Pr as journeySendSchema, Pt as journeyReviewStorageQuerySchema, Qn as bReviewDigest, Qt as journeyResourceQuerySchema, Rn as confirmedHideTerms, Un as retireWorkDescription, Ur as isSelectedWork, Ut as journeyContextSchema, V as validateInspectionBatches, Vn as maskedHitsStale, W as validateInspectionClaim, Wn as workDecisionDigest, Wr as selectedWorks, Wt as hideBeginSchema, X as validateDetectionSummary, Xn as reviewRepairResourceSchema, Xt as journeyPolicyRespondSchema, Y as validateInspectionContribution, Yt as searchScopeDigest, Z as inspectionInputs, Zt as projectPreparationProgress, _ as projectJourneyInventory, _n as journeyCommitResultSchema, _r as preparationSettlementSchema, an as reviewAttemptsResultSchema, ar as scanGitSeedsId, b as bReviewScope, c as reconstructBFields, cn as sessionReconciliationResourceSchema, en as journeyIsolateSchema, fn as sessionReviewQuerySchema, fr as journeyInventoryReadSchema, gn as sessionUsefulnessResourceSchema, gr as preparationBeginSchema, h as semanticGroupKey, hn as sessionUsefulnessInputSchema, ht as candidateSortAvailable, ii as stateSchema, in as reviewAttemptsQuerySchema, ir as scanSessionResourceSchema, jt as journeyGuidance, kr as staticSessionId, kt as attemptBudgetCodePoints, l as reviseGroupMembership, lr as validateScanExclusion, m as hideScopeDigest, mn as sessionReviewStatusSchema, mr as journeyPreparationProgressSchema, nn as sortingApplySchema, nr as scanCanonicalResourceSchema, o as bRereadDigest, pn as sessionReviewResourceSchema, pr as journeyInventorySchema, pt as manualUploadSchema, q as validateInspectionInputs, qt as journeySearchResultSchema, rn as reviewAttemptResourceSchema, s as reconcileBSession, sn as sessionReconcileResultSchema, t as scanBatchContextDigest, tn as journeyPlaceSchema, tr as scanAliasResourceSchema, u as resolveGroupSplit, un as sessionRereadResourceSchema, ut as manualUploadBindingSchema, v as preparationScope, vn as journeyCommitSchema, vr as preparationStartSchema, wn as settleConfirmedHides, wt as settleCorrections, xn as confirmedHideDeltaSchema, xr as applyCardAnswers, yn as journeyEventSchema, yr as validatePreparationFacts, zn as dictionaryHides } from "./src-CBTvOa44.mjs";
4
4
  import { constants } from "node:fs";
5
5
  import { z } from "zod";
6
6
  import { copyFile, link, lstat, mkdir, mkdtemp, open, readFile, realpath, rm, unlink } from "node:fs/promises";
@@ -415,11 +415,11 @@ function insertCorrectionReport(db, resource) {
415
415
  * A snapshot of an earlier release cannot render, so a new Journey may replace it, but never
416
416
  * one with a Send record or a sent Work: that Send stays for the person to finish.
417
417
  */
418
- /** Passport holds a receipt from one of this Journey's Sends, so a Work may have reached it. */
418
+ /** A receipt or persisted session mutation intent means a Send may have reached Passport. */
419
419
  function reachedPassport(db, journeyId) {
420
420
  return db.prepare("SELECT json FROM journey_sends WHERE journey_id=?").all(journeyId).some((row) => {
421
421
  if (typeof row["json"] !== "string") throw new ApplicationError("CORRUPTED_STATE");
422
- return journeySendSchema.parse(JSON.parse(row["json"])).items.some((item) => item.receipt || item.previousReceipts.length);
422
+ return journeySendSchema.parse(JSON.parse(row["json"])).items.some((item) => item.receipt || item.previousReceipts.length || item.sessionUpload !== void 0 || item.sessionMembership || item.sessionAssembly);
423
423
  });
424
424
  }
425
425
  /** An abandoned Journey gives way to a new one unless one of its Sends reached Passport. */
@@ -4828,7 +4828,7 @@ function commitJourneySend(db, input) {
4828
4828
  ].includes(work.reason));
4829
4829
  const journey = {
4830
4830
  ...current.journey,
4831
- phase: current.journey.phase === "paused" ? "paused" : finished ? "completed" : [
4831
+ phase: current.journey.phase === "paused" || prior?.status === "completed" ? current.journey.phase : finished ? "completed" : [
4832
4832
  "completed",
4833
4833
  "blocked",
4834
4834
  "paused"
@@ -1,7 +1,7 @@
1
- import { Y as createInspectionProcessor } from "./src-CmP73EcD.mjs";
2
- import { yn as createStaticProcessor } from "./locate-U3-nkird.mjs";
3
- import { l as createNativeAdapters, u as createGitNameSeedProvider } from "./src-DES7hBAP.mjs";
4
- import { H as validateInspectionRequest } from "./src-DNn7SifS.mjs";
1
+ import { X as createInspectionProcessor } from "./src-D4nrfC2S.mjs";
2
+ import { yn as createStaticProcessor } from "./locate-CBiw-CJK.mjs";
3
+ import { l as createNativeAdapters, u as createGitNameSeedProvider } from "./src-37kIclGK.mjs";
4
+ import { H as validateInspectionRequest } from "./src-CBTvOa44.mjs";
5
5
  import "./messages-D3m3bhva.mjs";
6
6
  import { z } from "zod";
7
7
  import { parentPort, workerData } from "node:worker_threads";
@@ -1,6 +1,6 @@
1
- import { B as writeLogicalJourneyOutput, C as readConfiguredSearchFields, E as prepareCollectionProduction, R as gitSeedsProvider, U as readConfiguredOutputInfo, d as verifyOutputShard, f as writeOutputShard, k as renderJobDigest, y as writeLogicalJourneyBase } from "./src-CmP73EcD.mjs";
2
- import { Ht as ApplicationError, Jt as reviewFamilies, zt as filterInventoryByPeriod } from "./locate-U3-nkird.mjs";
3
- import { Ar as staticSessionResourceSchema, Cn as renderedHideValue, Dn as hideKeyId, En as addHideIndexTokens, di as selectFrozenConfiguration, kn as packHideIndex, li as defaultScopedSettings, ui as freezeConfiguration } from "./src-DNn7SifS.mjs";
1
+ import { A as renderJobDigest, D as prepareCollectionProduction, V as writeLogicalJourneyOutput, W as readConfiguredOutputInfo, b as writeLogicalJourneyBase, d as verifyOutputShard, f as writeOutputShard, w as readConfiguredSearchFields, z as gitSeedsProvider } from "./src-D4nrfC2S.mjs";
2
+ import { Ht as ApplicationError, Jt as reviewFamilies, zt as filterInventoryByPeriod } from "./locate-CBiw-CJK.mjs";
3
+ import { Ar as staticSessionResourceSchema, Cn as renderedHideValue, Dn as hideKeyId, En as addHideIndexTokens, di as selectFrozenConfiguration, kn as packHideIndex, li as defaultScopedSettings, ui as freezeConfiguration } from "./src-CBTvOa44.mjs";
4
4
  import { constants } from "node:fs";
5
5
  import { link, lstat, open, unlink } from "node:fs/promises";
6
6
  import { join } from "node:path";
@@ -8246,6 +8246,8 @@ const sourcePartSchema = z.object({
8246
8246
  id: z.string(),
8247
8247
  path: z.string(),
8248
8248
  root: z.string(),
8249
+ /** Original harness-home-relative name, preserved before resolving a linked discovery root. */
8250
+ harnessRelativePath: z.string().min(1).max(16384).optional(),
8249
8251
  representation: z.enum(["jsonl", "jsonl.zst"]),
8250
8252
  snapshot: fileSnapshotSchema,
8251
8253
  nativeEvidence: nativeSourceEvidenceSchema.optional()
@@ -8472,7 +8474,10 @@ const safeCodes = /* @__PURE__ */ new Set([
8472
8474
  "EMPTY_MAIN_SESSION",
8473
8475
  "SEND_REMOTE_REFUSED",
8474
8476
  "SEND_INTERRUPTED",
8477
+ "SEND_SCOPE_BUSY",
8475
8478
  "SEND_REPLACE_REFUSED",
8479
+ "SESSION_CONTENT_CONFLICT",
8480
+ "WORK_REMOVED",
8476
8481
  "ACCOUNT_CHANGED",
8477
8482
  "JOURNEY_DESTINATION_CHANGED",
8478
8483
  "SENSITIVE_TERMS_UNSAFE_PATH",
@@ -1,4 +1,4 @@
1
- import "./src-DNn7SifS.mjs";
1
+ import "./src-CBTvOa44.mjs";
2
2
  //#region packages/harnesses/src/discovery/model.ts
3
3
  const discoveryBounds = {
4
4
  entries: 1e5,
@@ -1,6 +1,6 @@
1
- import { c as executorRequestSchema, d as parseOptions, h as startupFailure, i as invoke, n as readOperation, o as createRuntime, p as longCommands, r as waitOperation } from "./query-ByD0Rp_o.mjs";
2
- import { Gt as safeField, Ht as ApplicationError, Wt as safeCode } from "./locate-U3-nkird.mjs";
3
- import "./src-DNn7SifS.mjs";
1
+ import { c as executorRequestSchema, f as parseOptions, g as startupFailure, i as invoke, m as longCommands, n as readOperation, o as createRuntime, r as waitOperation } from "./query-CVqWNFYf.mjs";
2
+ import { Gt as safeField, Ht as ApplicationError, Wt as safeCode } from "./locate-CBiw-CJK.mjs";
3
+ import "./src-CBTvOa44.mjs";
4
4
  import { z } from "zod";
5
5
  import { setTimeout } from "node:timers/promises";
6
6
  //#region apps/cli/src/operation/executor.ts
@@ -1,4 +1,4 @@
1
- import { n as assertPreviewHeap, o as previewInputSchema, t as runPreview } from "./run-3UIkr7GZ.mjs";
1
+ import { n as assertPreviewHeap, o as previewInputSchema, t as runPreview } from "./run-BGlf-W0M.mjs";
2
2
  import { parentPort, workerData } from "node:worker_threads";
3
3
  //#region packages/harnesses/src/preview/worker/index.ts
4
4
  function notify(message) {
@@ -1,4 +1,4 @@
1
- import { Dt as privacyResolveSchema, Ot as privacyTermKey, t as locateTerms, wt as decisionCardInputSchema } from "./locate-U3-nkird.mjs";
1
+ import { Dt as privacyResolveSchema, Ot as privacyTermKey, t as locateTerms, wt as decisionCardInputSchema } from "./locate-CBiw-CJK.mjs";
2
2
  import { z } from "zod";
3
3
  //#region apps/cli/src/skill-install/privacy-validator.ts
4
4
  const suppliedTerms = z.array(z.object({