Conversation
- Add scope classification (project/global/both) to knowledge extraction - Route global entries to ~/.archon/knowledge/logs/ with source attribution - Add codebase-agnostic global synthesis prompt with contradiction detection - Create archon-knowledge-correct workflow with approval gate - Add scope field to knowledge_extract DAG node schema - 20 new tests covering scope routing, parsing, and global synthesis Implements PRD Phase 3.5 (Global Knowledge Base Tier)
Comprehensive PR ReviewPR: #5 — feat(knowledge): global knowledge base tier and correction workflow SummaryClean, well-structured feature addition. Strong test coverage (20+ new tests), follows existing codebase patterns, respects CLAUDE.md conventions. No critical or high-severity issues. Verdict:
9 unique findings after deduplicating across agents. MEDIUM Issues1. parseScopedOutput regex may capture wrong content if AI reverses section order
The View fixconst globalMatch = /## GLOBAL\s*\n([\s\S]*?)(?=## PROJECT|$)/i.exec(content);2. Partial write on dual-scope extraction failure
When Recommendation: Accept as-is — existing 3. DAG executor scope forwarding not asserted in tests
Recommendation: Add two test assertions for default and explicit scope. 4. CLAUDE.md missing scope field on knowledge-extract node type
The View fix`knowledge-extract:` (targeted knowledge extraction from workflow context, appends to daily log; `scope` field routes to project, global, or both logs — default `'both'`)LOW IssuesView 5 low-priority suggestions
What's Good
Next Steps
Reviewed by Archon comprehensive-pr-review workflow |
- Fix globalMatch regex to use lookahead (prevents wrong capture on reversed AI output) - Simplify store-adapter extractKnowledge to direct reference - Add scope fallback logging in parseScopedOutput - Add @param scope to KnowledgeExtractFn JSDoc - Fix "daily log" singular to "daily log(s)" in JSDoc - Document knowledge-extract scope field in CLAUDE.md - Add 2 tests for DAG executor scope forwarding (default + explicit)
⚡ Auto-Fix ReportStatus: COMPLETE Fixes Applied
What Was Fixed
Tests Added
⏭️ Skipped (Per Review Recommendation)
Validation✅ Type check | ✅ Lint | ✅ Tests (all pass) Auto-fixed by Archon comprehensive-pr-review workflow |
🎯 Workflow SummaryPlan: Implementation vs Plan
📋 Deviations from Plan (3)
Review Summary
Remaining: 1 LOW (test name slightly misleading — review recommends keeping as-is). Review verdict: APPROVE — clean, well-structured feature addition with strong test coverage. Validation
ℹ️ Deferred Items (NOT Building)These were intentionally excluded from scope:
Artifacts: |
Completes plan Tasks 1-3 that the initial implementation skipped: 1. EXTRACTION_PROMPT now instructs the capture model to produce ## PROJECT and ## GLOBAL blocks with a conservative bar (project is the default; global only for codebase-independent knowledge). 2. captureKnowledge parses scoped output via parseScopedOutput and routes each block to its tier's daily log. 3. Global entries trigger scheduleGlobalFlush(); global log entries include **Source**: owner/repo for attribution. Also refactored the duplicated global log writer into a shared writeGlobalLogEntry() helper (replacing the workflow-specific appendToGlobalDailyLog). Why this matters: captureKnowledge is the primary automatic capture path (session close, /reset, workflow completion, CLI post-workflow). Without this wiring, ~/.archon/knowledge/ would stay empty in normal use — only workflows with explicit knowledge_extract nodes would populate it, and zero default workflows have them. Tests: added 4 scope-routing cases to knowledge-capture.test.ts covering both-block, project-only, global-only, and malformed (fallback-to-project) outputs. Full validate passes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
archon-knowledge-correctapproval-gate workflow,scopefield onknowledge_extractDAG nodes$KNOWLEDGE_GLOBAL/$KNOWLEDGE_PROJECTvariables, no CLI--globalflag, no web UI for KB browsing, no per-language global clusteringUX Journey
Before
After
Architecture Diagram
Before
After
Connection inventory:
scopeparameterscopeparameterappendToGlobalDailyLog()with source attributionscheduleGlobalFlush()on global writes## Sourcesand## ContradictionsLabel Snapshot
risk: lowsize: Mcore,workflowscore:knowledge-capture,core:knowledge-flush,workflows:dag-executor,workflows:schemasChange Metadata
featuremultiLinked Issue
.archon/ralph/llm-knowledge-base-system/prd.mdValidation Evidence (required)
bun run validate # ✅ All passmdast-util-gfm— unrelated, exists on main)Security Impact (required)
NoNoNoYes— global KB writes to~/.archon/knowledge/logs/(already established by knowledge-init.ts; this adds the capture write path)Compatibility / Migration
Yes— scope defaults to'both', existing workflows unchangedNoNoHuman Verification (required)
Side Effects / Blast Radius (required)
knowledge_extractnodes now parse for scope markers in AI output — malformed output falls back to project (safe default)Rollback Plan (required)
knowledge.enabled: falsedisables entire KB pipelineRisks and Mitigations
archon-knowledge-correctworkflow enables correctionsflush.lock) prevents concurrent flushesPlan:
.claude/archon/plans/knowledge-base-global-tier.plan.mdWorkflow ID:
ac09c5076b3f5a648b84bb6ae3d70d38