Skip to content

okf/attested-computation

errorOKF specification

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.

This file breaks the rule:

revenue.md
---
type: Attested Computation
title: Revenue for a fiscal year
description: 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
```sql
SELECT 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-computation

Fixed:

revenue.md
---
type: Attested Computation
title: Revenue for a fiscal year
description: Recognized revenue for a fiscal year, per Finance's definition.
runtime: bigquery
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
```sql
SELECT SUM(amount) AS revenue FROM finance.recognized_revenue WHERE fiscal_year = @year
```