fix(javascript): enforce semantic byte bounds for literals

Fixes #3933. Part of #4027.

Normalize exact literals and configuration defaults through the shared primitive owner. Preserve tagged limits through member/destructuring projection and record encountered bounds in per-analysis state independently of later selected values. Remove the retained-value rescan and duplicate default reader. Preserve source Evidence, bounded/null values, aggregate wire capacity and complete endpoint lookup identities for query/trace/comparison.

Validated 66 focused and 932 semantic tests on the restored identical runtime; final public selection 7/7 adds an augmented large-endpoint acceptance (67 distinct focused cases across invocations). Full static/docs and fresh real Obsidian controls passed. Compact measurements and rejected attempts remain recorded.

Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com>
This commit is contained in:
YsopwnableandKaoru0822 authored and GitHub committed 2026-10-15 23:43:05 +08:00
1 parent 40f73f62bc
commit 9f8659e053
17 files changed
+1024 -57

No files matched your search

@@ -77,25 +77,6 @@ export const semanticResourceLimitUnknown = (
resourceLimit,
});
/** Collect resource-limit classifications from nested semantic values. */
export const semanticResourceLimitsIn = (
values: readonly JavaScriptSemanticValue[],
): readonly JavaScriptSemanticResourceLimit[] => {
const found = new Set<JavaScriptSemanticResourceLimit>();
const pending = [...values];
while (pending.length > 0) {
const value = pending.pop();
if (value === undefined) continue;
if (value.status === "unknown" && value.resourceLimit !== undefined)
found.add(value.resourceLimit);
else if (value.status === "object")
for (const property of value.properties) pending.push(property.value);
else if (value.status === "array")
for (const item of value.items) pending.push(item.value);
}
return [...found].sort();
};
/** Display label for one stable resource classification. */
export const semanticResourceLimitReason = (
resourceLimit: JavaScriptSemanticResourceLimit,