Skip to content

spec(auto-instrumentation): generator no longer reproduces privacy.json (scalar_metrics block hand-edited) #623

Open

Description

@nik13

What happens

spec/auto-instrumentation/README.md says privacy.json and privacy-fixtures.json are generated by generate_privacy_fixtures.py and must never be hand-edited. On dev, the generator's read-only check fails:

$ python3 spec/auto-instrumentation/generate_privacy_fixtures.py --check
stale privacy.json; run generate_privacy_fixtures.py
privacy golden cases: 6238 passed; idempotency: 6238 passed; coverage: 228 rules/sites pinned

spec/auto-instrumentation/test_privacy_spec.py fails 2 tests, including CatalogTests::test_generated_bytes_are_current (2 failed, 57 passed). sync.py reports the 4 shipping copies are byte-identical, so the copies agree with each other but not with the generator.

Cause

The scalar_metrics block in privacy.json (canonical-decimal byte counters, nonnegative safe-integer counters) is not produced by privacy_catalog() in the generator. It arrived hand-edited in the zero-code release (6a3cc76). #620 extended it with gen_ai.usage.cache_read_tokens.audio, also by hand. Both dev and #620 fail the check identically (verified in E2B).

Fix

  • Move the scalar_metrics rules into privacy_catalog().
  • Regenerate both JSON files and run sync.py --write.
  • Add a CI job that runs generate_privacy_fixtures.py --check and python -m pytest spec/auto-instrumentation, so hand edits fail CI. Currently no workflow runs either.

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