Repository navigation
Runnable examples, and integration fixtures that cannot be left behind - #62
Merged
Merged
Conversation
Every suite's cleanup sent Delete and ignored the answer. Agility refuses to delete a closed asset, so one batch test left its Story behind on every run. deleteFixtures deletes by exact OID, reactivates and retries what would not delete, and throws naming anything still there. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
Read, write, guarded write, batch with undo, errors, attachments, and testing with the fake. Each imports the package by name as a consumer does, cleans up what it creates, and refuses to write without V1_EXAMPLES_WRITE=1. npm run typecheck compiles them against the source; the integration tier runs each and fails on a non-zero exit or a slow run. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm
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.
Nothing in the published package changes (
examples/is not infiles). Headdefca1b, withmastermerged in.examples/: nine programs, one per task01-read.tsme()02-write.tsclient.send: create, update, an operation, theOutcome,unmatched03-guarded-write.tsclient.sendGuardedwith the Moment a person saw: a conflict as data and as an error04-batch-undo.tsclient.batch.runwith preview, confirmation and receipt;batch.reversible05-errors.tskindon everything thrown;client.explain06-attachments.ts07-testing.tsFakeAgilityClient, no instance08-custom-transport.tsTransportof your own (a timed wrapper), checked withtransportConformance09-browser-session.tscredentials,onUnauthorized, and when"retry-write"is the app's to answer@versionone/agility-sdkby name as a consumer does, and is run with plainnode examples/NN-….ts.sdk-integration example …, deletes them by exact OID in afinally, and refuses to start withoutV1_EXAMPLES_WRITE=1.09replacesfetchwith a small stand-in whose session expires on demand, so the re-authentication flow can be run anywhere; it says so at the top, and that in a browser the stand-in is deleted.npm run typechecknow compilesexamples/against the source (apathsentry intsconfig.jsonmaps the package's name tosrc), so an API change that breaks an example fails in CI on every push.test/integration/examples.test.tsruns each one against an instance and fails on a non-zero exit or a run over thirty seconds.Integration tier: a fixture left behind fails the suite
Writing the first example showed Stories named
sdk-integration batch aliased …on the testing instance: one per run of the tier, 29 in all. Every suite's cleanup sentDeleteand ignored the answer, and Agility refuses to delete a closed asset, which is how one batch test left its Story.deleteFixtures(transport, oids)intest/integration/instance.tsdeletes by exact OID, reactivates and retries what would not delete, and throws naming anything still there. Every suite'safterAlluses it.AGENTS.mdNow that it is on
master: it listsexamples/, says how the examples are kept true, and namesdeleteFixturesin the rule about live calls.Things a reviewer should know
.tsfile directly needs Node 22.18 or later;examples/README.mdsays so. The package itself still supports Node 22.dist/; otherwise it skips with the reason in the test's name. The scheduled integration workflow builds duringnpm ci, so it runs them.Verification
npm run verifyondefca1b: 234 unit tests in 30 files, all passing; the type-check includes the nine examples.sdk-integrationfixture of this SDK's.🤖 Generated with Claude Code
https://claude.ai/code/session_01Rgicmffzzwb2CzyeDSEhBm