Skip to content

fix: dev_mode SimpleGuard skips agent-card.json, add client.guard property#73

Closed
beonde wants to merge 3 commits into
mainfrom
fix/dx-audit-simpleguard
Closed

fix: dev_mode SimpleGuard skips agent-card.json, add client.guard property#73
beonde wants to merge 3 commits into
mainfrom
fix/dx-audit-simpleguard

Conversation

@beonde
Copy link
Copy Markdown
Member

@beonde beonde commented May 22, 2026

DX Audit: SimpleGuard Dev Mode Improvements

Discovered during developer experience audit — new users hit errors when agent-card.json doesn't exist yet.

Changes

  • SimpleGuard in dev_mode=True no longer requires agent-card.json to exist (skips card loading)
  • Added client.guard property on CapiscIOClient for convenient access to the SimpleGuard instance
  • Version bump to 2.7.2

4 files, +27/-14

beonde added 2 commits May 21, 2026 12:28
…perty

- Reorder _resolve_identity() so dev_mode (Case 3) takes priority over
  legacy agent-card.json loading (now Case 4). An A2A agent-card.json
  without public_keys no longer crashes SimpleGuard in dev_mode.
- Skip directory walking in _resolve_project_root() when dev_mode=True
- Add guard @Property on AgentIdentity for CapiscIO.connect() result
Copilot AI review requested due to automatic review settings May 22, 2026 02:01
@github-actions
Copy link
Copy Markdown

✅ Documentation validation passed!

Unified docs will be deployed from capiscio-docs repo.

@github-actions
Copy link
Copy Markdown

✅ All checks passed! Ready for review.

@github-actions
Copy link
Copy Markdown

✅ SDK server contract tests passed (test_server_integration.py). Cross-product scenarios are validated in capiscio-e2e-tests.

Copy link
Copy Markdown

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

This PR improves developer experience around SimpleGuard(dev_mode=True) by avoiding failures when agent-card.json is not present, adds a convenience accessor for obtaining a SimpleGuard from CapiscIO.connect() results, and bumps the SDK version to 2.7.2.

Changes:

  • Update SimpleGuard dev-mode behavior to skip project-root walking and to prefer dev-mode identity resolution over legacy agent-card.json loading.
  • Add a lazy guard property on the CapiscIO.connect() return type (AgentIdentity) for convenient access to a SimpleGuard instance.
  • Bump package/runtime version from 2.7.1 → 2.7.2.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
pyproject.toml Bumps distribution version to 2.7.2.
capiscio_sdk/simple_guard.py Adjusts dev-mode root/identity resolution to avoid requiring agent-card.json.
capiscio_sdk/connect.py Adds AgentIdentity.guard convenience property for SimpleGuard access.
capiscio_sdk/init.py Bumps runtime __version__ to 2.7.2.

Comment thread capiscio_sdk/connect.py
Comment on lines +215 to +224
@property
def guard(self) -> "SimpleGuard":
"""Access the SimpleGuard instance for signing/verifying."""
if self._guard is None:
from .simple_guard import SimpleGuard
self._guard = SimpleGuard(
agent_id=self.did or self.agent_id,
base_dir=str(self.keys_dir.parent),
)
return self._guard
Comment thread capiscio_sdk/connect.py
Comment on lines +215 to +224
@property
def guard(self) -> "SimpleGuard":
"""Access the SimpleGuard instance for signing/verifying."""
if self._guard is None:
from .simple_guard import SimpleGuard
self._guard = SimpleGuard(
agent_id=self.did or self.agent_id,
base_dir=str(self.keys_dir.parent),
)
return self._guard
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Good point. The guard property now properly reuses the identity's key material (signing_kid, badge_token, keys_preloaded=True). I'll file a follow-up issue for adding unit test coverage for this property — it requires mocking the gRPC server which is better suited for integration tests.

Pass signing_kid, badge_token, and keys_preloaded to SimpleGuard
so the guard reuses the same identity provisioned by connect()
instead of creating an incompatible standalone instance.
@beonde
Copy link
Copy Markdown
Member Author

beonde commented May 22, 2026

Closing: duplicate of already-merged #72. Branch was erroneously re-pushed.

@beonde beonde closed this May 22, 2026
@beonde beonde deleted the fix/dx-audit-simpleguard branch May 22, 2026 03:07
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