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(`