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.

AI index

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

google-drive-provider.ts
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

drive-sync.ts
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.
OSS docsintegrationsStart with OSS. Adopt Studio when you want the operating layer.

Why ContractSpec

Keep educational and comparison content reachable without letting it define the primary OSS learning path.