Skip to content

Release hardening: telemetry transport preflight + bundling reliability#23

Merged
IgnazioDS merged 21 commits intomainfrom
branch/implementation-hardening-start
Mar 5, 2026
Merged

Release hardening: telemetry transport preflight + bundling reliability#23
IgnazioDS merged 21 commits intomainfrom
branch/implementation-hardening-start

Conversation

@IgnazioDS
Copy link
Copy Markdown
Owner

@IgnazioDS IgnazioDS commented Mar 5, 2026

Summary

  • Add live telemetry transport preflight command and optional startup preflight gate.
  • Add regression tests for telemetry preflight command/startup behavior.
  • Add optional release-check preflight gate via RUN_TELEMETRY_TRANSPORT_PREFLIGHT=1.
  • Harden bundling to avoid unnecessary network-dependent OpenCV reinstall when cv2 is healthy.

Validation

  • make check-telemetry-transport
  • Telemetry-focused pytest suites + full edge suite
  • SKIP_DESKTOP_BUILD=1 ./scripts/smoke_test_bundling.sh
  • make demo
  • make release-check

Tracking

@IgnazioDS IgnazioDS merged commit a773e68 into main Mar 5, 2026
5 checks passed
@IgnazioDS IgnazioDS deleted the branch/implementation-hardening-start branch March 5, 2026 16:16
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f312df9a84

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +336 to +338
if self._tls_cert_pins:
observed = validate_server_certificate_pin(
cloud_ingest_url=self.cloud_ingest_url,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Offload TLS pin probe from async export loop

_send_batch is async but it directly calls validate_server_certificate_pin, which performs blocking socket/TLS I/O (socket.create_connection in services/telemetry/transport.py) before the httpx request. When TELEMETRY_TLS_CERT_SHA256_PINS is enabled, each export attempt can block the FastAPI event loop for up to the probe timeout, delaying unrelated request handling and health checks under network latency or endpoint stalls.

Useful? React with 👍 / 👎.

"""
if retention_days <= 0:
return 0
cutoff_iso = (_utc_now_naive() - timedelta(days=int(retention_days))).isoformat()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Normalize timestamp formats before outbox retention purge

This purge path compares text timestamps, but cutoff_iso is generated with ISO T separators while legacy created_at values come from SQLite CURRENT_TIMESTAMP (YYYY-MM-DD HH:MM:SS). In COALESCE(last_success_at, created_at) < ?, mixed formats can mis-order rows on the same date (space sorts before T), so migrated SENT rows with null last_success_at can be deleted earlier than the configured retention window.

Useful? React with 👍 / 👎.

def __init__(
self,
db_path: str = ".sentinelid/audit.db",
keychain_dir: str = ".sentinelid/keys",
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use configured keychain path for audit payload encryption

Audit payload encryption now depends on keychain_dir, but the constructor default hardcodes .sentinelid/keys; production wiring still instantiates AuditRepository() without passing settings. In deployments that set SENTINELID_KEYCHAIN_DIR, audit rows are encrypted with a different key location than the rest of the app (and delete-identity cleanup), which can make encrypted audit rows unreadable after restarts/rotations.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant