tom_som_dart_runtime 1.6.20
tom_som_dart_runtime: ^1.6.20 copied to clipboard
TomSpecs Specification Object Model — generic Dart runtime. The language-independent, hand-written runtime shared by every generated typed `tom_som_dart_v0` facade and the TomSpecs editor: the path-ke [...]
Changelog #
1.6.20 #
SpecReviewAnnotations.paragraphs(path:, field:)lists a value's paragraphs (SpecParagraph: index, start and end line, text, and the annotation kind when the paragraph is an annotation block). The index is exactly whatafterParagraphof the inserts takes, by the one rule of SOM §11.9.1 "Paragraphs". Conformance: a newannotation_cases.jsoncase.
1.6.19 #
- Question options (SOM §11.9.2): a question annotation lists its
options(SpecQuestionOption: letter, text with continuation lines joined, bold), itsrecommendedletter (the bold option, else the option that says "recommended", else the letter of a*Recommendation:*line) and itsanswerLetter((b)or**(b)**at the start of the answer).SpecQuestionDraft.recommendedwrites that option bold. Conformance: a newannotation_cases.jsoncase.
1.6.18 #
- Answers for a step folder (SOM §11.9.7):
extractAnswerscollects a document's (or a subtree's) answered and open questions, comments and inline marks, in rendition order, each with its section-id chain and its line in the Markdown rendition.renderAnswerswrites them as a deterministicanswers.md, grouped per document, with optional open questions and inline marks.SpecAnswerExtract.countsgives the counts. Conformance:answer_cases.json.
1.6.17 #
- Writing changes as inline marks (SOM §11.9.3):
markChangeText(old, new)diffs by line, then by word, merging changes at most two words apart, so accepting all marks givesnewand rejecting all givesold. Words are never split and code is never marked.SpecReviewAnnotations.setMarked(a second edit updates its mark) andmarkAgainst(against an earlier version) apply it to a value. Conformance:change_mark_cases.json.
1.6.16 #
- Reviewing inline marks (SOM §11.9.3):
revision,listMarks,decideMarks(accept / reject / leave in one write, refused on a stale revision),acceptAllMarks/rejectAllMarksunder a path,removeAllAnnotations,applyInlineMarksText. Each returns aSpecMarkReportfor the decision log. Accepting and rejecting follow whitespace rules: words never join, no double space or space before punctuation, and a whole-line mark leaves no blank line. Malformed marks are left as written and reported. - Conformance:
inline_mark_cases.json(27 text cases, 5 scripted cases).
1.6.15 #
- Review annotations (SOM §11.9):
SpecReviewAnnotationslists, counts, inserts, answers, edits, resolves and strips comment blocks (> ⬆️ **C-12** (Alexis): …), question blocks (> **❓ BQ-81 — topic:**…**Answer:**, single and combined) and CriticMarkup inline marks in content and form-field values. It also assigns missingC-<n>comment ids, gives the next free id (with a floor), returns the qualified formSBP C-12, and accepts or rejects one inline mark. Every edit is byte-stable outside the annotation it touches. validateDocumentreportsannotationMisplaced,annotationMalformedandduplicateAnnotationIdas its last group.- Conformance:
annotation_cases.json(12 scripted cases) and four validation cases. Guide:doc/review_annotations.md.
1.6.14 #
multipleReferences: a reference field withoutmultiplethat holds a comma-separated list is reported; every id of a list is still resolved on its own.FormFieldSpec.multiplereads the meta flag. Conformance:multipleReferencesInSingleField,everyDanglingIdOfAList.
1.6.13 #
missingRequiredField: every form the document holds must fill itsrequiredfields — class-level forms and forms declared on a section member, in list items or not. The schema tier checked class-level forms of the rendition only. Conformance:requiredFieldsFilled,missingRequiredFieldInListItemForms,missingRequiredFieldInMemberForm(the corpus model gainsRequiredEntry).
1.6.8 #
- Version aligned with the TomSpecs model (1.6.8); no library change.
- Conformance:
decisionStateOpenValues,decisionStateRejectsBool,enumValueIsCaseSensitive— an enum field accepts its open states like any other value and rejects a bool or a token in the wrong case (enumValueUnknown). The corpus model'sRegistryEntryform gains thedecidedfield for them.
1.6.7 #
- Derived values are checked (
derivedValueMismatch): aproductOffield holds the product of its operands — numbers, or an enum's 1-based position, in the same form or a sibling form — to the precision it is written in, and arankOffield ranks the instances of its form by their score, 1 to n, highest first. countOftargets written./…count only the entries beneath the section holding the form.FormFieldSpec.productOf/FormFieldSpec.rankOfread from the meta.
1.6.6 #
- Version aligned with the TomSpecs model (1.6.6); no library change.
- Conformance:
referenceAcrossRegistries/referenceAcrossRegistriesDanglinghold a reference field that names registries of two different classes — an id either declares resolves, one neither declares is adanglingReference. The corpus model'sRegistryLinkform gains thecrossRefsfield for it.
1.6.3 #
- The markdown codec round-trips exactly:
parse(toMarkdown(doc))stages every content value, form field, list and headline at its own path (SOM §11.6, §11.7). For the tom_uam Solution Blueprint that was 86 form values, 703 content values and 20 headlines read back elsewhere or merged.- Slot markers. Where the parser could not tell an owner's id-less body
slots apart, the emitter writes
<!-- slot: <rel> -->before the slot: text after anything else in the region, a form preamble that is not the default target, a form whose labels another form shares. The parser routes the following text to that slot and ends any open field. A body that reads back without markers gets none, so most documents render unchanged. - In a region with forms, label-shaped lines of a content slot carry the escape space too, and parse strips it.
- A line break in a stored headline is written as
<br>and read back. - Blank lines inside a value are kept, in the markdown and the YAML codec
alike (SOM §11.3, §12.4);
SpecDocumentYaml.dedupEmptyLinesstays as a helper but the codec no longer applies it.
- Slot markers. Where the parser could not tell an owner's id-less body
slots apart, the emitter writes
- Pinned by the regenerated corpus: a
Demo.mixed(MIX) section with an id-less form and preamble, two id-less content slots, a second form sharing a label, a two-line headline and a value with two blank lines; and amarkdown_import_cases.jsoncase for a marker, an unknown marker and<br>.
1.6.2 #
SpecDocument.hasValuesUnderanswers from a prefix index (every stored key plus each prefix ending before a/or-), built on the first question and dropped by every mutator, instead of scanning every stored key per call. The markdown emitter, the validator and the query engine ask it once per model node, so rendering a large document was quadratic: the tom_uam Solution Blueprint (about 10,000 values) took 299 s to render andvalidate_spec6 min 41 s; they now take about 2 s and 10 s, with a byte-identical rendition. Guarded byspec_document_values_index_test.dart(VI-1: agreement with a full scan after every mutator; VI-2: 20,000 values and 20,000 queries under 2 s).
1.6.1 #
- Code fields (SOM §11.4 rule 8): a form field whose meta carries
code: true(FormFieldSpec.code,SomFormFieldMeta.code) is written as an inline code span when its value is on one line — delimited by one backtick more than the longest run inside it, padded with a space when the value begins or ends with a backtick or a space — and the markdown import unwraps the span again. A value written without a span is kept as written; a multi-line value keeps the plain rendering. Pinned by the regenerated corpus (expected.md, the newDemo.details.patternandCard.content.selectorfields, and two newmarkdown_import_cases.jsoncases).
1.5.0 #
-
Released in lockstep with
tom_specs_model1.5.0. Two changes break a caller: the YAML decode'sreviewis null when the file has noreview:key (check for null where it was read as a map), and the model renames two section ids (seetom_specs_model1.5.0). -
The CodeSpecs gate record carries Stage B's gap lines: an
insufficiententry may holdgaps:, each aCodeSpecsGateGapwithsectionId,requiredandcarrier(<section-id>.<field>) and itscodespecs_prompt.md§6.3line. The reader refuses gaps on any other verdict, an unknown key in a gap, an empty field and a malformed carrier; the writer putsgaps:afterresolution. Additive, soformatVersionstays 1. Pinned by newcodespecs_record_cases.jsoncases. -
Markdown import stores a pattern-list item's heading id even when it equals the positional pattern default (
UCE-USER-1), so the id survives a later move or insert and a document's.mdimports to the same memory as its.yaml(SOM §11.5). A pattern-less list's<member>-<n>id stays positional. Pinned by the regenerated corpus (state.json,expected.docspecs.yaml) and each v0 package's Meridian import test. -
CodeSpecsExtractorrefuses a root that is a generation projection (D13,CGP) with aCodeSpecsExtractErrornaming the root, instead of answering every area with an empty extract (codespecs_prompt.md§5). Keyed onSpecModel.isGenerationInput, the root class's@CodeSpecsProjectionmarker, never on a type name. Pinned by two newcodespecs_extract_cases.jsonroot cases. -
DocSpecs schema findings on a SOM document name the document path to fix:
SpecDocument.toMarkdownWithMap/SpecDocumentMarkdown.exportRootWithMapreturn the rendition with its heading-line → path map (SpecMarkdownRendition.pathAtLine), andvalidateSpecDocumentrenders, validates and fillsDocSpecsViolation.path(SOM §14). Pinned bydocspecs_path_cases.json. -
A typed field (
int,double,num,bool) holding text its type cannot read is no longer read as unset.validateDocumentreports it with the new codevalueTypeMismatch;SpecEditor.value/formValuethrow aFormatExceptionon it;setValue/setFormValuerefuse such a string (SOM §9). Enum fields keep their forgiving read andenumValueUnknown. Pinned byvalidation_cases.jsonandeditor_cases.json. -
An empty document encodes as
document:with its root key and an empty mapping (SBP D00SolutionBlueprint: {}) instead ofdocument: {}, so the file still records which document root it is (SOM §12.3 rule 4). Decode still acceptsdocument: {}. Pinned by a newyaml_review_cases.jsoncase. -
A list item is known by its own section id in
SpecQueryEngine: thesectionIdExact/sectionIdPrefixfilters and the projection'ssectionIduse the item's stored id, else its positional id — the id its markdown heading carries — instead of the list field's id (llm_and_d4rt_tools.md §6). A list's own id now matches the list, not its items. Pinned by four newquery_cases.jsoncases and the regeneratedprojection_cases.json. -
Breaking:
SpecYamlContents.reviewisnullwhen the file has noreview:key and a map — possibly empty — when it has one, so decode → encode no longer addsreview: {}to a document that never had a review pass (SOM §12.1). Pinned by a newyaml_review_cases.jsoncase. -
Markdown import binds the prose of a section whose only body member is a form — the class-level
@Formoncontent— as that form's preamble, where the YAML codec keeps it, instead of on the section's own path (SOM §11.6). A SOM-rendered Solution Blueprint now imports back clean on all three tiers. Pinned by a newmarkdown_import_cases.jsoncase. -
The review pass follows one scalar rule in every port (SOM §12.5): plain scalars typed by the YAML 1.2 core schema on decode, and
SpecDocumentYaml.reviewScalarwriting a float that reads back as itself —.inf,-.infand.nanfor the non-finite values, which were written asInfinityandNaNand read back as strings. Pinned by two newyaml_review_cases.jsoncases.
1.4.1 #
- No change of its own: released in lockstep with
tom_specs_model1.4.1.
1.4.0 #
-
SpecDocument.moveListItem(model, itemPath, toIndex, {toList})reorders a list item, or moves it to another list of the same element class; the section id is the identity and the path the position (SOM §9). Values travel with the item, an anonymous item keeps its old id, and a cross-list stored id must fit the destination pattern.SpecDocumentYaml.rekeyReviewre-keys the review pass with the move's path map. Pinned bylist_move_cases.jsonin all nine runtimes. -
validateDocumentreportscountMismatchwhen acountOfform field (FormFieldSpec.countOf) states a number that is not a whole number or not the number of entries the document holds (SOM §9, phase 6). Pinned by thecountMatches/countMismatchvalidation cases in all nine runtimes. -
SpecDocument.assemble(fragments)(spec_document_assembly.dart) builds one document from fragments of the same root, merging their stores field by field and refusing any place two fragments both write (SpecAssemblyOverlap). Pinned byassembly_cases.jsonin all nine runtimes (SOM §12.9). -
CodeSpecsGateruns Stage A ofcodespecs_prompt.md§4 — A1 to A5 — as one gate over (model, document, catalogue, schema), reporting each check's findings and never stopping at the first; a check that could not run is reported as not run, and the gate does not pass. A4 (required marker arguments have populated sources) and A5 (structured carriers still offered) are new; their tables come from the catalogue's newgateblock (CodeSpecsRequiredArgument,CodeSpecsCarrier,CodeSpecsFieldRef). Pinned bycodespecs_gate_cases.jsonin all nine runtimes. -
Reading Phase-4 files back (
spec_codespecs_records.dart):CodeSpecsExtract.fromYaml(the inverse oftoYaml, byte-stable; refuses an unknownformatVersionand a disagreeingentryCount);CodeSpecsGateRecordreads and writesgate.verdicts.yamlin a checked shape, withwithVerdictandcheckAgainst(catalog); andCodeSpecsExtractSet.fromFiles/fromDirectoryread a run's extracts scoped by its gate record. Errors areCodeSpecsRecordError. Pinned bycodespecs_record_cases.jsonin all nine runtimes. -
CodeSpecsAreaCatalog.stepscarries thecodespecs_mapping.md§4.4.6 authoring-step table asCodeSpecsSteprows (number,title,slice,placedBy,areaCodes), withstepNumberedandstepsFor(area). A catalogue withoutstepsstill loads, with none. Pinned bycodespecs_extract_cases.json'sstepCasesin all nine runtimes. -
DocSpecsDocument.replaceSectionBody(text, sectionId, body)replaces one DocSpecs section's own body by id and keeps every other byte (SOM §14). It refuses an unknown or duplicated id and a body that would add a heading or leave a fence open.DocSpecsDocument.allSectionswalks the section tree. Pinned bydocspecs_replace_cases.json. -
SpecDocumentYaml.encode(..., review:)writes thereview:pass back, so a runtime load followed by a save keeps a reviewed document's review state (before, the pass was decoded and silently dropped on save). The writer (writeReviewPass) is a canonical pass-through: entries by path, fields by name, decode followed by encode byte-identical.staleReviewPaths(model, document, review)reports review entries whose path no longer resolves. The TomSpecs editor's own review writer is replaced by it. Pinned byyaml_review_cases.json. -
SpecDocument.applyMarkdownResult(result, {allowRejections})applies a parsed Markdown import as a full overwrite of the roots it covers (SOM §11.7): purge, then write content, forms, lists, headlines and codeSpecs through the installed path normalizer. A result with rejections is refused unless allowed.SpecDocument.fromMarkdown(text, model)loads a fresh document and returns it with the parse report (SpecMarkdownImport). Pinned by themarkdown_apply_cases.jsoncorpus table. Every consumer that loads a spec from Markdown used to carry its own copy of this step. -
Markdown codec: a member's heading id and its transparency are read from its meta node (
sectionId, thenclassSectionId), no longer by looking up the node's class name. A wrapper section (TextSection, …) carries its owner's class name, so the lookup returned the owner's id: the text rendered under a heading the DocSpecs schema rejects (the owner nested in itself). It is now transparent (SOM §11.6) and its text goes into the owner's body. -
Validator: content stored on a wrapper section (a
sectionmember that resolves to no class) is accepted, as the YAML codec writes it there; it was reported askindMismatch. -
Both were found authoring a real Solution Blueprint, where such sections could not be written in any form that passed every tier. A new corpus case (
Notes.remarks) pins them in all nine runtimes.
1.3.3 #
- Version follows the TomSpecs model to 1.3.3, which the generated
tom_som_dart_v0facade pins. - Markdown export (SOM §11.4 rule 2): consecutive
@Formfield groups are now separated by one blank line, also after a multi-line value, so a markdown viewer renders eachFieldName: valuegroup as its own paragraph and a markdown list ending a value no longer swallows the nextField:line as a lazy continuation. Parse and the DocSpecs validator accept the layout with or without the separator; values round-trip unchanged. Exported*.mdfiles gain blank lines inside form blocks — nothing else about the format moves.
1.3.2 #
- Version realigned to TomSpecs model 1.3.2 (lockstep with
tom_som_dart_v0). - No behavioural change to the runtime itself: 1.3.2 carries a test-only fix in
tom_specs_model, whose shipped tests read a workspace sibling and crashed in a hosted install.
1.3.1 #
- Version realigned to TomSpecs model 1.3.1 (lockstep with
tom_som_dart_v0). - No behavioural change to the runtime itself; 1.3.1 corrects dependency constraints across the release set so the published chain resolves to a set that actually compiles together.
1.3.0 #
- Version realigned to TomSpecs model 1.3 (lockstep with
tom_som_dart_v0). - No behavioural change to the runtime itself: the model-side work in this
release (
ImportanceBand, and the three-band risk entries moved onto the five-band matrix) reaches consumers through the regenerated facade and metadata, both of which this runtime reads generically.
1.2.0 #
- Version realigned to TomSpecs model 1.2 (lockstep with
tom_som_dart_v0). - No behavioural change to the runtime itself: the model-side work in this release (the four value enums bound to 20 form fields) reaches consumers through the regenerated facade and metadata, both of which this runtime reads generically.
1.1.0 #
- The CodeSpecs extractor (
spec_codespecs_extract) emits extract format 3: entries additionally carry the enclosing section instance'sheadline(format 2) and the nearest enclosing list-item instance's storedinstanceId(format 3). Both fields are copy-only and additive. - Version realigned to TomSpecs model 1.1 (lockstep with
tom_som_dart_v0).
1.0.0 #
- First packaged release of the generic Dart SOM runtime.
- Version tracks the TomSpecs model version; the typed
tom_som_dart_v0facade pins the same version.