From 4f95a55c70c40e4aadb4445b8122d1bf04ad9540 Mon Sep 17 00:00:00 2001 From: Hector Date: Tue, 16 Jun 2026 11:39:40 +0200 Subject: [PATCH] chore(wiki): maintenance-system v1.0 (lint script + test suite + subagent templates) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Plan abgestimmt mit k9ert im RamaDama-Topic 2026-06-16. Detection/Execution-Trennung: scripts/wiki-lint.sh ist mechanisch (kein LLM), Subagent-Spawn nur für Fixes. Includes: - scripts/wiki-lint.sh (v0.1, 360 lines, 8 checks, exit 0/1/2) - scripts/wiki-lint-test.sh (17 asserts, 3 fixtures, all green) - scripts/test-fixtures/wiki-lint/{clean,messy,broken}-wiki/ - scripts/subagents/{wiki-lint-runner,frontmatter-migration}.md - wiki/tasks/maintenance-todo.md (WMT-001..006, WMT-000 done) - AGENTS.md v1.4 (Maintenance-Section hinzugefügt) - wiki/log.md (Eintrag) - scripts/wiki-lint-report.md (erster Lint-Run: 46 Pages, 2 Issues) Erste Lint-Befunde (siehe Report): - 12 Wiki-Pages ohne Frontmatter - 14 Stubs (30% Quote) Co-Authored-By: Hector --- AGENTS.md | 21 +- scripts/subagents/frontmatter-migration.md | 70 ++++ scripts/subagents/wiki-lint-runner.md | 60 +++ .../broken-wiki/raw/blog/orphan-source.md | 8 + .../wiki/architecture/broken-link-source.md | 2 + .../wiki/concepts/llm/llm-with-broken-link.md | 12 + .../broken-wiki/wiki/tools/orphan-tool.md | 2 + .../clean-wiki/raw/blog/test-blog.md | 8 + .../wiki/architecture/memory-system.md | 39 ++ .../wiki/concepts/llm/llm-fusion.md | 30 ++ .../clean-wiki/wiki/tools/anthropic-claude.md | 33 ++ .../messy-wiki/raw/xpost/uncovered-test.md | 6 + .../wiki/architecture/memory-system.md | 2 + .../wiki/concepts/polymarket-arbitrage.md | 2 + .../wiki/tools/polymarket-monitoring.md | 2 + scripts/wiki-lint-report.md | 112 ++++++ scripts/wiki-lint-test.sh | 120 ++++++ scripts/wiki-lint.sh | 360 ++++++++++++++++++ wiki/log.md | 31 ++ wiki/tasks/maintenance-todo.md | 87 +++++ 20 files changed, 1006 insertions(+), 1 deletion(-) create mode 100644 scripts/subagents/frontmatter-migration.md create mode 100644 scripts/subagents/wiki-lint-runner.md create mode 100644 scripts/test-fixtures/wiki-lint/broken-wiki/raw/blog/orphan-source.md create mode 100644 scripts/test-fixtures/wiki-lint/broken-wiki/wiki/architecture/broken-link-source.md create mode 100644 scripts/test-fixtures/wiki-lint/broken-wiki/wiki/concepts/llm/llm-with-broken-link.md create mode 100644 scripts/test-fixtures/wiki-lint/broken-wiki/wiki/tools/orphan-tool.md create mode 100644 scripts/test-fixtures/wiki-lint/clean-wiki/raw/blog/test-blog.md create mode 100644 scripts/test-fixtures/wiki-lint/clean-wiki/wiki/architecture/memory-system.md create mode 100644 scripts/test-fixtures/wiki-lint/clean-wiki/wiki/concepts/llm/llm-fusion.md create mode 100644 scripts/test-fixtures/wiki-lint/clean-wiki/wiki/tools/anthropic-claude.md create mode 100644 scripts/test-fixtures/wiki-lint/messy-wiki/raw/xpost/uncovered-test.md create mode 100644 scripts/test-fixtures/wiki-lint/messy-wiki/wiki/architecture/memory-system.md create mode 100644 scripts/test-fixtures/wiki-lint/messy-wiki/wiki/concepts/polymarket-arbitrage.md create mode 100644 scripts/test-fixtures/wiki-lint/messy-wiki/wiki/tools/polymarket-monitoring.md create mode 100644 scripts/wiki-lint-report.md create mode 100755 scripts/wiki-lint-test.sh create mode 100755 scripts/wiki-lint.sh create mode 100644 wiki/tasks/maintenance-todo.md diff --git a/AGENTS.md b/AGENTS.md index aba4d60..008e9a1 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -247,6 +247,25 @@ Periodisch durchführen, wenn das Wiki wächst. Prüfe: - **Fehlende Seiten**: Wichtige Konzepte ohne eigenen Eintrag - **Missing Cross-References**: Verpasste Verlinkungen +**Mechanischer Lint:** `scripts/wiki-lint.sh` führt deterministische Checks aus (Stubs, Frontmatter, Broken-Refs, Orphans, Dup-Cluster, File-Count, Stale, Raw-Coverage). Output: `scripts/wiki-lint-report.md`. Exit 1 bei Issues. Tests: `scripts/wiki-lint-test.sh` (17 Asserts, 3 Fixtures). **Kein LLM im Detection-Pfad** — Agent liest nur den Report und entscheidet, welche Subagents für Fixes zu spawnen sind. + +### 5. Maintenance-ToDos + +Wiki-Pflege läuft über `wiki/tasks/maintenance-todo.md` (versioniert). Schema: + +- IDs: `WMT-XXX` (Wiki-Maintenance-ToDo) +- Status: `planning` (Vorschlag wartet) → `in-progress` (Subagent läuft) → `done` (Datum + Commit-Hashes) +- Pro ToDo: Category, Effort, Subagent-Template-Verweis +- Subagent committet Arbeit + ToDo-Update im finalen Commit + +**On-Demand-Trigger:** Im RamaDama-Topic schreiben `wiki-do WMT-XXX` → Hauptagent parsed, schiebt ToDo auf `in-progress`, spawnt den passenden Subagent. + +**Subagent-Templates:** `scripts/subagents/{name}.md`. Jedes Template beschreibt Input, Aufgabe, Constraints, Commit-Pattern, Failover-Modellkette (`ollama/glm-5.1 → ollama/minimax-m3 → ollama/deepseek-v4-flash:cloud → ollama/glm-5`). + +**Reporting:** Jede Aktion → Topic-Post in RamaDama. Drei Report-Typen: Lint-Report (mechanisch), Subagent-Action-Report (was gemacht), Weekly-Summary. + +**Vollständige Architektur-Doku:** siehe `wiki/tasks/maintenance-todo.md` "Wie es läuft" + Memory `12fd8a00-f6c4-4a03-b195-5d7da3efa469`. + --- ## DuckDB-MCP (für Such-Operationen) @@ -320,4 +339,4 @@ Wenn wikifyen → **subagent spawnen** (isolated). Kein Reply nötig. Der Subage 2. Rohdaten-Sammeln: Links aus aktuellem Chat → als raw-Dateien ablegen 3. Ingest-Run: Agent verarbeitet raw/ → wiki/ -*Erstellt: 2026-06-05 | Schema-Version: 1.3 (2026-06-15: `concepts/` in `llm/`, `agents/`, `policy/`, `directives/` aufgesplittet wegen File-Anzahl-Wachstum; FinancialBot-Topic-Ingest als zusätzlicher Use-Case für Telegram-Thread-Exporte)* +*Erstellt: 2026-06-05 | Schema-Version: 1.4 (2026-06-16: Wiki-Maintenance-System v1.0 — `scripts/wiki-lint.sh` + Test-Suite + `wiki/tasks/maintenance-todo.md` + `scripts/subagents/*.md` Templates; Detection/Execution-Trennung, keine LLM-Involvung im Lint-Pfad.)* diff --git a/scripts/subagents/frontmatter-migration.md b/scripts/subagents/frontmatter-migration.md new file mode 100644 index 0000000..2ab449e --- /dev/null +++ b/scripts/subagents/frontmatter-migration.md @@ -0,0 +1,70 @@ +# Subagent: frontmatter-migration + +**Trigger:** `wiki-do WMT-002` (on-demand) +**Output:** 12 Wiki-Pages mit Frontmatter + Final-Commit + Topic-Report +**Model:** `ollama/glm-5.1` (Fallbacks: `ollama/minimax-m3` → `ollama/deepseek-v4-flash:cloud` → `ollama/glm-5`) + +## Input + +Lese `wiki/tasks/maintenance-todo.md` WMT-002. Files-Liste steht dort. Zusätzlich: `output/test-lint-output.md` hat die aktuelle Missing-Liste (kann sich aber zwischenzeitlich geändert haben — selbst re-linten oder Hauptagent fragen). + +## Aufgabe + +Pro File aus der Missing-Liste: + +1. **Lies** die Wiki-Page komplett +2. **Erkunde** den Inhalt kurz (Titel? Konzept-Typ? Quellen die referenziert werden?) +3. **Erstelle** minimales Frontmatter nach `AGENTS.md`-Schema. Für Fakten-Seiten: + ```yaml + --- + created: + updated: + sources: [] + tags: [<2-4 passende tags>] + --- + ``` +4. **Schreibe** das Frontmatter an den Anfang der Page (vor dem bestehenden Inhalt) +5. **Commit einzeln** mit Schema `lint(wiki): add missing frontmatter to ` +6. **Push** nach jedem Commit (oder am Ende gesammelt — egal, aber konsistent) + +**Wichtig:** KEINE inhaltlichen Änderungen. Nur Frontmatter. Wenn du unsicher bist, welche `sources` oder `tags`, dann minimal halten: `sources: []` + `tags: [unclassified]` ist OK, der Hauptagent reviewed später. + +## Final-Commit + +Nach allen Frontmatter-Commits: + +```bash +cd /home/node/workspace/knowledge-base +# 1. maintenance-todo.md updaten +# Verschiebe WMT-002 von "ToDo" → "Done" mit Datum + Liste der Commits +# 2. Commit + push +git add wiki/tasks/maintenance-todo.md +git commit -m "chore(wiki): mark WMT-002 done ($(date -I))" +git push origin main +``` + +## Topic-Report + +Im RamaDama-Topic posten: +``` +## 🪴 WMT-002 done — Frontmatter-Migration + +- **** Pages ergänzt +- Commits: +- Rest: 0 +- Nächste: WMT-003 (Stub-Killer) bereit zum `wiki-do` +``` + +## Constraints + +- **NICHT** in raw/-Files schreiben +- **NICHT** den Inhalt der Pages ändern +- **NICHT** die Reihenfolge der Sektionen in den Pages ändern +- **NICHT** mehrere Pages in einen Commit packen +- Bei Unsicherheit: skip + in Topic-Report vermerken + +## Failover + +`ollama/glm-5.1` → `ollama/minimax-m3` → `ollama/deepseek-v4-flash:cloud` → `ollama/glm-5` + +Bei Model-Failure: Topic-Post mit Fehler, dann aufgeben. diff --git a/scripts/subagents/wiki-lint-runner.md b/scripts/subagents/wiki-lint-runner.md new file mode 100644 index 0000000..356715c --- /dev/null +++ b/scripts/subagents/wiki-lint-runner.md @@ -0,0 +1,60 @@ +# Subagent: wiki-lint-runner + +**Trigger:** On-demand (`wiki-do WMT-001`) oder weekly cron (So 04:30 CEST) +**Output:** Lint-Report in `scripts/wiki-lint-report.md` + Topic-Post +**Model:** n/a (Script) für den Lint, dann `ollama/glm-5.1` für die Topic-Zusammenfassung + +## Aufgabe + +1. **Lint-Script ausführen:** + ```bash + cd /home/node/workspace/knowledge-base + ./scripts/wiki-lint.sh . scripts/wiki-lint-report.md + ``` + Exit-Code 0 = sauber, 1 = Issues gefunden, 2 = Script-Fehler. + +2. **Report lesen** (`scripts/wiki-lint-report.md`). + +3. **Topic-Post erstellen** im RamaDama-Topic. Format: + ``` + ## 🪴 Wiki Lint — + + **Issues: ** | Total: Pages + + + Voller Report: `scripts/wiki-lint-report.md` + ``` + +4. **Falls Issues:** prüfe ob es passende `WMT-XXX`-ToDos in `wiki/tasks/maintenance-todo.md` gibt. Wenn nicht, lege neue an. + +## Constraints + +- KEINE Wiki-Edits +- KEINE Subagent-Spawns (außer das ToDo existiert schon — dann `wiki-do WMT-XXX` posten und der Hauptagent spawnt) +- Script-Output NUR lesen, nicht interpretieren/ändern +- Report-Post: max 2000 Zeichen + +## Output + +- Topic-Post im RamaDama-Topic +- Optional: Hinweis an Hauptagent, dass neue WMT-ToDos angelegt wurden + +## Commit + +Nur falls neue ToDos angelegt wurden: +```bash +cd /home/node/workspace/knowledge-base +git add wiki/tasks/maintenance-todo.md +git commit -m "chore(wiki): add WMT-XXX from lint-runner ($(date -I))" +git push origin main +tea push # falls nötig +``` + +## Failover + +Falls Model-Aufruf fehlschlägt (`ollama/glm-5.1`): +1. `ollama/minimax-m3` +2. `ollama/deepseek-v4-flash:cloud` +3. `ollama/glm-5` + +Bei 3 aufeinanderfolgenden Failures: Topic-Post mit Fehler, dann aufgeben (Hauptagent übernimmt). diff --git a/scripts/test-fixtures/wiki-lint/broken-wiki/raw/blog/orphan-source.md b/scripts/test-fixtures/wiki-lint/broken-wiki/raw/blog/orphan-source.md new file mode 100644 index 0000000..bdc7bd4 --- /dev/null +++ b/scripts/test-fixtures/wiki-lint/broken-wiki/raw/blog/orphan-source.md @@ -0,0 +1,8 @@ +--- +type: blog +source_url: https://example.com/orphan +retrieved: 2026-01-01 +title: "Orphan Source" +author: "Test" +tags: [test] +--- diff --git a/scripts/test-fixtures/wiki-lint/broken-wiki/wiki/architecture/broken-link-source.md b/scripts/test-fixtures/wiki-lint/broken-wiki/wiki/architecture/broken-link-source.md new file mode 100644 index 0000000..ca2f357 --- /dev/null +++ b/scripts/test-fixtures/wiki-lint/broken-wiki/wiki/architecture/broken-link-source.md @@ -0,0 +1,2 @@ +# Stub No Frontmatter +This file is intentionally a stub without frontmatter. diff --git a/scripts/test-fixtures/wiki-lint/broken-wiki/wiki/concepts/llm/llm-with-broken-link.md b/scripts/test-fixtures/wiki-lint/broken-wiki/wiki/concepts/llm/llm-with-broken-link.md new file mode 100644 index 0000000..badcf62 --- /dev/null +++ b/scripts/test-fixtures/wiki-lint/broken-wiki/wiki/concepts/llm/llm-with-broken-link.md @@ -0,0 +1,12 @@ +--- +created: 2026-01-01 +updated: 2026-01-01 +sources: [] +tags: [llm] +--- + +# LLM With Broken Link + +This page contains a broken cross-reference to test detection. + +See [Nonexistent Page](../concepts/llm/does-not-exist.md) for context. diff --git a/scripts/test-fixtures/wiki-lint/broken-wiki/wiki/tools/orphan-tool.md b/scripts/test-fixtures/wiki-lint/broken-wiki/wiki/tools/orphan-tool.md new file mode 100644 index 0000000..5053295 --- /dev/null +++ b/scripts/test-fixtures/wiki-lint/broken-wiki/wiki/tools/orphan-tool.md @@ -0,0 +1,2 @@ +# Orphan Page +This page has no incoming links and is therefore an orphan. diff --git a/scripts/test-fixtures/wiki-lint/clean-wiki/raw/blog/test-blog.md b/scripts/test-fixtures/wiki-lint/clean-wiki/raw/blog/test-blog.md new file mode 100644 index 0000000..f985c1b --- /dev/null +++ b/scripts/test-fixtures/wiki-lint/clean-wiki/raw/blog/test-blog.md @@ -0,0 +1,8 @@ +--- +type: blog +source_url: https://example.com/test +retrieved: 2026-01-01 +title: "Test Blog" +author: "Test Author" +tags: [test] +--- diff --git a/scripts/test-fixtures/wiki-lint/clean-wiki/wiki/architecture/memory-system.md b/scripts/test-fixtures/wiki-lint/clean-wiki/wiki/architecture/memory-system.md new file mode 100644 index 0000000..06cb602 --- /dev/null +++ b/scripts/test-fixtures/wiki-lint/clean-wiki/wiki/architecture/memory-system.md @@ -0,0 +1,39 @@ +--- +created: 2026-01-01 +updated: 2026-01-01 +sources: [blog/test-blog.md] +tags: [architecture, memory] +--- + +# Memory System + +This is a long enough page to be considered non-stub content. It has multiple +lines, clear structure, and proper frontmatter. All cross-references should +work correctly. The page deliberately uses standard patterns so the lint +script can validate its behavior on a clean wiki. + +## Background + +Lore ipsum dolor sit amet. This section exists primarily to make the file +longer than thirty lines so that stub detection treats it as a full page +rather than a stub. The script counts lines, and the threshold is currently +set to thirty lines minimum. We add more lines here to be safe and explicit +about the intent of the test fixture. + +## Architecture + +The architecture section contains a cross-reference to another wiki page. +The reference is formatted as a normal markdown link using the relative +path convention: see [tools section](../tools/anthropic-claude.md) for +related context. If the link is correct, the lint script reports zero +broken references. We also reference a concept page in the same sentence +to make the fixture link-density realistic. + +See [LLM Fusion](../concepts/llm/llm-fusion.md) for the related concept. + +## Conclusion + +This fixture is intentionally verbose so that the lint script returns +zero issues when run against it. The total line count is well above the +stub threshold. Frontmatter is present. Cross-references resolve. There +are no duplicate-topic clusters and no orphan pages in this fixture. diff --git a/scripts/test-fixtures/wiki-lint/clean-wiki/wiki/concepts/llm/llm-fusion.md b/scripts/test-fixtures/wiki-lint/clean-wiki/wiki/concepts/llm/llm-fusion.md new file mode 100644 index 0000000..2cfc0c2 --- /dev/null +++ b/scripts/test-fixtures/wiki-lint/clean-wiki/wiki/concepts/llm/llm-fusion.md @@ -0,0 +1,30 @@ +--- +created: 2026-01-01 +updated: 2026-01-01 +sources: [] +tags: [llm] +--- + +# LLM Fusion + +This page documents the concept of model fusion and ensemble techniques. +The page is linked from memory-system.md so the orphan check should +report zero orphans. The line count is high enough to avoid stub status. + +## Overview + +Model fusion combines multiple language models into a single inference path +or a routing layer that selects among candidate models. The technique is +useful for combining specialised models (coding, reasoning, multilingual) +without retraining a monolithic base model. The approach is described in +detail in the OpenRouter Fusion whitepaper and the DRACO benchmark study. + +## Practical Examples + +OpenRouter Fusion, DRACO benchmark, and similar approaches show that small +ensembles of well-chosen open models can match or exceed much larger +frontier models on specific tasks. The economic argument is strong: you +pay only for inference, not for the full frontier model on every request. +The technique is particularly effective when the candidate models have +complementary strengths rather than overlapping coverage of the same +tasks. diff --git a/scripts/test-fixtures/wiki-lint/clean-wiki/wiki/tools/anthropic-claude.md b/scripts/test-fixtures/wiki-lint/clean-wiki/wiki/tools/anthropic-claude.md new file mode 100644 index 0000000..e381d91 --- /dev/null +++ b/scripts/test-fixtures/wiki-lint/clean-wiki/wiki/tools/anthropic-claude.md @@ -0,0 +1,33 @@ +--- +created: 2026-01-01 +updated: 2026-01-01 +sources: [] +tags: [tools] +--- + +# Anthropic Claude + +Anthropic Claude is referenced from memory-system.md. The cross-reference +is valid and points to this file. Stub detection ignores this page because +it has more than thirty lines of content. The file uses minimal frontmatter +that complies with the wiki schema. + +## Versions + +Multiple Claude versions are tracked separately in the wiki. This page +serves as the canonical entry point and links out to model-specific +documentation pages and pricing information. The version history is +maintained as a separate wiki page that captures the evolution of the +model family over time. + +## Notes + +Cross-references resolve. The page is long enough to avoid stub status. +The page is intentionally verbose in the test fixture so that the lint +script can verify the threshold behaviour. + +## Additional Context + +The lint fixture intentionally adds additional paragraphs beyond the +minimum thirty-line threshold to ensure stability across minor edits +and line-count variations caused by trailing newlines or formatting. diff --git a/scripts/test-fixtures/wiki-lint/messy-wiki/raw/xpost/uncovered-test.md b/scripts/test-fixtures/wiki-lint/messy-wiki/raw/xpost/uncovered-test.md new file mode 100644 index 0000000..c3c27f5 --- /dev/null +++ b/scripts/test-fixtures/wiki-lint/messy-wiki/raw/xpost/uncovered-test.md @@ -0,0 +1,6 @@ +--- +type: xpost +source_url: https://x.com/test +retrieved: 2026-01-01 +author: "@test" +--- diff --git a/scripts/test-fixtures/wiki-lint/messy-wiki/wiki/architecture/memory-system.md b/scripts/test-fixtures/wiki-lint/messy-wiki/wiki/architecture/memory-system.md new file mode 100644 index 0000000..b3f173d --- /dev/null +++ b/scripts/test-fixtures/wiki-lint/messy-wiki/wiki/architecture/memory-system.md @@ -0,0 +1,2 @@ +# Memory System +Stub diff --git a/scripts/test-fixtures/wiki-lint/messy-wiki/wiki/concepts/polymarket-arbitrage.md b/scripts/test-fixtures/wiki-lint/messy-wiki/wiki/concepts/polymarket-arbitrage.md new file mode 100644 index 0000000..5a35930 --- /dev/null +++ b/scripts/test-fixtures/wiki-lint/messy-wiki/wiki/concepts/polymarket-arbitrage.md @@ -0,0 +1,2 @@ +# Polymarket Arbitrage +Polymarket polymarket polymarket polymarket polymarket polymarket polymarket polymarket diff --git a/scripts/test-fixtures/wiki-lint/messy-wiki/wiki/tools/polymarket-monitoring.md b/scripts/test-fixtures/wiki-lint/messy-wiki/wiki/tools/polymarket-monitoring.md new file mode 100644 index 0000000..de49d13 --- /dev/null +++ b/scripts/test-fixtures/wiki-lint/messy-wiki/wiki/tools/polymarket-monitoring.md @@ -0,0 +1,2 @@ +# Polymarket Bot +Polymarket polymarket polymarket polymarket polymarket polymarket diff --git a/scripts/wiki-lint-report.md b/scripts/wiki-lint-report.md new file mode 100644 index 0000000..4194916 --- /dev/null +++ b/scripts/wiki-lint-report.md @@ -0,0 +1,112 @@ +# Wiki Lint Report + +*Generated: 2026-06-16 09:33:31 UTC* +*Repo: .* +*Script: scripts/wiki-lint.sh v0.1* + + +### File-Count per Dir (Refactor-Trigger) +| Dir | Files | Trigger | +|-----|-------|---------| +| wiki | 3 | ✅ | +| wiki/architecture | 6 | ✅ | +| wiki/concepts/agents | 6 | ✅ | +| wiki/concepts/directives | 3 | ✅ | +| wiki/concepts/llm | 7 | ✅ | +| wiki/concepts/policy | 2 | ✅ | +| wiki/decisions | 2 | ✅ | +| wiki/events | 1 | ✅ | +| wiki/ideas | 4 | ✅ | +| wiki/teams | 3 | ✅ | +| wiki/tools | 9 | ✅ | + +### Stub-Quote (<30 Zeilen) +❌ **14 / 46 (30%)** — threshold 10%, fail 25% + +Stub-Files: +- `wiki/architecture/byterover-knowledge-mining.md (22 lines)` +- `wiki/architecture/memory-system.md (29 lines)` +- `wiki/concepts/agents/ai-agents-2026.md (29 lines)` +- `wiki/concepts/directives/quality-standard.md (23 lines)` +- `wiki/concepts/llm/llm-knowledge-base.md (27 lines)` +- `wiki/decisions/2026-04-memory-system.md (25 lines)` +- `wiki/decisions/2026-04-volume-persistence.md (19 lines)` +- `wiki/ideas/2026-04-08_git-auto-commit.md (28 lines)` +- `wiki/ideas/2026-05-28_plur1bus-audit.md (27 lines)` +- `wiki/ideas/2026-05-29_plur1bus-priority-fix.md (27 lines)` +- `wiki/ideas/2026-06-06_plur1bus-priority-fix.md (29 lines)` +- `wiki/tools/ecosystem-tools-april-2026.md (17 lines)` +- `wiki/tools/fincept-terminal.md (29 lines)` +- `wiki/tools/openai-gpt.md (24 lines)` + +### Frontmatter Präsenz +❌ **12 missing, 31 present** + +Missing: +- `wiki/architecture/agent-orchestration.md` +- `wiki/architecture/byterover-knowledge-mining.md` +- `wiki/architecture/container-volume-persistence.md` +- `wiki/architecture/cron-notable-events.md` +- `wiki/architecture/memory-system.md` +- `wiki/architecture/model-routing.md` +- `wiki/concepts/agents/subconscious-agent.md` +- `wiki/concepts/directives/pro-leben-directive.md` +- `wiki/concepts/directives/quality-standard.md` +- `wiki/decisions/2026-04-memory-system.md` +- `wiki/decisions/2026-04-volume-persistence.md` +- `wiki/tools/ecosystem-tools-april-2026.md` + +### Broken Cross-References +✅ **0 broken** + +### Orphan Pages (kein eingehender Link) +✅ **0 orphans** + +### Dup-Topic Cluster (substantielle Vorkommen) +⚠️ **polymarket**: 3 Files (≥3 Vorkommen je File) + - `wiki/concepts/agents/polymarket-arbitrage.md` (12 Treffer) + - `wiki/teams/ruediger.md` (8 Treffer) + - `wiki/tools/polymarket-monitoring-bot.md` (10 Treffer) +⚠️ **lightning**: 4 Files (≥3 Vorkommen je File) + - `wiki/concepts/agents/agent-payments-lightning.md` (15 Treffer) + - `wiki/teams/netbits-stachelbanane.md` (5 Treffer) + - `wiki/tools/blink-wallet-skill.md` (4 Treffer) + - `wiki/tools/lightning-payment-apps.md` (8 Treffer) +⚠️ **subconscious**: 6 Files (≥3 Vorkommen je File) + - `wiki/architecture/cron-notable-events.md` (3 Treffer) + - `wiki/concepts/agents/subconscious-agent.md` (10 Treffer) + - `wiki/ideas/2026-04-08_git-auto-commit.md` (5 Treffer) + - `wiki/ideas/2026-05-28_plur1bus-audit.md` (5 Treffer) + - `wiki/ideas/2026-05-29_plur1bus-priority-fix.md` (4 Treffer) + - `wiki/ideas/2026-06-06_plur1bus-priority-fix.md` (5 Treffer) +⚠️ **memory**: 3 Files (≥3 Vorkommen je File) + - `wiki/architecture/memory-system.md` (3 Treffer) + - `wiki/concepts/llm/ai-value-migration-orchestration.md` (3 Treffer) + - `wiki/decisions/2026-04-memory-system.md` (4 Treffer) +⚠️ **trading**: 7 Files (≥3 Vorkommen je File) + - `wiki/concepts/agents/ai-trading-reality-2026.md` (3 Treffer) + - `wiki/concepts/agents/iron-condor-options.md` (4 Treffer) + - `wiki/concepts/agents/polymarket-arbitrage.md` (6 Treffer) + - `wiki/concepts/directives/openclaw-financial-bots-policy.md` (4 Treffer) + - `wiki/teams/rene-kl.md` (3 Treffer) + - `wiki/teams/ruediger.md` (4 Treffer) + - `wiki/tools/fincept-terminal.md` (4 Treffer) + +### Stale Pages (mtime > 30d) +✅ **0 stale** + +### Uncovered Raw Sources +✅ **20 raw, all covered** + +## Summary + +- Total Wiki-Pages: 46 +- Issues: 2 + +→ **Action needed**: subagent spawn for fixes. See '## Recommended Subagent Spawns'. + +## Recommended Subagent Spawns + +- **frontmatter-migration** — 12 files missing frontmatter +- **stub-killer** — 14 stubs (30%, threshold 10%) +- **hub-page-creator** — dup-topic clusters detected diff --git a/scripts/wiki-lint-test.sh b/scripts/wiki-lint-test.sh new file mode 100755 index 0000000..7ae5a09 --- /dev/null +++ b/scripts/wiki-lint-test.sh @@ -0,0 +1,120 @@ +#!/usr/bin/env bash +# wiki-lint-test.sh — Test-Suite für scripts/wiki-lint.sh +# Usage: ./scripts/wiki-lint-test.sh + +set -u + +SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" +FIXTURES="$SCRIPT_DIR/test-fixtures/wiki-lint" +LINT="$SCRIPT_DIR/wiki-lint.sh" + +# Farben +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +NC='\033[0m' # No Color + +PASS=0 +FAIL=0 + +assert_exit() { + # $1 = expected exit code, $2 = actual, $3 = test name + local expected=$1 + local actual=$2 + local name=$3 + if [ "$actual" -eq "$expected" ]; then + echo -e "${GREEN}✓${NC} $name (exit=$actual)" + PASS=$((PASS+1)) + else + echo -e "${RED}✗${NC} $name (expected exit=$expected, got=$actual)" + FAIL=$((FAIL+1)) + fi +} + +assert_report_contains() { + # $1 = report file, $2 = expected substring, $3 = test name + local report=$1 + local needle=$2 + local name=$3 + if grep -qF "$needle" "$report"; then + echo -e "${GREEN}✓${NC} $name (found: '$needle')" + PASS=$((PASS+1)) + else + echo -e "${RED}✗${NC} $name (NOT found: '$needle')" + FAIL=$((FAIL+1)) + fi +} + +assert_report_not_contains() { + local report=$1 + local needle=$2 + local name=$3 + if ! grep -qF "$needle" "$report"; then + echo -e "${GREEN}✓${NC} $name (correctly absent: '$needle')" + PASS=$((PASS+1)) + else + echo -e "${RED}✗${NC} $name (UNEXPECTEDLY present: '$needle')" + FAIL=$((FAIL+1)) + fi +} + +run_lint() { + # $1 = fixture dir, $2 = report file + "$LINT" "$1" "$2" >/dev/null 2>&1 + return $? +} + +echo "=== Test 1: clean-wiki (expect: exit 0, 0 issues)===" +REPORT=$(mktemp) +run_lint "$FIXTURES/clean-wiki" "$REPORT" +assert_exit 0 $? "clean-wiki exit code" +assert_report_contains "$REPORT" "Total Wiki-Pages: 3" "clean-wiki total count" +assert_report_contains "$REPORT" "✅ **0 / 3 (0%)**" "clean-wiki no stubs" +assert_report_contains "$REPORT" "✅ **3 / 3 present**" "clean-wiki all frontmatter present" +assert_report_contains "$REPORT" "✅ **0 broken**" "clean-wiki no broken refs" +assert_report_contains "$REPORT" "✅ **0 orphans**" "clean-wiki no orphans" +rm -f "$REPORT" + +echo "" +echo "=== Test 2: messy-wiki (expect: exit 1, issues detected)===" +REPORT=$(mktemp) +run_lint "$FIXTURES/messy-wiki" "$REPORT" +EXIT=$? +assert_exit 1 $EXIT "messy-wiki exit code (issues found)" +assert_report_contains "$REPORT" "Stub-Quote" "messy-wiki has stub section" +assert_report_contains "$REPORT" "polymarket" "messy-wiki polymarket cluster detected" +assert_report_contains "$REPORT" "❌" "messy-wiki has at least one failure indicator" +rm -f "$REPORT" + +echo "" +echo "=== Test 3: broken-wiki (expect: exit 1, multiple issues)===" +REPORT=$(mktemp) +run_lint "$FIXTURES/broken-wiki" "$REPORT" +EXIT=$? +assert_exit 1 $EXIT "broken-wiki exit code" +assert_report_contains "$REPORT" "broken" "broken-wiki broken refs detected" +assert_report_contains "$REPORT" "Missing" "broken-wiki missing frontmatter" +assert_report_contains "$REPORT" "orphan" "broken-wiki orphans detected" +rm -f "$REPORT" + +echo "" +echo "=== Test 4: real repo (sanity check, expect exit 1)===" +REPORT=$(mktemp) +run_lint "$REPO_ROOT" "$REPORT" +EXIT=$? +assert_exit 1 $EXIT "real-repo exit code" +assert_report_contains "$REPORT" "frontmatter" "real-repo frontmatter section" +assert_report_contains "$REPORT" "Stub-Quote" "real-repo stub section" +rm -f "$REPORT" + +echo "" +echo "==============================" +echo -e "Passed: ${GREEN}$PASS${NC}" +echo -e "Failed: ${RED}$FAIL${NC}" +echo "==============================" + +if [ "$FAIL" -gt 0 ]; then + exit 1 +fi +exit 0 diff --git a/scripts/wiki-lint.sh b/scripts/wiki-lint.sh new file mode 100755 index 0000000..dcd9cdb --- /dev/null +++ b/scripts/wiki-lint.sh @@ -0,0 +1,360 @@ +#!/usr/bin/env bash +# wiki-lint.sh — Mechanischer Wiki-Health-Check (kein LLM) +# Version: 0.1 (Draft 2026-06-16) +# Repo: knowledge-base +# Usage: ./scripts/wiki-lint.sh [repo-root] [output-file] + +set -u # nounset; NICHT -e, weil wir alle Checks durchlaufen wollen + +# --- Konfiguration (Schwellwerte) --- +STUB_WARN_PCT=10 +STUB_FAIL_PCT=25 +DIR_WARN_FILES=12 +DIR_FAIL_FILES=20 +STALE_DAYS=30 +EXIT_OK=0 +EXIT_ISSUES=1 +EXIT_ERROR=2 + +REPO_ROOT="${1:-$(cd "$(dirname "$0")/.." && pwd)}" +OUTPUT="${2:-$REPO_ROOT/scripts/wiki-lint-report.md}" +TIMESTAMP="$(date -u +"%Y-%m-%d %H:%M:%S UTC")" + +cd "$REPO_ROOT" || { echo "FAIL: cannot cd to $REPO_ROOT" >&2; exit 2; } + +# --- Zähler --- +total_pages=0 +issues=0 +status_ok="✅" +status_warn="⚠️" +status_fail="❌" + +# --- Ergebnis-Sammler --- +declare -a section_lines +current_section="" + +# Helper: Sektion hinzufügen +add_line() { section_lines+=("$1"); } +new_section() { + current_section="$1" + section_lines+=("") + section_lines+=("### $1") +} + +# --- Files sammeln --- +# Meta-Files und Tasks-Dir ausschließen +mapfile -t all_wiki < <(find wiki -name "*.md" -type f -not -path "wiki/tasks/*" 2>/dev/null | sort) +total_pages=${#all_wiki[@]} + +# ============================================================ +# CHECK 1: File-Count per Dir (Trigger für Refactor) +# ============================================================ +new_section "File-Count per Dir (Refactor-Trigger)" +declare -A dir_count +while IFS= read -r f; do + dir=$(dirname "$f") + dir_count["$dir"]=$(( ${dir_count["$dir"]:-0} + 1 )) +done < <(printf '%s\n' "${all_wiki[@]}") + +add_line "| Dir | Files | Trigger |" +add_line "|-----|-------|---------|" +for dir in $(printf '%s\n' "${!dir_count[@]}" | sort); do + cnt=${dir_count["$dir"]} + if [ "$cnt" -ge "$DIR_FAIL_FILES" ]; then + add_line "| $dir | $cnt | ❌ FAIL (refactor) |" + issues=$((issues+1)) + elif [ "$cnt" -ge "$DIR_WARN_FILES" ]; then + add_line "| $dir | $cnt | ⚠️ warn (refactor) |" + else + add_line "| $dir | $cnt | ✅ |" + fi +done + +# ============================================================ +# CHECK 2: Stubs (<30 Zeilen) + Stub-Quote +# ============================================================ +new_section "Stub-Quote (<30 Zeilen)" +stub_count=0 +stub_files=() +for f in "${all_wiki[@]}"; do + lines=$(wc -l < "$f") + if [ "$lines" -lt 30 ]; then + # Meta-Files ausschließen + case "$(basename "$f")" in + index.md|log.md|ideas.md|tasks.md) continue ;; + esac + stub_count=$((stub_count+1)) + stub_files+=("$f ($lines lines)") + fi +done + +if [ "$total_pages" -gt 0 ]; then + stub_pct=$((stub_count * 100 / total_pages)) +else + stub_pct=0 +fi + +if [ "$stub_pct" -ge "$STUB_FAIL_PCT" ]; then + add_line "$status_fail **$stub_count / $total_pages ($stub_pct%)** — threshold $STUB_WARN_PCT%, fail $STUB_FAIL_PCT%" + issues=$((issues+1)) +elif [ "$stub_pct" -ge "$STUB_WARN_PCT" ]; then + add_line "$status_warn **$stub_count / $total_pages ($stub_pct%)** — threshold $STUB_WARN_PCT%" +else + add_line "$status_ok **$stub_count / $total_pages ($stub_pct%)**" +fi + +if [ "${#stub_files[@]}" -gt 0 ] && [ "$stub_count" -le 15 ]; then + add_line "" + add_line "Stub-Files:" + for s in "${stub_files[@]}"; do add_line "- \`$s\`"; done +fi + +# ============================================================ +# CHECK 3: Frontmatter fehlt +# ============================================================ +new_section "Frontmatter Präsenz" +missing_fm=() +present_fm=0 +for f in "${all_wiki[@]}"; do + # Meta-Files dürfen ohne + case "$(basename "$f")" in + index.md|log.md|ideas.md) continue ;; + esac + first=$(head -1 "$f") + if [ "$first" = "---" ]; then + present_fm=$((present_fm+1)) + else + missing_fm+=("$f") + fi +done + +if [ "${#missing_fm[@]}" -gt 0 ]; then + add_line "$status_fail **${#missing_fm[@]} missing, $present_fm present**" + issues=$((issues+1)) + add_line "" + add_line "Missing:" + for m in "${missing_fm[@]}"; do add_line "- \`$m\`"; done +else + add_line "$status_ok **$present_fm / $total_pages present**" +fi + +# ============================================================ +# CHECK 4: Broken Cross-Refs +# ============================================================ +new_section "Broken Cross-References" +broken_refs=() +# Sammle alle .md-Pfade relativ zum Repo +mapfile -t all_md_rel < <(find . -name "*.md" -not -path "./.git/*" -type f 2>/dev/null | sed 's|^\./||' | sort) + +# Grep nach ](path.md) in wiki-Files +for f in "${all_wiki[@]}"; do + while IFS= read -r match; do + # match ist z.B. "concepts/llm/foo.md" oder "../other/bar.md" + target=$(echo "$match" | sed 's|^(\.\./)*||' | sed 's|^wiki/||') + # Auflösen relativ zur File-Dir + fdir=$(dirname "$f") + if [ "$fdir" = "." ]; then + resolved="$target" + else + resolved="$fdir/$target" + fi + # Normalize + resolved=$(realpath -m --relative-to=. "$resolved" 2>/dev/null || echo "$resolved") + if [ ! -f "$resolved" ] && [ ! -f "wiki/$target" ] && [ ! -f "$target" ]; then + broken_refs+=("$f → $match") + fi + done < <(grep -oE '\]\(([^)]+\.md)\)' "$f" 2>/dev/null | sed 's|](||;s|)||') +done + +if [ "${#broken_refs[@]}" -gt 0 ]; then + add_line "$status_fail **${#broken_refs[@]} broken refs**" + issues=$((issues+1)) + for b in "${broken_refs[@]}"; do add_line "- \`$b\`"; done +else + add_line "$status_ok **0 broken**" +fi + +# ============================================================ +# CHECK 5: Orphan Pages (kein eingehender Link) +# ============================================================ +new_section "Orphan Pages (kein eingehender Link)" +orphans=() +for f in "${all_wiki[@]}"; do + basename=$(basename "$f" .md) + # Meta-Files auslassen + case "$basename" in + index|log|ideas|tasks) continue ;; + esac + # Suche nach basename in allen anderen wiki-Files (ohne die Datei selbst) + if ! grep -rq "$basename" "${all_wiki[@]/$f/}" 2>/dev/null; then + orphans+=("$f") + fi +done + +if [ "${#orphans[@]}" -gt 0 ]; then + add_line "$status_warn **${#orphans[@]} orphan pages**" + for o in "${orphans[@]}"; do add_line "- \`$o\`"; done +else + add_line "$status_ok **0 orphans**" +fi + +# ============================================================ +# CHECK 6: Dup-Topic-Cluster (Keyword-Suche) +# ============================================================ +new_section "Dup-Topic Cluster (substantielle Vorkommen)" +keywords=("polymarket" "lightning" "iron.condor" "subconscious" "memory" "trading") +declare -A cluster_files +for kw in "${keywords[@]}"; do + cluster_files["$kw"]="" +done +for f in "${all_wiki[@]}"; do + case "$(basename "$f")" in + index.md|log.md|ideas.md|tasks.md) continue ;; + esac + for kw in "${keywords[@]}"; do + count=$(grep -ciE "\\b$kw\\b" "$f" 2>/dev/null) + count=${count:-0} + if [ "$count" -ge 3 ]; then + cluster_files["$kw"]="${cluster_files[$kw]}$f|$count +" + fi + done +done +cluster_found=0 +for kw in "${keywords[@]}"; do + files_str="${cluster_files[$kw]}" + if [ -n "$files_str" ]; then + file_count=$(echo "$files_str" | grep -c "^[^-]") + if [ "$file_count" -ge 3 ]; then + cluster_found=$((cluster_found+1)) + add_line "$status_warn **$kw**: $file_count Files (≥3 Vorkommen je File)" + while IFS='|' read -r fpath fcount; do + [ -n "$fpath" ] && add_line " - \`$fpath\` ($fcount Treffer)" + done <<< "$files_str" + fi + fi +done +if [ "$cluster_found" -eq 0 ]; then + add_line "$status_ok **keine signifikanten Cluster** (Schwelle: ≥3 Vorkommen in ≥3 Files)" +fi + +# ============================================================ +# CHECK 7: Stale Wiki (mtime > 30d ohne index-Update) +# ============================================================ +new_section "Stale Pages (mtime > 30d)" +stale=() +thirty_days_ago=$(date -d "30 days ago" +%s 2>/dev/null || date -v-30d +%s 2>/dev/null || echo 0) +if [ "$thirty_days_ago" -gt 0 ]; then + while IFS= read -r f; do + mtime=$(stat -c %Y "$f" 2>/dev/null || stat -f %m "$f" 2>/dev/null || echo 0) + if [ "$mtime" -gt 0 ] && [ "$mtime" -lt "$thirty_days_ago" ]; then + stale+=("$f") + fi + done < <(printf '%s\n' "${all_wiki[@]}") +fi + +if [ "${#stale[@]}" -gt 0 ]; then + add_line "$status_warn **${#stale[@]} stale pages** (>30d)" + for s in "${stale[@]:0:10}"; do add_line "- \`$s\`"; done + if [ "${#stale[@]}" -gt 10 ]; then add_line "- ... und $((${#stale[@]}-10)) weitere"; fi +else + add_line "$status_ok **0 stale**" +fi + +# ============================================================ +# CHECK 8: Uncovered Raw (raw/-Files ohne Wiki-Cross-Ref) +# ============================================================ +new_section "Uncovered Raw Sources" +mapfile -t all_raw < <(find raw -name "*.md" -type f 2>/dev/null | sort) +uncovered=() +for r in "${all_raw[@]}"; do + rbase=$(basename "$r") + # Suche in Wiki nach dem Raw-Basename (ohne .md) oder nach dem Slug-Teil + slug=$(echo "$rbase" | sed 's/\.md$//' | sed 's/^[0-9-]*_//') + if ! grep -rq "$slug" wiki/ 2>/dev/null; then + uncovered+=("$r (slug: $slug)") + fi +done + +if [ "${#uncovered[@]}" -gt 0 ]; then + add_line "$status_warn **${#uncovered[@]} uncovered raw**" + for u in "${uncovered[@]}"; do add_line "- \`$u\`"; done +else + add_line "$status_ok **${#all_raw[@]} raw, all covered**" +fi + +# ============================================================ +# Zusammenfassung + Empfehlung +# ============================================================ +summary_section="## Summary" +section_lines+=("") +section_lines+=("$summary_section") +section_lines+=("") +section_lines+=("- Total Wiki-Pages: $total_pages") +section_lines+=("- Issues: $issues") +section_lines+=("") +if [ "$issues" -gt 0 ]; then + section_lines+=("→ **Action needed**: subagent spawn for fixes. See '## Recommended Subagent Spawns'.") +else + section_lines+=("→ Wiki is clean. No subagent spawn needed.") +fi + +# ============================================================ +# Empfohlene Subagent-Spawns (heuristisch) +# ============================================================ +section_lines+=("") +section_lines+=("## Recommended Subagent Spawns") +section_lines+=("") + +# Heuristik: Welche Subagents sind nötig? +if [ "${#missing_fm[@]}" -gt 0 ]; then + section_lines+=("- **frontmatter-migration** — ${#missing_fm[@]} files missing frontmatter") +fi +if [ "${#orphans[@]}" -gt 0 ]; then + section_lines+=("- **orphan-resolver** — ${#orphans[@]} orphan pages (link or delete)") +fi +if [ "${#stub_files[@]}" -gt 0 ] && [ "$stub_pct" -ge 10 ]; then + section_lines+=("- **stub-killer** — $stub_count stubs ($stub_pct%, threshold 10%)") +fi +# Dup-Topic-Cluster: bei polymarket/lightning/trading ≥3 hits +dup_warn=$(printf '%s\n' "${section_lines[@]}" | grep -c "^\*\*\(polymarket\|lightning\|iron\.condor\|trading\)\*\*" 2>/dev/null) || dup_warn=0 +dup_warn=${dup_warn:-0} +if [ "$dup_warn" -gt 0 ]; then + section_lines+=("- **hub-page-creator** — dup-topic clusters detected") +fi +# Tools-Dir ≥12 +if [ "${dir_count[wiki/tools]:-0}" -ge 12 ]; then + section_lines+=("- **tools-refactor** — wiki/tools/ hat ${dir_count[wiki/tools]} files") +fi +if [ "${#uncovered[@]}" -gt 0 ]; then + section_lines+=("- **raw-coverage-check** — ${#uncovered[@]} raw files ohne Wiki-Cross-Ref") +fi + +if [ "$issues" -eq 0 ] && [ "${#orphans[@]}" -eq 0 ] && [ "$stub_pct" -lt 10 ]; then + section_lines+=("(keine — Wiki sauber)") +fi + +# ============================================================ +# Output schreiben +# ============================================================ +{ + echo "# Wiki Lint Report" + echo "" + echo "*Generated: $TIMESTAMP*" + echo "*Repo: $REPO_ROOT*" + echo "*Script: scripts/wiki-lint.sh v0.1*" + echo "" + printf '%s\n' "${section_lines[@]}" +} > "$OUTPUT" + +# Console-Kurzfassung +echo "Wiki Lint — $TIMESTAMP" +echo "Total: $total_pages | Issues: $issues" +echo "Report: $OUTPUT" + +# Exit-Code +if [ "$issues" -gt 0 ]; then + exit "$EXIT_ISSUES" +else + exit "$EXIT_OK" +fi diff --git a/wiki/log.md b/wiki/log.md index 3aaf778..b700926 100644 --- a/wiki/log.md +++ b/wiki/log.md @@ -279,3 +279,34 @@ - Mehrere Spielfelder = mehr Akteure = mehr Handlungsfähigkeit (gegen Mangelnarrativ) - Orchestrierung ist direkter Handlungsraum für OpenClaw ([[architecture/model-routing.md]]) - Exportkontrollen langfristig kontraproduktiv — Open Source + Orchestration ist robustere Strategie + +--- + +## 2026-06-16 — Wiki-Maintenance-System v1.0 + +**Kontext:** Mit k9ert im RamaDama-Topic abgestimmt. Plan → Defaults → Go. Direkter Aktor, keine Subagent-Delegation für Setup. + +**Was passiert ist:** + +- **Architektur-Entscheidung:** Detection/Execution-Trennung. Mechanische Checks (Stubs, Frontmatter, Broken-Refs, Orphans, Dup-Cluster, File-Count, Stale, Raw-Coverage) → `scripts/wiki-lint.sh` als pure bash, KEIN LLM. Fixes → Subagent-Spawn mit Template. Agent liest Lint-Report, entscheidet welche Subagents gespawed werden. +- **ToDo-Workflow:** `wiki/tasks/maintenance-todo.md` (versioniert), IDs `WMT-XXX`, Status `planning → in-progress → done`. Subagent committet Arbeit + ToDo-Update in finalem Commit. +- **Reporting:** Jede Aktion → Topic-Post in RamaDama. Drei Report-Typen: Lint-Report, Subagent-Action-Report, Weekly-Summary. Kein Approval-Workflow. + +**Dateien:** + +- `scripts/wiki-lint.sh` (358 Zeilen) — Lint-Script v0.1 +- `scripts/wiki-lint-test.sh` (17 Asserts) — Test-Suite mit 3 Fixtures + Real-Repo +- `scripts/subagents/wiki-lint-runner.md` — Subagent-Template für Lint-Report-Posts +- `scripts/subagents/frontmatter-migration.md` — Subagent-Template für WMT-002 +- `scripts/test-fixtures/wiki-lint/{clean,messy,broken}-wiki/` — 3 Test-Fixtures +- `wiki/tasks/maintenance-todo.md` — Backlog mit WMT-001..006 + WMT-000 done + +**Tests:** 17 passed, 0 failed (clean-wiki: 0 issues, messy-wiki: issues detected, broken-wiki: multiple issues, real-repo: 2 issues wie erwartet). + +**Erster Lint-Run (Real-Repo):** 46 Pages, 2 Issues: +- 12 Wiki-Pages ohne Frontmatter +- 14 Stubs (30% Quote, threshold 10%) + +**Empfohlene nächste Subagents:** WMT-002 (frontmatter-migration, 12 files), WMT-003 (stub-killer, 14 files). + +**AGENTS.md v1.4:** Schema-Section für Maintenance-Wiki hinzugefügt (siehe unten). diff --git a/wiki/tasks/maintenance-todo.md b/wiki/tasks/maintenance-todo.md new file mode 100644 index 0000000..e3afd89 --- /dev/null +++ b/wiki/tasks/maintenance-todo.md @@ -0,0 +1,87 @@ +# Wiki-Maintenance Backlog + +*Erstellt: 2026-06-16 | Schema v1.0* +*Owner: Hector (Hauptagent) | Subagents führen aus, melden via Topic* + +--- + +## ToDo + +- [ ] **WMT-001** — `scripts/wiki-lint.sh` finalisieren + Test-Fixtures + - Category: tooling | Effort: M | Status: planning + - Subagent: `scripts/subagents/wiki-lint-runner.md` + - Notes: Draft v0.1 läuft (`output/draft-wiki-lint.sh`), Report korrekt, Exit-Code 1 bei Issues. Muss noch von `output/` → `scripts/` und Fixtures. + +- [ ] **WMT-002** — 12 Wiki-Pages mit Frontmatter nachziehen + - Category: schema | Effort: S | Status: planning + - Subagent: `scripts/subagents/frontmatter-migration.md` + - Files: 12 (siehe `output/test-lint-output.md` → Frontmatter-Sektion) + - Schema: siehe `AGENTS.md` § "Wiki-Pages haben minimales Frontmatter" + +- [ ] **WMT-003** — 14 Stubs analysieren (füllen oder killen) + - Category: content | Effort: L | Status: planning + - Subagent: `scripts/subagents/stub-killer.md` + - Files: 14 (siehe `output/test-lint-output.md` → Stub-Quote-Sektion) + - Strategie: pro Stub entscheiden — kurze Meta-Files ergänzen, inhaltlich dünne killen, konzeptuell wichtige expandieren. + +- [ ] **WMT-004** — Dup-Topic-Cluster auflösen (Hub-Pages) + - Category: structure | Effort: M | Status: planning + - Subagent: `scripts/subagents/hub-page-creator.md` + - Cluster: polymarket (3), lightning (4), trading (7), subconscious (6) + - Strategie: 1 Hub-Page pro Cluster, Spreu-Cluster (subconscious, memory) → kein Hub nötig, sind normal verteilt. + +- [ ] **WMT-005** — 1 uncovered raw → Wiki-Coverage herstellen + - Category: coverage | Effort: XS | Status: planning + - Subagent: `scripts/subagents/raw-coverage-check.md` + - File: `raw/blog/2026-06-13_trump-blocks-anthropic-fable-mythos.md` + - Notes: Sehr ähnlich zu `2026-06-13_trump-export-controls-anthropic-mythos-fable.md` — vermutlich Duplikat. Subagent prüft + mergt oder neuen Wiki-Eintrag anlegt. + +- [ ] **WMT-006** — `tools/` Sub-Cluster-Refactor (zurückgestellt) + - Category: structure | Effort: M | Status: parked + - Notes: 9 Files, unter Refactor-Trigger (12). Aktuell nicht zwingend. WMT-003 + WMT-002 haben Vorrang. + +--- + +## In Progress + +*(leer — kein Subagent läuft gerade)* + +--- + +## Done + +- [x] **WMT-000** — Schema + Maintenance-Wiki angelegt | meta | S | 2026-06-16 + - Plan-Architektur mit k9ert abgestimmt in RamaDama-Topic (#6625-#6640) + - Draft `scripts/wiki-lint.sh` v0.1 erstellt, getestet (`output/test-lint-output.md`) + +--- + +## Wie es läuft + +### Manueller Trigger + +Im RamaDama-Topic schreiben: +``` +wiki-do WMT-002 +``` +→ Hector parsed, schiebt das ToDo in "In Progress", spawnt den passenden Subagent mit dem Template. + +### Automatischer Trigger (Cron) + +| Cron | Wann | Was | Model | +|------|------|-----|-------| +| `wiki-lint-weekly` | So 04:30 CEST | Lint-Script ausführen, Report in Topic posten | n/a (Shell) | +| `wiki-weekly-summary` | So 19:00 CEST | Wartungszusammenfassung inkl. Wiki-Status | ollama/glm-5.1 | + +Subagent-Failover: `ollama/glm-5.1 → ollama/minimax-m3 → ollama/deepseek-v4-flash:cloud → ollama/glm-5` + +### Workflow für Subagents + +Jeder Subagent folgt diesem Pattern (siehe Template in `scripts/subagents/.md`): + +1. **Read** dieses Files + eigenes Template +2. **Arbeit** machen (Commits einzeln oder gruppiert) +3. **Final-Commit**: + - dieses File updaten (Status `planning` → `done` mit Datum + Commit-Hash der Arbeits-Commits) + - push +4. **Report** in RamaDama-Topic posten: was gemacht, welche Commits, was bleibt