Repository navigation
fix(core): reject YAML aliases and merge expansion in notes - #1933
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
58628c3 to
ef3347f
Compare
f744253 to
b9368db
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
b9368db to
f4f2956
Compare
ef3347f to
34a7e9c
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
34a7e9c to
7bde6c2
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
d7a9e79 to
372aa7c
Compare
7bde6c2 to
4040a84
Compare
|
@codex review |
372aa7c to
e257e8e
Compare
4040a84 to
3214ec6
Compare
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
e257e8e to
8b577e6
Compare
3214ec6 to
027f499
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
8b577e6 to
c47c543
Compare
027f499 to
6ee9800
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
6ee9800 to
f96f688
Compare
|
@codex review |
f96f688 to
3ae9bdf
Compare
a083edc to
412b611
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
3ae9bdf to
0a48783
Compare
412b611 to
f02c754
Compare
|
@codex review |
f02c754 to
e6fd64b
Compare
0a48783 to
92b3ee3
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
e6fd64b to
6649d5f
Compare
92b3ee3 to
f508403
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
f508403 to
3b8d968
Compare
6649d5f to
0a209fb
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
3b8d968 to
79384a5
Compare
0a209fb to
5997238
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Signed-off-by: phernandez <[email protected]>
79384a5 to
b445aa3
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Why
YAML aliases create shared or cyclic containers that downstream normalization, schema processing, and export treat as trees; merge construction can expand work before those consumers run. A 347-character alias document allocated 2.5 MiB in normalization, and a cyclic alias caused RecursionError in the real entity parser. Fixes #1892 (K6/K15/K16/K22/K44).
What Changed
Adopt the user-approved simple YAML policy: aliases and merge keys are unsupported in note metadata. Reject them during YAML composition, before construction or recursive normalization. Emit repeated values directly so writers do not introduce aliases. Document the policy in DOMAIN_MODEL.md.
Implementation Details
One SafeLoader subclass enforces the policy across Core frontmatter parsing, MCP read shaping, python-frontmatter adapters, schema-file reads, local Wiki ownership parsing, and OKF validation. OKF retains its timestamp-spelling resolver while inheriting the same graph restriction. Existing malformed-frontmatter handling preserves canonical bytes as body content; strict metadata/OKF readers reject unsupported YAML. SafeDumper customization keeps generated frontmatter compatible with the reader.
Stacked on #1932; only YAML policy, its adapters, documentation, and regression tests are new here.
Testing
uv run pytest tests/markdown/test_simple_yaml_policy.py tests/utils/test_file_utils.py tests/utils/test_frontmatter_obsidian_compatible.py tests/okf tests/picoschema tests/services/test_entity_service.py tests/services/test_note_section_edits.py tests/mcp/test_tool_read_note.py tests/api/v2/test_schema_router.py tests/index/test_local_wiki_projection.py -q --no-cov: 608 passed.just fast-check: passed, including repository type checking.just doctor: passed sandboxed write/index/search self-test.git diff --check: passed.Risks / Follow-ups
This deliberately stops accepting alias/merge metadata. Existing notes must repeat those values directly to use them as frontmatter; canonical bytes are not automatically rewritten. Unused anchors carry no alias edges and do not expand graphs. The CI project-update configuration parser is not note metadata and retains its existing YAML handling. Cloud must update Core and use the shared policy in any Cloud-owned YAML reader to receive the complete cross-repository fix.