Where “path/to/artifact” is the path name of the artifact in the storage directory.
The files in the hidden attributes directory are JSON files, and the attribute name where this information is stored is “storageItem-created”. The format of the field is a long, the value is a standard unix timestamp.
So you could write a script that reads these JSON files, parses out “storageItem-created”.
Then just delete what is not needed anymore, and follow the steps here to run some post delete tasks: