Skip to content

fix(catalog): record a snippet call as a snippet_call edge to the SNIPPET (#2017) - #2018

Merged
ako merged 1 commit into
mainfrom
fix/2017-snippet-call-refs
Nov 8, 2026
Merged

ako merged 1 commit into
mainfrom
fix/2017-snippet-call-refs

Conversation

@ako

@ako ako commented Nov 8, 2026

Copy link
Copy Markdown
Owner

Closes #2017.

Problem

A Forms$SnippetCall stores its snippet under Form, the same key a page action uses for its page. scanWidgetAllRefs reads every Form as a page, so each snippet call was recorded as a show_page edge to a PAGE. No refs row ever had TargetType = 'SNIPPET'. As a result, an architecture report concluded that the catalog records no references from layouts.

Change

  • widgets_data.SnippetRef: new column, also exposed as snippet_ref in Starlark.
  • snippet_call edges: each snippet call is now a snippet_call edge with TargetType = 'SNIPPET', from a page, a snippet or a layout. The new kind is in RefKinds, and SNIPPET is in RefTargetObjectTypes.
  • LAYOUT added to RefSourceObjectTypes: layouts have made edges since [up#1311] Catalog: the page's own Class/Style and the widgets of layouts are missing (widgets() covers pages and snippets only) #1302.
  • Two consumers that relied on the mislabel:
    • show callers now counts snippet_call. Without that, every snippet would read as uncalled.
    • SEC012's reachability walk now follows snippet_call. Its test fixture encoded the old show_page/PAGE shape.
  • Schema version 35, plus updates to the lint-rule skill, the catalog docs, a finding record and the CHANGELOG.

Evidence

  • Test written first: TestSnippetCallIsASnippetEdge_Issue2017 covers a layout and a page that each call a snippet. A button that opens a real page is the control and stays show_page. Before the fix the test failed with the reported symptom: kind:show_page targetType:PAGE and PageRef = "L.SNIP_Tabbar".
  • Controls: reverting the Form routing makes the catalog test fail again. Reverting SEC012's traversal makes TestReachablePageRead_ReachabilityMatchesMxbuild fail, because P_FromSnippet is no longer reached.
  • FactoryManagement (11.16), full catalog, main vs. this branch:
    • Snippet calls recorded as snippet_call edges to a SNIPPET:

      From Count
      Layouts 22
      Pages 182
      Snippets 107
    • show_page edges that point at a snippet: 0. Every other show_page count is unchanged.

    • Snippets with no inbound edge of any kind: 35 on both builds, so no snippet lost its references.

    • mxcli refs and show callers on Evora_UI.SNIP_FeedbackWidget list its six layouts as snippet_call.

    • Lint output is identical: 254 findings with the built-in rules and 1834 with the 31 bundled Starlark rules.

  • make ci-local passes except check-skill-pack-js, which needs node, and node isn't installed in this container. The targets after it pass when run on their own.

🤖 Generated with Claude Code

…PPET (#2017)

A Forms$SnippetCall stores its snippet under "Form", the key a page
action uses for its page, and scanWidgetAllRefs read every Form as a
page. Every snippet call became a show_page edge to a PAGE and no refs
row ever had TargetType SNIPPET: on FactoryManagement (11.16) 311 of
them, 22 from layouts, so a query for what uses a snippet by type found
nothing.

widgets gains SnippetRef (snippet_ref in Starlark), refs gains the
snippet_call kind, and LAYOUT joins RefSourceObjectTypes now that
layouts make edges (#1302). show callers counts the new kind and SEC012
walks it, both of which had relied on the show_page mislabel. Schema 35.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

Catalog records a snippet call as show_page to a PAGE; no refs target a SNIPPET

1 participant