Skip to content
Open
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
c26bdad
Preserve desktop analysis context and original task baselines
outlier27-cell Nov 22, 2026
6ed4324
Rebuild the Archify skill package
outlier27-cell Nov 22, 2026
c570dad
Wait for refreshed browser content across the analysis request
outlier27-cell Nov 22, 2026
87d0875
Merge latest dev and regenerate the combined skill archive
outlier27-cell Nov 22, 2026
f65e9b8
Package the committed LF-normalized analysis styles
outlier27-cell Nov 22, 2026
99b6c07
Cover task digest compatibility and desktop refresh edge cases
outlier27-cell Nov 22, 2026
0e6d394
Regenerate the verified skill archive from a clean checkout
outlier27-cell Nov 22, 2026
d8c2132
Make consecutive refresh regression inputs deterministic
outlier27-cell Nov 22, 2026
34cb238
Exercise Code Analysis verification history retention boundaries
outlier27-cell Nov 22, 2026
ace2271
Rebuild Archify package with verification history tests
outlier27-cell Nov 22, 2026
d3784c2
Sync Code Analysis vendoring from dev and rebuild the skill archive
outlier27-cell Nov 22, 2026
66535c3
Sync dev and rebuild the desktop analysis skill archive
outlier27-cell Nov 22, 2026
c42f4f7
Sync latest dev and rebuild Skill archive
outlier27-cell Nov 23, 2026
c2bd2d6
Sync dev and rebuild Skill archive
outlier27-cell Nov 24, 2026
33e4954
Merge branch 'dev' of https://github.com/tt-a1i/archify into codex/de…
outlier27-cell Nov 25, 2026
cbd0cc2
test(analysis): return to overview before refresh regression
outlier27-cell Nov 25, 2026
3c2159e
fix(analysis): preserve reading context after refresh
outlier27-cell Nov 25, 2026
7366cf9
fix(analysis): return to component when indicator disappears
outlier27-cell Nov 25, 2026
7e159da
fix(code-analysis): preserve exact context after reanalysis
outlier27-cell Nov 25, 2026
6e6c589
test(code-analysis): wait for clickable standalone controls
outlier27-cell Nov 25, 2026
914e732
fix(code-analysis): retain stable analysis selections
outlier27-cell Nov 25, 2026
3448efa
fix(code-analysis): avoid restoring ambiguous 3D selections
outlier27-cell Nov 25, 2026
5b4da0f
test: allow slow Windows lock helper startup
outlier27-cell Nov 25, 2026
1d71f83
fix(code-analysis): bind 3D selection to captured source
outlier27-cell Nov 25, 2026
ded8e35
fix(code-analysis): bind 3D selection to full named definition
outlier27-cell Nov 25, 2026
4933ec8
fix(code-analysis): reject ambiguous initializer selections
outlier27-cell Nov 25, 2026
56c2fca
test(code-analysis): cover Java initializer identities
outlier27-cell Nov 25, 2026
95d0efb
test(code-analysis): assert each Java initializer explicitly
outlier27-cell Nov 25, 2026
8907de8
fix: verify Atlas finding identities after reanalysis
outlier27-cell Nov 25, 2026
0deb954
fix: preserve proven function expression bindings
outlier27-cell Nov 25, 2026
f28251e
Merge dev and preserve wrapped function bindings
outlier27-cell Nov 25, 2026
3ef772f
test: cover TypeScript assertion wrappers
outlier27-cell Nov 25, 2026
888d544
Merge latest dev into reanalysis continuity
outlier27-cell Nov 25, 2026
2f5cb9d
Merge dev update notice baseline
outlier27-cell Nov 25, 2026
650a696
test: bound browser shutdown wait
outlier27-cell Nov 25, 2026
b4d4114
Merge commit '88f26d239e0e1d688fdb05b6e21df0b096bc00a4' into codex/de…
outlier27-cell Nov 25, 2026
5b1ad6e
Merge commit '63372e736abc9a4e3cd4bb9470ac854a52a33187' into codex/de…
outlier27-cell Nov 26, 2026
758611d
Merge commit '79c9342947e5a15c434cb5c90ca614cc48a8f40a' into codex/de…
outlier27-cell Nov 26, 2026
ceabbbf
fix(analysis): link same-named method findings by range
outlier27-cell Nov 26, 2026
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
Binary file modified archify.zip
Binary file not shown.
12 changes: 8 additions & 4 deletions archify/modules/code-analysis/bin/serve.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -436,14 +436,15 @@ function client(token, messages, makeTranslator, standalone, entryCss) {
};
// Re-analysis: the server runs a new analysis; the page then reloads and opens it,
// which re-mounts the layer cleanly instead of patching a live one.
window.__archifyReanalyze = async function () {
window.__archifyReanalyze = async function (reading) {
var response = await fetch('/analyze', { method: 'POST', headers: { 'X-Analysis-Token': token, 'X-Analysis-Refresh': '1' } });
if (!response.ok) {
var body = {};
try { body = await response.json(); } catch (e) { /* not JSON */ }
throw new Error(body.error || tr("analysis failed"));
}
location.replace(location.pathname + '?analysis=open');
history.replaceState({ analysisRefresh: { token: token, reading: reading } }, '', location.pathname);
location.reload();
};
button.addEventListener('click', async function () {
button.disabled = true; button.setAttribute('aria-busy', 'true'); setLabel(tr("Analyzing…")); say(tr("Reading the repository — imports, modules, rules."));
Expand Down Expand Up @@ -480,13 +481,16 @@ function client(token, messages, makeTranslator, standalone, entryCss) {
if (toggle && document.documentElement.getAttribute('data-bauify') !== 'on') toggle.click();
var params = new URLSearchParams(location.search), selectedFinding = params.get('finding');
if (selectedFinding && window.__archifyShowFinding) window.__archifyShowFinding(selectedFinding, params.get('from') === 'findings' ? 'findings' : 'summary');
if (location.search) history.replaceState(null, '', location.pathname);
if (refreshReading) window.__archifyRestoreReading?.(refreshReading);
if (location.search || refreshReading) history.replaceState(null, '', location.pathname);
} catch (error) {
button.disabled = false; button.removeAttribute('aria-busy'); setLabel(tr("Code Analysis"));
say(tr("Analysis failed: ") + error.message + tr(" — click Code Analysis to retry."));
}
});
if (standalone || new URLSearchParams(location.search).get('analysis') === 'open') button.click();
var savedRefresh = history.state?.analysisRefresh;
var refreshReading = savedRefresh?.token === token && savedRefresh.reading;
if (standalone || refreshReading || new URLSearchParams(location.search).get('analysis') === 'open') button.click();
}

if (process.argv[1] && path.resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
Expand Down
58 changes: 56 additions & 2 deletions archify/modules/code-analysis/overlay/atlas.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,58 @@
// coupling; the side panel states the unresolved counts. Source text stays in
// the Classic view, which the Atlas links to for any finding's evidence.
import fs from 'node:fs';
import { createHash } from 'node:crypto';
import { createRequire } from 'node:module';
import { clientAsset } from './client-assets.mjs';

const compareText = (a, b) => (a < b ? -1 : a > b ? 1 : 0);
const require = createRequire(import.meta.url);

// A function expression's measured range does not include its binding. Only
// accept a uniquely bound top-level anonymous expression whose captured range
// still matches the parsed source; otherwise its apparent name may be local
// to the expression or ambiguous across scopes.
function boundExpressions(facts) {
const wanted = new Set((facts.functions || []).filter(fn => fn.syntaxKind === 'FunctionExpression').map(fn => fn.file));
const result = new Map();
if (!wanted.size) return result;
const ts = require('../vendor/typescript.cjs');
for (const file of facts.files || []) {
if (!wanted.has(file.path) || typeof file.sourceText !== 'string') continue;
const source = ts.createSourceFile(file.path, file.sourceText, ts.ScriptTarget.Latest, true);
if (source.parseDiagnostics.length) continue;
const declarations = new Map(), expressions = [], pending = [source];
while (pending.length) {
const node = pending.pop();
if (ts.isVariableDeclaration(node) && ts.isIdentifier(node.name)) {
const name = node.name.text;
declarations.set(name, (declarations.get(name) || 0) + 1);
let init = node.initializer;
while (init && (ts.isParenthesizedExpression(init) || ts.isAsExpression(init) || ts.isSatisfiesExpression?.(init) || ts.isTypeAssertionExpression(init))) init = init.expression;
if (init && ts.isFunctionExpression(init) && !init.name && node.parent?.parent?.parent === source) expressions.push({ name, init });
}
ts.forEachChild(node, child => { pending.push(child); });
}
for (const { name, init } of expressions) {
if (declarations.get(name) !== 1) continue;
const start = init.getStart(source), end = init.getEnd(), pos = source.getLineAndCharacterOfPosition(start);
const digest = createHash('sha256').update(file.sourceText.slice(start, end)).digest('hex');
result.set(`${file.path}\0${pos.line + 1}\0${pos.character + 1}`, { name, digest });
}
}
return result;
}

function stableFunctionName(fn, expressions) {
if (fn.syntaxKind === 'FunctionExpression') {
const binding = expressions.get(`${fn.file}\0${fn.line}\0${fn.sourceRange?.column}`);
if (!binding || binding.name !== fn.name || binding.digest !== fn.sourceRange?.sha256) return false;
}
const name = fn.qualname || fn.name;
const owner = /^(?:MethodDeclaration|GetAccessor|SetAccessor)$/.test(fn.syntaxKind || '') && fn.name && name.endsWith(fn.name)
? name.slice(0, -fn.name.length) : name;
return !/<(?:callback of |anonymous(?:#\d+)?>|(?:static|instance) initializer>)/.test(owner);
}

// Shortest unambiguous label for each module: the fewest trailing path
// segments that no other module shares (`executor`, `cache/decorators`).
Expand Down Expand Up @@ -147,19 +196,24 @@ export function buildAtlas({ graph, facts, findings = [], review = null }) {
}

// [file, name, line, complexity, nesting, length, finding index or -1]
const expressions = boundExpressions(facts);
const functions = (facts.functions || [])
.filter((fn) => fileIndex.has(fn.file))
.map((fn) => [fileIndex.get(fn.file), fn.qualname || fn.name, fn.line, fn.complexity, fn.nesting ?? 0, (fn.endLine ?? fn.line) - fn.line + 1,
functionFinding.has(`${fn.file}\u0000${fn.qualname}`) ? functionFinding.get(`${fn.file}\u0000${fn.qualname}`) : -1,
fn.sourceRange ? { column: fn.sourceRange.column, endLine: fn.sourceRange.endLine, endColumn: fn.sourceRange.endColumn } : null])
fn.sourceRange ? { column: fn.sourceRange.column, endLine: fn.sourceRange.endLine, endColumn: fn.sourceRange.endColumn } : null,
fn.definition ? fn.definition.sourceRange?.sha256 || null : fn.sourceRange?.sha256 || null,
// Display names of callbacks and Java anonymous owners are numbered by
// source order. A quoted JS method named <anonymous> is a real name.
stableFunctionName(fn, expressions)])
.sort((a, b) => a[0] - b[0] || a[2] - b[2] || compareText(a[1], b[1]));
for (const [i, fn] of functions.entries()) if (fn[6] !== -1) listed[fn[6]].fn = i;

const unresolved = facts.unresolved || graph.unresolved || {};
return {
language: facts.repository?.language ?? null,
measured: Array.isArray(facts.functions),
modules: modules.map((m, i) => ({ id: m.id, label: labels[i], path: m.path, fanIn: m.fanIn, fanOut: m.fanOut })),
modules: modules.map((m, i) => ({ id: m.id, label: labels[i], path: m.path, rootGroup: m.path === '' && m.label === '(root)', fanIn: m.fanIn, fanOut: m.fanOut })),
files: files.map((f) => [f.path, f.module, f.loc]),
edges,
functions,
Expand Down
34 changes: 32 additions & 2 deletions archify/modules/code-analysis/overlay/client/atlas.js
Original file line number Diff line number Diff line change
Expand Up @@ -1108,6 +1108,7 @@
// One view at a time; the diagram is the default page ('' or 'diagram').
function showView(kind) {
if (!views) return;
views.hidden = root.getAttribute('data-bauify') !== 'on';
Comment thread
outlier27-cell marked this conversation as resolved.
Resolved
var next = kind === 'diagram' ? '' : kind || '';
// Set first: the layout (summary column hidden, full width) must settle before a view draws.
if (next) root.setAttribute('data-bauify-views', next); else root.removeAttribute('data-bauify-views');
Expand Down Expand Up @@ -1166,12 +1167,41 @@
var index = M.findIndex(function (m) { return m.id === id; });
select(index, -1);
},
saveSelection: function () { return { module: state.focusModule, finding: state.finding, file: state.file, changedFile: changedSelection, scope: fileScope?.value, tab: filePane.hidden ? 'map' : 'files', query: fileQuery.value, zoom: focusZoom, view: sideView() }; },
saveSelection: function (portable, active) {
var saved = { module: state.focusModule, finding: state.finding, file: state.file, changedFile: changedSelection, scope: fileScope?.value, tab: filePane.hidden ? 'map' : 'files', query: fileQuery.value, zoom: focusZoom, view: sideView() };
if (!portable) return saved;
return {
...saved, portable: true, module: M[saved.module] ? { path: M[saved.module].path, rootFile: M[saved.module].path || M[saved.module].rootGroup ? null : F.find(function (entry) { return entry[1] === saved.module; })?.[0] } : null, finding: FD[saved.finding]?.id, file: F[saved.file]?.[0],
changedFile: changedFiles[saved.changedFile]?.path,
view: { ...saved.view, groups: [...saved.view.groups] }, fileScroll: filePane.scrollTop,
focus: active === fileQuery ? 'search' : active === fileScope ? 'scope'
: active && fileList.contains(active) ? 'file' : active?.classList.contains('atlas-tab') ? 'tab' : null
};
},
restoreSelection: function (saved) {
fileQuery.value = saved.query || '';
if (fileScope && saved.scope) fileScope.value = saved.scope;
select(saved.module, saved.finding, saved, saved.file, saved.changedFile);
var module = saved.module, finding = saved.finding, file = saved.file, changed = saved.changedFile;
if (saved.portable) {
var matchingModules = saved.module ? M.map(function (entry, index) {
var rootFile = entry.path || entry.rootGroup ? null : F.find(function (file) { return file[1] === index; })?.[0];
return entry.path === saved.module.path && rootFile === saved.module.rootFile ? index : -1;
}).filter(function (index) { return index >= 0; }) : [];
module = matchingModules.length === 1 ? matchingModules[0] : -1;
finding = FD.findIndex(function (entry) { return entry.id === saved.finding; });
file = F.findIndex(function (entry) { return entry[0] === saved.file; });
changed = changedFiles.findIndex(function (entry) { return entry.path === saved.changedFile; });
saved = { ...saved, view: { ...saved.view, groups: new Set(saved.view.groups) } };
}
select(module, finding, saved, file, changed);
showTab(saved.tab === 'files');
if (saved.portable && saved.tab === 'files') filePane.scrollTop = saved.fileScroll;
if (saved.portable && !panel.hidden && saved.focus) {
var target = saved.focus === 'search' ? fileQuery : saved.focus === 'scope' ? fileScope
: saved.focus === 'file' ? fileList.querySelector('[aria-current="true"]') || fileQuery : panel.querySelector('.atlas-tab[aria-selected="true"]');
if (target?.getClientRects().length) target.focus({ preventScroll: true });
}
return saved.portable && ((saved.module && module < 0) || (saved.finding && finding < 0) || (saved.file && file < 0) || (saved.changedFile && changed < 0));
}
};
if (standalone) open();
Expand Down
39 changes: 38 additions & 1 deletion archify/modules/code-analysis/overlay/client/atlas3d.js
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,44 @@
}
resize(); updateCamera(); renderSide(); applyMarks();
requestAnimationFrame(frame);
return { host, select, state, consistent, counts: { files: drawnFiles, functions: drawnFns, branchDeps, threadDeps, insideDeps }, trunk: M[trunk].label, refresh: () => { resize(); dirty = true; } };
function functionIdentity(index) {
const fn = FN[index];
if (!fn) return null;
return { file: F[fn[0]][0], name: fn[1], line: fn[2], digest: fn[8], stableName: fn[9] === true, unique: !!fn[8] && FN.filter(candidate => candidate[0] === fn[0] && candidate[1] === fn[1] && candidate[8] === fn[8]).length === 1 };
}
function matchingFunction(saved) {
if (!saved || !saved.stableName || !saved.unique || !saved.digest) return [];
return FN.map((fn, i) => F[fn[0]][0] === saved.file && fn[9] === true && fn[1] === saved.name && fn[8] === saved.digest ? i : -1).filter(i => i !== -1);
}
function saveSelection() {
if (state.fn !== -1) return { type: 'function', ...functionIdentity(state.fn) };
if (state.finding !== -1) { const finding = FD[state.finding]; return { type: 'finding', id: finding.id, ...(finding.kind === 'function' ? { function: functionIdentity(finding.fn) } : {}) }; }
if (state.file !== -1) return { type: 'file', path: F[state.file][0] };
if (state.module !== -1) { const m = M[state.module]; return { type: 'module', path: m.path, rootFile: m.path || m.rootGroup ? null : F.find(f => f[1] === state.module)?.[0] }; }
return null;
}
function restoreSelection(saved) {
if (!saved) return false;
let indexes = [];
if (saved.type === 'function') {
// A generated name can be reassigned to a new function. Without
// independent owner provenance it is safer to report it unavailable.
indexes = matchingFunction(saved);
}
if (saved.type === 'finding') {
indexes = FD.map((f, i) => f.id === saved.id ? i : -1).filter(i => i !== -1);
if (indexes.length === 1 && FD[indexes[0]].kind === 'function') {
const matches = matchingFunction(saved.function);
if (matches.length !== 1 || matches[0] !== FD[indexes[0]].fn) return true;
Comment thread
outlier27-cell marked this conversation as resolved.
Resolved
}
}
if (saved.type === 'file') indexes = F.map((f, i) => f[0] === saved.path ? i : -1).filter(i => i !== -1);
if (saved.type === 'module') indexes = M.map((m, i) => m.path === saved.path && (m.path || (m.rootGroup ? null : F.find(f => f[1] === i)?.[0]) === saved.rootFile) ? i : -1).filter(i => i !== -1);
if (indexes.length !== 1) return true;
select({ type: saved.type, index: indexes[0] });
return false;
}
return { host, select, state, saveSelection, restoreSelection, consistent, counts: { files: drawnFiles, functions: drawnFns, branchDeps, threadDeps, insideDeps }, trunk: M[trunk].label, refresh: () => { resize(); dirty = true; } };
}

window.__archifyAtlas3d = { mount, get view() { return mounted; } };
Expand Down
12 changes: 12 additions & 0 deletions archify/modules/code-analysis/overlay/client/overlay.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading