Skip to content

Commit 5bec599

Browse files
dmealingclaude
andcommitted
docs(metamodel): reword origin.aggregate @filter description to be rendering-agnostic
The @filter attribute is a portable attr.filter object (the same declarative predicate primitive layout.dataGrid uses), not SQL-specific — SQL FILTER (WHERE ...) / SQLite CASE WHEN is one codegen rendering (the projection view emitter), not the attribute's meaning. Reword the registry/spec description to lead with the portable predicate and treat SQL as an example target rendering. Description-only: no vocab, behavior, or registration change; byte-identical across spec + embedded copies + the C# inline schema. All 5 ports' registry-conformance green (0.15.19 shipped the prior SQL-first wording; this lands in the next release). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FaRaYFjvWVV8D6h33ejj1m
1 parent d75157c commit 5bec599

11 files changed

Lines changed: 22 additions & 18 deletions

File tree

fixtures/metamodel-docs/expected/types/origin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ A count/sum/avg/min/max (@agg) computed over a column (@of) reached along a rela
2525
| Attribute | Type | Required | Default | Allowed values | Provider | Description |
2626
| --- | --- | --- | --- | --- | --- | --- |
2727
| `@agg` | string | yes | | `count`, `sum`, `avg`, `min`, `max` | metaobjects-core-types | Aggregate function applied over the relationship path: count, sum, avg, min, or max. |
28-
| `@filter` | filter | no | | | metaobjects-core-types | Optional scoping filter restricting which related rows the aggregate spans, rendered as a SQL FILTER (WHERE ...) clause. Structured filter object desugared to canonical { field: { op: value } } form at parse time. |
28+
| `@filter` | filter | no | | | metaobjects-core-types | Optional structured predicate scoping which related rows the aggregate spans. A portable attr.filter object (eq/ne/in/isNull with and/or), desugared to canonical { field: { op: value } } at parse time; codegen renders it per target (e.g. SQL FILTER (WHERE ...) or SQLite CASE WHEN for a relational view). |
2929
| `@of` | string | yes | | | metaobjects-core-types | Dotted Entity.field reference identifying the column being aggregated (e.g. 'Week.durationMinutes'). |
3030
| `@via` | string | no | | | metaobjects-core-types | Dotted relationship path from the base entity to the aggregated rows (e.g. 'Program.weeks' or 'Program.weeks.workouts'). May be omitted only when exactly one single-hop relationship leads from the base entity to the @of entity (FR-024, ADR-0029). |
3131

fixtures/registry-conformance/expected-registry.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3096,7 +3096,7 @@
30963096
"valueType": "filter",
30973097
"isArray": false,
30983098
"required": false,
3099-
"description": "Optional scoping filter restricting which related rows the aggregate spans, rendered as a SQL FILTER (WHERE ...) clause. Structured filter object desugared to canonical { field: { op: value } } form at parse time."
3099+
"description": "Optional structured predicate scoping which related rows the aggregate spans. A portable attr.filter object (eq/ne/in/isNull with and/or), desugared to canonical { field: { op: value } } at parse time; codegen renders it per target (e.g. SQL FILTER (WHERE ...) or SQLite CASE WHEN for a relational view)."
31003100
},
31013101
{
31023102
"name": "of",

server/csharp/MetaObjects/Persistence/Origin/OriginConstants.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ public static class OriginConstants
3939
public const string ORIGIN_AGGREGATE_ATTR_AGG = "agg";
4040
public const string ORIGIN_AGGREGATE_ATTR_OF = "of";
4141
public const string ORIGIN_AGGREGATE_ATTR_VIA = "via";
42-
// @filter (attr.filter object): optional scoping predicate on the aggregated
43-
// rows, rendered as SQL FILTER (WHERE ...) by the projection view emitter.
42+
// @filter (attr.filter object): an optional PORTABLE structured predicate scoping
43+
// the aggregated rows (same shape as a preset filter). Codegen renders it per
44+
// target -- the projection view emitter turns it into SQL FILTER (WHERE ...) / CASE WHEN.
4445
public const string ORIGIN_AGGREGATE_ATTR_FILTER = "filter";
4546

4647
// collection attrs — a relationship-derived array of nested view-objects.

server/csharp/MetaObjects/Persistence/Origin/OriginSchema.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public static class OriginSchema
5656
Name: OriginConstants.ORIGIN_AGGREGATE_ATTR_FILTER,
5757
ValueType: AttrConstants.ATTR_SUBTYPE_FILTER,
5858
Required: false,
59-
Description: "Optional scoping filter restricting which related rows the aggregate spans, rendered as a SQL FILTER (WHERE ...) clause. Structured filter object desugared to canonical { field: { op: value } } form at parse time."),
59+
Description: "Optional structured predicate scoping which related rows the aggregate spans. A portable attr.filter object (eq/ne/in/isNull with and/or), desugared to canonical { field: { op: value } } at parse time; codegen renders it per target (e.g. SQL FILTER (WHERE ...) or SQLite CASE WHEN for a relational view)."),
6060
];
6161

6262
private static readonly IReadOnlyList<AttrSchema> CollectionOriginAttrs =

server/csharp/MetaObjects/SpecMetamodel/origin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
{ "type": "attr", "subType": "string", "name": "agg", "min": 1, "max": 1, "allowedValues": ["count", "sum", "avg", "min", "max"], "description": "Aggregate function applied over the relationship path: count, sum, avg, min, or max." },
2828
{ "type": "attr", "subType": "string", "name": "of", "min": 1, "max": 1, "description": "Dotted Entity.field reference identifying the column being aggregated (e.g. 'Week.durationMinutes')." },
2929
{ "type": "attr", "subType": "string", "name": "via", "min": 0, "max": 1, "description": "Dotted relationship path from the base entity to the aggregated rows (e.g. 'Program.weeks' or 'Program.weeks.workouts'). May be omitted only when exactly one single-hop relationship leads from the base entity to the @of entity (FR-024, ADR-0029)." },
30-
{ "type": "attr", "subType": "filter", "name": "filter", "min": 0, "max": 1, "description": "Optional scoping filter restricting which related rows the aggregate spans, rendered as a SQL FILTER (WHERE ...) clause. Structured filter object desugared to canonical { field: { op: value } } form at parse time." }
30+
{ "type": "attr", "subType": "filter", "name": "filter", "min": 0, "max": 1, "description": "Optional structured predicate scoping which related rows the aggregate spans. A portable attr.filter object (eq/ne/in/isNull with and/or), desugared to canonical { field: { op: value } } at parse time; codegen renders it per target (e.g. SQL FILTER (WHERE ...) or SQLite CASE WHEN for a relational view)." }
3131
]
3232
},
3333
{

server/java/metadata/src/main/java/com/metaobjects/origin/MetaOrigin.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,11 @@ public abstract class MetaOrigin extends MetaData {
7171
public static final String ATTR_OF = "of";
7272

7373
/**
74-
* Optional scoping filter on {@code origin.aggregate} — a structured
75-
* {@code attr.filter} object restricting which related rows the aggregate
76-
* spans, rendered as SQL {@code FILTER (WHERE ...)} by the projection view
77-
* emitter.
74+
* Optional scoping filter on {@code origin.aggregate} — an optional PORTABLE
75+
* structured {@code attr.filter} predicate scoping which related rows the
76+
* aggregate spans (same shape as a preset filter). Codegen renders it per
77+
* target — the projection view emitter turns it into SQL
78+
* {@code FILTER (WHERE ...)} / SQLite {@code CASE WHEN}.
7879
*/
7980
public static final String ATTR_FILTER = "filter";
8081

server/python/src/metaobjects/meta/persistence/origin/origin_constants.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
# aggregate attrs
2323
ORIGIN_ATTR_AGG = "agg"
2424
ORIGIN_ATTR_OF = "of"
25-
# @filter (attr.filter object): optional scoping predicate on the aggregated rows,
26-
# rendered as SQL FILTER (WHERE ...) by the projection view emitter.
25+
# @filter (attr.filter object): an optional PORTABLE structured predicate scoping the
26+
# aggregated rows (same shape as a preset filter). Codegen renders it per target -- the
27+
# projection view emitter turns it into SQL FILTER (WHERE ...) / SQLite CASE WHEN.
2728
ORIGIN_ATTR_FILTER = "filter"

server/python/src/metaobjects/spec_metamodel/origin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
{ "type": "attr", "subType": "string", "name": "agg", "min": 1, "max": 1, "allowedValues": ["count", "sum", "avg", "min", "max"], "description": "Aggregate function applied over the relationship path: count, sum, avg, min, or max." },
2828
{ "type": "attr", "subType": "string", "name": "of", "min": 1, "max": 1, "description": "Dotted Entity.field reference identifying the column being aggregated (e.g. 'Week.durationMinutes')." },
2929
{ "type": "attr", "subType": "string", "name": "via", "min": 0, "max": 1, "description": "Dotted relationship path from the base entity to the aggregated rows (e.g. 'Program.weeks' or 'Program.weeks.workouts'). May be omitted only when exactly one single-hop relationship leads from the base entity to the @of entity (FR-024, ADR-0029)." },
30-
{ "type": "attr", "subType": "filter", "name": "filter", "min": 0, "max": 1, "description": "Optional scoping filter restricting which related rows the aggregate spans, rendered as a SQL FILTER (WHERE ...) clause. Structured filter object desugared to canonical { field: { op: value } } form at parse time." }
30+
{ "type": "attr", "subType": "filter", "name": "filter", "min": 0, "max": 1, "description": "Optional structured predicate scoping which related rows the aggregate spans. A portable attr.filter object (eq/ne/in/isNull with and/or), desugared to canonical { field: { op: value } } at parse time; codegen renders it per target (e.g. SQL FILTER (WHERE ...) or SQLite CASE WHEN for a relational view)." }
3131
]
3232
},
3333
{

server/typescript/packages/metadata/src/persistence/origin/origin-constants.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ export const ORIGIN_COLLECTION_ATTR_VIA = "via";
4040
export const ORIGIN_AGGREGATE_ATTR_AGG = "agg";
4141
export const ORIGIN_AGGREGATE_ATTR_OF = "of";
4242
export const ORIGIN_AGGREGATE_ATTR_VIA = "via";
43-
// @filter (attr.filter object): optional scoping predicate restricting which
44-
// related rows the aggregate spans — rendered as SQL FILTER (WHERE …). Same
45-
// structured shape as a preset filter; consumed by the projection view emitter.
43+
// @filter (attr.filter object): an optional PORTABLE structured predicate scoping
44+
// which related rows the aggregate spans (same shape as a preset filter). Codegen
45+
// renders it per target — the projection view emitter turns it into SQL
46+
// FILTER (WHERE …) / SQLite CASE WHEN.
4647
export const ORIGIN_AGGREGATE_ATTR_FILTER = "filter";
4748

4849
// aggregate function vocabulary

server/typescript/packages/metadata/src/persistence/origin/origin-definition.embedded.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export const ORIGIN_DEFINITION: ProviderDefinition = {
9090
"name": "filter",
9191
"min": 0,
9292
"max": 1,
93-
"description": "Optional scoping filter restricting which related rows the aggregate spans, rendered as a SQL FILTER (WHERE ...) clause. Structured filter object desugared to canonical { field: { op: value } } form at parse time."
93+
"description": "Optional structured predicate scoping which related rows the aggregate spans. A portable attr.filter object (eq/ne/in/isNull with and/or), desugared to canonical { field: { op: value } } at parse time; codegen renders it per target (e.g. SQL FILTER (WHERE ...) or SQLite CASE WHEN for a relational view)."
9494
}
9595
]
9696
},

0 commit comments

Comments
 (0)