Skip to content

docs(config): typed binding, shape mismatches, dotted map keys and language-key comments, as of v6.3.0 - #105

Open
wisdommen wants to merge 8 commits into
alphafrom
docs/p17-fu-config
Open

wisdommen wants to merge 8 commits into
alphafrom
docs/p17-fu-config

Conversation

@wisdommen

@wisdommen wisdommen commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Superseded — do not merge as is (2026-09-30). The maintainer decided to refactor the framework's configuration layer inside 6.3.0, storage layer included (a per-type converter registry, a plain-data boundary, converters registered by modules instead of parser subclasses, a path-as-key-array storage model). The framework branch this page documents (fix/p17-fu-config) will not be merged on its own; the refactor plan inherits its behaviour contract, and this page will be rewritten against the refactored behaviour. The PR stays open as a record.

已被取代,请勿按现状合并(2026-09-30)。 维护者决定在 6.3.0 内连存储层一起重构配置层;本页对应的框架分支不会单独合并,本页会按重构后的行为重写。PR 保留作记录。

Summary

Documents the 6.3.0 configuration-binding changes on alpha (this PR targets alpha deliberately — the unreleased layer; master stays at the released version). Companion to the framework branch UltiKits/UltiTools-Reborn fix/p17-fu-config, whose pull request is opened by the next plan on that branch; issues UltiKits/UltiTools-Reborn#523, #526, #534, #553, #542.

  • @ConfigEntry comment: a comment that is exactly one language key ({config.limit}) is resolved from the module's catalogue in the server's language and rewritten on every framework write, keys already in the file included (maintainer decision of 2026-09-29). The page says plainly that the rewrite re-renders the whole file — quotes dropped, inline lists expanded, yes → true, 1.50 → 1.5, comments beside list items lost, values unchanged — which the maintainer accepted on 2026-09-30.
  • "Collections, maps and wrongly shaped values": typed list/map binding, quoted numbers, skip-and-warn, a wrongly shaped value keeping the default, secret values redacted.
  • Do not put a dot in a map key: in a map the file stores as a section, such a key is split into nested levels on write and on load, quoting it does not help, and the framework neither refuses nor warns about it - use - or _ (maintainer decision of 2026-09-30: no check, documentation only, #553). Also: a custom parser, including one extending DefaultConfigParser, reads and writes as before; save() leaves a null map/object value out with a warning where earlier versions threw a NullPointerException and left the file unchanged.
  • float/Float fields accept a decimal whose float reading prints back the same (0.1, 0.3, 1.5); more digits than a float holds keeps the default with a warning (maintainer decision of 2026-09-30, #534).
  • "Comments, as of v6.3.0" box: an existing key keeps its comment unless the comment is a language key.

Prose and inline code only, marked as of v6.3.0, English and Chinese pages changed together; no <<< example reference to unreleased API. Checked locally: scripts/check-container-length.sh on both pages (0 over), scripts/check-bilingual-parity.sh (exit 0).

中文

在 alpha(未发布层)记录 6.3.0 配置绑定的改动,是框架分支 fix/p17-fu-config 的配套文档:语言键注释在每次写文件时按服务器语言重写,并明确写出重写会重新输出整个文件(引号、行内列表、yes、1.50、列表项旁注释),维护者 2026-09-30 已接受;列表和映射按声明类型绑定;映射的键里不要用点(写入和读取都会被拆成嵌套的几层,加引号也没用,框架既不拒绝也不警告;维护者 2026-09-30 决定只写文档);映射或对象里的 null 值 save() 不写并警告(旧版本抛 NullPointerException、文件不变);float 小数读回来一样就接受。

Issue closure

None — the framework pull request closes the issues.

🤖 Generated with Claude Code

…nguage-key comments, as of v6.3.0

Companion to UltiKits/UltiTools-Reborn fix/p17-fu-config (#523, #526, #553, #542). Prose only,
both languages; no example reference to unreleased API.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-30T00:28:31.589664Z c0d1d03 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.

@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: 9acc200ffa

ℹ️ 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".


The `comment` attribute is used to specify the comment of this configuration item.

As of v6.3.0, a `comment` that is exactly one language key, such as `comment = "{config.limit}"`, is resolved from your module's language catalogue (`lang/en.json`, `lang/zh.json`, or the `.yml` equivalents) in the server's current `language`, so one entry can ship its comment in every language the module supports. The framework writes that text on every write of the file, keys the operator already has included: the first-boot defaults write, a save, the shutdown save, a panel write, and the first start after an upgrade or a `language` switch. Only those comment lines change; an operator's hand-written comment on such an entry is replaced, and a start whose comments already match writes nothing. A catalogue text with line breaks becomes several comment lines. A key missing from the catalogue is written as the token itself, with one warning naming the module, file, entry and key. Any other comment, including one that only contains a placeholder such as `{player}` inside other text, is written as it is, and only when the key is first added.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Qualify YAML-only catalogue resolution

For internal modules that ship only lang/<code>.yml, the current internationalization guide (docs/src/guide/essentials/i18n.md:26-27) states that the shared classloader can resolve the core JSON catalogue before YAML is tried, causing i18n(...) to return the raw key. This paragraph currently presents the .yml equivalent as reliably resolving the localized comment, so modules following it can receive an untranslated token instead; link to that warning and include its JSON-file workaround.

Useful? React with 👍 / 👎.


::: info Comments, as of v6.3.0
Bukkit preserves existing comments across a save, and UltiTools sets `options().parseComments(true)` explicitly rather than relying on the default. A key added for the first time also gets its `@ConfigEntry(comment)` written alongside it; a key the operator already has is left untouched.
Bukkit preserves existing comments across a save, and UltiTools sets `options().parseComments(true)` explicitly rather than relying on the default. A key added for the first time also gets its `@ConfigEntry(comment)` written alongside it; a key the operator already has keeps its own comment unless that comment is a language key (see `@ConfigEntry` above).

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Make the exception depend on the annotation comment

When a key already exists, replacement is controlled by whether its declared @ConfigEntry(comment) is a language key, not whether the operator's existing comment is itself a language key. As written, a reader can infer that an ordinary hand-written comment remains untouched even when the annotation contains {config.limit}, contradicting the behavior documented above; name the annotation comment explicitly here.

Useful? React with 👍 / 👎.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Deploying ultitools-dev-doc with  Cloudflare Pages  Cloudflare Pages

Latest commit: 610b67b
Status: ✅  Deploy successful!
Preview URL: https://569cf5ae.ultitools-dev-doc.pages.dev
Branch Preview URL: https://docs-p17-fu-config.ultitools-dev-doc.pages.dev

View logs

wisdommen and others added 2 commits September 30, 2026 00:15
…ates, collection types, re-rendering), as of v6.3.0

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…the whole-file re-render, as of v6.3.0

Follows the maintainer's answers of 2026-09-30 on UltiKits/UltiTools-Reborn#534, #553 and #542.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

@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: c0d1d0382a

ℹ️ 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".


The `comment` attribute is used to specify the comment of this configuration item.

As of v6.3.0, a `comment` that is exactly one language key, such as `comment = "{config.limit}"`, is resolved from your module's language catalogue (`lang/en.json`, `lang/zh.json`, or the `.yml` equivalents) in the server's current `language`, so one entry can ship its comment in every language the module supports. The framework writes that text on every write of the file, keys the operator already has included: the first-boot defaults write, a save, the shutdown save, a panel write, and the first start after an upgrade or a `language` switch. An operator's hand-written comment on such an entry is replaced, values keep their meaning, and a start whose comments already match writes nothing. The rewrite changes more than the comment lines: like every framework write, it renders the whole file again, so quotes the operator added are dropped, an inline list `[a, b]` becomes a multi-line list, `yes` becomes `true`, `1.50` becomes `1.5`, and a comment written beside a list item is lost. Values keep their meaning. This happens once on the first start after an upgrade and once after a `language` switch. A catalogue text with line breaks becomes several comment lines. A key missing from the catalogue is written as the token itself, with one warning naming the module, file, entry and key. Any other comment, including one that only contains a placeholder such as `{player}` inside other text, is written as it is, and only when the key is first added.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Reconcile the quote rewrite description

When the file contains a double-quoted string, this sentence says the operator-added quotes are dropped, but the unchanged saving section at line 190 says SnakeYAML re-emits the value with single quotes. Those descriptions are mutually inconsistent and give operators conflicting expectations about the whole-file diff caused by translating a comment; clarify whether quoting is removed or merely changed.

Useful? React with 👍 / 👎.

wisdommen and others added 5 commits September 30, 2026 11:09
… as of v6.3.0

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…; list-element maps keep them, as of v6.3.0

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…6.2, as of v6.3.0

Follows the maintainer's answer of 2026-09-30 on UltiKits/UltiTools-Reborn#553 (warn only, the
write path stays as in 6.2); no refusal claim remains.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…ull values; module parsers as before

UltiKits/UltiTools-Reborn#553, maintainer answer of 2026-09-30 ("no check, documentation only"):
the framework neither refuses nor warns about a dotted map key, so the page now says plainly that
such a key is split into nested levels on write and on load, that quoting it does not help, and that
module authors and operators must use '-' or '_'. No claim of a warning remains. Also: a custom
parser, including one extending DefaultConfigParser, reads and writes exactly as before; save()
leaves a null map/object value out with a warning where earlier versions threw a
NullPointerException and left the file unchanged. English and Chinese pages changed together.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

1 participant