Glad to hear about your usecase, we would be glad to help you build with our solution. To answer your questions
We need “run only if the cap still allows.”, right now."
This would be an on-chain check. In addition to our checks (expiration, cooldown, number of runs), we will allow for custom logic like this. So all you’ll have to do is add a single line of your check on the DAML template.
Since you mentioned “run it right now” only, you’ll not need our cron running service. All you need would be to implement our interfaces in your contracts, and it’ll be enough.
When a check stops a run, nothing commits, so the ledger holds no record that the control fired.
Does yours leave anything behind, or is it a log line?
Proposal: A ledger record for refused actions (RFP 27, Security Monitoring, Auditability and Evidence) by dominicrume · Pull Request #860 · canton-foundation/canton-dev-fund · GitHub There is a proposal targetting this very issue. There’s also a discussion here How do you prove your app didn't do something? - #5 by orumedominic which could be useful.
We plan to store the logs for all runs offchain since the aborted/failed actions aren’t natively stored on-chain, and since there’s no standard pattern out there to commit them on-chain, it didn’t make sense to implement it within this proposal.
We can commit when a check fails, but then there can be a case when checks pass but something else fails/reverts later on in the transaction, and that will not be committed and cause inconsistencies for what goes onchain, if we use chain as the source of truth.
Thank you for the questions, I’ll reach out after our development phase completes after the proposal acceptance.