From e223dc768bd1a132d0b0ac490880c24bfb616525 Mon Sep 17 00:00:00 2001 From: Maverick0351a <210787466+Maverick0351a@users.noreply.github.com> Date: Tue, 20 Oct 2026 15:44:56 -0700 Subject: [PATCH] Wrap long Atlas claim labels on narrow screens --- WORK_LOG.md | 34 ++++++++ scripts/check_atlas_claim_wrapping.cjs | 107 +++++++++++++++++++++++++ scripts/check_atlas_selection.cjs | 2 + space/atlas-research.css | 3 + 4 files changed, 146 insertions(+) create mode 100644 scripts/check_atlas_claim_wrapping.cjs diff --git a/WORK_LOG.md b/WORK_LOG.md index ad15d5b..f20e6d9 100644 --- a/WORK_LOG.md +++ b/WORK_LOG.md @@ -1,5 +1,39 @@ # Finite graph search work log +## 2026-10-20 - Wrap long claim labels in the narrow Atlas inspector + +Post-deployment public-page inspection found horizontal page scrolling at a +390px viewport for C4 entry `n4-E16457`: the Atlas document measured 376px client +width and 534px scroll width with disclosures both closed and expanded. The +comparison claim's long identifier overflowed its summary/caption, while the +lattice diagram remained contained in its intentional horizontal scroller. + +Allow complete claim summary and caption labels to wrap with `overflow-wrap: +anywhere`, including their intrinsic minimum width. No content is hidden or +truncated; data, selection, export and the diagram scroller are unchanged. A +focused source contract now runs inside the existing CI selection checker. The +unmodified stylesheet fails it; repaired source passes 39 entries / 234 complete +labels and ten rejection controls plus two property-case positive controls. +Independent review MC-R1 reproduced three false passes for mixed-case ordinary +CSS property names; the checker now normalizes ASCII case while preserving +case-sensitive custom-property names. Original author and reviewer snapshots, +the false passes and repaired controls remain preserved in the versioned handoff. +This contract requires unconditional rules for both labels; it is not a general +CSS cascade or layout engine. + +Existing Atlas UI, map and selection checks pass (518 grouping cases, 304 +rejection witnesses, 115 filter combinations, 282 selection assertions, and 224 +color pairings). No workflow, proof or model execution changed. Exact source +snapshots, baseline failure and logs are retained in Direction's owned +`atlas-mobile-followup-2026-10-20/author` handoff and additive `author-repair-v2`. +Contributor steps 2-5 also passed: 33 root tests, the bounded 143,685-candidate +experiment, evidence validation and comparison with no mathematical differences +from the recorded release. Their unchanged-source evidence is frozen separately +in `contributor-validation` and `runs/atlas-mobile-validation-20261020T223143Z`. +Independent review and the same +closed/expanded public-browser reproduction remain required; these source tests +do not establish rendered mobile acceptance. Substantial AI assistance: Codex. + ## 2026-10-20 - Repair contrast-checker false passes after independent review Independent controls exposed CR-R1 (first declaration incorrectly winning an diff --git a/scripts/check_atlas_claim_wrapping.cjs b/scripts/check_atlas_claim_wrapping.cjs new file mode 100644 index 0000000..783feca --- /dev/null +++ b/scripts/check_atlas_claim_wrapping.cjs @@ -0,0 +1,107 @@ +/* Source contract for long claim identifiers. This does not perform layout. + * Browser acceptance must repeat the closed/open C4 inspector at 390px. + */ +'use strict'; +const assert = require('node:assert/strict'); +const fs = require('node:fs'); +const path = require('node:path'); + +function rules(css, conditional = false) { + css = css.replace(/\/\*[\s\S]*?\*\//g, ''); + const result = []; + let position = 0; + while (position < css.length) { + const open = css.indexOf('{', position); + if (open < 0) { assert(!css.slice(position).trim(), 'Complete CSS rule'); break; } + const selector = css.slice(position, open).trim(); + let end = open + 1, depth = 1; + while (end < css.length && depth) { + if (css[end] === '{') depth++; + if (css[end] === '}') depth--; + end++; + } + assert.equal(depth, 0, 'Balanced CSS'); + const body = css.slice(open + 1, end - 1); + if (selector.startsWith('@')) { + assert(selector.startsWith('@media'), 'Only existing media at-rules are modeled'); + result.push(...rules(body, true)); + } else { + const declarations = body.split(';').filter(part => part.trim()).map(part => { + const colon = part.indexOf(':'); + assert(colon > 0, 'Complete CSS declaration'); + const property = part.slice(0, colon).trim(); + // Ordinary property names are ASCII case-insensitive; custom names are not. + const key = property.startsWith('--') ? property : property.replace(/[A-Z]/g, letter => letter.toLowerCase()); + return [key, part.slice(colon + 1).trim()]; + }); + for (const part of selector.split(',')) result.push({selector: part.trim().replace(/\s+/g, ' '), conditional, declarations}); + } + position = end; + } + return result; +} + +function wrappingContract(css) { + const parsed = rules(css); + for (const selector of ['#entry-claims summary', '#entry-claims caption']) { + const applicable = parsed.filter(rule => rule.selector === selector); + // Deliberately an explicit, conservative source contract, not a CSS engine: + // a universal rule is required so narrow and desktop labels both wrap. + assert(applicable.some(rule => !rule.conditional && rule.declarations.some(([key, value]) => key === 'overflow-wrap' && value === 'anywhere')), + `Long claim label needs unconditional anywhere wrapping: ${selector}`); + for (const rule of applicable) { + for (const [key, value] of rule.declarations) { + if (key === 'overflow-wrap') assert.equal(value, 'anywhere', `No conflicting label wrap: ${selector}`); + if (key === 'white-space') assert.equal(value, 'normal', `No unbreakable label whitespace: ${selector}`); + if (['overflow', 'overflow-x'].includes(key)) assert.equal(value, 'visible', `Do not clip or scroll claim labels: ${selector}`); + } + } + } + return true; +} + +function checkAtlasClaimWrapping(root) { + const read = name => fs.readFileSync(path.join(root, name), 'utf8'); + const html = read('space/atlas.html'); + const styles = [...html.matchAll(/]*rel="stylesheet"[^>]*href="([^"]+)"/g)].map(match => match[1]); + assert.deepEqual(styles, ['atlas.css', 'atlas-research.css'], 'Actual stylesheet order'); + const css = styles.map(name => read(`space/${name}`)).join('\n'); + wrappingContract(css); + const app = require(path.join(root, 'space/atlas.js')); + const data = JSON.parse(read('space/atlas-data.json')); + const registry = JSON.parse(read('space/atlas-claims.json')); + let labels = 0; + for (const entry of data.entries) { + const markup = app.claimsHtml(registry, entry); + for (const claim of app.claimsForEntry(registry, entry)) { + assert(markup.includes(`Inspect ${claim.id}: hypotheses, citations and evidence gates`), 'Exact complete claim ID remains in summary'); + assert(markup.includes(`Evidence supplied for ${claim.id}`), 'Exact complete claim ID remains in caption'); + labels += 2; + } + } + const comparison = app.claimsForEntry(registry, data.entries.find(entry => entry.id === 'n4-E16457')).find(claim => claim.kind === 'same_shape_comparison'); + assert(comparison && /[a-f0-9]{64}/.test(comparison.id), 'Retain the actual long C4 comparison identifier from the live reproduction'); + // These reject missing caption/summary coverage, break-word (which does not + // lower min-content width), a viewport-only patch, and later contradictory rules. + const good = '#entry-claims summary,#entry-claims caption{overflow-wrap:anywhere}'; + const rejected = [ + '#entry-claims summary{overflow-wrap:anywhere}', + '#entry-claims caption{overflow-wrap:anywhere}', + good.replace('anywhere', 'break-word'), + `@media(max-width:760px){${good}}`, + good + '#entry-claims caption{white-space:nowrap}', + good + '#entry-claims summary{overflow-wrap:normal}', + good + '#entry-claims caption{overflow:hidden}', + good + '#entry-claims caption{WHITE-SPACE:nowrap}', + good + '#entry-claims summary{Overflow-Wrap:normal}', + good + '#entry-claims caption{OVERFLOW-X:hidden}', + ]; + for (const broken of rejected) assert.throws(() => wrappingContract(broken), assert.AssertionError); + assert(wrappingContract(good.replace('overflow-wrap', 'OVERFLOW-WRAP')), 'Uppercase ordinary property retains the valid rule'); + assert.deepEqual(rules('#entry-claims caption{--MixedCase:A;--mixedcase:B}')[0].declarations, + [['--MixedCase', 'A'], ['--mixedcase', 'B']], 'Distinct custom-property names preserve case (MC-R1)'); + console.log(`Atlas claim wrapping source contract: ${data.entries.length} entries, ${labels} exact labels, ${rejected.length} rejection controls, two property-case positive controls. No browser layout or mobile acceptance is inferred.`); + return {entries: data.entries.length, labels, rejectionControls: rejected.length, propertyCasePositives: 2}; +} +module.exports = {wrappingContract, checkAtlasClaimWrapping}; +if (require.main === module) checkAtlasClaimWrapping(path.resolve(process.argv[2] || path.join(__dirname, '..'))); diff --git a/scripts/check_atlas_selection.cjs b/scripts/check_atlas_selection.cjs index 2a0cce3..51ea7de 100644 --- a/scripts/check_atlas_selection.cjs +++ b/scripts/check_atlas_selection.cjs @@ -5,6 +5,7 @@ const fs = require('node:fs'); const path = require('node:path'); const vm = require('node:vm'); const {checkAtlasContrast} = require('./check_atlas_contrast.cjs'); +const {checkAtlasClaimWrapping} = require('./check_atlas_claim_wrapping.cjs'); const root = path.resolve(process.argv[2] || path.join(__dirname, '..')); const read = name => fs.readFileSync(path.join(root, name), 'utf8'); const data = JSON.parse(read('space/atlas-data.json')); @@ -169,5 +170,6 @@ try { const claimsHtml=app.claimsHtml(registry,data.entries[0]); ok(claimsHtml.includes('')&&claimsHtml.includes('scope="col"')&&claimsHtml.includes('scope="row"'),'Evidence table semantics'); checkAtlasContrast(root); + checkAtlasClaimWrapping(root); console.log(`Selection/inspector checks passed: ${checks} assertions; real headless Cytoscape + explicit DOM fixture; 39 exact entry IDs; native fallback and renderer-error paths; text contrast >= ${minText.toFixed(2)}:1, boundary contrast >= ${minBoundary.toFixed(2)}:1. Browser layout, assistive technology and canvas rendering NOT tested.`); } finally { charts.forEach(chart=>chart.destroy()); } diff --git a/space/atlas-research.css b/space/atlas-research.css index 9ed1d90..55708fd 100644 --- a/space/atlas-research.css +++ b/space/atlas-research.css @@ -33,6 +33,9 @@ h1 em{font-style:normal}.hero .lead{font-size:1.05rem;max-width:720px} #entry-claims{margin:20px 0;padding:22px 0;border-block:1px solid var(--line);min-width:0} #entry-claims h4{font-size:1.1rem;margin:0 0 12px}#entry-claims h5{font-size:.88rem;margin:0 0 8px}#entry-claims h6{font-size:.85rem;margin:20px 0 9px} #entry-claims p,#entry-claims li,#entry-claims summary{font-size:.82rem} +/* Comparison IDs also occur outside code/cells. Allow their full labels to + wrap and reduce caption min-content width; keep diagrams/code scrollable. */ +#entry-claims summary,#entry-claims caption{overflow-wrap:anywhere} #entry-claims code{overflow-wrap:anywhere;white-space:normal;font-size:.75rem} #entry-claims pre{white-space:pre;max-height:310px} #entry-claims dl{display:grid;grid-template-columns:minmax(110px,1fr) minmax(0,2fr);gap:8px 16px;font-size:.78rem}