Repository navigation
Description
fix(ci): check:proto-reads red for embeddings-native truncateVector — one undispositioned site landed with the native embeddings backend
Problem
bun script/check-proto-reads.ts exits 1 on clean origin/main 775b70088219c5aa21c86595d79ac6b89feea173 (verified this run in a laptop archive probe of that SHA, and the site re-verified by a raw gh api read at the same SHA). Of the four unlisted candidates the gate reports, three are already tracked by #1476 (generate.ts:171, systemone.ts:235, muse-attestation.ts:90) and the one stale allowlist entry (model-route-tuning.ts unit line) is already tracked by #1540. The remaining site is new and listed by neither issue:
Unlisted prototype-chain read candidate at packages/core/src/embeddings-native.ts:139:
for (let index = 0; index < dimensions; index++) sliced[index] = full[index] ?? 0
Origin
packages/core/src/embeddings-native.ts was added 2026-11-03 by commit b56245df9b ("feat(core): native in-process embeddings backend behind the registry (#1554 step 2)") — after #1476 was filed (2026-11-02, against main d96751c983), so its sweep of packages/core/src could not have listed this file. #1476's acceptance criteria include "gate exits 0 on main", so this site must be dispositioned either there or here; it is filed separately, following the #1540 precedent of tracking merge-wave gate drift in its own issue rather than silently expanding an earlier issue's site list.
Site analysis (disposition-shaped, not a live prototype bug)
fullis a fresh plain array built at the only call site,embeddings-native.ts:174:Array.from(data.subarray(rowIndex * input.nativeDimensions, (rowIndex + 1) * input.nativeDimensions)), wheredatais the ONNXFloat32Arrayoutput.- The read key
indexis a numeric loop variable bounded bydimensions, and the branch is only reached whendimensions < nativeDimensions(lines 135–137 return/throw otherwise). The key is never a caller-controlled string, so the harmful prototype-chain form behind audit(core): prototype-chain dictionary lookups — systematic sweep, shared guard, regression net #833/audit(core): shared own-property guard + regression net for prototype-chain dictionary reads (#833 follow-up) #865/fix(ai): bedrock-media MIME tables read through the prototype chain — media type "constructor" bypasses the unsupported-type error #916/fix(core): AISDK toolNames reads through the prototype chain — a provider tool id of "constructor" yields the Object function as the tool name #1085 (attacker-named keys liketoString/constructoron a plain record) is not reachable here. - A short
dataarray makesfull[index]yieldundefined→?? 0; that short-output behavior is the output-width validation gap already tracked by fix(core): native embeddings never validate the ONNX output width — a graph whose sentence_embedding width differs from the registration silently misassigns vectors #1583 and is explicitly out of scope here.
So the expected remedy is an accurate allowlist disposition in script/check-proto-reads.allowlist.txt stating the safe-by-construction reason above (or an equivalent guard if triage prefers code over disposition).
Why it matters
The proto-reads gate is the regression net for the prototype-chain read class. While it stays red for an undispositioned site, the next real instance can land unnoticed behind the noise — the same drift pattern as #1514 and #1540, one merge wave later.
Acceptance criteria
-
packages/core/src/embeddings-native.ts:139is dispositioned inscript/check-proto-reads.allowlist.txtwith the safe-by-construction reason (freshArray.fromnumeric array, numeric bounded loop index, no caller-controlled key), or guarded at the site - After fix(core): check:proto-reads red on main — muse-attestation ALIASES[name] reads through the prototype chain, two more façade reads unlisted #1476 and fix(ci): three gates red on main from today's merge wave — #1404's api.ts rewrite, #1531's byte decoder and #1532's parser unification left new undispositioned sites and stale allowlist entries #1540 also land,
bun script/check-proto-reads.tsreports no unlisted candidate forembeddings-native.tsand no new stale entries - No behavior change to
truncateVectoror the native embeddings path (the width-validation behavior stays fix(core): native embeddings never validate the ONNX output width — a graph whose sentence_embedding width differs from the registration silently misassigns vectors #1583's scope)
Related: #1476 (the gate's other three core sites), #1540 (the stale tuning entry), #1583 (output-width validation in the same file), #1369 (proto-reads coverage of the remaining trees).
Activity
dezren39 commentedon Nov 4, 2026
🤖 Agent note · filed
dezren39 commentedon Nov 4, 2026
🤖 Agent note · filed (correction)
repo-health:v1:triage:developing-today/opencode:issue:1600) returns exactly one row — task 9240, status queued, created 2026-11-04T05:32:01Z — and no task 9223 exists for this issue. No duplicate task was created. All other facts in the previous note stand.dezren39 commentedon Nov 4, 2026
Handed off to the opencode execution lane (task 9240). The laptop claimant will launch the bound session to work this item.
dezren39 commentedon Nov 4, 2026
ALREADY FIXED — closing with evidence (task 9240 revalidation, lane opencode-a):
packages/core/src/embeddings-native.ts:149:for (let index = 0; index < dimensions; index++) sliced[index] = full[index] ?? 0.script/check-proto-reads.allowlist.txt(line 106) with the safe-by-construction reason (numeric index into a ReadonlyArray under a bounded loop counter, dimensions validated first), added by commit b12cf04 "fix(core): own-property alias read in muse-attestation; disposition proto-reads gate to green (fix(core): check:proto-reads red on main — muse-attestation ALIASES[name] reads through the prototype chain, two more façade reads unlisted #1476)" (git log -S embeddings-native on the allowlist).bun script/check-proto-reads.tsexits 0 — "All 99 prototype-chain read candidates dispositioned", no unlisted embeddings-native candidate and no stale entries.No behavior change was needed; truncateVector is untouched.
agent-note:v1 — repo-queue-worker-shift-opencode lane A, task 9240 done (already fixed)