Repository navigation
feat(generator): add a static schema shorthand to AckInfer models - #174
Merged
Merged
Conversation
leoafarias
force-pushed
the
release/1.7
branch
from
September 29, 2026 14:09
88a2070 to
c498de5
Compare
leoafarias
force-pushed
the
feat/short-model-schema-accessor
branch
from
September 29, 2026 14:09
af76401 to
53e8d0f
Compare
This was referenced Sep 29, 2026
leoafarias
added this pull request to stack #178
September 29, 2026 14:11
leoafarias
force-pushed
the
feat/short-model-schema-accessor
branch
2 times, most recently
from
September 29, 2026 14:55
15974c5 to
6a1337d
Compare
leoafarias
marked this pull request as ready for review
September 29, 2026 15:06
leoafarias
force-pushed
the
feat/short-model-schema-accessor
branch
from
September 29, 2026 15:43
6a1337d to
dc85ba8
Compare
leoafarias
removed this pull request from stack #178
September 29, 2026 16:53
leoafarias
added a commit
that referenced
this pull request
Sep 29, 2026
Align the six publishable packages at 1.7.0-beta.1 and move unreleased notes into the 1.7.0-beta.1 changelog sections. The release includes shared inference, model adapter schemas, CodecSchema.canEncode, typed copyWith, stricter constrained-Set validation, the @AckInfer schema shorthand (#174), generated string-literal escaping (#164), and explicit schema descriptions (#176). Update PUBLISHING.md for this candidate. The Draft 2020-12 runtime (#171), JSON Schema-to-Dart generation (#167), and the decoder error contract (#163) are deferred to 2.0.
leoafarias
force-pushed
the
feat/short-model-schema-accessor
branch
from
September 29, 2026 16:53
dc85ba8 to
edbedc2
Compare
leoafarias
force-pushed
the
release/1.7
branch
from
September 29, 2026 16:53
abc5828 to
6bec904
Compare
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.
Summary
@AckInfer()models now declarestatic final schema = $ack.modelSchema. This applies to object models, value models, union bases, and union branches, soAck.list(Task.schema)replacesAck.list(Task.$ack.modelSchema). The shorthand has the same type as$ack.modelSchema, is created once, and equals$ack.modelSchema. It can't beidentical, becauseAckModelAdapter.modelSchemabuilds a new codec on each call.schemaor its union discriminator isschema. It also omits it when the annotated declaration is namedschema, because the static would shadow the variable the adapter reads. In those cases the generator neither fails nor renames the member, and$ack.modelSchemastill works. It also omits the shorthand when the library imports a prefix namedschema(for exampleimport 'package:ack/ack.dart' as schema;), because the static would shadow that prefix inside the generated class.$ack,@AckModel()(which already hasXSchema.schema), and the frozen@AckType()are unchanged.example/lib/*.ack.dartfiles, docs,llms.txt, and changelogs are updated.Closes #173
Stack
Rebuilt on the 1.7 release baseline. It no longer inherits #171 or #167, which move to 2.0. Base:
release/1.7(#168). Next in the stack: #164, then #176. After typedcopyWithreturned to 1.7, one conflict inmodel_emitter.dartwas resolved: the value-model shorthand check uses the existing_valueFieldhelper. Review fixdc85ba8fadds the import-prefix check.Validation
Validated locally on the combined 1.7 tree (
feat/ackmodel-class-description, head2d632300), which includes every PR in the stack:dart run melos run test --no-selectpassed. Strict analysis (--fatal-infos) found no issues in all seven packages. Tests passed:ack1,311,ack_generator347,ack_firebase_ai98,ack_mcp_dart63,ack_json_schema_builder51,ack_annotations8, plus the root and example suites.*.ack.dart/*.g.dart, thenmelos run build) reproduced the committed output exactly.dart scripts/api_check.dart 1.6.2reported no breaking changes in any of the six packages. It cannot inspect generated consumer code, so it does not flag the typedcopyWithgetter; theack_generatorchangelog documents that under Breaking.dart scripts/publish_dry_run.dartreported 0 warnings for all six packages.verify_release_tag v1.7.0-beta.1 --skip-ancestry,dart format --set-exit-if-changed, andgit diff --checkpassed.Setcodegen in chore(release): prepare Ack 1.7.0-beta.2 #168,schemaimport prefix in feat(generator): add a static schema shorthand to AckInfer models #174) and the non-blocking fixes are included.New tests:
ack_infer_contract_test.dartchecks that every model kind emits the shorthand, that each collision case omits it, and that aschemaimport prefix suppresses it.ack_infer_runtime_build_test.dartbuilds, analyzes (--fatal-infos), and runs a real consumer. It assertsNode.schemais stable across reads, equalsNode.$ack.modelSchema, has the expected static type, composes inAck.list, and works on value, union, and branch models. It also checks that the colliding models compile and parse through$ack.modelSchema, and thatRuleandDraftencode back.