sightmap: use the shared sightmap library instead of a local YAML walker - #10
Merged
Conversation
internal/sightmap re-implemented the same .sightmap/ YAML flattening the sightmap/sightmap library already owns (selector descendant-combinator composition, memory/tags normalization, $ref expansion) — duplicated logic that could drift from the library's own semantics. Import the library instead. - Collect now calls sightmap.Load + Corpus.AllComponents, projecting each match.SightmapComponent onto the existing wire shape. FindRoot (walk-up directory discovery) stays local — the library takes a directory directly and has none of its own. - Component gains a Tags field (author classification labels, e.g. `defect`), populated via the library now that it supports them. - Behavior change: a child component no longer inherits its parent's source: when it doesn't declare its own, matching the library's existing memory/stability/properties convention (only the selector prefix cascades). Flagged in the changeset. - Deleted flatten/rawComp/rawFile/toStringSlice/parseFile/findFiles; their test coverage moved to the library (sightmap/sightmap#102). Pinned to a commit hash for now since sightmap/sightmap's Go module isn't tagged past v0.15.10 (a subdirectory-module tagging gap tracked upstream).
The previous pin pointed at the pre-rebase commit; the PR was rebased onto main after this branch was pinned, rewriting its hash. No code change on either side — same content, new commit object.
sightmap/sightmap#102 merged and v0.17.0 shipped (dual-tagged v0.17.0 + go/v0.17.0), so the pseudo-version pin from before the release is no longer needed.
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.
Summary
internal/sightmapre-implemented the same.sightmap/YAML flattening thesightmap/sightmaplibrary already owns. SwapCollecttosightmap.Load+Corpus.AllComponents()instead of a hand-rolled walker.ComponentgainsTags(authored classification labels, e.g.defect), populated now that the library supports them — previously dropped entirely.source:when it doesn't declare its own, matching the library's existingmemory/stability/propertiesconvention. Covered in the changeset.FindRoot(walk-up.sightmap/discovery) stays local — the library takes a directory directly and has no discovery of its own.flatten/rawComp/rawFile/toStringSlice/parseFile/findFiles; equivalent coverage now lives in the library (sightmap/sightmap#102).Dependency note
Pinned
github.com/sightmap/sightmap/goto a commit hash (v0.0.0-20260730124557-a6d4dc74210f) rather than a released version — the module's Go tags stop atv0.15.10and don't cover thego/subdirectory-module path, so@latestdoesn't resolve to anything containing this change yet. That's a known upstream gap, not something to fix here. Re-pin once sightmap/sightmap#101 and #102 land and tag.