Repository navigation
0.3.0: one error tree, checks before requests, events, testing module - #5
Merged
Merged
Conversation
…nt rules - One error tree for every SDK language: MfaRequiredError is an AuthError, ConnectorTimeoutError a ConnectorError, FrontlineRequiredError a WrongLoginError; ApiError.server_message (message kept as an alias); NetworkError.request_sent; AccountError.find(type) - Every helper of both layers checks its arguments before signing in or sending anything - Retries: network failures and 5xx retried for idempotent requests and for sign-in and renewal (renewal only when the request never left); a 429 whose Retry-After exceeds the wait limit fails at once - Client(email, password, *, base_url=..., ...) - parse_first_alert_event accepts any non-empty string id; the payload is not final - Deduplicator flags only exact re-deliveries (same identity and canonical-JSON hash); upsert_key returns the id to store under Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FakeAPI.client(role="admin"|"user") returns a real Client wired to an in-memory fake. seed_customer() and seed_calls() add fictional data; connector_outcome, fail_write, network_down and rate_limit cover the failures callers must handle; requests and writes log every request. With strict=True (default) it refuses unknown paths and methods, unknown query parameters and bodies missing required fields, from the bundled spec. The unit tests now use it; tests/unit/fake_api.py re-exports it. Connector waits also count the check intervals slept, so a replaced sleep cannot spin for the full timeout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- README: retry policy with worst-case blocking time, the error tree, AccountError.find, the event rule (store by call id and upsert), First Alert payload not final, "Testing your code", "Running helpers from more than one process", "How many requests" (pinned by a test), links to the SDK pages; examples ship in the sdist, not the wheel - CHANGELOG 0.3.0 with a breaking-changes table; corrected the 0.2.0 activate_alerts line - Examples: Riverbend Auto Group, IC_ADMIN_* and IC_USER_* (IC_DATA_* as a fallback); the receiver skips only exact re-deliveries - Package metadata links to the SDK pages and a changelog; version 0.3.0 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…fake
- Token renewal resends a refresh token only after a 429 or a failure
that never left (connect, pool, local protocol, unsupported protocol);
a 5xx, a timeout after sending or an unreadable answer means sign in
- Client(deadline=120, clock=...) bounds one request with its sign-in,
renewal, retries and waits; each attempt's httpx phases share timeout
- List arguments are read once (generators work); every spec field and
argument is type-checked before any request
- Deduplicator.seen(event) checks and remember(event) records after the
durable write; is_duplicate is removed; a plain id is refused; stores
need has() and add(); a BOM no longer turns a body into an id
- First Alert ids and app-link ids must be [A-Za-z0-9_-]{1,128}; a
non-string top-level alert_id is refused rather than passed over
- due accepts only a date or YYYY-MM-DD on every Python version;
AccountError.find tolerates a non-exception cause attribute
- Testing module: refresh-token reuse ends every session; fail_next for
each HTTP and network failure; expire_access_tokens; auth_log; strict
mode checks top-level value types, enums, formats and unknown fields;
a small documented surface, internals underscored; transport= refused
- Examples and README follow check, store, remember; README states the
deadline bounds and the strict-mode limits; request counts measured
for the 2nd and 10th team
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…After rules, live Customers - Path arguments are checked where paths are built: 1-128 characters, not "." or "..", none of / \ ? # %, whitespace or controls; then percent-encoded. Helpers apply the same check before signing in - Free-text and number arguments must be real strings (at most 200) - Delivery keys hash the RFC 8785 canonical form (canonical_json) of the event as read; non I-JSON bodies are WebhookPayloadError - After Call events are refused exactly when a schema-required field is missing or wrongly typed; optional fields of the wrong type read None - Retry-After counts only as decimal seconds; otherwise backoff applies - A passed Customer is checked against the live location list and re-read when it differs; group and rule ids are read live; a Customer with another company's locations is refused; refreshed_at added - Testing module: fail_next(after_processing=False) fails before the platform acts; explicit patterns for numbers, dates, date-times and uuids; body enums and formats (generator keeps them in spec.json); secret-named values masked in the request log - Shared vectors in tests/unit/fixtures with tools/make_shared_vectors.py - README, CHANGELOG and request counts updated Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Validation patterns match the whole value (fullmatch); one explicit path rule (1-128 code points, no / \ ? # %, controls or whitespace, not "." or "..", never trimmed) for helpers, reference() and ids - Event bodies deeper than 64 levels are refused without recursion; call.id, location_id and First Alert ids must be plain ids; events with no string type key as "unknown" - Top-level body JSON types checked before sending for every method; allowed values left to the platform (no client-side enums, no connector-type list read before a connector write) - Sign-in is retried only after a failure that never left, a 5xx, or a 429 within the wait limit - Bodies, headers and webhook addresses travel in redacting types, so tracebacks captured with locals show no secrets; the fake's log hides URL paths - license_report reads the customer once; teams read earlier in the same call are not read again; request counts re-measured and pinned - README: retry table, Customer-object cost, a portable SQL row lock - Shared vectors regenerated (version 3) with path_argument_vectors Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…not a local path; README names no product for the shared store Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… in this run must be off Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…asured table Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Testing module:
- every request is logged with what answered it; auth_log logs every
sign-in and renewal attempt
- connector_outcome applies to attempts made after it is set;
settle_connector settles a waiting connector
- client(as_user=...) signs in as a seeded person (scope follows their
license); seed_customer returns people; seed_calls(recording, topics)
- fail_next(sign_in=...) for MFA, expired password, bad credentials
- strict=False lets an unlisted connector type through
- fake_behaviour_vectors.json: shared scenarios with a neutral format;
line_vectors.json; SHARED_VECTORS_VERSION 4
SDK:
- typed, frozen results for license_report, activate_alerts,
sync_lines, remove_user and offboard_customer, still readable by key
- lines must match +?[0-9*#]{1,32}; messages name the caller's
parameters; Member.teams lists every team; teams() puts Management last
- is_older and a receiver flow that never stores older data over newer
- a connector still settling on a re-run is checked and restarted once
- README: upgrading section, test hooks, set_alerts cost, the ten-team
total, activate_alerts measured under the stated conditions
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…r a team with calls Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
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.
What
Release 0.3.0. Built as a Python reference and ported, with the three SDKs held to the same shared test files.
NetworkError,AccountError.find, andserver_messageon API errors...could previously rewrite a request path.deadlineoption. A refresh token is sent again only after a rate limit or a failure where the request provably never left.seen/remember, and its keys follow RFC 8785 and are identical across the three SDKs.The changelog lists every breaking change.
Checks
Release order
The README links to documentation pages that go live with the docs release; merge and tag after that is published.
🤖 Generated with Claude Code