Problem
The headless package now has one canonical JSON implementation, but packages/eval/src/experiment-directory.ts and packages/storage/src/session-bundle-manifest.ts still carry separate serializers. They encode the same sorted-object/JSON primitive rules independently, so changes to canonicalization can silently produce different experiment identities and bundle bytes.
Scope
- Expose the existing strict canonical JSON authority from
@maka/core through a neutral module name.
- Replace the eval and session-bundle copies with that authority.
- Preserve the manifest's stable
SessionBundleFileError for invalid values and the eval newline/file format.
- Leave runtime-host serializers for a separately coordinated change because their
undefined policies are distinct and their files are under active PRs.
Acceptance criteria
- Equivalent key order produces identical bytes in both consumers.
- Manifest encoding still rejects non-finite/unsupported values with its existing public error code.
- Experiment directory creation and collision checks retain their current output and newline behavior.
- Focused core, eval, and storage tests cover deterministic ordering, nested arrays/objects, and invalid values.
This is a child slice of the canonicalization audit in #1404.
Problem
The headless package now has one canonical JSON implementation, but
packages/eval/src/experiment-directory.tsandpackages/storage/src/session-bundle-manifest.tsstill carry separate serializers. They encode the same sorted-object/JSON primitive rules independently, so changes to canonicalization can silently produce different experiment identities and bundle bytes.Scope
@maka/corethrough a neutral module name.SessionBundleFileErrorfor invalid values and the eval newline/file format.undefinedpolicies are distinct and their files are under active PRs.Acceptance criteria
This is a child slice of the canonicalization audit in #1404.