Repository navigation
Releases
v0.1.65 — build-symbols hardening
v0.1.65 — build-symbols hardening (AOSP / Linux / Perfetto / self)
Major build-symbols fixes from running scry against AOSP, Linux
kernel, Perfetto, and scry itself end-to-end:
Soong bridge:
- Cross-shard ninja variable expansion.
javacFlags = ${m.<mod>_<variant>.javacFlags}indirection used to be
captured as a literal string; now resolves to the actual flag
list. Unblocks libcore's --patch-module=java.base=… and every
AOSP module hiding flags behind a variable reference. - Forward Soong's javacFlags + kotlincFlags through to the
compiler, with surgical filtering (drop -Werror /
-source/-target/--release / -classpath / -bootclasspath /
--system= / -d / -processorpath / -Xplugin: which we
synthesize; keep --patch-module=, --add-modules=,
--add-exports=, -Xmultiplatform, -Xexpect-actual-classes). - Path-list rewriting for
--patch-module=NAME=p1:p2:…so
libcore's:out/soong:abs/jar.jarresolves correctly when
javac runs from any cwd.--system=nonemagic value passes
through unchanged. - Shell-aware tokenization (shell_words::split). AOSP wraps the
entire Error Prone configuration as one '…' shell-quoted arg;
split_whitespace was leaking every -Xep:… flag and javac
aborted compilation with "invalid flag". 11 modules unblocked. - srcjar extraction. Reads Soong's srcJars binding (AIDL
aidl0.srcjar) + auto-discovers sibling kapt/kapt-sources.jar
(Hilt / AutoValue / Dagger factory stubs) + extracts them via
unzipinto a per-compilation scratch dir, appending the .java
files to the source argfile. Resolves IFooCallback, Hilt_X,
AutoValue_X, Dagger factory references. - Sibling-output classpath augmentation. Auto-discovers
busybox/R.jar (AAPT2 R class), aapt2/R.jar (alternative),
turbine-apt/.jar, aconfig/.jar, merged_aconfig_files/*.jar
and folds them into the rule's -classpath. Resolves R.string.x,
com.android.wifi.flags.X, and other resource / flag references. - Variant fallback. New JvmRule trait + select_built_variant
groups multi-variant rules by logical module name and keeps
the one whose required .rsp files all exist on disk. Halves
the kotlinc dispatch work on multi-variant modules and
unblocks ~20 modules whose declared variant was unbuilt but
whose apex sibling has full intermediates.
Kotlin plugin:
- install_indexers.sh patches semanticdb-kotlinc in-place before
sbt publishM2to silence the FirFileSymbol stderr noise on
Kotlin 2.x — the plugin already returned NONE for file-level
symbols but printed first, making scry-bridge mis-classify
every Kotlin compilation containing a top-level fun/val as
"partial / no output".
Polyglot / general:
- Sidecar carry-over: scry index's atomic dir swap no longer
wipes scip_index.bin / clang_usrs.bin written independently
by build-symbols. - PATH plumbing: subprocess inherits PATH with the indexer
binary's parent dir prepended, so rust-analyzer can find
cargo / scip-go can find go without the operator wiring it. - Stderr surfacing: surface the last 3 non-empty stderr lines
of an indexer failure, not just the first banner. - Polyglot dispatch bails on indexer failure instead of
silently shipping an incomplete sidecar. - resolve_indexer_binary: clean two-source resolution
(SCRY_INDEXER_ env var → PATH). No hardcoded distro
paths, no npm-prefix probing. - scry_tmp_dir everywhere — never writes to /tmp. Honours
$SCRY_TMP_DIR; defaults to /mnt/agent/tmp. - GN over-spec: TUs whose source file doesn't exist on disk
count as "skipped (missing source)" not "failed".
CLI:
scry build-symbolsexposes every indexer override
(--javac, --scip-java, --kotlinc, --semanticdb-{javac,kotlinc}-jar,
--only-module, --max-compilations, --skip-{java,kotlin},
--only-root, --max-targets) instead of silently passing None.
Docs:
- BUILD_AWARE.md: indexer-binary configuration and scratch-dir
sections. - DEVELOPMENT.md: "Open work" — frozen scope for the remaining
items (coverage ceiling without a fullm, partial-success
classifier, kernel 634 parse failures, usr_for_window warm
latency, scry-cli main.rs file split).
Verified end-to-end:
- scry-on-scry: 6771 symbols / 74k records; cross-crate precision
queries return correct callers across all 3 Default impls of
resolve_indexer_binary. - perfetto: 235k USRs / 99M records, 0 real failures, 1349
skipped (missing-source — GN over-spec). - AOSP (with srcjar fix): 1119 javac OK / 81 partial / 13
no-output (was 1024 / 164 / 25 before).
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com
v0.1.64 — revert lexical receiver heuristics (v0.1.60-v0.1.63)
Revert v0.1.60-v0.1.63 (lexical receiver heuristics).
The "Kythe-gap arc" of v0.1.60-v0.1.63 leaned on three lexical
hacks that this revert removes:
- PascalCase filter to decide if an identifier is a class
(Foo.bar()⇒ "Foo is a class because it starts uppercase"). - Byte-adjacency pairing of TypeUse + Call refs to recover
the (receiver, method) tuple after the fact. - Receiver-aware resolver narrowing that consumed (1)+(2).
These produced a measurable but narrow win on static-utility-
method calls (Log.d, Objects.equals, …) while leaving
~80%+ of method dispatch untouched (instance calls, chained
calls, generic methods, etc.) — and the approach didn't
generalize. Trying to extend it broke more than it fixed
(C++ template patterns, whitespace-tolerant pairing).
The right path — what Kythe actually does — is structured
semantic refs from real compilers, not lexical approximations.
scry already has both Kythe-equivalent ingestors:
- Path B:
scry clang-indexconsumes libclang USRs from
compile_commands.json(the C/C++/ObjC compiler's own
per-occurrence symbol IDs). - Path C:
scry scip-importconsumes SCIP indexes from
scip-java / scip-rust / scip-go / scip-typescript / etc.
(compiler-backed per-occurrence symbol IDs across languages).
Both produce true cross-TU symbol identity — the actual
Kythe-grade signal. v0.1.65 wires auto-discovery so they
fire on-by-default whenever their inputs are present in the
indexed tree.
The lexical-receiver work is preserved in git history (tags
v0.1.60-v0.1.63 still resolve) for anyone who wants to study
the dead end.
v0.1.63 — receiver-aware narrowing for C++ and Rust
Kythe-gap arc, cross-language extension. Receiver-aware
narrowing now works for C++ (Foo::bar()) and Rust
(Foo::bar()) — same pass 2.5 + resolver mechanism from v0.1.62,
fed by language-specific tree-sitter queries that capture the
scope identifier of scoped calls.
// C++ — Foo::bar() captures Foo as a TypeUse ref, pass 2.5 pairs
// it with the bar Call ref, resolver narrows to Foo's bar.
namespace Foo { void bar(); }
namespace Bar { void bar(); }
void caller() { Foo::bar(); } // pinned to Foo::bar// Rust — same shape for impl methods and trait associated fns.
struct Foo; impl Foo { fn bar() {} }
struct Quux; impl Quux { fn bar() {} }
pub fn caller() { Foo::bar(); } // pinned to Foo::barCombined with v0.1.60/v0.1.61 (Java/Kotlin), the receiver-aware
resolution rule now covers the four highest-volume languages in
the AOSP+Linux corpus: Java, Kotlin, C++, Rust. C is intentionally
skipped — C has no Foo::bar scoping; struct-field calls
(obj.fn()) have lowercase receivers that don't fit the
PascalCase filter (the filter would over-include false positives
without strong signal).
Implementation note: tree-sitter-cpp's qualified_identifier
node only exposes namespace_identifier as a valid scope:
child — even when the scope is logically a class (MyClass::foo),
the grammar reports it as a namespace_identifier without
semantic analysis. The capture catches both shapes regardless.
Go and TypeScript queued for next session (Go's heuristic needs
care around package vs class receivers; TypeScript isn't a heavy
AOSP language).
E2E test: receiver_aware_narrowing_cpp_and_rust — pins TypeUse
ref capture for both languages.
v0.1.62 — receiver-aware resolver narrowing (Kythe-gap arc 3/3)
Kythe-gap arc, slice 3/3. Receiver-aware resolver narrowing.
The slice that finally moves the resolved% number.
build-resolutions now runs a new pass 2.5 that pairs each
Call ref with its preceding TypeUse ref (via byte-adjacency:
Foo.bar() ⇒ Foo's TypeUse ends at the dot byte, bar's Call
starts at dot+1). The result is a (file_id, call_byte_start) → receiver_class map.
In the resolver, when processing a Call ref shaped like
Foo.bar(), candidates are constrained to defs whose enclosing
class is Foo OR anything in Foo's ancestor set (via the
existing class_to_ancestors precompute from v0.1.33). One
candidate ⇒ pinned; multiple ⇒ fall through to the existing
rules. This is the strongest narrowing signal we have short of
full type inference — source-level evidence that the call
target is in this specific class chain.
// Before v0.1.62, with two `bar()` defs in unrelated classes:
// `Foo.bar()` resolves to NULL (ambiguous, returned 0)
// After v0.1.62:
// `Foo.bar()` resolves to Foo's bar (receiver pins it)
class Foo { static void bar() {} }
class Bar { static void bar() {} }
class Caller { void run() { Foo.bar(); } } // pinned to Foo's barWhy this matters: most static-utility-method calls in AOSP
(Log.d, Objects.equals, TextUtils.isEmpty, Math.min,
String.valueOf, …) have unambiguous receivers under this
rule. Expect resolved% to move materially from the current
49.6% on AOSP after a re-index.
Cost: pass 2.5 is O(N_refs) with two HashMap probes per
ref. Memory peak adds a (u32, u32) → String map sized by the
count of static-receiver calls (typically O(M) where M is
non-trivial but a small constant fraction of N_refs). Acceptable
peak for the AOSP-scale build budget.
E2E test: receiver_aware_narrowing_pins_static_call — two
classes both define bar(); Foo.bar() in a third file MUST
resolve to Foo's bar via the by-def histogram. Without v0.1.62
this returns unresolved.
v0.1.61 — Kotlin static-receiver capture (Kythe-gap arc slice 2/3)
Kytge-gap arc, slice 2/3. Kotlin static-receiver capture,
symmetric with v0.1.60's Java pattern. Foo.bar
navigation_expression with a class-named receiver now emits a
TypeUse ref to Foo alongside the existing FieldAccess ref
(latter preserved for backward compatibility).
Same PascalCase filter rejects local-var receivers
(myFoo.bar → no myFoo TypeUse). With v0.1.60, the Kythe-gap
arc has covered Java + Kotlin — the two highest-volume languages
in the AOSP corpus, and the two where polymorphism most hurts
the heuristic resolver.
E2E test: kotlin_static_receiver_capture — positive
(Foo.staticBar emits TypeUse ref to Foo), negative
(myFoo.instanceBar does NOT emit myFoo TypeUse).
Next: v0.1.62 — resolver narrowing that pairs the TypeUse ref
with the immediately-following Call ref to pin the method
dispatch. This is the slice that should actually move the
49.6% resolved% number.
v0.1.60 — Java static-receiver capture (first slice of Kythe-gap arc)
First slice of the Kythe-gap arc. Java static-receiver capture:
Foo.bar() now emits a TypeUse ref to Foo in addition to the
existing Call ref to bar. So scry ref Foo / scry callers Foo (with --kind type) catches static-method usage sites the
previous tree-sitter query silently missed.
// Caller.java
Foo.staticBar(); // NEW: emits TypeUse ref to Foo
myFoo.instanceBar(); // unchanged (filtered out — see below)Filter: receivers are only captured when the identifier
starts with an uppercase ASCII letter (Java class-naming
convention: PascalCase). Without type info this is a ~99%-
accurate way to separate Foo.bar() (class) from
myService.foo() (variable/field). Tree-sitter can't tell the
two apart structurally; the heuristic catches the common case
without false positives on local-var receivers.
Why this matters for the Kythe arc: sets up v0.1.62 — the
resolver will pair adjacent TypeUse + Call refs into a
"receiver.method" tuple and use the receiver class to narrow
which bar overload the call targets. Today the same 50%
unresolved ceiling exists because the resolver has no receiver
context; this lays the data foundation for receiver-aware
narrowing.
Schema-additive: existing on-disk indices stay readable, and a
re-index produces additional TypeUse refs without breaking
anything. Kotlin equivalent (navigation_expression shape)
queued for v0.1.61.
E2E test: java_static_receiver_capture — positive case
(Foo.staticBar() emits a Foo ref from the caller file),
negative case (myFoo.instanceBar() does NOT emit a myFoo
ref — the lowercase filter rejects it).
v0.1.59 — health surfaces file_refs sidecar + refs_resolved coverage
scry health now reports two more signals that were silently
missing:
-
file_refs.bin+file_refs_offsets.bin— the sidecar
that powersscry uses. Absent ⇒usesfalls back to a slow
linear scan; users hit that warning on every invocation
withouthealthflagging it upfront. The omission was a real
gap (health listedfile_symbols.binbut not its symmetric
refs counterpart). -
refs_resolvedcoverage — Layer 2 resolution stats
(resolved/total + percentage). Sub-10% usually means the
sidecar is stale or absent; high coverage tells you
--def-in/--strictnarrowing will be useful on this
index.
$ scry health --index /mnt/agent/scry-index
…
[ OK] file_refs.bin OK (257402208 bytes)
[ OK] file_refs_offsets.bin OK (8256672 bytes)
…
[ OK] refs_resolved v1, 31426932/63318468 refs resolved (49.6%)
synthetic_tree_roundtrip test extended with regression-guard
assertions: the three new artifacts must appear in the JSON
health output (would have caught the original file_refs.bin
omission).
v0.1.58 — --format count/paths on subclasses + implementations
--format count and --format paths on scry subclasses and
scry implementations. Closes the --format rollout: every
command that yields a stream now exposes the same compact-output
trio (count / paths / per-record). Uniform surface for
agents that need "how many" or "which files" before paying for
per-record JSONL.
$ scry subclasses Activity --format count
3210 subclasses
$ scry subclasses Activity --format paths --limit 5
.../FakeDefaultEnabledLauncherActivity.java
.../GPUStressTestActivity.java
.../NotesAppActivity.java
.../DaggerActivity.java
.../TestActivity.java
5 unique files (from 3210 symbols)
$ scry implementations Iterable --format paths --json --limit 3
["…/IterableBase.java", "…/UberspectImplTestCase.java", "…/Zer.java"]
Daemon parity: args.format: "paths" returns ["...", ...];
args.format: "count" returns {count: N}. MCP subclasses
and implementations schemas pick up format.enum.
Internal: new print_symbols_paths helper mirrors
print_refs_paths for symbol-record outputs (used here, available
for any future --format paths on symbol-yielding commands).
E2E test: subclasses_format_paths_and_count — count exactness,
path dedup + sort, implementations alias, daemon parity.
v0.1.57 — --format paths / count on uses
--format paths and --format count on scry uses — symmetric
with the ref/callers shape from v0.1.56. Lets agents ask cheap
versions of "what does NAME touch?" and "how many outgoing
edges?" without the per-ref JSONL noise.
$ scry uses bindService --format count
16655 edges
$ scry uses bindService --format paths --limit 5
…/AppEnumerationTests.java
…/CtsSupervisionAppService.kt
…/DynamicPermissionsTest.kt
…/FileChannelInterProcessLockTest.java
…/TestActivity.java
5 unique files (from 16655 refs)
Daemon parity: args.format: "paths" returns ["...", ...];
args.format: "count" returns {count: N}. MCP uses schema
gains format.enum = ["count", "paths"].
Combined with v0.1.56's coverage of ref + callers, this closes
the --format triad across every command that yields a stream
of refs — uniform compact-output surface for agents.
E2E test: uses_format_paths_and_count — CLI count + paths
shapes, dedup + sort assertions, daemon parity.
v0.1.56 — --format paths on ref/callers
--format paths on scry ref / scry callers — deduped sorted
file paths only. Completes the --format trio (count, by-def,
paths). Cheapest shape for the common LLM-agent question "which
files reference X?".
$ scry callers bindService --format paths --limit 5
/home/zim/dev/aosp/cts/.../ActivityManagerAppExitInfoTest.java
/home/zim/dev/aosp/cts/.../BitmapTest.java
/home/zim/dev/aosp/cts/.../CarOccupantConnectionManagerTest.java
/home/zim/dev/aosp/cts/.../SignatureQueryServiceInstrumentationTest.java
/home/zim/dev/aosp/cts/.../TunerTest.java
5 unique files (from 1981 refs)
$ scry callers bindService --format paths --json --limit 3
["…/ActivityManagerAppExitInfoTest.java", "…/BitmapTest.java", "…/CarOccupantConnectionManagerTest.java"]
Daemon parity: args.format: "paths" on ref / callers
JSON-RPC returns the same ["path", ...] array shape. MCP
schema's format.enum updated to ["by-def", "paths"].
Dedup happens before --limit, so the cap counts unique files,
not raw refs. Output is sorted ascending so consumers can binary-
search / diff stably across runs.
E2E test: format_paths_cli_and_daemon — CLI human + JSON shape,
daemon parity, dedup correctness (a file with no refs to X must
NOT appear in the output).