2404 stack 5 declare aggregates - #2448
Open
correct-horse-battery-bench wants to merge 2 commits into
Open
Conversation
correct-horse-battery-bench
force-pushed
the
2404-stack-5-declare-aggregates
branch
from
August 18, 2026 07:44
d9f5c72 to
b648f61
Compare
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
force-pushed
the
2404-stack-5-declare-aggregates
branch
from
August 18, 2026 14:37
1481040 to
0004770
Compare
correct-horse-battery-bench
marked this pull request as ready for review
August 18, 2026 14:49
s3inlc
approved these changes
Aug 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Make sure aggregate fields are also declared.