7f74303a00
Files changed: - CHANGES.md - README.md - VERSION - kb/concepts/Ambient Environment Dependency.md - kb/concepts/Anti-Cramming Heuristic.md - kb/concepts/Audit Trail.md - kb/concepts/BM25.md - kb/concepts/Bulk Operations.md - kb/concepts/CI Integration.md - kb/concepts/COLLECTION.md - kb/concepts/CPPC.md - kb/concepts/Checkpoint Audit.md - kb/concepts/Claude Code Auto Mode.md - kb/concepts/Command Round-Trip Integrity.md - kb/concepts/Confidence Scoring.md - kb/concepts/Consolidation Tiers.md - kb/concepts/Content Quality Control.md - kb/concepts/Context Isolation.md - kb/concepts/Contradiction Resolution.md - kb/concepts/Cross-platform Agent Skills.md - kb/concepts/Crystallization.md - kb/concepts/Delete Rather Than Anonymize.md - kb/concepts/Denylist over Allowlist.md - kb/concepts/Detect-Repair Asymmetry.md - kb/concepts/Diff-Reviewable Agent Edits.md - kb/concepts/Dual Licensing by File Plan.md - kb/concepts/Entity Extraction.md - kb/concepts/Episodic Memory.md - kb/concepts/Event-Driven Automation.md - kb/concepts/Filter on Ingest.md - kb/concepts/Forgetting.md - kb/concepts/Graph Traversal.md - kb/concepts/Green Suite Blind Spot.md - kb/concepts/Hooks.md - kb/concepts/Hybrid Search.md - kb/concepts/INDEX.md - kb/concepts/Implementation Spectrum.md - kb/concepts/Index Scaling.md - kb/concepts/Issue Label Scheme.md - kb/concepts/Iteration and Cost Limits.md - kb/concepts/KB Migration.md - kb/concepts/KB Stack Versioning.md - kb/concepts/Knowledge Compounding.md - kb/concepts/Knowledge Graph.md - kb/concepts/LLM Wiki Pattern.md - kb/concepts/Lint Workflow.md - kb/concepts/MCP-Leseserver.md - kb/concepts/Mass-Update Gate.md - kb/concepts/Memory Lifecycle.md - kb/concepts/Mesh Sync.md - kb/concepts/Modbus.md - kb/concepts/Multi-Agent Collaboration.md - kb/concepts/Naming Convention Conflict.md - kb/concepts/OKF Compatibility.md - kb/concepts/Optional Instance Context File.md - kb/concepts/Personalization Plane.md - kb/concepts/Privacy and Governance.md - kb/concepts/Procedural Memory.md - kb/concepts/Publish-Remote Gate.md - kb/concepts/Quality Scoring.md - kb/concepts/Quality and Self-Correction.md - kb/concepts/RAG.md - kb/concepts/Reciprocal Rank Fusion.md - kb/concepts/SSD TRIM.md - kb/concepts/Scale Ceiling.md - kb/concepts/Self-Healing.md - kb/concepts/Semantic Lint Automation.md - kb/concepts/Semantic Memory.md - kb/concepts/Session Orientation.md - kb/concepts/Shared vs Private.md - kb/concepts/Split Merge Reclassify.md - kb/concepts/Split Threshold.md - kb/concepts/Structural Enforcement over Documented Rule.md - kb/concepts/Stub Threshold.md - kb/concepts/Supersession.md - kb/concepts/Three-Layer Architecture.md - kb/concepts/Token Economics.md - kb/concepts/Typed Relationships.md - kb/concepts/User Management.md - kb/concepts/Vector Search.md - kb/concepts/Work Coordination.md - kb/concepts/Workflow Extraction.md - kb/concepts/Workflow Orchestration.md - kb/concepts/Working Memory.md - kb/concepts/Write-Once Frontmatter Fields.md - kb/concepts/architectures/Consolidation Tiers.md - kb/concepts/architectures/Context Isolation.md - kb/concepts/architectures/Cross-platform Agent Skills.md - kb/concepts/architectures/Episodic Memory.md - kb/concepts/architectures/Hybrid Search.md - kb/concepts/architectures/Implementation Spectrum.md - kb/concepts/architectures/Knowledge Graph.md - kb/concepts/architectures/LLM Wiki Pattern.md - kb/concepts/architectures/MCP-Leseserver.md - kb/concepts/architectures/Memory Lifecycle.md - kb/concepts/architectures/OKF Compatibility.md - kb/concepts/architectures/Optional Instance Context File.md - kb/concepts/architectures/Personalization Plane.md - kb/concepts/architectures/Procedural Memory.md - kb/concepts/architectures/RAG.md - kb/concepts/architectures/Scale Ceiling.md - kb/concepts/architectures/Semantic Memory.md - kb/concepts/architectures/Three-Layer Architecture.md - kb/concepts/architectures/Token Economics.md - kb/concepts/architectures/Working Memory.md - kb/concepts/decisions/Delete Rather Than Anonymize.md - kb/concepts/decisions/Denylist over Allowlist.md - kb/concepts/decisions/Diff-Reviewable Agent Edits.md - kb/concepts/decisions/Dual Licensing by File Plan.md - kb/concepts/decisions/Issue Label Scheme.md - kb/concepts/decisions/KB Stack Versioning.md - kb/concepts/decisions/Structural Enforcement over Documented Rule.md - kb/concepts/patterns/Audit Trail.md - kb/concepts/patterns/BM25.md - kb/concepts/patterns/Command Round-Trip Integrity.md - kb/concepts/patterns/Confidence Scoring.md - kb/concepts/patterns/Contradiction Resolution.md - kb/concepts/patterns/Entity Extraction.md - kb/concepts/patterns/Filter on Ingest.md - kb/concepts/patterns/Forgetting.md - kb/concepts/patterns/Graph Traversal.md - kb/concepts/patterns/Mesh Sync.md - kb/concepts/patterns/Quality Scoring.md - kb/concepts/patterns/Reciprocal Rank Fusion.md - kb/concepts/patterns/Self-Healing.md - kb/concepts/patterns/Shared vs Private.md - kb/concepts/patterns/Typed Relationships.md - kb/concepts/patterns/Vector Search.md - kb/concepts/patterns/Work Coordination.md - kb/concepts/problems/Ambient Environment Dependency.md - kb/concepts/problems/Detect-Repair Asymmetry.md - kb/concepts/problems/Green Suite Blind Spot.md - kb/concepts/problems/Naming Convention Conflict.md - kb/concepts/problems/Write-Once Frontmatter Fields.md - kb/concepts/protocols/CPPC.md - kb/concepts/protocols/Modbus.md - kb/concepts/protocols/SSD TRIM.md - kb/concepts/workflows/Anti-Cramming Heuristic.md - kb/concepts/workflows/Bulk Operations.md - kb/concepts/workflows/CI Integration.md - kb/concepts/workflows/Checkpoint Audit.md - kb/concepts/workflows/Claude Code Auto Mode.md - kb/concepts/workflows/Content Quality Control.md - kb/concepts/workflows/Crystallization.md - kb/concepts/workflows/Event-Driven Automation.md - kb/concepts/workflows/Hooks.md - kb/concepts/workflows/Index Scaling.md - kb/concepts/workflows/Iteration and Cost Limits.md - kb/concepts/workflows/KB Migration.md - kb/concepts/workflows/Knowledge Compounding.md - kb/concepts/workflows/Lint Workflow.md - kb/concepts/workflows/Mass-Update Gate.md - kb/concepts/workflows/Multi-Agent Collaboration.md - kb/concepts/workflows/Privacy and Governance.md - kb/concepts/workflows/Publish-Remote Gate.md - kb/concepts/workflows/Quality and Self-Correction.md - kb/concepts/workflows/Semantic Lint Automation.md - kb/concepts/workflows/Session Orientation.md - kb/concepts/workflows/Split Merge Reclassify.md - kb/concepts/workflows/Split Threshold.md - kb/concepts/workflows/Stub Threshold.md - kb/concepts/workflows/Supersession.md - kb/concepts/workflows/User Management.md - kb/concepts/workflows/Workflow Extraction.md - kb/concepts/workflows/Workflow Orchestration.md - kb/index.md - kb/log.md - tools/CONTRACT.md - tools/README.md - tools/chemenu/catalog.py - tools/chemenu/commands/index_build.py - tools/chemenu/lint_core.py - tools/chemenu/tests/conftest.py - tools/chemenu/tests/test_cite_cmd.py - tools/chemenu/tests/test_git_publish.py - tools/chemenu/tests/test_index_build.py - tools/chemenu/tests/test_lint.py - tools/chemenu/tests/test_new_page.py - tools/chemenu/tests/test_provenance.py - tools/chemenu/tests/test_type_resolver.py - tools/chemenu/tests/test_xref.py - types/concept.md - types/type-spec.md
122 lines
6.9 KiB
Markdown
122 lines
6.9 KiB
Markdown
---
|
|
type: types/concept.md
|
|
concept_type: pattern
|
|
tags: [wikitool, cli, idempotenz, tooling, datenintegritaet]
|
|
created: 2026-08-31
|
|
modified: 2026-08-31
|
|
related:
|
|
- exemplifies: wikitool
|
|
- enables: Self-Healing
|
|
- contrasts: Detect-Repair Asymmetry
|
|
- see-also: Green Suite Blind Spot
|
|
- contrasts: Write-Once Frontmatter Fields
|
|
sources: [Source - Conversation - Two Round-Trip Defects Found by an Ingest Session 2026-08-31]
|
|
confidence: 0.70
|
|
confidence_base: 0.70
|
|
provenance: sourced
|
|
summary: Anforderung, dass zwei Befehle auf derselben Datei in jeder Reihenfolge zusammenpassen und jeder erzeugte Zustand einen Gegenbefehl hat - 2026-08-31 in wikitool zweimal verletzt
|
|
---
|
|
# Command Round-Trip Integrity
|
|
|
|
**Typ:** Pattern
|
|
|
|
## Definition
|
|
|
|
Command Round-Trip Integrity ist die Anforderung, dass zwei Befehle, die dieselbe Datei
|
|
schreiben, in jeder Reihenfolge zusammenpassen und dass ein Befehl, der einen Zustand erzeugt,
|
|
einen Gegenbefehl hat, der ihn vollständig zurücknimmt. Verletzt ist sie in zwei Formen: die
|
|
**Reihenfolge entscheidet über den Inhalt** - der zweite Aufruf zerstört, was der erste
|
|
geschrieben hat -, oder ein Befehl erzeugt einen Zustand, den **kein anderer Befehl mehr
|
|
erreicht**.
|
|
|
|
Beide Formen sind auf Kommandoebene unsichtbar. Jeder einzelne Aufruf gelingt, meldet Erfolg
|
|
und tut für sich genommen das Richtige; der Schaden entsteht erst aus der Kombination. In einem
|
|
Stack, dessen Regeln jede Handeditierung ausschließen, ist die zweite Form die schwerere: eine
|
|
Seite, die kein Befehl mehr reparieren kann, ist eine Sackgasse.
|
|
|
|
## Kernpunkte
|
|
|
|
- **Der Anlassfall, Form 1 (Reihenfolge):** `split_cite_block()` in [[wikitool]] nahm alles von
|
|
der Überschrift `## Fußnoten` bis zum Dateiende als Fußnotenblock und behielt daraus nur die
|
|
Zitatdefinitionszeilen. Weil `xref add` seine Abschnitte ans Dateiende hängt, entschied allein die
|
|
Reihenfolge von `xref add` und `cite add`, ob eine Seite ihre Querverweise behielt. Betroffen
|
|
waren `cite add`, `cite sync` und `rename`; 8 Seiten mit 74 Zeilen standen in der gefährdeten
|
|
Position[^s-conversation-two-round-trip-defects-found-by-an-ingest-session-2026-08-31].
|
|
- **Der Anlassfall, Form 2 (kein Gegenbefehl):** `xref add` schrieb auf einer Source-Seite ein
|
|
`related:`, das `types/source.md` nicht deklariert, und `strip_frontmatter_ref()` räumte nur
|
|
deklarierte Felder. `xref remove` konnte den Rest also nicht entfernen - ein Kommando erzeugte
|
|
einen Zustand, den ein anderes nicht rückgängig machen konnte[^s-conversation-two-round-trip-defects-found-by-an-ingest-session-2026-08-31].
|
|
- **Die Reparatur ordnet die Ausgabe, statt die Aufrufer zu disziplinieren.** Der Fußnotenblock
|
|
endet seit `1.5.1` an der nächsten Überschrift und wird immer zuletzt gerendert. Damit muss
|
|
`xref add` sein Anhängen am Dateiende nicht ändern: der Widerspruch ist aufgelöst, nicht
|
|
umgangen. Eine Regel „erst `xref`, dann `cite`" wäre eine Regel gewesen, an die sich jeder
|
|
künftige Aufrufer hätte erinnern müssen[^s-conversation-two-round-trip-defects-found-by-an-ingest-session-2026-08-31].
|
|
- **Daraus folgt Selbstheilung.** Weil der Block immer zuletzt ausgegeben wird, bringt die erste
|
|
Zitatoperation eine bereits verrutschte Seite von selbst wieder in Ordnung. Der Fix repariert
|
|
nicht nur künftige Aufrufe, sondern den bestehenden Korpus im laufenden Betrieb - siehe
|
|
[[Self-Healing]][^s-conversation-two-round-trip-defects-found-by-an-ingest-session-2026-08-31].
|
|
- **Der Beleg ist Byte-Gleichheit, nicht ein grüner Test.** Nach `xref remove` und
|
|
anschließendem `xref link-source` kam die referenzierende Concept-Seite byteidentisch aus dem
|
|
Zyklus zurück. Erst das zeigt, dass die beiden Kommandos Inversen sind; ein Test, der nur
|
|
prüft, dass hinterher wieder eine Referenz dasteht, würde eine umformatierte Seite
|
|
durchlassen[^s-conversation-two-round-trip-defects-found-by-an-ingest-session-2026-08-31].
|
|
- **Vor dem Schreiben beide Seiten prüfen.** `xref add` validiert seit `1.6.0` beide Seiten,
|
|
bevor es eine schreibt, damit eine Ablehnung keine halbe Verknüpfung hinterlässt. Eine
|
|
abgebrochene bidirektionale Operation ist selbst ein Zustand ohne Gegenbefehl[^s-conversation-two-round-trip-defects-found-by-an-ingest-session-2026-08-31].
|
|
- **Die Feldwahl folgt der Collection, nicht einer Tabelle.** `xref link-source` legt ein Ziel
|
|
aus `kb/entities/` in `entities:` und eines aus `kb/concepts/` in `concepts:` ab. Das
|
|
Verzeichnis ist der Feldname, also braucht eine neue Collection keine Codeänderung, sondern
|
|
einen Typ, der das passende Feld deklariert. Eine Typ-zu-Feld-Zuordnung wurde verworfen, weil
|
|
sie eine zweite Kopie dessen wäre, was die Type-Specs schon sagen[^s-conversation-two-round-trip-defects-found-by-an-ingest-session-2026-08-31].
|
|
- **Abgrenzung zu [[Detect-Repair Asymmetry]]:** dort meldet ein Check einen Defekt, für den es
|
|
keinen Reparaturbefehl gibt. Hier meldet niemand etwas - jeder beteiligte Aufruf endet mit
|
|
Erfolg, und der Defekt zeigt sich erst an dem, was hinterher in der Datei fehlt.
|
|
|
|
## Beispiele
|
|
|
|
- [[wikitool]] - `cite add`/`xref add` (Gitea-Issue #17, geschlossen mit `1.5.1`) und
|
|
`xref add`/`xref remove` auf einer Source-Seite (Issue #18, geschlossen mit `1.6.0`)
|
|
- [[Self-Healing]] - die Eigenschaft, die aus der gewählten Reparatur folgt
|
|
- [[Write-Once Frontmatter Fields]] - der Endzustand, wenn der Gegenbefehl fehlt, statt nur
|
|
falsch zu greifen
|
|
|
|
## Wann zu verwenden
|
|
|
|
- Beim Entwurf eines Befehls, der eine Datei schreibt, die schon ein anderer Befehl schreibt:
|
|
beide Reihenfolgen durchspielen, nicht nur die geplante.
|
|
- Bei jedem Befehl, der einen Zustand *erzeugt*: benennen, welcher Befehl ihn wieder entfernt,
|
|
und den Zyklus einmal vollständig durchlaufen - der Vergleich ist Byte-Gleichheit.
|
|
- Bei einer Ablehnung, die auf ein anderes Kommando verweist: sie ist eine Behauptung über
|
|
dessen Fähigkeiten und gehört mit dem Test ausgeliefert, der sie belegt (siehe
|
|
[[Denylist over Allowlist]]).
|
|
|
|
## Wann NICHT zu verwenden
|
|
|
|
- Für Befehle, die bewusst nicht umkehrbar sind, weil die Umkehrung eine andere Operation ist:
|
|
`publish` schreibt Historie, und die Rücknahme eines Commits ist ein eigener Vorgang, keine
|
|
fehlende Inverse.
|
|
- Als Argument gegen anhängende Schreibvorgänge überhaupt. Das Problem war nicht das Anhängen
|
|
am Dateiende, sondern ein Leser, der alles dahinter als seinen Bereich betrachtete.
|
|
|
|
## Beziehungen
|
|
|
|
## Siehe auch
|
|
|
|
- [[Source - Conversation - Two Round-Trip Defects Found by an Ingest Session 2026-08-31]]
|
|
- [[Green Suite Blind Spot]]
|
|
- [[Write-Once Frontmatter Fields]]
|
|
|
|
## Fußnoten
|
|
|
|
[^s-conversation-two-round-trip-defects-found-by-an-ingest-session-2026-08-31]: [[Source - Conversation - Two Round-Trip Defects Found by an Ingest Session 2026-08-31]]
|
|
|
|
<!-- wikitool:links -->
|
|
## Beziehungen
|
|
|
|
- **exemplifies:** [[wikitool]]
|
|
- **enables:** [[Self-Healing]]
|
|
- **contrasts:** [[Detect-Repair Asymmetry]]
|
|
- **see-also:** [[Green Suite Blind Spot]]
|
|
- **contrasts:** [[Write-Once Frontmatter Fields]]
|
|
<!-- /wikitool:links -->
|