fix: gc must traverse oneOf and preserve template content #94

Merged
xingyue merged 1 commits from fix/93-gc-collectrefs-oneof into main 2026-06-07 13:36:09 +00:00

1 Commits

Author SHA1 Message Date
xiaoju 4659258693 fix: gc must traverse oneOf and preserve template content
CI / check (pull_request) Successful in 3m46s
collectRefs silently skipped oneOf even though it is in the meta-schema's
allowed keys. uwf step nodes use the standard JSON-Schema idiom
oneOf: [{type:"null"}, {type:"string", format:"ocas_ref"}] for nullable
prev/detail/start refs, so walk() never reached the chain and gc swept
the intermediate steps as false orphans. Mirror the anyOf branch in
collectRefs so every oneOf variant contributes refs.

Also align gc with closure.ts Phase 3: walk @ocas/template/text/<schema>
content for every reachable schema so rendered template nodes survive
when their schema is reachable, and are still collected when the schema
itself is unreachable.

Fixes #93
2026-06-07 13:06:59 +00:00