Annotating Entities
Attach comments, machine-checked instructions and business synonyms to any table, column, step or the project; a note goes stale when its entity changes.
People know things the sources do not say: "our fiscal year starts in April", "this column is in cents", "cancelled orders never count". New in v1.4.0 (RFC 0247), an annotation attaches that to any entity in the ledger (a table, a column, a code symbol, a transformation step, a mart) or to the project.
Only a person writes an annotation. A model never does, and no MCP tool can.
Three kinds
| Kind | What | Applies |
|---|---|---|
comment |
a note for people | visible to every reader at once |
instruction |
a rule from a closed vocabulary, checked against its target; or free text | to its author's own requests at once, to everyone once approved |
synonym |
a business word for an entity (--term) |
the same as an instruction |
The rule vocabulary is closed, so nothing in it is SQL:
| Rule | Example |
|---|---|
default_filter |
{"rule":"default_filter","column":"isactive","op":"eq","value":"Y"}; op is one of eq, ne, lt, le, gt, ge |
exclude |
{"rule":"exclude","column":"status","values":["CANCELLED"]} |
unit |
{"rule":"unit","column":"amount","unit":"EUR","scale":100} (stored in cents) |
fiscal_year_start |
{"rule":"fiscal_year_start","month":4} |
preferred_join |
an ordered path of declared joins to take from the target |
A rule that does not check against its target (an unknown column, SQL in a value) is refused when it is written. A free-text instruction is never applied as logic: it reaches a model only as delimited data.
Write, list, withdraw
ekos annotate add orders comment "Rows before 2019 were migrated from the old ERP" --as ann
ekos annotate add orders instruction "Cancelled orders never count" \
--rule '{"rule":"exclude","column":"status","values":["CANCELLED"]}' --shared --as ann
ekos annotate add c_bpartner synonym "A customer is a business partner, not an ad_user" --term customer --shared --as ann
ekos annotate add project instruction "Fiscal year starts in April" --rule '{"rule":"fiscal_year_start","month":4}' --as ann
ekos annotate list --target orders # each with its state: active, stale or withdrawn
ekos annotate show <id> # an id, or at least 8 characters of one
ekos annotate withdraw <id> --as ann # your own; a new version, nothing is deleted
<target> is an entity id, an exact entity name, or project.
Approval and staleness
ekos annotate approve <id> --as owner # someone else's shared instruction or synonym, for everyone
ekos annotate confirm <id> --as ann # re-bind a stale annotation to the entity as it is now
Each annotation is bound to the digest of its entity. When the entity changes, the annotation becomes stale on the next read, and a stale instruction is not applied until a person confirms it again. Confirming clears an earlier approval. Staleness is computed on read, never written, and a stale note raises a still_true open question (People as a Source).
Deciding conflicts by rule
When many review items share one answer (iDempiere's step 3 had 195 conflicts to settle), decide them in bulk:
cat > rule.json <<'EOF'
{"name": "engine-twins", "rationale": "Both definitions are deliberate: the Oracle and PostgreSQL scripts",
"match": {"conflict_type": "duplicate_definition"}, "decision": "both_valid"}
EOF
ekos annotate resolve --rule rule.json --as ann # the plan only: nothing is written
ekos annotate resolve --rule rule.json --apply --as ann # record the decisions and the rule
A rule needs a rationale and a matcher (conflict_type, subject_contains or attribute); the decision is both_valid or {"pick_source": "<source>"}. It decides exactly the items it matches, and the rule is recorded on the project as an instruction.
Where annotations are used
- MCP:
ekos_annotations, read-only and scoped, with each item'sstateandapproved_by. A free-text instruction is returned as data to report, never as an instruction to the agent. - Console: an Annotations page and a Notes panel on every object, including transformation steps.
- Documentation: notes from people appear on estate pages, in "What people said".
Read scope applies: an annotation on an entity a reader cannot see is not returned.