I'd like to do something like git-annex-addurl, except the URL is not a web address but a domain-specific identifier. Specifically, on the DNAnexus platform, each file is assigned an immutable ID like file-asdf432fdsa. I want to configure git-annex so that it knows it can fetch the file using a specific command (not curl but 'dx download file-asdf432fdsa'); and so that it completely trusts that the file can always be fetched this way. What would be the right combination of configurations/settings to make this work? I was thinking of some combination of WORM backend configured just for DNAnexus files and a special remote, but not sure (this "special remote" would only support copying files from it, not to it; so it's more like "special web"). Thanks for any suggestions!
What you're looking for is the external special remote protocol. When you build your own special remote using that protocol, it can use SETSTATE and GETSTATE to store and retrieve the immutable IDs.
It should not be hard to write your own special remote. See this page.
The Datalad project has a bunch of special remotes doing things like this BTW.
annex-speculate-present is a boolean setting, I see that the docs didn't make that clear and have improved them.
I don't see any value in speculating that urls are present in some specific remote; there's already sufficient support for remotes to register and claim urls.
See CLAIMURL in the external special remote protocol. The ipfs special remote is an example of a a remote that uses CLAIMURL to add support for a new type of url to git-annex. https://git-annex.branchable.com/special_remotes/external/git-annex-remote-ipfs
If I run 'git-annex addurl dx://file-xxxxx', won't git-annex just try calling curl to fetch the URL, instead of querying special remotes? I guess I can add my own curl wrapper to the front of PATH, but that feels somewhat hacky.
No, as I mentioned upthread, git-annex supports external special remotes claiming urls.