How zhk-lab/ebg works
EBG is a training-free evidence-grounded oversight method: it turns repository or trace evidence into behavior, scope, and relation structures, then supports task-oriented review and benchmark prediction. The interactive Repo workflow is driven by AgentLoop; FeedbackTrace also has a one-shot TraceReview path. The repository additionally contains an independent Codex review harness. The graph preserves these major product branches; edges for unsampled implementations are included only when documented, and marked dashed when their wiring is not evidenced in the excerpts or index.
Main entry points: agentloop/runner.py Interactive Agent · tracereview/runner.py TraceReview · service.py Evidence Service · behavior_atomization.py Behavior Atomization
Components 22
Evidence Graph
- Evidence Intake
src/ebg/evidence_intake.py - Behavior Atomization
src/ebg/behavior_atomization.py - Behavior Directory
src/ebg/behavior_directory.py - Relation Linking
src/ebg/relation_linking.py - Graph Retrieval
src/ebg/local_graph_retrieval.py - Graph Model
src/ebg/core/model.py - RepoGraph Construction
src/repograph/construction.py
AgentLoop
- Benchmark Config
src/agentloop/benchmark_configs/model.py - Interactive Agent
src/agentloop/runner.py - Context Builder
src/agentloop/context.py - Model Provider
src/agentloop/provider.py - Run Persistence
src/agentloop/storage.py
Review And Evaluation
- Prediction Contracts
src/evaluation_core/contracts.py - TraceReview
src/tracereview/runner.py - SilentSwap Source Review
src/agentloop/silentswap_source_review.py - Benchmark Judges
evaluation
Codex Harness
- Evidence Service
harness/src/codex_harness/application/service.py - Repository Capture
harness/src/codex_harness/application/repository.py - Requirement Matching
harness/src/codex_harness/application/matching.py - Task Storage
harness/src/codex_harness/application/storage.py - Harness EBG
harness/src/codex_harness/ebg
Other components
- Monitor
Connections 26
- Monitor → Interactive Agent: requests audit
- Interactive Agent → Benchmark Config: loads config
src/agentloop/benchmark_configs/model.py - Interactive Agent → Context Builder: builds context
- Interactive Agent → Model Provider: calls model
- Interactive Agent → Run Persistence: persists runs
- Interactive Agent → Prediction Contracts: validates output
- Evidence Intake → Graph Model: uses types
src/ebg/evidence_intake.py - Behavior Atomization → Evidence Intake: consumes evidence
src/ebg/behavior_atomization.py - Behavior Atomization → Graph Model: uses types
src/ebg/behavior_atomization.py - Behavior Atomization → Behavior Directory: feeds behaviors
- Behavior Directory → Relation Linking: provides behavior context
- Relation Linking → Graph Retrieval: supplies relations
- RepoGraph Construction → Graph Model: uses graph types
src/repograph/construction.py - TraceReview → Context Builder: uses context
src/tracereview/runner.py - TraceReview → Model Provider: calls model
src/tracereview/runner.py - TraceReview → Run Persistence: persists runs
src/tracereview/runner.py - TraceReview → Prediction Contracts: validates prediction
src/tracereview/runner.py - SilentSwap Source Review → Model Provider: uses provider
src/agentloop/silentswap_source_review.py - SilentSwap Source Review → Run Persistence: reads history
src/agentloop/silentswap_source_review.py - Prediction Contracts → Benchmark Judges: defines prediction contracts
- Repository Capture → Harness EBG: builds EBG stages
harness/src/codex_harness/application/repository.py - Requirement Matching → Harness EBG: uses behavior modules
harness/src/codex_harness/application/matching.py - Evidence Service → Requirement Matching: matches requirements
harness/src/codex_harness/application/service.py - Evidence Service → Repository Capture: requests repository view
harness/src/codex_harness/application/service.py - Evidence Service → Task Storage: reads task state
harness/src/codex_harness/application/service.py - Monitor → Evidence Service: requests review