foretop-telltale 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.
- foretop_telltale-0.1.0/LICENSE +202 -0
- foretop_telltale-0.1.0/PKG-INFO +354 -0
- foretop_telltale-0.1.0/README.md +339 -0
- foretop_telltale-0.1.0/pyproject.toml +72 -0
- foretop_telltale-0.1.0/pyproject.toml.orig +81 -0
- foretop_telltale-0.1.0/src/keel/__init__.py +1 -0
- foretop_telltale-0.1.0/src/keel/collect/__init__.py +0 -0
- foretop_telltale-0.1.0/src/keel/collect/line_tracking.py +48 -0
- foretop_telltale-0.1.0/src/keel/collect/walk.py +95 -0
- foretop_telltale-0.1.0/src/keel/finding.py +105 -0
- foretop_telltale-0.1.0/src/keel/gate.py +152 -0
- foretop_telltale-0.1.0/src/keel/git_ref.py +45 -0
- foretop_telltale-0.1.0/src/keel/owner.py +58 -0
- foretop_telltale-0.1.0/src/keel/render/__init__.py +0 -0
- foretop_telltale-0.1.0/src/keel/render/annotations.py +62 -0
- foretop_telltale-0.1.0/src/keel/render/markdown.py +40 -0
- foretop_telltale-0.1.0/src/keel/render/sarif.py +85 -0
- foretop_telltale-0.1.0/src/keel/render/terminal.py +38 -0
- foretop_telltale-0.1.0/src/keel/render/triage_json.py +15 -0
- foretop_telltale-0.1.0/src/keel/report.py +98 -0
- foretop_telltale-0.1.0/src/keel/run.py +67 -0
- foretop_telltale-0.1.0/src/keel/triage.py +167 -0
- foretop_telltale-0.1.0/src/telltale/__init__.py +1 -0
- foretop_telltale-0.1.0/src/telltale/__main__.py +4 -0
- foretop_telltale-0.1.0/src/telltale/brand.py +6 -0
- foretop_telltale-0.1.0/src/telltale/check.py +121 -0
- foretop_telltale-0.1.0/src/telltale/cli.py +174 -0
- foretop_telltale-0.1.0/src/telltale/findings.py +238 -0
- foretop_telltale-0.1.0/src/telltale/git_ref.py +44 -0
- foretop_telltale-0.1.0/src/telltale/grafana.py +106 -0
- foretop_telltale-0.1.0/src/telltale/match.py +97 -0
- foretop_telltale-0.1.0/src/telltale/models.py +121 -0
- foretop_telltale-0.1.0/src/telltale/openapi.py +92 -0
- foretop_telltale-0.1.0/src/telltale/otel.py +150 -0
- foretop_telltale-0.1.0/src/telltale/prometheus.py +62 -0
- foretop_telltale-0.1.0/src/telltale/promql.py +75 -0
- foretop_telltale-0.1.0/src/telltale/regression.py +68 -0
- foretop_telltale-0.1.0/src/telltale/render/__init__.py +0 -0
- foretop_telltale-0.1.0/src/telltale/render/annotations.py +48 -0
- foretop_telltale-0.1.0/src/telltale/render/json_renderer.py +15 -0
- foretop_telltale-0.1.0/src/telltale/render/markdown.py +96 -0
- foretop_telltale-0.1.0/src/telltale/render/sarif.py +12 -0
- foretop_telltale-0.1.0/src/telltale/render/terminal.py +119 -0
- foretop_telltale-0.1.0/src/telltale/response_code.py +22 -0
- foretop_telltale-0.1.0/src/telltale/route_template.py +14 -0
- foretop_telltale-0.1.0/src/telltale/rules/label_names.yaml +58 -0
- foretop_telltale-0.1.0/src/telltale/triage.py +150 -0
- foretop_telltale-0.1.0/src/telltale/walk.py +26 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright 2026 the foretop authors
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,354 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: foretop-telltale
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Compares an OpenAPI contract with the telemetry a service actually emits, and produces a route-by-route gap list before an incident finds it for you.
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
Requires-Dist: typer>=0.15
|
|
8
|
+
Requires-Dist: rich>=13.9
|
|
9
|
+
Requires-Dist: pathspec>=0.12
|
|
10
|
+
Requires-Dist: pyyaml>=6.0
|
|
11
|
+
Requires-Dist: pydantic>=2.9
|
|
12
|
+
Requires-Dist: httpx>=0.28
|
|
13
|
+
Requires-Python: >=3.12
|
|
14
|
+
Description-Content-Type: text/markdown
|
|
15
|
+
|
|
16
|
+
# telltale
|
|
17
|
+
|
|
18
|
+
> Compares an OpenAPI contract with the telemetry a service actually emits, and produces a
|
|
19
|
+
> route-by-route gap list before an incident finds it for you.
|
|
20
|
+
|
|
21
|
+
An OpenAPI spec says a route exists. Somewhere a Prometheus alert, an OTel Collector pipeline,
|
|
22
|
+
or a Grafana dashboard is supposed to be watching it — or isn't, and nobody notices until the
|
|
23
|
+
incident. `telltale` compares the two and tells you which routes (and which of their
|
|
24
|
+
documented 4xx/5xx failures specifically) have no telemetry at all.
|
|
25
|
+
|
|
26
|
+
## Install and run
|
|
27
|
+
|
|
28
|
+
```
|
|
29
|
+
uvx foretop-telltale check .
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
No config, no account, no network call beyond installing the package — autodetects an OpenAPI
|
|
33
|
+
document at the repo root and walks the repo for Prometheus alert rules, an OTel Collector
|
|
34
|
+
config, and Grafana dashboards, entirely local. Add `--base origin/main` to fail only when
|
|
35
|
+
coverage that existed at the merge base is gone now (never an absolute threshold — see DEC-04
|
|
36
|
+
below), or `--format markdown`/`--format annotations` for the same output a PR comment or
|
|
37
|
+
GitHub annotation would use. `telltale check --help` lists everything.
|
|
38
|
+
|
|
39
|
+
## Use it as a GitHub Action
|
|
40
|
+
|
|
41
|
+
```yaml
|
|
42
|
+
- uses: foretop-dev/telltale@main
|
|
43
|
+
with:
|
|
44
|
+
base: ${{ github.event.pull_request.base.sha }} # default; empty string disables the gate
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Annotates the pull request inline and upserts one summary comment (finds its own previous
|
|
48
|
+
comment by an HTML marker and edits it — never posts a second one on repeat pushes). Needs
|
|
49
|
+
`permissions: pull-requests: write` in the calling workflow.
|
|
50
|
+
|
|
51
|
+
## License
|
|
52
|
+
|
|
53
|
+
Apache-2.0. This file tracks build status below; the source-of-truth product spec lives in the
|
|
54
|
+
private monorepo this is mirrored from (see `scripts/sync-mirror.sh` there).
|
|
55
|
+
|
|
56
|
+
## Status
|
|
57
|
+
|
|
58
|
+
**Slice 1** (Session 9): OpenAPI parser + Prometheus alerting-rule parser + the matcher +
|
|
59
|
+
a terminal coverage matrix, run against one fixture service. No network, no DB.
|
|
60
|
+
|
|
61
|
+
**Slice 2, part 1** (Session 11): OTel Collector config parser + Grafana dashboard parser,
|
|
62
|
+
extending real coverage to all four signal dimensions (`log`/`metric`/`trace`/`alert`) —
|
|
63
|
+
every column in the matrix now has at least one real extractor behind it, none are
|
|
64
|
+
permanently `ambiguous` by construction anymore (see below for what `ambiguous` still means).
|
|
65
|
+
|
|
66
|
+
**Slice 3 (Session 12): the error-mode dimension** — DEC-03's own words, "the actual
|
|
67
|
+
differentiator, do not skip it." Every route-level cell now has siblings, one per documented
|
|
68
|
+
4xx/5xx response code (`src/telltale/response_code.py` normalizes both OpenAPI's "5XX"
|
|
69
|
+
wildcard and specific codes like "404" into one comparable space) — the coverage question
|
|
70
|
+
becomes not just "does this route have an alert" but "does *this specific documented
|
|
71
|
+
failure* have one." `telltale check` now renders two tables: route-level, then error-mode
|
|
72
|
+
(only when at least one route documents a 4xx/5xx code).
|
|
73
|
+
|
|
74
|
+
**Slice 4, part 1 (Session 13): the regression-vs-merge-base gate** — DEC-04: "Fail on
|
|
75
|
+
regression... vs the merge base. Absolute thresholds get disabled on day two of adoption." No
|
|
76
|
+
`--fail-on <threshold>` flag exists here on purpose (unlike ebb's) — that was a deliberate
|
|
77
|
+
choice as far back as Session 9's CLI, not an oversight filled in later.
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
telltale check <path> --base origin/main
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Computes the merge base of the current checkout and `--base` (`git merge-base HEAD <ref>` —
|
|
84
|
+
the commit where they diverged, not `<ref>`'s current tip, which can have moved since a PR
|
|
85
|
+
branched: `src/telltale/git_ref.py`), materializes it into a real temporary `git worktree`
|
|
86
|
+
(so the ordinary gitignore-aware walker sees exactly what a normal checkout would — never a
|
|
87
|
+
bare `git show`/tarball extraction), runs the full pipeline against it, and diffs the two
|
|
88
|
+
matrices (`src/telltale/regression.py`, pure — no I/O, no git). Exit 1 only if something that
|
|
89
|
+
was `present` at the merge base is not `present` now, at either granularity (route-level or a
|
|
90
|
+
specific error mode) — never on an absolute percentage or count. `absent → present` is an
|
|
91
|
+
improvement, not a regression; `ambiguous → absent` (a new extractor started running and found
|
|
92
|
+
nothing) is new information, not a loss; a route added or removed entirely is a spec change,
|
|
93
|
+
not a coverage regression.
|
|
94
|
+
|
|
95
|
+
Handles being run from a subdirectory of a larger repository correctly — `git worktree add`
|
|
96
|
+
always materializes the *whole* repo, never a subtree, so `run_check_at_merge_base` computes
|
|
97
|
+
the offset between the given path and the repo's actual toplevel once (`git_ref.toplevel()`)
|
|
98
|
+
and re-applies it inside the new worktree. An earlier version of this didn't do that and
|
|
99
|
+
happened to pass every test anyway, because every test so far had pointed `--base` straight at
|
|
100
|
+
a repo's own root — caught by testing the monorepo case explicitly, then confirmed against
|
|
101
|
+
this actual repository (`telltale check apps/telltale/tests/fixtures/fixture_service --base
|
|
102
|
+
HEAD`, run for real, not just in pytest) before it shipped.
|
|
103
|
+
|
|
104
|
+
**Slice 4, part 2 (Session 14): `--format`, the composite Action, and the PR comment** — the
|
|
105
|
+
same shape as ebb's own Session 8, roughly half the work, because `packages/keel` and the
|
|
106
|
+
`scripts/upsert_pr_comment.sh` pattern already existed to build on.
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
telltale check <path> --format table|markdown|annotations
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Three renderers now sit behind one flag, all built from the same `Matrix` + `Regression`
|
|
113
|
+
tuple computed once per run (`src/telltale/cli.py`'s `_render`) — never three separate scans:
|
|
114
|
+
|
|
115
|
+
- `table` (default): unchanged from Session 13 — the two Rich tables plus, if `--base` found
|
|
116
|
+
regressions, the regressions table (`src/telltale/render/terminal.py`).
|
|
117
|
+
- `markdown` (`src/telltale/render/markdown.py`, new): the same two tables as plain Markdown
|
|
118
|
+
pipe-tables, plus a "Regressions vs merge base" section when `--base` found any — this is
|
|
119
|
+
the composite Action's PR comment body.
|
|
120
|
+
- `annotations` (`src/telltale/render/annotations.py`, new): GitHub workflow-command syntax
|
|
121
|
+
(`::error file=...,line=...::message`), **one per regression, never one per coverage cell**.
|
|
122
|
+
Unlike ebb's Finding (a model-id string at a specific line), a `CoverageCell` has no file:line
|
|
123
|
+
of its own — the annotation points at the route's OpenAPI definition instead
|
|
124
|
+
(`Regression.route_source_file`/`route_source_line`, taken from the `after` state, i.e.
|
|
125
|
+
HEAD — what a PR reviewer actually has open, not the now-deleted merge-base worktree). A gap
|
|
126
|
+
that already existed at the merge base isn't new information for this PR, so only PRESENT ->
|
|
127
|
+
not-PRESENT gets annotated, same DEC-04 discipline as the exit-code gate itself — there's
|
|
128
|
+
deliberately no "annotate every absent cell" mode.
|
|
129
|
+
|
|
130
|
+
`apps/telltale/action.yml` (composite, not Docker/JS — same reasoning as the repo root's ebb
|
|
131
|
+
action): wraps `uvx foretop-telltale check`, defaults `--base` to the pull request's own base
|
|
132
|
+
SHA, emits `--format annotations` for inline PR annotations (zero extra permissions, same
|
|
133
|
+
mechanism ebb's action already uses) and upserts a `--format markdown` PR comment by HTML
|
|
134
|
+
marker (`apps/telltale/scripts/upsert_pr_comment.sh` — logic duplicated from, not imported
|
|
135
|
+
from, the repo-root copy: docs/adr/0002 requires every app to stay standalone-copyable into
|
|
136
|
+
its own future public mirror, exactly the ebb/`sync-ebb-mirror.sh` precedent, so this app's
|
|
137
|
+
action can't reach outside its own directory for a script it needs). Both copies of the script
|
|
138
|
+
now read their marker from a `COMMENT_MARKER` env var instead of a hardcoded string, so a repo
|
|
139
|
+
running both ebb's and telltale's Actions on the same PR upserts two separate comments instead
|
|
140
|
+
of colliding on one — a small, behavior-preserving generalization made to the shared script,
|
|
141
|
+
not a new one.
|
|
142
|
+
|
|
143
|
+
Lives at `apps/telltale/`, not the repo root (unlike ebb's `action.yml`): a repo can only have
|
|
144
|
+
one `action.yml` per directory, and the root is already ebb's. This also happens to match
|
|
145
|
+
telltale's real state honestly — it has no public mirror yet, so nothing here can assume a
|
|
146
|
+
`uvx foretop-telltale` invocation resolves to a real PyPI release; that's the same not-yet-done
|
|
147
|
+
caveat Session 8 already flagged for ebb's own action before it was ever actually published.
|
|
148
|
+
|
|
149
|
+
Verified for real, the same way Session 13's regression gate was: ran `telltale check
|
|
150
|
+
apps/telltale/tests/fixtures/fixture_service --format markdown` (clean output, 29% coverage),
|
|
151
|
+
then emptied the fixture's `prometheus/rules.yaml` to simulate a real regression and re-ran
|
|
152
|
+
with `--base HEAD --format annotations` (5 correctly-anchored `::error file=openapi.yaml,
|
|
153
|
+
line=N::` lines, exit 1) and again with `--format markdown` (the same 5 rows in a rendered
|
|
154
|
+
"Regressions vs merge base" table), then restored the fixture and confirmed a clean `git
|
|
155
|
+
status` — never just trusted the unit tests alone for the git-worktree-dependent path.
|
|
156
|
+
|
|
157
|
+
**Slice 5 (Session 15): the golden corpus** — `tests/golden/` + `tests/golden_manifest.yaml` +
|
|
158
|
+
`tests/unit/test_golden_corpus.py`, same shape and the same floor as ebb's own (Session 7):
|
|
159
|
+
precision >= 0.95, recall >= 0.85, scored **per extractor** (prometheus/grafana/otel — the
|
|
160
|
+
first path segment under `tests/golden/`, same grouping ebb uses for its own detector dirs),
|
|
161
|
+
never pooled into one aggregate that could hide one broken extractor behind two working ones.
|
|
162
|
+
`make accuracy-telltale` runs just this file, verbosely.
|
|
163
|
+
|
|
164
|
+
Ground truth is one entry per `Signal` a real extractor should produce for a fixture — `path`
|
|
165
|
+
(relative to `tests/golden/`), `evidence_line`, `route_template`, `method`, `status_code`,
|
|
166
|
+
`signal_type`. `null` fields are real ground truth (the extractor has no basis to claim a
|
|
167
|
+
route/method/status), not missing data — see `prometheus/03_no_route_label`, where an alert
|
|
168
|
+
with no route label still produces one Signal, correctly, with `route_template: null`.
|
|
169
|
+
|
|
170
|
+
Every extractor group has at least one pure-decoy fixture — content that shares surface
|
|
171
|
+
vocabulary with a real match without being one — enforced by its own test
|
|
172
|
+
(`test_every_fixture_group_has_a_pure_decoy_case`, identical logic to ebb's own): a 0-FP score
|
|
173
|
+
is trivial if a false positive was never actually possible to produce.
|
|
174
|
+
|
|
175
|
+
**A real bug, found by building this corpus, not just theorized about:** `grafana.py`'s own
|
|
176
|
+
docstring already claimed "a non-Prometheus datasource's query language is out of scope, not
|
|
177
|
+
silently misread as PromQL" — but the code only ever checked for the presence of an `expr`
|
|
178
|
+
field, never the target's actual datasource type. Loki's query field is *also* named `expr`,
|
|
179
|
+
and LogQL's `{label="value"}` stream selector is syntactically close enough to a PromQL
|
|
180
|
+
selector that a Loki panel's own labels (a `route="..."` stream label is entirely realistic)
|
|
181
|
+
would have been misread as real route evidence — confirmed against a real Loki-backed
|
|
182
|
+
dashboard fetched live this session, not assumed. Fixed with `_is_explicitly_non_prometheus`:
|
|
183
|
+
a `datasource.type` naming anything other than `"prometheus"`, on either the panel or the
|
|
184
|
+
target, is skipped. The corpus's own `grafana/04_decoy_loki_panel` fixture is what would have
|
|
185
|
+
caught this, and now guards against it regressing. A narrower gap remains and is left
|
|
186
|
+
documented, not silently patched over: a target with no `datasource` at all, or the legacy
|
|
187
|
+
`"${DS_XXX}"` template-variable shape older exported dashboards use, still reads `expr` as
|
|
188
|
+
PromQL — resolving that would mean cross-referencing the document's own `__inputs`, which is
|
|
189
|
+
more machinery than this parser's "good enough, not semantically perfect" scope calls for.
|
|
190
|
+
|
|
191
|
+
**Session 16: prepping to publish** — the release workflow and public-mirror sync script,
|
|
192
|
+
mirroring `apps/ebb`'s own Session 8 pattern exactly. Not yet actually published: PyPI project
|
|
193
|
+
creation and trusted-publisher configuration were always the user's job, not this session's
|
|
194
|
+
(same NEXT_STEPS.md Track A split ebb's own `docs/adr/0002-ebb-public-mirror.md` already
|
|
195
|
+
documents), and this session stopped short of creating a real `foretop-dev/telltale` repo.
|
|
196
|
+
|
|
197
|
+
- `.github/workflows/telltale-release.yml` (this monorepo) and
|
|
198
|
+
`scripts/mirror-workflows/telltale-{ci,release}.yml` (copied into the mirror as `ci.yml`/
|
|
199
|
+
`release.yml` by `scripts/sync-telltale-mirror.sh`) — same shape as ebb's own three files,
|
|
200
|
+
tag-namespaced `telltale-v*` per `docs/adr/0002`'s already-stated plan for the whole suite.
|
|
201
|
+
- Two real bugs found while building this, not just theorized about:
|
|
202
|
+
- `pyproject.toml`'s `[project.scripts]` only declared `telltale = ...`, not also
|
|
203
|
+
`foretop-telltale = ...` — `uvx <name>` (no `--from`) resolves the entry point matching the
|
|
204
|
+
*distribution* name, so `uvx foretop-telltale check .` (what `apps/telltale/action.yml`
|
|
205
|
+
already promises) would have failed to resolve once published. Caught by actually building
|
|
206
|
+
the wheel and inspecting `entry_points.txt`, not assumed correct because ebb's own
|
|
207
|
+
`pyproject.toml` already has the equivalent fix — confirmed fixed the same way afterward.
|
|
208
|
+
- No `LICENSE` file existed in `apps/telltale/` at all (copied from `apps/ebb/LICENSE`,
|
|
209
|
+
byte-identical standard Apache-2.0 text — a LICENSE file has no per-project content of its
|
|
210
|
+
own); `license-files = ["LICENSE"]` added to `pyproject.toml` so the built wheel actually
|
|
211
|
+
bundles it, verified by inspecting the wheel's own `dist-info/licenses/` after the change.
|
|
212
|
+
- The blocker this section used to describe (`keel.collect.walk`/`keel.git_ref` only resolving
|
|
213
|
+
inside the monorepo's own workspace) is fixed as of a later session — see
|
|
214
|
+
`packages/keel/README.md`'s own "Packaging note": `scripts/sync-telltale-mirror.sh` now
|
|
215
|
+
vendors the exact `keel` submodules telltale imports (`git_ref.py`, `collect/
|
|
216
|
+
line_tracking.py`, `collect/walk.py`) into the mirror at sync time, and the mirror's own
|
|
217
|
+
`pyproject.toml` (`scripts/mirror-pyproject/telltale.toml`) no longer depends on
|
|
218
|
+
`foretop-keel`. Re-verified for real after the fix: `ruff`/`mypy`/`pytest` (156 tests) all
|
|
219
|
+
green standalone, a real wheel built, and the built wheel cold-installed into a fresh venv
|
|
220
|
+
with `telltale --help` actually running.
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
uv run --package foretop-telltale telltale check <path>
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Domain model (`src/telltale/models.py`) is the SUITE_ARCHITECTURE-style pure core:
|
|
227
|
+
`RouteSet` (from the OpenAPI parser) × `SignalSet` (from the signal extractors) →
|
|
228
|
+
`match()` (`src/telltale/match.py`, pure, no I/O) → `Matrix`. Every coverage cell is
|
|
229
|
+
**three-state** — `present` / `absent` / `ambiguous` — never just present/absent. `ambiguous`
|
|
230
|
+
is not a synonym for `absent`: a route gets `ambiguous` for a signal type only when no
|
|
231
|
+
extractor for that type exists in telltale's own code at all — as of Session 11 every
|
|
232
|
+
`SignalType` has a real extractor (Prometheus → `alert`; Grafana → `metric`; OTel Collector →
|
|
233
|
+
`log`/`metric`/`trace`), so `ambiguous` no longer appears in ordinary runs. It stays a real,
|
|
234
|
+
reachable state, not a vestige: the moment a *new* signal dimension is added to `SignalType`
|
|
235
|
+
without an extractor yet, every route goes `ambiguous` for it, honestly, rather than a false
|
|
236
|
+
`absent` — see `SignalSet.attempted_types` in `models.py`. `absent` means an extractor
|
|
237
|
+
genuinely ran across the whole repo and found nothing for that route — specs/telltale.md's
|
|
238
|
+
explicit warning: "never claim coverage that does not exist... ambiguous is its own outcome
|
|
239
|
+
and is never counted as covered."
|
|
240
|
+
|
|
241
|
+
**OpenAPI parser** (`src/telltale/openapi.py`): OpenAPI 3.0/3.1, YAML or JSON. Reads the 8
|
|
242
|
+
Path Item Object method keys (get/put/post/delete/options/head/patch/trace — `spec.openapis.org`
|
|
243
|
+
oas/v3.1.0.html §4.8.7, fetched live this session, not written from memory) and each operation's
|
|
244
|
+
`responses` keys as-is (`"200"`, `"5XX"`, `"default"`) — stored since Session 9, consumed by
|
|
245
|
+
the matcher's error-mode dimension since Session 12. `$ref` resolution is local-document-only
|
|
246
|
+
(`#/components/...` JSON Pointers, walked against the already-parsed document) — external-file
|
|
247
|
+
`$ref`s are out of scope for Slice 1 and produce an `ambiguous`-flavoured skip, never a crash,
|
|
248
|
+
per specs/telltale.md §6's degrade-not-crash rule.
|
|
249
|
+
|
|
250
|
+
**Prometheus rule parser** (`src/telltale/prometheus.py`): parses `groups[].rules[]`
|
|
251
|
+
(`prometheus.io/docs/prometheus/latest/configuration/alerting_rules/`, fetched live), and only
|
|
252
|
+
entries with an `alert:` key — `record:` entries are recording rules, not alerts, and are
|
|
253
|
+
skipped. Extracts route-identifying label matchers from each rule's `expr` with a lightweight
|
|
254
|
+
selector regex (`metric_name{label="value", ...}` — PromQL's own basic matcher syntax,
|
|
255
|
+
`prometheus.io/docs/prometheus/latest/querying/basics/`, fetched live), not a full PromQL
|
|
256
|
+
parser — same "good enough, not semantically perfect" scope decision ebb's detectors made.
|
|
257
|
+
Which label names count as "this is the route" is a **declarative rules file**
|
|
258
|
+
(`src/telltale/rules/label_names.yaml`), not hardcoded `if` branches — specs/telltale.md §5's
|
|
259
|
+
explicit requirement, so this is a config edit for a user extending it, not a code change.
|
|
260
|
+
|
|
261
|
+
**Grafana dashboard parser** (`src/telltale/grafana.py`, Session 11): dashboard JSON
|
|
262
|
+
("dashboards as code"). Verified against two real, live-fetched public dashboards — a modern
|
|
263
|
+
flat `panels[]` shape and the legacy `rows[].panels[]` shape both use `targets[].expr` for a
|
|
264
|
+
Prometheus-backed panel's query. Only `expr` targets are read (specs/telltale.md DEC-01 commits
|
|
265
|
+
to OTel + Prometheus for v1; a non-Prometheus datasource's query language is out of scope, not
|
|
266
|
+
silently misread). Reuses the exact same PromQL selector/label-matcher logic as the Prometheus
|
|
267
|
+
parser (`src/telltale/promql.py`, extracted in this session so both parsers share one
|
|
268
|
+
implementation) — a panel visualizing a metric produces `metric`-type evidence, the same "this
|
|
269
|
+
is being watched" signal an alert represents for `alert`, without an alerting threshold.
|
|
270
|
+
|
|
271
|
+
**OTel Collector config parser** (`src/telltale/otel.py`, Session 11): `receivers`/
|
|
272
|
+
`processors`/`exporters`/`service.pipelines` — verified against opentelemetry.io's own docs
|
|
273
|
+
live. Deliberately narrow, and says so in its own docstring: most collector configs wire
|
|
274
|
+
generic pipelines with no reference to individual routes at all, so this parser only produces
|
|
275
|
+
evidence where a `filter` processor's OTTL condition actually names a route via `http.route`/
|
|
276
|
+
`http.request.method` (OpenTelemetry's current stable semantic convention attribute names,
|
|
277
|
+
`opentelemetry.io/docs/specs/semconv/http/http-spans/`, fetched live — not the code's own
|
|
278
|
+
`route`/`method` shorthand, since these are dotted attribute names from a different
|
|
279
|
+
ecosystem's convention, so they're a separate section of `label_names.yaml`, not folded into
|
|
280
|
+
the Prometheus lists). A processor only counts if it's genuinely wired into a
|
|
281
|
+
`service.pipelines` entry — an unreferenced `processors:` block is dead config that isn't
|
|
282
|
+
affecting the deployed collector, and reading it would be evidence for something not actually
|
|
283
|
+
happening. Which `traces`/`metrics`/`logs` section a condition sits under determines the
|
|
284
|
+
`SignalType` directly, since a filter processor's own structure already says that
|
|
285
|
+
unambiguously — no need to cross-reference the pipeline for that part.
|
|
286
|
+
|
|
287
|
+
**Evidence, not just data**: every parser needs real line numbers for `evidence_path` /
|
|
288
|
+
`evidence_line` (specs/telltale.md §6: "never assert without evidence"), but plain
|
|
289
|
+
`yaml.safe_load`/`json.loads` discard node positions once a document is built.
|
|
290
|
+
`keel.collect.line_tracking` (originally `src/telltale/yaml_lines.py`, extracted to `keel` in
|
|
291
|
+
Session 15 when charter needed the exact same thing for its own JSON-only config parsers — see
|
|
292
|
+
`packages/keel/README.md`) is a small custom `SafeLoader` that tags every parsed mapping with
|
|
293
|
+
its own starting line — used by every parser here, including the JSON ones (verified directly,
|
|
294
|
+
twice now — first for the OpenAPI parser, then again for a real 12KB Grafana dashboard file —
|
|
295
|
+
that well-formed JSON parses identically through this loader as through `json.loads`, just
|
|
296
|
+
with line tracking available). The one gap: a plain YAML/JSON list of strings (an OTel filter
|
|
297
|
+
condition list) has no per-item position, only the mappings do — `otel.py`'s evidence there
|
|
298
|
+
points at the enclosing `traces:`/`metrics:`/`logs:` block, the finest granularity available,
|
|
299
|
+
not a fabricated per-condition line.
|
|
300
|
+
|
|
301
|
+
**Route-template matching**: an OpenAPI path template (`/users/{id}`) and a signal's claimed
|
|
302
|
+
route (a Prometheus label value, a Grafana panel's query label, an OTel attribute value) are
|
|
303
|
+
compared after normalizing parameter placeholders (`{id}` and `:id` both collapse to the same
|
|
304
|
+
token) — exact match only, no fuzzy scoring, one shared function
|
|
305
|
+
(`src/telltale/route_template.py`) for every extractor. This is deliberately conservative: a
|
|
306
|
+
false `present` is worse than a false `absent` (specs/telltale.md's explicit priority), so an
|
|
307
|
+
unrecognized placeholder convention or a genuinely different path just doesn't match, rather
|
|
308
|
+
than guessing.
|
|
309
|
+
|
|
310
|
+
**Method narrowing**: two operations can share a path template (`GET /todos` and `POST
|
|
311
|
+
/todos`). Route-template matching alone would mark both `present` off a single GET-scoped
|
|
312
|
+
alert — a real false `present`, caught by the fixture-service acceptance test, not just
|
|
313
|
+
reasoned about. When an extractor finds a recognized method label/attribute
|
|
314
|
+
(`label_names.yaml`'s `method_label_names` for Prometheus/Grafana, `otel_method_attribute_names`
|
|
315
|
+
for OTel), a match additionally requires that method to agree with the route's. A signal with
|
|
316
|
+
no method information still matches on route template alone — the best information actually
|
|
317
|
+
available, not a reason to withhold a real match. See `.claude/skills/matching-rules.md` for
|
|
318
|
+
the full reasoning.
|
|
319
|
+
|
|
320
|
+
**The error-mode dimension** (`src/telltale/response_code.py`, Session 12): a route documents
|
|
321
|
+
its response codes as literal codes ("404") or OpenAPI's own wildcard convention ("5XX") —
|
|
322
|
+
`normalize_response_code()` maps both into one comparable space, and `is_error_mode()` restricts
|
|
323
|
+
to 4xx/5xx only (2xx/3xx/1xx are real, normalizable codes but not what DEC-03 tracks). Every
|
|
324
|
+
extractor was extended to also read a status-code label/attribute
|
|
325
|
+
(`label_names.yaml`'s `status_code_label_names` for Prometheus/Grafana,
|
|
326
|
+
`otel_status_code_attribute_names` for OTel) alongside route/method. Matching is **exact string
|
|
327
|
+
equality only, no class-membership reasoning either direction** — a route documenting "5XX" is
|
|
328
|
+
`present` only for a signal also scoped to exactly "5XX", not one scoped to the narrower "503",
|
|
329
|
+
and a route documenting "404" is never satisfied by a signal scoped to the broader "4XX". This
|
|
330
|
+
is a real, deliberate, documented gap (same false-present-is-worse-than-false-absent
|
|
331
|
+
conservatism as method narrowing), not an oversight.
|
|
332
|
+
|
|
333
|
+
One genuine PromQL idiom is recognized as meaningful, not fuzzy-matched: `code=~"5.."` is the
|
|
334
|
+
standard, widely-used convention for "the 5xx class," equivalent to OpenAPI's own "5XX" — only
|
|
335
|
+
this exact two-dot shape is interpreted, nothing broader. OTTL (OTel's condition language) has
|
|
336
|
+
no equivalent single standard idiom for a status-code *range*, so `otel.py` only reads exact
|
|
337
|
+
`==` conditions for status codes — a range condition like
|
|
338
|
+
`attributes["http.response.status_code"] >= 500` is a known, documented gap, not a silent one.
|
|
339
|
+
`http.response.status_code` is int-typed in OTTL (its own semconv example value is unquoted
|
|
340
|
+
`200`) — `otel.py`'s condition regex reads both quoted strings (`http.route`,
|
|
341
|
+
`http.request.method`) and bare integers, verified against a real OTTL condition shape, not
|
|
342
|
+
assumed to be one or the other.
|
|
343
|
+
|
|
344
|
+
**Session 10 (the extraction session):** the gitignore-aware file walker
|
|
345
|
+
(`is_binary`/`iter_files`/the gitignore matching) that `src/telltale/walk.py` copied verbatim
|
|
346
|
+
from `apps/ebb/src/ebb/walk.py` in Session 9 (marked `# DUPLICATED-FROM-EBB`) turned out to be
|
|
347
|
+
byte-identical between the two copies, so it moved to `packages/keel` —
|
|
348
|
+
`keel.collect.walk`. `src/telltale/walk.py` now imports it and keeps only
|
|
349
|
+
`iter_readable_text_files`, telltale's own thin layer on top. `packages/keel/README.md` has
|
|
350
|
+
the full identical-vs-similar reasoning.
|
|
351
|
+
|
|
352
|
+
`src/telltale/brand.py` duplicates ebb's one-line `BRAND` constant rather than importing it,
|
|
353
|
+
per NEXT_STEPS.md's insulation rule — that one stays duplicated; it isn't the kind of thing
|
|
354
|
+
`keel` is for.
|