@@ -206,30 +206,30 @@ private static function record_applied_artifact( array $artifact, int $agent_id,
206206 return new \WP_Error ( 'datamachine_bundle_agent_missing ' , sprintf ( 'Agent ID %d was not found. ' , $ agent_id ) );
207207 }
208208
209- $ config = is_array ( $ agent ['agent_config ' ] ?? null ) ? $ agent ['agent_config ' ] : array ();
210- $ bundle = is_array ( $ context ['bundle ' ] ?? null ) ? $ context ['bundle ' ] : array ();
211- $ bundle_slug = (string ) ( $ bundle ['bundle_slug ' ] ?? $ config ['datamachine_bundle ' ]['bundle_slug ' ] ?? '' );
212- $ version = (string ) ( $ bundle ['bundle_version ' ] ?? $ config ['datamachine_bundle ' ]['bundle_version ' ] ?? '' );
209+ $ config = is_array ( $ agent ['agent_config ' ] ?? null ) ? $ agent ['agent_config ' ] : array ();
210+ $ bundle = is_array ( $ context ['bundle ' ] ?? null ) ? $ context ['bundle ' ] : array ();
211+ $ bundle_slug = (string ) ( $ bundle ['bundle_slug ' ] ?? $ config ['datamachine_bundle ' ]['bundle_slug ' ] ?? '' );
212+ $ version = (string ) ( $ bundle ['bundle_version ' ] ?? $ config ['datamachine_bundle ' ]['bundle_version ' ] ?? '' );
213213 $ template_slug = (string ) ( $ bundle ['template_slug ' ] ?? $ config ['datamachine_bundle ' ]['template_slug ' ] ?? $ bundle_slug );
214214 $ template_version = (string ) ( $ bundle ['template_version ' ] ?? $ config ['datamachine_bundle ' ]['template_version ' ] ?? $ version );
215215 $ source_ref = (string ) ( $ bundle ['source_ref ' ] ?? $ config ['datamachine_bundle ' ]['source_ref ' ] ?? '' );
216216 $ source_revision = (string ) ( $ bundle ['source_revision ' ] ?? $ config ['datamachine_bundle ' ]['source_revision ' ] ?? '' );
217- $ type = (string ) ( $ artifact ['artifact_type ' ] ?? '' );
218- $ id = (string ) ( $ artifact ['artifact_id ' ] ?? '' );
219- $ payload = $ artifact ['payload ' ] ?? null ;
220- $ hash = AgentBundleArtifactHasher::hash ( $ payload );
221- $ now = gmdate ( 'c ' );
217+ $ type = (string ) ( $ artifact ['artifact_type ' ] ?? '' );
218+ $ id = (string ) ( $ artifact ['artifact_id ' ] ?? '' );
219+ $ payload = $ artifact ['payload ' ] ?? null ;
220+ $ hash = AgentBundleArtifactHasher::hash ( $ payload );
221+ $ now = gmdate ( 'c ' );
222222
223223 if ( '' === $ bundle_slug || '' === $ type || '' === $ id ) {
224224 return new \WP_Error ( 'datamachine_bundle_registry_incomplete ' , 'Bundle artifact registry metadata is incomplete. ' );
225225 }
226226
227- $ config ['datamachine_bundle ' ]['bundle_slug ' ] = $ bundle_slug ;
228- $ config ['datamachine_bundle ' ]['bundle_version ' ] = $ version ;
227+ $ config ['datamachine_bundle ' ]['bundle_slug ' ] = $ bundle_slug ;
228+ $ config ['datamachine_bundle ' ]['bundle_version ' ] = $ version ;
229229 $ config ['datamachine_bundle ' ]['template_slug ' ] = $ template_slug ;
230230 $ config ['datamachine_bundle ' ]['template_version ' ] = $ template_version ;
231- $ config ['datamachine_bundle ' ]['source_ref ' ] = $ source_ref ;
232- $ config ['datamachine_bundle ' ]['source_revision ' ] = $ source_revision ;
231+ $ config ['datamachine_bundle ' ]['source_ref ' ] = $ source_ref ;
232+ $ config ['datamachine_bundle ' ]['source_revision ' ] = $ source_revision ;
233233 $ config ['datamachine_bundle ' ]['artifacts ' ][ AgentBundleArtifactExtensions::artifact_key ( $ type , $ id ) ] = array (
234234 'bundle_slug ' => $ bundle_slug ,
235235 'bundle_version ' => $ version ,
0 commit comments