Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,15 @@ jobs:
env:
ARCHIFY_CHROME: ${{ steps.setup-chrome.outputs.chrome-path }}
ARCHIFY_CHROME_NO_SANDBOX: '1'
- name: Install offline font test parser
run: npm ci --ignore-scripts --no-audit --no-fund
working-directory: archify
- name: Verify offline fonts and independent SVG/raster exports
run: node --test test/offline-font-browser.test.mjs
working-directory: archify
env:
ARCHIFY_CHROME: ${{ steps.setup-chrome.outputs.chrome-path }}
ARCHIFY_CHROME_NO_SANDBOX: '1'
- name: Verify all five diagram modes localize Viewer interactions
run: node --test test/i18n.test.mjs
working-directory: archify
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ All notable changes are documented here. Format loosely follows [Keep a Changelo
- **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.
- **CLI output file types (#124).** Render, deliver, preview, and compare reject non-HTML artifact targets and compare rejects non-JSON receipt targets, including through symbolic links. Explicit absolute and parent-directory outputs remain supported; internal validation and inspection continue to work.
- **Self-contained viewer typography.** Delivered HTML and SVG embed the same fixed JetBrains Mono variable-font subsets and attribution; raster exports render from those definitions instead of selecting an installed copy. Covered characters retain the bundled font offline; CJK fallback and platform rasterization can still differ. The font adds about 96 KB per standalone HTML/SVG artifact, with the full SIL Open Font License retained in the font CSS and packaged Skill.
- **License provenance in distributions.** Source and packaged Skill distributions retain Cocoon AI's exact MIT copyright notice, package staging and smoke tests fail closed when the notice or LICENSE is missing or altered, and the deterministic ZIP carries the same LICENSE bytes as the repository.
- **Third-party mark notices in distributions.** Source and packaged Skill distributions now identify the pinned Simple Icons collection, disclose all individual icon licenses recorded by that version, preserve source and brand-guideline links, and state that Archify's MIT license does not replace third-party copyright or trademark terms. Package staging and smoke tests fail closed when the notice is missing or altered.
- **Unsupported experiment source chains.** The Hivenue and Taiga Mermaid inputs and their generated derivatives are removed from the current tree because no verifiable redistribution license was available; the retained validation evidence now reports the remaining 3-source / 9-artifact set without rewriting historical results.
Expand Down
13 changes: 13 additions & 0 deletions THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,19 @@ The OpenAI vector path is recorded from the
Use remains subject to those current guidelines and any applicable trademark
rights. Its inclusion does not state or imply endorsement by OpenAI.

## JetBrains Mono

Delivered Archify viewer artifacts embed the JetBrains Mono variable font
subsets served by Google Fonts. For characters covered by these subsets, font
selection does not depend on a network request or a locally installed copy.
Uncovered characters (including CJK) still use the system fallback stack;
browser and operating-system rasterization can differ.
JetBrains Mono is maintained at
[github.com/JetBrains/JetBrainsMono](https://github.com/JetBrains/JetBrainsMono)
and is distributed under the SIL Open Font License 1.1. The complete license
text is preserved in `assets/JetBrainsMono-OFL.txt` in the packaged Skill and
in the font CSS carried by standalone HTML and SVG exports.

## No additional rights granted

Brand names, logos, and trademarks remain the property of their respective
Expand Down
Binary file modified archify.zip
Binary file not shown.
13 changes: 13 additions & 0 deletions archify/THIRD_PARTY_NOTICES.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,19 @@ The OpenAI vector path is recorded from the
Use remains subject to those current guidelines and any applicable trademark
rights. Its inclusion does not state or imply endorsement by OpenAI.

## JetBrains Mono

Delivered Archify viewer artifacts embed the JetBrains Mono variable font
subsets served by Google Fonts. For characters covered by these subsets, font
selection does not depend on a network request or a locally installed copy.
Uncovered characters (including CJK) still use the system fallback stack;
browser and operating-system rasterization can differ.
JetBrains Mono is maintained at
[github.com/JetBrains/JetBrainsMono](https://github.com/JetBrains/JetBrainsMono)
and is distributed under the SIL Open Font License 1.1. The complete license
text is preserved in `assets/JetBrainsMono-OFL.txt` in the packaged Skill and
in the font CSS carried by standalone HTML and SVG exports.

## No additional rights granted

Brand names, logos, and trademarks remain the property of their respective
Expand Down
93 changes: 93 additions & 0 deletions archify/assets/JetBrainsMono-OFL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Copyright 2020 The JetBrains Mono Project Authors (https://github.com/JetBrains/JetBrainsMono)

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
https://openfontlicense.org


-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
159 changes: 139 additions & 20 deletions archify/assets/template.html

Large diffs are not rendered by default.

159 changes: 139 additions & 20 deletions archify/examples/dataflow-product-analytics.html

Large diffs are not rendered by default.

159 changes: 139 additions & 20 deletions archify/examples/lifecycle-agent-run.html

Large diffs are not rendered by default.

159 changes: 139 additions & 20 deletions archify/examples/sequence-cache-miss-request.html

Large diffs are not rendered by default.

159 changes: 139 additions & 20 deletions archify/examples/web-app-rendered.html

Large diffs are not rendered by default.

159 changes: 139 additions & 20 deletions archify/examples/workflow-agent-tool-call-rendered.html

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion archify/test/brand-marks.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test('third-party notices cover every recorded individual mark license', () => {
const notices = fs.readFileSync(path.join(skillRoot, 'THIRD_PARTY_NOTICES.md'), 'utf8');
const licensedMarks = BRAND_MARKS.filter((mark) => mark.provenance?.license);

assert.equal(THIRD_PARTY_NOTICE_DISCLOSURE_COUNT, 34, 'notice contract changed without review');
assert.equal(THIRD_PARTY_NOTICE_DISCLOSURE_COUNT, 39, 'notice contract changed without review');
assert.deepEqual(validateThirdPartyNotices(notices), { ok: true, missing: [] });
assert.equal(licensedMarks.length, 8, 'pinned Simple Icons license inventory changed');
for (const mark of licensedMarks) {
Expand Down
33 changes: 33 additions & 0 deletions archify/test/clean-skill-staging.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -289,3 +289,36 @@ test('clean staging reports the Git spawn error when Git cannot start', () => {
fs.rmSync(root, { recursive: true, force: true });
}
});

// Historical DSH snapshots predate embedded fonts and must remain packageable.
for (const fontPath of [null, 'archify/assets/template.html', 'archify/examples/standalone.html']) {
const embedded = fontPath !== null;
test(`clean staging applies font disclosures to snapshot contents (fontPath=${fontPath})`, () => {
const root = repositoryFixture();
const destination = path.join(root, 'staged-skill');
try {
const legacy = canonicalNotices.replace(/## JetBrains Mono[\s\S]*?(?=\n## |$)/, '');
write(root, 'THIRD_PARTY_NOTICES.md', legacy);
write(root, 'archify/THIRD_PARTY_NOTICES.md', legacy);
write(root, 'archify/assets/template.html', '<html>legacy viewer</html>');
if (embedded) write(root, fontPath, '@font-face { src: url(data:font/woff2;base64,fixture); }');
write(root, 'archify/assets/JetBrainsMono-OFL.txt', 'fixture license');
git(root, ['add', '.']);
if (embedded) {
assert.throws(() => stageCleanSkill({ repoRoot: root, destination }), /missing required disclosure: JetBrains Mono/);
assert.equal(fs.existsSync(destination), false);
write(root, 'THIRD_PARTY_NOTICES.md', canonicalNotices);
write(root, 'archify/THIRD_PARTY_NOTICES.md', canonicalNotices);
stageCleanSkill({ repoRoot: root, destination });
assert.equal(fs.readFileSync(path.join(destination, 'assets/JetBrainsMono-OFL.txt'), 'utf8'), 'fixture license');
fs.rmSync(destination, { recursive: true });
fs.unlinkSync(path.join(root, 'archify/assets/JetBrainsMono-OFL.txt'));
git(root, ['add', '.']);
assert.throws(() => stageCleanSkill({ repoRoot: root, destination }), /requires assets\/JetBrainsMono-OFL.txt/);
} else {
Comment thread
tt-a1i marked this conversation as resolved.
stageCleanSkill({ repoRoot: root, destination });
assert.equal(fs.readFileSync(path.join(destination, 'THIRD_PARTY_NOTICES.md'), 'utf8'), legacy);
}
} finally { fs.rmSync(root, { recursive: true, force: true }); }
});
}
76 changes: 76 additions & 0 deletions archify/test/helpers/offline-fonts.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import assert from 'node:assert/strict';
import { createHash } from 'node:crypto';
import fs from 'node:fs';
import { parse } from 'parse5';

const FONT_LICENSE = fs.readFileSync(new URL('../../assets/JetBrainsMono-OFL.txt', import.meta.url), 'utf8').trim();

// Pinned Google Fonts v24 bytes and coverage, independent of CSS formatting.
const EXPECTED_FACES = [
['9343de2ca5d9549f792e7962375af8efb0f320c7643bfd36c884b5a30e5c396f', 'U+0460-052F,U+1C80-1C8A,U+20B4,U+2DE0-2DFF,U+A640-A69F,U+FE2E-FE2F'],
['4995a9a43ac659ec32fcd8b463755cd6a07b31a6e6b3894a6a153b661cf490e2', 'U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116'],
['49c3da6c9a2b279b0f1f860f5cfb1f5dc38d88a5c7be9c9b1837bbc4e3db6111', 'U+0370-0377,U+037A-037F,U+0384-038A,U+038C,U+038E-03A1,U+03A3-03FF'],
['d44eb1936043a56038eb02dd70b243f379bef65783f94ec12f277550720411f1', 'U+0102-0103,U+0110-0111,U+0128-0129,U+0168-0169,U+01A0-01A1,U+01AF-01B0,U+0300-0301,U+0303-0304,U+0308-0309,U+0323,U+0329,U+1EA0-1EF9,U+20AB'],
['9c38cb2d0d2d93c1ee6e21fa78db76f13ea7e15e15cc64214c7ca89b6aaa35c4', 'U+0100-02BA,U+02BD-02C5,U+02C7-02CC,U+02CE-02D7,U+02DD-02FF,U+0304,U+0308,U+0329,U+1D00-1DBF,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF'],
['2c32b9b3ee358c119e210f6f5195f9bd34894d78a785ff2e95d60e718e400af4', 'U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD'],
].sort(([a], [b]) => a.localeCompare(b));

export function assertFontCss(css, subject) {
assert.ok(css.includes(FONT_LICENSE), `${subject}: missing standalone font license`);
const clean = css.replace(/\/\*[\s\S]*?\*\//g, '');
const faces = [...clean.matchAll(/@font-face\s*\{([^}]+)\}/gi)].map(([, block]) => {
const descriptor = (name) => block.match(new RegExp(`\\b${name}\\s*:\\s*([^;]+)`, 'i'))?.[1].trim();
assert.equal(descriptor('font-family')?.replace(/["']/g, ''), 'JetBrains Mono', subject);
assert.equal(descriptor('font-style'), 'normal', subject);
assert.equal(descriptor('font-weight')?.replace(/\s+/g, ' '), '400 800', subject);
assert.doesNotMatch(block, /\blocal\s*\(/i, `${subject}: installed fonts must not override embedded bytes`);
const encoded = block.match(/\bsrc\s*:\s*url\(\s*["']?data:font\/woff2;base64,([A-Za-z0-9+/=]+)["']?\s*\)/i)?.[1];
assert.ok(encoded, `${subject}: missing embedded WOFF2 source`);
const bytes = Buffer.from(encoded, 'base64');
assert.equal(bytes.toString('latin1', 0, 4), 'wOF2', subject);
return [createHash('sha256').update(bytes).digest('hex'), descriptor('unicode-range')?.replace(/\s+/g, '').toUpperCase()];
}).sort(([a], [b]) => a.localeCompare(b));
assert.deepEqual(faces, EXPECTED_FACES, `${subject}: font bytes or character coverage changed`);
}

// Parse HTML instead of scanning script/comment strings. parse5 also decodes
// srcdoc exactly once, so each nested viewer must satisfy the contract itself.
export function inspectDocuments(html, subject = 'artifact') {
const document = { subject, styles: [], scripts: [], resources: [], children: [] };
const remote = (value) => /^(?:https?:)?\/\//i.test(value || '');
function cssResources(css) {
const clean = css.replace(/\/\*[\s\S]*?\*\//g, '');
for (const match of clean.matchAll(/(?:url\(\s*|@import\s+)["']?((?:https?:)?\/\/[^"')\s;]+)/gi)) document.resources.push(match[1]);
}
function visit(node) {
const attrs = Object.fromEntries((node.attrs || []).map(({ name, value }) => [name, value]));
const text = (node.childNodes || []).filter((child) => child.nodeName === '#text').map((child) => child.value).join('');
if (node.tagName === 'style') { document.styles.push(text); cssResources(text); }
if (node.tagName === 'script') document.scripts.push(text);
if (attrs.style) cssResources(attrs.style);
for (const name of ['src', 'poster', 'data']) if (remote(attrs[name])) document.resources.push(attrs[name]);
if (attrs.srcset) for (const match of attrs.srcset.matchAll(/(?:^|[\s,])((?:https?:)?\/\/[^\s,]+)/g)) document.resources.push(match[1]);
if (['image', 'use', 'feImage'].includes(node.tagName) || (node.tagName === 'link' && /\b(stylesheet|preconnect|dns-prefetch|preload|modulepreload|prefetch|icon)\b/.test(attrs.rel || ''))) {
if (remote(attrs.href)) document.resources.push(attrs.href);
}
if (node.tagName === 'iframe' && attrs.srcdoc != null) document.children.push(...inspectDocuments(attrs.srcdoc, `${subject}/srcdoc[${document.children.length}]`));
for (const child of node.childNodes || []) visit(child);
}
visit(parse(html));
return [document, ...document.children];
}

export function assertOfflineArtifact(html, subject) {
const documents = inspectDocuments(html, subject);
let viewers = 0;
for (const document of documents) {
assert.deepEqual(document.resources, [], `${document.subject}: external subresource`);
const viewer = document.scripts.some((script) => /Archify\.readerLayout/.test(script));
if (viewer) {
assertFontCss(document.styles.join('\n'), document.subject);
viewers += 1;
}
}
assert.ok(viewers > 0, `${subject}: expected a viewer document`);
return viewers;
}
Loading