Skip to content

Support per-policy config.analysis.spanDisambiguation for span disambiguation parity #46

Description

@jzonthemtn

Summary

Support a new optional per-policy config.analysis.spanDisambiguation boolean (schema default true) so a policy can skip span disambiguation, the context-vector step that resolves ambiguously-typed spans (for example SSN vs. phone number). This is the runtime half of PhiSQL RFC philterd/phisql#20; the schema field is added in the redaction policy schema 1.2.0.

Requires phisql 1.2.0, the schema version that defines config.analysis.spanDisambiguation. phisql 1.2.0 is currently in development, so this work is blocked until that schema version is targeted.

Current state in phileas-python

This is forward-looking parity, not a direct port. Unlike the Java and .NET implementations:

  • phileas-python does not currently implement span disambiguation (there is no disambiguation service).
  • The policy model does not model the config.analysis object, so identification and spanDisambiguation are not parsed today.

So there is no disambiguation step to gate yet. The point of this issue is parity: track that when phileas-python gains span disambiguation (or when it starts modeling config.analysis), the spanDisambiguation field is honored, and in the meantime the field is not silently dropped in a way that would mislead an author into thinking it takes effect.

What to change

  1. When config.analysis is modeled, parse and preserve spanDisambiguation (boolean, default true) so it round-trips rather than being silently discarded.
  2. If and when span disambiguation is implemented in phileas-python, honor the flag with the same precedence as the other implementations: disambiguation runs only when a global feature is enabled AND the policy has not set spanDisambiguation to false. A policy can turn it off but not force it on when disabled globally.

Backward compatibility

Additive and non-breaking. Absent or true preserves current behavior. Existing policies are unaffected.

Acceptance criteria

  • When config.analysis is modeled, spanDisambiguation (default true) is parsed and preserved on round-trip.
  • If span disambiguation is implemented, a policy with config.analysis.spanDisambiguation = false skips it even when the global feature is enabled.
  • If span disambiguation is implemented, the field absent or true runs disambiguation as normal when the global feature is enabled, and a policy true cannot override a global off.
  • Behavior (once implemented) matches the Java and .NET Phileas implementations.
  • The package targets phisql 1.2.0 (the schema version defining the field).

Reference: PhiSQL RFC philterd/phisql#20.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions