Repository navigation
Conversation
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
|
Waiting for This PR needs a linked issue with the |
Test with a real decision model: Inception Mercury DecideWe tested this prototype with Inception's Mercury Decide model ( How we connected itMercury Decide accepts only
The API key stayed in the process environment. It was not in any request body, log or output file. Direct API checks
End-to-end runFixture: the 64 TypeScript source files of
Findings
Limits of this test: three searches on one small fixture. The local embedding server was slow (the query embedding needed a 30 s timeout), which made the seeds weaker. This is not a benchmark. Next stepI will add a native |
Mercury Decide style APIs accept only POST /decisions, not chat completions. The backend asks one keep and one expand question for each candidate plus one stop question, and orders kept symbols by probability. A user-tier threshold (default 0.5) selects each action. The endpoint and decisions backends share one HTTP helper for deadline, size cap and errors. Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Review follow-up: one URL helper validates both decision backends and matches the suffix on the URL path, so a host name cannot match. Tests cover answers without the noul type, and the docs state the tie order. Co-authored-by: alfonso-aft <289616620+alfonso-aft@users.noreply.github.com>
Native
|
| Search | Result |
|---|---|
| "how is the search context trace capped before it is sent to aft" (with trace) | 1 round, kept 0 of 4 (the seeds were not related), 1.3 s |
| "how does the bridge respawn the aft binary after the process dies" (with trace) | 1 round, kept BinaryBridge (1 of 4), 0.8 s |
| "where are per-command timeouts chosen" (query only) | 1 round, kept AftTransportOptions (1 of 5), 0.7 s |
All three footers show model=mercury-decide and fallback=none. With these instructions, no kept node got an expand probability of 0.5 or more, so each walk stopped after round 1 (stop=empty_frontier). The adapter test had different question text and expanded the restart search for two more rounds. The question text and the threshold change the walk depth, so they are good candidates to tune.
The full test suite was not run again for this change.
Linked issue
Approved issue: #890
What changes
This draft PR is a prototype of the design in #890:
aft_searchcollects related code from the call graph. The PR does not add a tool or an agent argument. It is off by default.When gather is on, the host plugin sends the reasoning and text that caused the search. This text does not go in the tool arguments. The engine starts the walk from the top code hits. It walks callers and callees on a pinned call-graph snapshot. In each round, a decision model selects the nodes to keep. The ranked results come first and do not change. A capped "Related code" section follows them.
This PR uses prototype defaults for the open questions in #890. Each default is easy to change when you answer.
Prototype defaults (open questions in #890)
search.gather.enabledis set totrue, gather runs on each search that has a natural-language query. A trace is not necessary. A pattern-only search or an empty query does not walk and does not read the session.Configuration
User tier only. A project can set
enabled: false, but cannot turn gather on or change the backend, endpoint, model, key or limits.Trace contents for each host
The plugin reads no message parts while gather is off. The user text comes last, so the 6000-character cap keeps it.
Failure behaviour
A gather problem does not make a search fail. The search gives the usual results and one line that gives the cause in these conditions:
building,suspended,unavailable,snapshot_unavailable).other_project).no_seeds).output_budget).If a decision times out, the endpoint gives an error, or the response is not correct JSON, that round uses the deterministic order. The footer records it as
fallback=<round>:<reason>.Security and data privacy
RawRequestDebug output shows only the id, command, session and parameter count.Changes to current behaviour
searchblock that sets onlygatherkeeps the user's basesearch.rerank. A harness block that setsrerankreplaces the basererankblock, as before.aft_searchagent-visible reply keeps its order: ranked results, then the gather section, then the search status lines and theshown N of Mtrailer last. The trailer counts the ranked results only.gather/in sliceA11-live-engine-integration. Seven list-envelope exclusions include the internal limits ingather/. Each exclusion gives its cause.Limits and follow-ups
pub(super)andpub(in …)functions. It identifies their cuts with the name of the previous item. Four current entries show this problem (external_exact.rs:316,:317,:563,external_pattern.rs:150). The gather exclusions use the current scanner keys and give the correct function inlocation_or_primitive. This problem is filed as list-envelope discovery gives pub(super) and pub(in …) functions the key of the previous function #971.gather_noticeline does not name the state that it replaces.How it was checked
Tests
gather_library tests, 19gather_search_testintegration tests through real subc frames and a local endpoint, the ownership audit and the fulllist_envelopesuite.Known test failures that are not from this PR
On the same Linux test host, with the same isolated storage, these tests also fail on a clean checkout of upstream main:
callgraph_testintegration: ten tests (callgraph_cross_file_tree,callgraph_callers_*,callgraph_impact_*,callgraph_depth_limit_truncates,callgraph_unknown_symbol_error,callgraph_aliased_import_resolution,callgraph_ops_return_building_then_ready_async).callgraph::tests::workspace_package_resolution_prefers_modern_ts_source_extensionsandinspect_dead_code_test::inspect_dead_code_keeps_workspace_barrel_default_export_import_live.commands::configure::tests(configure_volume_root_disables_root_work,account_home_and_ancestors_are_broad_when_environment_home_differs) andworker_jail::relaxed_linux_names_unenforced_denies_and_keeps_broad_access.bash_background::registry::memory_limit_testsandbash_test::bash_memory_cap_stop_keeps_changed_files_completion_fence.memory_limit_stops_foreground_commandis intermittent (on the clean base, 1 of 3 runs was successful).subc::page_collect::tests::*is intermittent (on the clean base, 9 of 46 failed in one run. On this branch, 0, 5 and 8 failed in three runs).packages/aft-bridge/src/__tests__/storage-isolation.test.ts:254, twoaftCLI checklist tests, and threeaft-opencodetests (auto-install pass slot, invalid RPC JSON envelopes, migration bootstrap in subc mode).cargo clippy -p aft-test-fake-lsp-server -- -D warnings:crates/aft/tests/lsp/fake_server.rs:744(clippy::match_result_ok) with the current toolchain.