Closed
Conversation
Foundation library for building DoubleAgent fake services. 12 modules: State management: - StateOverlay: copy-on-write state (immutable baseline + mutable overlay + tombstones) - NamespaceRouter: per-agent isolation via X-DoubleAgent-Namespace header Snapshot infrastructure: - snapshot.py: disk storage (manifest + per-type JSON files) - connector.py: abstract SnapshotConnector interface for pulling real SaaS data - airbyte_adapter.py: Docker-based Airbyte source connector integration - airbyte_pull.py: CLI entry point for Airbyte pulls (PyAirbyte + Docker backends) - pyairbyte_backend.py: PyAirbyte wrapper (no Docker required) - smart_filter.py: relational graph traversal for smart seeding Data safety: - redactor.py: deterministic PII anonymization preserving referential integrity - http_readonly.py: GET/HEAD-only HTTP client with SSRF protection Extras: - webhook_simulator.py: delivery with retry, HMAC signatures, audit log - dual_target.py: fake-vs-real contract comparison helpers - generic_server.py: zero-code snapshot explorer (FastAPI) 22 tests across 8 test files. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This was referenced Feb 15, 2026
Contributor
|
@zozo123 this is something i decided to avoid for now - i don't want to make agents to learn our SDK for implementation - they can just do it however they like (its not a lot of code to reimplement) |
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Foundation library for building DoubleAgent fake services. Every fake service imports this SDK instead of reinventing state management, snapshot loading, PII redaction, and webhook delivery.
12 modules, 4,475 lines, 22 tests:
State management
state_overlay.py— Copy-on-write state: immutable snapshot baseline + mutable overlay + tombstones.reset()returns to baseline in O(1).namespace.py— Per-agent isolation. Multiple AI agents share one baseline but get independent overlays viaX-DoubleAgent-Namespaceheader.Snapshot infrastructure
snapshot.py— Disk storage at~/.doubleagent/snapshots/<service>/<profile>/. Manifest + per-type JSON files. Incremental merge support.connector.py— AbstractSnapshotConnectorinterface for pulling real SaaS data.airbyte_adapter.py— Docker-based Airbyte source connector integration (666 lines, handles discover/read/state).airbyte_pull.py— CLI entry point fordoubleagent snapshot pullwhen using Airbyte connectors. Dual backend: PyAirbyte (default, no Docker) or Docker.pyairbyte_backend.py— PyAirbyte wrapper (ab.get_source()+get_records()). No Docker required.smart_filter.py— Breadth-first relational graph traversal for smart seeding (e.g., 3 projects → follow to issues → follow to comments, with per-parent limits).Data safety
redactor.py— Deterministic PII anonymization. Same email always maps to sameuser-N@doubleagent.local, preserving referential integrity across resources.http_readonly.py— GET/HEAD-only HTTP client with SSRF protection. Ensures connectors never accidentally mutate production data.Extras
webhook_simulator.py— Delivery with retry + exponential backoff, HMAC-SHA256 signatures, localhost-only allowlist, queryable audit log.dual_target.py— Fake-vs-real contract comparison. WhenDOUBLEAGENT_DUAL_TARGET=1,@readonlytests run against both targets and diff responses.generic_server.py— Zero-code FastAPI snapshot explorer. Any Airbyte-backed service can use this as its server with no custom code.Test plan
uv run pytest -v)🤖 Generated with Claude Code