Facts¶
A fact is a statement someone may need to know to use the data correctly. Write it so the agent that
uses the data knows what to do differently, not only what is true. All facts of a project are one list, in one place:
oryxkb/facts.yaml. A fact says what it is about with about (a dataset, a column, an output, rows, a source), so a
rule about one column sits with the other facts, not inside the column or the dataset.
An agent writes the list from your documents and code; a person reviews it. The page below is written for both: what to decide and check, and the exact shape the agent writes.
Four fields say what a fact is and how it is read:
kindsays what sort of statement it is: a definition, rule, quirk, recipe, decision, finding or open question.aboutsays what it is about. Noaboutmeans the whole project.impactsays how much it matters:critical,importantoruseful.as_ofis the date it was written, found or decided, when that date is known.
as_of here is not dates_asof. A fact's as_of is the date a statement was written or decided. The
as-of date of a source says which vendor release the data reflects.
Where facts live¶
The folder layout is on the spec overview. Facts live only in oryxkb/facts.yaml, or in
oryxkb/facts/*.yaml (several files by topic, merged in file-name order). Having both is an error. A folder with only
facts and no project.yaml is a valid project: its name defaults to the folder name. A facts, do_not
or use_cases key anywhere in project.yaml or in a split dataset file is an error whose message points to
facts.yaml. The facts file is a mapping with one key, facts:, a list. It has no version line: the project
file carries the format version. oryxkb check with no path checks the whole oryxkb/ folder: project, split files
and facts.
Which kind?¶
Ask in this order and stop at the first yes. About one fact in six is a judgement call; this order settles it, and the card shows every fact under its kind heading, so a borderline choice costs little.
| # | Ask | Kind |
|---|---|---|
| 1 | Is there no answer and no proposal yet? | question (with options) |
| 2 | Did someone make a choice between options, including "known issue, leave it" or "defer the fix"? | decision (options and revisit are optional) |
| 3 | Did this project compute it, as a result about its own data? | finding |
| 4 | Does it say how a value, score or name is defined or computed (a method, a composition, a suffix vocabulary)? | definition |
| 5 | Is it how to do a named task? | recipe (with when) |
| 6 | Is there a reason or an oddity in the data behind it (a break, a gap, a vendor habit, a trap)? | quirk, with the consequence in the statement |
| 7 | Otherwise: is it an instruction with nothing odd behind it? | rule |
A proposed answer is not a question: write it as the rule or quirk, status: proposed. A house choice with no oddity
in the data behind it (a basis, a convention) is a rule.
A statement with a reason or an oddity behind it is a quirk: "market_id codes have leading zeros, such as 04567; read it
as text or they are lost" is a quirk. A rule is an instruction, such as "do not call this score a rating" or "state the
quarter and the as-of date next to every rent figure". If the sentence needs a "because" about the data, it is a quirk.
A decision is settled: "earlier office quarters are not restated for flex space; the fix is deferred" is a decision,
and so is a known issue nobody will fix now. It says what was chosen, options lists the alternatives rejected, and
revisit says what would reopen it. A rule says what to do with the data; a decision records that a choice was made,
so a reader does not file the same issue again. Alternatives rejected for a rule or definition go in its detail under
a "Rejected:" heading, with see pointing at the document.
Example¶
facts:
- kind: definition
id: rent-growth-definition
statement: rent_growth is the change in asking rent against the previous quarter, as a decimal
about:
- Rents#rent_growth
- kind: quirk
id: market-id-text
statement: market_id codes have leading zeros, such as 04567; read it as text or they are lost
about:
- Rents#market_id
impact: critical
as_of: 2026-10-31
- kind: rule
statement: do not fill missing rent with zero
about:
- Rents#rent
as_of: 2026-10-31
probe: probes/rent-has-no-zero.py
- kind: quirk
id: office-incl-flex
statement: "office includes flex space in the 2026Q2 release and later: compare office within one side of 2026Q2 only"
detail: |
Vendor A widened its office definition in the 2026Q2 release and did not restate earlier quarters.
Flex space is about 4% of office rows from 2026Q2.
Rejected: restating earlier quarters ourselves; the vendor does not publish the flex split.
about:
- Rents#sector
impact: important
period: 2026Q2 onward
as_of: 2026-10-31
status: reviewed
reviewed_by: data-team
see:
- docs/data-notes.md#flex-space
- kind: recipe
when: comparing markets
statement: use rent_growth within one sector; never across sectors, whose lease lengths differ
about:
- Rents#rent_growth
- Rents#sector
as_of: 2026-10-31
- kind: quirk
statement: Seniors Housing rows start in 2014; its growth rates are not comparable with earlier sectors
about:
- Rents?sector=Seniors Housing
impact: important
- kind: finding
statement: asking rent runs above the vendor's published average in most markets
detail: |
38 of 55 markets, comparing 2026Q3 asking rent with the vendor's published average.
about:
- Rents
period: 2026Q3
as_of: 2026-11-05
see:
- analysis/rent-vs-published.ipynb
- kind: question
statement: how to treat 2020-2021 is undecided
about:
- Rents
impact: important
options:
- exclude 2020-2021
- keep all quarters
- kind: decision
id: flex-restatement-deferred
statement: earlier office quarters are not restated for flex space; the fix is deferred
about:
- Rents#sector
as_of: 2026-11-05
options:
- restate earlier quarters ourselves
revisit: vendor A publishes the flex split
- kind: quirk
statement: the 2026Q3 file was re-sent on 2026-11-02; earlier quarters are unchanged
about:
- source:vendor_a
audience: consumers
impact: useful
as_of: 2026-11-02
expires: 2027-01-31
- kind: quirk
statement: vendor A's client setting decides which quarter the file covers
about:
- source:vendor_a
see:
- cfg:vendors.vendor_a.client
The smallest valid fact of each kind:
| Kind | Needs | Smallest form |
|---|---|---|
definition |
statement |
kind: definition, statement: rent_growth is ... as a decimal, about: [Rents#rent_growth] |
rule |
statement |
kind: rule, statement: do not fill missing rent with zero, about: [Rents#rent] |
quirk |
statement, with the consequence |
kind: quirk, statement: market_id has leading zeros; read it as text, about: [Rents#market_id] |
recipe |
statement, when |
kind: recipe, when: comparing markets, statement: use rent_growth within one sector |
decision |
statement; options (alternatives rejected) and revisit when known |
kind: decision, statement: earlier office quarters are not restated; the fix is deferred, revisit: vendor A publishes the flex split |
finding |
statement (name the data in about) |
kind: finding, statement: asking rent runs above the published average, about: [Rents] |
question |
statement, options when there are choices |
kind: question, statement: how to treat 2020-2021 is undecided, options: [...] |
An id is optional: give one when a memo or a decision points at the fact. A fact without an id has no
citation id. The as_of lines are left out where nobody knows the date: never invent one.
The definition has no impact, so it is useful; the probe makes the rule show as checked on the card.
Style. Write about and see as block lists, as above: a one-line flow list is fine for plain ids
(about: [Rents#rent]), but an id with ?, a space or : needs quoting there. oryxkb's writers quote such ids and
emit block style; check reads both styles. Entries an agent writes without oryxkb avoid {...} flow maps: it is a convention
for readability, and check accepts flow style without a warning. Text in statement, detail or period that
contains : is quoted too (declare writes block scalars for longer text).
Fields explained¶
kind. Adefinitionsays how a value, score or name is defined or computed. Aruleis advice on what to do or never do. Aquirkis something odd in the data. Arecipeis how to do a task with this data; itswhennames the task. Afindingis a result this project computed about its own data. Adecisionis settled: a choice made between options, including "known issue, leave it" or "defer the fix";optionslists the alternatives rejected andrevisitis the condition that reopens it. Aquestionis open: there is no house answer and no proposal yet, andoptionslists the choices; a question with nooptionsis a known unknown (a cause not found). Afindingshould change what an agent does; other results belong in analysis documents, linked withsee. See Which kind? and Wording rules.statementanddetail. The statement is one line, and the card shows it. Put the full rule, lists and numbers indetail(markdown): a person or agent reads it on request withoryxkb facts <id> --full, and the card marks a fact that has one with(+detail).about. A list of ids; see About ids. Leave it out for a fact about the whole project, such as a convention for every answer (a memo basis).impact. How much it matters to an answer; see Impact and trust. The default depends on the kind:rule,quirk,recipeanddecisiondefault toimportant;definition,findingandquestiontouseful.as_ofandperiod.as_ofis when the fact was written, found or decided. It is optional and never invented: when it is absent, a tool shows the date the fact's line entered git.periodis the data period a statement describes, as free text (2026Q2, LTM); the card shows it. Use it for findings and quirks tied to one release.audience.consumersormaintainers; see Who sees a fact.see. Where the explanation is. Forms:docs/x.md#slug(the slug as the site renderer makes it),file.py:Name,git:<sha>:<path>for history, a ticket or URL, a hub id such ash-3f9a2c, or another fact's id (a retired question points at the rule that answers it). Config keys are writtencfg:<key>(for examplecfg:vendors.vendor_a.client).checkwarns about a file path that does not exist in the project, and for a local markdown file also verifies the anchor (the slug as GitHub makes it); other forms are not checked, and an entry with no path separator and no file extension is not treated as a path.status,reviewed_by,expires,probe. How sure we are the fact is true and still current; see Impact and trust.status: proposedis the default; writing it is optional. Who must confirm a proposed fact goes indetail, not instatement, which the card shows.
Definitions¶
Priority is by impact: a critical fact is Critical, an important fact Important, a useful fact Useful. The
fields that keep a fact true and citable (id, see, probe, reviewed_by) are Useful whatever the impact.
See What to write first.
| Key | Type | Required | Priority | Check | Description |
|---|---|---|---|---|---|
facts |
list of Fact | yes (in the facts file) | by impact | error if the file has a version line or other keys (except x-) |
The one list of facts of the project. |
kind |
definition, rule, quirk, recipe, decision, finding, question |
yes | by impact | error on any other value | What sort of statement it is. |
statement |
string | yes | by impact | prose lint | One line: what to know or do. The card shows it. |
detail |
string (markdown) | no | by impact | prose lint | The full rule, lists and numbers. Shown with oryxkb facts <id> --full, not on the card. |
about |
list of about ids | no; absent means the whole project | by impact | every id must resolve (error, with the fact's file and line); a glob must match at least one declared column; every key of a row filter must be a declared column of that dataset or output (error when the data is readable and the column is not there, otherwise a warning); a hint when a fact seen by consumers also names a non-exported dataset | What the fact is about. |
impact |
critical, important, useful |
no; default by kind (see above) | by impact | error on any other value; hint if more than a quarter of the project's facts are critical (projects with at least 8 facts) |
How much it matters to an answer. |
as_of |
date YYYY-MM-DD |
no | by impact | error if not a date | When the statement was written, found or decided. Never invented: leave it out. |
period |
string | no | Useful | - | The data period the statement describes, free text. Shown on the card. |
audience |
consumers, maintainers |
no; default from about |
Useful | error on any other value; error for consumers on a fact about only non-exported datasets; hint on a critical or important source fact left maintainers in a project that exports |
Who the fact is for; see Who sees a fact. |
when |
string | yes for recipe, otherwise not allowed |
Important | error if the rule is broken | The task the recipe applies to, in plain text ("comparing markets"). |
options |
list of string | allowed only for question and decision |
by impact | error otherwise | On a question, the open choices (an agent says which option it used); on a decision, the alternatives rejected. |
revisit |
string | allowed only for decision |
by impact | error otherwise | The condition that reopens the decision, in plain text. |
id |
string | no | Useful | error unless [a-z0-9-] and 2 to 63 characters, or an old f- id with hex digits; error if repeated anywhere in the project |
Stable citation id, kept across rewording. |
see |
list of string | no | Useful | warning, listed per fact, when a file path (no scheme, not a hub id, fact id or cfg: key) does not exist in the project; the anchor of a local markdown path is checked too |
Links to the explanation. Replaces the old field source. |
status |
proposed, reviewed, retired |
no, default proposed |
Useful | error on any other value (decision-open is gone: see question); warning on a retired question whose see names no live fact |
proposed is shown as [unreviewed] and is in use. reviewed records that a person confirmed it (reviewed_by); the agent writes it on that person's say-so. A retired fact is not shown; a question shows [open] whatever its status. |
expires |
date | no | Useful | error if before as_of |
After this date the fact is not shown as current. |
probe |
string | no | Useful | error if absolute, contains : or ..; see the probe contract |
Path from the project folder to a committed probe script that re-checks the statement on each build. |
reviewed_by |
string | no | Useful | - | Who reviewed it. |
About ids¶
about names the things the fact is about. Every id must resolve to something the project declares; a former name
that an alias still covers resolves too. An unresolved id of this project is an error with the fact's line.
| Form | Means |
|---|---|
Rents |
a dataset of this project (an export name) |
Rents#rent |
a column |
Rents#*_cagr |
the columns matching a glob (fnmatch); it must match at least one declared column |
RentsReport.summary#rent_growth_annual |
a column of one output (outputs: key) of a dataset with several outputs. A . separates the output because @ and : already mean builds and parameters in citations; the whole name is tried as a dataset first |
RentsReport.*#rent_growth_annual |
that column in every output of the dataset |
Rents?market_id=29484 |
rows of a dataset, written like the cell ids in citations; a column may precede ? |
source:vendor_a |
an as-of source: a key of project.sources or of any dataset's dates_asof (a dates_asof key missing from project.sources is a hint; an unknown source is an error) |
other-project/Rents#rent |
a dataset or column of another project: a/b is always project/dataset |
Names with spaces and special characters. Column names and row values may contain spaces: write them as they are.
#, &, ?, = and * inside a name or value are percent-encoded (%23, %26, %3F, %3D, %2A). A row id
with several keys joins them with &. Quote the whole id in YAML when it contains :. Block lists are the recommended style for about; oryxkb's writers
quote ids that contain ?, a space or :, and check reads both styles.
about:
- Rents?sector=Seniors Housing # a value with a space
- Rents?market_id=29484§or=Seniors Housing # a multi-key row id
- Rents?sector=R%26D # a value that contains &
- "Rents?note=see: footnote" # contains ": ", so the id is quoted
Slice checks. Every key in a row filter must be a declared column of that dataset (or output). When the checker can read the data and the column is not there, that is an error; with no data it is a warning.
Slices and lookup. A fact about rows is a slice of its dataset. oryxkb facts Rents includes the facts about its
slices; oryxkb facts "Rents?sector=Seniors Housing" returns the facts whose slice equals or contains that filter.
A finding may name any project's data. It lives in the file of the project that computed it: a consumer's finding
about imported data stays with the consumer and never travels to the producer. Another project's ids are resolved
against that project's published declarations when they are available locally; otherwise they are checked for syntax
only, with a warning, never an error.
Lookup¶
A tool answers "what must I know about Rents#market_id?" (oryxkb facts Rents#market_id [--full] [--all]) with the
facts in this order: facts naming the id itself (the column, or the rows), then facts naming its dataset, then
project-wide facts; for a dataset, last come the facts about each source in its dates_asof (marked [source:x]; a
consumer sees only those with audience: consumers, the maintainer view all), as on the card. Within that, facts are grouped by kind (definition, rule, quirk, recipe, decision, finding, question); within
a kind, critical first, then important, then useful, and the newest as_of first. Retired and expired facts are
left out unless asked for (--all). The card uses the same order, grouped by column in schema order,
then slices, then dataset-wide facts.
Internal names stay inside. On a consumer's card and in a consumer's oryxkb facts output, an about id that
names a dataset the project does not export is left out of the printed list; the fact still shows through its exported
ids. The maintainer card and the project's own lookup print every id.
On the consumer side. In a consumer project, oryxkb facts other-project/Rents#rent returns the producer's
published facts first, each prefixed with the producer's project, then the consumer's own facts about that id (its
findings and rules). The consumer's card for an import shows the same, labelled by project. See
Producers and consumers.
For maintainers. oryxkb card <project>/<Dataset> --audience maintainers renders the project's own card: every fact including the
maintainer ones, for all datasets. The consumer card is the default.
Who sees a fact¶
audience defaults from about, and exported on the dataset says which datasets consumers read:
| The fact is about | Default audience | Appears on |
|---|---|---|
| an exported dataset, its columns, outputs or rows | consumers |
the consumer cards and EXPORTS.md |
the whole project (no about) |
consumers |
every consumer card and EXPORTS.md |
a source (source:x) |
maintainers |
the project's own agents only |
a mix: a source and an exported dataset (about: [source:x, Rents]) |
consumers |
the consumer cards |
| a non-exported dataset | maintainers |
the project's own agents only |
An author sets audience: consumers on a source fact a consumer must know (a re-sent file, revised history): it then
appears on the card of every exported dataset whose dates_asof names that source. audience: consumers on a fact
about a non-exported dataset is an error. Vendor mechanics (throttling, parsing) stay maintainers; write the
consequence for consumers as its own fact.
Ask one question. For every source fact: would a consumer's answer be wrong without it? If yes, set
audience: consumers; check hints when a critical or important source fact stays maintainers in a project that
exports. When a dataset does not name the source in dates_asof, name the datasets in about with the source
(about: [source:vendor_a, Rents]): a list with any consumer-visible id is a consumer fact, and check does not warn
about the mix. A consumer fact that also names a non-exported dataset gets a hint, because the card would show an
internal name.
In an engine-built project the adapter fills exported: false entries for every non-exported task, so an author only
adds facts and never declares a dataset for the sake of about.
A folder you ship reaches every consumer. A fact about an exported dataset reaches consumers whatever its kind,
findings and questions included; set audience: maintainers on the ones meant for the project's own agents. A
question or a finding with no about, in a project that exports datasets, would show on every consumer card:
oryxkb check warns about that case only. A vendor ships rules, quirks, recipes and definitions. See
For data vendors.
Impact and trust¶
Every fact answers two questions, with separate fields. Do not mix them: a fact can be verified and minor, or unverified and critical.
How much it matters to an answer: impact. These are the same tiers as the field priorities in
What to write first.
| Value | Meaning | Example | How it is shown |
|---|---|---|---|
critical |
Ignore it and the answer is wrong. The agent must act on it every time. | "rent_growth is a decimal, not a percent" | Marked on the card and listed first in its section. |
important |
Ignore it and the answer is wrong for some questions. The agent applies it when the case fits. | "office includes flex space in the 2026Q2 release and later: only matters when comparing across 2026Q2" | Marked, after critical. |
useful |
Background. Ignoring it does not make an answer wrong. | "the 2026Q3 file was re-sent on 2026-11-02" | Last, not marked. |
Rule of thumb for the author. Write critical only when the answer is wrong without the fact, not merely worse. If
more than a quarter of a project's facts are critical (in a project with at least 8 facts), none of them stands out: oryxkb check hints at it. For a
question, impact is what goes wrong if an agent guesses; for a finding, how much a conclusion depends on it.
How sure we are that it is true: status, reviewed_by and probe.
| Level | Fields | How it is shown |
|---|---|---|
| Proposed | status: proposed (the default): someone wrote it, nobody has confirmed it; in use, the next agent applies it |
[unreviewed] |
| Reviewed | status: reviewed, reviewed_by: a person confirmed it |
no label |
| Checked against the data | probe: a committed script re-tests the statement on each build |
(checked) on any fact whose probe passed on the latest run; (probe failed); (probe not run) |
| Advice only | a rule with no probe |
(advice) |
| Retired | status: retired: no longer true |
not shown |
Nothing waits for a person: a fact applies as soon as an agent writes it, shown [unreviewed] until a person
confirms it. The next agent treats it as in force, says it is not yet signed off, and re-checks it against the data
when that is cheap. See How agents and people work together.
The strongest fact is reviewed and has a passing probe. Impact does not change when a fact is verified: a verified critical fact is still critical.
Probes¶
A probe is a small script committed with the project. The contract:
- it runs from the project root with the project's Python;
- it reads built data only;
- it exits 0 when the statement still holds, and non-zero when it no longer does;
- it prints one line (the reason, or the figure it saw); the runner keeps the last line of output as the summary, so an assert-style script that prints more qualifies;
- it finishes in 60 seconds.
A script that only prints a figure and cannot pass or fail belongs in see, not probe. The probe is the executable
part of a fact: the statement itself is written for the agent that uses the data.
To read a task's cached output without running the flow, load it with the engine's load call and let a missing build fail the probe; a call that builds on a miss reads more than built data. With oryxflow:
import sys
import oryxflow
import tasks
try:
df = oryxflow.Workflow(tasks.TaskRents, env='prod').outputLoad() # loads the saved output; never runs the flow
except RuntimeError as e: # "task not complete, run flow first": there is no build to check
print(e)
sys.exit(1)
n = (df['sector'] == 'office').sum()
print('office rows:', n)
sys.exit(0 if n > 0 else 1)
Wording rules¶
- A
ruleis advice written for an agent, not an automated quality check.probeis the executable part. People who know ODCS quality rules should not expect aruleto run; see Mappings. - A quirk says what is odd about the data; a rule says what to do. Put the consequence in the quirk's statement and write a separate rule only for an instruction with no quirk behind it (see Which kind?).
- Joins. A relationship's
ai_contextcarries only what the join itself needs. Anything standing goes in a fact about the key column, its kind by the kind test ("market names are spelled two ways; join on market_id" is a quirk, with the consequence in its statement). - Counts that change each release ("12,000 rows", "55 markets") belong in the generated coverage, not in facts; a
prose lint warns. A statement bound to one release uses
periodand, when it must vanish,expires. Coverage the profile cannot express (one measure starts later than another) is aquirk. - Rejected alternatives go in
detail, under "Rejected:". - Harvesting docstrings. An agent converting a project reads the "Do not:" and "Use for:" blocks of export docstrings and writes them as facts: they hold some of the most critical rules. It leaves history and retired rules out and does not invent dates.
- Every conversion ends with the checker (
oryxkb checkin oryxkb). A converter cannot see the defects only the code reveals: unquoted:or?in flow values,Dataset/output#colforDataset.output#col, a parameter name that does not exist.
Open questions¶
A question displays [open] whatever its status. When an agent proposes an answer, it writes the rule or quirk
(status: proposed, see naming the decision if there is one) and retires the question with see naming the rule.
The rule is in use at once; a person's review sets it reviewed. oryxkb check warns on a retired question whose
see names no live fact.
facts:
- kind: question
id: covid-window
statement: how to treat 2020-2021 is undecided
about: [Rents]
options: [exclude 2020-2021, keep all quarters]
status: retired
see: [covid-window-excluded]
- kind: rule
id: covid-window-excluded
statement: exclude 2020-2021 from trend fits
about: [Rents]
status: reviewed # before a person's review: proposed, in use and shown [unreviewed]
see: [h-3f9a2c]
The common case has no question at all: an agent proposes a house rule and nobody has confirmed it yet.
facts:
- kind: rule
statement: quote asking rent in memos; effective rent only when the memo says so
status: proposed
detail: Not yet confirmed by the research lead.
see: [h-7b21e4]
Without a hub the see line is left out. The decision behind h-7b21e4 is on
Communication.
Citing a fact¶
A fact with an id is cited in a memo as <project>/fact:<id>, for example
marketdata-example/fact:office-incl-flex. Ids are unique per project, and a fact may be about several datasets or
none. A fact without an id cannot be cited. A project alias resolves in a citation id as it does for datasets, so a
renamed project does not break old citations. The older forms <project>/<Dataset>/fact:<id> and .../howto:<id>
are still accepted when reading existing citation files; new citations use the new form. Cell citations are in
Communication.
Results stay with the project that produced them¶
A finding is a result this project computed about its own data, and it lives in this project's facts file. A result
never goes into another project's file. It becomes a fact about the source data only when it changes how everyone
reads that data, and then through a decision (Communication): the proposed decision is
written by the producer's agent as a rule or quirk whose see names the decision id, and becomes reviewed
when a person settles it. A consumer that wants the producer
to know something files a request; it does not edit the producer's facts. The whole path is on
Producers and consumers.