Skip to content

Commit 0de9c94

Browse files
grypezclaude
andcommitted
fix(kernel-utils): harden sheafify return value and frozenSections
sheafify returned a plain mutable object and used Object.freeze (shallow) for frozenSections. Replace both with harden() for deep transitive immutability under SES lockdown, consistent with the convention applied to constant/source/callable in metadata.ts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 218e881 commit 0de9c94

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

packages/kernel-utils/src/sheaf/sheafify.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ export const sheafify = <
183183
sections: PresheafSection<MetaData>[];
184184
compartment?: { evaluate: (src: string) => unknown };
185185
}): Sheaf<MetaData> => {
186-
const frozenSections: readonly ResolvedSection<MetaData>[] = Object.freeze(
186+
const frozenSections: readonly ResolvedSection<MetaData>[] = harden(
187187
sections.map((section) => ({
188188
exo: section.exo,
189189
spec:
@@ -316,10 +316,10 @@ export const sheafify = <
316316
schema: Record<string, MethodSchema>;
317317
}): object => buildSection({ guard: unionGuard(), lift, schema });
318318

319-
return {
319+
return harden({
320320
getSection,
321321
getDiscoverableSection,
322322
getGlobalSection,
323323
getDiscoverableGlobalSection,
324-
};
324+
});
325325
};

0 commit comments

Comments
 (0)