echolot 0.1.0__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.
Files changed (46) hide show
  1. echolot-0.1.0/LICENSE +201 -0
  2. echolot-0.1.0/PKG-INFO +183 -0
  3. echolot-0.1.0/README.md +153 -0
  4. echolot-0.1.0/echolot/__init__.py +0 -0
  5. echolot-0.1.0/echolot/claude/agents/perf-hunter.md +161 -0
  6. echolot-0.1.0/echolot/claude/commands/echolot-hunt.md +90 -0
  7. echolot-0.1.0/echolot/claude/commands/echolot-reflect.md +62 -0
  8. echolot-0.1.0/echolot/claude/commands/echolot-setup.md +135 -0
  9. echolot-0.1.0/echolot/claude/settings.json +7 -0
  10. echolot-0.1.0/echolot/claude/skills/echolot/SKILL.md +132 -0
  11. echolot-0.1.0/echolot/claude/skills/echolot/references/collect.md +111 -0
  12. echolot-0.1.0/echolot/claude/skills/echolot/references/config.md +131 -0
  13. echolot-0.1.0/echolot/claude/skills/echolot/references/naming.md +131 -0
  14. echolot-0.1.0/echolot/claude/skills/echolot/references/report.md +134 -0
  15. echolot-0.1.0/echolot/config.py +177 -0
  16. echolot-0.1.0/echolot/domains.py +189 -0
  17. echolot-0.1.0/echolot/fixture.py +296 -0
  18. echolot-0.1.0/echolot/main.py +1856 -0
  19. echolot-0.1.0/echolot/mark.py +657 -0
  20. echolot-0.1.0/echolot/recorder.py +132 -0
  21. echolot-0.1.0/echolot/reflect/__init__.py +19 -0
  22. echolot-0.1.0/echolot/reflect/claude_code.py +472 -0
  23. echolot-0.1.0/echolot/reflect/facts.py +810 -0
  24. echolot-0.1.0/echolot/reflect/model.py +153 -0
  25. echolot-0.1.0/echolot/reflect/render.py +425 -0
  26. echolot-0.1.0/echolot/reflect/signals.py +868 -0
  27. echolot-0.1.0/echolot/report.py +292 -0
  28. echolot-0.1.0/echolot/runner.py +338 -0
  29. echolot-0.1.0/echolot/selftest.py +1004 -0
  30. echolot-0.1.0/echolot/sql/context.sql +63 -0
  31. echolot-0.1.0/echolot/sql/detectors/binder_txn.sql +39 -0
  32. echolot-0.1.0/echolot/sql/detectors/gc_pressure.sql +51 -0
  33. echolot-0.1.0/echolot/sql/detectors/main_thread_block.sql +42 -0
  34. echolot-0.1.0/echolot/sql/detectors/monitor_contention.sql +50 -0
  35. echolot-0.1.0/echolot/sql/detectors/runnable_starvation.sql +20 -0
  36. echolot-0.1.0/echolot/sql/detectors/uninstrumented_cpu.sql +53 -0
  37. echolot-0.1.0/echolot/sql/window.sql +77 -0
  38. echolot-0.1.0/echolot/tp.py +348 -0
  39. echolot-0.1.0/echolot.egg-info/PKG-INFO +183 -0
  40. echolot-0.1.0/echolot.egg-info/SOURCES.txt +44 -0
  41. echolot-0.1.0/echolot.egg-info/dependency_links.txt +1 -0
  42. echolot-0.1.0/echolot.egg-info/entry_points.txt +2 -0
  43. echolot-0.1.0/echolot.egg-info/requires.txt +2 -0
  44. echolot-0.1.0/echolot.egg-info/top_level.txt +1 -0
  45. echolot-0.1.0/pyproject.toml +84 -0
  46. echolot-0.1.0/setup.cfg +4 -0
echolot-0.1.0/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
echolot-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,183 @@
1
+ Metadata-Version: 2.4
2
+ Name: echolot
3
+ Version: 0.1.0
4
+ Summary: A deterministic layer between Perfetto traces and AI agents
5
+ Author-email: Andrey Grishanov <grishanov.dev@gmail.com>
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/grishan0v/echolot
8
+ Project-URL: Documentation, https://github.com/grishan0v/echolot/tree/main/docs
9
+ Project-URL: Repository, https://github.com/grishan0v/echolot
10
+ Project-URL: Issues, https://github.com/grishan0v/echolot/issues
11
+ Keywords: perfetto,android,performance,tracing,profiling,ai-agents,claude-code
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Environment :: Console
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Operating System :: OS Independent
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.10
18
+ Classifier: Programming Language :: Python :: 3.11
19
+ Classifier: Programming Language :: Python :: 3.12
20
+ Classifier: Programming Language :: Python :: 3.13
21
+ Classifier: Programming Language :: Python :: 3.14
22
+ Classifier: Topic :: Software Development :: Debuggers
23
+ Classifier: Topic :: System :: Monitoring
24
+ Requires-Python: >=3.10
25
+ Description-Content-Type: text/markdown
26
+ License-File: LICENSE
27
+ Requires-Dist: perfetto==0.57.2
28
+ Requires-Dist: PyYAML>=6.0
29
+ Dynamic: license-file
30
+
31
+
32
+ <img width="2560" height="904" alt="echolot-hero" src="https://github.com/user-attachments/assets/c5640665-d1ae-41ac-8da9-669434ce51ac" />
33
+
34
+ ## Install
35
+
36
+ ```bash
37
+ pipx install echolot
38
+ ```
39
+
40
+ ## First time
41
+
42
+ ```bash
43
+ cd ~/my-app
44
+ //open your agent
45
+ /echolot init
46
+ ```
47
+
48
+ That installs the `.claude/` layer — the skill, the `perf-hunter` agent, the
49
+ commands — checks that this machine computes correctly, and ends with the next
50
+ step. Then open Claude Code in the project and type `/echolot`. That is the
51
+ one door: it asks the tool where the project stands and takes the next step
52
+ itself — the first time, that is building `echolot.yml` from the repository
53
+ and a probe trace (four questions to you along the way); every time after,
54
+ finding the cause of the regression you describe.
55
+
56
+ ```
57
+ /echolot # reads the state, does what is next
58
+ /echolot why is cold start slow # hunt, with that as the question
59
+ /echolot init · setup · hunt · reflect · doctor # that thing, explicitly
60
+ ```
61
+
62
+ ## Coming back
63
+
64
+ ```bash
65
+ echolot
66
+ ```
67
+
68
+ Where things stand — layer, config, traces, last report, last `doctor` — and
69
+ one line saying what to do next; usually `/echolot`. After updating the
70
+ package, run `echolot init` again: it brings the layer up to date and leaves
71
+ the files you edited alone.
72
+
73
+ Without an agent, or in CI:
74
+
75
+ ```bash
76
+ echolot collect -c echolot.yml -n 5 # 5 repeats of the scenario
77
+ echolot analyze .echolot/traces/*.perfetto-trace -c echolot.yml # the report
78
+ echolot doctor -q # exit 0/1: does this environment compute correctly?
79
+ ```
80
+
81
+ The output is `.echolot/out/report.md` for humans and `report.json` for the
82
+ agent. `doctor` builds a synthetic trace with problems planted in advance and
83
+ checks the answers against them — no device, about a second — good both as a
84
+ CI gate and as the agent's first move.
85
+
86
+ ## What it looks for
87
+
88
+ | detector | what it catches |
89
+ |---|---|
90
+ | `main_thread_block` | where the main thread spent its time (by self time) |
91
+ | `gc_pressure` | frequent or expensive GC, and waits on allocation |
92
+ | `monitor_contention` | monitor contention, with the owner's tid as evidence |
93
+ | `binder_txn` | long synchronous IPC, and death by a thousand cuts |
94
+ | `runnable_starvation` | thread ready but preempted on CPU |
95
+ | `uninstrumented_cpu` | **threads burning CPU with no instrumentation** |
96
+
97
+ The last one is the only detector that finds a problem inside uninstrumented
98
+ code. It does not guess; it presents a fact: "thread
99
+ `DefaultDispatcher-worker-2` was Running for 340 ms, zero slices". That is
100
+ where to add `trace{}` and re-record.
101
+
102
+ Each detector is one self-contained `.sql` file with its metadata in the
103
+ header. Drop a file into `echolot/sql/detectors/` and it is picked up — there
104
+ is no registration in code.
105
+
106
+ ## The commands
107
+
108
+ Two are yours to remember — `init` and `echolot` with nothing after it. The
109
+ rest split by who calls them.
110
+
111
+ **You**
112
+
113
+ ```
114
+ echolot where this project stands, and the next step
115
+ init install or update the .claude/ layer; checks the environment
116
+ analyze run the detectors, build a Marker Report — CI, or traces by hand
117
+ collect capture N traces of one scenario: launch | command | gradle
118
+ doctor environment + self-check on a synthetic trace + is the layer current; exit 0/1, -q for three lines
119
+ ```
120
+
121
+ **The agent**, behind `/echolot` — you do not call
122
+ these:
123
+
124
+ ```
125
+ probe processes, threads by CPU, scenario anchor candidates
126
+ names slice name inventory and detector mask coverage
127
+ domains slice-to-code map and instrumentation coverage
128
+ mark the first temporary markers for a project with none — from the manifest and the SDK, not from names; --apply / --remove
129
+ calibrate thresholds derived from known-healthy runs
130
+ explain list the detectors and their parameters
131
+ ```
132
+
133
+ **Improving the tool**
134
+
135
+ ```
136
+ reflect the same kind of report over an agent session — how the tool was used, where it got in the way
137
+ ```
138
+
139
+ ## Where things live
140
+
141
+ ```
142
+ android-project/
143
+ ├── echolot.yml ← the project half, committed
144
+ ├── local.yml ← device serials, binary path; in .gitignore
145
+ └── .echolot/ ← traces, reports, the run log, reflect reports; in .gitignore
146
+ ```
147
+
148
+ Read it like `gradle.properties` and `local.properties`: one tool per machine,
149
+ the binding to a project inside that project's repository.
150
+
151
+ ## Documentation
152
+
153
+ | document | about |
154
+ |---|---|
155
+ | [docs/collecting.md](https://github.com/grishan0v/echolot/blob/main/docs/collecting.md) | `collect`, the three modes, merging repeats |
156
+ | [docs/analysing.md](https://github.com/grishan0v/echolot/blob/main/docs/analysing.md) | `probe`, `names`, `domains` — from a trace to a place in the code |
157
+ | [docs/mark.md](https://github.com/grishan0v/echolot/blob/main/docs/mark.md) | `mark` — the first markers for a project with no instrumentation, from the platform's vocabulary |
158
+ | [docs/detectors.md](https://github.com/grishan0v/echolot/blob/main/docs/detectors.md) | writing your own, the context views, self time versus total |
159
+ | [docs/calibrate.md](https://github.com/grishan0v/echolot/blob/main/docs/calibrate.md) | thresholds from healthy runs, why rank beats percentile |
160
+ | [docs/determinism.md](https://github.com/grishan0v/echolot/blob/main/docs/determinism.md) | the pinned trace_processor, `doctor`, the self-check |
161
+ | [docs/agent-layer.md](https://github.com/grishan0v/echolot/blob/main/docs/agent-layer.md) | the `.claude/` layer and why the loop lives in a subagent |
162
+ | [docs/reflect.md](https://github.com/grishan0v/echolot/blob/main/docs/reflect.md) | `reflect` — the report over the agent's session, for improving the tool |
163
+
164
+ The agent-facing reference material ships inside the package, under
165
+ `echolot/claude/skills/echolot/references/` — the report schema, the config
166
+ schema, how ART names things, and how to capture a trace by hand.
167
+
168
+ ## Status
169
+
170
+ v0. Everything planned for it is in place except CI mode.
171
+
172
+ The detectors were validated on a synthetic trace (46 checks in `doctor`) and
173
+ on live traces from Android 14 (emulator) and Android 13 (Galaxy A51). The
174
+ naming masks for GC, locks and binder were narrowed against those real traces,
175
+ and every narrowing is pinned by a check.
176
+
177
+ **Not done: CI mode.** `scenario.budget_ms` is declared in the config but not
178
+ read by the code. What is needed is `analyze` with an exit code — either
179
+ against the budget or on "any detector fired", which after `calibrate` amounts
180
+ to a comparison against the baseline.
181
+
182
+ A failed detector never fails the run — the error goes to stderr and into
183
+ `report.json`.
@@ -0,0 +1,153 @@
1
+
2
+ <img width="2560" height="904" alt="echolot-hero" src="https://github.com/user-attachments/assets/c5640665-d1ae-41ac-8da9-669434ce51ac" />
3
+
4
+ ## Install
5
+
6
+ ```bash
7
+ pipx install echolot
8
+ ```
9
+
10
+ ## First time
11
+
12
+ ```bash
13
+ cd ~/my-app
14
+ //open your agent
15
+ /echolot init
16
+ ```
17
+
18
+ That installs the `.claude/` layer — the skill, the `perf-hunter` agent, the
19
+ commands — checks that this machine computes correctly, and ends with the next
20
+ step. Then open Claude Code in the project and type `/echolot`. That is the
21
+ one door: it asks the tool where the project stands and takes the next step
22
+ itself — the first time, that is building `echolot.yml` from the repository
23
+ and a probe trace (four questions to you along the way); every time after,
24
+ finding the cause of the regression you describe.
25
+
26
+ ```
27
+ /echolot # reads the state, does what is next
28
+ /echolot why is cold start slow # hunt, with that as the question
29
+ /echolot init · setup · hunt · reflect · doctor # that thing, explicitly
30
+ ```
31
+
32
+ ## Coming back
33
+
34
+ ```bash
35
+ echolot
36
+ ```
37
+
38
+ Where things stand — layer, config, traces, last report, last `doctor` — and
39
+ one line saying what to do next; usually `/echolot`. After updating the
40
+ package, run `echolot init` again: it brings the layer up to date and leaves
41
+ the files you edited alone.
42
+
43
+ Without an agent, or in CI:
44
+
45
+ ```bash
46
+ echolot collect -c echolot.yml -n 5 # 5 repeats of the scenario
47
+ echolot analyze .echolot/traces/*.perfetto-trace -c echolot.yml # the report
48
+ echolot doctor -q # exit 0/1: does this environment compute correctly?
49
+ ```
50
+
51
+ The output is `.echolot/out/report.md` for humans and `report.json` for the
52
+ agent. `doctor` builds a synthetic trace with problems planted in advance and
53
+ checks the answers against them — no device, about a second — good both as a
54
+ CI gate and as the agent's first move.
55
+
56
+ ## What it looks for
57
+
58
+ | detector | what it catches |
59
+ |---|---|
60
+ | `main_thread_block` | where the main thread spent its time (by self time) |
61
+ | `gc_pressure` | frequent or expensive GC, and waits on allocation |
62
+ | `monitor_contention` | monitor contention, with the owner's tid as evidence |
63
+ | `binder_txn` | long synchronous IPC, and death by a thousand cuts |
64
+ | `runnable_starvation` | thread ready but preempted on CPU |
65
+ | `uninstrumented_cpu` | **threads burning CPU with no instrumentation** |
66
+
67
+ The last one is the only detector that finds a problem inside uninstrumented
68
+ code. It does not guess; it presents a fact: "thread
69
+ `DefaultDispatcher-worker-2` was Running for 340 ms, zero slices". That is
70
+ where to add `trace{}` and re-record.
71
+
72
+ Each detector is one self-contained `.sql` file with its metadata in the
73
+ header. Drop a file into `echolot/sql/detectors/` and it is picked up — there
74
+ is no registration in code.
75
+
76
+ ## The commands
77
+
78
+ Two are yours to remember — `init` and `echolot` with nothing after it. The
79
+ rest split by who calls them.
80
+
81
+ **You**
82
+
83
+ ```
84
+ echolot where this project stands, and the next step
85
+ init install or update the .claude/ layer; checks the environment
86
+ analyze run the detectors, build a Marker Report — CI, or traces by hand
87
+ collect capture N traces of one scenario: launch | command | gradle
88
+ doctor environment + self-check on a synthetic trace + is the layer current; exit 0/1, -q for three lines
89
+ ```
90
+
91
+ **The agent**, behind `/echolot` — you do not call
92
+ these:
93
+
94
+ ```
95
+ probe processes, threads by CPU, scenario anchor candidates
96
+ names slice name inventory and detector mask coverage
97
+ domains slice-to-code map and instrumentation coverage
98
+ mark the first temporary markers for a project with none — from the manifest and the SDK, not from names; --apply / --remove
99
+ calibrate thresholds derived from known-healthy runs
100
+ explain list the detectors and their parameters
101
+ ```
102
+
103
+ **Improving the tool**
104
+
105
+ ```
106
+ reflect the same kind of report over an agent session — how the tool was used, where it got in the way
107
+ ```
108
+
109
+ ## Where things live
110
+
111
+ ```
112
+ android-project/
113
+ ├── echolot.yml ← the project half, committed
114
+ ├── local.yml ← device serials, binary path; in .gitignore
115
+ └── .echolot/ ← traces, reports, the run log, reflect reports; in .gitignore
116
+ ```
117
+
118
+ Read it like `gradle.properties` and `local.properties`: one tool per machine,
119
+ the binding to a project inside that project's repository.
120
+
121
+ ## Documentation
122
+
123
+ | document | about |
124
+ |---|---|
125
+ | [docs/collecting.md](https://github.com/grishan0v/echolot/blob/main/docs/collecting.md) | `collect`, the three modes, merging repeats |
126
+ | [docs/analysing.md](https://github.com/grishan0v/echolot/blob/main/docs/analysing.md) | `probe`, `names`, `domains` — from a trace to a place in the code |
127
+ | [docs/mark.md](https://github.com/grishan0v/echolot/blob/main/docs/mark.md) | `mark` — the first markers for a project with no instrumentation, from the platform's vocabulary |
128
+ | [docs/detectors.md](https://github.com/grishan0v/echolot/blob/main/docs/detectors.md) | writing your own, the context views, self time versus total |
129
+ | [docs/calibrate.md](https://github.com/grishan0v/echolot/blob/main/docs/calibrate.md) | thresholds from healthy runs, why rank beats percentile |
130
+ | [docs/determinism.md](https://github.com/grishan0v/echolot/blob/main/docs/determinism.md) | the pinned trace_processor, `doctor`, the self-check |
131
+ | [docs/agent-layer.md](https://github.com/grishan0v/echolot/blob/main/docs/agent-layer.md) | the `.claude/` layer and why the loop lives in a subagent |
132
+ | [docs/reflect.md](https://github.com/grishan0v/echolot/blob/main/docs/reflect.md) | `reflect` — the report over the agent's session, for improving the tool |
133
+
134
+ The agent-facing reference material ships inside the package, under
135
+ `echolot/claude/skills/echolot/references/` — the report schema, the config
136
+ schema, how ART names things, and how to capture a trace by hand.
137
+
138
+ ## Status
139
+
140
+ v0. Everything planned for it is in place except CI mode.
141
+
142
+ The detectors were validated on a synthetic trace (46 checks in `doctor`) and
143
+ on live traces from Android 14 (emulator) and Android 13 (Galaxy A51). The
144
+ naming masks for GC, locks and binder were narrowed against those real traces,
145
+ and every narrowing is pinned by a check.
146
+
147
+ **Not done: CI mode.** `scenario.budget_ms` is declared in the config but not
148
+ read by the code. What is needed is `analyze` with an exit code — either
149
+ against the budget or on "any detector fired", which after `calibrate` amounts
150
+ to a comparison against the baseline.
151
+
152
+ A failed detector never fails the run — the error goes to stderr and into
153
+ `report.json`.
File without changes