Skip to main content

A2A adapter service for Compass

Project description

compass-a2a

compass-a2a is the dedicated A2A adapter service for Compass.

It is intentionally positioned as a separate process boundary:

  • Compass stays the source of truth for LifeOS data and domain rules.
  • compass-a2a exposes an A2A-facing runtime surface for hub and peer agents.
  • The adapter can evolve independently from Compass internals.

Bootstrap Scope

This repository is initialized with:

  • uv for dependency and environment management
  • pre-commit for basic code quality checks
  • a minimal A2A server surface
  • a public agent card endpoint
  • HTTP Basic authentication bridged to Compass account credentials

Quick Start

uv sync --extra dev
cp .env.example .env
uv run pre-commit install
uv run compass-a2a

By default the server listens on http://127.0.0.1:8000.

Public endpoints:

  • GET /.well-known/agent-card.json
  • GET /.well-known/agent.json
  • GET /healthz

Protected endpoints:

  • POST /
  • POST /v1/message:send
  • POST /v1/message:stream
  • GET /v1/card

Authentication

Runtime access uses HTTP Basic authentication.

The adapter does not maintain its own account system. Instead, the Basic Auth username and password are treated as Compass login credentials. The current authenticated Compass identity is propagated into the request context so later Compass-facing logic can apply user-aware routing, token reuse, and policy.

The Basic Auth username should match the Compass login identifier currently expected by Compass, which is typically the account email.

The adapter does not inject user personalization fields such as locale or time zone. Those preferences remain owned by Compass itself.

Access tokens are cached in memory on a per-user basis, but they are no longer treated as unbounded session state. The adapter now applies token expiration, refresh skew, and cache size limits so expired or cold entries are recycled.

Optional cache tuning env vars:

  • COMPASS_A2A_TOKEN_CACHE_TTL_SECONDS
  • COMPASS_A2A_TOKEN_CACHE_REFRESH_SKEW_SECONDS
  • COMPASS_A2A_TOKEN_CACHE_MAX_ENTRIES

Capability Model

The current branch keeps a deliberate split between read skills and write commands.

  • Read skills are the current public capability surface.
  • Write commands are reserved for approval-aware mutations and have a separate execution path, even though no write commands are enabled yet.

The current bootstrap skill catalog internally uses Compass /agentic/* facade endpoints as the initial data source.

  • review_time_and_activity
  • search_personal_knowledge
  • review_planning
  • review_finance_state
  • review_vision_focus

Recommended invocation style is metadata-driven:

{
  "compass": {
    "skill": "review_planning",
    "arguments": {
      "view_type": "day",
      "selected_date": "2026-03-25T00:00:00Z",
      "include_notes": true
    }
  }
}

Contract rules for capability requests:

  • metadata.compass must be an object when provided
  • exactly one of metadata.compass.skill or metadata.compass.command may be set
  • metadata.compass.arguments must be a JSON object
  • slash-style read skill arguments must also be a JSON object
  • invalid capability contracts fail fast with an explicit adapter error instead of silently falling back to help text

Future write commands will use a separate metadata field:

{
  "compass": {
    "command": "create_note",
    "arguments": {
      "title": "Draft"
    }
  }
}

For quick manual testing, slash-style text commands also work:

/review_time_and_activity {"start_date":"2026-03-25T00:00:00Z","end_date":"2026-03-25T23:59:59Z"}

These Compass endpoints are treated as an internal bootstrap gateway, not as the long-term external A2A contract. Authentication is also bridged through Compass itself, so compass-a2a remains a thin protocol and policy layer.

Development

Run checks:

uv run pytest
uv run ruff check .
uv run ruff format --check .

Build and smoke test release artifacts locally:

uv build --no-sources
bash ./scripts/smoke_test_built_cli.sh dist/compass_a2a-*.whl
bash ./scripts/smoke_test_built_cli.sh dist/compass_a2a-*.tar.gz

Release

compass-a2a uses tag-driven releases.

  • Merge the release-ready commit into master
  • Create and push a version tag in the form vX.Y.Z
  • The publish workflow will only proceed when the tag commit is reachable from origin/master
  • The workflow builds artifacts, verifies that the package version matches the tag, publishes to PyPI, and creates a GitHub Release

PyPI publishing is configured for GitHub OIDC trusted publishing. The PyPI project must trust this repository and the publish.yml workflow before the first release can succeed.

Roadmap

This bootstrap intentionally keeps the runtime thin. The next steps are expected to include:

  • Compass API integration
  • approval-aware write operations
  • richer task execution and streaming behavior
  • durable task/session storage

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

compass_a2a-0.1.0.tar.gz (80.8 kB view details)

Uploaded Source

Built Distribution

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

compass_a2a-0.1.0-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file compass_a2a-0.1.0.tar.gz.

File metadata

  • Download URL: compass_a2a-0.1.0.tar.gz
  • Upload date:
  • Size: 80.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for compass_a2a-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6127cb9a5641d30ea6b7427c74981a603ea3f4040a4eec4c3322c47ade100d50
MD5 03c6b8a06f5dbc2abf9d371986c3f097
BLAKE2b-256 18c2b79387a3b92778f7aa6b5a0601b0190b0c5443950694a830a8d57150ac1d

See more details on using hashes here.

Provenance

The following attestation bundles were made for compass_a2a-0.1.0.tar.gz:

Publisher: publish.yml on liujuanjuan1984/compass-a2a

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

File details

Details for the file compass_a2a-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: compass_a2a-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 16.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for compass_a2a-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 982713cbcd45cfbc99589fc674c468fcda521dd3eab704bbf777a99208a459c8
MD5 de23e268d62bb50a0352a4422abe468b
BLAKE2b-256 cbf8ed7aabea81b5ae3cc538a6bae0e1ce61acdb5a2148cfd188e1cc6bba29cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for compass_a2a-0.1.0-py3-none-any.whl:

Publisher: publish.yml on liujuanjuan1984/compass-a2a

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