Skip to content

feat: implement error inheritance model for access codes#1228

Merged
razor-x merged 5 commits into
mainfrom
claude/error-docs-inheritance-xkaso1
Jul 3, 2026
Merged

feat: implement error inheritance model for access codes#1228
razor-x merged 5 commits into
mainfrom
claude/error-docs-inheritance-xkaso1

Conversation

@razor-x

@razor-x razor-x commented Jul 2, 2026

Copy link
Copy Markdown
Member

Summary

Implement a new error grouping model for resources that inherit errors from parent resources. This change reorganizes error documentation to show a resource's own errors first (grouped by variant group), followed by inherited errors from parent resources (in flat groups per parent).

Key Changes

  • New variantsToEntries() helper function — Extracted common logic for converting variants to sorted code entries, used by both groupCodes() and the new groupErrorCodes() function.

  • New groupErrorCodes() function — Implements the inheritance model:

    • Groups a resource's own errors (flagged with is_<resourceType>_error) by variant group, matching the existing groupCodes() behavior
    • Groups inherited errors from parent resources (other is_<parent>_error flags) into flat groups per parent, with parent resource names as headings
    • Supports an optional allowlist to restrict inherited error groups (e.g., access codes only show lock-related inherited errors, not device-level ones)
    • Handles unmanaged resources that reuse their managed counterpart's error flag
  • New resourceTypeNoun() helper — Converts resource type identifiers (e.g., connected_account) into display nouns (e.g., Connected Account) for inherited error group headings.

  • Configuration for inheritance — Added INHERITED_ERROR_GROUP_ALLOWLIST to define which variant groups are relevant for each resource type, and inheritanceResourceType option to ErrorPageOptions.

  • Updated error page generation — Modified writeErrorPage() to use groupErrorCodes() when inheritanceResourceType is specified, enabling the inheritance model for per-resource pages while preserving the existing behavior for device sub-category pages.

  • Regenerated error documentation — Access code and device error pages now display errors organized by the inheritance model, with own errors first (sorted alphabetically), followed by inherited errors grouped by parent resource (Bridge, Connected Account, Device).

Implementation Details

  • Errors without any resource flag are treated as belonging to the resource itself (some resources don't tag their errors)
  • Parent error keys are extracted dynamically from variant properties and sorted alphabetically
  • The allowlist filtering ensures only relevant inherited error groups appear on resource pages
  • All error codes within groups remain sorted alphabetically for consistency

https://claude.ai/code/session_01TgmnJeFSgiQhfptLskubdh

claude and others added 2 commits July 2, 2026 22:58
Render resource error pages in two parts: first the errors that belong
to the resource itself (matching `is_<resource>_error`), grouped by
variant group as before; then, for each parent resource whose errors the
resource inherits (other `is_<parent>_error` flags), a single flat group
per parent (variant groups ignored), headed by the parent's noun.

Errors that carry no resource flag remain the resource's own errors, and
unmanaged resources reuse their managed counterpart's flag
(`is_access_code_error`), so their own errors are identified correctly.

On the access code pages, inherited errors are limited to the ungrouped
and Locks variant groups; device categories like thermostats are not
relevant there.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TgmnJeFSgiQhfptLskubdh
@mintlify

mintlify Bot commented Jul 2, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
seam 🟢 Ready View Preview Jul 2, 2026, 11:12 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Use the blueprint's `variant.resourceType` field (added in
@seamapi/blueprint 0.56.0) to split a resource's errors into its own and
inherited groups, replacing the `is_<resource>_error` marker-property
parsing. Each error names exactly one owning resource, so inherited
errors group cleanly under a single parent and never appear twice.

This corrects two cases the marker approach got wrong: `acs_system`
errors (e.g. `bridge_disconnected`) are its own, not inherited from a
bridge; and errors that carried several markers (e.g. `account_disconnected`,
`bridge_disconnected`) no longer duplicate across parent groups.

Bumps @seamapi/blueprint to ^0.56.0 for the field.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TgmnJeFSgiQhfptLskubdh
@razor-x razor-x marked this pull request as ready for review July 2, 2026 23:16
@razor-x razor-x requested review from a team as code owners July 2, 2026 23:16
Each inherited-error group now opens with a <Note> explaining that the
codes belong to a parent resource and are surfaced here when set on it,
linking to the parent resource's own errors page.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TgmnJeFSgiQhfptLskubdh
@razor-x razor-x merged commit 30db4fd into main Jul 3, 2026
12 checks passed
@razor-x razor-x deleted the claude/error-docs-inheritance-xkaso1 branch July 3, 2026 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants