Skip to content

claw-api: warn on principal verb skew and surface inert principals#150

Merged
mostlydev merged 1 commit intomasterfrom
issue-144-claw-api-skew-warning
Apr 13, 2026
Merged

claw-api: warn on principal verb skew and surface inert principals#150
mostlydev merged 1 commit intomasterfrom
issue-144-claw-api-skew-warning

Conversation

@mostlydev
Copy link
Copy Markdown
Owner

@mostlydev mostlydev commented Apr 13, 2026

This pull request enhances principal management and diagnostics in the Claw API by improving health endpoint reporting, adding principal normalization and version skew warnings, and expanding test coverage. It introduces mechanisms to warn users when a configured principal requires API features that may not be supported by the deployed Claw API version, and surfaces principal-related diagnostics via the /health endpoint.

Health endpoint improvements:

  • The /health endpoint now returns detailed principal diagnostics, including the total principal count, a list of inert principals (those with no recognized verbs), and any normalization warnings about principal configuration.
  • The handler test suite is updated to validate the new health endpoint response and to check for inclusion of normalization warnings and inert principal reporting.

Principal store and normalization enhancements:

  • The Store struct now retains normalization warnings, and exposes an InertPrincipalNames method to summarize inert principals. [1] [2]
  • Tests are added to ensure normalization warnings are retained and inert principal summaries are accurate. [1] [2]

Principal version skew detection:

  • Adds PrincipalVersionSkewWarnings, which emits warnings if principals require verbs not supported by the specified Claw API image version. This helps prevent misconfiguration when using older API images.
  • The Claw API runtime preparation now prints these warnings to stdout if version mismatches are detected.
  • Comprehensive tests are included to verify warning emission for version mismatches, supported versions, and unpinned images. [1] [2]

Dependency update:

  • Imports golang.org/x/mod/semver to support semantic version comparison for image tag checking.

@mostlydev mostlydev self-assigned this Apr 13, 2026
@mostlydev mostlydev merged commit d264552 into master Apr 13, 2026
1 check passed
@mostlydev mostlydev deleted the issue-144-claw-api-skew-warning branch April 13, 2026 03:35
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