**Scope Audited**
`module/` release/wiki wrapper flow and `toolkit/` wiki generation cache logic.
**Changes Made**
Root cause was stale wiki cache reuse. The generator cache considered digest + page count, but not generator version, so a restored VPS cache with old generated output could skip regeneration.
Changed [wiki_native.go](/home/vicky/Projects/nwnee-shadowsoverwestgate/toolkit/internal/topdata/wiki_native.go:29) to bump the wiki generator to `nodebb-tiptap-html-v3`, and changed [wiki_native.go](/home/vicky/Projects/nwnee-shadowsoverwestgate/toolkit/internal/topdata/wiki_native.go:268) so cached pages are current only when `state.version` matches.
**Configuration/Schema Impact**
No YAML/config/schema changes. Existing `.cache/wiki/state.json` files with `nodebb-tiptap-html-v2` will be invalidated and regenerated.
**Compatibility Impact**
This is compatible with existing caches; it only forces one regeneration when the new toolkit runs. After that, normal digest-based skipping resumes.
**Tests Added**
Added [TestBuildWikiRegeneratesOldGeneratorCache](/home/vicky/Projects/nwnee-shadowsoverwestgate/toolkit/internal/topdata/wiki_native_test.go:183), which simulates a `v2` cache and verifies `build-wiki` regenerates it.
**Validation Performed**
- Confirmed new test failed before the fix with `wiki status "skipped"`.
- `go test ./internal/topdata -count=1` passes.
- `./build-tool.sh` succeeds.
- `SOW_TOOLS_DEV_BINARY=../toolkit/tools/sow-toolkit ./build-wiki.sh` now reports:
- `wiki pages: 1163`
- `wiki status: generated`
- Local generated race pages: `17`.
**Remaining Risk / VPS Next Step**
The VPS release job must use this rebuilt/published toolkit. On the next run, you should see the wiki build regenerate once before deploy, and deploy should load `1163` local pages instead of `1092`, including `races:*` pages.
### Summary
- Change generated topdata wiki links to target public wiki namespace and canonical slug paths.
- Add generated public path metadata to wiki page generation and page-index output.
- Add YAML-driven generated slug overrides and public-target collision validation.
### Details
- Generated relation links now render public targets such as:
- `[[feat/hardiness-vs-enchantments|Hardiness vs. Enchantments]]`
- `[[feat/favored-enemy-elves|Favored Enemy: Elves]]`
- Topdata page IDs remain the internal identity for output layout, managed markers, deploy state, and bookkeeping.
- Generated managed markers now include the effective public slug:
- `<!-- sow-topdata-wiki:page=... wiki_slug=... -->`
- Page-index entries now include:
- `public_slug`
- `public_target`
- Added parsing and validation for `page_paths.slug_overrides` from `topdata/wiki/wiki.yaml`.
- Generated public targets are validated for duplicate namespace-local collisions.
- Table link helpers now derive public targets from target page titles when available, so display aliases do not accidentally change link destinations.
### Tests
- Added and updated coverage for:
- public target rendering
- marker `wiki_slug` output
- page-index public metadata
- duplicate generated public target rejection
- slug override parsing and validation
- override-driven target selection
- target title slugging independent of display labels
### Validation
- `go test ./...`
- `gofmt -w` on changed Go files
- `./build-tool.sh`
- `git diff --check`
Reviewed-on: https://gitea.westgate.pw/ShadowsOverWestgate/sow-tools/pulls/6
Co-authored-by: vickydotbat <vickydotbat@tutamail.com>
Co-committed-by: vickydotbat <vickydotbat@tutamail.com>
**Scope Audited**
- Module wiki visibility config and docs.
- Toolkit wiki expression engine and visibility tests.
- Feat prerequisite rendering/reference behavior.
**Changes Made**
- Added `hidden_ref(Field, "dataset")` and `all_hidden_refs(..., "dataset")` helpers in [wiki_tables.go](/home/vicky/Projects/nwnee-shadowsoverwestgate/toolkit/internal/topdata/wiki_tables.go:914).
- Added feat visibility exclusions in [visibility.yaml](/home/vicky/Projects/nwnee-shadowsoverwestgate/module/topdata/wiki/visibility.yaml:44) for:
- `PREREQFEAT1`
- `PREREQFEAT2`
- `REQSKILL`
- `REQSKILL2`
- `OrReqFeat0..OrReqFeat4`
- Documented the helpers in [README.md](/home/vicky/Projects/nwnee-shadowsoverwestgate/module/topdata/wiki/README.md:53).
- Added coverage in [wiki_native_test.go](/home/vicky/Projects/nwnee-shadowsoverwestgate/toolkit/internal/topdata/wiki_native_test.go:646).
**Configuration/Schema Impact**
- No schema file change. `visibility.yaml` can now use the two new expression helpers.
**Compatibility Impact**
- Existing visibility expressions are unchanged.
- Missing or `****` prerequisite fields are ignored.
- Present references that resolve to hidden or missing wiki rows are treated as unreachable.
**Tests/Validation**
- Confirmed the new test failed before implementation on unknown helper.
- Ran `go test ./internal/topdata -run TestWikiVisibility`.
- Ran `go test ./internal/topdata`.
- Rebuilt toolkit with `./build-tool.sh`.
- Ran module wiki build with local toolkit:
`SOW_TOOLS_DEV_BINARY=../toolkit/tools/sow-toolkit ./build-wiki.sh`
Result: `wiki pages: 771`.
## Summary
- add YAML-backed generated wiki visibility policies for topdata datasets
- centralize page and reference eligibility through a visibility index
- cover eligibility helpers, metadata precedence, derived feat sets, and link suppression with toolkit tests
## Verification
- go test ./...
- module ./validate-topdata.sh with the feature toolkit binary
- module ./build-wiki.sh --force with the feature toolkit binary
Companion module branch: codex-wiki-visibility.
Reviewed-on: https://gitea.westgate.pw/ShadowsOverWestgate/sow-tools/pulls/4
Co-authored-by: vickydotbat <vickydotbat@tutamail.com>
Co-committed-by: vickydotbat <vickydotbat@tutamail.com>
Changes Made
- page-index.json now includes generated meta/status pages, not just entity pages.
- Wiki page count now comes from the final page index, so wiki pages: matches generated HTML files.
- Page IDs now normalize /, \, and _ to : to prevent duplicate index entries for slash-bearing keys.
- Added page-index validation for duplicate page_id and duplicate output_path.