Repository navigation
Conversation
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Array-table ownership and dotted-key conflicts can still produce invalid or incorrectly transformed TOML.
Review effort: Balanced
Findings: 2
Open (2)
What changed in this PR
Updates managed TOML editing to preserve foreign content and user-defined keys within marker spans.
Changes:
- Merges or removes only owned TOML tables and descendants.
- Updates Codex, Grok, and Kimi integrations for table-aware removal.
- Adds regression, CLI, and fuzz coverage.
| File | Description |
|---|---|
src/cli/config_toml_edit.c |
Implements table-aware span editing. |
src/cli/config_toml_edit.h |
Documents and exposes the updated API. |
src/cli/cli.c |
Supplies owned headers for client removal. |
tests/test_config_toml_edit.c |
Adds TOML regression coverage. |
tests/test_cli.c |
Adds Codex integration coverage. |
tests/fuzz/cbm_fuzz.c |
Fuzzes table-headed managed blocks. |
tests/fuzz/corpus/config/toml-foreign-span.seed |
Adds a foreign-span seed. |
scripts/memory-core-baseline.txt |
Updates the memory lint baseline. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Converted to draft while I run another round of checks on a small cleanup of this change. I'll mark it ready for review once they pass. |
Two cases from the DeusData#2434 review, both reproduced before this change: - Array block (Kimi's [[hooks]]): every later header on the array path counted as foreign. A [hooks] table in the span stayed next to the [[hooks]] entry upsert wrote, which is invalid TOML, and a [hooks.meta] of our entry that sat behind unrelated content survived removal and turned hooks into a table. Now only a later [[hooks]] element starts foreign content, together with its sub-tables; a same-path [hooks] or a sub-table ahead of that element fails closed. - Dotted keys: command.detail = "x" in our table does not match the block's command key, so the merge kept it and appended command, which TOML forbids. Upsert now fails closed when a dotted key or a sub-table redefines a key the block writes; unrelated dotted keys are kept. Plus a cleanup with no behaviour change: the block's body spec moves into the shape struct and the scan state into the span struct instead of extra parameters and out-parameters, duplicate comments go, and the public header drops the issue history. Tests: the fail-closed case adds the three array conflicts (upsert and removal both refuse, file untouched) and the two key redefinitions; the merge case keeps an unrelated dotted key; the array case keeps the sub-table of a foreign element. Refs DeusData#2228 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Anton Standrik <astandrik@yandex-team.ru>
|
Thank you so much, @astandrik, for this PR and especially for the careful side-by-side recheck with real Codex app-server writes. That comparison found a real gap. We also owe you an apology for the order of events: #2467, for the same issue, was merged today without your PR and your 10-02 results being weighed against it first. That is on us. Your finding holds on current main. When Codex removes Would you be up for rebasing #2434 onto main as the follow-up for that case? main now keeps foreign tables by moving them below the closing marker (#2467). What is still missing is a safe recovery when the closing marker is gone. Your app-server reproduction (delete I have reopened #2228 so the remaining case stays tracked. Thanks again for the thorough work! |
0f30825 to
ea911e2
Compare
Updated this PR on top of main, keeping #2467’s layout. It now recovers the missing closing marker while preserving user keys and foreign tables. |
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: 1
Open (3)
toml_assignment_t assignment;is uninitialized before being passed totoml_parse_assignment(),… · New The return value ofwrite_test_file()is ignored here, so a failed write could surface later as a… · New This assertion only checks thatsnprintf()returned a positive value, but it does not detect… · New
There was a problem hiding this comment.
Warning
Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.
Copilot review overview
Review effort: Lite
Findings: 1
Open (2)
Resolved since last review (3)
Signed-off-by: Anton Standrik <astandrik@yandex-team.ru>
b4c735d to
c28593e
Compare
Signed-off-by: Anton Standrik <astandrik@yandex-team.ru>


What does this PR do?
Fixes reinstall after Codex deletes
mcp_servers.node_repland takes the closing MCP marker with it. It keeps #2467's placement of foreign tables after the managed block.Before legacy migration, install recovers a lone opening marker only when the following CBM table and managed fields are recognizable. It preserves user keys, comments and child tables, restores the closer, and writes once atomically. Ambiguous ownership or a concurrent file change causes refusal without overwriting the file.
Evidence
scripts/test.sh: 8468 passed, 0 failed, 9 platform skips; production guards passed.scripts/msan.sh config_toml_edit cli: 409 passed. Config fuzz: 20,000 runs, seed 1.Native macOS/Windows and full TSan results will come from GitHub CI.
Checklist
Fixes #2228.
Written with OpenAI Codex on behalf of Anton Standrik (@astandrik).