@gitroll/tacitt-cli 0.3.0 → 0.4.1

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.
@@ -1383,13 +1383,254 @@ function withReadingProgress(state) {
1383
1383
  };
1384
1384
  }
1385
1385
  //#endregion
1386
- //#region packages/application/src/journey/static-session.ts
1386
+ //#region packages/application/src/journey/send/model.ts
1387
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
1627
+ //#region packages/application/src/journey/static-session.ts
1628
+ const count$12 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
1388
1629
  const staticFileSchema = z.object({
1389
1630
  path: z.string().min(1),
1390
1631
  identity: fileIdentitySchema,
1391
1632
  sha256: journeyDigestSchema,
1392
- byteLength: count$13
1633
+ byteLength: count$12
1393
1634
  }).strict();
1394
1635
  /**
1395
1636
  * Track B (ADR 0172): one admitted session of the private packaging base, with every built-in
@@ -1399,9 +1640,10 @@ 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
- inputRevision: count$13.min(1),
1646
+ inputRevision: count$12.min(1),
1405
1647
  snapshotId: journeyDigestSchema,
1406
1648
  sessionId: z.string().min(1).max(128),
1407
1649
  jobDigest: journeyDigestSchema,
@@ -1411,7 +1653,7 @@ const staticSessionResourceSchema = z.object({
1411
1653
  companion: staticFileSchema,
1412
1654
  masks: staticFileSchema,
1413
1655
  /** Model-facing image blocks this session's output leaves out; absent on older receipts. */
1414
- imagesOmitted: count$13.optional()
1656
+ imagesOmitted: count$12.optional()
1415
1657
  }).strict();
1416
1658
  const staticSessionId = (resource) => `${resource.workId}:${resource.inputRevision}:${resource.sessionId}`;
1417
1659
  /** Binds one Work's complete static base to the exact session results it was sealed from. */
@@ -1480,7 +1722,7 @@ const journeyPropagateActionSchema = z.object({
1480
1722
  }).strict();
1481
1723
  //#endregion
1482
1724
  //#region packages/application/src/journey/scope/model.ts
1483
- const count$12 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
1725
+ const count$11 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
1484
1726
  const safeText = z.string().trim().min(1).max(240);
1485
1727
  const journeyScopeConfirmActionSchema = z.object({ kind: z.literal("scope-confirm") }).strict();
1486
1728
  const journeyWorkTypeActionSchema = z.object({
@@ -1496,7 +1738,7 @@ const journeyWorksAccessActionSchema = z.object({
1496
1738
  /** Static-only Work facts for proposing project types and scan scope; no source bodies. */
1497
1739
  const journeyCatalogQuerySchema = z.object({
1498
1740
  journeyId: journeyIdSchema,
1499
- after: count$12.default(0),
1741
+ after: count$11.default(0),
1500
1742
  limit: z.number().int().min(1).max(100).default(50),
1501
1743
  /** Bounded frozen root routing metadata for classification helpers. */
1502
1744
  includeClassificationRouting: z.boolean().optional(),
@@ -1507,13 +1749,13 @@ const journeyCatalogQuerySchema = z.object({
1507
1749
  path: ["includeProjectEvidence"]
1508
1750
  });
1509
1751
  const workspaceKinds = z.object({
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
1752
+ checkout: count$11,
1753
+ worktree: count$11,
1754
+ folder: count$11,
1755
+ scratch: count$11,
1756
+ temp: count$11,
1757
+ home: count$11,
1758
+ unresolved: count$11
1517
1759
  }).strict();
1518
1760
  const day = z.string().regex(/^\d{4}-\d{2}-\d{2}$/u);
1519
1761
  const journeyCatalogWorkSchema = z.object({
@@ -1526,8 +1768,8 @@ const journeyCatalogWorkSchema = z.object({
1526
1768
  ]),
1527
1769
  access: journeyAccessSchema,
1528
1770
  projectType: journeyWorkTypeSchema.nullable(),
1529
- roots: count$12,
1530
- children: count$12,
1771
+ roots: count$11,
1772
+ children: count$11,
1531
1773
  firstActivity: day.nullable(),
1532
1774
  lastActivity: day.nullable(),
1533
1775
  workspaces: workspaceKinds,
@@ -1541,7 +1783,7 @@ const classificationRootSchema = z.object({
1541
1783
  workspaceKind: z.string().min(1).max(40),
1542
1784
  harness: z.enum(["claude", "codex"]),
1543
1785
  titleAvailable: z.boolean(),
1544
- memberCount: count$12,
1786
+ memberCount: count$11,
1545
1787
  titles: z.array(safeText).max(3),
1546
1788
  projectEvidence: z.object({
1547
1789
  status: z.enum([
@@ -1550,7 +1792,7 @@ const classificationRootSchema = z.object({
1550
1792
  "insufficient"
1551
1793
  ]),
1552
1794
  incomplete: z.boolean(),
1553
- ignored: count$12,
1795
+ ignored: count$11,
1554
1796
  workspace: z.object({
1555
1797
  kind: safeText,
1556
1798
  name: safeText.nullable()
@@ -1558,10 +1800,10 @@ const classificationRootSchema = z.object({
1558
1800
  repositories: z.array(z.object({
1559
1801
  id: z.string().regex(/^[a-f0-9]{64}$/u),
1560
1802
  name: safeText,
1561
- references: count$12,
1562
- reads: count$12,
1563
- changes: count$12,
1564
- commands: count$12
1803
+ references: count$11,
1804
+ reads: count$11,
1805
+ changes: count$11,
1806
+ commands: count$11
1565
1807
  }).strict()).max(8)
1566
1808
  }).strict().optional()
1567
1809
  }).strict();
@@ -1586,11 +1828,11 @@ const classificationAssignmentSchema = z.object({
1586
1828
  }).strict();
1587
1829
  const journeyCatalogSchema = z.object({
1588
1830
  journeyId: journeyIdSchema,
1589
- revision: count$12,
1831
+ revision: count$11,
1590
1832
  scope: z.enum(["pending", "confirmed"]),
1591
- total: count$12,
1833
+ total: count$11,
1592
1834
  works: z.array(journeyCatalogWorkSchema).max(100),
1593
- next: count$12.nullable(),
1835
+ next: count$11.nullable(),
1594
1836
  classificationRouting: z.object({
1595
1837
  knownProjects: z.array(classificationKnownProjectSchema),
1596
1838
  unresolvedRoots: z.array(classificationRootSchema),
@@ -1600,7 +1842,7 @@ const journeyCatalogSchema = z.object({
1600
1842
  /** Model project-type suggestions; explicit and delegated types are never overwritten. */
1601
1843
  const journeyClassifySchema = z.object({
1602
1844
  journeyId: journeyIdSchema,
1603
- expectedRevision: count$12,
1845
+ expectedRevision: count$11,
1604
1846
  idempotencyKey: journeyIdSchema,
1605
1847
  items: z.array(z.object({
1606
1848
  workId: journeyIdSchema,
@@ -2053,12 +2295,12 @@ function respondPrivacy(state, action, source) {
2053
2295
  }
2054
2296
  //#endregion
2055
2297
  //#region packages/application/src/journey/scope/classification.ts
2056
- const count$11 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
2298
+ const count$10 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
2057
2299
  const classificationCursorSchema = z.object({
2058
2300
  snapshotId: journeyDigestSchema,
2059
- inputRevision: count$11,
2301
+ inputRevision: count$10,
2060
2302
  rootSessionId: z.string().min(1).max(128).optional(),
2061
- partIndex: count$11,
2303
+ partIndex: count$10,
2062
2304
  afterOrdinal: z.number().int().min(-1)
2063
2305
  }).strict();
2064
2306
  /** Private frozen content; reading it never records privacy-review coverage. */
@@ -2070,7 +2312,7 @@ const journeyClassificationReadSchema = z.object({
2070
2312
  }).strict();
2071
2313
  const journeyClassificationSubmitSchema = z.object({
2072
2314
  journeyId: journeyIdSchema,
2073
- expectedRevision: count$11,
2315
+ expectedRevision: count$10,
2074
2316
  idempotencyKey: journeyIdSchema,
2075
2317
  items: z.array(z.object({
2076
2318
  projectName: z.string().trim().min(1).max(240),
@@ -2091,7 +2333,7 @@ const journeyClassificationSubmitSchema = z.object({
2091
2333
  * While roots are still being grouped, scan writes keep moving the revision: a later
2092
2334
  * submission is bound to the classification it replaces instead (E2).
2093
2335
  */
2094
- expectedClassificationRevision: count$11.optional()
2336
+ expectedClassificationRevision: count$10.optional()
2095
2337
  }).strict();
2096
2338
  const journeyClassificationSessionsSchema = z.object({
2097
2339
  journeyId: journeyIdSchema,
@@ -2099,7 +2341,7 @@ const journeyClassificationSessionsSchema = z.object({
2099
2341
  rootsOnly: z.boolean().optional(),
2100
2342
  includeProjectEvidence: z.boolean().optional(),
2101
2343
  projectEvidenceRootSessionIds: z.array(z.string().min(1).max(128)).min(1).max(100).optional(),
2102
- after: count$11.default(0),
2344
+ after: count$10.default(0),
2103
2345
  limit: z.number().int().min(1).max(100).default(50)
2104
2346
  }).strict();
2105
2347
  //#endregion
@@ -2504,12 +2746,12 @@ function verifiedScanGitSeeds(resource, snapshotId, roots) {
2504
2746
  }
2505
2747
  //#endregion
2506
2748
  //#region packages/application/src/journey/scan-session.ts
2507
- const count$10 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
2749
+ const count$9 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
2508
2750
  const scanFileSchema = z.object({
2509
2751
  path: z.string().min(1),
2510
2752
  identity: fileIdentitySchema,
2511
2753
  sha256: journeyDigestSchema,
2512
- byteLength: count$10
2754
+ byteLength: count$9
2513
2755
  }).strict();
2514
2756
  /**
2515
2757
  * Track A source-bound prose (`file`) with built-in static protection spans; no delivery archive
@@ -2525,13 +2767,13 @@ const sessionScanInputSchema = z.object({
2525
2767
  native: nativeSourceIdentitySchema,
2526
2768
  facts: z.object({
2527
2769
  representation: z.enum(["jsonl", "jsonl.zst"]),
2528
- byteLength: count$10,
2770
+ byteLength: count$9,
2529
2771
  sha256: journeyDigestSchema
2530
2772
  }).strict()
2531
2773
  }).strict()),
2532
- recordCount: count$10,
2533
- fieldCount: count$10,
2534
- inputUtf16: count$10,
2774
+ recordCount: count$9,
2775
+ fieldCount: count$9,
2776
+ inputUtf16: count$9,
2535
2777
  mainReviewVerified: z.literal(true),
2536
2778
  emptyReviewVerified: z.boolean()
2537
2779
  }).strict().refine((input) => new Set(input.sources.map((source) => source.sourceId)).size === input.sources.length);
@@ -2539,7 +2781,7 @@ const scanSessionResourceSchema = z.object({
2539
2781
  kind: z.literal("scan-session"),
2540
2782
  journeyId: journeyIdSchema,
2541
2783
  workId: journeyIdSchema,
2542
- inputRevision: count$10.min(1),
2784
+ inputRevision: count$9.min(1),
2543
2785
  snapshotId: journeyDigestSchema,
2544
2786
  configurationDigest: journeyDigestSchema,
2545
2787
  rootSessionId: z.string().min(1),
@@ -2558,7 +2800,7 @@ function scanPreparationDigest(resources) {
2558
2800
  const scanBatchBinding = {
2559
2801
  journeyId: journeyIdSchema,
2560
2802
  workId: journeyIdSchema,
2561
- inputRevision: count$10.min(1),
2803
+ inputRevision: count$9.min(1),
2562
2804
  snapshotId: journeyDigestSchema,
2563
2805
  configurationDigest: journeyDigestSchema
2564
2806
  };
@@ -3573,7 +3815,7 @@ const reviewProgressSchema = z.array(z.object({
3573
3815
  }).strict());
3574
3816
  //#endregion
3575
3817
  //#region packages/application/src/journey/review/session-schema.ts
3576
- const count$9 = z.number().int().nonnegative();
3818
+ const count$8 = z.number().int().nonnegative();
3577
3819
  const sessionReviewInputSchema = z.object({
3578
3820
  journeyId: journeyIdSchema,
3579
3821
  workId: journeyIdSchema,
@@ -3594,7 +3836,7 @@ const sessionReviewResourceSchema = z.object({
3594
3836
  workId: journeyIdSchema,
3595
3837
  sessionId: z.string().min(1).max(128),
3596
3838
  snapshotId: journeyDigestSchema,
3597
- inputRevision: count$9.positive(),
3839
+ inputRevision: count$8.positive(),
3598
3840
  requestHash: journeyDigestSchema,
3599
3841
  bindingDigest: journeyDigestSchema,
3600
3842
  at: z.iso.datetime(),
@@ -3608,8 +3850,8 @@ const sessionReviewResourceSchema = z.object({
3608
3850
  issues: z.array(reviewIssueSchema),
3609
3851
  requiresSemantic: z.boolean(),
3610
3852
  usefulness: sessionUsefulnessSchema,
3611
- totalCodePoints: count$9,
3612
- reviewedCodePoints: count$9
3853
+ totalCodePoints: count$8,
3854
+ reviewedCodePoints: count$8
3613
3855
  }).strict();
3614
3856
  const sessionRereadInputSchema = z.object({
3615
3857
  journeyId: journeyIdSchema,
@@ -3618,8 +3860,8 @@ const sessionRereadInputSchema = z.object({
3618
3860
  anchors: z.array(z.object({
3619
3861
  fieldId: z.string().min(1),
3620
3862
  fieldHash: journeyDigestSchema,
3621
- start: count$9,
3622
- end: count$9
3863
+ start: count$8,
3864
+ end: count$8
3623
3865
  }).strict()).min(1).max(128)
3624
3866
  }).strict();
3625
3867
  const sessionRereadResourceSchema = z.object({
@@ -3628,7 +3870,7 @@ const sessionRereadResourceSchema = z.object({
3628
3870
  journeyId: journeyIdSchema,
3629
3871
  workId: journeyIdSchema,
3630
3872
  sessionId: z.string().min(1).max(128),
3631
- inputRevision: count$9.positive(),
3873
+ inputRevision: count$8.positive(),
3632
3874
  snapshotId: journeyDigestSchema,
3633
3875
  sessionReviewId: journeyIdSchema,
3634
3876
  bindingDigest: journeyDigestSchema,
@@ -3646,8 +3888,8 @@ const sessionReconcileInputSchema = z.object({
3646
3888
  alignment: reviewAlignmentSchema
3647
3889
  }).strict();
3648
3890
  const retainedReviewAnchorSchema = bAnchorSchema.extend({
3649
- utf16Start: count$9,
3650
- utf16End: count$9,
3891
+ utf16Start: count$8,
3892
+ utf16End: count$8,
3651
3893
  owned: z.boolean()
3652
3894
  }).strict();
3653
3895
  const sessionOverlaySchema = z.object({
@@ -3661,7 +3903,7 @@ const sessionReconciliationResourceSchema = z.object({
3661
3903
  journeyId: journeyIdSchema,
3662
3904
  workId: journeyIdSchema,
3663
3905
  sessionId: z.string().min(1).max(128),
3664
- inputRevision: count$9.positive(),
3906
+ inputRevision: count$8.positive(),
3665
3907
  snapshotId: journeyDigestSchema,
3666
3908
  sessionReviewId: journeyIdSchema,
3667
3909
  bindingDigest: journeyDigestSchema,
@@ -3689,8 +3931,8 @@ const sessionReviewQuerySchema = z.object({
3689
3931
  workId: journeyIdSchema.optional(),
3690
3932
  sessionId: z.string().min(1).max(128).optional(),
3691
3933
  sessionReviewId: journeyIdSchema.optional(),
3692
- afterHit: count$9.default(0),
3693
- limit: count$9.positive().max(500).default(100)
3934
+ afterHit: count$8.default(0),
3935
+ limit: count$8.positive().max(500).default(100)
3694
3936
  }).strict();
3695
3937
  const sessionReviewStatusSchema = z.object({
3696
3938
  complete: z.boolean(),
@@ -3706,8 +3948,8 @@ const sessionReviewStatusSchema = z.object({
3706
3948
  requiresHumanDecision: z.boolean(),
3707
3949
  requiresSemantic: z.boolean(),
3708
3950
  issues: z.array(reviewIssueSchema),
3709
- totalCodePoints: count$9,
3710
- reviewedCodePoints: count$9,
3951
+ totalCodePoints: count$8,
3952
+ reviewedCodePoints: count$8,
3711
3953
  reconciliationId: journeyIdSchema.nullable(),
3712
3954
  /** ADR 0086: a read unit of the session suggests excluding it; advice, never a gate. */
3713
3955
  suggestExclude: z.boolean(),
@@ -3715,8 +3957,8 @@ const sessionReviewStatusSchema = z.object({
3715
3957
  reason: z.string().min(1).max(2e3).nullable()
3716
3958
  }).strict()),
3717
3959
  hits: z.array(sessionReviewHitSchema),
3718
- nextHit: count$9.nullable(),
3719
- totalHits: count$9
3960
+ nextHit: count$8.nullable(),
3961
+ totalHits: count$8
3720
3962
  }).strict();
3721
3963
  const sessionReviewResultSchema = z.object({
3722
3964
  preparation: sessionReviewResourceSchema,
@@ -3800,13 +4042,13 @@ const metadataFieldsSchema = z.object({
3800
4042
  }).strict();
3801
4043
  //#endregion
3802
4044
  //#region packages/application/src/journey/placement/routing-schema.ts
3803
- const count$8 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
4045
+ const count$7 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
3804
4046
  const bucket = z.object({
3805
4047
  complete: z.boolean(),
3806
- total: count$8,
4048
+ total: count$7,
3807
4049
  repositories: z.array(z.object({
3808
4050
  id: z.string().min(1),
3809
- count: count$8.min(1)
4051
+ count: count$7.min(1)
3810
4052
  }).strict())
3811
4053
  }).strict();
3812
4054
  const placementSignalsSchema = z.object({
@@ -3824,8 +4066,8 @@ const cheapPlacementSchema = z.object({
3824
4066
  "name"
3825
4067
  ]),
3826
4068
  confidence: z.enum(["high", "medium"]),
3827
- matched: count$8.min(1),
3828
- total: count$8.min(1),
4069
+ matched: count$7.min(1),
4070
+ total: count$7.min(1),
3829
4071
  otherRepositoryIds: z.array(z.string())
3830
4072
  }).strict();
3831
4073
  const sortingResourceSchema = z.object({
@@ -3846,26 +4088,26 @@ const sortingResourceSchema = z.object({
3846
4088
  const sortingApplySchema = z.object({
3847
4089
  journeyId: z.uuid(),
3848
4090
  sessionId: z.string().min(1).max(128),
3849
- expectedRevision: count$8,
4091
+ expectedRevision: count$7,
3850
4092
  idempotencyKey: z.uuid()
3851
4093
  }).strict();
3852
4094
  /** Preparation moves identified failing roots of one pending Work into its blocked Work. */
3853
4095
  const journeyIsolateSchema = z.object({
3854
4096
  journeyId: z.uuid(),
3855
4097
  workId: z.uuid(),
3856
- inputRevision: count$8.min(1),
4098
+ inputRevision: count$7.min(1),
3857
4099
  roots: z.array(z.object({
3858
4100
  sessionId: z.string().min(1).max(128),
3859
4101
  code: z.string().regex(/^[A-Z_]{3,80}$/u)
3860
4102
  }).strict()).min(1).max(1e5),
3861
- expectedRevision: count$8,
4103
+ expectedRevision: count$7,
3862
4104
  idempotencyKey: z.uuid()
3863
4105
  }).strict();
3864
4106
  const placement = z.object({
3865
4107
  workId: z.uuid(),
3866
4108
  sessionId: z.string().min(1).max(128),
3867
- inputRevision: count$8.min(1),
3868
- throughEvent: count$8,
4109
+ inputRevision: count$7.min(1),
4110
+ throughEvent: count$7,
3869
4111
  contextDigest: z.string().regex(/^[a-f0-9]{64}$/u),
3870
4112
  decision: z.enum([
3871
4113
  "join",
@@ -3881,13 +4123,13 @@ const placement = z.object({
3881
4123
  }).strict();
3882
4124
  const journeyPlaceSchema = z.object({
3883
4125
  journeyId: z.uuid(),
3884
- expectedRevision: count$8,
4126
+ expectedRevision: count$7,
3885
4127
  idempotencyKey: z.uuid(),
3886
4128
  placements: z.array(placement).min(1).max(1e3)
3887
4129
  }).strict();
3888
4130
  //#endregion
3889
4131
  //#region packages/application/src/journey/scope/progress.ts
3890
- const count$7 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
4132
+ const count$6 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
3891
4133
  const ids = z.array(z.string().min(1).max(128)).max(1e5).refine((values) => new Set(values).size === values.length);
3892
4134
  const journeyClassificationProgressSchema = z.object({
3893
4135
  journeyId: journeyIdSchema,
@@ -3895,8 +4137,8 @@ const journeyClassificationProgressSchema = z.object({
3895
4137
  id: z.literal("current"),
3896
4138
  snapshotId: journeyDigestSchema,
3897
4139
  inputFingerprint: journeyDigestSchema,
3898
- baselineRevision: count$7,
3899
- proposalRevision: count$7.nullable(),
4140
+ baselineRevision: count$6,
4141
+ proposalRevision: count$6.nullable(),
3900
4142
  stage: z.enum(["classification", "proposal"]),
3901
4143
  status: z.enum([
3902
4144
  "running",
@@ -3906,7 +4148,7 @@ const journeyClassificationProgressSchema = z.object({
3906
4148
  ]),
3907
4149
  startedAt: z.iso.datetime(),
3908
4150
  updatedAt: z.iso.datetime(),
3909
- elapsedMs: count$7,
4151
+ elapsedMs: count$6,
3910
4152
  rootIds: ids,
3911
4153
  completedRootIds: ids,
3912
4154
  groupedRootIds: ids,
@@ -4169,7 +4411,7 @@ const journeyPolicyRespondSchema = z.object({
4169
4411
  }).strict();
4170
4412
  //#endregion
4171
4413
  //#region packages/application/src/journey/search.ts
4172
- const count$6 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
4414
+ const count$5 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
4173
4415
  const term = z.string().min(1).max(1024).refine((value) => Buffer.byteLength(value) <= 1024 && !/[\0\r\n]/u.test(value));
4174
4416
  const journeySearchSchema = z.object({
4175
4417
  journeyId: journeyIdSchema,
@@ -4183,11 +4425,11 @@ const journeySearchResultSchema = z.object({
4183
4425
  binding: z.object({
4184
4426
  journeyId: journeyIdSchema,
4185
4427
  snapshotId: journeyDigestSchema,
4186
- revision: count$6,
4428
+ revision: count$5,
4187
4429
  scopeDigest: journeyDigestSchema,
4188
4430
  outputs: z.array(z.object({
4189
4431
  workId: journeyIdSchema,
4190
- outputRevision: count$6,
4432
+ outputRevision: count$5,
4191
4433
  sha256: journeyDigestSchema
4192
4434
  }).strict())
4193
4435
  }).strict(),
@@ -4204,10 +4446,10 @@ const journeySearchResultSchema = z.object({
4204
4446
  terms: z.array(z.object({
4205
4447
  id: z.string(),
4206
4448
  tried: z.array(z.string()),
4207
- sentMatches: count$6.nullable(),
4208
- originalMatches: count$6.nullable(),
4209
- sentSessions: count$6.nullable(),
4210
- originalSessions: count$6.nullable()
4449
+ sentMatches: count$5.nullable(),
4450
+ originalMatches: count$5.nullable(),
4451
+ sentSessions: count$5.nullable(),
4452
+ originalSessions: count$5.nullable()
4211
4453
  }).strict()),
4212
4454
  hits: z.array(z.object({
4213
4455
  termId: z.string(),
@@ -4223,16 +4465,16 @@ const journeySearchResultSchema = z.object({
4223
4465
  archiveSessionId: z.string().optional(),
4224
4466
  sessionId: z.string().optional(),
4225
4467
  sourcePartId: z.string().optional(),
4226
- recordIndex: count$6,
4468
+ recordIndex: count$5,
4227
4469
  fieldId: z.string(),
4228
- line: count$6
4470
+ line: count$5
4229
4471
  }).strict(),
4230
- occurrences: count$6,
4472
+ occurrences: count$5,
4231
4473
  modelContext: z.string().max(4096).optional(),
4232
4474
  match: z.object({
4233
- variantIndex: count$6.max(7),
4234
- start: count$6,
4235
- end: count$6
4475
+ variantIndex: count$5.max(7),
4476
+ start: count$5,
4477
+ end: count$5
4236
4478
  }).strict().optional()
4237
4479
  }).strict()),
4238
4480
  failures: z.array(z.object({
@@ -4255,7 +4497,7 @@ const journeySearchResultSchema = z.object({
4255
4497
  }));
4256
4498
  const journeySearchSaveSchema = z.object({
4257
4499
  journeyId: journeyIdSchema,
4258
- expectedRevision: count$6,
4500
+ expectedRevision: count$5,
4259
4501
  idempotencyKey: journeyIdSchema,
4260
4502
  result: journeySearchResultSchema
4261
4503
  }).strict();
@@ -4292,10 +4534,10 @@ const hideFinishSchema = z.object({
4292
4534
  }).strict();
4293
4535
  //#endregion
4294
4536
  //#region packages/application/src/journey/placement/context-schema.ts
4295
- const count$5 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
4537
+ const count$4 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
4296
4538
  const cursor = z.object({
4297
- inputRevision: count$5.min(1),
4298
- throughEvent: count$5,
4539
+ inputRevision: count$4.min(1),
4540
+ throughEvent: count$4,
4299
4541
  afterOrdinal: z.number().int().min(-1)
4300
4542
  }).strict();
4301
4543
  const journeyContextQuerySchema = z.object({
@@ -4308,14 +4550,14 @@ const journeyContextSchema = z.object({
4308
4550
  journeyId: z.uuid(),
4309
4551
  workId: z.uuid(),
4310
4552
  sessionId: z.string().min(1).max(128).nullable(),
4311
- inputRevision: count$5.min(1),
4553
+ inputRevision: count$4.min(1),
4312
4554
  explicitTitleId: z.uuid().nullable(),
4313
4555
  titleReview: z.object({
4314
4556
  id: z.uuid(),
4315
4557
  text: z.string().min(1).max(240),
4316
4558
  sha256: z.string().regex(/^[a-f0-9]{64}$/u)
4317
4559
  }).strict().nullable(),
4318
- throughEvent: count$5,
4560
+ throughEvent: count$4,
4319
4561
  digest: z.string().regex(/^[a-f0-9]{64}$/u),
4320
4562
  decisionDigest: z.string().regex(/^[a-f0-9]{64}$/u),
4321
4563
  decisions: z.array(z.object({
@@ -4333,13 +4575,13 @@ const journeyContextSchema = z.object({
4333
4575
  confirmed: z.boolean()
4334
4576
  }).strict()),
4335
4577
  describedCheckpoints: z.array(z.enum(["initial", "complete"])).max(2),
4336
- totalBatches: count$5,
4337
- reviewedBatches: count$5,
4578
+ totalBatches: count$4,
4579
+ reviewedBatches: count$4,
4338
4580
  complete: z.boolean(),
4339
4581
  placementReviewed: z.boolean(),
4340
4582
  fragments: z.array(z.object({
4341
4583
  batchId: z.uuid(),
4342
- ordinal: count$5
4584
+ ordinal: count$4
4343
4585
  }).strict()).max(16),
4344
4586
  cursor: cursor.nullable()
4345
4587
  }).strict();
@@ -4447,7 +4689,7 @@ function resetWorkScan(work) {
4447
4689
  }
4448
4690
  //#endregion
4449
4691
  //#region packages/application/src/journey/scope/proposal.ts
4450
- const count$4 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
4692
+ const count$3 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
4451
4693
  const workspaces = z.array(z.string().min(1).max(128));
4452
4694
  /**
4453
4695
  * A complete classification proposal prepared outside the store and applied inside one store
@@ -4460,9 +4702,9 @@ const classificationCommitSchema = z.object({
4460
4702
  requestHash: journeyDigestSchema,
4461
4703
  at: z.iso.datetime(),
4462
4704
  /** Unbound proposals keep the exact journey revision fence. */
4463
- expectedRevision: count$4,
4705
+ expectedRevision: count$3,
4464
4706
  /** Bound proposals (E2) are fenced on the classification they replace instead. */
4465
- expectedClassificationRevision: count$4.nullable(),
4707
+ expectedClassificationRevision: count$3.nullable(),
4466
4708
  snapshotId: journeyDigestSchema,
4467
4709
  /** `classificationPartition` of the state the proposal was prepared against. */
4468
4710
  partition: journeyDigestSchema,
@@ -5518,7 +5760,7 @@ async function readGroupItems(storage, value) {
5518
5760
  //#region packages/application/src/export/versions.ts
5519
5761
  /** Current built-in admission, annotation and retention contracts; implementations share these. */
5520
5762
  const nativeAdapterVersions = Object.freeze({
5521
- claude: "claude-native-export-v18",
5763
+ claude: "claude-native-export-v19",
5522
5764
  codex: "codex-native-export-v16"
5523
5765
  });
5524
5766
  /** Shared metadata annotation/preparation semantics, independent of serialization formats. */
@@ -6579,224 +6821,6 @@ function samePeriod(a, b) {
6579
6821
  return (a?.since ?? null) === (b?.since ?? null) && (a?.until ?? null) === (b?.until ?? null);
6580
6822
  }
6581
6823
  //#endregion
6582
- //#region packages/application/src/journey/send/model.ts
6583
- const count$3 = z.number().int().nonnegative().max(Number.MAX_SAFE_INTEGER);
6584
- const access = z.enum(["public", "private"]);
6585
- const sendSourceSchema = z.object({
6586
- id: z.string().regex(/^w[0-9]{6,}$/u),
6587
- pathHash: journeyDigestSchema.nullable(),
6588
- remoteHashes: z.array(journeyDigestSchema),
6589
- primaryRemoteHash: journeyDigestSchema.nullable(),
6590
- challengeId: z.string().regex(/^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$/u).optional()
6591
- }).strict();
6592
- const sendArtifactSchema = z.object({
6593
- workId: journeyIdSchema,
6594
- revision: count$3,
6595
- bundleId: journeyIdSchema,
6596
- createdAt: z.iso.datetime(),
6597
- title: z.string().min(1).max(300),
6598
- sessionCount: count$3,
6599
- grouping: z.enum(["workspace", "regrouped"]),
6600
- sources: z.array(sendSourceSchema).min(1),
6601
- byteLength: count$3.positive(),
6602
- sha256: journeyDigestSchema
6603
- }).strict();
6604
- const sendCandidateSchema = z.object({
6605
- bindingId: journeyIdSchema,
6606
- workId: z.string().regex(/^wk_[A-Za-z0-9_-]{32}$/u),
6607
- title: z.string(),
6608
- access: z.enum([
6609
- "public",
6610
- "private",
6611
- "removed"
6612
- ])
6613
- }).strict();
6614
- const sendResolutionSchema = z.object({
6615
- logicalWorkId: journeyIdSchema,
6616
- status: z.enum([
6617
- "matched",
6618
- "new",
6619
- "choose",
6620
- "blocked"
6621
- ]),
6622
- reason: z.enum([
6623
- "binding",
6624
- "exact_source",
6625
- "no_candidate",
6626
- "ambiguous",
6627
- "work_removed"
6628
- ]),
6629
- accessVersion: count$3,
6630
- scopeVersion: count$3,
6631
- candidates: z.array(sendCandidateSchema)
6632
- }).strict();
6633
- const sendSettingsSchema = z.object({
6634
- publicId: z.string().regex(/^(?:ps|ap)_[A-Za-z0-9_-]{32}$/u),
6635
- workId: z.string().regex(/^wk_[A-Za-z0-9_-]{32}$/u),
6636
- access,
6637
- accessVersion: count$3,
6638
- scopeVersion: count$3,
6639
- membersDigest: journeyDigestSchema,
6640
- works: z.array(z.object({
6641
- workId: z.string(),
6642
- kind: z.enum(["repository", "upload"]),
6643
- title: z.string(),
6644
- access: z.enum([
6645
- "public",
6646
- "private",
6647
- "removed"
6648
- ])
6649
- }).strict())
6650
- }).strict();
6651
- const sendReceiptSchema = z.object({
6652
- receiptId: journeyIdSchema,
6653
- logicalWorkId: journeyIdSchema,
6654
- bindingId: journeyIdSchema,
6655
- workId: z.string().regex(/^wk_[A-Za-z0-9_-]{32}$/u),
6656
- publicId: z.string().regex(/^(?:ps|ap)_[A-Za-z0-9_-]{32}$/u),
6657
- passportUrl: z.url(),
6658
- bundleId: journeyIdSchema,
6659
- outputRevision: count$3.positive(),
6660
- byteLength: count$3.positive(),
6661
- sha256: journeyDigestSchema,
6662
- access,
6663
- effectiveAccess: z.enum([
6664
- "public",
6665
- "private",
6666
- "removed"
6667
- ]),
6668
- state: z.enum([
6669
- "awaiting_upload",
6670
- "accepted",
6671
- "running",
6672
- "succeeded",
6673
- "partial",
6674
- "failed",
6675
- "superseded"
6676
- ]),
6677
- scanId: journeyIdSchema,
6678
- assessmentState: z.enum([
6679
- "accepted",
6680
- "running",
6681
- "succeeded",
6682
- "partial",
6683
- "failed"
6684
- ]).nullable(),
6685
- passportIncluded: z.boolean(),
6686
- upload: z.object({
6687
- uploadUrl: z.url(),
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()
6694
- }).strict().nullable()
6695
- }).strict();
6696
- /** `POST /me/works/replace`: the owner's other Works are retired (ADR 0204). */
6697
- const sendReplaceResultSchema = z.object({ retiredWorkIds: z.array(z.string().regex(/^wk_[A-Za-z0-9_-]{32}$/u)) }).strict();
6698
- const sendTargetSchema = z.discriminatedUnion("kind", [z.object({
6699
- kind: z.literal("existing"),
6700
- bindingId: journeyIdSchema
6701
- }).strict(), z.object({ kind: z.literal("new") }).strict()]);
6702
- const sendResolveInputSchema = z.object({
6703
- logicalWorkId: journeyIdSchema,
6704
- bindingId: journeyIdSchema.optional(),
6705
- grouping: z.enum(["workspace", "regrouped"]),
6706
- sources: z.array(sendSourceSchema).min(1)
6707
- }).strict();
6708
- const sendUploadInputSchema = z.object({
6709
- work: sendResolveInputSchema,
6710
- target: sendTargetSchema,
6711
- bundleId: journeyIdSchema,
6712
- createdAt: z.iso.datetime(),
6713
- title: z.string().min(1).max(300),
6714
- sessionCount: count$3,
6715
- access,
6716
- outputRevision: count$3.positive(),
6717
- byteLength: count$3.positive(),
6718
- sha256: journeyDigestSchema,
6719
- expectedAccessVersion: count$3,
6720
- expectedScopeVersion: count$3
6721
- }).strict();
6722
- const savedSendReceiptSchema = sendReceiptSchema.omit({ upload: true });
6723
- const sendItemSchema = z.object({
6724
- workId: journeyIdSchema,
6725
- title: z.string(),
6726
- access,
6727
- artifact: sendArtifactSchema,
6728
- operationKey: journeyIdSchema,
6729
- target: sendTargetSchema.nullable(),
6730
- targetConfirmed: z.boolean(),
6731
- resolution: sendResolutionSchema.nullable(),
6732
- settings: sendSettingsSchema.nullable(),
6733
- settingsConfirmed: z.boolean(),
6734
- /** The linked Settings changes the person last confirmed for this Work in this Send. */
6735
- confirmedSettings: sendSettingsSchema.nullable().optional(),
6736
- reservation: sendUploadInputSchema.nullable(),
6737
- receipt: savedSendReceiptSchema.nullable(),
6738
- previousReceipts: z.array(savedSendReceiptSchema),
6739
- /** The receipt whose bytes were PUT but not yet completed: the next step completes it (BL-210). */
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(),
6746
- status: z.enum([
6747
- "ready",
6748
- "target",
6749
- "settings",
6750
- "uploading",
6751
- "assessing",
6752
- "completed",
6753
- "blocked"
6754
- ]),
6755
- error: z.string().nullable()
6756
- }).strict();
6757
- const journeySendSchema = z.object({
6758
- id: journeyIdSchema,
6759
- journeyId: journeyIdSchema,
6760
- revision: count$3,
6761
- scopeDigest: journeyDigestSchema,
6762
- subject: z.string().nullable(),
6763
- confirmedAt: z.iso.datetime().nullable(),
6764
- status: z.enum([
6765
- "prepared",
6766
- "sign-in",
6767
- "review",
6768
- "sending",
6769
- "waiting",
6770
- "paused",
6771
- "completed",
6772
- "blocked"
6773
- ]),
6774
- items: z.array(sendItemSchema),
6775
- omitted: z.array(z.object({
6776
- workId: journeyIdSchema,
6777
- title: z.string(),
6778
- reason: z.enum([
6779
- "drop",
6780
- "empty",
6781
- "sent",
6782
- "not-ready",
6783
- "too-large",
6784
- "skipped"
6785
- ]),
6786
- /** Failed root families omitted even when the same Work has a retained output. */
6787
- sessionCount: count$3.positive().optional()
6788
- }).strict().refine((item) => item.reason !== "skipped" || item.sessionCount !== void 0)),
6789
- error: z.string().nullable(),
6790
- /**
6791
- * When this Send replaced the owner's earlier Passport Works and how many it retired; a
6792
- * native Send is completed only after this is recorded (ADR 0204).
6793
- */
6794
- replaced: z.object({
6795
- at: z.iso.datetime(),
6796
- retiredWorkCount: count$3
6797
- }).strict().nullable().optional()
6798
- }).strict();
6799
- //#endregion
6800
6824
  //#region packages/application/src/journey/send/command.ts
6801
6825
  const version$1 = z.number().int().nonnegative();
6802
6826
  const sendPrepareSchema = z.object({
@@ -6830,11 +6854,22 @@ const sendChoiceSchema = sendActionSchema.extend({
6830
6854
  }).strict();
6831
6855
  //#endregion
6832
6856
  //#region packages/application/src/journey/send/service.ts
6833
- /** The API boundary never serializes private scoped exception values from stored state. */
6857
+ /** Public snapshots omit local source candidates and private scoped exception values. */
6834
6858
  function safeJourneySender(sender, now) {
6835
6859
  const safe = (result) => ({
6836
- ...result,
6837
- 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
+ }
6838
6873
  });
6839
6874
  return {
6840
6875
  async get(input) {
@@ -6842,10 +6877,7 @@ function safeJourneySender(sender, now) {
6842
6877
  journeyId: input.journeyId,
6843
6878
  ...input.sendId ? { sendId: input.sendId } : {}
6844
6879
  });
6845
- return result ? {
6846
- ...result,
6847
- journey: journeyView(result.journey, now())
6848
- } : null;
6880
+ return result ? safe(result) : null;
6849
6881
  },
6850
6882
  async prepare(input, signal = new AbortController().signal) {
6851
6883
  return safe(await sender.prepare(input, signal));
@@ -6870,6 +6902,15 @@ function safeJourneySender(sender, now) {
6870
6902
  }
6871
6903
  };
6872
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
+ }
6873
6914
  //#endregion
6874
6915
  //#region packages/application/src/sensitive-terms/model.ts
6875
6916
  const maximumTermsFileBytes = 16777216;
@@ -13176,4 +13217,4 @@ function equivalenceDuplicates(batch) {
13176
13217
  return bindings.sort();
13177
13218
  }
13178
13219
  //#endregion
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 };
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 };