OSS-first docs
These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.
Google Drive
Google Drive is modeled as a storage and knowledge-ingestion provider with explicit delta watch state. The contract covers file listing, file retrieval, Drive watches, channel/resource expiry, replay checkpoints, dedupe, idempotency, and tombstones.
Provider contract
interface GoogleDriveProvider {
listFiles(query?: GoogleDriveListFilesQuery): Promise<GoogleDriveListFilesResult>;
getFile(fileId: string): Promise<GoogleDriveFile | null>;
watchChanges?(input: GoogleDriveWatchInput): Promise<GoogleDriveWatchResult>;
}The provider advertises storage.objects, knowledge.ingestion.drive, and provider.delta.watch. Runtime implementations should persist returned deltas before acknowledging sync work.
Delta-aware ingestion
await knowledge.syncDriveFiles(
{
query: "mimeType = 'text/plain' and trashed = false",
},
{
sourceId: "src_drive_support",
evidenceRef: "audit://sync/drive/support",
},
);
await knowledge.watchDriveChanges(
{
channelId: "drive-support-watch",
webhookUrl: "https://app.example.com/webhooks/google-drive",
},
{ sourceId: "src_drive_support" },
);Production checklist
- Persist `ProviderDeltaSyncState` per Drive source.
- Renew webhook channels before `webhookChannel.expiresAt`.
- Skip tombstoned files before indexing or mutating them.
- Record replay checkpoint and idempotency evidence for retries.
- Use mutation governance before changing permissions or sending outbound notifications.
Gmail integration
Ingest email threads through delta-aware provider contracts and governed outbound-send mutations.
Stripe integration
Bind payments and billing behavior without smearing provider logic across the codebase.
Why ContractSpec
Keep educational and comparison content reachable without letting it define the primary OSS learning path.