← Docs hub

08 — Make wikilink stripping configurable

Read first

Problem

After every synthesis, _strip_unresolved_wikilinks replaces every [[Target]] whose page does not exist with plain text. This keeps link_integrity clean, but it is permanent. If the user creates the missing page later, the old source pages no longer link to it.

Some users prefer red links: they show what the wiki should contain.

Required change

Add a boolean option, default True to preserve current behavior.

  1. Add a parameter to synthesize_new_sessions:

```python strip_unresolved_wikilinks: bool = True,


2. Guard the cleanup block:

 ```python
 if strip_unresolved_wikilinks and summary["synthesized"] > 0:
     ...
  1. In cmd_synthesize, read the config:

```python strip_links = bool(synth_cfg.get("strip_unresolved_wikilinks", True))


 Pass it to `synthesize_new_sessions`.

4. Add the key to `examples/sessions_config.json`:

 ```json
 "strip_unresolved_wikilinks": true
  1. Document the trade-off in one sentence in the synthesis block comment. Keep it short.

Do not change _strip_unresolved_wikilinks itself.

Tests

Add to tests/test_synth_pipeline.py:

Use the existing _seed_raw helper or copy its fixture shape. Do not touch the real wiki.

Verification

.venv/bin/python -m pytest tests/test_synth_pipeline.py -q
.venv/bin/python -m pytest tests/ -q
.venv/bin/python -m sessionwiki lint

Expected: tests pass, lint reports 0 errors, and the default behavior is unchanged.

Acceptance criteria

Out of scope

Rollback

Remove the parameter and the config key. Default behavior does not change, so no data migration is needed.