topdata: stop hardcoding the skills dataset location (#43)
sow-topdata moved skills into a tree (skills/core, skills/specs, skillcats, skillspecranks), which broke validate/build: the generated feat families hardcoded dataset "skills". Resolution is now data-driven: the family spec's child_source names the dataset, child slugs come from the row key's own namespace, and the wiki loader accepts both the flat and tree layouts (topdata main still uses the flat one until the overhaul merges). Verified against the skill-grouping-overhaul topdata branch: validate/build/wiki all clean with zero lock churn, focus feats stay on their adopted rows. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Reviewed-on: #43 Co-authored-by: vickydotbat <vickydotbat@tutamail.com> Co-committed-by: vickydotbat <vickydotbat@tutamail.com>
This commit was merged in pull request #43.
This commit is contained in:
@@ -569,11 +569,13 @@ func loadWikiContext(dataDir, sourceDir string) (*wikiContext, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
loadBase := func(name string) (nativeCollectedDataset, bool, error) {
|
||||
for _, dataset := range datasets {
|
||||
if dataset.Name == name {
|
||||
collected, err := collectNativeDataset(dataset)
|
||||
return collected, true, err
|
||||
loadBase := func(names ...string) (nativeCollectedDataset, bool, error) {
|
||||
for _, name := range names {
|
||||
for _, dataset := range datasets {
|
||||
if dataset.Name == name {
|
||||
collected, err := collectNativeDataset(dataset)
|
||||
return collected, true, err
|
||||
}
|
||||
}
|
||||
}
|
||||
return nativeCollectedDataset{}, false, nil
|
||||
@@ -583,7 +585,7 @@ func loadWikiContext(dataDir, sourceDir string) (*wikiContext, error) {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
skillDataset, skillOK, err := loadBase("skills")
|
||||
skillDataset, skillOK, err := loadBase("skills", "skills/core")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user