feat(sdk)!: catch up to the current AgentDrive contract, state filter included - #16
Merged
Merged
Conversation
…er included
The vendored contract was AgentDrive's pre-port snapshot: compatibility
policy 1, 34 paths, imported from a repository that has not hosted the file
since the 2026-08-29 monorepo port. The live contract is policy 2 with 44
paths, so the SDKs were ten operations behind before this change and the
importer could not read the current file at all -- it asserted policy == 1
and pointed `source_repository` / `source_path` at the old coordinates.
Three fixes make the import possible, then the regeneration carries
everything at once:
* `SOURCE_REPOSITORY` / `SOURCE_PATH` now name
tokencanopy/tokencanopy and apps/drive/tests/openapi.golden.json, so a
provenance record points at a file that exists.
* The policy assertion is pinned to `SUPPORTED_POLICY_VERSION = 2` rather
than loosened to a floor. A bump is AgentDrive changing the rules its
contract is judged by; that is a decision to read, not to absorb.
* Regenerated python/typescript/go from the merged contract
(tokencanopy/tokencanopy@100aa364) with the pinned generator image.
The hand-written facades follow the renamed filter: `drives.list`,
`folders.list`, `artifacts.list`, `grants.list` and `shares.list` take
`state` where they took `lifecycle`, matching the query parameter the
generated clients now send. That rename is a BREAKING change for any caller
passing the option; the API rejects the old spelling outright, so an SDK
that kept it would only fail later and less clearly.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AiYiPkSwvRWDfthQUtx11Q
The facade option rename is breaking and the contract catch-up adds ten operations, so neither is a patch release. The generator does not own these version fields; it reads SDK_VERSION and leaves the committed manifests alone, which is why regeneration after the bump changes nothing. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AiYiPkSwvRWDfthQUtx11Q
The bump touched the two package manifests and stopped there, but the version lives in six places the contract suite pins together: both manifests, the lockfile, `agentdrive_sdk.__version__`, the Go README, and `generate-sdks.sh`'s own `SDK_VERSION` default. That last one is the load-bearing one -- CI regenerates without setting SDK_VERSION, so a stale default rewrites every generated metadata file back to the old version and the failure surfaces as generated-code drift rather than as the one number that was missed. Regenerating with the new default carries it into the generated clients too. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AiYiPkSwvRWDfthQUtx11Q
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.
Why
The vendored contract was AgentDrive's pre-port snapshot — compatibility policy 1, 34 paths, imported from a repository that has not hosted the file since the 2026-08-29 monorepo port. The live contract is policy 2 with 44 paths.
So this is not the one-parameter patch it looked like from the API side. The SDKs were ten operations behind before the rename existed, and the importer could not read the current contract at all: it asserts
policy == 1and pointssource_repository/source_pathat coordinates that no longer resolve.What
Three fixes make the import possible:
SOURCE_REPOSITORY→tokencanopy/tokencanopy,SOURCE_PATH→apps/drive/tests/openapi.golden.json, so a provenance record names a file that exists.SUPPORTED_POLICY_VERSION = 2rather than loosened to a floor (>= 1). A policy bump is AgentDrive changing the rules its contract is judged by — a decision to read deliberately, not one to absorb silently.Then the regeneration carries everything at once: python / typescript / go regenerated from
tokencanopy/tokencanopy@100aa364with the pinned generator image (digest unchanged), bringing the ten missing operations and their models.The facades follow the renamed filter.
drives.list,folders.list,artifacts.list,grants.listandshares.listnow takestatewhere they tooklifecycle, matching the query parameter the generated clients send after tokencanopy/tokencanopy#681. This is breaking for any caller passing the option — but the API rejectslifecycleoutright now, so an SDK that kept the old option name would only fail later and less legibly.Both packages go to 0.1.0: a breaking option rename plus ten new operations is not a patch.
Validation
python3 -m unittest discover -s tests— 28 passed (the import-helper suite, updated for the new coordinates).python3 -m scripts.check_contract_provenance— provenance and generator pin consistent.python3 scripts/check_operation_coverage.py— every contract operation present in all three generated SDKs.bash scripts/generate-sdks.sh && bash scripts/check-generated-freshness.sh— run again after committing: worktree clean, so regeneration is idempotent and CI's freshness gate will agree.sdk/python: 130 passed.sdk/typescript: 12 passed.sdk/go: builds clean (no test files).Not in this PR
Publishing.
publish.ymlis a separateworkflow_dispatchand needs a human decision — npm@tokencanopy/agentdrive-sdkand PyPIagentdrive-sdkare both public surfaces, and the Go module tag follows the version input.Worth knowing before that dispatch: anyone on 0.0.3 passing
lifecycleis already broken against the deployed API, because the rename shipped without an alias. Publishing 0.1.0 is the fix for them, not the break.🤖 Generated with Claude Code
https://claude.ai/code/session_01AiYiPkSwvRWDfthQUtx11Q