Skip to content

2404 stack 5 declare aggregates - #2448

Open
correct-horse-battery-bench wants to merge 2 commits into
2404-stack-4-model-definition-accuracyfrom
2404-stack-5-declare-aggregates
Open

2404 stack 5 declare aggregates#2448
correct-horse-battery-bench wants to merge 2 commits into
2404-stack-4-model-definition-accuracyfrom
2404-stack-5-declare-aggregates

Conversation

@correct-horse-battery-bench

@correct-horse-battery-bench correct-horse-battery-bench commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Make sure aggregate fields are also declared.

aggregateData() adds computed properties to the resource an operation answers
with, and nothing said what they are, so the generator could not describe them
and a client asking for one got back an attribute the document never mentions.

getAggregateFeatures() declares them, and aggregateFeature() fills in what holds
for every computed property: it is read-only, never a primary key and never part
of the dba mapping. A callback returning null contributes no key at all, so an
optional aggregate is an absent property rather than a null one.

The three model APIs whose aggregates the generator needs first declare theirs:
the assigned agents, dispatch and search progress, status, chunk count, speed,
estimates and progress of a task, the auxiliary keyspace of a pretask and the
token of an API token. The status names its values through DTaskStatus, the same
define the code computing them uses.
The previous commit declared the aggregates of three model APIs. Five more offer
aggregates through getAggregateFieldsets() without declaring them, so a client
asking for e.g. `aggregate[agent]=crackingTime` got back an attribute the
document never mentions, and no generated client could reach it.

Declare the aggregates of AgentAPI, AgentAssignmentAPI, SupertaskAPI,
TaskWrapperDisplayAPI and ConfigAPI, plus the "cracked" field of TaskAPI that
was offered but not declared. Two of them needed the generator to catch up:

  Config: the value boundaries of an item depend on its config type, so the
  members of the object differ per item and no feature type describes it. A
  feature may now carry an 'openapi_schema' that FeatureTypeMapper takes
  verbatim instead of looking the type up.

  Config again: it replaces its attributes through
  getOpenAPIAttributesSchemaOverride(), and the override used to be taken as
  the final word. Since aggregateData() appends its fields to whatever the
  override describes, the aggregates are now merged into it, into every branch
  of a oneOf.

FullSpecTest walks every registered model and asserts that each offered
fieldset entry is declared, is reachable under the same alias and appears in
the response schema as an optional property, so the next aggregate cannot be
added without documenting it.
@correct-horse-battery-bench
correct-horse-battery-bench force-pushed the 2404-stack-5-declare-aggregates branch from 1481040 to 0004770 Compare August 18, 2026 14:37
@correct-horse-battery-bench
correct-horse-battery-bench marked this pull request as ready for review August 18, 2026 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants