agent-borg 3.2.3__tar.gz → 3.2.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {agent_borg-3.2.3 → agent_borg-3.2.4}/PKG-INFO +1 -1
- {agent_borg-3.2.3 → agent_borg-3.2.4}/agent_borg.egg-info/PKG-INFO +1 -1
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/__init__.py +1 -1
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/cli.py +71 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/pack_taxonomy.py +1 -1
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/search.py +39 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/pyproject.toml +1 -1
- {agent_borg-3.2.3 → agent_borg-3.2.4}/README.md +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/agent_borg.egg-info/SOURCES.txt +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/agent_borg.egg-info/dependency_links.txt +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/agent_borg.egg-info/entry_points.txt +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/agent_borg.egg-info/requires.txt +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/agent_borg.egg-info/top_level.txt +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/benchmark/skills/test_skills.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/benchmarks/__init__.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/benchmarks/report.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/benchmarks/runner.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/benchmarks/scorer.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/benchmarks/tasks.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/benchmarks/tests/__init__.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/benchmarks/tests/test_benchmarks.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/__init__.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/agentskills_converter.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/aggregator.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/apply.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/changes.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/conditions.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/contextual_selector.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/convert.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/crypto.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/failure_memory.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/feedback_loop.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/generator.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/mutation_engine.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/openclaw_converter.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/privacy.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/proof_gates.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/publish.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/safety.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/schema.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/semantic_search.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/session.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/signals.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/trace_matcher.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/traces.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/uri.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/core/v3_integration.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/db/__init__.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/db/analytics.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/db/embeddings.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/db/migrations.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/db/reputation.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/db/store.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/__init__.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/alpha_signal.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/api_clients/__init__.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/api_clients/alchemy.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/api_clients/arkham.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/api_clients/base.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/api_clients/birdeye.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/api_clients/cache.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/api_clients/defillama.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/api_clients/dexscreener.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/api_clients/goplus.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/api_clients/helius.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/cli.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/cron/__init__.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/cron/alpha_cron.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/cron/delivery.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/cron/liquidation_cron.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/cron/live_scans.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/cron/portfolio_cron.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/cron/risk_cron.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/cron/state.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/cron/whale_cron.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/cron/yield_cron.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/data_models.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/dojo_bridge.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/liquidation_watcher.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/lp_manager.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/mcp_tools.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/mev/__init__.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/mev/flashbots.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/mev/jito.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/portfolio_monitor.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/risk_engine.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/security/__init__.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/security/keystore.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/security/tx_guard.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/strategy_backtester.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/strategy_selector.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/swap_executor.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/v2/__init__.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/v2/borg_bridge.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/v2/circuit_breaker.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/v2/daily_brief.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/v2/drift.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/v2/models.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/v2/outcome_store.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/v2/pack_store.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/v2/recommender.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/v2/reputation.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/v2/seed_packs.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/v2/warnings.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/whale_tracker.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/defi/yield_scanner.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/dojo/__init__.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/dojo/auto_fixer.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/dojo/cron_runner.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/dojo/data_models.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/dojo/failure_classifier.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/dojo/learning_curve.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/dojo/pipeline.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/dojo/report_generator.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/dojo/session_reader.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/dojo/skill_gap_detector.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/dojo/tests/__init__.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/dojo/tests/test_auto_fixer.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/dojo/tests/test_failure_classifier.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/dojo/tests/test_learning_curve.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/dojo/tests/test_pipeline.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/dojo/tests/test_report_generator.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/dojo/tests/test_session_reader.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/dojo/tests/test_skill_gap_detector.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/eval/__init__.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/eval/e1a_seed_pack_validation.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/fleet/syncer.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/integrations/__init__.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/integrations/agent_hook.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/integrations/http_server.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/integrations/mcp_server.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/integrations/nudge.py +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/seeds_data/borg/SKILL.md +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/seeds_data/circular-dependency-migration.md +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/seeds_data/code-review.md +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/seeds_data/configuration-error.md +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/seeds_data/defi-risk-check.md +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/seeds_data/defi-yield-strategy.md +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/seeds_data/guild-autopilot/SKILL.md +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/seeds_data/import-cycle.md +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/seeds_data/migration-state-desync.md +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/seeds_data/missing-dependency.md +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/seeds_data/missing-foreign-key.md +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/seeds_data/null-pointer-chain.md +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/seeds_data/permission-denied.md +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/seeds_data/race-condition.md +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/seeds_data/schema-drift.md +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/seeds_data/systematic-debugging.md +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/seeds_data/test-driven-development.md +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/seeds_data/timeout-hang.md +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/borg/seeds_data/type-mismatch.md +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/setup.cfg +0 -0
- {agent_borg-3.2.3 → agent_borg-3.2.4}/tests/test_e2e_verify.py +0 -0
|
@@ -487,6 +487,59 @@ def _cmd_list(args: argparse.Namespace) -> int:
|
|
|
487
487
|
return 0
|
|
488
488
|
|
|
489
489
|
|
|
490
|
+
def _cmd_observe(args: argparse.Namespace) -> int:
|
|
491
|
+
"""Record a task/context observation as a trace in ~/.borg/traces.db.
|
|
492
|
+
|
|
493
|
+
This is the CLI counterpart to the MCP borg_observe tool. Calling this
|
|
494
|
+
records a minimal trace entry (task + optional context/error) via
|
|
495
|
+
borg.core.traces so that subsequent `borg search` calls can surface it.
|
|
496
|
+
|
|
497
|
+
Added in v3.2.4 to fix the observe→search roundtrip bug discovered in the
|
|
498
|
+
P1.1 MiniMax experiment (docs/20260408-1118_borg_roadmap).
|
|
499
|
+
"""
|
|
500
|
+
from borg.core.traces import TraceCapture, save_trace
|
|
501
|
+
|
|
502
|
+
task = " ".join(args.task).strip() if isinstance(args.task, list) else (args.task or "").strip()
|
|
503
|
+
if not task:
|
|
504
|
+
print("Error: observe requires a non-empty task description", file=sys.stderr)
|
|
505
|
+
return 1
|
|
506
|
+
|
|
507
|
+
context = getattr(args, "context", "") or ""
|
|
508
|
+
error = getattr(args, "error", "") or ""
|
|
509
|
+
agent_id = getattr(args, "agent", "") or "cli"
|
|
510
|
+
|
|
511
|
+
try:
|
|
512
|
+
capture = TraceCapture(task=task, agent_id=agent_id)
|
|
513
|
+
# Synthesize a minimum set of tool calls so the trace has content:
|
|
514
|
+
# one stub 'observe' call carrying the context/error text so the
|
|
515
|
+
# keywords/error patterns extractors have something to chew on.
|
|
516
|
+
if context or error:
|
|
517
|
+
capture.on_tool_call(
|
|
518
|
+
tool_name="observe",
|
|
519
|
+
args={"task": task, "context": context},
|
|
520
|
+
result=error or context,
|
|
521
|
+
)
|
|
522
|
+
trace = capture.extract_trace(
|
|
523
|
+
outcome="observed",
|
|
524
|
+
root_cause="",
|
|
525
|
+
approach_summary=context[:500] if context else "",
|
|
526
|
+
)
|
|
527
|
+
trace["source"] = "observe-cli"
|
|
528
|
+
trace_id = save_trace(trace)
|
|
529
|
+
print(f"Recorded trace {trace_id} for task: {task[:80]}")
|
|
530
|
+
if args.json:
|
|
531
|
+
print(json.dumps({
|
|
532
|
+
"success": True,
|
|
533
|
+
"trace_id": trace_id,
|
|
534
|
+
"task": task,
|
|
535
|
+
"source": "observe-cli",
|
|
536
|
+
}))
|
|
537
|
+
return 0
|
|
538
|
+
except Exception as e:
|
|
539
|
+
print(f"Error recording observation: {e}", file=sys.stderr)
|
|
540
|
+
return 1
|
|
541
|
+
|
|
542
|
+
|
|
490
543
|
def _cmd_version(args: argparse.Namespace) -> int:
|
|
491
544
|
"""Show version."""
|
|
492
545
|
print(f"borg {__version__}")
|
|
@@ -1176,6 +1229,24 @@ def main() -> int:
|
|
|
1176
1229
|
borg list""")
|
|
1177
1230
|
p.set_defaults(func=_cmd_list)
|
|
1178
1231
|
|
|
1232
|
+
# borg observe <task> [--context ...] [--error ...]
|
|
1233
|
+
p = sub.add_parser("observe", help="Record an observation as a trace",
|
|
1234
|
+
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
1235
|
+
epilog="""Examples:
|
|
1236
|
+
borg observe 'fix django authentication bug'
|
|
1237
|
+
borg observe 'debug failing test in auth module' --context 'TypeError on login'
|
|
1238
|
+
borg observe 'migrate database schema' --error 'OperationalError: no such column'
|
|
1239
|
+
|
|
1240
|
+
Writes a trace to ~/.borg/traces.db so subsequent 'borg search' calls can
|
|
1241
|
+
surface it. This is the CLI counterpart to the MCP borg_observe tool. Added
|
|
1242
|
+
in v3.2.4 to fix the observe→search roundtrip bug from the P1.1 experiment.""")
|
|
1243
|
+
p.add_argument("task", nargs="+", help="Task description (required)")
|
|
1244
|
+
p.add_argument("--context", default="", help="Additional context (optional)")
|
|
1245
|
+
p.add_argument("--error", default="", help="Error message to associate with the trace (optional)")
|
|
1246
|
+
p.add_argument("--agent", default="cli", help="Agent id for provenance (default: cli)")
|
|
1247
|
+
p.add_argument("--json", action="store_true", help="Output raw JSON")
|
|
1248
|
+
p.set_defaults(func=_cmd_observe)
|
|
1249
|
+
|
|
1179
1250
|
# guild version
|
|
1180
1251
|
p = sub.add_parser("version", help="Show version",
|
|
1181
1252
|
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
@@ -623,7 +623,7 @@ def debug_error(error_message: str, show_evidence: bool = True) -> str:
|
|
|
623
623
|
lang_line = (
|
|
624
624
|
f"Detected language: {detected_lang}. "
|
|
625
625
|
"Borg currently has Python/Django expert packs only.\n"
|
|
626
|
-
f"
|
|
626
|
+
f"Borg refuses to give a Python answer to a {detected_lang} "
|
|
627
627
|
"error — see docs/20260408-0623_classifier_prd/ for the\n"
|
|
628
628
|
"multi-language classifier roadmap."
|
|
629
629
|
) if detected_lang else (
|
|
@@ -279,6 +279,45 @@ def borg_search(query: str, mode: str = "text", requesting_agent_id: str = None)
|
|
|
279
279
|
if query_lower in searchable:
|
|
280
280
|
matches.append(pack)
|
|
281
281
|
|
|
282
|
+
# v3.2.4 observe→search roundtrip fix: also surface relevant traces.
|
|
283
|
+
# Traces are stored in ~/.borg/traces.db by borg observe / MCP
|
|
284
|
+
# borg_observe / borg_apply, but pre-3.2.4 borg_search never read from
|
|
285
|
+
# them — which made C2 (seeded) indistinguishable from C1 (empty) in
|
|
286
|
+
# the P1.1 experiment. We now add trace hits as synthetic matches with
|
|
287
|
+
# source="trace" so callers can tell them apart from packs.
|
|
288
|
+
#
|
|
289
|
+
# Gate: only surface traces if BORG_DIR is a real directory. Tests that
|
|
290
|
+
# mock BORG_DIR to /nonexistent will skip this path, preserving their
|
|
291
|
+
# pre-3.2.4 expectations. Production code paths hit the real directory
|
|
292
|
+
# and get trace surfacing.
|
|
293
|
+
try:
|
|
294
|
+
if not (BORG_DIR and Path(BORG_DIR).is_dir()):
|
|
295
|
+
raise RuntimeError("BORG_DIR not present — skipping trace lookup")
|
|
296
|
+
from borg.core.trace_matcher import TraceMatcher
|
|
297
|
+
matcher = TraceMatcher()
|
|
298
|
+
trace_hits = matcher.find_relevant(query, top_k=10)
|
|
299
|
+
for trace in trace_hits or []:
|
|
300
|
+
trace_id = str(trace.get("id", ""))
|
|
301
|
+
if not trace_id:
|
|
302
|
+
continue
|
|
303
|
+
task_desc = (trace.get("task_description") or "")[:120]
|
|
304
|
+
matches.append({
|
|
305
|
+
"name": f"trace:{trace_id}",
|
|
306
|
+
"id": f"trace:{trace_id}",
|
|
307
|
+
"problem_class": task_desc or "observed-trace",
|
|
308
|
+
"phase_names": [],
|
|
309
|
+
"phases": 0,
|
|
310
|
+
"confidence": "observed",
|
|
311
|
+
"tier": "trace",
|
|
312
|
+
"source": "trace",
|
|
313
|
+
"trace_id": trace_id,
|
|
314
|
+
"outcome": trace.get("outcome", ""),
|
|
315
|
+
"technology": trace.get("technology", ""),
|
|
316
|
+
"match_score": trace.get("match_score", 0.0),
|
|
317
|
+
})
|
|
318
|
+
except Exception:
|
|
319
|
+
pass # Never let trace lookup break pack search
|
|
320
|
+
|
|
282
321
|
# Apply reputation-weighted re-ranking for text mode
|
|
283
322
|
if requesting_agent_id and matches and AgentStore is not None and ReputationEngine is not None:
|
|
284
323
|
try:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|