Skip to content

test: canonical form cases for \r and backslash #110

Closed

Description

@frostyard-machines

Why

The B2 baseline test compares each record file under .memory/corrections/ with the canonical form of core ADR-0081: JSON.stringify(record, null, 2) + "\n". #108 made the Go serializer write the same bytes as JSON.stringify. A read-only cross-review of #108 (reviewer openai/gpt-6.1-sol, merge of #108) found the serializer correct, but the table near internal/baseline/repository_baseline_test.go:603 has no explicit case for 2 escapes:

  • a carriage return: JSON.stringify writes \r
  • a backslash: JSON.stringify writes \\

Severity: low, not blocking. No byte-format defect was seen. The gap is test coverage only.

Acceptance

  • The table in internal/baseline/repository_baseline_test.go has a case where a field holds a carriage return in canonical form (\r): it passes.
  • It has a case with the same field in a non-canonical form (for example \u000d or \u000D): it fails with "not in canonical form".
  • It has a case where a field holds a backslash in canonical form (\\): it passes.
  • go test ./... passes.

Owner: Lucilla (repository owner).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions