@gitroll/tacitt-cli 0.2.0 → 0.4.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-CQRWVUWR.mjs} +1 -1
  2. package/dist/agent-setup-worker.mjs +4 -4
  3. package/dist/cli.mjs +66 -9
  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-BaTNC9kf.mjs} +45 -3
  8. package/dist/inspection-worker.mjs +3 -3
  9. package/dist/job-DrcpSL_9.mjs +615 -0
  10. package/dist/{model-BJdTLNjT.mjs → model-D7UnGeag.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-ByD0Rp_o.mjs} +391 -551
  14. package/dist/{run-BeLHsZWb.mjs → run-3UIkr7GZ.mjs} +2 -2
  15. package/dist/session-process.mjs +6 -1
  16. package/dist/{src-k0Ya1Bri.mjs → src-CmP73EcD.mjs} +510 -161
  17. package/dist/{src-B5SArpVY.mjs → src-DES7hBAP.mjs} +17 -5
  18. package/dist/{src-CC95LYYp.mjs → src-DNn7SifS.mjs} +763 -528
  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
@@ -1383,6 +1383,247 @@ function withReadingProgress(state) {
1383
1383
  };
1384
1384
  }
1385
1385
  //#endregion
1386
+ //#region packages/application/src/journey/send/model.ts
1387
+ const count$13 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
1388
+ const access = z.enum(["public", "private"]);
1389
+ const sendSourceSchema = z.object({
1390
+ id: z.string().regex(/^w[0-9]{6,}$/u),
1391
+ pathHash: journeyDigestSchema.nullable(),
1392
+ remoteHashes: z.array(journeyDigestSchema),
1393
+ primaryRemoteHash: journeyDigestSchema.nullable(),
1394
+ challengeId: z.string().regex(/^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$/u).optional()
1395
+ }).strict();
1396
+ function agentSourcePathSegment(value) {
1397
+ return /^[A-Za-z0-9.][A-Za-z0-9._-]*$/u.test(value) && value !== "." && value !== "..";
1398
+ }
1399
+ /** Local candidates become public only after anonymous upload-time evidence checks. */
1400
+ const agentSourceSchema = z.object({
1401
+ kind: z.enum(["skill", "mcp"]),
1402
+ name: z.string().regex(/^[A-Za-z0-9_][A-Za-z0-9_.:-]{0,199}$/u),
1403
+ source: z.discriminatedUnion("type", [z.object({
1404
+ type: z.literal("github"),
1405
+ repo: z.string().refine((value) => {
1406
+ const segments = value.split("/");
1407
+ return segments.length === 2 && segments.every((part) => part.length <= 100 && agentSourcePathSegment(part));
1408
+ }),
1409
+ path: z.string().max(500).refine((value) => value.split("/").every(agentSourcePathSegment)).optional(),
1410
+ commit: z.string().regex(/^[a-f0-9]{40,64}$/iu).optional()
1411
+ }).strict(), z.object({
1412
+ type: z.literal("npm"),
1413
+ package: z.string().max(214).regex(/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/u)
1414
+ }).strict()])
1415
+ }).strict();
1416
+ const agentSourcesSchema = z.array(agentSourceSchema).max(500);
1417
+ const sendArtifactSchema = z.object({
1418
+ agentSources: agentSourcesSchema.optional(),
1419
+ workId: journeyIdSchema,
1420
+ revision: count$13,
1421
+ bundleId: journeyIdSchema,
1422
+ createdAt: z.iso.datetime(),
1423
+ title: z.string().min(1).max(300),
1424
+ sessionCount: count$13,
1425
+ grouping: z.enum(["workspace", "regrouped"]),
1426
+ sources: z.array(sendSourceSchema).min(1),
1427
+ byteLength: count$13.positive(),
1428
+ sha256: journeyDigestSchema
1429
+ }).strict();
1430
+ const sendCandidateSchema = z.object({
1431
+ bindingId: journeyIdSchema,
1432
+ workId: z.string().regex(/^wk_[A-Za-z0-9_-]{32}$/u),
1433
+ title: z.string(),
1434
+ access: z.enum([
1435
+ "public",
1436
+ "private",
1437
+ "removed"
1438
+ ])
1439
+ }).strict();
1440
+ const sendResolutionSchema = z.object({
1441
+ logicalWorkId: journeyIdSchema,
1442
+ status: z.enum([
1443
+ "matched",
1444
+ "new",
1445
+ "choose",
1446
+ "blocked"
1447
+ ]),
1448
+ reason: z.enum([
1449
+ "binding",
1450
+ "exact_source",
1451
+ "no_candidate",
1452
+ "ambiguous",
1453
+ "work_removed"
1454
+ ]),
1455
+ accessVersion: count$13,
1456
+ scopeVersion: count$13,
1457
+ candidates: z.array(sendCandidateSchema)
1458
+ }).strict();
1459
+ const sendSettingsSchema = z.object({
1460
+ publicId: z.string().regex(/^(?:ps|ap)_[A-Za-z0-9_-]{32}$/u),
1461
+ workId: z.string().regex(/^wk_[A-Za-z0-9_-]{32}$/u),
1462
+ access,
1463
+ accessVersion: count$13,
1464
+ scopeVersion: count$13,
1465
+ membersDigest: journeyDigestSchema,
1466
+ works: z.array(z.object({
1467
+ workId: z.string(),
1468
+ kind: z.enum(["repository", "upload"]),
1469
+ title: z.string(),
1470
+ access: z.enum([
1471
+ "public",
1472
+ "private",
1473
+ "removed"
1474
+ ])
1475
+ }).strict())
1476
+ }).strict();
1477
+ const sendReceiptSchema = z.object({
1478
+ receiptId: journeyIdSchema,
1479
+ logicalWorkId: journeyIdSchema,
1480
+ bindingId: journeyIdSchema,
1481
+ workId: z.string().regex(/^wk_[A-Za-z0-9_-]{32}$/u),
1482
+ publicId: z.string().regex(/^(?:ps|ap)_[A-Za-z0-9_-]{32}$/u),
1483
+ passportUrl: z.url(),
1484
+ bundleId: journeyIdSchema,
1485
+ outputRevision: count$13.positive(),
1486
+ byteLength: count$13.positive(),
1487
+ sha256: journeyDigestSchema,
1488
+ access,
1489
+ effectiveAccess: z.enum([
1490
+ "public",
1491
+ "private",
1492
+ "removed"
1493
+ ]),
1494
+ state: z.enum([
1495
+ "awaiting_upload",
1496
+ "accepted",
1497
+ "running",
1498
+ "succeeded",
1499
+ "partial",
1500
+ "failed",
1501
+ "superseded"
1502
+ ]),
1503
+ scanId: journeyIdSchema,
1504
+ assessmentState: z.enum([
1505
+ "accepted",
1506
+ "running",
1507
+ "succeeded",
1508
+ "partial",
1509
+ "failed"
1510
+ ]).nullable(),
1511
+ passportIncluded: z.boolean(),
1512
+ upload: z.object({
1513
+ uploadUrl: z.url(),
1514
+ expiresAt: z.iso.datetime(),
1515
+ /**
1516
+ * Headers the signed URL requires besides type and length: Passport answers them only
1517
+ * for a checksum upload, whose PUT writes the immutable object directly (ADR 0230).
1518
+ */
1519
+ headers: z.object({ "x-amz-checksum-sha256": z.base64().length(44) }).strict().optional()
1520
+ }).strict().nullable()
1521
+ }).strict();
1522
+ /** `POST /me/works/replace`: the owner's other Works are retired (ADR 0204). */
1523
+ const sendReplaceResultSchema = z.object({ retiredWorkIds: z.array(z.string().regex(/^wk_[A-Za-z0-9_-]{32}$/u)) }).strict();
1524
+ const sendTargetSchema = z.discriminatedUnion("kind", [z.object({
1525
+ kind: z.literal("existing"),
1526
+ bindingId: journeyIdSchema
1527
+ }).strict(), z.object({ kind: z.literal("new") }).strict()]);
1528
+ const sendResolveInputSchema = z.object({
1529
+ logicalWorkId: journeyIdSchema,
1530
+ bindingId: journeyIdSchema.optional(),
1531
+ grouping: z.enum(["workspace", "regrouped"]),
1532
+ sources: z.array(sendSourceSchema).min(1)
1533
+ }).strict();
1534
+ const sendUploadInputSchema = z.object({
1535
+ agentSources: agentSourcesSchema.optional(),
1536
+ work: sendResolveInputSchema,
1537
+ target: sendTargetSchema,
1538
+ bundleId: journeyIdSchema,
1539
+ createdAt: z.iso.datetime(),
1540
+ title: z.string().min(1).max(300),
1541
+ sessionCount: count$13,
1542
+ access,
1543
+ outputRevision: count$13.positive(),
1544
+ byteLength: count$13.positive(),
1545
+ sha256: journeyDigestSchema,
1546
+ expectedAccessVersion: count$13,
1547
+ expectedScopeVersion: count$13
1548
+ }).strict();
1549
+ const savedSendReceiptSchema = sendReceiptSchema.omit({ upload: true });
1550
+ const sendItemSchema = z.object({
1551
+ workId: journeyIdSchema,
1552
+ title: z.string(),
1553
+ access,
1554
+ artifact: sendArtifactSchema,
1555
+ operationKey: journeyIdSchema,
1556
+ target: sendTargetSchema.nullable(),
1557
+ targetConfirmed: z.boolean(),
1558
+ resolution: sendResolutionSchema.nullable(),
1559
+ settings: sendSettingsSchema.nullable(),
1560
+ settingsConfirmed: z.boolean(),
1561
+ /** The linked Settings changes the person last confirmed for this Work in this Send. */
1562
+ confirmedSettings: sendSettingsSchema.nullable().optional(),
1563
+ reservation: sendUploadInputSchema.nullable(),
1564
+ receipt: savedSendReceiptSchema.nullable(),
1565
+ previousReceipts: z.array(savedSendReceiptSchema),
1566
+ /** The receipt whose bytes were PUT but not yet completed: the next step completes it (BL-210). */
1567
+ uploadedReceiptId: journeyIdSchema.nullable().optional(),
1568
+ /**
1569
+ * Passport answered `bundle_mismatch` to this Work's checksum upload: the rest of this Send
1570
+ * uploads through staging (ADR 0231).
1571
+ */
1572
+ checksumUploadRefused: z.literal(true).optional(),
1573
+ status: z.enum([
1574
+ "ready",
1575
+ "target",
1576
+ "settings",
1577
+ "uploading",
1578
+ "assessing",
1579
+ "completed",
1580
+ "blocked"
1581
+ ]),
1582
+ error: z.string().nullable()
1583
+ }).strict();
1584
+ const journeySendSchema = z.object({
1585
+ id: journeyIdSchema,
1586
+ journeyId: journeyIdSchema,
1587
+ revision: count$13,
1588
+ scopeDigest: journeyDigestSchema,
1589
+ subject: z.string().nullable(),
1590
+ confirmedAt: z.iso.datetime().nullable(),
1591
+ status: z.enum([
1592
+ "prepared",
1593
+ "sign-in",
1594
+ "review",
1595
+ "sending",
1596
+ "waiting",
1597
+ "paused",
1598
+ "completed",
1599
+ "blocked"
1600
+ ]),
1601
+ items: z.array(sendItemSchema),
1602
+ omitted: z.array(z.object({
1603
+ workId: journeyIdSchema,
1604
+ title: z.string(),
1605
+ reason: z.enum([
1606
+ "drop",
1607
+ "empty",
1608
+ "sent",
1609
+ "not-ready",
1610
+ "too-large",
1611
+ "skipped"
1612
+ ]),
1613
+ /** Failed root families omitted even when the same Work has a retained output. */
1614
+ sessionCount: count$13.positive().optional()
1615
+ }).strict().refine((item) => item.reason !== "skipped" || item.sessionCount !== void 0)),
1616
+ error: z.string().nullable(),
1617
+ /**
1618
+ * When this Send replaced the owner's earlier Passport Works and how many it retired; a
1619
+ * native Send is completed only after this is recorded (ADR 0204).
1620
+ */
1621
+ replaced: z.object({
1622
+ at: z.iso.datetime(),
1623
+ retiredWorkCount: count$13
1624
+ }).strict().nullable().optional()
1625
+ }).strict();
1626
+ //#endregion
1386
1627
  //#region packages/application/src/journey/static-session.ts
1387
1628
  const count$12 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
1388
1629
  const staticFileSchema = z.object({
@@ -1399,6 +1640,7 @@ const staticFileSchema = z.object({
1399
1640
  */
1400
1641
  const staticSessionResourceSchema = z.object({
1401
1642
  kind: z.literal("static-session"),
1643
+ agentSources: agentSourcesSchema.optional(),
1402
1644
  journeyId: journeyIdSchema,
1403
1645
  workId: journeyIdSchema,
1404
1646
  inputRevision: count$12.min(1),
@@ -4367,67 +4609,329 @@ z.discriminatedUnion("kind", [z.object({
4367
4609
  submission: sessionReconcileInputSchema
4368
4610
  }).strict()]);
4369
4611
  //#endregion
4370
- //#region packages/application/src/journey/review/port.ts
4371
- /** Batches are served in publication order; only a Drop or un-Drop invalidates a cursor. */
4372
- const journeyReadCursorSchema = z.object({
4373
- snapshotId: journeyDigestSchema,
4374
- dropDigest: journeyDigestSchema,
4375
- afterSequence: z.number().int().min(0)
4376
- }).strict();
4377
- const journeyBatchReadSchema = z.object({
4378
- journeyId: journeyIdSchema,
4379
- cursor: journeyReadCursorSchema.optional()
4380
- }).strict();
4381
- z.object({
4382
- batch: reviewBatchSchema.nullable(),
4383
- cursor: journeyReadCursorSchema.nullable(),
4384
- remaining: z.number().int().nonnegative(),
4385
- /** Complete current guidance; a sibling so batch and unit digests stay unchanged. */
4386
- guidance: journeyGuidanceSchema,
4387
- /** Why no batch is served: the person's scan scope or Work preparation is still pending. */
4388
- waiting: z.enum(["scope", "preparation"]).nullable()
4389
- }).strict();
4390
- const journeyReviewQuerySchema = z.discriminatedUnion("kind", [z.object({
4391
- kind: z.literal("batch"),
4392
- journeyId: journeyIdSchema,
4393
- batchId: journeyIdSchema
4394
- }).strict(), z.object({
4395
- kind: z.literal("work"),
4396
- journeyId: journeyIdSchema,
4397
- workId: journeyIdSchema,
4398
- afterOrdinal: z.number().int().min(-1).default(-1)
4399
- }).strict()]);
4400
- /** Internal history is never accepted by the public review inspection facade. */
4401
- const journeyReviewStorageQuerySchema = z.union([
4402
- journeyReviewQuerySchema,
4403
- z.object({
4404
- kind: z.literal("attempt"),
4405
- journeyId: journeyIdSchema,
4406
- batchId: journeyIdSchema
4407
- }).strict(),
4408
- z.object({
4409
- kind: z.literal("protected"),
4410
- journeyId: journeyIdSchema,
4411
- afterBatchId: journeyIdSchema.optional(),
4412
- /** Only batches outside this Work input that analysed one of its root sessions. */
4413
- carriedTo: z.object({
4414
- workId: journeyIdSchema,
4415
- inputRevision: z.number().int().positive(),
4416
- sessionIds: z.array(reviewChunkSchema.shape.sessionId).min(1)
4417
- }).strict().optional()
4418
- }).strict()
4419
- ]);
4420
- z.object({
4421
- batch: reviewBatchSchema,
4422
- review: reviewSubmitSchema.nullable(),
4423
- additionalFindings: z.array(semanticFindingSchema),
4424
- additionalRetained: z.array(retainedReviewAnchorSchema),
4425
- assignments: z.array(z.object({
4426
- findingId: journeyIdSchema,
4427
- groupId: journeyIdSchema
4428
- }).strict())
4429
- }).strict().nullable();
4430
- z.object({
4612
+ //#region packages/application/src/journey/placement/work.ts
4613
+ /** The processed project name is both the initial title and the retired-description fallback. */
4614
+ function newJourneyWork(id, projectName, rootSessionIds, sourceWorkspaceIds, placement = "placed") {
4615
+ return {
4616
+ id,
4617
+ title: projectName,
4618
+ projectName,
4619
+ projectType: null,
4620
+ description: "",
4621
+ titleOrigin: "model",
4622
+ explicitTitleId: null,
4623
+ accessOrigin: "default",
4624
+ placement,
4625
+ suggestion: null,
4626
+ classificationRecommendation: null,
4627
+ sourceWorkspaceIds,
4628
+ rootSessionIds,
4629
+ grouping: sourceWorkspaceIds.length === 1 ? "workspace" : "regrouped",
4630
+ access: "private",
4631
+ accessConfirmed: false,
4632
+ reason: "Awaiting content review.",
4633
+ revision: 1,
4634
+ inputRevision: 1,
4635
+ status: "pending",
4636
+ totalBatches: 0,
4637
+ completedBatches: 0,
4638
+ groupIds: [],
4639
+ blockedCodes: [],
4640
+ artifact: null,
4641
+ binding: null
4642
+ };
4643
+ }
4644
+ //#endregion
4645
+ //#region packages/application/src/journey/scan-generation.ts
4646
+ /** Retire one scan generation while preserving the person's confirmed classification. */
4647
+ function retireScanGeneration(state, workId) {
4648
+ if (!state.works.some((work) => work.id === workId)) throw new ApplicationError("UNKNOWN_ITEM");
4649
+ const changedKeys = /* @__PURE__ */ new Set();
4650
+ const terms = state.privacy.terms.flatMap((term) => {
4651
+ if (!term.sources.some((source) => source.workId === workId)) return [term];
4652
+ changedKeys.add(privacyTermKey(term));
4653
+ const sources = term.sources.filter((source) => source.workId !== workId);
4654
+ return sources.length ? [{
4655
+ ...term,
4656
+ sources,
4657
+ disposition: term.disposition === "keep" ? "pending" : term.disposition
4658
+ }] : [];
4659
+ });
4660
+ return {
4661
+ ...state,
4662
+ readingComplete: false,
4663
+ phase: state.phase === "paused" ? "paused" : "processing",
4664
+ privacy: {
4665
+ ...state.privacy,
4666
+ terms,
4667
+ cards: state.privacy.cards.filter((card) => card.termKeys.every((key) => !changedKeys.has(key))),
4668
+ confirmedAnswersRevision: null,
4669
+ packageApproval: null
4670
+ },
4671
+ works: state.works.map((work) => work.id === workId ? resetWorkScan(work) : work)
4672
+ };
4673
+ }
4674
+ /** The same Work with a new scan generation: it is read again from its first session. */
4675
+ function resetWorkScan(work) {
4676
+ const { emptyReview: _empty, excludedReview: _excluded, staticReview: _static, metadataReviewedDigest: _metadata, reviewReuseFrom: _reuse, renderFailure: _failure, ...retained } = work;
4677
+ return {
4678
+ ...retained,
4679
+ revision: work.revision + 1,
4680
+ inputRevision: work.inputRevision + 1,
4681
+ status: "pending",
4682
+ suggestion: null,
4683
+ totalBatches: 0,
4684
+ completedBatches: 0,
4685
+ groupIds: [],
4686
+ blockedCodes: [],
4687
+ artifact: null
4688
+ };
4689
+ }
4690
+ //#endregion
4691
+ //#region packages/application/src/journey/scope/proposal.ts
4692
+ const count$3 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
4693
+ const workspaces = z.array(z.string().min(1).max(128));
4694
+ /**
4695
+ * A complete classification proposal prepared outside the store and applied inside one store
4696
+ * transaction against the current state (BL-216). New Work IDs and the session of every finding
4697
+ * chunk the regrouping moves are resolved beforehand, so applying it needs no I/O.
4698
+ */
4699
+ const classificationCommitSchema = z.object({
4700
+ journeyId: journeyIdSchema,
4701
+ requestKey: journeyIdSchema,
4702
+ requestHash: journeyDigestSchema,
4703
+ at: z.iso.datetime(),
4704
+ /** Unbound proposals keep the exact journey revision fence. */
4705
+ expectedRevision: count$3,
4706
+ /** Bound proposals (E2) are fenced on the classification they replace instead. */
4707
+ expectedClassificationRevision: count$3.nullable(),
4708
+ snapshotId: journeyDigestSchema,
4709
+ /** `classificationPartition` of the state the proposal was prepared against. */
4710
+ partition: journeyDigestSchema,
4711
+ late: z.boolean(),
4712
+ items: z.array(journeyClassificationSubmitSchema.shape.items.element.extend({
4713
+ workId: journeyIdSchema,
4714
+ workspaceIds: workspaces
4715
+ })).min(1).max(1e3),
4716
+ pending: z.object({
4717
+ workId: journeyIdSchema,
4718
+ rootSessionIds: z.array(z.string().min(1).max(128)).min(1).max(1e4),
4719
+ workspaceIds: workspaces
4720
+ }).strict().nullable(),
4721
+ chunkSessions: z.array(z.object({
4722
+ batchId: z.uuid(),
4723
+ chunkId: z.uuid(),
4724
+ sessionId: z.string().min(1).max(128)
4725
+ }).strict()).max(1e6)
4726
+ }).strict();
4727
+ /** The Works and roots a proposal regroups; scan progress and access never change it. */
4728
+ function classificationPartition(state) {
4729
+ return createHash("sha256").update(JSON.stringify(state.works.map((work) => [
4730
+ work.id,
4731
+ work.placement,
4732
+ work.rootSessionIds.toSorted()
4733
+ ]))).digest("hex");
4734
+ }
4735
+ /** The proposal's Works built from the given state's current Works (E2). */
4736
+ function classificationWorks(state, plan) {
4737
+ const late = plan.late;
4738
+ const works = [];
4739
+ for (const item of plan.items) {
4740
+ const existing = state.works.find((work) => work.placement !== "classifying" && work.rootSessionIds.length === item.rootSessionIds.length && work.rootSessionIds.every((root) => item.rootSessionIds.includes(root)));
4741
+ const extended = late ? state.works.find((work) => work.placement === "placed" && work.rootSessionIds.every((root) => item.rootSessionIds.includes(root))) : void 0;
4742
+ if (late && existing) {
4743
+ works.push(existing);
4744
+ continue;
4745
+ }
4746
+ const base = existing ?? (extended ? {
4747
+ ...resetWorkScan(extended),
4748
+ rootSessionIds: item.rootSessionIds,
4749
+ sourceWorkspaceIds: [.../* @__PURE__ */ new Set([...extended.sourceWorkspaceIds, ...item.workspaceIds])]
4750
+ } : newJourneyWork(item.workId, item.projectName, item.rootSessionIds, item.workspaceIds, "placed"));
4751
+ const { classificationMetadata: _display, ...original } = base;
4752
+ works.push({
4753
+ ...original,
4754
+ projectName: item.projectName,
4755
+ title: base.titleOrigin === "explicit" ? base.title : item.projectName,
4756
+ description: item.description,
4757
+ projectType: {
4758
+ type: item.projectType,
4759
+ reason: item.recommendation.reason,
4760
+ origin: "model"
4761
+ },
4762
+ placement: "placed",
4763
+ ...late && !extended ? {
4764
+ access: item.recommendation.access,
4765
+ accessOrigin: "model",
4766
+ accessConfirmed: true
4767
+ } : {},
4768
+ classificationRecommendation: item.recommendation,
4769
+ suggestion: null,
4770
+ artifact: null,
4771
+ revision: base.revision + 1
4772
+ });
4773
+ }
4774
+ const pending = plan.pending;
4775
+ if (pending) {
4776
+ const prior = state.works.find((work) => work.placement === "classifying" && work.rootSessionIds.length === pending.rootSessionIds.length && work.rootSessionIds.every((root) => pending.rootSessionIds.includes(root)));
4777
+ works.push(prior ?? newJourneyWork(pending.workId, "Still being grouped", pending.rootSessionIds, pending.workspaceIds, "classifying"));
4778
+ }
4779
+ const fields = (work) => JSON.stringify([
4780
+ work?.title,
4781
+ work?.projectName,
4782
+ work?.description,
4783
+ work?.classificationRecommendation?.reason
4784
+ ]);
4785
+ return {
4786
+ works,
4787
+ changedMetadata: new Set(works.filter((work) => {
4788
+ const old = state.works.find((item) => item.id === work.id);
4789
+ return !old || fields(work) !== fields(old);
4790
+ }).map((work) => work.id))
4791
+ };
4792
+ }
4793
+ /**
4794
+ * Rebind accepted frozen evidence; original batch/chunk IDs remain its audit provenance. Null
4795
+ * when a finding in a moved Work was not resolved beforehand, so the proposal is stale.
4796
+ */
4797
+ function regroupTerms(terms, works, changedMetadata, chunkSessions) {
4798
+ const owners = new Map(works.flatMap((work) => work.rootSessionIds.map((id) => [id, work.id])));
4799
+ const retained = new Set(works.map((work) => work.id));
4800
+ const sessions = new Map(chunkSessions.map((item) => [`${item.batchId}:${item.chunkId}`, item.sessionId]));
4801
+ const regrouped = [];
4802
+ for (const term of terms) {
4803
+ const sources = [];
4804
+ for (const source of term.sources) {
4805
+ if (source.kind === "metadata") {
4806
+ if (retained.has(source.workId) && !changedMetadata.has(source.workId)) sources.push(source);
4807
+ continue;
4808
+ }
4809
+ if (retained.has(source.workId)) {
4810
+ sources.push(source);
4811
+ continue;
4812
+ }
4813
+ const session = sessions.get(`${source.batchId}:${source.chunkId}`);
4814
+ if (session === void 0) return null;
4815
+ const workId = owners.get(session);
4816
+ if (!workId) throw new ApplicationError("CORRUPTED_STATE");
4817
+ sources.push({
4818
+ ...source,
4819
+ workId
4820
+ });
4821
+ }
4822
+ regrouped.push({
4823
+ ...term,
4824
+ sources
4825
+ });
4826
+ }
4827
+ return regrouped;
4828
+ }
4829
+ /**
4830
+ * The proposal applied to the current state, or null when it is stale: the classification, the
4831
+ * frozen snapshot, the regrouped Works and roots, or the scope changed since it was prepared.
4832
+ * Scan progress, Work input revisions and the person's visibility choices do not make it stale;
4833
+ * they are kept as the current state has them.
4834
+ */
4835
+ function applyClassificationProposal(state, plan) {
4836
+ const classifying = isClassifying(state);
4837
+ 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;
4838
+ const { works, changedMetadata } = classificationWorks(state, plan);
4839
+ const retained = new Set(works.map((work) => work.id));
4840
+ const regrouped = !plan.late && (state.works.some((work) => !retained.has(work.id)) || changedMetadata.size > 0);
4841
+ const cardTerms = new Set(state.privacy.cards.flatMap((card) => card.termKeys));
4842
+ const preserved = regroupTerms(state.privacy.terms, works, changedMetadata, plan.chunkSessions);
4843
+ if (!preserved) return null;
4844
+ const forced = new Set(preserved.filter((term) => !termTypeInfo[term.type].asked).map((term) => term.value));
4845
+ const overrides = new Map(state.valueOverrides?.map((item) => [item.value, item.choice]) ?? []);
4846
+ const terms = preserved.map((term) => ({
4847
+ ...term,
4848
+ 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
4849
+ }));
4850
+ return {
4851
+ ...state,
4852
+ works,
4853
+ classificationRevision: state.revision + 1,
4854
+ scope: plan.late ? state.scope : {
4855
+ status: "pending",
4856
+ actor: null,
4857
+ at: null
4858
+ },
4859
+ privacy: {
4860
+ ...state.privacy,
4861
+ terms,
4862
+ packageApproval: null,
4863
+ ...regrouped ? {
4864
+ cards: [],
4865
+ answersRevision: state.privacy.answersRevision + 1,
4866
+ confirmedAnswersRevision: null
4867
+ } : {}
4868
+ },
4869
+ readingComplete: !plan.pending && works.filter((work) => work.access !== "drop").every((work) => work.totalBatches > 0 && work.completedBatches === work.totalBatches),
4870
+ phase: "processing"
4871
+ };
4872
+ }
4873
+ //#endregion
4874
+ //#region packages/application/src/journey/review/port.ts
4875
+ /** Batches are served in publication order; only a Drop or un-Drop invalidates a cursor. */
4876
+ const journeyReadCursorSchema = z.object({
4877
+ snapshotId: journeyDigestSchema,
4878
+ dropDigest: journeyDigestSchema,
4879
+ afterSequence: z.number().int().min(0)
4880
+ }).strict();
4881
+ const journeyBatchReadSchema = z.object({
4882
+ journeyId: journeyIdSchema,
4883
+ cursor: journeyReadCursorSchema.optional()
4884
+ }).strict();
4885
+ z.object({
4886
+ batch: reviewBatchSchema.nullable(),
4887
+ cursor: journeyReadCursorSchema.nullable(),
4888
+ remaining: z.number().int().nonnegative(),
4889
+ /** Complete current guidance; a sibling so batch and unit digests stay unchanged. */
4890
+ guidance: journeyGuidanceSchema,
4891
+ /** Why no batch is served: the person's scan scope or Work preparation is still pending. */
4892
+ waiting: z.enum(["scope", "preparation"]).nullable()
4893
+ }).strict();
4894
+ const journeyReviewQuerySchema = z.discriminatedUnion("kind", [z.object({
4895
+ kind: z.literal("batch"),
4896
+ journeyId: journeyIdSchema,
4897
+ batchId: journeyIdSchema
4898
+ }).strict(), z.object({
4899
+ kind: z.literal("work"),
4900
+ journeyId: journeyIdSchema,
4901
+ workId: journeyIdSchema,
4902
+ afterOrdinal: z.number().int().min(-1).default(-1)
4903
+ }).strict()]);
4904
+ /** Internal history is never accepted by the public review inspection facade. */
4905
+ const journeyReviewStorageQuerySchema = z.union([
4906
+ journeyReviewQuerySchema,
4907
+ z.object({
4908
+ kind: z.literal("attempt"),
4909
+ journeyId: journeyIdSchema,
4910
+ batchId: journeyIdSchema
4911
+ }).strict(),
4912
+ z.object({
4913
+ kind: z.literal("protected"),
4914
+ journeyId: journeyIdSchema,
4915
+ afterBatchId: journeyIdSchema.optional(),
4916
+ /** Only batches outside this Work input that analysed one of its root sessions. */
4917
+ carriedTo: z.object({
4918
+ workId: journeyIdSchema,
4919
+ inputRevision: z.number().int().positive(),
4920
+ sessionIds: z.array(reviewChunkSchema.shape.sessionId).min(1)
4921
+ }).strict().optional()
4922
+ }).strict()
4923
+ ]);
4924
+ z.object({
4925
+ batch: reviewBatchSchema,
4926
+ review: reviewSubmitSchema.nullable(),
4927
+ additionalFindings: z.array(semanticFindingSchema),
4928
+ additionalRetained: z.array(retainedReviewAnchorSchema),
4929
+ assignments: z.array(z.object({
4930
+ findingId: journeyIdSchema,
4931
+ groupId: journeyIdSchema
4932
+ }).strict())
4933
+ }).strict().nullable();
4934
+ z.object({
4431
4935
  journeyId: journeyIdSchema.optional(),
4432
4936
  workIds: z.array(journeyIdSchema).min(1).max(1e3).optional()
4433
4937
  }).strict();
@@ -6007,7 +6511,7 @@ function createNativeJourney(storage, now = () => (/* @__PURE__ */ new Date()).t
6007
6511
  events: rows,
6008
6512
  state: await get({ journeyId: input.journeyId })
6009
6513
  };
6010
- await setTimeout$1(Math.min(250, Math.max(0, deadline - Date.now())), void 0, { signal });
6514
+ await setTimeout$1(Math.min(1e3, Math.max(0, deadline - Date.now())), void 0, { signal });
6011
6515
  }
6012
6516
  }
6013
6517
  async function prepare(value, signal) {
@@ -6110,7 +6614,7 @@ function createNativeJourney(storage, now = () => (/* @__PURE__ */ new Date()).t
6110
6614
  const scope = await port.renderScope?.(journeyId, workIds.length, signal);
6111
6615
  const renderWork = scope ? (workId) => scope.render(workId) : (workId) => port.render(journeyId, workId, signal);
6112
6616
  try {
6113
- await Promise.all(Array.from({ length: Math.min(scope?.concurrency ?? renderConcurrency, workIds.length) }, async () => {
6617
+ const failure = (await Promise.allSettled(Array.from({ length: Math.min(scope?.concurrency ?? renderConcurrency, workIds.length) }, async () => {
6114
6618
  for (let workId = workIds[next++]; workId !== void 0; workId = workIds[next++]) {
6115
6619
  try {
6116
6620
  await renderWork(workId);
@@ -6129,7 +6633,8 @@ function createNativeJourney(storage, now = () => (/* @__PURE__ */ new Date()).t
6129
6633
  }
6130
6634
  await new Promise((resolve) => setImmediate(resolve));
6131
6635
  }
6132
- }));
6636
+ }))).find((item) => item.status === "rejected");
6637
+ if (failure) throw failure.reason;
6133
6638
  } finally {
6134
6639
  await scope?.close();
6135
6640
  }
@@ -6146,383 +6651,175 @@ function createNativeJourney(storage, now = () => (/* @__PURE__ */ new Date()).t
6146
6651
  async function preview(value, signal = new AbortController().signal) {
6147
6652
  if (!local) throw new ApplicationError("INVALID_TRANSITION");
6148
6653
  return local.preview(journeyPreviewSchema.parse(value), signal);
6149
- }
6150
- async function files(value, signal = new AbortController().signal) {
6151
- const input = journeyRenderSchema.parse(value);
6152
- if (!local) throw new ApplicationError("INVALID_TRANSITION");
6153
- return local.files(input.journeyId, input.workId, signal);
6154
- }
6155
- async function submit(value) {
6156
- const result = await storage.submitReview(reviewSubmitSchema.parse(value));
6157
- return {
6158
- ...result,
6159
- state: await present(result.state)
6160
- };
6161
- }
6162
- async function compile(value) {
6163
- return storage.compileReview(reviewCompileSchema.parse(value));
6164
- }
6165
- async function correct(value) {
6166
- const result = await reportCorrection(storage, value, now());
6167
- return {
6168
- ...result,
6169
- state: await present(result.state)
6170
- };
6171
- }
6172
- async function search(value, signal = new AbortController().signal) {
6173
- if (!local) throw new ApplicationError("INVALID_TRANSITION");
6174
- return local.search(journeySearchSchema.parse(value), signal);
6175
- }
6176
- async function searchResult(value) {
6177
- return storage.readSearch(nativeGetSchema.required().parse(value).journeyId);
6178
- }
6179
- async function hidePlan(value, signal = new AbortController().signal) {
6180
- if (!local) throw new ApplicationError("INVALID_TRANSITION");
6181
- const result = await local.hide.plan(hidePlanInputSchema.parse(value), signal);
6182
- return {
6183
- ...result,
6184
- state: await present(result.state)
6185
- };
6186
- }
6187
- async function hideConfirm(value, source, signal = new AbortController().signal) {
6188
- if (!local) throw new ApplicationError("INVALID_TRANSITION");
6189
- const result = await local.hide.confirm(hideConfirmSchema.parse(value), source, signal);
6190
- return {
6191
- ...result,
6192
- state: await present(result.state)
6193
- };
6194
- }
6195
- async function hideRecover(value, signal = new AbortController().signal) {
6196
- if (!local) throw new ApplicationError("INVALID_TRANSITION");
6197
- const { journeyId } = nativeGetSchema.required().parse(value);
6198
- return present(await local.hide.recover(journeyId, signal));
6199
- }
6200
- async function cardsRead(value) {
6201
- const { journeyId } = nativeGetSchema.required().parse(value);
6202
- const state = await storage.current(journeyId);
6203
- if (!state?.consent) throw new ApplicationError("CONFIRMATION_REQUIRED");
6204
- return {
6205
- journeyId,
6206
- revision: state.revision,
6207
- ...state.privacy,
6208
- terms: activePrivacyTerms(state).map((term) => ({
6209
- ...term,
6210
- key: privacyTermKey(term)
6211
- }))
6212
- };
6213
- }
6214
- async function privacyWrite(value, resolve) {
6215
- const input = resolve ? privacyResolveSchema.parse(value) : cardsSubmitSchema.parse(value);
6216
- const rebase = "mode" in input && input.mode === "append";
6217
- for (let attempt = 0;; attempt++) {
6218
- const result = await commitPrivacy(input, rebase);
6219
- if (result.status !== "stale" || !rebase || attempt >= 4) return result;
6220
- }
6221
- }
6222
- async function commitPrivacy(input, rebase) {
6223
- const current = await storage.current(input.journeyId);
6224
- if (!current) throw new ApplicationError("UNKNOWN_ITEM");
6225
- const expectedRevision = rebase ? current.revision : input.expectedRevision;
6226
- const state = current.revision !== expectedRevision ? current : "resolutions" in input ? resolvePrivacyTerms(current, input) : publishDecisionCards(current, input);
6227
- const result = await storage.commit({
6228
- expectedRevision,
6229
- requestKey: input.idempotencyKey,
6230
- requestHash: digest$1(input),
6231
- state,
6232
- event: {
6233
- journeyId: state.journeyId,
6234
- kind: "response",
6235
- source: "conversation",
6236
- at: now()
6237
- }
6238
- });
6239
- return {
6240
- ...result,
6241
- state: await present(result.state)
6242
- };
6243
- }
6244
- return {
6245
- classificationSessions: async (value, signal = new AbortController().signal) => {
6246
- if (!local) throw new ApplicationError("INVALID_TRANSITION");
6247
- return local.works.classificationSessions(journeyClassificationSessionsSchema.parse(value), signal);
6248
- },
6249
- classificationProgress,
6250
- classificationRead: async (value, signal = new AbortController().signal) => {
6251
- if (!local) throw new ApplicationError("INVALID_TRANSITION");
6252
- return local.works.classificationRead(journeyClassificationReadSchema.parse(value), signal);
6253
- },
6254
- classificationSubmit: async (value, signal = new AbortController().signal) => {
6255
- if (!local) throw new ApplicationError("INVALID_TRANSITION");
6256
- const result = await local.works.classificationSubmit(journeyClassificationSubmitSchema.parse(value), signal);
6257
- return {
6258
- ...result,
6259
- state: await present(result.state)
6260
- };
6261
- },
6262
- cardsRead,
6263
- cardsSubmit: (value) => privacyWrite(value, false),
6264
- resolve: (value) => privacyWrite(value, true),
6265
- start,
6266
- get,
6267
- inventory: (value) => storage.readInventory(journeyInventoryQuerySchema.parse(value)),
6268
- respond,
6269
- events,
6270
- groupItems: (value) => readGroupItems(storage, value),
6271
- /** ADR 0086: one pack of read units and the values found in them. */
6272
- terms: async (value) => reviewTermsResultSchema.parse(await storage.recordTerms(reviewTermsInputSchema.parse(value))),
6273
- prepare,
6274
- read,
6275
- guidance,
6276
- inspect,
6277
- context,
6278
- place,
6279
- catalog,
6280
- classify,
6281
- describe,
6282
- submit,
6283
- compile,
6284
- record: (value) => recordReviewCandidate(storage, value),
6285
- repair: (value) => prepareReviewRepair(storage, value),
6286
- session: (value) => prepareSessionReview(storage, value),
6287
- reread: (value) => readSessionReview(storage, value),
6288
- reconcile: async (value) => {
6289
- const result = await submitSessionReview(storage, value);
6290
- return {
6291
- ...result,
6292
- commit: {
6293
- ...result.commit,
6294
- state: await present(result.commit.state)
6295
- }
6296
- };
6297
- },
6298
- reviewStatus: (value) => sessionReviewStatus(storage, value),
6299
- attempt: (value) => recordReviewAttempt(storage, value),
6300
- attempts: (value) => readReviewAttempts(storage, value),
6301
- correct,
6302
- render,
6303
- preview,
6304
- findings,
6305
- findingImpact,
6306
- files,
6307
- search,
6308
- searchResult,
6309
- hidePlan,
6310
- hideConfirm,
6311
- hideRecover
6312
- };
6313
- }
6314
- /** An empty period and no period both mean every session. */
6315
- function samePeriod(a, b) {
6316
- return (a?.since ?? null) === (b?.since ?? null) && (a?.until ?? null) === (b?.until ?? null);
6317
- }
6318
- //#endregion
6319
- //#region packages/application/src/journey/send/model.ts
6320
- const count$3 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
6321
- const access = z.enum(["public", "private"]);
6322
- const sendSourceSchema = z.object({
6323
- id: z.string().regex(/^w[0-9]{6,}$/u),
6324
- pathHash: journeyDigestSchema.nullable(),
6325
- remoteHashes: z.array(journeyDigestSchema),
6326
- primaryRemoteHash: journeyDigestSchema.nullable(),
6327
- challengeId: z.string().regex(/^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$/u).optional()
6328
- }).strict();
6329
- const sendArtifactSchema = z.object({
6330
- workId: journeyIdSchema,
6331
- revision: count$3,
6332
- bundleId: journeyIdSchema,
6333
- createdAt: z.iso.datetime(),
6334
- title: z.string().min(1).max(300),
6335
- sessionCount: count$3,
6336
- grouping: z.enum(["workspace", "regrouped"]),
6337
- sources: z.array(sendSourceSchema).min(1),
6338
- byteLength: count$3.positive(),
6339
- sha256: journeyDigestSchema
6340
- }).strict();
6341
- const sendCandidateSchema = z.object({
6342
- bindingId: journeyIdSchema,
6343
- workId: z.string().regex(/^wk_[A-Za-z0-9_-]{32}$/u),
6344
- title: z.string(),
6345
- access: z.enum([
6346
- "public",
6347
- "private",
6348
- "removed"
6349
- ])
6350
- }).strict();
6351
- const sendResolutionSchema = z.object({
6352
- logicalWorkId: journeyIdSchema,
6353
- status: z.enum([
6354
- "matched",
6355
- "new",
6356
- "choose",
6357
- "blocked"
6358
- ]),
6359
- reason: z.enum([
6360
- "binding",
6361
- "exact_source",
6362
- "no_candidate",
6363
- "ambiguous",
6364
- "work_removed"
6365
- ]),
6366
- accessVersion: count$3,
6367
- scopeVersion: count$3,
6368
- candidates: z.array(sendCandidateSchema)
6369
- }).strict();
6370
- const sendSettingsSchema = z.object({
6371
- publicId: z.string().regex(/^(?:ps|ap)_[A-Za-z0-9_-]{32}$/u),
6372
- workId: z.string().regex(/^wk_[A-Za-z0-9_-]{32}$/u),
6373
- access,
6374
- accessVersion: count$3,
6375
- scopeVersion: count$3,
6376
- membersDigest: journeyDigestSchema,
6377
- works: z.array(z.object({
6378
- workId: z.string(),
6379
- kind: z.enum(["repository", "upload"]),
6380
- title: z.string(),
6381
- access: z.enum([
6382
- "public",
6383
- "private",
6384
- "removed"
6385
- ])
6386
- }).strict())
6387
- }).strict();
6388
- const sendReceiptSchema = z.object({
6389
- receiptId: journeyIdSchema,
6390
- logicalWorkId: journeyIdSchema,
6391
- bindingId: journeyIdSchema,
6392
- workId: z.string().regex(/^wk_[A-Za-z0-9_-]{32}$/u),
6393
- publicId: z.string().regex(/^(?:ps|ap)_[A-Za-z0-9_-]{32}$/u),
6394
- passportUrl: z.url(),
6395
- bundleId: journeyIdSchema,
6396
- outputRevision: count$3.positive(),
6397
- byteLength: count$3.positive(),
6398
- sha256: journeyDigestSchema,
6399
- access,
6400
- effectiveAccess: z.enum([
6401
- "public",
6402
- "private",
6403
- "removed"
6404
- ]),
6405
- state: z.enum([
6406
- "awaiting_upload",
6407
- "accepted",
6408
- "running",
6409
- "succeeded",
6410
- "partial",
6411
- "failed",
6412
- "superseded"
6413
- ]),
6414
- scanId: journeyIdSchema,
6415
- assessmentState: z.enum([
6416
- "accepted",
6417
- "running",
6418
- "succeeded",
6419
- "partial",
6420
- "failed"
6421
- ]).nullable(),
6422
- passportIncluded: z.boolean(),
6423
- upload: z.object({
6424
- uploadUrl: z.url(),
6425
- expiresAt: z.iso.datetime()
6426
- }).strict().nullable()
6427
- }).strict();
6428
- /** `POST /me/works/replace`: the owner's other Works are retired (ADR 0204). */
6429
- const sendReplaceResultSchema = z.object({ retiredWorkIds: z.array(z.string().regex(/^wk_[A-Za-z0-9_-]{32}$/u)) }).strict();
6430
- const sendTargetSchema = z.discriminatedUnion("kind", [z.object({
6431
- kind: z.literal("existing"),
6432
- bindingId: journeyIdSchema
6433
- }).strict(), z.object({ kind: z.literal("new") }).strict()]);
6434
- const sendResolveInputSchema = z.object({
6435
- logicalWorkId: journeyIdSchema,
6436
- bindingId: journeyIdSchema.optional(),
6437
- grouping: z.enum(["workspace", "regrouped"]),
6438
- sources: z.array(sendSourceSchema).min(1)
6439
- }).strict();
6440
- const sendUploadInputSchema = z.object({
6441
- work: sendResolveInputSchema,
6442
- target: sendTargetSchema,
6443
- bundleId: journeyIdSchema,
6444
- createdAt: z.iso.datetime(),
6445
- title: z.string().min(1).max(300),
6446
- sessionCount: count$3,
6447
- access,
6448
- outputRevision: count$3.positive(),
6449
- byteLength: count$3.positive(),
6450
- sha256: journeyDigestSchema,
6451
- expectedAccessVersion: count$3,
6452
- expectedScopeVersion: count$3
6453
- }).strict();
6454
- const savedSendReceiptSchema = sendReceiptSchema.omit({ upload: true });
6455
- const sendItemSchema = z.object({
6456
- workId: journeyIdSchema,
6457
- title: z.string(),
6458
- access,
6459
- artifact: sendArtifactSchema,
6460
- operationKey: journeyIdSchema,
6461
- target: sendTargetSchema.nullable(),
6462
- targetConfirmed: z.boolean(),
6463
- resolution: sendResolutionSchema.nullable(),
6464
- settings: sendSettingsSchema.nullable(),
6465
- settingsConfirmed: z.boolean(),
6466
- /** The linked Settings changes the person last confirmed for this Work in this Send. */
6467
- confirmedSettings: sendSettingsSchema.nullable().optional(),
6468
- reservation: sendUploadInputSchema.nullable(),
6469
- receipt: savedSendReceiptSchema.nullable(),
6470
- previousReceipts: z.array(savedSendReceiptSchema),
6471
- /** The receipt whose bytes were PUT but not yet completed: the next step completes it (BL-210). */
6472
- uploadedReceiptId: journeyIdSchema.nullable().optional(),
6473
- status: z.enum([
6474
- "ready",
6475
- "target",
6476
- "settings",
6477
- "uploading",
6478
- "assessing",
6479
- "completed",
6480
- "blocked"
6481
- ]),
6482
- error: z.string().nullable()
6483
- }).strict();
6484
- const journeySendSchema = z.object({
6485
- id: journeyIdSchema,
6486
- journeyId: journeyIdSchema,
6487
- revision: count$3,
6488
- scopeDigest: journeyDigestSchema,
6489
- subject: z.string().nullable(),
6490
- confirmedAt: z.iso.datetime().nullable(),
6491
- status: z.enum([
6492
- "prepared",
6493
- "sign-in",
6494
- "review",
6495
- "sending",
6496
- "waiting",
6497
- "paused",
6498
- "completed",
6499
- "blocked"
6500
- ]),
6501
- items: z.array(sendItemSchema),
6502
- omitted: z.array(z.object({
6503
- workId: journeyIdSchema,
6504
- title: z.string(),
6505
- reason: z.enum([
6506
- "drop",
6507
- "empty",
6508
- "sent",
6509
- "not-ready",
6510
- "too-large",
6511
- "skipped"
6512
- ]),
6513
- /** Failed root families omitted even when the same Work has a retained output. */
6514
- sessionCount: count$3.positive().optional()
6515
- }).strict().refine((item) => item.reason !== "skipped" || item.sessionCount !== void 0)),
6516
- error: z.string().nullable(),
6517
- /**
6518
- * When this Send replaced the owner's earlier Passport Works and how many it retired; a
6519
- * native Send is completed only after this is recorded (ADR 0204).
6520
- */
6521
- replaced: z.object({
6522
- at: z.iso.datetime(),
6523
- retiredWorkCount: count$3
6524
- }).strict().nullable().optional()
6525
- }).strict();
6654
+ }
6655
+ async function files(value, signal = new AbortController().signal) {
6656
+ const input = journeyRenderSchema.parse(value);
6657
+ if (!local) throw new ApplicationError("INVALID_TRANSITION");
6658
+ return local.files(input.journeyId, input.workId, signal);
6659
+ }
6660
+ async function submit(value) {
6661
+ const result = await storage.submitReview(reviewSubmitSchema.parse(value));
6662
+ return {
6663
+ ...result,
6664
+ state: await present(result.state)
6665
+ };
6666
+ }
6667
+ async function compile(value) {
6668
+ return storage.compileReview(reviewCompileSchema.parse(value));
6669
+ }
6670
+ async function correct(value) {
6671
+ const result = await reportCorrection(storage, value, now());
6672
+ return {
6673
+ ...result,
6674
+ state: await present(result.state)
6675
+ };
6676
+ }
6677
+ async function search(value, signal = new AbortController().signal) {
6678
+ if (!local) throw new ApplicationError("INVALID_TRANSITION");
6679
+ return local.search(journeySearchSchema.parse(value), signal);
6680
+ }
6681
+ async function searchResult(value) {
6682
+ return storage.readSearch(nativeGetSchema.required().parse(value).journeyId);
6683
+ }
6684
+ async function hidePlan(value, signal = new AbortController().signal) {
6685
+ if (!local) throw new ApplicationError("INVALID_TRANSITION");
6686
+ const result = await local.hide.plan(hidePlanInputSchema.parse(value), signal);
6687
+ return {
6688
+ ...result,
6689
+ state: await present(result.state)
6690
+ };
6691
+ }
6692
+ async function hideConfirm(value, source, signal = new AbortController().signal) {
6693
+ if (!local) throw new ApplicationError("INVALID_TRANSITION");
6694
+ const result = await local.hide.confirm(hideConfirmSchema.parse(value), source, signal);
6695
+ return {
6696
+ ...result,
6697
+ state: await present(result.state)
6698
+ };
6699
+ }
6700
+ async function hideRecover(value, signal = new AbortController().signal) {
6701
+ if (!local) throw new ApplicationError("INVALID_TRANSITION");
6702
+ const { journeyId } = nativeGetSchema.required().parse(value);
6703
+ return present(await local.hide.recover(journeyId, signal));
6704
+ }
6705
+ async function cardsRead(value) {
6706
+ const { journeyId } = nativeGetSchema.required().parse(value);
6707
+ const state = await storage.current(journeyId);
6708
+ if (!state?.consent) throw new ApplicationError("CONFIRMATION_REQUIRED");
6709
+ return {
6710
+ journeyId,
6711
+ revision: state.revision,
6712
+ ...state.privacy,
6713
+ terms: activePrivacyTerms(state).map((term) => ({
6714
+ ...term,
6715
+ key: privacyTermKey(term)
6716
+ }))
6717
+ };
6718
+ }
6719
+ async function privacyWrite(value, resolve) {
6720
+ const input = resolve ? privacyResolveSchema.parse(value) : cardsSubmitSchema.parse(value);
6721
+ const rebase = "mode" in input && input.mode === "append";
6722
+ for (let attempt = 0;; attempt++) {
6723
+ const result = await commitPrivacy(input, rebase);
6724
+ if (result.status !== "stale" || !rebase || attempt >= 4) return result;
6725
+ }
6726
+ }
6727
+ async function commitPrivacy(input, rebase) {
6728
+ const current = await storage.current(input.journeyId);
6729
+ if (!current) throw new ApplicationError("UNKNOWN_ITEM");
6730
+ const expectedRevision = rebase ? current.revision : input.expectedRevision;
6731
+ const state = current.revision !== expectedRevision ? current : "resolutions" in input ? resolvePrivacyTerms(current, input) : publishDecisionCards(current, input);
6732
+ const result = await storage.commit({
6733
+ expectedRevision,
6734
+ requestKey: input.idempotencyKey,
6735
+ requestHash: digest$1(input),
6736
+ state,
6737
+ event: {
6738
+ journeyId: state.journeyId,
6739
+ kind: "response",
6740
+ source: "conversation",
6741
+ at: now()
6742
+ }
6743
+ });
6744
+ return {
6745
+ ...result,
6746
+ state: await present(result.state)
6747
+ };
6748
+ }
6749
+ return {
6750
+ classificationSessions: async (value, signal = new AbortController().signal) => {
6751
+ if (!local) throw new ApplicationError("INVALID_TRANSITION");
6752
+ return local.works.classificationSessions(journeyClassificationSessionsSchema.parse(value), signal);
6753
+ },
6754
+ classificationProgress,
6755
+ classificationRead: async (value, signal = new AbortController().signal) => {
6756
+ if (!local) throw new ApplicationError("INVALID_TRANSITION");
6757
+ return local.works.classificationRead(journeyClassificationReadSchema.parse(value), signal);
6758
+ },
6759
+ classificationSubmit: async (value, signal = new AbortController().signal) => {
6760
+ if (!local) throw new ApplicationError("INVALID_TRANSITION");
6761
+ const result = await local.works.classificationSubmit(journeyClassificationSubmitSchema.parse(value), signal);
6762
+ return {
6763
+ ...result,
6764
+ state: await present(result.state)
6765
+ };
6766
+ },
6767
+ cardsRead,
6768
+ cardsSubmit: (value) => privacyWrite(value, false),
6769
+ resolve: (value) => privacyWrite(value, true),
6770
+ start,
6771
+ get,
6772
+ inventory: (value) => storage.readInventory(journeyInventoryQuerySchema.parse(value)),
6773
+ respond,
6774
+ events,
6775
+ groupItems: (value) => readGroupItems(storage, value),
6776
+ /** ADR 0086: one pack of read units and the values found in them. */
6777
+ terms: async (value) => reviewTermsResultSchema.parse(await storage.recordTerms(reviewTermsInputSchema.parse(value))),
6778
+ prepare,
6779
+ read,
6780
+ guidance,
6781
+ inspect,
6782
+ context,
6783
+ place,
6784
+ catalog,
6785
+ classify,
6786
+ describe,
6787
+ submit,
6788
+ compile,
6789
+ record: (value) => recordReviewCandidate(storage, value),
6790
+ repair: (value) => prepareReviewRepair(storage, value),
6791
+ session: (value) => prepareSessionReview(storage, value),
6792
+ reread: (value) => readSessionReview(storage, value),
6793
+ reconcile: async (value) => {
6794
+ const result = await submitSessionReview(storage, value);
6795
+ return {
6796
+ ...result,
6797
+ commit: {
6798
+ ...result.commit,
6799
+ state: await present(result.commit.state)
6800
+ }
6801
+ };
6802
+ },
6803
+ reviewStatus: (value) => sessionReviewStatus(storage, value),
6804
+ attempt: (value) => recordReviewAttempt(storage, value),
6805
+ attempts: (value) => readReviewAttempts(storage, value),
6806
+ correct,
6807
+ render,
6808
+ preview,
6809
+ findings,
6810
+ findingImpact,
6811
+ files,
6812
+ search,
6813
+ searchResult,
6814
+ hidePlan,
6815
+ hideConfirm,
6816
+ hideRecover
6817
+ };
6818
+ }
6819
+ /** An empty period and no period both mean every session. */
6820
+ function samePeriod(a, b) {
6821
+ return (a?.since ?? null) === (b?.since ?? null) && (a?.until ?? null) === (b?.until ?? null);
6822
+ }
6526
6823
  //#endregion
6527
6824
  //#region packages/application/src/journey/send/command.ts
6528
6825
  const version$1 = z.number().int().nonnegative();
@@ -6557,11 +6854,22 @@ const sendChoiceSchema = sendActionSchema.extend({
6557
6854
  }).strict();
6558
6855
  //#endregion
6559
6856
  //#region packages/application/src/journey/send/service.ts
6560
- /** The API boundary never serializes private scoped exception values from stored state. */
6857
+ /** Public snapshots omit local source candidates and private scoped exception values. */
6561
6858
  function safeJourneySender(sender, now) {
6562
6859
  const safe = (result) => ({
6563
- ...result,
6564
- journey: journeyView(result.journey, now())
6860
+ ...withoutSnapshot(result),
6861
+ journey: journeyView(result.journey, now()),
6862
+ send: result.send && {
6863
+ ...result.send,
6864
+ items: result.send.items.map((item) => {
6865
+ const { agentSources: _candidates, ...artifact } = item.artifact;
6866
+ return {
6867
+ ...item,
6868
+ artifact,
6869
+ reservation: safeReservation(item.reservation)
6870
+ };
6871
+ })
6872
+ }
6565
6873
  });
6566
6874
  return {
6567
6875
  async get(input) {
@@ -6569,10 +6877,7 @@ function safeJourneySender(sender, now) {
6569
6877
  journeyId: input.journeyId,
6570
6878
  ...input.sendId ? { sendId: input.sendId } : {}
6571
6879
  });
6572
- return result ? {
6573
- ...result,
6574
- journey: journeyView(result.journey, now())
6575
- } : null;
6880
+ return result ? safe(result) : null;
6576
6881
  },
6577
6882
  async prepare(input, signal = new AbortController().signal) {
6578
6883
  return safe(await sender.prepare(input, signal));
@@ -6597,6 +6902,15 @@ function safeJourneySender(sender, now) {
6597
6902
  }
6598
6903
  };
6599
6904
  }
6905
+ function safeReservation(input) {
6906
+ if (!input) return null;
6907
+ const { agentSources: _admitted, ...reservation } = input;
6908
+ return reservation;
6909
+ }
6910
+ function withoutSnapshot(result) {
6911
+ const { journey: _journey, send: _send, ...rest } = result;
6912
+ return rest;
6913
+ }
6600
6914
  //#endregion
6601
6915
  //#region packages/application/src/sensitive-terms/model.ts
6602
6916
  const maximumTermsFileBytes = 16777216;
@@ -12287,39 +12601,6 @@ function reviseGroupMembership(state, action, members, preferenceScope) {
12287
12601
  };
12288
12602
  }
12289
12603
  //#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
12604
  //#region packages/application/src/journey/b/reconstruct.ts
12324
12605
  function reconstructBFields(inputs) {
12325
12606
  const units = inputs.map(validateBUnit).sort((left, right) => left.ordinal - right.ordinal);
@@ -12936,50 +13217,4 @@ function equivalenceDuplicates(batch) {
12936
13217
  return bindings.sort();
12937
13218
  }
12938
13219
  //#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 };
13220
+ export { settingsQuerySchema as $, mergeBRepair as $n, packageCommandSchema as $r, journeyResourceSchema as $t, deviceProfileScopeSchema as A, bContainment as An, staticSessionResourceSchema as Ar, validateAttemptAppend as At, validateInspectionBatch as B, journeyConfirmedHides as Bn, hasCompleteWorkDescription as Br, newJourneyWork as Bt, rebindReviewSubmit as C, renderedHideValue as Cn, privacyDecisionDigest as Cr, sendStartSchema as Ct, createAccount as D, hideKeyId as Dn, hasCurrentStaticReview as Dr, metadataProcessingVersion as Dt, staticallyHiddenFindings as E, addHideIndexTokens as En, nativeRespondSchema as Er, obsoleteJourney as Et, withSourceEvidence as F, confirmedHideGroupIds as Fn, sendArtifactSchema as Fr, applyClassificationProposal as Ft, validateInspectionFence as G, workPrivacyDecisions as Gn, withReadingProgress as Gr, hideFinishSchema as Gt, validateInspectionRequest as H, syncTermGroups as Hn, isReadingComplete as Hr, journeyContextQuerySchema as Ht, agentSetupKey as I, confirmedHideKey as In, sendReceiptSchema as Ir, classificationCommitSchema as It, validateInspectionQuery as J, reviewCandidateResourceSchema as Jn, journeyFindingsSchema as Jr, journeySearchSaveSchema as Jt, validateInspectionHead as K, workCorrectionBinding as Kn, mergePrivacyTerms as Kr, hidePublishSchema as Kt, createApplication as L, confirmedHideKinds as Ln, sendReplaceResultSchema as Lr, classificationPartition as Lt, readAccountAvatarUrl as M, bMaskedHits as Mn, agentSourceSchema as Mr, applyClassification as Mt, storedCredentialSchema as N, bTermMatcher as Nn, agentSourcesSchema as Nr, journeyBatchReadSchema as Nt, accountProfileSchema as O, maximumHideIndexTokens as On, staticReviewDigest as Or, nativeAdapterVersions as Ot, sourceIdentityEvidence as P, bWordBounded as Pn, journeySendSchema as Pr, journeyReviewStorageQuerySchema as Pt, settingsBatchSchema as Q, bReviewDigest as Qn, commandSchema as Qr, journeyResourceQuerySchema as Qt, inspectionCancelSchema as R, confirmedHideTerms as Rn, sendResolutionSchema as Rr, classificationWorks as Rt, rebindReviewOverlay as S, readConfirmedHideChange as Sn, assertJourneyPrivacyReady as Sr, sendPrepareSchema as St, guardedFindingText as T, termHideAdditions as Tn, nativeGetSchema as Tr, currentJourneyAdapters as Tt, inspectionQuerySchema as U, retireWorkDescription as Un, isSelectedWork as Ur, journeyContextSchema as Ut, validateInspectionBatches as V, maskedHitsStale as Vn, isClassifying as Vr, reviewCompileSchema as Vt, validateInspectionClaim as W, workDecisionDigest as Wn, selectedWorks as Wr, hideBeginSchema as Wt, validateDetectionSummary as X, reviewRepairResourceSchema as Xn, journeyRenderInputSchema as Xr, journeyPolicyRespondSchema as Xt, validateInspectionContribution as Y, reviewRepairInputSchema as Yn, journeyPreviewSchema as Yr, searchScopeDigest as Yt, inspectionInputs as Z, reviewTransportBytes as Zn, journeyRenderSchema as Zr, projectPreparationProgress as Zt, projectJourneyInventory as _, journeyCommitResultSchema as _n, preparationSettlementSchema as _r, maximumTermsFileBytes as _t, bCrossSegmentReviewSchema as a, sourceChangePolicy as ai, reviewAttemptsResultSchema as an, scanGitSeedsId as ar, maximumAgentSetupSessions as at, bReviewScope as b, confirmedHideAdditions as bn, journeyClassificationSessionsSchema as br, sendActionSchema as bt, reconstructBFields as c, effectiveTreatmentSchema as ci, sessionReconciliationResourceSchema as cn, scanExclusionResourceSchema as cr, validateFailureLocation as ct, selectedValueMembers as d, selectFrozenConfiguration as di, sessionReviewInputSchema as dn, journeyInventoryQuerySchema as dr, manualUploadChoiceSchema as dt, selectionBatchSchema as ei, journeyIsolateSchema as en, planBRepair as er, readWorkspaceOutcomes as et, splitSelectorValues as f, staticCatalogRef as fi, sessionReviewQuerySchema as fn, journeyInventoryReadSchema as fr, manualUploadPrepareSchema as ft, changeJourney as g, sessionUsefulnessResourceSchema as gn, preparationBeginSchema as gr, emptyTermsRevision as gt, semanticGroupKey as h, sessionUsefulnessInputSchema as hn, emptyPreparationFacts as hr, candidateSortAvailable as ht, validateBCrossSegmentReview as i, stateSchema as ii, reviewAttemptsQuerySchema as in, scanSessionResourceSchema as ir, defaultAgentSetupInclusion as it, profileUrlMatchesIdentity as j, bExceptionRanges as jn, agentSourcePathSegment as jr, journeyGuidance as jt, deviceAuthorizationSchema as k, packHideIndex as kn, staticSessionId as kr, attemptBudgetCodePoints as kt, reviseGroupMembership as l, defaultScopedSettings as li, sessionRereadInputSchema as ln, validateScanExclusion as lr, manualUploadActionSchema as lt, hideScopeDigest as m, sessionReviewStatusSchema as mn, journeyPreparationProgressSchema as mr, manualUploadStartSchema as mt, scanBatchEquivalenceDigest as n, gitMetadataBudgetBytes as ni, sortingApplySchema as nn, scanCanonicalResourceSchema as nr, appendSensitiveTerms as nt, bRereadDigest as o, recommendParallelism as oi, sessionReconcileInputSchema as on, scanGitSeedsResource as or, artifactFailureDetailSchema as ot, activeJourneyTerms as p, sessionReviewResourceSchema as pn, journeyInventorySchema as pr, manualUploadSchema as pt, validateInspectionInputs as q, reviewCandidateInputSchema as qn, journeyFindingImpactSchema as qr, journeySearchResultSchema as qt, locateTermEvidence as r, producerVersion as ri, reviewAttemptResourceSchema as rn, scanPreparationDigest as rr, classifyAgentSetup as rt, reconcileBSession as s, approvedTreatmentSchema as si, sessionReconcileResultSchema as sn, verifiedScanGitSeeds as sr, resolveFailureLocation as st, scanBatchContextDigest as t, selectionSchema as ti, journeyPlaceSchema as tn, scanAliasResourceSchema as tr, reviewInventory as tt, resolveGroupSplit as u, freezeConfiguration as ui, sessionRereadResourceSchema as un, resolveSourceSelection as ur, manualUploadBindingSchema as ut, preparationScope as v, journeyCommitSchema as vn, preparationStartSchema as vr, normalizeSensitiveTerms as vt, reviewBatchReuse as w, settleConfirmedHides as wn, nativeEventsSchema as wr, settleCorrections as wt, rebindReviewAlignment as x, confirmedHideDeltaSchema as xn, applyCardAnswers as xr, sendChoiceSchema as xt, isGenericPublicTerm as y, journeyEventSchema as yn, validatePreparationFacts as yr, replaceSensitiveTermsSchema as yt, inspectionStartSchema as z, dictionaryHides as zn, sendSettingsSchema as zr, retireScanGeneration as zt };