Skip to content

feat(pip): add bundle staleness telemetry constants#44

Merged
beonde merged 1 commit intomainfrom
feature/embedded-pdp
Mar 21, 2026
Merged

feat(pip): add bundle staleness telemetry constants#44
beonde merged 1 commit intomainfrom
feature/embedded-pdp

Conversation

@beonde
Copy link
Member

@beonde beonde commented Mar 21, 2026

Summary

Adds two telemetry constants for the embedded PDP implementation (RFC-005 Appendix B §B.4):

  • TelemetryBundleStale (capiscio.policy.bundle_stale) — emitted when the embedded PDP's policy bundle exceeds the staleness threshold
  • ErrorCodeBundleStale (BUNDLE_STALE) — distinct from PDP_UNAVAILABLE: the PDP evaluated successfully, but the underlying data may be out of date

Context

Task: EMBEDDED-PDP-001 (PR 1a of 5)
Implementation guide: internal-docs/engineering/embedded-pdp-implementation-guide.md v1.2
Linked PR: capiscio-server feature/embedded-pdp (PR 1b, depends on this)

This is the first PR in the embedded PDP implementation sequence. These constants are consumed by the staleness check in capiscio-server/internal/api/policy_middleware.go (Step 5 of the implementation guide).

Changes

  • pkg/pip/telemetry.go: Add TelemetryBundleStale and ErrorCodeBundleStale to the existing telemetry constants block

Testing

  • All unit tests pass (go test ./... — 21/21 packages, integration tests excluded as expected)
  • Constants only — no behavioral changes

Add TelemetryBundleStale and ErrorCodeBundleStale constants for the
embedded PDP implementation (RFC-005 Appendix B §B.4).

- TelemetryBundleStale: emitted when policy bundle exceeds staleness threshold
- ErrorCodeBundleStale: distinct from PDP_UNAVAILABLE — PDP evaluated but
  data may be out of date

Part of: EMBEDDED-PDP-001 (PR 1a)
Copilot AI review requested due to automatic review settings March 21, 2026 05:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds new telemetry/error-code constants to pkg/pip to support embedded PDP bundle staleness reporting per RFC-005, enabling downstream middleware (e.g., capiscio-server) to distinguish stale-bundle evaluations from PDP unavailability.

Changes:

  • Added TelemetryBundleStale (capiscio.policy.bundle_stale) telemetry field constant.
  • Added ErrorCodeBundleStale (BUNDLE_STALE) error code constant for stale-bundle evaluations.

@beonde beonde merged commit c1e5f58 into main Mar 21, 2026
7 checks passed
@beonde beonde deleted the feature/embedded-pdp branch March 21, 2026 05:04
@codecov
Copy link

codecov bot commented Mar 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

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.

2 participants