@gitroll/tacitt-cli 0.6.13 → 0.6.14

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 (36) hide show
  1. package/dist/{agent-setup-Doy_AnPY.mjs → agent-setup-CEPQfjBv.mjs} +2 -2
  2. package/dist/agent-setup-worker.mjs +5 -5
  3. package/dist/cli.mjs +6 -6
  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-BPbypzmt.mjs → frame-CRm99088.mjs} +1 -1
  8. package/dist/{heap-DCS_WXIA.mjs → heap-Bh9tySJp.mjs} +8 -7
  9. package/dist/inspection-worker.mjs +4 -4
  10. package/dist/{job--zxwgaPy.mjs → job-CsWKWcM4.mjs} +4 -4
  11. package/dist/{locate-PLEyLYW-.mjs → locate-CP2t26j2.mjs} +173 -19
  12. package/dist/{model-CyXvsWLz.mjs → model-ChHuVKoB.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-BC7MIaWc.mjs → query-D28k3XOr.mjs} +5822 -5704
  17. package/dist/{run-Dod7Vykp.mjs → run-CiJmV__5.mjs} +4 -4
  18. package/dist/{src-CttNuxOn.mjs → src-B3il9x5F.mjs} +37 -13
  19. package/dist/{src-dL6y2mcu.mjs → src-CWMrGXJK.mjs} +4 -4
  20. package/dist/{src-CP-K2PBv.mjs → src-CmvEJj46.mjs} +31 -8
  21. package/dist/store-database-worker.mjs +1 -1
  22. package/dist/web/assets/index-XdWDOC5H.js +172 -0
  23. package/dist/web/index.html +1 -1
  24. package/package.json +1 -1
  25. package/skills/tacitt/INDEX.md +1 -1
  26. package/skills/tacitt/SKILL.md +2 -0
  27. package/skills/tacitt/references/INDEX.md +2 -2
  28. package/skills/tacitt/references/commands.md +13 -0
  29. package/skills/tacitt/references/journey.md +2 -0
  30. package/skills/tacitt/scripts/INDEX.md +1 -1
  31. package/skills/tacitt/scripts/journey-classification-tasks.mjs +2 -0
  32. package/skills/tacitt/scripts/journey-state.d.mts +3 -0
  33. package/skills/tacitt/scripts/journey-state.mjs +8 -1
  34. package/skills/tacitt/scripts/journey.mjs +30 -0
  35. package/skills/tacitt/scripts/privacy-validator.mjs +76 -7
  36. package/dist/web/assets/index-BgDdPL1c.js +0 -172
@@ -1,5 +1,5 @@
1
- import "./locate-PLEyLYW-.mjs";
2
- import "./src-CttNuxOn.mjs";
1
+ import "./locate-CP2t26j2.mjs";
2
+ import "./src-B3il9x5F.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-CP-K2PBv.mjs";
2
- import { Fn as createStaticProcessor, _n as sessionSchema, yn as workspaceSchema } from "./locate-PLEyLYW-.mjs";
3
- import { l as createNativeAdapters, u as createGitNameSeedProvider } from "./src-dL6y2mcu.mjs";
4
- import { Ii as effectiveTreatmentSchema, ct as maximumAgentSetupSessions } from "./src-CttNuxOn.mjs";
5
- import "./agent-setup-Doy_AnPY.mjs";
1
+ import { Q as listAgentSetup } from "./src-CmvEJj46.mjs";
2
+ import { In as createStaticProcessor, bn as workspaceSchema, vn as sessionSchema } from "./locate-CP2t26j2.mjs";
3
+ import { l as createNativeAdapters, u as createGitNameSeedProvider } from "./src-CWMrGXJK.mjs";
4
+ import { Li as effectiveTreatmentSchema, ct as maximumAgentSetupSessions } from "./src-B3il9x5F.mjs";
5
+ import "./agent-setup-CEPQfjBv.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,10 +1,10 @@
1
1
  #!/usr/bin/env node
2
- import { _ as permissionDiagnostic, a as readAgentPresence, d as packageIdentity, f as createRenderActivity, g as longCommands, h as businessCommands, i as invoke, l as serveDetached, m as parseOptions, n as readOperation, o as createRuntime, p as helpText, r as waitOperation, s as executorEventSchema, t as cancelOperation, u as guardDetachedStartup, v as startupFailure, y as traceStartup } from "./query-BC7MIaWc.mjs";
3
- import { ct as openPrivateFile, st as makePrivateDirectory } from "./src-CP-K2PBv.mjs";
4
- import { B as inBackgroundStatusPoll, F as startHost, N as readStateDump, P as createExecutionPort } from "./job--zxwgaPy.mjs";
5
- import { in as ApplicationError, on as safeCode, sn as safeField } from "./locate-PLEyLYW-.mjs";
6
- import { Mi as stateSchema, Mr as awaitingPassport, Pr as hostDrives, rt as readWorkspaceOutcomes, ut as resolveFailureLocation, yn as reviewTransportBytes } from "./src-CttNuxOn.mjs";
7
- import { vt as isCoordinationBusy } from "./heap-DCS_WXIA.mjs";
2
+ import { _ as permissionDiagnostic, a as readAgentPresence, d as packageIdentity, f as createRenderActivity, g as longCommands, h as businessCommands, i as invoke, l as serveDetached, m as parseOptions, n as readOperation, o as createRuntime, p as helpText, r as waitOperation, s as executorEventSchema, t as cancelOperation, u as guardDetachedStartup, v as startupFailure, y as traceStartup } from "./query-D28k3XOr.mjs";
3
+ import { ct as openPrivateFile, st as makePrivateDirectory } from "./src-CmvEJj46.mjs";
4
+ import { B as inBackgroundStatusPoll, F as startHost, N as readStateDump, P as createExecutionPort } from "./job-CsWKWcM4.mjs";
5
+ import { an as ApplicationError, cn as safeField, sn as safeCode } from "./locate-CP2t26j2.mjs";
6
+ import { Fr as hostDrives, Ni as stateSchema, Nr as awaitingPassport, rt as readWorkspaceOutcomes, ut as resolveFailureLocation, yn as reviewTransportBytes } from "./src-B3il9x5F.mjs";
7
+ import { vt as isCoordinationBusy } from "./heap-Bh9tySJp.mjs";
8
8
  import { constants, createReadStream, write } from "node:fs";
9
9
  import { z } from "zod";
10
10
  import { lstat, mkdir, mkdtemp, open, readFile, readdir, realpath, rename, rm, writeFile } from "node:fs/promises";
@@ -1,4 +1,4 @@
1
- import { i as errorCode } from "./model-CyXvsWLz.mjs";
1
+ import { i as errorCode } from "./model-ChHuVKoB.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 { $ as createConfiguredPreviewStream } from "./src-CP-K2PBv.mjs";
2
- import { Fn as createStaticProcessor, _n as sessionSchema, yn as workspaceSchema } from "./locate-PLEyLYW-.mjs";
3
- import { l as createNativeAdapters, u as createGitNameSeedProvider } from "./src-dL6y2mcu.mjs";
4
- import { Ii as effectiveTreatmentSchema } from "./src-CttNuxOn.mjs";
5
- import { a as classifyRecord, n as assertPreviewHeap, t as runPreview } from "./run-Dod7Vykp.mjs";
1
+ import { $ as createConfiguredPreviewStream } from "./src-CmvEJj46.mjs";
2
+ import { In as createStaticProcessor, bn as workspaceSchema, vn as sessionSchema } from "./locate-CP2t26j2.mjs";
3
+ import { l as createNativeAdapters, u as createGitNameSeedProvider } from "./src-CWMrGXJK.mjs";
4
+ import { Li as effectiveTreatmentSchema } from "./src-B3il9x5F.mjs";
5
+ import { a as classifyRecord, n as assertPreviewHeap, t as runPreview } from "./run-CiJmV__5.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 { N as runConfiguredSessionJob, V as gitSeedsProvider, _ as captureConfiguredSessionJob, at as safeError, f as runConfiguredScanJob } from "./src-CP-K2PBv.mjs";
2
- import { d as runJourneyBaseJob, i as runJourneyOutputVerifyJob, n as runJourneyOutputJob, r as runJourneyOutputShardJob } from "./job--zxwgaPy.mjs";
3
- import { Fn as createStaticProcessor, Sr as processingSite, on as safeCode } from "./locate-PLEyLYW-.mjs";
4
- import { l as createNativeAdapters } from "./src-dL6y2mcu.mjs";
5
- import "./src-CttNuxOn.mjs";
1
+ import { N as runConfiguredSessionJob, V as gitSeedsProvider, _ as captureConfiguredSessionJob, at as safeError, f as runConfiguredScanJob } from "./src-CmvEJj46.mjs";
2
+ import { d as runJourneyBaseJob, i as runJourneyOutputVerifyJob, n as runJourneyOutputJob, r as runJourneyOutputShardJob } from "./job-CsWKWcM4.mjs";
3
+ import { Cr as processingSite, In as createStaticProcessor, sn as safeCode } from "./locate-CP2t26j2.mjs";
4
+ import { l as createNativeAdapters } from "./src-CWMrGXJK.mjs";
5
+ import "./src-B3il9x5F.mjs";
6
6
  import { parentPort } from "node:worker_threads";
7
7
  //#region packages/artifact/src/configured/parallel/spool-claim.ts
8
8
  /** A worker may create a named file only after the host has recorded its cleanup ownership. */
@@ -1,4 +1,4 @@
1
- import { vr as ProcessingError } from "./locate-PLEyLYW-.mjs";
1
+ import { yr as ProcessingError } from "./locate-CP2t26j2.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 { C as writePrivateReviewPayload, ct as openPrivateFile, lt as restrictToOwner, ot as exclusiveLock, ut as windowsOwnerOnly, w as readPrivateReviewPayload } from "./src-CP-K2PBv.mjs";
2
- import { Bt as reviewTermsResultSchema, C as validateBReview, Ft as privacyTermSchema, It as emptyReviewCorrectionResultSchema, Lt as emptyReviewCorrectionSchema, M as semanticFindingSchema, Mn as createDetectionSummary, Rt as journeyTermSchema, St as journeyWorkSuggestionSchema, Wt as termTypeSchema, b as validateReviewAlignment, c as reviewBatchSchema, cr as isStaticCategory, d as reviewSubmitSchema, dt as journeyIdSchema, f as textDigest, gt as nativeJourneySchema, h as reviewAlignmentAudit, hn as fileIdentitySchema, in as ApplicationError, ln as familySelected, lr as staticCategories, lt as journeyDigestSchema, m as findingReferenceKey, p as validateReview, s as reviewBatchChunks, u as reviewDigest, un as reviewFamilies, v as reviewAlignmentSchema, vt as journeyGuidanceSchema, x as bContextEvidence, xt as journeyDescribeSchema, zt as reviewTermsInputSchema } from "./locate-PLEyLYW-.mjs";
3
- import { $ as validateDetectionSummary, $t as journeyPlaceSchema, At as validateAttemptAppend, Bn as journeySearchSaveSchema, Bt as newJourneyWork, Cn as scanAliasResourceSchema, Dn as scanGitSeedsId, En as scanSessionResourceSchema, Fn as journeyInventoryReadSchema, Ft as classificationCommitSchema, Gr as staticSessionId, Gt as hideFinishSchema, Hn as journeyCommitResultSchema, Hr as mergePrivacyTerms, Ht as journeyContextQuerySchema, In as journeyInventorySchema, Ir as obsoleteJourney, J as validateInspectionFence, Jt as sendOutputQuerySchema, Kn as confirmedHideDeltaSchema, Kt as hidePublishSchema, Ln as journeyPreparationProgressSchema, Lr as sendOwesPassport, Mi as stateSchema, Mt as journeyBatchReadSchema, Nn as projectPreparationProgress, Nt as journeyReviewStorageQuerySchema, Ot as settleCorrections, Pt as applyClassificationProposal, Q as validateInspectionContribution, Qt as journeyIsolateSchema, Rr as sendReachedPassport, Si as bMaskedHits, Sr as assertJourneyPrivacyReady, U as validateInspectionBatch, Un as journeyCommitSchema, Ut as journeyContextSchema, Vn as searchScopeDigest, W as validateInspectionBatches, Wn as journeyEventSchema, Wt as hideBeginSchema, X as validateInspectionInputs, Xr as journeySendSchema, Xt as journeyResourceQuerySchema, Y as validateInspectionHead, Yn as settleConfirmedHides, Yt as sendOutputSchema, Z as validateInspectionQuery, Zt as journeyResourceSchema, an as sessionReconcileResultSchema, bn as bReviewDigest, c as reconstructBFields, ci as isSkippedWork, cn as sessionRereadResourceSchema, cr as preparationSettlementSchema, d as resolveGroupSplit, di as withReadingProgress, dn as sessionReviewResourceSchema, dr as preparationUpdateSchema, en as sortingApplySchema, et as inspectionInputs, fi as confirmedHideGroupIds, fn as sessionReviewStatusSchema, fr as validatePreparationFacts, g as semanticGroupKey, gi as dictionaryHides, gn as reviewCandidateResourceSchema, gt as manualUploadSchema, h as hideScopeDigest, hi as confirmedHideTerms, jn as validateScanExclusion, jt as journeyGuidance, kt as attemptBudgetCodePoints, l as chooseCheapPlacement, li as selectedWorks, lr as preparationStartSchema, mn as sessionUsefulnessResourceSchema, nn as reviewAttemptsQuerySchema, nr as workDecisionDigest, o as bRereadDigest, oi as isReadingComplete, on as sessionReconciliationResourceSchema, or as preparationBeginSchema, pi as confirmedHideKey, pn as sessionUsefulnessInputSchema, pt as manualUploadBindingSchema, q as validateInspectionClaim, qt as journeyPolicyRespondSchema, ri as hasCompleteWorkDescription, rn as reviewAttemptsResultSchema, rr as workPrivacyDecisions, s as reconcileBSession, si as isSelectedWork, sr as preparationPermissionSchema, t as scanBatchContextDigest, ti as sendSessionUploadSchema, tn as reviewAttemptResourceSchema, tr as retireWorkDescription, u as reviseGroupMembership, un as sessionReviewQuerySchema, ur as preparationStateSchema, v as projectJourneyInventory, vi as maskedHitsStale, vn as reviewRepairResourceSchema, vt as candidateSortAvailable, wn as scanCanonicalResourceSchema, wr as reconcileReaderKeeps, x as bReviewScope, xn as mergeBRepair, xr as applyCardAnswers, y as preparationScope, yi as syncTermGroups, zn as journeySearchResultSchema, zt as isolatedWorkId } from "./src-CttNuxOn.mjs";
1
+ import { C as writePrivateReviewPayload, ct as openPrivateFile, lt as restrictToOwner, ot as exclusiveLock, ut as windowsOwnerOnly, w as readPrivateReviewPayload } from "./src-CmvEJj46.mjs";
2
+ import { Bt as reviewTermsResultSchema, C as validateBReview, Ft as privacyTermSchema, It as emptyReviewCorrectionResultSchema, Lt as emptyReviewCorrectionSchema, M as semanticFindingSchema, Nn as createDetectionSummary, Rt as journeyTermSchema, St as journeyWorkSuggestionSchema, Wt as termTypeSchema, an as ApplicationError, b as validateReviewAlignment, c as reviewBatchSchema, d as reviewSubmitSchema, dn as reviewFamilies, dt as journeyIdSchema, f as textDigest, gn as fileIdentitySchema, gt as nativeJourneySchema, h as reviewAlignmentAudit, lr as isStaticCategory, lt as journeyDigestSchema, m as findingReferenceKey, p as validateReview, s as reviewBatchChunks, u as reviewDigest, un as familySelected, ur as staticCategories, v as reviewAlignmentSchema, vt as journeyGuidanceSchema, x as bContextEvidence, xt as journeyDescribeSchema, zt as reviewTermsInputSchema } from "./locate-CP2t26j2.mjs";
3
+ import { $ as validateDetectionSummary, $t as journeyPlaceSchema, At as validateAttemptAppend, Bn as journeySearchResultSchema, Bt as newJourneyWork, Ci as bMaskedHits, Cn as scanAliasResourceSchema, Cr as assertJourneyPrivacyReady, Dn as scanGitSeedsId, En as scanSessionResourceSchema, Fn as journeyInventoryReadSchema, Ft as classificationCommitSchema, Gn as journeyEventSchema, Gt as hideFinishSchema, Hn as searchScopeDigest, Ht as journeyContextQuerySchema, In as journeyInventorySchema, J as validateInspectionFence, Jt as sendOutputQuerySchema, Kr as staticSessionId, Kt as hidePublishSchema, Ln as journeyPreparationProgressSchema, Lr as obsoleteJourney, Mt as journeyBatchReadSchema, Ni as stateSchema, Nn as projectPreparationProgress, Nt as journeyReviewStorageQuerySchema, Ot as settleCorrections, Pt as applyClassificationProposal, Q as validateInspectionContribution, Qt as journeyIsolateSchema, Rr as sendOwesPassport, Sr as applyCardAnswers, Tr as reconcileReaderKeeps, U as validateInspectionBatch, Un as journeyCommitResultSchema, Ur as mergePrivacyTerms, Ut as journeyContextSchema, Vn as journeySearchSaveSchema, W as validateInspectionBatches, Wn as journeyCommitSchema, Wt as hideBeginSchema, X as validateInspectionInputs, Xn as settleConfirmedHides, Xt as journeyResourceQuerySchema, Y as validateInspectionHead, Yt as sendOutputSchema, Z as validateInspectionQuery, Zr as journeySendSchema, Zt as journeyResourceSchema, _i as dictionaryHides, an as sessionReconcileResultSchema, bi as syncTermGroups, bn as bReviewDigest, c as reconstructBFields, ci as isSelectedWork, cn as sessionRereadResourceSchema, cr as preparationPermissionSchema, d as resolveGroupSplit, dn as sessionReviewResourceSchema, dr as preparationStateSchema, en as sortingApplySchema, et as inspectionInputs, fi as withReadingProgress, fn as sessionReviewStatusSchema, fr as preparationUpdateSchema, g as semanticGroupKey, gi as confirmedHideTerms, gn as reviewCandidateResourceSchema, gt as manualUploadSchema, h as hideScopeDigest, ii as hasCompleteWorkDescription, ir as workPrivacyDecisions, jn as validateScanExclusion, jt as journeyGuidance, kt as attemptBudgetCodePoints, l as chooseCheapPlacement, li as isSkippedWork, lr as preparationSettlementSchema, mi as confirmedHideKey, mn as sessionUsefulnessResourceSchema, ni as sendSessionUploadSchema, nn as reviewAttemptsQuerySchema, nr as retireWorkDescription, o as bRereadDigest, on as sessionReconciliationResourceSchema, pi as confirmedHideGroupIds, pn as sessionUsefulnessInputSchema, pr as validatePreparationFacts, pt as manualUploadBindingSchema, q as validateInspectionClaim, qn as confirmedHideDeltaSchema, qt as journeyPolicyRespondSchema, rn as reviewAttemptsResultSchema, rr as workDecisionDigest, s as reconcileBSession, si as isReadingComplete, sr as preparationBeginSchema, t as scanBatchContextDigest, tn as reviewAttemptResourceSchema, u as reviseGroupMembership, ui as selectedWorks, un as sessionReviewQuerySchema, ur as preparationStartSchema, v as projectJourneyInventory, vn as reviewRepairResourceSchema, vt as candidateSortAvailable, wn as scanCanonicalResourceSchema, x as bReviewScope, xn as mergeBRepair, y as preparationScope, yi as maskedHitsStale, zr as sendReachedPassport, zt as isolatedWorkId } from "./src-B3il9x5F.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";
@@ -345,7 +345,7 @@ function readJourney(db, journeyId) {
345
345
  const text = row["state_json"];
346
346
  if (typeof text !== "string") throw new ApplicationError("CORRUPTED_STATE");
347
347
  const state = JSON.parse(text);
348
- if (typeof state === "object" && state !== null && "formatVersion" in state && state.formatVersion !== 10) throw new StoreError("OBSOLETE_SCHEMA", "Stored native Journey state uses an obsolete candidate format and has been preserved.");
348
+ if (typeof state === "object" && state !== null && "formatVersion" in state && state.formatVersion !== 10 && state.formatVersion !== 11) throw new StoreError("OBSOLETE_SCHEMA", "Stored native Journey state uses an obsolete candidate format and has been preserved.");
349
349
  let value = reconcileReaderKeeps(nativeJourneySchema.parse(state));
350
350
  if (value.outputVersion !== void 0 && value.outputVersion > 1) throw new StoreError("OBSOLETE_SCHEMA", "This journey requires a newer final writer.");
351
351
  if (value.outputVersion !== 1 && value.phase !== "completed" && !obsoleteJourney(value)) value = {
@@ -519,6 +519,7 @@ function commitJourney(db, input) {
519
519
  ...input,
520
520
  state: {
521
521
  ...stamped,
522
+ formatVersion: 11,
522
523
  ...hideRevision === void 0 ? {} : { confirmedHideRevision: hideRevision }
523
524
  }
524
525
  };
@@ -3809,7 +3810,7 @@ function projection(fields) {
3809
3810
  return (db, journeyId) => {
3810
3811
  const row = db.prepare(sql).get(journeyId);
3811
3812
  if (!row) return null;
3812
- if (row["format"] !== 10) throw new StoreError("OBSOLETE_SCHEMA", "Stored Journey preparation format is obsolete.");
3813
+ if (row["format"] !== 10 && row["format"] !== 11) throw new StoreError("OBSOLETE_SCHEMA", "Stored Journey preparation format is obsolete.");
3813
3814
  const result = {};
3814
3815
  for (const key of fields) {
3815
3816
  const value = row[key];
@@ -5090,7 +5091,7 @@ function checkpointJourneySendTransfer(db, input) {
5090
5091
  const revisionValue = row["revision"];
5091
5092
  if (typeof revisionValue !== "number" || !Number.isSafeInteger(revisionValue) || revisionValue < 0) throw new ApplicationError("CORRUPTED_STATE");
5092
5093
  if (revisionValue !== input.expectedJourneyRevision) return { status: "stale" };
5093
- if (row["formatVersion"] !== 10) throw new StoreError("OBSOLETE_SCHEMA", "Stored native Journey state uses an obsolete candidate format and has been preserved.");
5094
+ if (row["formatVersion"] !== 10 && row["formatVersion"] !== 11) throw new StoreError("OBSOLETE_SCHEMA", "Stored native Journey state uses an obsolete candidate format and has been preserved.");
5094
5095
  if (row["consentType"] !== "object") throw new ApplicationError("CONFIRMATION_REQUIRED");
5095
5096
  if (row["phase"] !== "sending") throw new ApplicationError(row["phase"] === "paused" ? "OPERATION_CANCELED" : "INVALID_TRANSITION");
5096
5097
  if (row["pendingHideId"] !== null && row["pendingHideId"] !== void 0) throw new ApplicationError("REVISION_CONFLICT");
@@ -5128,7 +5129,7 @@ function checkpointJourneySendTransfer(db, input) {
5128
5129
  const lastEvent = Number(inserted.lastInsertRowid);
5129
5130
  if (!Number.isSafeInteger(lastEvent) || lastEvent < 1) throw new ApplicationError("CORRUPTED_STATE");
5130
5131
  if (db.prepare(`UPDATE journey_runs SET revision=?,state_json=json_set(
5131
- state_json,'$.revision',?,'$.lastEvent',?) WHERE id=? AND revision=?`).run(revision, revision, lastEvent, input.journeyId, input.expectedJourneyRevision).changes !== 1) throw new ApplicationError("REVISION_CONFLICT");
5132
+ state_json,'$.formatVersion',11,'$.revision',?,'$.lastEvent',?) WHERE id=? AND revision=?`).run(revision, revision, lastEvent, input.journeyId, input.expectedJourneyRevision).changes !== 1) throw new ApplicationError("REVISION_CONFLICT");
5132
5133
  db.prepare("INSERT INTO journey_receipts VALUES(?,?,?,?)").run(input.requestKey, requestHash, input.journeyId, revision);
5133
5134
  return {
5134
5135
  status: "applied",
@@ -1,7 +1,7 @@
1
- import { et as createInspectionProcessor } from "./src-CP-K2PBv.mjs";
2
- import { Fn as createStaticProcessor } from "./locate-PLEyLYW-.mjs";
3
- import { l as createNativeAdapters, u as createGitNameSeedProvider } from "./src-dL6y2mcu.mjs";
4
- import { G as validateInspectionRequest } from "./src-CttNuxOn.mjs";
1
+ import { et as createInspectionProcessor } from "./src-CmvEJj46.mjs";
2
+ import { In as createStaticProcessor } from "./locate-CP2t26j2.mjs";
3
+ import { l as createNativeAdapters, u as createGitNameSeedProvider } from "./src-CWMrGXJK.mjs";
4
+ import { G as validateInspectionRequest } from "./src-B3il9x5F.mjs";
5
5
  import "./messages-D3m3bhva.mjs";
6
6
  import { z } from "zod";
7
7
  import { parentPort, workerData } from "node:worker_threads";
@@ -1,7 +1,7 @@
1
- import { E as readConfiguredSearchFields, F as parseCollectionWorkspaceSummary, K as readConfiguredOutputInfo, M as renderJobDigest, O as checkReusableBundle, P as readCollectionIndex, S as writeLogicalJourneyBase, U as writeLogicalJourneyOutput, V as gitSeedsProvider, ct as openPrivateFile, dt as isWindowsAclFailure, k as prepareCollectionProduction, m as writeOutputShard, p as verifyOutputShard, st as makePrivateDirectory, ut as windowsOwnerOnly, z as privateCollectionDirectory } from "./src-CP-K2PBv.mjs";
2
- import { C as validateBReview, J as bAnchorKey, Ut as termTypeInfo, X as bDigest, Xt as journeyProfileAddressActionSchema, Z as codePointLength, Zt as journeyProfileLinksActionSchema, d as reviewSubmitSchema, en as passportAddressSchema, f as textDigest, i as matchesReadReceipts, in as ApplicationError, j as bUnitFragments, n as runOccurrences, o as compileBFindings, on as safeCode, p as validateReview, qt as filterInventoryByPeriod, r as termSearchRuns, s as reviewBatchChunks, sn as safeField, t as locateTerms, tt as utf16Offset, un as reviewFamilies, xt as journeyDescribeSchema, y as reviewFindingsDigest, z as bClassificationKey, zt as reviewTermsInputSchema } from "./locate-PLEyLYW-.mjs";
3
- import { $t as journeyPlaceSchema, Ar as retryReviewActionSchema, C as rebindReviewOverlay, Ct as sendActionSchema, D as staticallyHiddenFindings, Di as packageCommandSchema, Dr as nativeGetSchema, Dt as sendStartSchema, E as guardedFindingText, Ei as commandSchema, Er as nativeEventsSchema, Et as sendRequestSchema, Gn as confirmedHideAdditions, H as inspectionStartSchema, Ht as journeyContextQuerySchema, Jn as renderedHideValue, K as inspectionQuerySchema, Kr as staticSessionResourceSchema, Li as defaultScopedSettings, Mi as stateSchema, Nt as journeyReviewStorageQuerySchema, Oi as selectionBatchSchema, Or as nativeRespondSchema, Pn as journeyInventoryQuerySchema, Qn as hideKeyId, Ri as freezeConfiguration, S as rebindReviewAlignment, Sn as planBRepair, St as replaceSensitiveTermsSchema, T as reviewBatchReuse, Tt as sendPrepareSchema, V as inspectionCancelSchema, Vt as reviewCompileSchema, Xn as termHideAdditions, Xt as journeyResourceQuerySchema, Zn as addHideIndexTokens, _n as reviewRepairInputSchema, _r as journeyRenderInputSchema, _t as manualUploadStartSchema, a as bCrossSegmentReviewSchema, b as isGenericPublicTerm, bn as bReviewDigest, bt as maximumTermsFileBytes, c as reconstructBFields, di as withReadingProgress, er as packHideIndex, f as selectedValueMembers, fi as confirmedHideGroupIds, ft as manualUploadActionSchema, gn as reviewCandidateResourceSchema, gr as journeyPreviewSchema, hn as reviewCandidateInputSchema, hr as journeyFindingsSchema, ht as manualUploadPrepareSchema, i as validateBCrossSegmentReview, in as sessionReconcileInputSchema, ji as producerVersion, ki as selectionSchema, ln as sessionReviewInputSchema, mr as journeyFindingImpactSchema, mt as manualUploadChoiceSchema, n as scanBatchEquivalenceDigest, nt as settingsQuerySchema, o as bRereadDigest, p as splitSelectorValues, pn as sessionUsefulnessInputSchema, pr as journeyClassificationSessionsSchema, qn as readConfirmedHideChange, qt as journeyPolicyRespondSchema, r as locateTermEvidence, rt as readWorkspaceOutcomes, s as reconcileBSession, si as isSelectedWork, sn as sessionRereadInputSchema, t as scanBatchContextDigest, tn as reviewAttemptResourceSchema, tt as settingsBatchSchema, un as sessionReviewQuerySchema, ut as resolveFailureLocation, vi as maskedHitsStale, vn as reviewRepairResourceSchema, vr as journeyRenderSchema, w as rebindReviewSubmit, wt as sendChoiceSchema, x as bReviewScope, zi as selectFrozenConfiguration } from "./src-CttNuxOn.mjs";
4
- import { $ as validateState, A as resourceSelectionQuerySchema, B as termReuseQuerySchema, C as loadAcceptedReview, D as aggregateUsefulness, E as loadPrivateResource, F as validateUnitCandidate, G as validateBatchBody, H as privateReviewHash, I as reuseQuerySchema, J as ownership, K as requireActiveBatch, L as batchQuery, M as evaluateUnitEvidence, N as sameCandidateRequest, O as sessionUsefulnessRecommendation, P as validateCandidateAttempt, Q as readStoredState, R as isPrivateResourceKind, S as validateSessionBindings, T as loadBatch, U as batchHeader, V as scanAliasRequestKey, W as createJourneyPayloadFiles, X as withDatabase, Y as validateDatabase, Z as readBundleDirectory, _ as loadReconciliation, _t as errorCode, a as decodeError, at as finishReset, b as validatePreparationSelection, c as dropsAnchor, ct as present, d as parseDelivery, dt as recheckPrivatePath, et as checkVersion, f as validateCandidate, ft as stateDirectory, g as loadPreparedBodies, gt as StoreError, h as loadPreparation, ht as withFileCheckTimings, i as createExecutor, it as databaseName, j as inspectionQuerySchema$1, k as sessionQuery, l as replySchema, lt as privatePath, m as loadStatus, mt as withStateSnapshot, n as releaseInheritedHeapFlags, nt as beginReset, o as ProtocolError, ot as hasResetMarker, p as classificationJourneyCommit, pt as syncDirectory, q as initializeAndClaim, r as storeHeapLimits, rt as createDatabaseFile, s as allowedReplies, st as inspectStateFiles, tt as schemaVersion, u as operations, ut as readResetMarker, v as loadRereadBodies, vt as isCoordinationBusy, w as loadAuthenticatedReview, x as validateSessionReconciliation, y as loadSessionBodies, yt as isSqliteCorruption, z as privateResourceHeader } from "./heap-DCS_WXIA.mjs";
1
+ import { E as readConfiguredSearchFields, F as parseCollectionWorkspaceSummary, K as readConfiguredOutputInfo, M as renderJobDigest, O as checkReusableBundle, P as readCollectionIndex, S as writeLogicalJourneyBase, U as writeLogicalJourneyOutput, V as gitSeedsProvider, ct as openPrivateFile, dt as isWindowsAclFailure, k as prepareCollectionProduction, m as writeOutputShard, p as verifyOutputShard, st as makePrivateDirectory, ut as windowsOwnerOnly, z as privateCollectionDirectory } from "./src-CmvEJj46.mjs";
2
+ import { C as validateBReview, J as bAnchorKey, Ut as termTypeInfo, X as bDigest, Xt as journeyProfileAddressActionSchema, Z as codePointLength, Zt as journeyProfileLinksActionSchema, an as ApplicationError, cn as safeField, d as reviewSubmitSchema, dn as reviewFamilies, en as passportAddressSchema, f as textDigest, i as matchesReadReceipts, j as bUnitFragments, n as runOccurrences, o as compileBFindings, p as validateReview, qt as filterInventoryByPeriod, r as termSearchRuns, s as reviewBatchChunks, sn as safeCode, t as locateTerms, tt as utf16Offset, xt as journeyDescribeSchema, y as reviewFindingsDigest, z as bClassificationKey, zt as reviewTermsInputSchema } from "./locate-CP2t26j2.mjs";
3
+ import { $n as hideKeyId, $t as journeyPlaceSchema, Ai as selectionSchema, Bi as selectFrozenConfiguration, C as rebindReviewOverlay, Ct as sendActionSchema, D as staticallyHiddenFindings, Di as commandSchema, Dr as nativeEventsSchema, Dt as sendStartSchema, E as guardedFindingText, Et as sendRequestSchema, H as inspectionStartSchema, Ht as journeyContextQuerySchema, Jn as readConfirmedHideChange, K as inspectionQuerySchema, Kn as confirmedHideAdditions, Mi as producerVersion, Ni as stateSchema, Nt as journeyReviewStorageQuerySchema, Oi as packageCommandSchema, Or as nativeGetSchema, Pn as journeyInventoryQuerySchema, Qn as addHideIndexTokens, Ri as defaultScopedSettings, S as rebindReviewAlignment, Sn as planBRepair, St as replaceSensitiveTermsSchema, T as reviewBatchReuse, Tt as sendPrepareSchema, V as inspectionCancelSchema, Vt as reviewCompileSchema, Xt as journeyResourceQuerySchema, Yn as renderedHideValue, Zn as termHideAdditions, _n as reviewRepairInputSchema, _r as journeyPreviewSchema, _t as manualUploadStartSchema, a as bCrossSegmentReviewSchema, b as isGenericPublicTerm, bn as bReviewDigest, bt as maximumTermsFileBytes, c as reconstructBFields, ci as isSelectedWork, f as selectedValueMembers, fi as withReadingProgress, ft as manualUploadActionSchema, gn as reviewCandidateResourceSchema, gr as journeyFindingsSchema, hn as reviewCandidateInputSchema, hr as journeyFindingImpactSchema, ht as manualUploadPrepareSchema, i as validateBCrossSegmentReview, in as sessionReconcileInputSchema, jr as retryReviewActionSchema, ki as selectionBatchSchema, kr as nativeRespondSchema, ln as sessionReviewInputSchema, mr as journeyClassificationSessionsSchema, mt as manualUploadChoiceSchema, n as scanBatchEquivalenceDigest, nt as settingsQuerySchema, o as bRereadDigest, p as splitSelectorValues, pi as confirmedHideGroupIds, pn as sessionUsefulnessInputSchema, qr as staticSessionResourceSchema, qt as journeyPolicyRespondSchema, r as locateTermEvidence, rt as readWorkspaceOutcomes, s as reconcileBSession, sn as sessionRereadInputSchema, t as scanBatchContextDigest, tn as reviewAttemptResourceSchema, tr as packHideIndex, tt as settingsBatchSchema, un as sessionReviewQuerySchema, ut as resolveFailureLocation, vn as reviewRepairResourceSchema, vr as journeyRenderInputSchema, w as rebindReviewSubmit, wt as sendChoiceSchema, x as bReviewScope, yi as maskedHitsStale, yr as journeyRenderSchema, zi as freezeConfiguration } from "./src-B3il9x5F.mjs";
4
+ import { $ as validateState, A as resourceSelectionQuerySchema, B as termReuseQuerySchema, C as loadAcceptedReview, D as aggregateUsefulness, E as loadPrivateResource, F as validateUnitCandidate, G as validateBatchBody, H as privateReviewHash, I as reuseQuerySchema, J as ownership, K as requireActiveBatch, L as batchQuery, M as evaluateUnitEvidence, N as sameCandidateRequest, O as sessionUsefulnessRecommendation, P as validateCandidateAttempt, Q as readStoredState, R as isPrivateResourceKind, S as validateSessionBindings, T as loadBatch, U as batchHeader, V as scanAliasRequestKey, W as createJourneyPayloadFiles, X as withDatabase, Y as validateDatabase, Z as readBundleDirectory, _ as loadReconciliation, _t as errorCode, a as decodeError, at as finishReset, b as validatePreparationSelection, c as dropsAnchor, ct as present, d as parseDelivery, dt as recheckPrivatePath, et as checkVersion, f as validateCandidate, ft as stateDirectory, g as loadPreparedBodies, gt as StoreError, h as loadPreparation, ht as withFileCheckTimings, i as createExecutor, it as databaseName, j as inspectionQuerySchema$1, k as sessionQuery, l as replySchema, lt as privatePath, m as loadStatus, mt as withStateSnapshot, n as releaseInheritedHeapFlags, nt as beginReset, o as ProtocolError, ot as hasResetMarker, p as classificationJourneyCommit, pt as syncDirectory, q as initializeAndClaim, r as storeHeapLimits, rt as createDatabaseFile, s as allowedReplies, st as inspectStateFiles, tt as schemaVersion, u as operations, ut as readResetMarker, v as loadRereadBodies, vt as isCoordinationBusy, w as loadAuthenticatedReview, x as validateSessionReconciliation, y as loadSessionBodies, yt as isSqliteCorruption, z as privateResourceHeader } from "./heap-Bh9tySJp.mjs";
5
5
  import { constants, write } from "node:fs";
6
6
  import { z } from "zod";
7
7
  import { copyFile, link, lstat, mkdir, mkdtemp, open, opendir, readFile, readdir, realpath, rename, rm, unlink, writeFile } from "node:fs/promises";
@@ -7202,7 +7202,7 @@ const inspectionSemanticVersions = Object.freeze({
7202
7202
  });
7203
7203
  //#endregion
7204
7204
  //#region packages/processing/src/inspection/binding.ts
7205
- function digest$6(value) {
7205
+ function digest$7(value) {
7206
7206
  return createHash("sha256").update(JSON.stringify(value)).digest("hex");
7207
7207
  }
7208
7208
  function identity(value) {
@@ -7222,14 +7222,14 @@ function sourceSet(values) {
7222
7222
  /** Deliberately accepts no redaction plan; only cleanup changes the retained ID. */
7223
7223
  function bindInspection(input) {
7224
7224
  const shared = {
7225
- sourceSetId: digest$6(["inspection-source-set-1", sourceSet(input.sources)]),
7225
+ sourceSetId: digest$7(["inspection-source-set-1", sourceSet(input.sources)]),
7226
7226
  detectorVersion: currentDetectorVersion,
7227
7227
  detectorConfigurationId: identity(input.detectorConfigurationId),
7228
7228
  parserVersion: identity(input.parserVersion),
7229
7229
  dictionaryVersion: entityDictionaryVersion,
7230
7230
  attributionVersion: identity(input.attributionVersion)
7231
7231
  };
7232
- const originalId = digest$6([
7232
+ const originalId = digest$7([
7233
7233
  originalInspectionVersion,
7234
7234
  shared,
7235
7235
  sourceSet(input.dictionarySources)
@@ -7239,7 +7239,7 @@ function bindInspection(input) {
7239
7239
  ...shared,
7240
7240
  originalId,
7241
7241
  projectionId,
7242
- retainedId: digest$6([
7242
+ retainedId: digest$7([
7243
7243
  "inspection-retained-1",
7244
7244
  originalId,
7245
7245
  projectionId
@@ -7546,7 +7546,7 @@ function createSentenceContext(text) {
7546
7546
  }
7547
7547
  //#endregion
7548
7548
  //#region packages/processing/src/native/masks.ts
7549
- const digest$5 = (text) => createHash("sha256").update(text).digest("hex");
7549
+ const digest$6 = (text) => createHash("sha256").update(text).digest("hex");
7550
7550
  /** Keeps only final retained mask regions and separates pre-static from provable raw offsets. */
7551
7551
  function createNativeMaskCapture(options, originals) {
7552
7552
  const captured = /* @__PURE__ */ new Map();
@@ -7586,8 +7586,8 @@ function createNativeMaskCapture(options, originals) {
7586
7586
  if (value.whole && window === void 0) fail("PROCESSING_INVALID_RECORD");
7587
7587
  const outputText = value.whole ? field.text : value.output;
7588
7588
  const original = originalById.get(value.field.fieldId);
7589
- const inputSha256 = digest$5(value.field.text);
7590
- const outputSha256 = digest$5(outputText);
7589
+ const inputSha256 = digest$6(value.field.text);
7590
+ const outputSha256 = digest$6(outputText);
7591
7591
  const context = createSentenceContext(value.field.text);
7592
7592
  for (const mask of value.masks) {
7593
7593
  let start = mask.outputRange.start;
@@ -8555,6 +8555,8 @@ const safeCodes = /* @__PURE__ */ new Set([
8555
8555
  "ACCOUNT_NOT_CONFIGURED",
8556
8556
  "ACCOUNT_SIGNED_OUT",
8557
8557
  "ACCOUNT_ACCESS_UNAVAILABLE",
8558
+ "ACCOUNT_WORKS_UNAVAILABLE",
8559
+ "ACCOUNT_NOTHING_TO_SEND",
8558
8560
  "JOURNEY_SIGN_IN_REQUIRED",
8559
8561
  "ACCOUNT_PROFILE_UNAVAILABLE",
8560
8562
  "PASSPORT_ADDRESS_TAKEN",
@@ -8714,7 +8716,8 @@ const safeFields = /* @__PURE__ */ new Set([
8714
8716
  "cards.append.term-not-open",
8715
8717
  "cards.append.own-identity-card",
8716
8718
  "cards.append.other-person",
8717
- "classification.late.several-works"
8719
+ "classification.late.several-works",
8720
+ "classification.account-work-split"
8718
8721
  ]);
8719
8722
  function safeField(error) {
8720
8723
  if (!(error instanceof ApplicationError) || !error.field) return null;
@@ -8735,7 +8738,7 @@ const range = z.object({
8735
8738
  start: z.number().int().nonnegative(),
8736
8739
  end: z.number().int().nonnegative()
8737
8740
  }).strict();
8738
- const digest$4 = z.string().regex(/^[a-f0-9]{64}$/u);
8741
+ const digest$5 = z.string().regex(/^[a-f0-9]{64}$/u);
8739
8742
  /** Original static title mask provenance for keyword-only preview/packaging. */
8740
8743
  const classificationTitleMaskSchema = z.object({
8741
8744
  inputRange: range,
@@ -8752,14 +8755,66 @@ const classificationTitleMaskSchema = z.object({
8752
8755
  originalPointer: z.string().nullable(),
8753
8756
  outputPointer: z.string().nullable(),
8754
8757
  sourceRange: range.nullable(),
8755
- inputSha256: digest$4,
8756
- outputSha256: digest$4,
8758
+ inputSha256: digest$5,
8759
+ outputSha256: digest$5,
8757
8760
  context: z.object({
8758
8761
  start: z.number().int().nonnegative(),
8759
8762
  text: z.string()
8760
8763
  }).strict()
8761
8764
  }).strict();
8762
8765
  //#endregion
8766
+ //#region packages/application/src/journey/account-works.ts
8767
+ const digest$4 = z.string().regex(/^[0-9a-f]{64}$/u);
8768
+ const stored = z.object({
8769
+ /** Wire field from issue #131; a formation reply without it is read as no stored metadata. */
8770
+ metadataSha256: digest$4.nullish().transform((value) => value ?? null),
8771
+ key: digest$4,
8772
+ sessionKey: z.string().regex(/^sess-pilot\/[^/]+\/[^/]+\/[^/]+$/u).nullable(),
8773
+ sha256: digest$4,
8774
+ byteLength: z.number().int().positive(),
8775
+ lastAt: z.iso.datetime()
8776
+ });
8777
+ const access = z.enum([
8778
+ "public",
8779
+ "private",
8780
+ "removed"
8781
+ ]);
8782
+ const accountWorksInventorySchema = z.object({
8783
+ works: z.array(z.object({
8784
+ logicalWorkId: z.uuid(),
8785
+ title: z.string().min(1).max(300),
8786
+ access,
8787
+ unitAccess: access,
8788
+ sessions: z.array(stored)
8789
+ })),
8790
+ unassigned: z.array(stored.extend({ removedFromWork: z.uuid().nullish().transform((value) => value ?? null) }))
8791
+ });
8792
+ const accountWorksSchema = z.discriminatedUnion("status", [
8793
+ z.strictObject({
8794
+ status: z.literal("read"),
8795
+ subject: z.string().min(1).max(128),
8796
+ at: z.iso.datetime(),
8797
+ inventory: accountWorksInventorySchema,
8798
+ /** Families with a key unassigned after its Work's removal: no Work, not sent (D4). */
8799
+ leftOut: z.array(z.strictObject({
8800
+ rootSessionId: z.string().min(1).max(128),
8801
+ removedWorkId: z.uuid()
8802
+ })).default([]),
8803
+ /** Families with a held key that are not cleanly placed: no Work, not sent (D9). */
8804
+ heldBack: z.array(z.string().min(1).max(128)).default([]),
8805
+ /** Every family was left out or held back: no Work and no snapshot (#129 review). */
8806
+ nothingToSend: z.literal(true).optional()
8807
+ }),
8808
+ z.strictObject({
8809
+ status: z.literal("signed-out"),
8810
+ at: z.iso.datetime()
8811
+ }),
8812
+ z.strictObject({
8813
+ status: z.literal("unavailable"),
8814
+ at: z.iso.datetime()
8815
+ })
8816
+ ]);
8817
+ //#endregion
8763
8818
  //#region packages/application/src/journey/profile.ts
8764
8819
  /**
8765
8820
  * Passport's own rules (talent-platform `profile-settings.ts`): 1 to 39 letters and digits with
@@ -9518,7 +9573,8 @@ const reviewInterruptionSchema = z.object({
9518
9573
  }).strict();
9519
9574
  const journeyWorkSchema = z.object({
9520
9575
  id: journeyIdSchema,
9521
- title: label,
9576
+ /** 240 characters; an `account` title holds the server's 300 (ADR 0276 D2). */
9577
+ title: z.string().trim().min(1).max(300),
9522
9578
  /** Statically processed repository or folder name; the original stays in the private plan. */
9523
9579
  projectName: label,
9524
9580
  projectType: journeyWorkTypeSchema.nullable(),
@@ -9534,7 +9590,11 @@ const journeyWorkSchema = z.object({
9534
9590
  description: z.string(),
9535
9591
  reason: z.string()
9536
9592
  }).strict().optional(),
9537
- titleOrigin: z.enum(["model", "explicit"]),
9593
+ titleOrigin: z.enum([
9594
+ "model",
9595
+ "explicit",
9596
+ "account"
9597
+ ]),
9538
9598
  explicitTitleId: journeyIdSchema.nullable(),
9539
9599
  accessOrigin: z.enum([
9540
9600
  "default",
@@ -9572,6 +9632,8 @@ const journeyWorkSchema = z.object({
9572
9632
  inputRevision: count$1.min(1),
9573
9633
  /** Placement created this Work (create-work or a sorting "new" decision): its name is generic. */
9574
9634
  createdByPlacement: z.literal(true).optional(),
9635
+ /** Rebuilt at formation from the account Work with this id (ADR 0276 D1); never classified. */
9636
+ accountWork: z.literal(true).optional(),
9575
9637
  /** Host-owned eligibility after removal-only regrouping; never authorizes output by itself. */
9576
9638
  reviewReuseFrom: z.object({
9577
9639
  inputRevision: count$1.min(1),
@@ -9627,7 +9689,7 @@ const journeyWorkSchema = z.object({
9627
9689
  sentBundleId: journeyIdSchema.optional(),
9628
9690
  sentAccess: z.enum(["public", "private"]).optional()
9629
9691
  }).strict().nullable()
9630
- }).strict();
9692
+ }).strict().refine((work) => work.titleOrigin === "account" || work.title.length <= 240, { path: ["title"] });
9631
9693
  const journeyConsentSchema = z.object({
9632
9694
  provider: label,
9633
9695
  allowedAt: z.iso.datetime(),
@@ -9649,7 +9711,7 @@ const journeyExceptionSchema = z.object({
9649
9711
  value: z.string().min(1).max(1024)
9650
9712
  }).strict();
9651
9713
  const nativeJourneySchema = z.object({
9652
- formatVersion: z.literal(10),
9714
+ formatVersion: z.literal([10, 11]),
9653
9715
  outputVersion: z.number().int().positive().optional(),
9654
9716
  classificationRevision: count$1.nullable(),
9655
9717
  privacy: journeyPrivacySchema,
@@ -9719,6 +9781,8 @@ const nativeJourneySchema = z.object({
9719
9781
  * confirmation and Retry set `read`; late classification records only a failure. Absent in a
9720
9782
  * journey of an earlier version, which reads as not `read`.
9721
9783
  */
9784
+ /** Formation read only; never establishes access proof. */
9785
+ accountWorks: accountWorksSchema.optional(),
9722
9786
  accountRead: z.object({
9723
9787
  status: z.enum([
9724
9788
  "read",
@@ -10356,6 +10420,93 @@ function expandBDuplicates(unit, review) {
10356
10420
  };
10357
10421
  }
10358
10422
  //#endregion
10423
+ //#region packages/application/src/journey/b/unit-budget.ts
10424
+ const wide = /[ᄀ-ᇿ⺀-꓏가-힯豈-﫿︰-﹏＀-￯\p{Extended_Pictographic}]/u;
10425
+ /** Matches the reader's estimate; rounds each line up and reserves field headers. */
10426
+ function bUnitBudget(fields) {
10427
+ const lines = [];
10428
+ let end = 0;
10429
+ for (const field of fields) {
10430
+ let start = end;
10431
+ const fieldStart = end;
10432
+ let thirds = 0;
10433
+ const take = () => {
10434
+ if (end > start) lines.push({
10435
+ start,
10436
+ end,
10437
+ tokens: (start === fieldStart ? 40 : 0) + Math.ceil(thirds / 3)
10438
+ });
10439
+ start = end;
10440
+ thirds = 0;
10441
+ };
10442
+ for (const scalar of field.text) {
10443
+ end++;
10444
+ thirds += wide.test(scalar) ? 3 : 1;
10445
+ if (scalar === "\n" || end - start === 64e3) take();
10446
+ }
10447
+ take();
10448
+ }
10449
+ const cores = [];
10450
+ let core = 0;
10451
+ let tokens = 40;
10452
+ const whole = lines.reduce((sum, line) => sum + line.tokens, 0) <= 8e3 && end <= 64e3;
10453
+ for (const line of lines) {
10454
+ const length = line.end - line.start;
10455
+ if (core && !whole && (tokens + line.tokens > 6e3 || core + length > 64e3)) {
10456
+ cores.push(core);
10457
+ core = 0;
10458
+ tokens = 40;
10459
+ }
10460
+ core += length;
10461
+ tokens += line.tokens;
10462
+ }
10463
+ if (core) cores.push(core);
10464
+ const totals = [0];
10465
+ for (const line of lines) totals.push((totals.at(-1) ?? 0) + line.tokens);
10466
+ const boundary = (point) => {
10467
+ let low = 0;
10468
+ let high = lines.length;
10469
+ while (low < high) {
10470
+ const mid = Math.floor((low + high) / 2);
10471
+ if ((lines[mid]?.start ?? Infinity) < point) low = mid + 1;
10472
+ else high = mid;
10473
+ }
10474
+ return low;
10475
+ };
10476
+ function context(start, finish) {
10477
+ const left = boundary(start);
10478
+ const right = boundary(finish);
10479
+ const coreTokens = 40 + (totals[right] ?? 0) - (totals[left] ?? 0);
10480
+ const allowance = coreTokens > 8e3 ? 960 : Math.max(0, Math.min(960, Math.floor((8e3 - coreTokens) / 2) - 40));
10481
+ let before = start;
10482
+ let after = finish;
10483
+ let remaining = allowance;
10484
+ for (let i = left - 1; i >= 0; i--) {
10485
+ const line = lines[i];
10486
+ if (!line || line.tokens > remaining) break;
10487
+ before = line.start;
10488
+ remaining -= line.tokens;
10489
+ }
10490
+ remaining = allowance;
10491
+ for (let i = right; i < lines.length; i++) {
10492
+ const line = lines[i];
10493
+ if (!line || line.tokens > remaining) break;
10494
+ after = line.end;
10495
+ remaining -= line.tokens;
10496
+ }
10497
+ if (before === start && start > 0) before = Math.max(lines[left - 1]?.start ?? 0, start - allowance);
10498
+ if (after === finish && finish < end) after = Math.min(lines[right]?.end ?? end, finish + allowance);
10499
+ return {
10500
+ before,
10501
+ after
10502
+ };
10503
+ }
10504
+ return {
10505
+ cores,
10506
+ context
10507
+ };
10508
+ }
10509
+ //#endregion
10359
10510
  //#region packages/application/src/journey/b/units.ts
10360
10511
  function validateBFields(fields) {
10361
10512
  const ids = /* @__PURE__ */ new Set();
@@ -10426,8 +10577,9 @@ function createBAnalysisUnits(input) {
10426
10577
  };
10427
10578
  });
10428
10579
  if (total === 0) return [];
10580
+ const budget = bUnitBudget(unique);
10429
10581
  const coreSize = total <= 4e4 ? 4e4 : 24e3;
10430
- const cores = input.cores ?? Array.from({ length: Math.ceil(total / coreSize) }, (_, ordinal) => Math.min(coreSize, total - ordinal * coreSize));
10582
+ const cores = input.cores ?? (input.lineContext ? budget.cores : Array.from({ length: Math.ceil(total / coreSize) }, (_, ordinal) => Math.min(coreSize, total - ordinal * coreSize)));
10431
10583
  if (cores.reduce((sum, core) => sum + core, 0) !== total) throw new ApplicationError("INCOMPLETE_REVIEW");
10432
10584
  const totalUnits = cores.length;
10433
10585
  const result = [];
@@ -10435,8 +10587,10 @@ function createBAnalysisUnits(input) {
10435
10587
  for (const [ordinal, core] of cores.entries()) {
10436
10588
  const start = end;
10437
10589
  end += core;
10438
- const before = Math.max(0, start - 8e3);
10439
- const after = Math.min(total, end + 8e3);
10590
+ const { before, after } = input.lineContext ? budget.context(start, end) : {
10591
+ before: Math.max(0, start - 8e3),
10592
+ after: Math.min(total, end + 8e3)
10593
+ };
10440
10594
  const parts = [
10441
10595
  ...totalUnits === 1 ? [] : fragments(positions, before, start, false),
10442
10596
  ...fragments(positions, start, end, true),
@@ -11028,4 +11182,4 @@ function locateTerms(batches, terms) {
11028
11182
  };
11029
11183
  }
11030
11184
  //#endregion
11031
- export { createCodePointIndex as $, validateProfile as $n, ownerProfileSchema as $t, bLegacyBindings as A, currentDetectorVersion as An, decisionCardInputSchema as At, bIssue as B, projectNativeRecord as Bn, reviewTermsResultSchema as Bt, validateBReview as C, projectNativeReviewInput as Cn, siteFields as Cr, hideConfirmSchema as Ct, bBindingCap as D, renderNative as Dn, cardAnswerActionSchema as Dt, validateBUnit as E, createSentenceContext as En, journeyConfigurationSchema as Et, bLiterals as F, createStaticProcessor as Fn, privacyTermSchema as Ft, bReviewSubmissionSchema as G, redactionImplementationVersion as Gn, termTypes as Gt, unownedBObligations as H, cleanupImplementationVersion as Hn, termOverrideValueSchema as Ht, uncoveredBObligations as I, staticDefaults as In, emptyReviewCorrectionResultSchema as It, bAnchorKey as J, nativeItems as Jn, sessionPeriodSchema as Jt, bSessionDecisionSchema as K, nativeBoolean as Kn, deselectOutsidePeriod as Kt, indexBRanges as L, staticOptions as Ln, emptyReviewCorrectionSchema as Lt, semanticFindingSchema as M, createDetectionSummary as Mn, packageConfirmActionSchema as Mt, bLiteralAdmitted as N, gapReasons as Nn, privacyResolveSchema as Nt, bDuplicateMirror as O, createSessionPreparation as On, cardsConfirmActionSchema as Ot, bLiteralTerms as P, walkNativeFields as Pn, privacyTermKey as Pt, codePointSlice as Q, retainedMainTextNodes as Qn, mergeOwnerProfile as Qt, bAdoptedObligations as R, createReplacementKey as Rn, journeyTermSchema as Rt, validateBClassification as S, processNativeRecord as Sn, processingSite as Sr, journeyWorkSuggestionSchema as St, validateBFields as T, reviewRoles as Tn, hidePlanResourceSchema as Tt, bRepresentationSchema as U, entityDictionaryVersion as Un, termTypeInfo as Ut, bOverlaps as V, parseNativeRecord as Vn, termAssessmentSchema as Vt, bRetainedGroupSchema as W, nativeParserVersion as Wn, termTypeSchema as Wt, bDigest as X, transformRecords as Xn, journeyProfileAddressActionSchema as Xt, bEvidenceReader as Y, nativeText as Yn, emptyJourneyProfile as Yt, codePointLength as Z, frameRecords as Zn, journeyProfileLinksActionSchema as Zt, reviewAlignmentInputSchema as _, sessionSchema as _n, defaultDetectionLimits as _r, reviewInterruptionSchema as _t, reviewReadPages as a, UnfinishedJourneyError as an, recordPointerLimits as ar, bMethod as at, validateReviewAlignment as b, nativeSourceIdentitySchema as bn, fail as br, delegatedDecisionSchema as bt, reviewBatchSchema as c, familyNeedsReview as cn, isStaticCategory as cr, journeyChoiceSchema as ct, reviewSubmitSchema as d, sourceGraph as dn, agentContextLocation as dr, journeyIdSchema as dt, passportAddressSchema as en, orderProfile as er, subtractBRanges as et, textDigest as f, sourceKey as fn, createEntityMatcher as fr, journeyKindSchema as ft, reviewAlignmentAuditSchema as g, inventorySchema as gn, scalarBefore as gr, nativeJourneySchema as gt, reviewAlignmentAudit as h, fileIdentitySchema as hn, scalarAfter as hr, journeyWorkTypeSchema as ht, matchesReadReceipts as i, ApplicationError as in, defaultLimits as ir, bIdSchema as it, bUnitFragments as j, inspectionSemanticVersions as jn, emptyJourneyPrivacy as jt, bDuplicateShift as k, bindInspection as kn, cardsSubmitSchema as kt, reviewChunkSchema as l, familySelected as ln, staticCategories as lr, journeyDigestSchema as lt, findingReferenceKey as m, sourceSnapshotId as mn, admitGitName as mr, journeyProjectTypeSchema as mt, runOccurrences as n, respondProfileLinks as nn, validatePlan as nr, bAnchorSchema as nt, compileBFindings as o, safeCode as on, resolveLimits as or, consentedWithoutAccount as ot, validateReview as p, observeSource as pn, admitCustomTerm as pr, journeyPreferenceScopeSchema as pt, bTermSchema as q, nativeField as qn, filterInventoryByPeriod as qt, termSearchRuns as r, classificationTitleMaskSchema as rn, copyData as rr, bCountSchema as rt, reviewBatchChunks as s, safeField as sn, detectStatic as sr, journeyAccessSchema as st, locateTerms as t, profileHasChoices as tn, buildPlan as tr, utf16Offset as tt, reviewDigest as u, reviewFamilies as un, jsonSpans as ur, journeyExceptionSchema as ut, reviewAlignmentSchema as v, sourcePartSchema as vn, ProcessingError as vr, journeyGuidanceSchema as vt, createBAnalysisUnits as w, mainReviewRole as wn, hidePlanInputSchema as wt, bContextEvidence as x, withMandatoryCustomTerms as xn, isProcessingCode as xr, journeyDescribeSchema as xt, reviewFindingsDigest as y, workspaceSchema as yn, declaredVersion as yr, journeyInstructionInputSchema as yt, bClassificationKey as z, sessionNonce as zn, reviewTermsInputSchema as zt };
11185
+ export { createCodePointIndex as $, retainedMainTextNodes as $n, ownerProfileSchema as $t, bLegacyBindings as A, bindInspection as An, decisionCardInputSchema as At, bIssue as B, sessionNonce as Bn, reviewTermsResultSchema as Bt, validateBReview as C, processNativeRecord as Cn, processingSite as Cr, hideConfirmSchema as Ct, bBindingCap as D, createSentenceContext as Dn, cardAnswerActionSchema as Dt, validateBUnit as E, reviewRoles as En, journeyConfigurationSchema as Et, bLiterals as F, walkNativeFields as Fn, privacyTermSchema as Ft, bReviewSubmissionSchema as G, nativeParserVersion as Gn, termTypes as Gt, unownedBObligations as H, parseNativeRecord as Hn, termOverrideValueSchema as Ht, uncoveredBObligations as I, createStaticProcessor as In, emptyReviewCorrectionResultSchema as It, bAnchorKey as J, nativeField as Jn, sessionPeriodSchema as Jt, bSessionDecisionSchema as K, redactionImplementationVersion as Kn, deselectOutsidePeriod as Kt, indexBRanges as L, staticDefaults as Ln, emptyReviewCorrectionSchema as Lt, semanticFindingSchema as M, inspectionSemanticVersions as Mn, packageConfirmActionSchema as Mt, bLiteralAdmitted as N, createDetectionSummary as Nn, privacyResolveSchema as Nt, bDuplicateMirror as O, renderNative as On, cardsConfirmActionSchema as Ot, bLiteralTerms as P, gapReasons as Pn, privacyTermKey as Pt, codePointSlice as Q, frameRecords as Qn, mergeOwnerProfile as Qt, bAdoptedObligations as R, staticOptions as Rn, journeyTermSchema as Rt, validateBClassification as S, withMandatoryCustomTerms as Sn, isProcessingCode as Sr, journeyWorkSuggestionSchema as St, validateBFields as T, mainReviewRole as Tn, hidePlanResourceSchema as Tt, bRepresentationSchema as U, cleanupImplementationVersion as Un, termTypeInfo as Ut, bOverlaps as V, projectNativeRecord as Vn, termAssessmentSchema as Vt, bRetainedGroupSchema as W, entityDictionaryVersion as Wn, termTypeSchema as Wt, bDigest as X, nativeText as Xn, journeyProfileAddressActionSchema as Xt, bEvidenceReader as Y, nativeItems as Yn, emptyJourneyProfile as Yt, codePointLength as Z, transformRecords as Zn, journeyProfileLinksActionSchema as Zt, reviewAlignmentInputSchema as _, inventorySchema as _n, scalarBefore as _r, reviewInterruptionSchema as _t, reviewReadPages as a, ApplicationError as an, defaultLimits as ar, bMethod as at, validateReviewAlignment as b, workspaceSchema as bn, declaredVersion as br, delegatedDecisionSchema as bt, reviewBatchSchema as c, safeField as cn, detectStatic as cr, journeyChoiceSchema as ct, reviewSubmitSchema as d, reviewFamilies as dn, jsonSpans as dr, journeyIdSchema as dt, passportAddressSchema as en, validateProfile as er, subtractBRanges as et, textDigest as f, sourceGraph as fn, agentContextLocation as fr, journeyKindSchema as ft, reviewAlignmentAuditSchema as g, fileIdentitySchema as gn, scalarAfter as gr, nativeJourneySchema as gt, reviewAlignmentAudit as h, sourceSnapshotId as hn, admitGitName as hr, journeyWorkTypeSchema as ht, matchesReadReceipts as i, classificationTitleMaskSchema as in, copyData as ir, bIdSchema as it, bUnitFragments as j, currentDetectorVersion as jn, emptyJourneyPrivacy as jt, bDuplicateShift as k, createSessionPreparation as kn, cardsSubmitSchema as kt, reviewChunkSchema as l, familyNeedsReview as ln, isStaticCategory as lr, journeyDigestSchema as lt, findingReferenceKey as m, observeSource as mn, admitCustomTerm as mr, journeyProjectTypeSchema as mt, runOccurrences as n, respondProfileLinks as nn, buildPlan as nr, bAnchorSchema as nt, compileBFindings as o, UnfinishedJourneyError as on, recordPointerLimits as or, consentedWithoutAccount as ot, validateReview as p, sourceKey as pn, createEntityMatcher as pr, journeyPreferenceScopeSchema as pt, bTermSchema as q, nativeBoolean as qn, filterInventoryByPeriod as qt, termSearchRuns as r, accountWorksInventorySchema as rn, validatePlan as rr, bCountSchema as rt, reviewBatchChunks as s, safeCode as sn, resolveLimits as sr, journeyAccessSchema as st, locateTerms as t, profileHasChoices as tn, orderProfile as tr, utf16Offset as tt, reviewDigest as u, familySelected as un, staticCategories as ur, journeyExceptionSchema as ut, reviewAlignmentSchema as v, sessionSchema as vn, defaultDetectionLimits as vr, journeyGuidanceSchema as vt, createBAnalysisUnits as w, projectNativeReviewInput as wn, siteFields as wr, hidePlanInputSchema as wt, bContextEvidence as x, nativeSourceIdentitySchema as xn, fail as xr, journeyDescribeSchema as xt, reviewFindingsDigest as y, sourcePartSchema as yn, ProcessingError as yr, journeyInstructionInputSchema as yt, bClassificationKey as z, createReplacementKey as zn, reviewTermsInputSchema as zt };
@@ -1,4 +1,4 @@
1
- import "./src-CttNuxOn.mjs";
1
+ import "./src-B3il9x5F.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, g as longCommands, i as invoke, m as parseOptions, n as readOperation, o as createRuntime, r as waitOperation, v as startupFailure } from "./query-BC7MIaWc.mjs";
2
- import { in as ApplicationError, on as safeCode, sn as safeField } from "./locate-PLEyLYW-.mjs";
3
- import "./src-CttNuxOn.mjs";
1
+ import { c as executorRequestSchema, g as longCommands, i as invoke, m as parseOptions, n as readOperation, o as createRuntime, r as waitOperation, v as startupFailure } from "./query-D28k3XOr.mjs";
2
+ import { an as ApplicationError, cn as safeField, sn as safeCode } from "./locate-CP2t26j2.mjs";
3
+ import "./src-B3il9x5F.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-Dod7Vykp.mjs";
1
+ import { n as assertPreviewHeap, o as previewInputSchema, t as runPreview } from "./run-CiJmV__5.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 { At as decisionCardInputSchema, Nt as privacyResolveSchema, Pt as privacyTermKey, a as reviewReadPages, t as locateTerms } from "./locate-PLEyLYW-.mjs";
1
+ import { At as decisionCardInputSchema, Nt as privacyResolveSchema, Pt as privacyTermKey, a as reviewReadPages, t as locateTerms } from "./locate-CP2t26j2.mjs";
2
2
  import { z } from "zod";
3
3
  //#region apps/cli/src/skill-install/privacy-validator.ts
4
4
  const sourceReferenceSchema = z.object({