feat(sequence-diagram): carry AppMap labels on diagram actions#2369
Open
kgilpin wants to merge 1 commit into
Open
feat(sequence-diagram): carry AppMap labels on diagram actions#2369kgilpin wants to merge 1 commit into
kgilpin wants to merge 1 commit into
Conversation
Each function/RPC/query action now records the AppMap labels applied to its callee code object (sorted, omitted when empty), so consumers can read labels straight from the exported sequence diagram instead of re-joining against the raw AppMap classMap. Labels are not folded into `digest`/`subtreeDigest`, so a pure re-label is not treated as a behavioral change — labels are a classification signal, not a behavioral one. The JSON formatter serializes the whole diagram, so the new field flows into `--format json` output with no formatter change. Motivated by the gold-traces behavioral-diff work, which classifies the severity of a detected change by whether the changed node is security-labeled. Co-Authored-By: Claude Opus 4.8 <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
Each diagram action (function call, HTTP server/client RPC, SQL query) now records the AppMap labels applied to its callee code object, as a sorted
labels?: string[]field — omitted when empty.Why
Labels live only in the raw AppMap
classMapand were dropped on sequence-diagram export. Consumers that wanted them (notably the gold-traces behavioral-diff work, which raises the severity of a detected change when the changed node is security-labeled) had to re-join the diagram against the raw AppMap. This makes the exported diagram self-contained: one source of truth for the analysis.Design notes
labelsis not folded intodigest/subtreeDigest(those derive frombuildStableHash/stableProperties). A pure re-label is therefore not a behavioral change — labels are a classification signal, not a behavioral one.formatter/json.tsserializes the whole diagram, solabelsflows into--format jsonautomatically. Text/PlantUML are unchanged (could annotate labeled calls later if desired).calleecode object.Testing
yarn test— 40 passed (3 new: label reported on a labeled action,undefinedon an unlabeled one, and labels excluded from the digest).yarn lint— 0 errors.sequence-diagram --format json:🤖 Generated with Claude Code