Repository navigation
Description
Found by an adversarial audit of the #58 L0–L3 equivalence claims, against the #65 stack head 2fe14465f. Counterexample to the #63 claim that "a module compiled under target: 'lynx' renders a first-screen batch deep-equal to the target: 'universal' encoding".
There are two defects here; the first is what makes the second reachable.
1. Attribute validation is skipped entirely for custom elements
packages/octane/src/compiler/compile-universal.js:1817:
if (isHost && hostProps !== undefined && Object.hasOwn(hostProps, name)) {
// ...renderer attribute allowlist enforced HERE ONLY
}The allowlist is consulted only for tags present in the renderer's own hostProps map — the ten declared Lynx intrinsics (view, text, image, scroll-view, …). Every tag outside that map, i.e. every custom native element declared through the documented LynxCustomIntrinsicElements augmentation (packages/lynx/README.md, example at packages/lynx/examples/native-capabilities/src/native-capabilities.d.ts), skips attribute validation wholesale.
Demonstrated by contrast, both executed:
| source | result |
|---|---|
<view __proto__={x} /> |
rejected: renderer "lynx" does not allow static attribute "__proto__" on <view> |
<octane-badge __proto__={x} /> |
compiles |
2. The two encodings then disagree on what that prop means
TEMPLATE_ENV.pwrites props with a raw assignment,packages/lynx/src/main-renderer.ts:720. For the name__proto__that is anObject.prototypeaccessor call: it mutates the record's[[Prototype]]and creates no own key.renderPlanNodebuilds the same poisoned object, but readsprops.childrenthrough the poisoned prototype chain atpackages/lynx/src/main-renderer.ts:802— beforehostNodelaunders it with{...rawProps}at:643.
The asymmetry is precise: children is read pre-spread and so is inherited; key and ref are read post-spread and so are not. One inherited key becomes a real host node, the others silently vanish.
Reproduction
Committed as a red test on claude/octane-issue-58-adversarial-audit (f70f46aa3):
packages/octane/tests/lynx-target-template-equivalence.test.ts → renders the same batch when a custom element carries an inherited prop name
With props.spec = { children: 'hijacked' }:
[lynx=TEMPLATE] hostCount=1 batch = create x-panel | insert
props [[Prototype]] = POISONED {"children":"hijacked",...}
[universal=PLAN] hostCount=2 batch = create x-panel | create #text{value:"hijacked"} | insert | insert
props [[Prototype]] = Object.prototype
Also reproduces at the bare descriptor ABI with no compiler involved, by pairing a kind:'host' plan carrying a __proto__ binding against the kind:'template' create program the backend emits for it.
Consumer impact
An app using a custom native element with a vendor-chosen attribute named __proto__ paints a different first screen depending only on the compiler target — an extra raw-text child under one encoding. hostCount, logicalCount, the batch, and the adoption snapshot node set all differ, so background adoption and mismatch repair see a different tree.
Likelihood is low: it needs that specific attribute name. Defect 1 is the broader concern — custom elements accept any attribute name unchecked, and __proto__ is simply the one with observable accessor behavior.
Notes for the fix
The committed test asserts only that the two encodings agree, so any consistent repair passes: make both paths use Object.defineProperty, or reject prototype-accessor names in lynxTemplateEligible and the plan binding loop alike. Extending attribute validation to custom elements would close the reachable path but leave the descriptor-ABI divergence.
Verification performed
Reproduced independently of the finding agent, at both the compile level and the descriptor-ABI level. The reachability question was contested between two finder agents — one reported __proto__ unreachable using a <view> fixture, which is correct for standard intrinsics — and resolved against the source at compile-universal.js:1817. Adversarial refuter panel had not yet adjudicated this candidate at time of filing.
Activity
Huxpro commentedon Aug 18, 2026
Adversarial panel result: survives, and the framing above understated it
An adversarial refuter has since attempted to kill this candidate and failed on all four routes. Two corrections to the original report follow — one that strengthens the finding, several that narrow it.
Correction 1 — this is not a cross-target artifact; it diverges inside the single shipped target
The report above frames this as
target: 'lynx'vstarget: 'universal'. That understates it.lynxMainThreadRenderershipstarget: 'lynx'(packages/lynx/src/config.ts:236), andlynxTemplateEligibleis evaluated per plan root, recursively — so the interpreted plan encoding is emitted insidetarget: 'lynx'whenever any node in a plan carrieskey/ref/children/an event.Compiling one module under the single production target, with a
refon a sibling element, the whole plan falls back to the interpreted encoding and the same element materializes:while the template-encoded arm materializes no child at all for that element. Both encodings ship in the same production target and disagree with each other. The
universalarm is a convenience for the differential harness, not a precondition for the bug.Correction 2 — narrower reachable shape than implied
All executed:
childrenkey.__proto__={{foo: 1}}is equivalent inhostCount,logicalCount, and batch; only the props record's[[Prototype]]differs (FOREIGNvsObject.prototype) — which the staged applier rejects and the direct applier ignores.__proto__="poison"is equivalent — setting a non-object prototype is a silent no-op.<x-foo {...JSON.parse('{"__proto__":{...}}')} />is rejected — "main-thread render-only host spreads are unsupported because first-screen event and ref props must be statically named for callback erasure."compile-universal.js:1817analysis:<view __proto__={...}>is rejected with "renderer "lynx" does not allow static attribute "proto" on <view>".Type-level reachability, checked properly
With the augmentation shaped like the shipped example (
'x-foo': LynxStandardProps & { label?: string }) the fixture is rejected —TS2322 Property '__proto__' does not exist on type .... But TypeScript accepts'__proto__'?: unknownas an interface member, and once an app declares it in its ownLynxCustomIntrinsicElements, the fixture typechecks with zero errors undertsrx-tsc --noEmitwithskipLibCheck: false.So the reachable shape is: an app-declared custom native element + a literal
__proto__=attribute the app declared in its own augmentation + a dynamic object value carryingchildren. Narrow — but type-legal, and no layer downstream rejects it (applyLynxFirstScreenDirectchecks only renderer id, version, andfirstScreenTreeHasList).Not an intentional divergence
Nothing in
docs/differences-from-react.mdordocs/lynx-specialized-target-l0.mdmentions__proto__. The codebase treats it as a hazard class it guards systematically elsewhere —defineProtoProp(main-renderer.ts:275) used byassignSpread(:293) anduniversalProps(:311), plus guards inuniversal-core.ts,client-driver.ts,host-driver.ts, and a dozen sites incompile.js/compile-universal.js. The two sites that miss it —TEMPLATE_ENV.p(main-renderer.ts:720) and therenderPlanNodebindings loop (main-renderer.ts:799, readingprops.childrenat:802beforehostNode's laundering spread at:643) — are gaps in an otherwise deliberate defense, not a declared divergence.Panel status
1 of 3 refuters reported: not refuted, reproduced independently after discarding the original probe and rebuilding the differential harness from scratch. The remaining two panel slots had not reported when this was written.
Generated by Claude Code
Huxpro commentedon Aug 18, 2026
Correction: the causal attribution in this issue is inverted, and the offending line predates the stack
A second adversarial refuter challenged this candidate's attribution and is correct. I have verified both of its load-bearing claims directly. The divergence is real and the red test stays valid, but the root cause and the owning PR named above are both wrong.
The template path is the correct one; the plan path is the deviant
packages/octane/src/universal-core.ts:3695— the generic universal core that drives the background thread and every non-Lynx universal renderer — reads dynamic children behind an own-property guard:A prototype-inherited
childrenis therefore invisible to it. One host, no ghost child. The refuter confirmed this by running the byte-equivalent host plan throughcreateObjectContainer/createObjectDriver/createUniversalRootwith the same poison object, plus a positive control with an ownchildrenbinding that does produce the child — so the absence is the guard working, not the plan being inert.TEMPLATE_ENV.p(main-renderer.ts:720), which this issue names as the root cause, produces exactly the core's answer. The deviant line is in the interpreted plan path:It predates this stack
Nothing in #59→#63→#64→#65 touches that line. The
owningPR: #63andfileLine: main-renderer.ts:720in the original report are both misattributed.What survives, and what changes
Survives:
'lynx', becauselynxTemplateEligiblefalls back per plan root — so arefon a sibling puts both encodings in the same module, disagreeing. CLAIM 1 is still falsified.packages/octane/tests/lynx-target-template-equivalence.test.ts) asserts only that the two encodings agree; it encodes no attribution and remains correctly red.compile-universal.js:1817gates onObject.hasOwn(hostProps, name)). That remains a real, separate finding and is what makes any of this reachable.Changes:
main-renderer.ts:802— add thehasOwnPropguard so the plan path matchesuniversal-core.ts:3695— not atTEMPLATE_ENV.p.Panel status
3 of 3 refuters have now reported on this candidate: two not refuted (independent reproduction; reachability confirmed through
tsrx-tsc --noEmit), one refuted on attribution — which is what this comment records. The defect is not in dispute; its ownership was.I am leaving the issue open rather than closing it:
main-renderer.ts:802still needs the guard, and the custom-element validation gap still needs a decision. The title and body above should be read with this correction applied.Generated by Claude Code
Huxpro commentedon Aug 18, 2026
Final panel result: two distinct defects here, and the second one is stack-introduced and crashes the first screen
The previous comment corrected the attribution for the
childrenhalf of this report. A third refuter then attacked the other half and could not kill it — and rebuilt it into a production-shaped end-to-end demonstration. Separating the two properly, because my earlier correction blurred them:Defect A — inherited
childrenmaterializes an extra hostPre-existing, not this stack. Root cause is the unguarded
const dynamicChildren = props.childrenatpackages/lynx/src/main-renderer.ts:802, which lacks thehasOwnPropguard thatuniversal-core.ts:3695has. Introduced inf3c4781dd(octanejs#660). Fix belongs at:802. This is what the previous comment covers.Defect B — the template path leaves a foreign
[[Prototype]]on the frozen props record, and the staged applier then refuses to paintThis one is #63's, and it is a hard crash, not a divergence.
Chain, all verified:
TEMPLATE_ENV.p(main-renderer.ts:720) doesprops[name] = value; for__proto__that mutates[[Prototype]]and creates no own key.freezeTemplateHostProps(main-renderer.ts:743) then freezes the record with the foreign prototype intact.cloneProps(host-driver.ts:1011) gates onhasCrossRealmPlainPrototype(core/plain-object.ts:20), which requiresprototype === nullor a prototype one hop from null. A{foo: 1}poison object is two hops, so it fails.Octane Lynx host: host props require plain objects, received [object Object].The plan path never hits this, because
hostNode's{...rawProps}spread (main-renderer.ts:643) launders the prototype away before the driver sees it.Why it is production-reachable — the refuter improved on the original repro
The original probe called
prepareLynxHostBatchon a container thatapplyLynxFirstScreenDirecthad already accepted — a sequence production never performs, and the weakest point in the report. The refuter attacked exactly that and it backfired: they rebuilt the real shape frompackages/lynx/src/main-thread.ts:1896-1911(direct first, staged only when direct declines) using a compiled.tsrxpage carrying a native<list>, which is precisely what makesfirstScreenTreeHasList(host-driver.ts:2882) returnfalseand hand the tree to the staged applier.So on any page containing a native
<list>— the one shape the direct path deliberately declines — a__proto__-named prop on a custom element crashes the first screen undertarget: 'lynx'and renders fine undertarget: 'universal'.target: 'lynx'is whatlynxMainThreadRendererships.Net severity
My earlier correction said severity "drops accordingly". That is true of Defect A only. Defect B raises it: it is introduced by the template lowering this stack added, it is reachable through the shipped renderer preset on the shipped code path, and its failure mode is a thrown first screen rather than a wrong one.
Fix direction for B: either have
TEMPLATE_ENV.pwrite viaObject.defineProperty(so__proto__becomes an own data property, matching what{...rawProps}yields on the plan path), or reject prototype-accessor names inlynxTemplateEligible. Fixing A alone leaves B.Panel tally
4 verdicts across this candidate family: 3 not refuted, 1 refuted-on-attribution. Under 2-of-3 the defect stands; what the panel changed is that it is now correctly split into a pre-existing bug (A) and a stack-introduced crash (B).
Generated by Claude Code
Huxpro commentedon Aug 18, 2026
Final panel tally: split on severity, not on mechanism
Closing the loop on this issue so the record is complete rather than favourable. Six refuter verdicts landed across the two defects reported here.
4 not refuted, 2 refuted. Nobody disputed the mechanism; the disagreement is entirely about whether a consumer would ever write the triggering code.
The strongest dissent (
invalidFixture: true) argues, with executed evidence:__proto__is a compile error on every standard Lynx intrinsic under both targets —view,text,image,scroll-view,list. Main-thread host spreads are rejected outright too.compile-universal.js:1817validates attributes solely for tags present inhostProps.tsrx-tsc --noEmitrejects it —TS2322: Property '__proto__' does not exist on type '{ class?: string; spec?: unknown; }'— unless the consumer declares an explicit__proto__?: unknownfield or an untyped[key: string]: unknownindex signature.__proto__attribute.The strongest defence, also executed, is the production-shape demonstration already recorded above: with a native
<list>forcing the staged path,target: 'lynx'throws the first screen wheretarget: 'universal'paints it.How I would triage this
Both are right. The accurate framing is: real defect, contrived trigger.
__proto__systematically elsewhere (~20 sites, incl.defineProtoPropatmain-renderer.ts:275).__proto__, which no shipped element has and no reasonable consumer writes.I would not prioritise this above #70, #76, #81, or #82, all of which trigger on ordinary code. It is worth fixing as hardening — one
Object.definePropertyinTEMPLATE_ENV.pand onehasOwnPropguard atmain-renderer.ts:802close both halves — rather than as an urgent correctness bug.Record
tsrx-tsc__proto__attributeThe two committed red tests are unaffected — they assert only that the encodings agree, and remain red.
Generated by Claude Code