Skip to content

Turn any idea, plan, or codebase into a beautiful interactive diagram. An agent skill for Claude Code, Codex, and more.

Merge remote-tracking branch 'origin/dev' into codex/pr411-dev-integration

tt-a1ib44f8e4e085f
diff --cc CHANGELOG.md
index 77490883,aca2631b..dc684734
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -7,7 -7,12 +7,13 @@@ All notable changes are documented here
> Development identity: `v2.17.0-dev.1`. Not a stable release.
### Fixed
- - **Text-presentation selectors no longer halve a wide glyph.** `textUnits` measured a `U+FE0E` (VS15) sequence as one unit for every base, so any East Asian Wide character followed by the selector was counted at half its advance. Shared node, boundary, legend, lane, and connection-label measurement now reads VS15 as a presentation choice that leaves the base's width untouched, while `U+FE0F` (VS16) keeps forcing the square emoji advance. Labels that overflowed their node while the layout receipt still read clean are now rejected with the same measurement as the identical label written without the selector.
++- **Conservative VS15 text-width estimates.** Text-presentation selectors retain the base character's estimated width instead of forcing every sequence to one unit. This prevents wide labels, including CJK text whose font ignores VS15, from passing layout checks at half their estimated width. Actual glyph widths remain font-dependent; some text-presentation labels may now need more space. VS16 emoji estimates and text without selectors are unchanged.
+ - **Readable renderer failures.** `render` and direct renderer entry points format classified input, schema, layout, and output failures without Node stacks. Filesystem failures identify the failing operation instead of labelling output errors as unreadable input; successful artifact bytes and existing validation/delivery receipt formats remain unchanged.
+ - **Architecture Delta baseline arrowheads (#433).** Removed and rerouted baseline relationships retain their marker definitions in the composed Delta SVG, preserving their authored direction alongside current relationships.
+ - **Compare rollback recovery (#438).** If restoring a previous output fails, compare preserves its recovery directory and reports backup-to-target paths instead of deleting the remaining backups during cleanup.
+ - **固定提交的来源校验 (#420)。** 校验忽略本地 Git replacement refs,始终读取指定提交的原始对象,避免替换后的文件或行范围造成误接受或误拒绝;保留原有来源链接、诊断与用户 Git 配置。
+ - **导出的独立 SVG 声明 UTF-8 编码。** 架构图「下载 SVG」和架构对比(compare)导出的 SVG 文档现在以 `<?xml version="1.0" encoding="UTF-8"?>` 声明开头;缺少声明时,部分消费方不按 XML 规范默认 UTF-8 而猜测编码,导致中文等非 ASCII 文本乱码。
+ - **Compare 输入快照一致性 (#400)。** 原始输入校验使用首次读取的字节快照,使其与回执哈希和差异计算保持一致;读取后原文件发生变化不会影响本次比较,非法原始字段仍会被拒绝。
- **DSH plugin refresh.** Adapter 0.2.0 pins the current Archify development snapshot, includes the newer runtime and CLI fixes, and targets DSH 0.1.2-rc.1. Release metadata replaces the frozen 0.1.0 packaging source; the tarball uses the canonical clean-Skill stager and documents independent plugin upgrades.
- **Machine-readable CLI argument failures (#330).** `validate --json` and `deliver --json` now keep invalid or missing option values, unknown options and diagram types, unsupported option combinations, and usage errors inside one versioned failure receipt on stdout. These failures use the `arguments` stage, stable diagnostic codes, and exit status 2, while human-mode stderr behavior remains unchanged.
- **Complete artifact-check receipts (#311).** The checker now lets stdout drain before exiting, so large JSON receipts remain complete through pipes. Validation, delivery, and architecture comparison retain their original success/failure status without truncated-JSON errors.
diff --cc archify.zip
index 8dcf71d0,8fdba970..b4189017
Binary files differ
diff --cc archify/renderers/shared/utils.mjs
index 468aa8d6,83075183..5226844a
--- a/archify/renderers/shared/utils.mjs
+++ b/archify/renderers/shared/utils.mjs
@@@ -200,28 -200,21 +200,16 @@@ export function applyTemplate(template
// ranges because V8 has no \p{East_Asian_Width=W} property escape.
const FULLWIDTH_RE = /[\u1100-\u115F\u231A-\u231B\u2329-\u232A\u23E9-\u23EC\u23F0\u23F3\u25FD-\u25FE\u2614-\u2615\u2630-\u2637\u2648-\u2653\u267F\u268A-\u268F\u2693\u26A1\u26AA-\u26AB\u26BD-\u26BE\u26C4-\u26C5\u26CE\u26D4\u26EA\u26F2-\u26F3\u26F5\u26FA\u26FD\u2705\u270A-\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B-\u2B1C\u2B50\u2B55\u2E80-\uA4CF\uA960-\uA97C\uAC00-\uD7A3\uF900-\uFAFF\uFE10-\uFE19\uFE30-\uFE6F\uFF01-\uFF60\uFFE0-\uFFE6\u{16FE0}-\u{18DFF}\u{1AFF0}-\u{1AFFF}\u{1B000}-\u{1B2FF}\u{1F000}-\u{1FAFF}\u{20000}-\u{3FFFD}]/u;
--// A variation selector (U+FE00-U+FE0F) carries no advance of its own: it
- // re-presents the character before it. Only VS16 (U+FE0F) changes the advance:
- // it asks for emoji presentation, which renders at the square emoji advance
- // whatever the base was worth on its own -- otherwise widening the
- // emoji-presentation bases above turns U+2B50 U+FE0F from two units into three
- // while the glyph on screen stays one square, and leaves U+2708 U+FE0F at two
- // only because its base happens to be narrow.
- //
- // VS15 (U+FE0E) asks for text presentation, which selects the monochrome glyph
- // without touching the base's East Asian Width -- the property FULLWIDTH_RE
- // above encodes, and the only thing this function measures. So a VS15 sequence
- // is worth exactly its base: U+2708 U+FE0E stays one unit because U+2708 is
- // Neutral, while U+2B50 U+FE0E stays two because U+2B50 is Wide. Reading VS15
- // as "renders narrow" instead halved every Wide base it followed, and
- // under-measuring is the direction that spills a label out of its box while
- // the layout receipt still reads clean.
-// re-presents the character before it. VS15 (U+FE0E) asks for text
-// presentation, which renders narrow; VS16 (U+FE0F) asks for emoji
-// presentation, which renders at the square emoji advance. So a base plus a
-// selector is measured from the selector, not from the base -- otherwise
-// widening the emoji-presentation bases above turns U+2B50 U+FE0F from two
-// units into three while the glyph on screen stays one square, and leaves
-// U+2708 U+FE0F at two only because its base happens to be narrow.
--//
--// A selector following a base that cannot take emoji presentation is
--// malformed input; measuring it wide is the safe direction here, since
--// over-measuring pads a box while under-measuring spills the label out of it.
++// Variation selectors contribute no separate unit. This is a conservative
++// width estimate, not a measurement of the selected glyph: its actual advance
++// depends on the font and presentation (Unicode UAX #11).
++// VS16 requests emoji presentation, so reserve two units for the sequence.
++// VS15 retains the base's width estimate; forcing every text-presentation
++// sequence to one unit undercounts wide bases, including CJK characters whose
++// font ignores that selector. Neutral bases remain one unit. Some selected
++// text glyphs can be narrower than this estimate; prefer extra space to overflow.
const VARIATION_SELECTOR_FIRST = 0xfe00;
const VARIATION_SELECTOR_LAST = 0xfe0f;
-const VARIATION_SELECTOR_TEXT = 0xfe0e;
const VARIATION_SELECTOR_EMOJI = 0xfe0f;
export function textUnits(text) {
diff --cc archify/test/geometry.test.mjs
index 1259313e,768f8a50..12e6efdd
--- a/archify/test/geometry.test.mjs
+++ b/archify/test/geometry.test.mjs
@@@ -626,7 -636,7 +636,7 @@@ test('textUnits counts emoji-presentati
assert.equal(textUnits('꥽'), 1);
});
--test('textUnits measures a variation-selector sequence from the selector', () => {
++test('textUnits estimates variation-selector sequences without counting selectors separately', () => {
// VS16 asks for emoji presentation: the pair renders as one square, so it
// must stay two units even though the base is now counted wide on its own.
assert.equal(textUnits('⭐️'), 2); // star
@@@ -637,39 -647,15 +647,37 @@@
// renders as a square and is two units, not one.
assert.equal(textUnits('✈️'), 2); // airplane
assert.equal(textUnits('❤️'), 2); // red heart
- // VS15 asks for text presentation. That picks the monochrome glyph without
- // changing the base's East Asian Width, so the sequence is worth its base.
- // VS15 asks for text presentation, which renders narrow.
- assert.equal(textUnits('⭐︎'), 1);
- assert.equal(textUnits('✈︎'), 1);
++ // VS15 retains the base width estimate; actual font advances may differ.
+ assert.equal(textUnits('✈︎'), 1); // airplane: U+2708 is Neutral
+ assert.equal(textUnits('⭐︎'), 2); // star: U+2B50 is Wide
// The selector never adds width of its own, alone or in a run.
assert.equal(textUnits('️'), 0);
assert.equal(textUnits('✅️ Done'), 7);
assert.equal(textUnits('⭐️⭐️'), 4);
});
+test('textUnits keeps a Wide base wide when VS15 asks for text presentation', () => {
+ // Regression: VS15 was read as "renders narrow" and applied to the sequence
+ // rather than to the base, so every Wide base it followed was measured at
- // half its advance. A zero-advance selector must never shrink the glyph in
- // front of it -- that under-measures the label and spills it out of its node
- // while the layout receipt still reads clean.
++ // half its estimated width. In particular, a CJK font may ignore VS15,
++ // leaving a wide glyph that the former one-unit estimate undercounted.
+ for (const base of ['⭐', '❗', '⛔', '⚓', '⚡', '✅', '⭕', '㊙', '〽', '中']) {
+ assert.equal(textUnits(base + '︎'), textUnits(base), `VS15 changed the width of ${JSON.stringify(base)}`);
+ assert.equal(textUnits(base + '︎'), 2);
+ }
+ // Neutral bases are unaffected: they were already worth one unit.
+ for (const base of ['✈', '™', '☀', '☎']) {
+ assert.equal(textUnits(base + '︎'), 1);
+ }
+ // VS16 still forces the square emoji advance, whatever the base is worth.
+ assert.equal(textUnits('✈️'), 2);
+ assert.equal(textUnits('⭐️'), 2);
+ // A run of Wide bases carrying VS15 measures the same as the run without it.
+ const run = '⭐❗⛔⚓⚡';
+ assert.equal(textUnits(Array.from(run).map((c) => c + '︎').join('')), textUnits(run));
+ assert.equal(textUnits(run), 10);
+});
+
test('semantic sigils cover every component and lifecycle kind without literal color', () => {
const kinds = [
'frontend', 'backend', 'database', 'cloud', 'security', 'messagebus', 'external',