@knpkv/control-center 0.1.1 → 0.2.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 (115) hide show
  1. package/dist/client/.vite/manifest.json +127 -125
  2. package/dist/client/assets/{ActiveWorkPage-Bvji6Tys.js → ActiveWorkPage-C6QwDV1Y.js} +2 -2
  3. package/dist/client/assets/{ActiveWorkPage-Bvji6Tys.js.map → ActiveWorkPage-C6QwDV1Y.js.map} +1 -1
  4. package/dist/client/assets/{AgentPage-Bom41la2.js → AgentPage-OqwP6uRi.js} +2 -2
  5. package/dist/client/assets/{AgentPage-Bom41la2.js.map → AgentPage-OqwP6uRi.js.map} +1 -1
  6. package/dist/client/assets/{AtlassianOAuthCallbackPage-dr-B9-DD.js → AtlassianOAuthCallbackPage-Bm7UhU-h.js} +2 -2
  7. package/dist/client/assets/{AtlassianOAuthCallbackPage-dr-B9-DD.js.map → AtlassianOAuthCallbackPage-Bm7UhU-h.js.map} +1 -1
  8. package/dist/client/assets/{AuthorizedSharePage-C-P-PNfm.js → AuthorizedSharePage-DblP3USU.js} +2 -2
  9. package/dist/client/assets/{AuthorizedSharePage-C-P-PNfm.js.map → AuthorizedSharePage-DblP3USU.js.map} +1 -1
  10. package/dist/client/assets/{BrowserCrypto-BPiuCuW-.js → BrowserCrypto-BGGRC6iW.js} +2 -2
  11. package/dist/client/assets/{BrowserCrypto-BPiuCuW-.js.map → BrowserCrypto-BGGRC6iW.js.map} +1 -1
  12. package/dist/client/assets/{BrowserSessionHydrator-C8F_LGhg.js → BrowserSessionHydrator-39UDbHf0.js} +2 -2
  13. package/dist/client/assets/{BrowserSessionHydrator-C8F_LGhg.js.map → BrowserSessionHydrator-39UDbHf0.js.map} +1 -1
  14. package/dist/client/assets/{CommandSearch-D6iFcdvj.js → CommandSearch-D4Fnjsl-.js} +2 -2
  15. package/dist/client/assets/{CommandSearch-D6iFcdvj.js.map → CommandSearch-D4Fnjsl-.js.map} +1 -1
  16. package/dist/client/assets/{ItemsPage-x39U11an.js → ItemsPage-BZQiTh9b.js} +2 -2
  17. package/dist/client/assets/{ItemsPage-x39U11an.js.map → ItemsPage-BZQiTh9b.js.map} +1 -1
  18. package/dist/client/assets/{PairPage-D5vlz4OG.js → PairPage-Dvfse5ky.js} +2 -2
  19. package/dist/client/assets/{PairPage-D5vlz4OG.js.map → PairPage-Dvfse5ky.js.map} +1 -1
  20. package/dist/client/assets/{PortfolioOverview-DSUabOmm.js → PortfolioOverview-DeJcfXcw.js} +2 -2
  21. package/dist/client/assets/{PortfolioOverview-DSUabOmm.js.map → PortfolioOverview-DeJcfXcw.js.map} +1 -1
  22. package/dist/client/assets/{ReleaseRoute-DyDm5s85.js → ReleaseRoute-D9q8_sCk.js} +2 -2
  23. package/dist/client/assets/{ReleaseRoute-DyDm5s85.js.map → ReleaseRoute-D9q8_sCk.js.map} +1 -1
  24. package/dist/client/assets/ReleaseWorkset-Bs_FXlbC.js +2 -0
  25. package/dist/client/assets/ReleaseWorkset-Bs_FXlbC.js.map +1 -0
  26. package/dist/client/assets/{ServicesPage-CoMVH2Si.js → ServicesPage-Co6GJHgc.js} +2 -2
  27. package/dist/client/assets/{ServicesPage-CoMVH2Si.js.map → ServicesPage-Co6GJHgc.js.map} +1 -1
  28. package/dist/client/assets/{TimelinePage-D8Fj_351.js → TimelinePage-CM2og72M.js} +2 -2
  29. package/dist/client/assets/{TimelinePage-D8Fj_351.js.map → TimelinePage-CM2og72M.js.map} +1 -1
  30. package/dist/client/assets/{WorkspaceEntityLink-BRifdJHn.js → WorkspaceEntityLink-CTw_He-8.js} +2 -2
  31. package/dist/client/assets/{WorkspaceEntityLink-BRifdJHn.js.map → WorkspaceEntityLink-CTw_He-8.js.map} +1 -1
  32. package/dist/client/assets/{WorkspaceEntityRoute-BwpujSqk.css → WorkspaceEntityRoute-Bdmv6ki4.css} +1 -1
  33. package/dist/client/assets/WorkspaceEntityRoute-BnsmaeS2.js +30 -0
  34. package/dist/client/assets/WorkspaceEntityRoute-BnsmaeS2.js.map +1 -0
  35. package/dist/client/assets/{WorkspaceReleaseLayout-DDLdY0rU.js → WorkspaceReleaseLayout-Ba6keUju.js} +2 -2
  36. package/dist/client/assets/{WorkspaceReleaseLayout-DDLdY0rU.js.map → WorkspaceReleaseLayout-Ba6keUju.js.map} +1 -1
  37. package/dist/client/assets/{authenticatedMutationClient-D5yD0rch.js → authenticatedMutationClient-CJklf3iD.js} +2 -2
  38. package/dist/client/assets/{authenticatedMutationClient-D5yD0rch.js.map → authenticatedMutationClient-CJklf3iD.js.map} +1 -1
  39. package/dist/client/assets/{authorizedShareTransport-Dyj53kJf.js → authorizedShareTransport-Xg20SHJ5.js} +2 -2
  40. package/dist/client/assets/{authorizedShareTransport-Dyj53kJf.js.map → authorizedShareTransport-Xg20SHJ5.js.map} +1 -1
  41. package/dist/client/assets/{client-OmvShYdC.js → client-P7FaPwzJ.js} +2 -2
  42. package/dist/client/assets/{client-OmvShYdC.js.map → client-P7FaPwzJ.js.map} +1 -1
  43. package/dist/client/assets/{connectionTestTransport-c25QXx7A.js → connectionTestTransport-C9iPOkKM.js} +2 -2
  44. package/dist/client/assets/{connectionTestTransport-c25QXx7A.js.map → connectionTestTransport-C9iPOkKM.js.map} +1 -1
  45. package/dist/client/assets/{index-DLoOV6Hp.js → index-DpW_ckau.js} +3 -3
  46. package/dist/client/assets/{index-DLoOV6Hp.js.map → index-DpW_ckau.js.map} +1 -1
  47. package/dist/client/assets/{patterns-DEbg7R-A-Cw0A2uKS.js → patterns-DEbg7R-A-BhsMyh9D.js} +2 -2
  48. package/dist/client/assets/{patterns-DEbg7R-A-Cw0A2uKS.js.map → patterns-DEbg7R-A-BhsMyh9D.js.map} +1 -1
  49. package/dist/client/assets/{presentPortfolio-CkRqd_zz.js → presentPortfolio-D-v615bg.js} +2 -2
  50. package/dist/client/assets/{presentPortfolio-CkRqd_zz.js.map → presentPortfolio-D-v615bg.js.map} +1 -1
  51. package/dist/client/assets/presentWorkspaceItems-IAp5SnpB.js +2 -0
  52. package/dist/client/assets/presentWorkspaceItems-IAp5SnpB.js.map +1 -0
  53. package/dist/client/assets/{releaseRoutes-DSWkTh-E.js → releaseRoutes-CfaNElmG.js} +2 -2
  54. package/dist/client/assets/{releaseRoutes-DSWkTh-E.js.map → releaseRoutes-CfaNElmG.js.map} +1 -1
  55. package/dist/client/assets/{serviceOnboarding-B9pvdyWf.js → serviceOnboarding-BZ2U_Ugw.js} +2 -2
  56. package/dist/client/assets/{serviceOnboarding-B9pvdyWf.js.map → serviceOnboarding-BZ2U_Ugw.js.map} +1 -1
  57. package/dist/client/assets/{useWorkspaceItems-D0FuHGto.js → useWorkspaceItems-DQTYaq1R.js} +2 -2
  58. package/dist/client/assets/{useWorkspaceItems-D0FuHGto.js.map → useWorkspaceItems-DQTYaq1R.js.map} +1 -1
  59. package/dist/client/assets/workspaceEntityRoutes-Biw67kRR.js +2 -0
  60. package/dist/client/assets/workspaceEntityRoutes-Biw67kRR.js.map +1 -0
  61. package/dist/client/build-graph.json +32 -2
  62. package/dist/client/index.html +1 -1
  63. package/dist/server/api/deliveryGraph.d.ts +126 -0
  64. package/dist/server/api/deliveryGraph.d.ts.map +1 -1
  65. package/dist/server/api/index.js +2 -2
  66. package/dist/server/api/shares.d.ts +14 -0
  67. package/dist/server/api/shares.d.ts.map +1 -1
  68. package/dist/server/assets/{BindConfig-BjK10BEb.js → BindConfig-Dk3vjYZc.js} +7 -7
  69. package/dist/server/assets/{BindConfig-BjK10BEb.js.map → BindConfig-Dk3vjYZc.js.map} +1 -1
  70. package/dist/server/assets/{controlCenterApi-tZPvRPRH.js → controlCenterApi-Dsug4Rzi.js} +2 -2
  71. package/dist/server/assets/{controlCenterApi-tZPvRPRH.js.map → controlCenterApi-Dsug4Rzi.js.map} +1 -1
  72. package/dist/server/assets/{domainEvent-x7yeq-gU.js → domainEvent-CZLKMqgn.js} +13 -2
  73. package/dist/server/assets/{domainEvent-x7yeq-gU.js.map → domainEvent-CZLKMqgn.js.map} +1 -1
  74. package/dist/server/assets/{firstPartyServices-Y41P8uke.js → firstPartyServices-BWdrzdfD.js} +2 -2
  75. package/dist/server/assets/{firstPartyServices-Y41P8uke.js.map → firstPartyServices-BWdrzdfD.js.map} +1 -1
  76. package/dist/server/assets/{manualPluginSynchronization-C0aHB4UM.js → manualPluginSynchronization-CDnX9qXi.js} +64 -23
  77. package/dist/server/assets/manualPluginSynchronization-CDnX9qXi.js.map +1 -0
  78. package/dist/server/assets/{portfolioInvalidation-Ds9Xm4_P.js → portfolioInvalidation-iTUo5N4r.js} +26 -6
  79. package/dist/server/assets/portfolioInvalidation-iTUo5N4r.js.map +1 -0
  80. package/dist/server/assets/{readiness-CzU3vjYQ.js → readiness-CZBkcjLP.js} +2 -2
  81. package/dist/server/assets/{readiness-CzU3vjYQ.js.map → readiness-CZBkcjLP.js.map} +1 -1
  82. package/dist/server/build-graph.json +1 -0
  83. package/dist/server/domain/deliveryGraph.d.ts +14 -0
  84. package/dist/server/domain/deliveryGraph.d.ts.map +1 -1
  85. package/dist/server/domain/index.js +3 -3
  86. package/dist/server/index.js +4 -4
  87. package/dist/server/server/application/normalizedPluginPageMaterialization.d.ts +1 -1
  88. package/dist/server/server/application/normalizedPluginPageMaterialization.d.ts.map +1 -1
  89. package/dist/server/server/cli.js +4 -4
  90. package/dist/server/server/index.js +3 -3
  91. package/dist/server/server/persistence/Persistence.d.ts +35 -0
  92. package/dist/server/server/persistence/Persistence.d.ts.map +1 -1
  93. package/dist/server/server/persistence/repositories/delivery-graph/contract.d.ts +56 -0
  94. package/dist/server/server/persistence/repositories/delivery-graph/contract.d.ts.map +1 -1
  95. package/dist/server/server/persistence/repositories/delivery-graph/decode.d.ts +7 -0
  96. package/dist/server/server/persistence/repositories/delivery-graph/decode.d.ts.map +1 -1
  97. package/dist/server/server/persistence/repositories/delivery-graph/read.d.ts +35 -0
  98. package/dist/server/server/persistence/repositories/delivery-graph/read.d.ts.map +1 -1
  99. package/dist/server/server/persistence/repositories/delivery-graph/rows.d.ts +7 -0
  100. package/dist/server/server/persistence/repositories/delivery-graph/rows.d.ts.map +1 -1
  101. package/dist/server/server/persistence/repositories/delivery-graph/write.d.ts +14 -0
  102. package/dist/server/server/persistence/repositories/delivery-graph/write.d.ts.map +1 -1
  103. package/dist/server/server/persistence/repositories/deliveryGraphRepository.d.ts +35 -0
  104. package/dist/server/server/persistence/repositories/deliveryGraphRepository.d.ts.map +1 -1
  105. package/package.json +3 -3
  106. package/dist/client/assets/ReleaseWorkset-BhGacsgb.js +0 -2
  107. package/dist/client/assets/ReleaseWorkset-BhGacsgb.js.map +0 -1
  108. package/dist/client/assets/WorkspaceEntityRoute-DPci8Q8I.js +0 -30
  109. package/dist/client/assets/WorkspaceEntityRoute-DPci8Q8I.js.map +0 -1
  110. package/dist/client/assets/presentWorkspaceItems-BU__8LcC.js +0 -2
  111. package/dist/client/assets/presentWorkspaceItems-BU__8LcC.js.map +0 -1
  112. package/dist/client/assets/workspaceEntityRoutes-CRcfSq7c.js +0 -2
  113. package/dist/client/assets/workspaceEntityRoutes-CRcfSq7c.js.map +0 -1
  114. package/dist/server/assets/manualPluginSynchronization-C0aHB4UM.js.map +0 -1
  115. package/dist/server/assets/portfolioInvalidation-Ds9Xm4_P.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"domainEvent-x7yeq-gU.js","names":[],"sources":["../../../src/domain/identifiers.ts","../../../src/domain/utcTimestamp.ts","../../../src/domain/sourceRevision.ts","../../../src/domain/freshness.ts","../../../src/domain/plugins/bounds.ts","../../../src/domain/readiness/policy.ts","../../../src/domain/readiness/model.ts","../../../src/domain/actors.ts","../../../src/domain/releaseRelay.ts","../../../src/domain/release.ts","../../../src/domain/plugins/descriptor.ts","../../../src/domain/normalizedIssue.ts","../../../src/domain/deliveryGraph.ts","../../../src/domain/relationshipRepair.ts","../../../src/domain/timeline.ts","../../../src/domain/domainEvent.ts"],"sourcesContent":["import { Schema, SchemaTransformation } from \"effect\"\n\nconst CANONICAL_LOWERCASE_UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/\n\nconst canonicalUuid7 = <const Brand extends string>(brand: Brand) =>\n Schema.String.check(Schema.isUUID(7)).pipe(\n Schema.decodeTo(\n Schema.String.check(\n Schema.isUUID(7),\n Schema.isPattern(CANONICAL_LOWERCASE_UUID_PATTERN, {\n expected: \"a canonical lowercase UUID v7\"\n })\n ),\n SchemaTransformation.toLowerCase()\n ),\n Schema.brand(brand)\n )\n\n/** Canonical identifier of an isolated Control Center workspace. */\nexport const WorkspaceId = canonicalUuid7(\"WorkspaceId\")\n\n/** Decoded workspace identifier. */\nexport type WorkspaceId = typeof WorkspaceId.Type\n\n/** Canonical identifier of a release aggregate. */\nexport const ReleaseId = canonicalUuid7(\"ReleaseId\")\n\n/** Decoded release identifier. */\nexport type ReleaseId = typeof ReleaseId.Type\n\n/** Canonical identifier of a normalized delivery entity. */\nexport const EntityId = canonicalUuid7(\"EntityId\")\n\n/** Decoded delivery-entity identifier. */\nexport type EntityId = typeof EntityId.Type\n\n/** Canonical identifier of a human collaborator. */\nexport const PersonId = canonicalUuid7(\"PersonId\")\n\n/** Decoded person identifier. */\nexport type PersonId = typeof PersonId.Type\n\n/** Canonical identifier of an automated agent. */\nexport const AgentId = canonicalUuid7(\"AgentId\")\n\n/** Decoded agent identifier. */\nexport type AgentId = typeof AgentId.Type\n\n/** Canonical identifier of a deployment environment. */\nexport const EnvironmentId = canonicalUuid7(\"EnvironmentId\")\n\n/** Decoded environment identifier. */\nexport type EnvironmentId = typeof EnvironmentId.Type\n\n/** Canonical identifier of a configured plugin connection. */\nexport const PluginConnectionId = canonicalUuid7(\"PluginConnectionId\")\n\n/** Decoded plugin-connection identifier. */\nexport type PluginConnectionId = typeof PluginConnectionId.Type\n\n/** Canonical identifier of one external provider account followed by a workspace. */\nexport const ProviderAccountId = canonicalUuid7(\"ProviderAccountId\")\n\n/** Decoded provider-account identifier. */\nexport type ProviderAccountId = typeof ProviderAccountId.Type\n\n/** Canonical identifier of one repository, pipeline, site, or workspace being followed. */\nexport const FollowedResourceId = canonicalUuid7(\"FollowedResourceId\")\n\n/** Decoded followed-resource identifier. */\nexport type FollowedResourceId = typeof FollowedResourceId.Type\n\n/** Canonical identifier of a collaborator role assignment. */\nexport const RoleAssignmentId = canonicalUuid7(\"RoleAssignmentId\")\n\n/** Decoded role-assignment identifier. */\nexport type RoleAssignmentId = typeof RoleAssignmentId.Type\n\n/** Canonical identifier of one delivery-graph relationship. */\nexport const RelationshipId = canonicalUuid7(\"RelationshipId\")\n\n/** Decoded delivery-graph relationship identifier. */\nexport type RelationshipId = typeof RelationshipId.Type\n\n/** Canonical identifier of one governed relationship-repair proposal. */\nexport const RelationshipRepairProposalId = canonicalUuid7(\"RelationshipRepairProposalId\")\n\n/** Decoded relationship-repair proposal identifier. */\nexport type RelationshipRepairProposalId = typeof RelationshipRepairProposalId.Type\n\n/** Canonical identifier of one immutable relationship-repair review. */\nexport const RelationshipRepairReviewId = canonicalUuid7(\"RelationshipRepairReviewId\")\n\n/** Decoded relationship-repair review identifier. */\nexport type RelationshipRepairReviewId = typeof RelationshipRepairReviewId.Type\n\n/** Canonical identifier of one immutable evidence claim. */\nexport const EvidenceClaimId = canonicalUuid7(\"EvidenceClaimId\")\n\n/** Decoded immutable evidence-claim identifier. */\nexport type EvidenceClaimId = typeof EvidenceClaimId.Type\n\n/** Canonical identifier of one immutable evidence observation envelope. */\nexport const EvidenceId = canonicalUuid7(\"EvidenceId\")\n\n/** Decoded immutable evidence observation identifier. */\nexport type EvidenceId = typeof EvidenceId.Type\n\n/** Canonical identifier of one immutable readiness assessment. */\nexport const ReadinessAssessmentId = canonicalUuid7(\"ReadinessAssessmentId\")\n\n/** Decoded immutable readiness-assessment identifier. */\nexport type ReadinessAssessmentId = typeof ReadinessAssessmentId.Type\n\n/** Canonical identifier of one resolved or explicitly missing graph node. */\nexport const GraphNodeId = canonicalUuid7(\"GraphNodeId\")\n\n/** Decoded graph-node identifier. */\nexport type GraphNodeId = typeof GraphNodeId.Type\n\n/** Workspace-local monotonic position used for durable event replay. */\nexport const EventCursor = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.brand(\"EventCursor\"))\n\n/** Decoded nonnegative event position; persisted event rows start at one. */\nexport type EventCursor = typeof EventCursor.Type\n\n/** Canonical identifier of one durable domain event. */\nexport const DomainEventId = canonicalUuid7(\"DomainEventId\")\n\n/** Decoded durable domain-event identifier. */\nexport type DomainEventId = typeof DomainEventId.Type\n\n/** Canonical identifier of one asynchronous Control Center job. */\nexport const JobId = canonicalUuid7(\"JobId\")\n\n/** Decoded asynchronous job identifier. */\nexport type JobId = typeof JobId.Type\n\n/** Canonical identifier of one durable release-scoped agent thread. */\nexport const AgentThreadId = canonicalUuid7(\"AgentThreadId\")\n\n/** Decoded durable agent-thread identifier. */\nexport type AgentThreadId = typeof AgentThreadId.Type\n\n/** Canonical identifier of an authenticated browser session. */\nexport const SessionId = canonicalUuid7(\"SessionId\")\n\n/** Decoded authenticated browser-session identifier. */\nexport type SessionId = typeof SessionId.Type\n\n/** Canonical identifier of one exact-scope authenticated share grant. */\nexport const ShareId = canonicalUuid7(\"ShareId\")\n\n/** Decoded authorized-share identifier. */\nexport type ShareId = typeof ShareId.Type\n\n/** Canonical identifier of one governed provider action. */\nexport const GovernedActionId = canonicalUuid7(\"GovernedActionId\")\n\n/** Decoded governed-action identifier. */\nexport type GovernedActionId = typeof GovernedActionId.Type\n\n/** Canonical identifier of one immutable governed-action transition. */\nexport const GovernedActionTransitionId = canonicalUuid7(\"GovernedActionTransitionId\")\n\n/** Decoded governed-action transition identifier. */\nexport type GovernedActionTransitionId = typeof GovernedActionTransitionId.Type\n\n/** Canonical identifier of one immutable human action authorization. */\nexport const GovernedActionAuthorizationId = canonicalUuid7(\"GovernedActionAuthorizationId\")\n\n/** Decoded governed-action authorization identifier. */\nexport type GovernedActionAuthorizationId = typeof GovernedActionAuthorizationId.Type\n\n/** Canonical identifier of one governed-action execution attempt. */\nexport const GovernedActionAttemptId = canonicalUuid7(\"GovernedActionAttemptId\")\n\n/** Decoded governed-action attempt identifier. */\nexport type GovernedActionAttemptId = typeof GovernedActionAttemptId.Type\n","import { Schema } from \"effect\"\n\n/**\n * Codec for instants that normalizes accepted ISO-8601 input to UTC and encodes\n * it as a canonical UTC ISO-8601 string.\n */\nexport const UtcTimestamp = Schema.DateTimeUtcFromString.annotate({\n identifier: \"UtcTimestamp\"\n})\n\n/** Decoded UTC instant used by Control Center domain records. */\nexport type UtcTimestamp = typeof UtcTimestamp.Type\n","import { DateTime, Schema, SchemaTransformation } from \"effect\"\n\nimport { PluginConnectionId } from \"./identifiers.js\"\nimport { UtcTimestamp } from \"./utcTimestamp.js\"\n\nconst MAX_OPAQUE_SOURCE_VALUE_LENGTH = 512\n\nconst boundedOpaqueSourceValue = Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(MAX_OPAQUE_SOURCE_VALUE_LENGTH)\n)\n\n/** Stable persisted provider names, independent of package abbreviations. */\nexport const ProviderId = Schema.Literals([\n \"codecommit\",\n \"codepipeline\",\n \"jira\",\n \"confluence\",\n \"clockify\"\n]).annotate({ identifier: \"ProviderId\" })\n\n/** Decoded plugin-provider identifier. */\nexport type ProviderId = typeof ProviderId.Type\n\n/** Opaque immutable identifier assigned to an object by its source provider. */\nexport const VendorImmutableId = boundedOpaqueSourceValue.pipe(Schema.brand(\"VendorImmutableId\"))\n\n/** Decoded source-provider object identifier. */\nexport type VendorImmutableId = typeof VendorImmutableId.Type\n\n/** Opaque source-provider revision, version, digest, or ETag. */\nexport const Revision = boundedOpaqueSourceValue.pipe(Schema.brand(\"Revision\"))\n\n/** Decoded source-provider revision. */\nexport type Revision = typeof Revision.Type\n\n/** Positive version of the normalization schema used for a source record. */\nexport const NormalizationSchemaVersion = Schema.Number.check(\n Schema.isInt(),\n Schema.isGreaterThan(0)\n).pipe(Schema.brand(\"NormalizationSchemaVersion\"))\n\n/** Decoded normalization-schema version. */\nexport type NormalizationSchemaVersion = typeof NormalizationSchemaVersion.Type\n\nconst hasNoControlCharacters = (value: string): boolean =>\n Array.from(value).every((character) => {\n const codePoint = character.codePointAt(0)\n return (\n codePoint !== undefined &&\n !((codePoint >= 0 && codePoint <= 0x1f) || (codePoint >= 0x7f && codePoint <= 0x9f))\n )\n })\n\nconst SafeSourceUrlString = Schema.String.check(\n Schema.isMaxLength(4_096),\n Schema.makeFilter(hasNoControlCharacters, { expected: \"a source URL without control characters\" })\n)\n\n/** Safe navigable URL for an exact provider object, without embedded credentials. */\nexport const SourceUrl = SafeSourceUrlString.pipe(\n Schema.decodeTo(Schema.URL, SchemaTransformation.urlFromString),\n Schema.check(\n Schema.makeFilter(\n ({ protocol }) => protocol === \"https:\" || protocol === \"http:\",\n { expected: \"an HTTP or HTTPS source URL\" }\n ),\n Schema.makeFilter(\n ({ password, username }) => password.length === 0 && username.length === 0,\n { expected: \"a source URL without embedded credentials\" }\n )\n )\n)\n\n/** Decoded safe source URL. */\nexport type SourceUrl = typeof SourceUrl.Type\n\n/**\n * Immutable provenance needed to reconcile a normalized record with the exact\n * provider object and revision from which it was derived.\n */\nexport const SourceRevision = Schema.Struct({\n providerId: ProviderId,\n pluginConnectionId: PluginConnectionId,\n vendorImmutableId: VendorImmutableId,\n revision: Revision,\n sourceUrl: Schema.Union([SourceUrl, Schema.Null]),\n firstObservedAt: UtcTimestamp,\n lastObservedAt: UtcTimestamp,\n synchronizedAt: UtcTimestamp,\n normalizationSchemaVersion: NormalizationSchemaVersion\n})\n .check(\n Schema.makeFilter((sourceRevision) => {\n if (\n DateTime.toEpochMillis(sourceRevision.firstObservedAt) >\n DateTime.toEpochMillis(sourceRevision.lastObservedAt)\n ) {\n return {\n path: [\"lastObservedAt\"],\n issue: \"lastObservedAt must not precede firstObservedAt\"\n }\n }\n\n return DateTime.toEpochMillis(sourceRevision.lastObservedAt) <=\n DateTime.toEpochMillis(sourceRevision.synchronizedAt)\n ? undefined\n : {\n path: [\"synchronizedAt\"],\n issue: \"synchronizedAt must not precede lastObservedAt\"\n }\n })\n )\n .annotate({ identifier: \"SourceRevision\" })\n\n/** Decoded source-revision provenance. */\nexport type SourceRevision = typeof SourceRevision.Type\n","import * as DateTime from \"effect/DateTime\"\nimport * as Effect from \"effect/Effect\"\nimport * as Schema from \"effect/Schema\"\nimport { PluginConnectionId } from \"./identifiers.js\"\nimport { SourceRevision } from \"./sourceRevision.js\"\nimport { UtcTimestamp } from \"./utcTimestamp.js\"\n\nconst StaleAfterSeconds = Schema.Int.check(Schema.isGreaterThan(0))\nconst SafeHealthMessage = Schema.String.check(\n Schema.isTrimmed(),\n Schema.isMinLength(1),\n Schema.isMaxLength(500)\n)\n\n/** Stable failure classes exposed by plugin health without leaking raw causes. */\nexport const PluginFailureClass = Schema.Literals([\n \"authentication\",\n \"authorization\",\n \"rate-limit\",\n \"timeout\",\n \"malformed-response\",\n \"outage\",\n \"unknown\"\n])\n\n/** Decoded plugin failure classification. */\nexport type PluginFailureClass = typeof PluginFailureClass.Type\n\nconst HealthyPluginHealth = Schema.TaggedStruct(\"healthy\", {\n checkedAt: UtcTimestamp\n})\n\nconst DegradedPluginHealth = Schema.TaggedStruct(\"degraded\", {\n checkedAt: UtcTimestamp,\n failureClass: PluginFailureClass,\n retryAt: Schema.NullOr(UtcTimestamp),\n safeMessage: SafeHealthMessage\n}).check(\n Schema.makeFilter(\n ({ checkedAt, retryAt }) => retryAt === null || DateTime.Order(checkedAt, retryAt) <= 0,\n { expected: \"plugin retry time to be at or after its health check\" }\n )\n)\n\nconst UnavailablePluginHealth = Schema.TaggedStruct(\"unavailable\", {\n checkedAt: UtcTimestamp,\n failureClass: PluginFailureClass,\n retryAt: Schema.NullOr(UtcTimestamp),\n safeMessage: SafeHealthMessage\n}).check(\n Schema.makeFilter(\n ({ checkedAt, retryAt }) => retryAt === null || DateTime.Order(checkedAt, retryAt) <= 0,\n { expected: \"plugin retry time to be at or after its health check\" }\n )\n)\n\nconst DisabledPluginHealth = Schema.TaggedStruct(\"disabled\", {\n checkedAt: UtcTimestamp\n})\n\n/** Health of the plugin connection responsible for a normalized object. */\nexport const PluginHealth = Schema.Union([\n HealthyPluginHealth,\n DegradedPluginHealth,\n UnavailablePluginHealth,\n DisabledPluginHealth\n]).pipe(Schema.toTaggedUnion(\"_tag\"))\n\n/** Decoded plugin connection health. */\nexport type PluginHealth = typeof PluginHealth.Type\n\nconst UsablePluginHealth = Schema.Union([HealthyPluginHealth, DegradedPluginHealth])\n\nconst ProviderProvenance = Schema.TaggedStruct(\"provider\", {\n sourceRevision: SourceRevision\n})\n\nconst CachedProvenance = Schema.TaggedStruct(\"cache\", {\n cachedAt: UtcTimestamp,\n sourceRevision: SourceRevision\n}).check(\n Schema.makeFilter(\n ({ cachedAt, sourceRevision }) => DateTime.Order(sourceRevision.synchronizedAt, cachedAt) <= 0,\n { expected: \"the cache time to be at or after source synchronization\" }\n )\n)\n\nconst NoCacheProvenance = Schema.TaggedStruct(\"none\", {\n pluginConnectionId: PluginConnectionId\n})\n\nconst sourceAgeSecondsAt = (sourceObservedAt: UtcTimestamp, evaluatedAt: UtcTimestamp): number =>\n (DateTime.toEpochMillis(evaluatedAt) - DateTime.toEpochMillis(sourceObservedAt)) / 1_000\n\nconst freshnessEvaluation = {\n // Older persisted revisions predate explicit projection-time evaluation. In\n // that case their plugin health check remains the historical evaluation time.\n evaluatedAt: Schema.optional(UtcTimestamp)\n}\n\nconst evaluatedAtOrHealthCheck = (\n evaluatedAt: UtcTimestamp | undefined,\n pluginHealth: PluginHealth\n): UtcTimestamp => evaluatedAt ?? pluginHealth.checkedAt\n\nconst CurrentFreshness = Schema.TaggedStruct(\"current\", {\n ...freshnessEvaluation,\n pluginHealth: UsablePluginHealth,\n provenance: Schema.Union([ProviderProvenance, CachedProvenance]),\n sourceObservedAt: UtcTimestamp,\n staleAfterSeconds: StaleAfterSeconds,\n synchronizedAt: UtcTimestamp\n}).check(\n Schema.makeFilter(\n ({ evaluatedAt, pluginHealth, provenance, sourceObservedAt, staleAfterSeconds, synchronizedAt }) =>\n DateTime.Equivalence(sourceObservedAt, provenance.sourceRevision.lastObservedAt) &&\n DateTime.Order(provenance.sourceRevision.synchronizedAt, synchronizedAt) <= 0 &&\n (provenance._tag === \"provider\" || DateTime.Order(provenance.cachedAt, synchronizedAt) <= 0) &&\n DateTime.Order(synchronizedAt, pluginHealth.checkedAt) <= 0 &&\n (evaluatedAt === undefined || DateTime.Order(pluginHealth.checkedAt, evaluatedAt) <= 0) &&\n sourceAgeSecondsAt(sourceObservedAt, evaluatedAtOrHealthCheck(evaluatedAt, pluginHealth)) >= 0 &&\n sourceAgeSecondsAt(sourceObservedAt, evaluatedAtOrHealthCheck(evaluatedAt, pluginHealth)) <= staleAfterSeconds,\n {\n expected: \"current source data to match its revision and remain within its stale threshold\"\n }\n )\n)\n\nconst StaleFreshness = Schema.TaggedStruct(\"stale\", {\n ...freshnessEvaluation,\n pluginHealth: PluginHealth,\n provenance: CachedProvenance,\n sourceObservedAt: UtcTimestamp,\n staleAfterSeconds: StaleAfterSeconds,\n synchronizedAt: UtcTimestamp\n}).check(\n Schema.makeFilter(\n ({ evaluatedAt, pluginHealth, provenance, sourceObservedAt, staleAfterSeconds, synchronizedAt }) =>\n DateTime.Equivalence(sourceObservedAt, provenance.sourceRevision.lastObservedAt) &&\n DateTime.Order(sourceObservedAt, synchronizedAt) <= 0 &&\n DateTime.Order(provenance.cachedAt, synchronizedAt) <= 0 &&\n DateTime.Order(synchronizedAt, pluginHealth.checkedAt) <= 0 &&\n (evaluatedAt === undefined || DateTime.Order(pluginHealth.checkedAt, evaluatedAt) <= 0) &&\n sourceAgeSecondsAt(sourceObservedAt, evaluatedAtOrHealthCheck(evaluatedAt, pluginHealth)) > staleAfterSeconds,\n {\n expected: \"stale cache data to be chronological and beyond its stale threshold\"\n }\n )\n)\n\nconst MissingFreshness = Schema.TaggedStruct(\"missing\", {\n pluginHealth: HealthyPluginHealth,\n provenance: NoCacheProvenance,\n sourceObservedAt: Schema.Null,\n staleAfterSeconds: StaleAfterSeconds,\n synchronizedAt: UtcTimestamp\n})\n\nconst UnavailableFreshness = Schema.TaggedStruct(\"unavailable\", {\n pluginHealth: Schema.Union([UnavailablePluginHealth, DisabledPluginHealth]),\n provenance: NoCacheProvenance,\n sourceObservedAt: Schema.Null,\n staleAfterSeconds: StaleAfterSeconds,\n synchronizedAt: Schema.Null\n})\n\n/**\n * Freshness of normalized data, preserving cached stale data while separating\n * absence from a connection that cannot currently be queried.\n */\nexport const Freshness = Schema.Union([\n CurrentFreshness,\n StaleFreshness,\n MissingFreshness,\n UnavailableFreshness\n]).pipe(Schema.toTaggedUnion(\"_tag\"))\n\n/** Decoded normalized-data freshness. */\nexport type Freshness = typeof Freshness.Type\n\n/** Re-evaluate persisted freshness for a read projection without rewriting its source facts. */\nexport const evaluateFreshnessAt = Effect.fn(\"Freshness.evaluateAt\")(function*(\n freshness: Freshness,\n evaluatedAt: UtcTimestamp\n): Effect.fn.Return<Freshness, Schema.SchemaError> {\n if (freshness._tag !== \"current\" && freshness._tag !== \"stale\") return freshness\n const isStale = freshness._tag === \"stale\" ||\n sourceAgeSecondsAt(freshness.sourceObservedAt, evaluatedAt) > freshness.staleAfterSeconds\n const provenance = isStale\n ? freshness.provenance._tag === \"cache\"\n ? freshness.provenance\n : {\n _tag: \"cache\",\n cachedAt: freshness.synchronizedAt,\n sourceRevision: freshness.provenance.sourceRevision\n }\n : freshness.provenance\n return yield* Schema.decodeUnknownEffect(Schema.toType(Freshness))({\n ...freshness,\n _tag: isStale ? \"stale\" : \"current\",\n evaluatedAt,\n provenance\n })\n})\n","import * as Schema from \"effect/Schema\"\n\nconst jsonEncoder = new TextEncoder()\n\nconst hasMaximumJsonBytes = (maximumBytes: number) =>\n Schema.makeFilter(\n (value: unknown) => {\n const serialized = JSON.stringify(value)\n return serialized !== undefined && jsonEncoder.encode(serialized).byteLength <= maximumBytes\n },\n { expected: `JSON encoded as at most ${maximumBytes} UTF-8 bytes` }\n )\n\n/** Maximum persisted or dispatched JSON payload accepted from a plugin boundary. */\nexport const MaximumPluginPayloadBytes = 262_144\n\n/** Maximum encoded size of one atomic normalized sync page. */\nexport const MaximumPluginSyncPageBytes = 1_048_576\n\n/** Maximum canonical descriptor JSON accepted before adapter construction. */\nexport const MaximumPluginDescriptorBytes = 61_440\n\n/** Bounded JSON for normalized evidence and governed-action payloads. */\nexport const PluginPayloadJson = Schema.Json.check(hasMaximumJsonBytes(MaximumPluginPayloadBytes)).annotate({\n identifier: \"PluginPayloadJson\"\n})\n\n/** Applies a deterministic upper bound to an already-decoded JSON-shaped value. */\nexport const hasMaximumPluginJsonBytes = hasMaximumJsonBytes\n","import * as DateTime from \"effect/DateTime\"\n\nimport type { EvidenceId, PluginConnectionId } from \"../identifiers.js\"\nimport type { UtcTimestamp } from \"../utcTimestamp.js\"\nimport type {\n ReadinessEvidenceReference,\n ReadinessFactDefinition,\n ReadinessFactEvaluation,\n ReadinessFactObservation,\n ReadinessFactResult,\n ReadinessFinding,\n ReadinessFindingCode,\n ReadinessProgress,\n ReadinessSourceSummary,\n ReadinessStages,\n ReadinessVerdict\n} from \"./model.js\"\n\n/** Locale-independent ordering used by canonical readiness records and digests. */\nexport const compareReadinessText = (left: string, right: string): number => left < right ? -1 : left > right ? 1 : 0\n\n/** Sorted unique string-like values for deterministic assessment material. */\nexport const sortedReadinessUnique = <Value extends string>(\n values: ReadonlyArray<Value>\n): Array<Value> => Array.from(new Set(values)).sort(compareReadinessText)\n\n/** Whether definitions form the complete provider-neutral V1 delivery policy. */\nexport const readinessDefinitionsShapeIsV1 = (\n definitions: ReadonlyArray<ReadinessFactDefinition>\n): boolean => {\n const deployments = definitions.filter(({ kind }) => kind === \"deployment\")\n return definitions.some(({ kind, requirement }) => kind === \"execution\" && requirement === \"required\") &&\n definitions.some(({ kind, requirement }) =>\n requirement === \"required\" && [\"relationship\", \"approval\", \"check\", \"documentation\"].includes(kind)\n ) &&\n deployments.length === 1 &&\n deployments[0]?.requirement === \"advisory\"\n}\n\n/** Whether definitions and observations form a complete V1 delivery policy shape. */\nexport const readinessPolicyShapeIsV1 = (\n definitions: ReadonlyArray<ReadinessFactDefinition>,\n observations: ReadonlyArray<ReadinessFactObservation>\n): boolean =>\n readinessDefinitionsShapeIsV1(definitions) &&\n observations.some(({ state }) => state._tag === \"deployment\")\n\n/** Whether one exact evidence dependency is current enough for a verdict. */\nexport const readinessEvidenceIsCurrent = (evidence: ReadinessEvidenceReference): boolean =>\n evidence.freshness === \"current\" &&\n evidence.validity === \"valid\" &&\n (evidence.source._tag === \"local\" ||\n evidence.source.health === \"healthy\" ||\n evidence.source.health === \"degraded\")\n\n/** Whether every evidence dependency of an observed fact is current and valid. */\nexport const readinessObservationIsCurrent = (\n observation: ReadinessFactObservation\n): boolean => observation.evidence.length > 0 && observation.evidence.every(readinessEvidenceIsCurrent)\n\n/** Whether a normalized observation is semantically positive. */\nexport const readinessObservationIsPositive = (\n observation: ReadinessFactObservation\n): boolean => {\n switch (observation.state._tag) {\n case \"relationship\":\n return observation.state.status === \"verified\" || observation.state.status === \"governed\"\n case \"approval\":\n return observation.state.status === \"approved\"\n case \"check\":\n return observation.state.status === \"passed\"\n case \"execution\":\n return observation.state.status === \"succeeded\"\n case \"documentation\":\n return observation.state.status === \"current\"\n case \"deployment\":\n return observation.state.status === \"succeeded\"\n }\n}\n\n/** Machine-readable explicit-failure reason, independent of freshness. */\nexport const readinessFailureCode = (\n observation: ReadinessFactObservation\n): ReadinessFindingCode | null => {\n switch (observation.state._tag) {\n case \"relationship\":\n return observation.state.status === \"rejected\" ? \"relationship-rejected\" : null\n case \"approval\":\n return observation.state.status === \"rejected\" ? \"approval-rejected\" : null\n case \"check\":\n return observation.state.status === \"failed\"\n ? \"check-failed\"\n : observation.state.status === \"cancelled\"\n ? \"check-cancelled\"\n : null\n case \"execution\":\n return observation.state.status === \"failed\"\n ? \"execution-failed\"\n : observation.state.status === \"stopped\"\n ? \"execution-stopped\"\n : null\n case \"documentation\":\n return null\n case \"deployment\":\n return observation.state.status === \"failed\"\n ? \"deployment-failed\"\n : observation.state.status === \"rolled-back\"\n ? \"deployment-rolled-back\"\n : null\n }\n}\n\n/** Machine-readable non-positive reason for one normalized observation. */\nexport const readinessNonPositiveCode = (\n observation: ReadinessFactObservation\n): ReadinessFindingCode | null => {\n switch (observation.state._tag) {\n case \"relationship\":\n switch (observation.state.status) {\n case \"missing\":\n return \"relationship-missing\"\n case \"inferred\":\n case \"proposed\":\n return \"relationship-unverified\"\n case \"superseded\":\n return \"relationship-superseded\"\n default:\n return null\n }\n case \"approval\":\n switch (observation.state.status) {\n case \"missing\":\n return \"approval-missing\"\n case \"pending\":\n return \"approval-pending\"\n case \"expired\":\n return \"approval-expired\"\n default:\n return null\n }\n case \"check\":\n return observation.state.status === \"missing\"\n ? \"check-missing\"\n : observation.state.status === \"queued\" || observation.state.status === \"running\"\n ? \"check-pending\"\n : null\n case \"execution\":\n return observation.state.status === \"missing\"\n ? \"execution-missing\"\n : observation.state.status === \"queued\" || observation.state.status === \"running\"\n ? \"execution-pending\"\n : null\n case \"documentation\":\n switch (observation.state.status) {\n case \"missing\":\n return \"documentation-missing\"\n case \"draft\":\n return \"documentation-draft\"\n case \"stale\":\n return \"documentation-stale\"\n case \"superseded\":\n return \"documentation-superseded\"\n default:\n return null\n }\n case \"deployment\":\n return null\n }\n}\n\n/** Whether this observation represents active build or check work. */\nexport const readinessObservationIsDeliveryActivity = (\n definition: ReadinessFactDefinition,\n observation: ReadinessFactObservation | null\n): boolean =>\n definition.requirement === \"required\" &&\n observation !== null &&\n ((observation.state._tag === \"execution\" &&\n (observation.state.status === \"queued\" || observation.state.status === \"running\")) ||\n (observation.state._tag === \"check\" &&\n (observation.state.status === \"queued\" || observation.state.status === \"running\"))) &&\n readinessObservationIsCurrent(observation)\n\n/** Canonical semantic result retained for one fact evaluation. */\nexport const readinessFactResult = (\n definition: ReadinessFactDefinition,\n observation: ReadinessFactObservation | null\n): ReadinessFactResult => {\n if (observation === null) return definition.requirement === \"required\" ? \"gap\" : \"advisory\"\n if (readinessFailureCode(observation) !== null) {\n return definition.requirement === \"required\" || definition.kind === \"deployment\"\n ? \"failed\"\n : \"advisory\"\n }\n if (readinessObservationIsPositive(observation) && readinessObservationIsCurrent(observation)) {\n return \"verified\"\n }\n const code = readinessNonPositiveCode(observation)\n if (code === \"approval-pending\" || code === \"check-pending\" || code === \"execution-pending\") {\n return \"pending\"\n }\n return definition.requirement === \"required\" ? \"gap\" : \"advisory\"\n}\n\nconst missingCode = (definition: ReadinessFactDefinition): ReadinessFindingCode => {\n switch (definition.kind) {\n case \"relationship\":\n return \"relationship-missing\"\n case \"approval\":\n return \"approval-missing\"\n case \"check\":\n return \"check-missing\"\n case \"execution\":\n return \"execution-missing\"\n case \"documentation\":\n return \"documentation-missing\"\n case \"deployment\":\n return \"deployment-missing\"\n }\n}\n\nconst observationEvidenceIds = (\n observation: ReadinessFactObservation | null\n): Array<EvidenceId> =>\n observation === null\n ? []\n : sortedReadinessUnique(observation.evidence.map(({ evidenceId }) => evidenceId))\n\nconst factFinding = (\n code: ReadinessFindingCode,\n definition: ReadinessFactDefinition,\n observation: ReadinessFactObservation | null\n): ReadinessFinding => ({\n code,\n subject: { _tag: \"fact\", factId: definition.factId },\n evidenceIds: observationEvidenceIds(observation)\n})\n\nconst evidenceFinding = (\n evidence: ReadinessEvidenceReference,\n definition: ReadinessFactDefinition\n): ReadinessFinding | null => {\n const code: ReadinessFindingCode | null = evidence.validity === \"expired\"\n ? \"evidence-expired\"\n : evidence.freshness === \"stale\"\n ? \"source-stale\"\n : evidence.freshness === \"missing\"\n ? \"source-missing\"\n : evidence.freshness === \"unavailable\" ||\n (evidence.source._tag === \"plugin\" &&\n (evidence.source.health === \"unavailable\" || evidence.source.health === \"disabled\"))\n ? \"source-unavailable\"\n : evidence.source._tag === \"plugin\" && evidence.source.health === \"degraded\"\n ? \"plugin-degraded\"\n : null\n if (code === null) return null\n return {\n code,\n subject: evidence.source._tag === \"plugin\"\n ? { _tag: \"source\", pluginConnectionId: evidence.source.pluginConnectionId }\n : { _tag: \"fact\", factId: definition.factId },\n evidenceIds: [evidence.evidenceId]\n }\n}\n\n/** Stable sort/deduplication key for readiness findings. */\nexport const readinessFindingKey = (finding: ReadinessFinding): string => {\n const subject = finding.subject._tag === \"fact\"\n ? finding.subject.factId\n : finding.subject._tag === \"source\"\n ? finding.subject.pluginConnectionId\n : \"candidate\"\n return `${finding.code}:${finding.subject._tag}:${subject}:${finding.evidenceIds.join(\",\")}`\n}\n\nconst normalizedFindings = (\n findings: ReadonlyArray<ReadinessFinding>\n): Array<ReadinessFinding> => {\n const byKey = new Map(findings.map((finding) => [readinessFindingKey(finding), finding]))\n return Array.from(byKey.values()).sort((left, right) =>\n compareReadinessText(readinessFindingKey(left), readinessFindingKey(right))\n )\n}\n\n/** Exact blocker, warning, and gap sets implied by retained fact evaluations. */\nexport const deriveReadinessFindings = (\n facts: ReadonlyArray<ReadinessFactEvaluation>,\n complete: boolean\n): {\n readonly blockers: Array<ReadinessFinding>\n readonly warnings: Array<ReadinessFinding>\n readonly gaps: Array<ReadinessFinding>\n} => {\n const blockers: Array<ReadinessFinding> = []\n const warnings: Array<ReadinessFinding> = []\n const gaps: Array<ReadinessFinding> = complete\n ? []\n : [{ code: \"input-incomplete\", subject: { _tag: \"candidate\" }, evidenceIds: [] }]\n\n for (const { definition, observation } of facts) {\n if (observation === null) {\n if (definition.requirement === \"required\") {\n gaps.push(factFinding(missingCode(definition), definition, observation))\n }\n continue\n }\n\n const failure = readinessFailureCode(observation)\n if (failure !== null) {\n const finding = factFinding(failure, definition, observation)\n if (definition.requirement === \"required\" || definition.kind === \"deployment\") {\n blockers.push(finding)\n } else {\n warnings.push(finding)\n }\n } else if (!readinessObservationIsPositive(observation) || !readinessObservationIsCurrent(observation)) {\n const code = readinessNonPositiveCode(observation)\n if (code !== null) {\n const finding = factFinding(code, definition, observation)\n const active = code === \"approval-pending\" || code === \"check-pending\" || code === \"execution-pending\"\n if (active || definition.requirement === \"advisory\") warnings.push(finding)\n if (!active && definition.requirement === \"required\") gaps.push(finding)\n }\n }\n\n for (const evidence of observation.evidence) {\n const finding = evidenceFinding(evidence, definition)\n if (finding === null) continue\n warnings.push(finding)\n if (\n definition.requirement === \"required\" &&\n finding.code !== \"plugin-degraded\" &&\n failure === null\n ) gaps.push(finding)\n }\n }\n\n return {\n blockers: normalizedFindings(blockers),\n warnings: normalizedFindings(warnings),\n gaps: normalizedFindings(gaps)\n }\n}\n\nconst freshnessRank = { current: 0, stale: 1, missing: 2, unavailable: 3 }\nconst healthRank = { healthy: 0, degraded: 1, unavailable: 2, disabled: 3 }\n\n/** Exact worst-state summaries for plugin evidence retained by facts. */\nexport const deriveReadinessSourceSummaries = (\n facts: ReadonlyArray<ReadinessFactEvaluation>\n): Array<ReadinessSourceSummary> => {\n const grouped = new Map<PluginConnectionId, Array<ReadinessEvidenceReference>>()\n for (const evidence of facts.flatMap(({ observation }) => observation?.evidence ?? [])) {\n if (evidence.source._tag !== \"plugin\") continue\n const current = grouped.get(evidence.source.pluginConnectionId) ?? []\n current.push(evidence)\n grouped.set(evidence.source.pluginConnectionId, current)\n }\n return Array.from(grouped.entries())\n .map(([pluginConnectionId, evidence]): ReadinessSourceSummary => ({\n pluginConnectionId,\n freshness: evidence.reduce<ReadinessSourceSummary[\"freshness\"]>(\n (worst, item) =>\n freshnessRank[item.freshness] > freshnessRank[worst]\n ? item.freshness\n : worst,\n \"current\"\n ),\n health: evidence.reduce<ReadinessSourceSummary[\"health\"]>((worst, item) => {\n const health = item.source._tag === \"plugin\" ? item.source.health : \"healthy\"\n return healthRank[health] > healthRank[worst] ? health : worst\n }, \"healthy\"),\n evidenceIds: sortedReadinessUnique(evidence.map(({ evidenceId }) => evidenceId))\n }))\n .sort((left, right) => compareReadinessText(left.pluginConnectionId, right.pluginConnectionId))\n}\n\n/** Earliest evidence freshness boundary retained by one environment assessment. */\nexport const deriveReadinessNextEvaluationAt = (\n facts: ReadonlyArray<ReadinessFactEvaluation>\n): UtcTimestamp | null =>\n facts\n .flatMap(({ observation }) => observation?.evidence ?? [])\n .flatMap(({ reevaluateAt }) => reevaluateAt === null ? [] : [reevaluateAt])\n .reduce<UtcTimestamp | null>(\n (earliest, boundary) => earliest === null || DateTime.Order(boundary, earliest) < 0 ? boundary : earliest,\n null\n )\n\nconst observationProgress = (\n observation: ReadinessFactObservation | undefined\n): ReadinessProgress | null => {\n if (observation?.state._tag === \"execution\" || observation?.state._tag === \"deployment\") {\n return observation.state.progress\n }\n return null\n}\n\nconst stageEvidence = (facts: ReadonlyArray<ReadinessFactEvaluation>) =>\n sortedReadinessUnique(facts.flatMap(({ evidenceIds }) => evidenceIds))\n\n/** Derive the exact three delivery stages from canonical fact evaluations. */\nexport const deriveReadinessStages = (\n facts: ReadonlyArray<ReadinessFactEvaluation>\n): ReadinessStages => {\n const build = facts.filter(({ definition }) => definition.kind === \"execution\")\n const verify = facts.filter(({ definition }) =>\n [\"relationship\", \"approval\", \"check\", \"documentation\"].includes(definition.kind)\n )\n const production = facts.filter(({ definition }) => definition.kind === \"deployment\")\n const deployment = production.find(({ observation }) => observation?.state._tag === \"deployment\")?.observation\n const requiredBuild = build.filter(({ definition }) => definition.requirement === \"required\")\n const requiredVerify = verify.filter(({ definition }) => definition.requirement === \"required\")\n const activeBuild = requiredBuild.filter(({ observation }) =>\n observation !== null &&\n observation.state._tag === \"execution\" &&\n (observation.state.status === \"queued\" || observation.state.status === \"running\") &&\n readinessObservationIsCurrent(observation)\n )\n const runningBuild = activeBuild.find(({ observation }) =>\n observation?.state._tag === \"execution\" && observation.state.status === \"running\"\n )\n const queuedBuild = activeBuild.find(({ observation }) =>\n observation?.state._tag === \"execution\" && observation.state.status === \"queued\"\n )\n const activeVerify = requiredVerify.find(({ observation }) =>\n observation !== null &&\n ((observation.state._tag === \"check\" &&\n (observation.state.status === \"queued\" || observation.state.status === \"running\")) ||\n (observation.state._tag === \"approval\" && observation.state.status === \"pending\")) &&\n readinessObservationIsCurrent(observation)\n )\n\n const buildState: ReadinessStages[\"build\"][\"state\"] = build.some(({ result }) => result === \"failed\")\n ? \"failed\"\n : runningBuild !== undefined\n ? \"running\"\n : queuedBuild !== undefined\n ? \"queued\"\n : requiredBuild.every(({ result }) => result === \"verified\")\n ? \"succeeded\"\n : build.some(({ observation }) => observation !== null)\n ? \"held\"\n : \"not-started\"\n\n const verifyState: ReadinessStages[\"verify\"][\"state\"] = verify.some(({ result }) => result === \"failed\")\n ? \"failed\"\n : activeVerify !== undefined\n ? \"pending\"\n : requiredVerify.every(({ result }) => result === \"verified\")\n ? \"passed\"\n : verify.some(({ observation }) => observation !== null)\n ? \"held\"\n : \"not-started\"\n\n let productionState: ReadinessStages[\"production\"][\"state\"] = \"not-started\"\n if (deployment?.state._tag === \"deployment\") {\n const current = readinessObservationIsCurrent(deployment)\n switch (deployment.state.status) {\n case \"failed\":\n productionState = \"failed\"\n break\n case \"rolled-back\":\n productionState = \"rolled-back\"\n break\n case \"deploying\":\n productionState = current ? \"deploying\" : \"held\"\n break\n case \"pending\":\n productionState = current ? \"waiting\" : \"held\"\n break\n case \"succeeded\":\n productionState = current ? \"succeeded\" : \"held\"\n break\n case \"not-started\":\n productionState = current ? \"not-started\" : \"held\"\n break\n }\n }\n\n return {\n build: {\n state: buildState,\n factIds: sortedReadinessUnique(build.map(({ definition }) => definition.factId)),\n evidenceIds: stageEvidence(build),\n progress: observationProgress(\n runningBuild?.observation ?? queuedBuild?.observation ?? undefined\n )\n },\n verify: {\n state: verifyState,\n factIds: sortedReadinessUnique(verify.map(({ definition }) => definition.factId)),\n evidenceIds: stageEvidence(verify),\n progress: null\n },\n production: {\n state: productionState,\n factIds: sortedReadinessUnique(production.map(({ definition }) => definition.factId)),\n evidenceIds: stageEvidence(production),\n progress: observationProgress(deployment ?? undefined)\n }\n }\n}\n\n/** Derive the canonical verdict from facts, findings, and exact stage state. */\nexport const deriveEnvironmentReadinessVerdict = (input: {\n readonly blockers: ReadonlyArray<ReadinessFinding>\n readonly facts: ReadonlyArray<ReadinessFactEvaluation>\n readonly gaps: ReadonlyArray<ReadinessFinding>\n readonly stages: ReadinessStages\n}): ReadinessVerdict => {\n if (input.blockers.length > 0) return \"blocked\"\n if (input.stages.production.state === \"deploying\") return \"deploying\"\n if (\n input.facts.some(({ definition, observation }) => readinessObservationIsDeliveryActivity(definition, observation))\n ) return \"building\"\n if (\n input.gaps.length > 0 ||\n input.stages.build.state === \"held\" ||\n input.stages.verify.state === \"held\" ||\n input.stages.production.state === \"held\" ||\n input.facts.some(({ definition, result }) => definition.requirement === \"required\" && result !== \"verified\")\n ) return \"held\"\n return input.stages.production.state === \"succeeded\" ? \"shipped\" : \"ready\"\n}\n\ntype ReleaseEnvironmentReadiness = {\n readonly blockers: ReadonlyArray<ReadinessFinding>\n readonly environmentId: string\n readonly gaps: ReadonlyArray<ReadinessFinding>\n readonly nextEvaluationAt: UtcTimestamp | null\n readonly sourceFreshness: ReadonlyArray<ReadinessSourceSummary>\n readonly stages: ReadinessStages\n readonly verdict: ReadinessVerdict\n readonly warnings: ReadonlyArray<ReadinessFinding>\n}\n\n/** Exact merged findings implied by retained environment summaries. */\nexport const deriveReleaseReadinessFindings = (\n environments: ReadonlyArray<ReleaseEnvironmentReadiness>\n): {\n readonly blockers: Array<ReadinessFinding>\n readonly warnings: Array<ReadinessFinding>\n readonly gaps: Array<ReadinessFinding>\n} => ({\n blockers: normalizedFindings(environments.flatMap(({ blockers }) => blockers)),\n warnings: normalizedFindings(environments.flatMap(({ warnings }) => warnings)),\n gaps: normalizedFindings(environments.flatMap(({ gaps }) => gaps))\n})\n\n/** Exact worst-state source summaries implied by retained environments. */\nexport const deriveReleaseReadinessSourceSummaries = (\n environments: ReadonlyArray<ReleaseEnvironmentReadiness>\n): Array<ReadinessSourceSummary> => {\n const grouped = new Map<PluginConnectionId, Array<ReadinessSourceSummary>>()\n for (const summary of environments.flatMap(({ sourceFreshness }) => sourceFreshness)) {\n const current = grouped.get(summary.pluginConnectionId) ?? []\n current.push(summary)\n grouped.set(summary.pluginConnectionId, current)\n }\n return Array.from(grouped.entries())\n .map(([pluginConnectionId, summaries]): ReadinessSourceSummary => ({\n pluginConnectionId,\n freshness: summaries.reduce<ReadinessSourceSummary[\"freshness\"]>(\n (worst, summary) => freshnessRank[summary.freshness] > freshnessRank[worst] ? summary.freshness : worst,\n \"current\"\n ),\n health: summaries.reduce<ReadinessSourceSummary[\"health\"]>(\n (worst, summary) => healthRank[summary.health] > healthRank[worst] ? summary.health : worst,\n \"healthy\"\n ),\n evidenceIds: sortedReadinessUnique(summaries.flatMap(({ evidenceIds }) => evidenceIds))\n }))\n .sort((left, right) => compareReadinessText(left.pluginConnectionId, right.pluginConnectionId))\n}\n\n/** Earliest child freshness boundary implied by retained environments. */\nexport const deriveReleaseReadinessNextEvaluationAt = (\n environments: ReadonlyArray<ReleaseEnvironmentReadiness>\n): UtcTimestamp | null =>\n environments.reduce<UtcTimestamp | null>((earliest, { nextEvaluationAt }) => {\n if (nextEvaluationAt === null) return earliest\n return earliest === null || DateTime.Order(nextEvaluationAt, earliest) < 0 ? nextEvaluationAt : earliest\n }, null)\n\nconst firstReleaseProgress = (\n environments: ReadonlyArray<ReleaseEnvironmentReadiness>,\n stage: \"build\" | \"production\"\n): ReadinessProgress | null =>\n environments\n .slice()\n .sort((left, right) => compareReadinessText(left.environmentId, right.environmentId))\n .find((environment) => environment.stages[stage].progress !== null)?.stages[stage].progress ?? null\n\n/** Exact three-stage roll-up implied by retained environment summaries. */\nexport const deriveReleaseReadinessStages = (\n environments: ReadonlyArray<ReleaseEnvironmentReadiness>\n): ReadinessStages => {\n const buildStates = environments.map(({ stages }) => stages.build.state)\n const verifyStates = environments.map(({ stages }) => stages.verify.state)\n const productionStates = environments.map(({ stages }) => stages.production.state)\n const buildState: ReadinessStages[\"build\"][\"state\"] = buildStates.includes(\"failed\")\n ? \"failed\"\n : buildStates.includes(\"running\")\n ? \"running\"\n : buildStates.includes(\"queued\")\n ? \"queued\"\n : buildStates.every((state) => state === \"succeeded\")\n ? \"succeeded\"\n : buildStates.every((state) => state === \"not-started\")\n ? \"not-started\"\n : \"held\"\n const verifyState: ReadinessStages[\"verify\"][\"state\"] = verifyStates.includes(\"failed\")\n ? \"failed\"\n : verifyStates.includes(\"pending\")\n ? \"pending\"\n : verifyStates.every((state) => state === \"passed\")\n ? \"passed\"\n : verifyStates.every((state) => state === \"not-started\")\n ? \"not-started\"\n : \"held\"\n let productionState: ReadinessStages[\"production\"][\"state\"] = \"not-started\"\n if (productionStates.includes(\"failed\")) productionState = \"failed\"\n else if (productionStates.includes(\"rolled-back\")) productionState = \"rolled-back\"\n else if (productionStates.includes(\"deploying\")) productionState = \"deploying\"\n else if (productionStates.includes(\"held\")) productionState = \"held\"\n else if (productionStates.every((state) => state === \"succeeded\")) productionState = \"succeeded\"\n else if (productionStates.some((state) => state === \"waiting\" || state === \"succeeded\")) {\n productionState = \"waiting\"\n }\n\n return {\n build: {\n state: buildState,\n factIds: sortedReadinessUnique(environments.flatMap(({ stages }) => stages.build.factIds)),\n evidenceIds: sortedReadinessUnique(environments.flatMap(({ stages }) => stages.build.evidenceIds)),\n progress: firstReleaseProgress(environments, \"build\")\n },\n verify: {\n state: verifyState,\n factIds: sortedReadinessUnique(environments.flatMap(({ stages }) => stages.verify.factIds)),\n evidenceIds: sortedReadinessUnique(environments.flatMap(({ stages }) => stages.verify.evidenceIds)),\n progress: null\n },\n production: {\n state: productionState,\n factIds: sortedReadinessUnique(environments.flatMap(({ stages }) => stages.production.factIds)),\n evidenceIds: sortedReadinessUnique(environments.flatMap(({ stages }) => stages.production.evidenceIds)),\n progress: firstReleaseProgress(environments, \"production\")\n }\n }\n}\n\n/** Canonical cross-environment precedence for release readiness. */\nexport const deriveReleaseReadinessVerdict = (\n environments: ReadonlyArray<ReleaseEnvironmentReadiness>\n): ReadinessVerdict => {\n const verdicts = environments.map(({ verdict }) => verdict)\n if (verdicts.includes(\"blocked\")) return \"blocked\"\n if (verdicts.includes(\"deploying\")) return \"deploying\"\n if (verdicts.includes(\"building\")) return \"building\"\n if (verdicts.includes(\"held\")) return \"held\"\n return verdicts.every((verdict) => verdict === \"shipped\") ? \"shipped\" : \"ready\"\n}\n\nconst sameStringArray = (\n left: ReadonlyArray<string>,\n right: ReadonlyArray<string>\n): boolean => left.length === right.length && left.every((value, index) => value === right[index])\n\nconst progressIsEqual = (\n left: ReadinessProgress | null,\n right: ReadinessProgress | null\n): boolean =>\n left === null || right === null\n ? left === right\n : left._tag === \"count\" && right._tag === \"count\"\n ? left.completed === right.completed && left.total === right.total\n : left._tag === \"percent\" && right._tag === \"percent\" && left.value === right.value\n\n/** Structural equality for canonical stage records without serialization shortcuts. */\nexport const readinessStagesAreEqual = (\n left: ReadinessStages,\n right: ReadinessStages\n): boolean =>\n left.build.state === right.build.state &&\n sameStringArray(left.build.factIds, right.build.factIds) &&\n sameStringArray(left.build.evidenceIds, right.build.evidenceIds) &&\n progressIsEqual(left.build.progress, right.build.progress) &&\n left.verify.state === right.verify.state &&\n sameStringArray(left.verify.factIds, right.verify.factIds) &&\n sameStringArray(left.verify.evidenceIds, right.verify.evidenceIds) &&\n progressIsEqual(left.verify.progress, right.verify.progress) &&\n left.production.state === right.production.state &&\n sameStringArray(left.production.factIds, right.production.factIds) &&\n sameStringArray(left.production.evidenceIds, right.production.evidenceIds) &&\n progressIsEqual(left.production.progress, right.production.progress)\n","import * as DateTime from \"effect/DateTime\"\nimport * as Schema from \"effect/Schema\"\n\nimport {\n EnvironmentId,\n EvidenceId,\n PluginConnectionId,\n ReadinessAssessmentId,\n ReleaseId,\n WorkspaceId\n} from \"../identifiers.js\"\nimport { UtcTimestamp } from \"../utcTimestamp.js\"\nimport {\n compareReadinessText,\n deriveEnvironmentReadinessVerdict,\n deriveReadinessFindings,\n deriveReadinessNextEvaluationAt,\n deriveReadinessSourceSummaries,\n deriveReadinessStages,\n deriveReleaseReadinessFindings,\n deriveReleaseReadinessNextEvaluationAt,\n deriveReleaseReadinessSourceSummaries,\n deriveReleaseReadinessStages,\n deriveReleaseReadinessVerdict,\n readinessFactResult,\n readinessFindingKey,\n readinessPolicyShapeIsV1,\n readinessStagesAreEqual,\n sortedReadinessUnique\n} from \"./policy.js\"\n\nconst boundedIdentifier = (maximumLength: number, identifier: string) =>\n Schema.String.check(\n Schema.isTrimmed(),\n Schema.isMinLength(1),\n Schema.isMaxLength(maximumLength)\n ).annotate({ identifier })\n\nconst unique = <Value>(values: ReadonlyArray<Value>): boolean => new Set(values).size === values.length\n\nconst sameOrderedStrings = (\n left: ReadonlyArray<string>,\n right: ReadonlyArray<string>\n): boolean => left.length === right.length && left.every((value, index) => value === right[index])\n\nconst isCanonicalStrings = (values: ReadonlyArray<string>): boolean =>\n sameOrderedStrings(values, sortedReadinessUnique(values))\n\n/** Maximum exact evidence dependencies in one environment or release assessment. */\nexport const MAX_READINESS_EVIDENCE_REFERENCES = 512\n\n/** Maximum blockers, warnings, or gaps retained in one assessment. */\nexport const MAX_READINESS_FINDINGS = 1_025\n\n/** Stable identity of one V1 readiness fact, independent of display copy. */\nexport const ReadinessFactId = boundedIdentifier(200, \"ReadinessFactId\").pipe(\n Schema.check(Schema.isPattern(/^[a-z0-9][a-z0-9._:/-]*$/u)),\n Schema.brand(\"ReadinessFactId\")\n)\n\n/** Decoded readiness-fact identity. */\nexport type ReadinessFactId = typeof ReadinessFactId.Type\n\n/** Hash of the complete canonical candidate input assembled by the application layer. */\nexport const ReadinessCandidateDigest = Schema.String.check(\n Schema.isPattern(/^sha256:[0-9a-f]{64}$/u)\n).pipe(Schema.brand(\"ReadinessCandidateDigest\"))\n\n/** Decoded candidate digest. */\nexport type ReadinessCandidateDigest = typeof ReadinessCandidateDigest.Type\n\n/** Positive version of the rule policy used for one assessment. */\nexport const ReadinessRuleVersion = Schema.Int.check(Schema.isGreaterThan(0)).pipe(\n Schema.brand(\"ReadinessRuleVersion\")\n)\n\n/** Decoded readiness-rule version. */\nexport type ReadinessRuleVersion = typeof ReadinessRuleVersion.Type\n\n/** Positive version of the evaluator implementation used for one assessment. */\nexport const ReadinessDerivationVersion = Schema.Int.check(Schema.isGreaterThan(0)).pipe(\n Schema.brand(\"ReadinessDerivationVersion\")\n)\n\n/** Decoded readiness-derivation version. */\nexport type ReadinessDerivationVersion = typeof ReadinessDerivationVersion.Type\n\n/** V1 readiness policy version. */\nexport const READINESS_RULE_VERSION_V1 = ReadinessRuleVersion.make(1)\n\n/** V1 evaluator implementation version. */\nexport const READINESS_DERIVATION_VERSION_V1 = ReadinessDerivationVersion.make(1)\n\n/** Positive source revision of the release candidate. */\nexport const ReadinessReleaseRevision = Schema.Int.check(Schema.isGreaterThan(0))\n\n/** Decoded release-candidate revision. */\nexport type ReadinessReleaseRevision = typeof ReadinessReleaseRevision.Type\n\n/** Bounded immutable artifact revision, such as a commit or image digest. */\nexport const ReadinessArtifactRevision = boundedIdentifier(512, \"ReadinessArtifactRevision\")\n\n/** Decoded artifact revision. */\nexport type ReadinessArtifactRevision = typeof ReadinessArtifactRevision.Type\n\n/** Stable identity of a readiness rule set. */\nexport const ReadinessRuleId = boundedIdentifier(200, \"ReadinessRuleId\")\n\n/** Decoded readiness-rule identity. */\nexport type ReadinessRuleId = typeof ReadinessRuleId.Type\n\n/** Explicit release or target-environment scope of an assessment. */\nexport const ReadinessScope = Schema.TaggedUnion({\n release: { releaseId: ReleaseId },\n environment: { releaseId: ReleaseId, environmentId: EnvironmentId }\n})\n\n/** Decoded readiness scope. */\nexport type ReadinessScope = typeof ReadinessScope.Type\n\nconst CandidateIdentityBase = {\n workspaceId: WorkspaceId,\n releaseRevision: ReadinessReleaseRevision,\n artifactRevision: ReadinessArtifactRevision,\n digest: ReadinessCandidateDigest\n}\n\n/** Immutable target-environment candidate whose complete material is digest-bound. */\nexport const EnvironmentReadinessCandidateIdentity = Schema.Struct({\n ...CandidateIdentityBase,\n scope: Schema.TaggedStruct(\"environment\", {\n releaseId: ReleaseId,\n environmentId: EnvironmentId\n })\n})\n\n/** Immutable release-scope candidate whose child assessments are digest-bound. */\nexport const ReleaseReadinessCandidateIdentity = Schema.Struct({\n ...CandidateIdentityBase,\n scope: Schema.TaggedStruct(\"release\", { releaseId: ReleaseId })\n})\n\n/** Immutable deployable candidate whose complete material is bound by a digest. */\nexport const ReadinessCandidateIdentity = Schema.Union([\n EnvironmentReadinessCandidateIdentity,\n ReleaseReadinessCandidateIdentity\n])\n\n/** Decoded deployable candidate identity. */\nexport type ReadinessCandidateIdentity = typeof ReadinessCandidateIdentity.Type\n\n/** Stable rule-set identity and content digest retained with every assessment. */\nexport const ReadinessRuleReference = Schema.Struct({\n ruleId: ReadinessRuleId,\n version: ReadinessRuleVersion,\n digest: ReadinessCandidateDigest\n})\n\n/** Decoded readiness rule reference. */\nexport type ReadinessRuleReference = typeof ReadinessRuleReference.Type\n\n/** Canonical six-state readiness verdict. */\nexport const ReadinessVerdict = Schema.Literals([\n \"blocked\",\n \"ready\",\n \"deploying\",\n \"building\",\n \"shipped\",\n \"held\"\n])\n\n/** Decoded readiness verdict. */\nexport type ReadinessVerdict = typeof ReadinessVerdict.Type\n\n/** Closed provider-neutral fact categories understood by the V1 evaluator. */\nexport const ReadinessFactKind = Schema.Literals([\n \"relationship\",\n \"approval\",\n \"check\",\n \"execution\",\n \"documentation\",\n \"deployment\"\n])\n\n/** Decoded readiness-fact category. */\nexport type ReadinessFactKind = typeof ReadinessFactKind.Type\n\n/** Whether a fact gates readiness or only contributes context. */\nexport const ReadinessFactRequirement = Schema.Literals([\"required\", \"advisory\"])\n\n/** Decoded fact requirement. */\nexport type ReadinessFactRequirement = typeof ReadinessFactRequirement.Type\n\n/** Policy definition that makes missing observations explicit rather than successful by absence. */\nexport const ReadinessFactDefinition = Schema.Struct({\n factId: ReadinessFactId,\n kind: ReadinessFactKind,\n requirement: ReadinessFactRequirement\n})\n\n/** Decoded readiness-fact definition. */\nexport type ReadinessFactDefinition = typeof ReadinessFactDefinition.Type\n\nconst CountProgress = Schema.TaggedStruct(\"count\", {\n completed: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n total: Schema.Int.check(Schema.isGreaterThan(0))\n}).check(\n Schema.makeFilter(({ completed, total }) => completed <= total, {\n expected: \"readiness progress completed count not to exceed its total\"\n })\n)\n\nconst PercentProgress = Schema.TaggedStruct(\"percent\", {\n value: Schema.Number.check(\n Schema.makeFilter((value) => value >= 0 && value <= 100, {\n expected: \"readiness progress percentage between zero and one hundred\"\n })\n )\n})\n\n/** Typed progress for builds and deployments without copied display text. */\nexport const ReadinessProgress = Schema.Union([CountProgress, PercentProgress]).pipe(\n Schema.toTaggedUnion(\"_tag\")\n)\n\n/** Decoded readiness progress. */\nexport type ReadinessProgress = typeof ReadinessProgress.Type\n\n/** Closed normalized observation states; vendor strings never enter rule evaluation. */\nexport const ReadinessFactState = Schema.TaggedUnion({\n relationship: {\n status: Schema.Literals([\n \"missing\",\n \"inferred\",\n \"proposed\",\n \"verified\",\n \"governed\",\n \"rejected\",\n \"superseded\"\n ])\n },\n approval: {\n status: Schema.Literals([\"missing\", \"pending\", \"approved\", \"rejected\", \"expired\"])\n },\n check: {\n status: Schema.Literals([\"missing\", \"queued\", \"running\", \"passed\", \"failed\", \"cancelled\"])\n },\n execution: {\n status: Schema.Literals([\"missing\", \"queued\", \"running\", \"succeeded\", \"failed\", \"stopped\"]),\n progress: Schema.NullOr(ReadinessProgress)\n },\n documentation: {\n status: Schema.Literals([\"missing\", \"draft\", \"current\", \"stale\", \"superseded\"])\n },\n deployment: {\n status: Schema.Literals([\"not-started\", \"pending\", \"deploying\", \"succeeded\", \"failed\", \"rolled-back\"]),\n progress: Schema.NullOr(ReadinessProgress)\n }\n})\n\n/** Decoded normalized readiness observation state. */\nexport type ReadinessFactState = typeof ReadinessFactState.Type\n\n/** Exact origin of evidence used for dependency tracking and plugin-health invalidation. */\nexport const ReadinessEvidenceSource = Schema.TaggedUnion({\n plugin: {\n pluginConnectionId: PluginConnectionId,\n health: Schema.Literals([\"healthy\", \"degraded\", \"unavailable\", \"disabled\"])\n },\n local: { origin: Schema.Literals([\"human\", \"agent\", \"system\"]) }\n})\n\n/** Decoded readiness-evidence source. */\nexport type ReadinessEvidenceSource = typeof ReadinessEvidenceSource.Type\n\n/** Exact evidence dependency and its freshness at the injected evaluation boundary. */\nexport const ReadinessEvidenceReference = Schema.Struct({\n evidenceId: EvidenceId,\n source: ReadinessEvidenceSource,\n freshness: Schema.Literals([\"current\", \"stale\", \"missing\", \"unavailable\"]),\n validity: Schema.Literals([\"valid\", \"expired\"]),\n reevaluateAt: Schema.NullOr(UtcTimestamp)\n})\n\n/** Decoded readiness-evidence dependency. */\nexport type ReadinessEvidenceReference = typeof ReadinessEvidenceReference.Type\n\nconst stateRequiresEvidence = (state: ReadinessFactState): boolean => state.status !== \"missing\"\n\n/** One normalized observation for a policy-defined fact. */\nexport const ReadinessFactObservation = Schema.Struct({\n factId: ReadinessFactId,\n state: ReadinessFactState,\n evidence: Schema.Array(ReadinessEvidenceReference).check(Schema.isMaxLength(128))\n}).check(\n Schema.makeFilter(({ evidence }) => unique(evidence.map(({ evidenceId }) => evidenceId)), {\n expected: \"readiness observation evidence identifiers to be unique\"\n }),\n Schema.makeFilter(({ evidence, state }) => !stateRequiresEvidence(state) || evidence.length > 0, {\n expected: \"a non-empty readiness observation state to reference evidence\"\n })\n)\n\n/** Decoded readiness-fact observation. */\nexport type ReadinessFactObservation = typeof ReadinessFactObservation.Type\n\n/** Stable machine-readable reason emitted by the V1 rule policy. */\nexport const ReadinessFindingCode = Schema.Literals([\n \"input-incomplete\",\n \"relationship-missing\",\n \"relationship-unverified\",\n \"relationship-rejected\",\n \"relationship-superseded\",\n \"approval-missing\",\n \"approval-pending\",\n \"approval-rejected\",\n \"approval-expired\",\n \"check-missing\",\n \"check-pending\",\n \"check-failed\",\n \"check-cancelled\",\n \"execution-missing\",\n \"execution-pending\",\n \"execution-failed\",\n \"execution-stopped\",\n \"documentation-missing\",\n \"documentation-draft\",\n \"documentation-stale\",\n \"documentation-superseded\",\n \"deployment-missing\",\n \"deployment-failed\",\n \"deployment-rolled-back\",\n \"source-stale\",\n \"source-missing\",\n \"source-unavailable\",\n \"plugin-degraded\",\n \"evidence-expired\"\n])\n\n/** Decoded readiness finding code. */\nexport type ReadinessFindingCode = typeof ReadinessFindingCode.Type\n\n/** Stable subject of a readiness finding. */\nexport const ReadinessFindingSubject = Schema.TaggedUnion({\n fact: { factId: ReadinessFactId },\n source: { pluginConnectionId: PluginConnectionId },\n candidate: {}\n})\n\n/** One blocker, warning, or evidence gap without presentation prose. */\nexport const ReadinessFinding = Schema.Struct({\n code: ReadinessFindingCode,\n subject: ReadinessFindingSubject,\n evidenceIds: Schema.Array(EvidenceId).check(Schema.isMaxLength(128))\n}).check(\n Schema.makeFilter(({ evidenceIds }) => unique(evidenceIds), {\n expected: \"readiness finding evidence identifiers to be unique\"\n })\n)\n\n/** Decoded readiness finding. */\nexport type ReadinessFinding = typeof ReadinessFinding.Type\n\n/** Outcome retained for every evaluated fact. */\nexport const ReadinessFactResult = Schema.Literals([\"verified\", \"pending\", \"failed\", \"gap\", \"advisory\"])\n\n/** Decoded readiness-fact outcome. */\nexport type ReadinessFactResult = typeof ReadinessFactResult.Type\n\n/** Auditable fact evaluation retained in an environment assessment. */\nexport const ReadinessFactEvaluation = Schema.Struct({\n definition: ReadinessFactDefinition,\n observation: Schema.NullOr(ReadinessFactObservation),\n result: ReadinessFactResult,\n evidenceIds: Schema.Array(EvidenceId).check(Schema.isMaxLength(128))\n}).check(\n Schema.makeFilter(({ definition, evidenceIds, observation, result }) =>\n observation === null\n ? evidenceIds.length === 0 && result === readinessFactResult(definition, observation)\n : observation.factId === definition.factId &&\n observation.state._tag === definition.kind &&\n sameOrderedStrings(\n evidenceIds,\n sortedReadinessUnique(observation.evidence.map(({ evidenceId }) => evidenceId))\n ) &&\n result === readinessFactResult(definition, observation), {\n expected: \"readiness fact evaluation to match its definition, observation, evidence, and result\"\n })\n)\n\n/** Decoded readiness-fact evaluation. */\nexport type ReadinessFactEvaluation = typeof ReadinessFactEvaluation.Type\n\n/** Worst current source state for one contributing plugin connection. */\nexport const ReadinessSourceSummary = Schema.Struct({\n pluginConnectionId: PluginConnectionId,\n freshness: Schema.Literals([\"current\", \"stale\", \"missing\", \"unavailable\"]),\n health: Schema.Literals([\"healthy\", \"degraded\", \"unavailable\", \"disabled\"]),\n evidenceIds: Schema.Array(EvidenceId).check(Schema.isMaxLength(512))\n})\n\n/** Decoded source summary. */\nexport type ReadinessSourceSummary = typeof ReadinessSourceSummary.Type\n\nconst ReadinessStageBase = {\n factIds: Schema.Array(ReadinessFactId).check(Schema.isMaxLength(512)),\n evidenceIds: Schema.Array(EvidenceId).check(Schema.isMaxLength(512)),\n progress: Schema.NullOr(ReadinessProgress)\n}\n\n/** Server-derived Build stage. */\nexport const BuildReadinessStage = Schema.Struct({\n ...ReadinessStageBase,\n state: Schema.Literals([\"not-started\", \"queued\", \"running\", \"succeeded\", \"failed\", \"held\"])\n})\n\n/** Server-derived Verify stage. */\nexport const VerifyReadinessStage = Schema.Struct({\n ...ReadinessStageBase,\n state: Schema.Literals([\"not-started\", \"pending\", \"passed\", \"failed\", \"held\"])\n})\n\n/** Server-derived Production stage. */\nexport const ProductionReadinessStage = Schema.Struct({\n ...ReadinessStageBase,\n state: Schema.Literals([\n \"not-started\",\n \"waiting\",\n \"deploying\",\n \"succeeded\",\n \"failed\",\n \"rolled-back\",\n \"held\"\n ])\n})\n\n/** Exactly three authoritative delivery stages. */\nexport const ReadinessStages = Schema.Struct({\n build: BuildReadinessStage,\n verify: VerifyReadinessStage,\n production: ProductionReadinessStage\n})\n\n/** Decoded readiness stages. */\nexport type ReadinessStages = typeof ReadinessStages.Type\n\n/** Complete, decoded input for one environment evaluation. */\nexport const EnvironmentReadinessEvaluationInput = Schema.Struct({\n assessmentId: ReadinessAssessmentId,\n previousAssessmentId: Schema.NullOr(ReadinessAssessmentId),\n candidate: EnvironmentReadinessCandidateIdentity,\n rule: ReadinessRuleReference,\n derivationVersion: ReadinessDerivationVersion,\n evaluatedAt: UtcTimestamp,\n complete: Schema.Boolean,\n definitions: Schema.Array(ReadinessFactDefinition).check(Schema.isMaxLength(512)),\n observations: Schema.Array(ReadinessFactObservation).check(Schema.isMaxLength(512))\n}).check(\n Schema.makeFilter(\n ({ assessmentId, previousAssessmentId }) => previousAssessmentId === null || previousAssessmentId !== assessmentId,\n { expected: \"an environment readiness input not to supersede itself\" }\n ),\n Schema.makeFilter(\n ({ derivationVersion }) => derivationVersion === READINESS_DERIVATION_VERSION_V1,\n { expected: \"the V1 environment evaluator to use derivation version 1\" }\n ),\n Schema.makeFilter(({ definitions }) => unique(definitions.map(({ factId }) => factId)), {\n expected: \"readiness fact definitions to have unique identities\"\n }),\n Schema.makeFilter(({ observations }) => unique(observations.map(({ factId }) => factId)), {\n expected: \"readiness fact observations to have unique identities\"\n }),\n Schema.makeFilter(\n ({ observations }) =>\n observations.reduce((total, observation) => total + observation.evidence.length, 0) <=\n MAX_READINESS_EVIDENCE_REFERENCES,\n {\n expected: \"environment readiness input to fit its bounded assessment evidence set\"\n }\n ),\n Schema.makeFilter(({ definitions, observations }) => {\n const definitionsById = new Map(definitions.map((definition) => [definition.factId, definition]))\n return observations.every((observation) => definitionsById.get(observation.factId)?.kind === observation.state._tag)\n }, { expected: \"readiness observations to match one policy fact of the same kind\" }),\n Schema.makeFilter(({ definitions, observations }) => readinessPolicyShapeIsV1(definitions, observations), {\n expected: \"environment readiness input to contain the complete V1 policy shape\"\n })\n)\n\n/** Decoded environment-readiness input. */\nexport type EnvironmentReadinessEvaluationInput = typeof EnvironmentReadinessEvaluationInput.Type\n\nconst factEvidenceIds = (facts: ReadonlyArray<ReadinessFactEvaluation>): Array<EvidenceId> =>\n sortedReadinessUnique(facts.flatMap(({ evidenceIds }) => evidenceIds))\n\nconst factsOfKinds = (\n facts: ReadonlyArray<ReadinessFactEvaluation>,\n kinds: ReadonlyArray<ReadinessFactKind>\n): ReadonlyArray<ReadinessFactEvaluation> => facts.filter(({ definition }) => kinds.includes(definition.kind))\n\nconst stageMatchesFacts = (\n stage: ReadinessStages[\"build\"] | ReadinessStages[\"verify\"] | ReadinessStages[\"production\"],\n facts: ReadonlyArray<ReadinessFactEvaluation>\n): boolean =>\n sameOrderedStrings(\n stage.factIds,\n sortedReadinessUnique(facts.map(({ definition }) => definition.factId))\n ) && sameOrderedStrings(stage.evidenceIds, factEvidenceIds(facts))\n\nconst canonicalAssessmentCollections = (assessment: {\n readonly blockers: ReadonlyArray<ReadinessFinding>\n readonly evidenceIds: ReadonlyArray<EvidenceId>\n readonly gaps: ReadonlyArray<ReadinessFinding>\n readonly sourceFreshness: ReadonlyArray<ReadinessSourceSummary>\n readonly stages: ReadinessStages\n readonly warnings: ReadonlyArray<ReadinessFinding>\n}): boolean => {\n const evidence = new Set(assessment.evidenceIds)\n const findings = [assessment.blockers, assessment.warnings, assessment.gaps]\n return isCanonicalStrings(assessment.evidenceIds) &&\n findings.every((items) =>\n sameOrderedStrings(items.map(readinessFindingKey), items.map(readinessFindingKey).sort(compareReadinessText)) &&\n unique(items.map(readinessFindingKey)) &&\n items.every(({ evidenceIds }) =>\n isCanonicalStrings(evidenceIds) && evidenceIds.every((evidenceId) => evidence.has(evidenceId))\n )\n ) &&\n isCanonicalStrings(assessment.stages.build.factIds) &&\n isCanonicalStrings(assessment.stages.build.evidenceIds) &&\n isCanonicalStrings(assessment.stages.verify.factIds) &&\n isCanonicalStrings(assessment.stages.verify.evidenceIds) &&\n isCanonicalStrings(assessment.stages.production.factIds) &&\n isCanonicalStrings(assessment.stages.production.evidenceIds) &&\n isCanonicalStrings(assessment.sourceFreshness.map(({ pluginConnectionId }) => pluginConnectionId)) &&\n assessment.sourceFreshness.every(({ evidenceIds }) =>\n isCanonicalStrings(evidenceIds) && evidenceIds.every((evidenceId) => evidence.has(evidenceId))\n )\n}\n\nconst AssessmentBase = {\n assessmentId: ReadinessAssessmentId,\n previousAssessmentId: Schema.NullOr(ReadinessAssessmentId),\n candidate: ReadinessCandidateIdentity,\n rule: ReadinessRuleReference,\n derivationVersion: ReadinessDerivationVersion,\n evaluatedAt: UtcTimestamp,\n nextEvaluationAt: Schema.NullOr(UtcTimestamp),\n verdict: ReadinessVerdict,\n stages: ReadinessStages,\n blockers: Schema.Array(ReadinessFinding).check(Schema.isMaxLength(MAX_READINESS_FINDINGS)),\n warnings: Schema.Array(ReadinessFinding).check(Schema.isMaxLength(MAX_READINESS_FINDINGS)),\n gaps: Schema.Array(ReadinessFinding).check(Schema.isMaxLength(MAX_READINESS_FINDINGS)),\n sourceFreshness: Schema.Array(ReadinessSourceSummary).check(Schema.isMaxLength(512)),\n evidenceIds: Schema.Array(EvidenceId).check(Schema.isMaxLength(MAX_READINESS_EVIDENCE_REFERENCES))\n}\n\n/** Immutable environment assessment retaining exact facts and evidence. */\nexport const EnvironmentReadinessAssessment = Schema.Struct({\n ...AssessmentBase,\n _tag: Schema.Literal(\"environment\"),\n candidate: EnvironmentReadinessCandidateIdentity,\n inputComplete: Schema.Boolean,\n facts: Schema.Array(ReadinessFactEvaluation).check(Schema.isMaxLength(512)),\n requiredFactIds: Schema.Array(ReadinessFactId).check(Schema.isMaxLength(512)),\n verifiedFactIds: Schema.Array(ReadinessFactId).check(Schema.isMaxLength(512))\n}).check(\n Schema.makeFilter(\n ({ derivationVersion }) => derivationVersion === READINESS_DERIVATION_VERSION_V1,\n { expected: \"an environment readiness assessment derived by V1\" }\n ),\n Schema.makeFilter(\n ({ assessmentId, previousAssessmentId }) => previousAssessmentId === null || previousAssessmentId !== assessmentId,\n {\n expected: \"a readiness assessment not to supersede itself\"\n }\n ),\n Schema.makeFilter(({ facts }) => isCanonicalStrings(facts.map(({ definition }) => definition.factId)), {\n expected: \"environment readiness facts to have canonical unique identities\"\n }),\n Schema.makeFilter(\n ({ facts }) =>\n readinessPolicyShapeIsV1(\n facts.map(({ definition }) => definition),\n facts.flatMap(({ observation }) => observation === null ? [] : [observation])\n ),\n { expected: \"environment readiness assessment to retain the complete V1 policy shape\" }\n ),\n Schema.makeFilter(({ facts, requiredFactIds }) =>\n sameOrderedStrings(\n requiredFactIds,\n sortedReadinessUnique(\n facts\n .filter(({ definition }) => definition.requirement === \"required\")\n .map(({ definition }) => definition.factId)\n )\n ), { expected: \"environment readiness required facts to match retained evaluations\" }),\n Schema.makeFilter(({ facts, verifiedFactIds }) =>\n sameOrderedStrings(\n verifiedFactIds,\n sortedReadinessUnique(\n facts\n .filter(({ result }) => result === \"verified\")\n .map(({ definition }) => definition.factId)\n )\n ), { expected: \"environment readiness verified facts to match retained evaluations\" }),\n Schema.makeFilter(({ blockers, facts, gaps, inputComplete, warnings }) => {\n const expected = deriveReadinessFindings(facts, inputComplete)\n return sameOrderedStrings(blockers.map(readinessFindingKey), expected.blockers.map(readinessFindingKey)) &&\n sameOrderedStrings(warnings.map(readinessFindingKey), expected.warnings.map(readinessFindingKey)) &&\n sameOrderedStrings(gaps.map(readinessFindingKey), expected.gaps.map(readinessFindingKey))\n }, { expected: \"environment readiness findings to match retained fact evaluations\" }),\n Schema.makeFilter(({ evidenceIds, facts }) =>\n sameOrderedStrings(\n evidenceIds,\n factEvidenceIds(facts)\n ), { expected: \"environment readiness evidence to match retained fact dependencies\" }),\n Schema.makeFilter(({ facts, stages }) => {\n const build = factsOfKinds(facts, [\"execution\"])\n const verify = factsOfKinds(facts, [\"relationship\", \"approval\", \"check\", \"documentation\"])\n const production = factsOfKinds(facts, [\"deployment\"])\n return stageMatchesFacts(stages.build, build) &&\n stageMatchesFacts(stages.verify, verify) &&\n stageMatchesFacts(stages.production, production)\n }, { expected: \"environment readiness stages to retain their exact fact and evidence dependencies\" }),\n Schema.makeFilter(({ facts, stages }) => readinessStagesAreEqual(stages, deriveReadinessStages(facts)), {\n expected: \"environment readiness stage states to match retained fact evaluations\"\n }),\n Schema.makeFilter(({ facts, sourceFreshness }) => {\n const expected = deriveReadinessSourceSummaries(facts)\n return sourceFreshness.length === expected.length && sourceFreshness.every((summary, index) => {\n const item = expected[index]\n return item !== undefined &&\n summary.pluginConnectionId === item.pluginConnectionId &&\n summary.freshness === item.freshness &&\n summary.health === item.health &&\n sameOrderedStrings(summary.evidenceIds, item.evidenceIds)\n })\n }, { expected: \"environment readiness source summaries to match retained evidence\" }),\n Schema.makeFilter(({ facts, nextEvaluationAt }) => {\n const expected = deriveReadinessNextEvaluationAt(facts)\n return expected === null || nextEvaluationAt === null\n ? expected === nextEvaluationAt\n : DateTime.Order(expected, nextEvaluationAt) === 0\n }, { expected: \"environment readiness reevaluation time to match retained evidence\" }),\n Schema.makeFilter(canonicalAssessmentCollections, {\n expected: \"environment readiness collections to be canonical and evidence-bound\"\n }),\n Schema.makeFilter((assessment) => assessment.verdict === deriveEnvironmentReadinessVerdict(assessment), {\n expected: \"environment readiness verdict to agree with retained facts, findings, and stages\"\n })\n)\n\n/** Decoded immutable environment assessment. */\nexport type EnvironmentReadinessAssessment = typeof EnvironmentReadinessAssessment.Type\n\n/** Compact immutable child retained by a release-scope roll-up. */\nexport const EnvironmentReadinessSummary = Schema.Struct({\n assessmentId: ReadinessAssessmentId,\n environmentId: EnvironmentId,\n candidateDigest: ReadinessCandidateDigest,\n inputComplete: Schema.Boolean,\n facts: Schema.Array(ReadinessFactEvaluation).check(Schema.isMaxLength(512)),\n nextEvaluationAt: Schema.NullOr(UtcTimestamp),\n verdict: ReadinessVerdict,\n stages: ReadinessStages,\n blockers: Schema.Array(ReadinessFinding).check(Schema.isMaxLength(MAX_READINESS_FINDINGS)),\n warnings: Schema.Array(ReadinessFinding).check(Schema.isMaxLength(MAX_READINESS_FINDINGS)),\n gaps: Schema.Array(ReadinessFinding).check(Schema.isMaxLength(MAX_READINESS_FINDINGS)),\n sourceFreshness: Schema.Array(ReadinessSourceSummary).check(Schema.isMaxLength(512)),\n evidenceIds: Schema.Array(EvidenceId).check(Schema.isMaxLength(MAX_READINESS_EVIDENCE_REFERENCES))\n}).check(\n Schema.makeFilter(({ facts }) => isCanonicalStrings(facts.map(({ definition }) => definition.factId)), {\n expected: \"an environment readiness summary to have canonical unique facts\"\n }),\n Schema.makeFilter(\n ({ facts }) =>\n readinessPolicyShapeIsV1(\n facts.map(({ definition }) => definition),\n facts.flatMap(({ observation }) => observation === null ? [] : [observation])\n ),\n { expected: \"an environment readiness summary to retain the complete V1 policy shape\" }\n ),\n Schema.makeFilter(({ blockers, facts, gaps, inputComplete, warnings }) => {\n const expected = deriveReadinessFindings(facts, inputComplete)\n return sameOrderedStrings(blockers.map(readinessFindingKey), expected.blockers.map(readinessFindingKey)) &&\n sameOrderedStrings(warnings.map(readinessFindingKey), expected.warnings.map(readinessFindingKey)) &&\n sameOrderedStrings(gaps.map(readinessFindingKey), expected.gaps.map(readinessFindingKey))\n }, { expected: \"environment readiness summary findings to match retained facts\" }),\n Schema.makeFilter(({ evidenceIds, facts }) => sameOrderedStrings(evidenceIds, factEvidenceIds(facts)), {\n expected: \"environment readiness summary evidence to match retained facts\"\n }),\n Schema.makeFilter(({ facts, stages }) => readinessStagesAreEqual(stages, deriveReadinessStages(facts)), {\n expected: \"environment readiness summary stages to match retained facts\"\n }),\n Schema.makeFilter(({ facts, sourceFreshness }) => {\n const expected = deriveReadinessSourceSummaries(facts)\n return sourceFreshness.length === expected.length && sourceFreshness.every((summary, index) => {\n const item = expected[index]\n return item !== undefined &&\n summary.pluginConnectionId === item.pluginConnectionId &&\n summary.freshness === item.freshness &&\n summary.health === item.health &&\n sameOrderedStrings(summary.evidenceIds, item.evidenceIds)\n })\n }, { expected: \"environment readiness summary sources to match retained facts\" }),\n Schema.makeFilter(({ facts, nextEvaluationAt }) => {\n const expected = deriveReadinessNextEvaluationAt(facts)\n return expected === null || nextEvaluationAt === null\n ? expected === nextEvaluationAt\n : DateTime.Order(expected, nextEvaluationAt) === 0\n }, { expected: \"environment readiness summary reevaluation time to match retained facts\" }),\n Schema.makeFilter(canonicalAssessmentCollections, {\n expected: \"environment readiness summary collections to be canonical and evidence-bound\"\n }),\n Schema.makeFilter((summary) => summary.verdict === deriveEnvironmentReadinessVerdict(summary), {\n expected: \"environment readiness summary verdict to match retained facts, findings, and stages\"\n })\n)\n\n/** Immutable release assessment rolled up from current target environments. */\nexport const ReleaseReadinessAssessment = Schema.Struct({\n ...AssessmentBase,\n _tag: Schema.Literal(\"release\"),\n candidate: ReleaseReadinessCandidateIdentity,\n environments: Schema.NonEmptyArray(EnvironmentReadinessSummary).check(Schema.isMaxLength(512))\n}).check(\n Schema.makeFilter(\n ({ derivationVersion }) => derivationVersion === READINESS_DERIVATION_VERSION_V1,\n { expected: \"a release readiness assessment derived by V1\" }\n ),\n Schema.makeFilter(\n ({ assessmentId, previousAssessmentId }) => previousAssessmentId === null || previousAssessmentId !== assessmentId,\n {\n expected: \"a release readiness assessment not to supersede itself\"\n }\n ),\n Schema.makeFilter(({ environments }) => isCanonicalStrings(environments.map(({ environmentId }) => environmentId)), {\n expected: \"release readiness environments to have canonical unique identities\"\n }),\n Schema.makeFilter(\n ({ environments, stages }) => readinessStagesAreEqual(stages, deriveReleaseReadinessStages(environments)),\n { expected: \"release readiness stages to match retained environment summaries\" }\n ),\n Schema.makeFilter(({ blockers, environments, gaps, warnings }) => {\n const expected = deriveReleaseReadinessFindings(environments)\n return sameOrderedStrings(blockers.map(readinessFindingKey), expected.blockers.map(readinessFindingKey)) &&\n sameOrderedStrings(warnings.map(readinessFindingKey), expected.warnings.map(readinessFindingKey)) &&\n sameOrderedStrings(gaps.map(readinessFindingKey), expected.gaps.map(readinessFindingKey))\n }, { expected: \"release readiness findings to match retained environment summaries\" }),\n Schema.makeFilter(({ environments, sourceFreshness }) => {\n const expected = deriveReleaseReadinessSourceSummaries(environments)\n return sourceFreshness.length === expected.length && sourceFreshness.every((summary, index) => {\n const item = expected[index]\n return item !== undefined &&\n summary.pluginConnectionId === item.pluginConnectionId &&\n summary.freshness === item.freshness &&\n summary.health === item.health &&\n sameOrderedStrings(summary.evidenceIds, item.evidenceIds)\n })\n }, { expected: \"release readiness sources to match retained environment summaries\" }),\n Schema.makeFilter(({ environments, nextEvaluationAt }) => {\n const expected = deriveReleaseReadinessNextEvaluationAt(environments)\n return expected === null || nextEvaluationAt === null\n ? expected === nextEvaluationAt\n : DateTime.Order(expected, nextEvaluationAt) === 0\n }, { expected: \"release readiness reevaluation time to match retained environment summaries\" }),\n Schema.makeFilter(({ environments, evidenceIds }) =>\n sameOrderedStrings(\n evidenceIds,\n sortedReadinessUnique(environments.flatMap(({ evidenceIds }) => evidenceIds))\n ), { expected: \"release readiness evidence to match retained environment summaries\" }),\n Schema.makeFilter(canonicalAssessmentCollections, {\n expected: \"release readiness collections to be canonical and evidence-bound\"\n }),\n Schema.makeFilter(({ environments, verdict }) => verdict === deriveReleaseReadinessVerdict(environments), {\n expected: \"release readiness verdict to agree with its environment summaries\"\n })\n)\n\n/** Decoded immutable release readiness assessment. */\nexport type ReleaseReadinessAssessment = typeof ReleaseReadinessAssessment.Type\n\n/** Any immutable server-authoritative readiness assessment. */\nexport const ReadinessAssessment = Schema.Union([\n EnvironmentReadinessAssessment,\n ReleaseReadinessAssessment\n]).pipe(Schema.toTaggedUnion(\"_tag\"))\n\n/** Decoded readiness assessment. */\nexport type ReadinessAssessment = typeof ReadinessAssessment.Type\n\n/** Complete, decoded input for one release-scope roll-up. */\nexport const ReleaseReadinessRollupInput = Schema.Struct({\n assessmentId: ReadinessAssessmentId,\n previousAssessmentId: Schema.NullOr(ReadinessAssessmentId),\n candidate: ReleaseReadinessCandidateIdentity,\n evaluatedAt: UtcTimestamp,\n environments: Schema.NonEmptyArray(EnvironmentReadinessAssessment).check(Schema.isMaxLength(512))\n}).check(\n Schema.makeFilter(\n ({ assessmentId, previousAssessmentId }) => previousAssessmentId === null || previousAssessmentId !== assessmentId,\n { expected: \"a release readiness roll-up input not to supersede itself\" }\n ),\n Schema.makeFilter(({ environments }) => unique(environments.map(({ candidate }) => candidate.scope.environmentId)), {\n expected: \"release readiness roll-up environment identities to be unique\"\n }),\n Schema.makeFilter(\n ({ candidate, environments }) =>\n environments.every((assessment) =>\n assessment.candidate.workspaceId === candidate.workspaceId &&\n assessment.candidate.scope.releaseId === candidate.scope.releaseId &&\n assessment.candidate.releaseRevision === candidate.releaseRevision &&\n assessment.candidate.artifactRevision === candidate.artifactRevision\n ),\n {\n expected: \"release readiness roll-up children to name the same workspace, release, and candidate revision\"\n }\n ),\n Schema.makeFilter(\n ({ environments }) =>\n environments.every((assessment) =>\n assessment.rule.ruleId === environments[0]?.rule.ruleId &&\n assessment.rule.version === environments[0]?.rule.version &&\n assessment.rule.digest === environments[0]?.rule.digest &&\n assessment.derivationVersion === environments[0]?.derivationVersion\n ),\n { expected: \"release readiness roll-up children to use one rule and derivation version\" }\n ),\n Schema.makeFilter(\n ({ environments }) =>\n sortedReadinessUnique(environments.flatMap(({ evidenceIds }) => evidenceIds)).length <=\n MAX_READINESS_EVIDENCE_REFERENCES,\n {\n expected: \"release readiness roll-up evidence to fit its bounded assessment\"\n }\n ),\n Schema.makeFilter(({ environments }) =>\n [\"build\", \"verify\", \"production\"].every((stage) => {\n if (stage === \"build\") {\n return sortedReadinessUnique(environments.flatMap(({ stages }) => stages.build.factIds)).length <= 512\n }\n if (stage === \"verify\") {\n return sortedReadinessUnique(environments.flatMap(({ stages }) => stages.verify.factIds)).length <= 512\n }\n return sortedReadinessUnique(environments.flatMap(({ stages }) => stages.production.factIds)).length <= 512\n }), { expected: \"release readiness roll-up facts to fit its bounded stages\" }),\n Schema.makeFilter(\n ({ environments }) =>\n environments.reduce((total, assessment) => total + assessment.blockers.length, 0) <=\n MAX_READINESS_FINDINGS &&\n environments.reduce((total, assessment) => total + assessment.warnings.length, 0) <=\n MAX_READINESS_FINDINGS &&\n environments.reduce((total, assessment) => total + assessment.gaps.length, 0) <=\n MAX_READINESS_FINDINGS,\n {\n expected: \"release readiness roll-up findings to fit its bounded assessment\"\n }\n ),\n Schema.makeFilter(\n ({ environments }) =>\n sortedReadinessUnique(\n environments.flatMap(({ sourceFreshness }) =>\n sourceFreshness.map(({ pluginConnectionId }) => pluginConnectionId)\n )\n ).length <= 512,\n {\n expected: \"release readiness roll-up sources to fit its bounded assessment\"\n }\n ),\n Schema.makeFilter(\n ({ environments, evaluatedAt }) =>\n environments.every((assessment) => DateTime.Order(assessment.evaluatedAt, evaluatedAt) <= 0),\n { expected: \"release readiness roll-up not to predate its child assessments\" }\n )\n)\n\n/** Decoded release-readiness roll-up input. */\nexport type ReleaseReadinessRollupInput = typeof ReleaseReadinessRollupInput.Type\n","import * as DateTime from \"effect/DateTime\"\nimport * as Schema from \"effect/Schema\"\nimport {\n AgentId,\n EntityId,\n EnvironmentId,\n PersonId,\n PluginConnectionId,\n ReleaseId,\n RoleAssignmentId,\n WorkspaceId\n} from \"./identifiers.js\"\nimport { ProviderId, VendorImmutableId } from \"./sourceRevision.js\"\nimport { UtcTimestamp } from \"./utcTimestamp.js\"\n\nconst DisplayName = Schema.String.check(Schema.isTrimmed(), Schema.isMinLength(1), Schema.isMaxLength(200))\nconst AvatarReferenceValue = Schema.String.check(\n Schema.isTrimmed(),\n Schema.isMinLength(1),\n Schema.isMaxLength(500)\n)\nconst Initials = Schema.String.check(Schema.isTrimmed(), Schema.isMinLength(1), Schema.isMaxLength(4))\n\n/** An immutable provider identity associated with a canonical person. */\nexport const PersonSourceIdentity = Schema.Struct({\n pluginConnectionId: PluginConnectionId,\n providerId: ProviderId,\n vendorPersonId: VendorImmutableId\n})\n\n/** Decoded person identity from a provider. */\nexport type PersonSourceIdentity = typeof PersonSourceIdentity.Type\n\n/** Avatar media reference or deterministic initials fallback. */\nexport const PersonAvatar = Schema.TaggedUnion({\n initials: {\n text: Initials\n },\n reference: {\n reference: AvatarReferenceValue\n }\n})\n\n/** Decoded person avatar representation. */\nexport type PersonAvatar = typeof PersonAvatar.Type\n\n/**\n * Derives a stable one- or two-token initials fallback from a display name.\n * The first code point of the first and last non-empty tokens is used.\n */\nexport const derivePersonInitials = (displayName: string): string => {\n const tokens = displayName.trim().split(/\\s+/u).filter(Boolean)\n const firstToken = tokens.at(0) ?? \"\"\n const lastToken = tokens.at(-1) ?? \"\"\n const firstInitial = Array.from(firstToken).at(0) ?? \"\"\n const lastInitial = tokens.length > 1 ? (Array.from(lastToken).at(0) ?? \"\") : \"\"\n return `${firstInitial}${lastInitial}`.toLocaleUpperCase(\"en-US\")\n}\n\nconst PersonSchema = Schema.Struct({\n avatar: PersonAvatar,\n displayName: DisplayName,\n isActive: Schema.Boolean,\n personId: PersonId,\n sourceIdentities: Schema.Array(PersonSourceIdentity)\n}).check(\n Schema.makeFilter(\n ({ avatar, displayName }) => avatar._tag === \"reference\" || avatar.text === derivePersonInitials(displayName),\n { expected: \"initials avatar to match the deterministic display-name fallback\" }\n ),\n Schema.makeFilter(\n ({ sourceIdentities }) => {\n const identityKeys = sourceIdentities.map(\n ({ pluginConnectionId, providerId, vendorPersonId }) =>\n `${providerId}\\u0000${pluginConnectionId}\\u0000${vendorPersonId}`\n )\n return new Set(identityKeys).size === identityKeys.length\n },\n { expected: \"person source identities to be unique\" }\n )\n)\n\n/** Canonical person with provider identities and an accessible avatar fallback. */\nexport const Person = PersonSchema\n\n/** Decoded canonical person. */\nexport type Person = typeof Person.Type\n\n/** Human collaborator responsible for a domain action. */\nexport const HumanActor = Schema.TaggedStruct(\"human\", {\n personId: PersonId\n})\n\n/** Decoded human actor. */\nexport type HumanActor = typeof HumanActor.Type\n\n/** Automated agent responsible for a domain action. */\nexport const AgentActor = Schema.TaggedStruct(\"agent\", {\n agentId: AgentId\n})\n\n/** Decoded agent actor. */\nexport type AgentActor = typeof AgentActor.Type\n\n/** Human or agent responsible for a domain action. */\nexport const Actor = Schema.Union([HumanActor, AgentActor]).pipe(Schema.toTaggedUnion(\"_tag\"))\n\n/** Decoded human or agent actor. */\nexport type Actor = typeof Actor.Type\n\n/** Explicit collaboration role stored with an assignment. */\nexport const Role = Schema.Literals([\n \"workspace-owner\",\n \"workspace-approver\",\n \"release-owner\",\n \"release-approver\",\n \"change-owner\",\n \"issue-owner\",\n \"issue-assignee\",\n \"page-owner\",\n \"author\",\n \"contributor\",\n \"reviewer\",\n \"operator\",\n \"deployment-approver\",\n \"merge-approver\",\n \"watcher\"\n])\n\n/** Decoded collaboration role. */\nexport type Role = typeof Role.Type\n\n/** Exact domain scope to which a role assignment applies. */\nexport const RoleScope = Schema.TaggedUnion({\n entity: {\n entityId: EntityId,\n workspaceId: WorkspaceId\n },\n environment: {\n environmentId: EnvironmentId,\n releaseId: ReleaseId,\n workspaceId: WorkspaceId\n },\n release: {\n releaseId: ReleaseId,\n workspaceId: WorkspaceId\n },\n workspace: {\n workspaceId: WorkspaceId\n }\n})\n\n/** Decoded role-assignment scope. */\nexport type RoleScope = typeof RoleScope.Type\n\nconst ActiveAssignmentLifecycle = Schema.TaggedStruct(\"active\", {\n assignedAt: UtcTimestamp\n})\n\nconst EndedAssignmentLifecycle = Schema.TaggedStruct(\"ended\", {\n assignedAt: UtcTimestamp,\n endedAt: UtcTimestamp\n}).check(\n Schema.makeFilter(\n ({ assignedAt, endedAt }) => DateTime.Order(assignedAt, endedAt) <= 0,\n { expected: \"assignment end time to be at or after assignment time\" }\n )\n)\n\nconst RevokedAssignmentLifecycle = Schema.TaggedStruct(\"revoked\", {\n assignedAt: UtcTimestamp,\n revokedAt: UtcTimestamp\n}).check(\n Schema.makeFilter(\n ({ assignedAt, revokedAt }) => DateTime.Order(assignedAt, revokedAt) <= 0,\n { expected: \"assignment revocation time to be at or after assignment time\" }\n )\n)\n\n/** Lifecycle and chronological bounds of a role assignment. */\nexport const AssignmentLifecycle = Schema.Union([\n ActiveAssignmentLifecycle,\n EndedAssignmentLifecycle,\n RevokedAssignmentLifecycle\n]).pipe(Schema.toTaggedUnion(\"_tag\"))\n\n/** Decoded assignment lifecycle. */\nexport type AssignmentLifecycle = typeof AssignmentLifecycle.Type\n\n/** Persisted binding of a human or agent role to one exact domain scope. */\nexport const RoleAssignment = Schema.Struct({\n actor: Actor,\n assignmentId: RoleAssignmentId,\n lifecycle: AssignmentLifecycle,\n role: Role,\n scope: RoleScope\n})\n\n/** Decoded role assignment. */\nexport type RoleAssignment = typeof RoleAssignment.Type\n","import { Schema } from \"effect\"\nimport type { ReleaseId } from \"./identifiers.js\"\n\n/** Canonical persisted algorithm label for the current Release Relay projection. */\nexport const RELEASE_RELAY_ALGORITHM = \"relay/v1\"\n\n/** Explicit v1 alias retained beside the versioned catalog constants. */\nexport const RELEASE_RELAY_V1_ALGORITHM = RELEASE_RELAY_ALGORITHM\n\ntype RelayCatalog = readonly [\n string,\n string,\n string,\n string,\n string,\n string,\n string,\n string,\n string,\n string,\n string,\n string,\n string,\n string,\n string,\n string\n]\n\nconst freezeCatalog = <const Catalog extends RelayCatalog>(catalog: Catalog): Readonly<Catalog> =>\n Object.freeze(catalog)\n\n/** Frozen adjective catalog whose order is part of the relay/v1 contract. */\nexport const RELEASE_RELAY_V1_ADJECTIVES = freezeCatalog([\n \"Amber\",\n \"Azure\",\n \"Copper\",\n \"Ember\",\n \"Golden\",\n \"Lunar\",\n \"Moss\",\n \"Nova\",\n \"Quiet\",\n \"Silver\",\n \"Solar\",\n \"Tidal\",\n \"Velvet\",\n \"Verdant\",\n \"Wild\",\n \"Winter\"\n])\n\n/** Frozen noun catalog whose order is part of the relay/v1 contract. */\nexport const RELEASE_RELAY_V1_NOUNS = freezeCatalog([\n \"Anchor\",\n \"Beacon\",\n \"Bridge\",\n \"Comet\",\n \"Finch\",\n \"Fork\",\n \"Gate\",\n \"Grove\",\n \"Harbor\",\n \"Orbit\",\n \"Pulse\",\n \"Reef\",\n \"Relay\",\n \"Spark\",\n \"Wave\",\n \"Willow\"\n])\n\n/** Schema for the relay/v1 algorithm discriminator. */\nexport const ReleaseRelayAlgorithm = Schema.Literal(RELEASE_RELAY_ALGORITHM)\n\n/** Persisted relay/v1 adjective. */\nexport const ReleaseRelayAdjective = Schema.Literals(RELEASE_RELAY_V1_ADJECTIVES)\n\n/** Persisted relay/v1 noun. */\nexport const ReleaseRelayNoun = Schema.Literals(RELEASE_RELAY_V1_NOUNS)\n\n/** Persisted relay/v1 codename assembled from the frozen catalogs. */\nexport const ReleaseRelayCodename = Schema.TemplateLiteral([ReleaseRelayAdjective, \" \", ReleaseRelayNoun])\n\n/** Closed index into rly's separately versioned 16-symbol presentation catalog. */\nexport const ReleaseRelaySymbolIndex = Schema.Literals([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])\n\n/** Decoded relay/v1 symbol index. */\nexport type ReleaseRelaySymbolIndex = typeof ReleaseRelaySymbolIndex.Type\n\n/** Exactly three distinct persisted indices into the release-symbol catalog. */\nexport const ReleaseRelaySymbolIndices = Schema.Tuple([\n ReleaseRelaySymbolIndex,\n ReleaseRelaySymbolIndex,\n ReleaseRelaySymbolIndex\n]).check(Schema.isUnique({ expected: \"three distinct release symbol indices\" }))\n\n/** Decoded three-symbol relay projection. */\nexport type ReleaseRelaySymbolIndices = typeof ReleaseRelaySymbolIndices.Type\n\n/** Versioned, persisted Release Relay identity owned by the Control Center domain. */\nexport const ReleaseRelayProjection = Schema.Struct({\n algorithm: ReleaseRelayAlgorithm,\n codename: ReleaseRelayCodename,\n symbolIndices: ReleaseRelaySymbolIndices\n})\n\n/** Decoded versioned Release Relay projection. */\nexport type ReleaseRelayProjection = typeof ReleaseRelayProjection.Type\n\nconst FNV_1A_OFFSET_BASIS = 0x81_1c_9d_c5\nconst FNV_1A_PRIME = 0x01_00_01_93\n\nconst fnv1a32 = (asciiValue: string): number => {\n let hash = FNV_1A_OFFSET_BASIS\n for (let index = 0; index < asciiValue.length; index += 1) {\n hash ^= asciiValue.charCodeAt(index)\n hash = Math.imul(hash, FNV_1A_PRIME) >>> 0\n }\n return hash\n}\n\nconst symbolIndexFromRemainder = (remainder: number): ReleaseRelaySymbolIndex => {\n switch (remainder) {\n case 0:\n return 0\n case 1:\n return 1\n case 2:\n return 2\n case 3:\n return 3\n case 4:\n return 4\n case 5:\n return 5\n case 6:\n return 6\n case 7:\n return 7\n case 8:\n return 8\n case 9:\n return 9\n case 10:\n return 10\n case 11:\n return 11\n case 12:\n return 12\n case 13:\n return 13\n case 14:\n return 14\n default:\n return 15\n }\n}\n\nconst catalogValueAt = <const Catalog extends RelayCatalog>(\n catalog: Catalog,\n index: ReleaseRelaySymbolIndex\n): Catalog[number] => {\n switch (index) {\n case 0:\n return catalog[0]\n case 1:\n return catalog[1]\n case 2:\n return catalog[2]\n case 3:\n return catalog[3]\n case 4:\n return catalog[4]\n case 5:\n return catalog[5]\n case 6:\n return catalog[6]\n case 7:\n return catalog[7]\n case 8:\n return catalog[8]\n case 9:\n return catalog[9]\n case 10:\n return catalog[10]\n case 11:\n return catalog[11]\n case 12:\n return catalog[12]\n case 13:\n return catalog[13]\n case 14:\n return catalog[14]\n default:\n return catalog[15]\n }\n}\n\nconst deriveSymbolIndices = (releaseId: ReleaseId): ReleaseRelaySymbolIndices => {\n const firstIndex = symbolIndexFromRemainder(fnv1a32(`${RELEASE_RELAY_ALGORITHM}|symbol/0|${releaseId}`) % 16)\n\n const secondRank = fnv1a32(`${RELEASE_RELAY_ALGORITHM}|symbol/1|${releaseId}`) % 15\n const secondIndex = symbolIndexFromRemainder(secondRank < firstIndex ? secondRank : secondRank + 1)\n\n const lowerExcludedIndex = Math.min(firstIndex, secondIndex)\n const upperExcludedIndex = Math.max(firstIndex, secondIndex)\n const thirdRank = fnv1a32(`${RELEASE_RELAY_ALGORITHM}|symbol/2|${releaseId}`) % 14\n const thirdIndex = symbolIndexFromRemainder(\n thirdRank < lowerExcludedIndex ? thirdRank : thirdRank < upperExcludedIndex - 1 ? thirdRank + 1 : thirdRank + 2\n )\n\n return [firstIndex, secondIndex, thirdIndex]\n}\n\n/**\n * Derive the stable relay/v1 projection for one canonical immutable release identifier.\n *\n * relay/v1 applies unsigned 32-bit FNV-1a to the ASCII domains\n * `relay/v1|adjective|<release-id>`, `relay/v1|noun|<release-id>`, and\n * `relay/v1|symbol/<position>|<release-id>`. Symbol hashes select ranks from the\n * remaining 16, 15, then 14 indices, making distinctness constructive.\n */\nexport const deriveReleaseRelay = (releaseId: ReleaseId): ReleaseRelayProjection => {\n const adjectiveIndex = symbolIndexFromRemainder(fnv1a32(`${RELEASE_RELAY_ALGORITHM}|adjective|${releaseId}`) % 16)\n const nounIndex = symbolIndexFromRemainder(fnv1a32(`${RELEASE_RELAY_ALGORITHM}|noun|${releaseId}`) % 16)\n const adjective = catalogValueAt(RELEASE_RELAY_V1_ADJECTIVES, adjectiveIndex)\n const noun = catalogValueAt(RELEASE_RELAY_V1_NOUNS, nounIndex)\n\n return {\n algorithm: RELEASE_RELAY_ALGORITHM,\n codename: `${adjective} ${noun}`,\n symbolIndices: deriveSymbolIndices(releaseId)\n }\n}\n","import * as DateTime from \"effect/DateTime\"\nimport * as Schema from \"effect/Schema\"\nimport { RoleAssignment } from \"./actors.js\"\nimport { Freshness } from \"./freshness.js\"\nimport { EnvironmentId, ReleaseId, WorkspaceId } from \"./identifiers.js\"\nimport { deriveReleaseRelay, ReleaseRelayProjection } from \"./releaseRelay.js\"\nimport { SourceRevision } from \"./sourceRevision.js\"\nimport { UtcTimestamp } from \"./utcTimestamp.js\"\n\n/** Human-readable service name retained independently of provider identity. */\nexport const ReleaseServiceName = Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(200)\n).pipe(Schema.brand(\"ReleaseServiceName\"))\n\n/** Decoded release service name. */\nexport type ReleaseServiceName = typeof ReleaseServiceName.Type\n\n/** Provider-neutral release version or immutable release label. */\nexport const ReleaseVersion = Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(100)\n).pipe(Schema.brand(\"ReleaseVersion\"))\n\n/** Decoded release version. */\nexport type ReleaseVersion = typeof ReleaseVersion.Type\n\n/** Lifecycle of the release aggregate, separate from readiness and pipeline state. */\nexport const ReleaseLifecycle = Schema.Literals([\n \"assembling\",\n \"candidate\",\n \"deploying\",\n \"released\",\n \"cancelled\"\n])\n\n/** Decoded release lifecycle. */\nexport type ReleaseLifecycle = typeof ReleaseLifecycle.Type\n\nconst ReleaseRecord = Schema.Struct({\n createdAt: UtcTimestamp,\n freshness: Freshness,\n id: ReleaseId,\n lifecycle: ReleaseLifecycle,\n relay: ReleaseRelayProjection,\n roleAssignments: Schema.Array(RoleAssignment),\n serviceName: ReleaseServiceName,\n sourceRevisions: Schema.Array(SourceRevision),\n targetEnvironmentIds: Schema.Array(EnvironmentId).check(\n Schema.isUnique({ expected: \"unique target environment identifiers\" })\n ),\n updatedAt: UtcTimestamp,\n version: ReleaseVersion,\n workspaceId: WorkspaceId\n})\n\nconst encodeSourceRevision = Schema.encodeSync(SourceRevision)\nconst sourceRevisionEquivalence = Schema.toEquivalence(Schema.toEncoded(SourceRevision))\n\n/**\n * Foundational release aggregate. Readiness, evidence, stages, and delivery\n * relationships extend this record in their owning slices.\n */\nexport const Release = ReleaseRecord.check(\n Schema.makeFilter(\n ({ createdAt, updatedAt }) => DateTime.Order(createdAt, updatedAt) <= 0,\n { expected: \"release update time to be at or after creation time\" }\n ),\n Schema.makeFilter(\n ({ roleAssignments, workspaceId }) => roleAssignments.every(({ scope }) => scope.workspaceId === workspaceId),\n { expected: \"every role assignment to belong to the release workspace\" }\n ),\n Schema.makeFilter(\n ({ id, roleAssignments }) =>\n roleAssignments.every(({ scope }) =>\n scope._tag === \"release\" || scope._tag === \"environment\" ? scope.releaseId === id : true\n ),\n { expected: \"release-scoped assignments to name this release\" }\n ),\n Schema.makeFilter(\n ({ roleAssignments, targetEnvironmentIds }) => {\n const targets = new Set(targetEnvironmentIds)\n return roleAssignments.every(({ scope }) =>\n scope._tag === \"environment\" ? targets.has(scope.environmentId) : true\n )\n },\n { expected: \"environment-scoped assignments to name a release target\" }\n ),\n Schema.makeFilter(\n ({ roleAssignments }) => {\n const assignmentIds = roleAssignments.map(({ assignmentId }) => assignmentId)\n return new Set(assignmentIds).size === assignmentIds.length\n },\n { expected: \"unique role assignment identifiers\" }\n ),\n Schema.makeFilter(\n ({ sourceRevisions }) => {\n const sourceKeys = sourceRevisions.map(\n ({ pluginConnectionId, providerId, vendorImmutableId }) =>\n `${providerId}\\u0000${pluginConnectionId}\\u0000${vendorImmutableId}`\n )\n return new Set(sourceKeys).size === sourceKeys.length\n },\n { expected: \"one current source revision per provider object\" }\n ),\n Schema.makeFilter(\n ({ freshness, sourceRevisions }) => {\n if (freshness._tag !== \"current\" && freshness._tag !== \"stale\") return true\n const freshnessRevision = encodeSourceRevision(freshness.provenance.sourceRevision)\n return (\n sourceRevisions.filter((sourceRevision) =>\n sourceRevisionEquivalence(encodeSourceRevision(sourceRevision), freshnessRevision)\n ).length === 1\n )\n },\n { expected: \"current or stale freshness provenance to match one release source revision\" }\n ),\n Schema.makeFilter(\n ({ id, relay }) => {\n const expected = deriveReleaseRelay(id)\n return (\n relay.algorithm === expected.algorithm &&\n relay.codename === expected.codename &&\n relay.symbolIndices.every((symbolIndex, index) => symbolIndex === expected.symbolIndices[index])\n )\n },\n { expected: \"persisted relay projection to match the canonical release identifier\" }\n )\n).annotate({ identifier: \"Release\" })\n\n/** Decoded foundational release aggregate. */\nexport type Release = typeof Release.Type\n","import * as Schema from \"effect/Schema\"\n\nimport { hasMaximumPluginJsonBytes, MaximumPluginDescriptorBytes } from \"./bounds.js\"\n\nconst NonNegativeInteger = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))\nconst PositiveInteger = Schema.Int.check(Schema.isGreaterThan(0))\n\nconst boundedIdentifier = (name: string, maximum: number) =>\n Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(maximum)\n ).pipe(Schema.brand(name))\n\n/** Stable reverse-DNS identity of a plugin, independent of package abbreviations. */\nexport const PluginId = boundedIdentifier(\"PluginId\", 200)\n\n/** Decoded stable plugin identity. */\nexport type PluginId = typeof PluginId.Type\n\n/** Strict structured semantic version used by plugin and adapter contracts. */\nexport const SemanticVersion = Schema.Struct({\n major: NonNegativeInteger,\n minor: NonNegativeInteger,\n patch: NonNegativeInteger\n}).annotate({ identifier: \"SemanticVersion\" })\n\n/** Decoded semantic version. */\nexport type SemanticVersion = typeof SemanticVersion.Type\n\n/** Independently versioned operations understood by the Control Center host. */\nexport const PluginCapabilityId = Schema.Literals([\n \"entity.read\",\n \"sync.incremental\",\n \"action.propose\",\n \"action.execute\",\n \"action.cancel\",\n \"action.reconcile\",\n \"diff.inventory\",\n \"diff.content\"\n]).annotate({ identifier: \"PluginCapabilityId\" })\n\n/** Decoded plugin capability identity. */\nexport type PluginCapabilityId = typeof PluginCapabilityId.Type\n\n/** A capability and the contract versions an adapter can implement. */\nexport const PluginCapabilityOfferV1 = Schema.Struct({\n capabilityId: PluginCapabilityId,\n supportedVersions: Schema.Array(PositiveInteger).check(\n Schema.isNonEmpty(),\n Schema.isUnique(),\n Schema.makeFilter((versions) => versions.length <= 16, {\n expected: \"at most 16 supported capability versions\"\n })\n ),\n requirement: Schema.Literals([\"required\", \"optional\"])\n}).annotate({ identifier: \"PluginCapabilityOfferV1\" })\n\n/** Decoded capability offer. */\nexport type PluginCapabilityOfferV1 = typeof PluginCapabilityOfferV1.Type\n\nconst ConfigurationKey = boundedIdentifier(\"PluginConfigurationKey\", 100)\nconst ConfigurationLabel = Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(200)\n)\nconst ConfigurationDescription = Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(500)\n)\n\nconst commonConfigurationFields = {\n key: ConfigurationKey,\n label: ConfigurationLabel,\n description: ConfigurationDescription,\n required: Schema.Boolean\n}\n\nconst TextConfigurationField = Schema.TaggedStruct(\"text\", commonConfigurationFields)\nconst UrlConfigurationField = Schema.TaggedStruct(\"url\", commonConfigurationFields)\nconst BooleanConfigurationField = Schema.TaggedStruct(\"boolean\", commonConfigurationFields)\nconst IntegerConfigurationField = Schema.TaggedStruct(\"integer\", {\n ...commonConfigurationFields,\n minimum: Schema.NullOr(Schema.Int),\n maximum: Schema.NullOr(Schema.Int)\n}).check(\n Schema.makeFilter(\n ({ maximum, minimum }) => maximum === null || minimum === null || minimum <= maximum,\n { expected: \"plugin integer configuration minimum not to exceed maximum\" }\n )\n)\nconst SelectConfigurationField = Schema.TaggedStruct(\"select\", {\n ...commonConfigurationFields,\n options: Schema.Array(Schema.Struct({\n label: ConfigurationLabel,\n value: boundedIdentifier(\"PluginConfigurationOption\", 200)\n })).check(\n Schema.isNonEmpty(),\n Schema.makeFilter((options) => options.length <= 100, {\n expected: \"at most 100 plugin configuration options\"\n }),\n Schema.makeFilter(\n (options) => new Set(options.map(({ value }) => value)).size === options.length,\n { expected: \"unique plugin configuration option values\" }\n )\n )\n})\nconst SecretReferenceConfigurationField = Schema.TaggedStruct(\"secret-reference\", {\n ...commonConfigurationFields,\n secretKind: Schema.Literals([\"token\", \"password\", \"private-key\", \"certificate\", \"opaque\"])\n})\n\n/** Secret-free metadata describing a plugin configuration field. */\nexport const PluginConfigurationFieldV1 = Schema.Union([\n TextConfigurationField,\n UrlConfigurationField,\n BooleanConfigurationField,\n IntegerConfigurationField,\n SelectConfigurationField,\n SecretReferenceConfigurationField\n]).pipe(Schema.toTaggedUnion(\"_tag\"))\n\n/** Decoded plugin configuration metadata. */\nexport type PluginConfigurationFieldV1 = typeof PluginConfigurationFieldV1.Type\n\n/** Raw version-one descriptor decoded before an adapter factory may run. */\nexport const PluginDescriptorV1 = Schema.Struct({\n contractId: Schema.Literal(\"dev.knpkv.control-center.plugin\"),\n contractVersion: SemanticVersion,\n pluginId: PluginId,\n adapterVersion: SemanticVersion,\n displayName: Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(200)\n ),\n configurationFields: Schema.Array(PluginConfigurationFieldV1).check(\n Schema.makeFilter((fields) => fields.length <= 100, {\n expected: \"at most 100 plugin configuration fields\"\n }),\n Schema.makeFilter(\n (fields) => new Set(fields.map(({ key }) => key)).size === fields.length,\n { expected: \"unique plugin configuration field keys\" }\n )\n ),\n capabilities: Schema.Array(PluginCapabilityOfferV1).check(\n Schema.isNonEmpty(),\n Schema.makeFilter((capabilities) => capabilities.length <= 32, {\n expected: \"at most 32 plugin capability offers\"\n })\n )\n}).check(\n hasMaximumPluginJsonBytes(MaximumPluginDescriptorBytes)\n).annotate({ identifier: \"PluginDescriptorV1\" })\n\n/** Decoded version-one plugin descriptor. */\nexport type PluginDescriptorV1 = typeof PluginDescriptorV1.Type\n\n/** One capability version selected by the host during negotiation. */\nexport const NegotiatedPluginCapabilityV1 = Schema.Struct({\n capabilityId: PluginCapabilityId,\n version: PositiveInteger\n}).annotate({ identifier: \"NegotiatedPluginCapabilityV1\" })\n\n/** Decoded negotiated capability. */\nexport type NegotiatedPluginCapabilityV1 = typeof NegotiatedPluginCapabilityV1.Type\n\n/** Descriptor accepted by the host after contract and capability negotiation. */\nexport const NegotiatedPluginDescriptorV1 = Schema.Struct({\n descriptor: PluginDescriptorV1,\n capabilities: Schema.Array(NegotiatedPluginCapabilityV1).check(\n Schema.isNonEmpty(),\n Schema.makeFilter((capabilities) => capabilities.length <= 32, {\n expected: \"at most 32 negotiated plugin capabilities\"\n }),\n Schema.makeFilter(\n (capabilities) => new Set(capabilities.map(({ capabilityId }) => capabilityId)).size === capabilities.length,\n { expected: \"unique negotiated plugin capabilities\" }\n )\n )\n}).annotate({ identifier: \"NegotiatedPluginDescriptorV1\" })\n\n/** Decoded negotiated plugin descriptor. */\nexport type NegotiatedPluginDescriptorV1 = typeof NegotiatedPluginDescriptorV1.Type\n","import * as Result from \"effect/Result\"\nimport * as Schema from \"effect/Schema\"\n\nimport { SourceUrl } from \"./sourceRevision.js\"\n\nconst boundedText = (maximum: number, identifier: string) =>\n Schema.String.check(Schema.isMaxLength(maximum)).annotate({ identifier })\n\nconst boundedNonEmptyText = (maximum: number, identifier: string) =>\n boundedText(maximum, identifier).check(Schema.isTrimmed(), Schema.isNonEmpty())\n\nconst boundedArray = <T, E, RD, RE>(schema: Schema.Codec<T, E, RD, RE>, maximum: number) =>\n Schema.Array(schema).check(Schema.isMaxLength(maximum))\n\nexport const MAXIMUM_NORMALIZED_ISSUE_LABELS = 200\nexport const MAXIMUM_NORMALIZED_ISSUE_COMPONENTS = 100\n// One issue, its activity evidence, 200 people, and three events per fix version must fit one 500-event page.\nexport const MAXIMUM_NORMALIZED_ISSUE_FIX_VERSIONS = 99\nexport const MAXIMUM_NORMALIZED_ISSUE_SUBTASKS = 200\nexport const MAXIMUM_NORMALIZED_ISSUE_COLLABORATORS = 200\nexport const MAXIMUM_NORMALIZED_ISSUE_COMMENTS = 200\nexport const MAXIMUM_NORMALIZED_ISSUE_HISTORY = 200\nexport const MAXIMUM_NORMALIZED_ISSUE_HISTORY_CHANGES = 100\n\nconst SourceObjectId = boundedNonEmptyText(512, \"NormalizedIssueSourceObjectId\")\nconst SourcePersonId = boundedNonEmptyText(512, \"NormalizedIssueSourcePersonId\")\nconst ShortText = boundedText(255, \"NormalizedIssueShortText\")\nconst RichText = boundedText(16_000, \"NormalizedIssueRichText\")\nconst TimestampText = boundedNonEmptyText(100, \"NormalizedIssueTimestamp\")\nconst AvatarUrl = boundedNonEmptyText(2_048, \"NormalizedIssueAvatarUrl\").check(\n Schema.makeFilter((value) => Result.isSuccess(Schema.decodeUnknownResult(SourceUrl)(value)), {\n expected: \"an HTTP(S) source URL without embedded credentials\"\n })\n)\n\n/** Provider-neutral named source object retained with a bounded source identity. */\nexport const NormalizedIssueNamedValue = Schema.Struct({\n sourceId: Schema.NullOr(SourceObjectId),\n name: Schema.NullOr(ShortText)\n}).annotate({ identifier: \"NormalizedIssueNamedValue\" })\n\n/** Provider-neutral project identity and presentation retained from an issue source. */\nexport const NormalizedIssueProject = Schema.Struct({\n sourceId: Schema.NullOr(SourceObjectId),\n key: Schema.NullOr(boundedNonEmptyText(100, \"NormalizedIssueProjectKey\")),\n name: Schema.NullOr(ShortText)\n}).annotate({ identifier: \"NormalizedIssueProject\" })\n\n/** Provider-neutral release/version reference retained from an issue source. */\nexport const NormalizedIssueFixVersion = Schema.Struct({\n sourceId: Schema.NullOr(SourceObjectId),\n name: Schema.NullOr(ShortText),\n released: Schema.Boolean,\n releaseDate: Schema.NullOr(TimestampText)\n}).annotate({ identifier: \"NormalizedIssueFixVersion\" })\n\n/** Provider-neutral parent or subtask reference retained from an issue source. */\nexport const NormalizedRelatedIssue = Schema.Struct({\n sourceId: Schema.NullOr(SourceObjectId),\n key: Schema.NullOr(boundedNonEmptyText(100, \"NormalizedRelatedIssueKey\")),\n summary: Schema.NullOr(boundedText(500, \"NormalizedRelatedIssueSummary\")),\n status: Schema.NullOr(NormalizedIssueNamedValue)\n}).annotate({ identifier: \"NormalizedRelatedIssue\" })\n\n/** Bounded source collaborator used for attribution without provider response types. */\nexport const NormalizedIssueCollaborator = Schema.Struct({\n sourcePersonId: SourcePersonId,\n displayName: boundedNonEmptyText(200, \"NormalizedIssueCollaboratorDisplayName\"),\n avatarUrl: Schema.NullOr(AvatarUrl),\n active: Schema.Boolean,\n roles: boundedArray(boundedNonEmptyText(100, \"NormalizedIssueCollaboratorRole\"), 16).check(Schema.isUnique())\n}).annotate({ identifier: \"NormalizedIssueCollaborator\" })\n\n/** Bounded provider-neutral issue comment. */\nexport const NormalizedIssueComment = Schema.Struct({\n sourceId: SourceObjectId,\n authorSourcePersonId: Schema.NullOr(SourcePersonId),\n updateAuthorSourcePersonId: Schema.NullOr(SourcePersonId),\n body: Schema.NullOr(RichText),\n createdAt: Schema.NullOr(TimestampText),\n updatedAt: Schema.NullOr(TimestampText)\n}).annotate({ identifier: \"NormalizedIssueComment\" })\n\n/** One bounded provider-neutral field transition. */\nexport const NormalizedIssueHistoryChange = Schema.Struct({\n field: boundedNonEmptyText(255, \"NormalizedIssueHistoryField\"),\n from: Schema.NullOr(boundedText(1_000, \"NormalizedIssueHistoryValue\")),\n to: Schema.NullOr(boundedText(1_000, \"NormalizedIssueHistoryValue\"))\n}).annotate({ identifier: \"NormalizedIssueHistoryChange\" })\n\n/** Bounded provider-neutral issue history entry. */\nexport const NormalizedIssueHistoryEntry = Schema.Struct({\n sourceId: SourceObjectId,\n authorSourcePersonId: Schema.NullOr(SourcePersonId),\n createdAt: Schema.NullOr(TimestampText),\n changes: boundedArray(NormalizedIssueHistoryChange, MAXIMUM_NORMALIZED_ISSUE_HISTORY_CHANGES)\n}).annotate({ identifier: \"NormalizedIssueHistoryEntry\" })\n\n/** Fields whose source material may be deliberately reduced to remain within synchronization bounds. */\nexport const NormalizedIssueTruncatedField = Schema.Literals([\n \"acceptanceCriteria\",\n \"collaborators\",\n \"comments\",\n \"components\",\n \"description\",\n \"environment\",\n \"fixVersions\",\n \"history\",\n \"issueType\",\n \"key\",\n \"labels\",\n \"parent\",\n \"priority\",\n \"project\",\n \"resolution\",\n \"summary\",\n \"status\",\n \"subtasks\",\n \"updatedAt\",\n \"createdAt\",\n \"dueDate\",\n \"resolvedAt\"\n])\n\n/**\n * Shared provider-neutral issue detail accepted from normalized plugins.\n *\n * The original compact key/status/priority/estimate fields remain required.\n * Rich fields are optional so older normalized plugins and persisted projections\n * remain valid; first-party Jira synchronization always supplies every rich field.\n */\nexport const NormalizedIssueAttributes = Schema.Struct({\n key: boundedNonEmptyText(100, \"NormalizedIssueKey\"),\n status: boundedNonEmptyText(100, \"NormalizedIssueStatus\"),\n priority: Schema.NullOr(boundedNonEmptyText(100, \"NormalizedIssuePriority\")),\n estimatePoints: Schema.NullOr(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))),\n summary: Schema.optionalKey(boundedText(500, \"NormalizedIssueSummary\")),\n description: Schema.optionalKey(Schema.NullOr(RichText)),\n acceptanceCriteria: Schema.optionalKey(Schema.NullOr(RichText)),\n environment: Schema.optionalKey(Schema.NullOr(RichText)),\n issueType: Schema.optionalKey(Schema.NullOr(NormalizedIssueNamedValue)),\n project: Schema.optionalKey(Schema.NullOr(NormalizedIssueProject)),\n resolution: Schema.optionalKey(Schema.NullOr(NormalizedIssueNamedValue)),\n labels: Schema.optionalKey(\n boundedArray(boundedNonEmptyText(255, \"NormalizedIssueLabel\"), MAXIMUM_NORMALIZED_ISSUE_LABELS)\n ),\n components: Schema.optionalKey(boundedArray(NormalizedIssueNamedValue, MAXIMUM_NORMALIZED_ISSUE_COMPONENTS)),\n fixVersions: Schema.optionalKey(boundedArray(NormalizedIssueFixVersion, MAXIMUM_NORMALIZED_ISSUE_FIX_VERSIONS)),\n createdAt: Schema.optionalKey(Schema.NullOr(TimestampText)),\n updatedAt: Schema.optionalKey(Schema.NullOr(TimestampText)),\n dueDate: Schema.optionalKey(Schema.NullOr(TimestampText)),\n resolvedAt: Schema.optionalKey(Schema.NullOr(TimestampText)),\n parent: Schema.optionalKey(Schema.NullOr(NormalizedRelatedIssue)),\n subtasks: Schema.optionalKey(boundedArray(NormalizedRelatedIssue, MAXIMUM_NORMALIZED_ISSUE_SUBTASKS)),\n assigneeSourcePersonId: Schema.optionalKey(Schema.NullOr(SourcePersonId)),\n reporterSourcePersonId: Schema.optionalKey(Schema.NullOr(SourcePersonId)),\n creatorSourcePersonId: Schema.optionalKey(Schema.NullOr(SourcePersonId)),\n collaborators: Schema.optionalKey(boundedArray(NormalizedIssueCollaborator, MAXIMUM_NORMALIZED_ISSUE_COLLABORATORS)),\n comments: Schema.optionalKey(boundedArray(NormalizedIssueComment, MAXIMUM_NORMALIZED_ISSUE_COMMENTS)),\n commentTotal: Schema.optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n commentsTruncated: Schema.optionalKey(Schema.Boolean),\n commentBodiesTruncated: Schema.optionalKey(Schema.Boolean),\n history: Schema.optionalKey(boundedArray(NormalizedIssueHistoryEntry, MAXIMUM_NORMALIZED_ISSUE_HISTORY)),\n historyTotal: Schema.optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n historyTruncated: Schema.optionalKey(Schema.Boolean),\n truncatedFields: Schema.optionalKey(boundedArray(NormalizedIssueTruncatedField, 32).check(Schema.isUnique()))\n}).annotate({ identifier: \"NormalizedIssueAttributes\" })\n\n/** Decoded provider-neutral normalized issue detail. */\nexport type NormalizedIssueAttributes = typeof NormalizedIssueAttributes.Type\n","import * as DateTime from \"effect/DateTime\"\nimport * as Schema from \"effect/Schema\"\n\nimport { Freshness } from \"./freshness.js\"\nimport {\n AgentId,\n EntityId,\n EnvironmentId,\n EvidenceClaimId,\n EvidenceId,\n GraphNodeId,\n PersonId,\n PluginConnectionId,\n RelationshipId,\n ReleaseId,\n WorkspaceId\n} from \"./identifiers.js\"\nimport { NormalizedIssueAttributes } from \"./normalizedIssue.js\"\nimport { UtcTimestamp } from \"./utcTimestamp.js\"\n\nconst boundedText = (maximum: number, identifier: string) =>\n Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(maximum)\n ).annotate({ identifier })\n\n/** Provider-neutral kind of an object participating in delivery. */\nexport const DeliveryEntityKind = Schema.Literals([\n \"issue\",\n \"pull-request\",\n \"page\",\n \"pipeline-execution\",\n \"deployment\",\n \"time-entry\"\n])\n\n/** Decoded normalized entity kind. */\nexport type DeliveryEntityKind = typeof DeliveryEntityKind.Type\n\n/** Connected service responsible for a normalized delivery entity. */\nexport const DeliveryEntityService = Schema.Literals([\n \"jira\",\n \"codecommit\",\n \"confluence\",\n \"codepipeline\",\n \"clockify\"\n])\n\n/** Decoded connected delivery service. */\nexport type DeliveryEntityService = typeof DeliveryEntityService.Type\n\n/** Coarse cross-provider lifecycle used by workspace item search. */\nexport const DeliveryEntityStatusGroup = Schema.Literals([\"active\", \"done\", \"failed\"])\n\n/** Decoded cross-provider lifecycle group. */\nexport type DeliveryEntityStatusGroup = typeof DeliveryEntityStatusGroup.Type\n\n/** Canonical semantic kind recorded for either endpoint of a relationship. */\nexport const RelationshipEndpointKind = Schema.Union([\n DeliveryEntityKind,\n Schema.Literals([\"release\", \"environment\"])\n])\n\n/** Decoded semantic relationship endpoint kind. */\nexport type RelationshipEndpointKind = typeof RelationshipEndpointKind.Type\n\n/** Positive immutable revision of a normalized entity or relationship. */\nexport const LedgerRevision = Schema.Int.check(Schema.isGreaterThan(0)).pipe(\n Schema.brand(\"LedgerRevision\")\n)\n\n/** Decoded ledger revision. */\nexport type LedgerRevision = typeof LedgerRevision.Type\n\nconst IssueDetails = Schema.TaggedStruct(\"issue\", {\n ...NormalizedIssueAttributes.fields\n})\n\nconst PullRequestDetails = Schema.TaggedStruct(\"pull-request\", {\n repository: boundedText(200, \"RepositoryName\"),\n sourceBranch: boundedText(500, \"SourceBranch\"),\n targetBranch: boundedText(500, \"TargetBranch\"),\n headRevision: boundedText(512, \"HeadRevision\"),\n reviewState: Schema.Literals([\"not-requested\", \"requested\", \"changes-requested\", \"approved\", \"merged\"])\n})\n\nconst PageDetails = Schema.TaggedStruct(\"page\", {\n spaceKey: boundedText(100, \"SpaceKey\"),\n revision: boundedText(512, \"PageRevision\"),\n status: Schema.Literals([\"draft\", \"current\", \"superseded\"]),\n linkedIssueKeys: Schema.optional(\n Schema.Array(boundedText(100, \"LinkedIssueKey\")).check(Schema.isUnique(), Schema.isMaxLength(100))\n ),\n linkedReleaseVersions: Schema.optional(\n Schema.Array(boundedText(100, \"LinkedReleaseVersion\")).check(Schema.isUnique(), Schema.isMaxLength(100))\n )\n})\n\nconst PipelineDetails = Schema.TaggedStruct(\"pipeline-execution\", {\n pipelineName: boundedText(200, \"PipelineName\"),\n executionId: boundedText(512, \"PipelineExecutionId\"),\n status: Schema.Literals([\"queued\", \"running\", \"succeeded\", \"failed\", \"stopped\"]),\n triggerRevision: boundedText(512, \"PipelineTriggerRevision\")\n})\n\nconst DeploymentDetails = Schema.TaggedStruct(\"deployment\", {\n environmentId: EnvironmentId,\n revision: boundedText(512, \"DeploymentRevision\"),\n status: Schema.Literals([\"pending\", \"deploying\", \"succeeded\", \"failed\", \"rolled-back\"])\n})\n\nconst TimeEntryDetails = Schema.TaggedStruct(\"time-entry\", {\n durationMinutes: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n billable: Schema.Boolean,\n approvalState: Schema.Literals([\"pending\", \"approved\", \"rejected\", \"not-required\"])\n})\n\n/** Provider-neutral entity extension decoded before graph persistence. */\nexport const DeliveryEntityDetails = Schema.Union([\n IssueDetails,\n PullRequestDetails,\n PageDetails,\n PipelineDetails,\n DeploymentDetails,\n TimeEntryDetails\n]).pipe(Schema.toTaggedUnion(\"_tag\"))\n\n/** Decoded provider-neutral entity details. */\nexport type DeliveryEntityDetails = typeof DeliveryEntityDetails.Type\n\n/** Immutable normalized projection for one exact entity source revision. */\nexport const DeliveryEntityProjection = Schema.Struct({\n workspaceId: WorkspaceId,\n entityId: EntityId,\n projectionRevision: LedgerRevision,\n sourceEntityRevision: LedgerRevision,\n supersedesProjectionRevision: Schema.NullOr(LedgerRevision),\n projectionSchemaVersion: Schema.Int.check(Schema.isGreaterThan(0)),\n entityState: Schema.Literals([\"present\", \"deleted\"]),\n entityType: DeliveryEntityKind,\n displayKey: boundedText(200, \"EntityDisplayKey\"),\n title: boundedText(500, \"EntityTitle\"),\n details: DeliveryEntityDetails\n}).check(\n Schema.makeFilter(\n ({ details, entityType }) => details._tag === entityType,\n { expected: \"entity details whose tag matches the entity kind\" }\n ),\n Schema.makeFilter(\n ({ projectionRevision, supersedesProjectionRevision }) =>\n projectionRevision === 1\n ? supersedesProjectionRevision === null\n : supersedesProjectionRevision === projectionRevision - 1,\n { expected: \"entity projection to supersede its exact preceding revision\" }\n )\n)\n\n/** Decoded normalized entity projection. */\nexport type DeliveryEntityProjection = typeof DeliveryEntityProjection.Type\n\n/** Resolved graph target with an exact canonical object identity. */\nexport const ResolvedDeliveryNode = Schema.TaggedUnion({\n entity: { entityId: EntityId, entityKind: DeliveryEntityKind },\n environment: { environmentId: EnvironmentId, releaseId: ReleaseId },\n release: { releaseId: ReleaseId }\n})\n\n/** Resolved or intentionally missing node stored as trusted graph state. */\nexport const DeliveryNode = Schema.Struct({\n workspaceId: WorkspaceId,\n nodeId: GraphNodeId,\n endpointKind: RelationshipEndpointKind,\n resolution: Schema.TaggedUnion({\n resolved: { target: ResolvedDeliveryNode },\n missing: {\n expectedKind: Schema.Literals([\"entity\", \"release\", \"environment\"]),\n expectedEntityKind: Schema.NullOr(DeliveryEntityKind),\n missingKey: boundedText(512, \"MissingDeliveryNodeKey\")\n }\n }),\n createdAt: UtcTimestamp\n}).check(\n Schema.makeFilter(\n ({ resolution }) =>\n resolution._tag !== \"missing\" ||\n (resolution.expectedKind === \"entity\") === (resolution.expectedEntityKind !== null),\n { expected: \"only missing entity nodes to carry an expected entity kind\" }\n ),\n Schema.makeFilter(\n ({ endpointKind, resolution }) => {\n if (resolution._tag === \"missing\") {\n return resolution.expectedKind === \"entity\"\n ? endpointKind === resolution.expectedEntityKind\n : endpointKind === resolution.expectedKind\n }\n\n return resolution.target._tag === \"entity\"\n ? endpointKind === resolution.target.entityKind\n : endpointKind === resolution.target._tag\n },\n { expected: \"graph node endpoint kind to match its resolved or expected target kind\" }\n )\n)\n\n/** Decoded graph node. */\nexport type DeliveryNode = typeof DeliveryNode.Type\n\n/** Semantic relationship between delivery nodes. Direction is significant. */\nexport const RelationshipKind = Schema.Literals([\n \"contains\",\n \"implements\",\n \"depends-on\",\n \"verified-by\",\n \"delivered-by\",\n \"documented-by\",\n \"tracks-time-for\"\n])\n\n/** Decoded relationship kind. */\nexport type RelationshipKind = typeof RelationshipKind.Type\n\nconst ALL_RELATIONSHIP_ENDPOINT_KINDS: ReadonlyArray<RelationshipEndpointKind> = [\n \"issue\",\n \"pull-request\",\n \"page\",\n \"pipeline-execution\",\n \"deployment\",\n \"time-entry\",\n \"release\",\n \"environment\"\n]\n\nconst ALL_ENTITY_ENDPOINT_KINDS: ReadonlyArray<RelationshipEndpointKind> = [\n \"issue\",\n \"pull-request\",\n \"page\",\n \"pipeline-execution\",\n \"deployment\",\n \"time-entry\"\n]\n\ntype RelationshipEndpointRule = Readonly<{\n source: ReadonlyArray<RelationshipEndpointKind>\n target: ReadonlyArray<RelationshipEndpointKind>\n}>\n\n/**\n * Version-one canonical direction matrix. Passive relationship names read from\n * source to target: for example, a pull request is `delivered-by` a pipeline\n * execution. `depends-on` is intentionally the one generic graph edge.\n */\nexport const RELATIONSHIP_ENDPOINT_MATRIX_V1: Readonly<\n Record<RelationshipKind, RelationshipEndpointRule>\n> = {\n \"contains\": { source: [\"release\"], target: ALL_ENTITY_ENDPOINT_KINDS },\n \"implements\": { source: [\"pull-request\"], target: [\"issue\"] },\n \"depends-on\": {\n source: ALL_RELATIONSHIP_ENDPOINT_KINDS,\n target: ALL_RELATIONSHIP_ENDPOINT_KINDS\n },\n \"verified-by\": { source: [\"pull-request\"], target: [\"pipeline-execution\"] },\n \"delivered-by\": { source: [\"pull-request\"], target: [\"pipeline-execution\"] },\n \"documented-by\": { source: [\"issue\", \"release\"], target: [\"page\"] },\n \"tracks-time-for\": { source: [\"time-entry\"], target: [\"issue\"] }\n}\n\nconst relationshipEndpointIsAllowed = (\n kind: RelationshipKind,\n sourceNodeKind: RelationshipEndpointKind,\n targetNodeKind: RelationshipEndpointKind\n): boolean => {\n const rule: RelationshipEndpointRule = RELATIONSHIP_ENDPOINT_MATRIX_V1[kind]\n return rule.source.some((candidate) => candidate === sourceNodeKind) &&\n rule.target.some((candidate) => candidate === targetNodeKind)\n}\n\n/** Explainable confidence; inferred links can never masquerade as confirmed. */\nexport const RelationshipConfidence = Schema.TaggedUnion({\n unknown: { rationale: boundedText(1_000, \"UnknownRelationshipConfidenceRationale\") },\n confirmed: {},\n inferred: {\n score: Schema.Number.check(Schema.isBetween({ minimum: 0, maximum: 1 })),\n rationale: boundedText(1_000, \"RelationshipConfidenceRationale\")\n }\n})\n\n/** Decoded relationship confidence. */\nexport type RelationshipConfidence = typeof RelationshipConfidence.Type\n\n/** Attribution for creation of a relationship revision. */\nexport const RelationshipProvenance = Schema.TaggedUnion({\n plugin: {\n pluginConnectionId: PluginConnectionId,\n sourceEntityId: EntityId,\n sourceEntityRevision: LedgerRevision\n },\n human: { personId: PersonId, rationale: boundedText(1_000, \"HumanRelationshipRationale\") },\n agent: { agentId: AgentId, rationale: boundedText(1_000, \"AgentRelationshipRationale\") },\n rule: {\n ruleId: boundedText(200, \"RelationshipRuleId\"),\n ruleVersion: Schema.Int.check(Schema.isGreaterThan(0)),\n rationale: boundedText(1_000, \"RuleRelationshipRationale\")\n }\n})\n\n/** Decoded relationship provenance. */\nexport type RelationshipProvenance = typeof RelationshipProvenance.Type\n\n/** Lifecycle of one relationship revision. Prior revisions remain immutable. */\nexport const RelationshipLifecycle = Schema.TaggedUnion({\n missing: { effectiveAt: UtcTimestamp, reason: boundedText(1_000, \"MissingRelationshipReason\") },\n inferred: { effectiveAt: UtcTimestamp },\n proposed: { effectiveAt: UtcTimestamp },\n verified: { effectiveAt: UtcTimestamp },\n governed: { effectiveAt: UtcTimestamp },\n rejected: { effectiveAt: UtcTimestamp, reason: boundedText(1_000, \"RejectionReason\") },\n superseded: { effectiveAt: UtcTimestamp, reason: boundedText(1_000, \"SupersessionReason\") }\n})\n\n/** Decoded relationship lifecycle. */\nexport type RelationshipLifecycle = typeof RelationshipLifecycle.Type\n\n/** Exact release or environment slice in which a relationship is evaluated. */\nexport const RelationshipScope = Schema.NullOr(\n Schema.TaggedUnion({\n release: { releaseId: ReleaseId },\n environment: { releaseId: ReleaseId, environmentId: EnvironmentId }\n })\n)\n\n/** Human, agent, or system that appended an immutable ledger revision. */\nexport const LedgerActor = Schema.TaggedUnion({\n human: { personId: PersonId },\n agent: { agentId: AgentId },\n system: { component: boundedText(200, \"LedgerSystemComponent\") }\n})\n\n/** Immutable relationship ledger revision. */\nexport const DeliveryRelationship = Schema.Struct({\n workspaceId: WorkspaceId,\n relationshipId: RelationshipId,\n relationshipSchemaVersion: Schema.Literal(1),\n revision: LedgerRevision,\n supersedesRevision: Schema.NullOr(LedgerRevision),\n kind: RelationshipKind,\n sourceNodeId: GraphNodeId,\n sourceNodeKind: RelationshipEndpointKind,\n targetNodeId: GraphNodeId,\n targetNodeKind: RelationshipEndpointKind,\n scope: RelationshipScope,\n lifecycle: RelationshipLifecycle,\n confidence: RelationshipConfidence,\n provenance: RelationshipProvenance,\n recordedBy: LedgerActor,\n evidenceClaimIds: Schema.Array(EvidenceClaimId).check(Schema.isMaxLength(128)),\n recordedAt: UtcTimestamp\n}).check(\n Schema.makeFilter(\n ({ evidenceClaimIds }) => new Set(evidenceClaimIds).size === evidenceClaimIds.length,\n { expected: \"relationship evidence references to be unique\" }\n ),\n Schema.makeFilter(\n ({ confidence, evidenceClaimIds }) => confidence._tag !== \"confirmed\" || evidenceClaimIds.length > 0,\n { expected: \"confirmed relationship confidence to reference immutable evidence\" }\n ),\n Schema.makeFilter(\n ({ sourceNodeId, targetNodeId }) => sourceNodeId !== targetNodeId,\n { expected: \"relationship source and target to differ\" }\n ),\n Schema.makeFilter(\n ({ kind, sourceNodeKind, targetNodeKind }) => relationshipEndpointIsAllowed(kind, sourceNodeKind, targetNodeKind),\n { expected: \"relationship endpoints to follow the canonical version-one direction matrix\" }\n ),\n Schema.makeFilter(\n ({ kind, scope }) => kind !== \"contains\" || scope !== null,\n { expected: \"release containment to carry an explicit release or environment scope\" }\n ),\n Schema.makeFilter(\n ({ confidence, lifecycle }) => lifecycle._tag !== \"inferred\" || confidence._tag !== \"confirmed\",\n { expected: \"an inferred relationship lifecycle not to claim confirmed confidence\" }\n ),\n Schema.makeFilter(\n ({ revision, supersedesRevision }) =>\n revision === 1 ? supersedesRevision === null : supersedesRevision === revision - 1,\n { expected: \"relationship to supersede its exact preceding revision\" }\n )\n)\n\n/** Decoded relationship ledger revision. */\nexport type DeliveryRelationship = typeof DeliveryRelationship.Type\n\n/** Closed assertion vocabulary used by immutable evidence claims. */\nexport const EvidencePredicate = Schema.Literals([\n \"relationship-observed\",\n \"status-observed\",\n \"approval-recorded\",\n \"check-observed\",\n \"execution-observed\",\n \"deployment-observed\",\n \"documentation-observed\",\n \"time-observed\"\n])\n\n/** Decoded evidence predicate. */\nexport type EvidencePredicate = typeof EvidencePredicate.Type\n\n/** Bounded, provider-neutral evidence value. */\nexport const EvidenceValue = Schema.TaggedUnion({\n flag: { value: Schema.Boolean },\n state: { value: boundedText(500, \"EvidenceState\") },\n revision: { value: boundedText(512, \"EvidenceRevision\") },\n reference: { targetNodeId: GraphNodeId }\n})\n\n/** Decoded evidence value. */\nexport type EvidenceValue = typeof EvidenceValue.Type\n\n/** Exact actor or source revision responsible for an evidence claim. */\nexport const EvidenceAttribution = Schema.TaggedUnion({\n plugin: {\n pluginConnectionId: PluginConnectionId,\n sourceEntityId: EntityId,\n sourceEntityRevision: LedgerRevision\n },\n human: { personId: PersonId },\n agent: { agentId: AgentId },\n system: { component: boundedText(200, \"EvidenceSystemComponent\") }\n})\n\n/** Decoded evidence attribution. */\nexport type EvidenceAttribution = typeof EvidenceAttribution.Type\n\n/** Explicit retention policy attached when evidence is recorded. */\nexport const EvidenceRetention = Schema.Struct({\n classification: Schema.Literals([\"audit\", \"evidence\", \"normalized-cache\"]),\n retainUntil: Schema.NullOr(UtcTimestamp),\n legalHold: Schema.Boolean\n})\n\n/** Decoded evidence retention metadata. */\nexport type EvidenceRetention = typeof EvidenceRetention.Type\n\n/** Independent verification of an evidence observation. */\nexport const EvidenceVerifier = Schema.TaggedUnion({\n human: { personId: PersonId },\n agent: { agentId: AgentId },\n system: { component: boundedText(200, \"EvidenceVerifierComponent\") }\n})\n\n/** Immutable observation envelope with provenance, validity, and retention. */\nexport const EvidenceItem = Schema.Struct({\n workspaceId: WorkspaceId,\n evidenceId: EvidenceId,\n schemaVersion: Schema.Int.check(Schema.isGreaterThan(0)),\n attribution: EvidenceAttribution,\n verifier: EvidenceVerifier,\n observedAt: UtcTimestamp,\n recordedAt: UtcTimestamp,\n validUntil: Schema.NullOr(UtcTimestamp),\n freshness: Freshness,\n retention: EvidenceRetention\n}).check(\n Schema.makeFilter(\n ({ attribution, freshness }) => {\n if (attribution._tag !== \"plugin\") return true\n\n return freshness.provenance._tag !== \"none\" &&\n attribution.pluginConnectionId === freshness.provenance.sourceRevision.pluginConnectionId\n },\n { expected: \"plugin evidence attribution to carry its exact freshness source revision\" }\n ),\n Schema.makeFilter(\n ({ observedAt, recordedAt }) => DateTime.Order(observedAt, recordedAt) <= 0,\n { expected: \"evidence observation time not to follow recording time\" }\n ),\n Schema.makeFilter(\n ({ observedAt, validUntil }) => validUntil === null || DateTime.Order(observedAt, validUntil) < 0,\n { expected: \"evidence validity to end after observation\" }\n ),\n Schema.makeFilter(\n ({ recordedAt, retention }) =>\n retention.retainUntil === null || DateTime.Order(recordedAt, retention.retainUntil) <= 0,\n { expected: \"evidence retention not to end before recording\" }\n )\n)\n\n/** Decoded immutable evidence observation. */\nexport type EvidenceItem = typeof EvidenceItem.Type\n\n/** One immutable normalized claim derived from an evidence observation. */\nexport const EvidenceClaim = Schema.Struct({\n workspaceId: WorkspaceId,\n evidenceClaimId: EvidenceClaimId,\n evidenceId: EvidenceId,\n subjectNodeId: GraphNodeId,\n predicate: EvidencePredicate,\n value: EvidenceValue,\n recordedAt: UtcTimestamp,\n supersedesEvidenceClaimId: Schema.NullOr(EvidenceClaimId)\n}).check(\n Schema.makeFilter(\n ({ evidenceClaimId, supersedesEvidenceClaimId }) => evidenceClaimId !== supersedesEvidenceClaimId,\n { expected: \"evidence not to supersede itself\" }\n )\n)\n\n/** Decoded immutable evidence claim. */\nexport type EvidenceClaim = typeof EvidenceClaim.Type\n\n/** Independent source availability and validity dimensions for an evidence item. */\nexport type EvidenceFreshnessAssessment = Readonly<{\n source: \"current\" | \"stale\" | \"missing\" | \"unavailable\"\n validity: \"valid\" | \"expired\"\n}>\n\nconst sourceFreshnessAt = (\n freshness: Freshness,\n at: DateTime.DateTime\n): EvidenceFreshnessAssessment[\"source\"] => {\n if (freshness._tag !== \"current\") return freshness._tag\n\n const ageMilliseconds = DateTime.toEpochMillis(at) - DateTime.toEpochMillis(freshness.sourceObservedAt)\n return ageMilliseconds < freshness.staleAfterSeconds * 1_000 ? \"current\" : \"stale\"\n}\n\n/** Determine source freshness and evidence validity at an injected instant. */\nexport const evidenceFreshnessAt = (\n evidence: EvidenceItem,\n at: DateTime.DateTime\n): EvidenceFreshnessAssessment => ({\n source: sourceFreshnessAt(evidence.freshness, at),\n validity: evidence.validUntil === null || DateTime.Order(at, evidence.validUntil) < 0\n ? \"valid\"\n : \"expired\"\n})\n\n/** Determine whether retained evidence bytes are eligible for governed cleanup. */\nexport const evidenceRetentionEligibilityAt = (\n evidence: EvidenceItem,\n at: DateTime.DateTime\n): \"retain\" | \"eligible\" =>\n !evidence.retention.legalHold &&\n evidence.retention.retainUntil !== null &&\n DateTime.Order(evidence.retention.retainUntil, at) <= 0\n ? \"eligible\"\n : \"retain\"\n","import * as Schema from \"effect/Schema\"\n\nimport { Actor } from \"./actors.js\"\nimport { LedgerRevision } from \"./deliveryGraph.js\"\nimport {\n EnvironmentId,\n RelationshipId,\n RelationshipRepairProposalId,\n RelationshipRepairReviewId,\n ReleaseId,\n SessionId,\n WorkspaceId\n} from \"./identifiers.js\"\nimport { UtcTimestamp } from \"./utcTimestamp.js\"\n\n/** Explicit decision proposed for an incomplete delivery relationship. */\nexport const RelationshipRepairDisposition = Schema.Literals([\"link\", \"verify\", \"reject\"])\n\n/** Decoded relationship-repair disposition. */\nexport type RelationshipRepairDisposition = typeof RelationshipRepairDisposition.Type\n\n/** Bounded human-readable justification stored with a repair proposal. */\nexport const RelationshipRepairRationale = Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(1_000)\n).annotate({ identifier: \"RelationshipRepairRationale\" })\n\n/** Decoded relationship-repair rationale. */\nexport type RelationshipRepairRationale = typeof RelationshipRepairRationale.Type\n\n/** Authenticated origin retained for proposal review and later audit. */\nexport const RelationshipRepairProposalOrigin = Schema.Struct({\n actor: Actor,\n sessionId: SessionId\n})\n\n/** Decoded relationship-repair proposal origin. */\nexport type RelationshipRepairProposalOrigin = typeof RelationshipRepairProposalOrigin.Type\n\n/** Final reviewer decision over one exact proposal. */\nexport const RelationshipRepairReviewDecision = Schema.Literals([\"approved\", \"rejected\"])\n\n/** Decoded relationship-repair review decision. */\nexport type RelationshipRepairReviewDecision = typeof RelationshipRepairReviewDecision.Type\n\n/** Immutable review evidence retained with a finalized proposal. */\nexport const RelationshipRepairReview = Schema.Struct({\n reviewId: RelationshipRepairReviewId,\n decision: RelationshipRepairReviewDecision,\n rationale: RelationshipRepairRationale,\n origin: RelationshipRepairProposalOrigin,\n reviewedAt: UtcTimestamp\n}).annotate({ identifier: \"RelationshipRepairReview\" })\n\n/** Decoded relationship-repair review. */\nexport type RelationshipRepairReview = typeof RelationshipRepairReview.Type\n\n/** Immutable evidence that one approved proposal appended an exact ledger revision. */\nexport const RelationshipRepairApplication = Schema.Struct({\n proposalId: RelationshipRepairProposalId,\n relationshipId: RelationshipId,\n appliedRevision: LedgerRevision,\n origin: RelationshipRepairProposalOrigin,\n appliedAt: UtcTimestamp\n}).annotate({ identifier: \"RelationshipRepairApplication\" })\n\n/** Decoded relationship-repair application evidence. */\nexport type RelationshipRepairApplication = typeof RelationshipRepairApplication.Type\n\n/** Durable proposal bound to one exact immutable relationship revision. */\nexport const RelationshipRepairProposal = Schema.Struct({\n schemaVersion: Schema.Literal(2),\n proposalId: RelationshipRepairProposalId,\n workspaceId: WorkspaceId,\n releaseId: ReleaseId,\n environmentId: Schema.NullOr(EnvironmentId),\n relationshipId: RelationshipId,\n expectedRevision: LedgerRevision,\n disposition: RelationshipRepairDisposition,\n rationale: RelationshipRepairRationale,\n origin: RelationshipRepairProposalOrigin,\n status: Schema.Literals([\"pending\", \"approved\", \"rejected\"]),\n proposedAt: UtcTimestamp,\n review: Schema.NullOr(RelationshipRepairReview)\n}).annotate({ identifier: \"RelationshipRepairProposal\" })\n\n/** Decoded durable relationship-repair proposal. */\nexport type RelationshipRepairProposal = typeof RelationshipRepairProposal.Type\n","import * as Schema from \"effect/Schema\"\n\nimport { UtcTimestamp } from \"./utcTimestamp.js\"\n\n/** Actor classes that can contribute durable activity to a workspace Timeline. */\nexport const TimelineActorKind = Schema.Literals([\"agent\", \"human\", \"plugin\", \"system\"])\n\n/** Decoded Timeline actor class. */\nexport type TimelineActorKind = typeof TimelineActorKind.Type\n\n/** Durable source streams merged by the Timeline projection. */\nexport const TimelineSourceKind = Schema.Literals([\"action\", \"plugin-sync\", \"relationship\", \"system\"])\n\n/** Decoded Timeline source stream. */\nexport type TimelineSourceKind = typeof TimelineSourceKind.Type\n\n/** Connected provider identity retained when a durable event has provenance. */\nexport const TimelineService = Schema.Literals([\"codecommit\", \"codepipeline\", \"jira\", \"confluence\", \"clockify\"])\n\n/** Decoded connected provider identity. */\nexport type TimelineService = typeof TimelineService.Type\n\n/** Stable cursor for newest-first Timeline pagination. */\nexport const TimelineCursor = Schema.Struct({\n eventKey: Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(1_024)),\n occurredAt: UtcTimestamp\n}).annotate({ identifier: \"TimelineCursor\" })\n\n/** Decoded stable Timeline cursor. */\nexport type TimelineCursor = typeof TimelineCursor.Type\n\n/** Default-redacted, human-readable event from one durable workspace source. */\nexport const TimelineEvent = Schema.Struct({\n eventKey: TimelineCursor.fields.eventKey,\n occurredAt: UtcTimestamp,\n actor: Schema.Struct({\n kind: TimelineActorKind,\n label: Schema.String.check(Schema.isTrimmed(), Schema.isNonEmpty(), Schema.isMaxLength(200))\n }),\n sourceKind: TimelineSourceKind,\n service: Schema.NullOr(TimelineService),\n eventType: Schema.String.check(Schema.isTrimmed(), Schema.isNonEmpty(), Schema.isMaxLength(200)),\n title: Schema.String.check(Schema.isTrimmed(), Schema.isNonEmpty(), Schema.isMaxLength(300)),\n href: Schema.NullOr(Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(2_048)))\n}).annotate({ identifier: \"TimelineEvent\" })\n\n/** Decoded Timeline event. */\nexport type TimelineEvent = typeof TimelineEvent.Type\n\nconst TimelineRawIdentifier = Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(2_048))\n\n/** Owner-visible durable identifiers for one exact Timeline event. */\nexport const TimelineEventIdentifiers = Schema.Struct({\n actorId: Schema.NullOr(TimelineRawIdentifier),\n actionId: Schema.NullOr(TimelineRawIdentifier),\n relationshipId: Schema.NullOr(TimelineRawIdentifier),\n pluginConnectionId: Schema.NullOr(TimelineRawIdentifier),\n releaseId: Schema.NullOr(TimelineRawIdentifier),\n entityId: Schema.NullOr(TimelineRawIdentifier)\n}).annotate({ identifier: \"TimelineEventIdentifiers\" })\n\n/** Decoded owner-visible Timeline identifiers. */\nexport type TimelineEventIdentifiers = typeof TimelineEventIdentifiers.Type\n\n/** Owner-visible reference to the local agent job attributable to an event. */\nexport const TimelineAgentJobDetail = Schema.Struct({\n jobId: TimelineRawIdentifier\n}).annotate({ identifier: \"TimelineAgentJobDetail\" })\n\n/** Decoded Timeline agent-job reference. */\nexport type TimelineAgentJobDetail = typeof TimelineAgentJobDetail.Type\n\n/** Deliberate owner-only expansion of one otherwise redacted Timeline event. */\nexport const TimelineEventDetail = Schema.Struct({\n event: TimelineEvent,\n identifiers: TimelineEventIdentifiers,\n agentJob: Schema.NullOr(TimelineAgentJobDetail)\n}).annotate({ identifier: \"TimelineEventDetail\" })\n\n/** Decoded owner-only Timeline event expansion. */\nexport type TimelineEventDetail = typeof TimelineEventDetail.Type\n\n/** One bounded Timeline page. */\nexport const TimelinePage = Schema.Struct({\n events: Schema.Array(TimelineEvent).check(\n Schema.makeFilter((events) => events.length <= 100, { expected: \"at most 100 Timeline events\" })\n ),\n nextCursor: Schema.NullOr(TimelineCursor)\n}).annotate({ identifier: \"TimelinePage\" })\n\n/** Decoded bounded Timeline page. */\nexport type TimelinePage = typeof TimelinePage.Type\n","import * as Schema from \"effect/Schema\"\n\nimport {\n DomainEventId,\n EntityId,\n EventCursor,\n JobId,\n PluginConnectionId,\n ReleaseId,\n WorkspaceId\n} from \"./identifiers.js\"\nimport { UtcTimestamp } from \"./utcTimestamp.js\"\n\nconst jsonEncoder = new TextEncoder()\nconst hasMaximumJsonBytes = (maximumBytes: number) =>\n Schema.makeFilter(\n (value: unknown) => {\n const serialized = JSON.stringify(value)\n return serialized !== undefined && jsonEncoder.encode(serialized).byteLength <= maximumBytes\n },\n { expected: `JSON encoded as at most ${maximumBytes} UTF-8 bytes` }\n )\nconst PersistedEventCursor = EventCursor.check(Schema.isGreaterThan(0))\n\n/** Maximum decoded JSON carried by one durable domain event. */\nexport const MaximumDomainEventPayloadBytes = 65_536\n\n/** Bounded trace identifier safe to persist independently of the HTTP API. */\nexport const DomainEventCorrelationId = Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(128),\n Schema.isPattern(/^[A-Za-z0-9._:-]+$/u, { expected: \"a domain-safe correlation identifier\" })\n).pipe(Schema.brand(\"DomainEventCorrelationId\"))\n\n/** Decoded durable event correlation identifier. */\nexport type DomainEventCorrelationId = typeof DomainEventCorrelationId.Type\n\n/** Optional normalized identities explaining which portfolio facts changed. */\nexport const DomainEventMetadataV1 = Schema.Struct({\n releaseId: Schema.optionalKey(ReleaseId),\n pluginConnectionId: Schema.optionalKey(PluginConnectionId),\n entityId: Schema.optionalKey(EntityId),\n jobId: Schema.optionalKey(JobId)\n}).annotate({ identifier: \"DomainEventMetadataV1\" })\n\n/** Decoded optional identities attached to a v1 domain event. */\nexport type DomainEventMetadataV1 = typeof DomainEventMetadataV1.Type\n\n/** Portfolio projection that must be refreshed after a durable invalidation. */\nexport const PortfolioInvalidationReason = Schema.Literals([\"release-projection\", \"plugin-health\"])\n\n/** Decoded reason for invalidating an authoritative portfolio projection. */\nexport type PortfolioInvalidationReason = typeof PortfolioInvalidationReason.Type\n\n/** Bounded typed payload persisted with a portfolio invalidation. */\nexport const PortfolioInvalidatedPayloadV1 = Schema.Struct({\n reason: PortfolioInvalidationReason\n}).check(hasMaximumJsonBytes(MaximumDomainEventPayloadBytes)).annotate({ identifier: \"PortfolioInvalidatedPayloadV1\" })\n\n/** Decoded bounded v1 portfolio-invalidation payload. */\nexport type PortfolioInvalidatedPayloadV1 = typeof PortfolioInvalidatedPayloadV1.Type\n\n/** Durable workspace-local event declaring that the authoritative portfolio changed. */\nexport const PortfolioInvalidatedEventV1 = Schema.Struct({\n schemaVersion: Schema.Literal(1),\n eventId: DomainEventId,\n eventCursor: PersistedEventCursor,\n workspaceId: WorkspaceId,\n eventType: Schema.Literal(\"portfolio-invalidated\"),\n occurredAt: UtcTimestamp,\n ingestedAt: UtcTimestamp,\n causationId: Schema.NullOr(DomainEventId),\n correlationId: Schema.NullOr(DomainEventCorrelationId),\n metadata: DomainEventMetadataV1,\n payload: PortfolioInvalidatedPayloadV1\n}).annotate({ identifier: \"PortfolioInvalidatedEventV1\" })\n\n/** Decoded durable v1 portfolio-invalidation event. */\nexport type PortfolioInvalidatedEventV1 = typeof PortfolioInvalidatedEventV1.Type\n"],"mappings":";;;;;;AAEA,IAAM,mCAAmC;AAEzC,IAAM,kBAA8C,UAClD,OAAO,OAAO,MAAM,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,KACpC,OAAO,SACL,OAAO,OAAO,MACZ,OAAO,OAAO,CAAC,GACf,OAAO,UAAU,kCAAkC,EACjD,UAAU,gCACZ,CAAC,CACH,GACA,qBAAqB,YAAY,CACnC,GACA,OAAO,MAAM,KAAK,CACpB;;AAGF,IAAa,cAAc,eAAe,aAAa;;AAMvD,IAAa,YAAY,eAAe,WAAW;;AAMnD,IAAa,WAAW,eAAe,UAAU;;AAMjD,IAAa,WAAW,eAAe,UAAU;;AAMjD,IAAa,UAAU,eAAe,SAAS;;AAM/C,IAAa,gBAAgB,eAAe,eAAe;;AAM3D,IAAa,qBAAqB,eAAe,oBAAoB;;AAMrE,IAAa,oBAAoB,eAAe,mBAAmB;;AAMnE,IAAa,qBAAqB,eAAe,oBAAoB;;AAMrE,IAAa,mBAAmB,eAAe,kBAAkB;;AAMj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src/domain/identifiers.ts","../../../src/domain/utcTimestamp.ts","../../../src/domain/sourceRevision.ts","../../../src/domain/freshness.ts","../../../src/domain/plugins/bounds.ts","../../../src/domain/readiness/policy.ts","../../../src/domain/readiness/model.ts","../../../src/domain/actors.ts","../../../src/domain/releaseRelay.ts","../../../src/domain/release.ts","../../../src/domain/plugins/descriptor.ts","../../../src/domain/normalizedIssue.ts","../../../src/domain/deliveryGraph.ts","../../../src/domain/relationshipRepair.ts","../../../src/domain/timeline.ts","../../../src/domain/domainEvent.ts"],"sourcesContent":["import { Schema, SchemaTransformation } from \"effect\"\n\nconst CANONICAL_LOWERCASE_UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-7[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/\n\nconst canonicalUuid7 = <const Brand extends string>(brand: Brand) =>\n Schema.String.check(Schema.isUUID(7)).pipe(\n Schema.decodeTo(\n Schema.String.check(\n Schema.isUUID(7),\n Schema.isPattern(CANONICAL_LOWERCASE_UUID_PATTERN, {\n expected: \"a canonical lowercase UUID v7\"\n })\n ),\n SchemaTransformation.toLowerCase()\n ),\n Schema.brand(brand)\n )\n\n/** Canonical identifier of an isolated Control Center workspace. */\nexport const WorkspaceId = canonicalUuid7(\"WorkspaceId\")\n\n/** Decoded workspace identifier. */\nexport type WorkspaceId = typeof WorkspaceId.Type\n\n/** Canonical identifier of a release aggregate. */\nexport const ReleaseId = canonicalUuid7(\"ReleaseId\")\n\n/** Decoded release identifier. */\nexport type ReleaseId = typeof ReleaseId.Type\n\n/** Canonical identifier of a normalized delivery entity. */\nexport const EntityId = canonicalUuid7(\"EntityId\")\n\n/** Decoded delivery-entity identifier. */\nexport type EntityId = typeof EntityId.Type\n\n/** Canonical identifier of a human collaborator. */\nexport const PersonId = canonicalUuid7(\"PersonId\")\n\n/** Decoded person identifier. */\nexport type PersonId = typeof PersonId.Type\n\n/** Canonical identifier of an automated agent. */\nexport const AgentId = canonicalUuid7(\"AgentId\")\n\n/** Decoded agent identifier. */\nexport type AgentId = typeof AgentId.Type\n\n/** Canonical identifier of a deployment environment. */\nexport const EnvironmentId = canonicalUuid7(\"EnvironmentId\")\n\n/** Decoded environment identifier. */\nexport type EnvironmentId = typeof EnvironmentId.Type\n\n/** Canonical identifier of a configured plugin connection. */\nexport const PluginConnectionId = canonicalUuid7(\"PluginConnectionId\")\n\n/** Decoded plugin-connection identifier. */\nexport type PluginConnectionId = typeof PluginConnectionId.Type\n\n/** Canonical identifier of one external provider account followed by a workspace. */\nexport const ProviderAccountId = canonicalUuid7(\"ProviderAccountId\")\n\n/** Decoded provider-account identifier. */\nexport type ProviderAccountId = typeof ProviderAccountId.Type\n\n/** Canonical identifier of one repository, pipeline, site, or workspace being followed. */\nexport const FollowedResourceId = canonicalUuid7(\"FollowedResourceId\")\n\n/** Decoded followed-resource identifier. */\nexport type FollowedResourceId = typeof FollowedResourceId.Type\n\n/** Canonical identifier of a collaborator role assignment. */\nexport const RoleAssignmentId = canonicalUuid7(\"RoleAssignmentId\")\n\n/** Decoded role-assignment identifier. */\nexport type RoleAssignmentId = typeof RoleAssignmentId.Type\n\n/** Canonical identifier of one delivery-graph relationship. */\nexport const RelationshipId = canonicalUuid7(\"RelationshipId\")\n\n/** Decoded delivery-graph relationship identifier. */\nexport type RelationshipId = typeof RelationshipId.Type\n\n/** Canonical identifier of one governed relationship-repair proposal. */\nexport const RelationshipRepairProposalId = canonicalUuid7(\"RelationshipRepairProposalId\")\n\n/** Decoded relationship-repair proposal identifier. */\nexport type RelationshipRepairProposalId = typeof RelationshipRepairProposalId.Type\n\n/** Canonical identifier of one immutable relationship-repair review. */\nexport const RelationshipRepairReviewId = canonicalUuid7(\"RelationshipRepairReviewId\")\n\n/** Decoded relationship-repair review identifier. */\nexport type RelationshipRepairReviewId = typeof RelationshipRepairReviewId.Type\n\n/** Canonical identifier of one immutable evidence claim. */\nexport const EvidenceClaimId = canonicalUuid7(\"EvidenceClaimId\")\n\n/** Decoded immutable evidence-claim identifier. */\nexport type EvidenceClaimId = typeof EvidenceClaimId.Type\n\n/** Canonical identifier of one immutable evidence observation envelope. */\nexport const EvidenceId = canonicalUuid7(\"EvidenceId\")\n\n/** Decoded immutable evidence observation identifier. */\nexport type EvidenceId = typeof EvidenceId.Type\n\n/** Canonical identifier of one immutable readiness assessment. */\nexport const ReadinessAssessmentId = canonicalUuid7(\"ReadinessAssessmentId\")\n\n/** Decoded immutable readiness-assessment identifier. */\nexport type ReadinessAssessmentId = typeof ReadinessAssessmentId.Type\n\n/** Canonical identifier of one resolved or explicitly missing graph node. */\nexport const GraphNodeId = canonicalUuid7(\"GraphNodeId\")\n\n/** Decoded graph-node identifier. */\nexport type GraphNodeId = typeof GraphNodeId.Type\n\n/** Workspace-local monotonic position used for durable event replay. */\nexport const EventCursor = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)).pipe(Schema.brand(\"EventCursor\"))\n\n/** Decoded nonnegative event position; persisted event rows start at one. */\nexport type EventCursor = typeof EventCursor.Type\n\n/** Canonical identifier of one durable domain event. */\nexport const DomainEventId = canonicalUuid7(\"DomainEventId\")\n\n/** Decoded durable domain-event identifier. */\nexport type DomainEventId = typeof DomainEventId.Type\n\n/** Canonical identifier of one asynchronous Control Center job. */\nexport const JobId = canonicalUuid7(\"JobId\")\n\n/** Decoded asynchronous job identifier. */\nexport type JobId = typeof JobId.Type\n\n/** Canonical identifier of one durable release-scoped agent thread. */\nexport const AgentThreadId = canonicalUuid7(\"AgentThreadId\")\n\n/** Decoded durable agent-thread identifier. */\nexport type AgentThreadId = typeof AgentThreadId.Type\n\n/** Canonical identifier of an authenticated browser session. */\nexport const SessionId = canonicalUuid7(\"SessionId\")\n\n/** Decoded authenticated browser-session identifier. */\nexport type SessionId = typeof SessionId.Type\n\n/** Canonical identifier of one exact-scope authenticated share grant. */\nexport const ShareId = canonicalUuid7(\"ShareId\")\n\n/** Decoded authorized-share identifier. */\nexport type ShareId = typeof ShareId.Type\n\n/** Canonical identifier of one governed provider action. */\nexport const GovernedActionId = canonicalUuid7(\"GovernedActionId\")\n\n/** Decoded governed-action identifier. */\nexport type GovernedActionId = typeof GovernedActionId.Type\n\n/** Canonical identifier of one immutable governed-action transition. */\nexport const GovernedActionTransitionId = canonicalUuid7(\"GovernedActionTransitionId\")\n\n/** Decoded governed-action transition identifier. */\nexport type GovernedActionTransitionId = typeof GovernedActionTransitionId.Type\n\n/** Canonical identifier of one immutable human action authorization. */\nexport const GovernedActionAuthorizationId = canonicalUuid7(\"GovernedActionAuthorizationId\")\n\n/** Decoded governed-action authorization identifier. */\nexport type GovernedActionAuthorizationId = typeof GovernedActionAuthorizationId.Type\n\n/** Canonical identifier of one governed-action execution attempt. */\nexport const GovernedActionAttemptId = canonicalUuid7(\"GovernedActionAttemptId\")\n\n/** Decoded governed-action attempt identifier. */\nexport type GovernedActionAttemptId = typeof GovernedActionAttemptId.Type\n","import { Schema } from \"effect\"\n\n/**\n * Codec for instants that normalizes accepted ISO-8601 input to UTC and encodes\n * it as a canonical UTC ISO-8601 string.\n */\nexport const UtcTimestamp = Schema.DateTimeUtcFromString.annotate({\n identifier: \"UtcTimestamp\"\n})\n\n/** Decoded UTC instant used by Control Center domain records. */\nexport type UtcTimestamp = typeof UtcTimestamp.Type\n","import { DateTime, Schema, SchemaTransformation } from \"effect\"\n\nimport { PluginConnectionId } from \"./identifiers.js\"\nimport { UtcTimestamp } from \"./utcTimestamp.js\"\n\nconst MAX_OPAQUE_SOURCE_VALUE_LENGTH = 512\n\nconst boundedOpaqueSourceValue = Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(MAX_OPAQUE_SOURCE_VALUE_LENGTH)\n)\n\n/** Stable persisted provider names, independent of package abbreviations. */\nexport const ProviderId = Schema.Literals([\n \"codecommit\",\n \"codepipeline\",\n \"jira\",\n \"confluence\",\n \"clockify\"\n]).annotate({ identifier: \"ProviderId\" })\n\n/** Decoded plugin-provider identifier. */\nexport type ProviderId = typeof ProviderId.Type\n\n/** Opaque immutable identifier assigned to an object by its source provider. */\nexport const VendorImmutableId = boundedOpaqueSourceValue.pipe(Schema.brand(\"VendorImmutableId\"))\n\n/** Decoded source-provider object identifier. */\nexport type VendorImmutableId = typeof VendorImmutableId.Type\n\n/** Opaque source-provider revision, version, digest, or ETag. */\nexport const Revision = boundedOpaqueSourceValue.pipe(Schema.brand(\"Revision\"))\n\n/** Decoded source-provider revision. */\nexport type Revision = typeof Revision.Type\n\n/** Positive version of the normalization schema used for a source record. */\nexport const NormalizationSchemaVersion = Schema.Number.check(\n Schema.isInt(),\n Schema.isGreaterThan(0)\n).pipe(Schema.brand(\"NormalizationSchemaVersion\"))\n\n/** Decoded normalization-schema version. */\nexport type NormalizationSchemaVersion = typeof NormalizationSchemaVersion.Type\n\nconst hasNoControlCharacters = (value: string): boolean =>\n Array.from(value).every((character) => {\n const codePoint = character.codePointAt(0)\n return (\n codePoint !== undefined &&\n !((codePoint >= 0 && codePoint <= 0x1f) || (codePoint >= 0x7f && codePoint <= 0x9f))\n )\n })\n\nconst SafeSourceUrlString = Schema.String.check(\n Schema.isMaxLength(4_096),\n Schema.makeFilter(hasNoControlCharacters, { expected: \"a source URL without control characters\" })\n)\n\n/** Safe navigable URL for an exact provider object, without embedded credentials. */\nexport const SourceUrl = SafeSourceUrlString.pipe(\n Schema.decodeTo(Schema.URL, SchemaTransformation.urlFromString),\n Schema.check(\n Schema.makeFilter(\n ({ protocol }) => protocol === \"https:\" || protocol === \"http:\",\n { expected: \"an HTTP or HTTPS source URL\" }\n ),\n Schema.makeFilter(\n ({ password, username }) => password.length === 0 && username.length === 0,\n { expected: \"a source URL without embedded credentials\" }\n )\n )\n)\n\n/** Decoded safe source URL. */\nexport type SourceUrl = typeof SourceUrl.Type\n\n/**\n * Immutable provenance needed to reconcile a normalized record with the exact\n * provider object and revision from which it was derived.\n */\nexport const SourceRevision = Schema.Struct({\n providerId: ProviderId,\n pluginConnectionId: PluginConnectionId,\n vendorImmutableId: VendorImmutableId,\n revision: Revision,\n sourceUrl: Schema.Union([SourceUrl, Schema.Null]),\n firstObservedAt: UtcTimestamp,\n lastObservedAt: UtcTimestamp,\n synchronizedAt: UtcTimestamp,\n normalizationSchemaVersion: NormalizationSchemaVersion\n})\n .check(\n Schema.makeFilter((sourceRevision) => {\n if (\n DateTime.toEpochMillis(sourceRevision.firstObservedAt) >\n DateTime.toEpochMillis(sourceRevision.lastObservedAt)\n ) {\n return {\n path: [\"lastObservedAt\"],\n issue: \"lastObservedAt must not precede firstObservedAt\"\n }\n }\n\n return DateTime.toEpochMillis(sourceRevision.lastObservedAt) <=\n DateTime.toEpochMillis(sourceRevision.synchronizedAt)\n ? undefined\n : {\n path: [\"synchronizedAt\"],\n issue: \"synchronizedAt must not precede lastObservedAt\"\n }\n })\n )\n .annotate({ identifier: \"SourceRevision\" })\n\n/** Decoded source-revision provenance. */\nexport type SourceRevision = typeof SourceRevision.Type\n","import * as DateTime from \"effect/DateTime\"\nimport * as Effect from \"effect/Effect\"\nimport * as Schema from \"effect/Schema\"\nimport { PluginConnectionId } from \"./identifiers.js\"\nimport { SourceRevision } from \"./sourceRevision.js\"\nimport { UtcTimestamp } from \"./utcTimestamp.js\"\n\nconst StaleAfterSeconds = Schema.Int.check(Schema.isGreaterThan(0))\nconst SafeHealthMessage = Schema.String.check(\n Schema.isTrimmed(),\n Schema.isMinLength(1),\n Schema.isMaxLength(500)\n)\n\n/** Stable failure classes exposed by plugin health without leaking raw causes. */\nexport const PluginFailureClass = Schema.Literals([\n \"authentication\",\n \"authorization\",\n \"rate-limit\",\n \"timeout\",\n \"malformed-response\",\n \"outage\",\n \"unknown\"\n])\n\n/** Decoded plugin failure classification. */\nexport type PluginFailureClass = typeof PluginFailureClass.Type\n\nconst HealthyPluginHealth = Schema.TaggedStruct(\"healthy\", {\n checkedAt: UtcTimestamp\n})\n\nconst DegradedPluginHealth = Schema.TaggedStruct(\"degraded\", {\n checkedAt: UtcTimestamp,\n failureClass: PluginFailureClass,\n retryAt: Schema.NullOr(UtcTimestamp),\n safeMessage: SafeHealthMessage\n}).check(\n Schema.makeFilter(\n ({ checkedAt, retryAt }) => retryAt === null || DateTime.Order(checkedAt, retryAt) <= 0,\n { expected: \"plugin retry time to be at or after its health check\" }\n )\n)\n\nconst UnavailablePluginHealth = Schema.TaggedStruct(\"unavailable\", {\n checkedAt: UtcTimestamp,\n failureClass: PluginFailureClass,\n retryAt: Schema.NullOr(UtcTimestamp),\n safeMessage: SafeHealthMessage\n}).check(\n Schema.makeFilter(\n ({ checkedAt, retryAt }) => retryAt === null || DateTime.Order(checkedAt, retryAt) <= 0,\n { expected: \"plugin retry time to be at or after its health check\" }\n )\n)\n\nconst DisabledPluginHealth = Schema.TaggedStruct(\"disabled\", {\n checkedAt: UtcTimestamp\n})\n\n/** Health of the plugin connection responsible for a normalized object. */\nexport const PluginHealth = Schema.Union([\n HealthyPluginHealth,\n DegradedPluginHealth,\n UnavailablePluginHealth,\n DisabledPluginHealth\n]).pipe(Schema.toTaggedUnion(\"_tag\"))\n\n/** Decoded plugin connection health. */\nexport type PluginHealth = typeof PluginHealth.Type\n\nconst UsablePluginHealth = Schema.Union([HealthyPluginHealth, DegradedPluginHealth])\n\nconst ProviderProvenance = Schema.TaggedStruct(\"provider\", {\n sourceRevision: SourceRevision\n})\n\nconst CachedProvenance = Schema.TaggedStruct(\"cache\", {\n cachedAt: UtcTimestamp,\n sourceRevision: SourceRevision\n}).check(\n Schema.makeFilter(\n ({ cachedAt, sourceRevision }) => DateTime.Order(sourceRevision.synchronizedAt, cachedAt) <= 0,\n { expected: \"the cache time to be at or after source synchronization\" }\n )\n)\n\nconst NoCacheProvenance = Schema.TaggedStruct(\"none\", {\n pluginConnectionId: PluginConnectionId\n})\n\nconst sourceAgeSecondsAt = (sourceObservedAt: UtcTimestamp, evaluatedAt: UtcTimestamp): number =>\n (DateTime.toEpochMillis(evaluatedAt) - DateTime.toEpochMillis(sourceObservedAt)) / 1_000\n\nconst freshnessEvaluation = {\n // Older persisted revisions predate explicit projection-time evaluation. In\n // that case their plugin health check remains the historical evaluation time.\n evaluatedAt: Schema.optional(UtcTimestamp)\n}\n\nconst evaluatedAtOrHealthCheck = (\n evaluatedAt: UtcTimestamp | undefined,\n pluginHealth: PluginHealth\n): UtcTimestamp => evaluatedAt ?? pluginHealth.checkedAt\n\nconst CurrentFreshness = Schema.TaggedStruct(\"current\", {\n ...freshnessEvaluation,\n pluginHealth: UsablePluginHealth,\n provenance: Schema.Union([ProviderProvenance, CachedProvenance]),\n sourceObservedAt: UtcTimestamp,\n staleAfterSeconds: StaleAfterSeconds,\n synchronizedAt: UtcTimestamp\n}).check(\n Schema.makeFilter(\n ({ evaluatedAt, pluginHealth, provenance, sourceObservedAt, staleAfterSeconds, synchronizedAt }) =>\n DateTime.Equivalence(sourceObservedAt, provenance.sourceRevision.lastObservedAt) &&\n DateTime.Order(provenance.sourceRevision.synchronizedAt, synchronizedAt) <= 0 &&\n (provenance._tag === \"provider\" || DateTime.Order(provenance.cachedAt, synchronizedAt) <= 0) &&\n DateTime.Order(synchronizedAt, pluginHealth.checkedAt) <= 0 &&\n (evaluatedAt === undefined || DateTime.Order(pluginHealth.checkedAt, evaluatedAt) <= 0) &&\n sourceAgeSecondsAt(sourceObservedAt, evaluatedAtOrHealthCheck(evaluatedAt, pluginHealth)) >= 0 &&\n sourceAgeSecondsAt(sourceObservedAt, evaluatedAtOrHealthCheck(evaluatedAt, pluginHealth)) <= staleAfterSeconds,\n {\n expected: \"current source data to match its revision and remain within its stale threshold\"\n }\n )\n)\n\nconst StaleFreshness = Schema.TaggedStruct(\"stale\", {\n ...freshnessEvaluation,\n pluginHealth: PluginHealth,\n provenance: CachedProvenance,\n sourceObservedAt: UtcTimestamp,\n staleAfterSeconds: StaleAfterSeconds,\n synchronizedAt: UtcTimestamp\n}).check(\n Schema.makeFilter(\n ({ evaluatedAt, pluginHealth, provenance, sourceObservedAt, staleAfterSeconds, synchronizedAt }) =>\n DateTime.Equivalence(sourceObservedAt, provenance.sourceRevision.lastObservedAt) &&\n DateTime.Order(sourceObservedAt, synchronizedAt) <= 0 &&\n DateTime.Order(provenance.cachedAt, synchronizedAt) <= 0 &&\n DateTime.Order(synchronizedAt, pluginHealth.checkedAt) <= 0 &&\n (evaluatedAt === undefined || DateTime.Order(pluginHealth.checkedAt, evaluatedAt) <= 0) &&\n sourceAgeSecondsAt(sourceObservedAt, evaluatedAtOrHealthCheck(evaluatedAt, pluginHealth)) > staleAfterSeconds,\n {\n expected: \"stale cache data to be chronological and beyond its stale threshold\"\n }\n )\n)\n\nconst MissingFreshness = Schema.TaggedStruct(\"missing\", {\n pluginHealth: HealthyPluginHealth,\n provenance: NoCacheProvenance,\n sourceObservedAt: Schema.Null,\n staleAfterSeconds: StaleAfterSeconds,\n synchronizedAt: UtcTimestamp\n})\n\nconst UnavailableFreshness = Schema.TaggedStruct(\"unavailable\", {\n pluginHealth: Schema.Union([UnavailablePluginHealth, DisabledPluginHealth]),\n provenance: NoCacheProvenance,\n sourceObservedAt: Schema.Null,\n staleAfterSeconds: StaleAfterSeconds,\n synchronizedAt: Schema.Null\n})\n\n/**\n * Freshness of normalized data, preserving cached stale data while separating\n * absence from a connection that cannot currently be queried.\n */\nexport const Freshness = Schema.Union([\n CurrentFreshness,\n StaleFreshness,\n MissingFreshness,\n UnavailableFreshness\n]).pipe(Schema.toTaggedUnion(\"_tag\"))\n\n/** Decoded normalized-data freshness. */\nexport type Freshness = typeof Freshness.Type\n\n/** Re-evaluate persisted freshness for a read projection without rewriting its source facts. */\nexport const evaluateFreshnessAt = Effect.fn(\"Freshness.evaluateAt\")(function*(\n freshness: Freshness,\n evaluatedAt: UtcTimestamp\n): Effect.fn.Return<Freshness, Schema.SchemaError> {\n if (freshness._tag !== \"current\" && freshness._tag !== \"stale\") return freshness\n const isStale = freshness._tag === \"stale\" ||\n sourceAgeSecondsAt(freshness.sourceObservedAt, evaluatedAt) > freshness.staleAfterSeconds\n const provenance = isStale\n ? freshness.provenance._tag === \"cache\"\n ? freshness.provenance\n : {\n _tag: \"cache\",\n cachedAt: freshness.synchronizedAt,\n sourceRevision: freshness.provenance.sourceRevision\n }\n : freshness.provenance\n return yield* Schema.decodeUnknownEffect(Schema.toType(Freshness))({\n ...freshness,\n _tag: isStale ? \"stale\" : \"current\",\n evaluatedAt,\n provenance\n })\n})\n","import * as Schema from \"effect/Schema\"\n\nconst jsonEncoder = new TextEncoder()\n\nconst hasMaximumJsonBytes = (maximumBytes: number) =>\n Schema.makeFilter(\n (value: unknown) => {\n const serialized = JSON.stringify(value)\n return serialized !== undefined && jsonEncoder.encode(serialized).byteLength <= maximumBytes\n },\n { expected: `JSON encoded as at most ${maximumBytes} UTF-8 bytes` }\n )\n\n/** Maximum persisted or dispatched JSON payload accepted from a plugin boundary. */\nexport const MaximumPluginPayloadBytes = 262_144\n\n/** Maximum encoded size of one atomic normalized sync page. */\nexport const MaximumPluginSyncPageBytes = 1_048_576\n\n/** Maximum canonical descriptor JSON accepted before adapter construction. */\nexport const MaximumPluginDescriptorBytes = 61_440\n\n/** Bounded JSON for normalized evidence and governed-action payloads. */\nexport const PluginPayloadJson = Schema.Json.check(hasMaximumJsonBytes(MaximumPluginPayloadBytes)).annotate({\n identifier: \"PluginPayloadJson\"\n})\n\n/** Applies a deterministic upper bound to an already-decoded JSON-shaped value. */\nexport const hasMaximumPluginJsonBytes = hasMaximumJsonBytes\n","import * as DateTime from \"effect/DateTime\"\n\nimport type { EvidenceId, PluginConnectionId } from \"../identifiers.js\"\nimport type { UtcTimestamp } from \"../utcTimestamp.js\"\nimport type {\n ReadinessEvidenceReference,\n ReadinessFactDefinition,\n ReadinessFactEvaluation,\n ReadinessFactObservation,\n ReadinessFactResult,\n ReadinessFinding,\n ReadinessFindingCode,\n ReadinessProgress,\n ReadinessSourceSummary,\n ReadinessStages,\n ReadinessVerdict\n} from \"./model.js\"\n\n/** Locale-independent ordering used by canonical readiness records and digests. */\nexport const compareReadinessText = (left: string, right: string): number => left < right ? -1 : left > right ? 1 : 0\n\n/** Sorted unique string-like values for deterministic assessment material. */\nexport const sortedReadinessUnique = <Value extends string>(\n values: ReadonlyArray<Value>\n): Array<Value> => Array.from(new Set(values)).sort(compareReadinessText)\n\n/** Whether definitions form the complete provider-neutral V1 delivery policy. */\nexport const readinessDefinitionsShapeIsV1 = (\n definitions: ReadonlyArray<ReadinessFactDefinition>\n): boolean => {\n const deployments = definitions.filter(({ kind }) => kind === \"deployment\")\n return definitions.some(({ kind, requirement }) => kind === \"execution\" && requirement === \"required\") &&\n definitions.some(({ kind, requirement }) =>\n requirement === \"required\" && [\"relationship\", \"approval\", \"check\", \"documentation\"].includes(kind)\n ) &&\n deployments.length === 1 &&\n deployments[0]?.requirement === \"advisory\"\n}\n\n/** Whether definitions and observations form a complete V1 delivery policy shape. */\nexport const readinessPolicyShapeIsV1 = (\n definitions: ReadonlyArray<ReadinessFactDefinition>,\n observations: ReadonlyArray<ReadinessFactObservation>\n): boolean =>\n readinessDefinitionsShapeIsV1(definitions) &&\n observations.some(({ state }) => state._tag === \"deployment\")\n\n/** Whether one exact evidence dependency is current enough for a verdict. */\nexport const readinessEvidenceIsCurrent = (evidence: ReadinessEvidenceReference): boolean =>\n evidence.freshness === \"current\" &&\n evidence.validity === \"valid\" &&\n (evidence.source._tag === \"local\" ||\n evidence.source.health === \"healthy\" ||\n evidence.source.health === \"degraded\")\n\n/** Whether every evidence dependency of an observed fact is current and valid. */\nexport const readinessObservationIsCurrent = (\n observation: ReadinessFactObservation\n): boolean => observation.evidence.length > 0 && observation.evidence.every(readinessEvidenceIsCurrent)\n\n/** Whether a normalized observation is semantically positive. */\nexport const readinessObservationIsPositive = (\n observation: ReadinessFactObservation\n): boolean => {\n switch (observation.state._tag) {\n case \"relationship\":\n return observation.state.status === \"verified\" || observation.state.status === \"governed\"\n case \"approval\":\n return observation.state.status === \"approved\"\n case \"check\":\n return observation.state.status === \"passed\"\n case \"execution\":\n return observation.state.status === \"succeeded\"\n case \"documentation\":\n return observation.state.status === \"current\"\n case \"deployment\":\n return observation.state.status === \"succeeded\"\n }\n}\n\n/** Machine-readable explicit-failure reason, independent of freshness. */\nexport const readinessFailureCode = (\n observation: ReadinessFactObservation\n): ReadinessFindingCode | null => {\n switch (observation.state._tag) {\n case \"relationship\":\n return observation.state.status === \"rejected\" ? \"relationship-rejected\" : null\n case \"approval\":\n return observation.state.status === \"rejected\" ? \"approval-rejected\" : null\n case \"check\":\n return observation.state.status === \"failed\"\n ? \"check-failed\"\n : observation.state.status === \"cancelled\"\n ? \"check-cancelled\"\n : null\n case \"execution\":\n return observation.state.status === \"failed\"\n ? \"execution-failed\"\n : observation.state.status === \"stopped\"\n ? \"execution-stopped\"\n : null\n case \"documentation\":\n return null\n case \"deployment\":\n return observation.state.status === \"failed\"\n ? \"deployment-failed\"\n : observation.state.status === \"rolled-back\"\n ? \"deployment-rolled-back\"\n : null\n }\n}\n\n/** Machine-readable non-positive reason for one normalized observation. */\nexport const readinessNonPositiveCode = (\n observation: ReadinessFactObservation\n): ReadinessFindingCode | null => {\n switch (observation.state._tag) {\n case \"relationship\":\n switch (observation.state.status) {\n case \"missing\":\n return \"relationship-missing\"\n case \"inferred\":\n case \"proposed\":\n return \"relationship-unverified\"\n case \"superseded\":\n return \"relationship-superseded\"\n default:\n return null\n }\n case \"approval\":\n switch (observation.state.status) {\n case \"missing\":\n return \"approval-missing\"\n case \"pending\":\n return \"approval-pending\"\n case \"expired\":\n return \"approval-expired\"\n default:\n return null\n }\n case \"check\":\n return observation.state.status === \"missing\"\n ? \"check-missing\"\n : observation.state.status === \"queued\" || observation.state.status === \"running\"\n ? \"check-pending\"\n : null\n case \"execution\":\n return observation.state.status === \"missing\"\n ? \"execution-missing\"\n : observation.state.status === \"queued\" || observation.state.status === \"running\"\n ? \"execution-pending\"\n : null\n case \"documentation\":\n switch (observation.state.status) {\n case \"missing\":\n return \"documentation-missing\"\n case \"draft\":\n return \"documentation-draft\"\n case \"stale\":\n return \"documentation-stale\"\n case \"superseded\":\n return \"documentation-superseded\"\n default:\n return null\n }\n case \"deployment\":\n return null\n }\n}\n\n/** Whether this observation represents active build or check work. */\nexport const readinessObservationIsDeliveryActivity = (\n definition: ReadinessFactDefinition,\n observation: ReadinessFactObservation | null\n): boolean =>\n definition.requirement === \"required\" &&\n observation !== null &&\n ((observation.state._tag === \"execution\" &&\n (observation.state.status === \"queued\" || observation.state.status === \"running\")) ||\n (observation.state._tag === \"check\" &&\n (observation.state.status === \"queued\" || observation.state.status === \"running\"))) &&\n readinessObservationIsCurrent(observation)\n\n/** Canonical semantic result retained for one fact evaluation. */\nexport const readinessFactResult = (\n definition: ReadinessFactDefinition,\n observation: ReadinessFactObservation | null\n): ReadinessFactResult => {\n if (observation === null) return definition.requirement === \"required\" ? \"gap\" : \"advisory\"\n if (readinessFailureCode(observation) !== null) {\n return definition.requirement === \"required\" || definition.kind === \"deployment\"\n ? \"failed\"\n : \"advisory\"\n }\n if (readinessObservationIsPositive(observation) && readinessObservationIsCurrent(observation)) {\n return \"verified\"\n }\n const code = readinessNonPositiveCode(observation)\n if (code === \"approval-pending\" || code === \"check-pending\" || code === \"execution-pending\") {\n return \"pending\"\n }\n return definition.requirement === \"required\" ? \"gap\" : \"advisory\"\n}\n\nconst missingCode = (definition: ReadinessFactDefinition): ReadinessFindingCode => {\n switch (definition.kind) {\n case \"relationship\":\n return \"relationship-missing\"\n case \"approval\":\n return \"approval-missing\"\n case \"check\":\n return \"check-missing\"\n case \"execution\":\n return \"execution-missing\"\n case \"documentation\":\n return \"documentation-missing\"\n case \"deployment\":\n return \"deployment-missing\"\n }\n}\n\nconst observationEvidenceIds = (\n observation: ReadinessFactObservation | null\n): Array<EvidenceId> =>\n observation === null\n ? []\n : sortedReadinessUnique(observation.evidence.map(({ evidenceId }) => evidenceId))\n\nconst factFinding = (\n code: ReadinessFindingCode,\n definition: ReadinessFactDefinition,\n observation: ReadinessFactObservation | null\n): ReadinessFinding => ({\n code,\n subject: { _tag: \"fact\", factId: definition.factId },\n evidenceIds: observationEvidenceIds(observation)\n})\n\nconst evidenceFinding = (\n evidence: ReadinessEvidenceReference,\n definition: ReadinessFactDefinition\n): ReadinessFinding | null => {\n const code: ReadinessFindingCode | null = evidence.validity === \"expired\"\n ? \"evidence-expired\"\n : evidence.freshness === \"stale\"\n ? \"source-stale\"\n : evidence.freshness === \"missing\"\n ? \"source-missing\"\n : evidence.freshness === \"unavailable\" ||\n (evidence.source._tag === \"plugin\" &&\n (evidence.source.health === \"unavailable\" || evidence.source.health === \"disabled\"))\n ? \"source-unavailable\"\n : evidence.source._tag === \"plugin\" && evidence.source.health === \"degraded\"\n ? \"plugin-degraded\"\n : null\n if (code === null) return null\n return {\n code,\n subject: evidence.source._tag === \"plugin\"\n ? { _tag: \"source\", pluginConnectionId: evidence.source.pluginConnectionId }\n : { _tag: \"fact\", factId: definition.factId },\n evidenceIds: [evidence.evidenceId]\n }\n}\n\n/** Stable sort/deduplication key for readiness findings. */\nexport const readinessFindingKey = (finding: ReadinessFinding): string => {\n const subject = finding.subject._tag === \"fact\"\n ? finding.subject.factId\n : finding.subject._tag === \"source\"\n ? finding.subject.pluginConnectionId\n : \"candidate\"\n return `${finding.code}:${finding.subject._tag}:${subject}:${finding.evidenceIds.join(\",\")}`\n}\n\nconst normalizedFindings = (\n findings: ReadonlyArray<ReadinessFinding>\n): Array<ReadinessFinding> => {\n const byKey = new Map(findings.map((finding) => [readinessFindingKey(finding), finding]))\n return Array.from(byKey.values()).sort((left, right) =>\n compareReadinessText(readinessFindingKey(left), readinessFindingKey(right))\n )\n}\n\n/** Exact blocker, warning, and gap sets implied by retained fact evaluations. */\nexport const deriveReadinessFindings = (\n facts: ReadonlyArray<ReadinessFactEvaluation>,\n complete: boolean\n): {\n readonly blockers: Array<ReadinessFinding>\n readonly warnings: Array<ReadinessFinding>\n readonly gaps: Array<ReadinessFinding>\n} => {\n const blockers: Array<ReadinessFinding> = []\n const warnings: Array<ReadinessFinding> = []\n const gaps: Array<ReadinessFinding> = complete\n ? []\n : [{ code: \"input-incomplete\", subject: { _tag: \"candidate\" }, evidenceIds: [] }]\n\n for (const { definition, observation } of facts) {\n if (observation === null) {\n if (definition.requirement === \"required\") {\n gaps.push(factFinding(missingCode(definition), definition, observation))\n }\n continue\n }\n\n const failure = readinessFailureCode(observation)\n if (failure !== null) {\n const finding = factFinding(failure, definition, observation)\n if (definition.requirement === \"required\" || definition.kind === \"deployment\") {\n blockers.push(finding)\n } else {\n warnings.push(finding)\n }\n } else if (!readinessObservationIsPositive(observation) || !readinessObservationIsCurrent(observation)) {\n const code = readinessNonPositiveCode(observation)\n if (code !== null) {\n const finding = factFinding(code, definition, observation)\n const active = code === \"approval-pending\" || code === \"check-pending\" || code === \"execution-pending\"\n if (active || definition.requirement === \"advisory\") warnings.push(finding)\n if (!active && definition.requirement === \"required\") gaps.push(finding)\n }\n }\n\n for (const evidence of observation.evidence) {\n const finding = evidenceFinding(evidence, definition)\n if (finding === null) continue\n warnings.push(finding)\n if (\n definition.requirement === \"required\" &&\n finding.code !== \"plugin-degraded\" &&\n failure === null\n ) gaps.push(finding)\n }\n }\n\n return {\n blockers: normalizedFindings(blockers),\n warnings: normalizedFindings(warnings),\n gaps: normalizedFindings(gaps)\n }\n}\n\nconst freshnessRank = { current: 0, stale: 1, missing: 2, unavailable: 3 }\nconst healthRank = { healthy: 0, degraded: 1, unavailable: 2, disabled: 3 }\n\n/** Exact worst-state summaries for plugin evidence retained by facts. */\nexport const deriveReadinessSourceSummaries = (\n facts: ReadonlyArray<ReadinessFactEvaluation>\n): Array<ReadinessSourceSummary> => {\n const grouped = new Map<PluginConnectionId, Array<ReadinessEvidenceReference>>()\n for (const evidence of facts.flatMap(({ observation }) => observation?.evidence ?? [])) {\n if (evidence.source._tag !== \"plugin\") continue\n const current = grouped.get(evidence.source.pluginConnectionId) ?? []\n current.push(evidence)\n grouped.set(evidence.source.pluginConnectionId, current)\n }\n return Array.from(grouped.entries())\n .map(([pluginConnectionId, evidence]): ReadinessSourceSummary => ({\n pluginConnectionId,\n freshness: evidence.reduce<ReadinessSourceSummary[\"freshness\"]>(\n (worst, item) =>\n freshnessRank[item.freshness] > freshnessRank[worst]\n ? item.freshness\n : worst,\n \"current\"\n ),\n health: evidence.reduce<ReadinessSourceSummary[\"health\"]>((worst, item) => {\n const health = item.source._tag === \"plugin\" ? item.source.health : \"healthy\"\n return healthRank[health] > healthRank[worst] ? health : worst\n }, \"healthy\"),\n evidenceIds: sortedReadinessUnique(evidence.map(({ evidenceId }) => evidenceId))\n }))\n .sort((left, right) => compareReadinessText(left.pluginConnectionId, right.pluginConnectionId))\n}\n\n/** Earliest evidence freshness boundary retained by one environment assessment. */\nexport const deriveReadinessNextEvaluationAt = (\n facts: ReadonlyArray<ReadinessFactEvaluation>\n): UtcTimestamp | null =>\n facts\n .flatMap(({ observation }) => observation?.evidence ?? [])\n .flatMap(({ reevaluateAt }) => reevaluateAt === null ? [] : [reevaluateAt])\n .reduce<UtcTimestamp | null>(\n (earliest, boundary) => earliest === null || DateTime.Order(boundary, earliest) < 0 ? boundary : earliest,\n null\n )\n\nconst observationProgress = (\n observation: ReadinessFactObservation | undefined\n): ReadinessProgress | null => {\n if (observation?.state._tag === \"execution\" || observation?.state._tag === \"deployment\") {\n return observation.state.progress\n }\n return null\n}\n\nconst stageEvidence = (facts: ReadonlyArray<ReadinessFactEvaluation>) =>\n sortedReadinessUnique(facts.flatMap(({ evidenceIds }) => evidenceIds))\n\n/** Derive the exact three delivery stages from canonical fact evaluations. */\nexport const deriveReadinessStages = (\n facts: ReadonlyArray<ReadinessFactEvaluation>\n): ReadinessStages => {\n const build = facts.filter(({ definition }) => definition.kind === \"execution\")\n const verify = facts.filter(({ definition }) =>\n [\"relationship\", \"approval\", \"check\", \"documentation\"].includes(definition.kind)\n )\n const production = facts.filter(({ definition }) => definition.kind === \"deployment\")\n const deployment = production.find(({ observation }) => observation?.state._tag === \"deployment\")?.observation\n const requiredBuild = build.filter(({ definition }) => definition.requirement === \"required\")\n const requiredVerify = verify.filter(({ definition }) => definition.requirement === \"required\")\n const activeBuild = requiredBuild.filter(({ observation }) =>\n observation !== null &&\n observation.state._tag === \"execution\" &&\n (observation.state.status === \"queued\" || observation.state.status === \"running\") &&\n readinessObservationIsCurrent(observation)\n )\n const runningBuild = activeBuild.find(({ observation }) =>\n observation?.state._tag === \"execution\" && observation.state.status === \"running\"\n )\n const queuedBuild = activeBuild.find(({ observation }) =>\n observation?.state._tag === \"execution\" && observation.state.status === \"queued\"\n )\n const activeVerify = requiredVerify.find(({ observation }) =>\n observation !== null &&\n ((observation.state._tag === \"check\" &&\n (observation.state.status === \"queued\" || observation.state.status === \"running\")) ||\n (observation.state._tag === \"approval\" && observation.state.status === \"pending\")) &&\n readinessObservationIsCurrent(observation)\n )\n\n const buildState: ReadinessStages[\"build\"][\"state\"] = build.some(({ result }) => result === \"failed\")\n ? \"failed\"\n : runningBuild !== undefined\n ? \"running\"\n : queuedBuild !== undefined\n ? \"queued\"\n : requiredBuild.every(({ result }) => result === \"verified\")\n ? \"succeeded\"\n : build.some(({ observation }) => observation !== null)\n ? \"held\"\n : \"not-started\"\n\n const verifyState: ReadinessStages[\"verify\"][\"state\"] = verify.some(({ result }) => result === \"failed\")\n ? \"failed\"\n : activeVerify !== undefined\n ? \"pending\"\n : requiredVerify.every(({ result }) => result === \"verified\")\n ? \"passed\"\n : verify.some(({ observation }) => observation !== null)\n ? \"held\"\n : \"not-started\"\n\n let productionState: ReadinessStages[\"production\"][\"state\"] = \"not-started\"\n if (deployment?.state._tag === \"deployment\") {\n const current = readinessObservationIsCurrent(deployment)\n switch (deployment.state.status) {\n case \"failed\":\n productionState = \"failed\"\n break\n case \"rolled-back\":\n productionState = \"rolled-back\"\n break\n case \"deploying\":\n productionState = current ? \"deploying\" : \"held\"\n break\n case \"pending\":\n productionState = current ? \"waiting\" : \"held\"\n break\n case \"succeeded\":\n productionState = current ? \"succeeded\" : \"held\"\n break\n case \"not-started\":\n productionState = current ? \"not-started\" : \"held\"\n break\n }\n }\n\n return {\n build: {\n state: buildState,\n factIds: sortedReadinessUnique(build.map(({ definition }) => definition.factId)),\n evidenceIds: stageEvidence(build),\n progress: observationProgress(\n runningBuild?.observation ?? queuedBuild?.observation ?? undefined\n )\n },\n verify: {\n state: verifyState,\n factIds: sortedReadinessUnique(verify.map(({ definition }) => definition.factId)),\n evidenceIds: stageEvidence(verify),\n progress: null\n },\n production: {\n state: productionState,\n factIds: sortedReadinessUnique(production.map(({ definition }) => definition.factId)),\n evidenceIds: stageEvidence(production),\n progress: observationProgress(deployment ?? undefined)\n }\n }\n}\n\n/** Derive the canonical verdict from facts, findings, and exact stage state. */\nexport const deriveEnvironmentReadinessVerdict = (input: {\n readonly blockers: ReadonlyArray<ReadinessFinding>\n readonly facts: ReadonlyArray<ReadinessFactEvaluation>\n readonly gaps: ReadonlyArray<ReadinessFinding>\n readonly stages: ReadinessStages\n}): ReadinessVerdict => {\n if (input.blockers.length > 0) return \"blocked\"\n if (input.stages.production.state === \"deploying\") return \"deploying\"\n if (\n input.facts.some(({ definition, observation }) => readinessObservationIsDeliveryActivity(definition, observation))\n ) return \"building\"\n if (\n input.gaps.length > 0 ||\n input.stages.build.state === \"held\" ||\n input.stages.verify.state === \"held\" ||\n input.stages.production.state === \"held\" ||\n input.facts.some(({ definition, result }) => definition.requirement === \"required\" && result !== \"verified\")\n ) return \"held\"\n return input.stages.production.state === \"succeeded\" ? \"shipped\" : \"ready\"\n}\n\ntype ReleaseEnvironmentReadiness = {\n readonly blockers: ReadonlyArray<ReadinessFinding>\n readonly environmentId: string\n readonly gaps: ReadonlyArray<ReadinessFinding>\n readonly nextEvaluationAt: UtcTimestamp | null\n readonly sourceFreshness: ReadonlyArray<ReadinessSourceSummary>\n readonly stages: ReadinessStages\n readonly verdict: ReadinessVerdict\n readonly warnings: ReadonlyArray<ReadinessFinding>\n}\n\n/** Exact merged findings implied by retained environment summaries. */\nexport const deriveReleaseReadinessFindings = (\n environments: ReadonlyArray<ReleaseEnvironmentReadiness>\n): {\n readonly blockers: Array<ReadinessFinding>\n readonly warnings: Array<ReadinessFinding>\n readonly gaps: Array<ReadinessFinding>\n} => ({\n blockers: normalizedFindings(environments.flatMap(({ blockers }) => blockers)),\n warnings: normalizedFindings(environments.flatMap(({ warnings }) => warnings)),\n gaps: normalizedFindings(environments.flatMap(({ gaps }) => gaps))\n})\n\n/** Exact worst-state source summaries implied by retained environments. */\nexport const deriveReleaseReadinessSourceSummaries = (\n environments: ReadonlyArray<ReleaseEnvironmentReadiness>\n): Array<ReadinessSourceSummary> => {\n const grouped = new Map<PluginConnectionId, Array<ReadinessSourceSummary>>()\n for (const summary of environments.flatMap(({ sourceFreshness }) => sourceFreshness)) {\n const current = grouped.get(summary.pluginConnectionId) ?? []\n current.push(summary)\n grouped.set(summary.pluginConnectionId, current)\n }\n return Array.from(grouped.entries())\n .map(([pluginConnectionId, summaries]): ReadinessSourceSummary => ({\n pluginConnectionId,\n freshness: summaries.reduce<ReadinessSourceSummary[\"freshness\"]>(\n (worst, summary) => freshnessRank[summary.freshness] > freshnessRank[worst] ? summary.freshness : worst,\n \"current\"\n ),\n health: summaries.reduce<ReadinessSourceSummary[\"health\"]>(\n (worst, summary) => healthRank[summary.health] > healthRank[worst] ? summary.health : worst,\n \"healthy\"\n ),\n evidenceIds: sortedReadinessUnique(summaries.flatMap(({ evidenceIds }) => evidenceIds))\n }))\n .sort((left, right) => compareReadinessText(left.pluginConnectionId, right.pluginConnectionId))\n}\n\n/** Earliest child freshness boundary implied by retained environments. */\nexport const deriveReleaseReadinessNextEvaluationAt = (\n environments: ReadonlyArray<ReleaseEnvironmentReadiness>\n): UtcTimestamp | null =>\n environments.reduce<UtcTimestamp | null>((earliest, { nextEvaluationAt }) => {\n if (nextEvaluationAt === null) return earliest\n return earliest === null || DateTime.Order(nextEvaluationAt, earliest) < 0 ? nextEvaluationAt : earliest\n }, null)\n\nconst firstReleaseProgress = (\n environments: ReadonlyArray<ReleaseEnvironmentReadiness>,\n stage: \"build\" | \"production\"\n): ReadinessProgress | null =>\n environments\n .slice()\n .sort((left, right) => compareReadinessText(left.environmentId, right.environmentId))\n .find((environment) => environment.stages[stage].progress !== null)?.stages[stage].progress ?? null\n\n/** Exact three-stage roll-up implied by retained environment summaries. */\nexport const deriveReleaseReadinessStages = (\n environments: ReadonlyArray<ReleaseEnvironmentReadiness>\n): ReadinessStages => {\n const buildStates = environments.map(({ stages }) => stages.build.state)\n const verifyStates = environments.map(({ stages }) => stages.verify.state)\n const productionStates = environments.map(({ stages }) => stages.production.state)\n const buildState: ReadinessStages[\"build\"][\"state\"] = buildStates.includes(\"failed\")\n ? \"failed\"\n : buildStates.includes(\"running\")\n ? \"running\"\n : buildStates.includes(\"queued\")\n ? \"queued\"\n : buildStates.every((state) => state === \"succeeded\")\n ? \"succeeded\"\n : buildStates.every((state) => state === \"not-started\")\n ? \"not-started\"\n : \"held\"\n const verifyState: ReadinessStages[\"verify\"][\"state\"] = verifyStates.includes(\"failed\")\n ? \"failed\"\n : verifyStates.includes(\"pending\")\n ? \"pending\"\n : verifyStates.every((state) => state === \"passed\")\n ? \"passed\"\n : verifyStates.every((state) => state === \"not-started\")\n ? \"not-started\"\n : \"held\"\n let productionState: ReadinessStages[\"production\"][\"state\"] = \"not-started\"\n if (productionStates.includes(\"failed\")) productionState = \"failed\"\n else if (productionStates.includes(\"rolled-back\")) productionState = \"rolled-back\"\n else if (productionStates.includes(\"deploying\")) productionState = \"deploying\"\n else if (productionStates.includes(\"held\")) productionState = \"held\"\n else if (productionStates.every((state) => state === \"succeeded\")) productionState = \"succeeded\"\n else if (productionStates.some((state) => state === \"waiting\" || state === \"succeeded\")) {\n productionState = \"waiting\"\n }\n\n return {\n build: {\n state: buildState,\n factIds: sortedReadinessUnique(environments.flatMap(({ stages }) => stages.build.factIds)),\n evidenceIds: sortedReadinessUnique(environments.flatMap(({ stages }) => stages.build.evidenceIds)),\n progress: firstReleaseProgress(environments, \"build\")\n },\n verify: {\n state: verifyState,\n factIds: sortedReadinessUnique(environments.flatMap(({ stages }) => stages.verify.factIds)),\n evidenceIds: sortedReadinessUnique(environments.flatMap(({ stages }) => stages.verify.evidenceIds)),\n progress: null\n },\n production: {\n state: productionState,\n factIds: sortedReadinessUnique(environments.flatMap(({ stages }) => stages.production.factIds)),\n evidenceIds: sortedReadinessUnique(environments.flatMap(({ stages }) => stages.production.evidenceIds)),\n progress: firstReleaseProgress(environments, \"production\")\n }\n }\n}\n\n/** Canonical cross-environment precedence for release readiness. */\nexport const deriveReleaseReadinessVerdict = (\n environments: ReadonlyArray<ReleaseEnvironmentReadiness>\n): ReadinessVerdict => {\n const verdicts = environments.map(({ verdict }) => verdict)\n if (verdicts.includes(\"blocked\")) return \"blocked\"\n if (verdicts.includes(\"deploying\")) return \"deploying\"\n if (verdicts.includes(\"building\")) return \"building\"\n if (verdicts.includes(\"held\")) return \"held\"\n return verdicts.every((verdict) => verdict === \"shipped\") ? \"shipped\" : \"ready\"\n}\n\nconst sameStringArray = (\n left: ReadonlyArray<string>,\n right: ReadonlyArray<string>\n): boolean => left.length === right.length && left.every((value, index) => value === right[index])\n\nconst progressIsEqual = (\n left: ReadinessProgress | null,\n right: ReadinessProgress | null\n): boolean =>\n left === null || right === null\n ? left === right\n : left._tag === \"count\" && right._tag === \"count\"\n ? left.completed === right.completed && left.total === right.total\n : left._tag === \"percent\" && right._tag === \"percent\" && left.value === right.value\n\n/** Structural equality for canonical stage records without serialization shortcuts. */\nexport const readinessStagesAreEqual = (\n left: ReadinessStages,\n right: ReadinessStages\n): boolean =>\n left.build.state === right.build.state &&\n sameStringArray(left.build.factIds, right.build.factIds) &&\n sameStringArray(left.build.evidenceIds, right.build.evidenceIds) &&\n progressIsEqual(left.build.progress, right.build.progress) &&\n left.verify.state === right.verify.state &&\n sameStringArray(left.verify.factIds, right.verify.factIds) &&\n sameStringArray(left.verify.evidenceIds, right.verify.evidenceIds) &&\n progressIsEqual(left.verify.progress, right.verify.progress) &&\n left.production.state === right.production.state &&\n sameStringArray(left.production.factIds, right.production.factIds) &&\n sameStringArray(left.production.evidenceIds, right.production.evidenceIds) &&\n progressIsEqual(left.production.progress, right.production.progress)\n","import * as DateTime from \"effect/DateTime\"\nimport * as Schema from \"effect/Schema\"\n\nimport {\n EnvironmentId,\n EvidenceId,\n PluginConnectionId,\n ReadinessAssessmentId,\n ReleaseId,\n WorkspaceId\n} from \"../identifiers.js\"\nimport { UtcTimestamp } from \"../utcTimestamp.js\"\nimport {\n compareReadinessText,\n deriveEnvironmentReadinessVerdict,\n deriveReadinessFindings,\n deriveReadinessNextEvaluationAt,\n deriveReadinessSourceSummaries,\n deriveReadinessStages,\n deriveReleaseReadinessFindings,\n deriveReleaseReadinessNextEvaluationAt,\n deriveReleaseReadinessSourceSummaries,\n deriveReleaseReadinessStages,\n deriveReleaseReadinessVerdict,\n readinessFactResult,\n readinessFindingKey,\n readinessPolicyShapeIsV1,\n readinessStagesAreEqual,\n sortedReadinessUnique\n} from \"./policy.js\"\n\nconst boundedIdentifier = (maximumLength: number, identifier: string) =>\n Schema.String.check(\n Schema.isTrimmed(),\n Schema.isMinLength(1),\n Schema.isMaxLength(maximumLength)\n ).annotate({ identifier })\n\nconst unique = <Value>(values: ReadonlyArray<Value>): boolean => new Set(values).size === values.length\n\nconst sameOrderedStrings = (\n left: ReadonlyArray<string>,\n right: ReadonlyArray<string>\n): boolean => left.length === right.length && left.every((value, index) => value === right[index])\n\nconst isCanonicalStrings = (values: ReadonlyArray<string>): boolean =>\n sameOrderedStrings(values, sortedReadinessUnique(values))\n\n/** Maximum exact evidence dependencies in one environment or release assessment. */\nexport const MAX_READINESS_EVIDENCE_REFERENCES = 512\n\n/** Maximum blockers, warnings, or gaps retained in one assessment. */\nexport const MAX_READINESS_FINDINGS = 1_025\n\n/** Stable identity of one V1 readiness fact, independent of display copy. */\nexport const ReadinessFactId = boundedIdentifier(200, \"ReadinessFactId\").pipe(\n Schema.check(Schema.isPattern(/^[a-z0-9][a-z0-9._:/-]*$/u)),\n Schema.brand(\"ReadinessFactId\")\n)\n\n/** Decoded readiness-fact identity. */\nexport type ReadinessFactId = typeof ReadinessFactId.Type\n\n/** Hash of the complete canonical candidate input assembled by the application layer. */\nexport const ReadinessCandidateDigest = Schema.String.check(\n Schema.isPattern(/^sha256:[0-9a-f]{64}$/u)\n).pipe(Schema.brand(\"ReadinessCandidateDigest\"))\n\n/** Decoded candidate digest. */\nexport type ReadinessCandidateDigest = typeof ReadinessCandidateDigest.Type\n\n/** Positive version of the rule policy used for one assessment. */\nexport const ReadinessRuleVersion = Schema.Int.check(Schema.isGreaterThan(0)).pipe(\n Schema.brand(\"ReadinessRuleVersion\")\n)\n\n/** Decoded readiness-rule version. */\nexport type ReadinessRuleVersion = typeof ReadinessRuleVersion.Type\n\n/** Positive version of the evaluator implementation used for one assessment. */\nexport const ReadinessDerivationVersion = Schema.Int.check(Schema.isGreaterThan(0)).pipe(\n Schema.brand(\"ReadinessDerivationVersion\")\n)\n\n/** Decoded readiness-derivation version. */\nexport type ReadinessDerivationVersion = typeof ReadinessDerivationVersion.Type\n\n/** V1 readiness policy version. */\nexport const READINESS_RULE_VERSION_V1 = ReadinessRuleVersion.make(1)\n\n/** V1 evaluator implementation version. */\nexport const READINESS_DERIVATION_VERSION_V1 = ReadinessDerivationVersion.make(1)\n\n/** Positive source revision of the release candidate. */\nexport const ReadinessReleaseRevision = Schema.Int.check(Schema.isGreaterThan(0))\n\n/** Decoded release-candidate revision. */\nexport type ReadinessReleaseRevision = typeof ReadinessReleaseRevision.Type\n\n/** Bounded immutable artifact revision, such as a commit or image digest. */\nexport const ReadinessArtifactRevision = boundedIdentifier(512, \"ReadinessArtifactRevision\")\n\n/** Decoded artifact revision. */\nexport type ReadinessArtifactRevision = typeof ReadinessArtifactRevision.Type\n\n/** Stable identity of a readiness rule set. */\nexport const ReadinessRuleId = boundedIdentifier(200, \"ReadinessRuleId\")\n\n/** Decoded readiness-rule identity. */\nexport type ReadinessRuleId = typeof ReadinessRuleId.Type\n\n/** Explicit release or target-environment scope of an assessment. */\nexport const ReadinessScope = Schema.TaggedUnion({\n release: { releaseId: ReleaseId },\n environment: { releaseId: ReleaseId, environmentId: EnvironmentId }\n})\n\n/** Decoded readiness scope. */\nexport type ReadinessScope = typeof ReadinessScope.Type\n\nconst CandidateIdentityBase = {\n workspaceId: WorkspaceId,\n releaseRevision: ReadinessReleaseRevision,\n artifactRevision: ReadinessArtifactRevision,\n digest: ReadinessCandidateDigest\n}\n\n/** Immutable target-environment candidate whose complete material is digest-bound. */\nexport const EnvironmentReadinessCandidateIdentity = Schema.Struct({\n ...CandidateIdentityBase,\n scope: Schema.TaggedStruct(\"environment\", {\n releaseId: ReleaseId,\n environmentId: EnvironmentId\n })\n})\n\n/** Immutable release-scope candidate whose child assessments are digest-bound. */\nexport const ReleaseReadinessCandidateIdentity = Schema.Struct({\n ...CandidateIdentityBase,\n scope: Schema.TaggedStruct(\"release\", { releaseId: ReleaseId })\n})\n\n/** Immutable deployable candidate whose complete material is bound by a digest. */\nexport const ReadinessCandidateIdentity = Schema.Union([\n EnvironmentReadinessCandidateIdentity,\n ReleaseReadinessCandidateIdentity\n])\n\n/** Decoded deployable candidate identity. */\nexport type ReadinessCandidateIdentity = typeof ReadinessCandidateIdentity.Type\n\n/** Stable rule-set identity and content digest retained with every assessment. */\nexport const ReadinessRuleReference = Schema.Struct({\n ruleId: ReadinessRuleId,\n version: ReadinessRuleVersion,\n digest: ReadinessCandidateDigest\n})\n\n/** Decoded readiness rule reference. */\nexport type ReadinessRuleReference = typeof ReadinessRuleReference.Type\n\n/** Canonical six-state readiness verdict. */\nexport const ReadinessVerdict = Schema.Literals([\n \"blocked\",\n \"ready\",\n \"deploying\",\n \"building\",\n \"shipped\",\n \"held\"\n])\n\n/** Decoded readiness verdict. */\nexport type ReadinessVerdict = typeof ReadinessVerdict.Type\n\n/** Closed provider-neutral fact categories understood by the V1 evaluator. */\nexport const ReadinessFactKind = Schema.Literals([\n \"relationship\",\n \"approval\",\n \"check\",\n \"execution\",\n \"documentation\",\n \"deployment\"\n])\n\n/** Decoded readiness-fact category. */\nexport type ReadinessFactKind = typeof ReadinessFactKind.Type\n\n/** Whether a fact gates readiness or only contributes context. */\nexport const ReadinessFactRequirement = Schema.Literals([\"required\", \"advisory\"])\n\n/** Decoded fact requirement. */\nexport type ReadinessFactRequirement = typeof ReadinessFactRequirement.Type\n\n/** Policy definition that makes missing observations explicit rather than successful by absence. */\nexport const ReadinessFactDefinition = Schema.Struct({\n factId: ReadinessFactId,\n kind: ReadinessFactKind,\n requirement: ReadinessFactRequirement\n})\n\n/** Decoded readiness-fact definition. */\nexport type ReadinessFactDefinition = typeof ReadinessFactDefinition.Type\n\nconst CountProgress = Schema.TaggedStruct(\"count\", {\n completed: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n total: Schema.Int.check(Schema.isGreaterThan(0))\n}).check(\n Schema.makeFilter(({ completed, total }) => completed <= total, {\n expected: \"readiness progress completed count not to exceed its total\"\n })\n)\n\nconst PercentProgress = Schema.TaggedStruct(\"percent\", {\n value: Schema.Number.check(\n Schema.makeFilter((value) => value >= 0 && value <= 100, {\n expected: \"readiness progress percentage between zero and one hundred\"\n })\n )\n})\n\n/** Typed progress for builds and deployments without copied display text. */\nexport const ReadinessProgress = Schema.Union([CountProgress, PercentProgress]).pipe(\n Schema.toTaggedUnion(\"_tag\")\n)\n\n/** Decoded readiness progress. */\nexport type ReadinessProgress = typeof ReadinessProgress.Type\n\n/** Closed normalized observation states; vendor strings never enter rule evaluation. */\nexport const ReadinessFactState = Schema.TaggedUnion({\n relationship: {\n status: Schema.Literals([\n \"missing\",\n \"inferred\",\n \"proposed\",\n \"verified\",\n \"governed\",\n \"rejected\",\n \"superseded\"\n ])\n },\n approval: {\n status: Schema.Literals([\"missing\", \"pending\", \"approved\", \"rejected\", \"expired\"])\n },\n check: {\n status: Schema.Literals([\"missing\", \"queued\", \"running\", \"passed\", \"failed\", \"cancelled\"])\n },\n execution: {\n status: Schema.Literals([\"missing\", \"queued\", \"running\", \"succeeded\", \"failed\", \"stopped\"]),\n progress: Schema.NullOr(ReadinessProgress)\n },\n documentation: {\n status: Schema.Literals([\"missing\", \"draft\", \"current\", \"stale\", \"superseded\"])\n },\n deployment: {\n status: Schema.Literals([\"not-started\", \"pending\", \"deploying\", \"succeeded\", \"failed\", \"rolled-back\"]),\n progress: Schema.NullOr(ReadinessProgress)\n }\n})\n\n/** Decoded normalized readiness observation state. */\nexport type ReadinessFactState = typeof ReadinessFactState.Type\n\n/** Exact origin of evidence used for dependency tracking and plugin-health invalidation. */\nexport const ReadinessEvidenceSource = Schema.TaggedUnion({\n plugin: {\n pluginConnectionId: PluginConnectionId,\n health: Schema.Literals([\"healthy\", \"degraded\", \"unavailable\", \"disabled\"])\n },\n local: { origin: Schema.Literals([\"human\", \"agent\", \"system\"]) }\n})\n\n/** Decoded readiness-evidence source. */\nexport type ReadinessEvidenceSource = typeof ReadinessEvidenceSource.Type\n\n/** Exact evidence dependency and its freshness at the injected evaluation boundary. */\nexport const ReadinessEvidenceReference = Schema.Struct({\n evidenceId: EvidenceId,\n source: ReadinessEvidenceSource,\n freshness: Schema.Literals([\"current\", \"stale\", \"missing\", \"unavailable\"]),\n validity: Schema.Literals([\"valid\", \"expired\"]),\n reevaluateAt: Schema.NullOr(UtcTimestamp)\n})\n\n/** Decoded readiness-evidence dependency. */\nexport type ReadinessEvidenceReference = typeof ReadinessEvidenceReference.Type\n\nconst stateRequiresEvidence = (state: ReadinessFactState): boolean => state.status !== \"missing\"\n\n/** One normalized observation for a policy-defined fact. */\nexport const ReadinessFactObservation = Schema.Struct({\n factId: ReadinessFactId,\n state: ReadinessFactState,\n evidence: Schema.Array(ReadinessEvidenceReference).check(Schema.isMaxLength(128))\n}).check(\n Schema.makeFilter(({ evidence }) => unique(evidence.map(({ evidenceId }) => evidenceId)), {\n expected: \"readiness observation evidence identifiers to be unique\"\n }),\n Schema.makeFilter(({ evidence, state }) => !stateRequiresEvidence(state) || evidence.length > 0, {\n expected: \"a non-empty readiness observation state to reference evidence\"\n })\n)\n\n/** Decoded readiness-fact observation. */\nexport type ReadinessFactObservation = typeof ReadinessFactObservation.Type\n\n/** Stable machine-readable reason emitted by the V1 rule policy. */\nexport const ReadinessFindingCode = Schema.Literals([\n \"input-incomplete\",\n \"relationship-missing\",\n \"relationship-unverified\",\n \"relationship-rejected\",\n \"relationship-superseded\",\n \"approval-missing\",\n \"approval-pending\",\n \"approval-rejected\",\n \"approval-expired\",\n \"check-missing\",\n \"check-pending\",\n \"check-failed\",\n \"check-cancelled\",\n \"execution-missing\",\n \"execution-pending\",\n \"execution-failed\",\n \"execution-stopped\",\n \"documentation-missing\",\n \"documentation-draft\",\n \"documentation-stale\",\n \"documentation-superseded\",\n \"deployment-missing\",\n \"deployment-failed\",\n \"deployment-rolled-back\",\n \"source-stale\",\n \"source-missing\",\n \"source-unavailable\",\n \"plugin-degraded\",\n \"evidence-expired\"\n])\n\n/** Decoded readiness finding code. */\nexport type ReadinessFindingCode = typeof ReadinessFindingCode.Type\n\n/** Stable subject of a readiness finding. */\nexport const ReadinessFindingSubject = Schema.TaggedUnion({\n fact: { factId: ReadinessFactId },\n source: { pluginConnectionId: PluginConnectionId },\n candidate: {}\n})\n\n/** One blocker, warning, or evidence gap without presentation prose. */\nexport const ReadinessFinding = Schema.Struct({\n code: ReadinessFindingCode,\n subject: ReadinessFindingSubject,\n evidenceIds: Schema.Array(EvidenceId).check(Schema.isMaxLength(128))\n}).check(\n Schema.makeFilter(({ evidenceIds }) => unique(evidenceIds), {\n expected: \"readiness finding evidence identifiers to be unique\"\n })\n)\n\n/** Decoded readiness finding. */\nexport type ReadinessFinding = typeof ReadinessFinding.Type\n\n/** Outcome retained for every evaluated fact. */\nexport const ReadinessFactResult = Schema.Literals([\"verified\", \"pending\", \"failed\", \"gap\", \"advisory\"])\n\n/** Decoded readiness-fact outcome. */\nexport type ReadinessFactResult = typeof ReadinessFactResult.Type\n\n/** Auditable fact evaluation retained in an environment assessment. */\nexport const ReadinessFactEvaluation = Schema.Struct({\n definition: ReadinessFactDefinition,\n observation: Schema.NullOr(ReadinessFactObservation),\n result: ReadinessFactResult,\n evidenceIds: Schema.Array(EvidenceId).check(Schema.isMaxLength(128))\n}).check(\n Schema.makeFilter(({ definition, evidenceIds, observation, result }) =>\n observation === null\n ? evidenceIds.length === 0 && result === readinessFactResult(definition, observation)\n : observation.factId === definition.factId &&\n observation.state._tag === definition.kind &&\n sameOrderedStrings(\n evidenceIds,\n sortedReadinessUnique(observation.evidence.map(({ evidenceId }) => evidenceId))\n ) &&\n result === readinessFactResult(definition, observation), {\n expected: \"readiness fact evaluation to match its definition, observation, evidence, and result\"\n })\n)\n\n/** Decoded readiness-fact evaluation. */\nexport type ReadinessFactEvaluation = typeof ReadinessFactEvaluation.Type\n\n/** Worst current source state for one contributing plugin connection. */\nexport const ReadinessSourceSummary = Schema.Struct({\n pluginConnectionId: PluginConnectionId,\n freshness: Schema.Literals([\"current\", \"stale\", \"missing\", \"unavailable\"]),\n health: Schema.Literals([\"healthy\", \"degraded\", \"unavailable\", \"disabled\"]),\n evidenceIds: Schema.Array(EvidenceId).check(Schema.isMaxLength(512))\n})\n\n/** Decoded source summary. */\nexport type ReadinessSourceSummary = typeof ReadinessSourceSummary.Type\n\nconst ReadinessStageBase = {\n factIds: Schema.Array(ReadinessFactId).check(Schema.isMaxLength(512)),\n evidenceIds: Schema.Array(EvidenceId).check(Schema.isMaxLength(512)),\n progress: Schema.NullOr(ReadinessProgress)\n}\n\n/** Server-derived Build stage. */\nexport const BuildReadinessStage = Schema.Struct({\n ...ReadinessStageBase,\n state: Schema.Literals([\"not-started\", \"queued\", \"running\", \"succeeded\", \"failed\", \"held\"])\n})\n\n/** Server-derived Verify stage. */\nexport const VerifyReadinessStage = Schema.Struct({\n ...ReadinessStageBase,\n state: Schema.Literals([\"not-started\", \"pending\", \"passed\", \"failed\", \"held\"])\n})\n\n/** Server-derived Production stage. */\nexport const ProductionReadinessStage = Schema.Struct({\n ...ReadinessStageBase,\n state: Schema.Literals([\n \"not-started\",\n \"waiting\",\n \"deploying\",\n \"succeeded\",\n \"failed\",\n \"rolled-back\",\n \"held\"\n ])\n})\n\n/** Exactly three authoritative delivery stages. */\nexport const ReadinessStages = Schema.Struct({\n build: BuildReadinessStage,\n verify: VerifyReadinessStage,\n production: ProductionReadinessStage\n})\n\n/** Decoded readiness stages. */\nexport type ReadinessStages = typeof ReadinessStages.Type\n\n/** Complete, decoded input for one environment evaluation. */\nexport const EnvironmentReadinessEvaluationInput = Schema.Struct({\n assessmentId: ReadinessAssessmentId,\n previousAssessmentId: Schema.NullOr(ReadinessAssessmentId),\n candidate: EnvironmentReadinessCandidateIdentity,\n rule: ReadinessRuleReference,\n derivationVersion: ReadinessDerivationVersion,\n evaluatedAt: UtcTimestamp,\n complete: Schema.Boolean,\n definitions: Schema.Array(ReadinessFactDefinition).check(Schema.isMaxLength(512)),\n observations: Schema.Array(ReadinessFactObservation).check(Schema.isMaxLength(512))\n}).check(\n Schema.makeFilter(\n ({ assessmentId, previousAssessmentId }) => previousAssessmentId === null || previousAssessmentId !== assessmentId,\n { expected: \"an environment readiness input not to supersede itself\" }\n ),\n Schema.makeFilter(\n ({ derivationVersion }) => derivationVersion === READINESS_DERIVATION_VERSION_V1,\n { expected: \"the V1 environment evaluator to use derivation version 1\" }\n ),\n Schema.makeFilter(({ definitions }) => unique(definitions.map(({ factId }) => factId)), {\n expected: \"readiness fact definitions to have unique identities\"\n }),\n Schema.makeFilter(({ observations }) => unique(observations.map(({ factId }) => factId)), {\n expected: \"readiness fact observations to have unique identities\"\n }),\n Schema.makeFilter(\n ({ observations }) =>\n observations.reduce((total, observation) => total + observation.evidence.length, 0) <=\n MAX_READINESS_EVIDENCE_REFERENCES,\n {\n expected: \"environment readiness input to fit its bounded assessment evidence set\"\n }\n ),\n Schema.makeFilter(({ definitions, observations }) => {\n const definitionsById = new Map(definitions.map((definition) => [definition.factId, definition]))\n return observations.every((observation) => definitionsById.get(observation.factId)?.kind === observation.state._tag)\n }, { expected: \"readiness observations to match one policy fact of the same kind\" }),\n Schema.makeFilter(({ definitions, observations }) => readinessPolicyShapeIsV1(definitions, observations), {\n expected: \"environment readiness input to contain the complete V1 policy shape\"\n })\n)\n\n/** Decoded environment-readiness input. */\nexport type EnvironmentReadinessEvaluationInput = typeof EnvironmentReadinessEvaluationInput.Type\n\nconst factEvidenceIds = (facts: ReadonlyArray<ReadinessFactEvaluation>): Array<EvidenceId> =>\n sortedReadinessUnique(facts.flatMap(({ evidenceIds }) => evidenceIds))\n\nconst factsOfKinds = (\n facts: ReadonlyArray<ReadinessFactEvaluation>,\n kinds: ReadonlyArray<ReadinessFactKind>\n): ReadonlyArray<ReadinessFactEvaluation> => facts.filter(({ definition }) => kinds.includes(definition.kind))\n\nconst stageMatchesFacts = (\n stage: ReadinessStages[\"build\"] | ReadinessStages[\"verify\"] | ReadinessStages[\"production\"],\n facts: ReadonlyArray<ReadinessFactEvaluation>\n): boolean =>\n sameOrderedStrings(\n stage.factIds,\n sortedReadinessUnique(facts.map(({ definition }) => definition.factId))\n ) && sameOrderedStrings(stage.evidenceIds, factEvidenceIds(facts))\n\nconst canonicalAssessmentCollections = (assessment: {\n readonly blockers: ReadonlyArray<ReadinessFinding>\n readonly evidenceIds: ReadonlyArray<EvidenceId>\n readonly gaps: ReadonlyArray<ReadinessFinding>\n readonly sourceFreshness: ReadonlyArray<ReadinessSourceSummary>\n readonly stages: ReadinessStages\n readonly warnings: ReadonlyArray<ReadinessFinding>\n}): boolean => {\n const evidence = new Set(assessment.evidenceIds)\n const findings = [assessment.blockers, assessment.warnings, assessment.gaps]\n return isCanonicalStrings(assessment.evidenceIds) &&\n findings.every((items) =>\n sameOrderedStrings(items.map(readinessFindingKey), items.map(readinessFindingKey).sort(compareReadinessText)) &&\n unique(items.map(readinessFindingKey)) &&\n items.every(({ evidenceIds }) =>\n isCanonicalStrings(evidenceIds) && evidenceIds.every((evidenceId) => evidence.has(evidenceId))\n )\n ) &&\n isCanonicalStrings(assessment.stages.build.factIds) &&\n isCanonicalStrings(assessment.stages.build.evidenceIds) &&\n isCanonicalStrings(assessment.stages.verify.factIds) &&\n isCanonicalStrings(assessment.stages.verify.evidenceIds) &&\n isCanonicalStrings(assessment.stages.production.factIds) &&\n isCanonicalStrings(assessment.stages.production.evidenceIds) &&\n isCanonicalStrings(assessment.sourceFreshness.map(({ pluginConnectionId }) => pluginConnectionId)) &&\n assessment.sourceFreshness.every(({ evidenceIds }) =>\n isCanonicalStrings(evidenceIds) && evidenceIds.every((evidenceId) => evidence.has(evidenceId))\n )\n}\n\nconst AssessmentBase = {\n assessmentId: ReadinessAssessmentId,\n previousAssessmentId: Schema.NullOr(ReadinessAssessmentId),\n candidate: ReadinessCandidateIdentity,\n rule: ReadinessRuleReference,\n derivationVersion: ReadinessDerivationVersion,\n evaluatedAt: UtcTimestamp,\n nextEvaluationAt: Schema.NullOr(UtcTimestamp),\n verdict: ReadinessVerdict,\n stages: ReadinessStages,\n blockers: Schema.Array(ReadinessFinding).check(Schema.isMaxLength(MAX_READINESS_FINDINGS)),\n warnings: Schema.Array(ReadinessFinding).check(Schema.isMaxLength(MAX_READINESS_FINDINGS)),\n gaps: Schema.Array(ReadinessFinding).check(Schema.isMaxLength(MAX_READINESS_FINDINGS)),\n sourceFreshness: Schema.Array(ReadinessSourceSummary).check(Schema.isMaxLength(512)),\n evidenceIds: Schema.Array(EvidenceId).check(Schema.isMaxLength(MAX_READINESS_EVIDENCE_REFERENCES))\n}\n\n/** Immutable environment assessment retaining exact facts and evidence. */\nexport const EnvironmentReadinessAssessment = Schema.Struct({\n ...AssessmentBase,\n _tag: Schema.Literal(\"environment\"),\n candidate: EnvironmentReadinessCandidateIdentity,\n inputComplete: Schema.Boolean,\n facts: Schema.Array(ReadinessFactEvaluation).check(Schema.isMaxLength(512)),\n requiredFactIds: Schema.Array(ReadinessFactId).check(Schema.isMaxLength(512)),\n verifiedFactIds: Schema.Array(ReadinessFactId).check(Schema.isMaxLength(512))\n}).check(\n Schema.makeFilter(\n ({ derivationVersion }) => derivationVersion === READINESS_DERIVATION_VERSION_V1,\n { expected: \"an environment readiness assessment derived by V1\" }\n ),\n Schema.makeFilter(\n ({ assessmentId, previousAssessmentId }) => previousAssessmentId === null || previousAssessmentId !== assessmentId,\n {\n expected: \"a readiness assessment not to supersede itself\"\n }\n ),\n Schema.makeFilter(({ facts }) => isCanonicalStrings(facts.map(({ definition }) => definition.factId)), {\n expected: \"environment readiness facts to have canonical unique identities\"\n }),\n Schema.makeFilter(\n ({ facts }) =>\n readinessPolicyShapeIsV1(\n facts.map(({ definition }) => definition),\n facts.flatMap(({ observation }) => observation === null ? [] : [observation])\n ),\n { expected: \"environment readiness assessment to retain the complete V1 policy shape\" }\n ),\n Schema.makeFilter(({ facts, requiredFactIds }) =>\n sameOrderedStrings(\n requiredFactIds,\n sortedReadinessUnique(\n facts\n .filter(({ definition }) => definition.requirement === \"required\")\n .map(({ definition }) => definition.factId)\n )\n ), { expected: \"environment readiness required facts to match retained evaluations\" }),\n Schema.makeFilter(({ facts, verifiedFactIds }) =>\n sameOrderedStrings(\n verifiedFactIds,\n sortedReadinessUnique(\n facts\n .filter(({ result }) => result === \"verified\")\n .map(({ definition }) => definition.factId)\n )\n ), { expected: \"environment readiness verified facts to match retained evaluations\" }),\n Schema.makeFilter(({ blockers, facts, gaps, inputComplete, warnings }) => {\n const expected = deriveReadinessFindings(facts, inputComplete)\n return sameOrderedStrings(blockers.map(readinessFindingKey), expected.blockers.map(readinessFindingKey)) &&\n sameOrderedStrings(warnings.map(readinessFindingKey), expected.warnings.map(readinessFindingKey)) &&\n sameOrderedStrings(gaps.map(readinessFindingKey), expected.gaps.map(readinessFindingKey))\n }, { expected: \"environment readiness findings to match retained fact evaluations\" }),\n Schema.makeFilter(({ evidenceIds, facts }) =>\n sameOrderedStrings(\n evidenceIds,\n factEvidenceIds(facts)\n ), { expected: \"environment readiness evidence to match retained fact dependencies\" }),\n Schema.makeFilter(({ facts, stages }) => {\n const build = factsOfKinds(facts, [\"execution\"])\n const verify = factsOfKinds(facts, [\"relationship\", \"approval\", \"check\", \"documentation\"])\n const production = factsOfKinds(facts, [\"deployment\"])\n return stageMatchesFacts(stages.build, build) &&\n stageMatchesFacts(stages.verify, verify) &&\n stageMatchesFacts(stages.production, production)\n }, { expected: \"environment readiness stages to retain their exact fact and evidence dependencies\" }),\n Schema.makeFilter(({ facts, stages }) => readinessStagesAreEqual(stages, deriveReadinessStages(facts)), {\n expected: \"environment readiness stage states to match retained fact evaluations\"\n }),\n Schema.makeFilter(({ facts, sourceFreshness }) => {\n const expected = deriveReadinessSourceSummaries(facts)\n return sourceFreshness.length === expected.length && sourceFreshness.every((summary, index) => {\n const item = expected[index]\n return item !== undefined &&\n summary.pluginConnectionId === item.pluginConnectionId &&\n summary.freshness === item.freshness &&\n summary.health === item.health &&\n sameOrderedStrings(summary.evidenceIds, item.evidenceIds)\n })\n }, { expected: \"environment readiness source summaries to match retained evidence\" }),\n Schema.makeFilter(({ facts, nextEvaluationAt }) => {\n const expected = deriveReadinessNextEvaluationAt(facts)\n return expected === null || nextEvaluationAt === null\n ? expected === nextEvaluationAt\n : DateTime.Order(expected, nextEvaluationAt) === 0\n }, { expected: \"environment readiness reevaluation time to match retained evidence\" }),\n Schema.makeFilter(canonicalAssessmentCollections, {\n expected: \"environment readiness collections to be canonical and evidence-bound\"\n }),\n Schema.makeFilter((assessment) => assessment.verdict === deriveEnvironmentReadinessVerdict(assessment), {\n expected: \"environment readiness verdict to agree with retained facts, findings, and stages\"\n })\n)\n\n/** Decoded immutable environment assessment. */\nexport type EnvironmentReadinessAssessment = typeof EnvironmentReadinessAssessment.Type\n\n/** Compact immutable child retained by a release-scope roll-up. */\nexport const EnvironmentReadinessSummary = Schema.Struct({\n assessmentId: ReadinessAssessmentId,\n environmentId: EnvironmentId,\n candidateDigest: ReadinessCandidateDigest,\n inputComplete: Schema.Boolean,\n facts: Schema.Array(ReadinessFactEvaluation).check(Schema.isMaxLength(512)),\n nextEvaluationAt: Schema.NullOr(UtcTimestamp),\n verdict: ReadinessVerdict,\n stages: ReadinessStages,\n blockers: Schema.Array(ReadinessFinding).check(Schema.isMaxLength(MAX_READINESS_FINDINGS)),\n warnings: Schema.Array(ReadinessFinding).check(Schema.isMaxLength(MAX_READINESS_FINDINGS)),\n gaps: Schema.Array(ReadinessFinding).check(Schema.isMaxLength(MAX_READINESS_FINDINGS)),\n sourceFreshness: Schema.Array(ReadinessSourceSummary).check(Schema.isMaxLength(512)),\n evidenceIds: Schema.Array(EvidenceId).check(Schema.isMaxLength(MAX_READINESS_EVIDENCE_REFERENCES))\n}).check(\n Schema.makeFilter(({ facts }) => isCanonicalStrings(facts.map(({ definition }) => definition.factId)), {\n expected: \"an environment readiness summary to have canonical unique facts\"\n }),\n Schema.makeFilter(\n ({ facts }) =>\n readinessPolicyShapeIsV1(\n facts.map(({ definition }) => definition),\n facts.flatMap(({ observation }) => observation === null ? [] : [observation])\n ),\n { expected: \"an environment readiness summary to retain the complete V1 policy shape\" }\n ),\n Schema.makeFilter(({ blockers, facts, gaps, inputComplete, warnings }) => {\n const expected = deriveReadinessFindings(facts, inputComplete)\n return sameOrderedStrings(blockers.map(readinessFindingKey), expected.blockers.map(readinessFindingKey)) &&\n sameOrderedStrings(warnings.map(readinessFindingKey), expected.warnings.map(readinessFindingKey)) &&\n sameOrderedStrings(gaps.map(readinessFindingKey), expected.gaps.map(readinessFindingKey))\n }, { expected: \"environment readiness summary findings to match retained facts\" }),\n Schema.makeFilter(({ evidenceIds, facts }) => sameOrderedStrings(evidenceIds, factEvidenceIds(facts)), {\n expected: \"environment readiness summary evidence to match retained facts\"\n }),\n Schema.makeFilter(({ facts, stages }) => readinessStagesAreEqual(stages, deriveReadinessStages(facts)), {\n expected: \"environment readiness summary stages to match retained facts\"\n }),\n Schema.makeFilter(({ facts, sourceFreshness }) => {\n const expected = deriveReadinessSourceSummaries(facts)\n return sourceFreshness.length === expected.length && sourceFreshness.every((summary, index) => {\n const item = expected[index]\n return item !== undefined &&\n summary.pluginConnectionId === item.pluginConnectionId &&\n summary.freshness === item.freshness &&\n summary.health === item.health &&\n sameOrderedStrings(summary.evidenceIds, item.evidenceIds)\n })\n }, { expected: \"environment readiness summary sources to match retained facts\" }),\n Schema.makeFilter(({ facts, nextEvaluationAt }) => {\n const expected = deriveReadinessNextEvaluationAt(facts)\n return expected === null || nextEvaluationAt === null\n ? expected === nextEvaluationAt\n : DateTime.Order(expected, nextEvaluationAt) === 0\n }, { expected: \"environment readiness summary reevaluation time to match retained facts\" }),\n Schema.makeFilter(canonicalAssessmentCollections, {\n expected: \"environment readiness summary collections to be canonical and evidence-bound\"\n }),\n Schema.makeFilter((summary) => summary.verdict === deriveEnvironmentReadinessVerdict(summary), {\n expected: \"environment readiness summary verdict to match retained facts, findings, and stages\"\n })\n)\n\n/** Immutable release assessment rolled up from current target environments. */\nexport const ReleaseReadinessAssessment = Schema.Struct({\n ...AssessmentBase,\n _tag: Schema.Literal(\"release\"),\n candidate: ReleaseReadinessCandidateIdentity,\n environments: Schema.NonEmptyArray(EnvironmentReadinessSummary).check(Schema.isMaxLength(512))\n}).check(\n Schema.makeFilter(\n ({ derivationVersion }) => derivationVersion === READINESS_DERIVATION_VERSION_V1,\n { expected: \"a release readiness assessment derived by V1\" }\n ),\n Schema.makeFilter(\n ({ assessmentId, previousAssessmentId }) => previousAssessmentId === null || previousAssessmentId !== assessmentId,\n {\n expected: \"a release readiness assessment not to supersede itself\"\n }\n ),\n Schema.makeFilter(({ environments }) => isCanonicalStrings(environments.map(({ environmentId }) => environmentId)), {\n expected: \"release readiness environments to have canonical unique identities\"\n }),\n Schema.makeFilter(\n ({ environments, stages }) => readinessStagesAreEqual(stages, deriveReleaseReadinessStages(environments)),\n { expected: \"release readiness stages to match retained environment summaries\" }\n ),\n Schema.makeFilter(({ blockers, environments, gaps, warnings }) => {\n const expected = deriveReleaseReadinessFindings(environments)\n return sameOrderedStrings(blockers.map(readinessFindingKey), expected.blockers.map(readinessFindingKey)) &&\n sameOrderedStrings(warnings.map(readinessFindingKey), expected.warnings.map(readinessFindingKey)) &&\n sameOrderedStrings(gaps.map(readinessFindingKey), expected.gaps.map(readinessFindingKey))\n }, { expected: \"release readiness findings to match retained environment summaries\" }),\n Schema.makeFilter(({ environments, sourceFreshness }) => {\n const expected = deriveReleaseReadinessSourceSummaries(environments)\n return sourceFreshness.length === expected.length && sourceFreshness.every((summary, index) => {\n const item = expected[index]\n return item !== undefined &&\n summary.pluginConnectionId === item.pluginConnectionId &&\n summary.freshness === item.freshness &&\n summary.health === item.health &&\n sameOrderedStrings(summary.evidenceIds, item.evidenceIds)\n })\n }, { expected: \"release readiness sources to match retained environment summaries\" }),\n Schema.makeFilter(({ environments, nextEvaluationAt }) => {\n const expected = deriveReleaseReadinessNextEvaluationAt(environments)\n return expected === null || nextEvaluationAt === null\n ? expected === nextEvaluationAt\n : DateTime.Order(expected, nextEvaluationAt) === 0\n }, { expected: \"release readiness reevaluation time to match retained environment summaries\" }),\n Schema.makeFilter(({ environments, evidenceIds }) =>\n sameOrderedStrings(\n evidenceIds,\n sortedReadinessUnique(environments.flatMap(({ evidenceIds }) => evidenceIds))\n ), { expected: \"release readiness evidence to match retained environment summaries\" }),\n Schema.makeFilter(canonicalAssessmentCollections, {\n expected: \"release readiness collections to be canonical and evidence-bound\"\n }),\n Schema.makeFilter(({ environments, verdict }) => verdict === deriveReleaseReadinessVerdict(environments), {\n expected: \"release readiness verdict to agree with its environment summaries\"\n })\n)\n\n/** Decoded immutable release readiness assessment. */\nexport type ReleaseReadinessAssessment = typeof ReleaseReadinessAssessment.Type\n\n/** Any immutable server-authoritative readiness assessment. */\nexport const ReadinessAssessment = Schema.Union([\n EnvironmentReadinessAssessment,\n ReleaseReadinessAssessment\n]).pipe(Schema.toTaggedUnion(\"_tag\"))\n\n/** Decoded readiness assessment. */\nexport type ReadinessAssessment = typeof ReadinessAssessment.Type\n\n/** Complete, decoded input for one release-scope roll-up. */\nexport const ReleaseReadinessRollupInput = Schema.Struct({\n assessmentId: ReadinessAssessmentId,\n previousAssessmentId: Schema.NullOr(ReadinessAssessmentId),\n candidate: ReleaseReadinessCandidateIdentity,\n evaluatedAt: UtcTimestamp,\n environments: Schema.NonEmptyArray(EnvironmentReadinessAssessment).check(Schema.isMaxLength(512))\n}).check(\n Schema.makeFilter(\n ({ assessmentId, previousAssessmentId }) => previousAssessmentId === null || previousAssessmentId !== assessmentId,\n { expected: \"a release readiness roll-up input not to supersede itself\" }\n ),\n Schema.makeFilter(({ environments }) => unique(environments.map(({ candidate }) => candidate.scope.environmentId)), {\n expected: \"release readiness roll-up environment identities to be unique\"\n }),\n Schema.makeFilter(\n ({ candidate, environments }) =>\n environments.every((assessment) =>\n assessment.candidate.workspaceId === candidate.workspaceId &&\n assessment.candidate.scope.releaseId === candidate.scope.releaseId &&\n assessment.candidate.releaseRevision === candidate.releaseRevision &&\n assessment.candidate.artifactRevision === candidate.artifactRevision\n ),\n {\n expected: \"release readiness roll-up children to name the same workspace, release, and candidate revision\"\n }\n ),\n Schema.makeFilter(\n ({ environments }) =>\n environments.every((assessment) =>\n assessment.rule.ruleId === environments[0]?.rule.ruleId &&\n assessment.rule.version === environments[0]?.rule.version &&\n assessment.rule.digest === environments[0]?.rule.digest &&\n assessment.derivationVersion === environments[0]?.derivationVersion\n ),\n { expected: \"release readiness roll-up children to use one rule and derivation version\" }\n ),\n Schema.makeFilter(\n ({ environments }) =>\n sortedReadinessUnique(environments.flatMap(({ evidenceIds }) => evidenceIds)).length <=\n MAX_READINESS_EVIDENCE_REFERENCES,\n {\n expected: \"release readiness roll-up evidence to fit its bounded assessment\"\n }\n ),\n Schema.makeFilter(({ environments }) =>\n [\"build\", \"verify\", \"production\"].every((stage) => {\n if (stage === \"build\") {\n return sortedReadinessUnique(environments.flatMap(({ stages }) => stages.build.factIds)).length <= 512\n }\n if (stage === \"verify\") {\n return sortedReadinessUnique(environments.flatMap(({ stages }) => stages.verify.factIds)).length <= 512\n }\n return sortedReadinessUnique(environments.flatMap(({ stages }) => stages.production.factIds)).length <= 512\n }), { expected: \"release readiness roll-up facts to fit its bounded stages\" }),\n Schema.makeFilter(\n ({ environments }) =>\n environments.reduce((total, assessment) => total + assessment.blockers.length, 0) <=\n MAX_READINESS_FINDINGS &&\n environments.reduce((total, assessment) => total + assessment.warnings.length, 0) <=\n MAX_READINESS_FINDINGS &&\n environments.reduce((total, assessment) => total + assessment.gaps.length, 0) <=\n MAX_READINESS_FINDINGS,\n {\n expected: \"release readiness roll-up findings to fit its bounded assessment\"\n }\n ),\n Schema.makeFilter(\n ({ environments }) =>\n sortedReadinessUnique(\n environments.flatMap(({ sourceFreshness }) =>\n sourceFreshness.map(({ pluginConnectionId }) => pluginConnectionId)\n )\n ).length <= 512,\n {\n expected: \"release readiness roll-up sources to fit its bounded assessment\"\n }\n ),\n Schema.makeFilter(\n ({ environments, evaluatedAt }) =>\n environments.every((assessment) => DateTime.Order(assessment.evaluatedAt, evaluatedAt) <= 0),\n { expected: \"release readiness roll-up not to predate its child assessments\" }\n )\n)\n\n/** Decoded release-readiness roll-up input. */\nexport type ReleaseReadinessRollupInput = typeof ReleaseReadinessRollupInput.Type\n","import * as DateTime from \"effect/DateTime\"\nimport * as Schema from \"effect/Schema\"\nimport {\n AgentId,\n EntityId,\n EnvironmentId,\n PersonId,\n PluginConnectionId,\n ReleaseId,\n RoleAssignmentId,\n WorkspaceId\n} from \"./identifiers.js\"\nimport { ProviderId, VendorImmutableId } from \"./sourceRevision.js\"\nimport { UtcTimestamp } from \"./utcTimestamp.js\"\n\nconst DisplayName = Schema.String.check(Schema.isTrimmed(), Schema.isMinLength(1), Schema.isMaxLength(200))\nconst AvatarReferenceValue = Schema.String.check(\n Schema.isTrimmed(),\n Schema.isMinLength(1),\n Schema.isMaxLength(500)\n)\nconst Initials = Schema.String.check(Schema.isTrimmed(), Schema.isMinLength(1), Schema.isMaxLength(4))\n\n/** An immutable provider identity associated with a canonical person. */\nexport const PersonSourceIdentity = Schema.Struct({\n pluginConnectionId: PluginConnectionId,\n providerId: ProviderId,\n vendorPersonId: VendorImmutableId\n})\n\n/** Decoded person identity from a provider. */\nexport type PersonSourceIdentity = typeof PersonSourceIdentity.Type\n\n/** Avatar media reference or deterministic initials fallback. */\nexport const PersonAvatar = Schema.TaggedUnion({\n initials: {\n text: Initials\n },\n reference: {\n reference: AvatarReferenceValue\n }\n})\n\n/** Decoded person avatar representation. */\nexport type PersonAvatar = typeof PersonAvatar.Type\n\n/**\n * Derives a stable one- or two-token initials fallback from a display name.\n * The first code point of the first and last non-empty tokens is used.\n */\nexport const derivePersonInitials = (displayName: string): string => {\n const tokens = displayName.trim().split(/\\s+/u).filter(Boolean)\n const firstToken = tokens.at(0) ?? \"\"\n const lastToken = tokens.at(-1) ?? \"\"\n const firstInitial = Array.from(firstToken).at(0) ?? \"\"\n const lastInitial = tokens.length > 1 ? (Array.from(lastToken).at(0) ?? \"\") : \"\"\n return `${firstInitial}${lastInitial}`.toLocaleUpperCase(\"en-US\")\n}\n\nconst PersonSchema = Schema.Struct({\n avatar: PersonAvatar,\n displayName: DisplayName,\n isActive: Schema.Boolean,\n personId: PersonId,\n sourceIdentities: Schema.Array(PersonSourceIdentity)\n}).check(\n Schema.makeFilter(\n ({ avatar, displayName }) => avatar._tag === \"reference\" || avatar.text === derivePersonInitials(displayName),\n { expected: \"initials avatar to match the deterministic display-name fallback\" }\n ),\n Schema.makeFilter(\n ({ sourceIdentities }) => {\n const identityKeys = sourceIdentities.map(\n ({ pluginConnectionId, providerId, vendorPersonId }) =>\n `${providerId}\\u0000${pluginConnectionId}\\u0000${vendorPersonId}`\n )\n return new Set(identityKeys).size === identityKeys.length\n },\n { expected: \"person source identities to be unique\" }\n )\n)\n\n/** Canonical person with provider identities and an accessible avatar fallback. */\nexport const Person = PersonSchema\n\n/** Decoded canonical person. */\nexport type Person = typeof Person.Type\n\n/** Human collaborator responsible for a domain action. */\nexport const HumanActor = Schema.TaggedStruct(\"human\", {\n personId: PersonId\n})\n\n/** Decoded human actor. */\nexport type HumanActor = typeof HumanActor.Type\n\n/** Automated agent responsible for a domain action. */\nexport const AgentActor = Schema.TaggedStruct(\"agent\", {\n agentId: AgentId\n})\n\n/** Decoded agent actor. */\nexport type AgentActor = typeof AgentActor.Type\n\n/** Human or agent responsible for a domain action. */\nexport const Actor = Schema.Union([HumanActor, AgentActor]).pipe(Schema.toTaggedUnion(\"_tag\"))\n\n/** Decoded human or agent actor. */\nexport type Actor = typeof Actor.Type\n\n/** Explicit collaboration role stored with an assignment. */\nexport const Role = Schema.Literals([\n \"workspace-owner\",\n \"workspace-approver\",\n \"release-owner\",\n \"release-approver\",\n \"change-owner\",\n \"issue-owner\",\n \"issue-assignee\",\n \"page-owner\",\n \"author\",\n \"contributor\",\n \"reviewer\",\n \"operator\",\n \"deployment-approver\",\n \"merge-approver\",\n \"watcher\"\n])\n\n/** Decoded collaboration role. */\nexport type Role = typeof Role.Type\n\n/** Exact domain scope to which a role assignment applies. */\nexport const RoleScope = Schema.TaggedUnion({\n entity: {\n entityId: EntityId,\n workspaceId: WorkspaceId\n },\n environment: {\n environmentId: EnvironmentId,\n releaseId: ReleaseId,\n workspaceId: WorkspaceId\n },\n release: {\n releaseId: ReleaseId,\n workspaceId: WorkspaceId\n },\n workspace: {\n workspaceId: WorkspaceId\n }\n})\n\n/** Decoded role-assignment scope. */\nexport type RoleScope = typeof RoleScope.Type\n\nconst ActiveAssignmentLifecycle = Schema.TaggedStruct(\"active\", {\n assignedAt: UtcTimestamp\n})\n\nconst EndedAssignmentLifecycle = Schema.TaggedStruct(\"ended\", {\n assignedAt: UtcTimestamp,\n endedAt: UtcTimestamp\n}).check(\n Schema.makeFilter(\n ({ assignedAt, endedAt }) => DateTime.Order(assignedAt, endedAt) <= 0,\n { expected: \"assignment end time to be at or after assignment time\" }\n )\n)\n\nconst RevokedAssignmentLifecycle = Schema.TaggedStruct(\"revoked\", {\n assignedAt: UtcTimestamp,\n revokedAt: UtcTimestamp\n}).check(\n Schema.makeFilter(\n ({ assignedAt, revokedAt }) => DateTime.Order(assignedAt, revokedAt) <= 0,\n { expected: \"assignment revocation time to be at or after assignment time\" }\n )\n)\n\n/** Lifecycle and chronological bounds of a role assignment. */\nexport const AssignmentLifecycle = Schema.Union([\n ActiveAssignmentLifecycle,\n EndedAssignmentLifecycle,\n RevokedAssignmentLifecycle\n]).pipe(Schema.toTaggedUnion(\"_tag\"))\n\n/** Decoded assignment lifecycle. */\nexport type AssignmentLifecycle = typeof AssignmentLifecycle.Type\n\n/** Persisted binding of a human or agent role to one exact domain scope. */\nexport const RoleAssignment = Schema.Struct({\n actor: Actor,\n assignmentId: RoleAssignmentId,\n lifecycle: AssignmentLifecycle,\n role: Role,\n scope: RoleScope\n})\n\n/** Decoded role assignment. */\nexport type RoleAssignment = typeof RoleAssignment.Type\n","import { Schema } from \"effect\"\nimport type { ReleaseId } from \"./identifiers.js\"\n\n/** Canonical persisted algorithm label for the current Release Relay projection. */\nexport const RELEASE_RELAY_ALGORITHM = \"relay/v1\"\n\n/** Explicit v1 alias retained beside the versioned catalog constants. */\nexport const RELEASE_RELAY_V1_ALGORITHM = RELEASE_RELAY_ALGORITHM\n\ntype RelayCatalog = readonly [\n string,\n string,\n string,\n string,\n string,\n string,\n string,\n string,\n string,\n string,\n string,\n string,\n string,\n string,\n string,\n string\n]\n\nconst freezeCatalog = <const Catalog extends RelayCatalog>(catalog: Catalog): Readonly<Catalog> =>\n Object.freeze(catalog)\n\n/** Frozen adjective catalog whose order is part of the relay/v1 contract. */\nexport const RELEASE_RELAY_V1_ADJECTIVES = freezeCatalog([\n \"Amber\",\n \"Azure\",\n \"Copper\",\n \"Ember\",\n \"Golden\",\n \"Lunar\",\n \"Moss\",\n \"Nova\",\n \"Quiet\",\n \"Silver\",\n \"Solar\",\n \"Tidal\",\n \"Velvet\",\n \"Verdant\",\n \"Wild\",\n \"Winter\"\n])\n\n/** Frozen noun catalog whose order is part of the relay/v1 contract. */\nexport const RELEASE_RELAY_V1_NOUNS = freezeCatalog([\n \"Anchor\",\n \"Beacon\",\n \"Bridge\",\n \"Comet\",\n \"Finch\",\n \"Fork\",\n \"Gate\",\n \"Grove\",\n \"Harbor\",\n \"Orbit\",\n \"Pulse\",\n \"Reef\",\n \"Relay\",\n \"Spark\",\n \"Wave\",\n \"Willow\"\n])\n\n/** Schema for the relay/v1 algorithm discriminator. */\nexport const ReleaseRelayAlgorithm = Schema.Literal(RELEASE_RELAY_ALGORITHM)\n\n/** Persisted relay/v1 adjective. */\nexport const ReleaseRelayAdjective = Schema.Literals(RELEASE_RELAY_V1_ADJECTIVES)\n\n/** Persisted relay/v1 noun. */\nexport const ReleaseRelayNoun = Schema.Literals(RELEASE_RELAY_V1_NOUNS)\n\n/** Persisted relay/v1 codename assembled from the frozen catalogs. */\nexport const ReleaseRelayCodename = Schema.TemplateLiteral([ReleaseRelayAdjective, \" \", ReleaseRelayNoun])\n\n/** Closed index into rly's separately versioned 16-symbol presentation catalog. */\nexport const ReleaseRelaySymbolIndex = Schema.Literals([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15])\n\n/** Decoded relay/v1 symbol index. */\nexport type ReleaseRelaySymbolIndex = typeof ReleaseRelaySymbolIndex.Type\n\n/** Exactly three distinct persisted indices into the release-symbol catalog. */\nexport const ReleaseRelaySymbolIndices = Schema.Tuple([\n ReleaseRelaySymbolIndex,\n ReleaseRelaySymbolIndex,\n ReleaseRelaySymbolIndex\n]).check(Schema.isUnique({ expected: \"three distinct release symbol indices\" }))\n\n/** Decoded three-symbol relay projection. */\nexport type ReleaseRelaySymbolIndices = typeof ReleaseRelaySymbolIndices.Type\n\n/** Versioned, persisted Release Relay identity owned by the Control Center domain. */\nexport const ReleaseRelayProjection = Schema.Struct({\n algorithm: ReleaseRelayAlgorithm,\n codename: ReleaseRelayCodename,\n symbolIndices: ReleaseRelaySymbolIndices\n})\n\n/** Decoded versioned Release Relay projection. */\nexport type ReleaseRelayProjection = typeof ReleaseRelayProjection.Type\n\nconst FNV_1A_OFFSET_BASIS = 0x81_1c_9d_c5\nconst FNV_1A_PRIME = 0x01_00_01_93\n\nconst fnv1a32 = (asciiValue: string): number => {\n let hash = FNV_1A_OFFSET_BASIS\n for (let index = 0; index < asciiValue.length; index += 1) {\n hash ^= asciiValue.charCodeAt(index)\n hash = Math.imul(hash, FNV_1A_PRIME) >>> 0\n }\n return hash\n}\n\nconst symbolIndexFromRemainder = (remainder: number): ReleaseRelaySymbolIndex => {\n switch (remainder) {\n case 0:\n return 0\n case 1:\n return 1\n case 2:\n return 2\n case 3:\n return 3\n case 4:\n return 4\n case 5:\n return 5\n case 6:\n return 6\n case 7:\n return 7\n case 8:\n return 8\n case 9:\n return 9\n case 10:\n return 10\n case 11:\n return 11\n case 12:\n return 12\n case 13:\n return 13\n case 14:\n return 14\n default:\n return 15\n }\n}\n\nconst catalogValueAt = <const Catalog extends RelayCatalog>(\n catalog: Catalog,\n index: ReleaseRelaySymbolIndex\n): Catalog[number] => {\n switch (index) {\n case 0:\n return catalog[0]\n case 1:\n return catalog[1]\n case 2:\n return catalog[2]\n case 3:\n return catalog[3]\n case 4:\n return catalog[4]\n case 5:\n return catalog[5]\n case 6:\n return catalog[6]\n case 7:\n return catalog[7]\n case 8:\n return catalog[8]\n case 9:\n return catalog[9]\n case 10:\n return catalog[10]\n case 11:\n return catalog[11]\n case 12:\n return catalog[12]\n case 13:\n return catalog[13]\n case 14:\n return catalog[14]\n default:\n return catalog[15]\n }\n}\n\nconst deriveSymbolIndices = (releaseId: ReleaseId): ReleaseRelaySymbolIndices => {\n const firstIndex = symbolIndexFromRemainder(fnv1a32(`${RELEASE_RELAY_ALGORITHM}|symbol/0|${releaseId}`) % 16)\n\n const secondRank = fnv1a32(`${RELEASE_RELAY_ALGORITHM}|symbol/1|${releaseId}`) % 15\n const secondIndex = symbolIndexFromRemainder(secondRank < firstIndex ? secondRank : secondRank + 1)\n\n const lowerExcludedIndex = Math.min(firstIndex, secondIndex)\n const upperExcludedIndex = Math.max(firstIndex, secondIndex)\n const thirdRank = fnv1a32(`${RELEASE_RELAY_ALGORITHM}|symbol/2|${releaseId}`) % 14\n const thirdIndex = symbolIndexFromRemainder(\n thirdRank < lowerExcludedIndex ? thirdRank : thirdRank < upperExcludedIndex - 1 ? thirdRank + 1 : thirdRank + 2\n )\n\n return [firstIndex, secondIndex, thirdIndex]\n}\n\n/**\n * Derive the stable relay/v1 projection for one canonical immutable release identifier.\n *\n * relay/v1 applies unsigned 32-bit FNV-1a to the ASCII domains\n * `relay/v1|adjective|<release-id>`, `relay/v1|noun|<release-id>`, and\n * `relay/v1|symbol/<position>|<release-id>`. Symbol hashes select ranks from the\n * remaining 16, 15, then 14 indices, making distinctness constructive.\n */\nexport const deriveReleaseRelay = (releaseId: ReleaseId): ReleaseRelayProjection => {\n const adjectiveIndex = symbolIndexFromRemainder(fnv1a32(`${RELEASE_RELAY_ALGORITHM}|adjective|${releaseId}`) % 16)\n const nounIndex = symbolIndexFromRemainder(fnv1a32(`${RELEASE_RELAY_ALGORITHM}|noun|${releaseId}`) % 16)\n const adjective = catalogValueAt(RELEASE_RELAY_V1_ADJECTIVES, adjectiveIndex)\n const noun = catalogValueAt(RELEASE_RELAY_V1_NOUNS, nounIndex)\n\n return {\n algorithm: RELEASE_RELAY_ALGORITHM,\n codename: `${adjective} ${noun}`,\n symbolIndices: deriveSymbolIndices(releaseId)\n }\n}\n","import * as DateTime from \"effect/DateTime\"\nimport * as Schema from \"effect/Schema\"\nimport { RoleAssignment } from \"./actors.js\"\nimport { Freshness } from \"./freshness.js\"\nimport { EnvironmentId, ReleaseId, WorkspaceId } from \"./identifiers.js\"\nimport { deriveReleaseRelay, ReleaseRelayProjection } from \"./releaseRelay.js\"\nimport { SourceRevision } from \"./sourceRevision.js\"\nimport { UtcTimestamp } from \"./utcTimestamp.js\"\n\n/** Human-readable service name retained independently of provider identity. */\nexport const ReleaseServiceName = Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(200)\n).pipe(Schema.brand(\"ReleaseServiceName\"))\n\n/** Decoded release service name. */\nexport type ReleaseServiceName = typeof ReleaseServiceName.Type\n\n/** Provider-neutral release version or immutable release label. */\nexport const ReleaseVersion = Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(100)\n).pipe(Schema.brand(\"ReleaseVersion\"))\n\n/** Decoded release version. */\nexport type ReleaseVersion = typeof ReleaseVersion.Type\n\n/** Lifecycle of the release aggregate, separate from readiness and pipeline state. */\nexport const ReleaseLifecycle = Schema.Literals([\n \"assembling\",\n \"candidate\",\n \"deploying\",\n \"released\",\n \"cancelled\"\n])\n\n/** Decoded release lifecycle. */\nexport type ReleaseLifecycle = typeof ReleaseLifecycle.Type\n\nconst ReleaseRecord = Schema.Struct({\n createdAt: UtcTimestamp,\n freshness: Freshness,\n id: ReleaseId,\n lifecycle: ReleaseLifecycle,\n relay: ReleaseRelayProjection,\n roleAssignments: Schema.Array(RoleAssignment),\n serviceName: ReleaseServiceName,\n sourceRevisions: Schema.Array(SourceRevision),\n targetEnvironmentIds: Schema.Array(EnvironmentId).check(\n Schema.isUnique({ expected: \"unique target environment identifiers\" })\n ),\n updatedAt: UtcTimestamp,\n version: ReleaseVersion,\n workspaceId: WorkspaceId\n})\n\nconst encodeSourceRevision = Schema.encodeSync(SourceRevision)\nconst sourceRevisionEquivalence = Schema.toEquivalence(Schema.toEncoded(SourceRevision))\n\n/**\n * Foundational release aggregate. Readiness, evidence, stages, and delivery\n * relationships extend this record in their owning slices.\n */\nexport const Release = ReleaseRecord.check(\n Schema.makeFilter(\n ({ createdAt, updatedAt }) => DateTime.Order(createdAt, updatedAt) <= 0,\n { expected: \"release update time to be at or after creation time\" }\n ),\n Schema.makeFilter(\n ({ roleAssignments, workspaceId }) => roleAssignments.every(({ scope }) => scope.workspaceId === workspaceId),\n { expected: \"every role assignment to belong to the release workspace\" }\n ),\n Schema.makeFilter(\n ({ id, roleAssignments }) =>\n roleAssignments.every(({ scope }) =>\n scope._tag === \"release\" || scope._tag === \"environment\" ? scope.releaseId === id : true\n ),\n { expected: \"release-scoped assignments to name this release\" }\n ),\n Schema.makeFilter(\n ({ roleAssignments, targetEnvironmentIds }) => {\n const targets = new Set(targetEnvironmentIds)\n return roleAssignments.every(({ scope }) =>\n scope._tag === \"environment\" ? targets.has(scope.environmentId) : true\n )\n },\n { expected: \"environment-scoped assignments to name a release target\" }\n ),\n Schema.makeFilter(\n ({ roleAssignments }) => {\n const assignmentIds = roleAssignments.map(({ assignmentId }) => assignmentId)\n return new Set(assignmentIds).size === assignmentIds.length\n },\n { expected: \"unique role assignment identifiers\" }\n ),\n Schema.makeFilter(\n ({ sourceRevisions }) => {\n const sourceKeys = sourceRevisions.map(\n ({ pluginConnectionId, providerId, vendorImmutableId }) =>\n `${providerId}\\u0000${pluginConnectionId}\\u0000${vendorImmutableId}`\n )\n return new Set(sourceKeys).size === sourceKeys.length\n },\n { expected: \"one current source revision per provider object\" }\n ),\n Schema.makeFilter(\n ({ freshness, sourceRevisions }) => {\n if (freshness._tag !== \"current\" && freshness._tag !== \"stale\") return true\n const freshnessRevision = encodeSourceRevision(freshness.provenance.sourceRevision)\n return (\n sourceRevisions.filter((sourceRevision) =>\n sourceRevisionEquivalence(encodeSourceRevision(sourceRevision), freshnessRevision)\n ).length === 1\n )\n },\n { expected: \"current or stale freshness provenance to match one release source revision\" }\n ),\n Schema.makeFilter(\n ({ id, relay }) => {\n const expected = deriveReleaseRelay(id)\n return (\n relay.algorithm === expected.algorithm &&\n relay.codename === expected.codename &&\n relay.symbolIndices.every((symbolIndex, index) => symbolIndex === expected.symbolIndices[index])\n )\n },\n { expected: \"persisted relay projection to match the canonical release identifier\" }\n )\n).annotate({ identifier: \"Release\" })\n\n/** Decoded foundational release aggregate. */\nexport type Release = typeof Release.Type\n","import * as Schema from \"effect/Schema\"\n\nimport { hasMaximumPluginJsonBytes, MaximumPluginDescriptorBytes } from \"./bounds.js\"\n\nconst NonNegativeInteger = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))\nconst PositiveInteger = Schema.Int.check(Schema.isGreaterThan(0))\n\nconst boundedIdentifier = (name: string, maximum: number) =>\n Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(maximum)\n ).pipe(Schema.brand(name))\n\n/** Stable reverse-DNS identity of a plugin, independent of package abbreviations. */\nexport const PluginId = boundedIdentifier(\"PluginId\", 200)\n\n/** Decoded stable plugin identity. */\nexport type PluginId = typeof PluginId.Type\n\n/** Strict structured semantic version used by plugin and adapter contracts. */\nexport const SemanticVersion = Schema.Struct({\n major: NonNegativeInteger,\n minor: NonNegativeInteger,\n patch: NonNegativeInteger\n}).annotate({ identifier: \"SemanticVersion\" })\n\n/** Decoded semantic version. */\nexport type SemanticVersion = typeof SemanticVersion.Type\n\n/** Independently versioned operations understood by the Control Center host. */\nexport const PluginCapabilityId = Schema.Literals([\n \"entity.read\",\n \"sync.incremental\",\n \"action.propose\",\n \"action.execute\",\n \"action.cancel\",\n \"action.reconcile\",\n \"diff.inventory\",\n \"diff.content\"\n]).annotate({ identifier: \"PluginCapabilityId\" })\n\n/** Decoded plugin capability identity. */\nexport type PluginCapabilityId = typeof PluginCapabilityId.Type\n\n/** A capability and the contract versions an adapter can implement. */\nexport const PluginCapabilityOfferV1 = Schema.Struct({\n capabilityId: PluginCapabilityId,\n supportedVersions: Schema.Array(PositiveInteger).check(\n Schema.isNonEmpty(),\n Schema.isUnique(),\n Schema.makeFilter((versions) => versions.length <= 16, {\n expected: \"at most 16 supported capability versions\"\n })\n ),\n requirement: Schema.Literals([\"required\", \"optional\"])\n}).annotate({ identifier: \"PluginCapabilityOfferV1\" })\n\n/** Decoded capability offer. */\nexport type PluginCapabilityOfferV1 = typeof PluginCapabilityOfferV1.Type\n\nconst ConfigurationKey = boundedIdentifier(\"PluginConfigurationKey\", 100)\nconst ConfigurationLabel = Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(200)\n)\nconst ConfigurationDescription = Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(500)\n)\n\nconst commonConfigurationFields = {\n key: ConfigurationKey,\n label: ConfigurationLabel,\n description: ConfigurationDescription,\n required: Schema.Boolean\n}\n\nconst TextConfigurationField = Schema.TaggedStruct(\"text\", commonConfigurationFields)\nconst UrlConfigurationField = Schema.TaggedStruct(\"url\", commonConfigurationFields)\nconst BooleanConfigurationField = Schema.TaggedStruct(\"boolean\", commonConfigurationFields)\nconst IntegerConfigurationField = Schema.TaggedStruct(\"integer\", {\n ...commonConfigurationFields,\n minimum: Schema.NullOr(Schema.Int),\n maximum: Schema.NullOr(Schema.Int)\n}).check(\n Schema.makeFilter(\n ({ maximum, minimum }) => maximum === null || minimum === null || minimum <= maximum,\n { expected: \"plugin integer configuration minimum not to exceed maximum\" }\n )\n)\nconst SelectConfigurationField = Schema.TaggedStruct(\"select\", {\n ...commonConfigurationFields,\n options: Schema.Array(Schema.Struct({\n label: ConfigurationLabel,\n value: boundedIdentifier(\"PluginConfigurationOption\", 200)\n })).check(\n Schema.isNonEmpty(),\n Schema.makeFilter((options) => options.length <= 100, {\n expected: \"at most 100 plugin configuration options\"\n }),\n Schema.makeFilter(\n (options) => new Set(options.map(({ value }) => value)).size === options.length,\n { expected: \"unique plugin configuration option values\" }\n )\n )\n})\nconst SecretReferenceConfigurationField = Schema.TaggedStruct(\"secret-reference\", {\n ...commonConfigurationFields,\n secretKind: Schema.Literals([\"token\", \"password\", \"private-key\", \"certificate\", \"opaque\"])\n})\n\n/** Secret-free metadata describing a plugin configuration field. */\nexport const PluginConfigurationFieldV1 = Schema.Union([\n TextConfigurationField,\n UrlConfigurationField,\n BooleanConfigurationField,\n IntegerConfigurationField,\n SelectConfigurationField,\n SecretReferenceConfigurationField\n]).pipe(Schema.toTaggedUnion(\"_tag\"))\n\n/** Decoded plugin configuration metadata. */\nexport type PluginConfigurationFieldV1 = typeof PluginConfigurationFieldV1.Type\n\n/** Raw version-one descriptor decoded before an adapter factory may run. */\nexport const PluginDescriptorV1 = Schema.Struct({\n contractId: Schema.Literal(\"dev.knpkv.control-center.plugin\"),\n contractVersion: SemanticVersion,\n pluginId: PluginId,\n adapterVersion: SemanticVersion,\n displayName: Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(200)\n ),\n configurationFields: Schema.Array(PluginConfigurationFieldV1).check(\n Schema.makeFilter((fields) => fields.length <= 100, {\n expected: \"at most 100 plugin configuration fields\"\n }),\n Schema.makeFilter(\n (fields) => new Set(fields.map(({ key }) => key)).size === fields.length,\n { expected: \"unique plugin configuration field keys\" }\n )\n ),\n capabilities: Schema.Array(PluginCapabilityOfferV1).check(\n Schema.isNonEmpty(),\n Schema.makeFilter((capabilities) => capabilities.length <= 32, {\n expected: \"at most 32 plugin capability offers\"\n })\n )\n}).check(\n hasMaximumPluginJsonBytes(MaximumPluginDescriptorBytes)\n).annotate({ identifier: \"PluginDescriptorV1\" })\n\n/** Decoded version-one plugin descriptor. */\nexport type PluginDescriptorV1 = typeof PluginDescriptorV1.Type\n\n/** One capability version selected by the host during negotiation. */\nexport const NegotiatedPluginCapabilityV1 = Schema.Struct({\n capabilityId: PluginCapabilityId,\n version: PositiveInteger\n}).annotate({ identifier: \"NegotiatedPluginCapabilityV1\" })\n\n/** Decoded negotiated capability. */\nexport type NegotiatedPluginCapabilityV1 = typeof NegotiatedPluginCapabilityV1.Type\n\n/** Descriptor accepted by the host after contract and capability negotiation. */\nexport const NegotiatedPluginDescriptorV1 = Schema.Struct({\n descriptor: PluginDescriptorV1,\n capabilities: Schema.Array(NegotiatedPluginCapabilityV1).check(\n Schema.isNonEmpty(),\n Schema.makeFilter((capabilities) => capabilities.length <= 32, {\n expected: \"at most 32 negotiated plugin capabilities\"\n }),\n Schema.makeFilter(\n (capabilities) => new Set(capabilities.map(({ capabilityId }) => capabilityId)).size === capabilities.length,\n { expected: \"unique negotiated plugin capabilities\" }\n )\n )\n}).annotate({ identifier: \"NegotiatedPluginDescriptorV1\" })\n\n/** Decoded negotiated plugin descriptor. */\nexport type NegotiatedPluginDescriptorV1 = typeof NegotiatedPluginDescriptorV1.Type\n","import * as Result from \"effect/Result\"\nimport * as Schema from \"effect/Schema\"\n\nimport { SourceUrl } from \"./sourceRevision.js\"\n\nconst boundedText = (maximum: number, identifier: string) =>\n Schema.String.check(Schema.isMaxLength(maximum)).annotate({ identifier })\n\nconst boundedNonEmptyText = (maximum: number, identifier: string) =>\n boundedText(maximum, identifier).check(Schema.isTrimmed(), Schema.isNonEmpty())\n\nconst boundedArray = <T, E, RD, RE>(schema: Schema.Codec<T, E, RD, RE>, maximum: number) =>\n Schema.Array(schema).check(Schema.isMaxLength(maximum))\n\nexport const MAXIMUM_NORMALIZED_ISSUE_LABELS = 200\nexport const MAXIMUM_NORMALIZED_ISSUE_COMPONENTS = 100\n// One issue, its activity evidence, 200 people, and three events per fix version must fit one 500-event page.\nexport const MAXIMUM_NORMALIZED_ISSUE_FIX_VERSIONS = 99\nexport const MAXIMUM_NORMALIZED_ISSUE_SUBTASKS = 200\nexport const MAXIMUM_NORMALIZED_ISSUE_COLLABORATORS = 200\nexport const MAXIMUM_NORMALIZED_ISSUE_COMMENTS = 200\nexport const MAXIMUM_NORMALIZED_ISSUE_HISTORY = 200\nexport const MAXIMUM_NORMALIZED_ISSUE_HISTORY_CHANGES = 100\n\nconst SourceObjectId = boundedNonEmptyText(512, \"NormalizedIssueSourceObjectId\")\nconst SourcePersonId = boundedNonEmptyText(512, \"NormalizedIssueSourcePersonId\")\nconst ShortText = boundedText(255, \"NormalizedIssueShortText\")\nconst RichText = boundedText(16_000, \"NormalizedIssueRichText\")\nconst TimestampText = boundedNonEmptyText(100, \"NormalizedIssueTimestamp\")\nconst AvatarUrl = boundedNonEmptyText(2_048, \"NormalizedIssueAvatarUrl\").check(\n Schema.makeFilter((value) => Result.isSuccess(Schema.decodeUnknownResult(SourceUrl)(value)), {\n expected: \"an HTTP(S) source URL without embedded credentials\"\n })\n)\n\n/** Provider-neutral named source object retained with a bounded source identity. */\nexport const NormalizedIssueNamedValue = Schema.Struct({\n sourceId: Schema.NullOr(SourceObjectId),\n name: Schema.NullOr(ShortText)\n}).annotate({ identifier: \"NormalizedIssueNamedValue\" })\n\n/** Provider-neutral project identity and presentation retained from an issue source. */\nexport const NormalizedIssueProject = Schema.Struct({\n sourceId: Schema.NullOr(SourceObjectId),\n key: Schema.NullOr(boundedNonEmptyText(100, \"NormalizedIssueProjectKey\")),\n name: Schema.NullOr(ShortText)\n}).annotate({ identifier: \"NormalizedIssueProject\" })\n\n/** Provider-neutral release/version reference retained from an issue source. */\nexport const NormalizedIssueFixVersion = Schema.Struct({\n sourceId: Schema.NullOr(SourceObjectId),\n name: Schema.NullOr(ShortText),\n released: Schema.Boolean,\n releaseDate: Schema.NullOr(TimestampText)\n}).annotate({ identifier: \"NormalizedIssueFixVersion\" })\n\n/** Provider-neutral parent or subtask reference retained from an issue source. */\nexport const NormalizedRelatedIssue = Schema.Struct({\n sourceId: Schema.NullOr(SourceObjectId),\n key: Schema.NullOr(boundedNonEmptyText(100, \"NormalizedRelatedIssueKey\")),\n summary: Schema.NullOr(boundedText(500, \"NormalizedRelatedIssueSummary\")),\n status: Schema.NullOr(NormalizedIssueNamedValue)\n}).annotate({ identifier: \"NormalizedRelatedIssue\" })\n\n/** Bounded source collaborator used for attribution without provider response types. */\nexport const NormalizedIssueCollaborator = Schema.Struct({\n sourcePersonId: SourcePersonId,\n displayName: boundedNonEmptyText(200, \"NormalizedIssueCollaboratorDisplayName\"),\n avatarUrl: Schema.NullOr(AvatarUrl),\n active: Schema.Boolean,\n roles: boundedArray(boundedNonEmptyText(100, \"NormalizedIssueCollaboratorRole\"), 16).check(Schema.isUnique())\n}).annotate({ identifier: \"NormalizedIssueCollaborator\" })\n\n/** Bounded provider-neutral issue comment. */\nexport const NormalizedIssueComment = Schema.Struct({\n sourceId: SourceObjectId,\n authorSourcePersonId: Schema.NullOr(SourcePersonId),\n updateAuthorSourcePersonId: Schema.NullOr(SourcePersonId),\n body: Schema.NullOr(RichText),\n createdAt: Schema.NullOr(TimestampText),\n updatedAt: Schema.NullOr(TimestampText)\n}).annotate({ identifier: \"NormalizedIssueComment\" })\n\n/** One bounded provider-neutral field transition. */\nexport const NormalizedIssueHistoryChange = Schema.Struct({\n field: boundedNonEmptyText(255, \"NormalizedIssueHistoryField\"),\n from: Schema.NullOr(boundedText(1_000, \"NormalizedIssueHistoryValue\")),\n to: Schema.NullOr(boundedText(1_000, \"NormalizedIssueHistoryValue\"))\n}).annotate({ identifier: \"NormalizedIssueHistoryChange\" })\n\n/** Bounded provider-neutral issue history entry. */\nexport const NormalizedIssueHistoryEntry = Schema.Struct({\n sourceId: SourceObjectId,\n authorSourcePersonId: Schema.NullOr(SourcePersonId),\n createdAt: Schema.NullOr(TimestampText),\n changes: boundedArray(NormalizedIssueHistoryChange, MAXIMUM_NORMALIZED_ISSUE_HISTORY_CHANGES)\n}).annotate({ identifier: \"NormalizedIssueHistoryEntry\" })\n\n/** Fields whose source material may be deliberately reduced to remain within synchronization bounds. */\nexport const NormalizedIssueTruncatedField = Schema.Literals([\n \"acceptanceCriteria\",\n \"collaborators\",\n \"comments\",\n \"components\",\n \"description\",\n \"environment\",\n \"fixVersions\",\n \"history\",\n \"issueType\",\n \"key\",\n \"labels\",\n \"parent\",\n \"priority\",\n \"project\",\n \"resolution\",\n \"summary\",\n \"status\",\n \"subtasks\",\n \"updatedAt\",\n \"createdAt\",\n \"dueDate\",\n \"resolvedAt\"\n])\n\n/**\n * Shared provider-neutral issue detail accepted from normalized plugins.\n *\n * The original compact key/status/priority/estimate fields remain required.\n * Rich fields are optional so older normalized plugins and persisted projections\n * remain valid; first-party Jira synchronization always supplies every rich field.\n */\nexport const NormalizedIssueAttributes = Schema.Struct({\n key: boundedNonEmptyText(100, \"NormalizedIssueKey\"),\n status: boundedNonEmptyText(100, \"NormalizedIssueStatus\"),\n priority: Schema.NullOr(boundedNonEmptyText(100, \"NormalizedIssuePriority\")),\n estimatePoints: Schema.NullOr(Schema.Number.check(Schema.isGreaterThanOrEqualTo(0))),\n summary: Schema.optionalKey(boundedText(500, \"NormalizedIssueSummary\")),\n description: Schema.optionalKey(Schema.NullOr(RichText)),\n acceptanceCriteria: Schema.optionalKey(Schema.NullOr(RichText)),\n environment: Schema.optionalKey(Schema.NullOr(RichText)),\n issueType: Schema.optionalKey(Schema.NullOr(NormalizedIssueNamedValue)),\n project: Schema.optionalKey(Schema.NullOr(NormalizedIssueProject)),\n resolution: Schema.optionalKey(Schema.NullOr(NormalizedIssueNamedValue)),\n labels: Schema.optionalKey(\n boundedArray(boundedNonEmptyText(255, \"NormalizedIssueLabel\"), MAXIMUM_NORMALIZED_ISSUE_LABELS)\n ),\n components: Schema.optionalKey(boundedArray(NormalizedIssueNamedValue, MAXIMUM_NORMALIZED_ISSUE_COMPONENTS)),\n fixVersions: Schema.optionalKey(boundedArray(NormalizedIssueFixVersion, MAXIMUM_NORMALIZED_ISSUE_FIX_VERSIONS)),\n createdAt: Schema.optionalKey(Schema.NullOr(TimestampText)),\n updatedAt: Schema.optionalKey(Schema.NullOr(TimestampText)),\n dueDate: Schema.optionalKey(Schema.NullOr(TimestampText)),\n resolvedAt: Schema.optionalKey(Schema.NullOr(TimestampText)),\n parent: Schema.optionalKey(Schema.NullOr(NormalizedRelatedIssue)),\n subtasks: Schema.optionalKey(boundedArray(NormalizedRelatedIssue, MAXIMUM_NORMALIZED_ISSUE_SUBTASKS)),\n assigneeSourcePersonId: Schema.optionalKey(Schema.NullOr(SourcePersonId)),\n reporterSourcePersonId: Schema.optionalKey(Schema.NullOr(SourcePersonId)),\n creatorSourcePersonId: Schema.optionalKey(Schema.NullOr(SourcePersonId)),\n collaborators: Schema.optionalKey(boundedArray(NormalizedIssueCollaborator, MAXIMUM_NORMALIZED_ISSUE_COLLABORATORS)),\n comments: Schema.optionalKey(boundedArray(NormalizedIssueComment, MAXIMUM_NORMALIZED_ISSUE_COMMENTS)),\n commentTotal: Schema.optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n commentsTruncated: Schema.optionalKey(Schema.Boolean),\n commentBodiesTruncated: Schema.optionalKey(Schema.Boolean),\n history: Schema.optionalKey(boundedArray(NormalizedIssueHistoryEntry, MAXIMUM_NORMALIZED_ISSUE_HISTORY)),\n historyTotal: Schema.optionalKey(Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))),\n historyTruncated: Schema.optionalKey(Schema.Boolean),\n truncatedFields: Schema.optionalKey(boundedArray(NormalizedIssueTruncatedField, 32).check(Schema.isUnique()))\n}).annotate({ identifier: \"NormalizedIssueAttributes\" })\n\n/** Decoded provider-neutral normalized issue detail. */\nexport type NormalizedIssueAttributes = typeof NormalizedIssueAttributes.Type\n","import * as DateTime from \"effect/DateTime\"\nimport * as Schema from \"effect/Schema\"\n\nimport { Freshness } from \"./freshness.js\"\nimport {\n AgentId,\n EntityId,\n EnvironmentId,\n EvidenceClaimId,\n EvidenceId,\n GraphNodeId,\n PersonId,\n PluginConnectionId,\n RelationshipId,\n ReleaseId,\n WorkspaceId\n} from \"./identifiers.js\"\nimport { NormalizedIssueAttributes } from \"./normalizedIssue.js\"\nimport { UtcTimestamp } from \"./utcTimestamp.js\"\n\nconst boundedText = (maximum: number, identifier: string) =>\n Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(maximum)\n ).annotate({ identifier })\n\n/** Provider-neutral kind of an object participating in delivery. */\nexport const DeliveryEntityKind = Schema.Literals([\n \"issue\",\n \"pull-request\",\n \"page\",\n \"pipeline-execution\",\n \"deployment\",\n \"time-entry\"\n])\n\n/** Decoded normalized entity kind. */\nexport type DeliveryEntityKind = typeof DeliveryEntityKind.Type\n\n/** Connected service responsible for a normalized delivery entity. */\nexport const DeliveryEntityService = Schema.Literals([\n \"jira\",\n \"codecommit\",\n \"confluence\",\n \"codepipeline\",\n \"clockify\"\n])\n\n/** Decoded connected delivery service. */\nexport type DeliveryEntityService = typeof DeliveryEntityService.Type\n\n/** Coarse cross-provider lifecycle used by workspace item search. */\nexport const DeliveryEntityStatusGroup = Schema.Literals([\"active\", \"done\", \"failed\"])\n\n/** Decoded cross-provider lifecycle group. */\nexport type DeliveryEntityStatusGroup = typeof DeliveryEntityStatusGroup.Type\n\n/** Canonical semantic kind recorded for either endpoint of a relationship. */\nexport const RelationshipEndpointKind = Schema.Union([\n DeliveryEntityKind,\n Schema.Literals([\"release\", \"environment\"])\n])\n\n/** Decoded semantic relationship endpoint kind. */\nexport type RelationshipEndpointKind = typeof RelationshipEndpointKind.Type\n\n/** Positive immutable revision of a normalized entity or relationship. */\nexport const LedgerRevision = Schema.Int.check(Schema.isGreaterThan(0)).pipe(\n Schema.brand(\"LedgerRevision\")\n)\n\n/** Decoded ledger revision. */\nexport type LedgerRevision = typeof LedgerRevision.Type\n\nconst IssueDetails = Schema.TaggedStruct(\"issue\", {\n ...NormalizedIssueAttributes.fields\n})\n\nconst PullRequestDetails = Schema.TaggedStruct(\"pull-request\", {\n repository: boundedText(200, \"RepositoryName\"),\n sourceBranch: boundedText(500, \"SourceBranch\"),\n targetBranch: boundedText(500, \"TargetBranch\"),\n headRevision: boundedText(512, \"HeadRevision\"),\n reviewState: Schema.Literals([\"not-requested\", \"requested\", \"changes-requested\", \"approved\", \"merged\"]),\n lifecycle: Schema.optionalKey(Schema.NullOr(Schema.Literals([\"open\", \"closed\", \"merged\"]))),\n description: Schema.optionalKey(Schema.NullOr(Schema.String.check(Schema.isMaxLength(50_000)))),\n authorReference: Schema.optionalKey(Schema.NullOr(boundedText(512, \"PullRequestAuthorReference\"))),\n baseRevision: Schema.optionalKey(Schema.NullOr(boundedText(512, \"BaseRevision\"))),\n mergeBaseRevision: Schema.optionalKey(Schema.NullOr(boundedText(512, \"MergeBaseRevision\"))),\n createdAt: Schema.optionalKey(Schema.NullOr(boundedText(64, \"PullRequestCreatedAt\"))),\n updatedAt: Schema.optionalKey(Schema.NullOr(boundedText(64, \"PullRequestUpdatedAt\")))\n})\n\nconst PageDetails = Schema.TaggedStruct(\"page\", {\n spaceKey: boundedText(100, \"SpaceKey\"),\n revision: boundedText(512, \"PageRevision\"),\n status: Schema.Literals([\"draft\", \"current\", \"superseded\"]),\n linkedIssueKeys: Schema.optional(\n Schema.Array(boundedText(100, \"LinkedIssueKey\")).check(Schema.isUnique(), Schema.isMaxLength(100))\n ),\n linkedReleaseVersions: Schema.optional(\n Schema.Array(boundedText(100, \"LinkedReleaseVersion\")).check(Schema.isUnique(), Schema.isMaxLength(100))\n )\n})\n\nconst PipelineDetails = Schema.TaggedStruct(\"pipeline-execution\", {\n pipelineName: boundedText(200, \"PipelineName\"),\n executionId: boundedText(512, \"PipelineExecutionId\"),\n status: Schema.Literals([\"queued\", \"running\", \"succeeded\", \"failed\", \"stopped\"]),\n triggerRevision: boundedText(512, \"PipelineTriggerRevision\")\n})\n\nconst DeploymentDetails = Schema.TaggedStruct(\"deployment\", {\n environmentId: EnvironmentId,\n revision: boundedText(512, \"DeploymentRevision\"),\n status: Schema.Literals([\"pending\", \"deploying\", \"succeeded\", \"failed\", \"rolled-back\"])\n})\n\nconst TimeEntryDetails = Schema.TaggedStruct(\"time-entry\", {\n durationMinutes: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n billable: Schema.Boolean,\n approvalState: Schema.Literals([\"pending\", \"approved\", \"rejected\", \"not-required\"])\n})\n\n/** Provider-neutral entity extension decoded before graph persistence. */\nexport const DeliveryEntityDetails = Schema.Union([\n IssueDetails,\n PullRequestDetails,\n PageDetails,\n PipelineDetails,\n DeploymentDetails,\n TimeEntryDetails\n]).pipe(Schema.toTaggedUnion(\"_tag\"))\n\n/** Decoded provider-neutral entity details. */\nexport type DeliveryEntityDetails = typeof DeliveryEntityDetails.Type\n\n/** Immutable normalized projection for one exact entity source revision. */\nexport const DeliveryEntityProjection = Schema.Struct({\n workspaceId: WorkspaceId,\n entityId: EntityId,\n projectionRevision: LedgerRevision,\n sourceEntityRevision: LedgerRevision,\n supersedesProjectionRevision: Schema.NullOr(LedgerRevision),\n projectionSchemaVersion: Schema.Int.check(Schema.isGreaterThan(0)),\n entityState: Schema.Literals([\"present\", \"deleted\"]),\n entityType: DeliveryEntityKind,\n displayKey: boundedText(200, \"EntityDisplayKey\"),\n title: boundedText(500, \"EntityTitle\"),\n details: DeliveryEntityDetails\n}).check(\n Schema.makeFilter(\n ({ details, entityType }) => details._tag === entityType,\n { expected: \"entity details whose tag matches the entity kind\" }\n ),\n Schema.makeFilter(\n ({ projectionRevision, supersedesProjectionRevision }) =>\n projectionRevision === 1\n ? supersedesProjectionRevision === null\n : supersedesProjectionRevision === projectionRevision - 1,\n { expected: \"entity projection to supersede its exact preceding revision\" }\n )\n)\n\n/** Decoded normalized entity projection. */\nexport type DeliveryEntityProjection = typeof DeliveryEntityProjection.Type\n\n/** Resolved graph target with an exact canonical object identity. */\nexport const ResolvedDeliveryNode = Schema.TaggedUnion({\n entity: { entityId: EntityId, entityKind: DeliveryEntityKind },\n environment: { environmentId: EnvironmentId, releaseId: ReleaseId },\n release: { releaseId: ReleaseId }\n})\n\n/** Resolved or intentionally missing node stored as trusted graph state. */\nexport const DeliveryNode = Schema.Struct({\n workspaceId: WorkspaceId,\n nodeId: GraphNodeId,\n endpointKind: RelationshipEndpointKind,\n resolution: Schema.TaggedUnion({\n resolved: { target: ResolvedDeliveryNode },\n missing: {\n expectedKind: Schema.Literals([\"entity\", \"release\", \"environment\"]),\n expectedEntityKind: Schema.NullOr(DeliveryEntityKind),\n missingKey: boundedText(512, \"MissingDeliveryNodeKey\")\n }\n }),\n createdAt: UtcTimestamp\n}).check(\n Schema.makeFilter(\n ({ resolution }) =>\n resolution._tag !== \"missing\" ||\n (resolution.expectedKind === \"entity\") === (resolution.expectedEntityKind !== null),\n { expected: \"only missing entity nodes to carry an expected entity kind\" }\n ),\n Schema.makeFilter(\n ({ endpointKind, resolution }) => {\n if (resolution._tag === \"missing\") {\n return resolution.expectedKind === \"entity\"\n ? endpointKind === resolution.expectedEntityKind\n : endpointKind === resolution.expectedKind\n }\n\n return resolution.target._tag === \"entity\"\n ? endpointKind === resolution.target.entityKind\n : endpointKind === resolution.target._tag\n },\n { expected: \"graph node endpoint kind to match its resolved or expected target kind\" }\n )\n)\n\n/** Decoded graph node. */\nexport type DeliveryNode = typeof DeliveryNode.Type\n\n/** Semantic relationship between delivery nodes. Direction is significant. */\nexport const RelationshipKind = Schema.Literals([\n \"contains\",\n \"implements\",\n \"depends-on\",\n \"verified-by\",\n \"delivered-by\",\n \"documented-by\",\n \"tracks-time-for\"\n])\n\n/** Decoded relationship kind. */\nexport type RelationshipKind = typeof RelationshipKind.Type\n\nconst ALL_RELATIONSHIP_ENDPOINT_KINDS: ReadonlyArray<RelationshipEndpointKind> = [\n \"issue\",\n \"pull-request\",\n \"page\",\n \"pipeline-execution\",\n \"deployment\",\n \"time-entry\",\n \"release\",\n \"environment\"\n]\n\nconst ALL_ENTITY_ENDPOINT_KINDS: ReadonlyArray<RelationshipEndpointKind> = [\n \"issue\",\n \"pull-request\",\n \"page\",\n \"pipeline-execution\",\n \"deployment\",\n \"time-entry\"\n]\n\ntype RelationshipEndpointRule = Readonly<{\n source: ReadonlyArray<RelationshipEndpointKind>\n target: ReadonlyArray<RelationshipEndpointKind>\n}>\n\n/**\n * Version-one canonical direction matrix. Passive relationship names read from\n * source to target: for example, a pull request is `delivered-by` a pipeline\n * execution. `depends-on` is intentionally the one generic graph edge.\n */\nexport const RELATIONSHIP_ENDPOINT_MATRIX_V1: Readonly<\n Record<RelationshipKind, RelationshipEndpointRule>\n> = {\n \"contains\": { source: [\"release\"], target: ALL_ENTITY_ENDPOINT_KINDS },\n \"implements\": { source: [\"pull-request\"], target: [\"issue\"] },\n \"depends-on\": {\n source: ALL_RELATIONSHIP_ENDPOINT_KINDS,\n target: ALL_RELATIONSHIP_ENDPOINT_KINDS\n },\n \"verified-by\": { source: [\"pull-request\"], target: [\"pipeline-execution\"] },\n \"delivered-by\": { source: [\"pull-request\"], target: [\"pipeline-execution\"] },\n \"documented-by\": { source: [\"issue\", \"release\"], target: [\"page\"] },\n \"tracks-time-for\": { source: [\"time-entry\"], target: [\"issue\"] }\n}\n\nconst relationshipEndpointIsAllowed = (\n kind: RelationshipKind,\n sourceNodeKind: RelationshipEndpointKind,\n targetNodeKind: RelationshipEndpointKind\n): boolean => {\n const rule: RelationshipEndpointRule = RELATIONSHIP_ENDPOINT_MATRIX_V1[kind]\n return rule.source.some((candidate) => candidate === sourceNodeKind) &&\n rule.target.some((candidate) => candidate === targetNodeKind)\n}\n\n/** Explainable confidence; inferred links can never masquerade as confirmed. */\nexport const RelationshipConfidence = Schema.TaggedUnion({\n unknown: { rationale: boundedText(1_000, \"UnknownRelationshipConfidenceRationale\") },\n confirmed: {},\n inferred: {\n score: Schema.Number.check(Schema.isBetween({ minimum: 0, maximum: 1 })),\n rationale: boundedText(1_000, \"RelationshipConfidenceRationale\")\n }\n})\n\n/** Decoded relationship confidence. */\nexport type RelationshipConfidence = typeof RelationshipConfidence.Type\n\n/** Attribution for creation of a relationship revision. */\nexport const RelationshipProvenance = Schema.TaggedUnion({\n plugin: {\n pluginConnectionId: PluginConnectionId,\n sourceEntityId: EntityId,\n sourceEntityRevision: LedgerRevision\n },\n human: { personId: PersonId, rationale: boundedText(1_000, \"HumanRelationshipRationale\") },\n agent: { agentId: AgentId, rationale: boundedText(1_000, \"AgentRelationshipRationale\") },\n rule: {\n ruleId: boundedText(200, \"RelationshipRuleId\"),\n ruleVersion: Schema.Int.check(Schema.isGreaterThan(0)),\n rationale: boundedText(1_000, \"RuleRelationshipRationale\")\n }\n})\n\n/** Decoded relationship provenance. */\nexport type RelationshipProvenance = typeof RelationshipProvenance.Type\n\n/** Lifecycle of one relationship revision. Prior revisions remain immutable. */\nexport const RelationshipLifecycle = Schema.TaggedUnion({\n missing: { effectiveAt: UtcTimestamp, reason: boundedText(1_000, \"MissingRelationshipReason\") },\n inferred: { effectiveAt: UtcTimestamp },\n proposed: { effectiveAt: UtcTimestamp },\n verified: { effectiveAt: UtcTimestamp },\n governed: { effectiveAt: UtcTimestamp },\n rejected: { effectiveAt: UtcTimestamp, reason: boundedText(1_000, \"RejectionReason\") },\n superseded: { effectiveAt: UtcTimestamp, reason: boundedText(1_000, \"SupersessionReason\") }\n})\n\n/** Decoded relationship lifecycle. */\nexport type RelationshipLifecycle = typeof RelationshipLifecycle.Type\n\n/** Exact release or environment slice in which a relationship is evaluated. */\nexport const RelationshipScope = Schema.NullOr(\n Schema.TaggedUnion({\n release: { releaseId: ReleaseId },\n environment: { releaseId: ReleaseId, environmentId: EnvironmentId }\n })\n)\n\n/** Human, agent, or system that appended an immutable ledger revision. */\nexport const LedgerActor = Schema.TaggedUnion({\n human: { personId: PersonId },\n agent: { agentId: AgentId },\n system: { component: boundedText(200, \"LedgerSystemComponent\") }\n})\n\n/** Immutable relationship ledger revision. */\nexport const DeliveryRelationship = Schema.Struct({\n workspaceId: WorkspaceId,\n relationshipId: RelationshipId,\n relationshipSchemaVersion: Schema.Literal(1),\n revision: LedgerRevision,\n supersedesRevision: Schema.NullOr(LedgerRevision),\n kind: RelationshipKind,\n sourceNodeId: GraphNodeId,\n sourceNodeKind: RelationshipEndpointKind,\n targetNodeId: GraphNodeId,\n targetNodeKind: RelationshipEndpointKind,\n scope: RelationshipScope,\n lifecycle: RelationshipLifecycle,\n confidence: RelationshipConfidence,\n provenance: RelationshipProvenance,\n recordedBy: LedgerActor,\n evidenceClaimIds: Schema.Array(EvidenceClaimId).check(Schema.isMaxLength(128)),\n recordedAt: UtcTimestamp\n}).check(\n Schema.makeFilter(\n ({ evidenceClaimIds }) => new Set(evidenceClaimIds).size === evidenceClaimIds.length,\n { expected: \"relationship evidence references to be unique\" }\n ),\n Schema.makeFilter(\n ({ confidence, evidenceClaimIds }) => confidence._tag !== \"confirmed\" || evidenceClaimIds.length > 0,\n { expected: \"confirmed relationship confidence to reference immutable evidence\" }\n ),\n Schema.makeFilter(\n ({ sourceNodeId, targetNodeId }) => sourceNodeId !== targetNodeId,\n { expected: \"relationship source and target to differ\" }\n ),\n Schema.makeFilter(\n ({ kind, sourceNodeKind, targetNodeKind }) => relationshipEndpointIsAllowed(kind, sourceNodeKind, targetNodeKind),\n { expected: \"relationship endpoints to follow the canonical version-one direction matrix\" }\n ),\n Schema.makeFilter(\n ({ kind, scope }) => kind !== \"contains\" || scope !== null,\n { expected: \"release containment to carry an explicit release or environment scope\" }\n ),\n Schema.makeFilter(\n ({ confidence, lifecycle }) => lifecycle._tag !== \"inferred\" || confidence._tag !== \"confirmed\",\n { expected: \"an inferred relationship lifecycle not to claim confirmed confidence\" }\n ),\n Schema.makeFilter(\n ({ revision, supersedesRevision }) =>\n revision === 1 ? supersedesRevision === null : supersedesRevision === revision - 1,\n { expected: \"relationship to supersede its exact preceding revision\" }\n )\n)\n\n/** Decoded relationship ledger revision. */\nexport type DeliveryRelationship = typeof DeliveryRelationship.Type\n\n/** Closed assertion vocabulary used by immutable evidence claims. */\nexport const EvidencePredicate = Schema.Literals([\n \"relationship-observed\",\n \"status-observed\",\n \"approval-recorded\",\n \"check-observed\",\n \"execution-observed\",\n \"deployment-observed\",\n \"documentation-observed\",\n \"time-observed\"\n])\n\n/** Decoded evidence predicate. */\nexport type EvidencePredicate = typeof EvidencePredicate.Type\n\n/** Bounded, provider-neutral evidence value. */\nexport const EvidenceValue = Schema.TaggedUnion({\n flag: { value: Schema.Boolean },\n state: { value: boundedText(500, \"EvidenceState\") },\n revision: { value: boundedText(512, \"EvidenceRevision\") },\n reference: { targetNodeId: GraphNodeId }\n})\n\n/** Decoded evidence value. */\nexport type EvidenceValue = typeof EvidenceValue.Type\n\n/** Exact actor or source revision responsible for an evidence claim. */\nexport const EvidenceAttribution = Schema.TaggedUnion({\n plugin: {\n pluginConnectionId: PluginConnectionId,\n sourceEntityId: EntityId,\n sourceEntityRevision: LedgerRevision\n },\n human: { personId: PersonId },\n agent: { agentId: AgentId },\n system: { component: boundedText(200, \"EvidenceSystemComponent\") }\n})\n\n/** Decoded evidence attribution. */\nexport type EvidenceAttribution = typeof EvidenceAttribution.Type\n\n/** Explicit retention policy attached when evidence is recorded. */\nexport const EvidenceRetention = Schema.Struct({\n classification: Schema.Literals([\"audit\", \"evidence\", \"normalized-cache\"]),\n retainUntil: Schema.NullOr(UtcTimestamp),\n legalHold: Schema.Boolean\n})\n\n/** Decoded evidence retention metadata. */\nexport type EvidenceRetention = typeof EvidenceRetention.Type\n\n/** Independent verification of an evidence observation. */\nexport const EvidenceVerifier = Schema.TaggedUnion({\n human: { personId: PersonId },\n agent: { agentId: AgentId },\n system: { component: boundedText(200, \"EvidenceVerifierComponent\") }\n})\n\n/** Immutable observation envelope with provenance, validity, and retention. */\nexport const EvidenceItem = Schema.Struct({\n workspaceId: WorkspaceId,\n evidenceId: EvidenceId,\n schemaVersion: Schema.Int.check(Schema.isGreaterThan(0)),\n attribution: EvidenceAttribution,\n verifier: EvidenceVerifier,\n observedAt: UtcTimestamp,\n recordedAt: UtcTimestamp,\n validUntil: Schema.NullOr(UtcTimestamp),\n freshness: Freshness,\n retention: EvidenceRetention\n}).check(\n Schema.makeFilter(\n ({ attribution, freshness }) => {\n if (attribution._tag !== \"plugin\") return true\n\n return freshness.provenance._tag !== \"none\" &&\n attribution.pluginConnectionId === freshness.provenance.sourceRevision.pluginConnectionId\n },\n { expected: \"plugin evidence attribution to carry its exact freshness source revision\" }\n ),\n Schema.makeFilter(\n ({ observedAt, recordedAt }) => DateTime.Order(observedAt, recordedAt) <= 0,\n { expected: \"evidence observation time not to follow recording time\" }\n ),\n Schema.makeFilter(\n ({ observedAt, validUntil }) => validUntil === null || DateTime.Order(observedAt, validUntil) < 0,\n { expected: \"evidence validity to end after observation\" }\n ),\n Schema.makeFilter(\n ({ recordedAt, retention }) =>\n retention.retainUntil === null || DateTime.Order(recordedAt, retention.retainUntil) <= 0,\n { expected: \"evidence retention not to end before recording\" }\n )\n)\n\n/** Decoded immutable evidence observation. */\nexport type EvidenceItem = typeof EvidenceItem.Type\n\n/** One immutable normalized claim derived from an evidence observation. */\nexport const EvidenceClaim = Schema.Struct({\n workspaceId: WorkspaceId,\n evidenceClaimId: EvidenceClaimId,\n evidenceId: EvidenceId,\n subjectNodeId: GraphNodeId,\n predicate: EvidencePredicate,\n value: EvidenceValue,\n recordedAt: UtcTimestamp,\n supersedesEvidenceClaimId: Schema.NullOr(EvidenceClaimId)\n}).check(\n Schema.makeFilter(\n ({ evidenceClaimId, supersedesEvidenceClaimId }) => evidenceClaimId !== supersedesEvidenceClaimId,\n { expected: \"evidence not to supersede itself\" }\n )\n)\n\n/** Decoded immutable evidence claim. */\nexport type EvidenceClaim = typeof EvidenceClaim.Type\n\n/** Independent source availability and validity dimensions for an evidence item. */\nexport type EvidenceFreshnessAssessment = Readonly<{\n source: \"current\" | \"stale\" | \"missing\" | \"unavailable\"\n validity: \"valid\" | \"expired\"\n}>\n\nconst sourceFreshnessAt = (\n freshness: Freshness,\n at: DateTime.DateTime\n): EvidenceFreshnessAssessment[\"source\"] => {\n if (freshness._tag !== \"current\") return freshness._tag\n\n const ageMilliseconds = DateTime.toEpochMillis(at) - DateTime.toEpochMillis(freshness.sourceObservedAt)\n return ageMilliseconds < freshness.staleAfterSeconds * 1_000 ? \"current\" : \"stale\"\n}\n\n/** Determine source freshness and evidence validity at an injected instant. */\nexport const evidenceFreshnessAt = (\n evidence: EvidenceItem,\n at: DateTime.DateTime\n): EvidenceFreshnessAssessment => ({\n source: sourceFreshnessAt(evidence.freshness, at),\n validity: evidence.validUntil === null || DateTime.Order(at, evidence.validUntil) < 0\n ? \"valid\"\n : \"expired\"\n})\n\n/** Determine whether retained evidence bytes are eligible for governed cleanup. */\nexport const evidenceRetentionEligibilityAt = (\n evidence: EvidenceItem,\n at: DateTime.DateTime\n): \"retain\" | \"eligible\" =>\n !evidence.retention.legalHold &&\n evidence.retention.retainUntil !== null &&\n DateTime.Order(evidence.retention.retainUntil, at) <= 0\n ? \"eligible\"\n : \"retain\"\n","import * as Schema from \"effect/Schema\"\n\nimport { Actor } from \"./actors.js\"\nimport { LedgerRevision } from \"./deliveryGraph.js\"\nimport {\n EnvironmentId,\n RelationshipId,\n RelationshipRepairProposalId,\n RelationshipRepairReviewId,\n ReleaseId,\n SessionId,\n WorkspaceId\n} from \"./identifiers.js\"\nimport { UtcTimestamp } from \"./utcTimestamp.js\"\n\n/** Explicit decision proposed for an incomplete delivery relationship. */\nexport const RelationshipRepairDisposition = Schema.Literals([\"link\", \"verify\", \"reject\"])\n\n/** Decoded relationship-repair disposition. */\nexport type RelationshipRepairDisposition = typeof RelationshipRepairDisposition.Type\n\n/** Bounded human-readable justification stored with a repair proposal. */\nexport const RelationshipRepairRationale = Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(1_000)\n).annotate({ identifier: \"RelationshipRepairRationale\" })\n\n/** Decoded relationship-repair rationale. */\nexport type RelationshipRepairRationale = typeof RelationshipRepairRationale.Type\n\n/** Authenticated origin retained for proposal review and later audit. */\nexport const RelationshipRepairProposalOrigin = Schema.Struct({\n actor: Actor,\n sessionId: SessionId\n})\n\n/** Decoded relationship-repair proposal origin. */\nexport type RelationshipRepairProposalOrigin = typeof RelationshipRepairProposalOrigin.Type\n\n/** Final reviewer decision over one exact proposal. */\nexport const RelationshipRepairReviewDecision = Schema.Literals([\"approved\", \"rejected\"])\n\n/** Decoded relationship-repair review decision. */\nexport type RelationshipRepairReviewDecision = typeof RelationshipRepairReviewDecision.Type\n\n/** Immutable review evidence retained with a finalized proposal. */\nexport const RelationshipRepairReview = Schema.Struct({\n reviewId: RelationshipRepairReviewId,\n decision: RelationshipRepairReviewDecision,\n rationale: RelationshipRepairRationale,\n origin: RelationshipRepairProposalOrigin,\n reviewedAt: UtcTimestamp\n}).annotate({ identifier: \"RelationshipRepairReview\" })\n\n/** Decoded relationship-repair review. */\nexport type RelationshipRepairReview = typeof RelationshipRepairReview.Type\n\n/** Immutable evidence that one approved proposal appended an exact ledger revision. */\nexport const RelationshipRepairApplication = Schema.Struct({\n proposalId: RelationshipRepairProposalId,\n relationshipId: RelationshipId,\n appliedRevision: LedgerRevision,\n origin: RelationshipRepairProposalOrigin,\n appliedAt: UtcTimestamp\n}).annotate({ identifier: \"RelationshipRepairApplication\" })\n\n/** Decoded relationship-repair application evidence. */\nexport type RelationshipRepairApplication = typeof RelationshipRepairApplication.Type\n\n/** Durable proposal bound to one exact immutable relationship revision. */\nexport const RelationshipRepairProposal = Schema.Struct({\n schemaVersion: Schema.Literal(2),\n proposalId: RelationshipRepairProposalId,\n workspaceId: WorkspaceId,\n releaseId: ReleaseId,\n environmentId: Schema.NullOr(EnvironmentId),\n relationshipId: RelationshipId,\n expectedRevision: LedgerRevision,\n disposition: RelationshipRepairDisposition,\n rationale: RelationshipRepairRationale,\n origin: RelationshipRepairProposalOrigin,\n status: Schema.Literals([\"pending\", \"approved\", \"rejected\"]),\n proposedAt: UtcTimestamp,\n review: Schema.NullOr(RelationshipRepairReview)\n}).annotate({ identifier: \"RelationshipRepairProposal\" })\n\n/** Decoded durable relationship-repair proposal. */\nexport type RelationshipRepairProposal = typeof RelationshipRepairProposal.Type\n","import * as Schema from \"effect/Schema\"\n\nimport { UtcTimestamp } from \"./utcTimestamp.js\"\n\n/** Actor classes that can contribute durable activity to a workspace Timeline. */\nexport const TimelineActorKind = Schema.Literals([\"agent\", \"human\", \"plugin\", \"system\"])\n\n/** Decoded Timeline actor class. */\nexport type TimelineActorKind = typeof TimelineActorKind.Type\n\n/** Durable source streams merged by the Timeline projection. */\nexport const TimelineSourceKind = Schema.Literals([\"action\", \"plugin-sync\", \"relationship\", \"system\"])\n\n/** Decoded Timeline source stream. */\nexport type TimelineSourceKind = typeof TimelineSourceKind.Type\n\n/** Connected provider identity retained when a durable event has provenance. */\nexport const TimelineService = Schema.Literals([\"codecommit\", \"codepipeline\", \"jira\", \"confluence\", \"clockify\"])\n\n/** Decoded connected provider identity. */\nexport type TimelineService = typeof TimelineService.Type\n\n/** Stable cursor for newest-first Timeline pagination. */\nexport const TimelineCursor = Schema.Struct({\n eventKey: Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(1_024)),\n occurredAt: UtcTimestamp\n}).annotate({ identifier: \"TimelineCursor\" })\n\n/** Decoded stable Timeline cursor. */\nexport type TimelineCursor = typeof TimelineCursor.Type\n\n/** Default-redacted, human-readable event from one durable workspace source. */\nexport const TimelineEvent = Schema.Struct({\n eventKey: TimelineCursor.fields.eventKey,\n occurredAt: UtcTimestamp,\n actor: Schema.Struct({\n kind: TimelineActorKind,\n label: Schema.String.check(Schema.isTrimmed(), Schema.isNonEmpty(), Schema.isMaxLength(200))\n }),\n sourceKind: TimelineSourceKind,\n service: Schema.NullOr(TimelineService),\n eventType: Schema.String.check(Schema.isTrimmed(), Schema.isNonEmpty(), Schema.isMaxLength(200)),\n title: Schema.String.check(Schema.isTrimmed(), Schema.isNonEmpty(), Schema.isMaxLength(300)),\n href: Schema.NullOr(Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(2_048)))\n}).annotate({ identifier: \"TimelineEvent\" })\n\n/** Decoded Timeline event. */\nexport type TimelineEvent = typeof TimelineEvent.Type\n\nconst TimelineRawIdentifier = Schema.String.check(Schema.isNonEmpty(), Schema.isMaxLength(2_048))\n\n/** Owner-visible durable identifiers for one exact Timeline event. */\nexport const TimelineEventIdentifiers = Schema.Struct({\n actorId: Schema.NullOr(TimelineRawIdentifier),\n actionId: Schema.NullOr(TimelineRawIdentifier),\n relationshipId: Schema.NullOr(TimelineRawIdentifier),\n pluginConnectionId: Schema.NullOr(TimelineRawIdentifier),\n releaseId: Schema.NullOr(TimelineRawIdentifier),\n entityId: Schema.NullOr(TimelineRawIdentifier)\n}).annotate({ identifier: \"TimelineEventIdentifiers\" })\n\n/** Decoded owner-visible Timeline identifiers. */\nexport type TimelineEventIdentifiers = typeof TimelineEventIdentifiers.Type\n\n/** Owner-visible reference to the local agent job attributable to an event. */\nexport const TimelineAgentJobDetail = Schema.Struct({\n jobId: TimelineRawIdentifier\n}).annotate({ identifier: \"TimelineAgentJobDetail\" })\n\n/** Decoded Timeline agent-job reference. */\nexport type TimelineAgentJobDetail = typeof TimelineAgentJobDetail.Type\n\n/** Deliberate owner-only expansion of one otherwise redacted Timeline event. */\nexport const TimelineEventDetail = Schema.Struct({\n event: TimelineEvent,\n identifiers: TimelineEventIdentifiers,\n agentJob: Schema.NullOr(TimelineAgentJobDetail)\n}).annotate({ identifier: \"TimelineEventDetail\" })\n\n/** Decoded owner-only Timeline event expansion. */\nexport type TimelineEventDetail = typeof TimelineEventDetail.Type\n\n/** One bounded Timeline page. */\nexport const TimelinePage = Schema.Struct({\n events: Schema.Array(TimelineEvent).check(\n Schema.makeFilter((events) => events.length <= 100, { expected: \"at most 100 Timeline events\" })\n ),\n nextCursor: Schema.NullOr(TimelineCursor)\n}).annotate({ identifier: \"TimelinePage\" })\n\n/** Decoded bounded Timeline page. */\nexport type TimelinePage = typeof TimelinePage.Type\n","import * as Schema from \"effect/Schema\"\n\nimport {\n DomainEventId,\n EntityId,\n EventCursor,\n JobId,\n PluginConnectionId,\n ReleaseId,\n WorkspaceId\n} from \"./identifiers.js\"\nimport { UtcTimestamp } from \"./utcTimestamp.js\"\n\nconst jsonEncoder = new TextEncoder()\nconst hasMaximumJsonBytes = (maximumBytes: number) =>\n Schema.makeFilter(\n (value: unknown) => {\n const serialized = JSON.stringify(value)\n return serialized !== undefined && jsonEncoder.encode(serialized).byteLength <= maximumBytes\n },\n { expected: `JSON encoded as at most ${maximumBytes} UTF-8 bytes` }\n )\nconst PersistedEventCursor = EventCursor.check(Schema.isGreaterThan(0))\n\n/** Maximum decoded JSON carried by one durable domain event. */\nexport const MaximumDomainEventPayloadBytes = 65_536\n\n/** Bounded trace identifier safe to persist independently of the HTTP API. */\nexport const DomainEventCorrelationId = Schema.String.check(\n Schema.isTrimmed(),\n Schema.isNonEmpty(),\n Schema.isMaxLength(128),\n Schema.isPattern(/^[A-Za-z0-9._:-]+$/u, { expected: \"a domain-safe correlation identifier\" })\n).pipe(Schema.brand(\"DomainEventCorrelationId\"))\n\n/** Decoded durable event correlation identifier. */\nexport type DomainEventCorrelationId = typeof DomainEventCorrelationId.Type\n\n/** Optional normalized identities explaining which portfolio facts changed. */\nexport const DomainEventMetadataV1 = Schema.Struct({\n releaseId: Schema.optionalKey(ReleaseId),\n pluginConnectionId: Schema.optionalKey(PluginConnectionId),\n entityId: Schema.optionalKey(EntityId),\n jobId: Schema.optionalKey(JobId)\n}).annotate({ identifier: \"DomainEventMetadataV1\" })\n\n/** Decoded optional identities attached to a v1 domain event. */\nexport type DomainEventMetadataV1 = typeof DomainEventMetadataV1.Type\n\n/** Portfolio projection that must be refreshed after a durable invalidation. */\nexport const PortfolioInvalidationReason = Schema.Literals([\"release-projection\", \"plugin-health\"])\n\n/** Decoded reason for invalidating an authoritative portfolio projection. */\nexport type PortfolioInvalidationReason = typeof PortfolioInvalidationReason.Type\n\n/** Bounded typed payload persisted with a portfolio invalidation. */\nexport const PortfolioInvalidatedPayloadV1 = Schema.Struct({\n reason: PortfolioInvalidationReason\n}).check(hasMaximumJsonBytes(MaximumDomainEventPayloadBytes)).annotate({ identifier: \"PortfolioInvalidatedPayloadV1\" })\n\n/** Decoded bounded v1 portfolio-invalidation payload. */\nexport type PortfolioInvalidatedPayloadV1 = typeof PortfolioInvalidatedPayloadV1.Type\n\n/** Durable workspace-local event declaring that the authoritative portfolio changed. */\nexport const PortfolioInvalidatedEventV1 = Schema.Struct({\n schemaVersion: Schema.Literal(1),\n eventId: DomainEventId,\n eventCursor: PersistedEventCursor,\n workspaceId: WorkspaceId,\n eventType: Schema.Literal(\"portfolio-invalidated\"),\n occurredAt: UtcTimestamp,\n ingestedAt: UtcTimestamp,\n causationId: Schema.NullOr(DomainEventId),\n correlationId: Schema.NullOr(DomainEventCorrelationId),\n metadata: DomainEventMetadataV1,\n payload: PortfolioInvalidatedPayloadV1\n}).annotate({ identifier: \"PortfolioInvalidatedEventV1\" })\n\n/** Decoded durable v1 portfolio-invalidation event. */\nexport type PortfolioInvalidatedEventV1 = typeof PortfolioInvalidatedEventV1.Type\n"],"mappings":";;;;;;AAEA,IAAM,mCAAmC;AAEzC,IAAM,kBAA8C,UAClD,OAAO,OAAO,MAAM,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,KACpC,OAAO,SACL,OAAO,OAAO,MACZ,OAAO,OAAO,CAAC,GACf,OAAO,UAAU,kCAAkC,EACjD,UAAU,gCACZ,CAAC,CACH,GACA,qBAAqB,YAAY,CACnC,GACA,OAAO,MAAM,KAAK,CACpB;;AAGF,IAAa,cAAc,eAAe,aAAa;;AAMvD,IAAa,YAAY,eAAe,WAAW;;AAMnD,IAAa,WAAW,eAAe,UAAU;;AAMjD,IAAa,WAAW,eAAe,UAAU;;AAMjD,IAAa,UAAU,eAAe,SAAS;;AAM/C,IAAa,gBAAgB,eAAe,eAAe;;AAM3D,IAAa,qBAAqB,eAAe,oBAAoB;;AAMrE,IAAa,oBAAoB,eAAe,mBAAmB;;AAMnE,IAAa,qBAAqB,eAAe,oBAAoB;;AAMrE,IAAa,mBAAmB,eAAe,kBAAkB;;AAMjE,IAAa,iBAAiB,eAAe,gBAAgB;;AAM7D,IAAa,+BAA+B,eAAe,8BAA8B;;AAMzF,IAAa,6BAA6B,eAAe,4BAA4B;;AAMrF,IAAa,kBAAkB,eAAe,iBAAiB;;AAM/D,IAAa,aAAa,eAAe,YAAY;;AAMrD,IAAa,wBAAwB,eAAe,uBAAuB;;AAM3E,IAAa,cAAc,eAAe,aAAa;;AAMvD,IAAa,cAAc,OAAO,IAAI,MAAM,OAAO,uBAAuB,CAAC,CAAC,CAAC,CAAC,KAAK,OAAO,MAAM,aAAa,CAAC;;AAM9G,IAAa,gBAAgB,eAAe,eAAe;;AAM3D,IAAa,QAAQ,eAAe,OAAO;;AAM3C,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