Skip to main content

Wire-format Pydantic schema for AI Internet Diagnostic. The field allowlist is the privacy contract.

Project description

wifi-diag-schema

Privacy contract: the field allowlist on TelemetryFrame is the privacy posture. There is no raw_message, no username, no credential field — by construction.

The wire-format Pydantic schema for the AI Internet Diagnostic project. The cross-platform local agent, the Hugging Face Space UI, and the trained model artifact all pip install wifi-diag-schema==X.Y.Z and operate against the same set of typed contracts.

The schema source IS the privacy policy. Adding a field is a deliberate, reviewable act — the test suite enforces a literal allowlist regression gate (tests/test_telemetry_field_allowlist.py), and pydantic.ConfigDict(extra="forbid") rejects any unknown field at validation time.

Install

pip install wifi-diag-schema==1.0.0

Usage

from pydantic import ValidationError
from wifi_diag_schema import TelemetryFrame, Verdict, EvidenceItem, SCHEMA_VERSION

# Attempt to set a field outside the allowlist → ValidationError("extra_forbidden")
try:
    TelemetryFrame.model_validate({"raw_message": "anything"})
except ValidationError as e:
    print(e)  # extra_forbidden — the privacy contract spoke

Schema fields (v1.0.0)

Group Count Notes
Core (D-02) 14 timestamp, os, network_mode, rssi_dbm, bssid, channel, ping_continuity, latency_jitter_ms, dns_resolution_ms, dhcp_event_class, auth_event_class, captive_portal_detected, mac_randomization_state, driver_state
Extended (D-01) 4 per_packet_retry_count, rts_cts_rate, beacon_rssi_dbm, neighbor_ap_count_5ghz
Privacy mode 1 bssid_mode (raw | hashed)
Meta 1 window_ms
Total 20

Every field carries a why-allowlisted justification in its Field(description=...). See src/wifi_diag_schema/_justifications.py for the extended-field rationale and per-OS source confidence tiers.

Versioning

Strict SemVer (D-05):

  • Major = breaking change (field removed, type narrowed, validator tightened)
  • Minor = additive (new optional field with default; new enum value)
  • Patch = doc-only

The agent and Space exchange schema_version via HandshakeFrame on the first SSE message of every live session (added in plan 01-02). Major mismatch → hard error. Minor mismatch → warn-but-continue.

Release

Tag a release as vX.Y.Z; the publish.yml workflow runs OIDC Trusted Publishing automatically. The Trusted Publisher must be registered at https://pypi.org/manage/account/publishing/ pointing at this repo + the publish.yml workflow filename.

License

Apache-2.0.

Release process

Tag a release as vX.Y.Z; the publish.yml GitHub Action builds wheel + sdist with uv build, smoke-installs the wheel into a fresh venv, and publishes to PyPI via OIDC Trusted Publishing — no API tokens are stored anywhere.

A one-time manual step is required: register wifi-diag-schema as a Trusted Publisher at https://pypi.org/manage/account/publishing/ pointing at the GitHub repo + the publish.yml workflow filename. Until that registration is in place, the publish step will fail at the final action.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wifi_diag_schema-1.1.0.tar.gz (35.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wifi_diag_schema-1.1.0-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file wifi_diag_schema-1.1.0.tar.gz.

File metadata

  • Download URL: wifi_diag_schema-1.1.0.tar.gz
  • Upload date:
  • Size: 35.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wifi_diag_schema-1.1.0.tar.gz
Algorithm Hash digest
SHA256 c6e3d84d98d4a0f1c6c1c351fb5d28eeb19ce64bef763045134e6ac0e03f36e0
MD5 d20d6daeeae44491faa767cdbcabf070
BLAKE2b-256 5284bdbd6185620708f30067e5807809ea5e3f1d809d8d7a80d76149cfc8e05c

See more details on using hashes here.

Provenance

The following attestation bundles were made for wifi_diag_schema-1.1.0.tar.gz:

Publisher: publish.yml on wolfwdavid/wifi-diag-schema

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wifi_diag_schema-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for wifi_diag_schema-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6f131a95bc7a65ef65ad634aa75d0c8485404069ad024457117e71cdaf1bdad7
MD5 548bcf0b6877f116cacd4d1f3e601499
BLAKE2b-256 3949f16a747a9ce996adf05ab6f7b2f280720f833d705ecdfa48d3ec560e0655

See more details on using hashes here.

Provenance

The following attestation bundles were made for wifi_diag_schema-1.1.0-py3-none-any.whl:

Publisher: publish.yml on wolfwdavid/wifi-diag-schema

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page