Skip to content

TFW Knowledge โ€” Knowledge Consolidation Workflow

Role: Coordinator Output: Updated knowledge/ topic files, KNOWLEDGE.md ยง4 (index), knowledge_state.yaml Trigger: Manual (/tfw-knowledge) or gate in plan.md Step 2 Duration: 5-20 minutes

๐Ÿ”’ ROLE LOCK: COORDINATOR Permitted: reading all project artifacts, writing to KNOWLEDGE.md, knowledge/ topic files, .tfw/knowledge_state.yaml. Forbidden: writing code, modifying RF/REVIEW/RES/HL/TS files (except adding fact-candidates: processed marker).

Prerequisites

  1. Read .tfw/knowledge_state.yaml โ€” current state, last consolidation seq
  2. Read KNOWLEDGE.md โ€” current knowledge index
  3. Read all topic files in knowledge/ โ€” current verified facts
  4. Read .tfw/project_config.yaml โ†’ tfw.knowledge section for limits

Phase 1: Orient

  1. Note last_consolidation_seq โ†’ compute task range to scan
  2. List topic files with fact counts
  3. Read conventions.md ยง10.1 โ†’ list all canonical categories. Note which have topic files and which don't
  4. Present orientation summary to user (include category coverage gaps)

Phase 2: Gather

โš ๏ธ Knowledge โ‰  technical documentation. Knowledge is what would be UNKNOWN without the human saying it: vision, priorities, emotions, business context, architectural philosophy, process corrections. Technical implementation details (tools config, API constraints, build errors) belong in tfw-docs.

YES: "primary output = knowledge graph, not docs site", "close as MVP, don't stretch phases" NO: "MkDocs docs_dir cannot be project root", "use directory URLs not .md"

  1. Scan artifacts for tasks since last_consolidation_seq:
  2. HL ยง11 (Strategic Session Insights) โ€” coordinator's captured signals from planning sessions
  3. RF ยง7 (Execution Session Insights) โ€” executor's captured signals from live testing (if exists)
  4. RF, REVIEW, RES ยงFact Candidates โ€” standard FC sections
  5. Review conversation history for the current session โ€” extract facts from user messages not captured in artifacts
  6. Category coverage check: do any candidates belong to categories without topic files? Don't force facts into existing categories โ€” create new topic file when justified. Ref: conventions.md ยง10.1
  7. Present gathered candidates to user:
Found {N} candidates from {M} artifacts:
| # | Candidate | Category | Source | Confidence |
|---|-----------|----------|--------|------------|

Priority: ยง11/ยง7 insights are pre-filtered strategic signals โ†’ higher value than standard FC. Standard FC mix strategic + technical; apply Human-Only Test more strictly.

๐Ÿ›‘ WAIT โ€” user reviews candidates before consolidation

Phase 3: Consolidate

For each candidate:

  1. Human-Only Test โ€” would this fact be unknown without the human saying it? If an agent can discover it by reading code, running commands, or checking docs โ†’ reject
  2. Deduplicate โ€” check if fact already exists in topic files โ†’ skip
  3. Contradiction check โ€” if contradicts existing fact โ†’ flag, ask user
  4. DO NOT auto-resolve contradictions โ€” present both, user decides
  5. Verification:
  6. โ‰ฅ2 independent sources โ†’ โœ… verified
  7. 1 source โ†’ present to user for confirmation or skip
  8. Write to topic file โ€” knowledge/{category}.md
  9. Category: see conventions.md ยง10.1. If no topic file exists for the category, create from .tfw/templates/topic_file.md
  10. Check max_facts_per_topic and max_topic_files limits (see tfw.knowledge in project_config.yaml)
  11. Mark processed โ€” add marker to source artifact:
    > fact-candidates: processed YYYY-MM-DD
    

Present consolidation results to user before finalizing.

๐Ÿ›‘ WAIT โ€” user approves changes before writing

Phase 4: Update

  1. Review existing facts for staleness (source > 20 tasks ago or source artifact deleted) โ†’ flag for user, DO NOT auto-delete
  2. Update KNOWLEDGE.md ยง4 (Project Facts): update category counts + links to topic files

    โš ๏ธ Do NOT write to ยง1 (Architecture Map) or ยง2 (Key Artifacts) โ€” those belong to /tfw-docs (Combination scope)

  3. Update .tfw/knowledge_state.yaml:
  4. last_consolidation_seq โ†’ current task seq
  5. last_consolidation_date โ†’ today
  6. Stats: total_facts, verified, unverified, rejected, candidates_processed, sources_scanned
  7. Present summary to user

๐Ÿ›‘ WAIT โ€” user approves before final write

Behavior Rules

  • DO NOT invent facts โ€” only consolidate from artifacts and conversation
  • DO NOT auto-resolve contradictions โ€” ask user
  • DO NOT delete facts without user confirmation
  • DO NOT modify RF/REVIEW/RES content โ€” only add the fact-candidates: processed marker
  • DO NOT default all facts to existing categories โ€” check ยง10.1 for full list, create new topic files when justified