Producers and consumers¶
Each project's agent sees only its own files; these messages are how they stay current with each other.
This page is for the builder whose project publishes datasets that other projects read (the producer), or whose project imports them (the consumer). It says what travels between them, and where each piece is defined.
Who writes what¶
| Producer | Consumer | |
|---|---|---|
| Describes the data | oryxkb/project.yaml: datasets (marked exported), columns with types and units, relationships |
Its own project.yaml for the datasets it builds |
| Facts the consumer's agent must know | facts.yaml: definitions, rules, quirks and recipes about the exported datasets. These reach the consumer cards (Who sees a fact) |
Its own facts.yaml: findings, and rules about the imported data it needs for its own work |
| Results | Findings about its own data stay in its file | A result about imported data is a finding in the consumer's own file. It never goes into the producer's |
| Changes | Declares renames and removals (Schema changes); each published build sends a change notice | Reads the notice, checks its memos, sends an ack |
| Questions | Answers requests | Files a request when a number or a meaning looks wrong |
What the consumer's agent sees¶
For an import, oryxkb facts marketdata-example/Rents#rent in the consumer project 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 two groups, labelled by project (a consumer's
card). The agent also reads the producer's card: its facts, definitions and
joins, with the as-of date of each source. It cites what it used with <project>/fact:<id> for a fact and a cell id for a figure
(citations). Facts the producer marked for maintainers (about its sources and its
internal datasets) are not on the card; a source fact the producer set to audience: consumers is.
Where the import is declared. The consumer does not declare imports in project.yaml: a dataset it reads from
another project is imported when its pipeline loads it, and the import is known from the run. A consumer's fact names
the import by writing the producer's project in about (marketdata-example/Rents#rent).
A consumer's own result¶
A consumer computes something about imported data: "asking rent is above the published average in 38 of 55 markets".
That is a finding in the consumer's facts.yaml, with about: [marketdata-example/Rents#rent]
(the producer's project name, then dataset and column). oryxkb check accepts it without a note. It stays with the
project that produced it and never travels to the producer.
Getting a fact into the producer's file¶
A consumer cannot edit the producer's facts. The path is:
- The consumer's agent files a request on the dataset or column ("is
rentannual or monthly in 2019?"). - If the answer changes how everyone reads the data, the producer's agent or a consumer's proposes a decision. It is in use at once, provisional: consumers see it from the hub, on the card of each dataset in its scope, before any fact is written.
- The producer's agent writes it as a
ruleorquirkin itsfacts.yamlwithsee: [h-<id>],[unreviewed]. The person accountable for the producing project settles the decision; then the agent sets the factreviewed. A consumer that disagrees votesrevisit.
Nothing waits for a person: a proposed decision is in use at once until a person settles it. See How agents and people work together. If a person rejects or corrects it, the change shows in the hub's news, and a citation check flags it for anyone who cited the decision; there is no push notice today.
The rule behind this: Results stay with the project that produced them.
When the producer changes things¶
The producer follows Schema changes: a new name for a changed unit, removed_columns
and aliases for renames, a dated fact for a change in meaning. The same changes reach the consumer as a change
notice with the kinds values, renamed, removed, type, scale and blanks. The consumer's agent:
- reads the notice in its brief (
oryxkb news); - finds the memos that cite the changed columns: its cited files name them;
- re-reads those cells from the old and the new build, which it can read; the notice carries no values;
- updates the memos and acks with what it checked or changed (
oryxkb ack <id> --note "...").
What is not available yet¶
Messages go through a shared service (a hub), within one organisation: its projects and teams. Until a hub is public, notices, requests and decisions work only between projects that share one. Messages across organisations, such as notices from a vendor to its clients' agents, are out of scope (Status). Everything in the files themselves works without a hub.
A worked pair of projects, with the producer's file, the consumer's findings and one notice: Examples.