void update boundary provenance

This commit is contained in:
Stewart Allen 2026-03-02 19:08:34 -05:00
commit 907c8e7f06

View file

@ -3384,6 +3384,13 @@ function edgeKey(a, b) {
const allFeatures = api.features.list() || []; const allFeatures = api.features.list() || [];
const featureIndexById = new Map(allFeatures.map((f, i) => [String(f?.id || ''), i])); const featureIndexById = new Map(allFeatures.map((f, i) => [String(f?.id || ''), i]));
const eligibleSketchIds = new Set(); const eligibleSketchIds = new Set();
const activeEditFeatureId = String(api.document?.getAtomicEditFeatureId?.() || '');
const activeEditFeature = activeEditFeatureId
? (allFeatures.find(f => String(f?.id || '') === activeEditFeatureId) || null)
: null;
const activeSketchEditId = activeEditFeature?.type === 'sketch'
? String(activeEditFeature.id || '')
: '';
const getFeatureIndex = (fid) => { const getFeatureIndex = (fid) => {
const key = String(fid || ''); const key = String(fid || '');
if (!key) return -1; if (!key) return -1;
@ -3410,10 +3417,14 @@ function edgeKey(a, b) {
} }
return false; return false;
}; };
for (const feature of allFeatures) { // Guardrail: do not auto-mutate historical sketches during solids
if (feature?.type !== 'sketch') continue; // rebuilds triggered by other features. Only the actively edited
if (hasFutureSourceDependency(feature)) continue; // sketch may auto-refresh derived refs / face attachments.
eligibleSketchIds.add(String(feature?.id || '')); if (activeSketchEditId) {
const feature = allFeatures.find(f => String(f?.id || '') === activeSketchEditId) || null;
if (feature?.type === 'sketch' && !hasFutureSourceDependency(feature)) {
eligibleSketchIds.add(activeSketchEditId);
}
} }
let derivedChanged = false; let derivedChanged = false;
for (const feature of allFeatures) { for (const feature of allFeatures) {