Skip to content

feat: definition-site anchors in breadcrumbs and cycle paths (ERR-6)#291

Merged
lesnik512 merged 4 commits into
mainfrom
definition-sites
Jul 8, 2026
Merged

feat: definition-site anchors in breadcrumbs and cycle paths (ERR-6)#291
lesnik512 merged 4 commits into
mainfrom
definition-sites

Conversation

@lesnik512

Copy link
Copy Markdown
Member

The accepted ERR-6 item from the 2026-07-05 3.0 UX research: breadcrumb steps and cycle paths carry the Factory creator's definition site as a trailing (module:line) anchor — a production traceback now names both ends of a failure and where each was declared.

  • CaptureFactory.definition_site, lazy + memoized, error-path-only (zero declaration/import cost, verified by call-site grep): __code__.co_firstlineno free for functions, inspect.getsourcelines for classes, silent None for C callables/partials/pathological creators. Format module:line (maintainer-ruled), e.g. app.services:17.
  • BreadcrumbsResolutionStep gains a defaulted location; chain lines render UserService (app.services:17). Alias/ContextProvider steps stay bare.
  • CyclesCircularDependencyError gains cycle_locations (public .cycle_path stays bare list[str]); both construction sites (validate DFS + RecursionError conversion) pass anchors.
  • Never-raises invariant — anchor capture swallows everything (except Exception) with one reviewer-verified carve-out: a fresh RecursionError during capture propagates un-memoized so the runtime cycle guard's retry ladder re-converts with headroom — an instrumented probe confirmed anchors survive repeated stack exhaustion and no raw RecursionError escapes. Deterministic tests pin both branches.
  • Docs — Symptom anchors on scope-not-initialized-error/scope-skipped-error/circular-dependency (the pages anchored tracebacks land on); scope-chain notes it carries no chain; architecture/resolution.md + validation.md promoted.
  • Gatesjust test-ci (100% line coverage, 337 passed), just lint-ci, just docs-build --strict, just check-planning all green.

Downstream note for the next release: exact-message assertions may break on the new trailing anchors; substring match= survives (2.24.0-style note to carry in the notes).

Design bundle (rationale home): planning/changes/2026-07-08.04-definition-sites.md

🤖 Generated with Claude Code

lesnik512 and others added 4 commits July 8, 2026 17:10
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…e promotion (ERR-6)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tors (ERR-6)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@lesnik512 lesnik512 merged commit dd68cf9 into main Jul 8, 2026
7 checks passed
@lesnik512 lesnik512 deleted the definition-sites branch July 8, 2026 15:08
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.

1 participant