I'm not so sure calculating GDP by production would capture this. It should, mind you, as all GDP calculations should get the same answer, but a silly/stupid example of two LLMs digging and filling in a hole may not fit in a production calculation.
> the production approach estimates the total value of economic output and deducts the cost of intermediate goods that are consumed in the process (like those of materials and services)[1]
This is a very rough definition of it, but role with it. There is no economic value since the hole was dug only to be filled back in. There was a service paid for on each end of the project, but those are services that could fall into the category of intermediate goods consumed that is actually deducted. The transaction could actually have a negative GDP when using the production calculation approach.
[1] the production approach estimates the total value of economic output and deducts the cost of intermediate goods that are consumed in the process (like those of materials and services)
In both income and expenditure-based GDP calculations income or consumption by households are part of the calculation (which means the calculations will not give the same result).
You can make an argument that if the hypothetical workers are salaried they're not technically paid for any given task, while I'd argue that there was an opportunity cost (they could have done other work than digging/filling it in), so there's some subjectivity to it.
My stance is that if it was done as part of paid work, they were paid to carry out the task as there's at least in aggregate if not per every one individual event an opportunity cost in having them do that work instead of something else, and so part of their consumption was paid for by the labour for those tasks, and hence they affect GDP.
That the output does not add value for the procurer of that labour does not nullify the expenditure on that labour. Whether you're calculating GDP on income or expenditure, those add to GDP either as income for the workers or an expenditure for the employer.