fix Roman numeral start of count, manual update, Roman counting test
authorThomas Walker Lynch <eknp9n@reasoningtechnology.com>
Tue, 30 Jun 2026 09:07:33 +0000 (09:07 +0000)
committerThomas Walker Lynch <eknp9n@reasoningtechnology.com>
Tue, 30 Jun 2026 09:07:33 +0000 (09:07 +0000)
developer/authored/Manuscript.copy/Document/manual.html
developer/authored/Manuscript.copy/Element/constraint.js [deleted file]
developer/authored/Manuscript.copy/Element/counter.js
developer/authored/Manuscript.copy/Element/crossref.js [deleted file]
developer/authored/Manuscript.copy/Theme/inverse_wheat.js

index bf37759..add892a 100644 (file)
@@ -17,7 +17,7 @@
 
       <RT·title 
         author="Thomas Walker Lynch" 
-        date="2026-06-26 09:35Z" 
+        date="2026-06-30 16:49Z" 
         title="RT Style System: Reference Manual"
         copyright="2026 Reasoning Technology">
       </RT·title>
               </div>
             </td>
           </tr>
-          <tr>
-            <td><RT·code>&lt;RT·term-index&gt;</RT·code></td>
-            <td>Inserts a list of the terms used in the paper and the pages they occur on.</td>
-          </tr>
           <tr>
             <td><RT·code>&lt;RT·endnotes&gt;</RT·code></td>
             <td>Inserts a compiled list of the endnotes.</td>
               </div>
             </td>
           </tr>
-          <tr>
-            <td><RT·code>&lt;RT·term-em&gt;</RT·code></td>
-            <td>Forces visual emphasis for a term subsequent to its first occurrence.</td>
-          </tr>
-          <tr>
-            <td><RT·code>&lt;RT·neologism&gt;</RT·code></td>
-            <td>Project specific vocabulary. Styled distinctly from conventional terms. Auto-generates an anchor ID prefixed with "def-neo-".</td>
-          </tr>
-          <tr>
-            <td><RT·code>&lt;RT·neologism-em&gt;</RT·code></td>
-            <td>Forces visual emphasis for a neologism subsequent to its first occurrence.</td>
-          </tr>
           <tr>
             <td><RT·code>&lt;RT·code&gt;</RT·code></td>
             <td>Code span or pre formatted code block with theme aware borders. Automatically dedents block content.</td>
             <td><RT·code>&lt;RT·symbol&gt;</RT·code></td>
             <td>Technical symbol wrapper enforcing strict font weight and character spacing.</td>
           </tr>
-          <tr>
-            <td><RT·code>&lt;RT·constraint&gt;</RT·code></td>
-            <td>Highlights architectural limits or hard requirements in a distinct block.</td>
-          </tr>
         </tbody>
       </table>
 
       <h3>Declarative Counters</h3>
+      <p>
+        The counter object establishes an isolated state machine. It separates the strict numerical sequence data from the visual formatting layer, permitting precise state queries alongside heavily customizable output formatting.
+      </p>
       <table>
         <thead>
           <tr>
               <div class="attr-list">
                 <strong>Attributes:</strong><br>
                 <code>counter</code>: Required identifier.<br>
-                <code>style</code>: "Natural", "roman", "Roman", "alpha", "Alpha", or "roman-outline". (Default: "Natural")<br>
-                <code>on-first-step</code>: The starting value. (Default: "1")<br>
-                <code>separator</code>: The string separating depth counts. (Default: ".")<br>
-                <code>separator-placement</code>: "embedded" or "embedded-after". (Default: "embedded")
+                <code>style</code>: A comma-separated list defining the formatting at each depth. Valid options: "NaturalNumber", "CountingNumber", "Roman", "roman", "Alpha", "alpha". The keyword "outline" maps to a standard mixed array. (Default: "NaturalNumber")<br>
+                <code>on-first-step</code>: The initial starting value, supplied in the format of the top-level style. (Default: "0")<br>
+                <code>separator</code>: The string joining depth sequence segments. (Default: ".")<br>
+                <code>separator-placement</code>: "embedded" or "embedded-after". (Default: "embedded")<br>
+                <code>mode</code>: "scoped" (omits the rightmost sequence digit when reading outside a closed node) or "milestone" (reports the full completed sequence path). (Default: "scoped")
               </div>
             </td>
           </tr>
           <tr>
             <td><RT·code>&lt;RT·Counter·step&gt;</RT·code></td>
             <td>
-              Advances the counter from empty or increments to the next ordinal address.<br>
-              <div class="attr-list">
-                <strong>Attributes:</strong><br>
-                <code>counter</code>: Required identifier.
-              </div>
-            </td>
-          </tr>
-          <tr>
-            <td><RT·code>&lt;RT·Counter·indent&gt;</RT·code></td>
-            <td>
-              Scope within tag pairs counts at a new depth. Must be closed with <code>&lt;/RT·Counter·indent&gt;</code>.<br>
+              Advances the counter state. When applied as a parent tag, the contents within its scope define a sub-level; the machine automatically pushes into a nested depth on entry and pops back to the parent container upon exit.<br>
               <div class="attr-list">
                 <strong>Attributes:</strong><br>
                 <code>counter</code>: Required identifier.
           <tr>
             <td><RT·code>&lt;RT·Counter·snapshot&gt;</RT·code></td>
             <td>
-              Deep copies the active count and styling parameters to a dictionary key.<br>
+              Clones the entire active state machine, including its current 0-indexed numerical array, operational status, and presentation configurations, saving it to a dictionary key.<br>
               <div class="attr-list">
                 <strong>Attributes:</strong><br>
                 <code>counter</code>: Required identifier.<br>
           <tr>
             <td><RT·code>&lt;RT·Counter·read&gt;</RT·code></td>
             <td>
-              Reads a field from a snapshot as innerHTML. A snapshot can be recalled from anywhere in the document.<br>
+              Recalls information from a snapshot and outputs it as innerHTML. A snapshot can be recalled from anywhere in the document.<br>
               <div class="attr-list">
                 <strong>Attributes:</strong><br>
                 <code>snapshot</code>: Required snapshot name.<br>
-                <code>key</code>: The state property to read. (Default: "count")
+                <code>key</code>: The state property to read. Dot-notation permits querying nested attributes (e.g., "count.status", "count.list"). Querying "count" outputs the style-mapped, separator-joined visual string. (Default: "count")
               </div>
             </td>
           </tr>
           </tr>
         </thead>
         <tbody>
-          <tr>
-            <td><RT·code>&lt;RT·crossref&gt;</RT·code></td>
-            <td>Context aware internal anchor link. Visual styling applied automatically.</td>
-          </tr>
           <tr>
             <td><RT·code>&lt;RT·endnote&gt;</RT·code></td>
             <td>Tag pair contents added as an item to the endnote list. Replaces the inline text with an anchor link.</td>
           </tr>
-          <tr>
-            <td><RT·code>&lt;RT·footnote&gt;</RT·code></td>
-            <td>Tag pair contents are automatically extracted and appended to the bottom of the active printed page container.</td>
-          </tr>
         </tbody>
       </table>
 
diff --git a/developer/authored/Manuscript.copy/Element/constraint.js b/developer/authored/Manuscript.copy/Element/constraint.js
deleted file mode 100644 (file)
index 41b12c7..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-// developer/authored/RT/element/constraint.js
-(function() {
-
-  if (!RT) {
-    console.error("RT not defined – was RT-Manuscript_make run?");
-    return;
-  }
-  if (!RT.Element) {
-    console.error("RT.Element not defined – was the state_manager run?");
-    return;
-  }
-
-  RT.Element.add( function(){
-    document.querySelectorAll('RT·constraint').forEach( (el) => {
-      el.style.display = 'block';
-      el.style.borderLeft = `4px solid ${RT.theme('read', 'state', 'warning')}`;
-      el.style.backgroundColor = RT.theme('read', 'surface', '1');
-      el.style.padding = '1rem';
-      el.style.margin = '1.5rem 0';
-      el.style.color = RT.theme('read', 'content', 'main');
-    });
-  });
-
-})();
-
index 2c00aca..94d355e 100644 (file)
     write(dict) {
       for (const [key, value] of Object.entries(dict)) {
         if (key === 'style') {
-          this.style = Array.isArray(value) ? value : [value];
+          let parsed = Array.isArray(value) ? value : [value];
+          if (parsed.length === 1 && parsed[0] === 'outline') {
+            parsed = ['Roman', 'Alpha', 'roman', 'alpha', 'CountingNumber'];
+          }
+          this.style = parsed;
         } else if (key === 'Count' || key === 'count') {
           // Support copying from another CounterMachine or Count object
           const source_count = value instanceof CounterMachine ? value.count : (value instanceof Count ? value : null);
     from_roman(val) { return this.from_Roman(val.toUpperCase()); }
 
     to_Roman(num) {
-      if (num < 1) return num.toString();
+      let n = num + 1; // 0-indexed to 1-indexed
+      if (n < 1) return n.toString();
       const lookup = {M:1000, CM:900, D:500, CD:400, C:100, XC:90, L:50, XL:40, X:10, IX:9, V:5, IV:4, I:1};
       let roman = '';
       for (let i in lookup) {
-        while (num >= lookup[i]) {
+        while (n >= lookup[i]) {
           roman += i;
-          num -= lookup[i];
+          n -= lookup[i];
         }
       }
       return roman;
           i++;
         }
       }
-      return num;
+      return Math.max(0, num - 1); // 1-indexed to 0-indexed
     }
 
     to_Alpha(num) { return String.fromCharCode(65 + num); }
 
           const on_first_step_str = node.getAttribute('on-first-step');
           if (on_first_step_str) {
-            const top_style = parsed_style[0];
+            const top_style = RT.dict_instance[name].style[0];
             const method_name = `from_${top_style}`;
             const active_machine = RT.dict_instance[name];
             const initial_val = typeof active_machine[method_name] === 'function' 
diff --git a/developer/authored/Manuscript.copy/Element/crossref.js b/developer/authored/Manuscript.copy/Element/crossref.js
deleted file mode 100644 (file)
index bf7cded..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
-  Processes <rt·crossref> tags.
-  Applies default styling and interaction cues using the active RT theme.
-*/
-
-(function() {
-
-  if (!window.RT) {
-    console.error("RT not defined - was RT-Manuscript_make run?");
-    return;
-  }
-  if (!window.RT.Element) {
-    console.error("RT.Element not defined - was the state_manager run?");
-    return;
-  }
-
-  RT.Element.add( function() {
-    const debug = window.RT.Debug || { log: function(){} };
-    if (debug.log) debug.log('crossref', 'Processing cross-references');
-
-    document.querySelectorAll('rt·crossref').forEach( (el) => {
-      el.style.color = window.RT.theme('read', 'brand', 'link');
-      el.style.textDecoration = 'underline';
-      el.style.cursor = 'pointer';
-      el.style.fontWeight = '500';
-    });
-  });
-
-})();
index 5c5c05a..d4e72a8 100644 (file)
@@ -1,4 +1,4 @@
-// Theme/inverse_wheat_DS.js
+// Theme/inverse_wheat.js
 
 window.RT = window.RT || {};
 window.RT.theme_library = window.RT.theme_library || {};
@@ -6,7 +6,7 @@ window.RT.theme_library = window.RT.theme_library || {};
 window.RT.theme_library['inverse_wheat'] = {
   meta: {
     is_dark: true,
-    name: "inverse_wheat_DS"
+    name: "inverse_wheat"
   },
   surface: {
     0: "oklch(0.157 0 0)",