Repository navigation
fix(resolver): lookup_table precedence, known_values/open_pattern & canonical name extraction - #65
Merged
Merged
Conversation
…anonical name extraction - Implement lookup_table precedence over url template in resolveChildUrl and type/namespace-scoped searches, and include lookup_table in has_url index flags (SecID#177). - Close nodeMatches when known_values is a non-empty string[] array (with or without open_pattern: true) or a non-empty Record<string, string> on an open node, and propagate open to TypeIndex.child_index (SecID#190). - Export single-source-of-truth extractNameSlug(node, matchedName?) that preserves escaped literal dots (^[\w.-]+$) and echoes matchedName for regex source patterns so canonical SecIDs round-trip (SecID#181). Refs: CloudSecurityAlliance/SecID#177 Refs: CloudSecurityAlliance/SecID#181 Refs: CloudSecurityAlliance/SecID#190 AI-Agent: Gemini
…puts AI-Agent: Gemini
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.
Agent: Gemini (SecID governing agent)
Summary
Addresses the three resolver bugs in Group A:
lookup_tableprecedence overurltemplate (CloudSecurityAlliance/SecID#177):resolveChildUrlnow checkschild.data.lookup_table(Object.hasOwn(table, subpath)) beforechild.data.url, implementing the precedence documented inREGISTRY-JSON-FORMAT.md(lookup_tableoverridesurlfor keys in the table, andurlserves as fallback for matching IDs not inlookup_table).namespaceScopedSearchandtypeScopedSearchalso resolve URLs forlookup_table-only nodes viaresolveChildUrl.scripts/upload-registry-kv.tsandtest/helpers/seed-kv.tssethas_url: !!(child.data?.url || child.data?.lookup_table)on child index entries.known_valuesclosing &open_patternpropagation (CloudSecurityAlliance/SecID#190):MatchNodeData.known_valuestoRecord<string, string> | string[].nodeMatchesso a non-emptystring[]known_valuesarray always closes the set (both unscoped and scoped, regardless of whether sentinel probing classifies the regex as open), and a non-emptyRecord<string, string>map closes the set whenisNodeOpen(node)is true.open?: booleantoChildIndexEntryand updatedcrossSourceCandidatesinsrc/kv-resolve.tsto checke.open ?? isOpenPattern(e.patterns)soopen_pattern: truechild nodes inTypeIndex.child_indexare excluded from tight cross-source candidate selection.Single-source-of-truth
extractNameSlug(CloudSecurityAlliance/SecID#181):patternLiteralandextractNameSlug(node, matchedName?)fromsrc/resolver.tsand imported it inscripts/upload-registry-kv.ts,test/helpers/seed-kv.ts, andtest/resolver.test.ts(eliminating 3 duplicate copies).patterns[0]viapatternLiteral+/^[\w.-]+$/while rejecting unescaped wildcard dots.matchedNamewhenpatterns[0]is a regex template so canonical SecIDs round-trip cleanly.Verification & Reviews
npm run typecheck— cleannpm test— 17 test files, 1,358 tests passedcodex review --base main; caught excess object literal propertiesweight/datainextractNameSlugunit test inputs, fixed in5fa7c2e).Refs: CloudSecurityAlliance/SecID#177
Refs: CloudSecurityAlliance/SecID#181
Refs: CloudSecurityAlliance/SecID#190