TOML editor qualification

Configuration editing uses the existing pinned CsToml 1.8.6 reader to accept source documents and verify rendered candidates. It adds no parser package and makes no change to the reader’s accepted TOML profile. The existing TOML 1.0 compatibility contract remains in force. The installed package README states that 1.0 is the default and 1.1 is optional through CsTomlSerializerOptions.Spec; the editor does not enable that option. Its NuGet metadata identifies the MIT license and upstream commit 6e3b51a9ac9b4bf8f51c9175ffa6f74cd73940ea. Reader conformance fixtures and rejection tests remain authoritative for parsing.

TomlEditor scans source spans for the requested edit. It changes a value token or the necessary named entries and table declarations. It does not serialize the whole document. Before returning a successful edit it reparses the candidate and compares the entire raw typed tree with the intended tree. A lexical mistake therefore returns config.edit.verification and the original text. Parse failures and unrepresentable values likewise return safe codes and the original text. No input values appear in these diagnostics.

The editor is repository-authored code under the repository’s Apache-2.0 license. CsToml continues as the unchanged MIT-licensed package dependency. No upstream source is copied into the editor. It uses explicit discriminated-union matches, source text operations and invariant primitive formatting. It has no dynamic code, reflection serializer or runtime secret resolution. Existing pinned CsToml/FSharp.Core trimming diagnostics remain the dependency qualification limitation; this change does not suppress them.

The transaction adapter owns encoding and atomic file installation. The editor returns text without normalizing unrelated whitespace or line endings. Missing unset results and byte-identical writes do not require installation. Syntax fixtures cover both presentation and complete semantic equality through the canonical reader.

Presentation and semantic checks

The focused tests exercise CRLF and inline comments, exact quoted and literal key spelling, dotted paths, implicit empty parent objects, complete table replacement and removal, nested inline objects, and array-of-tables replacement. Multiline strings containing comment/header characters, arrays with comments, temporal values and unrelated nonfinite numbers remain byte-identical. Candidate comparison treats two NaNs as the same typed number; ordinary F# structural equality alone would reject an unrelated edit in a document containing NaN.

Red and green checkpoints are recorded under /private/tmp/morphir-config-editing/editor/. red-01.log fails because the editor does not yet exist. Subsequent pairs record unset, insertion, missing-unset, complete table changes, inline changes, implicit-parent preservation and the NaN regression. green-08.log passes the first 17 cases. Later qualification expands this suite; the campaign delivery journal records the final counts and host-publishing results.

Unsetting the final leaf retains its parent object. If a parent existed only through dotted entries, the editor may add an explicit empty object to preserve that semantic container. Unsetting the parent itself removes its declarations and descendants. Arrays are complete values. Traversal through an array, scalar or opaque secret reference fails before rendering. Setting a complete object replaces that object’s authored entries; it does not merge the object with its previous value.

New entries are inserted after the last complete statement line in their containing table. Leading comments and indentation on the next unrelated header stay together. Existing key spelling and quote style remain intact when changing only a value. Newly rendered values use invariant types, including an explicit float marker for integral doubles and the sign of negative zero.

Final focused qualification passes 30/30 cases in editor/final.log, after formatting the owned source and test files. The build reports zero warnings and errors. The additional cases cover canonical opaque references, sign changes between positive and negative zero, typed scalar/composite roundtrips including subnormal/maximal doubles and Unicode controls, null/range rejection, BOM and 127-segment quoted paths, TOML 1.1-only syntax rejection, and all three pinned upstream TOML documents. The HTML result is under editor/results/. These are local managed checks; the campaign journal records the separate trim/native and integrated suite evidence.

Parent integration adds four passing cases for complete inline dotted subtrees, multiline array comments/partial string quotes, control escapes and safe refusal of lossy Unicode. The integrated editor count is 34; the full IO suite has 266 passing tests at this boundary.