okf/attested-computation
An Attested Computation has a runtime, well-formed parameters, executor, and attester, and a computation (a computation path or a code block under # Computation) (OKF §10).
An Attested Computation carries a sanctioned way to compute a value, so a consumer can confirm an agent ran it rather than improvising its own (§10). Its contract is in the frontmatter (§10.2): runtime (required: it defines what parameters mean), the parameters an agent may fill ({ name, type, required }), an executor that runs the computation and returns a receipt, and an attester that checks the receipt. The computation itself is a code block under # Computation, or a file named by computation.
Example
Section titled “Example”This file breaks the rule:
---type: Attested Computationtitle: Revenue for a fiscal yeardescription: Recognized revenue for a fiscal year, per Finance's definition.parameters: - { name: year, type: integer, required: true }executor: resource: /references/run-on-bigquery.md receipt: [job_id, executed_sql, result]attester: resource: /references/sql_equality.py---
# Computation
```sqlSELECT SUM(amount) AS revenue FROM finance.recognized_revenue WHERE fiscal_year = @year```okforest validate reports:
revenue.md 2:1 error An Attested Computation needs `runtime`, e.g. `runtime: bigquery`. okf/attested-computationFixed:
---type: Attested Computationtitle: Revenue for a fiscal yeardescription: Recognized revenue for a fiscal year, per Finance's definition.runtime: bigqueryparameters: - { name: year, type: integer, required: true }executor: resource: /references/run-on-bigquery.md receipt: [job_id, executed_sql, result]attester: resource: /references/sql_equality.py---
# Computation
```sqlSELECT SUM(amount) AS revenue FROM finance.recognized_revenue WHERE fiscal_year = @year```