Skip to content

docs: prepare 2.0 documentation and pin naming conventions - #281

Merged
leoafarias merged 13 commits into
mainfrom
claude/amazing-brown-nil5p7
Dec 3, 2026
Merged

leoafarias merged 13 commits into
mainfrom
claude/amazing-brown-nil5p7

Conversation

@leoafarias

@leoafarias leoafarias commented Dec 2, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This PR prepares the documentation for the 2.0.0 stable release and pins Ack's naming rule. It changes no library behavior. Library code changes are dartdoc comments only.

Reviewers compared every user-facing page with the code on main. They found no wrong API, key, or output. They did find repeated content, prerelease wording, gaps, and missing dartdoc. This PR fixes those.

Changes

Naming rule (first commit)

  • A VM test checks that constraint keys and diagnostic codes are snake_case, and that serialized error fields are camelCase. It finds 41 keys and 14 codes. An ARCHITECTURE.md entry records the rule.

One home per topic

  • Schema Types owns presence and a new Defaults section, which says withDefault validates when the default is used.
  • Custom Validation owns refine, a new transform section, custom constraints, and messages. It also gets a decision table.
  • Error Handling owns the error model, with a table of SchemaError members.
  • Configuration becomes a hub of links. Other pages link to these homes instead of repeating them.

Onboarding

  • The quickstart now ends with a generated model.
  • The migration guide starts with "Before you upgrade" (the SDK floor), then splits by starting version: from 1.x, or from a 2.0 beta. Its breaking changes are grouped into compile, runtime, and generated-code changes.
  • The root, ack, and generator READMEs are trimmed. The generator README goes from 381 lines to about 110.

Advanced pages

  • Model Code Generation gains:
    • a rules index;
    • naming and reserved-name tables;
    • a section on inferred field types;
    • the XSchema.schema vs X.schema rule;
    • the rule that generated Set<T> fields reject duplicates and export uniqueItems.
  • JSON Schema Integration gains a table of native vs imported differences. It also adds the missing constraint-to-keyword rows: contains, startsWith, endsWith, length, and ip().

Guides and reference

  • The Flutter form guide is now a numbered how-to.
  • Common Recipes keeps only the API-response task plus a table of links.
  • Ecosystem Integrations is now a table for choosing an adapter. The adapter quickstart is folded into the full guide and removed from the sidebar; the file still exists.
  • The API reference lists one entry per symbol and links to pub.dev dartdoc.
  • The three adapter READMEs share one structure.

Dartdoc (comments only)

  • Documented SchemaError and its subclasses, Constraint, ConstraintError, Validator, JsonSchemaSpec, and AckException.errors.
  • parseAs and safeParseAs now have distinct summaries. Boolean getters now start with "Whether".

Agent skills

  • Added the missing 1.x runtime breaks, the Set rule, and the naming rules.

Not changed on purpose

  • Version pins and prerelease notes (2.0.0-beta.3): release step H updates these.
  • Page URLs: docs.json has no redirect setting, so no page was deleted, renamed, or split.

Verification

  • dart format --set-exit-if-changed . and melos run analyze: pass.
  • Root dart test test: 80 tests pass. This includes:
    • the snippet test, which compiles every Dart example in the docs and READMEs;
    • the agent-skill tests;
    • the architecture-link and release-guidance tests.
  • packages/ack dart test: 3,115 tests pass.
  • npx @docs.page/cli@2.0.0 check: no issues.
  • A link and anchor check over 40 files reports no broken relative links or anchors. The only remaining hit is the concepta.dev/.../reference/llms-txt route, which is also on main.
  • Doc-integrity tests were updated where an example moved to its new home. Snippet wrappers that no example uses any more were removed.

https://claude.ai/code/session_01QEFHxK274pLvHpTn3qqhJG


Generated by Claude Code

Add a VM test that scans the library source and requires built-in
constraint keys and diagnostic codes to be lowercase snake_case, and
serialized error map fields to be camelCase. Record the naming rule in
ARCHITECTURE.md and keep the source-reading test out of the Chrome run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEFHxK274pLvHpTn3qqhJG
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-02T23:43:21.839050Z 9ed3d74 New commits
🔒 Security Review ✅ Completed 2026-12-02T23:44:35.825857Z 9ed3d74 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@leoafarias
leoafarias marked this pull request as draft December 2, 2026 14:57
Give each topic one home: Schema Types owns presence and defaults,
Custom Validation owns refine, transform, constraints and messages, and
Error Handling owns the error model. Trim the overview, installation,
quickstart and READMEs, add a generated-model step to the quickstart,
reorganize the migration guide by starting version, and turn
Configuration into a hub page. Replace beta-history prose with 2.0
behavior. Version pins stay for the release step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEFHxK274pLvHpTn3qqhJG
Add a rules index, naming and reserved-name tables, inferred field types,
rule annotation and JSON key sections, and the facade schema rules to
Model Code Generation. Reorder Codecs. Shorten the JSON Schema guide's
lead, add native-versus-imported differences and the missing
constraint-to-keyword rows, and turn shape notes into a table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEFHxK274pLvHpTn3qqhJG
Make the Flutter form guide a numbered how-to with one validator helper.
Reduce Common Recipes to a link table and the API-response recipe, and
Ecosystem Integrations to a choose-an-adapter table. Fold the adapter
quickstart into the full adapter guide and drop it from the sidebar.
Rewrite the API reference as one entry per symbol that links to pub.dev
dartdoc. Give the three adapter READMEs one structure and move the
Firebase contributor tests to test/README.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEFHxK274pLvHpTn3qqhJG
Document SchemaError and each subclass, Constraint, ConstraintError,
Validator, JsonSchemaSpec and AckException.errors. Give parseAs and
safeParseAs distinct summaries, contrast nullable with optional, start
boolean getters with "Whether", and add short examples to
Ack.discriminated and the object shape operations. Comments only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEFHxK274pLvHpTn3qqhJG
Add the missing 1.x runtime breaks, Set and naming rules to the agent
skills. Restore the .schema.json numeric note, the inference API and the
preserveBoundary rule. Fix anchors that moved, point doc-integrity
checks at the pages that now own each example, and drop snippet
wrappers that no example uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEFHxK274pLvHpTn3qqhJG
@leoafarias leoafarias changed the title test(ack): pin snake_case keys and camelCase error fields docs: prepare 2.0 documentation and pin naming conventions Dec 2, 2026
@leoafarias
leoafarias marked this pull request as ready for review December 2, 2026 15:07
Pairs with the generator fix that makes XSchema.toJsonSchema() and
toSchemaModel() export X.schema, so a class-owned description and
exportable constraints appear in the export.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEFHxK274pLvHpTn3qqhJG
Restore the ACK_FIREBASE_AI_* variable names in the Firebase test guide.
Make the naming test read both quote styles, conditional and inline map
keys, the AckException envelope, and fail on any computed key or code.
Qualify user-facing error text, the jsonEncode shortcut, which built-ins
take message:, callback failure types, JsonSchemaSpec export, and the
isNullable/isOptional flags. Document anyOf fields versus roots, the
generator part step, validated .schema.json output, and form-level
refinement errors. Fix error subtype examples, the naming skill, and
restore the compiled factory example and doc-test coverage.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEFHxK274pLvHpTn3qqhJG

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b677e598f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread docs/guides/flutter-form-validation.mdx Resolved
The replacement submit handler skipped _formKey.currentState!.validate(),
so untouched invalid fields never showed their errors. Run the field
validators first and send only when they and safeParse both pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEFHxK274pLvHpTn3qqhJG
Qualify the toString redaction promise in the migration guide, the
AckException and toString dartdoc, and the migration skill. Describe
isNullable and isOptional as settings and drop the protected
acceptsNull. Exclude enum values from the jsonEncode shortcut, qualify
transform failures, narrow the codec export rule to the runtime side,
and state that value-model files have no part.

The naming test now rejects any constraint key or code that is not
plain string literals or a known forward, checks parameter defaults,
and asserts the fields and identifiers of real emitted errors, so
transformed values and computed map keys fail too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEFHxK274pLvHpTn3qqhJG
Drop the redaction promise from AckException.toString, limit the
jsonEncode shortcut to values that hold only JSON types, and note that
Ack.duration() maps its bounds to milliseconds on export.

The naming test now checks each result of a ternary key, skips user
payload values when walking emitted errors, keeps a snake_case wire key
in its fixture, and covers a schema-model warning with context.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEFHxK274pLvHpTn3qqhJG
Say when a validated value can go straight to jsonEncode, when to call
schema.encode first (codecs, Ack.datetime, Ack.enumValues, including a
codec whose runtime value looks JSON-safe), and that a one-way transform
or Ack.instance has no wire encoder.

The naming test accepts only the known string_pattern_$patternName
template as an interpolated key, covers native enum violations, and
asserts context on the serialized trim warning itself. The compiler's
private _diagnostic helper takes a named code so the source scan sees
every code passed to it; behavior is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QEFHxK274pLvHpTn3qqhJG
@leoafarias
leoafarias merged commit 8eb07e5 into main Dec 3, 2026
12 of 13 checks passed
@leoafarias
leoafarias deleted the claude/amazing-brown-nil5p7 branch December 3, 2026 00:03
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