From 1d6028d0825b5335f56ac5369dfdd7e7d5dd9392 Mon Sep 17 00:00:00 2001 From: thisrohangupta <52221549+thisrohangupta@users.noreply.github.com> Date: Thu, 9 Jul 2026 00:41:56 +0000 Subject: [PATCH 1/2] chore: auto-sync harness schemas --- src/data/schemas/v0/pipeline.ts | 1130 +++++++++++++++++++++++++----- src/data/schemas/v0/template.ts | 1131 ++++++++++++++++++++++++++++--- 2 files changed, 2008 insertions(+), 253 deletions(-) diff --git a/src/data/schemas/v0/pipeline.ts b/src/data/schemas/v0/pipeline.ts index 985f6b0da..bfa232f8a 100644 --- a/src/data/schemas/v0/pipeline.ts +++ b/src/data/schemas/v0/pipeline.ts @@ -83534,8 +83534,15 @@ const schema: Record = { "type": "string" }, "name": { - "type": "string", - "pattern": "^[a-zA-Z_][0-9a-zA-Z_\\.\\[\\]$-]{0,127}$" + "oneOf": [ + { + "type": "string", + "pattern": "^[a-zA-Z_][0-9a-zA-Z_\\.\\[\\]$-]{0,127}$" + }, + { + "pattern": "(<\\+.+>.*)" + } + ] }, "type": { "type": "string", @@ -83573,8 +83580,15 @@ const schema: Record = { "format": "double" }, "name": { - "type": "string", - "pattern": "^[a-zA-Z_][0-9a-zA-Z_\\.\\[\\]$-]{0,127}$" + "oneOf": [ + { + "type": "string", + "pattern": "^[a-zA-Z_][0-9a-zA-Z_\\.\\[\\]$-]{0,127}$" + }, + { + "pattern": "(<\\+.+>.*)" + } + ] }, "type": { "type": "string", @@ -83624,8 +83638,15 @@ const schema: Record = { "type": "string" }, "name": { - "type": "string", - "pattern": "^[a-zA-Z_][0-9a-zA-Z_\\.\\[\\]$-]{0,127}$" + "oneOf": [ + { + "type": "string", + "pattern": "^[a-zA-Z_][0-9a-zA-Z_\\.\\[\\]$-]{0,127}$" + }, + { + "pattern": "(<\\+.+>.*)" + } + ] }, "type": { "type": "string", @@ -90190,22 +90211,518 @@ const schema: Record = { "if": { "properties": { "type": { - "const": "AzureContainerAppsRollback" + "const": "AzureContainerAppsRollback" + } + } + }, + "then": { + "properties": { + "spec": { + "$ref": "#/definitions/pipeline/steps/cd/AzureContainerAppsRollbackStepInfo" + } + } + } + } + ] + }, + "AzureContainerAppsRollbackStepInfo": { + "title": "AzureContainerAppsRollbackStepInfo", + "allOf": [ + { + "$ref": "#/definitions/pipeline/common/StepSpecType" + }, + { + "type": "object", + "properties": { + "connectorRef": { + "type": "string" + }, + "delegateSelectors": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] + }, + "image": { + "type": "string" + }, + "imagePullPolicy": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Always", + "Never", + "IfNotPresent" + ] + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] + }, + "privileged": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "^<\\+input>((\\.)((executionInput\\(\\))|(allowedValues|selectOneFrom|selectManyFrom|default|regex)\\(.+?\\)))*$", + "minLength": 1 + } + ] + }, + "resources": { + "$ref": "#/definitions/pipeline/common/ContainerResource" + }, + "runAsUser": { + "oneOf": [ + { + "type": "integer", + "format": "int32" + }, + { + "type": "string" + } + ] + }, + "preExecution": { + "type": "string" + } + } + } + ], + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "connectorRef": { + "type": "string" + }, + "delegateSelectors": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] + }, + "image": { + "type": "string" + }, + "imagePullPolicy": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Always", + "Never", + "IfNotPresent" + ] + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] + }, + "privileged": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "^<\\+input>((\\.)((executionInput\\(\\))|(allowedValues|selectOneFrom|selectManyFrom|default|regex)\\(.+?\\)))*$", + "minLength": 1 + } + ] + }, + "resources": { + "$ref": "#/definitions/pipeline/common/ContainerResource" + }, + "runAsUser": { + "oneOf": [ + { + "type": "integer", + "format": "int32" + }, + { + "type": "string" + } + ] + }, + "preExecution": { + "type": "string" + }, + "description": { + "desc": "This is the description for AzureContainerAppsRollbackStepInfo" + } + } + }, + "GoogleCloudRunPrepareRollbackDataStepNode": { + "title": "GoogleCloudRunPrepareRollbackDataStepNode", + "type": "object", + "required": [ + "identifier", + "name", + "type" + ], + "properties": { + "description": { + "type": "string", + "desc": "This is the description for GoogleCloudRunPrepareRollbackDataStepNode" + }, + "enforce": { + "$ref": "#/definitions/pipeline/common/PolicyConfig" + }, + "failureStrategies": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/pipeline/common/FailureStrategyConfig" + } + }, + { + "type": "string", + "pattern": "^<\\+input>$", + "minLength": 1 + } + ] + }, + "identifier": { + "type": "string", + "pattern": "^[a-zA-Z_][0-9a-zA-Z_]{0,127}$" + }, + "name": { + "type": "string", + "pattern": "^[a-zA-Z_0-9-.][-0-9a-zA-Z_\\s.]{0,127}$" + }, + "strategy": { + "oneOf": [ + { + "$ref": "#/definitions/pipeline/common/StrategyConfig" + }, + { + "type": "string", + "pattern": "^<\\+input>$", + "minLength": 1 + } + ] + }, + "timeout": { + "type": "string", + "pattern": "^(([1-9])+\\d+[s])|(((([1-9])+\\d*[mhwd])+([\\s]?\\d+[smhwd])*)|(.*<\\+.*>(?!.*\\.executionInput\\(\\)).*)|(^$))$" + }, + "type": { + "type": "string", + "enum": [ + "GoogleCloudRunPrepareRollbackData" + ] + }, + "when": { + "oneOf": [ + { + "$ref": "#/definitions/pipeline/common/StepWhenCondition" + }, + { + "type": "string", + "pattern": "^<\\+input>$", + "minLength": 1 + } + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "GoogleCloudRunPrepareRollbackData" + } + } + }, + "then": { + "properties": { + "spec": { + "$ref": "#/definitions/pipeline/steps/cd/GoogleCloudRunPrepareRollbackDataStepInfo" + } + } + } + } + ] + }, + "GoogleCloudRunPrepareRollbackDataStepInfo": { + "title": "GoogleCloudRunPrepareRollbackDataStepInfo", + "allOf": [ + { + "$ref": "#/definitions/pipeline/common/StepSpecType" + }, + { + "type": "object", + "properties": { + "connectorRef": { + "type": "string" + }, + "delegateSelectors": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] + }, + "image": { + "type": "string" + }, + "imagePullPolicy": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Always", + "Never", + "IfNotPresent" + ] + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] + }, + "privileged": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "^<\\+input>((\\.)((executionInput\\(\\))|(allowedValues|selectOneFrom|selectManyFrom|default|regex)\\(.+?\\)))*$", + "minLength": 1 + } + ] + }, + "resources": { + "$ref": "#/definitions/pipeline/common/ContainerResource" + }, + "runAsUser": { + "oneOf": [ + { + "type": "integer", + "format": "int32" + }, + { + "type": "string" + } + ] + }, + "preExecution": { + "type": "string" + } + } + } + ], + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "connectorRef": { + "type": "string" + }, + "delegateSelectors": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] + }, + "image": { + "type": "string" + }, + "imagePullPolicy": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Always", + "Never", + "IfNotPresent" + ] + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] + }, + "privileged": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "^<\\+input>((\\.)((executionInput\\(\\))|(allowedValues|selectOneFrom|selectManyFrom|default|regex)\\(.+?\\)))*$", + "minLength": 1 + } + ] + }, + "resources": { + "$ref": "#/definitions/pipeline/common/ContainerResource" + }, + "runAsUser": { + "oneOf": [ + { + "type": "integer", + "format": "int32" + }, + { + "type": "string" + } + ] + }, + "preExecution": { + "type": "string" + }, + "description": { + "desc": "This is the description for GoogleCloudRunPrepareRollbackDataStepInfo" + } + } + }, + "GoogleCloudRunDeployStepNode": { + "title": "GoogleCloudRunDeployStepNode", + "type": "object", + "required": [ + "identifier", + "name", + "type" + ], + "properties": { + "description": { + "type": "string", + "desc": "This is the description for GoogleCloudRunDeployStepNode" + }, + "enforce": { + "$ref": "#/definitions/pipeline/common/PolicyConfig" + }, + "failureStrategies": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/pipeline/common/FailureStrategyConfig" + } + }, + { + "type": "string", + "pattern": "^<\\+input>$", + "minLength": 1 + } + ] + }, + "identifier": { + "type": "string", + "pattern": "^[a-zA-Z_][0-9a-zA-Z_]{0,127}$" + }, + "name": { + "type": "string", + "pattern": "^[a-zA-Z_0-9-.][-0-9a-zA-Z_\\s.]{0,127}$" + }, + "strategy": { + "oneOf": [ + { + "$ref": "#/definitions/pipeline/common/StrategyConfig" + }, + { + "type": "string", + "pattern": "^<\\+input>$", + "minLength": 1 + } + ] + }, + "timeout": { + "type": "string", + "pattern": "^(([1-9])+\\d+[s])|(((([1-9])+\\d*[mhwd])+([\\s]?\\d+[smhwd])*)|(.*<\\+.*>(?!.*\\.executionInput\\(\\)).*)|(^$))$" + }, + "type": { + "type": "string", + "enum": [ + "GoogleCloudRunDeploy" + ] + }, + "when": { + "oneOf": [ + { + "$ref": "#/definitions/pipeline/common/StepWhenCondition" + }, + { + "type": "string", + "pattern": "^<\\+input>$", + "minLength": 1 + } + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "GoogleCloudRunDeploy" } } }, "then": { "properties": { "spec": { - "$ref": "#/definitions/pipeline/steps/cd/AzureContainerAppsRollbackStepInfo" + "$ref": "#/definitions/pipeline/steps/cd/GoogleCloudRunDeployStepInfo" } } } } ] }, - "AzureContainerAppsRollbackStepInfo": { - "title": "AzureContainerAppsRollbackStepInfo", + "GoogleCloudRunDeployStepInfo": { + "title": "GoogleCloudRunDeployStepInfo", "allOf": [ { "$ref": "#/definitions/pipeline/common/StepSpecType" @@ -90231,6 +90748,21 @@ const schema: Record = { } ] }, + "commandOptions": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string", + "pattern": "^<\\+input>((\\.)((executionInput\\(\\))|(allowedValues|selectOneFrom|selectManyFrom|default|regex)\\(.+?\\)))*$", + "minLength": 1 + } + ] + }, "image": { "type": "string" }, @@ -90279,6 +90811,18 @@ const schema: Record = { }, "preExecution": { "type": "string" + }, + "skipTrafficShift": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] } } } @@ -90304,6 +90848,21 @@ const schema: Record = { } ] }, + "commandOptions": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string", + "pattern": "^<\\+input>((\\.)((executionInput\\(\\))|(allowedValues|selectOneFrom|selectManyFrom|default|regex)\\(.+?\\)))*$", + "minLength": 1 + } + ] + }, "image": { "type": "string" }, @@ -90353,13 +90912,25 @@ const schema: Record = { "preExecution": { "type": "string" }, + "skipTrafficShift": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] + }, "description": { - "desc": "This is the description for AzureContainerAppsRollbackStepInfo" + "desc": "This is the description for GoogleCloudRunDeployStepInfo" } } }, - "GoogleCloudRunPrepareRollbackDataStepNode": { - "title": "GoogleCloudRunPrepareRollbackDataStepNode", + "ShiftGoogleAgentRuntimeTrafficStepNode": { + "title": "ShiftGoogleAgentRuntimeTrafficStepNode", "type": "object", "required": [ "identifier", @@ -90369,7 +90940,7 @@ const schema: Record = { "properties": { "description": { "type": "string", - "desc": "This is the description for GoogleCloudRunPrepareRollbackDataStepNode" + "desc": "This is the description for ShiftGoogleAgentRuntimeTrafficStepNode" }, "enforce": { "$ref": "#/definitions/pipeline/common/PolicyConfig" @@ -90416,7 +90987,7 @@ const schema: Record = { "type": { "type": "string", "enum": [ - "GoogleCloudRunPrepareRollbackData" + "ShiftGoogleAgentRuntimeTraffic" ] }, "when": { @@ -90438,22 +91009,22 @@ const schema: Record = { "if": { "properties": { "type": { - "const": "GoogleCloudRunPrepareRollbackData" + "const": "ShiftGoogleAgentRuntimeTraffic" } } }, "then": { "properties": { "spec": { - "$ref": "#/definitions/pipeline/steps/cd/GoogleCloudRunPrepareRollbackDataStepInfo" + "$ref": "#/definitions/pipeline/steps/cd/ShiftGoogleAgentRuntimeTrafficStepInfo" } } } } ] }, - "GoogleCloudRunPrepareRollbackDataStepInfo": { - "title": "GoogleCloudRunPrepareRollbackDataStepInfo", + "ShiftGoogleAgentRuntimeTrafficStepInfo": { + "title": "ShiftGoogleAgentRuntimeTrafficStepInfo", "allOf": [ { "$ref": "#/definitions/pipeline/common/StepSpecType" @@ -90527,6 +91098,27 @@ const schema: Record = { }, "preExecution": { "type": "string" + }, + "target": { + "type": "object", + "properties": { + "revisionId": { + "type": "string" + } + } + }, + "weight": { + "oneOf": [ + { + "type": "integer", + "format": "int32" + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] } } } @@ -90601,13 +91193,34 @@ const schema: Record = { "preExecution": { "type": "string" }, + "target": { + "type": "object", + "properties": { + "revisionId": { + "type": "string" + } + } + }, + "weight": { + "oneOf": [ + { + "type": "integer", + "format": "int32" + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] + }, "description": { - "desc": "This is the description for GoogleCloudRunPrepareRollbackDataStepInfo" + "desc": "This is the description for ShiftGoogleAgentRuntimeTrafficStepInfo" } } }, - "GoogleCloudRunDeployStepNode": { - "title": "GoogleCloudRunDeployStepNode", + "DeployGoogleAgentRuntimeRevisionStepNode": { + "title": "DeployGoogleAgentRuntimeRevisionStepNode", "type": "object", "required": [ "identifier", @@ -90617,7 +91230,7 @@ const schema: Record = { "properties": { "description": { "type": "string", - "desc": "This is the description for GoogleCloudRunDeployStepNode" + "desc": "This is the description for DeployGoogleAgentRuntimeRevisionStepNode" }, "enforce": { "$ref": "#/definitions/pipeline/common/PolicyConfig" @@ -90664,7 +91277,7 @@ const schema: Record = { "type": { "type": "string", "enum": [ - "GoogleCloudRunDeploy" + "DeployGoogleAgentRuntimeRevision" ] }, "when": { @@ -90686,22 +91299,22 @@ const schema: Record = { "if": { "properties": { "type": { - "const": "GoogleCloudRunDeploy" + "const": "DeployGoogleAgentRuntimeRevision" } } }, "then": { "properties": { "spec": { - "$ref": "#/definitions/pipeline/steps/cd/GoogleCloudRunDeployStepInfo" + "$ref": "#/definitions/pipeline/steps/cd/DeployGoogleAgentRuntimeRevisionStepInfo" } } } } ] }, - "GoogleCloudRunDeployStepInfo": { - "title": "GoogleCloudRunDeployStepInfo", + "DeployGoogleAgentRuntimeRevisionStepInfo": { + "title": "DeployGoogleAgentRuntimeRevisionStepInfo", "allOf": [ { "$ref": "#/definitions/pipeline/common/StepSpecType" @@ -90727,21 +91340,6 @@ const schema: Record = { } ] }, - "commandOptions": { - "oneOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "string", - "pattern": "^<\\+input>((\\.)((executionInput\\(\\))|(allowedValues|selectOneFrom|selectManyFrom|default|regex)\\(.+?\\)))*$", - "minLength": 1 - } - ] - }, "image": { "type": "string" }, @@ -90791,7 +91389,7 @@ const schema: Record = { "preExecution": { "type": "string" }, - "skipTrafficShift": { + "waitReady": { "oneOf": [ { "type": "boolean" @@ -90827,21 +91425,6 @@ const schema: Record = { } ] }, - "commandOptions": { - "oneOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "string", - "pattern": "^<\\+input>((\\.)((executionInput\\(\\))|(allowedValues|selectOneFrom|selectManyFrom|default|regex)\\(.+?\\)))*$", - "minLength": 1 - } - ] - }, "image": { "type": "string" }, @@ -90891,7 +91474,7 @@ const schema: Record = { "preExecution": { "type": "string" }, - "skipTrafficShift": { + "waitReady": { "oneOf": [ { "type": "boolean" @@ -90904,12 +91487,12 @@ const schema: Record = { ] }, "description": { - "desc": "This is the description for GoogleCloudRunDeployStepInfo" + "desc": "This is the description for DeployGoogleAgentRuntimeRevisionStepInfo" } } }, - "ShiftGoogleAgentRuntimeTrafficStepNode": { - "title": "ShiftGoogleAgentRuntimeTrafficStepNode", + "RollbackGoogleAgentRuntimeRevisionStepNode": { + "title": "RollbackGoogleAgentRuntimeRevisionStepNode", "type": "object", "required": [ "identifier", @@ -90919,7 +91502,7 @@ const schema: Record = { "properties": { "description": { "type": "string", - "desc": "This is the description for ShiftGoogleAgentRuntimeTrafficStepNode" + "desc": "This is the description for RollbackGoogleAgentRuntimeRevisionStepNode" }, "enforce": { "$ref": "#/definitions/pipeline/common/PolicyConfig" @@ -90966,7 +91549,7 @@ const schema: Record = { "type": { "type": "string", "enum": [ - "ShiftGoogleAgentRuntimeTraffic" + "RollbackGoogleAgentRuntimeRevision" ] }, "when": { @@ -90988,22 +91571,22 @@ const schema: Record = { "if": { "properties": { "type": { - "const": "ShiftGoogleAgentRuntimeTraffic" + "const": "RollbackGoogleAgentRuntimeRevision" } } }, "then": { "properties": { "spec": { - "$ref": "#/definitions/pipeline/steps/cd/ShiftGoogleAgentRuntimeTrafficStepInfo" + "$ref": "#/definitions/pipeline/steps/cd/RollbackGoogleAgentRuntimeRevisionStepInfo" } } } } ] }, - "ShiftGoogleAgentRuntimeTrafficStepInfo": { - "title": "ShiftGoogleAgentRuntimeTrafficStepInfo", + "RollbackGoogleAgentRuntimeRevisionStepInfo": { + "title": "RollbackGoogleAgentRuntimeRevisionStepInfo", "allOf": [ { "$ref": "#/definitions/pipeline/common/StepSpecType" @@ -91077,27 +91660,6 @@ const schema: Record = { }, "preExecution": { "type": "string" - }, - "target": { - "type": "object", - "properties": { - "revisionId": { - "type": "string" - } - } - }, - "weight": { - "oneOf": [ - { - "type": "integer", - "format": "int32" - }, - { - "type": "string", - "pattern": "(<\\+.+>.*)", - "minLength": 1 - } - ] } } } @@ -91172,34 +91734,13 @@ const schema: Record = { "preExecution": { "type": "string" }, - "target": { - "type": "object", - "properties": { - "revisionId": { - "type": "string" - } - } - }, - "weight": { - "oneOf": [ - { - "type": "integer", - "format": "int32" - }, - { - "type": "string", - "pattern": "(<\\+.+>.*)", - "minLength": 1 - } - ] - }, "description": { - "desc": "This is the description for ShiftGoogleAgentRuntimeTrafficStepInfo" + "desc": "This is the description for RollbackGoogleAgentRuntimeRevisionStepInfo" } } }, - "DeployGoogleAgentRuntimeRevisionStepNode": { - "title": "DeployGoogleAgentRuntimeRevisionStepNode", + "DeployAwsAgentCoreRevisionStepNode": { + "title": "DeployAwsAgentCoreRevisionStepNode", "type": "object", "required": [ "identifier", @@ -91209,7 +91750,7 @@ const schema: Record = { "properties": { "description": { "type": "string", - "desc": "This is the description for DeployGoogleAgentRuntimeRevisionStepNode" + "desc": "This is the description for DeployAwsAgentCoreRevisionStepNode" }, "enforce": { "$ref": "#/definitions/pipeline/common/PolicyConfig" @@ -91256,7 +91797,7 @@ const schema: Record = { "type": { "type": "string", "enum": [ - "DeployGoogleAgentRuntimeRevision" + "DeployAwsAgentCoreRevision" ] }, "when": { @@ -91278,22 +91819,22 @@ const schema: Record = { "if": { "properties": { "type": { - "const": "DeployGoogleAgentRuntimeRevision" + "const": "DeployAwsAgentCoreRevision" } } }, "then": { "properties": { "spec": { - "$ref": "#/definitions/pipeline/steps/cd/DeployGoogleAgentRuntimeRevisionStepInfo" + "$ref": "#/definitions/pipeline/steps/cd/DeployAwsAgentCoreRevisionStepInfo" } } } } ] }, - "DeployGoogleAgentRuntimeRevisionStepInfo": { - "title": "DeployGoogleAgentRuntimeRevisionStepInfo", + "DeployAwsAgentCoreRevisionStepInfo": { + "title": "DeployAwsAgentCoreRevisionStepInfo", "allOf": [ { "$ref": "#/definitions/pipeline/common/StepSpecType" @@ -91466,12 +92007,12 @@ const schema: Record = { ] }, "description": { - "desc": "This is the description for DeployGoogleAgentRuntimeRevisionStepInfo" + "desc": "This is the description for DeployAwsAgentCoreRevisionStepInfo" } } }, - "RollbackGoogleAgentRuntimeRevisionStepNode": { - "title": "RollbackGoogleAgentRuntimeRevisionStepNode", + "ShiftAwsAgentCoreTrafficStepNode": { + "title": "ShiftAwsAgentCoreTrafficStepNode", "type": "object", "required": [ "identifier", @@ -91481,7 +92022,7 @@ const schema: Record = { "properties": { "description": { "type": "string", - "desc": "This is the description for RollbackGoogleAgentRuntimeRevisionStepNode" + "desc": "This is the description for ShiftAwsAgentCoreTrafficStepNode" }, "enforce": { "$ref": "#/definitions/pipeline/common/PolicyConfig" @@ -91528,7 +92069,7 @@ const schema: Record = { "type": { "type": "string", "enum": [ - "RollbackGoogleAgentRuntimeRevision" + "ShiftAwsAgentCoreTraffic" ] }, "when": { @@ -91550,22 +92091,22 @@ const schema: Record = { "if": { "properties": { "type": { - "const": "RollbackGoogleAgentRuntimeRevision" + "const": "ShiftAwsAgentCoreTraffic" } } }, "then": { "properties": { "spec": { - "$ref": "#/definitions/pipeline/steps/cd/RollbackGoogleAgentRuntimeRevisionStepInfo" + "$ref": "#/definitions/pipeline/steps/cd/ShiftAwsAgentCoreTrafficStepInfo" } } } } ] }, - "RollbackGoogleAgentRuntimeRevisionStepInfo": { - "title": "RollbackGoogleAgentRuntimeRevisionStepInfo", + "ShiftAwsAgentCoreTrafficStepInfo": { + "title": "ShiftAwsAgentCoreTrafficStepInfo", "allOf": [ { "$ref": "#/definitions/pipeline/common/StepSpecType" @@ -91639,6 +92180,27 @@ const schema: Record = { }, "preExecution": { "type": "string" + }, + "target": { + "type": "object", + "properties": { + "revisionId": { + "type": "string" + } + } + }, + "weight": { + "oneOf": [ + { + "type": "integer", + "format": "int32" + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] } } } @@ -91713,13 +92275,34 @@ const schema: Record = { "preExecution": { "type": "string" }, + "target": { + "type": "object", + "properties": { + "revisionId": { + "type": "string" + } + } + }, + "weight": { + "oneOf": [ + { + "type": "integer", + "format": "int32" + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] + }, "description": { - "desc": "This is the description for RollbackGoogleAgentRuntimeRevisionStepInfo" + "desc": "This is the description for ShiftAwsAgentCoreTrafficStepInfo" } } }, - "DeployAwsAgentCoreRevisionStepNode": { - "title": "DeployAwsAgentCoreRevisionStepNode", + "RollbackAwsAgentCoreRevisionStepNode": { + "title": "RollbackAwsAgentCoreRevisionStepNode", "type": "object", "required": [ "identifier", @@ -91729,7 +92312,7 @@ const schema: Record = { "properties": { "description": { "type": "string", - "desc": "This is the description for DeployAwsAgentCoreRevisionStepNode" + "desc": "This is the description for RollbackAwsAgentCoreRevisionStepNode" }, "enforce": { "$ref": "#/definitions/pipeline/common/PolicyConfig" @@ -91776,7 +92359,7 @@ const schema: Record = { "type": { "type": "string", "enum": [ - "DeployAwsAgentCoreRevision" + "RollbackAwsAgentCoreRevision" ] }, "when": { @@ -91798,22 +92381,22 @@ const schema: Record = { "if": { "properties": { "type": { - "const": "DeployAwsAgentCoreRevision" + "const": "RollbackAwsAgentCoreRevision" } } }, "then": { "properties": { "spec": { - "$ref": "#/definitions/pipeline/steps/cd/DeployAwsAgentCoreRevisionStepInfo" + "$ref": "#/definitions/pipeline/steps/cd/RollbackAwsAgentCoreRevisionStepInfo" } } } } ] }, - "DeployAwsAgentCoreRevisionStepInfo": { - "title": "DeployAwsAgentCoreRevisionStepInfo", + "RollbackAwsAgentCoreRevisionStepInfo": { + "title": "RollbackAwsAgentCoreRevisionStepInfo", "allOf": [ { "$ref": "#/definitions/pipeline/common/StepSpecType" @@ -91887,18 +92470,6 @@ const schema: Record = { }, "preExecution": { "type": "string" - }, - "waitReady": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "string", - "pattern": "(<\\+.+>.*)", - "minLength": 1 - } - ] } } } @@ -91973,20 +92544,8 @@ const schema: Record = { "preExecution": { "type": "string" }, - "waitReady": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "string", - "pattern": "(<\\+.+>.*)", - "minLength": 1 - } - ] - }, "description": { - "desc": "This is the description for DeployAwsAgentCoreRevisionStepInfo" + "desc": "This is the description for RollbackAwsAgentCoreRevisionStepInfo" } } }, @@ -106005,7 +106564,8 @@ const schema: Record = { "GoogleCloudRun", "AzureContainerApps", "Salesforce", - "GoogleManagedInstanceGroup" + "GoogleManagedInstanceGroup", + "AiAgent" ] }, "environment": { @@ -107271,6 +107831,12 @@ const schema: Record = { { "$ref": "#/definitions/pipeline/steps/cd/DeployAwsAgentCoreRevisionStepNode" }, + { + "$ref": "#/definitions/pipeline/steps/cd/ShiftAwsAgentCoreTrafficStepNode" + }, + { + "$ref": "#/definitions/pipeline/steps/cd/RollbackAwsAgentCoreRevisionStepNode" + }, { "$ref": "#/definitions/pipeline/steps/cd/GoogleCloudRunTrafficShiftStepNode" }, @@ -110515,7 +111081,8 @@ const schema: Record = { "GoogleCloudRun", "AzureContainerApps", "Salesforce", - "GoogleManagedInstanceGroup" + "GoogleManagedInstanceGroup", + "AiAgent" ] }, "description": { @@ -110827,6 +111394,22 @@ const schema: Record = { } } } + }, + { + "if": { + "properties": { + "type": { + "const": "AiAgent" + } + } + }, + "then": { + "properties": { + "spec": { + "$ref": "#/definitions/pipeline/stages/cd/AiAgentServiceSpec" + } + } + } } ] }, @@ -115134,6 +115717,217 @@ const schema: Record = { } } }, + "AiAgentServiceSpec": { + "title": "AiAgentServiceSpec", + "type": "object", + "required": [ + "platform" + ], + "properties": { + "configVariables": { + "type": "array", + "items": { + "$ref": "#/definitions/pipeline/common/NGVariable" + } + }, + "platform": { + "$ref": "#/definitions/pipeline/stages/cd/AiAgentPlatform" + }, + "variables": { + "type": "array", + "items": { + "$ref": "#/definitions/pipeline/common/NGVariable" + } + }, + "description": { + "desc": "This is the description for AiAgentServiceSpec" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "AiAgentPlatform": { + "title": "AiAgentPlatform", + "type": "object", + "required": [ + "type", + "spec" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "AwsAgentCore", + "GoogleAgentRuntime" + ] + }, + "description": { + "desc": "This is the description for AiAgentPlatform" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "AwsAgentCore" + } + } + }, + "then": { + "properties": { + "spec": { + "$ref": "#/definitions/pipeline/stages/cd/AwsAgentCorePlatformSpec" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "GoogleAgentRuntime" + } + } + }, + "then": { + "properties": { + "spec": { + "$ref": "#/definitions/pipeline/stages/cd/GoogleAgentRuntimePlatformSpec" + } + } + } + } + ] + }, + "AwsAgentCorePlatformSpec": { + "title": "AwsAgentCorePlatformSpec", + "type": "object", + "required": [ + "source", + "executionRoleArn" + ], + "properties": { + "source": { + "$ref": "#/definitions/pipeline/stages/cd/AwsCoreAgentSource" + }, + "executionRoleArn": { + "type": "string" + }, + "description": { + "desc": "This is the description for AwsAgentCorePlatformSpec" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "AwsCoreAgentSource": { + "title": "AwsCoreAgentSource", + "type": "object", + "required": [ + "type", + "spec" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "container" + ] + }, + "description": { + "desc": "This is the description for AwsCoreAgentSource" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "container" + } + } + }, + "then": { + "properties": { + "spec": { + "$ref": "#/definitions/pipeline/stages/cd/ContainerAgentSource" + } + } + } + } + ] + }, + "ContainerAgentSource": { + "title": "ContainerAgentSource", + "type": "object", + "required": [ + "image" + ], + "properties": { + "image": { + "type": "string" + }, + "description": { + "desc": "This is the description for ContainerAgentSource" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "GoogleAgentRuntimePlatformSpec": { + "title": "GoogleAgentRuntimePlatformSpec", + "type": "object", + "required": [ + "source" + ], + "properties": { + "source": { + "$ref": "#/definitions/pipeline/stages/cd/GoogleAgentSource" + }, + "description": { + "desc": "This is the description for GoogleAgentRuntimePlatformSpec" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "GoogleAgentSource": { + "title": "GoogleAgentSource", + "type": "object", + "required": [ + "type", + "spec" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "container" + ] + }, + "description": { + "desc": "This is the description for GoogleAgentSource" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "container" + } + } + }, + "then": { + "properties": { + "spec": { + "$ref": "#/definitions/pipeline/stages/cd/ContainerAgentSource" + } + } + } + } + ] + }, "StageOverridesConfig": { "title": "StageOverridesConfig", "type": "object", @@ -119324,6 +120118,12 @@ const schema: Record = { { "$ref": "#/definitions/pipeline/steps/cd/DeployAwsAgentCoreRevisionStepNode" }, + { + "$ref": "#/definitions/pipeline/steps/cd/ShiftAwsAgentCoreTrafficStepNode" + }, + { + "$ref": "#/definitions/pipeline/steps/cd/RollbackAwsAgentCoreRevisionStepNode" + }, { "$ref": "#/definitions/pipeline/steps/cd/GoogleCloudRunTrafficShiftStepNode" }, diff --git a/src/data/schemas/v0/template.ts b/src/data/schemas/v0/template.ts index 353f383fc..733b2b5e1 100644 --- a/src/data/schemas/v0/template.ts +++ b/src/data/schemas/v0/template.ts @@ -986,6 +986,12 @@ const schema: Record = { { "$ref": "#/definitions/pipeline/steps/cd/DeployAwsAgentCoreRevisionStepNode_template" }, + { + "$ref": "#/definitions/pipeline/steps/cd/ShiftAwsAgentCoreTrafficStepNode_template" + }, + { + "$ref": "#/definitions/pipeline/steps/cd/RollbackAwsAgentCoreRevisionStepNode_template" + }, { "$ref": "#/definitions/pipeline/steps/cd/GoogleCloudRunTrafficShiftStepNode_template" }, @@ -31324,8 +31330,15 @@ const schema: Record = { "type": "string" }, "name": { - "type": "string", - "pattern": "^[a-zA-Z_][0-9a-zA-Z_\\.\\[\\]$-]{0,127}$" + "oneOf": [ + { + "type": "string", + "pattern": "^[a-zA-Z_][0-9a-zA-Z_\\.\\[\\]$-]{0,127}$" + }, + { + "pattern": "(<\\+.+>.*)" + } + ] }, "type": { "type": "string", @@ -31363,8 +31376,15 @@ const schema: Record = { "format": "double" }, "name": { - "type": "string", - "pattern": "^[a-zA-Z_][0-9a-zA-Z_\\.\\[\\]$-]{0,127}$" + "oneOf": [ + { + "type": "string", + "pattern": "^[a-zA-Z_][0-9a-zA-Z_\\.\\[\\]$-]{0,127}$" + }, + { + "pattern": "(<\\+.+>.*)" + } + ] }, "type": { "type": "string", @@ -31414,8 +31434,15 @@ const schema: Record = { "type": "string" }, "name": { - "type": "string", - "pattern": "^[a-zA-Z_][0-9a-zA-Z_\\.\\[\\]$-]{0,127}$" + "oneOf": [ + { + "type": "string", + "pattern": "^[a-zA-Z_][0-9a-zA-Z_\\.\\[\\]$-]{0,127}$" + }, + { + "pattern": "(<\\+.+>.*)" + } + ] }, "type": { "type": "string", @@ -36083,12 +36110,546 @@ const schema: Record = { "type": "string" }, "description": { - "desc": "This is the description for RollbackGoogleAgentRuntimeRevisionStepInfo" + "desc": "This is the description for RollbackGoogleAgentRuntimeRevisionStepInfo" + } + } + }, + "DeployAwsAgentCoreRevisionStepNode_template": { + "title": "DeployAwsAgentCoreRevisionStepNode_template", + "type": "object", + "required": [ + "type" + ], + "properties": { + "enforce": { + "$ref": "#/definitions/pipeline/common/PolicyConfig" + }, + "failureStrategies": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/pipeline/common/FailureStrategyConfig" + } + }, + { + "type": "string", + "pattern": "^<\\+input>$", + "minLength": 1 + } + ] + }, + "strategy": { + "oneOf": [ + { + "$ref": "#/definitions/pipeline/common/StrategyConfig" + }, + { + "type": "string", + "pattern": "^<\\+input>$", + "minLength": 1 + } + ] + }, + "timeout": { + "type": "string", + "pattern": "^(([1-9])+\\d+[s])|(((([1-9])+\\d*[mhwd])+([\\s]?\\d+[smhwd])*)|(.*<\\+.*>(?!.*\\.executionInput\\(\\)).*)|(^$))$" + }, + "type": { + "type": "string", + "enum": [ + "DeployAwsAgentCoreRevision" + ] + }, + "when": { + "oneOf": [ + { + "$ref": "#/definitions/pipeline/common/StepWhenCondition" + }, + { + "type": "string", + "pattern": "^<\\+input>$", + "minLength": 1 + } + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "DeployAwsAgentCoreRevision" + } + } + }, + "then": { + "properties": { + "spec": { + "$ref": "#/definitions/pipeline/steps/cd/DeployAwsAgentCoreRevisionStepInfo" + } + } + } + } + ] + }, + "DeployAwsAgentCoreRevisionStepInfo": { + "title": "DeployAwsAgentCoreRevisionStepInfo", + "allOf": [ + { + "$ref": "#/definitions/pipeline/common/StepSpecType" + }, + { + "type": "object", + "properties": { + "connectorRef": { + "type": "string" + }, + "delegateSelectors": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] + }, + "image": { + "type": "string" + }, + "imagePullPolicy": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Always", + "Never", + "IfNotPresent" + ] + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] + }, + "privileged": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "^<\\+input>((\\.)((executionInput\\(\\))|(allowedValues|selectOneFrom|selectManyFrom|default|regex)\\(.+?\\)))*$", + "minLength": 1 + } + ] + }, + "resources": { + "$ref": "#/definitions/pipeline/common/ContainerResource" + }, + "runAsUser": { + "oneOf": [ + { + "type": "integer", + "format": "int32" + }, + { + "type": "string" + } + ] + }, + "preExecution": { + "type": "string" + }, + "waitReady": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] + } + } + } + ], + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "connectorRef": { + "type": "string" + }, + "delegateSelectors": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] + }, + "image": { + "type": "string" + }, + "imagePullPolicy": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Always", + "Never", + "IfNotPresent" + ] + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] + }, + "privileged": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "^<\\+input>((\\.)((executionInput\\(\\))|(allowedValues|selectOneFrom|selectManyFrom|default|regex)\\(.+?\\)))*$", + "minLength": 1 + } + ] + }, + "resources": { + "$ref": "#/definitions/pipeline/common/ContainerResource" + }, + "runAsUser": { + "oneOf": [ + { + "type": "integer", + "format": "int32" + }, + { + "type": "string" + } + ] + }, + "preExecution": { + "type": "string" + }, + "waitReady": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] + }, + "description": { + "desc": "This is the description for DeployAwsAgentCoreRevisionStepInfo" + } + } + }, + "ShiftAwsAgentCoreTrafficStepNode_template": { + "title": "ShiftAwsAgentCoreTrafficStepNode_template", + "type": "object", + "required": [ + "type" + ], + "properties": { + "enforce": { + "$ref": "#/definitions/pipeline/common/PolicyConfig" + }, + "failureStrategies": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/pipeline/common/FailureStrategyConfig" + } + }, + { + "type": "string", + "pattern": "^<\\+input>$", + "minLength": 1 + } + ] + }, + "strategy": { + "oneOf": [ + { + "$ref": "#/definitions/pipeline/common/StrategyConfig" + }, + { + "type": "string", + "pattern": "^<\\+input>$", + "minLength": 1 + } + ] + }, + "timeout": { + "type": "string", + "pattern": "^(([1-9])+\\d+[s])|(((([1-9])+\\d*[mhwd])+([\\s]?\\d+[smhwd])*)|(.*<\\+.*>(?!.*\\.executionInput\\(\\)).*)|(^$))$" + }, + "type": { + "type": "string", + "enum": [ + "ShiftAwsAgentCoreTraffic" + ] + }, + "when": { + "oneOf": [ + { + "$ref": "#/definitions/pipeline/common/StepWhenCondition" + }, + { + "type": "string", + "pattern": "^<\\+input>$", + "minLength": 1 + } + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "ShiftAwsAgentCoreTraffic" + } + } + }, + "then": { + "properties": { + "spec": { + "$ref": "#/definitions/pipeline/steps/cd/ShiftAwsAgentCoreTrafficStepInfo" + } + } + } + } + ] + }, + "ShiftAwsAgentCoreTrafficStepInfo": { + "title": "ShiftAwsAgentCoreTrafficStepInfo", + "allOf": [ + { + "$ref": "#/definitions/pipeline/common/StepSpecType" + }, + { + "type": "object", + "properties": { + "connectorRef": { + "type": "string" + }, + "delegateSelectors": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] + }, + "image": { + "type": "string" + }, + "imagePullPolicy": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Always", + "Never", + "IfNotPresent" + ] + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] + }, + "privileged": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "^<\\+input>((\\.)((executionInput\\(\\))|(allowedValues|selectOneFrom|selectManyFrom|default|regex)\\(.+?\\)))*$", + "minLength": 1 + } + ] + }, + "resources": { + "$ref": "#/definitions/pipeline/common/ContainerResource" + }, + "runAsUser": { + "oneOf": [ + { + "type": "integer", + "format": "int32" + }, + { + "type": "string" + } + ] + }, + "preExecution": { + "type": "string" + }, + "target": { + "type": "object", + "properties": { + "revisionId": { + "type": "string" + } + } + }, + "weight": { + "oneOf": [ + { + "type": "integer", + "format": "int32" + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] + } + } + } + ], + "$schema": "http://json-schema.org/draft-07/schema#", + "type": "object", + "properties": { + "connectorRef": { + "type": "string" + }, + "delegateSelectors": { + "oneOf": [ + { + "type": "array", + "items": { + "type": "string" + } + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] + }, + "image": { + "type": "string" + }, + "imagePullPolicy": { + "oneOf": [ + { + "type": "string", + "enum": [ + "Always", + "Never", + "IfNotPresent" + ] + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] + }, + "privileged": { + "oneOf": [ + { + "type": "boolean" + }, + { + "type": "string", + "pattern": "^<\\+input>((\\.)((executionInput\\(\\))|(allowedValues|selectOneFrom|selectManyFrom|default|regex)\\(.+?\\)))*$", + "minLength": 1 + } + ] + }, + "resources": { + "$ref": "#/definitions/pipeline/common/ContainerResource" + }, + "runAsUser": { + "oneOf": [ + { + "type": "integer", + "format": "int32" + }, + { + "type": "string" + } + ] + }, + "preExecution": { + "type": "string" + }, + "target": { + "type": "object", + "properties": { + "revisionId": { + "type": "string" + } + } + }, + "weight": { + "oneOf": [ + { + "type": "integer", + "format": "int32" + }, + { + "type": "string", + "pattern": "(<\\+.+>.*)", + "minLength": 1 + } + ] + }, + "description": { + "desc": "This is the description for ShiftAwsAgentCoreTrafficStepInfo" } } }, - "DeployAwsAgentCoreRevisionStepNode_template": { - "title": "DeployAwsAgentCoreRevisionStepNode_template", + "RollbackAwsAgentCoreRevisionStepNode_template": { + "title": "RollbackAwsAgentCoreRevisionStepNode_template", "type": "object", "required": [ "type" @@ -36131,7 +36692,7 @@ const schema: Record = { "type": { "type": "string", "enum": [ - "DeployAwsAgentCoreRevision" + "RollbackAwsAgentCoreRevision" ] }, "when": { @@ -36153,22 +36714,22 @@ const schema: Record = { "if": { "properties": { "type": { - "const": "DeployAwsAgentCoreRevision" + "const": "RollbackAwsAgentCoreRevision" } } }, "then": { "properties": { "spec": { - "$ref": "#/definitions/pipeline/steps/cd/DeployAwsAgentCoreRevisionStepInfo" + "$ref": "#/definitions/pipeline/steps/cd/RollbackAwsAgentCoreRevisionStepInfo" } } } } ] }, - "DeployAwsAgentCoreRevisionStepInfo": { - "title": "DeployAwsAgentCoreRevisionStepInfo", + "RollbackAwsAgentCoreRevisionStepInfo": { + "title": "RollbackAwsAgentCoreRevisionStepInfo", "allOf": [ { "$ref": "#/definitions/pipeline/common/StepSpecType" @@ -36242,18 +36803,6 @@ const schema: Record = { }, "preExecution": { "type": "string" - }, - "waitReady": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "string", - "pattern": "(<\\+.+>.*)", - "minLength": 1 - } - ] } } } @@ -36328,20 +36877,8 @@ const schema: Record = { "preExecution": { "type": "string" }, - "waitReady": { - "oneOf": [ - { - "type": "boolean" - }, - { - "type": "string", - "pattern": "(<\\+.+>.*)", - "minLength": 1 - } - ] - }, "description": { - "desc": "This is the description for DeployAwsAgentCoreRevisionStepInfo" + "desc": "This is the description for RollbackAwsAgentCoreRevisionStepInfo" } } }, @@ -55558,22 +56095,210 @@ const schema: Record = { "if": { "properties": { "type": { - "const": "GoogleCloudRunPrepareRollbackData" + "const": "GoogleCloudRunPrepareRollbackData" + } + } + }, + "then": { + "properties": { + "spec": { + "$ref": "#/definitions/pipeline/steps/cd/GoogleCloudRunPrepareRollbackDataStepInfo" + } + } + } + } + ] + }, + "GoogleCloudRunDeployStepNode": { + "title": "GoogleCloudRunDeployStepNode", + "type": "object", + "required": [ + "identifier", + "name", + "type" + ], + "properties": { + "description": { + "type": "string", + "desc": "This is the description for GoogleCloudRunDeployStepNode" + }, + "enforce": { + "$ref": "#/definitions/pipeline/common/PolicyConfig" + }, + "failureStrategies": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/pipeline/common/FailureStrategyConfig" + } + }, + { + "type": "string", + "pattern": "^<\\+input>$", + "minLength": 1 + } + ] + }, + "identifier": { + "type": "string", + "pattern": "^[a-zA-Z_][0-9a-zA-Z_]{0,127}$" + }, + "name": { + "type": "string", + "pattern": "^[a-zA-Z_0-9-.][-0-9a-zA-Z_\\s.]{0,127}$" + }, + "strategy": { + "oneOf": [ + { + "$ref": "#/definitions/pipeline/common/StrategyConfig" + }, + { + "type": "string", + "pattern": "^<\\+input>$", + "minLength": 1 + } + ] + }, + "timeout": { + "type": "string", + "pattern": "^(([1-9])+\\d+[s])|(((([1-9])+\\d*[mhwd])+([\\s]?\\d+[smhwd])*)|(.*<\\+.*>(?!.*\\.executionInput\\(\\)).*)|(^$))$" + }, + "type": { + "type": "string", + "enum": [ + "GoogleCloudRunDeploy" + ] + }, + "when": { + "oneOf": [ + { + "$ref": "#/definitions/pipeline/common/StepWhenCondition" + }, + { + "type": "string", + "pattern": "^<\\+input>$", + "minLength": 1 + } + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "GoogleCloudRunDeploy" + } + } + }, + "then": { + "properties": { + "spec": { + "$ref": "#/definitions/pipeline/steps/cd/GoogleCloudRunDeployStepInfo" + } + } + } + } + ] + }, + "ShiftGoogleAgentRuntimeTrafficStepNode": { + "title": "ShiftGoogleAgentRuntimeTrafficStepNode", + "type": "object", + "required": [ + "identifier", + "name", + "type" + ], + "properties": { + "description": { + "type": "string", + "desc": "This is the description for ShiftGoogleAgentRuntimeTrafficStepNode" + }, + "enforce": { + "$ref": "#/definitions/pipeline/common/PolicyConfig" + }, + "failureStrategies": { + "oneOf": [ + { + "type": "array", + "items": { + "$ref": "#/definitions/pipeline/common/FailureStrategyConfig" + } + }, + { + "type": "string", + "pattern": "^<\\+input>$", + "minLength": 1 + } + ] + }, + "identifier": { + "type": "string", + "pattern": "^[a-zA-Z_][0-9a-zA-Z_]{0,127}$" + }, + "name": { + "type": "string", + "pattern": "^[a-zA-Z_0-9-.][-0-9a-zA-Z_\\s.]{0,127}$" + }, + "strategy": { + "oneOf": [ + { + "$ref": "#/definitions/pipeline/common/StrategyConfig" + }, + { + "type": "string", + "pattern": "^<\\+input>$", + "minLength": 1 + } + ] + }, + "timeout": { + "type": "string", + "pattern": "^(([1-9])+\\d+[s])|(((([1-9])+\\d*[mhwd])+([\\s]?\\d+[smhwd])*)|(.*<\\+.*>(?!.*\\.executionInput\\(\\)).*)|(^$))$" + }, + "type": { + "type": "string", + "enum": [ + "ShiftGoogleAgentRuntimeTraffic" + ] + }, + "when": { + "oneOf": [ + { + "$ref": "#/definitions/pipeline/common/StepWhenCondition" + }, + { + "type": "string", + "pattern": "^<\\+input>$", + "minLength": 1 + } + ] + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "ShiftGoogleAgentRuntimeTraffic" } } }, "then": { "properties": { "spec": { - "$ref": "#/definitions/pipeline/steps/cd/GoogleCloudRunPrepareRollbackDataStepInfo" + "$ref": "#/definitions/pipeline/steps/cd/ShiftGoogleAgentRuntimeTrafficStepInfo" } } } } ] }, - "GoogleCloudRunDeployStepNode": { - "title": "GoogleCloudRunDeployStepNode", + "DeployGoogleAgentRuntimeRevisionStepNode": { + "title": "DeployGoogleAgentRuntimeRevisionStepNode", "type": "object", "required": [ "identifier", @@ -55583,7 +56308,7 @@ const schema: Record = { "properties": { "description": { "type": "string", - "desc": "This is the description for GoogleCloudRunDeployStepNode" + "desc": "This is the description for DeployGoogleAgentRuntimeRevisionStepNode" }, "enforce": { "$ref": "#/definitions/pipeline/common/PolicyConfig" @@ -55630,7 +56355,7 @@ const schema: Record = { "type": { "type": "string", "enum": [ - "GoogleCloudRunDeploy" + "DeployGoogleAgentRuntimeRevision" ] }, "when": { @@ -55652,22 +56377,22 @@ const schema: Record = { "if": { "properties": { "type": { - "const": "GoogleCloudRunDeploy" + "const": "DeployGoogleAgentRuntimeRevision" } } }, "then": { "properties": { "spec": { - "$ref": "#/definitions/pipeline/steps/cd/GoogleCloudRunDeployStepInfo" + "$ref": "#/definitions/pipeline/steps/cd/DeployGoogleAgentRuntimeRevisionStepInfo" } } } } ] }, - "ShiftGoogleAgentRuntimeTrafficStepNode": { - "title": "ShiftGoogleAgentRuntimeTrafficStepNode", + "RollbackGoogleAgentRuntimeRevisionStepNode": { + "title": "RollbackGoogleAgentRuntimeRevisionStepNode", "type": "object", "required": [ "identifier", @@ -55677,7 +56402,7 @@ const schema: Record = { "properties": { "description": { "type": "string", - "desc": "This is the description for ShiftGoogleAgentRuntimeTrafficStepNode" + "desc": "This is the description for RollbackGoogleAgentRuntimeRevisionStepNode" }, "enforce": { "$ref": "#/definitions/pipeline/common/PolicyConfig" @@ -55724,7 +56449,7 @@ const schema: Record = { "type": { "type": "string", "enum": [ - "ShiftGoogleAgentRuntimeTraffic" + "RollbackGoogleAgentRuntimeRevision" ] }, "when": { @@ -55746,22 +56471,22 @@ const schema: Record = { "if": { "properties": { "type": { - "const": "ShiftGoogleAgentRuntimeTraffic" + "const": "RollbackGoogleAgentRuntimeRevision" } } }, "then": { "properties": { "spec": { - "$ref": "#/definitions/pipeline/steps/cd/ShiftGoogleAgentRuntimeTrafficStepInfo" + "$ref": "#/definitions/pipeline/steps/cd/RollbackGoogleAgentRuntimeRevisionStepInfo" } } } } ] }, - "DeployGoogleAgentRuntimeRevisionStepNode": { - "title": "DeployGoogleAgentRuntimeRevisionStepNode", + "DeployAwsAgentCoreRevisionStepNode": { + "title": "DeployAwsAgentCoreRevisionStepNode", "type": "object", "required": [ "identifier", @@ -55771,7 +56496,7 @@ const schema: Record = { "properties": { "description": { "type": "string", - "desc": "This is the description for DeployGoogleAgentRuntimeRevisionStepNode" + "desc": "This is the description for DeployAwsAgentCoreRevisionStepNode" }, "enforce": { "$ref": "#/definitions/pipeline/common/PolicyConfig" @@ -55818,7 +56543,7 @@ const schema: Record = { "type": { "type": "string", "enum": [ - "DeployGoogleAgentRuntimeRevision" + "DeployAwsAgentCoreRevision" ] }, "when": { @@ -55840,22 +56565,22 @@ const schema: Record = { "if": { "properties": { "type": { - "const": "DeployGoogleAgentRuntimeRevision" + "const": "DeployAwsAgentCoreRevision" } } }, "then": { "properties": { "spec": { - "$ref": "#/definitions/pipeline/steps/cd/DeployGoogleAgentRuntimeRevisionStepInfo" + "$ref": "#/definitions/pipeline/steps/cd/DeployAwsAgentCoreRevisionStepInfo" } } } } ] }, - "RollbackGoogleAgentRuntimeRevisionStepNode": { - "title": "RollbackGoogleAgentRuntimeRevisionStepNode", + "ShiftAwsAgentCoreTrafficStepNode": { + "title": "ShiftAwsAgentCoreTrafficStepNode", "type": "object", "required": [ "identifier", @@ -55865,7 +56590,7 @@ const schema: Record = { "properties": { "description": { "type": "string", - "desc": "This is the description for RollbackGoogleAgentRuntimeRevisionStepNode" + "desc": "This is the description for ShiftAwsAgentCoreTrafficStepNode" }, "enforce": { "$ref": "#/definitions/pipeline/common/PolicyConfig" @@ -55912,7 +56637,7 @@ const schema: Record = { "type": { "type": "string", "enum": [ - "RollbackGoogleAgentRuntimeRevision" + "ShiftAwsAgentCoreTraffic" ] }, "when": { @@ -55934,22 +56659,22 @@ const schema: Record = { "if": { "properties": { "type": { - "const": "RollbackGoogleAgentRuntimeRevision" + "const": "ShiftAwsAgentCoreTraffic" } } }, "then": { "properties": { "spec": { - "$ref": "#/definitions/pipeline/steps/cd/RollbackGoogleAgentRuntimeRevisionStepInfo" + "$ref": "#/definitions/pipeline/steps/cd/ShiftAwsAgentCoreTrafficStepInfo" } } } } ] }, - "DeployAwsAgentCoreRevisionStepNode": { - "title": "DeployAwsAgentCoreRevisionStepNode", + "RollbackAwsAgentCoreRevisionStepNode": { + "title": "RollbackAwsAgentCoreRevisionStepNode", "type": "object", "required": [ "identifier", @@ -55959,7 +56684,7 @@ const schema: Record = { "properties": { "description": { "type": "string", - "desc": "This is the description for DeployAwsAgentCoreRevisionStepNode" + "desc": "This is the description for RollbackAwsAgentCoreRevisionStepNode" }, "enforce": { "$ref": "#/definitions/pipeline/common/PolicyConfig" @@ -56006,7 +56731,7 @@ const schema: Record = { "type": { "type": "string", "enum": [ - "DeployAwsAgentCoreRevision" + "RollbackAwsAgentCoreRevision" ] }, "when": { @@ -56028,14 +56753,14 @@ const schema: Record = { "if": { "properties": { "type": { - "const": "DeployAwsAgentCoreRevision" + "const": "RollbackAwsAgentCoreRevision" } } }, "then": { "properties": { "spec": { - "$ref": "#/definitions/pipeline/steps/cd/DeployAwsAgentCoreRevisionStepInfo" + "$ref": "#/definitions/pipeline/steps/cd/RollbackAwsAgentCoreRevisionStepInfo" } } } @@ -132644,21 +133369,10 @@ const schema: Record = { "type": "object", "description": "Definition of a single named identity that produces an independent OIDC ID_TOKEN.\nThe identity name (the map key under identities) doubles as the environment variable\nthe step receives at runtime.\n", "properties": { - "audiences": { - "description": "Audiences (aud) the minted ID_TOKEN is issued for.", - "oneOf": [ - { - "type": "array", - "items": { - "type": "string" - } - }, - { - "type": "string", - "pattern": "^<\\+input>((\\.)((executionInput\\(\\))|(allowedValues|selectOneFrom|selectManyFrom|default|regex)\\(.+?\\)))*$", - "minLength": 1 - } - ] + "audience": { + "description": "Audience (aud) the minted ID_TOKEN is issued for.", + "type": "string", + "minLength": 1 }, "subjectTemplate": { "description": "Template for the sub claim. Supports literals and allowlisted Harness expressions\n(e.g. <+account.identifier>, <+pipeline.identifier>, <+step.identifier>).\n", @@ -133608,7 +134322,8 @@ const schema: Record = { "GoogleCloudRun", "AzureContainerApps", "Salesforce", - "GoogleManagedInstanceGroup" + "GoogleManagedInstanceGroup", + "AiAgent" ] }, "environment": { @@ -134874,6 +135589,12 @@ const schema: Record = { { "$ref": "#/definitions/pipeline/steps/cd/DeployAwsAgentCoreRevisionStepNode" }, + { + "$ref": "#/definitions/pipeline/steps/cd/ShiftAwsAgentCoreTrafficStepNode" + }, + { + "$ref": "#/definitions/pipeline/steps/cd/RollbackAwsAgentCoreRevisionStepNode" + }, { "$ref": "#/definitions/pipeline/steps/cd/GoogleCloudRunTrafficShiftStepNode" }, @@ -137834,7 +138555,8 @@ const schema: Record = { "GoogleCloudRun", "AzureContainerApps", "Salesforce", - "GoogleManagedInstanceGroup" + "GoogleManagedInstanceGroup", + "AiAgent" ] }, "description": { @@ -138146,6 +138868,22 @@ const schema: Record = { } } } + }, + { + "if": { + "properties": { + "type": { + "const": "AiAgent" + } + } + }, + "then": { + "properties": { + "spec": { + "$ref": "#/definitions/pipeline/stages/cd/AiAgentServiceSpec" + } + } + } } ] }, @@ -142453,6 +143191,217 @@ const schema: Record = { } } }, + "AiAgentServiceSpec": { + "title": "AiAgentServiceSpec", + "type": "object", + "required": [ + "platform" + ], + "properties": { + "configVariables": { + "type": "array", + "items": { + "$ref": "#/definitions/pipeline/common/NGVariable" + } + }, + "platform": { + "$ref": "#/definitions/pipeline/stages/cd/AiAgentPlatform" + }, + "variables": { + "type": "array", + "items": { + "$ref": "#/definitions/pipeline/common/NGVariable" + } + }, + "description": { + "desc": "This is the description for AiAgentServiceSpec" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "AiAgentPlatform": { + "title": "AiAgentPlatform", + "type": "object", + "required": [ + "type", + "spec" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "AwsAgentCore", + "GoogleAgentRuntime" + ] + }, + "description": { + "desc": "This is the description for AiAgentPlatform" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "AwsAgentCore" + } + } + }, + "then": { + "properties": { + "spec": { + "$ref": "#/definitions/pipeline/stages/cd/AwsAgentCorePlatformSpec" + } + } + } + }, + { + "if": { + "properties": { + "type": { + "const": "GoogleAgentRuntime" + } + } + }, + "then": { + "properties": { + "spec": { + "$ref": "#/definitions/pipeline/stages/cd/GoogleAgentRuntimePlatformSpec" + } + } + } + } + ] + }, + "AwsAgentCorePlatformSpec": { + "title": "AwsAgentCorePlatformSpec", + "type": "object", + "required": [ + "source", + "executionRoleArn" + ], + "properties": { + "source": { + "$ref": "#/definitions/pipeline/stages/cd/AwsCoreAgentSource" + }, + "executionRoleArn": { + "type": "string" + }, + "description": { + "desc": "This is the description for AwsAgentCorePlatformSpec" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "AwsCoreAgentSource": { + "title": "AwsCoreAgentSource", + "type": "object", + "required": [ + "type", + "spec" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "container" + ] + }, + "description": { + "desc": "This is the description for AwsCoreAgentSource" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "container" + } + } + }, + "then": { + "properties": { + "spec": { + "$ref": "#/definitions/pipeline/stages/cd/ContainerAgentSource" + } + } + } + } + ] + }, + "ContainerAgentSource": { + "title": "ContainerAgentSource", + "type": "object", + "required": [ + "image" + ], + "properties": { + "image": { + "type": "string" + }, + "description": { + "desc": "This is the description for ContainerAgentSource" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "GoogleAgentRuntimePlatformSpec": { + "title": "GoogleAgentRuntimePlatformSpec", + "type": "object", + "required": [ + "source" + ], + "properties": { + "source": { + "$ref": "#/definitions/pipeline/stages/cd/GoogleAgentSource" + }, + "description": { + "desc": "This is the description for GoogleAgentRuntimePlatformSpec" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#" + }, + "GoogleAgentSource": { + "title": "GoogleAgentSource", + "type": "object", + "required": [ + "type", + "spec" + ], + "properties": { + "type": { + "type": "string", + "enum": [ + "container" + ] + }, + "description": { + "desc": "This is the description for GoogleAgentSource" + } + }, + "$schema": "http://json-schema.org/draft-07/schema#", + "allOf": [ + { + "if": { + "properties": { + "type": { + "const": "container" + } + } + }, + "then": { + "properties": { + "spec": { + "$ref": "#/definitions/pipeline/stages/cd/ContainerAgentSource" + } + } + } + } + ] + }, "StageOverridesConfig": { "title": "StageOverridesConfig", "type": "object", @@ -146992,6 +147941,12 @@ const schema: Record = { { "$ref": "#/definitions/pipeline/steps/cd/DeployAwsAgentCoreRevisionStepNode" }, + { + "$ref": "#/definitions/pipeline/steps/cd/ShiftAwsAgentCoreTrafficStepNode" + }, + { + "$ref": "#/definitions/pipeline/steps/cd/RollbackAwsAgentCoreRevisionStepNode" + }, { "$ref": "#/definitions/pipeline/steps/cd/GoogleCloudRunTrafficShiftStepNode" }, From 2d33af7eeccc9f54d753edd43b23b77cb727edd8 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 9 Jul 2026 00:46:37 +0000 Subject: [PATCH 2/2] test: strengthen coding-standards guardrails MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add shared constants.ts for the 11 consolidated MCP tool names - Add AGENTS.md consistency checks (tools, Zod v4, standards:check) - Add security checks (secret metadata, no value leakage, rate limiter) - Move scorecardStatsExtract to shared extractors.ts per standards §3 - Refactor architecture/docs tests to use shared constants Standards suite: 80 -> 88 tests; all pass with pnpm test (2486). Co-authored-by: Rohan Gupta --- src/registry/extractors.ts | 13 +++ src/registry/toolsets/idp.ts | 11 +-- .../agents-consistency.test.ts | 34 +++++++ tests/coding-standards/architecture.test.ts | 32 +------ tests/coding-standards/constants.ts | 35 +++++++ .../coding-standards/docs-consistency.test.ts | 18 +--- tests/coding-standards/security.test.ts | 94 +++++++++++++++++++ 7 files changed, 185 insertions(+), 52 deletions(-) create mode 100644 tests/coding-standards/agents-consistency.test.ts create mode 100644 tests/coding-standards/constants.ts create mode 100644 tests/coding-standards/security.test.ts diff --git a/src/registry/extractors.ts b/src/registry/extractors.ts index 3e3d736e9..284788190 100644 --- a/src/registry/extractors.ts +++ b/src/registry/extractors.ts @@ -780,6 +780,19 @@ export const fmeListExtract = (raw: unknown): unknown => { return raw; }; +/** + * IDP scorecard/check stats — normalizes timestamp to RFC3339 `time` for agent consumption. + * API: `{ name?, stats?, timestamp? }` + */ +export const scorecardStatsExtract = (raw: unknown): unknown => { + const r = raw as { name?: string; stats?: unknown[]; timestamp?: number | null }; + return { + name: r.name, + stats: r.stats ?? [], + time: r.timestamp != null ? new Date(r.timestamp).toISOString() : "", + }; +}; + /** Extract FME feature flag single item — passthrough with trafficType.id flattened. */ export const fmeGetExtract = (raw: unknown): unknown => { if (raw && typeof raw === "object") { diff --git a/src/registry/toolsets/idp.ts b/src/registry/toolsets/idp.ts index 9b1bfbaff..151fa1429 100644 --- a/src/registry/toolsets/idp.ts +++ b/src/registry/toolsets/idp.ts @@ -1,5 +1,5 @@ import type { PathBuilderConfig, ToolsetDefinition } from "../types.js"; -import { ngExtract, passthrough, v1ListExtract } from "../extractors.js"; +import { ngExtract, passthrough, scorecardStatsExtract, v1ListExtract } from "../extractors.js"; import { parse as parseYaml } from "yaml"; const CONFIG_API_KEY = "__config_api_key"; @@ -38,15 +38,6 @@ const extractAuthParamRefs = (yamlStr: string): { apikeyRefs: string[]; apiKeySe return { apikeyRefs, apiKeySecretRefs }; }; -const scorecardStatsExtract = (raw: unknown): unknown => { - const r = raw as { name?: string; stats?: unknown[]; timestamp?: number | null }; - return { - name: r.name, - stats: r.stats ?? [], - time: r.timestamp != null ? new Date(r.timestamp).toISOString() : "", - }; -}; - export const idpToolset: ToolsetDefinition = { name: "idp", displayName: "Internal Developer Portal", diff --git a/tests/coding-standards/agents-consistency.test.ts b/tests/coding-standards/agents-consistency.test.ts new file mode 100644 index 000000000..73ca7b7c6 --- /dev/null +++ b/tests/coding-standards/agents-consistency.test.ts @@ -0,0 +1,34 @@ +/** + * Keep AGENTS.md aligned with docs/coding-standards.md and enforced architecture constants. + */ +import { describe, it, expect } from "vitest"; +import { readFileSync } from "node:fs"; +import { join } from "node:path"; +import { ALLOWED_MCP_TOOLS } from "./constants.js"; + +const REPO_ROOT = join(import.meta.dirname, "../.."); +const AGENTS_PATH = join(REPO_ROOT, "AGENTS.md"); + +describe("Coding standards — AGENTS.md consistency", () => { + const content = readFileSync(AGENTS_PATH, "utf8"); + + it("AGENTS.md documents 11 consolidated MCP tools including harness_schema", () => { + expect(content).toMatch(/11 consolidated tools/); + for (const tool of ALLOWED_MCP_TOOLS) { + expect(content, `missing ${tool} in AGENTS.md`).toContain(tool); + } + }); + + it("AGENTS.md references Zod v4 (not v3)", () => { + expect(content).toMatch(/Zod v4/); + expect(content).not.toMatch(/Zod v3/); + }); + + it("AGENTS.md documents pnpm standards:check guardrails", () => { + expect(content).toContain("pnpm standards:check"); + }); + + it("AGENTS.md forbids console.log on stdout", () => { + expect(content).toMatch(/Use `console\.log\(\)` — stdout is the JSON-RPC transport/); + }); +}); diff --git a/tests/coding-standards/architecture.test.ts b/tests/coding-standards/architecture.test.ts index bce24d226..b70fa8c47 100644 --- a/tests/coding-standards/architecture.test.ts +++ b/tests/coding-standards/architecture.test.ts @@ -13,38 +13,16 @@ import { join, relative } from "node:path"; import { ALL_TOOLSET_NAMES } from "../../src/registry/index.js"; import type { ToolsetName } from "../../src/registry/types.js"; +import { ALLOWED_MCP_TOOLS_SET, ALLOWED_REGISTER_TOOL_FILES } from "./constants.js"; + const REPO_ROOT = join(import.meta.dirname, "../.."); const SRC = join(REPO_ROOT, "src"); /** The only MCP tools allowed in the server. */ -const ALLOWED_MCP_TOOLS = new Set([ - "harness_list", - "harness_get", - "harness_create", - "harness_update", - "harness_delete", - "harness_execute", - "harness_diagnose", - "harness_search", - "harness_describe", - "harness_status", - "harness_schema", -]); +const ALLOWED_MCP_TOOLS = ALLOWED_MCP_TOOLS_SET; /** Only these files may call server.registerTool(). */ -const ALLOWED_REGISTER_TOOL_FILES = new Set([ - "src/tools/harness-list.ts", - "src/tools/harness-get.ts", - "src/tools/harness-create.ts", - "src/tools/harness-update.ts", - "src/tools/harness-delete.ts", - "src/tools/harness-execute.ts", - "src/tools/harness-diagnose.ts", - "src/tools/harness-search.ts", - "src/tools/harness-describe.ts", - "src/tools/harness-status.ts", - "src/tools/harness-schema.ts", -]); +const ALLOWED_REGISTER_TOOL_FILES_SET = new Set(ALLOWED_REGISTER_TOOL_FILES); /** Only these harness-*.ts handler files may exist under src/tools/. */ const ALLOWED_HARNESS_HANDLER_FILES = new Set([ @@ -210,7 +188,7 @@ describe("Coding standards — MCP tool handlers", () => { if (!content.includes("registerTool")) continue; const fileRel = rel(file); - if (!ALLOWED_REGISTER_TOOL_FILES.has(fileRel)) { + if (!ALLOWED_REGISTER_TOOL_FILES_SET.has(fileRel)) { const tools = extractRegisterToolNames(content); violations.push(`${fileRel} calls registerTool for: ${tools.join(", ") || "(dynamic)"}`); } diff --git a/tests/coding-standards/constants.ts b/tests/coding-standards/constants.ts new file mode 100644 index 000000000..d163c4cbf --- /dev/null +++ b/tests/coding-standards/constants.ts @@ -0,0 +1,35 @@ +/** + * Single source of truth for architecture guardrail constants. + * Keep in sync with docs/coding-standards.md and AGENTS.md. + */ +export const ALLOWED_MCP_TOOLS = [ + "harness_list", + "harness_get", + "harness_create", + "harness_update", + "harness_delete", + "harness_execute", + "harness_diagnose", + "harness_search", + "harness_describe", + "harness_status", + "harness_schema", +] as const; + +export type AllowedMcpTool = (typeof ALLOWED_MCP_TOOLS)[number]; + +export const ALLOWED_MCP_TOOLS_SET = new Set(ALLOWED_MCP_TOOLS); + +export const ALLOWED_REGISTER_TOOL_FILES = [ + "src/tools/harness-list.ts", + "src/tools/harness-get.ts", + "src/tools/harness-create.ts", + "src/tools/harness-update.ts", + "src/tools/harness-delete.ts", + "src/tools/harness-execute.ts", + "src/tools/harness-diagnose.ts", + "src/tools/harness-search.ts", + "src/tools/harness-describe.ts", + "src/tools/harness-status.ts", + "src/tools/harness-schema.ts", +] as const; diff --git a/tests/coding-standards/docs-consistency.test.ts b/tests/coding-standards/docs-consistency.test.ts index 0989e711e..b1db397ff 100644 --- a/tests/coding-standards/docs-consistency.test.ts +++ b/tests/coding-standards/docs-consistency.test.ts @@ -6,29 +6,17 @@ import { describe, it, expect } from "vitest"; import { readFileSync } from "node:fs"; import { join } from "node:path"; +import { ALLOWED_MCP_TOOLS } from "./constants.js"; + const REPO_ROOT = join(import.meta.dirname, "../.."); const STANDARDS_PATH = join(REPO_ROOT, "docs/coding-standards.md"); -const REQUIRED_TOOLS = [ - "harness_list", - "harness_get", - "harness_create", - "harness_update", - "harness_delete", - "harness_execute", - "harness_diagnose", - "harness_search", - "harness_describe", - "harness_status", - "harness_schema", -]; - describe("Coding standards — documentation consistency", () => { const content = readFileSync(STANDARDS_PATH, "utf8"); it("docs/coding-standards.md documents 11 consolidated MCP tools including harness_schema", () => { expect(content).toMatch(/11 consolidated tool handlers/); - for (const tool of REQUIRED_TOOLS) { + for (const tool of ALLOWED_MCP_TOOLS) { expect(content, `missing ${tool} in docs/coding-standards.md`).toContain(tool); } }); diff --git a/tests/coding-standards/security.test.ts b/tests/coding-standards/security.test.ts new file mode 100644 index 000000000..2d83c4a82 --- /dev/null +++ b/tests/coding-standards/security.test.ts @@ -0,0 +1,94 @@ +/** + * Safety and security rules from docs/coding-standards.md §9. + */ +import { describe, it, expect } from "vitest"; +import { readFileSync, readdirSync, statSync } from "node:fs"; +import { join, relative } from "node:path"; +import { Registry } from "../../src/registry/index.js"; +import { idpToolset } from "../../src/registry/toolsets/idp.js"; + +const REPO_ROOT = join(import.meta.dirname, "../.."); +const SRC = join(REPO_ROOT, "src"); +const TOOLSET_DIR = join(SRC, "registry/toolsets"); + +const MINIMAL_CONFIG = { + HARNESS_API_KEY: "pat.testaccount.testtoken.testsecret", + HARNESS_BASE_URL: "https://app.harness.io", +} as const; + +/** Patterns that must not appear in toolset response shaping (secret value leakage). */ +const FORBIDDEN_SECRET_LEAK_PATTERNS: Array<{ pattern: RegExp; reason: string }> = [ + { pattern: /\bsecretValue\b/, reason: "secretValue field must not be mapped in toolsets" }, + { pattern: /\bencryptedSecret\b/, reason: "encryptedSecret must not be mapped in toolsets" }, + { pattern: /\bdecryptedValue\b/, reason: "decryptedValue must not be mapped in toolsets" }, +]; + +function rel(path: string): string { + return relative(REPO_ROOT, path).replace(/\\/g, "/"); +} + +function walkTsFiles(dir: string): string[] { + const results: string[] = []; + for (const entry of readdirSync(dir)) { + const full = join(dir, entry); + const stat = statSync(full); + if (stat.isDirectory()) { + results.push(...walkTsFiles(full)); + } else if (entry.endsWith(".ts")) { + results.push(full); + } + } + return results; +} + +describe("Coding standards — security", () => { + it("secret resource descriptions state values are never exposed", () => { + const registry = new Registry(MINIMAL_CONFIG); + const secret = registry.getResource("secret"); + expect(secret.description.toLowerCase()).toMatch(/never/); + expect(secret.operations.get?.description.toLowerCase()).toMatch(/never/); + expect(secret.operations.list?.description.toLowerCase()).toMatch(/never/); + }); + + it("toolset files do not map secret value fields in response extractors", () => { + const violations: string[] = []; + + for (const file of walkTsFiles(TOOLSET_DIR)) { + const content = readFileSync(file, "utf8"); + for (const { pattern, reason } of FORBIDDEN_SECRET_LEAK_PATTERNS) { + if (pattern.test(content)) { + violations.push(`${rel(file)}: ${reason}`); + } + } + } + + expect(violations, violations.join("\n")).toEqual([]); + }); + + it("idp workflow execute bodyBuilder does not echo api_key_secret in the API request body", () => { + const workflow = idpToolset.resources.find((r) => r.resourceType === "idp_workflow"); + const execute = workflow?.executeActions?.execute; + expect(execute?.bodyBuilder).toBeDefined(); + + const body = execute!.bodyBuilder!({ + body: { + identifier: "wf-1", + workflow_details: { + identifier: "wf-1", + yaml: "spec:\n steps: []\n", + }, + api_key_secret: "should-not-leak", + values: { foo: "bar" }, + }, + }); + + expect(body).toEqual({ identifier: "wf-1", values: { foo: "bar" } }); + expect(body).not.toHaveProperty("api_key_secret"); + }); + + it("HarnessClient enforces client-side rate limiting via RateLimiter", () => { + const content = readFileSync(join(SRC, "client/harness-client.ts"), "utf8"); + expect(content).toContain("RateLimiter"); + expect(content).toContain("rateLimiter.acquire()"); + }); +});