From 66ac95d035bb7821b5ef56237c3b448efbb6ecc1 Mon Sep 17 00:00:00 2001 From: Nishiki Liu Date: Thu, 26 Nov 2026 03:51:37 -0800 Subject: [PATCH 1/4] feat(learning): record which request dismissed a suggested update Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5 --- packages/learning/README.md | 4 ++-- packages/learning/conformance/index.mjs | 7 ++++++- .../contracts/v1/update-decision.schema.json | 5 +++++ packages/learning/index.d.mts | 12 ++++++++++-- packages/learning/src/cli.mjs | 8 ++++++-- packages/learning/src/contracts-validators.cjs | 2 +- packages/learning/src/store.mjs | 14 +++++++++++--- 7 files changed, 41 insertions(+), 11 deletions(-) diff --git a/packages/learning/README.md b/packages/learning/README.md index f7922882..78d77077 100644 --- a/packages/learning/README.md +++ b/packages/learning/README.md @@ -58,7 +58,7 @@ node /packages/learning/bin/replica-learning.mjs doctor | `outcomes ` | Lists how agents' uses of one learning were scored, oldest first. Each outcome names the version the agent received, the commit it reported, the efficiency from 1 to 4, whether the agent followed the learning, the evaluator's reasoning, and any before and after screenshot. Scores of a version whose evidence no longer permits review are left out | | `propose-update ` | Suggests new wording for an accepted learning when scored uses keep showing the same issue. See [Suggest learning updates](#suggest-learning-updates) | | `updates ` | Lists a learning's suggested updates, oldest first, each `open`, `applied`, `dismissed`, or `stale` | -| `apply-update --operation-id `, `dismiss-update ` | Records a person's decision on a suggested update. `apply-update` makes the suggested wording, or the person's edit of it from `--title-file` and `--content-file`, the learning's next version | +| `apply-update --operation-id `, `dismiss-update [--operation-id ]` | Records a person's decision on a suggested update. `apply-update` makes the suggested wording, or the person's edit of it from `--title-file` and `--content-file`, the learning's next version | | `delete --reason ` | Removes a learning for good: every version, the records of its deliveries and use, their screenshots, and its suggested updates. A learning that is part of a replacement, or that a stored proposal would replace, cannot be deleted; retire it instead | | `expire-guidance [--days ]` | Removes guidance records older than `--days`, 365 by default, that no usage report names | | `delete-repository --confirm ` | Removes every record this repository's store holds, including its audit trail. Naming the repository again guards against deleting the wrong store. Copies outside the store, such as exports, are not touched | @@ -299,7 +299,7 @@ The host names each attempt with `--operation-id`, so a retry keeps the first sc Only scores of the current version count, and only scores whose evidence included the Build's diff or a reviewer's confirmation. Each Build counts once, by its commit. Copilot is asked only when, in at least two Builds, the agent followed the learning and still scored 1 or 2 with an issue. It sees the newest 500 issues, groups them, names each group, and drafts the full new wording. A group becomes a suggestion only when it spans at least two Builds, more Builds than went well with a score of 3 or 4, and its wording differs from the current text. A run that finds too little evidence, or no new low or high scores since the last suggestion, spends nothing. A run where Copilot suggests nothing is not recorded, so a host runs it again only after new scores arrive. -A person decides with `apply-update` or `dismiss-update`. Applying records the wording, or the person's edit of it, as the learning's next version, the same way `edit` does. The host names each apply with `--operation-id`, so a retry finishes an apply that stopped partway. A suggestion goes `stale` when the learning changes, when it is no longer accepted, when a score it relied on is gone or no longer shown, when the learning is superseded or in conflict, or when a newer suggestion names the same issue. A dismissed issue is suggested again only with at least two Builds first scored after the dismissal, one confirmed by a reviewer. Drafting needs the evaluation purpose, since it sends the learning to Copilot. The route, usage reporting, and untrusted-input handling match [scoring](#score-applied-learnings). +A person decides with `apply-update` or `dismiss-update`. Applying records the wording, or the person's edit of it, as the learning's next version, the same way `edit` does. The host names each apply with `--operation-id`, so a retry finishes an apply that stopped partway. A host can also name a dismissal with `--operation-id`, so it can later tell its own dismissal from someone else's. A suggestion goes `stale` when the learning changes, when it is no longer accepted, when a score it relied on is gone or no longer shown, when the learning is superseded or in conflict, or when a newer suggestion names the same issue. A dismissed issue is suggested again only with at least two Builds first scored after the dismissal, one confirmed by a reviewer. Drafting needs the evaluation purpose, since it sends the learning to Copilot. The route, usage reporting, and untrusted-input handling match [scoring](#score-applied-learnings). ## Bring your own consolidator diff --git a/packages/learning/conformance/index.mjs b/packages/learning/conformance/index.mjs index 1cca2f59..a79c210f 100644 --- a/packages/learning/conformance/index.mjs +++ b/packages/learning/conformance/index.mjs @@ -1675,7 +1675,10 @@ export function memoryProviderConformance({ name, createProvider }) { const first = await store.proposeUpdate(agent(), update) const again = await store.proposeUpdate(agent(), { ...update, content: "Other wording." }) const other = await store.proposeUpdate(agent(), { ...update, issueKey: "label-contrast" }) - const dismissed = await store.dismissUpdate(designer(), other.id, { reason: "Not it." }) + const dismissed = await store.dismissUpdate(designer(), other.id, { + reason: "Not it.", + operationId: "77777777-7777-4777-8777-777777777777", + }) const redismissed = await store.dismissUpdate(designer(), other.id, { reason: "Not it." }) // A newer suggestion for the same issue replaces the first one. const newer = await store.proposeUpdate(agent(), { @@ -1706,6 +1709,8 @@ export function memoryProviderConformance({ name, createProvider }) { assert.deepEqual([first.stored, again.stored], [true, false]) assert.equal(again.proposal.content, update.content) assert.deepEqual([dismissed.stored, redismissed.stored], [true, false]) + // The host's recovery tells its own dismissal apart by this ID. + assert.equal(redismissed.update.decision.operationId, "77777777-7777-4777-8777-777777777777") assert.equal(applied.memory.version, record.version + 1) assert.equal(applied.memory.content, decision.content) assert.equal((await store.getMemory(designer(), proposal.id)).record.version, record.version + 1) diff --git a/packages/learning/contracts/v1/update-decision.schema.json b/packages/learning/contracts/v1/update-decision.schema.json index 6dc8174e..b21c23bf 100644 --- a/packages/learning/contracts/v1/update-decision.schema.json +++ b/packages/learning/contracts/v1/update-decision.schema.json @@ -58,6 +58,11 @@ "decidedAt": { "$ref": "common.schema.json#/$defs/timestamp" }, + "operationId": { + "description": "The host request that dismissed the proposal, so the host can tell its own dismissal from a later one.", + "type": "string", + "pattern": "^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$" + }, "digest": { "$ref": "common.schema.json#/$defs/digest" } diff --git a/packages/learning/index.d.mts b/packages/learning/index.d.mts index 5de4ef4f..6deaf84a 100644 --- a/packages/learning/index.d.mts +++ b/packages/learning/index.d.mts @@ -426,7 +426,14 @@ export type LearningUpdate = { counter: string[] proposedAt: Timestamp state: "open" | "applied" | "dismissed" | "stale" - decision?: { reason: string; decidedBy: Actor; decidedAt: Timestamp; appliedVersion?: number } + decision?: { + reason: string + decidedBy: Actor + decidedAt: Timestamp + appliedVersion?: number + /** The host request that dismissed the proposal, when the host named one. */ + operationId?: string + } } & ( | { withheld?: never; issue: string; title?: string; content: string; reasoning: string } | { withheld: true } @@ -1312,7 +1319,8 @@ export interface LearningStore { dismissUpdate( context: LearningContext, proposalId: string, - input: { reason: string }, + /** A host names the dismissal so its recovery can tell it from a later one. */ + input: { reason: string; operationId?: string }, ): Promise<{ update: LearningUpdate; stored: boolean }> /** * Remove a learning for good, with its deliveries, use, screenshots, scores, and update diff --git a/packages/learning/src/cli.mjs b/packages/learning/src/cli.mjs index 9ef8e33d..6e9ebb81 100644 --- a/packages/learning/src/cli.mjs +++ b/packages/learning/src/cli.mjs @@ -114,7 +114,8 @@ Review (a person decides; --by github:) --operation-id [--title-file ] [--content-file ] Make the suggested wording, or your edit of it, the learning's next version - dismiss-update --by (--reason | --reason-file ) + dismiss-update [--operation-id ] --by + (--reason | --reason-file ) Use recall [--task | --task-file ] [--limit ] [--budget ] @@ -1599,7 +1600,10 @@ async function dismissUpdate(session) { const reason = await reasonOf(session) const principal = person(session) const { store } = await open(session) - const result = await store.dismissUpdate(context(session, principal), id, { reason }) + const result = await store.dismissUpdate(context(session, principal), id, { + reason, + operationId: session.values["operation-id"], + }) session.out(result, result.stored ? `Dismissed ${id}.` : `${id} was already dismissed.`) } diff --git a/packages/learning/src/contracts-validators.cjs b/packages/learning/src/contracts-validators.cjs index 60fb23d7..1431fced 100644 --- a/packages/learning/src/contracts-validators.cjs +++ b/packages/learning/src/contracts-validators.cjs @@ -8,4 +8,4 @@ Number.isFinite(milliseconds) && new Date(milliseconds).toISOString() === `${value.slice(0, 23)}Z` ) -} })["date-time"];const pattern4 = new RegExp("^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$", "u");function validate56(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate56.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate56.errors = vErrors;return errors === 0;}validate56.evaluated = {"dynamicProps":false,"dynamicItems":false};const schema23 = {"description":"A person, agent, or system. asserted marks an identity the host could not authenticate.","type":"object","additionalProperties":false,"required":["kind","id"],"properties":{"kind":{"enum":["human","agent","system","service"]},"id":{"description":"A prefix such as github: and a name. The name has no whitespace, control characters, Unicode format characters, or code points from the tag block, U+E0000 to U+E007F, because each can make an ID read as another.","type":"string","minLength":3,"maxLength":300,"pattern":"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},"role":{"$ref":"#/$defs/slug"},"login":{"description":"The login shown at import time, for display only. Stable actor IDs, not this mutable login, identify reviewers.","type":"string","pattern":"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},"model":{"type":"string","minLength":1,"maxLength":200},"asserted":{"type":"boolean"}}};const pattern5 = new RegExp("^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$", "u");const pattern7 = new RegExp("^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$", "u");const schema24 = {"type":"string","minLength":1,"maxLength":128,"pattern":"^[a-z0-9]+(?:[._-][a-z0-9]+)*$"};const pattern6 = new RegExp("^[a-z0-9]+(?:[._-][a-z0-9]+)*$", "u");function validate59(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate59.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(func2(data) > 128){const err0 = {instancePath,schemaPath:"#/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(func2(data) < 1){const err1 = {instancePath,schemaPath:"#/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(!pattern6.test(data)){const err2 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"},message:"must match pattern \""+"^[a-z0-9]+(?:[._-][a-z0-9]+)*$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}validate59.errors = vErrors;return errors === 0;}validate59.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate58(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate58.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((((key0 === "kind") || (key0 === "id")) || (key0 === "role")) || (key0 === "login")) || (key0 === "model")) || (key0 === "asserted"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((data0 === "human") || (data0 === "agent")) || (data0 === "system")) || (data0 === "service"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema23.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.id !== undefined){let data1 = data.id;if(typeof data1 === "string"){if(func2(data1) > 300){const err4 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 3){const err5 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern5.test(data1)){const err6 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},message:"must match pattern \""+"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.role !== undefined){if(!(validate59(data.role, {instancePath:instancePath+"/role",parentData:data,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.login !== undefined){let data3 = data.login;if(typeof data3 === "string"){if(!pattern7.test(data3)){const err8 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},message:"must match pattern \""+"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"+"\""};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.model !== undefined){let data4 = data.model;if(typeof data4 === "string"){if(func2(data4) > 200){const err10 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data4) < 1){const err11 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.asserted !== undefined){if(typeof data.asserted !== "boolean"){const err13 = {instancePath:instancePath+"/asserted",schemaPath:"#/properties/asserted/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate58.errors = vErrors;return errors === 0;}validate58.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema25 = {"description":"Who a record belongs to. Hosts derive it from the caller's access, never from agent input.","type":"object","additionalProperties":false,"minProperties":1,"properties":{"host":{"description":"The Git or Hub host, such as github.com, when the scope comes from a repository URL. The same owner/name on two hosts never shares records.","type":"string","maxLength":261,"pattern":"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},"organization":{"$ref":"#/$defs/scopeName"},"team":{"$ref":"#/$defs/scopeName"},"repository":{"description":"owner/name in lowercase.","type":"string","pattern":"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},"product":{"$ref":"#/$defs/scopeName"}}};const pattern8 = new RegExp("^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$", "u");const pattern10 = new RegExp("^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$", "u");const schema26 = {"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9]+(?:[._-][a-z0-9]+)*$"};function validate63(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate63.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(func2(data) > 100){const err0 = {instancePath,schemaPath:"#/maxLength",keyword:"maxLength",params:{limit: 100},message:"must NOT have more than 100 characters"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(func2(data) < 1){const err1 = {instancePath,schemaPath:"#/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(!pattern6.test(data)){const err2 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"},message:"must match pattern \""+"^[a-z0-9]+(?:[._-][a-z0-9]+)*$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}validate63.errors = vErrors;return errors === 0;}validate63.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate62(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate62.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate62.errors = vErrors;return errors === 0;}validate62.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema27 = {"description":"What a record may be used for. Permission for one purpose never implies another.","enum":["review","instruction","evaluation","analytics","training","publication"]};function validate68(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate68.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!((((((data === "review") || (data === "instruction")) || (data === "evaluation")) || (data === "analytics")) || (data === "training")) || (data === "publication"))){const err0 = {instancePath,schemaPath:"#/enum",keyword:"enum",params:{allowedValues: schema27.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}validate68.errors = vErrors;return errors === 0;}validate68.evaluated = {"dynamicProps":false,"dynamicItems":false};const schema28 = {"description":"SHA-256 of the RFC 8785 canonical JSON of a value.","type":"string","pattern":"^sha256:[0-9a-f]{64}$"};const pattern11 = new RegExp("^sha256:[0-9a-f]{64}$", "u");function validate71(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate71.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate71.errors = vErrors;return errors === 0;}validate71.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate73(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate73.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(func2(data) > 128){const err0 = {instancePath,schemaPath:"#/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(func2(data) < 1){const err1 = {instancePath,schemaPath:"#/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(!pattern6.test(data)){const err2 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"},message:"must match pattern \""+"^[a-z0-9]+(?:[._-][a-z0-9]+)*$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}validate73.errors = vErrors;return errors === 0;}validate73.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate52(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/audit-entry.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate52.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.at === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "at"},message:"must have required property '"+"at"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.actor === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "actor"},message:"must have required property '"+"actor"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.operation === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "operation"},message:"must have required property '"+"operation"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.scope === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.subjects === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "subjects"},message:"must have required property '"+"subjects"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.outcome === undefined){const err7 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "outcome"},message:"must have required property '"+"outcome"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.provider === undefined){const err8 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "provider"},message:"must have required property '"+"provider"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data.digest === undefined){const err9 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}for(const key0 in data){if(!(func1.call(schema19.properties, key0))){const err10 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.schemaVersion !== undefined){if("replica.audit/v1" !== data.schemaVersion){const err11 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.audit/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data.id !== undefined){if(!(validate54(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate54.errors : vErrors.concat(validate54.errors);errors = vErrors.length;}}if(data.at !== undefined){if(!(validate56(data.at, {instancePath:instancePath+"/at",parentData:data,parentDataProperty:"at",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate56.errors : vErrors.concat(validate56.errors);errors = vErrors.length;}}if(data.actor !== undefined){if(!(validate58(data.actor, {instancePath:instancePath+"/actor",parentData:data,parentDataProperty:"actor",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate58.errors : vErrors.concat(validate58.errors);errors = vErrors.length;}}if(data.operation !== undefined){let data4 = data.operation;if(!((((((((((((((((((((((data4 === "grant.add") || (data4 === "grant.withdraw")) || (data4 === "collection.import")) || (data4 === "observation.append")) || (data4 === "evidence.redact")) || (data4 === "annotation.add")) || (data4 === "consolidation.run")) || (data4 === "memory.propose")) || (data4 === "memory.accept")) || (data4 === "memory.edit")) || (data4 === "memory.reinstate")) || (data4 === "memory.reject")) || (data4 === "memory.retire")) || (data4 === "memory.supersede")) || (data4 === "memory.recall")) || (data4 === "memory.delete")) || (data4 === "usage.report")) || (data4 === "usage.score")) || (data4 === "update.propose")) || (data4 === "update.decide")) || (data4 === "guidance.expire")) || (data4 === "export.create"))){const err12 = {instancePath:instancePath+"/operation",schemaPath:"#/properties/operation/enum",keyword:"enum",params:{allowedValues: schema19.properties.operation.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.scope !== undefined){if(!(validate62(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate62.errors : vErrors.concat(validate62.errors);errors = vErrors.length;}}if(data.purpose !== undefined){if(!(validate68(data.purpose, {instancePath:instancePath+"/purpose",parentData:data,parentDataProperty:"purpose",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate68.errors : vErrors.concat(validate68.errors);errors = vErrors.length;}}if(data.subjects !== undefined){let data7 = data.subjects;if(Array.isArray(data7)){if(data7.length > 10000){const err13 = {instancePath:instancePath+"/subjects",schemaPath:"#/properties/subjects/maxItems",keyword:"maxItems",params:{limit: 10000},message:"must NOT have more than 10000 items"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}const len0 = data7.length;for(let i0=0; i0 2000){const err21 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}if(func2(data13) < 1){const err22 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}else {const err23 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}if(data.provider !== undefined){let data14 = data.provider;if(data14 && typeof data14 == "object" && !Array.isArray(data14)){if(data14.id === undefined){const err24 = {instancePath:instancePath+"/provider",schemaPath:"#/properties/provider/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}if(data14.version === undefined){const err25 = {instancePath:instancePath+"/provider",schemaPath:"#/properties/provider/required",keyword:"required",params:{missingProperty: "version"},message:"must have required property '"+"version"+"'"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}for(const key2 in data14){if(!((key2 === "id") || (key2 === "version"))){const err26 = {instancePath:instancePath+"/provider",schemaPath:"#/properties/provider/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}if(data14.id !== undefined){if(!(validate73(data14.id, {instancePath:instancePath+"/provider/id",parentData:data14,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate73.errors : vErrors.concat(validate73.errors);errors = vErrors.length;}}if(data14.version !== undefined){let data16 = data14.version;if(typeof data16 === "string"){if(func2(data16) > 64){const err27 = {instancePath:instancePath+"/provider/version",schemaPath:"#/properties/provider/properties/version/maxLength",keyword:"maxLength",params:{limit: 64},message:"must NOT have more than 64 characters"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}if(func2(data16) < 1){const err28 = {instancePath:instancePath+"/provider/version",schemaPath:"#/properties/provider/properties/version/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}else {const err29 = {instancePath:instancePath+"/provider/version",schemaPath:"#/properties/provider/properties/version/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}}else {const err30 = {instancePath:instancePath+"/provider",schemaPath:"#/properties/provider/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}if(data.digest !== undefined){if(!(validate71(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate71.errors : vErrors.concat(validate71.errors);errors = vErrors.length;}}}else {const err31 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}validate52.errors = vErrors;return errors === 0;}validate52.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.collection = validate76;const schema30 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/collection.schema.json","title":"Replica evidence collection v1","description":"One import of source evidence for a time window. complete is true only when every page and reply continuation was present. A window that no complete collection covers is reported as incomplete, never as empty.","type":"object","additionalProperties":false,"required":["schemaVersion","id","source","scope","snapshotId","snapshotDigest","capturedAt","filters","complete","problems","counts","importedAt","importedBy","digest"],"properties":{"schemaVersion":{"const":"replica.collection/v1"},"id":{"$ref":"common.schema.json#/$defs/id"},"source":{"$ref":"common.schema.json#/$defs/source"},"scope":{"$ref":"common.schema.json#/$defs/scope"},"snapshotId":{"type":"string","pattern":"^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$"},"snapshotDigest":{"description":"The digest of the snapshot's normalized contents. A scope normally stores one collection per snapshotId; migration can retain multiple matching historical collections. Reimports must match every retained collection.","$ref":"common.schema.json#/$defs/digest"},"reviewerIdentity":{"description":"Once a Hub source opts into stable identities, login-only evidence from that source serves review only.","const":"stable-user-id"},"capturedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"filters":{"type":"object","additionalProperties":false,"required":["resolution","read","from","to"],"properties":{"resolution":{"enum":["all","unresolved","resolved"]},"read":{"enum":["all","unread","read"]},"from":{"anyOf":[{"$ref":"common.schema.json#/$defs/timestamp"},{"type":"null"}]},"to":{"anyOf":[{"$ref":"common.schema.json#/$defs/timestamp"},{"type":"null"}]}}},"complete":{"type":"boolean"},"problems":{"type":"array","maxItems":1000,"items":{"type":"string","minLength":1,"maxLength":2000}},"counts":{"type":"object","additionalProperties":false,"required":["threads","messages","episodes","events"],"properties":{"threads":{"$ref":"common.schema.json#/$defs/count"},"messages":{"$ref":"common.schema.json#/$defs/count"},"episodes":{"$ref":"common.schema.json#/$defs/count"},"events":{"$ref":"common.schema.json#/$defs/count"}}},"importedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"importedBy":{"$ref":"common.schema.json#/$defs/actor"},"digest":{"$ref":"common.schema.json#/$defs/digest"}}};function validate77(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate77.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate77.errors = vErrors;return errors === 0;}validate77.evaluated = {"dynamicProps":false,"dynamicItems":false};const schema32 = {"description":"Where an episode or a piece of evidence came from, pinned to the exact Build when there is one.","type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"$ref":"#/$defs/sourceKind"},"hubOrigin":{"$ref":"#/$defs/origin"},"repository":{"type":"string","pattern":"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},"repositoryId":{"$ref":"#/$defs/sourceIdentifier"},"prototypeId":{"$ref":"#/$defs/sourceIdentifier"},"prototypeName":{"type":"string","minLength":1,"maxLength":1024},"branch":{"type":"string","minLength":1,"maxLength":1024},"buildNumber":{"$ref":"#/$defs/positiveInteger"},"buildId":{"$ref":"#/$defs/positiveInteger"},"commitSha":{"$ref":"#/$defs/commitSha"},"threadId":{"$ref":"#/$defs/positiveInteger"},"commentId":{"$ref":"#/$defs/positiveInteger"},"sessionId":{"type":"string","minLength":1,"maxLength":200}}};const schema33 = {"description":"Where evidence came from, such as hub_review_comments.","type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"};const pattern14 = new RegExp("^[a-z][a-z0-9_]{1,63}$", "u");function validate80(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate80.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern14.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9_]{1,63}$"},message:"must match pattern \""+"^[a-z][a-z0-9_]{1,63}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate80.errors = vErrors;return errors === 0;}validate80.evaluated = {"dynamicProps":false,"dynamicItems":false};const schema34 = {"description":"An HTTP or HTTPS origin without credentials, path, query, or fragment.","type":"string","maxLength":2048,"pattern":"^https?://[A-Za-z0-9.-]+(?::[0-9]{1,5})?$"};const pattern15 = new RegExp("^https?://[A-Za-z0-9.-]+(?::[0-9]{1,5})?$", "u");function validate82(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate82.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(func2(data) > 2048){const err0 = {instancePath,schemaPath:"#/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!pattern15.test(data)){const err1 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^https?://[A-Za-z0-9.-]+(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^https?://[A-Za-z0-9.-]+(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate82.errors = vErrors;return errors === 0;}validate82.evaluated = {"dynamicProps":false,"dynamicItems":false};const schema35 = {"description":"A stable source-system identifier, either a legacy positive integer or a UUID.","oneOf":[{"$ref":"#/$defs/positiveInteger"},{"type":"string","pattern":"^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$"}]};const schema36 = {"type":"integer","minimum":1,"maximum":9007199254740991};function validate85(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate85.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!(((typeof data == "number") && (!(data % 1) && !isNaN(data))) && (isFinite(data)))){const err0 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if((typeof data == "number") && (isFinite(data))){if(data > 9007199254740991 || isNaN(data)){const err1 = {instancePath,schemaPath:"#/maximum",keyword:"maximum",params:{comparison: "<=", limit: 9007199254740991},message:"must be <= 9007199254740991"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data < 1 || isNaN(data)){const err2 = {instancePath,schemaPath:"#/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}validate85.errors = vErrors;return errors === 0;}validate85.evaluated = {"dynamicProps":false,"dynamicItems":false};const pattern17 = new RegExp("^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$", "u");function validate84(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate84.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}const _errs0 = errors;let valid0 = false;let passing0 = null;const _errs1 = errors;if(!(validate85(data, {instancePath,parentData,parentDataProperty,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}var _valid0 = _errs1 === errors;if(_valid0){valid0 = true;passing0 = 0;}const _errs2 = errors;if(typeof data === "string"){if(!pattern17.test(data)){const err0 = {instancePath,schemaPath:"#/oneOf/1/pattern",keyword:"pattern",params:{pattern: "^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$"},message:"must match pattern \""+"^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/oneOf/1/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}var _valid0 = _errs2 === errors;if(_valid0 && valid0){valid0 = false;passing0 = [passing0, 1];}else {if(_valid0){valid0 = true;passing0 = 1;}}if(!valid0){const err2 = {instancePath,schemaPath:"#/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}else {errors = _errs0;if(vErrors !== null){if(_errs0){vErrors.length = _errs0;}else {vErrors = null;}}}validate84.errors = vErrors;return errors === 0;}validate84.evaluated = {"dynamicProps":false,"dynamicItems":false};const schema37 = {"type":"string","pattern":"^[0-9a-f]{40}$"};const pattern18 = new RegExp("^[0-9a-f]{40}$", "u");function validate91(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate91.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern18.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9a-f]{40}$"},message:"must match pattern \""+"^[0-9a-f]{40}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate91.errors = vErrors;return errors === 0;}validate91.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate79(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate79.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(func1.call(schema32.properties, key0))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.kind !== undefined){if(!(validate80(data.kind, {instancePath:instancePath+"/kind",parentData:data,parentDataProperty:"kind",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate80.errors : vErrors.concat(validate80.errors);errors = vErrors.length;}}if(data.hubOrigin !== undefined){if(!(validate82(data.hubOrigin, {instancePath:instancePath+"/hubOrigin",parentData:data,parentDataProperty:"hubOrigin",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate82.errors : vErrors.concat(validate82.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data2 = data.repository;if(typeof data2 === "string"){if(!pattern10.test(data2)){const err2 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.repositoryId !== undefined){if(!(validate84(data.repositoryId, {instancePath:instancePath+"/repositoryId",parentData:data,parentDataProperty:"repositoryId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate84.errors : vErrors.concat(validate84.errors);errors = vErrors.length;}}if(data.prototypeId !== undefined){if(!(validate84(data.prototypeId, {instancePath:instancePath+"/prototypeId",parentData:data,parentDataProperty:"prototypeId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate84.errors : vErrors.concat(validate84.errors);errors = vErrors.length;}}if(data.prototypeName !== undefined){let data5 = data.prototypeName;if(typeof data5 === "string"){if(func2(data5) > 1024){const err4 = {instancePath:instancePath+"/prototypeName",schemaPath:"#/properties/prototypeName/maxLength",keyword:"maxLength",params:{limit: 1024},message:"must NOT have more than 1024 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data5) < 1){const err5 = {instancePath:instancePath+"/prototypeName",schemaPath:"#/properties/prototypeName/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/prototypeName",schemaPath:"#/properties/prototypeName/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.branch !== undefined){let data6 = data.branch;if(typeof data6 === "string"){if(func2(data6) > 1024){const err7 = {instancePath:instancePath+"/branch",schemaPath:"#/properties/branch/maxLength",keyword:"maxLength",params:{limit: 1024},message:"must NOT have more than 1024 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func2(data6) < 1){const err8 = {instancePath:instancePath+"/branch",schemaPath:"#/properties/branch/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/branch",schemaPath:"#/properties/branch/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.buildNumber !== undefined){if(!(validate85(data.buildNumber, {instancePath:instancePath+"/buildNumber",parentData:data,parentDataProperty:"buildNumber",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}if(data.buildId !== undefined){if(!(validate85(data.buildId, {instancePath:instancePath+"/buildId",parentData:data,parentDataProperty:"buildId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}if(data.commitSha !== undefined){if(!(validate91(data.commitSha, {instancePath:instancePath+"/commitSha",parentData:data,parentDataProperty:"commitSha",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate91.errors : vErrors.concat(validate91.errors);errors = vErrors.length;}}if(data.threadId !== undefined){if(!(validate85(data.threadId, {instancePath:instancePath+"/threadId",parentData:data,parentDataProperty:"threadId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}if(data.commentId !== undefined){if(!(validate85(data.commentId, {instancePath:instancePath+"/commentId",parentData:data,parentDataProperty:"commentId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}if(data.sessionId !== undefined){let data12 = data.sessionId;if(typeof data12 === "string"){if(func2(data12) > 200){const err10 = {instancePath:instancePath+"/sessionId",schemaPath:"#/properties/sessionId/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data12) < 1){const err11 = {instancePath:instancePath+"/sessionId",schemaPath:"#/properties/sessionId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/sessionId",schemaPath:"#/properties/sessionId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}validate79.errors = vErrors;return errors === 0;}validate79.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate96(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate96.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate96.errors = vErrors;return errors === 0;}validate96.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate101(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate101.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate101.errors = vErrors;return errors === 0;}validate101.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate103(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate103.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate103.errors = vErrors;return errors === 0;}validate103.evaluated = {"dynamicProps":false,"dynamicItems":false};const schema41 = {"type":"integer","minimum":0,"maximum":9007199254740991};function validate107(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate107.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!(((typeof data == "number") && (!(data % 1) && !isNaN(data))) && (isFinite(data)))){const err0 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if((typeof data == "number") && (isFinite(data))){if(data > 9007199254740991 || isNaN(data)){const err1 = {instancePath,schemaPath:"#/maximum",keyword:"maximum",params:{comparison: "<=", limit: 9007199254740991},message:"must be <= 9007199254740991"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data < 0 || isNaN(data)){const err2 = {instancePath,schemaPath:"#/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}validate107.errors = vErrors;return errors === 0;}validate107.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate113(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate113.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((((key0 === "kind") || (key0 === "id")) || (key0 === "role")) || (key0 === "login")) || (key0 === "model")) || (key0 === "asserted"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((data0 === "human") || (data0 === "agent")) || (data0 === "system")) || (data0 === "service"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema23.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.id !== undefined){let data1 = data.id;if(typeof data1 === "string"){if(func2(data1) > 300){const err4 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 3){const err5 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern5.test(data1)){const err6 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},message:"must match pattern \""+"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.role !== undefined){if(!(validate59(data.role, {instancePath:instancePath+"/role",parentData:data,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.login !== undefined){let data3 = data.login;if(typeof data3 === "string"){if(!pattern7.test(data3)){const err8 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},message:"must match pattern \""+"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"+"\""};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.model !== undefined){let data4 = data.model;if(typeof data4 === "string"){if(func2(data4) > 200){const err10 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data4) < 1){const err11 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.asserted !== undefined){if(typeof data.asserted !== "boolean"){const err13 = {instancePath:instancePath+"/asserted",schemaPath:"#/properties/asserted/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate113.errors = vErrors;return errors === 0;}validate113.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const pattern21 = new RegExp("^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$", "u");function validate76(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/collection.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate76.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.source === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "source"},message:"must have required property '"+"source"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.scope === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.snapshotId === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "snapshotId"},message:"must have required property '"+"snapshotId"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.snapshotDigest === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "snapshotDigest"},message:"must have required property '"+"snapshotDigest"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.capturedAt === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "capturedAt"},message:"must have required property '"+"capturedAt"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.filters === undefined){const err7 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "filters"},message:"must have required property '"+"filters"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.complete === undefined){const err8 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "complete"},message:"must have required property '"+"complete"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data.problems === undefined){const err9 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "problems"},message:"must have required property '"+"problems"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(data.counts === undefined){const err10 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "counts"},message:"must have required property '"+"counts"+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(data.importedAt === undefined){const err11 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "importedAt"},message:"must have required property '"+"importedAt"+"'"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(data.importedBy === undefined){const err12 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "importedBy"},message:"must have required property '"+"importedBy"+"'"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}if(data.digest === undefined){const err13 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}for(const key0 in data){if(!(func1.call(schema30.properties, key0))){const err14 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data.schemaVersion !== undefined){if("replica.collection/v1" !== data.schemaVersion){const err15 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.collection/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data.id !== undefined){if(!(validate77(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate77.errors : vErrors.concat(validate77.errors);errors = vErrors.length;}}if(data.source !== undefined){if(!(validate79(data.source, {instancePath:instancePath+"/source",parentData:data,parentDataProperty:"source",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate79.errors : vErrors.concat(validate79.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate96(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate96.errors : vErrors.concat(validate96.errors);errors = vErrors.length;}}if(data.snapshotId !== undefined){let data4 = data.snapshotId;if(typeof data4 === "string"){if(!pattern21.test(data4)){const err16 = {instancePath:instancePath+"/snapshotId",schemaPath:"#/properties/snapshotId/pattern",keyword:"pattern",params:{pattern: "^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$"},message:"must match pattern \""+"^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$"+"\""};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}else {const err17 = {instancePath:instancePath+"/snapshotId",schemaPath:"#/properties/snapshotId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}if(data.snapshotDigest !== undefined){if(!(validate101(data.snapshotDigest, {instancePath:instancePath+"/snapshotDigest",parentData:data,parentDataProperty:"snapshotDigest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate101.errors : vErrors.concat(validate101.errors);errors = vErrors.length;}}if(data.reviewerIdentity !== undefined){if("stable-user-id" !== data.reviewerIdentity){const err18 = {instancePath:instancePath+"/reviewerIdentity",schemaPath:"#/properties/reviewerIdentity/const",keyword:"const",params:{allowedValue: "stable-user-id"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data.capturedAt !== undefined){if(!(validate103(data.capturedAt, {instancePath:instancePath+"/capturedAt",parentData:data,parentDataProperty:"capturedAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate103.errors : vErrors.concat(validate103.errors);errors = vErrors.length;}}if(data.filters !== undefined){let data8 = data.filters;if(data8 && typeof data8 == "object" && !Array.isArray(data8)){if(data8.resolution === undefined){const err19 = {instancePath:instancePath+"/filters",schemaPath:"#/properties/filters/required",keyword:"required",params:{missingProperty: "resolution"},message:"must have required property '"+"resolution"+"'"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}if(data8.read === undefined){const err20 = {instancePath:instancePath+"/filters",schemaPath:"#/properties/filters/required",keyword:"required",params:{missingProperty: "read"},message:"must have required property '"+"read"+"'"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}if(data8.from === undefined){const err21 = {instancePath:instancePath+"/filters",schemaPath:"#/properties/filters/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}if(data8.to === undefined){const err22 = {instancePath:instancePath+"/filters",schemaPath:"#/properties/filters/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}for(const key1 in data8){if(!((((key1 === "resolution") || (key1 === "read")) || (key1 === "from")) || (key1 === "to"))){const err23 = {instancePath:instancePath+"/filters",schemaPath:"#/properties/filters/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}if(data8.resolution !== undefined){let data9 = data8.resolution;if(!(((data9 === "all") || (data9 === "unresolved")) || (data9 === "resolved"))){const err24 = {instancePath:instancePath+"/filters/resolution",schemaPath:"#/properties/filters/properties/resolution/enum",keyword:"enum",params:{allowedValues: schema30.properties.filters.properties.resolution.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}if(data8.read !== undefined){let data10 = data8.read;if(!(((data10 === "all") || (data10 === "unread")) || (data10 === "read"))){const err25 = {instancePath:instancePath+"/filters/read",schemaPath:"#/properties/filters/properties/read/enum",keyword:"enum",params:{allowedValues: schema30.properties.filters.properties.read.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}if(data8.from !== undefined){let data11 = data8.from;const _errs17 = errors;let valid2 = false;const _errs18 = errors;if(!(validate103(data11, {instancePath:instancePath+"/filters/from",parentData:data8,parentDataProperty:"from",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate103.errors : vErrors.concat(validate103.errors);errors = vErrors.length;}var _valid0 = _errs18 === errors;valid2 = valid2 || _valid0;const _errs19 = errors;if(data11 !== null){const err26 = {instancePath:instancePath+"/filters/from",schemaPath:"#/properties/filters/properties/from/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}var _valid0 = _errs19 === errors;valid2 = valid2 || _valid0;if(!valid2){const err27 = {instancePath:instancePath+"/filters/from",schemaPath:"#/properties/filters/properties/from/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}else {errors = _errs17;if(vErrors !== null){if(_errs17){vErrors.length = _errs17;}else {vErrors = null;}}}}if(data8.to !== undefined){let data12 = data8.to;const _errs22 = errors;let valid3 = false;const _errs23 = errors;if(!(validate103(data12, {instancePath:instancePath+"/filters/to",parentData:data8,parentDataProperty:"to",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate103.errors : vErrors.concat(validate103.errors);errors = vErrors.length;}var _valid1 = _errs23 === errors;valid3 = valid3 || _valid1;const _errs24 = errors;if(data12 !== null){const err28 = {instancePath:instancePath+"/filters/to",schemaPath:"#/properties/filters/properties/to/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}var _valid1 = _errs24 === errors;valid3 = valid3 || _valid1;if(!valid3){const err29 = {instancePath:instancePath+"/filters/to",schemaPath:"#/properties/filters/properties/to/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}else {errors = _errs22;if(vErrors !== null){if(_errs22){vErrors.length = _errs22;}else {vErrors = null;}}}}}else {const err30 = {instancePath:instancePath+"/filters",schemaPath:"#/properties/filters/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}if(data.complete !== undefined){if(typeof data.complete !== "boolean"){const err31 = {instancePath:instancePath+"/complete",schemaPath:"#/properties/complete/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}if(data.problems !== undefined){let data14 = data.problems;if(Array.isArray(data14)){if(data14.length > 1000){const err32 = {instancePath:instancePath+"/problems",schemaPath:"#/properties/problems/maxItems",keyword:"maxItems",params:{limit: 1000},message:"must NOT have more than 1000 items"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}const len0 = data14.length;for(let i0=0; i0 2000){const err33 = {instancePath:instancePath+"/problems/" + i0,schemaPath:"#/properties/problems/items/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}if(func2(data15) < 1){const err34 = {instancePath:instancePath+"/problems/" + i0,schemaPath:"#/properties/problems/items/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}else {const err35 = {instancePath:instancePath+"/problems/" + i0,schemaPath:"#/properties/problems/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}}else {const err36 = {instancePath:instancePath+"/problems",schemaPath:"#/properties/problems/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}}if(data.counts !== undefined){let data16 = data.counts;if(data16 && typeof data16 == "object" && !Array.isArray(data16)){if(data16.threads === undefined){const err37 = {instancePath:instancePath+"/counts",schemaPath:"#/properties/counts/required",keyword:"required",params:{missingProperty: "threads"},message:"must have required property '"+"threads"+"'"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}if(data16.messages === undefined){const err38 = {instancePath:instancePath+"/counts",schemaPath:"#/properties/counts/required",keyword:"required",params:{missingProperty: "messages"},message:"must have required property '"+"messages"+"'"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}if(data16.episodes === undefined){const err39 = {instancePath:instancePath+"/counts",schemaPath:"#/properties/counts/required",keyword:"required",params:{missingProperty: "episodes"},message:"must have required property '"+"episodes"+"'"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}if(data16.events === undefined){const err40 = {instancePath:instancePath+"/counts",schemaPath:"#/properties/counts/required",keyword:"required",params:{missingProperty: "events"},message:"must have required property '"+"events"+"'"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}for(const key2 in data16){if(!((((key2 === "threads") || (key2 === "messages")) || (key2 === "episodes")) || (key2 === "events"))){const err41 = {instancePath:instancePath+"/counts",schemaPath:"#/properties/counts/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}if(data16.threads !== undefined){if(!(validate107(data16.threads, {instancePath:instancePath+"/counts/threads",parentData:data16,parentDataProperty:"threads",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate107.errors : vErrors.concat(validate107.errors);errors = vErrors.length;}}if(data16.messages !== undefined){if(!(validate107(data16.messages, {instancePath:instancePath+"/counts/messages",parentData:data16,parentDataProperty:"messages",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate107.errors : vErrors.concat(validate107.errors);errors = vErrors.length;}}if(data16.episodes !== undefined){if(!(validate107(data16.episodes, {instancePath:instancePath+"/counts/episodes",parentData:data16,parentDataProperty:"episodes",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate107.errors : vErrors.concat(validate107.errors);errors = vErrors.length;}}if(data16.events !== undefined){if(!(validate107(data16.events, {instancePath:instancePath+"/counts/events",parentData:data16,parentDataProperty:"events",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate107.errors : vErrors.concat(validate107.errors);errors = vErrors.length;}}}else {const err42 = {instancePath:instancePath+"/counts",schemaPath:"#/properties/counts/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data.importedAt !== undefined){if(!(validate103(data.importedAt, {instancePath:instancePath+"/importedAt",parentData:data,parentDataProperty:"importedAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate103.errors : vErrors.concat(validate103.errors);errors = vErrors.length;}}if(data.importedBy !== undefined){if(!(validate113(data.importedBy, {instancePath:instancePath+"/importedBy",parentData:data,parentDataProperty:"importedBy",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate113.errors : vErrors.concat(validate113.errors);errors = vErrors.length;}}if(data.digest !== undefined){if(!(validate101(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate101.errors : vErrors.concat(validate101.errors);errors = vErrors.length;}}}else {const err43 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}validate76.errors = vErrors;return errors === 0;}validate76.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.consentGrant = validate117;const schema43 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/consent-grant.schema.json","title":"Replica consent grant v1","description":"Permission to use evidence from named sources, in one scope, for named purposes. A host decides at read time whether a record may be used for a purpose: some active grant in the record's scope must name the purpose and the record's source, and cover the evidence's original time. Reading feedback, publishing it, and training on it are separate purposes. A grant is never edited; a withdrawal record ends a purpose.","type":"object","additionalProperties":false,"required":["schemaVersion","id","scope","purposes","sources","grantedBy","grantedAt","basis","digest"],"properties":{"schemaVersion":{"const":"replica.consent-grant/v1"},"id":{"$ref":"common.schema.json#/$defs/id"},"scope":{"$ref":"common.schema.json#/$defs/scope"},"purposes":{"$ref":"common.schema.json#/$defs/purposes"},"sources":{"type":"array","minItems":1,"maxItems":20,"items":{"$ref":"common.schema.json#/$defs/sourceKind"}},"grantedBy":{"$ref":"common.schema.json#/$defs/humanActor"},"grantedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"expiresAt":{"$ref":"common.schema.json#/$defs/timestamp"},"evidenceFrom":{"description":"Covers only evidence whose original time is at or after this time. Omit to cover earlier evidence too.","$ref":"common.schema.json#/$defs/timestamp"},"evidenceUntil":{"description":"Covers only evidence whose original time is before this time. Omit for no upper bound.","$ref":"common.schema.json#/$defs/timestamp"},"basis":{"description":"Why this use is allowed, such as a team agreement or a study consent form.","type":"string","minLength":1,"maxLength":2000},"digest":{"$ref":"common.schema.json#/$defs/digest"}}};function validate118(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate118.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate118.errors = vErrors;return errors === 0;}validate118.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate120(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate120.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate120.errors = vErrors;return errors === 0;}validate120.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema46 = {"type":"array","minItems":1,"maxItems":6,"items":{"$ref":"#/$defs/purpose"}};function validate126(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate126.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!((((((data === "review") || (data === "instruction")) || (data === "evaluation")) || (data === "analytics")) || (data === "training")) || (data === "publication"))){const err0 = {instancePath,schemaPath:"#/enum",keyword:"enum",params:{allowedValues: schema27.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}validate126.errors = vErrors;return errors === 0;}validate126.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate125(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate125.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(Array.isArray(data)){if(data.length > 6){const err0 = {instancePath,schemaPath:"#/maxItems",keyword:"maxItems",params:{limit: 6},message:"must NOT have more than 6 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.length < 1){const err1 = {instancePath,schemaPath:"#/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}const len0 = data.length;for(let i0=0; i0 300){const err4 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 3){const err5 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern5.test(data1)){const err6 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},message:"must match pattern \""+"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.role !== undefined){if(!(validate59(data.role, {instancePath:instancePath+"/role",parentData:data,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.login !== undefined){let data3 = data.login;if(typeof data3 === "string"){if(!pattern7.test(data3)){const err8 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},message:"must match pattern \""+"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"+"\""};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.model !== undefined){let data4 = data.model;if(typeof data4 === "string"){if(func2(data4) > 200){const err10 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data4) < 1){const err11 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.asserted !== undefined){if(typeof data.asserted !== "boolean"){const err13 = {instancePath:instancePath+"/asserted",schemaPath:"#/properties/asserted/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate132.errors = vErrors;return errors === 0;}validate132.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate131(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate131.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!(validate132(data, {instancePath,parentData,parentDataProperty,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate132.errors : vErrors.concat(validate132.errors);errors = vErrors.length;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind !== undefined){if("human" !== data.kind){const err0 = {instancePath:instancePath+"/kind",schemaPath:"#/allOf/1/properties/kind/const",keyword:"const",params:{allowedValue: "human"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}}else {const err1 = {instancePath,schemaPath:"#/allOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate131.errors = vErrors;return errors === 0;}validate131.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate136(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate136.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate136.errors = vErrors;return errors === 0;}validate136.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate141(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate141.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate141.errors = vErrors;return errors === 0;}validate141.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate117(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/consent-grant.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate117.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.scope === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.purposes === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "purposes"},message:"must have required property '"+"purposes"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.sources === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "sources"},message:"must have required property '"+"sources"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.grantedBy === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "grantedBy"},message:"must have required property '"+"grantedBy"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.grantedAt === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "grantedAt"},message:"must have required property '"+"grantedAt"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.basis === undefined){const err7 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "basis"},message:"must have required property '"+"basis"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.digest === undefined){const err8 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}for(const key0 in data){if(!(func1.call(schema43.properties, key0))){const err9 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.schemaVersion !== undefined){if("replica.consent-grant/v1" !== data.schemaVersion){const err10 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.consent-grant/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.id !== undefined){if(!(validate118(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate118.errors : vErrors.concat(validate118.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate120(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate120.errors : vErrors.concat(validate120.errors);errors = vErrors.length;}}if(data.purposes !== undefined){if(!(validate125(data.purposes, {instancePath:instancePath+"/purposes",parentData:data,parentDataProperty:"purposes",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate125.errors : vErrors.concat(validate125.errors);errors = vErrors.length;}}if(data.sources !== undefined){let data4 = data.sources;if(Array.isArray(data4)){if(data4.length > 20){const err11 = {instancePath:instancePath+"/sources",schemaPath:"#/properties/sources/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(data4.length < 1){const err12 = {instancePath:instancePath+"/sources",schemaPath:"#/properties/sources/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}const len0 = data4.length;for(let i0=0; i0 2000){const err14 = {instancePath:instancePath+"/basis",schemaPath:"#/properties/basis/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}if(func2(data11) < 1){const err15 = {instancePath:instancePath+"/basis",schemaPath:"#/properties/basis/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}else {const err16 = {instancePath:instancePath+"/basis",schemaPath:"#/properties/basis/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}if(data.digest !== undefined){if(!(validate141(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate141.errors : vErrors.concat(validate141.errors);errors = vErrors.length;}}}else {const err17 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate117.errors = vErrors;return errors === 0;}validate117.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.deliveredLearning = validate143;const schema53 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/delivered-learning.schema.json","title":"Replica delivered learning v1","description":"One learning version a guidance record gave an agent, with the exact text the agent received.","type":"object","additionalProperties":false,"required":["schemaVersion","id","scope","guidanceId","memoryId","contentDigest","sourceScope","position","text","deliveredAt","digest"],"properties":{"schemaVersion":{"const":"replica.delivered-learning/v1"},"id":{"$ref":"common.schema.json#/$defs/id"},"scope":{"$ref":"common.schema.json#/$defs/scope"},"guidanceId":{"$ref":"common.schema.json#/$defs/id"},"memoryId":{"$ref":"common.schema.json#/$defs/id"},"contentDigest":{"$ref":"common.schema.json#/$defs/digest"},"sourceScope":{"$ref":"common.schema.json#/$defs/scope","description":"The repository the learning belongs to. A shared learning names its source repository."},"position":{"$ref":"common.schema.json#/$defs/positiveInteger"},"text":{"type":"string","minLength":1,"maxLength":20000},"deliveredAt":{"$ref":"common.schema.json#/$defs/timestamp"},"digest":{"$ref":"common.schema.json#/$defs/digest"}}};function validate144(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate144.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate144.errors = vErrors;return errors === 0;}validate144.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate146(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate146.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate146.errors = vErrors;return errors === 0;}validate146.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate153(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate153.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate153.errors = vErrors;return errors === 0;}validate153.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate156(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate156.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!(((typeof data == "number") && (!(data % 1) && !isNaN(data))) && (isFinite(data)))){const err0 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if((typeof data == "number") && (isFinite(data))){if(data > 9007199254740991 || isNaN(data)){const err1 = {instancePath,schemaPath:"#/maximum",keyword:"maximum",params:{comparison: "<=", limit: 9007199254740991},message:"must be <= 9007199254740991"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data < 1 || isNaN(data)){const err2 = {instancePath,schemaPath:"#/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}validate156.errors = vErrors;return errors === 0;}validate156.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate158(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate158.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate158.errors = vErrors;return errors === 0;}validate158.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate143(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/delivered-learning.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate143.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.scope === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.guidanceId === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "guidanceId"},message:"must have required property '"+"guidanceId"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.memoryId === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "memoryId"},message:"must have required property '"+"memoryId"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.contentDigest === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "contentDigest"},message:"must have required property '"+"contentDigest"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.sourceScope === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "sourceScope"},message:"must have required property '"+"sourceScope"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.position === undefined){const err7 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "position"},message:"must have required property '"+"position"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.text === undefined){const err8 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "text"},message:"must have required property '"+"text"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data.deliveredAt === undefined){const err9 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "deliveredAt"},message:"must have required property '"+"deliveredAt"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(data.digest === undefined){const err10 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}for(const key0 in data){if(!(func1.call(schema53.properties, key0))){const err11 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data.schemaVersion !== undefined){if("replica.delivered-learning/v1" !== data.schemaVersion){const err12 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.delivered-learning/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.id !== undefined){if(!(validate144(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate144.errors : vErrors.concat(validate144.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate146(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate146.errors : vErrors.concat(validate146.errors);errors = vErrors.length;}}if(data.guidanceId !== undefined){if(!(validate144(data.guidanceId, {instancePath:instancePath+"/guidanceId",parentData:data,parentDataProperty:"guidanceId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate144.errors : vErrors.concat(validate144.errors);errors = vErrors.length;}}if(data.memoryId !== undefined){if(!(validate144(data.memoryId, {instancePath:instancePath+"/memoryId",parentData:data,parentDataProperty:"memoryId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate144.errors : vErrors.concat(validate144.errors);errors = vErrors.length;}}if(data.contentDigest !== undefined){if(!(validate153(data.contentDigest, {instancePath:instancePath+"/contentDigest",parentData:data,parentDataProperty:"contentDigest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate153.errors : vErrors.concat(validate153.errors);errors = vErrors.length;}}if(data.sourceScope !== undefined){if(!(validate146(data.sourceScope, {instancePath:instancePath+"/sourceScope",parentData:data,parentDataProperty:"sourceScope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate146.errors : vErrors.concat(validate146.errors);errors = vErrors.length;}}if(data.position !== undefined){if(!(validate156(data.position, {instancePath:instancePath+"/position",parentData:data,parentDataProperty:"position",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate156.errors : vErrors.concat(validate156.errors);errors = vErrors.length;}}if(data.text !== undefined){let data8 = data.text;if(typeof data8 === "string"){if(func2(data8) > 20000){const err13 = {instancePath:instancePath+"/text",schemaPath:"#/properties/text/maxLength",keyword:"maxLength",params:{limit: 20000},message:"must NOT have more than 20000 characters"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}if(func2(data8) < 1){const err14 = {instancePath:instancePath+"/text",schemaPath:"#/properties/text/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/text",schemaPath:"#/properties/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data.deliveredAt !== undefined){if(!(validate158(data.deliveredAt, {instancePath:instancePath+"/deliveredAt",parentData:data,parentDataProperty:"deliveredAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate158.errors : vErrors.concat(validate158.errors);errors = vErrors.length;}}if(data.digest !== undefined){if(!(validate153(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate153.errors : vErrors.concat(validate153.errors);errors = vErrors.length;}}}else {const err16 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}validate143.errors = vErrors;return errors === 0;}validate143.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.episode = validate161;const schema59 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/episode.schema.json","title":"Replica episode v1","description":"The unit of learning evidence: one review thread, chat session, scenario run, or similar. The digest covers the header, every field except digest and timeline, so appending events never changes it. Events carry their own digests. timeline appears only in exports.","type":"object","additionalProperties":false,"required":["schemaVersion","id","scope","source","actors","grants","provenance","startedAt","digest"],"properties":{"schemaVersion":{"const":"replica.episode/v1"},"id":{"$ref":"common.schema.json#/$defs/id"},"scope":{"$ref":"common.schema.json#/$defs/scope"},"source":{"$ref":"common.schema.json#/$defs/source"},"task":{"type":"object","additionalProperties":false,"properties":{"prompt":{"type":"string","minLength":1,"maxLength":10000},"goal":{"type":"string","minLength":1,"maxLength":2000},"role":{"$ref":"common.schema.json#/$defs/slug"},"taskId":{"type":"string","minLength":1,"maxLength":200}}},"actors":{"type":"array","maxItems":500,"items":{"$ref":"common.schema.json#/$defs/actor"}},"versions":{"description":"What produced the experience under review, so outcomes can be tied to versions.","type":"object","additionalProperties":false,"properties":{"model":{"type":"string","minLength":1,"maxLength":200},"harness":{"type":"string","minLength":1,"maxLength":200},"designSystem":{"type":"string","minLength":1,"maxLength":200},"brandPack":{"type":"string","minLength":1,"maxLength":200},"memorySnapshot":{"$ref":"common.schema.json#/$defs/digest"}}},"grants":{"description":"The consent grants this episode was collected under, kept for provenance. Use for a purpose is decided at read time from the grants then active for the episode's scope and source.","type":"array","minItems":1,"maxItems":20,"items":{"$ref":"common.schema.json#/$defs/id"}},"contentTrust":{"type":"object","additionalProperties":false,"required":["untrusted","treatAs"],"properties":{"untrusted":{"type":"boolean"},"treatAs":{"const":"data"},"source":{"$ref":"common.schema.json#/$defs/sourceKind"}}},"provenance":{"$ref":"common.schema.json#/$defs/provenance"},"startedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"endedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"outcome":{"type":"object","additionalProperties":false,"required":["status"],"properties":{"status":{"enum":["success","failure","partial","unknown"]},"summary":{"type":"string","minLength":1,"maxLength":2000}}},"timeline":{"type":"array","maxItems":100000,"items":{"$ref":"event.schema.json"}},"digest":{"$ref":"common.schema.json#/$defs/digest"}}};function validate162(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate162.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate162.errors = vErrors;return errors === 0;}validate162.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate164(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate164.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate164.errors = vErrors;return errors === 0;}validate164.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate169(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate169.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(func1.call(schema32.properties, key0))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.kind !== undefined){if(!(validate80(data.kind, {instancePath:instancePath+"/kind",parentData:data,parentDataProperty:"kind",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate80.errors : vErrors.concat(validate80.errors);errors = vErrors.length;}}if(data.hubOrigin !== undefined){if(!(validate82(data.hubOrigin, {instancePath:instancePath+"/hubOrigin",parentData:data,parentDataProperty:"hubOrigin",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate82.errors : vErrors.concat(validate82.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data2 = data.repository;if(typeof data2 === "string"){if(!pattern10.test(data2)){const err2 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.repositoryId !== undefined){if(!(validate84(data.repositoryId, {instancePath:instancePath+"/repositoryId",parentData:data,parentDataProperty:"repositoryId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate84.errors : vErrors.concat(validate84.errors);errors = vErrors.length;}}if(data.prototypeId !== undefined){if(!(validate84(data.prototypeId, {instancePath:instancePath+"/prototypeId",parentData:data,parentDataProperty:"prototypeId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate84.errors : vErrors.concat(validate84.errors);errors = vErrors.length;}}if(data.prototypeName !== undefined){let data5 = data.prototypeName;if(typeof data5 === "string"){if(func2(data5) > 1024){const err4 = {instancePath:instancePath+"/prototypeName",schemaPath:"#/properties/prototypeName/maxLength",keyword:"maxLength",params:{limit: 1024},message:"must NOT have more than 1024 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data5) < 1){const err5 = {instancePath:instancePath+"/prototypeName",schemaPath:"#/properties/prototypeName/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/prototypeName",schemaPath:"#/properties/prototypeName/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.branch !== undefined){let data6 = data.branch;if(typeof data6 === "string"){if(func2(data6) > 1024){const err7 = {instancePath:instancePath+"/branch",schemaPath:"#/properties/branch/maxLength",keyword:"maxLength",params:{limit: 1024},message:"must NOT have more than 1024 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func2(data6) < 1){const err8 = {instancePath:instancePath+"/branch",schemaPath:"#/properties/branch/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/branch",schemaPath:"#/properties/branch/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.buildNumber !== undefined){if(!(validate85(data.buildNumber, {instancePath:instancePath+"/buildNumber",parentData:data,parentDataProperty:"buildNumber",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}if(data.buildId !== undefined){if(!(validate85(data.buildId, {instancePath:instancePath+"/buildId",parentData:data,parentDataProperty:"buildId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}if(data.commitSha !== undefined){if(!(validate91(data.commitSha, {instancePath:instancePath+"/commitSha",parentData:data,parentDataProperty:"commitSha",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate91.errors : vErrors.concat(validate91.errors);errors = vErrors.length;}}if(data.threadId !== undefined){if(!(validate85(data.threadId, {instancePath:instancePath+"/threadId",parentData:data,parentDataProperty:"threadId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}if(data.commentId !== undefined){if(!(validate85(data.commentId, {instancePath:instancePath+"/commentId",parentData:data,parentDataProperty:"commentId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}if(data.sessionId !== undefined){let data12 = data.sessionId;if(typeof data12 === "string"){if(func2(data12) > 200){const err10 = {instancePath:instancePath+"/sessionId",schemaPath:"#/properties/sessionId/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data12) < 1){const err11 = {instancePath:instancePath+"/sessionId",schemaPath:"#/properties/sessionId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/sessionId",schemaPath:"#/properties/sessionId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}validate169.errors = vErrors;return errors === 0;}validate169.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate180(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate180.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(func2(data) > 128){const err0 = {instancePath,schemaPath:"#/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(func2(data) < 1){const err1 = {instancePath,schemaPath:"#/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(!pattern6.test(data)){const err2 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"},message:"must match pattern \""+"^[a-z0-9]+(?:[._-][a-z0-9]+)*$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}validate180.errors = vErrors;return errors === 0;}validate180.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate182(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate182.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((((key0 === "kind") || (key0 === "id")) || (key0 === "role")) || (key0 === "login")) || (key0 === "model")) || (key0 === "asserted"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((data0 === "human") || (data0 === "agent")) || (data0 === "system")) || (data0 === "service"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema23.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.id !== undefined){let data1 = data.id;if(typeof data1 === "string"){if(func2(data1) > 300){const err4 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 3){const err5 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern5.test(data1)){const err6 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},message:"must match pattern \""+"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.role !== undefined){if(!(validate59(data.role, {instancePath:instancePath+"/role",parentData:data,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.login !== undefined){let data3 = data.login;if(typeof data3 === "string"){if(!pattern7.test(data3)){const err8 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},message:"must match pattern \""+"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"+"\""};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.model !== undefined){let data4 = data.model;if(typeof data4 === "string"){if(func2(data4) > 200){const err10 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data4) < 1){const err11 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.asserted !== undefined){if(typeof data.asserted !== "boolean"){const err13 = {instancePath:instancePath+"/asserted",schemaPath:"#/properties/asserted/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate182.errors = vErrors;return errors === 0;}validate182.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate185(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate185.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate185.errors = vErrors;return errors === 0;}validate185.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate188(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate188.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern14.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9_]{1,63}$"},message:"must match pattern \""+"^[a-z][a-z0-9_]{1,63}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate188.errors = vErrors;return errors === 0;}validate188.evaluated = {"dynamicProps":false,"dynamicItems":false};const schema67 = {"description":"Which code made a record, how, when, for whom, and from which inputs.","type":"object","additionalProperties":false,"required":["producer","method","createdAt","createdBy"],"properties":{"producer":{"$ref":"#/$defs/producer"},"method":{"type":"string","maxLength":128,"pattern":"^[a-z]+:[a-z0-9_.-]+$"},"createdAt":{"$ref":"#/$defs/timestamp"},"createdBy":{"$ref":"#/$defs/actor"},"inputs":{"type":"array","maxItems":1000,"items":{"$ref":"#/$defs/digest"}}}};const schema68 = {"type":"object","additionalProperties":false,"required":["name","version"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"version":{"type":"string","minLength":1,"maxLength":64}}};function validate191(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate191.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.name === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "name"},message:"must have required property '"+"name"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.version === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "version"},message:"must have required property '"+"version"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((key0 === "name") || (key0 === "version"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.name !== undefined){let data0 = data.name;if(typeof data0 === "string"){if(func2(data0) > 200){const err3 = {instancePath:instancePath+"/name",schemaPath:"#/properties/name/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(func2(data0) < 1){const err4 = {instancePath:instancePath+"/name",schemaPath:"#/properties/name/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}else {const err5 = {instancePath:instancePath+"/name",schemaPath:"#/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.version !== undefined){let data1 = data.version;if(typeof data1 === "string"){if(func2(data1) > 64){const err6 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/maxLength",keyword:"maxLength",params:{limit: 64},message:"must NOT have more than 64 characters"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(func2(data1) < 1){const err7 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}else {const err8 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}}else {const err9 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}validate191.errors = vErrors;return errors === 0;}validate191.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate193(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate193.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate193.errors = vErrors;return errors === 0;}validate193.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate196(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate196.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate196.errors = vErrors;return errors === 0;}validate196.evaluated = {"dynamicProps":false,"dynamicItems":false};const pattern48 = new RegExp("^[a-z]+:[a-z0-9_.-]+$", "u");function validate190(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate190.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.producer === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "producer"},message:"must have required property '"+"producer"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.method === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "method"},message:"must have required property '"+"method"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.createdAt === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "createdAt"},message:"must have required property '"+"createdAt"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.createdBy === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "createdBy"},message:"must have required property '"+"createdBy"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data){if(!(((((key0 === "producer") || (key0 === "method")) || (key0 === "createdAt")) || (key0 === "createdBy")) || (key0 === "inputs"))){const err4 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.producer !== undefined){if(!(validate191(data.producer, {instancePath:instancePath+"/producer",parentData:data,parentDataProperty:"producer",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate191.errors : vErrors.concat(validate191.errors);errors = vErrors.length;}}if(data.method !== undefined){let data1 = data.method;if(typeof data1 === "string"){if(func2(data1) > 128){const err5 = {instancePath:instancePath+"/method",schemaPath:"#/properties/method/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern48.test(data1)){const err6 = {instancePath:instancePath+"/method",schemaPath:"#/properties/method/pattern",keyword:"pattern",params:{pattern: "^[a-z]+:[a-z0-9_.-]+$"},message:"must match pattern \""+"^[a-z]+:[a-z0-9_.-]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/method",schemaPath:"#/properties/method/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.createdAt !== undefined){if(!(validate193(data.createdAt, {instancePath:instancePath+"/createdAt",parentData:data,parentDataProperty:"createdAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate193.errors : vErrors.concat(validate193.errors);errors = vErrors.length;}}if(data.createdBy !== undefined){if(!(validate132(data.createdBy, {instancePath:instancePath+"/createdBy",parentData:data,parentDataProperty:"createdBy",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate132.errors : vErrors.concat(validate132.errors);errors = vErrors.length;}}if(data.inputs !== undefined){let data4 = data.inputs;if(Array.isArray(data4)){if(data4.length > 1000){const err8 = {instancePath:instancePath+"/inputs",schemaPath:"#/properties/inputs/maxItems",keyword:"maxItems",params:{limit: 1000},message:"must NOT have more than 1000 items"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}const len0 = data4.length;for(let i0=0; i0 9007199254740991 || isNaN(data)){const err1 = {instancePath,schemaPath:"#/maximum",keyword:"maximum",params:{comparison: "<=", limit: 9007199254740991},message:"must be <= 9007199254740991"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data < 1 || isNaN(data)){const err2 = {instancePath,schemaPath:"#/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}validate204.errors = vErrors;return errors === 0;}validate204.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate207(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate207.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate207.errors = vErrors;return errors === 0;}validate207.evaluated = {"dynamicProps":false,"dynamicItems":false};const schema76 = {"description":"The compact saved target of a root comment: route and accessible element details.","type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"enum":["element","area"]},"route":{"type":"object","additionalProperties":false,"properties":{"pathname":{"type":"string","maxLength":2048},"search":{"type":"string","maxLength":2048},"hash":{"type":"string","maxLength":1024}}},"accessibleName":{"type":"string","maxLength":1000},"tagName":{"type":"string","maxLength":64},"selectedText":{"type":"string","maxLength":2000},"elements":{"type":"array","maxItems":8,"items":{"type":"object","additionalProperties":false,"properties":{"accessibleName":{"type":"string","maxLength":1000},"tagName":{"type":"string","maxLength":64},"role":{"type":"string","maxLength":64},"textExcerpt":{"type":"string","maxLength":500}}}}}};function validate212(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate212.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!((((((key0 === "kind") || (key0 === "route")) || (key0 === "accessibleName")) || (key0 === "tagName")) || (key0 === "selectedText")) || (key0 === "elements"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((data0 === "element") || (data0 === "area"))){const err2 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema76.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.route !== undefined){let data1 = data.route;if(data1 && typeof data1 == "object" && !Array.isArray(data1)){for(const key1 in data1){if(!(((key1 === "pathname") || (key1 === "search")) || (key1 === "hash"))){const err3 = {instancePath:instancePath+"/route",schemaPath:"#/properties/route/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data1.pathname !== undefined){let data2 = data1.pathname;if(typeof data2 === "string"){if(func2(data2) > 2048){const err4 = {instancePath:instancePath+"/route/pathname",schemaPath:"#/properties/route/properties/pathname/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}else {const err5 = {instancePath:instancePath+"/route/pathname",schemaPath:"#/properties/route/properties/pathname/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data1.search !== undefined){let data3 = data1.search;if(typeof data3 === "string"){if(func2(data3) > 2048){const err6 = {instancePath:instancePath+"/route/search",schemaPath:"#/properties/route/properties/search/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/route/search",schemaPath:"#/properties/route/properties/search/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data1.hash !== undefined){let data4 = data1.hash;if(typeof data4 === "string"){if(func2(data4) > 1024){const err8 = {instancePath:instancePath+"/route/hash",schemaPath:"#/properties/route/properties/hash/maxLength",keyword:"maxLength",params:{limit: 1024},message:"must NOT have more than 1024 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/route/hash",schemaPath:"#/properties/route/properties/hash/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}}else {const err10 = {instancePath:instancePath+"/route",schemaPath:"#/properties/route/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.accessibleName !== undefined){let data5 = data.accessibleName;if(typeof data5 === "string"){if(func2(data5) > 1000){const err11 = {instancePath:instancePath+"/accessibleName",schemaPath:"#/properties/accessibleName/maxLength",keyword:"maxLength",params:{limit: 1000},message:"must NOT have more than 1000 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/accessibleName",schemaPath:"#/properties/accessibleName/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.tagName !== undefined){let data6 = data.tagName;if(typeof data6 === "string"){if(func2(data6) > 64){const err13 = {instancePath:instancePath+"/tagName",schemaPath:"#/properties/tagName/maxLength",keyword:"maxLength",params:{limit: 64},message:"must NOT have more than 64 characters"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}else {const err14 = {instancePath:instancePath+"/tagName",schemaPath:"#/properties/tagName/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data.selectedText !== undefined){let data7 = data.selectedText;if(typeof data7 === "string"){if(func2(data7) > 2000){const err15 = {instancePath:instancePath+"/selectedText",schemaPath:"#/properties/selectedText/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}else {const err16 = {instancePath:instancePath+"/selectedText",schemaPath:"#/properties/selectedText/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}if(data.elements !== undefined){let data8 = data.elements;if(Array.isArray(data8)){if(data8.length > 8){const err17 = {instancePath:instancePath+"/elements",schemaPath:"#/properties/elements/maxItems",keyword:"maxItems",params:{limit: 8},message:"must NOT have more than 8 items"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}const len0 = data8.length;for(let i0=0; i0 1000){const err19 = {instancePath:instancePath+"/elements/" + i0+"/accessibleName",schemaPath:"#/properties/elements/items/properties/accessibleName/maxLength",keyword:"maxLength",params:{limit: 1000},message:"must NOT have more than 1000 characters"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}else {const err20 = {instancePath:instancePath+"/elements/" + i0+"/accessibleName",schemaPath:"#/properties/elements/items/properties/accessibleName/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}if(data9.tagName !== undefined){let data11 = data9.tagName;if(typeof data11 === "string"){if(func2(data11) > 64){const err21 = {instancePath:instancePath+"/elements/" + i0+"/tagName",schemaPath:"#/properties/elements/items/properties/tagName/maxLength",keyword:"maxLength",params:{limit: 64},message:"must NOT have more than 64 characters"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}else {const err22 = {instancePath:instancePath+"/elements/" + i0+"/tagName",schemaPath:"#/properties/elements/items/properties/tagName/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}if(data9.role !== undefined){let data12 = data9.role;if(typeof data12 === "string"){if(func2(data12) > 64){const err23 = {instancePath:instancePath+"/elements/" + i0+"/role",schemaPath:"#/properties/elements/items/properties/role/maxLength",keyword:"maxLength",params:{limit: 64},message:"must NOT have more than 64 characters"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}else {const err24 = {instancePath:instancePath+"/elements/" + i0+"/role",schemaPath:"#/properties/elements/items/properties/role/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}if(data9.textExcerpt !== undefined){let data13 = data9.textExcerpt;if(typeof data13 === "string"){if(func2(data13) > 500){const err25 = {instancePath:instancePath+"/elements/" + i0+"/textExcerpt",schemaPath:"#/properties/elements/items/properties/textExcerpt/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}else {const err26 = {instancePath:instancePath+"/elements/" + i0+"/textExcerpt",schemaPath:"#/properties/elements/items/properties/textExcerpt/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}}else {const err27 = {instancePath:instancePath+"/elements/" + i0,schemaPath:"#/properties/elements/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}}else {const err28 = {instancePath:instancePath+"/elements",schemaPath:"#/properties/elements/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}}else {const err29 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}validate212.errors = vErrors;return errors === 0;}validate212.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate203(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate203.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}const _errs2 = errors;let valid1 = true;const _errs3 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.role !== undefined){if("root" !== data.role){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}}var _valid0 = _errs3 === errors;errors = _errs2;if(vErrors !== null){if(_errs2){vErrors.length = _errs2;}else {vErrors = null;}}let ifClause0;if(_valid0){const _errs5 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.buildNumber === undefined){const err1 = {instancePath,schemaPath:"#/allOf/0/then/required",keyword:"required",params:{missingProperty: "buildNumber"},message:"must have required property '"+"buildNumber"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}var _valid0 = _errs5 === errors;valid1 = _valid0;ifClause0 = "then";}else {const _errs6 = errors;const _errs7 = errors;const _errs8 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((data.buildNumber === undefined) && (missing0 = "buildNumber")){const err2 = {};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}var valid3 = _errs8 === errors;if(valid3){const err3 = {instancePath,schemaPath:"#/allOf/0/else/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}else {errors = _errs7;if(vErrors !== null){if(_errs7){vErrors.length = _errs7;}else {vErrors = null;}}}var _valid0 = _errs6 === errors;valid1 = _valid0;ifClause0 = "else";}if(!valid1){const err4 = {instancePath,schemaPath:"#/allOf/0/if",keyword:"if",params:{failingKeyword: ifClause0},message:"must match \""+ifClause0+"\" schema"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}const _errs10 = errors;let valid4 = true;const _errs11 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.deletedAt !== undefined){if(typeof data.deletedAt !== "string"){const err5 = {};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}}var _valid1 = _errs11 === errors;errors = _errs10;if(vErrors !== null){if(_errs10){vErrors.length = _errs10;}else {vErrors = null;}}let ifClause1;if(_valid1){const _errs14 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.body !== undefined){if(data.body !== null){const err6 = {instancePath:instancePath+"/body",schemaPath:"#/allOf/1/then/properties/body/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}var _valid1 = _errs14 === errors;valid4 = _valid1;if(valid4){var props0 = {};props0.body = true;props0.deletedAt = true;}ifClause1 = "then";}else {const _errs17 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.body !== undefined){if(typeof data.body !== "string"){const err7 = {instancePath:instancePath+"/body",schemaPath:"#/allOf/1/else/properties/body/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}var _valid1 = _errs17 === errors;valid4 = _valid1;if(valid4){if(props0 !== true){props0 = props0 || {};props0.body = true;}}ifClause1 = "else";}if(!valid4){const err8 = {instancePath,schemaPath:"#/allOf/1/if",keyword:"if",params:{failingKeyword: ifClause1},message:"must match \""+ifClause1+"\" schema"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(props0 !== true){props0 = props0 || {};props0.role = true;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.source === undefined){const err9 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "source"},message:"must have required property '"+"source"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(data.commentId === undefined){const err10 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "commentId"},message:"must have required property '"+"commentId"+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(data.threadId === undefined){const err11 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "threadId"},message:"must have required property '"+"threadId"+"'"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(data.role === undefined){const err12 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "role"},message:"must have required property '"+"role"+"'"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}if(data.body === undefined){const err13 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "body"},message:"must have required property '"+"body"+"'"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}if(data.createdAt === undefined){const err14 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "createdAt"},message:"must have required property '"+"createdAt"+"'"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}if(data.editedAt === undefined){const err15 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "editedAt"},message:"must have required property '"+"editedAt"+"'"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}if(data.deletedAt === undefined){const err16 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "deletedAt"},message:"must have required property '"+"deletedAt"+"'"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}for(const key0 in data){if(!(func1.call(schema73.properties, key0))){const err17 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}if(data.source !== undefined){if("hub_review_comment" !== data.source){const err18 = {instancePath:instancePath+"/source",schemaPath:"#/properties/source/const",keyword:"const",params:{allowedValue: "hub_review_comment"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data.commentId !== undefined){if(!(validate204(data.commentId, {instancePath:instancePath+"/commentId",parentData:data,parentDataProperty:"commentId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate204.errors : vErrors.concat(validate204.errors);errors = vErrors.length;}}if(data.threadId !== undefined){if(!(validate204(data.threadId, {instancePath:instancePath+"/threadId",parentData:data,parentDataProperty:"threadId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate204.errors : vErrors.concat(validate204.errors);errors = vErrors.length;}}if(data.role !== undefined){let data7 = data.role;if(!((data7 === "root") || (data7 === "reply"))){const err19 = {instancePath:instancePath+"/role",schemaPath:"#/properties/role/enum",keyword:"enum",params:{allowedValues: schema73.properties.role.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}if(data.body !== undefined){let data8 = data.body;const _errs26 = errors;let valid9 = false;const _errs27 = errors;if(typeof data8 === "string"){if(func2(data8) > 10000){const err20 = {instancePath:instancePath+"/body",schemaPath:"#/properties/body/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 10000},message:"must NOT have more than 10000 characters"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}if(func2(data8) < 1){const err21 = {instancePath:instancePath+"/body",schemaPath:"#/properties/body/anyOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}else {const err22 = {instancePath:instancePath+"/body",schemaPath:"#/properties/body/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}var _valid2 = _errs27 === errors;valid9 = valid9 || _valid2;const _errs29 = errors;if(data8 !== null){const err23 = {instancePath:instancePath+"/body",schemaPath:"#/properties/body/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}var _valid2 = _errs29 === errors;valid9 = valid9 || _valid2;if(!valid9){const err24 = {instancePath:instancePath+"/body",schemaPath:"#/properties/body/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}else {errors = _errs26;if(vErrors !== null){if(_errs26){vErrors.length = _errs26;}else {vErrors = null;}}}}if(data.createdAt !== undefined){if(!(validate207(data.createdAt, {instancePath:instancePath+"/createdAt",parentData:data,parentDataProperty:"createdAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate207.errors : vErrors.concat(validate207.errors);errors = vErrors.length;}}if(data.editedAt !== undefined){let data10 = data.editedAt;const _errs33 = errors;let valid10 = false;const _errs34 = errors;if(!(validate207(data10, {instancePath:instancePath+"/editedAt",parentData:data,parentDataProperty:"editedAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate207.errors : vErrors.concat(validate207.errors);errors = vErrors.length;}var _valid3 = _errs34 === errors;valid10 = valid10 || _valid3;const _errs35 = errors;if(data10 !== null){const err25 = {instancePath:instancePath+"/editedAt",schemaPath:"#/properties/editedAt/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}var _valid3 = _errs35 === errors;valid10 = valid10 || _valid3;if(!valid10){const err26 = {instancePath:instancePath+"/editedAt",schemaPath:"#/properties/editedAt/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}else {errors = _errs33;if(vErrors !== null){if(_errs33){vErrors.length = _errs33;}else {vErrors = null;}}}}if(data.deletedAt !== undefined){let data11 = data.deletedAt;const _errs38 = errors;let valid11 = false;const _errs39 = errors;if(!(validate207(data11, {instancePath:instancePath+"/deletedAt",parentData:data,parentDataProperty:"deletedAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate207.errors : vErrors.concat(validate207.errors);errors = vErrors.length;}var _valid4 = _errs39 === errors;valid11 = valid11 || _valid4;const _errs40 = errors;if(data11 !== null){const err27 = {instancePath:instancePath+"/deletedAt",schemaPath:"#/properties/deletedAt/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}var _valid4 = _errs40 === errors;valid11 = valid11 || _valid4;if(!valid11){const err28 = {instancePath:instancePath+"/deletedAt",schemaPath:"#/properties/deletedAt/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}else {errors = _errs38;if(vErrors !== null){if(_errs38){vErrors.length = _errs38;}else {vErrors = null;}}}}if(data.buildNumber !== undefined){if(!(validate204(data.buildNumber, {instancePath:instancePath+"/buildNumber",parentData:data,parentDataProperty:"buildNumber",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate204.errors : vErrors.concat(validate204.errors);errors = vErrors.length;}}if(data.context !== undefined){if(!(validate212(data.context, {instancePath:instancePath+"/context",parentData:data,parentDataProperty:"context",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate212.errors : vErrors.concat(validate212.errors);errors = vErrors.length;}}}else {const err29 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}validate203.errors = vErrors;return errors === 0;}validate203.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema77 = {"description":"A judgment about another event in the same episode: its theme, signal, and whether it is an observed problem.","type":"object","additionalProperties":false,"required":["target","theme","signal","observation","stance"],"properties":{"target":{"$ref":"#/$defs/eventTarget"},"theme":{"type":"object","additionalProperties":false,"required":["key","statement"],"properties":{"key":{"$ref":"common.schema.json#/$defs/slug"},"statement":{"type":"string","minLength":1,"maxLength":1000}}},"signal":{"enum":["visual_quality","accessibility","usability","content","interaction","performance","agreement","replica_workflow","other"]},"observation":{"enum":["observed","preference","question","praise","other"]},"stance":{"enum":["supports","contradicts"]},"proposedKind":{"$ref":"common.schema.json#/$defs/memoryKind"},"trace":{"$ref":"common.schema.json#/$defs/trace"},"note":{"type":"string","minLength":1,"maxLength":1000}}};const schema78 = {"type":"object","additionalProperties":false,"required":["eventId"],"properties":{"eventId":{"$ref":"common.schema.json#/$defs/id"}}};function validate217(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate217.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate217.errors = vErrors;return errors === 0;}validate217.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate216(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate216.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.eventId === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "eventId"},message:"must have required property '"+"eventId"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(key0 === "eventId")){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.eventId !== undefined){if(!(validate217(data.eventId, {instancePath:instancePath+"/eventId",parentData:data,parentDataProperty:"eventId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate217.errors : vErrors.concat(validate217.errors);errors = vErrors.length;}}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate216.errors = vErrors;return errors === 0;}validate216.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate220(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate220.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(func2(data) > 128){const err0 = {instancePath,schemaPath:"#/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(func2(data) < 1){const err1 = {instancePath,schemaPath:"#/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(!pattern6.test(data)){const err2 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"},message:"must match pattern \""+"^[a-z0-9]+(?:[._-][a-z0-9]+)*$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}validate220.errors = vErrors;return errors === 0;}validate220.evaluated = {"dynamicProps":false,"dynamicItems":false};const schema81 = {"enum":["fact","preference","rule","procedure","example","anti_pattern","design_principle"]};function validate222(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate222.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!(((((((data === "fact") || (data === "preference")) || (data === "rule")) || (data === "procedure")) || (data === "example")) || (data === "anti_pattern")) || (data === "design_principle"))){const err0 = {instancePath,schemaPath:"#/enum",keyword:"enum",params:{allowedValues: schema81.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}validate222.errors = vErrors;return errors === 0;}validate222.evaluated = {"dynamicProps":false,"dynamicItems":false};const schema82 = {"description":"The rule, skill, component, context, or token that should have prevented a problem.","type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["rule","skill","component","context","token","other"]},"ref":{"type":"string","minLength":1,"maxLength":500}}};function validate224(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate224.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.ref === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "ref"},message:"must have required property '"+"ref"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((key0 === "kind") || (key0 === "ref"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((((data0 === "rule") || (data0 === "skill")) || (data0 === "component")) || (data0 === "context")) || (data0 === "token")) || (data0 === "other"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema82.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.ref !== undefined){let data1 = data.ref;if(typeof data1 === "string"){if(func2(data1) > 500){const err4 = {instancePath:instancePath+"/ref",schemaPath:"#/properties/ref/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 1){const err5 = {instancePath:instancePath+"/ref",schemaPath:"#/properties/ref/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/ref",schemaPath:"#/properties/ref/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate224.errors = vErrors;return errors === 0;}validate224.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate215(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate215.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.target === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "target"},message:"must have required property '"+"target"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.theme === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "theme"},message:"must have required property '"+"theme"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.signal === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "signal"},message:"must have required property '"+"signal"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.observation === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "observation"},message:"must have required property '"+"observation"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.stance === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "stance"},message:"must have required property '"+"stance"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}for(const key0 in data){if(!((((((((key0 === "target") || (key0 === "theme")) || (key0 === "signal")) || (key0 === "observation")) || (key0 === "stance")) || (key0 === "proposedKind")) || (key0 === "trace")) || (key0 === "note"))){const err5 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.target !== undefined){if(!(validate216(data.target, {instancePath:instancePath+"/target",parentData:data,parentDataProperty:"target",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate216.errors : vErrors.concat(validate216.errors);errors = vErrors.length;}}if(data.theme !== undefined){let data1 = data.theme;if(data1 && typeof data1 == "object" && !Array.isArray(data1)){if(data1.key === undefined){const err6 = {instancePath:instancePath+"/theme",schemaPath:"#/properties/theme/required",keyword:"required",params:{missingProperty: "key"},message:"must have required property '"+"key"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data1.statement === undefined){const err7 = {instancePath:instancePath+"/theme",schemaPath:"#/properties/theme/required",keyword:"required",params:{missingProperty: "statement"},message:"must have required property '"+"statement"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}for(const key1 in data1){if(!((key1 === "key") || (key1 === "statement"))){const err8 = {instancePath:instancePath+"/theme",schemaPath:"#/properties/theme/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data1.key !== undefined){if(!(validate220(data1.key, {instancePath:instancePath+"/theme/key",parentData:data1,parentDataProperty:"key",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate220.errors : vErrors.concat(validate220.errors);errors = vErrors.length;}}if(data1.statement !== undefined){let data3 = data1.statement;if(typeof data3 === "string"){if(func2(data3) > 1000){const err9 = {instancePath:instancePath+"/theme/statement",schemaPath:"#/properties/theme/properties/statement/maxLength",keyword:"maxLength",params:{limit: 1000},message:"must NOT have more than 1000 characters"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(func2(data3) < 1){const err10 = {instancePath:instancePath+"/theme/statement",schemaPath:"#/properties/theme/properties/statement/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}else {const err11 = {instancePath:instancePath+"/theme/statement",schemaPath:"#/properties/theme/properties/statement/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}}else {const err12 = {instancePath:instancePath+"/theme",schemaPath:"#/properties/theme/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.signal !== undefined){let data4 = data.signal;if(!(((((((((data4 === "visual_quality") || (data4 === "accessibility")) || (data4 === "usability")) || (data4 === "content")) || (data4 === "interaction")) || (data4 === "performance")) || (data4 === "agreement")) || (data4 === "replica_workflow")) || (data4 === "other"))){const err13 = {instancePath:instancePath+"/signal",schemaPath:"#/properties/signal/enum",keyword:"enum",params:{allowedValues: schema77.properties.signal.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data.observation !== undefined){let data5 = data.observation;if(!(((((data5 === "observed") || (data5 === "preference")) || (data5 === "question")) || (data5 === "praise")) || (data5 === "other"))){const err14 = {instancePath:instancePath+"/observation",schemaPath:"#/properties/observation/enum",keyword:"enum",params:{allowedValues: schema77.properties.observation.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data.stance !== undefined){let data6 = data.stance;if(!((data6 === "supports") || (data6 === "contradicts"))){const err15 = {instancePath:instancePath+"/stance",schemaPath:"#/properties/stance/enum",keyword:"enum",params:{allowedValues: schema77.properties.stance.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data.proposedKind !== undefined){if(!(validate222(data.proposedKind, {instancePath:instancePath+"/proposedKind",parentData:data,parentDataProperty:"proposedKind",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate222.errors : vErrors.concat(validate222.errors);errors = vErrors.length;}}if(data.trace !== undefined){if(!(validate224(data.trace, {instancePath:instancePath+"/trace",parentData:data,parentDataProperty:"trace",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate224.errors : vErrors.concat(validate224.errors);errors = vErrors.length;}}if(data.note !== undefined){let data9 = data.note;if(typeof data9 === "string"){if(func2(data9) > 1000){const err16 = {instancePath:instancePath+"/note",schemaPath:"#/properties/note/maxLength",keyword:"maxLength",params:{limit: 1000},message:"must NOT have more than 1000 characters"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}if(func2(data9) < 1){const err17 = {instancePath:instancePath+"/note",schemaPath:"#/properties/note/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}else {const err18 = {instancePath:instancePath+"/note",schemaPath:"#/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}}else {const err19 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}validate215.errors = vErrors;return errors === 0;}validate215.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema83 = {"description":"A labeler read another event in the same episode and found nothing to label, so it is not asked about that event again.","type":"object","additionalProperties":false,"required":["target"],"properties":{"target":{"$ref":"#/$defs/eventTarget"}}};function validate227(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate227.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.target === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "target"},message:"must have required property '"+"target"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(key0 === "target")){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.target !== undefined){if(!(validate216(data.target, {instancePath:instancePath+"/target",parentData:data,parentDataProperty:"target",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate216.errors : vErrors.concat(validate216.errors);errors = vErrors.length;}}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate227.errors = vErrors;return errors === 0;}validate227.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema84 = {"type":"object","additionalProperties":false,"required":["subject","status","at"],"properties":{"subject":{"type":"object","additionalProperties":false,"required":["kind","id"],"properties":{"kind":{"const":"thread"},"id":{"$ref":"common.schema.json#/$defs/positiveInteger"}}},"status":{"enum":["resolved","unresolved"]},"at":{"$ref":"common.schema.json#/$defs/timestamp"},"sequence":{"$ref":"common.schema.json#/$defs/positiveInteger"},"by":{"$ref":"common.schema.json#/$defs/actor"}}};function validate234(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate234.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((((key0 === "kind") || (key0 === "id")) || (key0 === "role")) || (key0 === "login")) || (key0 === "model")) || (key0 === "asserted"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((data0 === "human") || (data0 === "agent")) || (data0 === "system")) || (data0 === "service"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema23.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.id !== undefined){let data1 = data.id;if(typeof data1 === "string"){if(func2(data1) > 300){const err4 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 3){const err5 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern5.test(data1)){const err6 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},message:"must match pattern \""+"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.role !== undefined){if(!(validate59(data.role, {instancePath:instancePath+"/role",parentData:data,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.login !== undefined){let data3 = data.login;if(typeof data3 === "string"){if(!pattern7.test(data3)){const err8 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},message:"must match pattern \""+"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"+"\""};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.model !== undefined){let data4 = data.model;if(typeof data4 === "string"){if(func2(data4) > 200){const err10 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data4) < 1){const err11 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.asserted !== undefined){if(typeof data.asserted !== "boolean"){const err13 = {instancePath:instancePath+"/asserted",schemaPath:"#/properties/asserted/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate234.errors = vErrors;return errors === 0;}validate234.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate230(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate230.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.subject === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "subject"},message:"must have required property '"+"subject"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.status === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "status"},message:"must have required property '"+"status"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.at === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "at"},message:"must have required property '"+"at"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}for(const key0 in data){if(!(((((key0 === "subject") || (key0 === "status")) || (key0 === "at")) || (key0 === "sequence")) || (key0 === "by"))){const err3 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.subject !== undefined){let data0 = data.subject;if(data0 && typeof data0 == "object" && !Array.isArray(data0)){if(data0.kind === undefined){const err4 = {instancePath:instancePath+"/subject",schemaPath:"#/properties/subject/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data0.id === undefined){const err5 = {instancePath:instancePath+"/subject",schemaPath:"#/properties/subject/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}for(const key1 in data0){if(!((key1 === "kind") || (key1 === "id"))){const err6 = {instancePath:instancePath+"/subject",schemaPath:"#/properties/subject/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data0.kind !== undefined){if("thread" !== data0.kind){const err7 = {instancePath:instancePath+"/subject/kind",schemaPath:"#/properties/subject/properties/kind/const",keyword:"const",params:{allowedValue: "thread"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data0.id !== undefined){if(!(validate204(data0.id, {instancePath:instancePath+"/subject/id",parentData:data0,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate204.errors : vErrors.concat(validate204.errors);errors = vErrors.length;}}}else {const err8 = {instancePath:instancePath+"/subject",schemaPath:"#/properties/subject/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.status !== undefined){let data3 = data.status;if(!((data3 === "resolved") || (data3 === "unresolved"))){const err9 = {instancePath:instancePath+"/status",schemaPath:"#/properties/status/enum",keyword:"enum",params:{allowedValues: schema84.properties.status.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.at !== undefined){if(!(validate207(data.at, {instancePath:instancePath+"/at",parentData:data,parentDataProperty:"at",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate207.errors : vErrors.concat(validate207.errors);errors = vErrors.length;}}if(data.sequence !== undefined){if(!(validate204(data.sequence, {instancePath:instancePath+"/sequence",parentData:data,parentDataProperty:"sequence",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate204.errors : vErrors.concat(validate204.errors);errors = vErrors.length;}}if(data.by !== undefined){if(!(validate234(data.by, {instancePath:instancePath+"/by",parentData:data,parentDataProperty:"by",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate234.errors : vErrors.concat(validate234.errors);errors = vErrors.length;}}}else {const err10 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}validate230.errors = vErrors;return errors === 0;}validate230.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema86 = {"description":"Withdraws an earlier event from every purpose. The earlier event stays in history for audit.","type":"object","additionalProperties":false,"required":["target","reason","at"],"properties":{"target":{"$ref":"#/$defs/eventTarget"},"reason":{"enum":["deleted_at_source","withdrawn_by_author","identity_corrected","other"]},"at":{"$ref":"common.schema.json#/$defs/timestamp"}}};function validate238(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate238.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.target === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "target"},message:"must have required property '"+"target"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.reason === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "reason"},message:"must have required property '"+"reason"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.at === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "at"},message:"must have required property '"+"at"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}for(const key0 in data){if(!(((key0 === "target") || (key0 === "reason")) || (key0 === "at"))){const err3 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.target !== undefined){if(!(validate216(data.target, {instancePath:instancePath+"/target",parentData:data,parentDataProperty:"target",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate216.errors : vErrors.concat(validate216.errors);errors = vErrors.length;}}if(data.reason !== undefined){let data1 = data.reason;if(!((((data1 === "deleted_at_source") || (data1 === "withdrawn_by_author")) || (data1 === "identity_corrected")) || (data1 === "other"))){const err4 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/enum",keyword:"enum",params:{allowedValues: schema86.properties.reason.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.at !== undefined){if(!(validate207(data.at, {instancePath:instancePath+"/at",parentData:data,parentDataProperty:"at",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate207.errors : vErrors.concat(validate207.errors);errors = vErrors.length;}}}else {const err5 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}validate238.errors = vErrors;return errors === 0;}validate238.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema87 = {"type":"object","additionalProperties":false,"required":["memories"],"properties":{"memories":{"type":"array","maxItems":200,"items":{"type":"object","additionalProperties":false,"required":["id","contentDigest"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"contentDigest":{"$ref":"common.schema.json#/$defs/digest"}}}},"task":{"type":"string","minLength":1,"maxLength":2000}}};function validate244(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate244.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate244.errors = vErrors;return errors === 0;}validate244.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate242(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate242.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.memories === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "memories"},message:"must have required property '"+"memories"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!((key0 === "memories") || (key0 === "task"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.memories !== undefined){let data0 = data.memories;if(Array.isArray(data0)){if(data0.length > 200){const err2 = {instancePath:instancePath+"/memories",schemaPath:"#/properties/memories/maxItems",keyword:"maxItems",params:{limit: 200},message:"must NOT have more than 200 items"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}const len0 = data0.length;for(let i0=0; i0 2000){const err8 = {instancePath:instancePath+"/task",schemaPath:"#/properties/task/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(func2(data4) < 1){const err9 = {instancePath:instancePath+"/task",schemaPath:"#/properties/task/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+"/task",schemaPath:"#/properties/task/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}}else {const err11 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}validate242.errors = vErrors;return errors === 0;}validate242.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema89 = {"description":"How an agent session ended. A later outcome for the same session supersedes the earlier one.","type":"object","additionalProperties":false,"required":["status"],"properties":{"status":{"enum":["success","failure","partial","unknown"]},"summary":{"type":"string","minLength":1,"maxLength":2000}}};function validate247(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate247.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.status === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "status"},message:"must have required property '"+"status"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!((key0 === "status") || (key0 === "summary"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.status !== undefined){let data0 = data.status;if(!((((data0 === "success") || (data0 === "failure")) || (data0 === "partial")) || (data0 === "unknown"))){const err2 = {instancePath:instancePath+"/status",schemaPath:"#/properties/status/enum",keyword:"enum",params:{allowedValues: schema89.properties.status.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.summary !== undefined){let data1 = data.summary;if(typeof data1 === "string"){if(func2(data1) > 2000){const err3 = {instancePath:instancePath+"/summary",schemaPath:"#/properties/summary/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(func2(data1) < 1){const err4 = {instancePath:instancePath+"/summary",schemaPath:"#/properties/summary/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}else {const err5 = {instancePath:instancePath+"/summary",schemaPath:"#/properties/summary/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}}else {const err6 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}validate247.errors = vErrors;return errors === 0;}validate247.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate251(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate251.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate251.errors = vErrors;return errors === 0;}validate251.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema91 = {"type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"$ref":"#/$defs/slug"},"uri":{"type":"string","minLength":1,"maxLength":2048},"digest":{"$ref":"#/$defs/digest"},"mediaType":{"type":"string","minLength":3,"maxLength":128}}};function validate261(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate261.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!((((key0 === "kind") || (key0 === "uri")) || (key0 === "digest")) || (key0 === "mediaType"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.kind !== undefined){if(!(validate59(data.kind, {instancePath:instancePath+"/kind",parentData:data,parentDataProperty:"kind",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.uri !== undefined){let data1 = data.uri;if(typeof data1 === "string"){if(func2(data1) > 2048){const err2 = {instancePath:instancePath+"/uri",schemaPath:"#/properties/uri/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(func2(data1) < 1){const err3 = {instancePath:instancePath+"/uri",schemaPath:"#/properties/uri/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/uri",schemaPath:"#/properties/uri/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.digest !== undefined){if(!(validate196(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate196.errors : vErrors.concat(validate196.errors);errors = vErrors.length;}}if(data.mediaType !== undefined){let data3 = data.mediaType;if(typeof data3 === "string"){if(func2(data3) > 128){const err5 = {instancePath:instancePath+"/mediaType",schemaPath:"#/properties/mediaType/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(func2(data3) < 3){const err6 = {instancePath:instancePath+"/mediaType",schemaPath:"#/properties/mediaType/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/mediaType",schemaPath:"#/properties/mediaType/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}else {const err8 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}validate261.errors = vErrors;return errors === 0;}validate261.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema92 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/evidence-ref.schema.json","title":"Replica evidence reference v1","description":"Points from a learning back to the exact events that support it, and pins them to their source.","type":"object","additionalProperties":false,"required":["episodeId","eventIds"],"properties":{"episodeId":{"$ref":"common.schema.json#/$defs/id"},"eventIds":{"type":"array","minItems":1,"maxItems":100,"items":{"$ref":"common.schema.json#/$defs/id"}},"source":{"$ref":"common.schema.json#/$defs/source"},"observedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"author":{"$ref":"common.schema.json#/$defs/actor"},"artifacts":{"type":"array","maxItems":20,"items":{"$ref":"common.schema.json#/$defs/artifactRef"}}}};function validate266(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate266.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate266.errors = vErrors;return errors === 0;}validate266.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate269(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate269.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(func1.call(schema32.properties, key0))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.kind !== undefined){if(!(validate80(data.kind, {instancePath:instancePath+"/kind",parentData:data,parentDataProperty:"kind",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate80.errors : vErrors.concat(validate80.errors);errors = vErrors.length;}}if(data.hubOrigin !== undefined){if(!(validate82(data.hubOrigin, {instancePath:instancePath+"/hubOrigin",parentData:data,parentDataProperty:"hubOrigin",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate82.errors : vErrors.concat(validate82.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data2 = data.repository;if(typeof data2 === "string"){if(!pattern10.test(data2)){const err2 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.repositoryId !== undefined){if(!(validate84(data.repositoryId, {instancePath:instancePath+"/repositoryId",parentData:data,parentDataProperty:"repositoryId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate84.errors : vErrors.concat(validate84.errors);errors = vErrors.length;}}if(data.prototypeId !== undefined){if(!(validate84(data.prototypeId, {instancePath:instancePath+"/prototypeId",parentData:data,parentDataProperty:"prototypeId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate84.errors : vErrors.concat(validate84.errors);errors = vErrors.length;}}if(data.prototypeName !== undefined){let data5 = data.prototypeName;if(typeof data5 === "string"){if(func2(data5) > 1024){const err4 = {instancePath:instancePath+"/prototypeName",schemaPath:"#/properties/prototypeName/maxLength",keyword:"maxLength",params:{limit: 1024},message:"must NOT have more than 1024 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data5) < 1){const err5 = {instancePath:instancePath+"/prototypeName",schemaPath:"#/properties/prototypeName/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/prototypeName",schemaPath:"#/properties/prototypeName/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.branch !== undefined){let data6 = data.branch;if(typeof data6 === "string"){if(func2(data6) > 1024){const err7 = {instancePath:instancePath+"/branch",schemaPath:"#/properties/branch/maxLength",keyword:"maxLength",params:{limit: 1024},message:"must NOT have more than 1024 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func2(data6) < 1){const err8 = {instancePath:instancePath+"/branch",schemaPath:"#/properties/branch/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/branch",schemaPath:"#/properties/branch/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.buildNumber !== undefined){if(!(validate85(data.buildNumber, {instancePath:instancePath+"/buildNumber",parentData:data,parentDataProperty:"buildNumber",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}if(data.buildId !== undefined){if(!(validate85(data.buildId, {instancePath:instancePath+"/buildId",parentData:data,parentDataProperty:"buildId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}if(data.commitSha !== undefined){if(!(validate91(data.commitSha, {instancePath:instancePath+"/commitSha",parentData:data,parentDataProperty:"commitSha",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate91.errors : vErrors.concat(validate91.errors);errors = vErrors.length;}}if(data.threadId !== undefined){if(!(validate85(data.threadId, {instancePath:instancePath+"/threadId",parentData:data,parentDataProperty:"threadId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}if(data.commentId !== undefined){if(!(validate85(data.commentId, {instancePath:instancePath+"/commentId",parentData:data,parentDataProperty:"commentId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}if(data.sessionId !== undefined){let data12 = data.sessionId;if(typeof data12 === "string"){if(func2(data12) > 200){const err10 = {instancePath:instancePath+"/sessionId",schemaPath:"#/properties/sessionId/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data12) < 1){const err11 = {instancePath:instancePath+"/sessionId",schemaPath:"#/properties/sessionId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/sessionId",schemaPath:"#/properties/sessionId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}validate269.errors = vErrors;return errors === 0;}validate269.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate280(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate280.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate280.errors = vErrors;return errors === 0;}validate280.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate282(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate282.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((((key0 === "kind") || (key0 === "id")) || (key0 === "role")) || (key0 === "login")) || (key0 === "model")) || (key0 === "asserted"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((data0 === "human") || (data0 === "agent")) || (data0 === "system")) || (data0 === "service"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema23.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.id !== undefined){let data1 = data.id;if(typeof data1 === "string"){if(func2(data1) > 300){const err4 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 3){const err5 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern5.test(data1)){const err6 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},message:"must match pattern \""+"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.role !== undefined){if(!(validate59(data.role, {instancePath:instancePath+"/role",parentData:data,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.login !== undefined){let data3 = data.login;if(typeof data3 === "string"){if(!pattern7.test(data3)){const err8 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},message:"must match pattern \""+"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"+"\""};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.model !== undefined){let data4 = data.model;if(typeof data4 === "string"){if(func2(data4) > 200){const err10 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data4) < 1){const err11 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.asserted !== undefined){if(typeof data.asserted !== "boolean"){const err13 = {instancePath:instancePath+"/asserted",schemaPath:"#/properties/asserted/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate282.errors = vErrors;return errors === 0;}validate282.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate285(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate285.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!((((key0 === "kind") || (key0 === "uri")) || (key0 === "digest")) || (key0 === "mediaType"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.kind !== undefined){if(!(validate59(data.kind, {instancePath:instancePath+"/kind",parentData:data,parentDataProperty:"kind",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.uri !== undefined){let data1 = data.uri;if(typeof data1 === "string"){if(func2(data1) > 2048){const err2 = {instancePath:instancePath+"/uri",schemaPath:"#/properties/uri/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(func2(data1) < 1){const err3 = {instancePath:instancePath+"/uri",schemaPath:"#/properties/uri/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/uri",schemaPath:"#/properties/uri/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.digest !== undefined){if(!(validate196(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate196.errors : vErrors.concat(validate196.errors);errors = vErrors.length;}}if(data.mediaType !== undefined){let data3 = data.mediaType;if(typeof data3 === "string"){if(func2(data3) > 128){const err5 = {instancePath:instancePath+"/mediaType",schemaPath:"#/properties/mediaType/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(func2(data3) < 3){const err6 = {instancePath:instancePath+"/mediaType",schemaPath:"#/properties/mediaType/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/mediaType",schemaPath:"#/properties/mediaType/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}else {const err8 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}validate285.errors = vErrors;return errors === 0;}validate285.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate265(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/evidence-ref.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate265.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.episodeId === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "episodeId"},message:"must have required property '"+"episodeId"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.eventIds === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "eventIds"},message:"must have required property '"+"eventIds"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((((key0 === "episodeId") || (key0 === "eventIds")) || (key0 === "source")) || (key0 === "observedAt")) || (key0 === "author")) || (key0 === "artifacts"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.episodeId !== undefined){if(!(validate266(data.episodeId, {instancePath:instancePath+"/episodeId",parentData:data,parentDataProperty:"episodeId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate266.errors : vErrors.concat(validate266.errors);errors = vErrors.length;}}if(data.eventIds !== undefined){let data1 = data.eventIds;if(Array.isArray(data1)){if(data1.length > 100){const err3 = {instancePath:instancePath+"/eventIds",schemaPath:"#/properties/eventIds/maxItems",keyword:"maxItems",params:{limit: 100},message:"must NOT have more than 100 items"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data1.length < 1){const err4 = {instancePath:instancePath+"/eventIds",schemaPath:"#/properties/eventIds/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}const len0 = data1.length;for(let i0=0; i0 20){const err6 = {instancePath:instancePath+"/artifacts",schemaPath:"#/properties/artifacts/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}const len1 = data6.length;for(let i1=0; i1 1000){const err4 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/maxLength",keyword:"maxLength",params:{limit: 1000},message:"must NOT have more than 1000 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data2) < 1){const err5 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.commentId !== undefined){if(!(validate85(data.commentId, {instancePath:instancePath+"/commentId",parentData:data,parentDataProperty:"commentId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate290.errors = vErrors;return errors === 0;}validate290.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const pattern60 = new RegExp("^x-[a-z0-9-]+\\.[a-z0-9_]+$", "u");function validate202(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/event.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate202.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}const _errs2 = errors;let valid1 = true;const _errs3 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((data.redaction === undefined) && (missing0 = "redaction")){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}var _valid0 = _errs3 === errors;errors = _errs2;if(vErrors !== null){if(_errs2){vErrors.length = _errs2;}else {vErrors = null;}}let ifClause0;if(_valid0){const _errs4 = errors;const _errs5 = errors;const _errs6 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing1;if((data.payload === undefined) && (missing1 = "payload")){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}var valid2 = _errs6 === errors;if(valid2){const err2 = {instancePath,schemaPath:"#/allOf/0/then/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}else {errors = _errs5;if(vErrors !== null){if(_errs5){vErrors.length = _errs5;}else {vErrors = null;}}}var _valid0 = _errs4 === errors;valid1 = _valid0;ifClause0 = "then";}else {const _errs7 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.payload === undefined){const err3 = {instancePath,schemaPath:"#/allOf/0/else/required",keyword:"required",params:{missingProperty: "payload"},message:"must have required property '"+"payload"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}var _valid0 = _errs7 === errors;valid1 = _valid0;ifClause0 = "else";}if(!valid1){const err4 = {instancePath,schemaPath:"#/allOf/0/if",keyword:"if",params:{failingKeyword: ifClause0},message:"must match \""+ifClause0+"\" schema"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}const _errs9 = errors;let valid3 = true;const _errs10 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing2;if((data.type === undefined) && (missing2 = "type")){const err5 = {};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}else {if(data.type !== undefined){if("human_comment" !== data.type){const err6 = {};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}}var _valid1 = _errs10 === errors;errors = _errs9;if(vErrors !== null){if(_errs9){vErrors.length = _errs9;}else {vErrors = null;}}if(_valid1){const _errs12 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.payload !== undefined){if(!(validate203(data.payload, {instancePath:instancePath+"/payload",parentData:data,parentDataProperty:"payload",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate203.errors : vErrors.concat(validate203.errors);errors = vErrors.length;}}}var _valid1 = _errs12 === errors;valid3 = _valid1;if(valid3){var props0 = {};props0.payload = true;props0.type = true;}}if(!valid3){const err7 = {instancePath,schemaPath:"#/allOf/1/if",keyword:"if",params:{failingKeyword: "then"},message:"must match \"then\" schema"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}const _errs15 = errors;let valid6 = true;const _errs16 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing3;if((data.type === undefined) && (missing3 = "type")){const err8 = {};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}else {if(data.type !== undefined){if("annotation" !== data.type){const err9 = {};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}}}var _valid2 = _errs16 === errors;errors = _errs15;if(vErrors !== null){if(_errs15){vErrors.length = _errs15;}else {vErrors = null;}}if(_valid2){const _errs18 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.parentEventId === undefined){const err10 = {instancePath,schemaPath:"#/allOf/2/then/required",keyword:"required",params:{missingProperty: "parentEventId"},message:"must have required property '"+"parentEventId"+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(data.payload !== undefined){if(!(validate215(data.payload, {instancePath:instancePath+"/payload",parentData:data,parentDataProperty:"payload",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate215.errors : vErrors.concat(validate215.errors);errors = vErrors.length;}}}var _valid2 = _errs18 === errors;valid6 = _valid2;if(valid6){var props1 = {};props1.payload = true;props1.type = true;}}if(!valid6){const err11 = {instancePath,schemaPath:"#/allOf/2/if",keyword:"if",params:{failingKeyword: "then"},message:"must match \"then\" schema"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(props0 !== true && props1 !== undefined){if(props1 === true){props0 = true;}else {props0 = props0 || {};Object.assign(props0, props1);}}const _errs21 = errors;let valid9 = true;const _errs22 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing4;if((data.type === undefined) && (missing4 = "type")){const err12 = {};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}else {if(data.type !== undefined){if("no_annotation" !== data.type){const err13 = {};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}}var _valid3 = _errs22 === errors;errors = _errs21;if(vErrors !== null){if(_errs21){vErrors.length = _errs21;}else {vErrors = null;}}if(_valid3){const _errs24 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.parentEventId === undefined){const err14 = {instancePath,schemaPath:"#/allOf/3/then/required",keyword:"required",params:{missingProperty: "parentEventId"},message:"must have required property '"+"parentEventId"+"'"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}if(data.payload !== undefined){if(!(validate227(data.payload, {instancePath:instancePath+"/payload",parentData:data,parentDataProperty:"payload",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate227.errors : vErrors.concat(validate227.errors);errors = vErrors.length;}}}var _valid3 = _errs24 === errors;valid9 = _valid3;if(valid9){var props2 = {};props2.payload = true;props2.type = true;}}if(!valid9){const err15 = {instancePath,schemaPath:"#/allOf/3/if",keyword:"if",params:{failingKeyword: "then"},message:"must match \"then\" schema"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}if(props0 !== true && props2 !== undefined){if(props2 === true){props0 = true;}else {props0 = props0 || {};Object.assign(props0, props2);}}const _errs27 = errors;let valid12 = true;const _errs28 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing5;if((data.type === undefined) && (missing5 = "type")){const err16 = {};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}else {if(data.type !== undefined){if("status_change" !== data.type){const err17 = {};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}}}var _valid4 = _errs28 === errors;errors = _errs27;if(vErrors !== null){if(_errs27){vErrors.length = _errs27;}else {vErrors = null;}}if(_valid4){const _errs30 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.payload !== undefined){if(!(validate230(data.payload, {instancePath:instancePath+"/payload",parentData:data,parentDataProperty:"payload",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate230.errors : vErrors.concat(validate230.errors);errors = vErrors.length;}}}var _valid4 = _errs30 === errors;valid12 = _valid4;if(valid12){var props3 = {};props3.payload = true;props3.type = true;}}if(!valid12){const err18 = {instancePath,schemaPath:"#/allOf/4/if",keyword:"if",params:{failingKeyword: "then"},message:"must match \"then\" schema"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}if(props0 !== true && props3 !== undefined){if(props3 === true){props0 = true;}else {props0 = props0 || {};Object.assign(props0, props3);}}const _errs33 = errors;let valid15 = true;const _errs34 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing6;if((data.type === undefined) && (missing6 = "type")){const err19 = {};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}else {if(data.type !== undefined){if("retraction" !== data.type){const err20 = {};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}}}var _valid5 = _errs34 === errors;errors = _errs33;if(vErrors !== null){if(_errs33){vErrors.length = _errs33;}else {vErrors = null;}}if(_valid5){const _errs36 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.parentEventId === undefined){const err21 = {instancePath,schemaPath:"#/allOf/5/then/required",keyword:"required",params:{missingProperty: "parentEventId"},message:"must have required property '"+"parentEventId"+"'"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}if(data.payload !== undefined){if(!(validate238(data.payload, {instancePath:instancePath+"/payload",parentData:data,parentDataProperty:"payload",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate238.errors : vErrors.concat(validate238.errors);errors = vErrors.length;}}}var _valid5 = _errs36 === errors;valid15 = _valid5;if(valid15){var props4 = {};props4.payload = true;props4.type = true;}}if(!valid15){const err22 = {instancePath,schemaPath:"#/allOf/5/if",keyword:"if",params:{failingKeyword: "then"},message:"must match \"then\" schema"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}if(props0 !== true && props4 !== undefined){if(props4 === true){props0 = true;}else {props0 = props0 || {};Object.assign(props0, props4);}}const _errs39 = errors;let valid18 = true;const _errs40 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing7;if((data.type === undefined) && (missing7 = "type")){const err23 = {};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}else {if(data.type !== undefined){if("memory_retrieved" !== data.type){const err24 = {};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}}}var _valid6 = _errs40 === errors;errors = _errs39;if(vErrors !== null){if(_errs39){vErrors.length = _errs39;}else {vErrors = null;}}if(_valid6){const _errs42 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.payload !== undefined){if(!(validate242(data.payload, {instancePath:instancePath+"/payload",parentData:data,parentDataProperty:"payload",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate242.errors : vErrors.concat(validate242.errors);errors = vErrors.length;}}}var _valid6 = _errs42 === errors;valid18 = _valid6;if(valid18){var props5 = {};props5.payload = true;props5.type = true;}}if(!valid18){const err25 = {instancePath,schemaPath:"#/allOf/6/if",keyword:"if",params:{failingKeyword: "then"},message:"must match \"then\" schema"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}if(props0 !== true && props5 !== undefined){if(props5 === true){props0 = true;}else {props0 = props0 || {};Object.assign(props0, props5);}}const _errs45 = errors;let valid21 = true;const _errs46 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing8;if((data.type === undefined) && (missing8 = "type")){const err26 = {};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}else {if(data.type !== undefined){if("session_outcome" !== data.type){const err27 = {};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}}}var _valid7 = _errs46 === errors;errors = _errs45;if(vErrors !== null){if(_errs45){vErrors.length = _errs45;}else {vErrors = null;}}if(_valid7){const _errs48 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.payload !== undefined){if(!(validate247(data.payload, {instancePath:instancePath+"/payload",parentData:data,parentDataProperty:"payload",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate247.errors : vErrors.concat(validate247.errors);errors = vErrors.length;}}}var _valid7 = _errs48 === errors;valid21 = _valid7;if(valid21){var props6 = {};props6.payload = true;props6.type = true;}}if(!valid21){const err28 = {instancePath,schemaPath:"#/allOf/7/if",keyword:"if",params:{failingKeyword: "then"},message:"must match \"then\" schema"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}if(props0 !== true && props6 !== undefined){if(props6 === true){props0 = true;}else {props0 = props0 || {};Object.assign(props0, props6);}}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err29 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}if(data.id === undefined){const err30 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}if(data.episodeId === undefined){const err31 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "episodeId"},message:"must have required property '"+"episodeId"+"'"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}if(data.scope === undefined){const err32 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}if(data.type === undefined){const err33 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}if(data.at === undefined){const err34 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "at"},message:"must have required property '"+"at"+"'"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}if(data.actor === undefined){const err35 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "actor"},message:"must have required property '"+"actor"+"'"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}if(data.payloadDigest === undefined){const err36 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "payloadDigest"},message:"must have required property '"+"payloadDigest"+"'"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}if(data.digest === undefined){const err37 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}for(const key0 in data){if(!(func1.call(schema72.properties, key0))){const err38 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}}if(data.schemaVersion !== undefined){if("replica.event/v1" !== data.schemaVersion){const err39 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.event/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}if(data.id !== undefined){if(!(validate217(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate217.errors : vErrors.concat(validate217.errors);errors = vErrors.length;}}if(data.episodeId !== undefined){if(!(validate217(data.episodeId, {instancePath:instancePath+"/episodeId",parentData:data,parentDataProperty:"episodeId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate217.errors : vErrors.concat(validate217.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate251(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate251.errors : vErrors.concat(validate251.errors);errors = vErrors.length;}}if(data.type !== undefined){let data18 = data.type;const _errs56 = errors;let valid25 = false;const _errs57 = errors;if(!(((((((((((((((((((((((((data18 === "user_message") || (data18 === "agent_message")) || (data18 === "human_comment")) || (data18 === "human_correction")) || (data18 === "human_approval")) || (data18 === "human_rejection")) || (data18 === "tool_call")) || (data18 === "tool_result")) || (data18 === "ui_snapshot")) || (data18 === "ui_interaction")) || (data18 === "build_created")) || (data18 === "audio_segment")) || (data18 === "voice_turn")) || (data18 === "agent_to_agent_message")) || (data18 === "evaluation_result")) || (data18 === "criterion_result")) || (data18 === "memory_retrieved")) || (data18 === "memory_proposed")) || (data18 === "handoff")) || (data18 === "error")) || (data18 === "annotation")) || (data18 === "no_annotation")) || (data18 === "status_change")) || (data18 === "session_outcome")) || (data18 === "retraction"))){const err40 = {instancePath:instancePath+"/type",schemaPath:"#/properties/type/anyOf/0/enum",keyword:"enum",params:{allowedValues: schema72.properties.type.anyOf[0].enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}var _valid8 = _errs57 === errors;valid25 = valid25 || _valid8;const _errs58 = errors;if(typeof data18 === "string"){if(func2(data18) > 128){const err41 = {instancePath:instancePath+"/type",schemaPath:"#/properties/type/anyOf/1/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}if(!pattern60.test(data18)){const err42 = {instancePath:instancePath+"/type",schemaPath:"#/properties/type/anyOf/1/pattern",keyword:"pattern",params:{pattern: "^x-[a-z0-9-]+\\.[a-z0-9_]+$"},message:"must match pattern \""+"^x-[a-z0-9-]+\\.[a-z0-9_]+$"+"\""};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}else {const err43 = {instancePath:instancePath+"/type",schemaPath:"#/properties/type/anyOf/1/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}var _valid8 = _errs58 === errors;valid25 = valid25 || _valid8;if(!valid25){const err44 = {instancePath:instancePath+"/type",schemaPath:"#/properties/type/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}else {errors = _errs56;if(vErrors !== null){if(_errs56){vErrors.length = _errs56;}else {vErrors = null;}}}}if(data.at !== undefined){if(!(validate207(data.at, {instancePath:instancePath+"/at",parentData:data,parentDataProperty:"at",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate207.errors : vErrors.concat(validate207.errors);errors = vErrors.length;}}if(data.actor !== undefined){if(!(validate234(data.actor, {instancePath:instancePath+"/actor",parentData:data,parentDataProperty:"actor",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate234.errors : vErrors.concat(validate234.errors);errors = vErrors.length;}}if(data.payload !== undefined){let data21 = data.payload;if(!(data21 && typeof data21 == "object" && !Array.isArray(data21))){const err45 = {instancePath:instancePath+"/payload",schemaPath:"#/properties/payload/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}}if(data.payloadDigest !== undefined){if(!(validate244(data.payloadDigest, {instancePath:instancePath+"/payloadDigest",parentData:data,parentDataProperty:"payloadDigest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate244.errors : vErrors.concat(validate244.errors);errors = vErrors.length;}}if(data.parentEventId !== undefined){if(!(validate217(data.parentEventId, {instancePath:instancePath+"/parentEventId",parentData:data,parentDataProperty:"parentEventId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate217.errors : vErrors.concat(validate217.errors);errors = vErrors.length;}}if(data.supersedes !== undefined){if(!(validate217(data.supersedes, {instancePath:instancePath+"/supersedes",parentData:data,parentDataProperty:"supersedes",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate217.errors : vErrors.concat(validate217.errors);errors = vErrors.length;}}if(data.artifactRefs !== undefined){let data25 = data.artifactRefs;if(Array.isArray(data25)){if(data25.length > 20){const err46 = {instancePath:instancePath+"/artifactRefs",schemaPath:"#/properties/artifactRefs/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}const len0 = data25.length;for(let i0=0; i0 100){const err48 = {instancePath:instancePath+"/evidenceRefs",schemaPath:"#/properties/evidenceRefs/maxItems",keyword:"maxItems",params:{limit: 100},message:"must NOT have more than 100 items"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}const len1 = data27.length;for(let i1=0; i1 10000){const err12 = {instancePath:instancePath+"/task/prompt",schemaPath:"#/properties/task/properties/prompt/maxLength",keyword:"maxLength",params:{limit: 10000},message:"must NOT have more than 10000 characters"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}if(func2(data5) < 1){const err13 = {instancePath:instancePath+"/task/prompt",schemaPath:"#/properties/task/properties/prompt/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}else {const err14 = {instancePath:instancePath+"/task/prompt",schemaPath:"#/properties/task/properties/prompt/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data4.goal !== undefined){let data6 = data4.goal;if(typeof data6 === "string"){if(func2(data6) > 2000){const err15 = {instancePath:instancePath+"/task/goal",schemaPath:"#/properties/task/properties/goal/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}if(func2(data6) < 1){const err16 = {instancePath:instancePath+"/task/goal",schemaPath:"#/properties/task/properties/goal/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}else {const err17 = {instancePath:instancePath+"/task/goal",schemaPath:"#/properties/task/properties/goal/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}if(data4.role !== undefined){if(!(validate180(data4.role, {instancePath:instancePath+"/task/role",parentData:data4,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate180.errors : vErrors.concat(validate180.errors);errors = vErrors.length;}}if(data4.taskId !== undefined){let data8 = data4.taskId;if(typeof data8 === "string"){if(func2(data8) > 200){const err18 = {instancePath:instancePath+"/task/taskId",schemaPath:"#/properties/task/properties/taskId/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}if(func2(data8) < 1){const err19 = {instancePath:instancePath+"/task/taskId",schemaPath:"#/properties/task/properties/taskId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}else {const err20 = {instancePath:instancePath+"/task/taskId",schemaPath:"#/properties/task/properties/taskId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}}else {const err21 = {instancePath:instancePath+"/task",schemaPath:"#/properties/task/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}if(data.actors !== undefined){let data9 = data.actors;if(Array.isArray(data9)){if(data9.length > 500){const err22 = {instancePath:instancePath+"/actors",schemaPath:"#/properties/actors/maxItems",keyword:"maxItems",params:{limit: 500},message:"must NOT have more than 500 items"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}const len0 = data9.length;for(let i0=0; i0 200){const err25 = {instancePath:instancePath+"/versions/model",schemaPath:"#/properties/versions/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}if(func2(data12) < 1){const err26 = {instancePath:instancePath+"/versions/model",schemaPath:"#/properties/versions/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}else {const err27 = {instancePath:instancePath+"/versions/model",schemaPath:"#/properties/versions/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}if(data11.harness !== undefined){let data13 = data11.harness;if(typeof data13 === "string"){if(func2(data13) > 200){const err28 = {instancePath:instancePath+"/versions/harness",schemaPath:"#/properties/versions/properties/harness/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}if(func2(data13) < 1){const err29 = {instancePath:instancePath+"/versions/harness",schemaPath:"#/properties/versions/properties/harness/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}else {const err30 = {instancePath:instancePath+"/versions/harness",schemaPath:"#/properties/versions/properties/harness/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}if(data11.designSystem !== undefined){let data14 = data11.designSystem;if(typeof data14 === "string"){if(func2(data14) > 200){const err31 = {instancePath:instancePath+"/versions/designSystem",schemaPath:"#/properties/versions/properties/designSystem/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}if(func2(data14) < 1){const err32 = {instancePath:instancePath+"/versions/designSystem",schemaPath:"#/properties/versions/properties/designSystem/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}else {const err33 = {instancePath:instancePath+"/versions/designSystem",schemaPath:"#/properties/versions/properties/designSystem/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data11.brandPack !== undefined){let data15 = data11.brandPack;if(typeof data15 === "string"){if(func2(data15) > 200){const err34 = {instancePath:instancePath+"/versions/brandPack",schemaPath:"#/properties/versions/properties/brandPack/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}if(func2(data15) < 1){const err35 = {instancePath:instancePath+"/versions/brandPack",schemaPath:"#/properties/versions/properties/brandPack/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}else {const err36 = {instancePath:instancePath+"/versions/brandPack",schemaPath:"#/properties/versions/properties/brandPack/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}}if(data11.memorySnapshot !== undefined){if(!(validate185(data11.memorySnapshot, {instancePath:instancePath+"/versions/memorySnapshot",parentData:data11,parentDataProperty:"memorySnapshot",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate185.errors : vErrors.concat(validate185.errors);errors = vErrors.length;}}}else {const err37 = {instancePath:instancePath+"/versions",schemaPath:"#/properties/versions/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}if(data.grants !== undefined){let data17 = data.grants;if(Array.isArray(data17)){if(data17.length > 20){const err38 = {instancePath:instancePath+"/grants",schemaPath:"#/properties/grants/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}if(data17.length < 1){const err39 = {instancePath:instancePath+"/grants",schemaPath:"#/properties/grants/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}const len1 = data17.length;for(let i1=0; i1 2000){const err50 = {instancePath:instancePath+"/outcome/summary",schemaPath:"#/properties/outcome/properties/summary/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}if(func2(data28) < 1){const err51 = {instancePath:instancePath+"/outcome/summary",schemaPath:"#/properties/outcome/properties/summary/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}else {const err52 = {instancePath:instancePath+"/outcome/summary",schemaPath:"#/properties/outcome/properties/summary/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}}}else {const err53 = {instancePath:instancePath+"/outcome",schemaPath:"#/properties/outcome/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}if(data.timeline !== undefined){let data29 = data.timeline;if(Array.isArray(data29)){if(data29.length > 100000){const err54 = {instancePath:instancePath+"/timeline",schemaPath:"#/properties/timeline/maxItems",keyword:"maxItems",params:{limit: 100000},message:"must NOT have more than 100000 items"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}const len2 = data29.length;for(let i2=0; i2 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate303.errors = vErrors;return errors === 0;}validate303.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate308(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate308.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate308.errors = vErrors;return errors === 0;}validate308.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate310(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate310.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!(validate132(data, {instancePath,parentData,parentDataProperty,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate132.errors : vErrors.concat(validate132.errors);errors = vErrors.length;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind !== undefined){if("human" !== data.kind){const err0 = {instancePath:instancePath+"/kind",schemaPath:"#/allOf/1/properties/kind/const",keyword:"const",params:{allowedValue: "human"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}}else {const err1 = {instancePath,schemaPath:"#/allOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate310.errors = vErrors;return errors === 0;}validate310.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate313(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate313.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(func2(data) > 128){const err0 = {instancePath,schemaPath:"#/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(func2(data) < 1){const err1 = {instancePath,schemaPath:"#/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(!pattern6.test(data)){const err2 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"},message:"must match pattern \""+"^[a-z0-9]+(?:[._-][a-z0-9]+)*$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}validate313.errors = vErrors;return errors === 0;}validate313.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate315(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate315.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!(((typeof data == "number") && (!(data % 1) && !isNaN(data))) && (isFinite(data)))){const err0 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if((typeof data == "number") && (isFinite(data))){if(data > 9007199254740991 || isNaN(data)){const err1 = {instancePath,schemaPath:"#/maximum",keyword:"maximum",params:{comparison: "<=", limit: 9007199254740991},message:"must be <= 9007199254740991"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data < 0 || isNaN(data)){const err2 = {instancePath,schemaPath:"#/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}validate315.errors = vErrors;return errors === 0;}validate315.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate325(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate325.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate325.errors = vErrors;return errors === 0;}validate325.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate298(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/export-manifest.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate298.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.purpose === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "purpose"},message:"must have required property '"+"purpose"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.scope === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.createdAt === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "createdAt"},message:"must have required property '"+"createdAt"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.createdBy === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "createdBy"},message:"must have required property '"+"createdBy"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.provider === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "provider"},message:"must have required property '"+"provider"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.destination === undefined){const err7 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "destination"},message:"must have required property '"+"destination"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.counts === undefined){const err8 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "counts"},message:"must have required property '"+"counts"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data.excluded === undefined){const err9 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "excluded"},message:"must have required property '"+"excluded"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(data.records === undefined){const err10 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "records"},message:"must have required property '"+"records"+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(data.digest === undefined){const err11 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}for(const key0 in data){if(!(func1.call(schema99.properties, key0))){const err12 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.schemaVersion !== undefined){if("replica.export/v1" !== data.schemaVersion){const err13 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.export/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data.id !== undefined){if(!(validate299(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate299.errors : vErrors.concat(validate299.errors);errors = vErrors.length;}}if(data.purpose !== undefined){if(!(validate301(data.purpose, {instancePath:instancePath+"/purpose",parentData:data,parentDataProperty:"purpose",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate301.errors : vErrors.concat(validate301.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate303(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate303.errors : vErrors.concat(validate303.errors);errors = vErrors.length;}}if(data.createdAt !== undefined){if(!(validate308(data.createdAt, {instancePath:instancePath+"/createdAt",parentData:data,parentDataProperty:"createdAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate308.errors : vErrors.concat(validate308.errors);errors = vErrors.length;}}if(data.createdBy !== undefined){if(!(validate310(data.createdBy, {instancePath:instancePath+"/createdBy",parentData:data,parentDataProperty:"createdBy",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate310.errors : vErrors.concat(validate310.errors);errors = vErrors.length;}}if(data.provider !== undefined){let data6 = data.provider;if(data6 && typeof data6 == "object" && !Array.isArray(data6)){if(data6.id === undefined){const err14 = {instancePath:instancePath+"/provider",schemaPath:"#/properties/provider/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}if(data6.version === undefined){const err15 = {instancePath:instancePath+"/provider",schemaPath:"#/properties/provider/required",keyword:"required",params:{missingProperty: "version"},message:"must have required property '"+"version"+"'"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}for(const key1 in data6){if(!((key1 === "id") || (key1 === "version"))){const err16 = {instancePath:instancePath+"/provider",schemaPath:"#/properties/provider/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}if(data6.id !== undefined){if(!(validate313(data6.id, {instancePath:instancePath+"/provider/id",parentData:data6,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate313.errors : vErrors.concat(validate313.errors);errors = vErrors.length;}}if(data6.version !== undefined){let data8 = data6.version;if(typeof data8 === "string"){if(func2(data8) > 64){const err17 = {instancePath:instancePath+"/provider/version",schemaPath:"#/properties/provider/properties/version/maxLength",keyword:"maxLength",params:{limit: 64},message:"must NOT have more than 64 characters"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}if(func2(data8) < 1){const err18 = {instancePath:instancePath+"/provider/version",schemaPath:"#/properties/provider/properties/version/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}else {const err19 = {instancePath:instancePath+"/provider/version",schemaPath:"#/properties/provider/properties/version/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}}else {const err20 = {instancePath:instancePath+"/provider",schemaPath:"#/properties/provider/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}if(data.destination !== undefined){let data9 = data.destination;if(typeof data9 === "string"){if(func2(data9) > 2048){const err21 = {instancePath:instancePath+"/destination",schemaPath:"#/properties/destination/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}if(func2(data9) < 1){const err22 = {instancePath:instancePath+"/destination",schemaPath:"#/properties/destination/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}else {const err23 = {instancePath:instancePath+"/destination",schemaPath:"#/properties/destination/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}if(data.contents !== undefined){let data10 = data.contents;if(!((data10 === "all") || (data10 === "learnings"))){const err24 = {instancePath:instancePath+"/contents",schemaPath:"#/properties/contents/enum",keyword:"enum",params:{allowedValues: schema99.properties.contents.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}if(data.counts !== undefined){let data11 = data.counts;if(data11 && typeof data11 == "object" && !Array.isArray(data11)){if(data11.episodes === undefined){const err25 = {instancePath:instancePath+"/counts",schemaPath:"#/properties/counts/required",keyword:"required",params:{missingProperty: "episodes"},message:"must have required property '"+"episodes"+"'"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}if(data11.events === undefined){const err26 = {instancePath:instancePath+"/counts",schemaPath:"#/properties/counts/required",keyword:"required",params:{missingProperty: "events"},message:"must have required property '"+"events"+"'"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}if(data11.memories === undefined){const err27 = {instancePath:instancePath+"/counts",schemaPath:"#/properties/counts/required",keyword:"required",params:{missingProperty: "memories"},message:"must have required property '"+"memories"+"'"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}if(data11.grants === undefined){const err28 = {instancePath:instancePath+"/counts",schemaPath:"#/properties/counts/required",keyword:"required",params:{missingProperty: "grants"},message:"must have required property '"+"grants"+"'"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}for(const key2 in data11){if(!(((((key2 === "collections") || (key2 === "episodes")) || (key2 === "events")) || (key2 === "memories")) || (key2 === "grants"))){const err29 = {instancePath:instancePath+"/counts",schemaPath:"#/properties/counts/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}if(data11.collections !== undefined){if(!(validate315(data11.collections, {instancePath:instancePath+"/counts/collections",parentData:data11,parentDataProperty:"collections",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate315.errors : vErrors.concat(validate315.errors);errors = vErrors.length;}}if(data11.episodes !== undefined){if(!(validate315(data11.episodes, {instancePath:instancePath+"/counts/episodes",parentData:data11,parentDataProperty:"episodes",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate315.errors : vErrors.concat(validate315.errors);errors = vErrors.length;}}if(data11.events !== undefined){if(!(validate315(data11.events, {instancePath:instancePath+"/counts/events",parentData:data11,parentDataProperty:"events",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate315.errors : vErrors.concat(validate315.errors);errors = vErrors.length;}}if(data11.memories !== undefined){if(!(validate315(data11.memories, {instancePath:instancePath+"/counts/memories",parentData:data11,parentDataProperty:"memories",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate315.errors : vErrors.concat(validate315.errors);errors = vErrors.length;}}if(data11.grants !== undefined){if(!(validate315(data11.grants, {instancePath:instancePath+"/counts/grants",parentData:data11,parentDataProperty:"grants",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate315.errors : vErrors.concat(validate315.errors);errors = vErrors.length;}}}else {const err30 = {instancePath:instancePath+"/counts",schemaPath:"#/properties/counts/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}if(data.completeEpisodeIds !== undefined){let data17 = data.completeEpisodeIds;if(Array.isArray(data17)){if(data17.length > 1000000){const err31 = {instancePath:instancePath+"/completeEpisodeIds",schemaPath:"#/properties/completeEpisodeIds/maxItems",keyword:"maxItems",params:{limit: 1000000},message:"must NOT have more than 1000000 items"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}const len0 = data17.length;for(let i0=0; i0 1000000){const err33 = {instancePath:instancePath+"/completeViews",schemaPath:"#/properties/completeViews/maxItems",keyword:"maxItems",params:{limit: 1000000},message:"must NOT have more than 1000000 items"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}const len1 = data19.length;for(let i1=0; i1 4096){const err34 = {instancePath:instancePath+"/completeViews/" + i1,schemaPath:"#/properties/completeViews/items/maxLength",keyword:"maxLength",params:{limit: 4096},message:"must NOT have more than 4096 characters"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}if(func2(data20) < 1){const err35 = {instancePath:instancePath+"/completeViews/" + i1,schemaPath:"#/properties/completeViews/items/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}else {const err36 = {instancePath:instancePath+"/completeViews/" + i1,schemaPath:"#/properties/completeViews/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}}}else {const err37 = {instancePath:instancePath+"/completeViews",schemaPath:"#/properties/completeViews/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}if(data.completePrototypes !== undefined){let data21 = data.completePrototypes;if(Array.isArray(data21)){if(data21.length > 1000000){const err38 = {instancePath:instancePath+"/completePrototypes",schemaPath:"#/properties/completePrototypes/maxItems",keyword:"maxItems",params:{limit: 1000000},message:"must NOT have more than 1000000 items"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}const len2 = data21.length;for(let i2=0; i2 4096){const err39 = {instancePath:instancePath+"/completePrototypes/" + i2,schemaPath:"#/properties/completePrototypes/items/maxLength",keyword:"maxLength",params:{limit: 4096},message:"must NOT have more than 4096 characters"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}if(func2(data22) < 1){const err40 = {instancePath:instancePath+"/completePrototypes/" + i2,schemaPath:"#/properties/completePrototypes/items/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}else {const err41 = {instancePath:instancePath+"/completePrototypes/" + i2,schemaPath:"#/properties/completePrototypes/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}}else {const err42 = {instancePath:instancePath+"/completePrototypes",schemaPath:"#/properties/completePrototypes/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data.excluded !== undefined){let data23 = data.excluded;if(Array.isArray(data23)){if(data23.length > 50){const err43 = {instancePath:instancePath+"/excluded",schemaPath:"#/properties/excluded/maxItems",keyword:"maxItems",params:{limit: 50},message:"must NOT have more than 50 items"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}const len3 = data23.length;for(let i3=0; i3 1000000){const err49 = {instancePath:instancePath+"/records",schemaPath:"#/properties/records/maxItems",keyword:"maxItems",params:{limit: 1000000},message:"must NOT have more than 1000000 items"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}const len4 = data27.length;for(let i4=0; i4 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate332.errors = vErrors;return errors === 0;}validate332.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate337(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate337.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(Array.isArray(data)){if(data.length > 6){const err0 = {instancePath,schemaPath:"#/maxItems",keyword:"maxItems",params:{limit: 6},message:"must NOT have more than 6 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.length < 1){const err1 = {instancePath,schemaPath:"#/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}const len0 = data.length;for(let i0=0; i0 2000){const err10 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data7) < 1){const err11 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.digest !== undefined){if(!(validate345(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate345.errors : vErrors.concat(validate345.errors);errors = vErrors.length;}}}else {const err13 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}validate328.errors = vErrors;return errors === 0;}validate328.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.guidance = validate347;const schema115 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/guidance.schema.json","title":"Replica guidance v1","description":"One time an agent asked for guidance: who asked, from where, and when. The learnings it received are delivered-learning records.","type":"object","additionalProperties":false,"required":["schemaVersion","id","scope","requestedAt","requestedBy","via","digest"],"properties":{"schemaVersion":{"const":"replica.guidance/v1"},"id":{"$ref":"common.schema.json#/$defs/id"},"scope":{"$ref":"common.schema.json#/$defs/scope"},"requestedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"requestedBy":{"$ref":"common.schema.json#/$defs/actor"},"via":{"description":"local: the command or MCP server on this machine. hub: a Hub agent connection.","enum":["local","hub"]},"session":{"description":"The coding agent session, when the agent names it. The label is the agent name and when the session started.","type":"object","additionalProperties":false,"required":["id"],"properties":{"id":{"type":"string","minLength":1,"maxLength":200},"label":{"type":"string","minLength":1,"maxLength":200}}},"digest":{"$ref":"common.schema.json#/$defs/digest"}}};function validate348(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate348.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate348.errors = vErrors;return errors === 0;}validate348.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate350(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate350.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate350.errors = vErrors;return errors === 0;}validate350.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate355(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate355.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate355.errors = vErrors;return errors === 0;}validate355.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate357(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate357.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((((key0 === "kind") || (key0 === "id")) || (key0 === "role")) || (key0 === "login")) || (key0 === "model")) || (key0 === "asserted"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((data0 === "human") || (data0 === "agent")) || (data0 === "system")) || (data0 === "service"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema23.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.id !== undefined){let data1 = data.id;if(typeof data1 === "string"){if(func2(data1) > 300){const err4 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 3){const err5 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern5.test(data1)){const err6 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},message:"must match pattern \""+"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.role !== undefined){if(!(validate59(data.role, {instancePath:instancePath+"/role",parentData:data,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.login !== undefined){let data3 = data.login;if(typeof data3 === "string"){if(!pattern7.test(data3)){const err8 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},message:"must match pattern \""+"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"+"\""};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.model !== undefined){let data4 = data.model;if(typeof data4 === "string"){if(func2(data4) > 200){const err10 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data4) < 1){const err11 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.asserted !== undefined){if(typeof data.asserted !== "boolean"){const err13 = {instancePath:instancePath+"/asserted",schemaPath:"#/properties/asserted/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate357.errors = vErrors;return errors === 0;}validate357.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate360(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate360.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate360.errors = vErrors;return errors === 0;}validate360.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate347(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/guidance.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate347.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.scope === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.requestedAt === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "requestedAt"},message:"must have required property '"+"requestedAt"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.requestedBy === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "requestedBy"},message:"must have required property '"+"requestedBy"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.via === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "via"},message:"must have required property '"+"via"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.digest === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}for(const key0 in data){if(!((((((((key0 === "schemaVersion") || (key0 === "id")) || (key0 === "scope")) || (key0 === "requestedAt")) || (key0 === "requestedBy")) || (key0 === "via")) || (key0 === "session")) || (key0 === "digest"))){const err7 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.schemaVersion !== undefined){if("replica.guidance/v1" !== data.schemaVersion){const err8 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.guidance/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.id !== undefined){if(!(validate348(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate348.errors : vErrors.concat(validate348.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate350(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate350.errors : vErrors.concat(validate350.errors);errors = vErrors.length;}}if(data.requestedAt !== undefined){if(!(validate355(data.requestedAt, {instancePath:instancePath+"/requestedAt",parentData:data,parentDataProperty:"requestedAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate355.errors : vErrors.concat(validate355.errors);errors = vErrors.length;}}if(data.requestedBy !== undefined){if(!(validate357(data.requestedBy, {instancePath:instancePath+"/requestedBy",parentData:data,parentDataProperty:"requestedBy",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate357.errors : vErrors.concat(validate357.errors);errors = vErrors.length;}}if(data.via !== undefined){let data5 = data.via;if(!((data5 === "local") || (data5 === "hub"))){const err9 = {instancePath:instancePath+"/via",schemaPath:"#/properties/via/enum",keyword:"enum",params:{allowedValues: schema115.properties.via.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.session !== undefined){let data6 = data.session;if(data6 && typeof data6 == "object" && !Array.isArray(data6)){if(data6.id === undefined){const err10 = {instancePath:instancePath+"/session",schemaPath:"#/properties/session/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}for(const key1 in data6){if(!((key1 === "id") || (key1 === "label"))){const err11 = {instancePath:instancePath+"/session",schemaPath:"#/properties/session/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data6.id !== undefined){let data7 = data6.id;if(typeof data7 === "string"){if(func2(data7) > 200){const err12 = {instancePath:instancePath+"/session/id",schemaPath:"#/properties/session/properties/id/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}if(func2(data7) < 1){const err13 = {instancePath:instancePath+"/session/id",schemaPath:"#/properties/session/properties/id/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}else {const err14 = {instancePath:instancePath+"/session/id",schemaPath:"#/properties/session/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data6.label !== undefined){let data8 = data6.label;if(typeof data8 === "string"){if(func2(data8) > 200){const err15 = {instancePath:instancePath+"/session/label",schemaPath:"#/properties/session/properties/label/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}if(func2(data8) < 1){const err16 = {instancePath:instancePath+"/session/label",schemaPath:"#/properties/session/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}else {const err17 = {instancePath:instancePath+"/session/label",schemaPath:"#/properties/session/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}}else {const err18 = {instancePath:instancePath+"/session",schemaPath:"#/properties/session/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data.digest !== undefined){if(!(validate360(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate360.errors : vErrors.concat(validate360.errors);errors = vErrors.length;}}}else {const err19 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}validate347.errors = vErrors;return errors === 0;}validate347.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.memoryProposal = validate362;const schema121 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/memory-proposal.schema.json","title":"Replica memory proposal v1","description":"What a consolidator returns. It never sets an ID, a scope, or a state: the host assigns the ID, takes the scope from the caller, and stores every proposal as proposed until a person reviews it.","type":"object","additionalProperties":false,"required":["schemaVersion","kind","content","evidence","rationale","lifecycle","consolidator"],"properties":{"schemaVersion":{"const":"replica.memory-proposal/v1"},"kind":{"$ref":"common.schema.json#/$defs/memoryKind"},"title":{"type":"string","minLength":1,"maxLength":120},"content":{"type":"string","minLength":1,"maxLength":4000},"themeKey":{"$ref":"common.schema.json#/$defs/slug"},"appliesTo":{"type":"array","maxItems":20,"items":{"$ref":"common.schema.json#/$defs/trace"}},"evidence":{"type":"array","minItems":1,"maxItems":500,"items":{"$ref":"evidence-ref.schema.json"}},"contradictions":{"type":"array","maxItems":500,"items":{"$ref":"evidence-ref.schema.json"}},"support":{"$ref":"memory-record.schema.json#/$defs/support"},"confidence":{"type":"number","minimum":0,"maximum":1},"rationale":{"$ref":"#/$defs/rationale"},"lifecycle":{"$ref":"#/$defs/lifecycle"},"consolidator":{"$ref":"#/$defs/consolidator"},"validFrom":{"$ref":"common.schema.json#/$defs/timestamp"},"validUntil":{"$ref":"common.schema.json#/$defs/timestamp"},"expiresAt":{"$ref":"common.schema.json#/$defs/timestamp"}},"$defs":{"consolidator":{"type":"object","additionalProperties":false,"required":["id","version"],"properties":{"id":{"$ref":"common.schema.json#/$defs/slug"},"version":{"type":"string","minLength":1,"maxLength":64}}},"rationale":{"description":"Why the learning recurs, what contradicts it, what it should improve, and how we would know it is wrong.","type":"object","additionalProperties":false,"required":["recurrence","expectedBenefit","falsification"],"properties":{"recurrence":{"type":"string","minLength":1,"maxLength":2000},"contradictions":{"type":"string","minLength":1,"maxLength":2000},"expectedBenefit":{"type":"string","minLength":1,"maxLength":2000},"falsification":{"type":"string","minLength":1,"maxLength":2000}}},"lifecycle":{"type":"object","additionalProperties":false,"required":["action"],"properties":{"action":{"enum":["new","merge","supersede","retire"]},"targets":{"type":"array","minItems":1,"maxItems":50,"items":{"$ref":"common.schema.json#/$defs/id"}}},"allOf":[{"if":{"properties":{"action":{"const":"new"}}},"then":{"not":{"required":["targets"]}},"else":{"required":["targets"]}}]}}};function validate363(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate363.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!(((((((data === "fact") || (data === "preference")) || (data === "rule")) || (data === "procedure")) || (data === "example")) || (data === "anti_pattern")) || (data === "design_principle"))){const err0 = {instancePath,schemaPath:"#/enum",keyword:"enum",params:{allowedValues: schema81.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}validate363.errors = vErrors;return errors === 0;}validate363.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate365(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate365.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(func2(data) > 128){const err0 = {instancePath,schemaPath:"#/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(func2(data) < 1){const err1 = {instancePath,schemaPath:"#/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(!pattern6.test(data)){const err2 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"},message:"must match pattern \""+"^[a-z0-9]+(?:[._-][a-z0-9]+)*$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}validate365.errors = vErrors;return errors === 0;}validate365.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate367(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate367.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.ref === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "ref"},message:"must have required property '"+"ref"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((key0 === "kind") || (key0 === "ref"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((((data0 === "rule") || (data0 === "skill")) || (data0 === "component")) || (data0 === "context")) || (data0 === "token")) || (data0 === "other"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema82.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.ref !== undefined){let data1 = data.ref;if(typeof data1 === "string"){if(func2(data1) > 500){const err4 = {instancePath:instancePath+"/ref",schemaPath:"#/properties/ref/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 1){const err5 = {instancePath:instancePath+"/ref",schemaPath:"#/properties/ref/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/ref",schemaPath:"#/properties/ref/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate367.errors = vErrors;return errors === 0;}validate367.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema132 = {"description":"Distinct sources behind a learning. Count distinct episodes, prototypes, Builds, and reviewers, never raw comments.","type":"object","additionalProperties":false,"required":["distinctEpisodes","distinctPrototypes","distinctReviewers","distinctBuilds"],"properties":{"distinctEpisodes":{"$ref":"common.schema.json#/$defs/count"},"distinctPrototypes":{"$ref":"common.schema.json#/$defs/count"},"distinctReviewers":{"$ref":"common.schema.json#/$defs/count"},"distinctBuilds":{"$ref":"common.schema.json#/$defs/count"}}};function validate390(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate390.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!(((typeof data == "number") && (!(data % 1) && !isNaN(data))) && (isFinite(data)))){const err0 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if((typeof data == "number") && (isFinite(data))){if(data > 9007199254740991 || isNaN(data)){const err1 = {instancePath,schemaPath:"#/maximum",keyword:"maximum",params:{comparison: "<=", limit: 9007199254740991},message:"must be <= 9007199254740991"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data < 0 || isNaN(data)){const err2 = {instancePath,schemaPath:"#/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}validate390.errors = vErrors;return errors === 0;}validate390.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate437(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate437.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.distinctEpisodes === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "distinctEpisodes"},message:"must have required property '"+"distinctEpisodes"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.distinctPrototypes === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "distinctPrototypes"},message:"must have required property '"+"distinctPrototypes"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.distinctReviewers === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "distinctReviewers"},message:"must have required property '"+"distinctReviewers"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.distinctBuilds === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "distinctBuilds"},message:"must have required property '"+"distinctBuilds"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data){if(!((((key0 === "distinctEpisodes") || (key0 === "distinctPrototypes")) || (key0 === "distinctReviewers")) || (key0 === "distinctBuilds"))){const err4 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.distinctEpisodes !== undefined){if(!(validate390(data.distinctEpisodes, {instancePath:instancePath+"/distinctEpisodes",parentData:data,parentDataProperty:"distinctEpisodes",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate390.errors : vErrors.concat(validate390.errors);errors = vErrors.length;}}if(data.distinctPrototypes !== undefined){if(!(validate390(data.distinctPrototypes, {instancePath:instancePath+"/distinctPrototypes",parentData:data,parentDataProperty:"distinctPrototypes",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate390.errors : vErrors.concat(validate390.errors);errors = vErrors.length;}}if(data.distinctReviewers !== undefined){if(!(validate390(data.distinctReviewers, {instancePath:instancePath+"/distinctReviewers",parentData:data,parentDataProperty:"distinctReviewers",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate390.errors : vErrors.concat(validate390.errors);errors = vErrors.length;}}if(data.distinctBuilds !== undefined){if(!(validate390(data.distinctBuilds, {instancePath:instancePath+"/distinctBuilds",parentData:data,parentDataProperty:"distinctBuilds",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate390.errors : vErrors.concat(validate390.errors);errors = vErrors.length;}}}else {const err5 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}validate437.errors = vErrors;return errors === 0;}validate437.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema136 = {"description":"Why the learning recurs, what contradicts it, what it should improve, and how we would know it is wrong.","type":"object","additionalProperties":false,"required":["recurrence","expectedBenefit","falsification"],"properties":{"recurrence":{"type":"string","minLength":1,"maxLength":2000},"contradictions":{"type":"string","minLength":1,"maxLength":2000},"expectedBenefit":{"type":"string","minLength":1,"maxLength":2000},"falsification":{"type":"string","minLength":1,"maxLength":2000}}};function validate443(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate443.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.recurrence === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "recurrence"},message:"must have required property '"+"recurrence"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.expectedBenefit === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "expectedBenefit"},message:"must have required property '"+"expectedBenefit"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.falsification === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "falsification"},message:"must have required property '"+"falsification"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}for(const key0 in data){if(!((((key0 === "recurrence") || (key0 === "contradictions")) || (key0 === "expectedBenefit")) || (key0 === "falsification"))){const err3 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.recurrence !== undefined){let data0 = data.recurrence;if(typeof data0 === "string"){if(func2(data0) > 2000){const err4 = {instancePath:instancePath+"/recurrence",schemaPath:"#/properties/recurrence/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data0) < 1){const err5 = {instancePath:instancePath+"/recurrence",schemaPath:"#/properties/recurrence/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/recurrence",schemaPath:"#/properties/recurrence/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.contradictions !== undefined){let data1 = data.contradictions;if(typeof data1 === "string"){if(func2(data1) > 2000){const err7 = {instancePath:instancePath+"/contradictions",schemaPath:"#/properties/contradictions/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func2(data1) < 1){const err8 = {instancePath:instancePath+"/contradictions",schemaPath:"#/properties/contradictions/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/contradictions",schemaPath:"#/properties/contradictions/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.expectedBenefit !== undefined){let data2 = data.expectedBenefit;if(typeof data2 === "string"){if(func2(data2) > 2000){const err10 = {instancePath:instancePath+"/expectedBenefit",schemaPath:"#/properties/expectedBenefit/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data2) < 1){const err11 = {instancePath:instancePath+"/expectedBenefit",schemaPath:"#/properties/expectedBenefit/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/expectedBenefit",schemaPath:"#/properties/expectedBenefit/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.falsification !== undefined){let data3 = data.falsification;if(typeof data3 === "string"){if(func2(data3) > 2000){const err13 = {instancePath:instancePath+"/falsification",schemaPath:"#/properties/falsification/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}if(func2(data3) < 1){const err14 = {instancePath:instancePath+"/falsification",schemaPath:"#/properties/falsification/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/falsification",schemaPath:"#/properties/falsification/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}validate443.errors = vErrors;return errors === 0;}validate443.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema137 = {"type":"object","additionalProperties":false,"required":["action"],"properties":{"action":{"enum":["new","merge","supersede","retire"]},"targets":{"type":"array","minItems":1,"maxItems":50,"items":{"$ref":"common.schema.json#/$defs/id"}}},"allOf":[{"if":{"properties":{"action":{"const":"new"}}},"then":{"not":{"required":["targets"]}},"else":{"required":["targets"]}}]};function validate409(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate409.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate409.errors = vErrors;return errors === 0;}validate409.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate445(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate445.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}const _errs2 = errors;let valid1 = true;const _errs3 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.action !== undefined){if("new" !== data.action){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}}var _valid0 = _errs3 === errors;errors = _errs2;if(vErrors !== null){if(_errs2){vErrors.length = _errs2;}else {vErrors = null;}}let ifClause0;if(_valid0){const _errs5 = errors;const _errs6 = errors;const _errs7 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((data.targets === undefined) && (missing0 = "targets")){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}var valid3 = _errs7 === errors;if(valid3){const err2 = {instancePath,schemaPath:"#/allOf/0/then/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}else {errors = _errs6;if(vErrors !== null){if(_errs6){vErrors.length = _errs6;}else {vErrors = null;}}}var _valid0 = _errs5 === errors;valid1 = _valid0;ifClause0 = "then";}else {const _errs8 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.targets === undefined){const err3 = {instancePath,schemaPath:"#/allOf/0/else/required",keyword:"required",params:{missingProperty: "targets"},message:"must have required property '"+"targets"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}var _valid0 = _errs8 === errors;valid1 = _valid0;ifClause0 = "else";}if(!valid1){const err4 = {instancePath,schemaPath:"#/allOf/0/if",keyword:"if",params:{failingKeyword: ifClause0},message:"must match \""+ifClause0+"\" schema"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.action === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "action"},message:"must have required property '"+"action"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}for(const key0 in data){if(!((key0 === "action") || (key0 === "targets"))){const err6 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.action !== undefined){let data1 = data.action;if(!((((data1 === "new") || (data1 === "merge")) || (data1 === "supersede")) || (data1 === "retire"))){const err7 = {instancePath:instancePath+"/action",schemaPath:"#/properties/action/enum",keyword:"enum",params:{allowedValues: schema137.properties.action.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.targets !== undefined){let data2 = data.targets;if(Array.isArray(data2)){if(data2.length > 50){const err8 = {instancePath:instancePath+"/targets",schemaPath:"#/properties/targets/maxItems",keyword:"maxItems",params:{limit: 50},message:"must NOT have more than 50 items"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data2.length < 1){const err9 = {instancePath:instancePath+"/targets",schemaPath:"#/properties/targets/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}const len0 = data2.length;for(let i0=0; i0 64){const err3 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/maxLength",keyword:"maxLength",params:{limit: 64},message:"must NOT have more than 64 characters"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(func2(data1) < 1){const err4 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}else {const err5 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}}else {const err6 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}validate448.errors = vErrors;return errors === 0;}validate448.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate451(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate451.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate451.errors = vErrors;return errors === 0;}validate451.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate362(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/memory-proposal.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate362.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.kind === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.content === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "content"},message:"must have required property '"+"content"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.evidence === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "evidence"},message:"must have required property '"+"evidence"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.rationale === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "rationale"},message:"must have required property '"+"rationale"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.lifecycle === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "lifecycle"},message:"must have required property '"+"lifecycle"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.consolidator === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "consolidator"},message:"must have required property '"+"consolidator"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}for(const key0 in data){if(!(func1.call(schema121.properties, key0))){const err7 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.schemaVersion !== undefined){if("replica.memory-proposal/v1" !== data.schemaVersion){const err8 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.memory-proposal/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.kind !== undefined){if(!(validate363(data.kind, {instancePath:instancePath+"/kind",parentData:data,parentDataProperty:"kind",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate363.errors : vErrors.concat(validate363.errors);errors = vErrors.length;}}if(data.title !== undefined){let data2 = data.title;if(typeof data2 === "string"){if(func2(data2) > 120){const err9 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(func2(data2) < 1){const err10 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}else {const err11 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data.content !== undefined){let data3 = data.content;if(typeof data3 === "string"){if(func2(data3) > 4000){const err12 = {instancePath:instancePath+"/content",schemaPath:"#/properties/content/maxLength",keyword:"maxLength",params:{limit: 4000},message:"must NOT have more than 4000 characters"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}if(func2(data3) < 1){const err13 = {instancePath:instancePath+"/content",schemaPath:"#/properties/content/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}else {const err14 = {instancePath:instancePath+"/content",schemaPath:"#/properties/content/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data.themeKey !== undefined){if(!(validate365(data.themeKey, {instancePath:instancePath+"/themeKey",parentData:data,parentDataProperty:"themeKey",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate365.errors : vErrors.concat(validate365.errors);errors = vErrors.length;}}if(data.appliesTo !== undefined){let data5 = data.appliesTo;if(Array.isArray(data5)){if(data5.length > 20){const err15 = {instancePath:instancePath+"/appliesTo",schemaPath:"#/properties/appliesTo/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}const len0 = data5.length;for(let i0=0; i0 500){const err17 = {instancePath:instancePath+"/evidence",schemaPath:"#/properties/evidence/maxItems",keyword:"maxItems",params:{limit: 500},message:"must NOT have more than 500 items"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}if(data7.length < 1){const err18 = {instancePath:instancePath+"/evidence",schemaPath:"#/properties/evidence/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}const len1 = data7.length;for(let i1=0; i1 500){const err20 = {instancePath:instancePath+"/contradictions",schemaPath:"#/properties/contradictions/maxItems",keyword:"maxItems",params:{limit: 500},message:"must NOT have more than 500 items"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}const len2 = data9.length;for(let i2=0; i2 1 || isNaN(data12)){const err22 = {instancePath:instancePath+"/confidence",schemaPath:"#/properties/confidence/maximum",keyword:"maximum",params:{comparison: "<=", limit: 1},message:"must be <= 1"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}if(data12 < 0 || isNaN(data12)){const err23 = {instancePath:instancePath+"/confidence",schemaPath:"#/properties/confidence/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}else {const err24 = {instancePath:instancePath+"/confidence",schemaPath:"#/properties/confidence/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}if(data.rationale !== undefined){if(!(validate443(data.rationale, {instancePath:instancePath+"/rationale",parentData:data,parentDataProperty:"rationale",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate443.errors : vErrors.concat(validate443.errors);errors = vErrors.length;}}if(data.lifecycle !== undefined){if(!(validate445(data.lifecycle, {instancePath:instancePath+"/lifecycle",parentData:data,parentDataProperty:"lifecycle",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate445.errors : vErrors.concat(validate445.errors);errors = vErrors.length;}}if(data.consolidator !== undefined){if(!(validate448(data.consolidator, {instancePath:instancePath+"/consolidator",parentData:data,parentDataProperty:"consolidator",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate448.errors : vErrors.concat(validate448.errors);errors = vErrors.length;}}if(data.validFrom !== undefined){if(!(validate451(data.validFrom, {instancePath:instancePath+"/validFrom",parentData:data,parentDataProperty:"validFrom",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate451.errors : vErrors.concat(validate451.errors);errors = vErrors.length;}}if(data.validUntil !== undefined){if(!(validate451(data.validUntil, {instancePath:instancePath+"/validUntil",parentData:data,parentDataProperty:"validUntil",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate451.errors : vErrors.concat(validate451.errors);errors = vErrors.length;}}if(data.expiresAt !== undefined){if(!(validate451(data.expiresAt, {instancePath:instancePath+"/expiresAt",parentData:data,parentDataProperty:"expiresAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate451.errors : vErrors.concat(validate451.errors);errors = vErrors.length;}}}else {const err25 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}validate362.errors = vErrors;return errors === 0;}validate362.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.memoryRecord = validate371;const schema125 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/memory-record.schema.json","title":"Replica memory record v1","description":"One version of an explicit learning. Every lifecycle change appends a new version with the next version number and previousDigest. contentDigest identifies the learning itself: scope, kind, content, targets, lifecycle, evidence, and validity dates; an approval is valid only while accepted.contentDigest equals it. reviewDigest covers everything a reviewer is shown, adding contradictions, support, confidence, rationale, and the proposer; accepting or rejecting requires the reviewDigest the person reviewed.","type":"object","additionalProperties":false,"required":["schemaVersion","id","version","scope","kind","state","content","evidence","contentDigest","reviewDigest","proposal","provenance","createdAt","updatedAt","digest"],"properties":{"schemaVersion":{"const":"replica.memory/v1"},"id":{"$ref":"common.schema.json#/$defs/id"},"version":{"type":"integer","minimum":1,"maximum":1000000},"previousDigest":{"$ref":"common.schema.json#/$defs/digest"},"scope":{"$ref":"common.schema.json#/$defs/scope"},"kind":{"$ref":"common.schema.json#/$defs/memoryKind"},"state":{"enum":["proposed","accepted","rejected","retired"]},"title":{"type":"string","minLength":1,"maxLength":120},"content":{"type":"string","minLength":1,"maxLength":4000},"themeKey":{"$ref":"common.schema.json#/$defs/slug"},"appliesTo":{"type":"array","maxItems":20,"items":{"$ref":"common.schema.json#/$defs/trace"}},"evidence":{"type":"array","minItems":1,"maxItems":500,"items":{"$ref":"evidence-ref.schema.json"}},"contradictions":{"type":"array","maxItems":500,"items":{"$ref":"evidence-ref.schema.json"}},"support":{"$ref":"#/$defs/support"},"confidence":{"description":"Optional metadata from the proposer. Never a measure of truth.","type":"number","minimum":0,"maximum":1},"validFrom":{"$ref":"common.schema.json#/$defs/timestamp"},"validUntil":{"$ref":"common.schema.json#/$defs/timestamp"},"expiresAt":{"$ref":"common.schema.json#/$defs/timestamp"},"supersedes":{"description":"Learnings this accepted learning replaces. Acceptance sets it from the reviewed lifecycle targets, and a later step may only add to it. No ID repeats. A proposed or rejected learning never carries it. Replaced learnings keep their own state; readers derive which replacement wins.","type":"array","minItems":1,"maxItems":50,"items":{"$ref":"common.schema.json#/$defs/id"}},"contentDigest":{"$ref":"common.schema.json#/$defs/digest"},"reviewDigest":{"$ref":"common.schema.json#/$defs/digest"},"proposal":{"type":"object","additionalProperties":false,"required":["consolidator","rationale","lifecycle","proposedAt","proposedBy","proposalDigest"],"properties":{"consolidator":{"$ref":"memory-proposal.schema.json#/$defs/consolidator"},"rationale":{"$ref":"memory-proposal.schema.json#/$defs/rationale"},"lifecycle":{"$ref":"memory-proposal.schema.json#/$defs/lifecycle"},"proposedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"proposedBy":{"$ref":"common.schema.json#/$defs/actor"},"proposalDigest":{"$ref":"common.schema.json#/$defs/digest"}}},"accepted":{"type":"object","additionalProperties":false,"required":["by","at","contentDigest","reviewedDigest","edited"],"properties":{"by":{"$ref":"common.schema.json#/$defs/humanActor"},"at":{"$ref":"common.schema.json#/$defs/timestamp"},"contentDigest":{"$ref":"common.schema.json#/$defs/digest"},"reviewedDigest":{"$ref":"common.schema.json#/$defs/digest"},"edited":{"type":"boolean"},"decision":{"enum":["edit","reinstate"]},"requestedFields":{"type":"array","items":{"enum":["title","content"]},"minItems":1,"maxItems":2},"operationId":{"type":"string","pattern":"^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$"},"note":{"type":"string","minLength":1,"maxLength":2000}}},"rejected":{"type":"object","additionalProperties":false,"required":["by","at","reviewedDigest","reason"],"properties":{"by":{"$ref":"common.schema.json#/$defs/humanActor"},"at":{"$ref":"common.schema.json#/$defs/timestamp"},"reviewedDigest":{"$ref":"common.schema.json#/$defs/digest"},"reason":{"type":"string","minLength":1,"maxLength":2000},"operationId":{"type":"string","pattern":"^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$"}}},"retired":{"type":"object","additionalProperties":false,"required":["at","reason"],"properties":{"by":{"$ref":"common.schema.json#/$defs/humanActor"},"at":{"$ref":"common.schema.json#/$defs/timestamp"},"reason":{"type":"string","minLength":1,"maxLength":2000},"operationId":{"type":"string","pattern":"^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$"}}},"provenance":{"$ref":"common.schema.json#/$defs/provenance"},"createdAt":{"$ref":"common.schema.json#/$defs/timestamp"},"updatedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"digest":{"$ref":"common.schema.json#/$defs/digest"}},"allOf":[{"if":{"properties":{"version":{"const":1}}},"then":{"not":{"required":["previousDigest"]}},"else":{"required":["previousDigest"]}},{"if":{"properties":{"state":{"const":"proposed"}}},"then":{"not":{"anyOf":[{"required":["accepted"]},{"required":["rejected"]},{"required":["retired"]},{"required":["supersedes"]}]}}},{"if":{"properties":{"state":{"const":"accepted"}}},"then":{"required":["accepted"],"not":{"anyOf":[{"required":["rejected"]},{"required":["retired"]}]}}},{"if":{"properties":{"state":{"const":"rejected"}}},"then":{"required":["rejected"],"not":{"anyOf":[{"required":["accepted"]},{"required":["retired"]},{"required":["supersedes"]}]}}},{"if":{"properties":{"state":{"const":"retired"}}},"then":{"required":["accepted","retired"],"not":{"required":["rejected"]}}}],"$defs":{"support":{"description":"Distinct sources behind a learning. Count distinct episodes, prototypes, Builds, and reviewers, never raw comments.","type":"object","additionalProperties":false,"required":["distinctEpisodes","distinctPrototypes","distinctReviewers","distinctBuilds"],"properties":{"distinctEpisodes":{"$ref":"common.schema.json#/$defs/count"},"distinctPrototypes":{"$ref":"common.schema.json#/$defs/count"},"distinctReviewers":{"$ref":"common.schema.json#/$defs/count"},"distinctBuilds":{"$ref":"common.schema.json#/$defs/count"}}}}};function validate372(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate372.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate372.errors = vErrors;return errors === 0;}validate372.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate374(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate374.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate374.errors = vErrors;return errors === 0;}validate374.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate376(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate376.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate376.errors = vErrors;return errors === 0;}validate376.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate381(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate381.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!(((((((data === "fact") || (data === "preference")) || (data === "rule")) || (data === "procedure")) || (data === "example")) || (data === "anti_pattern")) || (data === "design_principle"))){const err0 = {instancePath,schemaPath:"#/enum",keyword:"enum",params:{allowedValues: schema81.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}validate381.errors = vErrors;return errors === 0;}validate381.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate383(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate383.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(func2(data) > 128){const err0 = {instancePath,schemaPath:"#/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(func2(data) < 1){const err1 = {instancePath,schemaPath:"#/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(!pattern6.test(data)){const err2 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"},message:"must match pattern \""+"^[a-z0-9]+(?:[._-][a-z0-9]+)*$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}validate383.errors = vErrors;return errors === 0;}validate383.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate385(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate385.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.ref === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "ref"},message:"must have required property '"+"ref"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((key0 === "kind") || (key0 === "ref"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((((data0 === "rule") || (data0 === "skill")) || (data0 === "component")) || (data0 === "context")) || (data0 === "token")) || (data0 === "other"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema82.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.ref !== undefined){let data1 = data.ref;if(typeof data1 === "string"){if(func2(data1) > 500){const err4 = {instancePath:instancePath+"/ref",schemaPath:"#/properties/ref/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 1){const err5 = {instancePath:instancePath+"/ref",schemaPath:"#/properties/ref/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/ref",schemaPath:"#/properties/ref/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate385.errors = vErrors;return errors === 0;}validate385.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate389(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate389.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.distinctEpisodes === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "distinctEpisodes"},message:"must have required property '"+"distinctEpisodes"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.distinctPrototypes === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "distinctPrototypes"},message:"must have required property '"+"distinctPrototypes"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.distinctReviewers === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "distinctReviewers"},message:"must have required property '"+"distinctReviewers"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.distinctBuilds === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "distinctBuilds"},message:"must have required property '"+"distinctBuilds"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data){if(!((((key0 === "distinctEpisodes") || (key0 === "distinctPrototypes")) || (key0 === "distinctReviewers")) || (key0 === "distinctBuilds"))){const err4 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.distinctEpisodes !== undefined){if(!(validate390(data.distinctEpisodes, {instancePath:instancePath+"/distinctEpisodes",parentData:data,parentDataProperty:"distinctEpisodes",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate390.errors : vErrors.concat(validate390.errors);errors = vErrors.length;}}if(data.distinctPrototypes !== undefined){if(!(validate390(data.distinctPrototypes, {instancePath:instancePath+"/distinctPrototypes",parentData:data,parentDataProperty:"distinctPrototypes",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate390.errors : vErrors.concat(validate390.errors);errors = vErrors.length;}}if(data.distinctReviewers !== undefined){if(!(validate390(data.distinctReviewers, {instancePath:instancePath+"/distinctReviewers",parentData:data,parentDataProperty:"distinctReviewers",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate390.errors : vErrors.concat(validate390.errors);errors = vErrors.length;}}if(data.distinctBuilds !== undefined){if(!(validate390(data.distinctBuilds, {instancePath:instancePath+"/distinctBuilds",parentData:data,parentDataProperty:"distinctBuilds",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate390.errors : vErrors.concat(validate390.errors);errors = vErrors.length;}}}else {const err5 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}validate389.errors = vErrors;return errors === 0;}validate389.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate396(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate396.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate396.errors = vErrors;return errors === 0;}validate396.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate403(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate403.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.id === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.version === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "version"},message:"must have required property '"+"version"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((key0 === "id") || (key0 === "version"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.id !== undefined){if(!(validate365(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate365.errors : vErrors.concat(validate365.errors);errors = vErrors.length;}}if(data.version !== undefined){let data1 = data.version;if(typeof data1 === "string"){if(func2(data1) > 64){const err3 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/maxLength",keyword:"maxLength",params:{limit: 64},message:"must NOT have more than 64 characters"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(func2(data1) < 1){const err4 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}else {const err5 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}}else {const err6 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}validate403.errors = vErrors;return errors === 0;}validate403.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate406(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate406.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.recurrence === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "recurrence"},message:"must have required property '"+"recurrence"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.expectedBenefit === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "expectedBenefit"},message:"must have required property '"+"expectedBenefit"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.falsification === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "falsification"},message:"must have required property '"+"falsification"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}for(const key0 in data){if(!((((key0 === "recurrence") || (key0 === "contradictions")) || (key0 === "expectedBenefit")) || (key0 === "falsification"))){const err3 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.recurrence !== undefined){let data0 = data.recurrence;if(typeof data0 === "string"){if(func2(data0) > 2000){const err4 = {instancePath:instancePath+"/recurrence",schemaPath:"#/properties/recurrence/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data0) < 1){const err5 = {instancePath:instancePath+"/recurrence",schemaPath:"#/properties/recurrence/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/recurrence",schemaPath:"#/properties/recurrence/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.contradictions !== undefined){let data1 = data.contradictions;if(typeof data1 === "string"){if(func2(data1) > 2000){const err7 = {instancePath:instancePath+"/contradictions",schemaPath:"#/properties/contradictions/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func2(data1) < 1){const err8 = {instancePath:instancePath+"/contradictions",schemaPath:"#/properties/contradictions/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/contradictions",schemaPath:"#/properties/contradictions/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.expectedBenefit !== undefined){let data2 = data.expectedBenefit;if(typeof data2 === "string"){if(func2(data2) > 2000){const err10 = {instancePath:instancePath+"/expectedBenefit",schemaPath:"#/properties/expectedBenefit/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data2) < 1){const err11 = {instancePath:instancePath+"/expectedBenefit",schemaPath:"#/properties/expectedBenefit/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/expectedBenefit",schemaPath:"#/properties/expectedBenefit/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.falsification !== undefined){let data3 = data.falsification;if(typeof data3 === "string"){if(func2(data3) > 2000){const err13 = {instancePath:instancePath+"/falsification",schemaPath:"#/properties/falsification/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}if(func2(data3) < 1){const err14 = {instancePath:instancePath+"/falsification",schemaPath:"#/properties/falsification/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/falsification",schemaPath:"#/properties/falsification/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}validate406.errors = vErrors;return errors === 0;}validate406.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate408(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate408.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}const _errs2 = errors;let valid1 = true;const _errs3 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.action !== undefined){if("new" !== data.action){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}}var _valid0 = _errs3 === errors;errors = _errs2;if(vErrors !== null){if(_errs2){vErrors.length = _errs2;}else {vErrors = null;}}let ifClause0;if(_valid0){const _errs5 = errors;const _errs6 = errors;const _errs7 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((data.targets === undefined) && (missing0 = "targets")){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}var valid3 = _errs7 === errors;if(valid3){const err2 = {instancePath,schemaPath:"#/allOf/0/then/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}else {errors = _errs6;if(vErrors !== null){if(_errs6){vErrors.length = _errs6;}else {vErrors = null;}}}var _valid0 = _errs5 === errors;valid1 = _valid0;ifClause0 = "then";}else {const _errs8 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.targets === undefined){const err3 = {instancePath,schemaPath:"#/allOf/0/else/required",keyword:"required",params:{missingProperty: "targets"},message:"must have required property '"+"targets"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}var _valid0 = _errs8 === errors;valid1 = _valid0;ifClause0 = "else";}if(!valid1){const err4 = {instancePath,schemaPath:"#/allOf/0/if",keyword:"if",params:{failingKeyword: ifClause0},message:"must match \""+ifClause0+"\" schema"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.action === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "action"},message:"must have required property '"+"action"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}for(const key0 in data){if(!((key0 === "action") || (key0 === "targets"))){const err6 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.action !== undefined){let data1 = data.action;if(!((((data1 === "new") || (data1 === "merge")) || (data1 === "supersede")) || (data1 === "retire"))){const err7 = {instancePath:instancePath+"/action",schemaPath:"#/properties/action/enum",keyword:"enum",params:{allowedValues: schema137.properties.action.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.targets !== undefined){let data2 = data.targets;if(Array.isArray(data2)){if(data2.length > 50){const err8 = {instancePath:instancePath+"/targets",schemaPath:"#/properties/targets/maxItems",keyword:"maxItems",params:{limit: 50},message:"must NOT have more than 50 items"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data2.length < 1){const err9 = {instancePath:instancePath+"/targets",schemaPath:"#/properties/targets/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}const len0 = data2.length;for(let i0=0; i0 300){const err4 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 3){const err5 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern5.test(data1)){const err6 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},message:"must match pattern \""+"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.role !== undefined){if(!(validate59(data.role, {instancePath:instancePath+"/role",parentData:data,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.login !== undefined){let data3 = data.login;if(typeof data3 === "string"){if(!pattern7.test(data3)){const err8 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},message:"must match pattern \""+"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"+"\""};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.model !== undefined){let data4 = data.model;if(typeof data4 === "string"){if(func2(data4) > 200){const err10 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data4) < 1){const err11 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.asserted !== undefined){if(typeof data.asserted !== "boolean"){const err13 = {instancePath:instancePath+"/asserted",schemaPath:"#/properties/asserted/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate413.errors = vErrors;return errors === 0;}validate413.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate417(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate417.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!(validate132(data, {instancePath,parentData,parentDataProperty,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate132.errors : vErrors.concat(validate132.errors);errors = vErrors.length;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind !== undefined){if("human" !== data.kind){const err0 = {instancePath:instancePath+"/kind",schemaPath:"#/allOf/1/properties/kind/const",keyword:"const",params:{allowedValue: "human"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}}else {const err1 = {instancePath,schemaPath:"#/allOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate417.errors = vErrors;return errors === 0;}validate417.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate428(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate428.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.producer === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "producer"},message:"must have required property '"+"producer"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.method === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "method"},message:"must have required property '"+"method"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.createdAt === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "createdAt"},message:"must have required property '"+"createdAt"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.createdBy === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "createdBy"},message:"must have required property '"+"createdBy"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data){if(!(((((key0 === "producer") || (key0 === "method")) || (key0 === "createdAt")) || (key0 === "createdBy")) || (key0 === "inputs"))){const err4 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.producer !== undefined){if(!(validate191(data.producer, {instancePath:instancePath+"/producer",parentData:data,parentDataProperty:"producer",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate191.errors : vErrors.concat(validate191.errors);errors = vErrors.length;}}if(data.method !== undefined){let data1 = data.method;if(typeof data1 === "string"){if(func2(data1) > 128){const err5 = {instancePath:instancePath+"/method",schemaPath:"#/properties/method/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern48.test(data1)){const err6 = {instancePath:instancePath+"/method",schemaPath:"#/properties/method/pattern",keyword:"pattern",params:{pattern: "^[a-z]+:[a-z0-9_.-]+$"},message:"must match pattern \""+"^[a-z]+:[a-z0-9_.-]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/method",schemaPath:"#/properties/method/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.createdAt !== undefined){if(!(validate193(data.createdAt, {instancePath:instancePath+"/createdAt",parentData:data,parentDataProperty:"createdAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate193.errors : vErrors.concat(validate193.errors);errors = vErrors.length;}}if(data.createdBy !== undefined){if(!(validate132(data.createdBy, {instancePath:instancePath+"/createdBy",parentData:data,parentDataProperty:"createdBy",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate132.errors : vErrors.concat(validate132.errors);errors = vErrors.length;}}if(data.inputs !== undefined){let data4 = data.inputs;if(Array.isArray(data4)){if(data4.length > 1000){const err8 = {instancePath:instancePath+"/inputs",schemaPath:"#/properties/inputs/maxItems",keyword:"maxItems",params:{limit: 1000},message:"must NOT have more than 1000 items"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}const len0 = data4.length;for(let i0=0; i0 1000000 || isNaN(data7)){const err52 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/maximum",keyword:"maximum",params:{comparison: "<=", limit: 1000000},message:"must be <= 1000000"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}if(data7 < 1 || isNaN(data7)){const err53 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}}if(data.previousDigest !== undefined){if(!(validate374(data.previousDigest, {instancePath:instancePath+"/previousDigest",parentData:data,parentDataProperty:"previousDigest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate374.errors : vErrors.concat(validate374.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate376(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate376.errors : vErrors.concat(validate376.errors);errors = vErrors.length;}}if(data.kind !== undefined){if(!(validate381(data.kind, {instancePath:instancePath+"/kind",parentData:data,parentDataProperty:"kind",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate381.errors : vErrors.concat(validate381.errors);errors = vErrors.length;}}if(data.state !== undefined){let data11 = data.state;if(!((((data11 === "proposed") || (data11 === "accepted")) || (data11 === "rejected")) || (data11 === "retired"))){const err54 = {instancePath:instancePath+"/state",schemaPath:"#/properties/state/enum",keyword:"enum",params:{allowedValues: schema125.properties.state.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}if(data.title !== undefined){let data12 = data.title;if(typeof data12 === "string"){if(func2(data12) > 120){const err55 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}if(func2(data12) < 1){const err56 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}}else {const err57 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}}if(data.content !== undefined){let data13 = data.content;if(typeof data13 === "string"){if(func2(data13) > 4000){const err58 = {instancePath:instancePath+"/content",schemaPath:"#/properties/content/maxLength",keyword:"maxLength",params:{limit: 4000},message:"must NOT have more than 4000 characters"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}if(func2(data13) < 1){const err59 = {instancePath:instancePath+"/content",schemaPath:"#/properties/content/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}}else {const err60 = {instancePath:instancePath+"/content",schemaPath:"#/properties/content/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}}if(data.themeKey !== undefined){if(!(validate383(data.themeKey, {instancePath:instancePath+"/themeKey",parentData:data,parentDataProperty:"themeKey",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate383.errors : vErrors.concat(validate383.errors);errors = vErrors.length;}}if(data.appliesTo !== undefined){let data15 = data.appliesTo;if(Array.isArray(data15)){if(data15.length > 20){const err61 = {instancePath:instancePath+"/appliesTo",schemaPath:"#/properties/appliesTo/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}const len0 = data15.length;for(let i0=0; i0 500){const err63 = {instancePath:instancePath+"/evidence",schemaPath:"#/properties/evidence/maxItems",keyword:"maxItems",params:{limit: 500},message:"must NOT have more than 500 items"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}if(data17.length < 1){const err64 = {instancePath:instancePath+"/evidence",schemaPath:"#/properties/evidence/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}const len1 = data17.length;for(let i1=0; i1 500){const err66 = {instancePath:instancePath+"/contradictions",schemaPath:"#/properties/contradictions/maxItems",keyword:"maxItems",params:{limit: 500},message:"must NOT have more than 500 items"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}const len2 = data19.length;for(let i2=0; i2 1 || isNaN(data22)){const err68 = {instancePath:instancePath+"/confidence",schemaPath:"#/properties/confidence/maximum",keyword:"maximum",params:{comparison: "<=", limit: 1},message:"must be <= 1"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}if(data22 < 0 || isNaN(data22)){const err69 = {instancePath:instancePath+"/confidence",schemaPath:"#/properties/confidence/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}}else {const err70 = {instancePath:instancePath+"/confidence",schemaPath:"#/properties/confidence/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}}if(data.validFrom !== undefined){if(!(validate396(data.validFrom, {instancePath:instancePath+"/validFrom",parentData:data,parentDataProperty:"validFrom",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate396.errors : vErrors.concat(validate396.errors);errors = vErrors.length;}}if(data.validUntil !== undefined){if(!(validate396(data.validUntil, {instancePath:instancePath+"/validUntil",parentData:data,parentDataProperty:"validUntil",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate396.errors : vErrors.concat(validate396.errors);errors = vErrors.length;}}if(data.expiresAt !== undefined){if(!(validate396(data.expiresAt, {instancePath:instancePath+"/expiresAt",parentData:data,parentDataProperty:"expiresAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate396.errors : vErrors.concat(validate396.errors);errors = vErrors.length;}}if(data.supersedes !== undefined){let data26 = data.supersedes;if(Array.isArray(data26)){if(data26.length > 50){const err71 = {instancePath:instancePath+"/supersedes",schemaPath:"#/properties/supersedes/maxItems",keyword:"maxItems",params:{limit: 50},message:"must NOT have more than 50 items"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}if(data26.length < 1){const err72 = {instancePath:instancePath+"/supersedes",schemaPath:"#/properties/supersedes/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}const len3 = data26.length;for(let i3=0; i3 2){const err90 = {instancePath:instancePath+"/accepted/requestedFields",schemaPath:"#/properties/accepted/properties/requestedFields/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}if(data44.length < 1){const err91 = {instancePath:instancePath+"/accepted/requestedFields",schemaPath:"#/properties/accepted/properties/requestedFields/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}const len4 = data44.length;for(let i4=0; i4 2000){const err96 = {instancePath:instancePath+"/accepted/note",schemaPath:"#/properties/accepted/properties/note/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}if(func2(data47) < 1){const err97 = {instancePath:instancePath+"/accepted/note",schemaPath:"#/properties/accepted/properties/note/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}}else {const err98 = {instancePath:instancePath+"/accepted/note",schemaPath:"#/properties/accepted/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}}}else {const err99 = {instancePath:instancePath+"/accepted",schemaPath:"#/properties/accepted/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}}if(data.rejected !== undefined){let data48 = data.rejected;if(data48 && typeof data48 == "object" && !Array.isArray(data48)){if(data48.by === undefined){const err100 = {instancePath:instancePath+"/rejected",schemaPath:"#/properties/rejected/required",keyword:"required",params:{missingProperty: "by"},message:"must have required property '"+"by"+"'"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}if(data48.at === undefined){const err101 = {instancePath:instancePath+"/rejected",schemaPath:"#/properties/rejected/required",keyword:"required",params:{missingProperty: "at"},message:"must have required property '"+"at"+"'"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}if(data48.reviewedDigest === undefined){const err102 = {instancePath:instancePath+"/rejected",schemaPath:"#/properties/rejected/required",keyword:"required",params:{missingProperty: "reviewedDigest"},message:"must have required property '"+"reviewedDigest"+"'"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}if(data48.reason === undefined){const err103 = {instancePath:instancePath+"/rejected",schemaPath:"#/properties/rejected/required",keyword:"required",params:{missingProperty: "reason"},message:"must have required property '"+"reason"+"'"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}for(const key3 in data48){if(!(((((key3 === "by") || (key3 === "at")) || (key3 === "reviewedDigest")) || (key3 === "reason")) || (key3 === "operationId"))){const err104 = {instancePath:instancePath+"/rejected",schemaPath:"#/properties/rejected/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}}if(data48.by !== undefined){if(!(validate417(data48.by, {instancePath:instancePath+"/rejected/by",parentData:data48,parentDataProperty:"by",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate417.errors : vErrors.concat(validate417.errors);errors = vErrors.length;}}if(data48.at !== undefined){if(!(validate396(data48.at, {instancePath:instancePath+"/rejected/at",parentData:data48,parentDataProperty:"at",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate396.errors : vErrors.concat(validate396.errors);errors = vErrors.length;}}if(data48.reviewedDigest !== undefined){if(!(validate374(data48.reviewedDigest, {instancePath:instancePath+"/rejected/reviewedDigest",parentData:data48,parentDataProperty:"reviewedDigest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate374.errors : vErrors.concat(validate374.errors);errors = vErrors.length;}}if(data48.reason !== undefined){let data52 = data48.reason;if(typeof data52 === "string"){if(func2(data52) > 2000){const err105 = {instancePath:instancePath+"/rejected/reason",schemaPath:"#/properties/rejected/properties/reason/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}if(func2(data52) < 1){const err106 = {instancePath:instancePath+"/rejected/reason",schemaPath:"#/properties/rejected/properties/reason/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}}else {const err107 = {instancePath:instancePath+"/rejected/reason",schemaPath:"#/properties/rejected/properties/reason/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}}if(data48.operationId !== undefined){let data53 = data48.operationId;if(typeof data53 === "string"){if(!pattern17.test(data53)){const err108 = {instancePath:instancePath+"/rejected/operationId",schemaPath:"#/properties/rejected/properties/operationId/pattern",keyword:"pattern",params:{pattern: "^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$"},message:"must match pattern \""+"^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$"+"\""};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}}else {const err109 = {instancePath:instancePath+"/rejected/operationId",schemaPath:"#/properties/rejected/properties/operationId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}}}else {const err110 = {instancePath:instancePath+"/rejected",schemaPath:"#/properties/rejected/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}}if(data.retired !== undefined){let data54 = data.retired;if(data54 && typeof data54 == "object" && !Array.isArray(data54)){if(data54.at === undefined){const err111 = {instancePath:instancePath+"/retired",schemaPath:"#/properties/retired/required",keyword:"required",params:{missingProperty: "at"},message:"must have required property '"+"at"+"'"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}if(data54.reason === undefined){const err112 = {instancePath:instancePath+"/retired",schemaPath:"#/properties/retired/required",keyword:"required",params:{missingProperty: "reason"},message:"must have required property '"+"reason"+"'"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}for(const key4 in data54){if(!((((key4 === "by") || (key4 === "at")) || (key4 === "reason")) || (key4 === "operationId"))){const err113 = {instancePath:instancePath+"/retired",schemaPath:"#/properties/retired/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}}if(data54.by !== undefined){if(!(validate417(data54.by, {instancePath:instancePath+"/retired/by",parentData:data54,parentDataProperty:"by",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate417.errors : vErrors.concat(validate417.errors);errors = vErrors.length;}}if(data54.at !== undefined){if(!(validate396(data54.at, {instancePath:instancePath+"/retired/at",parentData:data54,parentDataProperty:"at",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate396.errors : vErrors.concat(validate396.errors);errors = vErrors.length;}}if(data54.reason !== undefined){let data57 = data54.reason;if(typeof data57 === "string"){if(func2(data57) > 2000){const err114 = {instancePath:instancePath+"/retired/reason",schemaPath:"#/properties/retired/properties/reason/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}if(func2(data57) < 1){const err115 = {instancePath:instancePath+"/retired/reason",schemaPath:"#/properties/retired/properties/reason/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}}else {const err116 = {instancePath:instancePath+"/retired/reason",schemaPath:"#/properties/retired/properties/reason/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}}if(data54.operationId !== undefined){let data58 = data54.operationId;if(typeof data58 === "string"){if(!pattern17.test(data58)){const err117 = {instancePath:instancePath+"/retired/operationId",schemaPath:"#/properties/retired/properties/operationId/pattern",keyword:"pattern",params:{pattern: "^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$"},message:"must match pattern \""+"^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$"+"\""};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}}else {const err118 = {instancePath:instancePath+"/retired/operationId",schemaPath:"#/properties/retired/properties/operationId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}}}else {const err119 = {instancePath:instancePath+"/retired",schemaPath:"#/properties/retired/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}}if(data.provenance !== undefined){if(!(validate428(data.provenance, {instancePath:instancePath+"/provenance",parentData:data,parentDataProperty:"provenance",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate428.errors : vErrors.concat(validate428.errors);errors = vErrors.length;}}if(data.createdAt !== undefined){if(!(validate396(data.createdAt, {instancePath:instancePath+"/createdAt",parentData:data,parentDataProperty:"createdAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate396.errors : vErrors.concat(validate396.errors);errors = vErrors.length;}}if(data.updatedAt !== undefined){if(!(validate396(data.updatedAt, {instancePath:instancePath+"/updatedAt",parentData:data,parentDataProperty:"updatedAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate396.errors : vErrors.concat(validate396.errors);errors = vErrors.length;}}if(data.digest !== undefined){if(!(validate374(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate374.errors : vErrors.concat(validate374.errors);errors = vErrors.length;}}}else {const err120 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}validate371.errors = vErrors;return errors === 0;}validate371.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.providerManifest = validate455;const schema147 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/provider-manifest.schema.json","title":"Replica memory provider manifest v1","description":"What a memory provider is, which contract versions it supports, which capabilities it offers, and where its data goes. A host checks this before use and refuses a provider that lacks a required capability.","type":"object","additionalProperties":false,"required":["schemaVersion","id","name","version","contract","capabilities","storage","externalCalls"],"properties":{"schemaVersion":{"const":"replica.provider/v1"},"id":{"$ref":"common.schema.json#/$defs/slug"},"name":{"type":"string","minLength":1,"maxLength":200},"version":{"type":"string","minLength":1,"maxLength":64},"contract":{"type":"object","additionalProperties":false,"required":["name","versions"],"properties":{"name":{"const":"replica.memory-provider"},"versions":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"integer","minimum":1,"maximum":1000}}}},"capabilities":{"description":"Required by v1 hosts: observation.append, observation.query, memory.store, memory.query, memory.lifecycle, grant.store, audit.store. Optional examples: memory.semantic_search, memory.graph_query, memory.temporal_query, memory.compaction, memory.consolidate.","type":"array","minItems":1,"maxItems":64,"items":{"type":"string","maxLength":64,"pattern":"^[a-z]+(?:\\.[a-z_]+)+$"}},"storage":{"type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"enum":["local","memory","remote"]},"location":{"description":"A non-secret description such as a directory or service name. Never a credential.","type":"string","minLength":1,"maxLength":2048}}},"externalCalls":{"description":"Hosts this provider sends data to, with IPv6 addresses in brackets. Empty for a provider that stays on the machine.","type":"array","maxItems":50,"items":{"type":"string","minLength":1,"maxLength":255,"pattern":"^(?:[A-Za-z0-9._-]+(?::[0-9]{1,5})?|\\[[0-9A-Za-z:.%_-]+\\](?::[0-9]{1,5})?)$"}},"dataRetention":{"type":"string","minLength":1,"maxLength":2000}}};function validate456(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate456.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(func2(data) > 128){const err0 = {instancePath,schemaPath:"#/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(func2(data) < 1){const err1 = {instancePath,schemaPath:"#/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(!pattern6.test(data)){const err2 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"},message:"must match pattern \""+"^[a-z0-9]+(?:[._-][a-z0-9]+)*$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}validate456.errors = vErrors;return errors === 0;}validate456.evaluated = {"dynamicProps":false,"dynamicItems":false};const pattern100 = new RegExp("^[a-z]+(?:\\.[a-z_]+)+$", "u");const pattern101 = new RegExp("^(?:[A-Za-z0-9._-]+(?::[0-9]{1,5})?|\\[[0-9A-Za-z:.%_-]+\\](?::[0-9]{1,5})?)$", "u");function validate455(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/provider-manifest.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate455.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.name === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "name"},message:"must have required property '"+"name"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.version === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "version"},message:"must have required property '"+"version"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.contract === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "contract"},message:"must have required property '"+"contract"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.capabilities === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "capabilities"},message:"must have required property '"+"capabilities"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.storage === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "storage"},message:"must have required property '"+"storage"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.externalCalls === undefined){const err7 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "externalCalls"},message:"must have required property '"+"externalCalls"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}for(const key0 in data){if(!(func1.call(schema147.properties, key0))){const err8 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.schemaVersion !== undefined){if("replica.provider/v1" !== data.schemaVersion){const err9 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.provider/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.id !== undefined){if(!(validate456(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate456.errors : vErrors.concat(validate456.errors);errors = vErrors.length;}}if(data.name !== undefined){let data2 = data.name;if(typeof data2 === "string"){if(func2(data2) > 200){const err10 = {instancePath:instancePath+"/name",schemaPath:"#/properties/name/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data2) < 1){const err11 = {instancePath:instancePath+"/name",schemaPath:"#/properties/name/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/name",schemaPath:"#/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.version !== undefined){let data3 = data.version;if(typeof data3 === "string"){if(func2(data3) > 64){const err13 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/maxLength",keyword:"maxLength",params:{limit: 64},message:"must NOT have more than 64 characters"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}if(func2(data3) < 1){const err14 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data.contract !== undefined){let data4 = data.contract;if(data4 && typeof data4 == "object" && !Array.isArray(data4)){if(data4.name === undefined){const err16 = {instancePath:instancePath+"/contract",schemaPath:"#/properties/contract/required",keyword:"required",params:{missingProperty: "name"},message:"must have required property '"+"name"+"'"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}if(data4.versions === undefined){const err17 = {instancePath:instancePath+"/contract",schemaPath:"#/properties/contract/required",keyword:"required",params:{missingProperty: "versions"},message:"must have required property '"+"versions"+"'"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}for(const key1 in data4){if(!((key1 === "name") || (key1 === "versions"))){const err18 = {instancePath:instancePath+"/contract",schemaPath:"#/properties/contract/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data4.name !== undefined){if("replica.memory-provider" !== data4.name){const err19 = {instancePath:instancePath+"/contract/name",schemaPath:"#/properties/contract/properties/name/const",keyword:"const",params:{allowedValue: "replica.memory-provider"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}if(data4.versions !== undefined){let data6 = data4.versions;if(Array.isArray(data6)){if(data6.length > 20){const err20 = {instancePath:instancePath+"/contract/versions",schemaPath:"#/properties/contract/properties/versions/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}if(data6.length < 1){const err21 = {instancePath:instancePath+"/contract/versions",schemaPath:"#/properties/contract/properties/versions/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}const len0 = data6.length;for(let i0=0; i0 1000 || isNaN(data7)){const err23 = {instancePath:instancePath+"/contract/versions/" + i0,schemaPath:"#/properties/contract/properties/versions/items/maximum",keyword:"maximum",params:{comparison: "<=", limit: 1000},message:"must be <= 1000"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}if(data7 < 1 || isNaN(data7)){const err24 = {instancePath:instancePath+"/contract/versions/" + i0,schemaPath:"#/properties/contract/properties/versions/items/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}}}else {const err25 = {instancePath:instancePath+"/contract/versions",schemaPath:"#/properties/contract/properties/versions/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}}else {const err26 = {instancePath:instancePath+"/contract",schemaPath:"#/properties/contract/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}if(data.capabilities !== undefined){let data8 = data.capabilities;if(Array.isArray(data8)){if(data8.length > 64){const err27 = {instancePath:instancePath+"/capabilities",schemaPath:"#/properties/capabilities/maxItems",keyword:"maxItems",params:{limit: 64},message:"must NOT have more than 64 items"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}if(data8.length < 1){const err28 = {instancePath:instancePath+"/capabilities",schemaPath:"#/properties/capabilities/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}const len1 = data8.length;for(let i1=0; i1 64){const err29 = {instancePath:instancePath+"/capabilities/" + i1,schemaPath:"#/properties/capabilities/items/maxLength",keyword:"maxLength",params:{limit: 64},message:"must NOT have more than 64 characters"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}if(!pattern100.test(data9)){const err30 = {instancePath:instancePath+"/capabilities/" + i1,schemaPath:"#/properties/capabilities/items/pattern",keyword:"pattern",params:{pattern: "^[a-z]+(?:\\.[a-z_]+)+$"},message:"must match pattern \""+"^[a-z]+(?:\\.[a-z_]+)+$"+"\""};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}else {const err31 = {instancePath:instancePath+"/capabilities/" + i1,schemaPath:"#/properties/capabilities/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}}else {const err32 = {instancePath:instancePath+"/capabilities",schemaPath:"#/properties/capabilities/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}if(data.storage !== undefined){let data10 = data.storage;if(data10 && typeof data10 == "object" && !Array.isArray(data10)){if(data10.kind === undefined){const err33 = {instancePath:instancePath+"/storage",schemaPath:"#/properties/storage/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}for(const key2 in data10){if(!((key2 === "kind") || (key2 === "location"))){const err34 = {instancePath:instancePath+"/storage",schemaPath:"#/properties/storage/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}if(data10.kind !== undefined){let data11 = data10.kind;if(!(((data11 === "local") || (data11 === "memory")) || (data11 === "remote"))){const err35 = {instancePath:instancePath+"/storage/kind",schemaPath:"#/properties/storage/properties/kind/enum",keyword:"enum",params:{allowedValues: schema147.properties.storage.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}if(data10.location !== undefined){let data12 = data10.location;if(typeof data12 === "string"){if(func2(data12) > 2048){const err36 = {instancePath:instancePath+"/storage/location",schemaPath:"#/properties/storage/properties/location/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}if(func2(data12) < 1){const err37 = {instancePath:instancePath+"/storage/location",schemaPath:"#/properties/storage/properties/location/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}else {const err38 = {instancePath:instancePath+"/storage/location",schemaPath:"#/properties/storage/properties/location/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}}}else {const err39 = {instancePath:instancePath+"/storage",schemaPath:"#/properties/storage/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}if(data.externalCalls !== undefined){let data13 = data.externalCalls;if(Array.isArray(data13)){if(data13.length > 50){const err40 = {instancePath:instancePath+"/externalCalls",schemaPath:"#/properties/externalCalls/maxItems",keyword:"maxItems",params:{limit: 50},message:"must NOT have more than 50 items"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}const len2 = data13.length;for(let i2=0; i2 255){const err41 = {instancePath:instancePath+"/externalCalls/" + i2,schemaPath:"#/properties/externalCalls/items/maxLength",keyword:"maxLength",params:{limit: 255},message:"must NOT have more than 255 characters"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}if(func2(data14) < 1){const err42 = {instancePath:instancePath+"/externalCalls/" + i2,schemaPath:"#/properties/externalCalls/items/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}if(!pattern101.test(data14)){const err43 = {instancePath:instancePath+"/externalCalls/" + i2,schemaPath:"#/properties/externalCalls/items/pattern",keyword:"pattern",params:{pattern: "^(?:[A-Za-z0-9._-]+(?::[0-9]{1,5})?|\\[[0-9A-Za-z:.%_-]+\\](?::[0-9]{1,5})?)$"},message:"must match pattern \""+"^(?:[A-Za-z0-9._-]+(?::[0-9]{1,5})?|\\[[0-9A-Za-z:.%_-]+\\](?::[0-9]{1,5})?)$"+"\""};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}}else {const err44 = {instancePath:instancePath+"/externalCalls/" + i2,schemaPath:"#/properties/externalCalls/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}}else {const err45 = {instancePath:instancePath+"/externalCalls",schemaPath:"#/properties/externalCalls/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}}if(data.dataRetention !== undefined){let data15 = data.dataRetention;if(typeof data15 === "string"){if(func2(data15) > 2000){const err46 = {instancePath:instancePath+"/dataRetention",schemaPath:"#/properties/dataRetention/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}if(func2(data15) < 1){const err47 = {instancePath:instancePath+"/dataRetention",schemaPath:"#/properties/dataRetention/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}else {const err48 = {instancePath:instancePath+"/dataRetention",schemaPath:"#/properties/dataRetention/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}}else {const err49 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}validate455.errors = vErrors;return errors === 0;}validate455.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.score = validate458;const schema149 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/score.schema.json","title":"Replica score v1","description":"A model's judgment of how much one used learning helped the Build it was used for. It is evidence for a person, never a decision.","type":"object","additionalProperties":false,"required":["schemaVersion","id","scope","usedLearningId","usageReportId","memoryId","operationId","rubricVersion","efficiency","followed","reasoning","inputs","route","scoredBy","scoredAt","digest"],"if":{"properties":{"efficiency":{"enum":[1,2]}}},"then":{"required":["issue"]},"properties":{"schemaVersion":{"const":"replica.score/v1"},"id":{"$ref":"common.schema.json#/$defs/id"},"scope":{"$ref":"common.schema.json#/$defs/scope"},"usedLearningId":{"$ref":"common.schema.json#/$defs/id"},"usageReportId":{"$ref":"common.schema.json#/$defs/id"},"memoryId":{"$ref":"common.schema.json#/$defs/id"},"operationId":{"description":"The host's ID for this scoring attempt, so a retry stores one score.","type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"},"rubricVersion":{"const":"replica.efficiency-rubric/v1"},"efficiency":{"description":"1 not efficient at all, 2 slightly, 3 mostly, 4 highly efficient.","type":"integer","minimum":1,"maximum":4},"followed":{"description":"Whether the Build followed the learning, judged apart from the score.","enum":["followed","not_followed","unclear"]},"reasoning":{"type":"string","minLength":1,"maxLength":4000},"issue":{"description":"What went wrong, as one reusable sentence, when the score is 1 or 2.","type":"string","minLength":1,"maxLength":500},"inputs":{"description":"What the model saw besides the learning and the usage report.","type":"array","maxItems":3,"items":{"enum":["screenshots","build_diff","reviewer_verification"]}},"route":{"description":"How the model was chosen: Copilot Fusion at a tier, or Auto at a reasoning effort.","type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"enum":["fusion","auto"]},"fusionTier":{"type":"string","minLength":1,"maxLength":50},"model":{"type":"string","minLength":1,"maxLength":200},"reasoningEffort":{"type":"string","minLength":1,"maxLength":50}}},"scoredBy":{"$ref":"common.schema.json#/$defs/actor"},"scoredAt":{"$ref":"common.schema.json#/$defs/timestamp"},"digest":{"$ref":"common.schema.json#/$defs/digest"}}};function validate459(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate459.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate459.errors = vErrors;return errors === 0;}validate459.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate461(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate461.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate461.errors = vErrors;return errors === 0;}validate461.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate469(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate469.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((((key0 === "kind") || (key0 === "id")) || (key0 === "role")) || (key0 === "login")) || (key0 === "model")) || (key0 === "asserted"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((data0 === "human") || (data0 === "agent")) || (data0 === "system")) || (data0 === "service"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema23.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.id !== undefined){let data1 = data.id;if(typeof data1 === "string"){if(func2(data1) > 300){const err4 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 3){const err5 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern5.test(data1)){const err6 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},message:"must match pattern \""+"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.role !== undefined){if(!(validate59(data.role, {instancePath:instancePath+"/role",parentData:data,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.login !== undefined){let data3 = data.login;if(typeof data3 === "string"){if(!pattern7.test(data3)){const err8 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},message:"must match pattern \""+"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"+"\""};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.model !== undefined){let data4 = data.model;if(typeof data4 === "string"){if(func2(data4) > 200){const err10 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data4) < 1){const err11 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.asserted !== undefined){if(typeof data.asserted !== "boolean"){const err13 = {instancePath:instancePath+"/asserted",schemaPath:"#/properties/asserted/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate469.errors = vErrors;return errors === 0;}validate469.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate472(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate472.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate472.errors = vErrors;return errors === 0;}validate472.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate474(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate474.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate474.errors = vErrors;return errors === 0;}validate474.evaluated = {"dynamicProps":false,"dynamicItems":false};const pattern105 = new RegExp("^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", "u");function validate458(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/score.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate458.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}const _errs1 = errors;let valid0 = true;const _errs2 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.efficiency !== undefined){let data0 = data.efficiency;if(!((data0 === 1) || (data0 === 2))){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}}var _valid0 = _errs2 === errors;errors = _errs1;if(vErrors !== null){if(_errs1){vErrors.length = _errs1;}else {vErrors = null;}}if(_valid0){const _errs4 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.issue === undefined){const err1 = {instancePath,schemaPath:"#/then/required",keyword:"required",params:{missingProperty: "issue"},message:"must have required property '"+"issue"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}var _valid0 = _errs4 === errors;valid0 = _valid0;}if(!valid0){const err2 = {instancePath,schemaPath:"#/if",keyword:"if",params:{failingKeyword: "then"},message:"must match \"then\" schema"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.id === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.scope === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.usedLearningId === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "usedLearningId"},message:"must have required property '"+"usedLearningId"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.usageReportId === undefined){const err7 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "usageReportId"},message:"must have required property '"+"usageReportId"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.memoryId === undefined){const err8 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "memoryId"},message:"must have required property '"+"memoryId"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data.operationId === undefined){const err9 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "operationId"},message:"must have required property '"+"operationId"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(data.rubricVersion === undefined){const err10 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "rubricVersion"},message:"must have required property '"+"rubricVersion"+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(data.efficiency === undefined){const err11 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "efficiency"},message:"must have required property '"+"efficiency"+"'"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(data.followed === undefined){const err12 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "followed"},message:"must have required property '"+"followed"+"'"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}if(data.reasoning === undefined){const err13 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "reasoning"},message:"must have required property '"+"reasoning"+"'"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}if(data.inputs === undefined){const err14 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "inputs"},message:"must have required property '"+"inputs"+"'"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}if(data.route === undefined){const err15 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "route"},message:"must have required property '"+"route"+"'"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}if(data.scoredBy === undefined){const err16 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scoredBy"},message:"must have required property '"+"scoredBy"+"'"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}if(data.scoredAt === undefined){const err17 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scoredAt"},message:"must have required property '"+"scoredAt"+"'"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}if(data.digest === undefined){const err18 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}for(const key0 in data){if(!(func1.call(schema149.properties, key0))){const err19 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}if(data.schemaVersion !== undefined){if("replica.score/v1" !== data.schemaVersion){const err20 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.score/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}if(data.id !== undefined){if(!(validate459(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate459.errors : vErrors.concat(validate459.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate461(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate461.errors : vErrors.concat(validate461.errors);errors = vErrors.length;}}if(data.usedLearningId !== undefined){if(!(validate459(data.usedLearningId, {instancePath:instancePath+"/usedLearningId",parentData:data,parentDataProperty:"usedLearningId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate459.errors : vErrors.concat(validate459.errors);errors = vErrors.length;}}if(data.usageReportId !== undefined){if(!(validate459(data.usageReportId, {instancePath:instancePath+"/usageReportId",parentData:data,parentDataProperty:"usageReportId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate459.errors : vErrors.concat(validate459.errors);errors = vErrors.length;}}if(data.memoryId !== undefined){if(!(validate459(data.memoryId, {instancePath:instancePath+"/memoryId",parentData:data,parentDataProperty:"memoryId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate459.errors : vErrors.concat(validate459.errors);errors = vErrors.length;}}if(data.operationId !== undefined){let data7 = data.operationId;if(typeof data7 === "string"){if(!pattern105.test(data7)){const err21 = {instancePath:instancePath+"/operationId",schemaPath:"#/properties/operationId/pattern",keyword:"pattern",params:{pattern: "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"},message:"must match pattern \""+"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"+"\""};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}else {const err22 = {instancePath:instancePath+"/operationId",schemaPath:"#/properties/operationId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}if(data.rubricVersion !== undefined){if("replica.efficiency-rubric/v1" !== data.rubricVersion){const err23 = {instancePath:instancePath+"/rubricVersion",schemaPath:"#/properties/rubricVersion/const",keyword:"const",params:{allowedValue: "replica.efficiency-rubric/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}if(data.efficiency !== undefined){let data9 = data.efficiency;if(!(((typeof data9 == "number") && (!(data9 % 1) && !isNaN(data9))) && (isFinite(data9)))){const err24 = {instancePath:instancePath+"/efficiency",schemaPath:"#/properties/efficiency/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}if((typeof data9 == "number") && (isFinite(data9))){if(data9 > 4 || isNaN(data9)){const err25 = {instancePath:instancePath+"/efficiency",schemaPath:"#/properties/efficiency/maximum",keyword:"maximum",params:{comparison: "<=", limit: 4},message:"must be <= 4"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}if(data9 < 1 || isNaN(data9)){const err26 = {instancePath:instancePath+"/efficiency",schemaPath:"#/properties/efficiency/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}}if(data.followed !== undefined){let data10 = data.followed;if(!(((data10 === "followed") || (data10 === "not_followed")) || (data10 === "unclear"))){const err27 = {instancePath:instancePath+"/followed",schemaPath:"#/properties/followed/enum",keyword:"enum",params:{allowedValues: schema149.properties.followed.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}if(data.reasoning !== undefined){let data11 = data.reasoning;if(typeof data11 === "string"){if(func2(data11) > 4000){const err28 = {instancePath:instancePath+"/reasoning",schemaPath:"#/properties/reasoning/maxLength",keyword:"maxLength",params:{limit: 4000},message:"must NOT have more than 4000 characters"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}if(func2(data11) < 1){const err29 = {instancePath:instancePath+"/reasoning",schemaPath:"#/properties/reasoning/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}else {const err30 = {instancePath:instancePath+"/reasoning",schemaPath:"#/properties/reasoning/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}if(data.issue !== undefined){let data12 = data.issue;if(typeof data12 === "string"){if(func2(data12) > 500){const err31 = {instancePath:instancePath+"/issue",schemaPath:"#/properties/issue/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}if(func2(data12) < 1){const err32 = {instancePath:instancePath+"/issue",schemaPath:"#/properties/issue/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}else {const err33 = {instancePath:instancePath+"/issue",schemaPath:"#/properties/issue/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data.inputs !== undefined){let data13 = data.inputs;if(Array.isArray(data13)){if(data13.length > 3){const err34 = {instancePath:instancePath+"/inputs",schemaPath:"#/properties/inputs/maxItems",keyword:"maxItems",params:{limit: 3},message:"must NOT have more than 3 items"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}const len0 = data13.length;for(let i0=0; i0 50){const err40 = {instancePath:instancePath+"/route/fusionTier",schemaPath:"#/properties/route/properties/fusionTier/maxLength",keyword:"maxLength",params:{limit: 50},message:"must NOT have more than 50 characters"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}if(func2(data17) < 1){const err41 = {instancePath:instancePath+"/route/fusionTier",schemaPath:"#/properties/route/properties/fusionTier/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}else {const err42 = {instancePath:instancePath+"/route/fusionTier",schemaPath:"#/properties/route/properties/fusionTier/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data15.model !== undefined){let data18 = data15.model;if(typeof data18 === "string"){if(func2(data18) > 200){const err43 = {instancePath:instancePath+"/route/model",schemaPath:"#/properties/route/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}if(func2(data18) < 1){const err44 = {instancePath:instancePath+"/route/model",schemaPath:"#/properties/route/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}else {const err45 = {instancePath:instancePath+"/route/model",schemaPath:"#/properties/route/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}}if(data15.reasoningEffort !== undefined){let data19 = data15.reasoningEffort;if(typeof data19 === "string"){if(func2(data19) > 50){const err46 = {instancePath:instancePath+"/route/reasoningEffort",schemaPath:"#/properties/route/properties/reasoningEffort/maxLength",keyword:"maxLength",params:{limit: 50},message:"must NOT have more than 50 characters"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}if(func2(data19) < 1){const err47 = {instancePath:instancePath+"/route/reasoningEffort",schemaPath:"#/properties/route/properties/reasoningEffort/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}else {const err48 = {instancePath:instancePath+"/route/reasoningEffort",schemaPath:"#/properties/route/properties/reasoningEffort/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}}else {const err49 = {instancePath:instancePath+"/route",schemaPath:"#/properties/route/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}if(data.scoredBy !== undefined){if(!(validate469(data.scoredBy, {instancePath:instancePath+"/scoredBy",parentData:data,parentDataProperty:"scoredBy",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate469.errors : vErrors.concat(validate469.errors);errors = vErrors.length;}}if(data.scoredAt !== undefined){if(!(validate472(data.scoredAt, {instancePath:instancePath+"/scoredAt",parentData:data,parentDataProperty:"scoredAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate472.errors : vErrors.concat(validate472.errors);errors = vErrors.length;}}if(data.digest !== undefined){if(!(validate474(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate474.errors : vErrors.concat(validate474.errors);errors = vErrors.length;}}}else {const err50 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}validate458.errors = vErrors;return errors === 0;}validate458.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.screenshot = validate476;const schema155 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/screenshot.schema.json","title":"Replica screenshot v1","description":"One screenshot an agent took for a usage report. The record holds no image; the host keeps the bytes by their SHA-256. Agent screenshots are never verified Build captures.","type":"object","additionalProperties":false,"required":["schemaVersion","id","scope","usageReportId","sha256","role","route","viewport","theme","capturedAt","digest"],"properties":{"schemaVersion":{"const":"replica.screenshot/v1"},"id":{"$ref":"common.schema.json#/$defs/id"},"scope":{"$ref":"common.schema.json#/$defs/scope"},"usageReportId":{"$ref":"common.schema.json#/$defs/id"},"sha256":{"description":"SHA-256 of the PNG bytes.","type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"role":{"enum":["before","after"]},"route":{"type":"string","minLength":1,"maxLength":2048},"viewport":{"type":"object","additionalProperties":false,"required":["width","height"],"properties":{"width":{"type":"integer","minimum":1,"maximum":100000},"height":{"type":"integer","minimum":1,"maximum":100000}}},"theme":{"type":"string","minLength":1,"maxLength":64},"capturedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"consentGrantId":{"$ref":"common.schema.json#/$defs/id"},"digest":{"$ref":"common.schema.json#/$defs/digest"}}};function validate477(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate477.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate477.errors = vErrors;return errors === 0;}validate477.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate479(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate479.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate479.errors = vErrors;return errors === 0;}validate479.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate485(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate485.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate485.errors = vErrors;return errors === 0;}validate485.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate488(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate488.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate488.errors = vErrors;return errors === 0;}validate488.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate476(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/screenshot.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate476.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.scope === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.usageReportId === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "usageReportId"},message:"must have required property '"+"usageReportId"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.sha256 === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "sha256"},message:"must have required property '"+"sha256"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.role === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "role"},message:"must have required property '"+"role"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.route === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "route"},message:"must have required property '"+"route"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.viewport === undefined){const err7 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "viewport"},message:"must have required property '"+"viewport"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.theme === undefined){const err8 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "theme"},message:"must have required property '"+"theme"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data.capturedAt === undefined){const err9 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "capturedAt"},message:"must have required property '"+"capturedAt"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(data.digest === undefined){const err10 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}for(const key0 in data){if(!(func1.call(schema155.properties, key0))){const err11 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data.schemaVersion !== undefined){if("replica.screenshot/v1" !== data.schemaVersion){const err12 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.screenshot/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.id !== undefined){if(!(validate477(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate477.errors : vErrors.concat(validate477.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate479(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate479.errors : vErrors.concat(validate479.errors);errors = vErrors.length;}}if(data.usageReportId !== undefined){if(!(validate477(data.usageReportId, {instancePath:instancePath+"/usageReportId",parentData:data,parentDataProperty:"usageReportId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate477.errors : vErrors.concat(validate477.errors);errors = vErrors.length;}}if(data.sha256 !== undefined){let data4 = data.sha256;if(typeof data4 === "string"){if(!pattern11.test(data4)){const err13 = {instancePath:instancePath+"/sha256",schemaPath:"#/properties/sha256/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}else {const err14 = {instancePath:instancePath+"/sha256",schemaPath:"#/properties/sha256/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data.role !== undefined){let data5 = data.role;if(!((data5 === "before") || (data5 === "after"))){const err15 = {instancePath:instancePath+"/role",schemaPath:"#/properties/role/enum",keyword:"enum",params:{allowedValues: schema155.properties.role.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data.route !== undefined){let data6 = data.route;if(typeof data6 === "string"){if(func2(data6) > 2048){const err16 = {instancePath:instancePath+"/route",schemaPath:"#/properties/route/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}if(func2(data6) < 1){const err17 = {instancePath:instancePath+"/route",schemaPath:"#/properties/route/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}else {const err18 = {instancePath:instancePath+"/route",schemaPath:"#/properties/route/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data.viewport !== undefined){let data7 = data.viewport;if(data7 && typeof data7 == "object" && !Array.isArray(data7)){if(data7.width === undefined){const err19 = {instancePath:instancePath+"/viewport",schemaPath:"#/properties/viewport/required",keyword:"required",params:{missingProperty: "width"},message:"must have required property '"+"width"+"'"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}if(data7.height === undefined){const err20 = {instancePath:instancePath+"/viewport",schemaPath:"#/properties/viewport/required",keyword:"required",params:{missingProperty: "height"},message:"must have required property '"+"height"+"'"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}for(const key1 in data7){if(!((key1 === "width") || (key1 === "height"))){const err21 = {instancePath:instancePath+"/viewport",schemaPath:"#/properties/viewport/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}if(data7.width !== undefined){let data8 = data7.width;if(!(((typeof data8 == "number") && (!(data8 % 1) && !isNaN(data8))) && (isFinite(data8)))){const err22 = {instancePath:instancePath+"/viewport/width",schemaPath:"#/properties/viewport/properties/width/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}if((typeof data8 == "number") && (isFinite(data8))){if(data8 > 100000 || isNaN(data8)){const err23 = {instancePath:instancePath+"/viewport/width",schemaPath:"#/properties/viewport/properties/width/maximum",keyword:"maximum",params:{comparison: "<=", limit: 100000},message:"must be <= 100000"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}if(data8 < 1 || isNaN(data8)){const err24 = {instancePath:instancePath+"/viewport/width",schemaPath:"#/properties/viewport/properties/width/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}}if(data7.height !== undefined){let data9 = data7.height;if(!(((typeof data9 == "number") && (!(data9 % 1) && !isNaN(data9))) && (isFinite(data9)))){const err25 = {instancePath:instancePath+"/viewport/height",schemaPath:"#/properties/viewport/properties/height/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}if((typeof data9 == "number") && (isFinite(data9))){if(data9 > 100000 || isNaN(data9)){const err26 = {instancePath:instancePath+"/viewport/height",schemaPath:"#/properties/viewport/properties/height/maximum",keyword:"maximum",params:{comparison: "<=", limit: 100000},message:"must be <= 100000"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}if(data9 < 1 || isNaN(data9)){const err27 = {instancePath:instancePath+"/viewport/height",schemaPath:"#/properties/viewport/properties/height/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}}}else {const err28 = {instancePath:instancePath+"/viewport",schemaPath:"#/properties/viewport/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}if(data.theme !== undefined){let data10 = data.theme;if(typeof data10 === "string"){if(func2(data10) > 64){const err29 = {instancePath:instancePath+"/theme",schemaPath:"#/properties/theme/maxLength",keyword:"maxLength",params:{limit: 64},message:"must NOT have more than 64 characters"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}if(func2(data10) < 1){const err30 = {instancePath:instancePath+"/theme",schemaPath:"#/properties/theme/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}else {const err31 = {instancePath:instancePath+"/theme",schemaPath:"#/properties/theme/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}if(data.capturedAt !== undefined){if(!(validate485(data.capturedAt, {instancePath:instancePath+"/capturedAt",parentData:data,parentDataProperty:"capturedAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate485.errors : vErrors.concat(validate485.errors);errors = vErrors.length;}}if(data.consentGrantId !== undefined){if(!(validate477(data.consentGrantId, {instancePath:instancePath+"/consentGrantId",parentData:data,parentDataProperty:"consentGrantId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate477.errors : vErrors.concat(validate477.errors);errors = vErrors.length;}}if(data.digest !== undefined){if(!(validate488(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate488.errors : vErrors.concat(validate488.errors);errors = vErrors.length;}}}else {const err32 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}validate476.errors = vErrors;return errors === 0;}validate476.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.updateDecision = validate490;const schema160 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/update-decision.schema.json","title":"Replica update decision v1","description":"A person's decision on one update proposal: applied as a new version of the learning, or dismissed.","type":"object","additionalProperties":false,"required":["schemaVersion","id","scope","proposalId","memoryId","decision","reason","decidedBy","decidedAt","digest"],"if":{"properties":{"decision":{"const":"applied"}}},"then":{"required":["appliedVersion"]},"properties":{"schemaVersion":{"const":"replica.update-decision/v1"},"id":{"$ref":"common.schema.json#/$defs/id"},"scope":{"$ref":"common.schema.json#/$defs/scope"},"proposalId":{"$ref":"common.schema.json#/$defs/id"},"memoryId":{"$ref":"common.schema.json#/$defs/id"},"decision":{"enum":["applied","dismissed"]},"appliedVersion":{"description":"The learning version the applied wording became.","type":"integer","minimum":2},"reason":{"type":"string","minLength":1,"maxLength":2000},"decidedBy":{"$ref":"common.schema.json#/$defs/humanActor"},"decidedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"digest":{"$ref":"common.schema.json#/$defs/digest"}}};function validate491(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate491.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate491.errors = vErrors;return errors === 0;}validate491.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate493(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate493.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate493.errors = vErrors;return errors === 0;}validate493.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate500(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate500.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!(validate132(data, {instancePath,parentData,parentDataProperty,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate132.errors : vErrors.concat(validate132.errors);errors = vErrors.length;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind !== undefined){if("human" !== data.kind){const err0 = {instancePath:instancePath+"/kind",schemaPath:"#/allOf/1/properties/kind/const",keyword:"const",params:{allowedValue: "human"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}}else {const err1 = {instancePath,schemaPath:"#/allOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate500.errors = vErrors;return errors === 0;}validate500.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate503(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate503.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate503.errors = vErrors;return errors === 0;}validate503.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate505(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate505.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate505.errors = vErrors;return errors === 0;}validate505.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate490(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/update-decision.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate490.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}const _errs1 = errors;let valid0 = true;const _errs2 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.decision !== undefined){if("applied" !== data.decision){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}}var _valid0 = _errs2 === errors;errors = _errs1;if(vErrors !== null){if(_errs1){vErrors.length = _errs1;}else {vErrors = null;}}if(_valid0){const _errs4 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.appliedVersion === undefined){const err1 = {instancePath,schemaPath:"#/then/required",keyword:"required",params:{missingProperty: "appliedVersion"},message:"must have required property '"+"appliedVersion"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}var _valid0 = _errs4 === errors;valid0 = _valid0;}if(!valid0){const err2 = {instancePath,schemaPath:"#/if",keyword:"if",params:{failingKeyword: "then"},message:"must match \"then\" schema"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.id === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.scope === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.proposalId === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "proposalId"},message:"must have required property '"+"proposalId"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.memoryId === undefined){const err7 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "memoryId"},message:"must have required property '"+"memoryId"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.decision === undefined){const err8 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "decision"},message:"must have required property '"+"decision"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data.reason === undefined){const err9 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "reason"},message:"must have required property '"+"reason"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(data.decidedBy === undefined){const err10 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "decidedBy"},message:"must have required property '"+"decidedBy"+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(data.decidedAt === undefined){const err11 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "decidedAt"},message:"must have required property '"+"decidedAt"+"'"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(data.digest === undefined){const err12 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}for(const key0 in data){if(!(func1.call(schema160.properties, key0))){const err13 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data.schemaVersion !== undefined){if("replica.update-decision/v1" !== data.schemaVersion){const err14 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.update-decision/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data.id !== undefined){if(!(validate491(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate491.errors : vErrors.concat(validate491.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate493(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate493.errors : vErrors.concat(validate493.errors);errors = vErrors.length;}}if(data.proposalId !== undefined){if(!(validate491(data.proposalId, {instancePath:instancePath+"/proposalId",parentData:data,parentDataProperty:"proposalId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate491.errors : vErrors.concat(validate491.errors);errors = vErrors.length;}}if(data.memoryId !== undefined){if(!(validate491(data.memoryId, {instancePath:instancePath+"/memoryId",parentData:data,parentDataProperty:"memoryId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate491.errors : vErrors.concat(validate491.errors);errors = vErrors.length;}}if(data.decision !== undefined){let data6 = data.decision;if(!((data6 === "applied") || (data6 === "dismissed"))){const err15 = {instancePath:instancePath+"/decision",schemaPath:"#/properties/decision/enum",keyword:"enum",params:{allowedValues: schema160.properties.decision.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data.appliedVersion !== undefined){let data7 = data.appliedVersion;if(!(((typeof data7 == "number") && (!(data7 % 1) && !isNaN(data7))) && (isFinite(data7)))){const err16 = {instancePath:instancePath+"/appliedVersion",schemaPath:"#/properties/appliedVersion/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}if((typeof data7 == "number") && (isFinite(data7))){if(data7 < 2 || isNaN(data7)){const err17 = {instancePath:instancePath+"/appliedVersion",schemaPath:"#/properties/appliedVersion/minimum",keyword:"minimum",params:{comparison: ">=", limit: 2},message:"must be >= 2"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}}if(data.reason !== undefined){let data8 = data.reason;if(typeof data8 === "string"){if(func2(data8) > 2000){const err18 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}if(func2(data8) < 1){const err19 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}else {const err20 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}if(data.decidedBy !== undefined){if(!(validate500(data.decidedBy, {instancePath:instancePath+"/decidedBy",parentData:data,parentDataProperty:"decidedBy",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate500.errors : vErrors.concat(validate500.errors);errors = vErrors.length;}}if(data.decidedAt !== undefined){if(!(validate503(data.decidedAt, {instancePath:instancePath+"/decidedAt",parentData:data,parentDataProperty:"decidedAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate503.errors : vErrors.concat(validate503.errors);errors = vErrors.length;}}if(data.digest !== undefined){if(!(validate505(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate505.errors : vErrors.concat(validate505.errors);errors = vErrors.length;}}}else {const err21 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}validate490.errors = vErrors;return errors === 0;}validate490.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.updateProposal = validate507;const schema166 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/update-proposal.schema.json","title":"Replica update proposal v1","description":"Suggested new wording for one version of an accepted learning, drafted because scored uses of that version kept showing the same issue. It is a suggestion for a person; only a person applies it.","type":"object","additionalProperties":false,"required":["schemaVersion","id","scope","memoryId","version","versionDigest","issueKey","issue","content","reasoning","support","counter","route","proposedBy","proposedAt","digest"],"properties":{"schemaVersion":{"const":"replica.update-proposal/v1"},"id":{"$ref":"common.schema.json#/$defs/id"},"scope":{"$ref":"common.schema.json#/$defs/scope"},"memoryId":{"$ref":"common.schema.json#/$defs/id"},"version":{"description":"The learning version whose wording this would replace.","type":"integer","minimum":1},"versionDigest":{"description":"The digest of that version, so applying it after the wording changed is refused.","$ref":"common.schema.json#/$defs/digest"},"issueKey":{"description":"A short name for the issue, so later runs group the same issue under it.","$ref":"common.schema.json#/$defs/slug"},"issue":{"description":"The recurring issue, as one sentence.","type":"string","minLength":1,"maxLength":500},"title":{"type":"string","minLength":1,"maxLength":120},"content":{"description":"The suggested wording of the learning.","type":"string","minLength":1,"maxLength":4000},"reasoning":{"description":"Why this wording addresses the issue.","type":"string","minLength":1,"maxLength":4000},"support":{"description":"The scores that showed the issue.","type":"array","minItems":2,"maxItems":500,"items":{"$ref":"common.schema.json#/$defs/id"}},"counter":{"description":"The scores of the same version that went well.","type":"array","maxItems":500,"items":{"$ref":"common.schema.json#/$defs/id"}},"route":{"$ref":"score.schema.json#/properties/route"},"proposedBy":{"$ref":"common.schema.json#/$defs/actor"},"proposedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"digest":{"$ref":"common.schema.json#/$defs/digest"}}};function validate508(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate508.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate508.errors = vErrors;return errors === 0;}validate508.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate510(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate510.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate510.errors = vErrors;return errors === 0;}validate510.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate516(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate516.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate516.errors = vErrors;return errors === 0;}validate516.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate518(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate518.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(func2(data) > 128){const err0 = {instancePath,schemaPath:"#/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(func2(data) < 1){const err1 = {instancePath,schemaPath:"#/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(!pattern6.test(data)){const err2 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"},message:"must match pattern \""+"^[a-z0-9]+(?:[._-][a-z0-9]+)*$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}validate518.errors = vErrors;return errors === 0;}validate518.evaluated = {"dynamicProps":false,"dynamicItems":false};const schema171 = {"description":"How the model was chosen: Copilot Fusion at a tier, or Auto at a reasoning effort.","type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"enum":["fusion","auto"]},"fusionTier":{"type":"string","minLength":1,"maxLength":50},"model":{"type":"string","minLength":1,"maxLength":200},"reasoningEffort":{"type":"string","minLength":1,"maxLength":50}}};function validate522(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate522.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!((((key0 === "kind") || (key0 === "fusionTier")) || (key0 === "model")) || (key0 === "reasoningEffort"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((data0 === "fusion") || (data0 === "auto"))){const err2 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema171.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.fusionTier !== undefined){let data1 = data.fusionTier;if(typeof data1 === "string"){if(func2(data1) > 50){const err3 = {instancePath:instancePath+"/fusionTier",schemaPath:"#/properties/fusionTier/maxLength",keyword:"maxLength",params:{limit: 50},message:"must NOT have more than 50 characters"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(func2(data1) < 1){const err4 = {instancePath:instancePath+"/fusionTier",schemaPath:"#/properties/fusionTier/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}else {const err5 = {instancePath:instancePath+"/fusionTier",schemaPath:"#/properties/fusionTier/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.model !== undefined){let data2 = data.model;if(typeof data2 === "string"){if(func2(data2) > 200){const err6 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(func2(data2) < 1){const err7 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}else {const err8 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.reasoningEffort !== undefined){let data3 = data.reasoningEffort;if(typeof data3 === "string"){if(func2(data3) > 50){const err9 = {instancePath:instancePath+"/reasoningEffort",schemaPath:"#/properties/reasoningEffort/maxLength",keyword:"maxLength",params:{limit: 50},message:"must NOT have more than 50 characters"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(func2(data3) < 1){const err10 = {instancePath:instancePath+"/reasoningEffort",schemaPath:"#/properties/reasoningEffort/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}else {const err11 = {instancePath:instancePath+"/reasoningEffort",schemaPath:"#/properties/reasoningEffort/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}}else {const err12 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}validate522.errors = vErrors;return errors === 0;}validate522.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate524(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate524.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((((key0 === "kind") || (key0 === "id")) || (key0 === "role")) || (key0 === "login")) || (key0 === "model")) || (key0 === "asserted"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((data0 === "human") || (data0 === "agent")) || (data0 === "system")) || (data0 === "service"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema23.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.id !== undefined){let data1 = data.id;if(typeof data1 === "string"){if(func2(data1) > 300){const err4 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 3){const err5 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern5.test(data1)){const err6 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},message:"must match pattern \""+"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.role !== undefined){if(!(validate59(data.role, {instancePath:instancePath+"/role",parentData:data,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.login !== undefined){let data3 = data.login;if(typeof data3 === "string"){if(!pattern7.test(data3)){const err8 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},message:"must match pattern \""+"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"+"\""};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.model !== undefined){let data4 = data.model;if(typeof data4 === "string"){if(func2(data4) > 200){const err10 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data4) < 1){const err11 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.asserted !== undefined){if(typeof data.asserted !== "boolean"){const err13 = {instancePath:instancePath+"/asserted",schemaPath:"#/properties/asserted/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate524.errors = vErrors;return errors === 0;}validate524.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate527(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate527.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate527.errors = vErrors;return errors === 0;}validate527.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate507(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/update-proposal.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate507.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.scope === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.memoryId === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "memoryId"},message:"must have required property '"+"memoryId"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.version === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "version"},message:"must have required property '"+"version"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.versionDigest === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "versionDigest"},message:"must have required property '"+"versionDigest"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.issueKey === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "issueKey"},message:"must have required property '"+"issueKey"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.issue === undefined){const err7 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "issue"},message:"must have required property '"+"issue"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.content === undefined){const err8 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "content"},message:"must have required property '"+"content"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data.reasoning === undefined){const err9 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "reasoning"},message:"must have required property '"+"reasoning"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(data.support === undefined){const err10 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "support"},message:"must have required property '"+"support"+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(data.counter === undefined){const err11 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "counter"},message:"must have required property '"+"counter"+"'"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(data.route === undefined){const err12 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "route"},message:"must have required property '"+"route"+"'"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}if(data.proposedBy === undefined){const err13 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "proposedBy"},message:"must have required property '"+"proposedBy"+"'"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}if(data.proposedAt === undefined){const err14 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "proposedAt"},message:"must have required property '"+"proposedAt"+"'"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}if(data.digest === undefined){const err15 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}for(const key0 in data){if(!(func1.call(schema166.properties, key0))){const err16 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}if(data.schemaVersion !== undefined){if("replica.update-proposal/v1" !== data.schemaVersion){const err17 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.update-proposal/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}if(data.id !== undefined){if(!(validate508(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate508.errors : vErrors.concat(validate508.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate510(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate510.errors : vErrors.concat(validate510.errors);errors = vErrors.length;}}if(data.memoryId !== undefined){if(!(validate508(data.memoryId, {instancePath:instancePath+"/memoryId",parentData:data,parentDataProperty:"memoryId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate508.errors : vErrors.concat(validate508.errors);errors = vErrors.length;}}if(data.version !== undefined){let data4 = data.version;if(!(((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4)))){const err18 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}if((typeof data4 == "number") && (isFinite(data4))){if(data4 < 1 || isNaN(data4)){const err19 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}}if(data.versionDigest !== undefined){if(!(validate516(data.versionDigest, {instancePath:instancePath+"/versionDigest",parentData:data,parentDataProperty:"versionDigest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate516.errors : vErrors.concat(validate516.errors);errors = vErrors.length;}}if(data.issueKey !== undefined){if(!(validate518(data.issueKey, {instancePath:instancePath+"/issueKey",parentData:data,parentDataProperty:"issueKey",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate518.errors : vErrors.concat(validate518.errors);errors = vErrors.length;}}if(data.issue !== undefined){let data7 = data.issue;if(typeof data7 === "string"){if(func2(data7) > 500){const err20 = {instancePath:instancePath+"/issue",schemaPath:"#/properties/issue/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}if(func2(data7) < 1){const err21 = {instancePath:instancePath+"/issue",schemaPath:"#/properties/issue/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}else {const err22 = {instancePath:instancePath+"/issue",schemaPath:"#/properties/issue/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}if(data.title !== undefined){let data8 = data.title;if(typeof data8 === "string"){if(func2(data8) > 120){const err23 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}if(func2(data8) < 1){const err24 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}else {const err25 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}if(data.content !== undefined){let data9 = data.content;if(typeof data9 === "string"){if(func2(data9) > 4000){const err26 = {instancePath:instancePath+"/content",schemaPath:"#/properties/content/maxLength",keyword:"maxLength",params:{limit: 4000},message:"must NOT have more than 4000 characters"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}if(func2(data9) < 1){const err27 = {instancePath:instancePath+"/content",schemaPath:"#/properties/content/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}else {const err28 = {instancePath:instancePath+"/content",schemaPath:"#/properties/content/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}if(data.reasoning !== undefined){let data10 = data.reasoning;if(typeof data10 === "string"){if(func2(data10) > 4000){const err29 = {instancePath:instancePath+"/reasoning",schemaPath:"#/properties/reasoning/maxLength",keyword:"maxLength",params:{limit: 4000},message:"must NOT have more than 4000 characters"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}if(func2(data10) < 1){const err30 = {instancePath:instancePath+"/reasoning",schemaPath:"#/properties/reasoning/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}else {const err31 = {instancePath:instancePath+"/reasoning",schemaPath:"#/properties/reasoning/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}if(data.support !== undefined){let data11 = data.support;if(Array.isArray(data11)){if(data11.length > 500){const err32 = {instancePath:instancePath+"/support",schemaPath:"#/properties/support/maxItems",keyword:"maxItems",params:{limit: 500},message:"must NOT have more than 500 items"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}if(data11.length < 2){const err33 = {instancePath:instancePath+"/support",schemaPath:"#/properties/support/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}const len0 = data11.length;for(let i0=0; i0 500){const err35 = {instancePath:instancePath+"/counter",schemaPath:"#/properties/counter/maxItems",keyword:"maxItems",params:{limit: 500},message:"must NOT have more than 500 items"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}const len1 = data13.length;for(let i1=0; i1 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate533.errors = vErrors;return errors === 0;}validate533.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate539(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate539.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern18.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9a-f]{40}$"},message:"must match pattern \""+"^[0-9a-f]{40}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate539.errors = vErrors;return errors === 0;}validate539.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate541(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate541.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate541.errors = vErrors;return errors === 0;}validate541.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate543(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate543.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((((key0 === "kind") || (key0 === "id")) || (key0 === "role")) || (key0 === "login")) || (key0 === "model")) || (key0 === "asserted"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((data0 === "human") || (data0 === "agent")) || (data0 === "system")) || (data0 === "service"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema23.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.id !== undefined){let data1 = data.id;if(typeof data1 === "string"){if(func2(data1) > 300){const err4 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 3){const err5 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern5.test(data1)){const err6 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},message:"must match pattern \""+"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.role !== undefined){if(!(validate59(data.role, {instancePath:instancePath+"/role",parentData:data,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.login !== undefined){let data3 = data.login;if(typeof data3 === "string"){if(!pattern7.test(data3)){const err8 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},message:"must match pattern \""+"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"+"\""};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.model !== undefined){let data4 = data.model;if(typeof data4 === "string"){if(func2(data4) > 200){const err10 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data4) < 1){const err11 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.asserted !== undefined){if(typeof data.asserted !== "boolean"){const err13 = {instancePath:instancePath+"/asserted",schemaPath:"#/properties/asserted/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate543.errors = vErrors;return errors === 0;}validate543.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate546(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate546.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate546.errors = vErrors;return errors === 0;}validate546.evaluated = {"dynamicProps":false,"dynamicItems":false};const pattern132 = new RegExp("^[A-Za-z0-9._:-]{1,128}$", "u");function validate530(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/usage-report.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate530.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.scope === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.reportId === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "reportId"},message:"must have required property '"+"reportId"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.guidanceIds === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "guidanceIds"},message:"must have required property '"+"guidanceIds"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.commitSha === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "commitSha"},message:"must have required property '"+"commitSha"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.contentDigest === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "contentDigest"},message:"must have required property '"+"contentDigest"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.reportedBy === undefined){const err7 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "reportedBy"},message:"must have required property '"+"reportedBy"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.reportedAt === undefined){const err8 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "reportedAt"},message:"must have required property '"+"reportedAt"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data.digest === undefined){const err9 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}for(const key0 in data){if(!(func1.call(schema174.properties, key0))){const err10 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.schemaVersion !== undefined){if("replica.usage-report/v1" !== data.schemaVersion){const err11 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.usage-report/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data.id !== undefined){if(!(validate531(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate531.errors : vErrors.concat(validate531.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate533(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate533.errors : vErrors.concat(validate533.errors);errors = vErrors.length;}}if(data.reportId !== undefined){let data3 = data.reportId;if(typeof data3 === "string"){if(!pattern132.test(data3)){const err12 = {instancePath:instancePath+"/reportId",schemaPath:"#/properties/reportId/pattern",keyword:"pattern",params:{pattern: "^[A-Za-z0-9._:-]{1,128}$"},message:"must match pattern \""+"^[A-Za-z0-9._:-]{1,128}$"+"\""};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}else {const err13 = {instancePath:instancePath+"/reportId",schemaPath:"#/properties/reportId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data.guidanceIds !== undefined){let data4 = data.guidanceIds;if(Array.isArray(data4)){if(data4.length > 100){const err14 = {instancePath:instancePath+"/guidanceIds",schemaPath:"#/properties/guidanceIds/maxItems",keyword:"maxItems",params:{limit: 100},message:"must NOT have more than 100 items"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}if(data4.length < 1){const err15 = {instancePath:instancePath+"/guidanceIds",schemaPath:"#/properties/guidanceIds/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}const len0 = data4.length;for(let i0=0; i0 200){const err19 = {instancePath:instancePath+"/session/id",schemaPath:"#/properties/session/properties/id/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}if(func2(data7) < 1){const err20 = {instancePath:instancePath+"/session/id",schemaPath:"#/properties/session/properties/id/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}else {const err21 = {instancePath:instancePath+"/session/id",schemaPath:"#/properties/session/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}if(data6.label !== undefined){let data8 = data6.label;if(typeof data8 === "string"){if(func2(data8) > 200){const err22 = {instancePath:instancePath+"/session/label",schemaPath:"#/properties/session/properties/label/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}if(func2(data8) < 1){const err23 = {instancePath:instancePath+"/session/label",schemaPath:"#/properties/session/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}else {const err24 = {instancePath:instancePath+"/session/label",schemaPath:"#/properties/session/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}}else {const err25 = {instancePath:instancePath+"/session",schemaPath:"#/properties/session/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}if(data.commitSha !== undefined){if(!(validate539(data.commitSha, {instancePath:instancePath+"/commitSha",parentData:data,parentDataProperty:"commitSha",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate539.errors : vErrors.concat(validate539.errors);errors = vErrors.length;}}if(data.prototypeId !== undefined){let data10 = data.prototypeId;if(typeof data10 === "string"){if(func2(data10) > 200){const err26 = {instancePath:instancePath+"/prototypeId",schemaPath:"#/properties/prototypeId/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}if(func2(data10) < 1){const err27 = {instancePath:instancePath+"/prototypeId",schemaPath:"#/properties/prototypeId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}else {const err28 = {instancePath:instancePath+"/prototypeId",schemaPath:"#/properties/prototypeId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}if(data.contentDigest !== undefined){if(!(validate541(data.contentDigest, {instancePath:instancePath+"/contentDigest",parentData:data,parentDataProperty:"contentDigest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate541.errors : vErrors.concat(validate541.errors);errors = vErrors.length;}}if(data.reportedBy !== undefined){if(!(validate543(data.reportedBy, {instancePath:instancePath+"/reportedBy",parentData:data,parentDataProperty:"reportedBy",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate543.errors : vErrors.concat(validate543.errors);errors = vErrors.length;}}if(data.reportedAt !== undefined){if(!(validate546(data.reportedAt, {instancePath:instancePath+"/reportedAt",parentData:data,parentDataProperty:"reportedAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate546.errors : vErrors.concat(validate546.errors);errors = vErrors.length;}}if(data.digest !== undefined){if(!(validate541(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate541.errors : vErrors.concat(validate541.errors);errors = vErrors.length;}}}else {const err29 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}validate530.errors = vErrors;return errors === 0;}validate530.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.usedLearning = validate549;const schema181 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/used-learning.schema.json","title":"Replica used learning v1","description":"One delivered learning an agent says it used. It is always the agent's claim, never a verified result.","type":"object","additionalProperties":false,"required":["schemaVersion","id","scope","usageReportId","deliveryId","memoryId","claimedBy","reportedAt","digest"],"properties":{"schemaVersion":{"const":"replica.used-learning/v1"},"id":{"$ref":"common.schema.json#/$defs/id"},"scope":{"$ref":"common.schema.json#/$defs/scope"},"usageReportId":{"$ref":"common.schema.json#/$defs/id"},"deliveryId":{"$ref":"common.schema.json#/$defs/id"},"memoryId":{"$ref":"common.schema.json#/$defs/id"},"claimedBy":{"$ref":"common.schema.json#/$defs/actor"},"beforeScreenshotId":{"$ref":"common.schema.json#/$defs/id"},"afterScreenshotId":{"$ref":"common.schema.json#/$defs/id"},"reportedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"digest":{"$ref":"common.schema.json#/$defs/digest"}}};function validate550(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate550.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate550.errors = vErrors;return errors === 0;}validate550.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate552(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate552.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate552.errors = vErrors;return errors === 0;}validate552.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate560(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate560.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((((key0 === "kind") || (key0 === "id")) || (key0 === "role")) || (key0 === "login")) || (key0 === "model")) || (key0 === "asserted"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((data0 === "human") || (data0 === "agent")) || (data0 === "system")) || (data0 === "service"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema23.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.id !== undefined){let data1 = data.id;if(typeof data1 === "string"){if(func2(data1) > 300){const err4 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 3){const err5 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern5.test(data1)){const err6 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},message:"must match pattern \""+"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.role !== undefined){if(!(validate59(data.role, {instancePath:instancePath+"/role",parentData:data,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.login !== undefined){let data3 = data.login;if(typeof data3 === "string"){if(!pattern7.test(data3)){const err8 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},message:"must match pattern \""+"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"+"\""};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.model !== undefined){let data4 = data.model;if(typeof data4 === "string"){if(func2(data4) > 200){const err10 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data4) < 1){const err11 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.asserted !== undefined){if(typeof data.asserted !== "boolean"){const err13 = {instancePath:instancePath+"/asserted",schemaPath:"#/properties/asserted/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate560.errors = vErrors;return errors === 0;}validate560.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate565(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate565.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate565.errors = vErrors;return errors === 0;}validate565.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate567(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate567.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate567.errors = vErrors;return errors === 0;}validate567.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate549(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/used-learning.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate549.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.scope === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.usageReportId === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "usageReportId"},message:"must have required property '"+"usageReportId"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.deliveryId === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "deliveryId"},message:"must have required property '"+"deliveryId"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.memoryId === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "memoryId"},message:"must have required property '"+"memoryId"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.claimedBy === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "claimedBy"},message:"must have required property '"+"claimedBy"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.reportedAt === undefined){const err7 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "reportedAt"},message:"must have required property '"+"reportedAt"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.digest === undefined){const err8 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}for(const key0 in data){if(!(func1.call(schema181.properties, key0))){const err9 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.schemaVersion !== undefined){if("replica.used-learning/v1" !== data.schemaVersion){const err10 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.used-learning/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.id !== undefined){if(!(validate550(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate550.errors : vErrors.concat(validate550.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate552(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate552.errors : vErrors.concat(validate552.errors);errors = vErrors.length;}}if(data.usageReportId !== undefined){if(!(validate550(data.usageReportId, {instancePath:instancePath+"/usageReportId",parentData:data,parentDataProperty:"usageReportId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate550.errors : vErrors.concat(validate550.errors);errors = vErrors.length;}}if(data.deliveryId !== undefined){if(!(validate550(data.deliveryId, {instancePath:instancePath+"/deliveryId",parentData:data,parentDataProperty:"deliveryId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate550.errors : vErrors.concat(validate550.errors);errors = vErrors.length;}}if(data.memoryId !== undefined){if(!(validate550(data.memoryId, {instancePath:instancePath+"/memoryId",parentData:data,parentDataProperty:"memoryId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate550.errors : vErrors.concat(validate550.errors);errors = vErrors.length;}}if(data.claimedBy !== undefined){if(!(validate560(data.claimedBy, {instancePath:instancePath+"/claimedBy",parentData:data,parentDataProperty:"claimedBy",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate560.errors : vErrors.concat(validate560.errors);errors = vErrors.length;}}if(data.beforeScreenshotId !== undefined){if(!(validate550(data.beforeScreenshotId, {instancePath:instancePath+"/beforeScreenshotId",parentData:data,parentDataProperty:"beforeScreenshotId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate550.errors : vErrors.concat(validate550.errors);errors = vErrors.length;}}if(data.afterScreenshotId !== undefined){if(!(validate550(data.afterScreenshotId, {instancePath:instancePath+"/afterScreenshotId",parentData:data,parentDataProperty:"afterScreenshotId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate550.errors : vErrors.concat(validate550.errors);errors = vErrors.length;}}if(data.reportedAt !== undefined){if(!(validate565(data.reportedAt, {instancePath:instancePath+"/reportedAt",parentData:data,parentDataProperty:"reportedAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate565.errors : vErrors.concat(validate565.errors);errors = vErrors.length;}}if(data.digest !== undefined){if(!(validate567(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate567.errors : vErrors.concat(validate567.errors);errors = vErrors.length;}}}else {const err11 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}validate549.errors = vErrors;return errors === 0;}validate549.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false}; +} })["date-time"];const pattern4 = new RegExp("^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$", "u");function validate56(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate56.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate56.errors = vErrors;return errors === 0;}validate56.evaluated = {"dynamicProps":false,"dynamicItems":false};const schema23 = {"description":"A person, agent, or system. asserted marks an identity the host could not authenticate.","type":"object","additionalProperties":false,"required":["kind","id"],"properties":{"kind":{"enum":["human","agent","system","service"]},"id":{"description":"A prefix such as github: and a name. The name has no whitespace, control characters, Unicode format characters, or code points from the tag block, U+E0000 to U+E007F, because each can make an ID read as another.","type":"string","minLength":3,"maxLength":300,"pattern":"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},"role":{"$ref":"#/$defs/slug"},"login":{"description":"The login shown at import time, for display only. Stable actor IDs, not this mutable login, identify reviewers.","type":"string","pattern":"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},"model":{"type":"string","minLength":1,"maxLength":200},"asserted":{"type":"boolean"}}};const pattern5 = new RegExp("^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$", "u");const pattern7 = new RegExp("^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$", "u");const schema24 = {"type":"string","minLength":1,"maxLength":128,"pattern":"^[a-z0-9]+(?:[._-][a-z0-9]+)*$"};const pattern6 = new RegExp("^[a-z0-9]+(?:[._-][a-z0-9]+)*$", "u");function validate59(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate59.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(func2(data) > 128){const err0 = {instancePath,schemaPath:"#/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(func2(data) < 1){const err1 = {instancePath,schemaPath:"#/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(!pattern6.test(data)){const err2 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"},message:"must match pattern \""+"^[a-z0-9]+(?:[._-][a-z0-9]+)*$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}validate59.errors = vErrors;return errors === 0;}validate59.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate58(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate58.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((((key0 === "kind") || (key0 === "id")) || (key0 === "role")) || (key0 === "login")) || (key0 === "model")) || (key0 === "asserted"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((data0 === "human") || (data0 === "agent")) || (data0 === "system")) || (data0 === "service"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema23.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.id !== undefined){let data1 = data.id;if(typeof data1 === "string"){if(func2(data1) > 300){const err4 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 3){const err5 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern5.test(data1)){const err6 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},message:"must match pattern \""+"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.role !== undefined){if(!(validate59(data.role, {instancePath:instancePath+"/role",parentData:data,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.login !== undefined){let data3 = data.login;if(typeof data3 === "string"){if(!pattern7.test(data3)){const err8 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},message:"must match pattern \""+"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"+"\""};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.model !== undefined){let data4 = data.model;if(typeof data4 === "string"){if(func2(data4) > 200){const err10 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data4) < 1){const err11 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.asserted !== undefined){if(typeof data.asserted !== "boolean"){const err13 = {instancePath:instancePath+"/asserted",schemaPath:"#/properties/asserted/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate58.errors = vErrors;return errors === 0;}validate58.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema25 = {"description":"Who a record belongs to. Hosts derive it from the caller's access, never from agent input.","type":"object","additionalProperties":false,"minProperties":1,"properties":{"host":{"description":"The Git or Hub host, such as github.com, when the scope comes from a repository URL. The same owner/name on two hosts never shares records.","type":"string","maxLength":261,"pattern":"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},"organization":{"$ref":"#/$defs/scopeName"},"team":{"$ref":"#/$defs/scopeName"},"repository":{"description":"owner/name in lowercase.","type":"string","pattern":"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},"product":{"$ref":"#/$defs/scopeName"}}};const pattern8 = new RegExp("^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$", "u");const pattern10 = new RegExp("^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$", "u");const schema26 = {"type":"string","minLength":1,"maxLength":100,"pattern":"^[a-z0-9]+(?:[._-][a-z0-9]+)*$"};function validate63(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate63.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(func2(data) > 100){const err0 = {instancePath,schemaPath:"#/maxLength",keyword:"maxLength",params:{limit: 100},message:"must NOT have more than 100 characters"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(func2(data) < 1){const err1 = {instancePath,schemaPath:"#/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(!pattern6.test(data)){const err2 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"},message:"must match pattern \""+"^[a-z0-9]+(?:[._-][a-z0-9]+)*$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}validate63.errors = vErrors;return errors === 0;}validate63.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate62(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate62.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate62.errors = vErrors;return errors === 0;}validate62.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema27 = {"description":"What a record may be used for. Permission for one purpose never implies another.","enum":["review","instruction","evaluation","analytics","training","publication"]};function validate68(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate68.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!((((((data === "review") || (data === "instruction")) || (data === "evaluation")) || (data === "analytics")) || (data === "training")) || (data === "publication"))){const err0 = {instancePath,schemaPath:"#/enum",keyword:"enum",params:{allowedValues: schema27.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}validate68.errors = vErrors;return errors === 0;}validate68.evaluated = {"dynamicProps":false,"dynamicItems":false};const schema28 = {"description":"SHA-256 of the RFC 8785 canonical JSON of a value.","type":"string","pattern":"^sha256:[0-9a-f]{64}$"};const pattern11 = new RegExp("^sha256:[0-9a-f]{64}$", "u");function validate71(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate71.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate71.errors = vErrors;return errors === 0;}validate71.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate73(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate73.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(func2(data) > 128){const err0 = {instancePath,schemaPath:"#/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(func2(data) < 1){const err1 = {instancePath,schemaPath:"#/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(!pattern6.test(data)){const err2 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"},message:"must match pattern \""+"^[a-z0-9]+(?:[._-][a-z0-9]+)*$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}validate73.errors = vErrors;return errors === 0;}validate73.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate52(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/audit-entry.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate52.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.at === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "at"},message:"must have required property '"+"at"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.actor === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "actor"},message:"must have required property '"+"actor"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.operation === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "operation"},message:"must have required property '"+"operation"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.scope === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.subjects === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "subjects"},message:"must have required property '"+"subjects"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.outcome === undefined){const err7 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "outcome"},message:"must have required property '"+"outcome"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.provider === undefined){const err8 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "provider"},message:"must have required property '"+"provider"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data.digest === undefined){const err9 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}for(const key0 in data){if(!(func1.call(schema19.properties, key0))){const err10 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.schemaVersion !== undefined){if("replica.audit/v1" !== data.schemaVersion){const err11 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.audit/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data.id !== undefined){if(!(validate54(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate54.errors : vErrors.concat(validate54.errors);errors = vErrors.length;}}if(data.at !== undefined){if(!(validate56(data.at, {instancePath:instancePath+"/at",parentData:data,parentDataProperty:"at",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate56.errors : vErrors.concat(validate56.errors);errors = vErrors.length;}}if(data.actor !== undefined){if(!(validate58(data.actor, {instancePath:instancePath+"/actor",parentData:data,parentDataProperty:"actor",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate58.errors : vErrors.concat(validate58.errors);errors = vErrors.length;}}if(data.operation !== undefined){let data4 = data.operation;if(!((((((((((((((((((((((data4 === "grant.add") || (data4 === "grant.withdraw")) || (data4 === "collection.import")) || (data4 === "observation.append")) || (data4 === "evidence.redact")) || (data4 === "annotation.add")) || (data4 === "consolidation.run")) || (data4 === "memory.propose")) || (data4 === "memory.accept")) || (data4 === "memory.edit")) || (data4 === "memory.reinstate")) || (data4 === "memory.reject")) || (data4 === "memory.retire")) || (data4 === "memory.supersede")) || (data4 === "memory.recall")) || (data4 === "memory.delete")) || (data4 === "usage.report")) || (data4 === "usage.score")) || (data4 === "update.propose")) || (data4 === "update.decide")) || (data4 === "guidance.expire")) || (data4 === "export.create"))){const err12 = {instancePath:instancePath+"/operation",schemaPath:"#/properties/operation/enum",keyword:"enum",params:{allowedValues: schema19.properties.operation.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.scope !== undefined){if(!(validate62(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate62.errors : vErrors.concat(validate62.errors);errors = vErrors.length;}}if(data.purpose !== undefined){if(!(validate68(data.purpose, {instancePath:instancePath+"/purpose",parentData:data,parentDataProperty:"purpose",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate68.errors : vErrors.concat(validate68.errors);errors = vErrors.length;}}if(data.subjects !== undefined){let data7 = data.subjects;if(Array.isArray(data7)){if(data7.length > 10000){const err13 = {instancePath:instancePath+"/subjects",schemaPath:"#/properties/subjects/maxItems",keyword:"maxItems",params:{limit: 10000},message:"must NOT have more than 10000 items"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}const len0 = data7.length;for(let i0=0; i0 2000){const err21 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}if(func2(data13) < 1){const err22 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}else {const err23 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}if(data.provider !== undefined){let data14 = data.provider;if(data14 && typeof data14 == "object" && !Array.isArray(data14)){if(data14.id === undefined){const err24 = {instancePath:instancePath+"/provider",schemaPath:"#/properties/provider/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}if(data14.version === undefined){const err25 = {instancePath:instancePath+"/provider",schemaPath:"#/properties/provider/required",keyword:"required",params:{missingProperty: "version"},message:"must have required property '"+"version"+"'"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}for(const key2 in data14){if(!((key2 === "id") || (key2 === "version"))){const err26 = {instancePath:instancePath+"/provider",schemaPath:"#/properties/provider/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}if(data14.id !== undefined){if(!(validate73(data14.id, {instancePath:instancePath+"/provider/id",parentData:data14,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate73.errors : vErrors.concat(validate73.errors);errors = vErrors.length;}}if(data14.version !== undefined){let data16 = data14.version;if(typeof data16 === "string"){if(func2(data16) > 64){const err27 = {instancePath:instancePath+"/provider/version",schemaPath:"#/properties/provider/properties/version/maxLength",keyword:"maxLength",params:{limit: 64},message:"must NOT have more than 64 characters"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}if(func2(data16) < 1){const err28 = {instancePath:instancePath+"/provider/version",schemaPath:"#/properties/provider/properties/version/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}else {const err29 = {instancePath:instancePath+"/provider/version",schemaPath:"#/properties/provider/properties/version/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}}else {const err30 = {instancePath:instancePath+"/provider",schemaPath:"#/properties/provider/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}if(data.digest !== undefined){if(!(validate71(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate71.errors : vErrors.concat(validate71.errors);errors = vErrors.length;}}}else {const err31 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}validate52.errors = vErrors;return errors === 0;}validate52.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.collection = validate76;const schema30 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/collection.schema.json","title":"Replica evidence collection v1","description":"One import of source evidence for a time window. complete is true only when every page and reply continuation was present. A window that no complete collection covers is reported as incomplete, never as empty.","type":"object","additionalProperties":false,"required":["schemaVersion","id","source","scope","snapshotId","snapshotDigest","capturedAt","filters","complete","problems","counts","importedAt","importedBy","digest"],"properties":{"schemaVersion":{"const":"replica.collection/v1"},"id":{"$ref":"common.schema.json#/$defs/id"},"source":{"$ref":"common.schema.json#/$defs/source"},"scope":{"$ref":"common.schema.json#/$defs/scope"},"snapshotId":{"type":"string","pattern":"^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$"},"snapshotDigest":{"description":"The digest of the snapshot's normalized contents. A scope normally stores one collection per snapshotId; migration can retain multiple matching historical collections. Reimports must match every retained collection.","$ref":"common.schema.json#/$defs/digest"},"reviewerIdentity":{"description":"Once a Hub source opts into stable identities, login-only evidence from that source serves review only.","const":"stable-user-id"},"capturedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"filters":{"type":"object","additionalProperties":false,"required":["resolution","read","from","to"],"properties":{"resolution":{"enum":["all","unresolved","resolved"]},"read":{"enum":["all","unread","read"]},"from":{"anyOf":[{"$ref":"common.schema.json#/$defs/timestamp"},{"type":"null"}]},"to":{"anyOf":[{"$ref":"common.schema.json#/$defs/timestamp"},{"type":"null"}]}}},"complete":{"type":"boolean"},"problems":{"type":"array","maxItems":1000,"items":{"type":"string","minLength":1,"maxLength":2000}},"counts":{"type":"object","additionalProperties":false,"required":["threads","messages","episodes","events"],"properties":{"threads":{"$ref":"common.schema.json#/$defs/count"},"messages":{"$ref":"common.schema.json#/$defs/count"},"episodes":{"$ref":"common.schema.json#/$defs/count"},"events":{"$ref":"common.schema.json#/$defs/count"}}},"importedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"importedBy":{"$ref":"common.schema.json#/$defs/actor"},"digest":{"$ref":"common.schema.json#/$defs/digest"}}};function validate77(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate77.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate77.errors = vErrors;return errors === 0;}validate77.evaluated = {"dynamicProps":false,"dynamicItems":false};const schema32 = {"description":"Where an episode or a piece of evidence came from, pinned to the exact Build when there is one.","type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"$ref":"#/$defs/sourceKind"},"hubOrigin":{"$ref":"#/$defs/origin"},"repository":{"type":"string","pattern":"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},"repositoryId":{"$ref":"#/$defs/sourceIdentifier"},"prototypeId":{"$ref":"#/$defs/sourceIdentifier"},"prototypeName":{"type":"string","minLength":1,"maxLength":1024},"branch":{"type":"string","minLength":1,"maxLength":1024},"buildNumber":{"$ref":"#/$defs/positiveInteger"},"buildId":{"$ref":"#/$defs/positiveInteger"},"commitSha":{"$ref":"#/$defs/commitSha"},"threadId":{"$ref":"#/$defs/positiveInteger"},"commentId":{"$ref":"#/$defs/positiveInteger"},"sessionId":{"type":"string","minLength":1,"maxLength":200}}};const schema33 = {"description":"Where evidence came from, such as hub_review_comments.","type":"string","pattern":"^[a-z][a-z0-9_]{1,63}$"};const pattern14 = new RegExp("^[a-z][a-z0-9_]{1,63}$", "u");function validate80(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate80.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern14.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9_]{1,63}$"},message:"must match pattern \""+"^[a-z][a-z0-9_]{1,63}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate80.errors = vErrors;return errors === 0;}validate80.evaluated = {"dynamicProps":false,"dynamicItems":false};const schema34 = {"description":"An HTTP or HTTPS origin without credentials, path, query, or fragment.","type":"string","maxLength":2048,"pattern":"^https?://[A-Za-z0-9.-]+(?::[0-9]{1,5})?$"};const pattern15 = new RegExp("^https?://[A-Za-z0-9.-]+(?::[0-9]{1,5})?$", "u");function validate82(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate82.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(func2(data) > 2048){const err0 = {instancePath,schemaPath:"#/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!pattern15.test(data)){const err1 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^https?://[A-Za-z0-9.-]+(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^https?://[A-Za-z0-9.-]+(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate82.errors = vErrors;return errors === 0;}validate82.evaluated = {"dynamicProps":false,"dynamicItems":false};const schema35 = {"description":"A stable source-system identifier, either a legacy positive integer or a UUID.","oneOf":[{"$ref":"#/$defs/positiveInteger"},{"type":"string","pattern":"^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$"}]};const schema36 = {"type":"integer","minimum":1,"maximum":9007199254740991};function validate85(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate85.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!(((typeof data == "number") && (!(data % 1) && !isNaN(data))) && (isFinite(data)))){const err0 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if((typeof data == "number") && (isFinite(data))){if(data > 9007199254740991 || isNaN(data)){const err1 = {instancePath,schemaPath:"#/maximum",keyword:"maximum",params:{comparison: "<=", limit: 9007199254740991},message:"must be <= 9007199254740991"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data < 1 || isNaN(data)){const err2 = {instancePath,schemaPath:"#/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}validate85.errors = vErrors;return errors === 0;}validate85.evaluated = {"dynamicProps":false,"dynamicItems":false};const pattern17 = new RegExp("^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$", "u");function validate84(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate84.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}const _errs0 = errors;let valid0 = false;let passing0 = null;const _errs1 = errors;if(!(validate85(data, {instancePath,parentData,parentDataProperty,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}var _valid0 = _errs1 === errors;if(_valid0){valid0 = true;passing0 = 0;}const _errs2 = errors;if(typeof data === "string"){if(!pattern17.test(data)){const err0 = {instancePath,schemaPath:"#/oneOf/1/pattern",keyword:"pattern",params:{pattern: "^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$"},message:"must match pattern \""+"^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/oneOf/1/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}var _valid0 = _errs2 === errors;if(_valid0 && valid0){valid0 = false;passing0 = [passing0, 1];}else {if(_valid0){valid0 = true;passing0 = 1;}}if(!valid0){const err2 = {instancePath,schemaPath:"#/oneOf",keyword:"oneOf",params:{passingSchemas: passing0},message:"must match exactly one schema in oneOf"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}else {errors = _errs0;if(vErrors !== null){if(_errs0){vErrors.length = _errs0;}else {vErrors = null;}}}validate84.errors = vErrors;return errors === 0;}validate84.evaluated = {"dynamicProps":false,"dynamicItems":false};const schema37 = {"type":"string","pattern":"^[0-9a-f]{40}$"};const pattern18 = new RegExp("^[0-9a-f]{40}$", "u");function validate91(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate91.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern18.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9a-f]{40}$"},message:"must match pattern \""+"^[0-9a-f]{40}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate91.errors = vErrors;return errors === 0;}validate91.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate79(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate79.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(func1.call(schema32.properties, key0))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.kind !== undefined){if(!(validate80(data.kind, {instancePath:instancePath+"/kind",parentData:data,parentDataProperty:"kind",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate80.errors : vErrors.concat(validate80.errors);errors = vErrors.length;}}if(data.hubOrigin !== undefined){if(!(validate82(data.hubOrigin, {instancePath:instancePath+"/hubOrigin",parentData:data,parentDataProperty:"hubOrigin",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate82.errors : vErrors.concat(validate82.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data2 = data.repository;if(typeof data2 === "string"){if(!pattern10.test(data2)){const err2 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.repositoryId !== undefined){if(!(validate84(data.repositoryId, {instancePath:instancePath+"/repositoryId",parentData:data,parentDataProperty:"repositoryId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate84.errors : vErrors.concat(validate84.errors);errors = vErrors.length;}}if(data.prototypeId !== undefined){if(!(validate84(data.prototypeId, {instancePath:instancePath+"/prototypeId",parentData:data,parentDataProperty:"prototypeId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate84.errors : vErrors.concat(validate84.errors);errors = vErrors.length;}}if(data.prototypeName !== undefined){let data5 = data.prototypeName;if(typeof data5 === "string"){if(func2(data5) > 1024){const err4 = {instancePath:instancePath+"/prototypeName",schemaPath:"#/properties/prototypeName/maxLength",keyword:"maxLength",params:{limit: 1024},message:"must NOT have more than 1024 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data5) < 1){const err5 = {instancePath:instancePath+"/prototypeName",schemaPath:"#/properties/prototypeName/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/prototypeName",schemaPath:"#/properties/prototypeName/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.branch !== undefined){let data6 = data.branch;if(typeof data6 === "string"){if(func2(data6) > 1024){const err7 = {instancePath:instancePath+"/branch",schemaPath:"#/properties/branch/maxLength",keyword:"maxLength",params:{limit: 1024},message:"must NOT have more than 1024 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func2(data6) < 1){const err8 = {instancePath:instancePath+"/branch",schemaPath:"#/properties/branch/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/branch",schemaPath:"#/properties/branch/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.buildNumber !== undefined){if(!(validate85(data.buildNumber, {instancePath:instancePath+"/buildNumber",parentData:data,parentDataProperty:"buildNumber",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}if(data.buildId !== undefined){if(!(validate85(data.buildId, {instancePath:instancePath+"/buildId",parentData:data,parentDataProperty:"buildId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}if(data.commitSha !== undefined){if(!(validate91(data.commitSha, {instancePath:instancePath+"/commitSha",parentData:data,parentDataProperty:"commitSha",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate91.errors : vErrors.concat(validate91.errors);errors = vErrors.length;}}if(data.threadId !== undefined){if(!(validate85(data.threadId, {instancePath:instancePath+"/threadId",parentData:data,parentDataProperty:"threadId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}if(data.commentId !== undefined){if(!(validate85(data.commentId, {instancePath:instancePath+"/commentId",parentData:data,parentDataProperty:"commentId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}if(data.sessionId !== undefined){let data12 = data.sessionId;if(typeof data12 === "string"){if(func2(data12) > 200){const err10 = {instancePath:instancePath+"/sessionId",schemaPath:"#/properties/sessionId/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data12) < 1){const err11 = {instancePath:instancePath+"/sessionId",schemaPath:"#/properties/sessionId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/sessionId",schemaPath:"#/properties/sessionId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}validate79.errors = vErrors;return errors === 0;}validate79.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate96(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate96.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate96.errors = vErrors;return errors === 0;}validate96.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate101(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate101.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate101.errors = vErrors;return errors === 0;}validate101.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate103(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate103.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate103.errors = vErrors;return errors === 0;}validate103.evaluated = {"dynamicProps":false,"dynamicItems":false};const schema41 = {"type":"integer","minimum":0,"maximum":9007199254740991};function validate107(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate107.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!(((typeof data == "number") && (!(data % 1) && !isNaN(data))) && (isFinite(data)))){const err0 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if((typeof data == "number") && (isFinite(data))){if(data > 9007199254740991 || isNaN(data)){const err1 = {instancePath,schemaPath:"#/maximum",keyword:"maximum",params:{comparison: "<=", limit: 9007199254740991},message:"must be <= 9007199254740991"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data < 0 || isNaN(data)){const err2 = {instancePath,schemaPath:"#/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}validate107.errors = vErrors;return errors === 0;}validate107.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate113(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate113.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((((key0 === "kind") || (key0 === "id")) || (key0 === "role")) || (key0 === "login")) || (key0 === "model")) || (key0 === "asserted"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((data0 === "human") || (data0 === "agent")) || (data0 === "system")) || (data0 === "service"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema23.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.id !== undefined){let data1 = data.id;if(typeof data1 === "string"){if(func2(data1) > 300){const err4 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 3){const err5 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern5.test(data1)){const err6 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},message:"must match pattern \""+"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.role !== undefined){if(!(validate59(data.role, {instancePath:instancePath+"/role",parentData:data,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.login !== undefined){let data3 = data.login;if(typeof data3 === "string"){if(!pattern7.test(data3)){const err8 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},message:"must match pattern \""+"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"+"\""};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.model !== undefined){let data4 = data.model;if(typeof data4 === "string"){if(func2(data4) > 200){const err10 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data4) < 1){const err11 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.asserted !== undefined){if(typeof data.asserted !== "boolean"){const err13 = {instancePath:instancePath+"/asserted",schemaPath:"#/properties/asserted/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate113.errors = vErrors;return errors === 0;}validate113.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const pattern21 = new RegExp("^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$", "u");function validate76(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/collection.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate76.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.source === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "source"},message:"must have required property '"+"source"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.scope === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.snapshotId === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "snapshotId"},message:"must have required property '"+"snapshotId"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.snapshotDigest === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "snapshotDigest"},message:"must have required property '"+"snapshotDigest"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.capturedAt === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "capturedAt"},message:"must have required property '"+"capturedAt"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.filters === undefined){const err7 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "filters"},message:"must have required property '"+"filters"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.complete === undefined){const err8 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "complete"},message:"must have required property '"+"complete"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data.problems === undefined){const err9 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "problems"},message:"must have required property '"+"problems"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(data.counts === undefined){const err10 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "counts"},message:"must have required property '"+"counts"+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(data.importedAt === undefined){const err11 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "importedAt"},message:"must have required property '"+"importedAt"+"'"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(data.importedBy === undefined){const err12 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "importedBy"},message:"must have required property '"+"importedBy"+"'"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}if(data.digest === undefined){const err13 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}for(const key0 in data){if(!(func1.call(schema30.properties, key0))){const err14 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data.schemaVersion !== undefined){if("replica.collection/v1" !== data.schemaVersion){const err15 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.collection/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data.id !== undefined){if(!(validate77(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate77.errors : vErrors.concat(validate77.errors);errors = vErrors.length;}}if(data.source !== undefined){if(!(validate79(data.source, {instancePath:instancePath+"/source",parentData:data,parentDataProperty:"source",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate79.errors : vErrors.concat(validate79.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate96(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate96.errors : vErrors.concat(validate96.errors);errors = vErrors.length;}}if(data.snapshotId !== undefined){let data4 = data.snapshotId;if(typeof data4 === "string"){if(!pattern21.test(data4)){const err16 = {instancePath:instancePath+"/snapshotId",schemaPath:"#/properties/snapshotId/pattern",keyword:"pattern",params:{pattern: "^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$"},message:"must match pattern \""+"^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$"+"\""};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}else {const err17 = {instancePath:instancePath+"/snapshotId",schemaPath:"#/properties/snapshotId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}if(data.snapshotDigest !== undefined){if(!(validate101(data.snapshotDigest, {instancePath:instancePath+"/snapshotDigest",parentData:data,parentDataProperty:"snapshotDigest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate101.errors : vErrors.concat(validate101.errors);errors = vErrors.length;}}if(data.reviewerIdentity !== undefined){if("stable-user-id" !== data.reviewerIdentity){const err18 = {instancePath:instancePath+"/reviewerIdentity",schemaPath:"#/properties/reviewerIdentity/const",keyword:"const",params:{allowedValue: "stable-user-id"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data.capturedAt !== undefined){if(!(validate103(data.capturedAt, {instancePath:instancePath+"/capturedAt",parentData:data,parentDataProperty:"capturedAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate103.errors : vErrors.concat(validate103.errors);errors = vErrors.length;}}if(data.filters !== undefined){let data8 = data.filters;if(data8 && typeof data8 == "object" && !Array.isArray(data8)){if(data8.resolution === undefined){const err19 = {instancePath:instancePath+"/filters",schemaPath:"#/properties/filters/required",keyword:"required",params:{missingProperty: "resolution"},message:"must have required property '"+"resolution"+"'"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}if(data8.read === undefined){const err20 = {instancePath:instancePath+"/filters",schemaPath:"#/properties/filters/required",keyword:"required",params:{missingProperty: "read"},message:"must have required property '"+"read"+"'"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}if(data8.from === undefined){const err21 = {instancePath:instancePath+"/filters",schemaPath:"#/properties/filters/required",keyword:"required",params:{missingProperty: "from"},message:"must have required property '"+"from"+"'"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}if(data8.to === undefined){const err22 = {instancePath:instancePath+"/filters",schemaPath:"#/properties/filters/required",keyword:"required",params:{missingProperty: "to"},message:"must have required property '"+"to"+"'"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}for(const key1 in data8){if(!((((key1 === "resolution") || (key1 === "read")) || (key1 === "from")) || (key1 === "to"))){const err23 = {instancePath:instancePath+"/filters",schemaPath:"#/properties/filters/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}if(data8.resolution !== undefined){let data9 = data8.resolution;if(!(((data9 === "all") || (data9 === "unresolved")) || (data9 === "resolved"))){const err24 = {instancePath:instancePath+"/filters/resolution",schemaPath:"#/properties/filters/properties/resolution/enum",keyword:"enum",params:{allowedValues: schema30.properties.filters.properties.resolution.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}if(data8.read !== undefined){let data10 = data8.read;if(!(((data10 === "all") || (data10 === "unread")) || (data10 === "read"))){const err25 = {instancePath:instancePath+"/filters/read",schemaPath:"#/properties/filters/properties/read/enum",keyword:"enum",params:{allowedValues: schema30.properties.filters.properties.read.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}if(data8.from !== undefined){let data11 = data8.from;const _errs17 = errors;let valid2 = false;const _errs18 = errors;if(!(validate103(data11, {instancePath:instancePath+"/filters/from",parentData:data8,parentDataProperty:"from",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate103.errors : vErrors.concat(validate103.errors);errors = vErrors.length;}var _valid0 = _errs18 === errors;valid2 = valid2 || _valid0;const _errs19 = errors;if(data11 !== null){const err26 = {instancePath:instancePath+"/filters/from",schemaPath:"#/properties/filters/properties/from/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}var _valid0 = _errs19 === errors;valid2 = valid2 || _valid0;if(!valid2){const err27 = {instancePath:instancePath+"/filters/from",schemaPath:"#/properties/filters/properties/from/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}else {errors = _errs17;if(vErrors !== null){if(_errs17){vErrors.length = _errs17;}else {vErrors = null;}}}}if(data8.to !== undefined){let data12 = data8.to;const _errs22 = errors;let valid3 = false;const _errs23 = errors;if(!(validate103(data12, {instancePath:instancePath+"/filters/to",parentData:data8,parentDataProperty:"to",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate103.errors : vErrors.concat(validate103.errors);errors = vErrors.length;}var _valid1 = _errs23 === errors;valid3 = valid3 || _valid1;const _errs24 = errors;if(data12 !== null){const err28 = {instancePath:instancePath+"/filters/to",schemaPath:"#/properties/filters/properties/to/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}var _valid1 = _errs24 === errors;valid3 = valid3 || _valid1;if(!valid3){const err29 = {instancePath:instancePath+"/filters/to",schemaPath:"#/properties/filters/properties/to/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}else {errors = _errs22;if(vErrors !== null){if(_errs22){vErrors.length = _errs22;}else {vErrors = null;}}}}}else {const err30 = {instancePath:instancePath+"/filters",schemaPath:"#/properties/filters/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}if(data.complete !== undefined){if(typeof data.complete !== "boolean"){const err31 = {instancePath:instancePath+"/complete",schemaPath:"#/properties/complete/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}if(data.problems !== undefined){let data14 = data.problems;if(Array.isArray(data14)){if(data14.length > 1000){const err32 = {instancePath:instancePath+"/problems",schemaPath:"#/properties/problems/maxItems",keyword:"maxItems",params:{limit: 1000},message:"must NOT have more than 1000 items"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}const len0 = data14.length;for(let i0=0; i0 2000){const err33 = {instancePath:instancePath+"/problems/" + i0,schemaPath:"#/properties/problems/items/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}if(func2(data15) < 1){const err34 = {instancePath:instancePath+"/problems/" + i0,schemaPath:"#/properties/problems/items/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}else {const err35 = {instancePath:instancePath+"/problems/" + i0,schemaPath:"#/properties/problems/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}}else {const err36 = {instancePath:instancePath+"/problems",schemaPath:"#/properties/problems/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}}if(data.counts !== undefined){let data16 = data.counts;if(data16 && typeof data16 == "object" && !Array.isArray(data16)){if(data16.threads === undefined){const err37 = {instancePath:instancePath+"/counts",schemaPath:"#/properties/counts/required",keyword:"required",params:{missingProperty: "threads"},message:"must have required property '"+"threads"+"'"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}if(data16.messages === undefined){const err38 = {instancePath:instancePath+"/counts",schemaPath:"#/properties/counts/required",keyword:"required",params:{missingProperty: "messages"},message:"must have required property '"+"messages"+"'"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}if(data16.episodes === undefined){const err39 = {instancePath:instancePath+"/counts",schemaPath:"#/properties/counts/required",keyword:"required",params:{missingProperty: "episodes"},message:"must have required property '"+"episodes"+"'"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}if(data16.events === undefined){const err40 = {instancePath:instancePath+"/counts",schemaPath:"#/properties/counts/required",keyword:"required",params:{missingProperty: "events"},message:"must have required property '"+"events"+"'"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}for(const key2 in data16){if(!((((key2 === "threads") || (key2 === "messages")) || (key2 === "episodes")) || (key2 === "events"))){const err41 = {instancePath:instancePath+"/counts",schemaPath:"#/properties/counts/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}if(data16.threads !== undefined){if(!(validate107(data16.threads, {instancePath:instancePath+"/counts/threads",parentData:data16,parentDataProperty:"threads",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate107.errors : vErrors.concat(validate107.errors);errors = vErrors.length;}}if(data16.messages !== undefined){if(!(validate107(data16.messages, {instancePath:instancePath+"/counts/messages",parentData:data16,parentDataProperty:"messages",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate107.errors : vErrors.concat(validate107.errors);errors = vErrors.length;}}if(data16.episodes !== undefined){if(!(validate107(data16.episodes, {instancePath:instancePath+"/counts/episodes",parentData:data16,parentDataProperty:"episodes",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate107.errors : vErrors.concat(validate107.errors);errors = vErrors.length;}}if(data16.events !== undefined){if(!(validate107(data16.events, {instancePath:instancePath+"/counts/events",parentData:data16,parentDataProperty:"events",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate107.errors : vErrors.concat(validate107.errors);errors = vErrors.length;}}}else {const err42 = {instancePath:instancePath+"/counts",schemaPath:"#/properties/counts/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data.importedAt !== undefined){if(!(validate103(data.importedAt, {instancePath:instancePath+"/importedAt",parentData:data,parentDataProperty:"importedAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate103.errors : vErrors.concat(validate103.errors);errors = vErrors.length;}}if(data.importedBy !== undefined){if(!(validate113(data.importedBy, {instancePath:instancePath+"/importedBy",parentData:data,parentDataProperty:"importedBy",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate113.errors : vErrors.concat(validate113.errors);errors = vErrors.length;}}if(data.digest !== undefined){if(!(validate101(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate101.errors : vErrors.concat(validate101.errors);errors = vErrors.length;}}}else {const err43 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}validate76.errors = vErrors;return errors === 0;}validate76.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.consentGrant = validate117;const schema43 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/consent-grant.schema.json","title":"Replica consent grant v1","description":"Permission to use evidence from named sources, in one scope, for named purposes. A host decides at read time whether a record may be used for a purpose: some active grant in the record's scope must name the purpose and the record's source, and cover the evidence's original time. Reading feedback, publishing it, and training on it are separate purposes. A grant is never edited; a withdrawal record ends a purpose.","type":"object","additionalProperties":false,"required":["schemaVersion","id","scope","purposes","sources","grantedBy","grantedAt","basis","digest"],"properties":{"schemaVersion":{"const":"replica.consent-grant/v1"},"id":{"$ref":"common.schema.json#/$defs/id"},"scope":{"$ref":"common.schema.json#/$defs/scope"},"purposes":{"$ref":"common.schema.json#/$defs/purposes"},"sources":{"type":"array","minItems":1,"maxItems":20,"items":{"$ref":"common.schema.json#/$defs/sourceKind"}},"grantedBy":{"$ref":"common.schema.json#/$defs/humanActor"},"grantedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"expiresAt":{"$ref":"common.schema.json#/$defs/timestamp"},"evidenceFrom":{"description":"Covers only evidence whose original time is at or after this time. Omit to cover earlier evidence too.","$ref":"common.schema.json#/$defs/timestamp"},"evidenceUntil":{"description":"Covers only evidence whose original time is before this time. Omit for no upper bound.","$ref":"common.schema.json#/$defs/timestamp"},"basis":{"description":"Why this use is allowed, such as a team agreement or a study consent form.","type":"string","minLength":1,"maxLength":2000},"digest":{"$ref":"common.schema.json#/$defs/digest"}}};function validate118(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate118.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate118.errors = vErrors;return errors === 0;}validate118.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate120(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate120.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate120.errors = vErrors;return errors === 0;}validate120.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema46 = {"type":"array","minItems":1,"maxItems":6,"items":{"$ref":"#/$defs/purpose"}};function validate126(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate126.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!((((((data === "review") || (data === "instruction")) || (data === "evaluation")) || (data === "analytics")) || (data === "training")) || (data === "publication"))){const err0 = {instancePath,schemaPath:"#/enum",keyword:"enum",params:{allowedValues: schema27.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}validate126.errors = vErrors;return errors === 0;}validate126.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate125(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate125.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(Array.isArray(data)){if(data.length > 6){const err0 = {instancePath,schemaPath:"#/maxItems",keyword:"maxItems",params:{limit: 6},message:"must NOT have more than 6 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.length < 1){const err1 = {instancePath,schemaPath:"#/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}const len0 = data.length;for(let i0=0; i0 300){const err4 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 3){const err5 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern5.test(data1)){const err6 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},message:"must match pattern \""+"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.role !== undefined){if(!(validate59(data.role, {instancePath:instancePath+"/role",parentData:data,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.login !== undefined){let data3 = data.login;if(typeof data3 === "string"){if(!pattern7.test(data3)){const err8 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},message:"must match pattern \""+"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"+"\""};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.model !== undefined){let data4 = data.model;if(typeof data4 === "string"){if(func2(data4) > 200){const err10 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data4) < 1){const err11 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.asserted !== undefined){if(typeof data.asserted !== "boolean"){const err13 = {instancePath:instancePath+"/asserted",schemaPath:"#/properties/asserted/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate132.errors = vErrors;return errors === 0;}validate132.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate131(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate131.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!(validate132(data, {instancePath,parentData,parentDataProperty,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate132.errors : vErrors.concat(validate132.errors);errors = vErrors.length;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind !== undefined){if("human" !== data.kind){const err0 = {instancePath:instancePath+"/kind",schemaPath:"#/allOf/1/properties/kind/const",keyword:"const",params:{allowedValue: "human"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}}else {const err1 = {instancePath,schemaPath:"#/allOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate131.errors = vErrors;return errors === 0;}validate131.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate136(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate136.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate136.errors = vErrors;return errors === 0;}validate136.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate141(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate141.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate141.errors = vErrors;return errors === 0;}validate141.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate117(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/consent-grant.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate117.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.scope === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.purposes === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "purposes"},message:"must have required property '"+"purposes"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.sources === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "sources"},message:"must have required property '"+"sources"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.grantedBy === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "grantedBy"},message:"must have required property '"+"grantedBy"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.grantedAt === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "grantedAt"},message:"must have required property '"+"grantedAt"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.basis === undefined){const err7 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "basis"},message:"must have required property '"+"basis"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.digest === undefined){const err8 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}for(const key0 in data){if(!(func1.call(schema43.properties, key0))){const err9 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.schemaVersion !== undefined){if("replica.consent-grant/v1" !== data.schemaVersion){const err10 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.consent-grant/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.id !== undefined){if(!(validate118(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate118.errors : vErrors.concat(validate118.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate120(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate120.errors : vErrors.concat(validate120.errors);errors = vErrors.length;}}if(data.purposes !== undefined){if(!(validate125(data.purposes, {instancePath:instancePath+"/purposes",parentData:data,parentDataProperty:"purposes",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate125.errors : vErrors.concat(validate125.errors);errors = vErrors.length;}}if(data.sources !== undefined){let data4 = data.sources;if(Array.isArray(data4)){if(data4.length > 20){const err11 = {instancePath:instancePath+"/sources",schemaPath:"#/properties/sources/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(data4.length < 1){const err12 = {instancePath:instancePath+"/sources",schemaPath:"#/properties/sources/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}const len0 = data4.length;for(let i0=0; i0 2000){const err14 = {instancePath:instancePath+"/basis",schemaPath:"#/properties/basis/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}if(func2(data11) < 1){const err15 = {instancePath:instancePath+"/basis",schemaPath:"#/properties/basis/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}else {const err16 = {instancePath:instancePath+"/basis",schemaPath:"#/properties/basis/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}if(data.digest !== undefined){if(!(validate141(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate141.errors : vErrors.concat(validate141.errors);errors = vErrors.length;}}}else {const err17 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}validate117.errors = vErrors;return errors === 0;}validate117.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.deliveredLearning = validate143;const schema53 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/delivered-learning.schema.json","title":"Replica delivered learning v1","description":"One learning version a guidance record gave an agent, with the exact text the agent received.","type":"object","additionalProperties":false,"required":["schemaVersion","id","scope","guidanceId","memoryId","contentDigest","sourceScope","position","text","deliveredAt","digest"],"properties":{"schemaVersion":{"const":"replica.delivered-learning/v1"},"id":{"$ref":"common.schema.json#/$defs/id"},"scope":{"$ref":"common.schema.json#/$defs/scope"},"guidanceId":{"$ref":"common.schema.json#/$defs/id"},"memoryId":{"$ref":"common.schema.json#/$defs/id"},"contentDigest":{"$ref":"common.schema.json#/$defs/digest"},"sourceScope":{"$ref":"common.schema.json#/$defs/scope","description":"The repository the learning belongs to. A shared learning names its source repository."},"position":{"$ref":"common.schema.json#/$defs/positiveInteger"},"text":{"type":"string","minLength":1,"maxLength":20000},"deliveredAt":{"$ref":"common.schema.json#/$defs/timestamp"},"digest":{"$ref":"common.schema.json#/$defs/digest"}}};function validate144(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate144.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate144.errors = vErrors;return errors === 0;}validate144.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate146(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate146.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate146.errors = vErrors;return errors === 0;}validate146.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate153(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate153.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate153.errors = vErrors;return errors === 0;}validate153.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate156(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate156.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!(((typeof data == "number") && (!(data % 1) && !isNaN(data))) && (isFinite(data)))){const err0 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if((typeof data == "number") && (isFinite(data))){if(data > 9007199254740991 || isNaN(data)){const err1 = {instancePath,schemaPath:"#/maximum",keyword:"maximum",params:{comparison: "<=", limit: 9007199254740991},message:"must be <= 9007199254740991"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data < 1 || isNaN(data)){const err2 = {instancePath,schemaPath:"#/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}validate156.errors = vErrors;return errors === 0;}validate156.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate158(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate158.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate158.errors = vErrors;return errors === 0;}validate158.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate143(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/delivered-learning.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate143.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.scope === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.guidanceId === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "guidanceId"},message:"must have required property '"+"guidanceId"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.memoryId === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "memoryId"},message:"must have required property '"+"memoryId"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.contentDigest === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "contentDigest"},message:"must have required property '"+"contentDigest"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.sourceScope === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "sourceScope"},message:"must have required property '"+"sourceScope"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.position === undefined){const err7 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "position"},message:"must have required property '"+"position"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.text === undefined){const err8 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "text"},message:"must have required property '"+"text"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data.deliveredAt === undefined){const err9 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "deliveredAt"},message:"must have required property '"+"deliveredAt"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(data.digest === undefined){const err10 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}for(const key0 in data){if(!(func1.call(schema53.properties, key0))){const err11 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data.schemaVersion !== undefined){if("replica.delivered-learning/v1" !== data.schemaVersion){const err12 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.delivered-learning/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.id !== undefined){if(!(validate144(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate144.errors : vErrors.concat(validate144.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate146(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate146.errors : vErrors.concat(validate146.errors);errors = vErrors.length;}}if(data.guidanceId !== undefined){if(!(validate144(data.guidanceId, {instancePath:instancePath+"/guidanceId",parentData:data,parentDataProperty:"guidanceId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate144.errors : vErrors.concat(validate144.errors);errors = vErrors.length;}}if(data.memoryId !== undefined){if(!(validate144(data.memoryId, {instancePath:instancePath+"/memoryId",parentData:data,parentDataProperty:"memoryId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate144.errors : vErrors.concat(validate144.errors);errors = vErrors.length;}}if(data.contentDigest !== undefined){if(!(validate153(data.contentDigest, {instancePath:instancePath+"/contentDigest",parentData:data,parentDataProperty:"contentDigest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate153.errors : vErrors.concat(validate153.errors);errors = vErrors.length;}}if(data.sourceScope !== undefined){if(!(validate146(data.sourceScope, {instancePath:instancePath+"/sourceScope",parentData:data,parentDataProperty:"sourceScope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate146.errors : vErrors.concat(validate146.errors);errors = vErrors.length;}}if(data.position !== undefined){if(!(validate156(data.position, {instancePath:instancePath+"/position",parentData:data,parentDataProperty:"position",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate156.errors : vErrors.concat(validate156.errors);errors = vErrors.length;}}if(data.text !== undefined){let data8 = data.text;if(typeof data8 === "string"){if(func2(data8) > 20000){const err13 = {instancePath:instancePath+"/text",schemaPath:"#/properties/text/maxLength",keyword:"maxLength",params:{limit: 20000},message:"must NOT have more than 20000 characters"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}if(func2(data8) < 1){const err14 = {instancePath:instancePath+"/text",schemaPath:"#/properties/text/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/text",schemaPath:"#/properties/text/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data.deliveredAt !== undefined){if(!(validate158(data.deliveredAt, {instancePath:instancePath+"/deliveredAt",parentData:data,parentDataProperty:"deliveredAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate158.errors : vErrors.concat(validate158.errors);errors = vErrors.length;}}if(data.digest !== undefined){if(!(validate153(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate153.errors : vErrors.concat(validate153.errors);errors = vErrors.length;}}}else {const err16 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}validate143.errors = vErrors;return errors === 0;}validate143.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.episode = validate161;const schema59 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/episode.schema.json","title":"Replica episode v1","description":"The unit of learning evidence: one review thread, chat session, scenario run, or similar. The digest covers the header, every field except digest and timeline, so appending events never changes it. Events carry their own digests. timeline appears only in exports.","type":"object","additionalProperties":false,"required":["schemaVersion","id","scope","source","actors","grants","provenance","startedAt","digest"],"properties":{"schemaVersion":{"const":"replica.episode/v1"},"id":{"$ref":"common.schema.json#/$defs/id"},"scope":{"$ref":"common.schema.json#/$defs/scope"},"source":{"$ref":"common.schema.json#/$defs/source"},"task":{"type":"object","additionalProperties":false,"properties":{"prompt":{"type":"string","minLength":1,"maxLength":10000},"goal":{"type":"string","minLength":1,"maxLength":2000},"role":{"$ref":"common.schema.json#/$defs/slug"},"taskId":{"type":"string","minLength":1,"maxLength":200}}},"actors":{"type":"array","maxItems":500,"items":{"$ref":"common.schema.json#/$defs/actor"}},"versions":{"description":"What produced the experience under review, so outcomes can be tied to versions.","type":"object","additionalProperties":false,"properties":{"model":{"type":"string","minLength":1,"maxLength":200},"harness":{"type":"string","minLength":1,"maxLength":200},"designSystem":{"type":"string","minLength":1,"maxLength":200},"brandPack":{"type":"string","minLength":1,"maxLength":200},"memorySnapshot":{"$ref":"common.schema.json#/$defs/digest"}}},"grants":{"description":"The consent grants this episode was collected under, kept for provenance. Use for a purpose is decided at read time from the grants then active for the episode's scope and source.","type":"array","minItems":1,"maxItems":20,"items":{"$ref":"common.schema.json#/$defs/id"}},"contentTrust":{"type":"object","additionalProperties":false,"required":["untrusted","treatAs"],"properties":{"untrusted":{"type":"boolean"},"treatAs":{"const":"data"},"source":{"$ref":"common.schema.json#/$defs/sourceKind"}}},"provenance":{"$ref":"common.schema.json#/$defs/provenance"},"startedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"endedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"outcome":{"type":"object","additionalProperties":false,"required":["status"],"properties":{"status":{"enum":["success","failure","partial","unknown"]},"summary":{"type":"string","minLength":1,"maxLength":2000}}},"timeline":{"type":"array","maxItems":100000,"items":{"$ref":"event.schema.json"}},"digest":{"$ref":"common.schema.json#/$defs/digest"}}};function validate162(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate162.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate162.errors = vErrors;return errors === 0;}validate162.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate164(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate164.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate164.errors = vErrors;return errors === 0;}validate164.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate169(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate169.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(func1.call(schema32.properties, key0))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.kind !== undefined){if(!(validate80(data.kind, {instancePath:instancePath+"/kind",parentData:data,parentDataProperty:"kind",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate80.errors : vErrors.concat(validate80.errors);errors = vErrors.length;}}if(data.hubOrigin !== undefined){if(!(validate82(data.hubOrigin, {instancePath:instancePath+"/hubOrigin",parentData:data,parentDataProperty:"hubOrigin",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate82.errors : vErrors.concat(validate82.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data2 = data.repository;if(typeof data2 === "string"){if(!pattern10.test(data2)){const err2 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.repositoryId !== undefined){if(!(validate84(data.repositoryId, {instancePath:instancePath+"/repositoryId",parentData:data,parentDataProperty:"repositoryId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate84.errors : vErrors.concat(validate84.errors);errors = vErrors.length;}}if(data.prototypeId !== undefined){if(!(validate84(data.prototypeId, {instancePath:instancePath+"/prototypeId",parentData:data,parentDataProperty:"prototypeId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate84.errors : vErrors.concat(validate84.errors);errors = vErrors.length;}}if(data.prototypeName !== undefined){let data5 = data.prototypeName;if(typeof data5 === "string"){if(func2(data5) > 1024){const err4 = {instancePath:instancePath+"/prototypeName",schemaPath:"#/properties/prototypeName/maxLength",keyword:"maxLength",params:{limit: 1024},message:"must NOT have more than 1024 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data5) < 1){const err5 = {instancePath:instancePath+"/prototypeName",schemaPath:"#/properties/prototypeName/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/prototypeName",schemaPath:"#/properties/prototypeName/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.branch !== undefined){let data6 = data.branch;if(typeof data6 === "string"){if(func2(data6) > 1024){const err7 = {instancePath:instancePath+"/branch",schemaPath:"#/properties/branch/maxLength",keyword:"maxLength",params:{limit: 1024},message:"must NOT have more than 1024 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func2(data6) < 1){const err8 = {instancePath:instancePath+"/branch",schemaPath:"#/properties/branch/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/branch",schemaPath:"#/properties/branch/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.buildNumber !== undefined){if(!(validate85(data.buildNumber, {instancePath:instancePath+"/buildNumber",parentData:data,parentDataProperty:"buildNumber",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}if(data.buildId !== undefined){if(!(validate85(data.buildId, {instancePath:instancePath+"/buildId",parentData:data,parentDataProperty:"buildId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}if(data.commitSha !== undefined){if(!(validate91(data.commitSha, {instancePath:instancePath+"/commitSha",parentData:data,parentDataProperty:"commitSha",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate91.errors : vErrors.concat(validate91.errors);errors = vErrors.length;}}if(data.threadId !== undefined){if(!(validate85(data.threadId, {instancePath:instancePath+"/threadId",parentData:data,parentDataProperty:"threadId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}if(data.commentId !== undefined){if(!(validate85(data.commentId, {instancePath:instancePath+"/commentId",parentData:data,parentDataProperty:"commentId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}if(data.sessionId !== undefined){let data12 = data.sessionId;if(typeof data12 === "string"){if(func2(data12) > 200){const err10 = {instancePath:instancePath+"/sessionId",schemaPath:"#/properties/sessionId/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data12) < 1){const err11 = {instancePath:instancePath+"/sessionId",schemaPath:"#/properties/sessionId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/sessionId",schemaPath:"#/properties/sessionId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}validate169.errors = vErrors;return errors === 0;}validate169.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate180(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate180.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(func2(data) > 128){const err0 = {instancePath,schemaPath:"#/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(func2(data) < 1){const err1 = {instancePath,schemaPath:"#/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(!pattern6.test(data)){const err2 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"},message:"must match pattern \""+"^[a-z0-9]+(?:[._-][a-z0-9]+)*$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}validate180.errors = vErrors;return errors === 0;}validate180.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate182(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate182.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((((key0 === "kind") || (key0 === "id")) || (key0 === "role")) || (key0 === "login")) || (key0 === "model")) || (key0 === "asserted"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((data0 === "human") || (data0 === "agent")) || (data0 === "system")) || (data0 === "service"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema23.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.id !== undefined){let data1 = data.id;if(typeof data1 === "string"){if(func2(data1) > 300){const err4 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 3){const err5 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern5.test(data1)){const err6 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},message:"must match pattern \""+"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.role !== undefined){if(!(validate59(data.role, {instancePath:instancePath+"/role",parentData:data,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.login !== undefined){let data3 = data.login;if(typeof data3 === "string"){if(!pattern7.test(data3)){const err8 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},message:"must match pattern \""+"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"+"\""};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.model !== undefined){let data4 = data.model;if(typeof data4 === "string"){if(func2(data4) > 200){const err10 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data4) < 1){const err11 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.asserted !== undefined){if(typeof data.asserted !== "boolean"){const err13 = {instancePath:instancePath+"/asserted",schemaPath:"#/properties/asserted/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate182.errors = vErrors;return errors === 0;}validate182.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate185(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate185.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate185.errors = vErrors;return errors === 0;}validate185.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate188(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate188.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern14.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9_]{1,63}$"},message:"must match pattern \""+"^[a-z][a-z0-9_]{1,63}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate188.errors = vErrors;return errors === 0;}validate188.evaluated = {"dynamicProps":false,"dynamicItems":false};const schema67 = {"description":"Which code made a record, how, when, for whom, and from which inputs.","type":"object","additionalProperties":false,"required":["producer","method","createdAt","createdBy"],"properties":{"producer":{"$ref":"#/$defs/producer"},"method":{"type":"string","maxLength":128,"pattern":"^[a-z]+:[a-z0-9_.-]+$"},"createdAt":{"$ref":"#/$defs/timestamp"},"createdBy":{"$ref":"#/$defs/actor"},"inputs":{"type":"array","maxItems":1000,"items":{"$ref":"#/$defs/digest"}}}};const schema68 = {"type":"object","additionalProperties":false,"required":["name","version"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"version":{"type":"string","minLength":1,"maxLength":64}}};function validate191(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate191.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.name === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "name"},message:"must have required property '"+"name"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.version === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "version"},message:"must have required property '"+"version"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((key0 === "name") || (key0 === "version"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.name !== undefined){let data0 = data.name;if(typeof data0 === "string"){if(func2(data0) > 200){const err3 = {instancePath:instancePath+"/name",schemaPath:"#/properties/name/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(func2(data0) < 1){const err4 = {instancePath:instancePath+"/name",schemaPath:"#/properties/name/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}else {const err5 = {instancePath:instancePath+"/name",schemaPath:"#/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.version !== undefined){let data1 = data.version;if(typeof data1 === "string"){if(func2(data1) > 64){const err6 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/maxLength",keyword:"maxLength",params:{limit: 64},message:"must NOT have more than 64 characters"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(func2(data1) < 1){const err7 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}else {const err8 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}}else {const err9 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}validate191.errors = vErrors;return errors === 0;}validate191.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate193(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate193.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate193.errors = vErrors;return errors === 0;}validate193.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate196(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate196.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate196.errors = vErrors;return errors === 0;}validate196.evaluated = {"dynamicProps":false,"dynamicItems":false};const pattern48 = new RegExp("^[a-z]+:[a-z0-9_.-]+$", "u");function validate190(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate190.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.producer === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "producer"},message:"must have required property '"+"producer"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.method === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "method"},message:"must have required property '"+"method"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.createdAt === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "createdAt"},message:"must have required property '"+"createdAt"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.createdBy === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "createdBy"},message:"must have required property '"+"createdBy"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data){if(!(((((key0 === "producer") || (key0 === "method")) || (key0 === "createdAt")) || (key0 === "createdBy")) || (key0 === "inputs"))){const err4 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.producer !== undefined){if(!(validate191(data.producer, {instancePath:instancePath+"/producer",parentData:data,parentDataProperty:"producer",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate191.errors : vErrors.concat(validate191.errors);errors = vErrors.length;}}if(data.method !== undefined){let data1 = data.method;if(typeof data1 === "string"){if(func2(data1) > 128){const err5 = {instancePath:instancePath+"/method",schemaPath:"#/properties/method/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern48.test(data1)){const err6 = {instancePath:instancePath+"/method",schemaPath:"#/properties/method/pattern",keyword:"pattern",params:{pattern: "^[a-z]+:[a-z0-9_.-]+$"},message:"must match pattern \""+"^[a-z]+:[a-z0-9_.-]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/method",schemaPath:"#/properties/method/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.createdAt !== undefined){if(!(validate193(data.createdAt, {instancePath:instancePath+"/createdAt",parentData:data,parentDataProperty:"createdAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate193.errors : vErrors.concat(validate193.errors);errors = vErrors.length;}}if(data.createdBy !== undefined){if(!(validate132(data.createdBy, {instancePath:instancePath+"/createdBy",parentData:data,parentDataProperty:"createdBy",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate132.errors : vErrors.concat(validate132.errors);errors = vErrors.length;}}if(data.inputs !== undefined){let data4 = data.inputs;if(Array.isArray(data4)){if(data4.length > 1000){const err8 = {instancePath:instancePath+"/inputs",schemaPath:"#/properties/inputs/maxItems",keyword:"maxItems",params:{limit: 1000},message:"must NOT have more than 1000 items"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}const len0 = data4.length;for(let i0=0; i0 9007199254740991 || isNaN(data)){const err1 = {instancePath,schemaPath:"#/maximum",keyword:"maximum",params:{comparison: "<=", limit: 9007199254740991},message:"must be <= 9007199254740991"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data < 1 || isNaN(data)){const err2 = {instancePath,schemaPath:"#/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}validate204.errors = vErrors;return errors === 0;}validate204.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate207(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate207.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate207.errors = vErrors;return errors === 0;}validate207.evaluated = {"dynamicProps":false,"dynamicItems":false};const schema76 = {"description":"The compact saved target of a root comment: route and accessible element details.","type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"enum":["element","area"]},"route":{"type":"object","additionalProperties":false,"properties":{"pathname":{"type":"string","maxLength":2048},"search":{"type":"string","maxLength":2048},"hash":{"type":"string","maxLength":1024}}},"accessibleName":{"type":"string","maxLength":1000},"tagName":{"type":"string","maxLength":64},"selectedText":{"type":"string","maxLength":2000},"elements":{"type":"array","maxItems":8,"items":{"type":"object","additionalProperties":false,"properties":{"accessibleName":{"type":"string","maxLength":1000},"tagName":{"type":"string","maxLength":64},"role":{"type":"string","maxLength":64},"textExcerpt":{"type":"string","maxLength":500}}}}}};function validate212(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate212.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!((((((key0 === "kind") || (key0 === "route")) || (key0 === "accessibleName")) || (key0 === "tagName")) || (key0 === "selectedText")) || (key0 === "elements"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((data0 === "element") || (data0 === "area"))){const err2 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema76.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.route !== undefined){let data1 = data.route;if(data1 && typeof data1 == "object" && !Array.isArray(data1)){for(const key1 in data1){if(!(((key1 === "pathname") || (key1 === "search")) || (key1 === "hash"))){const err3 = {instancePath:instancePath+"/route",schemaPath:"#/properties/route/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data1.pathname !== undefined){let data2 = data1.pathname;if(typeof data2 === "string"){if(func2(data2) > 2048){const err4 = {instancePath:instancePath+"/route/pathname",schemaPath:"#/properties/route/properties/pathname/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}else {const err5 = {instancePath:instancePath+"/route/pathname",schemaPath:"#/properties/route/properties/pathname/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data1.search !== undefined){let data3 = data1.search;if(typeof data3 === "string"){if(func2(data3) > 2048){const err6 = {instancePath:instancePath+"/route/search",schemaPath:"#/properties/route/properties/search/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/route/search",schemaPath:"#/properties/route/properties/search/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data1.hash !== undefined){let data4 = data1.hash;if(typeof data4 === "string"){if(func2(data4) > 1024){const err8 = {instancePath:instancePath+"/route/hash",schemaPath:"#/properties/route/properties/hash/maxLength",keyword:"maxLength",params:{limit: 1024},message:"must NOT have more than 1024 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/route/hash",schemaPath:"#/properties/route/properties/hash/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}}else {const err10 = {instancePath:instancePath+"/route",schemaPath:"#/properties/route/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.accessibleName !== undefined){let data5 = data.accessibleName;if(typeof data5 === "string"){if(func2(data5) > 1000){const err11 = {instancePath:instancePath+"/accessibleName",schemaPath:"#/properties/accessibleName/maxLength",keyword:"maxLength",params:{limit: 1000},message:"must NOT have more than 1000 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/accessibleName",schemaPath:"#/properties/accessibleName/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.tagName !== undefined){let data6 = data.tagName;if(typeof data6 === "string"){if(func2(data6) > 64){const err13 = {instancePath:instancePath+"/tagName",schemaPath:"#/properties/tagName/maxLength",keyword:"maxLength",params:{limit: 64},message:"must NOT have more than 64 characters"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}else {const err14 = {instancePath:instancePath+"/tagName",schemaPath:"#/properties/tagName/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data.selectedText !== undefined){let data7 = data.selectedText;if(typeof data7 === "string"){if(func2(data7) > 2000){const err15 = {instancePath:instancePath+"/selectedText",schemaPath:"#/properties/selectedText/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}else {const err16 = {instancePath:instancePath+"/selectedText",schemaPath:"#/properties/selectedText/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}if(data.elements !== undefined){let data8 = data.elements;if(Array.isArray(data8)){if(data8.length > 8){const err17 = {instancePath:instancePath+"/elements",schemaPath:"#/properties/elements/maxItems",keyword:"maxItems",params:{limit: 8},message:"must NOT have more than 8 items"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}const len0 = data8.length;for(let i0=0; i0 1000){const err19 = {instancePath:instancePath+"/elements/" + i0+"/accessibleName",schemaPath:"#/properties/elements/items/properties/accessibleName/maxLength",keyword:"maxLength",params:{limit: 1000},message:"must NOT have more than 1000 characters"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}else {const err20 = {instancePath:instancePath+"/elements/" + i0+"/accessibleName",schemaPath:"#/properties/elements/items/properties/accessibleName/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}if(data9.tagName !== undefined){let data11 = data9.tagName;if(typeof data11 === "string"){if(func2(data11) > 64){const err21 = {instancePath:instancePath+"/elements/" + i0+"/tagName",schemaPath:"#/properties/elements/items/properties/tagName/maxLength",keyword:"maxLength",params:{limit: 64},message:"must NOT have more than 64 characters"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}else {const err22 = {instancePath:instancePath+"/elements/" + i0+"/tagName",schemaPath:"#/properties/elements/items/properties/tagName/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}if(data9.role !== undefined){let data12 = data9.role;if(typeof data12 === "string"){if(func2(data12) > 64){const err23 = {instancePath:instancePath+"/elements/" + i0+"/role",schemaPath:"#/properties/elements/items/properties/role/maxLength",keyword:"maxLength",params:{limit: 64},message:"must NOT have more than 64 characters"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}else {const err24 = {instancePath:instancePath+"/elements/" + i0+"/role",schemaPath:"#/properties/elements/items/properties/role/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}if(data9.textExcerpt !== undefined){let data13 = data9.textExcerpt;if(typeof data13 === "string"){if(func2(data13) > 500){const err25 = {instancePath:instancePath+"/elements/" + i0+"/textExcerpt",schemaPath:"#/properties/elements/items/properties/textExcerpt/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}else {const err26 = {instancePath:instancePath+"/elements/" + i0+"/textExcerpt",schemaPath:"#/properties/elements/items/properties/textExcerpt/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}}else {const err27 = {instancePath:instancePath+"/elements/" + i0,schemaPath:"#/properties/elements/items/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}}else {const err28 = {instancePath:instancePath+"/elements",schemaPath:"#/properties/elements/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}}else {const err29 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}validate212.errors = vErrors;return errors === 0;}validate212.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate203(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate203.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}const _errs2 = errors;let valid1 = true;const _errs3 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.role !== undefined){if("root" !== data.role){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}}var _valid0 = _errs3 === errors;errors = _errs2;if(vErrors !== null){if(_errs2){vErrors.length = _errs2;}else {vErrors = null;}}let ifClause0;if(_valid0){const _errs5 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.buildNumber === undefined){const err1 = {instancePath,schemaPath:"#/allOf/0/then/required",keyword:"required",params:{missingProperty: "buildNumber"},message:"must have required property '"+"buildNumber"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}var _valid0 = _errs5 === errors;valid1 = _valid0;ifClause0 = "then";}else {const _errs6 = errors;const _errs7 = errors;const _errs8 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((data.buildNumber === undefined) && (missing0 = "buildNumber")){const err2 = {};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}var valid3 = _errs8 === errors;if(valid3){const err3 = {instancePath,schemaPath:"#/allOf/0/else/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}else {errors = _errs7;if(vErrors !== null){if(_errs7){vErrors.length = _errs7;}else {vErrors = null;}}}var _valid0 = _errs6 === errors;valid1 = _valid0;ifClause0 = "else";}if(!valid1){const err4 = {instancePath,schemaPath:"#/allOf/0/if",keyword:"if",params:{failingKeyword: ifClause0},message:"must match \""+ifClause0+"\" schema"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}const _errs10 = errors;let valid4 = true;const _errs11 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.deletedAt !== undefined){if(typeof data.deletedAt !== "string"){const err5 = {};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}}var _valid1 = _errs11 === errors;errors = _errs10;if(vErrors !== null){if(_errs10){vErrors.length = _errs10;}else {vErrors = null;}}let ifClause1;if(_valid1){const _errs14 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.body !== undefined){if(data.body !== null){const err6 = {instancePath:instancePath+"/body",schemaPath:"#/allOf/1/then/properties/body/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}var _valid1 = _errs14 === errors;valid4 = _valid1;if(valid4){var props0 = {};props0.body = true;props0.deletedAt = true;}ifClause1 = "then";}else {const _errs17 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.body !== undefined){if(typeof data.body !== "string"){const err7 = {instancePath:instancePath+"/body",schemaPath:"#/allOf/1/else/properties/body/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}var _valid1 = _errs17 === errors;valid4 = _valid1;if(valid4){if(props0 !== true){props0 = props0 || {};props0.body = true;}}ifClause1 = "else";}if(!valid4){const err8 = {instancePath,schemaPath:"#/allOf/1/if",keyword:"if",params:{failingKeyword: ifClause1},message:"must match \""+ifClause1+"\" schema"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(props0 !== true){props0 = props0 || {};props0.role = true;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.source === undefined){const err9 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "source"},message:"must have required property '"+"source"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(data.commentId === undefined){const err10 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "commentId"},message:"must have required property '"+"commentId"+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(data.threadId === undefined){const err11 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "threadId"},message:"must have required property '"+"threadId"+"'"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(data.role === undefined){const err12 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "role"},message:"must have required property '"+"role"+"'"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}if(data.body === undefined){const err13 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "body"},message:"must have required property '"+"body"+"'"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}if(data.createdAt === undefined){const err14 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "createdAt"},message:"must have required property '"+"createdAt"+"'"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}if(data.editedAt === undefined){const err15 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "editedAt"},message:"must have required property '"+"editedAt"+"'"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}if(data.deletedAt === undefined){const err16 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "deletedAt"},message:"must have required property '"+"deletedAt"+"'"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}for(const key0 in data){if(!(func1.call(schema73.properties, key0))){const err17 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}if(data.source !== undefined){if("hub_review_comment" !== data.source){const err18 = {instancePath:instancePath+"/source",schemaPath:"#/properties/source/const",keyword:"const",params:{allowedValue: "hub_review_comment"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data.commentId !== undefined){if(!(validate204(data.commentId, {instancePath:instancePath+"/commentId",parentData:data,parentDataProperty:"commentId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate204.errors : vErrors.concat(validate204.errors);errors = vErrors.length;}}if(data.threadId !== undefined){if(!(validate204(data.threadId, {instancePath:instancePath+"/threadId",parentData:data,parentDataProperty:"threadId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate204.errors : vErrors.concat(validate204.errors);errors = vErrors.length;}}if(data.role !== undefined){let data7 = data.role;if(!((data7 === "root") || (data7 === "reply"))){const err19 = {instancePath:instancePath+"/role",schemaPath:"#/properties/role/enum",keyword:"enum",params:{allowedValues: schema73.properties.role.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}if(data.body !== undefined){let data8 = data.body;const _errs26 = errors;let valid9 = false;const _errs27 = errors;if(typeof data8 === "string"){if(func2(data8) > 10000){const err20 = {instancePath:instancePath+"/body",schemaPath:"#/properties/body/anyOf/0/maxLength",keyword:"maxLength",params:{limit: 10000},message:"must NOT have more than 10000 characters"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}if(func2(data8) < 1){const err21 = {instancePath:instancePath+"/body",schemaPath:"#/properties/body/anyOf/0/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}else {const err22 = {instancePath:instancePath+"/body",schemaPath:"#/properties/body/anyOf/0/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}var _valid2 = _errs27 === errors;valid9 = valid9 || _valid2;const _errs29 = errors;if(data8 !== null){const err23 = {instancePath:instancePath+"/body",schemaPath:"#/properties/body/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}var _valid2 = _errs29 === errors;valid9 = valid9 || _valid2;if(!valid9){const err24 = {instancePath:instancePath+"/body",schemaPath:"#/properties/body/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}else {errors = _errs26;if(vErrors !== null){if(_errs26){vErrors.length = _errs26;}else {vErrors = null;}}}}if(data.createdAt !== undefined){if(!(validate207(data.createdAt, {instancePath:instancePath+"/createdAt",parentData:data,parentDataProperty:"createdAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate207.errors : vErrors.concat(validate207.errors);errors = vErrors.length;}}if(data.editedAt !== undefined){let data10 = data.editedAt;const _errs33 = errors;let valid10 = false;const _errs34 = errors;if(!(validate207(data10, {instancePath:instancePath+"/editedAt",parentData:data,parentDataProperty:"editedAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate207.errors : vErrors.concat(validate207.errors);errors = vErrors.length;}var _valid3 = _errs34 === errors;valid10 = valid10 || _valid3;const _errs35 = errors;if(data10 !== null){const err25 = {instancePath:instancePath+"/editedAt",schemaPath:"#/properties/editedAt/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}var _valid3 = _errs35 === errors;valid10 = valid10 || _valid3;if(!valid10){const err26 = {instancePath:instancePath+"/editedAt",schemaPath:"#/properties/editedAt/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}else {errors = _errs33;if(vErrors !== null){if(_errs33){vErrors.length = _errs33;}else {vErrors = null;}}}}if(data.deletedAt !== undefined){let data11 = data.deletedAt;const _errs38 = errors;let valid11 = false;const _errs39 = errors;if(!(validate207(data11, {instancePath:instancePath+"/deletedAt",parentData:data,parentDataProperty:"deletedAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate207.errors : vErrors.concat(validate207.errors);errors = vErrors.length;}var _valid4 = _errs39 === errors;valid11 = valid11 || _valid4;const _errs40 = errors;if(data11 !== null){const err27 = {instancePath:instancePath+"/deletedAt",schemaPath:"#/properties/deletedAt/anyOf/1/type",keyword:"type",params:{type: "null"},message:"must be null"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}var _valid4 = _errs40 === errors;valid11 = valid11 || _valid4;if(!valid11){const err28 = {instancePath:instancePath+"/deletedAt",schemaPath:"#/properties/deletedAt/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}else {errors = _errs38;if(vErrors !== null){if(_errs38){vErrors.length = _errs38;}else {vErrors = null;}}}}if(data.buildNumber !== undefined){if(!(validate204(data.buildNumber, {instancePath:instancePath+"/buildNumber",parentData:data,parentDataProperty:"buildNumber",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate204.errors : vErrors.concat(validate204.errors);errors = vErrors.length;}}if(data.context !== undefined){if(!(validate212(data.context, {instancePath:instancePath+"/context",parentData:data,parentDataProperty:"context",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate212.errors : vErrors.concat(validate212.errors);errors = vErrors.length;}}}else {const err29 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}validate203.errors = vErrors;return errors === 0;}validate203.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema77 = {"description":"A judgment about another event in the same episode: its theme, signal, and whether it is an observed problem.","type":"object","additionalProperties":false,"required":["target","theme","signal","observation","stance"],"properties":{"target":{"$ref":"#/$defs/eventTarget"},"theme":{"type":"object","additionalProperties":false,"required":["key","statement"],"properties":{"key":{"$ref":"common.schema.json#/$defs/slug"},"statement":{"type":"string","minLength":1,"maxLength":1000}}},"signal":{"enum":["visual_quality","accessibility","usability","content","interaction","performance","agreement","replica_workflow","other"]},"observation":{"enum":["observed","preference","question","praise","other"]},"stance":{"enum":["supports","contradicts"]},"proposedKind":{"$ref":"common.schema.json#/$defs/memoryKind"},"trace":{"$ref":"common.schema.json#/$defs/trace"},"note":{"type":"string","minLength":1,"maxLength":1000}}};const schema78 = {"type":"object","additionalProperties":false,"required":["eventId"],"properties":{"eventId":{"$ref":"common.schema.json#/$defs/id"}}};function validate217(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate217.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate217.errors = vErrors;return errors === 0;}validate217.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate216(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate216.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.eventId === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "eventId"},message:"must have required property '"+"eventId"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(key0 === "eventId")){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.eventId !== undefined){if(!(validate217(data.eventId, {instancePath:instancePath+"/eventId",parentData:data,parentDataProperty:"eventId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate217.errors : vErrors.concat(validate217.errors);errors = vErrors.length;}}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate216.errors = vErrors;return errors === 0;}validate216.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate220(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate220.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(func2(data) > 128){const err0 = {instancePath,schemaPath:"#/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(func2(data) < 1){const err1 = {instancePath,schemaPath:"#/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(!pattern6.test(data)){const err2 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"},message:"must match pattern \""+"^[a-z0-9]+(?:[._-][a-z0-9]+)*$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}validate220.errors = vErrors;return errors === 0;}validate220.evaluated = {"dynamicProps":false,"dynamicItems":false};const schema81 = {"enum":["fact","preference","rule","procedure","example","anti_pattern","design_principle"]};function validate222(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate222.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!(((((((data === "fact") || (data === "preference")) || (data === "rule")) || (data === "procedure")) || (data === "example")) || (data === "anti_pattern")) || (data === "design_principle"))){const err0 = {instancePath,schemaPath:"#/enum",keyword:"enum",params:{allowedValues: schema81.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}validate222.errors = vErrors;return errors === 0;}validate222.evaluated = {"dynamicProps":false,"dynamicItems":false};const schema82 = {"description":"The rule, skill, component, context, or token that should have prevented a problem.","type":"object","additionalProperties":false,"required":["kind","ref"],"properties":{"kind":{"enum":["rule","skill","component","context","token","other"]},"ref":{"type":"string","minLength":1,"maxLength":500}}};function validate224(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate224.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.ref === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "ref"},message:"must have required property '"+"ref"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((key0 === "kind") || (key0 === "ref"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((((data0 === "rule") || (data0 === "skill")) || (data0 === "component")) || (data0 === "context")) || (data0 === "token")) || (data0 === "other"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema82.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.ref !== undefined){let data1 = data.ref;if(typeof data1 === "string"){if(func2(data1) > 500){const err4 = {instancePath:instancePath+"/ref",schemaPath:"#/properties/ref/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 1){const err5 = {instancePath:instancePath+"/ref",schemaPath:"#/properties/ref/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/ref",schemaPath:"#/properties/ref/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate224.errors = vErrors;return errors === 0;}validate224.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate215(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate215.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.target === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "target"},message:"must have required property '"+"target"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.theme === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "theme"},message:"must have required property '"+"theme"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.signal === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "signal"},message:"must have required property '"+"signal"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.observation === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "observation"},message:"must have required property '"+"observation"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.stance === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "stance"},message:"must have required property '"+"stance"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}for(const key0 in data){if(!((((((((key0 === "target") || (key0 === "theme")) || (key0 === "signal")) || (key0 === "observation")) || (key0 === "stance")) || (key0 === "proposedKind")) || (key0 === "trace")) || (key0 === "note"))){const err5 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.target !== undefined){if(!(validate216(data.target, {instancePath:instancePath+"/target",parentData:data,parentDataProperty:"target",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate216.errors : vErrors.concat(validate216.errors);errors = vErrors.length;}}if(data.theme !== undefined){let data1 = data.theme;if(data1 && typeof data1 == "object" && !Array.isArray(data1)){if(data1.key === undefined){const err6 = {instancePath:instancePath+"/theme",schemaPath:"#/properties/theme/required",keyword:"required",params:{missingProperty: "key"},message:"must have required property '"+"key"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data1.statement === undefined){const err7 = {instancePath:instancePath+"/theme",schemaPath:"#/properties/theme/required",keyword:"required",params:{missingProperty: "statement"},message:"must have required property '"+"statement"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}for(const key1 in data1){if(!((key1 === "key") || (key1 === "statement"))){const err8 = {instancePath:instancePath+"/theme",schemaPath:"#/properties/theme/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data1.key !== undefined){if(!(validate220(data1.key, {instancePath:instancePath+"/theme/key",parentData:data1,parentDataProperty:"key",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate220.errors : vErrors.concat(validate220.errors);errors = vErrors.length;}}if(data1.statement !== undefined){let data3 = data1.statement;if(typeof data3 === "string"){if(func2(data3) > 1000){const err9 = {instancePath:instancePath+"/theme/statement",schemaPath:"#/properties/theme/properties/statement/maxLength",keyword:"maxLength",params:{limit: 1000},message:"must NOT have more than 1000 characters"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(func2(data3) < 1){const err10 = {instancePath:instancePath+"/theme/statement",schemaPath:"#/properties/theme/properties/statement/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}else {const err11 = {instancePath:instancePath+"/theme/statement",schemaPath:"#/properties/theme/properties/statement/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}}else {const err12 = {instancePath:instancePath+"/theme",schemaPath:"#/properties/theme/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.signal !== undefined){let data4 = data.signal;if(!(((((((((data4 === "visual_quality") || (data4 === "accessibility")) || (data4 === "usability")) || (data4 === "content")) || (data4 === "interaction")) || (data4 === "performance")) || (data4 === "agreement")) || (data4 === "replica_workflow")) || (data4 === "other"))){const err13 = {instancePath:instancePath+"/signal",schemaPath:"#/properties/signal/enum",keyword:"enum",params:{allowedValues: schema77.properties.signal.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data.observation !== undefined){let data5 = data.observation;if(!(((((data5 === "observed") || (data5 === "preference")) || (data5 === "question")) || (data5 === "praise")) || (data5 === "other"))){const err14 = {instancePath:instancePath+"/observation",schemaPath:"#/properties/observation/enum",keyword:"enum",params:{allowedValues: schema77.properties.observation.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data.stance !== undefined){let data6 = data.stance;if(!((data6 === "supports") || (data6 === "contradicts"))){const err15 = {instancePath:instancePath+"/stance",schemaPath:"#/properties/stance/enum",keyword:"enum",params:{allowedValues: schema77.properties.stance.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data.proposedKind !== undefined){if(!(validate222(data.proposedKind, {instancePath:instancePath+"/proposedKind",parentData:data,parentDataProperty:"proposedKind",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate222.errors : vErrors.concat(validate222.errors);errors = vErrors.length;}}if(data.trace !== undefined){if(!(validate224(data.trace, {instancePath:instancePath+"/trace",parentData:data,parentDataProperty:"trace",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate224.errors : vErrors.concat(validate224.errors);errors = vErrors.length;}}if(data.note !== undefined){let data9 = data.note;if(typeof data9 === "string"){if(func2(data9) > 1000){const err16 = {instancePath:instancePath+"/note",schemaPath:"#/properties/note/maxLength",keyword:"maxLength",params:{limit: 1000},message:"must NOT have more than 1000 characters"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}if(func2(data9) < 1){const err17 = {instancePath:instancePath+"/note",schemaPath:"#/properties/note/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}else {const err18 = {instancePath:instancePath+"/note",schemaPath:"#/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}}else {const err19 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}validate215.errors = vErrors;return errors === 0;}validate215.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema83 = {"description":"A labeler read another event in the same episode and found nothing to label, so it is not asked about that event again.","type":"object","additionalProperties":false,"required":["target"],"properties":{"target":{"$ref":"#/$defs/eventTarget"}}};function validate227(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate227.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.target === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "target"},message:"must have required property '"+"target"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(key0 === "target")){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.target !== undefined){if(!(validate216(data.target, {instancePath:instancePath+"/target",parentData:data,parentDataProperty:"target",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate216.errors : vErrors.concat(validate216.errors);errors = vErrors.length;}}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate227.errors = vErrors;return errors === 0;}validate227.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema84 = {"type":"object","additionalProperties":false,"required":["subject","status","at"],"properties":{"subject":{"type":"object","additionalProperties":false,"required":["kind","id"],"properties":{"kind":{"const":"thread"},"id":{"$ref":"common.schema.json#/$defs/positiveInteger"}}},"status":{"enum":["resolved","unresolved"]},"at":{"$ref":"common.schema.json#/$defs/timestamp"},"sequence":{"$ref":"common.schema.json#/$defs/positiveInteger"},"by":{"$ref":"common.schema.json#/$defs/actor"}}};function validate234(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate234.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((((key0 === "kind") || (key0 === "id")) || (key0 === "role")) || (key0 === "login")) || (key0 === "model")) || (key0 === "asserted"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((data0 === "human") || (data0 === "agent")) || (data0 === "system")) || (data0 === "service"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema23.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.id !== undefined){let data1 = data.id;if(typeof data1 === "string"){if(func2(data1) > 300){const err4 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 3){const err5 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern5.test(data1)){const err6 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},message:"must match pattern \""+"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.role !== undefined){if(!(validate59(data.role, {instancePath:instancePath+"/role",parentData:data,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.login !== undefined){let data3 = data.login;if(typeof data3 === "string"){if(!pattern7.test(data3)){const err8 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},message:"must match pattern \""+"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"+"\""};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.model !== undefined){let data4 = data.model;if(typeof data4 === "string"){if(func2(data4) > 200){const err10 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data4) < 1){const err11 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.asserted !== undefined){if(typeof data.asserted !== "boolean"){const err13 = {instancePath:instancePath+"/asserted",schemaPath:"#/properties/asserted/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate234.errors = vErrors;return errors === 0;}validate234.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate230(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate230.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.subject === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "subject"},message:"must have required property '"+"subject"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.status === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "status"},message:"must have required property '"+"status"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.at === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "at"},message:"must have required property '"+"at"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}for(const key0 in data){if(!(((((key0 === "subject") || (key0 === "status")) || (key0 === "at")) || (key0 === "sequence")) || (key0 === "by"))){const err3 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.subject !== undefined){let data0 = data.subject;if(data0 && typeof data0 == "object" && !Array.isArray(data0)){if(data0.kind === undefined){const err4 = {instancePath:instancePath+"/subject",schemaPath:"#/properties/subject/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data0.id === undefined){const err5 = {instancePath:instancePath+"/subject",schemaPath:"#/properties/subject/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}for(const key1 in data0){if(!((key1 === "kind") || (key1 === "id"))){const err6 = {instancePath:instancePath+"/subject",schemaPath:"#/properties/subject/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data0.kind !== undefined){if("thread" !== data0.kind){const err7 = {instancePath:instancePath+"/subject/kind",schemaPath:"#/properties/subject/properties/kind/const",keyword:"const",params:{allowedValue: "thread"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data0.id !== undefined){if(!(validate204(data0.id, {instancePath:instancePath+"/subject/id",parentData:data0,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate204.errors : vErrors.concat(validate204.errors);errors = vErrors.length;}}}else {const err8 = {instancePath:instancePath+"/subject",schemaPath:"#/properties/subject/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.status !== undefined){let data3 = data.status;if(!((data3 === "resolved") || (data3 === "unresolved"))){const err9 = {instancePath:instancePath+"/status",schemaPath:"#/properties/status/enum",keyword:"enum",params:{allowedValues: schema84.properties.status.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.at !== undefined){if(!(validate207(data.at, {instancePath:instancePath+"/at",parentData:data,parentDataProperty:"at",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate207.errors : vErrors.concat(validate207.errors);errors = vErrors.length;}}if(data.sequence !== undefined){if(!(validate204(data.sequence, {instancePath:instancePath+"/sequence",parentData:data,parentDataProperty:"sequence",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate204.errors : vErrors.concat(validate204.errors);errors = vErrors.length;}}if(data.by !== undefined){if(!(validate234(data.by, {instancePath:instancePath+"/by",parentData:data,parentDataProperty:"by",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate234.errors : vErrors.concat(validate234.errors);errors = vErrors.length;}}}else {const err10 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}validate230.errors = vErrors;return errors === 0;}validate230.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema86 = {"description":"Withdraws an earlier event from every purpose. The earlier event stays in history for audit.","type":"object","additionalProperties":false,"required":["target","reason","at"],"properties":{"target":{"$ref":"#/$defs/eventTarget"},"reason":{"enum":["deleted_at_source","withdrawn_by_author","identity_corrected","other"]},"at":{"$ref":"common.schema.json#/$defs/timestamp"}}};function validate238(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate238.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.target === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "target"},message:"must have required property '"+"target"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.reason === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "reason"},message:"must have required property '"+"reason"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.at === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "at"},message:"must have required property '"+"at"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}for(const key0 in data){if(!(((key0 === "target") || (key0 === "reason")) || (key0 === "at"))){const err3 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.target !== undefined){if(!(validate216(data.target, {instancePath:instancePath+"/target",parentData:data,parentDataProperty:"target",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate216.errors : vErrors.concat(validate216.errors);errors = vErrors.length;}}if(data.reason !== undefined){let data1 = data.reason;if(!((((data1 === "deleted_at_source") || (data1 === "withdrawn_by_author")) || (data1 === "identity_corrected")) || (data1 === "other"))){const err4 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/enum",keyword:"enum",params:{allowedValues: schema86.properties.reason.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.at !== undefined){if(!(validate207(data.at, {instancePath:instancePath+"/at",parentData:data,parentDataProperty:"at",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate207.errors : vErrors.concat(validate207.errors);errors = vErrors.length;}}}else {const err5 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}validate238.errors = vErrors;return errors === 0;}validate238.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema87 = {"type":"object","additionalProperties":false,"required":["memories"],"properties":{"memories":{"type":"array","maxItems":200,"items":{"type":"object","additionalProperties":false,"required":["id","contentDigest"],"properties":{"id":{"$ref":"common.schema.json#/$defs/id"},"contentDigest":{"$ref":"common.schema.json#/$defs/digest"}}}},"task":{"type":"string","minLength":1,"maxLength":2000}}};function validate244(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate244.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate244.errors = vErrors;return errors === 0;}validate244.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate242(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate242.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.memories === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "memories"},message:"must have required property '"+"memories"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!((key0 === "memories") || (key0 === "task"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.memories !== undefined){let data0 = data.memories;if(Array.isArray(data0)){if(data0.length > 200){const err2 = {instancePath:instancePath+"/memories",schemaPath:"#/properties/memories/maxItems",keyword:"maxItems",params:{limit: 200},message:"must NOT have more than 200 items"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}const len0 = data0.length;for(let i0=0; i0 2000){const err8 = {instancePath:instancePath+"/task",schemaPath:"#/properties/task/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(func2(data4) < 1){const err9 = {instancePath:instancePath+"/task",schemaPath:"#/properties/task/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}else {const err10 = {instancePath:instancePath+"/task",schemaPath:"#/properties/task/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}}else {const err11 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}validate242.errors = vErrors;return errors === 0;}validate242.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema89 = {"description":"How an agent session ended. A later outcome for the same session supersedes the earlier one.","type":"object","additionalProperties":false,"required":["status"],"properties":{"status":{"enum":["success","failure","partial","unknown"]},"summary":{"type":"string","minLength":1,"maxLength":2000}}};function validate247(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate247.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.status === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "status"},message:"must have required property '"+"status"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!((key0 === "status") || (key0 === "summary"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.status !== undefined){let data0 = data.status;if(!((((data0 === "success") || (data0 === "failure")) || (data0 === "partial")) || (data0 === "unknown"))){const err2 = {instancePath:instancePath+"/status",schemaPath:"#/properties/status/enum",keyword:"enum",params:{allowedValues: schema89.properties.status.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.summary !== undefined){let data1 = data.summary;if(typeof data1 === "string"){if(func2(data1) > 2000){const err3 = {instancePath:instancePath+"/summary",schemaPath:"#/properties/summary/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(func2(data1) < 1){const err4 = {instancePath:instancePath+"/summary",schemaPath:"#/properties/summary/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}else {const err5 = {instancePath:instancePath+"/summary",schemaPath:"#/properties/summary/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}}else {const err6 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}validate247.errors = vErrors;return errors === 0;}validate247.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate251(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate251.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate251.errors = vErrors;return errors === 0;}validate251.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema91 = {"type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"$ref":"#/$defs/slug"},"uri":{"type":"string","minLength":1,"maxLength":2048},"digest":{"$ref":"#/$defs/digest"},"mediaType":{"type":"string","minLength":3,"maxLength":128}}};function validate261(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate261.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!((((key0 === "kind") || (key0 === "uri")) || (key0 === "digest")) || (key0 === "mediaType"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.kind !== undefined){if(!(validate59(data.kind, {instancePath:instancePath+"/kind",parentData:data,parentDataProperty:"kind",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.uri !== undefined){let data1 = data.uri;if(typeof data1 === "string"){if(func2(data1) > 2048){const err2 = {instancePath:instancePath+"/uri",schemaPath:"#/properties/uri/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(func2(data1) < 1){const err3 = {instancePath:instancePath+"/uri",schemaPath:"#/properties/uri/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/uri",schemaPath:"#/properties/uri/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.digest !== undefined){if(!(validate196(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate196.errors : vErrors.concat(validate196.errors);errors = vErrors.length;}}if(data.mediaType !== undefined){let data3 = data.mediaType;if(typeof data3 === "string"){if(func2(data3) > 128){const err5 = {instancePath:instancePath+"/mediaType",schemaPath:"#/properties/mediaType/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(func2(data3) < 3){const err6 = {instancePath:instancePath+"/mediaType",schemaPath:"#/properties/mediaType/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/mediaType",schemaPath:"#/properties/mediaType/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}else {const err8 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}validate261.errors = vErrors;return errors === 0;}validate261.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema92 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/evidence-ref.schema.json","title":"Replica evidence reference v1","description":"Points from a learning back to the exact events that support it, and pins them to their source.","type":"object","additionalProperties":false,"required":["episodeId","eventIds"],"properties":{"episodeId":{"$ref":"common.schema.json#/$defs/id"},"eventIds":{"type":"array","minItems":1,"maxItems":100,"items":{"$ref":"common.schema.json#/$defs/id"}},"source":{"$ref":"common.schema.json#/$defs/source"},"observedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"author":{"$ref":"common.schema.json#/$defs/actor"},"artifacts":{"type":"array","maxItems":20,"items":{"$ref":"common.schema.json#/$defs/artifactRef"}}}};function validate266(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate266.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate266.errors = vErrors;return errors === 0;}validate266.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate269(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate269.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(func1.call(schema32.properties, key0))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.kind !== undefined){if(!(validate80(data.kind, {instancePath:instancePath+"/kind",parentData:data,parentDataProperty:"kind",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate80.errors : vErrors.concat(validate80.errors);errors = vErrors.length;}}if(data.hubOrigin !== undefined){if(!(validate82(data.hubOrigin, {instancePath:instancePath+"/hubOrigin",parentData:data,parentDataProperty:"hubOrigin",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate82.errors : vErrors.concat(validate82.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data2 = data.repository;if(typeof data2 === "string"){if(!pattern10.test(data2)){const err2 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.repositoryId !== undefined){if(!(validate84(data.repositoryId, {instancePath:instancePath+"/repositoryId",parentData:data,parentDataProperty:"repositoryId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate84.errors : vErrors.concat(validate84.errors);errors = vErrors.length;}}if(data.prototypeId !== undefined){if(!(validate84(data.prototypeId, {instancePath:instancePath+"/prototypeId",parentData:data,parentDataProperty:"prototypeId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate84.errors : vErrors.concat(validate84.errors);errors = vErrors.length;}}if(data.prototypeName !== undefined){let data5 = data.prototypeName;if(typeof data5 === "string"){if(func2(data5) > 1024){const err4 = {instancePath:instancePath+"/prototypeName",schemaPath:"#/properties/prototypeName/maxLength",keyword:"maxLength",params:{limit: 1024},message:"must NOT have more than 1024 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data5) < 1){const err5 = {instancePath:instancePath+"/prototypeName",schemaPath:"#/properties/prototypeName/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/prototypeName",schemaPath:"#/properties/prototypeName/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.branch !== undefined){let data6 = data.branch;if(typeof data6 === "string"){if(func2(data6) > 1024){const err7 = {instancePath:instancePath+"/branch",schemaPath:"#/properties/branch/maxLength",keyword:"maxLength",params:{limit: 1024},message:"must NOT have more than 1024 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func2(data6) < 1){const err8 = {instancePath:instancePath+"/branch",schemaPath:"#/properties/branch/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/branch",schemaPath:"#/properties/branch/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.buildNumber !== undefined){if(!(validate85(data.buildNumber, {instancePath:instancePath+"/buildNumber",parentData:data,parentDataProperty:"buildNumber",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}if(data.buildId !== undefined){if(!(validate85(data.buildId, {instancePath:instancePath+"/buildId",parentData:data,parentDataProperty:"buildId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}if(data.commitSha !== undefined){if(!(validate91(data.commitSha, {instancePath:instancePath+"/commitSha",parentData:data,parentDataProperty:"commitSha",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate91.errors : vErrors.concat(validate91.errors);errors = vErrors.length;}}if(data.threadId !== undefined){if(!(validate85(data.threadId, {instancePath:instancePath+"/threadId",parentData:data,parentDataProperty:"threadId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}if(data.commentId !== undefined){if(!(validate85(data.commentId, {instancePath:instancePath+"/commentId",parentData:data,parentDataProperty:"commentId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}if(data.sessionId !== undefined){let data12 = data.sessionId;if(typeof data12 === "string"){if(func2(data12) > 200){const err10 = {instancePath:instancePath+"/sessionId",schemaPath:"#/properties/sessionId/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data12) < 1){const err11 = {instancePath:instancePath+"/sessionId",schemaPath:"#/properties/sessionId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/sessionId",schemaPath:"#/properties/sessionId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}}else {const err13 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}validate269.errors = vErrors;return errors === 0;}validate269.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate280(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate280.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate280.errors = vErrors;return errors === 0;}validate280.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate282(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate282.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((((key0 === "kind") || (key0 === "id")) || (key0 === "role")) || (key0 === "login")) || (key0 === "model")) || (key0 === "asserted"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((data0 === "human") || (data0 === "agent")) || (data0 === "system")) || (data0 === "service"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema23.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.id !== undefined){let data1 = data.id;if(typeof data1 === "string"){if(func2(data1) > 300){const err4 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 3){const err5 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern5.test(data1)){const err6 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},message:"must match pattern \""+"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.role !== undefined){if(!(validate59(data.role, {instancePath:instancePath+"/role",parentData:data,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.login !== undefined){let data3 = data.login;if(typeof data3 === "string"){if(!pattern7.test(data3)){const err8 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},message:"must match pattern \""+"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"+"\""};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.model !== undefined){let data4 = data.model;if(typeof data4 === "string"){if(func2(data4) > 200){const err10 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data4) < 1){const err11 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.asserted !== undefined){if(typeof data.asserted !== "boolean"){const err13 = {instancePath:instancePath+"/asserted",schemaPath:"#/properties/asserted/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate282.errors = vErrors;return errors === 0;}validate282.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate285(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate285.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!((((key0 === "kind") || (key0 === "uri")) || (key0 === "digest")) || (key0 === "mediaType"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.kind !== undefined){if(!(validate59(data.kind, {instancePath:instancePath+"/kind",parentData:data,parentDataProperty:"kind",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.uri !== undefined){let data1 = data.uri;if(typeof data1 === "string"){if(func2(data1) > 2048){const err2 = {instancePath:instancePath+"/uri",schemaPath:"#/properties/uri/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(func2(data1) < 1){const err3 = {instancePath:instancePath+"/uri",schemaPath:"#/properties/uri/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/uri",schemaPath:"#/properties/uri/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.digest !== undefined){if(!(validate196(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate196.errors : vErrors.concat(validate196.errors);errors = vErrors.length;}}if(data.mediaType !== undefined){let data3 = data.mediaType;if(typeof data3 === "string"){if(func2(data3) > 128){const err5 = {instancePath:instancePath+"/mediaType",schemaPath:"#/properties/mediaType/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(func2(data3) < 3){const err6 = {instancePath:instancePath+"/mediaType",schemaPath:"#/properties/mediaType/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/mediaType",schemaPath:"#/properties/mediaType/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}}else {const err8 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}validate285.errors = vErrors;return errors === 0;}validate285.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate265(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/evidence-ref.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate265.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.episodeId === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "episodeId"},message:"must have required property '"+"episodeId"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.eventIds === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "eventIds"},message:"must have required property '"+"eventIds"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((((key0 === "episodeId") || (key0 === "eventIds")) || (key0 === "source")) || (key0 === "observedAt")) || (key0 === "author")) || (key0 === "artifacts"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.episodeId !== undefined){if(!(validate266(data.episodeId, {instancePath:instancePath+"/episodeId",parentData:data,parentDataProperty:"episodeId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate266.errors : vErrors.concat(validate266.errors);errors = vErrors.length;}}if(data.eventIds !== undefined){let data1 = data.eventIds;if(Array.isArray(data1)){if(data1.length > 100){const err3 = {instancePath:instancePath+"/eventIds",schemaPath:"#/properties/eventIds/maxItems",keyword:"maxItems",params:{limit: 100},message:"must NOT have more than 100 items"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data1.length < 1){const err4 = {instancePath:instancePath+"/eventIds",schemaPath:"#/properties/eventIds/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}const len0 = data1.length;for(let i0=0; i0 20){const err6 = {instancePath:instancePath+"/artifacts",schemaPath:"#/properties/artifacts/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}const len1 = data6.length;for(let i1=0; i1 1000){const err4 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/maxLength",keyword:"maxLength",params:{limit: 1000},message:"must NOT have more than 1000 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data2) < 1){const err5 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.commentId !== undefined){if(!(validate85(data.commentId, {instancePath:instancePath+"/commentId",parentData:data,parentDataProperty:"commentId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate85.errors : vErrors.concat(validate85.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate290.errors = vErrors;return errors === 0;}validate290.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const pattern60 = new RegExp("^x-[a-z0-9-]+\\.[a-z0-9_]+$", "u");function validate202(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/event.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate202.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}const _errs2 = errors;let valid1 = true;const _errs3 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((data.redaction === undefined) && (missing0 = "redaction")){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}var _valid0 = _errs3 === errors;errors = _errs2;if(vErrors !== null){if(_errs2){vErrors.length = _errs2;}else {vErrors = null;}}let ifClause0;if(_valid0){const _errs4 = errors;const _errs5 = errors;const _errs6 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing1;if((data.payload === undefined) && (missing1 = "payload")){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}var valid2 = _errs6 === errors;if(valid2){const err2 = {instancePath,schemaPath:"#/allOf/0/then/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}else {errors = _errs5;if(vErrors !== null){if(_errs5){vErrors.length = _errs5;}else {vErrors = null;}}}var _valid0 = _errs4 === errors;valid1 = _valid0;ifClause0 = "then";}else {const _errs7 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.payload === undefined){const err3 = {instancePath,schemaPath:"#/allOf/0/else/required",keyword:"required",params:{missingProperty: "payload"},message:"must have required property '"+"payload"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}var _valid0 = _errs7 === errors;valid1 = _valid0;ifClause0 = "else";}if(!valid1){const err4 = {instancePath,schemaPath:"#/allOf/0/if",keyword:"if",params:{failingKeyword: ifClause0},message:"must match \""+ifClause0+"\" schema"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}const _errs9 = errors;let valid3 = true;const _errs10 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing2;if((data.type === undefined) && (missing2 = "type")){const err5 = {};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}else {if(data.type !== undefined){if("human_comment" !== data.type){const err6 = {};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}}var _valid1 = _errs10 === errors;errors = _errs9;if(vErrors !== null){if(_errs9){vErrors.length = _errs9;}else {vErrors = null;}}if(_valid1){const _errs12 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.payload !== undefined){if(!(validate203(data.payload, {instancePath:instancePath+"/payload",parentData:data,parentDataProperty:"payload",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate203.errors : vErrors.concat(validate203.errors);errors = vErrors.length;}}}var _valid1 = _errs12 === errors;valid3 = _valid1;if(valid3){var props0 = {};props0.payload = true;props0.type = true;}}if(!valid3){const err7 = {instancePath,schemaPath:"#/allOf/1/if",keyword:"if",params:{failingKeyword: "then"},message:"must match \"then\" schema"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}const _errs15 = errors;let valid6 = true;const _errs16 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing3;if((data.type === undefined) && (missing3 = "type")){const err8 = {};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}else {if(data.type !== undefined){if("annotation" !== data.type){const err9 = {};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}}}var _valid2 = _errs16 === errors;errors = _errs15;if(vErrors !== null){if(_errs15){vErrors.length = _errs15;}else {vErrors = null;}}if(_valid2){const _errs18 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.parentEventId === undefined){const err10 = {instancePath,schemaPath:"#/allOf/2/then/required",keyword:"required",params:{missingProperty: "parentEventId"},message:"must have required property '"+"parentEventId"+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(data.payload !== undefined){if(!(validate215(data.payload, {instancePath:instancePath+"/payload",parentData:data,parentDataProperty:"payload",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate215.errors : vErrors.concat(validate215.errors);errors = vErrors.length;}}}var _valid2 = _errs18 === errors;valid6 = _valid2;if(valid6){var props1 = {};props1.payload = true;props1.type = true;}}if(!valid6){const err11 = {instancePath,schemaPath:"#/allOf/2/if",keyword:"if",params:{failingKeyword: "then"},message:"must match \"then\" schema"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(props0 !== true && props1 !== undefined){if(props1 === true){props0 = true;}else {props0 = props0 || {};Object.assign(props0, props1);}}const _errs21 = errors;let valid9 = true;const _errs22 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing4;if((data.type === undefined) && (missing4 = "type")){const err12 = {};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}else {if(data.type !== undefined){if("no_annotation" !== data.type){const err13 = {};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}}var _valid3 = _errs22 === errors;errors = _errs21;if(vErrors !== null){if(_errs21){vErrors.length = _errs21;}else {vErrors = null;}}if(_valid3){const _errs24 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.parentEventId === undefined){const err14 = {instancePath,schemaPath:"#/allOf/3/then/required",keyword:"required",params:{missingProperty: "parentEventId"},message:"must have required property '"+"parentEventId"+"'"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}if(data.payload !== undefined){if(!(validate227(data.payload, {instancePath:instancePath+"/payload",parentData:data,parentDataProperty:"payload",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate227.errors : vErrors.concat(validate227.errors);errors = vErrors.length;}}}var _valid3 = _errs24 === errors;valid9 = _valid3;if(valid9){var props2 = {};props2.payload = true;props2.type = true;}}if(!valid9){const err15 = {instancePath,schemaPath:"#/allOf/3/if",keyword:"if",params:{failingKeyword: "then"},message:"must match \"then\" schema"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}if(props0 !== true && props2 !== undefined){if(props2 === true){props0 = true;}else {props0 = props0 || {};Object.assign(props0, props2);}}const _errs27 = errors;let valid12 = true;const _errs28 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing5;if((data.type === undefined) && (missing5 = "type")){const err16 = {};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}else {if(data.type !== undefined){if("status_change" !== data.type){const err17 = {};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}}}var _valid4 = _errs28 === errors;errors = _errs27;if(vErrors !== null){if(_errs27){vErrors.length = _errs27;}else {vErrors = null;}}if(_valid4){const _errs30 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.payload !== undefined){if(!(validate230(data.payload, {instancePath:instancePath+"/payload",parentData:data,parentDataProperty:"payload",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate230.errors : vErrors.concat(validate230.errors);errors = vErrors.length;}}}var _valid4 = _errs30 === errors;valid12 = _valid4;if(valid12){var props3 = {};props3.payload = true;props3.type = true;}}if(!valid12){const err18 = {instancePath,schemaPath:"#/allOf/4/if",keyword:"if",params:{failingKeyword: "then"},message:"must match \"then\" schema"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}if(props0 !== true && props3 !== undefined){if(props3 === true){props0 = true;}else {props0 = props0 || {};Object.assign(props0, props3);}}const _errs33 = errors;let valid15 = true;const _errs34 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing6;if((data.type === undefined) && (missing6 = "type")){const err19 = {};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}else {if(data.type !== undefined){if("retraction" !== data.type){const err20 = {};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}}}var _valid5 = _errs34 === errors;errors = _errs33;if(vErrors !== null){if(_errs33){vErrors.length = _errs33;}else {vErrors = null;}}if(_valid5){const _errs36 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.parentEventId === undefined){const err21 = {instancePath,schemaPath:"#/allOf/5/then/required",keyword:"required",params:{missingProperty: "parentEventId"},message:"must have required property '"+"parentEventId"+"'"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}if(data.payload !== undefined){if(!(validate238(data.payload, {instancePath:instancePath+"/payload",parentData:data,parentDataProperty:"payload",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate238.errors : vErrors.concat(validate238.errors);errors = vErrors.length;}}}var _valid5 = _errs36 === errors;valid15 = _valid5;if(valid15){var props4 = {};props4.payload = true;props4.type = true;}}if(!valid15){const err22 = {instancePath,schemaPath:"#/allOf/5/if",keyword:"if",params:{failingKeyword: "then"},message:"must match \"then\" schema"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}if(props0 !== true && props4 !== undefined){if(props4 === true){props0 = true;}else {props0 = props0 || {};Object.assign(props0, props4);}}const _errs39 = errors;let valid18 = true;const _errs40 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing7;if((data.type === undefined) && (missing7 = "type")){const err23 = {};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}else {if(data.type !== undefined){if("memory_retrieved" !== data.type){const err24 = {};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}}}var _valid6 = _errs40 === errors;errors = _errs39;if(vErrors !== null){if(_errs39){vErrors.length = _errs39;}else {vErrors = null;}}if(_valid6){const _errs42 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.payload !== undefined){if(!(validate242(data.payload, {instancePath:instancePath+"/payload",parentData:data,parentDataProperty:"payload",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate242.errors : vErrors.concat(validate242.errors);errors = vErrors.length;}}}var _valid6 = _errs42 === errors;valid18 = _valid6;if(valid18){var props5 = {};props5.payload = true;props5.type = true;}}if(!valid18){const err25 = {instancePath,schemaPath:"#/allOf/6/if",keyword:"if",params:{failingKeyword: "then"},message:"must match \"then\" schema"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}if(props0 !== true && props5 !== undefined){if(props5 === true){props0 = true;}else {props0 = props0 || {};Object.assign(props0, props5);}}const _errs45 = errors;let valid21 = true;const _errs46 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing8;if((data.type === undefined) && (missing8 = "type")){const err26 = {};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}else {if(data.type !== undefined){if("session_outcome" !== data.type){const err27 = {};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}}}var _valid7 = _errs46 === errors;errors = _errs45;if(vErrors !== null){if(_errs45){vErrors.length = _errs45;}else {vErrors = null;}}if(_valid7){const _errs48 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.payload !== undefined){if(!(validate247(data.payload, {instancePath:instancePath+"/payload",parentData:data,parentDataProperty:"payload",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate247.errors : vErrors.concat(validate247.errors);errors = vErrors.length;}}}var _valid7 = _errs48 === errors;valid21 = _valid7;if(valid21){var props6 = {};props6.payload = true;props6.type = true;}}if(!valid21){const err28 = {instancePath,schemaPath:"#/allOf/7/if",keyword:"if",params:{failingKeyword: "then"},message:"must match \"then\" schema"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}if(props0 !== true && props6 !== undefined){if(props6 === true){props0 = true;}else {props0 = props0 || {};Object.assign(props0, props6);}}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err29 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}if(data.id === undefined){const err30 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}if(data.episodeId === undefined){const err31 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "episodeId"},message:"must have required property '"+"episodeId"+"'"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}if(data.scope === undefined){const err32 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}if(data.type === undefined){const err33 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "type"},message:"must have required property '"+"type"+"'"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}if(data.at === undefined){const err34 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "at"},message:"must have required property '"+"at"+"'"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}if(data.actor === undefined){const err35 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "actor"},message:"must have required property '"+"actor"+"'"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}if(data.payloadDigest === undefined){const err36 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "payloadDigest"},message:"must have required property '"+"payloadDigest"+"'"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}if(data.digest === undefined){const err37 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}for(const key0 in data){if(!(func1.call(schema72.properties, key0))){const err38 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}}if(data.schemaVersion !== undefined){if("replica.event/v1" !== data.schemaVersion){const err39 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.event/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}if(data.id !== undefined){if(!(validate217(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate217.errors : vErrors.concat(validate217.errors);errors = vErrors.length;}}if(data.episodeId !== undefined){if(!(validate217(data.episodeId, {instancePath:instancePath+"/episodeId",parentData:data,parentDataProperty:"episodeId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate217.errors : vErrors.concat(validate217.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate251(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate251.errors : vErrors.concat(validate251.errors);errors = vErrors.length;}}if(data.type !== undefined){let data18 = data.type;const _errs56 = errors;let valid25 = false;const _errs57 = errors;if(!(((((((((((((((((((((((((data18 === "user_message") || (data18 === "agent_message")) || (data18 === "human_comment")) || (data18 === "human_correction")) || (data18 === "human_approval")) || (data18 === "human_rejection")) || (data18 === "tool_call")) || (data18 === "tool_result")) || (data18 === "ui_snapshot")) || (data18 === "ui_interaction")) || (data18 === "build_created")) || (data18 === "audio_segment")) || (data18 === "voice_turn")) || (data18 === "agent_to_agent_message")) || (data18 === "evaluation_result")) || (data18 === "criterion_result")) || (data18 === "memory_retrieved")) || (data18 === "memory_proposed")) || (data18 === "handoff")) || (data18 === "error")) || (data18 === "annotation")) || (data18 === "no_annotation")) || (data18 === "status_change")) || (data18 === "session_outcome")) || (data18 === "retraction"))){const err40 = {instancePath:instancePath+"/type",schemaPath:"#/properties/type/anyOf/0/enum",keyword:"enum",params:{allowedValues: schema72.properties.type.anyOf[0].enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}var _valid8 = _errs57 === errors;valid25 = valid25 || _valid8;const _errs58 = errors;if(typeof data18 === "string"){if(func2(data18) > 128){const err41 = {instancePath:instancePath+"/type",schemaPath:"#/properties/type/anyOf/1/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}if(!pattern60.test(data18)){const err42 = {instancePath:instancePath+"/type",schemaPath:"#/properties/type/anyOf/1/pattern",keyword:"pattern",params:{pattern: "^x-[a-z0-9-]+\\.[a-z0-9_]+$"},message:"must match pattern \""+"^x-[a-z0-9-]+\\.[a-z0-9_]+$"+"\""};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}else {const err43 = {instancePath:instancePath+"/type",schemaPath:"#/properties/type/anyOf/1/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}var _valid8 = _errs58 === errors;valid25 = valid25 || _valid8;if(!valid25){const err44 = {instancePath:instancePath+"/type",schemaPath:"#/properties/type/anyOf",keyword:"anyOf",params:{},message:"must match a schema in anyOf"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}else {errors = _errs56;if(vErrors !== null){if(_errs56){vErrors.length = _errs56;}else {vErrors = null;}}}}if(data.at !== undefined){if(!(validate207(data.at, {instancePath:instancePath+"/at",parentData:data,parentDataProperty:"at",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate207.errors : vErrors.concat(validate207.errors);errors = vErrors.length;}}if(data.actor !== undefined){if(!(validate234(data.actor, {instancePath:instancePath+"/actor",parentData:data,parentDataProperty:"actor",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate234.errors : vErrors.concat(validate234.errors);errors = vErrors.length;}}if(data.payload !== undefined){let data21 = data.payload;if(!(data21 && typeof data21 == "object" && !Array.isArray(data21))){const err45 = {instancePath:instancePath+"/payload",schemaPath:"#/properties/payload/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}}if(data.payloadDigest !== undefined){if(!(validate244(data.payloadDigest, {instancePath:instancePath+"/payloadDigest",parentData:data,parentDataProperty:"payloadDigest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate244.errors : vErrors.concat(validate244.errors);errors = vErrors.length;}}if(data.parentEventId !== undefined){if(!(validate217(data.parentEventId, {instancePath:instancePath+"/parentEventId",parentData:data,parentDataProperty:"parentEventId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate217.errors : vErrors.concat(validate217.errors);errors = vErrors.length;}}if(data.supersedes !== undefined){if(!(validate217(data.supersedes, {instancePath:instancePath+"/supersedes",parentData:data,parentDataProperty:"supersedes",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate217.errors : vErrors.concat(validate217.errors);errors = vErrors.length;}}if(data.artifactRefs !== undefined){let data25 = data.artifactRefs;if(Array.isArray(data25)){if(data25.length > 20){const err46 = {instancePath:instancePath+"/artifactRefs",schemaPath:"#/properties/artifactRefs/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}const len0 = data25.length;for(let i0=0; i0 100){const err48 = {instancePath:instancePath+"/evidenceRefs",schemaPath:"#/properties/evidenceRefs/maxItems",keyword:"maxItems",params:{limit: 100},message:"must NOT have more than 100 items"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}const len1 = data27.length;for(let i1=0; i1 10000){const err12 = {instancePath:instancePath+"/task/prompt",schemaPath:"#/properties/task/properties/prompt/maxLength",keyword:"maxLength",params:{limit: 10000},message:"must NOT have more than 10000 characters"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}if(func2(data5) < 1){const err13 = {instancePath:instancePath+"/task/prompt",schemaPath:"#/properties/task/properties/prompt/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}else {const err14 = {instancePath:instancePath+"/task/prompt",schemaPath:"#/properties/task/properties/prompt/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data4.goal !== undefined){let data6 = data4.goal;if(typeof data6 === "string"){if(func2(data6) > 2000){const err15 = {instancePath:instancePath+"/task/goal",schemaPath:"#/properties/task/properties/goal/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}if(func2(data6) < 1){const err16 = {instancePath:instancePath+"/task/goal",schemaPath:"#/properties/task/properties/goal/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}else {const err17 = {instancePath:instancePath+"/task/goal",schemaPath:"#/properties/task/properties/goal/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}if(data4.role !== undefined){if(!(validate180(data4.role, {instancePath:instancePath+"/task/role",parentData:data4,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate180.errors : vErrors.concat(validate180.errors);errors = vErrors.length;}}if(data4.taskId !== undefined){let data8 = data4.taskId;if(typeof data8 === "string"){if(func2(data8) > 200){const err18 = {instancePath:instancePath+"/task/taskId",schemaPath:"#/properties/task/properties/taskId/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}if(func2(data8) < 1){const err19 = {instancePath:instancePath+"/task/taskId",schemaPath:"#/properties/task/properties/taskId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}else {const err20 = {instancePath:instancePath+"/task/taskId",schemaPath:"#/properties/task/properties/taskId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}}else {const err21 = {instancePath:instancePath+"/task",schemaPath:"#/properties/task/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}if(data.actors !== undefined){let data9 = data.actors;if(Array.isArray(data9)){if(data9.length > 500){const err22 = {instancePath:instancePath+"/actors",schemaPath:"#/properties/actors/maxItems",keyword:"maxItems",params:{limit: 500},message:"must NOT have more than 500 items"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}const len0 = data9.length;for(let i0=0; i0 200){const err25 = {instancePath:instancePath+"/versions/model",schemaPath:"#/properties/versions/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}if(func2(data12) < 1){const err26 = {instancePath:instancePath+"/versions/model",schemaPath:"#/properties/versions/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}else {const err27 = {instancePath:instancePath+"/versions/model",schemaPath:"#/properties/versions/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}if(data11.harness !== undefined){let data13 = data11.harness;if(typeof data13 === "string"){if(func2(data13) > 200){const err28 = {instancePath:instancePath+"/versions/harness",schemaPath:"#/properties/versions/properties/harness/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}if(func2(data13) < 1){const err29 = {instancePath:instancePath+"/versions/harness",schemaPath:"#/properties/versions/properties/harness/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}else {const err30 = {instancePath:instancePath+"/versions/harness",schemaPath:"#/properties/versions/properties/harness/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}if(data11.designSystem !== undefined){let data14 = data11.designSystem;if(typeof data14 === "string"){if(func2(data14) > 200){const err31 = {instancePath:instancePath+"/versions/designSystem",schemaPath:"#/properties/versions/properties/designSystem/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}if(func2(data14) < 1){const err32 = {instancePath:instancePath+"/versions/designSystem",schemaPath:"#/properties/versions/properties/designSystem/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}else {const err33 = {instancePath:instancePath+"/versions/designSystem",schemaPath:"#/properties/versions/properties/designSystem/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data11.brandPack !== undefined){let data15 = data11.brandPack;if(typeof data15 === "string"){if(func2(data15) > 200){const err34 = {instancePath:instancePath+"/versions/brandPack",schemaPath:"#/properties/versions/properties/brandPack/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}if(func2(data15) < 1){const err35 = {instancePath:instancePath+"/versions/brandPack",schemaPath:"#/properties/versions/properties/brandPack/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}else {const err36 = {instancePath:instancePath+"/versions/brandPack",schemaPath:"#/properties/versions/properties/brandPack/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}}if(data11.memorySnapshot !== undefined){if(!(validate185(data11.memorySnapshot, {instancePath:instancePath+"/versions/memorySnapshot",parentData:data11,parentDataProperty:"memorySnapshot",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate185.errors : vErrors.concat(validate185.errors);errors = vErrors.length;}}}else {const err37 = {instancePath:instancePath+"/versions",schemaPath:"#/properties/versions/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}if(data.grants !== undefined){let data17 = data.grants;if(Array.isArray(data17)){if(data17.length > 20){const err38 = {instancePath:instancePath+"/grants",schemaPath:"#/properties/grants/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}if(data17.length < 1){const err39 = {instancePath:instancePath+"/grants",schemaPath:"#/properties/grants/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}const len1 = data17.length;for(let i1=0; i1 2000){const err50 = {instancePath:instancePath+"/outcome/summary",schemaPath:"#/properties/outcome/properties/summary/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}if(func2(data28) < 1){const err51 = {instancePath:instancePath+"/outcome/summary",schemaPath:"#/properties/outcome/properties/summary/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err51];}else {vErrors.push(err51);}errors++;}}else {const err52 = {instancePath:instancePath+"/outcome/summary",schemaPath:"#/properties/outcome/properties/summary/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}}}else {const err53 = {instancePath:instancePath+"/outcome",schemaPath:"#/properties/outcome/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}if(data.timeline !== undefined){let data29 = data.timeline;if(Array.isArray(data29)){if(data29.length > 100000){const err54 = {instancePath:instancePath+"/timeline",schemaPath:"#/properties/timeline/maxItems",keyword:"maxItems",params:{limit: 100000},message:"must NOT have more than 100000 items"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}const len2 = data29.length;for(let i2=0; i2 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate303.errors = vErrors;return errors === 0;}validate303.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate308(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate308.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate308.errors = vErrors;return errors === 0;}validate308.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate310(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate310.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!(validate132(data, {instancePath,parentData,parentDataProperty,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate132.errors : vErrors.concat(validate132.errors);errors = vErrors.length;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind !== undefined){if("human" !== data.kind){const err0 = {instancePath:instancePath+"/kind",schemaPath:"#/allOf/1/properties/kind/const",keyword:"const",params:{allowedValue: "human"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}}else {const err1 = {instancePath,schemaPath:"#/allOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate310.errors = vErrors;return errors === 0;}validate310.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate313(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate313.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(func2(data) > 128){const err0 = {instancePath,schemaPath:"#/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(func2(data) < 1){const err1 = {instancePath,schemaPath:"#/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(!pattern6.test(data)){const err2 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"},message:"must match pattern \""+"^[a-z0-9]+(?:[._-][a-z0-9]+)*$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}validate313.errors = vErrors;return errors === 0;}validate313.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate315(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate315.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!(((typeof data == "number") && (!(data % 1) && !isNaN(data))) && (isFinite(data)))){const err0 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if((typeof data == "number") && (isFinite(data))){if(data > 9007199254740991 || isNaN(data)){const err1 = {instancePath,schemaPath:"#/maximum",keyword:"maximum",params:{comparison: "<=", limit: 9007199254740991},message:"must be <= 9007199254740991"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data < 0 || isNaN(data)){const err2 = {instancePath,schemaPath:"#/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}validate315.errors = vErrors;return errors === 0;}validate315.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate325(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate325.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate325.errors = vErrors;return errors === 0;}validate325.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate298(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/export-manifest.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate298.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.purpose === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "purpose"},message:"must have required property '"+"purpose"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.scope === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.createdAt === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "createdAt"},message:"must have required property '"+"createdAt"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.createdBy === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "createdBy"},message:"must have required property '"+"createdBy"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.provider === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "provider"},message:"must have required property '"+"provider"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.destination === undefined){const err7 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "destination"},message:"must have required property '"+"destination"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.counts === undefined){const err8 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "counts"},message:"must have required property '"+"counts"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data.excluded === undefined){const err9 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "excluded"},message:"must have required property '"+"excluded"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(data.records === undefined){const err10 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "records"},message:"must have required property '"+"records"+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(data.digest === undefined){const err11 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}for(const key0 in data){if(!(func1.call(schema99.properties, key0))){const err12 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.schemaVersion !== undefined){if("replica.export/v1" !== data.schemaVersion){const err13 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.export/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data.id !== undefined){if(!(validate299(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate299.errors : vErrors.concat(validate299.errors);errors = vErrors.length;}}if(data.purpose !== undefined){if(!(validate301(data.purpose, {instancePath:instancePath+"/purpose",parentData:data,parentDataProperty:"purpose",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate301.errors : vErrors.concat(validate301.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate303(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate303.errors : vErrors.concat(validate303.errors);errors = vErrors.length;}}if(data.createdAt !== undefined){if(!(validate308(data.createdAt, {instancePath:instancePath+"/createdAt",parentData:data,parentDataProperty:"createdAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate308.errors : vErrors.concat(validate308.errors);errors = vErrors.length;}}if(data.createdBy !== undefined){if(!(validate310(data.createdBy, {instancePath:instancePath+"/createdBy",parentData:data,parentDataProperty:"createdBy",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate310.errors : vErrors.concat(validate310.errors);errors = vErrors.length;}}if(data.provider !== undefined){let data6 = data.provider;if(data6 && typeof data6 == "object" && !Array.isArray(data6)){if(data6.id === undefined){const err14 = {instancePath:instancePath+"/provider",schemaPath:"#/properties/provider/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}if(data6.version === undefined){const err15 = {instancePath:instancePath+"/provider",schemaPath:"#/properties/provider/required",keyword:"required",params:{missingProperty: "version"},message:"must have required property '"+"version"+"'"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}for(const key1 in data6){if(!((key1 === "id") || (key1 === "version"))){const err16 = {instancePath:instancePath+"/provider",schemaPath:"#/properties/provider/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}if(data6.id !== undefined){if(!(validate313(data6.id, {instancePath:instancePath+"/provider/id",parentData:data6,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate313.errors : vErrors.concat(validate313.errors);errors = vErrors.length;}}if(data6.version !== undefined){let data8 = data6.version;if(typeof data8 === "string"){if(func2(data8) > 64){const err17 = {instancePath:instancePath+"/provider/version",schemaPath:"#/properties/provider/properties/version/maxLength",keyword:"maxLength",params:{limit: 64},message:"must NOT have more than 64 characters"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}if(func2(data8) < 1){const err18 = {instancePath:instancePath+"/provider/version",schemaPath:"#/properties/provider/properties/version/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}else {const err19 = {instancePath:instancePath+"/provider/version",schemaPath:"#/properties/provider/properties/version/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}}else {const err20 = {instancePath:instancePath+"/provider",schemaPath:"#/properties/provider/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}if(data.destination !== undefined){let data9 = data.destination;if(typeof data9 === "string"){if(func2(data9) > 2048){const err21 = {instancePath:instancePath+"/destination",schemaPath:"#/properties/destination/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}if(func2(data9) < 1){const err22 = {instancePath:instancePath+"/destination",schemaPath:"#/properties/destination/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}else {const err23 = {instancePath:instancePath+"/destination",schemaPath:"#/properties/destination/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}if(data.contents !== undefined){let data10 = data.contents;if(!((data10 === "all") || (data10 === "learnings"))){const err24 = {instancePath:instancePath+"/contents",schemaPath:"#/properties/contents/enum",keyword:"enum",params:{allowedValues: schema99.properties.contents.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}if(data.counts !== undefined){let data11 = data.counts;if(data11 && typeof data11 == "object" && !Array.isArray(data11)){if(data11.episodes === undefined){const err25 = {instancePath:instancePath+"/counts",schemaPath:"#/properties/counts/required",keyword:"required",params:{missingProperty: "episodes"},message:"must have required property '"+"episodes"+"'"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}if(data11.events === undefined){const err26 = {instancePath:instancePath+"/counts",schemaPath:"#/properties/counts/required",keyword:"required",params:{missingProperty: "events"},message:"must have required property '"+"events"+"'"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}if(data11.memories === undefined){const err27 = {instancePath:instancePath+"/counts",schemaPath:"#/properties/counts/required",keyword:"required",params:{missingProperty: "memories"},message:"must have required property '"+"memories"+"'"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}if(data11.grants === undefined){const err28 = {instancePath:instancePath+"/counts",schemaPath:"#/properties/counts/required",keyword:"required",params:{missingProperty: "grants"},message:"must have required property '"+"grants"+"'"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}for(const key2 in data11){if(!(((((key2 === "collections") || (key2 === "episodes")) || (key2 === "events")) || (key2 === "memories")) || (key2 === "grants"))){const err29 = {instancePath:instancePath+"/counts",schemaPath:"#/properties/counts/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}if(data11.collections !== undefined){if(!(validate315(data11.collections, {instancePath:instancePath+"/counts/collections",parentData:data11,parentDataProperty:"collections",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate315.errors : vErrors.concat(validate315.errors);errors = vErrors.length;}}if(data11.episodes !== undefined){if(!(validate315(data11.episodes, {instancePath:instancePath+"/counts/episodes",parentData:data11,parentDataProperty:"episodes",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate315.errors : vErrors.concat(validate315.errors);errors = vErrors.length;}}if(data11.events !== undefined){if(!(validate315(data11.events, {instancePath:instancePath+"/counts/events",parentData:data11,parentDataProperty:"events",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate315.errors : vErrors.concat(validate315.errors);errors = vErrors.length;}}if(data11.memories !== undefined){if(!(validate315(data11.memories, {instancePath:instancePath+"/counts/memories",parentData:data11,parentDataProperty:"memories",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate315.errors : vErrors.concat(validate315.errors);errors = vErrors.length;}}if(data11.grants !== undefined){if(!(validate315(data11.grants, {instancePath:instancePath+"/counts/grants",parentData:data11,parentDataProperty:"grants",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate315.errors : vErrors.concat(validate315.errors);errors = vErrors.length;}}}else {const err30 = {instancePath:instancePath+"/counts",schemaPath:"#/properties/counts/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}if(data.completeEpisodeIds !== undefined){let data17 = data.completeEpisodeIds;if(Array.isArray(data17)){if(data17.length > 1000000){const err31 = {instancePath:instancePath+"/completeEpisodeIds",schemaPath:"#/properties/completeEpisodeIds/maxItems",keyword:"maxItems",params:{limit: 1000000},message:"must NOT have more than 1000000 items"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}const len0 = data17.length;for(let i0=0; i0 1000000){const err33 = {instancePath:instancePath+"/completeViews",schemaPath:"#/properties/completeViews/maxItems",keyword:"maxItems",params:{limit: 1000000},message:"must NOT have more than 1000000 items"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}const len1 = data19.length;for(let i1=0; i1 4096){const err34 = {instancePath:instancePath+"/completeViews/" + i1,schemaPath:"#/properties/completeViews/items/maxLength",keyword:"maxLength",params:{limit: 4096},message:"must NOT have more than 4096 characters"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}if(func2(data20) < 1){const err35 = {instancePath:instancePath+"/completeViews/" + i1,schemaPath:"#/properties/completeViews/items/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}else {const err36 = {instancePath:instancePath+"/completeViews/" + i1,schemaPath:"#/properties/completeViews/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}}}else {const err37 = {instancePath:instancePath+"/completeViews",schemaPath:"#/properties/completeViews/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}if(data.completePrototypes !== undefined){let data21 = data.completePrototypes;if(Array.isArray(data21)){if(data21.length > 1000000){const err38 = {instancePath:instancePath+"/completePrototypes",schemaPath:"#/properties/completePrototypes/maxItems",keyword:"maxItems",params:{limit: 1000000},message:"must NOT have more than 1000000 items"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}const len2 = data21.length;for(let i2=0; i2 4096){const err39 = {instancePath:instancePath+"/completePrototypes/" + i2,schemaPath:"#/properties/completePrototypes/items/maxLength",keyword:"maxLength",params:{limit: 4096},message:"must NOT have more than 4096 characters"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}if(func2(data22) < 1){const err40 = {instancePath:instancePath+"/completePrototypes/" + i2,schemaPath:"#/properties/completePrototypes/items/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}}else {const err41 = {instancePath:instancePath+"/completePrototypes/" + i2,schemaPath:"#/properties/completePrototypes/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}}else {const err42 = {instancePath:instancePath+"/completePrototypes",schemaPath:"#/properties/completePrototypes/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data.excluded !== undefined){let data23 = data.excluded;if(Array.isArray(data23)){if(data23.length > 50){const err43 = {instancePath:instancePath+"/excluded",schemaPath:"#/properties/excluded/maxItems",keyword:"maxItems",params:{limit: 50},message:"must NOT have more than 50 items"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}const len3 = data23.length;for(let i3=0; i3 1000000){const err49 = {instancePath:instancePath+"/records",schemaPath:"#/properties/records/maxItems",keyword:"maxItems",params:{limit: 1000000},message:"must NOT have more than 1000000 items"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}const len4 = data27.length;for(let i4=0; i4 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate332.errors = vErrors;return errors === 0;}validate332.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate337(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate337.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(Array.isArray(data)){if(data.length > 6){const err0 = {instancePath,schemaPath:"#/maxItems",keyword:"maxItems",params:{limit: 6},message:"must NOT have more than 6 items"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.length < 1){const err1 = {instancePath,schemaPath:"#/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}const len0 = data.length;for(let i0=0; i0 2000){const err10 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data7) < 1){const err11 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.digest !== undefined){if(!(validate345(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate345.errors : vErrors.concat(validate345.errors);errors = vErrors.length;}}}else {const err13 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}validate328.errors = vErrors;return errors === 0;}validate328.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.guidance = validate347;const schema115 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/guidance.schema.json","title":"Replica guidance v1","description":"One time an agent asked for guidance: who asked, from where, and when. The learnings it received are delivered-learning records.","type":"object","additionalProperties":false,"required":["schemaVersion","id","scope","requestedAt","requestedBy","via","digest"],"properties":{"schemaVersion":{"const":"replica.guidance/v1"},"id":{"$ref":"common.schema.json#/$defs/id"},"scope":{"$ref":"common.schema.json#/$defs/scope"},"requestedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"requestedBy":{"$ref":"common.schema.json#/$defs/actor"},"via":{"description":"local: the command or MCP server on this machine. hub: a Hub agent connection.","enum":["local","hub"]},"session":{"description":"The coding agent session, when the agent names it. The label is the agent name and when the session started.","type":"object","additionalProperties":false,"required":["id"],"properties":{"id":{"type":"string","minLength":1,"maxLength":200},"label":{"type":"string","minLength":1,"maxLength":200}}},"digest":{"$ref":"common.schema.json#/$defs/digest"}}};function validate348(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate348.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate348.errors = vErrors;return errors === 0;}validate348.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate350(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate350.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate350.errors = vErrors;return errors === 0;}validate350.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate355(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate355.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate355.errors = vErrors;return errors === 0;}validate355.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate357(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate357.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((((key0 === "kind") || (key0 === "id")) || (key0 === "role")) || (key0 === "login")) || (key0 === "model")) || (key0 === "asserted"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((data0 === "human") || (data0 === "agent")) || (data0 === "system")) || (data0 === "service"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema23.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.id !== undefined){let data1 = data.id;if(typeof data1 === "string"){if(func2(data1) > 300){const err4 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 3){const err5 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern5.test(data1)){const err6 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},message:"must match pattern \""+"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.role !== undefined){if(!(validate59(data.role, {instancePath:instancePath+"/role",parentData:data,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.login !== undefined){let data3 = data.login;if(typeof data3 === "string"){if(!pattern7.test(data3)){const err8 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},message:"must match pattern \""+"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"+"\""};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.model !== undefined){let data4 = data.model;if(typeof data4 === "string"){if(func2(data4) > 200){const err10 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data4) < 1){const err11 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.asserted !== undefined){if(typeof data.asserted !== "boolean"){const err13 = {instancePath:instancePath+"/asserted",schemaPath:"#/properties/asserted/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate357.errors = vErrors;return errors === 0;}validate357.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate360(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate360.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate360.errors = vErrors;return errors === 0;}validate360.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate347(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/guidance.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate347.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.scope === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.requestedAt === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "requestedAt"},message:"must have required property '"+"requestedAt"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.requestedBy === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "requestedBy"},message:"must have required property '"+"requestedBy"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.via === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "via"},message:"must have required property '"+"via"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.digest === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}for(const key0 in data){if(!((((((((key0 === "schemaVersion") || (key0 === "id")) || (key0 === "scope")) || (key0 === "requestedAt")) || (key0 === "requestedBy")) || (key0 === "via")) || (key0 === "session")) || (key0 === "digest"))){const err7 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.schemaVersion !== undefined){if("replica.guidance/v1" !== data.schemaVersion){const err8 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.guidance/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.id !== undefined){if(!(validate348(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate348.errors : vErrors.concat(validate348.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate350(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate350.errors : vErrors.concat(validate350.errors);errors = vErrors.length;}}if(data.requestedAt !== undefined){if(!(validate355(data.requestedAt, {instancePath:instancePath+"/requestedAt",parentData:data,parentDataProperty:"requestedAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate355.errors : vErrors.concat(validate355.errors);errors = vErrors.length;}}if(data.requestedBy !== undefined){if(!(validate357(data.requestedBy, {instancePath:instancePath+"/requestedBy",parentData:data,parentDataProperty:"requestedBy",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate357.errors : vErrors.concat(validate357.errors);errors = vErrors.length;}}if(data.via !== undefined){let data5 = data.via;if(!((data5 === "local") || (data5 === "hub"))){const err9 = {instancePath:instancePath+"/via",schemaPath:"#/properties/via/enum",keyword:"enum",params:{allowedValues: schema115.properties.via.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.session !== undefined){let data6 = data.session;if(data6 && typeof data6 == "object" && !Array.isArray(data6)){if(data6.id === undefined){const err10 = {instancePath:instancePath+"/session",schemaPath:"#/properties/session/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}for(const key1 in data6){if(!((key1 === "id") || (key1 === "label"))){const err11 = {instancePath:instancePath+"/session",schemaPath:"#/properties/session/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data6.id !== undefined){let data7 = data6.id;if(typeof data7 === "string"){if(func2(data7) > 200){const err12 = {instancePath:instancePath+"/session/id",schemaPath:"#/properties/session/properties/id/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}if(func2(data7) < 1){const err13 = {instancePath:instancePath+"/session/id",schemaPath:"#/properties/session/properties/id/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}else {const err14 = {instancePath:instancePath+"/session/id",schemaPath:"#/properties/session/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data6.label !== undefined){let data8 = data6.label;if(typeof data8 === "string"){if(func2(data8) > 200){const err15 = {instancePath:instancePath+"/session/label",schemaPath:"#/properties/session/properties/label/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}if(func2(data8) < 1){const err16 = {instancePath:instancePath+"/session/label",schemaPath:"#/properties/session/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}else {const err17 = {instancePath:instancePath+"/session/label",schemaPath:"#/properties/session/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}}else {const err18 = {instancePath:instancePath+"/session",schemaPath:"#/properties/session/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data.digest !== undefined){if(!(validate360(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate360.errors : vErrors.concat(validate360.errors);errors = vErrors.length;}}}else {const err19 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}validate347.errors = vErrors;return errors === 0;}validate347.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.memoryProposal = validate362;const schema121 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/memory-proposal.schema.json","title":"Replica memory proposal v1","description":"What a consolidator returns. It never sets an ID, a scope, or a state: the host assigns the ID, takes the scope from the caller, and stores every proposal as proposed until a person reviews it.","type":"object","additionalProperties":false,"required":["schemaVersion","kind","content","evidence","rationale","lifecycle","consolidator"],"properties":{"schemaVersion":{"const":"replica.memory-proposal/v1"},"kind":{"$ref":"common.schema.json#/$defs/memoryKind"},"title":{"type":"string","minLength":1,"maxLength":120},"content":{"type":"string","minLength":1,"maxLength":4000},"themeKey":{"$ref":"common.schema.json#/$defs/slug"},"appliesTo":{"type":"array","maxItems":20,"items":{"$ref":"common.schema.json#/$defs/trace"}},"evidence":{"type":"array","minItems":1,"maxItems":500,"items":{"$ref":"evidence-ref.schema.json"}},"contradictions":{"type":"array","maxItems":500,"items":{"$ref":"evidence-ref.schema.json"}},"support":{"$ref":"memory-record.schema.json#/$defs/support"},"confidence":{"type":"number","minimum":0,"maximum":1},"rationale":{"$ref":"#/$defs/rationale"},"lifecycle":{"$ref":"#/$defs/lifecycle"},"consolidator":{"$ref":"#/$defs/consolidator"},"validFrom":{"$ref":"common.schema.json#/$defs/timestamp"},"validUntil":{"$ref":"common.schema.json#/$defs/timestamp"},"expiresAt":{"$ref":"common.schema.json#/$defs/timestamp"}},"$defs":{"consolidator":{"type":"object","additionalProperties":false,"required":["id","version"],"properties":{"id":{"$ref":"common.schema.json#/$defs/slug"},"version":{"type":"string","minLength":1,"maxLength":64}}},"rationale":{"description":"Why the learning recurs, what contradicts it, what it should improve, and how we would know it is wrong.","type":"object","additionalProperties":false,"required":["recurrence","expectedBenefit","falsification"],"properties":{"recurrence":{"type":"string","minLength":1,"maxLength":2000},"contradictions":{"type":"string","minLength":1,"maxLength":2000},"expectedBenefit":{"type":"string","minLength":1,"maxLength":2000},"falsification":{"type":"string","minLength":1,"maxLength":2000}}},"lifecycle":{"type":"object","additionalProperties":false,"required":["action"],"properties":{"action":{"enum":["new","merge","supersede","retire"]},"targets":{"type":"array","minItems":1,"maxItems":50,"items":{"$ref":"common.schema.json#/$defs/id"}}},"allOf":[{"if":{"properties":{"action":{"const":"new"}}},"then":{"not":{"required":["targets"]}},"else":{"required":["targets"]}}]}}};function validate363(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate363.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!(((((((data === "fact") || (data === "preference")) || (data === "rule")) || (data === "procedure")) || (data === "example")) || (data === "anti_pattern")) || (data === "design_principle"))){const err0 = {instancePath,schemaPath:"#/enum",keyword:"enum",params:{allowedValues: schema81.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}validate363.errors = vErrors;return errors === 0;}validate363.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate365(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate365.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(func2(data) > 128){const err0 = {instancePath,schemaPath:"#/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(func2(data) < 1){const err1 = {instancePath,schemaPath:"#/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(!pattern6.test(data)){const err2 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"},message:"must match pattern \""+"^[a-z0-9]+(?:[._-][a-z0-9]+)*$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}validate365.errors = vErrors;return errors === 0;}validate365.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate367(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate367.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.ref === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "ref"},message:"must have required property '"+"ref"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((key0 === "kind") || (key0 === "ref"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((((data0 === "rule") || (data0 === "skill")) || (data0 === "component")) || (data0 === "context")) || (data0 === "token")) || (data0 === "other"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema82.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.ref !== undefined){let data1 = data.ref;if(typeof data1 === "string"){if(func2(data1) > 500){const err4 = {instancePath:instancePath+"/ref",schemaPath:"#/properties/ref/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 1){const err5 = {instancePath:instancePath+"/ref",schemaPath:"#/properties/ref/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/ref",schemaPath:"#/properties/ref/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate367.errors = vErrors;return errors === 0;}validate367.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema132 = {"description":"Distinct sources behind a learning. Count distinct episodes, prototypes, Builds, and reviewers, never raw comments.","type":"object","additionalProperties":false,"required":["distinctEpisodes","distinctPrototypes","distinctReviewers","distinctBuilds"],"properties":{"distinctEpisodes":{"$ref":"common.schema.json#/$defs/count"},"distinctPrototypes":{"$ref":"common.schema.json#/$defs/count"},"distinctReviewers":{"$ref":"common.schema.json#/$defs/count"},"distinctBuilds":{"$ref":"common.schema.json#/$defs/count"}}};function validate390(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate390.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!(((typeof data == "number") && (!(data % 1) && !isNaN(data))) && (isFinite(data)))){const err0 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if((typeof data == "number") && (isFinite(data))){if(data > 9007199254740991 || isNaN(data)){const err1 = {instancePath,schemaPath:"#/maximum",keyword:"maximum",params:{comparison: "<=", limit: 9007199254740991},message:"must be <= 9007199254740991"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data < 0 || isNaN(data)){const err2 = {instancePath,schemaPath:"#/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}validate390.errors = vErrors;return errors === 0;}validate390.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate437(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate437.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.distinctEpisodes === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "distinctEpisodes"},message:"must have required property '"+"distinctEpisodes"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.distinctPrototypes === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "distinctPrototypes"},message:"must have required property '"+"distinctPrototypes"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.distinctReviewers === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "distinctReviewers"},message:"must have required property '"+"distinctReviewers"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.distinctBuilds === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "distinctBuilds"},message:"must have required property '"+"distinctBuilds"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data){if(!((((key0 === "distinctEpisodes") || (key0 === "distinctPrototypes")) || (key0 === "distinctReviewers")) || (key0 === "distinctBuilds"))){const err4 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.distinctEpisodes !== undefined){if(!(validate390(data.distinctEpisodes, {instancePath:instancePath+"/distinctEpisodes",parentData:data,parentDataProperty:"distinctEpisodes",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate390.errors : vErrors.concat(validate390.errors);errors = vErrors.length;}}if(data.distinctPrototypes !== undefined){if(!(validate390(data.distinctPrototypes, {instancePath:instancePath+"/distinctPrototypes",parentData:data,parentDataProperty:"distinctPrototypes",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate390.errors : vErrors.concat(validate390.errors);errors = vErrors.length;}}if(data.distinctReviewers !== undefined){if(!(validate390(data.distinctReviewers, {instancePath:instancePath+"/distinctReviewers",parentData:data,parentDataProperty:"distinctReviewers",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate390.errors : vErrors.concat(validate390.errors);errors = vErrors.length;}}if(data.distinctBuilds !== undefined){if(!(validate390(data.distinctBuilds, {instancePath:instancePath+"/distinctBuilds",parentData:data,parentDataProperty:"distinctBuilds",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate390.errors : vErrors.concat(validate390.errors);errors = vErrors.length;}}}else {const err5 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}validate437.errors = vErrors;return errors === 0;}validate437.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema136 = {"description":"Why the learning recurs, what contradicts it, what it should improve, and how we would know it is wrong.","type":"object","additionalProperties":false,"required":["recurrence","expectedBenefit","falsification"],"properties":{"recurrence":{"type":"string","minLength":1,"maxLength":2000},"contradictions":{"type":"string","minLength":1,"maxLength":2000},"expectedBenefit":{"type":"string","minLength":1,"maxLength":2000},"falsification":{"type":"string","minLength":1,"maxLength":2000}}};function validate443(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate443.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.recurrence === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "recurrence"},message:"must have required property '"+"recurrence"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.expectedBenefit === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "expectedBenefit"},message:"must have required property '"+"expectedBenefit"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.falsification === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "falsification"},message:"must have required property '"+"falsification"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}for(const key0 in data){if(!((((key0 === "recurrence") || (key0 === "contradictions")) || (key0 === "expectedBenefit")) || (key0 === "falsification"))){const err3 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.recurrence !== undefined){let data0 = data.recurrence;if(typeof data0 === "string"){if(func2(data0) > 2000){const err4 = {instancePath:instancePath+"/recurrence",schemaPath:"#/properties/recurrence/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data0) < 1){const err5 = {instancePath:instancePath+"/recurrence",schemaPath:"#/properties/recurrence/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/recurrence",schemaPath:"#/properties/recurrence/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.contradictions !== undefined){let data1 = data.contradictions;if(typeof data1 === "string"){if(func2(data1) > 2000){const err7 = {instancePath:instancePath+"/contradictions",schemaPath:"#/properties/contradictions/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func2(data1) < 1){const err8 = {instancePath:instancePath+"/contradictions",schemaPath:"#/properties/contradictions/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/contradictions",schemaPath:"#/properties/contradictions/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.expectedBenefit !== undefined){let data2 = data.expectedBenefit;if(typeof data2 === "string"){if(func2(data2) > 2000){const err10 = {instancePath:instancePath+"/expectedBenefit",schemaPath:"#/properties/expectedBenefit/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data2) < 1){const err11 = {instancePath:instancePath+"/expectedBenefit",schemaPath:"#/properties/expectedBenefit/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/expectedBenefit",schemaPath:"#/properties/expectedBenefit/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.falsification !== undefined){let data3 = data.falsification;if(typeof data3 === "string"){if(func2(data3) > 2000){const err13 = {instancePath:instancePath+"/falsification",schemaPath:"#/properties/falsification/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}if(func2(data3) < 1){const err14 = {instancePath:instancePath+"/falsification",schemaPath:"#/properties/falsification/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/falsification",schemaPath:"#/properties/falsification/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}validate443.errors = vErrors;return errors === 0;}validate443.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};const schema137 = {"type":"object","additionalProperties":false,"required":["action"],"properties":{"action":{"enum":["new","merge","supersede","retire"]},"targets":{"type":"array","minItems":1,"maxItems":50,"items":{"$ref":"common.schema.json#/$defs/id"}}},"allOf":[{"if":{"properties":{"action":{"const":"new"}}},"then":{"not":{"required":["targets"]}},"else":{"required":["targets"]}}]};function validate409(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate409.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate409.errors = vErrors;return errors === 0;}validate409.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate445(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate445.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}const _errs2 = errors;let valid1 = true;const _errs3 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.action !== undefined){if("new" !== data.action){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}}var _valid0 = _errs3 === errors;errors = _errs2;if(vErrors !== null){if(_errs2){vErrors.length = _errs2;}else {vErrors = null;}}let ifClause0;if(_valid0){const _errs5 = errors;const _errs6 = errors;const _errs7 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((data.targets === undefined) && (missing0 = "targets")){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}var valid3 = _errs7 === errors;if(valid3){const err2 = {instancePath,schemaPath:"#/allOf/0/then/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}else {errors = _errs6;if(vErrors !== null){if(_errs6){vErrors.length = _errs6;}else {vErrors = null;}}}var _valid0 = _errs5 === errors;valid1 = _valid0;ifClause0 = "then";}else {const _errs8 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.targets === undefined){const err3 = {instancePath,schemaPath:"#/allOf/0/else/required",keyword:"required",params:{missingProperty: "targets"},message:"must have required property '"+"targets"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}var _valid0 = _errs8 === errors;valid1 = _valid0;ifClause0 = "else";}if(!valid1){const err4 = {instancePath,schemaPath:"#/allOf/0/if",keyword:"if",params:{failingKeyword: ifClause0},message:"must match \""+ifClause0+"\" schema"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.action === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "action"},message:"must have required property '"+"action"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}for(const key0 in data){if(!((key0 === "action") || (key0 === "targets"))){const err6 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.action !== undefined){let data1 = data.action;if(!((((data1 === "new") || (data1 === "merge")) || (data1 === "supersede")) || (data1 === "retire"))){const err7 = {instancePath:instancePath+"/action",schemaPath:"#/properties/action/enum",keyword:"enum",params:{allowedValues: schema137.properties.action.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.targets !== undefined){let data2 = data.targets;if(Array.isArray(data2)){if(data2.length > 50){const err8 = {instancePath:instancePath+"/targets",schemaPath:"#/properties/targets/maxItems",keyword:"maxItems",params:{limit: 50},message:"must NOT have more than 50 items"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data2.length < 1){const err9 = {instancePath:instancePath+"/targets",schemaPath:"#/properties/targets/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}const len0 = data2.length;for(let i0=0; i0 64){const err3 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/maxLength",keyword:"maxLength",params:{limit: 64},message:"must NOT have more than 64 characters"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(func2(data1) < 1){const err4 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}else {const err5 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}}else {const err6 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}validate448.errors = vErrors;return errors === 0;}validate448.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate451(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate451.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate451.errors = vErrors;return errors === 0;}validate451.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate362(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/memory-proposal.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate362.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.kind === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.content === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "content"},message:"must have required property '"+"content"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.evidence === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "evidence"},message:"must have required property '"+"evidence"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.rationale === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "rationale"},message:"must have required property '"+"rationale"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.lifecycle === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "lifecycle"},message:"must have required property '"+"lifecycle"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.consolidator === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "consolidator"},message:"must have required property '"+"consolidator"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}for(const key0 in data){if(!(func1.call(schema121.properties, key0))){const err7 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.schemaVersion !== undefined){if("replica.memory-proposal/v1" !== data.schemaVersion){const err8 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.memory-proposal/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.kind !== undefined){if(!(validate363(data.kind, {instancePath:instancePath+"/kind",parentData:data,parentDataProperty:"kind",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate363.errors : vErrors.concat(validate363.errors);errors = vErrors.length;}}if(data.title !== undefined){let data2 = data.title;if(typeof data2 === "string"){if(func2(data2) > 120){const err9 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(func2(data2) < 1){const err10 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}else {const err11 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data.content !== undefined){let data3 = data.content;if(typeof data3 === "string"){if(func2(data3) > 4000){const err12 = {instancePath:instancePath+"/content",schemaPath:"#/properties/content/maxLength",keyword:"maxLength",params:{limit: 4000},message:"must NOT have more than 4000 characters"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}if(func2(data3) < 1){const err13 = {instancePath:instancePath+"/content",schemaPath:"#/properties/content/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}else {const err14 = {instancePath:instancePath+"/content",schemaPath:"#/properties/content/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data.themeKey !== undefined){if(!(validate365(data.themeKey, {instancePath:instancePath+"/themeKey",parentData:data,parentDataProperty:"themeKey",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate365.errors : vErrors.concat(validate365.errors);errors = vErrors.length;}}if(data.appliesTo !== undefined){let data5 = data.appliesTo;if(Array.isArray(data5)){if(data5.length > 20){const err15 = {instancePath:instancePath+"/appliesTo",schemaPath:"#/properties/appliesTo/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}const len0 = data5.length;for(let i0=0; i0 500){const err17 = {instancePath:instancePath+"/evidence",schemaPath:"#/properties/evidence/maxItems",keyword:"maxItems",params:{limit: 500},message:"must NOT have more than 500 items"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}if(data7.length < 1){const err18 = {instancePath:instancePath+"/evidence",schemaPath:"#/properties/evidence/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}const len1 = data7.length;for(let i1=0; i1 500){const err20 = {instancePath:instancePath+"/contradictions",schemaPath:"#/properties/contradictions/maxItems",keyword:"maxItems",params:{limit: 500},message:"must NOT have more than 500 items"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}const len2 = data9.length;for(let i2=0; i2 1 || isNaN(data12)){const err22 = {instancePath:instancePath+"/confidence",schemaPath:"#/properties/confidence/maximum",keyword:"maximum",params:{comparison: "<=", limit: 1},message:"must be <= 1"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}if(data12 < 0 || isNaN(data12)){const err23 = {instancePath:instancePath+"/confidence",schemaPath:"#/properties/confidence/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}else {const err24 = {instancePath:instancePath+"/confidence",schemaPath:"#/properties/confidence/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}if(data.rationale !== undefined){if(!(validate443(data.rationale, {instancePath:instancePath+"/rationale",parentData:data,parentDataProperty:"rationale",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate443.errors : vErrors.concat(validate443.errors);errors = vErrors.length;}}if(data.lifecycle !== undefined){if(!(validate445(data.lifecycle, {instancePath:instancePath+"/lifecycle",parentData:data,parentDataProperty:"lifecycle",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate445.errors : vErrors.concat(validate445.errors);errors = vErrors.length;}}if(data.consolidator !== undefined){if(!(validate448(data.consolidator, {instancePath:instancePath+"/consolidator",parentData:data,parentDataProperty:"consolidator",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate448.errors : vErrors.concat(validate448.errors);errors = vErrors.length;}}if(data.validFrom !== undefined){if(!(validate451(data.validFrom, {instancePath:instancePath+"/validFrom",parentData:data,parentDataProperty:"validFrom",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate451.errors : vErrors.concat(validate451.errors);errors = vErrors.length;}}if(data.validUntil !== undefined){if(!(validate451(data.validUntil, {instancePath:instancePath+"/validUntil",parentData:data,parentDataProperty:"validUntil",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate451.errors : vErrors.concat(validate451.errors);errors = vErrors.length;}}if(data.expiresAt !== undefined){if(!(validate451(data.expiresAt, {instancePath:instancePath+"/expiresAt",parentData:data,parentDataProperty:"expiresAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate451.errors : vErrors.concat(validate451.errors);errors = vErrors.length;}}}else {const err25 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}validate362.errors = vErrors;return errors === 0;}validate362.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.memoryRecord = validate371;const schema125 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/memory-record.schema.json","title":"Replica memory record v1","description":"One version of an explicit learning. Every lifecycle change appends a new version with the next version number and previousDigest. contentDigest identifies the learning itself: scope, kind, content, targets, lifecycle, evidence, and validity dates; an approval is valid only while accepted.contentDigest equals it. reviewDigest covers everything a reviewer is shown, adding contradictions, support, confidence, rationale, and the proposer; accepting or rejecting requires the reviewDigest the person reviewed.","type":"object","additionalProperties":false,"required":["schemaVersion","id","version","scope","kind","state","content","evidence","contentDigest","reviewDigest","proposal","provenance","createdAt","updatedAt","digest"],"properties":{"schemaVersion":{"const":"replica.memory/v1"},"id":{"$ref":"common.schema.json#/$defs/id"},"version":{"type":"integer","minimum":1,"maximum":1000000},"previousDigest":{"$ref":"common.schema.json#/$defs/digest"},"scope":{"$ref":"common.schema.json#/$defs/scope"},"kind":{"$ref":"common.schema.json#/$defs/memoryKind"},"state":{"enum":["proposed","accepted","rejected","retired"]},"title":{"type":"string","minLength":1,"maxLength":120},"content":{"type":"string","minLength":1,"maxLength":4000},"themeKey":{"$ref":"common.schema.json#/$defs/slug"},"appliesTo":{"type":"array","maxItems":20,"items":{"$ref":"common.schema.json#/$defs/trace"}},"evidence":{"type":"array","minItems":1,"maxItems":500,"items":{"$ref":"evidence-ref.schema.json"}},"contradictions":{"type":"array","maxItems":500,"items":{"$ref":"evidence-ref.schema.json"}},"support":{"$ref":"#/$defs/support"},"confidence":{"description":"Optional metadata from the proposer. Never a measure of truth.","type":"number","minimum":0,"maximum":1},"validFrom":{"$ref":"common.schema.json#/$defs/timestamp"},"validUntil":{"$ref":"common.schema.json#/$defs/timestamp"},"expiresAt":{"$ref":"common.schema.json#/$defs/timestamp"},"supersedes":{"description":"Learnings this accepted learning replaces. Acceptance sets it from the reviewed lifecycle targets, and a later step may only add to it. No ID repeats. A proposed or rejected learning never carries it. Replaced learnings keep their own state; readers derive which replacement wins.","type":"array","minItems":1,"maxItems":50,"items":{"$ref":"common.schema.json#/$defs/id"}},"contentDigest":{"$ref":"common.schema.json#/$defs/digest"},"reviewDigest":{"$ref":"common.schema.json#/$defs/digest"},"proposal":{"type":"object","additionalProperties":false,"required":["consolidator","rationale","lifecycle","proposedAt","proposedBy","proposalDigest"],"properties":{"consolidator":{"$ref":"memory-proposal.schema.json#/$defs/consolidator"},"rationale":{"$ref":"memory-proposal.schema.json#/$defs/rationale"},"lifecycle":{"$ref":"memory-proposal.schema.json#/$defs/lifecycle"},"proposedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"proposedBy":{"$ref":"common.schema.json#/$defs/actor"},"proposalDigest":{"$ref":"common.schema.json#/$defs/digest"}}},"accepted":{"type":"object","additionalProperties":false,"required":["by","at","contentDigest","reviewedDigest","edited"],"properties":{"by":{"$ref":"common.schema.json#/$defs/humanActor"},"at":{"$ref":"common.schema.json#/$defs/timestamp"},"contentDigest":{"$ref":"common.schema.json#/$defs/digest"},"reviewedDigest":{"$ref":"common.schema.json#/$defs/digest"},"edited":{"type":"boolean"},"decision":{"enum":["edit","reinstate"]},"requestedFields":{"type":"array","items":{"enum":["title","content"]},"minItems":1,"maxItems":2},"operationId":{"type":"string","pattern":"^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$"},"note":{"type":"string","minLength":1,"maxLength":2000}}},"rejected":{"type":"object","additionalProperties":false,"required":["by","at","reviewedDigest","reason"],"properties":{"by":{"$ref":"common.schema.json#/$defs/humanActor"},"at":{"$ref":"common.schema.json#/$defs/timestamp"},"reviewedDigest":{"$ref":"common.schema.json#/$defs/digest"},"reason":{"type":"string","minLength":1,"maxLength":2000},"operationId":{"type":"string","pattern":"^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$"}}},"retired":{"type":"object","additionalProperties":false,"required":["at","reason"],"properties":{"by":{"$ref":"common.schema.json#/$defs/humanActor"},"at":{"$ref":"common.schema.json#/$defs/timestamp"},"reason":{"type":"string","minLength":1,"maxLength":2000},"operationId":{"type":"string","pattern":"^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$"}}},"provenance":{"$ref":"common.schema.json#/$defs/provenance"},"createdAt":{"$ref":"common.schema.json#/$defs/timestamp"},"updatedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"digest":{"$ref":"common.schema.json#/$defs/digest"}},"allOf":[{"if":{"properties":{"version":{"const":1}}},"then":{"not":{"required":["previousDigest"]}},"else":{"required":["previousDigest"]}},{"if":{"properties":{"state":{"const":"proposed"}}},"then":{"not":{"anyOf":[{"required":["accepted"]},{"required":["rejected"]},{"required":["retired"]},{"required":["supersedes"]}]}}},{"if":{"properties":{"state":{"const":"accepted"}}},"then":{"required":["accepted"],"not":{"anyOf":[{"required":["rejected"]},{"required":["retired"]}]}}},{"if":{"properties":{"state":{"const":"rejected"}}},"then":{"required":["rejected"],"not":{"anyOf":[{"required":["accepted"]},{"required":["retired"]},{"required":["supersedes"]}]}}},{"if":{"properties":{"state":{"const":"retired"}}},"then":{"required":["accepted","retired"],"not":{"required":["rejected"]}}}],"$defs":{"support":{"description":"Distinct sources behind a learning. Count distinct episodes, prototypes, Builds, and reviewers, never raw comments.","type":"object","additionalProperties":false,"required":["distinctEpisodes","distinctPrototypes","distinctReviewers","distinctBuilds"],"properties":{"distinctEpisodes":{"$ref":"common.schema.json#/$defs/count"},"distinctPrototypes":{"$ref":"common.schema.json#/$defs/count"},"distinctReviewers":{"$ref":"common.schema.json#/$defs/count"},"distinctBuilds":{"$ref":"common.schema.json#/$defs/count"}}}}};function validate372(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate372.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate372.errors = vErrors;return errors === 0;}validate372.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate374(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate374.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate374.errors = vErrors;return errors === 0;}validate374.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate376(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate376.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate376.errors = vErrors;return errors === 0;}validate376.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate381(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate381.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!(((((((data === "fact") || (data === "preference")) || (data === "rule")) || (data === "procedure")) || (data === "example")) || (data === "anti_pattern")) || (data === "design_principle"))){const err0 = {instancePath,schemaPath:"#/enum",keyword:"enum",params:{allowedValues: schema81.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}validate381.errors = vErrors;return errors === 0;}validate381.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate383(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate383.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(func2(data) > 128){const err0 = {instancePath,schemaPath:"#/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(func2(data) < 1){const err1 = {instancePath,schemaPath:"#/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(!pattern6.test(data)){const err2 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"},message:"must match pattern \""+"^[a-z0-9]+(?:[._-][a-z0-9]+)*$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}validate383.errors = vErrors;return errors === 0;}validate383.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate385(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate385.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.ref === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "ref"},message:"must have required property '"+"ref"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((key0 === "kind") || (key0 === "ref"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((((data0 === "rule") || (data0 === "skill")) || (data0 === "component")) || (data0 === "context")) || (data0 === "token")) || (data0 === "other"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema82.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.ref !== undefined){let data1 = data.ref;if(typeof data1 === "string"){if(func2(data1) > 500){const err4 = {instancePath:instancePath+"/ref",schemaPath:"#/properties/ref/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 1){const err5 = {instancePath:instancePath+"/ref",schemaPath:"#/properties/ref/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/ref",schemaPath:"#/properties/ref/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate385.errors = vErrors;return errors === 0;}validate385.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate389(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate389.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.distinctEpisodes === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "distinctEpisodes"},message:"must have required property '"+"distinctEpisodes"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.distinctPrototypes === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "distinctPrototypes"},message:"must have required property '"+"distinctPrototypes"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.distinctReviewers === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "distinctReviewers"},message:"must have required property '"+"distinctReviewers"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.distinctBuilds === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "distinctBuilds"},message:"must have required property '"+"distinctBuilds"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data){if(!((((key0 === "distinctEpisodes") || (key0 === "distinctPrototypes")) || (key0 === "distinctReviewers")) || (key0 === "distinctBuilds"))){const err4 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.distinctEpisodes !== undefined){if(!(validate390(data.distinctEpisodes, {instancePath:instancePath+"/distinctEpisodes",parentData:data,parentDataProperty:"distinctEpisodes",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate390.errors : vErrors.concat(validate390.errors);errors = vErrors.length;}}if(data.distinctPrototypes !== undefined){if(!(validate390(data.distinctPrototypes, {instancePath:instancePath+"/distinctPrototypes",parentData:data,parentDataProperty:"distinctPrototypes",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate390.errors : vErrors.concat(validate390.errors);errors = vErrors.length;}}if(data.distinctReviewers !== undefined){if(!(validate390(data.distinctReviewers, {instancePath:instancePath+"/distinctReviewers",parentData:data,parentDataProperty:"distinctReviewers",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate390.errors : vErrors.concat(validate390.errors);errors = vErrors.length;}}if(data.distinctBuilds !== undefined){if(!(validate390(data.distinctBuilds, {instancePath:instancePath+"/distinctBuilds",parentData:data,parentDataProperty:"distinctBuilds",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate390.errors : vErrors.concat(validate390.errors);errors = vErrors.length;}}}else {const err5 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}validate389.errors = vErrors;return errors === 0;}validate389.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate396(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate396.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate396.errors = vErrors;return errors === 0;}validate396.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate403(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate403.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.id === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.version === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "version"},message:"must have required property '"+"version"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((key0 === "id") || (key0 === "version"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.id !== undefined){if(!(validate365(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate365.errors : vErrors.concat(validate365.errors);errors = vErrors.length;}}if(data.version !== undefined){let data1 = data.version;if(typeof data1 === "string"){if(func2(data1) > 64){const err3 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/maxLength",keyword:"maxLength",params:{limit: 64},message:"must NOT have more than 64 characters"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(func2(data1) < 1){const err4 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}else {const err5 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}}else {const err6 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}validate403.errors = vErrors;return errors === 0;}validate403.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate406(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate406.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.recurrence === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "recurrence"},message:"must have required property '"+"recurrence"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.expectedBenefit === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "expectedBenefit"},message:"must have required property '"+"expectedBenefit"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.falsification === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "falsification"},message:"must have required property '"+"falsification"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}for(const key0 in data){if(!((((key0 === "recurrence") || (key0 === "contradictions")) || (key0 === "expectedBenefit")) || (key0 === "falsification"))){const err3 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.recurrence !== undefined){let data0 = data.recurrence;if(typeof data0 === "string"){if(func2(data0) > 2000){const err4 = {instancePath:instancePath+"/recurrence",schemaPath:"#/properties/recurrence/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data0) < 1){const err5 = {instancePath:instancePath+"/recurrence",schemaPath:"#/properties/recurrence/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/recurrence",schemaPath:"#/properties/recurrence/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.contradictions !== undefined){let data1 = data.contradictions;if(typeof data1 === "string"){if(func2(data1) > 2000){const err7 = {instancePath:instancePath+"/contradictions",schemaPath:"#/properties/contradictions/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(func2(data1) < 1){const err8 = {instancePath:instancePath+"/contradictions",schemaPath:"#/properties/contradictions/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/contradictions",schemaPath:"#/properties/contradictions/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.expectedBenefit !== undefined){let data2 = data.expectedBenefit;if(typeof data2 === "string"){if(func2(data2) > 2000){const err10 = {instancePath:instancePath+"/expectedBenefit",schemaPath:"#/properties/expectedBenefit/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data2) < 1){const err11 = {instancePath:instancePath+"/expectedBenefit",schemaPath:"#/properties/expectedBenefit/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/expectedBenefit",schemaPath:"#/properties/expectedBenefit/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.falsification !== undefined){let data3 = data.falsification;if(typeof data3 === "string"){if(func2(data3) > 2000){const err13 = {instancePath:instancePath+"/falsification",schemaPath:"#/properties/falsification/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}if(func2(data3) < 1){const err14 = {instancePath:instancePath+"/falsification",schemaPath:"#/properties/falsification/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/falsification",schemaPath:"#/properties/falsification/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}}else {const err16 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}validate406.errors = vErrors;return errors === 0;}validate406.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate408(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate408.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}const _errs2 = errors;let valid1 = true;const _errs3 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.action !== undefined){if("new" !== data.action){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}}var _valid0 = _errs3 === errors;errors = _errs2;if(vErrors !== null){if(_errs2){vErrors.length = _errs2;}else {vErrors = null;}}let ifClause0;if(_valid0){const _errs5 = errors;const _errs6 = errors;const _errs7 = errors;if(data && typeof data == "object" && !Array.isArray(data)){let missing0;if((data.targets === undefined) && (missing0 = "targets")){const err1 = {};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}var valid3 = _errs7 === errors;if(valid3){const err2 = {instancePath,schemaPath:"#/allOf/0/then/not",keyword:"not",params:{},message:"must NOT be valid"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}else {errors = _errs6;if(vErrors !== null){if(_errs6){vErrors.length = _errs6;}else {vErrors = null;}}}var _valid0 = _errs5 === errors;valid1 = _valid0;ifClause0 = "then";}else {const _errs8 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.targets === undefined){const err3 = {instancePath,schemaPath:"#/allOf/0/else/required",keyword:"required",params:{missingProperty: "targets"},message:"must have required property '"+"targets"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}var _valid0 = _errs8 === errors;valid1 = _valid0;ifClause0 = "else";}if(!valid1){const err4 = {instancePath,schemaPath:"#/allOf/0/if",keyword:"if",params:{failingKeyword: ifClause0},message:"must match \""+ifClause0+"\" schema"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.action === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "action"},message:"must have required property '"+"action"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}for(const key0 in data){if(!((key0 === "action") || (key0 === "targets"))){const err6 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.action !== undefined){let data1 = data.action;if(!((((data1 === "new") || (data1 === "merge")) || (data1 === "supersede")) || (data1 === "retire"))){const err7 = {instancePath:instancePath+"/action",schemaPath:"#/properties/action/enum",keyword:"enum",params:{allowedValues: schema137.properties.action.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.targets !== undefined){let data2 = data.targets;if(Array.isArray(data2)){if(data2.length > 50){const err8 = {instancePath:instancePath+"/targets",schemaPath:"#/properties/targets/maxItems",keyword:"maxItems",params:{limit: 50},message:"must NOT have more than 50 items"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data2.length < 1){const err9 = {instancePath:instancePath+"/targets",schemaPath:"#/properties/targets/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}const len0 = data2.length;for(let i0=0; i0 300){const err4 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 3){const err5 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern5.test(data1)){const err6 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},message:"must match pattern \""+"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.role !== undefined){if(!(validate59(data.role, {instancePath:instancePath+"/role",parentData:data,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.login !== undefined){let data3 = data.login;if(typeof data3 === "string"){if(!pattern7.test(data3)){const err8 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},message:"must match pattern \""+"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"+"\""};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.model !== undefined){let data4 = data.model;if(typeof data4 === "string"){if(func2(data4) > 200){const err10 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data4) < 1){const err11 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.asserted !== undefined){if(typeof data.asserted !== "boolean"){const err13 = {instancePath:instancePath+"/asserted",schemaPath:"#/properties/asserted/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate413.errors = vErrors;return errors === 0;}validate413.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate417(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate417.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!(validate132(data, {instancePath,parentData,parentDataProperty,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate132.errors : vErrors.concat(validate132.errors);errors = vErrors.length;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind !== undefined){if("human" !== data.kind){const err0 = {instancePath:instancePath+"/kind",schemaPath:"#/allOf/1/properties/kind/const",keyword:"const",params:{allowedValue: "human"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}}else {const err1 = {instancePath,schemaPath:"#/allOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate417.errors = vErrors;return errors === 0;}validate417.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate428(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate428.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.producer === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "producer"},message:"must have required property '"+"producer"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.method === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "method"},message:"must have required property '"+"method"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.createdAt === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "createdAt"},message:"must have required property '"+"createdAt"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.createdBy === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "createdBy"},message:"must have required property '"+"createdBy"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}for(const key0 in data){if(!(((((key0 === "producer") || (key0 === "method")) || (key0 === "createdAt")) || (key0 === "createdBy")) || (key0 === "inputs"))){const err4 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.producer !== undefined){if(!(validate191(data.producer, {instancePath:instancePath+"/producer",parentData:data,parentDataProperty:"producer",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate191.errors : vErrors.concat(validate191.errors);errors = vErrors.length;}}if(data.method !== undefined){let data1 = data.method;if(typeof data1 === "string"){if(func2(data1) > 128){const err5 = {instancePath:instancePath+"/method",schemaPath:"#/properties/method/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern48.test(data1)){const err6 = {instancePath:instancePath+"/method",schemaPath:"#/properties/method/pattern",keyword:"pattern",params:{pattern: "^[a-z]+:[a-z0-9_.-]+$"},message:"must match pattern \""+"^[a-z]+:[a-z0-9_.-]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/method",schemaPath:"#/properties/method/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.createdAt !== undefined){if(!(validate193(data.createdAt, {instancePath:instancePath+"/createdAt",parentData:data,parentDataProperty:"createdAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate193.errors : vErrors.concat(validate193.errors);errors = vErrors.length;}}if(data.createdBy !== undefined){if(!(validate132(data.createdBy, {instancePath:instancePath+"/createdBy",parentData:data,parentDataProperty:"createdBy",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate132.errors : vErrors.concat(validate132.errors);errors = vErrors.length;}}if(data.inputs !== undefined){let data4 = data.inputs;if(Array.isArray(data4)){if(data4.length > 1000){const err8 = {instancePath:instancePath+"/inputs",schemaPath:"#/properties/inputs/maxItems",keyword:"maxItems",params:{limit: 1000},message:"must NOT have more than 1000 items"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}const len0 = data4.length;for(let i0=0; i0 1000000 || isNaN(data7)){const err52 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/maximum",keyword:"maximum",params:{comparison: "<=", limit: 1000000},message:"must be <= 1000000"};if(vErrors === null){vErrors = [err52];}else {vErrors.push(err52);}errors++;}if(data7 < 1 || isNaN(data7)){const err53 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err53];}else {vErrors.push(err53);}errors++;}}}if(data.previousDigest !== undefined){if(!(validate374(data.previousDigest, {instancePath:instancePath+"/previousDigest",parentData:data,parentDataProperty:"previousDigest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate374.errors : vErrors.concat(validate374.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate376(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate376.errors : vErrors.concat(validate376.errors);errors = vErrors.length;}}if(data.kind !== undefined){if(!(validate381(data.kind, {instancePath:instancePath+"/kind",parentData:data,parentDataProperty:"kind",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate381.errors : vErrors.concat(validate381.errors);errors = vErrors.length;}}if(data.state !== undefined){let data11 = data.state;if(!((((data11 === "proposed") || (data11 === "accepted")) || (data11 === "rejected")) || (data11 === "retired"))){const err54 = {instancePath:instancePath+"/state",schemaPath:"#/properties/state/enum",keyword:"enum",params:{allowedValues: schema125.properties.state.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err54];}else {vErrors.push(err54);}errors++;}}if(data.title !== undefined){let data12 = data.title;if(typeof data12 === "string"){if(func2(data12) > 120){const err55 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err55];}else {vErrors.push(err55);}errors++;}if(func2(data12) < 1){const err56 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err56];}else {vErrors.push(err56);}errors++;}}else {const err57 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err57];}else {vErrors.push(err57);}errors++;}}if(data.content !== undefined){let data13 = data.content;if(typeof data13 === "string"){if(func2(data13) > 4000){const err58 = {instancePath:instancePath+"/content",schemaPath:"#/properties/content/maxLength",keyword:"maxLength",params:{limit: 4000},message:"must NOT have more than 4000 characters"};if(vErrors === null){vErrors = [err58];}else {vErrors.push(err58);}errors++;}if(func2(data13) < 1){const err59 = {instancePath:instancePath+"/content",schemaPath:"#/properties/content/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err59];}else {vErrors.push(err59);}errors++;}}else {const err60 = {instancePath:instancePath+"/content",schemaPath:"#/properties/content/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err60];}else {vErrors.push(err60);}errors++;}}if(data.themeKey !== undefined){if(!(validate383(data.themeKey, {instancePath:instancePath+"/themeKey",parentData:data,parentDataProperty:"themeKey",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate383.errors : vErrors.concat(validate383.errors);errors = vErrors.length;}}if(data.appliesTo !== undefined){let data15 = data.appliesTo;if(Array.isArray(data15)){if(data15.length > 20){const err61 = {instancePath:instancePath+"/appliesTo",schemaPath:"#/properties/appliesTo/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err61];}else {vErrors.push(err61);}errors++;}const len0 = data15.length;for(let i0=0; i0 500){const err63 = {instancePath:instancePath+"/evidence",schemaPath:"#/properties/evidence/maxItems",keyword:"maxItems",params:{limit: 500},message:"must NOT have more than 500 items"};if(vErrors === null){vErrors = [err63];}else {vErrors.push(err63);}errors++;}if(data17.length < 1){const err64 = {instancePath:instancePath+"/evidence",schemaPath:"#/properties/evidence/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err64];}else {vErrors.push(err64);}errors++;}const len1 = data17.length;for(let i1=0; i1 500){const err66 = {instancePath:instancePath+"/contradictions",schemaPath:"#/properties/contradictions/maxItems",keyword:"maxItems",params:{limit: 500},message:"must NOT have more than 500 items"};if(vErrors === null){vErrors = [err66];}else {vErrors.push(err66);}errors++;}const len2 = data19.length;for(let i2=0; i2 1 || isNaN(data22)){const err68 = {instancePath:instancePath+"/confidence",schemaPath:"#/properties/confidence/maximum",keyword:"maximum",params:{comparison: "<=", limit: 1},message:"must be <= 1"};if(vErrors === null){vErrors = [err68];}else {vErrors.push(err68);}errors++;}if(data22 < 0 || isNaN(data22)){const err69 = {instancePath:instancePath+"/confidence",schemaPath:"#/properties/confidence/minimum",keyword:"minimum",params:{comparison: ">=", limit: 0},message:"must be >= 0"};if(vErrors === null){vErrors = [err69];}else {vErrors.push(err69);}errors++;}}else {const err70 = {instancePath:instancePath+"/confidence",schemaPath:"#/properties/confidence/type",keyword:"type",params:{type: "number"},message:"must be number"};if(vErrors === null){vErrors = [err70];}else {vErrors.push(err70);}errors++;}}if(data.validFrom !== undefined){if(!(validate396(data.validFrom, {instancePath:instancePath+"/validFrom",parentData:data,parentDataProperty:"validFrom",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate396.errors : vErrors.concat(validate396.errors);errors = vErrors.length;}}if(data.validUntil !== undefined){if(!(validate396(data.validUntil, {instancePath:instancePath+"/validUntil",parentData:data,parentDataProperty:"validUntil",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate396.errors : vErrors.concat(validate396.errors);errors = vErrors.length;}}if(data.expiresAt !== undefined){if(!(validate396(data.expiresAt, {instancePath:instancePath+"/expiresAt",parentData:data,parentDataProperty:"expiresAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate396.errors : vErrors.concat(validate396.errors);errors = vErrors.length;}}if(data.supersedes !== undefined){let data26 = data.supersedes;if(Array.isArray(data26)){if(data26.length > 50){const err71 = {instancePath:instancePath+"/supersedes",schemaPath:"#/properties/supersedes/maxItems",keyword:"maxItems",params:{limit: 50},message:"must NOT have more than 50 items"};if(vErrors === null){vErrors = [err71];}else {vErrors.push(err71);}errors++;}if(data26.length < 1){const err72 = {instancePath:instancePath+"/supersedes",schemaPath:"#/properties/supersedes/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err72];}else {vErrors.push(err72);}errors++;}const len3 = data26.length;for(let i3=0; i3 2){const err90 = {instancePath:instancePath+"/accepted/requestedFields",schemaPath:"#/properties/accepted/properties/requestedFields/maxItems",keyword:"maxItems",params:{limit: 2},message:"must NOT have more than 2 items"};if(vErrors === null){vErrors = [err90];}else {vErrors.push(err90);}errors++;}if(data44.length < 1){const err91 = {instancePath:instancePath+"/accepted/requestedFields",schemaPath:"#/properties/accepted/properties/requestedFields/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err91];}else {vErrors.push(err91);}errors++;}const len4 = data44.length;for(let i4=0; i4 2000){const err96 = {instancePath:instancePath+"/accepted/note",schemaPath:"#/properties/accepted/properties/note/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err96];}else {vErrors.push(err96);}errors++;}if(func2(data47) < 1){const err97 = {instancePath:instancePath+"/accepted/note",schemaPath:"#/properties/accepted/properties/note/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err97];}else {vErrors.push(err97);}errors++;}}else {const err98 = {instancePath:instancePath+"/accepted/note",schemaPath:"#/properties/accepted/properties/note/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err98];}else {vErrors.push(err98);}errors++;}}}else {const err99 = {instancePath:instancePath+"/accepted",schemaPath:"#/properties/accepted/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err99];}else {vErrors.push(err99);}errors++;}}if(data.rejected !== undefined){let data48 = data.rejected;if(data48 && typeof data48 == "object" && !Array.isArray(data48)){if(data48.by === undefined){const err100 = {instancePath:instancePath+"/rejected",schemaPath:"#/properties/rejected/required",keyword:"required",params:{missingProperty: "by"},message:"must have required property '"+"by"+"'"};if(vErrors === null){vErrors = [err100];}else {vErrors.push(err100);}errors++;}if(data48.at === undefined){const err101 = {instancePath:instancePath+"/rejected",schemaPath:"#/properties/rejected/required",keyword:"required",params:{missingProperty: "at"},message:"must have required property '"+"at"+"'"};if(vErrors === null){vErrors = [err101];}else {vErrors.push(err101);}errors++;}if(data48.reviewedDigest === undefined){const err102 = {instancePath:instancePath+"/rejected",schemaPath:"#/properties/rejected/required",keyword:"required",params:{missingProperty: "reviewedDigest"},message:"must have required property '"+"reviewedDigest"+"'"};if(vErrors === null){vErrors = [err102];}else {vErrors.push(err102);}errors++;}if(data48.reason === undefined){const err103 = {instancePath:instancePath+"/rejected",schemaPath:"#/properties/rejected/required",keyword:"required",params:{missingProperty: "reason"},message:"must have required property '"+"reason"+"'"};if(vErrors === null){vErrors = [err103];}else {vErrors.push(err103);}errors++;}for(const key3 in data48){if(!(((((key3 === "by") || (key3 === "at")) || (key3 === "reviewedDigest")) || (key3 === "reason")) || (key3 === "operationId"))){const err104 = {instancePath:instancePath+"/rejected",schemaPath:"#/properties/rejected/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key3},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err104];}else {vErrors.push(err104);}errors++;}}if(data48.by !== undefined){if(!(validate417(data48.by, {instancePath:instancePath+"/rejected/by",parentData:data48,parentDataProperty:"by",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate417.errors : vErrors.concat(validate417.errors);errors = vErrors.length;}}if(data48.at !== undefined){if(!(validate396(data48.at, {instancePath:instancePath+"/rejected/at",parentData:data48,parentDataProperty:"at",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate396.errors : vErrors.concat(validate396.errors);errors = vErrors.length;}}if(data48.reviewedDigest !== undefined){if(!(validate374(data48.reviewedDigest, {instancePath:instancePath+"/rejected/reviewedDigest",parentData:data48,parentDataProperty:"reviewedDigest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate374.errors : vErrors.concat(validate374.errors);errors = vErrors.length;}}if(data48.reason !== undefined){let data52 = data48.reason;if(typeof data52 === "string"){if(func2(data52) > 2000){const err105 = {instancePath:instancePath+"/rejected/reason",schemaPath:"#/properties/rejected/properties/reason/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err105];}else {vErrors.push(err105);}errors++;}if(func2(data52) < 1){const err106 = {instancePath:instancePath+"/rejected/reason",schemaPath:"#/properties/rejected/properties/reason/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err106];}else {vErrors.push(err106);}errors++;}}else {const err107 = {instancePath:instancePath+"/rejected/reason",schemaPath:"#/properties/rejected/properties/reason/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err107];}else {vErrors.push(err107);}errors++;}}if(data48.operationId !== undefined){let data53 = data48.operationId;if(typeof data53 === "string"){if(!pattern17.test(data53)){const err108 = {instancePath:instancePath+"/rejected/operationId",schemaPath:"#/properties/rejected/properties/operationId/pattern",keyword:"pattern",params:{pattern: "^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$"},message:"must match pattern \""+"^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$"+"\""};if(vErrors === null){vErrors = [err108];}else {vErrors.push(err108);}errors++;}}else {const err109 = {instancePath:instancePath+"/rejected/operationId",schemaPath:"#/properties/rejected/properties/operationId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err109];}else {vErrors.push(err109);}errors++;}}}else {const err110 = {instancePath:instancePath+"/rejected",schemaPath:"#/properties/rejected/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err110];}else {vErrors.push(err110);}errors++;}}if(data.retired !== undefined){let data54 = data.retired;if(data54 && typeof data54 == "object" && !Array.isArray(data54)){if(data54.at === undefined){const err111 = {instancePath:instancePath+"/retired",schemaPath:"#/properties/retired/required",keyword:"required",params:{missingProperty: "at"},message:"must have required property '"+"at"+"'"};if(vErrors === null){vErrors = [err111];}else {vErrors.push(err111);}errors++;}if(data54.reason === undefined){const err112 = {instancePath:instancePath+"/retired",schemaPath:"#/properties/retired/required",keyword:"required",params:{missingProperty: "reason"},message:"must have required property '"+"reason"+"'"};if(vErrors === null){vErrors = [err112];}else {vErrors.push(err112);}errors++;}for(const key4 in data54){if(!((((key4 === "by") || (key4 === "at")) || (key4 === "reason")) || (key4 === "operationId"))){const err113 = {instancePath:instancePath+"/retired",schemaPath:"#/properties/retired/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key4},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err113];}else {vErrors.push(err113);}errors++;}}if(data54.by !== undefined){if(!(validate417(data54.by, {instancePath:instancePath+"/retired/by",parentData:data54,parentDataProperty:"by",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate417.errors : vErrors.concat(validate417.errors);errors = vErrors.length;}}if(data54.at !== undefined){if(!(validate396(data54.at, {instancePath:instancePath+"/retired/at",parentData:data54,parentDataProperty:"at",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate396.errors : vErrors.concat(validate396.errors);errors = vErrors.length;}}if(data54.reason !== undefined){let data57 = data54.reason;if(typeof data57 === "string"){if(func2(data57) > 2000){const err114 = {instancePath:instancePath+"/retired/reason",schemaPath:"#/properties/retired/properties/reason/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err114];}else {vErrors.push(err114);}errors++;}if(func2(data57) < 1){const err115 = {instancePath:instancePath+"/retired/reason",schemaPath:"#/properties/retired/properties/reason/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err115];}else {vErrors.push(err115);}errors++;}}else {const err116 = {instancePath:instancePath+"/retired/reason",schemaPath:"#/properties/retired/properties/reason/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err116];}else {vErrors.push(err116);}errors++;}}if(data54.operationId !== undefined){let data58 = data54.operationId;if(typeof data58 === "string"){if(!pattern17.test(data58)){const err117 = {instancePath:instancePath+"/retired/operationId",schemaPath:"#/properties/retired/properties/operationId/pattern",keyword:"pattern",params:{pattern: "^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$"},message:"must match pattern \""+"^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$"+"\""};if(vErrors === null){vErrors = [err117];}else {vErrors.push(err117);}errors++;}}else {const err118 = {instancePath:instancePath+"/retired/operationId",schemaPath:"#/properties/retired/properties/operationId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err118];}else {vErrors.push(err118);}errors++;}}}else {const err119 = {instancePath:instancePath+"/retired",schemaPath:"#/properties/retired/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err119];}else {vErrors.push(err119);}errors++;}}if(data.provenance !== undefined){if(!(validate428(data.provenance, {instancePath:instancePath+"/provenance",parentData:data,parentDataProperty:"provenance",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate428.errors : vErrors.concat(validate428.errors);errors = vErrors.length;}}if(data.createdAt !== undefined){if(!(validate396(data.createdAt, {instancePath:instancePath+"/createdAt",parentData:data,parentDataProperty:"createdAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate396.errors : vErrors.concat(validate396.errors);errors = vErrors.length;}}if(data.updatedAt !== undefined){if(!(validate396(data.updatedAt, {instancePath:instancePath+"/updatedAt",parentData:data,parentDataProperty:"updatedAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate396.errors : vErrors.concat(validate396.errors);errors = vErrors.length;}}if(data.digest !== undefined){if(!(validate374(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate374.errors : vErrors.concat(validate374.errors);errors = vErrors.length;}}}else {const err120 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err120];}else {vErrors.push(err120);}errors++;}validate371.errors = vErrors;return errors === 0;}validate371.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.providerManifest = validate455;const schema147 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/provider-manifest.schema.json","title":"Replica memory provider manifest v1","description":"What a memory provider is, which contract versions it supports, which capabilities it offers, and where its data goes. A host checks this before use and refuses a provider that lacks a required capability.","type":"object","additionalProperties":false,"required":["schemaVersion","id","name","version","contract","capabilities","storage","externalCalls"],"properties":{"schemaVersion":{"const":"replica.provider/v1"},"id":{"$ref":"common.schema.json#/$defs/slug"},"name":{"type":"string","minLength":1,"maxLength":200},"version":{"type":"string","minLength":1,"maxLength":64},"contract":{"type":"object","additionalProperties":false,"required":["name","versions"],"properties":{"name":{"const":"replica.memory-provider"},"versions":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"integer","minimum":1,"maximum":1000}}}},"capabilities":{"description":"Required by v1 hosts: observation.append, observation.query, memory.store, memory.query, memory.lifecycle, grant.store, audit.store. Optional examples: memory.semantic_search, memory.graph_query, memory.temporal_query, memory.compaction, memory.consolidate.","type":"array","minItems":1,"maxItems":64,"items":{"type":"string","maxLength":64,"pattern":"^[a-z]+(?:\\.[a-z_]+)+$"}},"storage":{"type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"enum":["local","memory","remote"]},"location":{"description":"A non-secret description such as a directory or service name. Never a credential.","type":"string","minLength":1,"maxLength":2048}}},"externalCalls":{"description":"Hosts this provider sends data to, with IPv6 addresses in brackets. Empty for a provider that stays on the machine.","type":"array","maxItems":50,"items":{"type":"string","minLength":1,"maxLength":255,"pattern":"^(?:[A-Za-z0-9._-]+(?::[0-9]{1,5})?|\\[[0-9A-Za-z:.%_-]+\\](?::[0-9]{1,5})?)$"}},"dataRetention":{"type":"string","minLength":1,"maxLength":2000}}};function validate456(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate456.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(func2(data) > 128){const err0 = {instancePath,schemaPath:"#/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(func2(data) < 1){const err1 = {instancePath,schemaPath:"#/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(!pattern6.test(data)){const err2 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"},message:"must match pattern \""+"^[a-z0-9]+(?:[._-][a-z0-9]+)*$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}validate456.errors = vErrors;return errors === 0;}validate456.evaluated = {"dynamicProps":false,"dynamicItems":false};const pattern100 = new RegExp("^[a-z]+(?:\\.[a-z_]+)+$", "u");const pattern101 = new RegExp("^(?:[A-Za-z0-9._-]+(?::[0-9]{1,5})?|\\[[0-9A-Za-z:.%_-]+\\](?::[0-9]{1,5})?)$", "u");function validate455(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/provider-manifest.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate455.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.name === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "name"},message:"must have required property '"+"name"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.version === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "version"},message:"must have required property '"+"version"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.contract === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "contract"},message:"must have required property '"+"contract"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.capabilities === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "capabilities"},message:"must have required property '"+"capabilities"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.storage === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "storage"},message:"must have required property '"+"storage"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.externalCalls === undefined){const err7 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "externalCalls"},message:"must have required property '"+"externalCalls"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}for(const key0 in data){if(!(func1.call(schema147.properties, key0))){const err8 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.schemaVersion !== undefined){if("replica.provider/v1" !== data.schemaVersion){const err9 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.provider/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.id !== undefined){if(!(validate456(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate456.errors : vErrors.concat(validate456.errors);errors = vErrors.length;}}if(data.name !== undefined){let data2 = data.name;if(typeof data2 === "string"){if(func2(data2) > 200){const err10 = {instancePath:instancePath+"/name",schemaPath:"#/properties/name/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data2) < 1){const err11 = {instancePath:instancePath+"/name",schemaPath:"#/properties/name/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/name",schemaPath:"#/properties/name/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.version !== undefined){let data3 = data.version;if(typeof data3 === "string"){if(func2(data3) > 64){const err13 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/maxLength",keyword:"maxLength",params:{limit: 64},message:"must NOT have more than 64 characters"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}if(func2(data3) < 1){const err14 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}else {const err15 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data.contract !== undefined){let data4 = data.contract;if(data4 && typeof data4 == "object" && !Array.isArray(data4)){if(data4.name === undefined){const err16 = {instancePath:instancePath+"/contract",schemaPath:"#/properties/contract/required",keyword:"required",params:{missingProperty: "name"},message:"must have required property '"+"name"+"'"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}if(data4.versions === undefined){const err17 = {instancePath:instancePath+"/contract",schemaPath:"#/properties/contract/required",keyword:"required",params:{missingProperty: "versions"},message:"must have required property '"+"versions"+"'"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}for(const key1 in data4){if(!((key1 === "name") || (key1 === "versions"))){const err18 = {instancePath:instancePath+"/contract",schemaPath:"#/properties/contract/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data4.name !== undefined){if("replica.memory-provider" !== data4.name){const err19 = {instancePath:instancePath+"/contract/name",schemaPath:"#/properties/contract/properties/name/const",keyword:"const",params:{allowedValue: "replica.memory-provider"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}if(data4.versions !== undefined){let data6 = data4.versions;if(Array.isArray(data6)){if(data6.length > 20){const err20 = {instancePath:instancePath+"/contract/versions",schemaPath:"#/properties/contract/properties/versions/maxItems",keyword:"maxItems",params:{limit: 20},message:"must NOT have more than 20 items"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}if(data6.length < 1){const err21 = {instancePath:instancePath+"/contract/versions",schemaPath:"#/properties/contract/properties/versions/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}const len0 = data6.length;for(let i0=0; i0 1000 || isNaN(data7)){const err23 = {instancePath:instancePath+"/contract/versions/" + i0,schemaPath:"#/properties/contract/properties/versions/items/maximum",keyword:"maximum",params:{comparison: "<=", limit: 1000},message:"must be <= 1000"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}if(data7 < 1 || isNaN(data7)){const err24 = {instancePath:instancePath+"/contract/versions/" + i0,schemaPath:"#/properties/contract/properties/versions/items/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}}}else {const err25 = {instancePath:instancePath+"/contract/versions",schemaPath:"#/properties/contract/properties/versions/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}}else {const err26 = {instancePath:instancePath+"/contract",schemaPath:"#/properties/contract/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}if(data.capabilities !== undefined){let data8 = data.capabilities;if(Array.isArray(data8)){if(data8.length > 64){const err27 = {instancePath:instancePath+"/capabilities",schemaPath:"#/properties/capabilities/maxItems",keyword:"maxItems",params:{limit: 64},message:"must NOT have more than 64 items"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}if(data8.length < 1){const err28 = {instancePath:instancePath+"/capabilities",schemaPath:"#/properties/capabilities/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}const len1 = data8.length;for(let i1=0; i1 64){const err29 = {instancePath:instancePath+"/capabilities/" + i1,schemaPath:"#/properties/capabilities/items/maxLength",keyword:"maxLength",params:{limit: 64},message:"must NOT have more than 64 characters"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}if(!pattern100.test(data9)){const err30 = {instancePath:instancePath+"/capabilities/" + i1,schemaPath:"#/properties/capabilities/items/pattern",keyword:"pattern",params:{pattern: "^[a-z]+(?:\\.[a-z_]+)+$"},message:"must match pattern \""+"^[a-z]+(?:\\.[a-z_]+)+$"+"\""};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}else {const err31 = {instancePath:instancePath+"/capabilities/" + i1,schemaPath:"#/properties/capabilities/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}}else {const err32 = {instancePath:instancePath+"/capabilities",schemaPath:"#/properties/capabilities/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}if(data.storage !== undefined){let data10 = data.storage;if(data10 && typeof data10 == "object" && !Array.isArray(data10)){if(data10.kind === undefined){const err33 = {instancePath:instancePath+"/storage",schemaPath:"#/properties/storage/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}for(const key2 in data10){if(!((key2 === "kind") || (key2 === "location"))){const err34 = {instancePath:instancePath+"/storage",schemaPath:"#/properties/storage/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key2},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}}if(data10.kind !== undefined){let data11 = data10.kind;if(!(((data11 === "local") || (data11 === "memory")) || (data11 === "remote"))){const err35 = {instancePath:instancePath+"/storage/kind",schemaPath:"#/properties/storage/properties/kind/enum",keyword:"enum",params:{allowedValues: schema147.properties.storage.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}}if(data10.location !== undefined){let data12 = data10.location;if(typeof data12 === "string"){if(func2(data12) > 2048){const err36 = {instancePath:instancePath+"/storage/location",schemaPath:"#/properties/storage/properties/location/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err36];}else {vErrors.push(err36);}errors++;}if(func2(data12) < 1){const err37 = {instancePath:instancePath+"/storage/location",schemaPath:"#/properties/storage/properties/location/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err37];}else {vErrors.push(err37);}errors++;}}else {const err38 = {instancePath:instancePath+"/storage/location",schemaPath:"#/properties/storage/properties/location/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err38];}else {vErrors.push(err38);}errors++;}}}else {const err39 = {instancePath:instancePath+"/storage",schemaPath:"#/properties/storage/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err39];}else {vErrors.push(err39);}errors++;}}if(data.externalCalls !== undefined){let data13 = data.externalCalls;if(Array.isArray(data13)){if(data13.length > 50){const err40 = {instancePath:instancePath+"/externalCalls",schemaPath:"#/properties/externalCalls/maxItems",keyword:"maxItems",params:{limit: 50},message:"must NOT have more than 50 items"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}const len2 = data13.length;for(let i2=0; i2 255){const err41 = {instancePath:instancePath+"/externalCalls/" + i2,schemaPath:"#/properties/externalCalls/items/maxLength",keyword:"maxLength",params:{limit: 255},message:"must NOT have more than 255 characters"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}if(func2(data14) < 1){const err42 = {instancePath:instancePath+"/externalCalls/" + i2,schemaPath:"#/properties/externalCalls/items/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}if(!pattern101.test(data14)){const err43 = {instancePath:instancePath+"/externalCalls/" + i2,schemaPath:"#/properties/externalCalls/items/pattern",keyword:"pattern",params:{pattern: "^(?:[A-Za-z0-9._-]+(?::[0-9]{1,5})?|\\[[0-9A-Za-z:.%_-]+\\](?::[0-9]{1,5})?)$"},message:"must match pattern \""+"^(?:[A-Za-z0-9._-]+(?::[0-9]{1,5})?|\\[[0-9A-Za-z:.%_-]+\\](?::[0-9]{1,5})?)$"+"\""};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}}else {const err44 = {instancePath:instancePath+"/externalCalls/" + i2,schemaPath:"#/properties/externalCalls/items/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}}else {const err45 = {instancePath:instancePath+"/externalCalls",schemaPath:"#/properties/externalCalls/type",keyword:"type",params:{type: "array"},message:"must be array"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}}if(data.dataRetention !== undefined){let data15 = data.dataRetention;if(typeof data15 === "string"){if(func2(data15) > 2000){const err46 = {instancePath:instancePath+"/dataRetention",schemaPath:"#/properties/dataRetention/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}if(func2(data15) < 1){const err47 = {instancePath:instancePath+"/dataRetention",schemaPath:"#/properties/dataRetention/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}else {const err48 = {instancePath:instancePath+"/dataRetention",schemaPath:"#/properties/dataRetention/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}}else {const err49 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}validate455.errors = vErrors;return errors === 0;}validate455.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.score = validate458;const schema149 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/score.schema.json","title":"Replica score v1","description":"A model's judgment of how much one used learning helped the Build it was used for. It is evidence for a person, never a decision.","type":"object","additionalProperties":false,"required":["schemaVersion","id","scope","usedLearningId","usageReportId","memoryId","operationId","rubricVersion","efficiency","followed","reasoning","inputs","route","scoredBy","scoredAt","digest"],"if":{"properties":{"efficiency":{"enum":[1,2]}}},"then":{"required":["issue"]},"properties":{"schemaVersion":{"const":"replica.score/v1"},"id":{"$ref":"common.schema.json#/$defs/id"},"scope":{"$ref":"common.schema.json#/$defs/scope"},"usedLearningId":{"$ref":"common.schema.json#/$defs/id"},"usageReportId":{"$ref":"common.schema.json#/$defs/id"},"memoryId":{"$ref":"common.schema.json#/$defs/id"},"operationId":{"description":"The host's ID for this scoring attempt, so a retry stores one score.","type":"string","pattern":"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"},"rubricVersion":{"const":"replica.efficiency-rubric/v1"},"efficiency":{"description":"1 not efficient at all, 2 slightly, 3 mostly, 4 highly efficient.","type":"integer","minimum":1,"maximum":4},"followed":{"description":"Whether the Build followed the learning, judged apart from the score.","enum":["followed","not_followed","unclear"]},"reasoning":{"type":"string","minLength":1,"maxLength":4000},"issue":{"description":"What went wrong, as one reusable sentence, when the score is 1 or 2.","type":"string","minLength":1,"maxLength":500},"inputs":{"description":"What the model saw besides the learning and the usage report.","type":"array","maxItems":3,"items":{"enum":["screenshots","build_diff","reviewer_verification"]}},"route":{"description":"How the model was chosen: Copilot Fusion at a tier, or Auto at a reasoning effort.","type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"enum":["fusion","auto"]},"fusionTier":{"type":"string","minLength":1,"maxLength":50},"model":{"type":"string","minLength":1,"maxLength":200},"reasoningEffort":{"type":"string","minLength":1,"maxLength":50}}},"scoredBy":{"$ref":"common.schema.json#/$defs/actor"},"scoredAt":{"$ref":"common.schema.json#/$defs/timestamp"},"digest":{"$ref":"common.schema.json#/$defs/digest"}}};function validate459(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate459.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate459.errors = vErrors;return errors === 0;}validate459.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate461(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate461.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate461.errors = vErrors;return errors === 0;}validate461.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate469(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate469.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((((key0 === "kind") || (key0 === "id")) || (key0 === "role")) || (key0 === "login")) || (key0 === "model")) || (key0 === "asserted"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((data0 === "human") || (data0 === "agent")) || (data0 === "system")) || (data0 === "service"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema23.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.id !== undefined){let data1 = data.id;if(typeof data1 === "string"){if(func2(data1) > 300){const err4 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 3){const err5 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern5.test(data1)){const err6 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},message:"must match pattern \""+"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.role !== undefined){if(!(validate59(data.role, {instancePath:instancePath+"/role",parentData:data,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.login !== undefined){let data3 = data.login;if(typeof data3 === "string"){if(!pattern7.test(data3)){const err8 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},message:"must match pattern \""+"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"+"\""};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.model !== undefined){let data4 = data.model;if(typeof data4 === "string"){if(func2(data4) > 200){const err10 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data4) < 1){const err11 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.asserted !== undefined){if(typeof data.asserted !== "boolean"){const err13 = {instancePath:instancePath+"/asserted",schemaPath:"#/properties/asserted/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate469.errors = vErrors;return errors === 0;}validate469.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate472(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate472.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate472.errors = vErrors;return errors === 0;}validate472.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate474(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate474.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate474.errors = vErrors;return errors === 0;}validate474.evaluated = {"dynamicProps":false,"dynamicItems":false};const pattern105 = new RegExp("^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$", "u");function validate458(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/score.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate458.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}const _errs1 = errors;let valid0 = true;const _errs2 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.efficiency !== undefined){let data0 = data.efficiency;if(!((data0 === 1) || (data0 === 2))){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}}var _valid0 = _errs2 === errors;errors = _errs1;if(vErrors !== null){if(_errs1){vErrors.length = _errs1;}else {vErrors = null;}}if(_valid0){const _errs4 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.issue === undefined){const err1 = {instancePath,schemaPath:"#/then/required",keyword:"required",params:{missingProperty: "issue"},message:"must have required property '"+"issue"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}var _valid0 = _errs4 === errors;valid0 = _valid0;}if(!valid0){const err2 = {instancePath,schemaPath:"#/if",keyword:"if",params:{failingKeyword: "then"},message:"must match \"then\" schema"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.id === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.scope === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.usedLearningId === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "usedLearningId"},message:"must have required property '"+"usedLearningId"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.usageReportId === undefined){const err7 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "usageReportId"},message:"must have required property '"+"usageReportId"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.memoryId === undefined){const err8 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "memoryId"},message:"must have required property '"+"memoryId"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data.operationId === undefined){const err9 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "operationId"},message:"must have required property '"+"operationId"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(data.rubricVersion === undefined){const err10 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "rubricVersion"},message:"must have required property '"+"rubricVersion"+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(data.efficiency === undefined){const err11 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "efficiency"},message:"must have required property '"+"efficiency"+"'"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(data.followed === undefined){const err12 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "followed"},message:"must have required property '"+"followed"+"'"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}if(data.reasoning === undefined){const err13 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "reasoning"},message:"must have required property '"+"reasoning"+"'"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}if(data.inputs === undefined){const err14 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "inputs"},message:"must have required property '"+"inputs"+"'"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}if(data.route === undefined){const err15 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "route"},message:"must have required property '"+"route"+"'"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}if(data.scoredBy === undefined){const err16 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scoredBy"},message:"must have required property '"+"scoredBy"+"'"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}if(data.scoredAt === undefined){const err17 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scoredAt"},message:"must have required property '"+"scoredAt"+"'"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}if(data.digest === undefined){const err18 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}for(const key0 in data){if(!(func1.call(schema149.properties, key0))){const err19 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}if(data.schemaVersion !== undefined){if("replica.score/v1" !== data.schemaVersion){const err20 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.score/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}if(data.id !== undefined){if(!(validate459(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate459.errors : vErrors.concat(validate459.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate461(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate461.errors : vErrors.concat(validate461.errors);errors = vErrors.length;}}if(data.usedLearningId !== undefined){if(!(validate459(data.usedLearningId, {instancePath:instancePath+"/usedLearningId",parentData:data,parentDataProperty:"usedLearningId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate459.errors : vErrors.concat(validate459.errors);errors = vErrors.length;}}if(data.usageReportId !== undefined){if(!(validate459(data.usageReportId, {instancePath:instancePath+"/usageReportId",parentData:data,parentDataProperty:"usageReportId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate459.errors : vErrors.concat(validate459.errors);errors = vErrors.length;}}if(data.memoryId !== undefined){if(!(validate459(data.memoryId, {instancePath:instancePath+"/memoryId",parentData:data,parentDataProperty:"memoryId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate459.errors : vErrors.concat(validate459.errors);errors = vErrors.length;}}if(data.operationId !== undefined){let data7 = data.operationId;if(typeof data7 === "string"){if(!pattern105.test(data7)){const err21 = {instancePath:instancePath+"/operationId",schemaPath:"#/properties/operationId/pattern",keyword:"pattern",params:{pattern: "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"},message:"must match pattern \""+"^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"+"\""};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}else {const err22 = {instancePath:instancePath+"/operationId",schemaPath:"#/properties/operationId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}if(data.rubricVersion !== undefined){if("replica.efficiency-rubric/v1" !== data.rubricVersion){const err23 = {instancePath:instancePath+"/rubricVersion",schemaPath:"#/properties/rubricVersion/const",keyword:"const",params:{allowedValue: "replica.efficiency-rubric/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}if(data.efficiency !== undefined){let data9 = data.efficiency;if(!(((typeof data9 == "number") && (!(data9 % 1) && !isNaN(data9))) && (isFinite(data9)))){const err24 = {instancePath:instancePath+"/efficiency",schemaPath:"#/properties/efficiency/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}if((typeof data9 == "number") && (isFinite(data9))){if(data9 > 4 || isNaN(data9)){const err25 = {instancePath:instancePath+"/efficiency",schemaPath:"#/properties/efficiency/maximum",keyword:"maximum",params:{comparison: "<=", limit: 4},message:"must be <= 4"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}if(data9 < 1 || isNaN(data9)){const err26 = {instancePath:instancePath+"/efficiency",schemaPath:"#/properties/efficiency/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}}}if(data.followed !== undefined){let data10 = data.followed;if(!(((data10 === "followed") || (data10 === "not_followed")) || (data10 === "unclear"))){const err27 = {instancePath:instancePath+"/followed",schemaPath:"#/properties/followed/enum",keyword:"enum",params:{allowedValues: schema149.properties.followed.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}if(data.reasoning !== undefined){let data11 = data.reasoning;if(typeof data11 === "string"){if(func2(data11) > 4000){const err28 = {instancePath:instancePath+"/reasoning",schemaPath:"#/properties/reasoning/maxLength",keyword:"maxLength",params:{limit: 4000},message:"must NOT have more than 4000 characters"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}if(func2(data11) < 1){const err29 = {instancePath:instancePath+"/reasoning",schemaPath:"#/properties/reasoning/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}}else {const err30 = {instancePath:instancePath+"/reasoning",schemaPath:"#/properties/reasoning/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}if(data.issue !== undefined){let data12 = data.issue;if(typeof data12 === "string"){if(func2(data12) > 500){const err31 = {instancePath:instancePath+"/issue",schemaPath:"#/properties/issue/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}if(func2(data12) < 1){const err32 = {instancePath:instancePath+"/issue",schemaPath:"#/properties/issue/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}}else {const err33 = {instancePath:instancePath+"/issue",schemaPath:"#/properties/issue/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}}if(data.inputs !== undefined){let data13 = data.inputs;if(Array.isArray(data13)){if(data13.length > 3){const err34 = {instancePath:instancePath+"/inputs",schemaPath:"#/properties/inputs/maxItems",keyword:"maxItems",params:{limit: 3},message:"must NOT have more than 3 items"};if(vErrors === null){vErrors = [err34];}else {vErrors.push(err34);}errors++;}const len0 = data13.length;for(let i0=0; i0 50){const err40 = {instancePath:instancePath+"/route/fusionTier",schemaPath:"#/properties/route/properties/fusionTier/maxLength",keyword:"maxLength",params:{limit: 50},message:"must NOT have more than 50 characters"};if(vErrors === null){vErrors = [err40];}else {vErrors.push(err40);}errors++;}if(func2(data17) < 1){const err41 = {instancePath:instancePath+"/route/fusionTier",schemaPath:"#/properties/route/properties/fusionTier/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err41];}else {vErrors.push(err41);}errors++;}}else {const err42 = {instancePath:instancePath+"/route/fusionTier",schemaPath:"#/properties/route/properties/fusionTier/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err42];}else {vErrors.push(err42);}errors++;}}if(data15.model !== undefined){let data18 = data15.model;if(typeof data18 === "string"){if(func2(data18) > 200){const err43 = {instancePath:instancePath+"/route/model",schemaPath:"#/properties/route/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err43];}else {vErrors.push(err43);}errors++;}if(func2(data18) < 1){const err44 = {instancePath:instancePath+"/route/model",schemaPath:"#/properties/route/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err44];}else {vErrors.push(err44);}errors++;}}else {const err45 = {instancePath:instancePath+"/route/model",schemaPath:"#/properties/route/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err45];}else {vErrors.push(err45);}errors++;}}if(data15.reasoningEffort !== undefined){let data19 = data15.reasoningEffort;if(typeof data19 === "string"){if(func2(data19) > 50){const err46 = {instancePath:instancePath+"/route/reasoningEffort",schemaPath:"#/properties/route/properties/reasoningEffort/maxLength",keyword:"maxLength",params:{limit: 50},message:"must NOT have more than 50 characters"};if(vErrors === null){vErrors = [err46];}else {vErrors.push(err46);}errors++;}if(func2(data19) < 1){const err47 = {instancePath:instancePath+"/route/reasoningEffort",schemaPath:"#/properties/route/properties/reasoningEffort/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err47];}else {vErrors.push(err47);}errors++;}}else {const err48 = {instancePath:instancePath+"/route/reasoningEffort",schemaPath:"#/properties/route/properties/reasoningEffort/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err48];}else {vErrors.push(err48);}errors++;}}}else {const err49 = {instancePath:instancePath+"/route",schemaPath:"#/properties/route/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err49];}else {vErrors.push(err49);}errors++;}}if(data.scoredBy !== undefined){if(!(validate469(data.scoredBy, {instancePath:instancePath+"/scoredBy",parentData:data,parentDataProperty:"scoredBy",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate469.errors : vErrors.concat(validate469.errors);errors = vErrors.length;}}if(data.scoredAt !== undefined){if(!(validate472(data.scoredAt, {instancePath:instancePath+"/scoredAt",parentData:data,parentDataProperty:"scoredAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate472.errors : vErrors.concat(validate472.errors);errors = vErrors.length;}}if(data.digest !== undefined){if(!(validate474(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate474.errors : vErrors.concat(validate474.errors);errors = vErrors.length;}}}else {const err50 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err50];}else {vErrors.push(err50);}errors++;}validate458.errors = vErrors;return errors === 0;}validate458.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.screenshot = validate476;const schema155 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/screenshot.schema.json","title":"Replica screenshot v1","description":"One screenshot an agent took for a usage report. The record holds no image; the host keeps the bytes by their SHA-256. Agent screenshots are never verified Build captures.","type":"object","additionalProperties":false,"required":["schemaVersion","id","scope","usageReportId","sha256","role","route","viewport","theme","capturedAt","digest"],"properties":{"schemaVersion":{"const":"replica.screenshot/v1"},"id":{"$ref":"common.schema.json#/$defs/id"},"scope":{"$ref":"common.schema.json#/$defs/scope"},"usageReportId":{"$ref":"common.schema.json#/$defs/id"},"sha256":{"description":"SHA-256 of the PNG bytes.","type":"string","pattern":"^sha256:[0-9a-f]{64}$"},"role":{"enum":["before","after"]},"route":{"type":"string","minLength":1,"maxLength":2048},"viewport":{"type":"object","additionalProperties":false,"required":["width","height"],"properties":{"width":{"type":"integer","minimum":1,"maximum":100000},"height":{"type":"integer","minimum":1,"maximum":100000}}},"theme":{"type":"string","minLength":1,"maxLength":64},"capturedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"consentGrantId":{"$ref":"common.schema.json#/$defs/id"},"digest":{"$ref":"common.schema.json#/$defs/digest"}}};function validate477(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate477.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate477.errors = vErrors;return errors === 0;}validate477.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate479(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate479.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate479.errors = vErrors;return errors === 0;}validate479.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate485(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate485.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate485.errors = vErrors;return errors === 0;}validate485.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate488(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate488.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate488.errors = vErrors;return errors === 0;}validate488.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate476(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/screenshot.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate476.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.scope === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.usageReportId === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "usageReportId"},message:"must have required property '"+"usageReportId"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.sha256 === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "sha256"},message:"must have required property '"+"sha256"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.role === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "role"},message:"must have required property '"+"role"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.route === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "route"},message:"must have required property '"+"route"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.viewport === undefined){const err7 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "viewport"},message:"must have required property '"+"viewport"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.theme === undefined){const err8 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "theme"},message:"must have required property '"+"theme"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data.capturedAt === undefined){const err9 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "capturedAt"},message:"must have required property '"+"capturedAt"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(data.digest === undefined){const err10 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}for(const key0 in data){if(!(func1.call(schema155.properties, key0))){const err11 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data.schemaVersion !== undefined){if("replica.screenshot/v1" !== data.schemaVersion){const err12 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.screenshot/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.id !== undefined){if(!(validate477(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate477.errors : vErrors.concat(validate477.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate479(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate479.errors : vErrors.concat(validate479.errors);errors = vErrors.length;}}if(data.usageReportId !== undefined){if(!(validate477(data.usageReportId, {instancePath:instancePath+"/usageReportId",parentData:data,parentDataProperty:"usageReportId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate477.errors : vErrors.concat(validate477.errors);errors = vErrors.length;}}if(data.sha256 !== undefined){let data4 = data.sha256;if(typeof data4 === "string"){if(!pattern11.test(data4)){const err13 = {instancePath:instancePath+"/sha256",schemaPath:"#/properties/sha256/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}else {const err14 = {instancePath:instancePath+"/sha256",schemaPath:"#/properties/sha256/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data.role !== undefined){let data5 = data.role;if(!((data5 === "before") || (data5 === "after"))){const err15 = {instancePath:instancePath+"/role",schemaPath:"#/properties/role/enum",keyword:"enum",params:{allowedValues: schema155.properties.role.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data.route !== undefined){let data6 = data.route;if(typeof data6 === "string"){if(func2(data6) > 2048){const err16 = {instancePath:instancePath+"/route",schemaPath:"#/properties/route/maxLength",keyword:"maxLength",params:{limit: 2048},message:"must NOT have more than 2048 characters"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}if(func2(data6) < 1){const err17 = {instancePath:instancePath+"/route",schemaPath:"#/properties/route/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}else {const err18 = {instancePath:instancePath+"/route",schemaPath:"#/properties/route/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}}if(data.viewport !== undefined){let data7 = data.viewport;if(data7 && typeof data7 == "object" && !Array.isArray(data7)){if(data7.width === undefined){const err19 = {instancePath:instancePath+"/viewport",schemaPath:"#/properties/viewport/required",keyword:"required",params:{missingProperty: "width"},message:"must have required property '"+"width"+"'"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}if(data7.height === undefined){const err20 = {instancePath:instancePath+"/viewport",schemaPath:"#/properties/viewport/required",keyword:"required",params:{missingProperty: "height"},message:"must have required property '"+"height"+"'"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}for(const key1 in data7){if(!((key1 === "width") || (key1 === "height"))){const err21 = {instancePath:instancePath+"/viewport",schemaPath:"#/properties/viewport/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key1},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}if(data7.width !== undefined){let data8 = data7.width;if(!(((typeof data8 == "number") && (!(data8 % 1) && !isNaN(data8))) && (isFinite(data8)))){const err22 = {instancePath:instancePath+"/viewport/width",schemaPath:"#/properties/viewport/properties/width/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}if((typeof data8 == "number") && (isFinite(data8))){if(data8 > 100000 || isNaN(data8)){const err23 = {instancePath:instancePath+"/viewport/width",schemaPath:"#/properties/viewport/properties/width/maximum",keyword:"maximum",params:{comparison: "<=", limit: 100000},message:"must be <= 100000"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}if(data8 < 1 || isNaN(data8)){const err24 = {instancePath:instancePath+"/viewport/width",schemaPath:"#/properties/viewport/properties/width/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}}if(data7.height !== undefined){let data9 = data7.height;if(!(((typeof data9 == "number") && (!(data9 % 1) && !isNaN(data9))) && (isFinite(data9)))){const err25 = {instancePath:instancePath+"/viewport/height",schemaPath:"#/properties/viewport/properties/height/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}if((typeof data9 == "number") && (isFinite(data9))){if(data9 > 100000 || isNaN(data9)){const err26 = {instancePath:instancePath+"/viewport/height",schemaPath:"#/properties/viewport/properties/height/maximum",keyword:"maximum",params:{comparison: "<=", limit: 100000},message:"must be <= 100000"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}if(data9 < 1 || isNaN(data9)){const err27 = {instancePath:instancePath+"/viewport/height",schemaPath:"#/properties/viewport/properties/height/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}}}else {const err28 = {instancePath:instancePath+"/viewport",schemaPath:"#/properties/viewport/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}if(data.theme !== undefined){let data10 = data.theme;if(typeof data10 === "string"){if(func2(data10) > 64){const err29 = {instancePath:instancePath+"/theme",schemaPath:"#/properties/theme/maxLength",keyword:"maxLength",params:{limit: 64},message:"must NOT have more than 64 characters"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}if(func2(data10) < 1){const err30 = {instancePath:instancePath+"/theme",schemaPath:"#/properties/theme/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}else {const err31 = {instancePath:instancePath+"/theme",schemaPath:"#/properties/theme/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}if(data.capturedAt !== undefined){if(!(validate485(data.capturedAt, {instancePath:instancePath+"/capturedAt",parentData:data,parentDataProperty:"capturedAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate485.errors : vErrors.concat(validate485.errors);errors = vErrors.length;}}if(data.consentGrantId !== undefined){if(!(validate477(data.consentGrantId, {instancePath:instancePath+"/consentGrantId",parentData:data,parentDataProperty:"consentGrantId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate477.errors : vErrors.concat(validate477.errors);errors = vErrors.length;}}if(data.digest !== undefined){if(!(validate488(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate488.errors : vErrors.concat(validate488.errors);errors = vErrors.length;}}}else {const err32 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}validate476.errors = vErrors;return errors === 0;}validate476.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.updateDecision = validate490;const schema160 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/update-decision.schema.json","title":"Replica update decision v1","description":"A person's decision on one update proposal: applied as a new version of the learning, or dismissed.","type":"object","additionalProperties":false,"required":["schemaVersion","id","scope","proposalId","memoryId","decision","reason","decidedBy","decidedAt","digest"],"if":{"properties":{"decision":{"const":"applied"}}},"then":{"required":["appliedVersion"]},"properties":{"schemaVersion":{"const":"replica.update-decision/v1"},"id":{"$ref":"common.schema.json#/$defs/id"},"scope":{"$ref":"common.schema.json#/$defs/scope"},"proposalId":{"$ref":"common.schema.json#/$defs/id"},"memoryId":{"$ref":"common.schema.json#/$defs/id"},"decision":{"enum":["applied","dismissed"]},"appliedVersion":{"description":"The learning version the applied wording became.","type":"integer","minimum":2},"reason":{"type":"string","minLength":1,"maxLength":2000},"decidedBy":{"$ref":"common.schema.json#/$defs/humanActor"},"decidedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"operationId":{"description":"The host request that dismissed the proposal, so the host can tell its own dismissal from a later one.","type":"string","pattern":"^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$"},"digest":{"$ref":"common.schema.json#/$defs/digest"}}};function validate491(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate491.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate491.errors = vErrors;return errors === 0;}validate491.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate493(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate493.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate493.errors = vErrors;return errors === 0;}validate493.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate500(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate500.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(!(validate132(data, {instancePath,parentData,parentDataProperty,rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate132.errors : vErrors.concat(validate132.errors);errors = vErrors.length;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind !== undefined){if("human" !== data.kind){const err0 = {instancePath:instancePath+"/kind",schemaPath:"#/allOf/1/properties/kind/const",keyword:"const",params:{allowedValue: "human"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}}else {const err1 = {instancePath,schemaPath:"#/allOf/1/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate500.errors = vErrors;return errors === 0;}validate500.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate503(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate503.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate503.errors = vErrors;return errors === 0;}validate503.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate505(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate505.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate505.errors = vErrors;return errors === 0;}validate505.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate490(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/update-decision.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate490.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}const _errs1 = errors;let valid0 = true;const _errs2 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.decision !== undefined){if("applied" !== data.decision){const err0 = {};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}}var _valid0 = _errs2 === errors;errors = _errs1;if(vErrors !== null){if(_errs1){vErrors.length = _errs1;}else {vErrors = null;}}if(_valid0){const _errs4 = errors;if(data && typeof data == "object" && !Array.isArray(data)){if(data.appliedVersion === undefined){const err1 = {instancePath,schemaPath:"#/then/required",keyword:"required",params:{missingProperty: "appliedVersion"},message:"must have required property '"+"appliedVersion"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}var _valid0 = _errs4 === errors;valid0 = _valid0;}if(!valid0){const err2 = {instancePath,schemaPath:"#/if",keyword:"if",params:{failingKeyword: "then"},message:"must match \"then\" schema"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.id === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.scope === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.proposalId === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "proposalId"},message:"must have required property '"+"proposalId"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.memoryId === undefined){const err7 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "memoryId"},message:"must have required property '"+"memoryId"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.decision === undefined){const err8 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "decision"},message:"must have required property '"+"decision"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data.reason === undefined){const err9 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "reason"},message:"must have required property '"+"reason"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(data.decidedBy === undefined){const err10 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "decidedBy"},message:"must have required property '"+"decidedBy"+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(data.decidedAt === undefined){const err11 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "decidedAt"},message:"must have required property '"+"decidedAt"+"'"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(data.digest === undefined){const err12 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}for(const key0 in data){if(!(func1.call(schema160.properties, key0))){const err13 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data.schemaVersion !== undefined){if("replica.update-decision/v1" !== data.schemaVersion){const err14 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.update-decision/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}}if(data.id !== undefined){if(!(validate491(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate491.errors : vErrors.concat(validate491.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate493(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate493.errors : vErrors.concat(validate493.errors);errors = vErrors.length;}}if(data.proposalId !== undefined){if(!(validate491(data.proposalId, {instancePath:instancePath+"/proposalId",parentData:data,parentDataProperty:"proposalId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate491.errors : vErrors.concat(validate491.errors);errors = vErrors.length;}}if(data.memoryId !== undefined){if(!(validate491(data.memoryId, {instancePath:instancePath+"/memoryId",parentData:data,parentDataProperty:"memoryId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate491.errors : vErrors.concat(validate491.errors);errors = vErrors.length;}}if(data.decision !== undefined){let data6 = data.decision;if(!((data6 === "applied") || (data6 === "dismissed"))){const err15 = {instancePath:instancePath+"/decision",schemaPath:"#/properties/decision/enum",keyword:"enum",params:{allowedValues: schema160.properties.decision.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}}if(data.appliedVersion !== undefined){let data7 = data.appliedVersion;if(!(((typeof data7 == "number") && (!(data7 % 1) && !isNaN(data7))) && (isFinite(data7)))){const err16 = {instancePath:instancePath+"/appliedVersion",schemaPath:"#/properties/appliedVersion/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}if((typeof data7 == "number") && (isFinite(data7))){if(data7 < 2 || isNaN(data7)){const err17 = {instancePath:instancePath+"/appliedVersion",schemaPath:"#/properties/appliedVersion/minimum",keyword:"minimum",params:{comparison: ">=", limit: 2},message:"must be >= 2"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}}if(data.reason !== undefined){let data8 = data.reason;if(typeof data8 === "string"){if(func2(data8) > 2000){const err18 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/maxLength",keyword:"maxLength",params:{limit: 2000},message:"must NOT have more than 2000 characters"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}if(func2(data8) < 1){const err19 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}else {const err20 = {instancePath:instancePath+"/reason",schemaPath:"#/properties/reason/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}if(data.decidedBy !== undefined){if(!(validate500(data.decidedBy, {instancePath:instancePath+"/decidedBy",parentData:data,parentDataProperty:"decidedBy",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate500.errors : vErrors.concat(validate500.errors);errors = vErrors.length;}}if(data.decidedAt !== undefined){if(!(validate503(data.decidedAt, {instancePath:instancePath+"/decidedAt",parentData:data,parentDataProperty:"decidedAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate503.errors : vErrors.concat(validate503.errors);errors = vErrors.length;}}if(data.operationId !== undefined){let data11 = data.operationId;if(typeof data11 === "string"){if(!pattern17.test(data11)){const err21 = {instancePath:instancePath+"/operationId",schemaPath:"#/properties/operationId/pattern",keyword:"pattern",params:{pattern: "^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$"},message:"must match pattern \""+"^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$"+"\""};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}else {const err22 = {instancePath:instancePath+"/operationId",schemaPath:"#/properties/operationId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}if(data.digest !== undefined){if(!(validate505(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate505.errors : vErrors.concat(validate505.errors);errors = vErrors.length;}}}else {const err23 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}validate490.errors = vErrors;return errors === 0;}validate490.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.updateProposal = validate507;const schema166 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/update-proposal.schema.json","title":"Replica update proposal v1","description":"Suggested new wording for one version of an accepted learning, drafted because scored uses of that version kept showing the same issue. It is a suggestion for a person; only a person applies it.","type":"object","additionalProperties":false,"required":["schemaVersion","id","scope","memoryId","version","versionDigest","issueKey","issue","content","reasoning","support","counter","route","proposedBy","proposedAt","digest"],"properties":{"schemaVersion":{"const":"replica.update-proposal/v1"},"id":{"$ref":"common.schema.json#/$defs/id"},"scope":{"$ref":"common.schema.json#/$defs/scope"},"memoryId":{"$ref":"common.schema.json#/$defs/id"},"version":{"description":"The learning version whose wording this would replace.","type":"integer","minimum":1},"versionDigest":{"description":"The digest of that version, so applying it after the wording changed is refused.","$ref":"common.schema.json#/$defs/digest"},"issueKey":{"description":"A short name for the issue, so later runs group the same issue under it.","$ref":"common.schema.json#/$defs/slug"},"issue":{"description":"The recurring issue, as one sentence.","type":"string","minLength":1,"maxLength":500},"title":{"type":"string","minLength":1,"maxLength":120},"content":{"description":"The suggested wording of the learning.","type":"string","minLength":1,"maxLength":4000},"reasoning":{"description":"Why this wording addresses the issue.","type":"string","minLength":1,"maxLength":4000},"support":{"description":"The scores that showed the issue.","type":"array","minItems":2,"maxItems":500,"items":{"$ref":"common.schema.json#/$defs/id"}},"counter":{"description":"The scores of the same version that went well.","type":"array","maxItems":500,"items":{"$ref":"common.schema.json#/$defs/id"}},"route":{"$ref":"score.schema.json#/properties/route"},"proposedBy":{"$ref":"common.schema.json#/$defs/actor"},"proposedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"digest":{"$ref":"common.schema.json#/$defs/digest"}}};function validate508(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate508.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate508.errors = vErrors;return errors === 0;}validate508.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate510(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate510.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate510.errors = vErrors;return errors === 0;}validate510.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate516(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate516.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate516.errors = vErrors;return errors === 0;}validate516.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate518(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate518.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(func2(data) > 128){const err0 = {instancePath,schemaPath:"#/maxLength",keyword:"maxLength",params:{limit: 128},message:"must NOT have more than 128 characters"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(func2(data) < 1){const err1 = {instancePath,schemaPath:"#/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(!pattern6.test(data)){const err2 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9]+(?:[._-][a-z0-9]+)*$"},message:"must match pattern \""+"^[a-z0-9]+(?:[._-][a-z0-9]+)*$"+"\""};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}else {const err3 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}validate518.errors = vErrors;return errors === 0;}validate518.evaluated = {"dynamicProps":false,"dynamicItems":false};const schema171 = {"description":"How the model was chosen: Copilot Fusion at a tier, or Auto at a reasoning effort.","type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"enum":["fusion","auto"]},"fusionTier":{"type":"string","minLength":1,"maxLength":50},"model":{"type":"string","minLength":1,"maxLength":200},"reasoningEffort":{"type":"string","minLength":1,"maxLength":50}}};function validate522(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate522.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!((((key0 === "kind") || (key0 === "fusionTier")) || (key0 === "model")) || (key0 === "reasoningEffort"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((data0 === "fusion") || (data0 === "auto"))){const err2 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema171.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.fusionTier !== undefined){let data1 = data.fusionTier;if(typeof data1 === "string"){if(func2(data1) > 50){const err3 = {instancePath:instancePath+"/fusionTier",schemaPath:"#/properties/fusionTier/maxLength",keyword:"maxLength",params:{limit: 50},message:"must NOT have more than 50 characters"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(func2(data1) < 1){const err4 = {instancePath:instancePath+"/fusionTier",schemaPath:"#/properties/fusionTier/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}else {const err5 = {instancePath:instancePath+"/fusionTier",schemaPath:"#/properties/fusionTier/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}if(data.model !== undefined){let data2 = data.model;if(typeof data2 === "string"){if(func2(data2) > 200){const err6 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(func2(data2) < 1){const err7 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}else {const err8 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}if(data.reasoningEffort !== undefined){let data3 = data.reasoningEffort;if(typeof data3 === "string"){if(func2(data3) > 50){const err9 = {instancePath:instancePath+"/reasoningEffort",schemaPath:"#/properties/reasoningEffort/maxLength",keyword:"maxLength",params:{limit: 50},message:"must NOT have more than 50 characters"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(func2(data3) < 1){const err10 = {instancePath:instancePath+"/reasoningEffort",schemaPath:"#/properties/reasoningEffort/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}else {const err11 = {instancePath:instancePath+"/reasoningEffort",schemaPath:"#/properties/reasoningEffort/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}}else {const err12 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}validate522.errors = vErrors;return errors === 0;}validate522.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate524(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate524.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((((key0 === "kind") || (key0 === "id")) || (key0 === "role")) || (key0 === "login")) || (key0 === "model")) || (key0 === "asserted"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((data0 === "human") || (data0 === "agent")) || (data0 === "system")) || (data0 === "service"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema23.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.id !== undefined){let data1 = data.id;if(typeof data1 === "string"){if(func2(data1) > 300){const err4 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 3){const err5 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern5.test(data1)){const err6 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},message:"must match pattern \""+"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.role !== undefined){if(!(validate59(data.role, {instancePath:instancePath+"/role",parentData:data,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.login !== undefined){let data3 = data.login;if(typeof data3 === "string"){if(!pattern7.test(data3)){const err8 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},message:"must match pattern \""+"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"+"\""};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.model !== undefined){let data4 = data.model;if(typeof data4 === "string"){if(func2(data4) > 200){const err10 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data4) < 1){const err11 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.asserted !== undefined){if(typeof data.asserted !== "boolean"){const err13 = {instancePath:instancePath+"/asserted",schemaPath:"#/properties/asserted/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate524.errors = vErrors;return errors === 0;}validate524.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate527(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate527.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate527.errors = vErrors;return errors === 0;}validate527.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate507(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/update-proposal.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate507.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.scope === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.memoryId === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "memoryId"},message:"must have required property '"+"memoryId"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.version === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "version"},message:"must have required property '"+"version"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.versionDigest === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "versionDigest"},message:"must have required property '"+"versionDigest"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.issueKey === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "issueKey"},message:"must have required property '"+"issueKey"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.issue === undefined){const err7 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "issue"},message:"must have required property '"+"issue"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.content === undefined){const err8 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "content"},message:"must have required property '"+"content"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data.reasoning === undefined){const err9 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "reasoning"},message:"must have required property '"+"reasoning"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}if(data.support === undefined){const err10 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "support"},message:"must have required property '"+"support"+"'"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(data.counter === undefined){const err11 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "counter"},message:"must have required property '"+"counter"+"'"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}if(data.route === undefined){const err12 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "route"},message:"must have required property '"+"route"+"'"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}if(data.proposedBy === undefined){const err13 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "proposedBy"},message:"must have required property '"+"proposedBy"+"'"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}if(data.proposedAt === undefined){const err14 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "proposedAt"},message:"must have required property '"+"proposedAt"+"'"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}if(data.digest === undefined){const err15 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}for(const key0 in data){if(!(func1.call(schema166.properties, key0))){const err16 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err16];}else {vErrors.push(err16);}errors++;}}if(data.schemaVersion !== undefined){if("replica.update-proposal/v1" !== data.schemaVersion){const err17 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.update-proposal/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err17];}else {vErrors.push(err17);}errors++;}}if(data.id !== undefined){if(!(validate508(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate508.errors : vErrors.concat(validate508.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate510(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate510.errors : vErrors.concat(validate510.errors);errors = vErrors.length;}}if(data.memoryId !== undefined){if(!(validate508(data.memoryId, {instancePath:instancePath+"/memoryId",parentData:data,parentDataProperty:"memoryId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate508.errors : vErrors.concat(validate508.errors);errors = vErrors.length;}}if(data.version !== undefined){let data4 = data.version;if(!(((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4)))){const err18 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/type",keyword:"type",params:{type: "integer"},message:"must be integer"};if(vErrors === null){vErrors = [err18];}else {vErrors.push(err18);}errors++;}if((typeof data4 == "number") && (isFinite(data4))){if(data4 < 1 || isNaN(data4)){const err19 = {instancePath:instancePath+"/version",schemaPath:"#/properties/version/minimum",keyword:"minimum",params:{comparison: ">=", limit: 1},message:"must be >= 1"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}}}if(data.versionDigest !== undefined){if(!(validate516(data.versionDigest, {instancePath:instancePath+"/versionDigest",parentData:data,parentDataProperty:"versionDigest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate516.errors : vErrors.concat(validate516.errors);errors = vErrors.length;}}if(data.issueKey !== undefined){if(!(validate518(data.issueKey, {instancePath:instancePath+"/issueKey",parentData:data,parentDataProperty:"issueKey",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate518.errors : vErrors.concat(validate518.errors);errors = vErrors.length;}}if(data.issue !== undefined){let data7 = data.issue;if(typeof data7 === "string"){if(func2(data7) > 500){const err20 = {instancePath:instancePath+"/issue",schemaPath:"#/properties/issue/maxLength",keyword:"maxLength",params:{limit: 500},message:"must NOT have more than 500 characters"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}if(func2(data7) < 1){const err21 = {instancePath:instancePath+"/issue",schemaPath:"#/properties/issue/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}else {const err22 = {instancePath:instancePath+"/issue",schemaPath:"#/properties/issue/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}}if(data.title !== undefined){let data8 = data.title;if(typeof data8 === "string"){if(func2(data8) > 120){const err23 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/maxLength",keyword:"maxLength",params:{limit: 120},message:"must NOT have more than 120 characters"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}if(func2(data8) < 1){const err24 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}else {const err25 = {instancePath:instancePath+"/title",schemaPath:"#/properties/title/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}if(data.content !== undefined){let data9 = data.content;if(typeof data9 === "string"){if(func2(data9) > 4000){const err26 = {instancePath:instancePath+"/content",schemaPath:"#/properties/content/maxLength",keyword:"maxLength",params:{limit: 4000},message:"must NOT have more than 4000 characters"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}if(func2(data9) < 1){const err27 = {instancePath:instancePath+"/content",schemaPath:"#/properties/content/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}else {const err28 = {instancePath:instancePath+"/content",schemaPath:"#/properties/content/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}if(data.reasoning !== undefined){let data10 = data.reasoning;if(typeof data10 === "string"){if(func2(data10) > 4000){const err29 = {instancePath:instancePath+"/reasoning",schemaPath:"#/properties/reasoning/maxLength",keyword:"maxLength",params:{limit: 4000},message:"must NOT have more than 4000 characters"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}if(func2(data10) < 1){const err30 = {instancePath:instancePath+"/reasoning",schemaPath:"#/properties/reasoning/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err30];}else {vErrors.push(err30);}errors++;}}else {const err31 = {instancePath:instancePath+"/reasoning",schemaPath:"#/properties/reasoning/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err31];}else {vErrors.push(err31);}errors++;}}if(data.support !== undefined){let data11 = data.support;if(Array.isArray(data11)){if(data11.length > 500){const err32 = {instancePath:instancePath+"/support",schemaPath:"#/properties/support/maxItems",keyword:"maxItems",params:{limit: 500},message:"must NOT have more than 500 items"};if(vErrors === null){vErrors = [err32];}else {vErrors.push(err32);}errors++;}if(data11.length < 2){const err33 = {instancePath:instancePath+"/support",schemaPath:"#/properties/support/minItems",keyword:"minItems",params:{limit: 2},message:"must NOT have fewer than 2 items"};if(vErrors === null){vErrors = [err33];}else {vErrors.push(err33);}errors++;}const len0 = data11.length;for(let i0=0; i0 500){const err35 = {instancePath:instancePath+"/counter",schemaPath:"#/properties/counter/maxItems",keyword:"maxItems",params:{limit: 500},message:"must NOT have more than 500 items"};if(vErrors === null){vErrors = [err35];}else {vErrors.push(err35);}errors++;}const len1 = data13.length;for(let i1=0; i1 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate533.errors = vErrors;return errors === 0;}validate533.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate539(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate539.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern18.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9a-f]{40}$"},message:"must match pattern \""+"^[0-9a-f]{40}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate539.errors = vErrors;return errors === 0;}validate539.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate541(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate541.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate541.errors = vErrors;return errors === 0;}validate541.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate543(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate543.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((((key0 === "kind") || (key0 === "id")) || (key0 === "role")) || (key0 === "login")) || (key0 === "model")) || (key0 === "asserted"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((data0 === "human") || (data0 === "agent")) || (data0 === "system")) || (data0 === "service"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema23.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.id !== undefined){let data1 = data.id;if(typeof data1 === "string"){if(func2(data1) > 300){const err4 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 3){const err5 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern5.test(data1)){const err6 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},message:"must match pattern \""+"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.role !== undefined){if(!(validate59(data.role, {instancePath:instancePath+"/role",parentData:data,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.login !== undefined){let data3 = data.login;if(typeof data3 === "string"){if(!pattern7.test(data3)){const err8 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},message:"must match pattern \""+"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"+"\""};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.model !== undefined){let data4 = data.model;if(typeof data4 === "string"){if(func2(data4) > 200){const err10 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data4) < 1){const err11 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.asserted !== undefined){if(typeof data.asserted !== "boolean"){const err13 = {instancePath:instancePath+"/asserted",schemaPath:"#/properties/asserted/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate543.errors = vErrors;return errors === 0;}validate543.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate546(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate546.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate546.errors = vErrors;return errors === 0;}validate546.evaluated = {"dynamicProps":false,"dynamicItems":false};const pattern133 = new RegExp("^[A-Za-z0-9._:-]{1,128}$", "u");function validate530(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/usage-report.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate530.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.scope === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.reportId === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "reportId"},message:"must have required property '"+"reportId"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.guidanceIds === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "guidanceIds"},message:"must have required property '"+"guidanceIds"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.commitSha === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "commitSha"},message:"must have required property '"+"commitSha"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.contentDigest === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "contentDigest"},message:"must have required property '"+"contentDigest"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.reportedBy === undefined){const err7 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "reportedBy"},message:"must have required property '"+"reportedBy"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.reportedAt === undefined){const err8 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "reportedAt"},message:"must have required property '"+"reportedAt"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}if(data.digest === undefined){const err9 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}for(const key0 in data){if(!(func1.call(schema174.properties, key0))){const err10 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.schemaVersion !== undefined){if("replica.usage-report/v1" !== data.schemaVersion){const err11 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.usage-report/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}if(data.id !== undefined){if(!(validate531(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate531.errors : vErrors.concat(validate531.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate533(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate533.errors : vErrors.concat(validate533.errors);errors = vErrors.length;}}if(data.reportId !== undefined){let data3 = data.reportId;if(typeof data3 === "string"){if(!pattern133.test(data3)){const err12 = {instancePath:instancePath+"/reportId",schemaPath:"#/properties/reportId/pattern",keyword:"pattern",params:{pattern: "^[A-Za-z0-9._:-]{1,128}$"},message:"must match pattern \""+"^[A-Za-z0-9._:-]{1,128}$"+"\""};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}else {const err13 = {instancePath:instancePath+"/reportId",schemaPath:"#/properties/reportId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}if(data.guidanceIds !== undefined){let data4 = data.guidanceIds;if(Array.isArray(data4)){if(data4.length > 100){const err14 = {instancePath:instancePath+"/guidanceIds",schemaPath:"#/properties/guidanceIds/maxItems",keyword:"maxItems",params:{limit: 100},message:"must NOT have more than 100 items"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}if(data4.length < 1){const err15 = {instancePath:instancePath+"/guidanceIds",schemaPath:"#/properties/guidanceIds/minItems",keyword:"minItems",params:{limit: 1},message:"must NOT have fewer than 1 items"};if(vErrors === null){vErrors = [err15];}else {vErrors.push(err15);}errors++;}const len0 = data4.length;for(let i0=0; i0 200){const err19 = {instancePath:instancePath+"/session/id",schemaPath:"#/properties/session/properties/id/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err19];}else {vErrors.push(err19);}errors++;}if(func2(data7) < 1){const err20 = {instancePath:instancePath+"/session/id",schemaPath:"#/properties/session/properties/id/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err20];}else {vErrors.push(err20);}errors++;}}else {const err21 = {instancePath:instancePath+"/session/id",schemaPath:"#/properties/session/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err21];}else {vErrors.push(err21);}errors++;}}if(data6.label !== undefined){let data8 = data6.label;if(typeof data8 === "string"){if(func2(data8) > 200){const err22 = {instancePath:instancePath+"/session/label",schemaPath:"#/properties/session/properties/label/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err22];}else {vErrors.push(err22);}errors++;}if(func2(data8) < 1){const err23 = {instancePath:instancePath+"/session/label",schemaPath:"#/properties/session/properties/label/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err23];}else {vErrors.push(err23);}errors++;}}else {const err24 = {instancePath:instancePath+"/session/label",schemaPath:"#/properties/session/properties/label/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err24];}else {vErrors.push(err24);}errors++;}}}else {const err25 = {instancePath:instancePath+"/session",schemaPath:"#/properties/session/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err25];}else {vErrors.push(err25);}errors++;}}if(data.commitSha !== undefined){if(!(validate539(data.commitSha, {instancePath:instancePath+"/commitSha",parentData:data,parentDataProperty:"commitSha",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate539.errors : vErrors.concat(validate539.errors);errors = vErrors.length;}}if(data.prototypeId !== undefined){let data10 = data.prototypeId;if(typeof data10 === "string"){if(func2(data10) > 200){const err26 = {instancePath:instancePath+"/prototypeId",schemaPath:"#/properties/prototypeId/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err26];}else {vErrors.push(err26);}errors++;}if(func2(data10) < 1){const err27 = {instancePath:instancePath+"/prototypeId",schemaPath:"#/properties/prototypeId/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err27];}else {vErrors.push(err27);}errors++;}}else {const err28 = {instancePath:instancePath+"/prototypeId",schemaPath:"#/properties/prototypeId/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err28];}else {vErrors.push(err28);}errors++;}}if(data.contentDigest !== undefined){if(!(validate541(data.contentDigest, {instancePath:instancePath+"/contentDigest",parentData:data,parentDataProperty:"contentDigest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate541.errors : vErrors.concat(validate541.errors);errors = vErrors.length;}}if(data.reportedBy !== undefined){if(!(validate543(data.reportedBy, {instancePath:instancePath+"/reportedBy",parentData:data,parentDataProperty:"reportedBy",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate543.errors : vErrors.concat(validate543.errors);errors = vErrors.length;}}if(data.reportedAt !== undefined){if(!(validate546(data.reportedAt, {instancePath:instancePath+"/reportedAt",parentData:data,parentDataProperty:"reportedAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate546.errors : vErrors.concat(validate546.errors);errors = vErrors.length;}}if(data.digest !== undefined){if(!(validate541(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate541.errors : vErrors.concat(validate541.errors);errors = vErrors.length;}}}else {const err29 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err29];}else {vErrors.push(err29);}errors++;}validate530.errors = vErrors;return errors === 0;}validate530.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};exports.usedLearning = validate549;const schema181 = {"$schema":"https://json-schema.org/draft/2020-12/schema","$id":"https://github.com/github/replica/learning/v1/used-learning.schema.json","title":"Replica used learning v1","description":"One delivered learning an agent says it used. It is always the agent's claim, never a verified result.","type":"object","additionalProperties":false,"required":["schemaVersion","id","scope","usageReportId","deliveryId","memoryId","claimedBy","reportedAt","digest"],"properties":{"schemaVersion":{"const":"replica.used-learning/v1"},"id":{"$ref":"common.schema.json#/$defs/id"},"scope":{"$ref":"common.schema.json#/$defs/scope"},"usageReportId":{"$ref":"common.schema.json#/$defs/id"},"deliveryId":{"$ref":"common.schema.json#/$defs/id"},"memoryId":{"$ref":"common.schema.json#/$defs/id"},"claimedBy":{"$ref":"common.schema.json#/$defs/actor"},"beforeScreenshotId":{"$ref":"common.schema.json#/$defs/id"},"afterScreenshotId":{"$ref":"common.schema.json#/$defs/id"},"reportedAt":{"$ref":"common.schema.json#/$defs/timestamp"},"digest":{"$ref":"common.schema.json#/$defs/digest"}}};function validate550(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate550.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern3.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"},message:"must match pattern \""+"^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate550.errors = vErrors;return errors === 0;}validate550.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate552(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate552.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(Object.keys(data).length < 1){const err0 = {instancePath,schemaPath:"#/minProperties",keyword:"minProperties",params:{limit: 1},message:"must NOT have fewer than 1 properties"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}for(const key0 in data){if(!(((((key0 === "host") || (key0 === "organization")) || (key0 === "team")) || (key0 === "repository")) || (key0 === "product"))){const err1 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}if(data.host !== undefined){let data0 = data.host;if(typeof data0 === "string"){if(func2(data0) > 261){const err2 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/maxLength",keyword:"maxLength",params:{limit: 261},message:"must NOT have more than 261 characters"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(!pattern8.test(data0)){const err3 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"},message:"must match pattern \""+"^[a-z0-9](?:[a-z0-9.-]{0,251}[a-z0-9])?(?::[0-9]{1,5})?$"+"\""};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}else {const err4 = {instancePath:instancePath+"/host",schemaPath:"#/properties/host/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}}if(data.organization !== undefined){if(!(validate63(data.organization, {instancePath:instancePath+"/organization",parentData:data,parentDataProperty:"organization",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.team !== undefined){if(!(validate63(data.team, {instancePath:instancePath+"/team",parentData:data,parentDataProperty:"team",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}if(data.repository !== undefined){let data3 = data.repository;if(typeof data3 === "string"){if(!pattern10.test(data3)){const err5 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/pattern",keyword:"pattern",params:{pattern: "^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"},message:"must match pattern \""+"^[a-z0-9_.-]{1,100}/[a-z0-9_.-]{1,100}$"+"\""};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}}else {const err6 = {instancePath:instancePath+"/repository",schemaPath:"#/properties/repository/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}if(data.product !== undefined){if(!(validate63(data.product, {instancePath:instancePath+"/product",parentData:data,parentDataProperty:"product",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate63.errors : vErrors.concat(validate63.errors);errors = vErrors.length;}}}else {const err7 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}validate552.errors = vErrors;return errors === 0;}validate552.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate560(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate560.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.kind === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "kind"},message:"must have required property '"+"kind"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}for(const key0 in data){if(!((((((key0 === "kind") || (key0 === "id")) || (key0 === "role")) || (key0 === "login")) || (key0 === "model")) || (key0 === "asserted"))){const err2 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}}if(data.kind !== undefined){let data0 = data.kind;if(!((((data0 === "human") || (data0 === "agent")) || (data0 === "system")) || (data0 === "service"))){const err3 = {instancePath:instancePath+"/kind",schemaPath:"#/properties/kind/enum",keyword:"enum",params:{allowedValues: schema23.properties.kind.enum},message:"must be equal to one of the allowed values"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}}if(data.id !== undefined){let data1 = data.id;if(typeof data1 === "string"){if(func2(data1) > 300){const err4 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/maxLength",keyword:"maxLength",params:{limit: 300},message:"must NOT have more than 300 characters"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(func2(data1) < 3){const err5 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/minLength",keyword:"minLength",params:{limit: 3},message:"must NOT have fewer than 3 characters"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(!pattern5.test(data1)){const err6 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/pattern",keyword:"pattern",params:{pattern: "^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"},message:"must match pattern \""+"^[a-z][a-z0-9-]*:[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]+$"+"\""};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}}else {const err7 = {instancePath:instancePath+"/id",schemaPath:"#/properties/id/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}}if(data.role !== undefined){if(!(validate59(data.role, {instancePath:instancePath+"/role",parentData:data,parentDataProperty:"role",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate59.errors : vErrors.concat(validate59.errors);errors = vErrors.length;}}if(data.login !== undefined){let data3 = data.login;if(typeof data3 === "string"){if(!pattern7.test(data3)){const err8 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/pattern",keyword:"pattern",params:{pattern: "^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"},message:"must match pattern \""+"^[^\\s\\p{Cc}\\p{Cf}\\u{E0000}-\\u{E007F}]{1,256}$"+"\""};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}}else {const err9 = {instancePath:instancePath+"/login",schemaPath:"#/properties/login/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.model !== undefined){let data4 = data.model;if(typeof data4 === "string"){if(func2(data4) > 200){const err10 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/maxLength",keyword:"maxLength",params:{limit: 200},message:"must NOT have more than 200 characters"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}if(func2(data4) < 1){const err11 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/minLength",keyword:"minLength",params:{limit: 1},message:"must NOT have fewer than 1 characters"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}}else {const err12 = {instancePath:instancePath+"/model",schemaPath:"#/properties/model/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err12];}else {vErrors.push(err12);}errors++;}}if(data.asserted !== undefined){if(typeof data.asserted !== "boolean"){const err13 = {instancePath:instancePath+"/asserted",schemaPath:"#/properties/asserted/type",keyword:"type",params:{type: "boolean"},message:"must be boolean"};if(vErrors === null){vErrors = [err13];}else {vErrors.push(err13);}errors++;}}}else {const err14 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err14];}else {vErrors.push(err14);}errors++;}validate560.errors = vErrors;return errors === 0;}validate560.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false};function validate565(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate565.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern4.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"},message:"must match pattern \""+"^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}\\.[0-9]{6}Z$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(!(formats0(data))){const err1 = {instancePath,schemaPath:"#/format",keyword:"format",params:{format: "date-time"},message:"must match format \""+"date-time"+"\""};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}}else {const err2 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}validate565.errors = vErrors;return errors === 0;}validate565.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate567(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){let vErrors = null;let errors = 0;const evaluated0 = validate567.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(typeof data === "string"){if(!pattern11.test(data)){const err0 = {instancePath,schemaPath:"#/pattern",keyword:"pattern",params:{pattern: "^sha256:[0-9a-f]{64}$"},message:"must match pattern \""+"^sha256:[0-9a-f]{64}$"+"\""};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}}else {const err1 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "string"},message:"must be string"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}validate567.errors = vErrors;return errors === 0;}validate567.evaluated = {"dynamicProps":false,"dynamicItems":false};function validate549(data, {instancePath="", parentData, parentDataProperty, rootData=data, dynamicAnchors={}}={}){/*# sourceURL="https://github.com/github/replica/learning/v1/used-learning.schema.json" */;let vErrors = null;let errors = 0;const evaluated0 = validate549.evaluated;if(evaluated0.dynamicProps){evaluated0.props = undefined;}if(evaluated0.dynamicItems){evaluated0.items = undefined;}if(data && typeof data == "object" && !Array.isArray(data)){if(data.schemaVersion === undefined){const err0 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "schemaVersion"},message:"must have required property '"+"schemaVersion"+"'"};if(vErrors === null){vErrors = [err0];}else {vErrors.push(err0);}errors++;}if(data.id === undefined){const err1 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "id"},message:"must have required property '"+"id"+"'"};if(vErrors === null){vErrors = [err1];}else {vErrors.push(err1);}errors++;}if(data.scope === undefined){const err2 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "scope"},message:"must have required property '"+"scope"+"'"};if(vErrors === null){vErrors = [err2];}else {vErrors.push(err2);}errors++;}if(data.usageReportId === undefined){const err3 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "usageReportId"},message:"must have required property '"+"usageReportId"+"'"};if(vErrors === null){vErrors = [err3];}else {vErrors.push(err3);}errors++;}if(data.deliveryId === undefined){const err4 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "deliveryId"},message:"must have required property '"+"deliveryId"+"'"};if(vErrors === null){vErrors = [err4];}else {vErrors.push(err4);}errors++;}if(data.memoryId === undefined){const err5 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "memoryId"},message:"must have required property '"+"memoryId"+"'"};if(vErrors === null){vErrors = [err5];}else {vErrors.push(err5);}errors++;}if(data.claimedBy === undefined){const err6 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "claimedBy"},message:"must have required property '"+"claimedBy"+"'"};if(vErrors === null){vErrors = [err6];}else {vErrors.push(err6);}errors++;}if(data.reportedAt === undefined){const err7 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "reportedAt"},message:"must have required property '"+"reportedAt"+"'"};if(vErrors === null){vErrors = [err7];}else {vErrors.push(err7);}errors++;}if(data.digest === undefined){const err8 = {instancePath,schemaPath:"#/required",keyword:"required",params:{missingProperty: "digest"},message:"must have required property '"+"digest"+"'"};if(vErrors === null){vErrors = [err8];}else {vErrors.push(err8);}errors++;}for(const key0 in data){if(!(func1.call(schema181.properties, key0))){const err9 = {instancePath,schemaPath:"#/additionalProperties",keyword:"additionalProperties",params:{additionalProperty: key0},message:"must NOT have additional properties"};if(vErrors === null){vErrors = [err9];}else {vErrors.push(err9);}errors++;}}if(data.schemaVersion !== undefined){if("replica.used-learning/v1" !== data.schemaVersion){const err10 = {instancePath:instancePath+"/schemaVersion",schemaPath:"#/properties/schemaVersion/const",keyword:"const",params:{allowedValue: "replica.used-learning/v1"},message:"must be equal to constant"};if(vErrors === null){vErrors = [err10];}else {vErrors.push(err10);}errors++;}}if(data.id !== undefined){if(!(validate550(data.id, {instancePath:instancePath+"/id",parentData:data,parentDataProperty:"id",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate550.errors : vErrors.concat(validate550.errors);errors = vErrors.length;}}if(data.scope !== undefined){if(!(validate552(data.scope, {instancePath:instancePath+"/scope",parentData:data,parentDataProperty:"scope",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate552.errors : vErrors.concat(validate552.errors);errors = vErrors.length;}}if(data.usageReportId !== undefined){if(!(validate550(data.usageReportId, {instancePath:instancePath+"/usageReportId",parentData:data,parentDataProperty:"usageReportId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate550.errors : vErrors.concat(validate550.errors);errors = vErrors.length;}}if(data.deliveryId !== undefined){if(!(validate550(data.deliveryId, {instancePath:instancePath+"/deliveryId",parentData:data,parentDataProperty:"deliveryId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate550.errors : vErrors.concat(validate550.errors);errors = vErrors.length;}}if(data.memoryId !== undefined){if(!(validate550(data.memoryId, {instancePath:instancePath+"/memoryId",parentData:data,parentDataProperty:"memoryId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate550.errors : vErrors.concat(validate550.errors);errors = vErrors.length;}}if(data.claimedBy !== undefined){if(!(validate560(data.claimedBy, {instancePath:instancePath+"/claimedBy",parentData:data,parentDataProperty:"claimedBy",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate560.errors : vErrors.concat(validate560.errors);errors = vErrors.length;}}if(data.beforeScreenshotId !== undefined){if(!(validate550(data.beforeScreenshotId, {instancePath:instancePath+"/beforeScreenshotId",parentData:data,parentDataProperty:"beforeScreenshotId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate550.errors : vErrors.concat(validate550.errors);errors = vErrors.length;}}if(data.afterScreenshotId !== undefined){if(!(validate550(data.afterScreenshotId, {instancePath:instancePath+"/afterScreenshotId",parentData:data,parentDataProperty:"afterScreenshotId",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate550.errors : vErrors.concat(validate550.errors);errors = vErrors.length;}}if(data.reportedAt !== undefined){if(!(validate565(data.reportedAt, {instancePath:instancePath+"/reportedAt",parentData:data,parentDataProperty:"reportedAt",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate565.errors : vErrors.concat(validate565.errors);errors = vErrors.length;}}if(data.digest !== undefined){if(!(validate567(data.digest, {instancePath:instancePath+"/digest",parentData:data,parentDataProperty:"digest",rootData,dynamicAnchors}))){vErrors = vErrors === null ? validate567.errors : vErrors.concat(validate567.errors);errors = vErrors.length;}}}else {const err11 = {instancePath,schemaPath:"#/type",keyword:"type",params:{type: "object"},message:"must be object"};if(vErrors === null){vErrors = [err11];}else {vErrors.push(err11);}errors++;}validate549.errors = vErrors;return errors === 0;}validate549.evaluated = {"props":true,"dynamicProps":false,"dynamicItems":false}; diff --git a/packages/learning/src/store.mjs b/packages/learning/src/store.mjs index e428b8f3..54d3fbe3 100644 --- a/packages/learning/src/store.mjs +++ b/packages/learning/src/store.mjs @@ -3995,6 +3995,7 @@ class LearningStore { decidedBy: decision.decidedBy, decidedAt: decision.decidedAt, ...(decision.appliedVersion ? { appliedVersion: decision.appliedVersion } : {}), + ...(decision.operationId ? { operationId: decision.operationId } : {}), }, } : {}), @@ -4036,16 +4037,22 @@ class LearningStore { } /** Dismiss an open update proposal, so it returns only with new evidence. */ - async dismissUpdate(context, proposalId, { reason } = {}) { + async dismissUpdate(context, proposalId, { reason, operationId } = {}) { assertContext(context) requireHuman(context, "dismiss an update") if (typeof reason !== "string" || !reason.trim() || reason.length > 2000) throw new LearningError("invalid_input", "Give a reason for the decision.") + if (operationId !== undefined && !OPERATION_ID.test(operationId)) + throw new LearningError("invalid_input", "Name the dismissal with a UUID operation ID.") const { proposal, update } = await this.#update(context, proposalId) if (update.state === "dismissed") return { update, stored: false } if (update.state !== "open") throw new LearningError("invalid_transition", `Update ${proposalId} is ${update.state}.`) - const stored = await this.#decideUpdate(context, proposal, { decision: "dismissed", reason }) + const stored = await this.#decideUpdate(context, proposal, { + decision: "dismissed", + reason, + operationId, + }) return { update: (await this.#update(context, proposalId)).update, stored } } @@ -4068,7 +4075,7 @@ class LearningStore { } /** Keep one decision per proposal; when two people decide at once, the first one stands. */ - async #decideUpdate(context, proposal, { decision, appliedVersion, reason }) { + async #decideUpdate(context, proposal, { decision, appliedVersion, reason, operationId }) { const record = sealRecord({ schemaVersion: SCHEMA_VERSIONS.updateDecision, id: derivedId("update_decision", { proposalId: proposal.id }), @@ -4080,6 +4087,7 @@ class LearningStore { reason, decidedBy: context.principal, decidedAt: this.#now(), + ...(operationId ? { operationId } : {}), }) assertValid("updateDecision", record) try { From 2ea9edc41d775990759abfa676ec6d79deced67f Mon Sep 17 00:00:00 2001 From: Nishiki Liu Date: Thu, 26 Nov 2026 02:45:07 -0800 Subject: [PATCH 2/4] feat(hub): apply or dismiss suggested learning updates Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5 --- hub/schema/learning-decision-operation.prisma | 6 +- .../migration.sql | 9 + .../create-learning-job-processors/index.ts | 4 +- .../execute-learning-decision/index.test.ts | 99 ++++++++++ .../execute-learning-decision/index.ts | 106 +++++++---- .../get-learning-history/index.test.ts | 79 ++++++++ .../learning/get-learning-history/index.ts | 165 +++++++++++++---- .../index.test.ts | 78 ++++++++ .../index.ts | 69 +++++-- hub/server/domains/learning/types.ts | 27 +++ .../index.ts | 4 +- .../index.ts | 14 ++ .../create-security-audit/types.ts | 3 +- .../parse-security-audit-event/index.ts | 10 +- .../index.ts | 175 ++++++++++++------ .../learning-outcomes.db.test.ts | 53 ++++-- .../api/learnings/decision/post/index.ts | 17 ++ hub/server/routes/api/learnings/types.ts | 6 + .../present-security-audit/index.test.ts | 25 +++ .../present-security-audit/index.ts | 8 + 20 files changed, 794 insertions(+), 163 deletions(-) create mode 100644 hub/schema/migrations/20261228090000_learning_update_decisions/migration.sql create mode 100644 hub/server/repositories/learning-update-runs/find-latest-learning-update-result/index.ts diff --git a/hub/schema/learning-decision-operation.prisma b/hub/schema/learning-decision-operation.prisma index cff77302..2736ff4e 100644 --- a/hub/schema/learning-decision-operation.prisma +++ b/hub/schema/learning-decision-operation.prisma @@ -9,8 +9,10 @@ model LearningDecisionOperation { actorMembership Membership @relation(fields: [actorMembershipId], references: [id], onDelete: Cascade) // Attribute columns - learningId String @map("learning_id") @db.VarChar(255) - decision String @db.VarChar(20) + learningId String @map("learning_id") @db.VarChar(255) + decision String @db.VarChar(20) + // Set only for decisions on a suggested update, so recovery can check that suggestion. + proposalId String? @map("proposal_id") @db.VarChar(255) // Timestamp columns createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz(3) diff --git a/hub/schema/migrations/20261228090000_learning_update_decisions/migration.sql b/hub/schema/migrations/20261228090000_learning_update_decisions/migration.sql new file mode 100644 index 00000000..02ea9bd9 --- /dev/null +++ b/hub/schema/migrations/20261228090000_learning_update_decisions/migration.sql @@ -0,0 +1,9 @@ +-- AlterTable +ALTER TABLE "learning_decision_operations" ADD COLUMN "proposal_id" VARCHAR(255); + +ALTER TABLE "learning_decision_operations" +DROP CONSTRAINT "learning_decision_operations_decision_check"; + +ALTER TABLE "learning_decision_operations" +ADD CONSTRAINT "learning_decision_operations_decision_check" +CHECK ("decision" IN ('accept', 'reject', 'retire', 'edit', 'reinstate', 'apply_update', 'dismiss_update')); diff --git a/hub/server/domains/learning/create-learning-job-processors/index.ts b/hub/server/domains/learning/create-learning-job-processors/index.ts index 446097c3..9fa97c06 100644 --- a/hub/server/domains/learning/create-learning-job-processors/index.ts +++ b/hub/server/domains/learning/create-learning-job-processors/index.ts @@ -31,6 +31,7 @@ import { readAutomaticLearningRunsEnabled } from "../read-automatic-learning-run import { readLearningConfiguration } from "../read-learning-configuration/index.ts" import { scheduleLearningRuns } from "../schedule-learning-runs/index.ts" import { scoreAppliedLearnings } from "../score-applied-learnings/index.ts" +import type { LearningDecision } from "../types.ts" import { createConfiguredArtifactStorage } from "../../artifacts/create-configured-artifact-storage/index.ts" import { createJobProcessor } from "../../../integrations/bullmq/create-job-processor/index.ts" import { createJobQueue } from "../../../integrations/bullmq/create-job-queue/index.ts" @@ -377,8 +378,7 @@ export function createLearningJobProcessors(environment: NodeJS.ProcessEnv, logg id: input.auditId, type: "learning_decision", actorMembershipId: operation.actorMembershipId, - decision: operation.decision as - "accept" | "reject" | "retire" | "edit" | "reinstate", + decision: operation.decision as LearningDecision["decision"], learningId: operation.learningId, operationId: operation.id, outcome: input.outcome, diff --git a/hub/server/domains/learning/execute-learning-decision/index.test.ts b/hub/server/domains/learning/execute-learning-decision/index.test.ts index 8d1459a6..4dea7499 100644 --- a/hub/server/domains/learning/execute-learning-decision/index.test.ts +++ b/hub/server/domains/learning/execute-learning-decision/index.test.ts @@ -211,4 +211,103 @@ describe("executeLearningDecision()", () => { expect(reasonPath).not.toBe("") await expect(stat(reasonPath)).rejects.toMatchObject({ code: "ENOENT" }) }) + + it("applies a suggested update with its operation ID and private wording", async () => { + vi.mocked(validatePrivateStorageRoot).mockResolvedValue("/private/learning/repository") + vi.mocked(runLearningCommand) + .mockResolvedValueOnce({ updates: [{ id: "upd_1", state: "open" }] }) + .mockImplementationOnce(async (arguments_) => { + expect(arguments_).toEqual( + expect.arrayContaining([ + "apply-update", + "upd_1", + "--operation-id", + "33333333-3333-4333-8333-333333333333", + ]), + ) + const index = arguments_.indexOf("--content-file") + expect(await readFile(arguments_[index + 1]!, "utf8")).toBe("Put labels above inputs.") + return {} + }) + + const result = await executeLearningDecision({ + actor: "human:mona", + applicationRoot: "/app", + cliPath: "/app/replica-learning.mjs", + decision: { + decision: "apply_update", + proposalId: "upd_1", + content: "Put labels above inputs.", + reason: "The suggestion matches what reviewers asked for.", + }, + learningDatabaseUrl: "postgresql://learning.example/replica", + learningId: "mem_1", + nodePath: "/node", + operationId: "33333333-3333-4333-8333-333333333333", + repositoryId: "11111111-2222-4333-8444-555555555555", + repositoryScope: "github.com/repositories/123", + root: "/private/learning", + staticDirectories: [], + }) + + expect(result.notice).toBe("Suggested update applied.") + expect(vi.mocked(runLearningCommand).mock.calls[0]![0]).toEqual( + expect.arrayContaining(["updates", "mem_1"]), + ) + }) + + it("refuses a suggested update that belongs to another learning", async () => { + vi.mocked(validatePrivateStorageRoot).mockResolvedValue("/private/learning/repository") + vi.mocked(runLearningCommand) + .mockReset() + .mockResolvedValueOnce({ updates: [{ id: "upd_1", state: "open" }] }) + + await expect( + executeLearningDecision({ + actor: "human:mona", + applicationRoot: "/app", + cliPath: "/app/replica-learning.mjs", + decision: { decision: "dismiss_update", proposalId: "upd_other", reason: "Not needed." }, + learningDatabaseUrl: "postgresql://learning.example/replica", + learningId: "mem_1", + nodePath: "/node", + operationId: "33333333-3333-4333-8333-333333333333", + repositoryId: "11111111-2222-4333-8444-555555555555", + repositoryScope: "github.com/repositories/123", + root: "/private/learning", + staticDirectories: [], + }), + ).rejects.toMatchObject({ code: "not_found" }) + expect(runLearningCommand).toHaveBeenCalledTimes(1) + }) + + it("refuses a suggested update another administrator already decided", async () => { + vi.mocked(validatePrivateStorageRoot).mockResolvedValue("/private/learning/repository") + vi.mocked(runLearningCommand) + .mockReset() + .mockResolvedValueOnce({ updates: [{ id: "upd_1", state: "applied" }] }) + + await expect( + executeLearningDecision({ + actor: "human:mona", + applicationRoot: "/app", + cliPath: "/app/replica-learning.mjs", + decision: { + decision: "apply_update", + proposalId: "upd_1", + content: "Put labels above inputs.", + reason: "The suggestion matches what reviewers asked for.", + }, + learningDatabaseUrl: "postgresql://learning.example/replica", + learningId: "mem_1", + nodePath: "/node", + operationId: "33333333-3333-4333-8333-333333333333", + repositoryId: "11111111-2222-4333-8444-555555555555", + repositoryScope: "github.com/repositories/123", + root: "/private/learning", + staticDirectories: [], + }), + ).rejects.toMatchObject({ code: "stale_review" }) + expect(runLearningCommand).toHaveBeenCalledTimes(1) + }) }) diff --git a/hub/server/domains/learning/execute-learning-decision/index.ts b/hub/server/domains/learning/execute-learning-decision/index.ts index 1950640d..b5c67e83 100644 --- a/hub/server/domains/learning/execute-learning-decision/index.ts +++ b/hub/server/domains/learning/execute-learning-decision/index.ts @@ -1,6 +1,7 @@ import { access, mkdtemp, rm, writeFile } from "node:fs/promises" import { tmpdir } from "node:os" import { resolve } from "node:path" +import { z } from "zod" import { runLearningCommand } from "../../../integrations/learning/run-learning-command/index.ts" import { validatePrivateStorageRoot } from "../../../utils/validate-private-storage-root/index.ts" @@ -8,6 +9,10 @@ import { LearningCommandError } from "../../../integrations/learning/run-learnin import { learningStoreArguments } from "../learning-store-arguments/index.ts" import type { LearningDecision } from "../types.ts" +const updatesSchema = z + .object({ updates: z.array(z.object({ id: z.string(), state: z.string() }).loose()) }) + .loose() + export async function executeLearningDecision(input: { actor: string applicationRoot?: string @@ -41,64 +46,87 @@ export async function executeLearningDecision(input: { throw new LearningCommandError("not_found", "That learning no longer exists.") } } - const arguments_ = [input.decision.decision, input.learningId] - arguments_.push("--operation-id", input.operationId) - if (input.decision.decision !== "retire") { - arguments_.push("--digest", input.decision.digest) + const store = learningStoreArguments({ + directory, + repositoryId: input.repositoryId, + repositoryScope: input.repositoryScope, + }) + const commandOptions = { + cliPath: input.cliPath, + ...(input.learningDatabaseUrl ? { learningDatabaseUrl: input.learningDatabaseUrl } : {}), + nodePath: input.nodePath, + signal: input.signal, + } + const decision = input.decision + const arguments_: string[] = [] + if (decision.decision === "apply_update" || decision.decision === "dismiss_update") { + // The package finds a suggestion by its own ID, so check it belongs to this learning. + const { updates } = updatesSchema.parse( + await runLearningCommand(["updates", input.learningId, ...store], commandOptions), + ) + const update = updates.find(({ id }) => id === decision.proposalId) + if (!update) { + throw new LearningCommandError("not_found", "That suggested update no longer exists.") + } + // The package treats a repeated decision as done, which would hide that another + // administrator already chose differently. + if (update.state !== "open") { + throw new LearningCommandError( + "stale_review", + "That suggested update was already decided. Refresh to see the latest.", + ) + } + arguments_.push( + decision.decision.replace("_", "-"), + decision.proposalId, + "--operation-id", + input.operationId, + ) + } else { + arguments_.push(decision.decision, input.learningId, "--operation-id", input.operationId) + if (decision.decision !== "retire") arguments_.push("--digest", decision.digest) } arguments_.push("--by", input.actor) let temporaryDirectory: string | undefined try { - if (input.decision.decision !== "accept" || input.decision.content !== undefined) { + if (decision.decision !== "accept" || decision.content !== undefined) { temporaryDirectory = await mkdtemp(resolve(tmpdir(), "replica-learning-decision-")) } - if (input.decision.decision !== "accept") { + if (decision.decision !== "accept") { const reasonPath = resolve(temporaryDirectory!, "reason.txt") - await writeFile(reasonPath, input.decision.reason, { mode: 0o600 }) + await writeFile(reasonPath, decision.reason, { mode: 0o600 }) arguments_.push("--reason-file", reasonPath) } if ( - (input.decision.decision === "accept" || input.decision.decision === "edit") && - input.decision.content !== undefined + (decision.decision === "accept" || + decision.decision === "edit" || + decision.decision === "apply_update") && + decision.content !== undefined ) { const contentPath = resolve(temporaryDirectory!, "content.txt") - await writeFile(contentPath, input.decision.content, { mode: 0o600 }) + await writeFile(contentPath, decision.content, { mode: 0o600 }) arguments_.push("--content-file", contentPath) } - if (input.decision.decision === "edit" && input.decision.title !== undefined) { + if ( + (decision.decision === "edit" || decision.decision === "apply_update") && + decision.title !== undefined + ) { const titlePath = resolve(temporaryDirectory!, "title.txt") - await writeFile(titlePath, input.decision.title, { mode: 0o600 }) + await writeFile(titlePath, decision.title, { mode: 0o600 }) arguments_.push("--title-file", titlePath) } - await runLearningCommand( - [ - ...arguments_, - ...learningStoreArguments({ - directory, - repositoryId: input.repositoryId, - repositoryScope: input.repositoryScope, - }), - ], - { - cliPath: input.cliPath, - ...(input.learningDatabaseUrl ? { learningDatabaseUrl: input.learningDatabaseUrl } : {}), - nodePath: input.nodePath, - signal: input.signal, - }, - ) + await runLearningCommand([...arguments_, ...store], commandOptions) } finally { if (temporaryDirectory) await rm(temporaryDirectory, { recursive: true }) } - return { - notice: - input.decision.decision === "accept" - ? "Learning accepted." - : input.decision.decision === "reject" - ? "Suggestion rejected." - : input.decision.decision === "retire" - ? "Learning retired." - : input.decision.decision === "edit" - ? "Learning updated." - : "Learning reinstated.", + const notices = { + accept: "Learning accepted.", + reject: "Suggestion rejected.", + retire: "Learning retired.", + edit: "Learning updated.", + reinstate: "Learning reinstated.", + apply_update: "Suggested update applied.", + dismiss_update: "Suggested update dismissed.", } + return { notice: notices[decision.decision] } } diff --git a/hub/server/domains/learning/get-learning-history/index.test.ts b/hub/server/domains/learning/get-learning-history/index.test.ts index 08257ade..e0b22f3a 100644 --- a/hub/server/domains/learning/get-learning-history/index.test.ts +++ b/hub/server/domains/learning/get-learning-history/index.test.ts @@ -154,6 +154,7 @@ describe("getLearningHistory()", () => { }, ], }) + .mockResolvedValueOnce({ updates: [] }) const result = await getLearningHistory({ applicationRoot: "/app", @@ -197,6 +198,7 @@ describe("getLearningHistory()", () => { { ...outcome, id: "score_confirmed", inputs: ["build_diff", "reviewer_verification"] }, ], }) + .mockResolvedValueOnce({ updates: [] }) const result = await getLearningHistory({ applicationRoot: "/app", @@ -314,4 +316,81 @@ describe("getLearningHistory()", () => { expect(observationArguments).toContain("evt_1") expect(observationArguments).not.toContain("evt 2") }) + + it("shows earlier wording with its own scores and only open suggested updates", async () => { + const outcome = { + commitSha: "a".repeat(40), + prototypeId: "proto_1", + efficiency: 2, + followed: "followed", + reasoning: "The labels moved inside the fields.", + issue: "The rule did not say where the label goes.", + scoredAt: "2026-11-05T00:00:00.000Z", + inputs: ["build_diff"], + } + const open = { + id: "upd_open", + state: "open", + issue: "The rule did not say where the label goes.", + content: "Put labels above inputs.", + reasoning: "Builds kept placing labels inside inputs.", + support: ["score_new"], + } + vi.mocked(runLearningCommand) + .mockResolvedValueOnce({ + withheld: false, + record: {}, + versions: [ + { version: 1, state: "accepted", contentDigest: "old", content: "Label fields." }, + // Wording changed before approval never reached agents. + { version: 2, state: "proposed", contentDigest: "draft", content: "Label it." }, + { version: 3, state: "accepted", contentDigest: "new", content: "Label every field." }, + ], + }) + .mockResolvedValueOnce({ + outcomes: [ + { ...outcome, id: "score_old", usedLearningId: "use_1", version: 1 }, + { ...outcome, id: "score_new", usedLearningId: "use_2", version: 3 }, + ], + }) + .mockResolvedValueOnce({ + updates: [ + { ...open, id: "upd_dismissed", state: "dismissed" }, + // The package hides wording whose scores may no longer be read. + { id: "upd_withheld", state: "open", withheld: true, support: [] }, + open, + ], + }) + + const result = await getLearningHistory({ + applicationRoot: "/app", + cliPath: "/app/replica-learning.mjs", + learningId: "mem_1", + nodePath: "/node", + repositoryId: "11111111-2222-4333-8444-555555555555", + repositoryScope: "github.com/repositories/123", + root: "/private/learning", + staticDirectories: [], + }) + + expect(result.outcomes.map(({ id }) => id)).toEqual(["score_new"]) + expect(result.earlierGuidance).toEqual([ + { + version: 1, + title: null, + content: "Label fields.", + outcomes: [expect.objectContaining({ id: "score_old" })], + }, + ]) + expect(result.updates).toEqual([ + { + id: "upd_open", + issue: "The rule did not say where the label goes.", + title: null, + content: "Put labels above inputs.", + reasoning: "Builds kept placing labels inside inputs.", + support: [expect.objectContaining({ id: "score_new", commitSha: "a".repeat(40) })], + }, + ]) + }) }) diff --git a/hub/server/domains/learning/get-learning-history/index.ts b/hub/server/domains/learning/get-learning-history/index.ts index a7548418..262cb332 100644 --- a/hub/server/domains/learning/get-learning-history/index.ts +++ b/hub/server/domains/learning/get-learning-history/index.ts @@ -10,7 +10,13 @@ import type { LearningEvidenceReference, ReviewCommentLearningSource, } from "../review-comment-learning-source/types.ts" -import type { LearningDecisionRecord, LearningEvidence, ReportedLearningOutcome } from "../types.ts" +import type { + EarlierLearningGuidance, + LearningDecisionRecord, + LearningEvidence, + LearningUpdateSuggestion, + ReportedLearningOutcome, +} from "../types.ts" const decisionSchema = z .object({ @@ -47,6 +53,8 @@ const versionSchema = z digest: z.string().optional().catch(undefined), contentDigest: z.string().optional().catch(undefined), withheld: z.literal(true).optional(), + title: z.string().optional().catch(undefined), + content: z.string().optional().catch(undefined), updatedAt: z.string().optional(), proposal: z .object({ @@ -123,6 +131,25 @@ const observationsSchema = z }) .loose() +const updatesSchema = z + .object({ + updates: z.array( + z + .object({ + id: z.string().min(1), + state: z.string(), + // The package leaves out wording whose scores may no longer be read. + issue: z.string().optional(), + title: z.string().optional(), + content: z.string().optional(), + reasoning: z.string().optional(), + support: z.array(z.string()), + }) + .loose(), + ), + }) + .loose() + function login(identity: string | undefined) { return identity?.replace(/^(?:github|human):/, "") || null } @@ -221,6 +248,8 @@ export async function getLearningHistory(input: { contradictions: LearningEvidence[] otherContradictionsCount: number outcomes: ReportedLearningOutcome[] + earlierGuidance: EarlierLearningGuidance[] + updates: LearningUpdateSuggestion[] }> { // The ID is passed to the package as an argument, so it must never read as an option. if (input.learningId.startsWith("-")) { @@ -261,17 +290,50 @@ export async function getLearningHistory(input: { ), ) const history = decisions(shown.versions ?? []) - const outcomes = shown.withheld + const versions = shown.versions ?? [] + const scored = shown.withheld ? [] - : currentOutcomes( - outcomesSchema.parse( - await runLearningCommand( - ["outcomes", input.learningId, ...commonArguments], - commandOptions, - ), - ).outcomes, - shown.versions ?? [], - ) + : outcomesSchema.parse( + await runLearningCommand( + ["outcomes", input.learningId, ...commonArguments], + commandOptions, + ), + ).outcomes + const wording = versions.at(-1)?.contentDigest + const outcomes = wording ? outcomesOf(scored, versions, wording) : [] + const earlierGuidance = shown.withheld || !wording ? [] : earlier(scored, versions, wording) + // Only an accepted learning can take new wording, so other states never show one. + const updates = + shown.withheld || versions.at(-1)?.state !== "accepted" + ? [] + : updatesSchema + .parse( + await runLearningCommand( + ["updates", input.learningId, ...commonArguments], + commandOptions, + ), + ) + .updates.flatMap((update) => { + // Hub checks each supporting score before showing the wording, so a score + // it cannot read leaves the suggestion unchecked and hidden. + const support = update.support.map((id) => scored.find((score) => score.id === id)) + return update.state === "open" && + update.issue !== undefined && + update.content !== undefined && + update.reasoning !== undefined && + support.every((score) => score !== undefined) + ? [ + { + id: update.id, + issue: update.issue, + title: update.title ?? null, + content: update.content, + reasoning: update.reasoning, + support: support.map(reported), + }, + ] + : [] + }) const supporting = shown.withheld ? [] : (shown.record.evidence ?? []) const opposing = shown.withheld ? [] : (shown.record.contradictions ?? []) const references = [...supporting, ...opposing] @@ -283,6 +345,8 @@ export async function getLearningHistory(input: { contradictions: [], otherContradictionsCount: missingEventCount(opposing, []), outcomes, + earlierGuidance, + updates, } } // The package reads at most 100 events at once, so a detail page shows the first 100. @@ -333,17 +397,52 @@ export async function getLearningHistory(input: { contradictions, otherContradictionsCount: missingEventCount(opposing, contradictions), outcomes, + earlierGuidance, + updates, + } +} + +// Each wording agents were given before the current one, newest first, so people can +// compare how older guidance was scored with the guidance agents get now. +function earlier( + outcomes: z.infer["outcomes"], + versions: z.infer[], + current: string, +): EarlierLearningGuidance[] { + const latest = new Map>() + for (const version of versions) { + // Proposed wording that was changed before approval never reached agents. + if ( + version.state === "accepted" && + version.contentDigest && + version.contentDigest !== current + ) { + // Moving a repeated wording to the end keeps the list ordered by its last use. + latest.delete(version.contentDigest) + latest.set(version.contentDigest, version) + } } + return [...latest.entries()].reverse().flatMap(([wording, version]) => + version.version === undefined || version.withheld || version.content === undefined + ? [] + : [ + { + version: version.version, + title: version.title ?? null, + content: version.content, + outcomes: outcomesOf(outcomes, versions, wording), + }, + ], + ) } -// Scores of older wording say nothing about the guidance agents get now. Retiring and -// reinstating add versions with the same wording, so match the wording, not the number. -function currentOutcomes( +// Scores of other wording say nothing about this guidance. Retiring and reinstating add +// versions with the same wording, so match the wording, not the number. +function outcomesOf( outcomes: z.infer["outcomes"], versions: z.infer[], + wording: string, ): ReportedLearningOutcome[] { - const wording = versions.at(-1)?.contentDigest - if (!wording) return [] const current = new Set( versions.filter((entry) => entry.contentDigest === wording).map((entry) => entry.version), ) @@ -353,21 +452,25 @@ function currentOutcomes( const last = new Map(matching.map((outcome, index) => [outcome.usedLearningId, index])) return matching .filter((outcome, index) => last.get(outcome.usedLearningId) === index) - .map((outcome) => ({ - id: outcome.id, - source: outcome.inputs.includes("reviewer_verification") - ? ("reviewer_confirmed" as const) - : ("automated" as const), - commitSha: outcome.commitSha, - prototypeId: outcome.prototypeId ?? null, - efficiency: outcome.efficiency, - followed: outcome.followed, - reasoning: outcome.reasoning, - issue: outcome.issue ?? null, - scoredAt: outcome.scoredAt, - ...(outcome.before ? { before: screenshot(outcome.before) } : {}), - ...(outcome.after ? { after: screenshot(outcome.after) } : {}), - })) + .map(reported) +} + +function reported( + outcome: z.infer["outcomes"][number], +): ReportedLearningOutcome { + return { + id: outcome.id, + source: outcome.inputs.includes("reviewer_verification") ? "reviewer_confirmed" : "automated", + commitSha: outcome.commitSha, + prototypeId: outcome.prototypeId ?? null, + efficiency: outcome.efficiency, + followed: outcome.followed, + reasoning: outcome.reasoning, + issue: outcome.issue ?? null, + scoredAt: outcome.scoredAt, + ...(outcome.before ? { before: screenshot(outcome.before) } : {}), + ...(outcome.after ? { after: screenshot(outcome.after) } : {}), + } } function screenshot(value: z.infer) { diff --git a/hub/server/domains/learning/reconcile-learning-decision-operation/index.test.ts b/hub/server/domains/learning/reconcile-learning-decision-operation/index.test.ts index a83eb7b7..c7933521 100644 --- a/hub/server/domains/learning/reconcile-learning-decision-operation/index.test.ts +++ b/hub/server/domains/learning/reconcile-learning-decision-operation/index.test.ts @@ -7,6 +7,7 @@ const operation = { actorMembershipId: "22222222-2222-4222-8222-222222222222", decision: "accept", learningId: "mem_1", + proposalId: null, repositoryId: "33333333-3333-4333-8333-333333333333", } @@ -159,4 +160,81 @@ describe("reconcileLearningDecisionOperation()", () => { }), ) }) + + it("counts an apply as successful once its own edit landed", async () => { + const finish = vi.fn().mockResolvedValue(undefined) + const runCommand = vi.fn().mockResolvedValue({ state: "accepted" }) + + await reconcileLearningDecisionOperation( + { ...operation, decision: "apply_update", proposalId: "upd_1" }, + { + finish, + prepare: vi.fn().mockResolvedValue({ + directory: "/private/store", + repositoryScope: "github.com/repositories/123", + repositoryId: operation.repositoryId, + }), + runCommand, + withLock: async (run) => await run(new AbortController().signal), + }, + ) + + expect(runCommand).toHaveBeenCalledWith( + expect.arrayContaining(["operation-status", "--operation-id", operation.id]), + expect.anything(), + ) + expect(finish).toHaveBeenCalledWith(expect.objectContaining({ outcome: "succeeded" })) + }) + + it("recovers a dismissal this request saved", async () => { + const finish = vi.fn().mockResolvedValue(undefined) + const runCommand = vi.fn().mockResolvedValue({ + updates: [{ id: "upd_1", state: "dismissed", decision: { operationId: operation.id } }], + }) + + await reconcileLearningDecisionOperation( + { ...operation, decision: "dismiss_update", proposalId: "upd_1" }, + { + finish, + prepare: vi.fn().mockResolvedValue({ + directory: "/private/store", + repositoryScope: "github.com/repositories/123", + repositoryId: operation.repositoryId, + }), + runCommand, + withLock: async (run) => await run(new AbortController().signal), + }, + ) + + expect(finish).toHaveBeenCalledWith(expect.objectContaining({ outcome: "succeeded" })) + }) + + it("does not credit a stopped dismissal with another administrator's", async () => { + const finish = vi.fn().mockResolvedValue(undefined) + const runCommand = vi.fn().mockResolvedValue({ + updates: [ + { + id: "upd_1", + state: "dismissed", + decision: { operationId: "99999999-9999-4999-8999-999999999999" }, + }, + ], + }) + + await reconcileLearningDecisionOperation( + { ...operation, decision: "dismiss_update", proposalId: "upd_1" }, + { + finish, + prepare: vi.fn().mockResolvedValue({ + directory: "/private/store", + repositoryScope: "github.com/repositories/123", + repositoryId: operation.repositoryId, + }), + runCommand, + withLock: async (run) => await run(new AbortController().signal), + }, + ) + + expect(finish).toHaveBeenCalledWith(expect.objectContaining({ outcome: "failed" })) + }) }) diff --git a/hub/server/domains/learning/reconcile-learning-decision-operation/index.ts b/hub/server/domains/learning/reconcile-learning-decision-operation/index.ts index f6dac32c..6d49a9a9 100644 --- a/hub/server/domains/learning/reconcile-learning-decision-operation/index.ts +++ b/hub/server/domains/learning/reconcile-learning-decision-operation/index.ts @@ -8,6 +8,19 @@ const resultSchema = z state: z.enum(["proposed", "accepted", "rejected", "retired"]).nullable(), }) .loose() +const updatesSchema = z + .object({ + updates: z.array( + z + .object({ + id: z.string(), + state: z.string(), + decision: z.object({ operationId: z.string().optional() }).loose().optional(), + }) + .loose(), + ), + }) + .loose() export async function reconcileLearningDecisionOperation( operation: { @@ -15,6 +28,7 @@ export async function reconcileLearningDecisionOperation( actorMembershipId: string decision: string learningId: string + proposalId: string | null repositoryId: string }, dependencies: { @@ -39,25 +53,52 @@ export async function reconcileLearningDecisionOperation( reinstate: "accepted", reject: "rejected", retire: "retired", + // An apply's edit carries the operation, so the edit landing means it worked. + apply_update: "accepted", + dismiss_update: "dismissed", }[operation.decision] - if (!expected) throw new Error("The pending learning decision is invalid.") + const update = operation.decision === "apply_update" || operation.decision === "dismiss_update" + if (!expected || (update && !operation.proposalId)) + throw new Error("The pending learning decision is invalid.") await dependencies.withLock(async (signal) => { let outcome: "succeeded" | "failed" = "failed" let reason = "interrupted_or_failed" const store = await dependencies.prepare(operation.repositoryId) - const result = resultSchema.parse( - await dependencies.runCommand( - [ - "operation-status", - operation.learningId, - "--operation-id", - operation.id, - ...learningStoreArguments(store), - ], - { signal }, - ), - ) - if (result.state === expected) { + async function operationState() { + return resultSchema.parse( + await dependencies.runCommand( + [ + "operation-status", + operation.learningId, + "--operation-id", + operation.id, + ...learningStoreArguments(store), + ], + { signal }, + ), + ).state + } + // Another administrator may decide the same suggestion later, so each request + // looks only for its own mark: the edit an apply made, or the dismissal it saved. + const state = + operation.decision === "dismiss_update" + ? updatesSchema + .parse( + await dependencies.runCommand( + ["updates", operation.learningId, ...learningStoreArguments(store)], + { signal }, + ), + ) + .updates.some( + (item) => + item.id === operation.proposalId && + item.state === "dismissed" && + item.decision?.operationId === operation.id, + ) + ? "dismissed" + : null + : await operationState() + if (state === expected) { outcome = "succeeded" reason = "" } diff --git a/hub/server/domains/learning/types.ts b/hub/server/domains/learning/types.ts index bdb5e09f..7e3d5441 100644 --- a/hub/server/domains/learning/types.ts +++ b/hub/server/domains/learning/types.ts @@ -79,6 +79,14 @@ export type LearningDecision = | { decision: "retire"; reason: string } | { decision: "edit"; digest: string; title?: string; content?: string; reason: string } | { decision: "reinstate"; digest: string; reason: string } + | { + decision: "apply_update" + proposalId: string + title?: string + content?: string + reason: string + } + | { decision: "dismiss_update"; proposalId: string; reason: string } /** A learning an agent said it applied in a Build, with screenshots it may show. */ export type AppliedLearning = { @@ -123,3 +131,22 @@ export interface ReportedLearningOutcome { } type ReportedScreenshot = { sha256: string; route: string; consentGrantId?: string } + +/** Suggested new wording for an accepted learning, waiting for an administrator. */ +export interface LearningUpdateSuggestion { + id: string + issue: string + title: string | null + content: string + reasoning: string + /** Where the issue showed: the scores as reported, or the Builds people can open. */ + support: Support[] +} + +/** Wording agents were given before the current version, with how it was scored. */ +export interface EarlierLearningGuidance { + version: number + title: string | null + content: string + outcomes: Outcome[] +} diff --git a/hub/server/repositories/learning-decision-operations/create-learning-decision-operation/index.ts b/hub/server/repositories/learning-decision-operations/create-learning-decision-operation/index.ts index b1d1ba8a..b115016d 100644 --- a/hub/server/repositories/learning-decision-operations/create-learning-decision-operation/index.ts +++ b/hub/server/repositories/learning-decision-operations/create-learning-decision-operation/index.ts @@ -7,7 +7,9 @@ export function createLearningDecisionOperation( repositoryId: string actorMembershipId: string learningId: string - decision: "accept" | "reject" | "retire" | "edit" | "reinstate" + decision: + "accept" | "reject" | "retire" | "edit" | "reinstate" | "apply_update" | "dismiss_update" + proposalId?: string }, ) { return database.learningDecisionOperation.create({ data: input }) diff --git a/hub/server/repositories/learning-update-runs/find-latest-learning-update-result/index.ts b/hub/server/repositories/learning-update-runs/find-latest-learning-update-result/index.ts new file mode 100644 index 00000000..4ebe2c47 --- /dev/null +++ b/hub/server/repositories/learning-update-runs/find-latest-learning-update-result/index.ts @@ -0,0 +1,14 @@ +import type { PrismaClient } from "../../../generated/prisma/client.ts" + +/** What the newest finished check of one learning found, such as too little evidence. */ +export async function findLatestLearningUpdateResult( + database: Pick, + input: { repositoryId: string; memoryId: string }, +) { + const run = await database.learningUpdateRun.findFirst({ + where: { ...input, state: "SUCCEEDED" }, + orderBy: [{ createdAt: "desc" }, { id: "desc" }], + select: { result: true }, + }) + return run?.result ?? null +} diff --git a/hub/server/repositories/security-audits/create-security-audit/types.ts b/hub/server/repositories/security-audits/create-security-audit/types.ts index 9ddd6ad0..f745b7dc 100644 --- a/hub/server/repositories/security-audits/create-security-audit/types.ts +++ b/hub/server/repositories/security-audits/create-security-audit/types.ts @@ -228,7 +228,8 @@ export interface CopilotConnectionAudit extends SecurityAuditEvent { export interface LearningDecisionAudit extends SecurityAuditEvent { type: "learning_decision" actorMembershipId: string - decision: "accept" | "reject" | "retire" | "edit" | "reinstate" + decision: + "accept" | "reject" | "retire" | "edit" | "reinstate" | "apply_update" | "dismiss_update" learningId: string operationId: string outcome: "requested" | "succeeded" | "failed" diff --git a/hub/server/repositories/security-audits/parse-security-audit-event/index.ts b/hub/server/repositories/security-audits/parse-security-audit-event/index.ts index f714ef8f..33a1c6c5 100644 --- a/hub/server/repositories/security-audits/parse-security-audit-event/index.ts +++ b/hub/server/repositories/security-audits/parse-security-audit-event/index.ts @@ -289,7 +289,15 @@ const eventSchema = z.discriminatedUnion("type", [ z .object({ actorMembershipId: z.uuid(), - decision: z.enum(["accept", "reject", "retire", "edit", "reinstate"]), + decision: z.enum([ + "accept", + "reject", + "retire", + "edit", + "reinstate", + "apply_update", + "dismiss_update", + ]), id: z.uuid(), learningId: z.string().min(1).max(255), operationId: z.uuid(), diff --git a/hub/server/routes/api/learnings/create-learnings-route-dependencies/index.ts b/hub/server/routes/api/learnings/create-learnings-route-dependencies/index.ts index fbd7d273..b547e57b 100644 --- a/hub/server/routes/api/learnings/create-learnings-route-dependencies/index.ts +++ b/hub/server/routes/api/learnings/create-learnings-route-dependencies/index.ts @@ -37,6 +37,7 @@ import { createLearningRun } from "../../../../repositories/learning-runs/create import { finishLearningRun } from "../../../../repositories/learning-runs/finish-learning-run/index.ts" import { listLearningRuns } from "../../../../repositories/learning-runs/list-learning-runs/index.ts" import { listLearningActivityDays } from "../../../../repositories/learning-activity-days/list-learning-activity-days/index.ts" +import { findLatestLearningUpdateResult } from "../../../../repositories/learning-update-runs/find-latest-learning-update-result/index.ts" import { createLearningDecisionOperation } from "../../../../repositories/learning-decision-operations/create-learning-decision-operation/index.ts" import { deleteLearningDecisionOperation } from "../../../../repositories/learning-decision-operations/delete-learning-decision-operation/index.ts" import { listLearningShares } from "../../../../repositories/learning-shares/list-learning-shares/index.ts" @@ -244,6 +245,105 @@ export async function createLearningsRouteDependencies( : { state: "not-connected" as const } } + async function readHistory({ + repositoryId, + learningId, + }: { + repositoryId: string + learningId: string + }) { + const repositoryScope = await getLearningRepositoryScope(prisma, repositoryId) + const history = await getLearningHistory({ + ...configuration, + evidenceSource: source, + learningId, + repositoryId, + repositoryScope, + }) + if (repositoryScope !== (await getLearningRepositoryScope(prisma, repositoryId))) { + throw new LearningCommandError( + "repository_scope_unavailable", + "The repository learning scope changed. Try again.", + ) + } + const repository = await prisma.repository.findUnique({ + where: { id: repositoryId }, + select: { id: true, defaultBranch: true }, + }) + const scored = [ + ...history.outcomes, + ...history.earlierGuidance.flatMap((guidance) => guidance.outcomes), + ...history.updates.flatMap((update) => update.support), + ] + const builds = repository + ? await listSuccessfulCommitBuilds(prisma, { + repository, + commitShas: [...new Set(scored.map((outcome) => outcome.commitSha))], + }) + : [] + const consented = await consentedScreenshots(repositoryId, scored) + function buildOf({ + commitSha, + prototypeId, + }: Pick<(typeof scored)[number], "commitSha" | "prototypeId">) { + return builds.find( + (candidate) => + candidate.commitSha === commitSha && + (prototypeId === null || candidate.prototypeId === prototypeId), + ) + } + // The scorer's words may describe a screenshot that consent no longer covers. + function withheld({ before, after }: Pick<(typeof scored)[number], "before" | "after">) { + return Boolean( + (before && !consentedScreenshot(consented, before)) || + (after && !consentedScreenshot(consented, after)), + ) + } + // A score with no Build left to show is hidden rather than shown without context. + function shown(outcomes: typeof scored) { + return outcomes.flatMap((reported) => { + const { commitSha, prototypeId, before, after, ...outcome } = reported + const build = buildOf({ commitSha, prototypeId }) + if (!build) return [] + const shownBefore = consentedScreenshot(consented, before) + const shownAfter = consentedScreenshot(consented, after) + return [ + { + ...outcome, + ...(withheld(reported) ? { reasoning: "", issue: null } : {}), + build: { + prototypeId: build.prototypeId, + prototypeName: build.prototypeName, + number: build.number, + }, + ...(shownBefore ? { before: shownBefore } : {}), + ...(shownAfter ? { after: shownAfter } : {}), + }, + ] + }) + } + // Suggested wording is written from its supporting scores, so it may repeat what a + // hidden Build or a withdrawn screenshot showed. + const updates = history.updates.flatMap((update) => + update.support.every((outcome) => buildOf(outcome) && !withheld(outcome)) + ? [{ ...update, support: shown(update.support).map(({ build }) => build) }] + : [], + ) + const lastCheck = updates.length + ? null + : await findLatestLearningUpdateResult(prisma, { repositoryId, memoryId: learningId }) + return { + ...history, + outcomes: shown(history.outcomes), + earlierGuidance: history.earlierGuidance.map((guidance) => ({ + ...guidance, + outcomes: shown(guidance.outcomes), + })), + updates, + updateNeedsMoreEvidence: lastCheck === "insufficient_evidence", + } + } + return { applicationOrigin, automaticRunsEnabled: configuration.automaticRuns, @@ -306,64 +406,7 @@ export async function createLearningsRouteDependencies( } } }, - getHistory: async ({ repositoryId, learningId }) => { - const repositoryScope = await getLearningRepositoryScope(prisma, repositoryId) - const history = await getLearningHistory({ - ...configuration, - evidenceSource: source, - learningId, - repositoryId, - repositoryScope, - }) - if (repositoryScope !== (await getLearningRepositoryScope(prisma, repositoryId))) { - throw new LearningCommandError( - "repository_scope_unavailable", - "The repository learning scope changed. Try again.", - ) - } - const repository = await prisma.repository.findUnique({ - where: { id: repositoryId }, - select: { id: true, defaultBranch: true }, - }) - const builds = repository - ? await listSuccessfulCommitBuilds(prisma, { - repository, - commitShas: [...new Set(history.outcomes.map((outcome) => outcome.commitSha))], - }) - : [] - const consented = await consentedScreenshots(repositoryId, history.outcomes) - return { - ...history, - // A score with no Build left to show is hidden rather than shown without context. - outcomes: history.outcomes.flatMap( - ({ commitSha, prototypeId, before, after, ...outcome }) => { - const build = builds.find( - (candidate) => - candidate.commitSha === commitSha && - (prototypeId === null || candidate.prototypeId === prototypeId), - ) - if (!build) return [] - const shownBefore = consentedScreenshot(consented, before) - const shownAfter = consentedScreenshot(consented, after) - // The scorer's words may describe a screenshot that consent no longer covers. - const withheld = Boolean((before && !shownBefore) || (after && !shownAfter)) - return [ - { - ...outcome, - ...(withheld ? { reasoning: "", issue: null } : {}), - build: { - prototypeId: build.prototypeId, - prototypeName: build.prototypeName, - number: build.number, - }, - ...(shownBefore ? { before: shownBefore } : {}), - ...(shownAfter ? { after: shownAfter } : {}), - }, - ] - }, - ), - } - }, + getHistory: readHistory, getAppliedLearnings: async ({ repositoryId, prototypeId, commitSha }) => { const repositoryScope = await getLearningRepositoryScope(prisma, repositoryId) const applied = await getAppliedLearnings({ @@ -844,6 +887,19 @@ export async function createLearningsRouteDependencies( if (!(await findRepository(viewer, input.repositoryId))) { throw new LearningsError(404, "repository_not_found", "Repository not found.") } + // Consent or a Build can disappear after a suggestion is shown, so its + // wording is checked again before agents can get it. + const decision = input.decision + if ( + decision.decision === "apply_update" && + !(await readHistory(input)).updates.some(({ id }) => id === decision.proposalId) + ) { + throw new LearningsError( + 409, + "stale_review", + "That suggested update can no longer be applied. Refresh to see the latest.", + ) + } const authorized = await runRepositoryAuthorityTransaction(async (transaction) => { if ( !(await lockRepositoryAdministratorSession(transaction, { @@ -863,6 +919,9 @@ export async function createLearningsRouteDependencies( actorMembershipId, decision: input.decision.decision, learningId: input.learningId, + ...("proposalId" in input.decision + ? { proposalId: input.decision.proposalId } + : {}), repositoryId: input.repositoryId, }) await createSecurityAudit(transaction, { diff --git a/hub/server/routes/api/learnings/create-learnings-route-dependencies/learning-outcomes.db.test.ts b/hub/server/routes/api/learnings/create-learnings-route-dependencies/learning-outcomes.db.test.ts index c7851640..34c36e2b 100644 --- a/hub/server/routes/api/learnings/create-learnings-route-dependencies/learning-outcomes.db.test.ts +++ b/hub/server/routes/api/learnings/create-learnings-route-dependencies/learning-outcomes.db.test.ts @@ -73,6 +73,8 @@ describe("learning outcomes", () => { otherEvidenceCount: 0, contradictions: [], otherContradictionsCount: 0, + earlierGuidance: [], + updates: [], outcomes: [ { ...score, id: "score_checkout", commitSha: shared, prototypeId: checkout.id }, { ...score, id: "score_signup", commitSha: shared, prototypeId: signup.id }, @@ -95,7 +97,7 @@ describe("learning outcomes", () => { ]) }) - it("hides the scorer's words when a screenshot it saw is no longer shown", async () => { + it("hides the scorer's words, and suggestions drawn from them, when a screenshot is no longer shown", async () => { const repository = await prisma.repository.create({ data: { defaultBranch: "main", githubRepositoryId: 18n, nameWithOwner: "octo/consent" }, }) @@ -118,26 +120,43 @@ describe("learning outcomes", () => { finishedAt: new Date("2026-12-01T00:01:00Z"), }, }) + const withScreenshot = { + id: "score_with_screenshot", + source: "automated" as const, + commitSha, + prototypeId: prototype.id, + efficiency: 2, + followed: "followed" as const, + reasoning: "The screenshot shows the card number.", + issue: "The card number is visible.", + scoredAt: "2026-12-02T00:00:00.000Z", + after: { sha256: "d".repeat(64), route: "/checkout", consentGrantId: "grant_old" }, + } + const fromDiff = { + ...withScreenshot, + id: "score_from_diff", + reasoning: "The diff removed the label.", + issue: "The label is gone.", + after: undefined, + } + const suggestion = { + issue: "Labels go missing.", + title: null, + content: "Keep a visible label on every field.", + reasoning: "Builds kept dropping labels.", + } vi.mocked(getLearningHistory).mockResolvedValue({ decisions: [], evidence: [], otherEvidenceCount: 0, contradictions: [], otherContradictionsCount: 0, - outcomes: [ - { - id: "score_with_screenshot", - source: "automated", - commitSha, - prototypeId: prototype.id, - efficiency: 2, - followed: "followed", - reasoning: "The screenshot shows the card number.", - issue: "The card number is visible.", - scoredAt: "2026-12-02T00:00:00.000Z", - after: { sha256: "d".repeat(64), route: "/checkout", consentGrantId: "grant_old" }, - }, + earlierGuidance: [], + updates: [ + { ...suggestion, id: "upd_from_screenshot", support: [withScreenshot, fromDiff] }, + { ...suggestion, id: "upd_from_diff", support: [fromDiff] }, ], + outcomes: [withScreenshot], }) const learnings = await createLearningsRouteDependencies( { HUB_APPLICATION_ORIGIN: "https://hub.example.test", DATABASE_URL: getDatabaseUrl() }, @@ -151,5 +170,11 @@ describe("learning outcomes", () => { expect.objectContaining({ id: "score_with_screenshot", reasoning: "", issue: null }), ]) expect(history.outcomes[0]).not.toHaveProperty("after") + expect(history.updates).toEqual([ + expect.objectContaining({ + id: "upd_from_diff", + support: [{ prototypeId: prototype.id, prototypeName: "Checkout", number: 1 }], + }), + ]) }) }) diff --git a/hub/server/routes/api/learnings/decision/post/index.ts b/hub/server/routes/api/learnings/decision/post/index.ts index 5f17d37b..68622fcb 100644 --- a/hub/server/routes/api/learnings/decision/post/index.ts +++ b/hub/server/routes/api/learnings/decision/post/index.ts @@ -7,6 +7,7 @@ import { respondLearningError } from "../../respond-learning-error/index.ts" import type { LearningsRouteDependencies } from "../../types.ts" const digest = z.string().regex(/^sha256:[0-9a-f]{64}$/) +const proposalId = z.string().regex(/^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$/) const decisionSchema = z.discriminatedUnion("decision", [ z .object({ @@ -45,6 +46,22 @@ const decisionSchema = z.discriminatedUnion("decision", [ reason: z.string().trim().min(1).max(500), }) .strict(), + z + .object({ + decision: z.literal("apply_update"), + proposalId, + title: z.string().trim().min(1).max(120).optional(), + content: z.string().trim().min(1).max(2000).optional(), + reason: z.string().trim().min(1).max(500), + }) + .strict(), + z + .object({ + decision: z.literal("dismiss_update"), + proposalId, + reason: z.string().trim().min(1).max(500), + }) + .strict(), ]) const learningIdSchema = z .string() diff --git a/hub/server/routes/api/learnings/types.ts b/hub/server/routes/api/learnings/types.ts index a0ba332b..c720b8da 100644 --- a/hub/server/routes/api/learnings/types.ts +++ b/hub/server/routes/api/learnings/types.ts @@ -1,6 +1,8 @@ import type { CurrentSessionDependencies } from "../auth/types.ts" import type { ProductViewer } from "../product/types.ts" import type { + EarlierLearningGuidance, + LearningUpdateSuggestion, AcceptedLearning, AppliedLearning, LearningDecision, @@ -101,6 +103,10 @@ export interface LearningsRouteDependencies { evidence: LearningEvidence[] otherEvidenceCount: number outcomes: LearningOutcome[] + earlierGuidance: EarlierLearningGuidance[] + updates: LearningUpdateSuggestion[] + /** Whether the last check found too few scored uses to suggest new wording. */ + updateNeedsMoreEvidence: boolean }> getAppliedLearnings(input: { repositoryId: string diff --git a/hub/server/routes/api/security-audits/present-security-audit/index.test.ts b/hub/server/routes/api/security-audits/present-security-audit/index.test.ts index 49725bdf..3a6efec0 100644 --- a/hub/server/routes/api/security-audits/present-security-audit/index.test.ts +++ b/hub/server/routes/api/security-audits/present-security-audit/index.test.ts @@ -433,6 +433,31 @@ describe("presentSecurityAudit()", () => { outcome: "success", }), }, + { + label: "a failed suggested learning update", + event: { + actorMembershipId, + decision: "apply_update", + id: auditId, + learningId: "mem_1", + operationId: sessionId, + outcome: "failed", + reason: "stale_review", + repositoryId: providerId, + type: "learning_decision", + }, + expected: expectedRecord({ + action: "learning.apply_update", + actor: { membershipId: actorMembershipId }, + context: { + repositoryId: providerId, + learningId: "mem_1", + operationId: sessionId, + reason: "stale_review", + }, + outcome: "failure", + }), + }, { label: "repository learning acceptance request", event: { diff --git a/hub/server/routes/api/security-audits/present-security-audit/index.ts b/hub/server/routes/api/security-audits/present-security-audit/index.ts index 53c91890..2ec1e537 100644 --- a/hub/server/routes/api/security-audits/present-security-audit/index.ts +++ b/hub/server/routes/api/security-audits/present-security-audit/index.ts @@ -91,6 +91,10 @@ function actorFor(record: SecurityAuditListRecord) { } case "learning.accept": case "learning.accept.requested": + case "learning.apply_update": + case "learning.apply_update.requested": + case "learning.dismiss_update": + case "learning.dismiss_update.requested": case "learning.edit": case "learning.edit.requested": case "learning.reinstate": @@ -407,6 +411,10 @@ function contextFor(record: SecurityAuditListRecord): Record Date: Thu, 26 Nov 2026 02:45:07 -0800 Subject: [PATCH 3/4] feat(hub): review suggested updates and earlier guidance Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 25291e01-0146-42cb-ac6d-f5e1dd5c35f5 --- .../hub/learnings-contracts/index.ts | 75 +++++-- .../hub/learnings-contracts/types.ts | 30 +++ .../hub/routes/settings-learnings/index.tsx | 12 +- .../learnings-library/index.test.ts | 69 +++++++ .../view-models/learnings-library/index.ts | 39 +++- .../features/learnings-library/index.tsx | 185 +++++++++++++++++- .../features/learnings-library/styles.css | 11 ++ .../features/learnings-library/types.ts | 26 +++ hub/client/pages/learnings-page/stories.tsx | 75 +++++++ 9 files changed, 501 insertions(+), 21 deletions(-) diff --git a/hub/client/application/hub/learnings-contracts/index.ts b/hub/client/application/hub/learnings-contracts/index.ts index 866b3683..d77c9a07 100644 --- a/hub/client/application/hub/learnings-contracts/index.ts +++ b/hub/client/application/hub/learnings-contracts/index.ts @@ -125,6 +125,31 @@ export const appliedLearningsResponseSchema = z }) .strict() satisfies z.ZodType +const buildSchema = z + .object({ + prototypeId: recordIdentifierSchema, + prototypeName: z.string().min(1), + number: identifier, + }) + .strict() + +const learningOutcomeResponseSchema = z + .object({ + id: z.string().min(1), + source: z.enum(["automated", "reviewer_confirmed"]), + efficiency: z.number().int().min(1).max(4), + followed: z.enum(["followed", "not_followed", "unclear"]), + reasoning: z.string(), + issue: z.string().nullable(), + scoredAt: timestamp, + build: buildSchema, + before: appliedScreenshotSchema.optional(), + after: appliedScreenshotSchema.optional(), + }) + .strict() + +const proposalId = z.string().regex(/^[a-z][a-z0-9]{1,15}_[A-Za-z0-9_-]{8,128}$/) + export const learningHistoryResponseSchema = z .object({ decisions: z.array( @@ -143,28 +168,30 @@ export const learningHistoryResponseSchema = z otherEvidenceCount: count, contradictions: z.array(learningEvidenceResponseSchema), otherContradictionsCount: count, - outcomes: z.array( + outcomes: z.array(learningOutcomeResponseSchema), + earlierGuidance: z.array( z .object({ - id: z.string().min(1), - source: z.enum(["automated", "reviewer_confirmed"]), - efficiency: z.number().int().min(1).max(4), - followed: z.enum(["followed", "not_followed", "unclear"]), + version: identifier, + title: z.string().nullable(), + content: z.string(), + outcomes: z.array(learningOutcomeResponseSchema), + }) + .strict(), + ), + updates: z.array( + z + .object({ + id: proposalId, + issue: z.string(), + title: z.string().nullable(), + content: z.string(), reasoning: z.string(), - issue: z.string().nullable(), - scoredAt: timestamp, - build: z - .object({ - prototypeId: recordIdentifierSchema, - prototypeName: z.string().min(1), - number: identifier, - }) - .strict(), - before: appliedScreenshotSchema.optional(), - after: appliedScreenshotSchema.optional(), + support: z.array(buildSchema), }) .strict(), ), + updateNeedsMoreEvidence: z.boolean(), }) .strict() satisfies z.ZodType @@ -309,6 +336,22 @@ export const learningDecisionInputSchema = z.discriminatedUnion("decision", [ reason: z.string().trim().min(1).max(500), }) .strict(), + z + .object({ + decision: z.literal("apply_update"), + proposalId, + title: titleInput.optional(), + content: z.string().trim().min(1).max(2000).optional(), + reason: z.string().trim().min(1).max(500), + }) + .strict(), + z + .object({ + decision: z.literal("dismiss_update"), + proposalId, + reason: z.string().trim().min(1).max(500), + }) + .strict(), ]) satisfies z.ZodType export const learningShareInputSchema = z diff --git a/hub/client/application/hub/learnings-contracts/types.ts b/hub/client/application/hub/learnings-contracts/types.ts index 1574a0e4..699275c3 100644 --- a/hub/client/application/hub/learnings-contracts/types.ts +++ b/hub/client/application/hub/learnings-contracts/types.ts @@ -85,6 +85,28 @@ export interface LearningHistoryResponse { contradictions: LearningEvidenceResponse[] otherContradictionsCount: number outcomes: LearningOutcomeResponse[] + /** Wording agents were given before the current version, newest first. */ + earlierGuidance: Array<{ + version: number + title: string | null + content: string + outcomes: LearningOutcomeResponse[] + }> + /** Suggested new wording waiting for an administrator. */ + updates: LearningUpdateResponse[] + /** Whether the last check found too few scored uses to suggest new wording. */ + updateNeedsMoreEvidence: boolean +} + +/** Suggested new wording, drafted because scored uses kept showing the same issue. */ +export interface LearningUpdateResponse { + id: string + issue: string + title: string | null + content: string + reasoning: string + /** The Builds whose scores showed the issue. */ + support: LearningOutcomeResponse["build"][] } /** How one use of a learning was scored, with the Build it judged. */ @@ -174,6 +196,14 @@ export type LearningDecisionInput = | { decision: "retire"; reason: string } | { decision: "edit"; digest: string; title?: string; content?: string; reason: string } | { decision: "reinstate"; digest: string; reason: string } + | { + decision: "apply_update" + proposalId: string + title?: string + content?: string + reason: string + } + | { decision: "dismiss_update"; proposalId: string; reason: string } export interface LearningShareInput { shared: boolean diff --git a/hub/client/application/hub/routes/settings-learnings/index.tsx b/hub/client/application/hub/routes/settings-learnings/index.tsx index a51c9dcb..741a12f5 100644 --- a/hub/client/application/hub/routes/settings-learnings/index.tsx +++ b/hub/client/application/hub/routes/settings-learnings/index.tsx @@ -355,7 +355,17 @@ function submitDecision( } : decision === "reinstate" ? { decision, digest: form.get("digest"), reason: form.get("reason") } - : { decision } + : decision === "apply_update" + ? { + decision, + proposalId: form.get("proposalId"), + ...(typeof title === "string" && title.trim() ? { title } : {}), + content: form.get("content"), + reason: form.get("reason"), + } + : decision === "dismiss_update" + ? { decision, proposalId: form.get("proposalId"), reason: form.get("reason") } + : { decision } const parsed = learningDecisionInputSchema.safeParse(input) if (!parsed.success) { throw new Response(parsed.error.issues.map(({ message }) => message).join(" "), { status: 422 }) diff --git a/hub/client/application/hub/view-models/learnings-library/index.test.ts b/hub/client/application/hub/view-models/learnings-library/index.test.ts index 2822ec33..d507a791 100644 --- a/hub/client/application/hub/view-models/learnings-library/index.test.ts +++ b/hub/client/application/hub/view-models/learnings-library/index.test.ts @@ -107,6 +107,9 @@ describe("learningsLibrary()", () => { contradictions: [], otherContradictionsCount: 0, outcomes: [], + earlierGuidance: [], + updates: [], + updateNeedsMoreEvidence: false, }, ) @@ -223,6 +226,9 @@ describe("learningsLibrary()", () => { ], otherContradictionsCount: 1, outcomes: [], + earlierGuidance: [], + updates: [], + updateNeedsMoreEvidence: false, }, ) @@ -265,6 +271,9 @@ describe("learningsLibrary()", () => { otherEvidenceCount: 0, contradictions: [], otherContradictionsCount: 0, + earlierGuidance: [], + updates: [], + updateNeedsMoreEvidence: false, outcomes: [ { ...score, @@ -306,4 +315,64 @@ describe("learningsLibrary()", () => { afterScreenshotUrl: `/api/repositories/2001/learnings/screenshots/${"b".repeat(64)}`, }) }) + + it("links each Build that showed a suggested update's issue once", () => { + const state = emptyLearnings() + state.learnings = [ + { + id: "mem_active", + title: "Keep labels visible", + content: "Show a label above every field.", + digest, + acceptedBy: "hubot", + acceptedAt: "2026-10-09T15:00:00Z", + edited: false, + lastDecision: "accepted", + status: "recalled", + shared: false, + }, + ] + + const result = learningsLibrary( + state, + { pathname, search: "?status=active&learning=mem_active" }, + { + decisions: [], + evidence: [], + otherEvidenceCount: 0, + contradictions: [], + otherContradictionsCount: 0, + earlierGuidance: [], + updateNeedsMoreEvidence: false, + // A reviewer's later score replaced these in the current list, but the + // suggestion still links the Builds it was drafted from. + outcomes: [], + updates: [ + { + id: "upd_1", + issue: "The rule did not say where the label goes.", + title: null, + content: "Show a label above every field, outside the input.", + reasoning: "Builds kept placing labels inside inputs.", + // Both scores of one Build supported it. + support: [ + { prototypeId: "17", prototypeName: "Checkout", number: 3 }, + { prototypeId: "17", prototypeName: "Checkout", number: 3 }, + ], + }, + ], + }, + ) + + expect(result.selected?.updates).toEqual([ + { + id: "upd_1", + issue: "The rule did not say where the label goes.", + title: null, + content: "Show a label above every field, outside the input.", + reasoning: "Builds kept placing labels inside inputs.", + support: [{ label: "Checkout, Build 3", path: "/repositories/2001/prototypes/17?build=3" }], + }, + ]) + }) }) diff --git a/hub/client/application/hub/view-models/learnings-library/index.ts b/hub/client/application/hub/view-models/learnings-library/index.ts index 30915bb3..40851494 100644 --- a/hub/client/application/hub/view-models/learnings-library/index.ts +++ b/hub/client/application/hub/view-models/learnings-library/index.ts @@ -80,6 +80,13 @@ function evidence(items: LearningEvidenceResponse[], repositoryId: string): Lear * Reads a score as a plain result. A score only says something about the guidance when * the agent followed it, and 3 or 4 means the work went well. */ +function buildLink(build: LearningOutcomeResponse["build"], repositoryId: string) { + return { + label: `${build.prototypeName}, Build ${build.number}`, + path: `/repositories/${repositoryId}/prototypes/${build.prototypeId}?build=${build.number}`, + } +} + function outcomes(items: LearningOutcomeResponse[], repositoryId: string): LearningOutcome[] { function screenshot(value?: { sha256: string }) { return value ? `/api/repositories/${repositoryId}/learnings/screenshots/${value.sha256}` : null @@ -90,8 +97,8 @@ function outcomes(items: LearningOutcomeResponse[], repositoryId: string): Learn item.followed !== "followed" ? "inconclusive" : item.efficiency >= 3 ? "supports" : "concern", reviewerConfirmed: item.source === "reviewer_confirmed", summary: item.issue ?? item.reasoning, - buildLabel: `${item.build.prototypeName}, Build ${item.build.number}`, - buildPath: `/repositories/${repositoryId}/prototypes/${item.build.prototypeId}?build=${item.build.number}`, + buildLabel: buildLink(item.build, repositoryId).label, + buildPath: buildLink(item.build, repositoryId).path, evaluatedAt: item.scoredAt, beforeScreenshotUrl: screenshot(item.before), afterScreenshotUrl: screenshot(item.after), @@ -227,6 +234,7 @@ function detail( const repositoryId = state.repository.id const path = `/repositories/${repositoryId}/learnings/${encodeURIComponent(record.id)}/decision` const canDecide = state.permissions.decide + const current = outcomes(history?.outcomes ?? [], repositoryId) const common = { id: record.id, status: record.status, @@ -252,7 +260,15 @@ function detail( reason: entry.reason, })), // Only guidance agents get now can have later Builds to judge. - outcomes: record.status === "active" ? outcomes(history?.outcomes ?? [], repositoryId) : null, + outcomes: record.status === "active" ? current : null, + updates: [], + updateNeedsMoreEvidence: false, + earlierGuidance: (history?.earlierGuidance ?? []).map((guidance) => ({ + version: guidance.version, + title: guidance.title, + guidance: guidance.content, + outcomes: outcomes(guidance.outcomes, repositoryId), + })), source: record.source, share: null, } @@ -317,6 +333,23 @@ function detail( recallFact(accepted.status), ...(accepted.shared ? ["Shared across Hub"] : []), ], + updates: (history?.updates ?? []).map((update) => ({ + id: update.id, + issue: update.issue, + title: update.title, + content: update.content, + reasoning: update.reasoning, + // Both scores of one Build can support a suggestion, so each Build is linked once. + support: [ + ...new Map( + update.support.map((build) => { + const link = buildLink(build, repositoryId) + return [link.path, link] + }), + ).values(), + ], + })), + updateNeedsMoreEvidence: history?.updateNeedsMoreEvidence ?? false, decision: canDecide && accepted.digest && accepted.content !== null ? { diff --git a/hub/client/features/learnings-library/index.tsx b/hub/client/features/learnings-library/index.tsx index 26e36995..7b4fa372 100644 --- a/hub/client/features/learnings-library/index.tsx +++ b/hub/client/features/learnings-library/index.tsx @@ -36,6 +36,7 @@ import type { LearningEvidence, LearningOutcome, LearningStatus, + LearningUpdate, LearningsLibraryData, } from "./types" import "./styles.css" @@ -255,6 +256,16 @@ function LearningDetailView({ error: { error: string } | null }) { const [dialog, setDialog] = useState<"reject" | "edit" | "retire" | "reinstate" | null>(null) + const [openedUpdate, setUpdateDialog] = useState<{ + action: "apply" | "dismiss" + update: LearningUpdate + } | null>(null) + // A decided suggestion leaves the refreshed list, so its dialog has nothing to submit. + // A failed attempt keeps the suggestion, and with it the person's draft. + const updateDialog = + openedUpdate && learning.updates.some(({ id }) => id === openedUpdate.update.id) + ? openedUpdate + : null // An error from an earlier attempt does not belong to a dialog opened afterwards. const [staleError, setStaleError] = useState(error) const decision = learning.decision @@ -266,6 +277,11 @@ function LearningDetailView({ setDialog(next) } + function openUpdate(next: NonNullable) { + setStaleError(error) + setUpdateDialog(next) + } + return (
@@ -431,12 +447,94 @@ function LearningDetailView({ ) : null} + {learning.updates.map((update) => ( + +
+ + Issue: {update.issue} + + {update.title ? ( + + New title: {update.title} + + ) : null} + + {update.content} + +
+
+ {decision ? ( +
+ + +
+ ) : null} + + ))} + {learning.outcomes ? ( + {learning.updateNeedsMoreEvidence ? ( + + Not enough Builds show the same issue to suggest new wording yet. + + ) : null} + + ) : null} + + {learning.earlierGuidance.length ? ( + + {learning.earlierGuidance.map((guidance) => ( +
+
+ + Version {guidance.version} + {guidance.title ? ` · ${guidance.title}` : null} + + + {guidance.guidance} + +
+ +
+ ))}
) : null} @@ -528,6 +626,87 @@ function LearningDetailView({ ) : null} + + {decision && updateDialog ? ( + setUpdateDialog(null)} + > +

+ {updateDialog.action === "apply" + ? "Agents get this wording. You can change it before applying." + : "Copilot suggests it again only when new Builds show the issue."} +

+ {error && error !== staleError ? ( + + ) : null} + + {updateDialog.action === "apply" ? ( + <> + {/* A blank title would fall back to the suggested one, so a suggested + title must be kept or reworded rather than cleared. */} + + Title + + + + Guidance +