@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
@@ -1384,12 +1384,12 @@ function withReadingProgress(state) {
1384
1384
  }
1385
1385
  //#endregion
1386
1386
  //#region packages/application/src/journey/static-session.ts
1387
- const count$12 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
1387
+ const count$13 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
1388
1388
  const staticFileSchema = z.object({
1389
1389
  path: z.string().min(1),
1390
1390
  identity: fileIdentitySchema,
1391
1391
  sha256: journeyDigestSchema,
1392
- byteLength: count$12
1392
+ byteLength: count$13
1393
1393
  }).strict();
1394
1394
  /**
1395
1395
  * Track B (ADR 0172): one admitted session of the private packaging base, with every built-in
@@ -1401,7 +1401,7 @@ const staticSessionResourceSchema = z.object({
1401
1401
  kind: z.literal("static-session"),
1402
1402
  journeyId: journeyIdSchema,
1403
1403
  workId: journeyIdSchema,
1404
- inputRevision: count$12.min(1),
1404
+ inputRevision: count$13.min(1),
1405
1405
  snapshotId: journeyDigestSchema,
1406
1406
  sessionId: z.string().min(1).max(128),
1407
1407
  jobDigest: journeyDigestSchema,
@@ -1411,7 +1411,7 @@ const staticSessionResourceSchema = z.object({
1411
1411
  companion: staticFileSchema,
1412
1412
  masks: staticFileSchema,
1413
1413
  /** Model-facing image blocks this session's output leaves out; absent on older receipts. */
1414
- imagesOmitted: count$12.optional()
1414
+ imagesOmitted: count$13.optional()
1415
1415
  }).strict();
1416
1416
  const staticSessionId = (resource) => `${resource.workId}:${resource.inputRevision}:${resource.sessionId}`;
1417
1417
  /** Binds one Work's complete static base to the exact session results it was sealed from. */
@@ -1480,7 +1480,7 @@ const journeyPropagateActionSchema = z.object({
1480
1480
  }).strict();
1481
1481
  //#endregion
1482
1482
  //#region packages/application/src/journey/scope/model.ts
1483
- const count$11 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
1483
+ const count$12 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
1484
1484
  const safeText = z.string().trim().min(1).max(240);
1485
1485
  const journeyScopeConfirmActionSchema = z.object({ kind: z.literal("scope-confirm") }).strict();
1486
1486
  const journeyWorkTypeActionSchema = z.object({
@@ -1496,7 +1496,7 @@ const journeyWorksAccessActionSchema = z.object({
1496
1496
  /** Static-only Work facts for proposing project types and scan scope; no source bodies. */
1497
1497
  const journeyCatalogQuerySchema = z.object({
1498
1498
  journeyId: journeyIdSchema,
1499
- after: count$11.default(0),
1499
+ after: count$12.default(0),
1500
1500
  limit: z.number().int().min(1).max(100).default(50),
1501
1501
  /** Bounded frozen root routing metadata for classification helpers. */
1502
1502
  includeClassificationRouting: z.boolean().optional(),
@@ -1507,13 +1507,13 @@ const journeyCatalogQuerySchema = z.object({
1507
1507
  path: ["includeProjectEvidence"]
1508
1508
  });
1509
1509
  const workspaceKinds = z.object({
1510
- checkout: count$11,
1511
- worktree: count$11,
1512
- folder: count$11,
1513
- scratch: count$11,
1514
- temp: count$11,
1515
- home: count$11,
1516
- unresolved: count$11
1510
+ checkout: count$12,
1511
+ worktree: count$12,
1512
+ folder: count$12,
1513
+ scratch: count$12,
1514
+ temp: count$12,
1515
+ home: count$12,
1516
+ unresolved: count$12
1517
1517
  }).strict();
1518
1518
  const day = z.string().regex(/^\d{4}-\d{2}-\d{2}$/u);
1519
1519
  const journeyCatalogWorkSchema = z.object({
@@ -1526,8 +1526,8 @@ const journeyCatalogWorkSchema = z.object({
1526
1526
  ]),
1527
1527
  access: journeyAccessSchema,
1528
1528
  projectType: journeyWorkTypeSchema.nullable(),
1529
- roots: count$11,
1530
- children: count$11,
1529
+ roots: count$12,
1530
+ children: count$12,
1531
1531
  firstActivity: day.nullable(),
1532
1532
  lastActivity: day.nullable(),
1533
1533
  workspaces: workspaceKinds,
@@ -1541,7 +1541,7 @@ const classificationRootSchema = z.object({
1541
1541
  workspaceKind: z.string().min(1).max(40),
1542
1542
  harness: z.enum(["claude", "codex"]),
1543
1543
  titleAvailable: z.boolean(),
1544
- memberCount: count$11,
1544
+ memberCount: count$12,
1545
1545
  titles: z.array(safeText).max(3),
1546
1546
  projectEvidence: z.object({
1547
1547
  status: z.enum([
@@ -1550,7 +1550,7 @@ const classificationRootSchema = z.object({
1550
1550
  "insufficient"
1551
1551
  ]),
1552
1552
  incomplete: z.boolean(),
1553
- ignored: count$11,
1553
+ ignored: count$12,
1554
1554
  workspace: z.object({
1555
1555
  kind: safeText,
1556
1556
  name: safeText.nullable()
@@ -1558,10 +1558,10 @@ const classificationRootSchema = z.object({
1558
1558
  repositories: z.array(z.object({
1559
1559
  id: z.string().regex(/^[a-f0-9]{64}$/u),
1560
1560
  name: safeText,
1561
- references: count$11,
1562
- reads: count$11,
1563
- changes: count$11,
1564
- commands: count$11
1561
+ references: count$12,
1562
+ reads: count$12,
1563
+ changes: count$12,
1564
+ commands: count$12
1565
1565
  }).strict()).max(8)
1566
1566
  }).strict().optional()
1567
1567
  }).strict();
@@ -1586,11 +1586,11 @@ const classificationAssignmentSchema = z.object({
1586
1586
  }).strict();
1587
1587
  const journeyCatalogSchema = z.object({
1588
1588
  journeyId: journeyIdSchema,
1589
- revision: count$11,
1589
+ revision: count$12,
1590
1590
  scope: z.enum(["pending", "confirmed"]),
1591
- total: count$11,
1591
+ total: count$12,
1592
1592
  works: z.array(journeyCatalogWorkSchema).max(100),
1593
- next: count$11.nullable(),
1593
+ next: count$12.nullable(),
1594
1594
  classificationRouting: z.object({
1595
1595
  knownProjects: z.array(classificationKnownProjectSchema),
1596
1596
  unresolvedRoots: z.array(classificationRootSchema),
@@ -1600,7 +1600,7 @@ const journeyCatalogSchema = z.object({
1600
1600
  /** Model project-type suggestions; explicit and delegated types are never overwritten. */
1601
1601
  const journeyClassifySchema = z.object({
1602
1602
  journeyId: journeyIdSchema,
1603
- expectedRevision: count$11,
1603
+ expectedRevision: count$12,
1604
1604
  idempotencyKey: journeyIdSchema,
1605
1605
  items: z.array(z.object({
1606
1606
  workId: journeyIdSchema,
@@ -2053,12 +2053,12 @@ function respondPrivacy(state, action, source) {
2053
2053
  }
2054
2054
  //#endregion
2055
2055
  //#region packages/application/src/journey/scope/classification.ts
2056
- const count$10 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
2056
+ const count$11 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
2057
2057
  const classificationCursorSchema = z.object({
2058
2058
  snapshotId: journeyDigestSchema,
2059
- inputRevision: count$10,
2059
+ inputRevision: count$11,
2060
2060
  rootSessionId: z.string().min(1).max(128).optional(),
2061
- partIndex: count$10,
2061
+ partIndex: count$11,
2062
2062
  afterOrdinal: z.number().int().min(-1)
2063
2063
  }).strict();
2064
2064
  /** Private frozen content; reading it never records privacy-review coverage. */
@@ -2070,7 +2070,7 @@ const journeyClassificationReadSchema = z.object({
2070
2070
  }).strict();
2071
2071
  const journeyClassificationSubmitSchema = z.object({
2072
2072
  journeyId: journeyIdSchema,
2073
- expectedRevision: count$10,
2073
+ expectedRevision: count$11,
2074
2074
  idempotencyKey: journeyIdSchema,
2075
2075
  items: z.array(z.object({
2076
2076
  projectName: z.string().trim().min(1).max(240),
@@ -2091,7 +2091,7 @@ const journeyClassificationSubmitSchema = z.object({
2091
2091
  * While roots are still being grouped, scan writes keep moving the revision: a later
2092
2092
  * submission is bound to the classification it replaces instead (E2).
2093
2093
  */
2094
- expectedClassificationRevision: count$10.optional()
2094
+ expectedClassificationRevision: count$11.optional()
2095
2095
  }).strict();
2096
2096
  const journeyClassificationSessionsSchema = z.object({
2097
2097
  journeyId: journeyIdSchema,
@@ -2099,7 +2099,7 @@ const journeyClassificationSessionsSchema = z.object({
2099
2099
  rootsOnly: z.boolean().optional(),
2100
2100
  includeProjectEvidence: z.boolean().optional(),
2101
2101
  projectEvidenceRootSessionIds: z.array(z.string().min(1).max(128)).min(1).max(100).optional(),
2102
- after: count$10.default(0),
2102
+ after: count$11.default(0),
2103
2103
  limit: z.number().int().min(1).max(100).default(50)
2104
2104
  }).strict();
2105
2105
  //#endregion
@@ -2504,12 +2504,12 @@ function verifiedScanGitSeeds(resource, snapshotId, roots) {
2504
2504
  }
2505
2505
  //#endregion
2506
2506
  //#region packages/application/src/journey/scan-session.ts
2507
- const count$9 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
2507
+ const count$10 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
2508
2508
  const scanFileSchema = z.object({
2509
2509
  path: z.string().min(1),
2510
2510
  identity: fileIdentitySchema,
2511
2511
  sha256: journeyDigestSchema,
2512
- byteLength: count$9
2512
+ byteLength: count$10
2513
2513
  }).strict();
2514
2514
  /**
2515
2515
  * Track A source-bound prose (`file`) with built-in static protection spans; no delivery archive
@@ -2525,13 +2525,13 @@ const sessionScanInputSchema = z.object({
2525
2525
  native: nativeSourceIdentitySchema,
2526
2526
  facts: z.object({
2527
2527
  representation: z.enum(["jsonl", "jsonl.zst"]),
2528
- byteLength: count$9,
2528
+ byteLength: count$10,
2529
2529
  sha256: journeyDigestSchema
2530
2530
  }).strict()
2531
2531
  }).strict()),
2532
- recordCount: count$9,
2533
- fieldCount: count$9,
2534
- inputUtf16: count$9,
2532
+ recordCount: count$10,
2533
+ fieldCount: count$10,
2534
+ inputUtf16: count$10,
2535
2535
  mainReviewVerified: z.literal(true),
2536
2536
  emptyReviewVerified: z.boolean()
2537
2537
  }).strict().refine((input) => new Set(input.sources.map((source) => source.sourceId)).size === input.sources.length);
@@ -2539,7 +2539,7 @@ const scanSessionResourceSchema = z.object({
2539
2539
  kind: z.literal("scan-session"),
2540
2540
  journeyId: journeyIdSchema,
2541
2541
  workId: journeyIdSchema,
2542
- inputRevision: count$9.min(1),
2542
+ inputRevision: count$10.min(1),
2543
2543
  snapshotId: journeyDigestSchema,
2544
2544
  configurationDigest: journeyDigestSchema,
2545
2545
  rootSessionId: z.string().min(1),
@@ -2558,7 +2558,7 @@ function scanPreparationDigest(resources) {
2558
2558
  const scanBatchBinding = {
2559
2559
  journeyId: journeyIdSchema,
2560
2560
  workId: journeyIdSchema,
2561
- inputRevision: count$9.min(1),
2561
+ inputRevision: count$10.min(1),
2562
2562
  snapshotId: journeyDigestSchema,
2563
2563
  configurationDigest: journeyDigestSchema
2564
2564
  };
@@ -3573,7 +3573,7 @@ const reviewProgressSchema = z.array(z.object({
3573
3573
  }).strict());
3574
3574
  //#endregion
3575
3575
  //#region packages/application/src/journey/review/session-schema.ts
3576
- const count$8 = z.number().int().nonnegative();
3576
+ const count$9 = z.number().int().nonnegative();
3577
3577
  const sessionReviewInputSchema = z.object({
3578
3578
  journeyId: journeyIdSchema,
3579
3579
  workId: journeyIdSchema,
@@ -3594,7 +3594,7 @@ const sessionReviewResourceSchema = z.object({
3594
3594
  workId: journeyIdSchema,
3595
3595
  sessionId: z.string().min(1).max(128),
3596
3596
  snapshotId: journeyDigestSchema,
3597
- inputRevision: count$8.positive(),
3597
+ inputRevision: count$9.positive(),
3598
3598
  requestHash: journeyDigestSchema,
3599
3599
  bindingDigest: journeyDigestSchema,
3600
3600
  at: z.iso.datetime(),
@@ -3608,8 +3608,8 @@ const sessionReviewResourceSchema = z.object({
3608
3608
  issues: z.array(reviewIssueSchema),
3609
3609
  requiresSemantic: z.boolean(),
3610
3610
  usefulness: sessionUsefulnessSchema,
3611
- totalCodePoints: count$8,
3612
- reviewedCodePoints: count$8
3611
+ totalCodePoints: count$9,
3612
+ reviewedCodePoints: count$9
3613
3613
  }).strict();
3614
3614
  const sessionRereadInputSchema = z.object({
3615
3615
  journeyId: journeyIdSchema,
@@ -3618,8 +3618,8 @@ const sessionRereadInputSchema = z.object({
3618
3618
  anchors: z.array(z.object({
3619
3619
  fieldId: z.string().min(1),
3620
3620
  fieldHash: journeyDigestSchema,
3621
- start: count$8,
3622
- end: count$8
3621
+ start: count$9,
3622
+ end: count$9
3623
3623
  }).strict()).min(1).max(128)
3624
3624
  }).strict();
3625
3625
  const sessionRereadResourceSchema = z.object({
@@ -3628,7 +3628,7 @@ const sessionRereadResourceSchema = z.object({
3628
3628
  journeyId: journeyIdSchema,
3629
3629
  workId: journeyIdSchema,
3630
3630
  sessionId: z.string().min(1).max(128),
3631
- inputRevision: count$8.positive(),
3631
+ inputRevision: count$9.positive(),
3632
3632
  snapshotId: journeyDigestSchema,
3633
3633
  sessionReviewId: journeyIdSchema,
3634
3634
  bindingDigest: journeyDigestSchema,
@@ -3646,8 +3646,8 @@ const sessionReconcileInputSchema = z.object({
3646
3646
  alignment: reviewAlignmentSchema
3647
3647
  }).strict();
3648
3648
  const retainedReviewAnchorSchema = bAnchorSchema.extend({
3649
- utf16Start: count$8,
3650
- utf16End: count$8,
3649
+ utf16Start: count$9,
3650
+ utf16End: count$9,
3651
3651
  owned: z.boolean()
3652
3652
  }).strict();
3653
3653
  const sessionOverlaySchema = z.object({
@@ -3661,7 +3661,7 @@ const sessionReconciliationResourceSchema = z.object({
3661
3661
  journeyId: journeyIdSchema,
3662
3662
  workId: journeyIdSchema,
3663
3663
  sessionId: z.string().min(1).max(128),
3664
- inputRevision: count$8.positive(),
3664
+ inputRevision: count$9.positive(),
3665
3665
  snapshotId: journeyDigestSchema,
3666
3666
  sessionReviewId: journeyIdSchema,
3667
3667
  bindingDigest: journeyDigestSchema,
@@ -3689,8 +3689,8 @@ const sessionReviewQuerySchema = z.object({
3689
3689
  workId: journeyIdSchema.optional(),
3690
3690
  sessionId: z.string().min(1).max(128).optional(),
3691
3691
  sessionReviewId: journeyIdSchema.optional(),
3692
- afterHit: count$8.default(0),
3693
- limit: count$8.positive().max(500).default(100)
3692
+ afterHit: count$9.default(0),
3693
+ limit: count$9.positive().max(500).default(100)
3694
3694
  }).strict();
3695
3695
  const sessionReviewStatusSchema = z.object({
3696
3696
  complete: z.boolean(),
@@ -3706,8 +3706,8 @@ const sessionReviewStatusSchema = z.object({
3706
3706
  requiresHumanDecision: z.boolean(),
3707
3707
  requiresSemantic: z.boolean(),
3708
3708
  issues: z.array(reviewIssueSchema),
3709
- totalCodePoints: count$8,
3710
- reviewedCodePoints: count$8,
3709
+ totalCodePoints: count$9,
3710
+ reviewedCodePoints: count$9,
3711
3711
  reconciliationId: journeyIdSchema.nullable(),
3712
3712
  /** ADR 0086: a read unit of the session suggests excluding it; advice, never a gate. */
3713
3713
  suggestExclude: z.boolean(),
@@ -3715,8 +3715,8 @@ const sessionReviewStatusSchema = z.object({
3715
3715
  reason: z.string().min(1).max(2e3).nullable()
3716
3716
  }).strict()),
3717
3717
  hits: z.array(sessionReviewHitSchema),
3718
- nextHit: count$8.nullable(),
3719
- totalHits: count$8
3718
+ nextHit: count$9.nullable(),
3719
+ totalHits: count$9
3720
3720
  }).strict();
3721
3721
  const sessionReviewResultSchema = z.object({
3722
3722
  preparation: sessionReviewResourceSchema,
@@ -3800,13 +3800,13 @@ const metadataFieldsSchema = z.object({
3800
3800
  }).strict();
3801
3801
  //#endregion
3802
3802
  //#region packages/application/src/journey/placement/routing-schema.ts
3803
- const count$7 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
3803
+ const count$8 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
3804
3804
  const bucket = z.object({
3805
3805
  complete: z.boolean(),
3806
- total: count$7,
3806
+ total: count$8,
3807
3807
  repositories: z.array(z.object({
3808
3808
  id: z.string().min(1),
3809
- count: count$7.min(1)
3809
+ count: count$8.min(1)
3810
3810
  }).strict())
3811
3811
  }).strict();
3812
3812
  const placementSignalsSchema = z.object({
@@ -3824,8 +3824,8 @@ const cheapPlacementSchema = z.object({
3824
3824
  "name"
3825
3825
  ]),
3826
3826
  confidence: z.enum(["high", "medium"]),
3827
- matched: count$7.min(1),
3828
- total: count$7.min(1),
3827
+ matched: count$8.min(1),
3828
+ total: count$8.min(1),
3829
3829
  otherRepositoryIds: z.array(z.string())
3830
3830
  }).strict();
3831
3831
  const sortingResourceSchema = z.object({
@@ -3846,26 +3846,26 @@ const sortingResourceSchema = z.object({
3846
3846
  const sortingApplySchema = z.object({
3847
3847
  journeyId: z.uuid(),
3848
3848
  sessionId: z.string().min(1).max(128),
3849
- expectedRevision: count$7,
3849
+ expectedRevision: count$8,
3850
3850
  idempotencyKey: z.uuid()
3851
3851
  }).strict();
3852
3852
  /** Preparation moves identified failing roots of one pending Work into its blocked Work. */
3853
3853
  const journeyIsolateSchema = z.object({
3854
3854
  journeyId: z.uuid(),
3855
3855
  workId: z.uuid(),
3856
- inputRevision: count$7.min(1),
3856
+ inputRevision: count$8.min(1),
3857
3857
  roots: z.array(z.object({
3858
3858
  sessionId: z.string().min(1).max(128),
3859
3859
  code: z.string().regex(/^[A-Z_]{3,80}$/u)
3860
3860
  }).strict()).min(1).max(1e5),
3861
- expectedRevision: count$7,
3861
+ expectedRevision: count$8,
3862
3862
  idempotencyKey: z.uuid()
3863
3863
  }).strict();
3864
3864
  const placement = z.object({
3865
3865
  workId: z.uuid(),
3866
3866
  sessionId: z.string().min(1).max(128),
3867
- inputRevision: count$7.min(1),
3868
- throughEvent: count$7,
3867
+ inputRevision: count$8.min(1),
3868
+ throughEvent: count$8,
3869
3869
  contextDigest: z.string().regex(/^[a-f0-9]{64}$/u),
3870
3870
  decision: z.enum([
3871
3871
  "join",
@@ -3881,13 +3881,13 @@ const placement = z.object({
3881
3881
  }).strict();
3882
3882
  const journeyPlaceSchema = z.object({
3883
3883
  journeyId: z.uuid(),
3884
- expectedRevision: count$7,
3884
+ expectedRevision: count$8,
3885
3885
  idempotencyKey: z.uuid(),
3886
3886
  placements: z.array(placement).min(1).max(1e3)
3887
3887
  }).strict();
3888
3888
  //#endregion
3889
3889
  //#region packages/application/src/journey/scope/progress.ts
3890
- const count$6 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
3890
+ const count$7 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
3891
3891
  const ids = z.array(z.string().min(1).max(128)).max(1e5).refine((values) => new Set(values).size === values.length);
3892
3892
  const journeyClassificationProgressSchema = z.object({
3893
3893
  journeyId: journeyIdSchema,
@@ -3895,8 +3895,8 @@ const journeyClassificationProgressSchema = z.object({
3895
3895
  id: z.literal("current"),
3896
3896
  snapshotId: journeyDigestSchema,
3897
3897
  inputFingerprint: journeyDigestSchema,
3898
- baselineRevision: count$6,
3899
- proposalRevision: count$6.nullable(),
3898
+ baselineRevision: count$7,
3899
+ proposalRevision: count$7.nullable(),
3900
3900
  stage: z.enum(["classification", "proposal"]),
3901
3901
  status: z.enum([
3902
3902
  "running",
@@ -3906,7 +3906,7 @@ const journeyClassificationProgressSchema = z.object({
3906
3906
  ]),
3907
3907
  startedAt: z.iso.datetime(),
3908
3908
  updatedAt: z.iso.datetime(),
3909
- elapsedMs: count$6,
3909
+ elapsedMs: count$7,
3910
3910
  rootIds: ids,
3911
3911
  completedRootIds: ids,
3912
3912
  groupedRootIds: ids,
@@ -4169,7 +4169,7 @@ const journeyPolicyRespondSchema = z.object({
4169
4169
  }).strict();
4170
4170
  //#endregion
4171
4171
  //#region packages/application/src/journey/search.ts
4172
- const count$5 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
4172
+ const count$6 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
4173
4173
  const term = z.string().min(1).max(1024).refine((value) => Buffer.byteLength(value) <= 1024 && !/[\0\r\n]/u.test(value));
4174
4174
  const journeySearchSchema = z.object({
4175
4175
  journeyId: journeyIdSchema,
@@ -4183,11 +4183,11 @@ const journeySearchResultSchema = z.object({
4183
4183
  binding: z.object({
4184
4184
  journeyId: journeyIdSchema,
4185
4185
  snapshotId: journeyDigestSchema,
4186
- revision: count$5,
4186
+ revision: count$6,
4187
4187
  scopeDigest: journeyDigestSchema,
4188
4188
  outputs: z.array(z.object({
4189
4189
  workId: journeyIdSchema,
4190
- outputRevision: count$5,
4190
+ outputRevision: count$6,
4191
4191
  sha256: journeyDigestSchema
4192
4192
  }).strict())
4193
4193
  }).strict(),
@@ -4204,10 +4204,10 @@ const journeySearchResultSchema = z.object({
4204
4204
  terms: z.array(z.object({
4205
4205
  id: z.string(),
4206
4206
  tried: z.array(z.string()),
4207
- sentMatches: count$5.nullable(),
4208
- originalMatches: count$5.nullable(),
4209
- sentSessions: count$5.nullable(),
4210
- originalSessions: count$5.nullable()
4207
+ sentMatches: count$6.nullable(),
4208
+ originalMatches: count$6.nullable(),
4209
+ sentSessions: count$6.nullable(),
4210
+ originalSessions: count$6.nullable()
4211
4211
  }).strict()),
4212
4212
  hits: z.array(z.object({
4213
4213
  termId: z.string(),
@@ -4223,16 +4223,16 @@ const journeySearchResultSchema = z.object({
4223
4223
  archiveSessionId: z.string().optional(),
4224
4224
  sessionId: z.string().optional(),
4225
4225
  sourcePartId: z.string().optional(),
4226
- recordIndex: count$5,
4226
+ recordIndex: count$6,
4227
4227
  fieldId: z.string(),
4228
- line: count$5
4228
+ line: count$6
4229
4229
  }).strict(),
4230
- occurrences: count$5,
4230
+ occurrences: count$6,
4231
4231
  modelContext: z.string().max(4096).optional(),
4232
4232
  match: z.object({
4233
- variantIndex: count$5.max(7),
4234
- start: count$5,
4235
- end: count$5
4233
+ variantIndex: count$6.max(7),
4234
+ start: count$6,
4235
+ end: count$6
4236
4236
  }).strict().optional()
4237
4237
  }).strict()),
4238
4238
  failures: z.array(z.object({
@@ -4255,7 +4255,7 @@ const journeySearchResultSchema = z.object({
4255
4255
  }));
4256
4256
  const journeySearchSaveSchema = z.object({
4257
4257
  journeyId: journeyIdSchema,
4258
- expectedRevision: count$5,
4258
+ expectedRevision: count$6,
4259
4259
  idempotencyKey: journeyIdSchema,
4260
4260
  result: journeySearchResultSchema
4261
4261
  }).strict();
@@ -4292,10 +4292,10 @@ const hideFinishSchema = z.object({
4292
4292
  }).strict();
4293
4293
  //#endregion
4294
4294
  //#region packages/application/src/journey/placement/context-schema.ts
4295
- const count$4 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
4295
+ const count$5 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
4296
4296
  const cursor = z.object({
4297
- inputRevision: count$4.min(1),
4298
- throughEvent: count$4,
4297
+ inputRevision: count$5.min(1),
4298
+ throughEvent: count$5,
4299
4299
  afterOrdinal: z.number().int().min(-1)
4300
4300
  }).strict();
4301
4301
  const journeyContextQuerySchema = z.object({
@@ -4308,14 +4308,14 @@ const journeyContextSchema = z.object({
4308
4308
  journeyId: z.uuid(),
4309
4309
  workId: z.uuid(),
4310
4310
  sessionId: z.string().min(1).max(128).nullable(),
4311
- inputRevision: count$4.min(1),
4311
+ inputRevision: count$5.min(1),
4312
4312
  explicitTitleId: z.uuid().nullable(),
4313
4313
  titleReview: z.object({
4314
4314
  id: z.uuid(),
4315
4315
  text: z.string().min(1).max(240),
4316
4316
  sha256: z.string().regex(/^[a-f0-9]{64}$/u)
4317
4317
  }).strict().nullable(),
4318
- throughEvent: count$4,
4318
+ throughEvent: count$5,
4319
4319
  digest: z.string().regex(/^[a-f0-9]{64}$/u),
4320
4320
  decisionDigest: z.string().regex(/^[a-f0-9]{64}$/u),
4321
4321
  decisions: z.array(z.object({
@@ -4333,13 +4333,13 @@ const journeyContextSchema = z.object({
4333
4333
  confirmed: z.boolean()
4334
4334
  }).strict()),
4335
4335
  describedCheckpoints: z.array(z.enum(["initial", "complete"])).max(2),
4336
- totalBatches: count$4,
4337
- reviewedBatches: count$4,
4336
+ totalBatches: count$5,
4337
+ reviewedBatches: count$5,
4338
4338
  complete: z.boolean(),
4339
4339
  placementReviewed: z.boolean(),
4340
4340
  fragments: z.array(z.object({
4341
4341
  batchId: z.uuid(),
4342
- ordinal: count$4
4342
+ ordinal: count$5
4343
4343
  }).strict()).max(16),
4344
4344
  cursor: cursor.nullable()
4345
4345
  }).strict();
@@ -4367,6 +4367,268 @@ z.discriminatedUnion("kind", [z.object({
4367
4367
  submission: sessionReconcileInputSchema
4368
4368
  }).strict()]);
4369
4369
  //#endregion
4370
+ //#region packages/application/src/journey/placement/work.ts
4371
+ /** The processed project name is both the initial title and the retired-description fallback. */
4372
+ function newJourneyWork(id, projectName, rootSessionIds, sourceWorkspaceIds, placement = "placed") {
4373
+ return {
4374
+ id,
4375
+ title: projectName,
4376
+ projectName,
4377
+ projectType: null,
4378
+ description: "",
4379
+ titleOrigin: "model",
4380
+ explicitTitleId: null,
4381
+ accessOrigin: "default",
4382
+ placement,
4383
+ suggestion: null,
4384
+ classificationRecommendation: null,
4385
+ sourceWorkspaceIds,
4386
+ rootSessionIds,
4387
+ grouping: sourceWorkspaceIds.length === 1 ? "workspace" : "regrouped",
4388
+ access: "private",
4389
+ accessConfirmed: false,
4390
+ reason: "Awaiting content review.",
4391
+ revision: 1,
4392
+ inputRevision: 1,
4393
+ status: "pending",
4394
+ totalBatches: 0,
4395
+ completedBatches: 0,
4396
+ groupIds: [],
4397
+ blockedCodes: [],
4398
+ artifact: null,
4399
+ binding: null
4400
+ };
4401
+ }
4402
+ //#endregion
4403
+ //#region packages/application/src/journey/scan-generation.ts
4404
+ /** Retire one scan generation while preserving the person's confirmed classification. */
4405
+ function retireScanGeneration(state, workId) {
4406
+ if (!state.works.some((work) => work.id === workId)) throw new ApplicationError("UNKNOWN_ITEM");
4407
+ const changedKeys = /* @__PURE__ */ new Set();
4408
+ const terms = state.privacy.terms.flatMap((term) => {
4409
+ if (!term.sources.some((source) => source.workId === workId)) return [term];
4410
+ changedKeys.add(privacyTermKey(term));
4411
+ const sources = term.sources.filter((source) => source.workId !== workId);
4412
+ return sources.length ? [{
4413
+ ...term,
4414
+ sources,
4415
+ disposition: term.disposition === "keep" ? "pending" : term.disposition
4416
+ }] : [];
4417
+ });
4418
+ return {
4419
+ ...state,
4420
+ readingComplete: false,
4421
+ phase: state.phase === "paused" ? "paused" : "processing",
4422
+ privacy: {
4423
+ ...state.privacy,
4424
+ terms,
4425
+ cards: state.privacy.cards.filter((card) => card.termKeys.every((key) => !changedKeys.has(key))),
4426
+ confirmedAnswersRevision: null,
4427
+ packageApproval: null
4428
+ },
4429
+ works: state.works.map((work) => work.id === workId ? resetWorkScan(work) : work)
4430
+ };
4431
+ }
4432
+ /** The same Work with a new scan generation: it is read again from its first session. */
4433
+ function resetWorkScan(work) {
4434
+ const { emptyReview: _empty, excludedReview: _excluded, staticReview: _static, metadataReviewedDigest: _metadata, reviewReuseFrom: _reuse, renderFailure: _failure, ...retained } = work;
4435
+ return {
4436
+ ...retained,
4437
+ revision: work.revision + 1,
4438
+ inputRevision: work.inputRevision + 1,
4439
+ status: "pending",
4440
+ suggestion: null,
4441
+ totalBatches: 0,
4442
+ completedBatches: 0,
4443
+ groupIds: [],
4444
+ blockedCodes: [],
4445
+ artifact: null
4446
+ };
4447
+ }
4448
+ //#endregion
4449
+ //#region packages/application/src/journey/scope/proposal.ts
4450
+ const count$4 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
4451
+ const workspaces = z.array(z.string().min(1).max(128));
4452
+ /**
4453
+ * A complete classification proposal prepared outside the store and applied inside one store
4454
+ * transaction against the current state (BL-216). New Work IDs and the session of every finding
4455
+ * chunk the regrouping moves are resolved beforehand, so applying it needs no I/O.
4456
+ */
4457
+ const classificationCommitSchema = z.object({
4458
+ journeyId: journeyIdSchema,
4459
+ requestKey: journeyIdSchema,
4460
+ requestHash: journeyDigestSchema,
4461
+ at: z.iso.datetime(),
4462
+ /** Unbound proposals keep the exact journey revision fence. */
4463
+ expectedRevision: count$4,
4464
+ /** Bound proposals (E2) are fenced on the classification they replace instead. */
4465
+ expectedClassificationRevision: count$4.nullable(),
4466
+ snapshotId: journeyDigestSchema,
4467
+ /** `classificationPartition` of the state the proposal was prepared against. */
4468
+ partition: journeyDigestSchema,
4469
+ late: z.boolean(),
4470
+ items: z.array(journeyClassificationSubmitSchema.shape.items.element.extend({
4471
+ workId: journeyIdSchema,
4472
+ workspaceIds: workspaces
4473
+ })).min(1).max(1e3),
4474
+ pending: z.object({
4475
+ workId: journeyIdSchema,
4476
+ rootSessionIds: z.array(z.string().min(1).max(128)).min(1).max(1e4),
4477
+ workspaceIds: workspaces
4478
+ }).strict().nullable(),
4479
+ chunkSessions: z.array(z.object({
4480
+ batchId: z.uuid(),
4481
+ chunkId: z.uuid(),
4482
+ sessionId: z.string().min(1).max(128)
4483
+ }).strict()).max(1e6)
4484
+ }).strict();
4485
+ /** The Works and roots a proposal regroups; scan progress and access never change it. */
4486
+ function classificationPartition(state) {
4487
+ return createHash("sha256").update(JSON.stringify(state.works.map((work) => [
4488
+ work.id,
4489
+ work.placement,
4490
+ work.rootSessionIds.toSorted()
4491
+ ]))).digest("hex");
4492
+ }
4493
+ /** The proposal's Works built from the given state's current Works (E2). */
4494
+ function classificationWorks(state, plan) {
4495
+ const late = plan.late;
4496
+ const works = [];
4497
+ for (const item of plan.items) {
4498
+ const existing = state.works.find((work) => work.placement !== "classifying" && work.rootSessionIds.length === item.rootSessionIds.length && work.rootSessionIds.every((root) => item.rootSessionIds.includes(root)));
4499
+ const extended = late ? state.works.find((work) => work.placement === "placed" && work.rootSessionIds.every((root) => item.rootSessionIds.includes(root))) : void 0;
4500
+ if (late && existing) {
4501
+ works.push(existing);
4502
+ continue;
4503
+ }
4504
+ const base = existing ?? (extended ? {
4505
+ ...resetWorkScan(extended),
4506
+ rootSessionIds: item.rootSessionIds,
4507
+ sourceWorkspaceIds: [.../* @__PURE__ */ new Set([...extended.sourceWorkspaceIds, ...item.workspaceIds])]
4508
+ } : newJourneyWork(item.workId, item.projectName, item.rootSessionIds, item.workspaceIds, "placed"));
4509
+ const { classificationMetadata: _display, ...original } = base;
4510
+ works.push({
4511
+ ...original,
4512
+ projectName: item.projectName,
4513
+ title: base.titleOrigin === "explicit" ? base.title : item.projectName,
4514
+ description: item.description,
4515
+ projectType: {
4516
+ type: item.projectType,
4517
+ reason: item.recommendation.reason,
4518
+ origin: "model"
4519
+ },
4520
+ placement: "placed",
4521
+ ...late && !extended ? {
4522
+ access: item.recommendation.access,
4523
+ accessOrigin: "model",
4524
+ accessConfirmed: true
4525
+ } : {},
4526
+ classificationRecommendation: item.recommendation,
4527
+ suggestion: null,
4528
+ artifact: null,
4529
+ revision: base.revision + 1
4530
+ });
4531
+ }
4532
+ const pending = plan.pending;
4533
+ if (pending) {
4534
+ const prior = state.works.find((work) => work.placement === "classifying" && work.rootSessionIds.length === pending.rootSessionIds.length && work.rootSessionIds.every((root) => pending.rootSessionIds.includes(root)));
4535
+ works.push(prior ?? newJourneyWork(pending.workId, "Still being grouped", pending.rootSessionIds, pending.workspaceIds, "classifying"));
4536
+ }
4537
+ const fields = (work) => JSON.stringify([
4538
+ work?.title,
4539
+ work?.projectName,
4540
+ work?.description,
4541
+ work?.classificationRecommendation?.reason
4542
+ ]);
4543
+ return {
4544
+ works,
4545
+ changedMetadata: new Set(works.filter((work) => {
4546
+ const old = state.works.find((item) => item.id === work.id);
4547
+ return !old || fields(work) !== fields(old);
4548
+ }).map((work) => work.id))
4549
+ };
4550
+ }
4551
+ /**
4552
+ * Rebind accepted frozen evidence; original batch/chunk IDs remain its audit provenance. Null
4553
+ * when a finding in a moved Work was not resolved beforehand, so the proposal is stale.
4554
+ */
4555
+ function regroupTerms(terms, works, changedMetadata, chunkSessions) {
4556
+ const owners = new Map(works.flatMap((work) => work.rootSessionIds.map((id) => [id, work.id])));
4557
+ const retained = new Set(works.map((work) => work.id));
4558
+ const sessions = new Map(chunkSessions.map((item) => [`${item.batchId}:${item.chunkId}`, item.sessionId]));
4559
+ const regrouped = [];
4560
+ for (const term of terms) {
4561
+ const sources = [];
4562
+ for (const source of term.sources) {
4563
+ if (source.kind === "metadata") {
4564
+ if (retained.has(source.workId) && !changedMetadata.has(source.workId)) sources.push(source);
4565
+ continue;
4566
+ }
4567
+ if (retained.has(source.workId)) {
4568
+ sources.push(source);
4569
+ continue;
4570
+ }
4571
+ const session = sessions.get(`${source.batchId}:${source.chunkId}`);
4572
+ if (session === void 0) return null;
4573
+ const workId = owners.get(session);
4574
+ if (!workId) throw new ApplicationError("CORRUPTED_STATE");
4575
+ sources.push({
4576
+ ...source,
4577
+ workId
4578
+ });
4579
+ }
4580
+ regrouped.push({
4581
+ ...term,
4582
+ sources
4583
+ });
4584
+ }
4585
+ return regrouped;
4586
+ }
4587
+ /**
4588
+ * The proposal applied to the current state, or null when it is stale: the classification, the
4589
+ * frozen snapshot, the regrouped Works and roots, or the scope changed since it was prepared.
4590
+ * Scan progress, Work input revisions and the person's visibility choices do not make it stale;
4591
+ * they are kept as the current state has them.
4592
+ */
4593
+ function applyClassificationProposal(state, plan) {
4594
+ const classifying = isClassifying(state);
4595
+ if (!state.consent || state.journeyId !== plan.journeyId || (plan.expectedClassificationRevision === null ? state.revision !== plan.expectedRevision : !classifying || state.classificationRevision !== plan.expectedClassificationRevision) || state.snapshotId !== plan.snapshotId || state.scope.status === "confirmed" !== plan.late || plan.late && !classifying || state.phase === "paused" || state.pendingHideId || classificationPartition(state) !== plan.partition) return null;
4596
+ const { works, changedMetadata } = classificationWorks(state, plan);
4597
+ const retained = new Set(works.map((work) => work.id));
4598
+ const regrouped = !plan.late && (state.works.some((work) => !retained.has(work.id)) || changedMetadata.size > 0);
4599
+ const cardTerms = new Set(state.privacy.cards.flatMap((card) => card.termKeys));
4600
+ const preserved = regroupTerms(state.privacy.terms, works, changedMetadata, plan.chunkSessions);
4601
+ if (!preserved) return null;
4602
+ const forced = new Set(preserved.filter((term) => !termTypeInfo[term.type].asked).map((term) => term.value));
4603
+ const overrides = new Map(state.valueOverrides?.map((item) => [item.value, item.choice]) ?? []);
4604
+ const terms = preserved.map((term) => ({
4605
+ ...term,
4606
+ disposition: forced.has(term.value) ? "hidden" : overrides.has(term.value) ? overrides.get(term.value) === "hide" ? "hidden" : "keep" : regrouped && cardTerms.has(privacyTermKey(term)) ? "pending" : term.disposition
4607
+ }));
4608
+ return {
4609
+ ...state,
4610
+ works,
4611
+ classificationRevision: state.revision + 1,
4612
+ scope: plan.late ? state.scope : {
4613
+ status: "pending",
4614
+ actor: null,
4615
+ at: null
4616
+ },
4617
+ privacy: {
4618
+ ...state.privacy,
4619
+ terms,
4620
+ packageApproval: null,
4621
+ ...regrouped ? {
4622
+ cards: [],
4623
+ answersRevision: state.privacy.answersRevision + 1,
4624
+ confirmedAnswersRevision: null
4625
+ } : {}
4626
+ },
4627
+ readingComplete: !plan.pending && works.filter((work) => work.access !== "drop").every((work) => work.totalBatches > 0 && work.completedBatches === work.totalBatches),
4628
+ phase: "processing"
4629
+ };
4630
+ }
4631
+ //#endregion
4370
4632
  //#region packages/application/src/journey/review/port.ts
4371
4633
  /** Batches are served in publication order; only a Drop or un-Drop invalidates a cursor. */
4372
4634
  const journeyReadCursorSchema = z.object({
@@ -6007,7 +6269,7 @@ function createNativeJourney(storage, now = () => (/* @__PURE__ */ new Date()).t
6007
6269
  events: rows,
6008
6270
  state: await get({ journeyId: input.journeyId })
6009
6271
  };
6010
- await setTimeout$1(Math.min(250, Math.max(0, deadline - Date.now())), void 0, { signal });
6272
+ await setTimeout$1(Math.min(1e3, Math.max(0, deadline - Date.now())), void 0, { signal });
6011
6273
  }
6012
6274
  }
6013
6275
  async function prepare(value, signal) {
@@ -6110,7 +6372,7 @@ function createNativeJourney(storage, now = () => (/* @__PURE__ */ new Date()).t
6110
6372
  const scope = await port.renderScope?.(journeyId, workIds.length, signal);
6111
6373
  const renderWork = scope ? (workId) => scope.render(workId) : (workId) => port.render(journeyId, workId, signal);
6112
6374
  try {
6113
- await Promise.all(Array.from({ length: Math.min(scope?.concurrency ?? renderConcurrency, workIds.length) }, async () => {
6375
+ const failure = (await Promise.allSettled(Array.from({ length: Math.min(scope?.concurrency ?? renderConcurrency, workIds.length) }, async () => {
6114
6376
  for (let workId = workIds[next++]; workId !== void 0; workId = workIds[next++]) {
6115
6377
  try {
6116
6378
  await renderWork(workId);
@@ -6129,7 +6391,8 @@ function createNativeJourney(storage, now = () => (/* @__PURE__ */ new Date()).t
6129
6391
  }
6130
6392
  await new Promise((resolve) => setImmediate(resolve));
6131
6393
  }
6132
- }));
6394
+ }))).find((item) => item.status === "rejected");
6395
+ if (failure) throw failure.reason;
6133
6396
  } finally {
6134
6397
  await scope?.close();
6135
6398
  }
@@ -6422,7 +6685,12 @@ const sendReceiptSchema = z.object({
6422
6685
  passportIncluded: z.boolean(),
6423
6686
  upload: z.object({
6424
6687
  uploadUrl: z.url(),
6425
- expiresAt: z.iso.datetime()
6688
+ expiresAt: z.iso.datetime(),
6689
+ /**
6690
+ * Headers the signed URL requires besides type and length: Passport answers them only
6691
+ * for a checksum upload, whose PUT writes the immutable object directly (ADR 0230).
6692
+ */
6693
+ headers: z.object({ "x-amz-checksum-sha256": z.base64().length(44) }).strict().optional()
6426
6694
  }).strict().nullable()
6427
6695
  }).strict();
6428
6696
  /** `POST /me/works/replace`: the owner's other Works are retired (ADR 0204). */
@@ -6470,6 +6738,11 @@ const sendItemSchema = z.object({
6470
6738
  previousReceipts: z.array(savedSendReceiptSchema),
6471
6739
  /** The receipt whose bytes were PUT but not yet completed: the next step completes it (BL-210). */
6472
6740
  uploadedReceiptId: journeyIdSchema.nullable().optional(),
6741
+ /**
6742
+ * Passport answered `bundle_mismatch` to this Work's checksum upload: the rest of this Send
6743
+ * uploads through staging (ADR 0231).
6744
+ */
6745
+ checksumUploadRefused: z.literal(true).optional(),
6473
6746
  status: z.enum([
6474
6747
  "ready",
6475
6748
  "target",
@@ -12287,39 +12560,6 @@ function reviseGroupMembership(state, action, members, preferenceScope) {
12287
12560
  };
12288
12561
  }
12289
12562
  //#endregion
12290
- //#region packages/application/src/journey/placement/work.ts
12291
- /** The processed project name is both the initial title and the retired-description fallback. */
12292
- function newJourneyWork(id, projectName, rootSessionIds, sourceWorkspaceIds, placement = "placed") {
12293
- return {
12294
- id,
12295
- title: projectName,
12296
- projectName,
12297
- projectType: null,
12298
- description: "",
12299
- titleOrigin: "model",
12300
- explicitTitleId: null,
12301
- accessOrigin: "default",
12302
- placement,
12303
- suggestion: null,
12304
- classificationRecommendation: null,
12305
- sourceWorkspaceIds,
12306
- rootSessionIds,
12307
- grouping: sourceWorkspaceIds.length === 1 ? "workspace" : "regrouped",
12308
- access: "private",
12309
- accessConfirmed: false,
12310
- reason: "Awaiting content review.",
12311
- revision: 1,
12312
- inputRevision: 1,
12313
- status: "pending",
12314
- totalBatches: 0,
12315
- completedBatches: 0,
12316
- groupIds: [],
12317
- blockedCodes: [],
12318
- artifact: null,
12319
- binding: null
12320
- };
12321
- }
12322
- //#endregion
12323
12563
  //#region packages/application/src/journey/b/reconstruct.ts
12324
12564
  function reconstructBFields(inputs) {
12325
12565
  const units = inputs.map(validateBUnit).sort((left, right) => left.ordinal - right.ordinal);
@@ -12936,50 +13176,4 @@ function equivalenceDuplicates(batch) {
12936
13176
  return bindings.sort();
12937
13177
  }
12938
13178
  //#endregion
12939
- //#region packages/application/src/journey/scan-generation.ts
12940
- /** Retire one scan generation while preserving the person's confirmed classification. */
12941
- function retireScanGeneration(state, workId) {
12942
- if (!state.works.some((work) => work.id === workId)) throw new ApplicationError("UNKNOWN_ITEM");
12943
- const changedKeys = /* @__PURE__ */ new Set();
12944
- const terms = state.privacy.terms.flatMap((term) => {
12945
- if (!term.sources.some((source) => source.workId === workId)) return [term];
12946
- changedKeys.add(privacyTermKey(term));
12947
- const sources = term.sources.filter((source) => source.workId !== workId);
12948
- return sources.length ? [{
12949
- ...term,
12950
- sources,
12951
- disposition: term.disposition === "keep" ? "pending" : term.disposition
12952
- }] : [];
12953
- });
12954
- return {
12955
- ...state,
12956
- readingComplete: false,
12957
- phase: state.phase === "paused" ? "paused" : "processing",
12958
- privacy: {
12959
- ...state.privacy,
12960
- terms,
12961
- cards: state.privacy.cards.filter((card) => card.termKeys.every((key) => !changedKeys.has(key))),
12962
- confirmedAnswersRevision: null,
12963
- packageApproval: null
12964
- },
12965
- works: state.works.map((work) => work.id === workId ? resetWorkScan(work) : work)
12966
- };
12967
- }
12968
- /** The same Work with a new scan generation: it is read again from its first session. */
12969
- function resetWorkScan(work) {
12970
- const { emptyReview: _empty, excludedReview: _excluded, staticReview: _static, metadataReviewedDigest: _metadata, reviewReuseFrom: _reuse, renderFailure: _failure, ...retained } = work;
12971
- return {
12972
- ...retained,
12973
- revision: work.revision + 1,
12974
- inputRevision: work.inputRevision + 1,
12975
- status: "pending",
12976
- suggestion: null,
12977
- totalBatches: 0,
12978
- completedBatches: 0,
12979
- groupIds: [],
12980
- blockedCodes: [],
12981
- artifact: null
12982
- };
12983
- }
12984
- //#endregion
12985
- export { validateDetectionSummary as $, reviewRepairResourceSchema as $n, sourceChangePolicy as $r, journeyPolicyRespondSchema as $t, createAccount as A, hideKeyId as An, hasCurrentStaticReview as Ar, sendReplaceResultSchema as At, createApplication as B, confirmedHideKinds as Bn, mergePrivacyTerms as Br, journeyGuidance as Bt, bReviewScope as C, confirmedHideAdditions as Cn, journeyClassificationSessionsSchema as Cr, sendActionSchema as Ct, reviewBatchReuse as D, settleConfirmedHides as Dn, nativeEventsSchema as Dr, journeySendSchema as Dt, rebindReviewSubmit as E, renderedHideValue as En, privacyDecisionDigest as Er, sendStartSchema as Et, readAccountAvatarUrl as F, bMaskedHits as Fn, isClassifying as Fr, obsoleteJourney as Ft, validateInspectionRequest as G, syncTermGroups as Gn, journeyRenderSchema as Gr, journeyContextQuerySchema as Gt, inspectionStartSchema as H, dictionaryHides as Hn, journeyFindingsSchema as Hr, journeyBatchReadSchema as Ht, storedCredentialSchema as I, bTermMatcher as In, isReadingComplete as Ir, metadataProcessingVersion as It, validateInspectionFence as J, workPrivacyDecisions as Jn, selectionBatchSchema as Jr, hideFinishSchema as Jt, inspectionQuerySchema as K, retireWorkDescription as Kn, commandSchema as Kr, journeyContextSchema as Kt, sourceIdentityEvidence as L, bWordBounded as Ln, isSelectedWork as Lr, nativeAdapterVersions as Lt, deviceAuthorizationSchema as M, packHideIndex as Mn, staticSessionId as Mr, sendSettingsSchema as Mt, deviceProfileScopeSchema as N, bContainment as Nn, staticSessionResourceSchema as Nr, settleCorrections as Nt, guardedFindingText as O, termHideAdditions as On, nativeGetSchema as Or, sendArtifactSchema as Ot, profileUrlMatchesIdentity as P, bExceptionRanges as Pn, hasCompleteWorkDescription as Pr, currentJourneyAdapters as Pt, validateInspectionContribution as Q, reviewRepairInputSchema as Qn, stateSchema as Qr, searchScopeDigest as Qt, withSourceEvidence as R, confirmedHideGroupIds as Rn, selectedWorks as Rr, attemptBudgetCodePoints as Rt, isGenericPublicTerm as S, journeyEventSchema as Sn, validatePreparationFacts as Sr, replaceSensitiveTermsSchema as St, rebindReviewOverlay as T, readConfirmedHideChange as Tn, assertJourneyPrivacyReady as Tr, sendPrepareSchema as Tt, validateInspectionBatch as U, journeyConfirmedHides as Un, journeyPreviewSchema as Ur, journeyReviewStorageQuerySchema as Ut, inspectionCancelSchema as V, confirmedHideTerms as Vn, journeyFindingImpactSchema as Vr, applyClassification as Vt, validateInspectionBatches as W, maskedHitsStale as Wn, journeyRenderInputSchema as Wr, reviewCompileSchema as Wt, validateInspectionInputs as X, reviewCandidateInputSchema as Xn, gitMetadataBudgetBytes as Xr, journeySearchResultSchema as Xt, validateInspectionHead as Y, workCorrectionBinding as Yn, selectionSchema as Yr, hidePublishSchema as Yt, validateInspectionQuery as Z, reviewCandidateResourceSchema as Zn, producerVersion as Zr, journeySearchSaveSchema as Zt, hideScopeDigest as _, sessionReviewStatusSchema as _n, journeyPreparationProgressSchema as _r, manualUploadStartSchema as _t, locateTermEvidence as a, selectFrozenConfiguration as ai, sortingApplySchema as an, scanCanonicalResourceSchema as ar, appendSensitiveTerms as at, projectJourneyInventory as b, journeyCommitResultSchema as bn, preparationSettlementSchema as br, maximumTermsFileBytes as bt, bRereadDigest as c, reviewAttemptsResultSchema as cn, scanGitSeedsId as cr, maximumAgentSetupSessions as ct, newJourneyWork as d, sessionReconciliationResourceSchema as dn, scanExclusionResourceSchema as dr, validateFailureLocation as dt, recommendParallelism as ei, projectPreparationProgress as en, reviewTransportBytes as er, inspectionInputs as et, reviseGroupMembership as f, sessionRereadInputSchema as fn, validateScanExclusion as fr, manualUploadActionSchema as ft, activeJourneyTerms as g, sessionReviewResourceSchema as gn, journeyInventorySchema as gr, manualUploadSchema as gt, splitSelectorValues as h, sessionReviewQuerySchema as hn, journeyInventoryReadSchema as hr, manualUploadPrepareSchema as ht, scanBatchEquivalenceDigest as i, freezeConfiguration as ii, journeyPlaceSchema as in, scanAliasResourceSchema as ir, reviewInventory as it, accountProfileSchema as j, maximumHideIndexTokens as jn, staticReviewDigest as jr, sendResolutionSchema as jt, staticallyHiddenFindings as k, addHideIndexTokens as kn, nativeRespondSchema as kr, sendReceiptSchema as kt, reconcileBSession as l, sessionReconcileInputSchema as ln, scanGitSeedsResource as lr, artifactFailureDetailSchema as lt, selectedValueMembers as m, sessionReviewInputSchema as mn, journeyInventoryQuerySchema as mr, manualUploadChoiceSchema as mt, retireScanGeneration as n, effectiveTreatmentSchema as ni, journeyResourceSchema as nn, mergeBRepair as nr, settingsQuerySchema as nt, validateBCrossSegmentReview as o, staticCatalogRef as oi, reviewAttemptResourceSchema as on, scanPreparationDigest as or, classifyAgentSetup as ot, resolveGroupSplit as p, sessionRereadResourceSchema as pn, resolveSourceSelection as pr, manualUploadBindingSchema as pt, validateInspectionClaim as q, workDecisionDigest as qn, packageCommandSchema as qr, hideBeginSchema as qt, scanBatchContextDigest as r, defaultScopedSettings as ri, journeyIsolateSchema as rn, planBRepair as rr, readWorkspaceOutcomes as rt, bCrossSegmentReviewSchema as s, reviewAttemptsQuerySchema as sn, scanSessionResourceSchema as sr, defaultAgentSetupInclusion as st, resetWorkScan as t, approvedTreatmentSchema as ti, journeyResourceQuerySchema as tn, bReviewDigest as tr, settingsBatchSchema as tt, reconstructBFields as u, sessionReconcileResultSchema as un, verifiedScanGitSeeds as ur, resolveFailureLocation as ut, semanticGroupKey as v, sessionUsefulnessInputSchema as vn, emptyPreparationFacts as vr, candidateSortAvailable as vt, rebindReviewAlignment as w, confirmedHideDeltaSchema as wn, applyCardAnswers as wr, sendChoiceSchema as wt, preparationScope as x, journeyCommitSchema as xn, preparationStartSchema as xr, normalizeSensitiveTerms as xt, changeJourney as y, sessionUsefulnessResourceSchema as yn, preparationBeginSchema as yr, emptyTermsRevision as yt, agentSetupKey as z, confirmedHideKey as zn, withReadingProgress as zr, validateAttemptAppend as zt };
13179
+ export { settingsQuerySchema as $, reviewCandidateInputSchema as $n, gitMetadataBudgetBytes as $r, journeySearchResultSchema as $t, deviceProfileScopeSchema as A, settleConfirmedHides as An, nativeEventsSchema as Ar, settleCorrections as At, validateInspectionBatch as B, bWordBounded as Bn, isSelectedWork as Br, journeyReviewStorageQuerySchema as Bt, rebindReviewSubmit as C, journeyCommitResultSchema as Cn, preparationSettlementSchema as Cr, sendStartSchema as Ct, createAccount as D, confirmedHideDeltaSchema as Dn, applyCardAnswers as Dr, sendReplaceResultSchema as Dt, staticallyHiddenFindings as E, confirmedHideAdditions as En, journeyClassificationSessionsSchema as Er, sendReceiptSchema as Et, withSourceEvidence as F, packHideIndex as Fn, staticSessionId as Fr, attemptBudgetCodePoints as Ft, validateInspectionFence as G, dictionaryHides as Gn, journeyFindingsSchema as Gr, retireScanGeneration as Gt, validateInspectionRequest as H, confirmedHideKey as Hn, withReadingProgress as Hr, classificationCommitSchema as Ht, agentSetupKey as I, bContainment as In, staticSessionResourceSchema as Ir, validateAttemptAppend as It, validateInspectionQuery as J, syncTermGroups as Jn, journeyRenderSchema as Jr, journeyContextQuerySchema as Jt, validateInspectionHead as K, journeyConfirmedHides as Kn, journeyPreviewSchema as Kr, newJourneyWork as Kt, createApplication as L, bExceptionRanges as Ln, hasCompleteWorkDescription as Lr, journeyGuidance as Lt, readAccountAvatarUrl as M, addHideIndexTokens as Mn, nativeRespondSchema as Mr, obsoleteJourney as Mt, storedCredentialSchema as N, hideKeyId as Nn, hasCurrentStaticReview as Nr, metadataProcessingVersion as Nt, accountProfileSchema as O, readConfirmedHideChange as On, assertJourneyPrivacyReady as Or, sendResolutionSchema as Ot, sourceIdentityEvidence as P, maximumHideIndexTokens as Pn, staticReviewDigest as Pr, nativeAdapterVersions as Pt, settingsBatchSchema as Q, workCorrectionBinding as Qn, selectionSchema as Qr, hidePublishSchema as Qt, inspectionCancelSchema as R, bMaskedHits as Rn, isClassifying as Rr, applyClassification as Rt, rebindReviewOverlay as S, sessionUsefulnessResourceSchema as Sn, preparationBeginSchema as Sr, sendPrepareSchema as St, guardedFindingText as T, journeyEventSchema as Tn, validatePreparationFacts as Tr, sendArtifactSchema as Tt, inspectionQuerySchema as U, confirmedHideKinds as Un, mergePrivacyTerms as Ur, classificationPartition as Ut, validateInspectionBatches as V, confirmedHideGroupIds as Vn, selectedWorks as Vr, applyClassificationProposal as Vt, validateInspectionClaim as W, confirmedHideTerms as Wn, journeyFindingImpactSchema as Wr, classificationWorks as Wt, validateDetectionSummary as X, workDecisionDigest as Xn, packageCommandSchema as Xr, hideBeginSchema as Xt, validateInspectionContribution as Y, retireWorkDescription as Yn, commandSchema as Yr, journeyContextSchema as Yt, inspectionInputs as Z, workPrivacyDecisions as Zn, selectionBatchSchema as Zr, hideFinishSchema as Zt, projectJourneyInventory as _, sessionReviewInputSchema as _n, journeyInventoryQuerySchema as _r, maximumTermsFileBytes as _t, bCrossSegmentReviewSchema as a, effectiveTreatmentSchema as ai, journeyResourceSchema as an, mergeBRepair as ar, maximumAgentSetupSessions as at, bReviewScope as b, sessionReviewStatusSchema as bn, journeyPreparationProgressSchema as br, sendActionSchema as bt, reconstructBFields as c, selectFrozenConfiguration as ci, sortingApplySchema as cn, scanCanonicalResourceSchema as cr, validateFailureLocation as ct, selectedValueMembers as d, reviewAttemptsResultSchema as dn, scanGitSeedsId as dr, manualUploadChoiceSchema as dt, producerVersion as ei, journeySearchSaveSchema as en, reviewCandidateResourceSchema as er, readWorkspaceOutcomes as et, splitSelectorValues as f, sessionReconcileInputSchema as fn, scanGitSeedsResource as fr, manualUploadPrepareSchema as ft, changeJourney as g, sessionRereadResourceSchema as gn, resolveSourceSelection as gr, emptyTermsRevision as gt, semanticGroupKey as h, sessionRereadInputSchema as hn, validateScanExclusion as hr, candidateSortAvailable as ht, validateBCrossSegmentReview as i, approvedTreatmentSchema as ii, journeyResourceQuerySchema as in, bReviewDigest as ir, defaultAgentSetupInclusion as it, profileUrlMatchesIdentity as j, termHideAdditions as jn, nativeGetSchema as jr, currentJourneyAdapters as jt, deviceAuthorizationSchema as k, renderedHideValue as kn, privacyDecisionDigest as kr, sendSettingsSchema as kt, reviseGroupMembership as l, staticCatalogRef as li, reviewAttemptResourceSchema as ln, scanPreparationDigest as lr, manualUploadActionSchema as lt, hideScopeDigest as m, sessionReconciliationResourceSchema as mn, scanExclusionResourceSchema as mr, manualUploadStartSchema as mt, scanBatchEquivalenceDigest as n, sourceChangePolicy as ni, journeyPolicyRespondSchema as nn, reviewRepairResourceSchema as nr, appendSensitiveTerms as nt, bRereadDigest as o, defaultScopedSettings as oi, journeyIsolateSchema as on, planBRepair as or, artifactFailureDetailSchema as ot, activeJourneyTerms as p, sessionReconcileResultSchema as pn, verifiedScanGitSeeds as pr, manualUploadSchema as pt, validateInspectionInputs as q, maskedHitsStale as qn, journeyRenderInputSchema as qr, reviewCompileSchema as qt, locateTermEvidence as r, recommendParallelism as ri, projectPreparationProgress as rn, reviewTransportBytes as rr, classifyAgentSetup as rt, reconcileBSession as s, freezeConfiguration as si, journeyPlaceSchema as sn, scanAliasResourceSchema as sr, resolveFailureLocation as st, scanBatchContextDigest as t, stateSchema as ti, searchScopeDigest as tn, reviewRepairInputSchema as tr, reviewInventory as tt, resolveGroupSplit as u, reviewAttemptsQuerySchema as un, scanSessionResourceSchema as ur, manualUploadBindingSchema as ut, preparationScope as v, sessionReviewQuerySchema as vn, journeyInventoryReadSchema as vr, normalizeSensitiveTerms as vt, reviewBatchReuse as w, journeyCommitSchema as wn, preparationStartSchema as wr, journeySendSchema as wt, rebindReviewAlignment as x, sessionUsefulnessInputSchema as xn, emptyPreparationFacts as xr, sendChoiceSchema as xt, isGenericPublicTerm as y, sessionReviewResourceSchema as yn, journeyInventorySchema as yr, replaceSensitiveTermsSchema as yt, inspectionStartSchema as z, bTermMatcher as zn, isReadingComplete as zr, journeyBatchReadSchema as zt };