flyleaf 0.5.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.
flyleaf-0.5.0/LICENSE ADDED
@@ -0,0 +1,190 @@
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 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
+ Copyright 2026 Krishna Dahale
179
+
180
+ Licensed under the Apache License, Version 2.0 (the "License");
181
+ you may not use this file except in compliance with the License.
182
+ You may obtain a copy of the License at
183
+
184
+ http://www.apache.org/licenses/LICENSE-2.0
185
+
186
+ Unless required by applicable law or agreed to in writing, software
187
+ distributed under the License is distributed on an "AS IS" BASIS,
188
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
189
+ See the License for the specific language governing permissions and
190
+ limitations under the License.
flyleaf-0.5.0/PKG-INFO ADDED
@@ -0,0 +1,438 @@
1
+ Metadata-Version: 2.4
2
+ Name: flyleaf
3
+ Version: 0.5.0
4
+ Summary: Local inventory of AI components in a repository. Not a legal risk classifier.
5
+ Keywords: eu-ai-act,inventory,model-card,cli
6
+ Author: Krishna Dahale
7
+ Author-email: Krishna Dahale <krishy.ai.d@gmail.com>
8
+ License-Expression: Apache-2.0
9
+ License-File: LICENSE
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Environment :: Console
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: Intended Audience :: Legal Industry
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Software Development :: Quality Assurance
19
+ Classifier: Topic :: Software Development :: Documentation
20
+ Requires-Dist: typer>=0.12
21
+ Requires-Python: >=3.11
22
+ Project-URL: Homepage, https://github.com/krishyaid-coder/flyleaf
23
+ Project-URL: Repository, https://github.com/krishyaid-coder/flyleaf
24
+ Project-URL: Issues, https://github.com/krishyaid-coder/flyleaf/issues
25
+ Description-Content-Type: text/markdown
26
+
27
+ # flyleaf
28
+
29
+ [![ci](https://github.com/krishyaid-coder/flyleaf/actions/workflows/ci.yml/badge.svg)](https://github.com/krishyaid-coder/flyleaf/actions/workflows/ci.yml)
30
+ [![pypi](https://img.shields.io/pypi/v/flyleaf)](https://pypi.org/project/flyleaf/)
31
+ [![python](https://img.shields.io/pypi/pyversions/flyleaf)](https://pypi.org/project/flyleaf/)
32
+ [![license](https://img.shields.io/badge/license-Apache--2.0-blue)](LICENSE)
33
+
34
+ <p align="center">
35
+ <img src="https://raw.githubusercontent.com/krishyaid-coder/flyleaf/main/flyleaf.png" alt="flyleaf" width="220">
36
+ </p>
37
+
38
+ flyleaf is a local documentation clerk for AI code. It inventories the AI libraries in a repository, cites the EU AI Act provisions a person should read, and reports when a model card is missing or has fallen behind the code.
39
+
40
+ A flyleaf is the blank page bound in front of a book, the page where you say what the book is. This tool prepares that page and keeps a record of when the book moves on.
41
+
42
+ Legal classification depends on the use case. The use case is not in the import. flyleaf prepares the inventory and the questions. A person decides what the law requires. This output is not legal advice.
43
+
44
+ <p align="center">
45
+ <img src="https://raw.githubusercontent.com/krishyaid-coder/flyleaf/main/demo.gif" alt="flyleaf finding documentation drift, waiving one finding, and reopening a lapsed waiver" width="820">
46
+ </p>
47
+
48
+ ## Architecture
49
+
50
+ Detection rules and the citation pack are separate. The scanner names what it found in the tree. The pack names the provision to read, the Official Journal text, and the date that text was current. Every report copies the pack version, so a later edit to the pack does not rewrite an older run.
51
+
52
+ ```mermaid
53
+ flowchart TD
54
+ repo[Repository]
55
+ rules[Detection rules]
56
+ pack[Citation pack]
57
+ declared[Declared systems]
58
+ scan[flyleaf scan]
59
+ inventory[Inventory]
60
+ brief[flyleaf brief]
61
+ card[flyleaf card]
62
+ cite[flyleaf cite]
63
+ person[Person decides]
64
+
65
+ repo --> scan
66
+ rules --> scan
67
+ pack --> scan
68
+ declared --> scan
69
+ scan --> inventory
70
+ repo --> brief
71
+ pack --> brief
72
+ inventory --> card
73
+ pack --> cite
74
+ inventory --> person
75
+ brief --> person
76
+ card --> person
77
+ cite --> person
78
+ ```
79
+
80
+ `brief` scans the same rules at two states and diffs the inventories. Line numbers can move without a finding. A finding appears when a component is added or removed, when the import or dependency text changes, or when the model card content changes. The base is a git ref, or the recorded baseline.
81
+
82
+ ```mermaid
83
+ flowchart LR
84
+ baseRef[Base git ref or baseline]
85
+ headRef[Head git ref or working tree]
86
+ scanBase[Scan base]
87
+ scanHead[Scan head]
88
+ diff[Diff inventories]
89
+ graded[Grade impact and severity]
90
+ waivers[Apply waivers]
91
+ rollup[Roll up declared systems]
92
+ memo[Brief with citations]
93
+
94
+ baseRef --> scanBase
95
+ headRef --> scanHead
96
+ scanBase --> diff
97
+ scanHead --> diff
98
+ diff --> graded --> waivers --> rollup --> memo
99
+ ```
100
+
101
+ Waivers are applied to components first, then to systems, so a waiver on one file shrinks a system finding rather than silencing it.
102
+
103
+ A waiver suppresses a finding for a stated reason, until a stated date. It is never silent and never permanent. An expired waiver puts the finding back in front of a person.
104
+
105
+ ```mermaid
106
+ flowchart LR
107
+ finding[Finding]
108
+ check{Covering waiver?}
109
+ valid{Still in date?}
110
+ active[Active finding]
111
+ waived[Waived and logged]
112
+ reopened[Reopened, waiver expired]
113
+
114
+ finding --> check
115
+ check -->|no| active
116
+ check -->|yes| valid
117
+ valid -->|yes| waived
118
+ valid -->|no| reopened
119
+ ```
120
+
121
+ The pack moves only when you publish a new version. A scan does not fetch the law.
122
+
123
+ ```mermaid
124
+ flowchart LR
125
+ official[Official Journal text]
126
+ edit[Edit the citation pack]
127
+ version[New pack version and changelog entry]
128
+ report[Reports record that version]
129
+
130
+ official --> edit --> version --> report
131
+ ```
132
+
133
+ ## What a component is
134
+
135
+ A component is one detected framework in one file: `app.py` importing `openai`, or `pyproject.toml` depending on `scikit-learn`. That is evidence. An AI system is a grouping a person makes from those components. flyleaf does not invent that grouping, and it does not assign a risk tier.
136
+
137
+ You can declare the grouping yourself. See Systems below. Once declared, a system is what the brief reports and what `card` scaffolds, so one system needs one card rather than one per file.
138
+
139
+ Status values on a finding are `missing` and `needs_review`. `missing` means a model card file was not found, or was removed. `needs_review` means a person should read the cited provision against the change. The tool does not declare that a law was breached.
140
+
141
+ ## Impact and severity
142
+
143
+ Every finding carries an impact and a severity.
144
+
145
+ `impact` is `runtime` when the detected code changed, and `documentation` when only the model card did. A new dependency behaves differently from a reworded card, so the two are not mixed.
146
+
147
+ `severity` is `high`, `medium`, or `low`. It ranks how much engineering attention a change deserves. It is not a legal risk tier and says nothing about whether an obligation applies.
148
+
149
+ | Change | Impact | Severity |
150
+ |---|---|---|
151
+ | `added` with no model card | runtime | high |
152
+ | `added` with a model card | runtime | medium |
153
+ | `removed` | runtime | medium |
154
+ | `evidence_changed` | runtime | high |
155
+ | `card_stale` | runtime | high |
156
+ | `evidence_and_card_changed` | runtime | medium |
157
+ | `card_removed` | documentation | high |
158
+ | `card_added` | documentation | low |
159
+ | `card_changed` | documentation | low |
160
+
161
+ A system finding takes the severity of its worst component, and its impact is `runtime` when any component inside it changed code.
162
+
163
+ ## Install
164
+
165
+ ```bash
166
+ uv tool install flyleaf
167
+ flyleaf --help
168
+ ```
169
+
170
+ `pipx install flyleaf` and `pip install flyleaf` work too. Python 3.11 or later. The only runtime dependency is typer.
171
+
172
+ To work on flyleaf itself:
173
+
174
+ ```bash
175
+ git clone https://github.com/krishyaid-coder/flyleaf
176
+ cd flyleaf
177
+ uv sync
178
+ uv run pytest
179
+ ```
180
+
181
+ ## Scan
182
+
183
+ ```bash
184
+ uv run flyleaf scan .
185
+ uv run flyleaf scan . --format markdown
186
+ uv run flyleaf scan . -o inventory.json
187
+ ```
188
+
189
+ `scan` exits 0 when it finishes, including when it finds AI libraries. Using PyTorch is not a failed build.
190
+
191
+ Python files and code cells in `.ipynb` notebooks are read with the standard-library AST. `requirements*.txt`, `pyproject.toml`, and `package.json` are read as dependency lists. A keyword that happens to match a package name is not treated as a dependency. JavaScript imports inside `.ts` and `.js` files are not parsed yet. Scoped packages such as `@anthropic-ai/sdk` are recognized when they appear in `package.json`.
192
+
193
+ A model card counts as present when `MODEL_CARD.md` (or `model_card.md` / `modelcard.md`, markdown or yaml) sits next to the file or at the repository root. A component in a declared system uses that system's card instead.
194
+
195
+ JSON is the default. Every inventory includes:
196
+
197
+ - `citation_pack.version` and `citation_pack.as_of`
198
+ - `citations`, the entries this report actually used, each with pinpoint, quote, note, CELEX, and source URL
199
+ - `components[]` with `path`, `framework`, `category`, `role_hint`, `system`, `evidence`, `review_hints`, `model_card_status`, and `documentation_citation_ids`
200
+ - `systems[]`, the groupings you declared, each with its owner, card status, and component ids
201
+ - a disclaimer
202
+ - `warnings` for files that could not be parsed
203
+
204
+ `role_hint` is one of `api_client`, `orchestration`, or `local_ml`. It tells you which definition to read. It is not a finding that you are a provider or a deployer.
205
+
206
+ ## Systems
207
+
208
+ One library used in three files is three components. Whether it is one system or three depends on who the output reaches and what for, and that is not in the import. flyleaf will not guess it, so you declare it in `.flyleaf/systems.toml`. Commit that file.
209
+
210
+ ```toml
211
+ [[system]]
212
+ name = "support-bot"
213
+ owner = "platform@example.com"
214
+ card = "docs/cards/support-bot.md"
215
+ includes = ["app/chat/*", "pyproject.toml"]
216
+
217
+ [[system]]
218
+ name = "ticket-summarizer"
219
+ owner = "support@example.com"
220
+ card = "docs/cards/ticket-summarizer.md"
221
+ includes = ["jobs/summarize.py"]
222
+ ```
223
+
224
+ `name` and `includes` are required. `card` and `owner` are optional. An entry missing a required field is ignored, reported as a warning, and its files fall back to standing alone.
225
+
226
+ An include is an exact path, a glob, or a directory prefix, all relative to the repository root and written with forward slashes. A `*` spans separators, so `app/*` claims everything beneath `app`. A file claimed by two systems goes to the first one declared, and the scan warns that it was contested. A system that claims no detected component also warns, because that usually means a pattern is wrong.
227
+
228
+ ```mermaid
229
+ flowchart LR
230
+ fileA[app/chat/bot.py]
231
+ fileB[pyproject.toml]
232
+ fileC[jobs/summarize.py]
233
+ compA[Component openai]
234
+ compB[Component openai]
235
+ compC[Component openai]
236
+ sysA[System support-bot]
237
+ sysC[System ticket-summarizer]
238
+ cardA[One card]
239
+ cardC[One card]
240
+
241
+ fileA --> compA --> sysA
242
+ fileB --> compB --> sysA
243
+ fileC --> compC --> sysC
244
+ sysA --> cardA
245
+ sysC --> cardC
246
+ ```
247
+
248
+ Declaring a system changes three things. The declared `card` becomes the card for every component in the system, so one file documents the whole thing. The brief reports one finding per system instead of one per file, listing the components inside it as evidence. `flyleaf card` writes one scaffold per system.
249
+
250
+ Components you do not claim are still reported individually. Nothing is hidden by leaving the file out.
251
+
252
+ ## Who owns a finding
253
+
254
+ A finding that names nobody is a finding nobody does. Every finding in a brief carries two names, and they answer different questions.
255
+
256
+ `owner` is the `owner` field of the declared system. It is accountable for the system whoever happened to type the change.
257
+
258
+ `author` is read from `git blame` on the evidence line that changed. It is whoever last touched that line, which is usually the person who can answer the question fastest.
259
+
260
+ ```mermaid
261
+ flowchart TD
262
+ finding[Finding]
263
+ blame{Author from git blame?}
264
+ bot{Is it a bot?}
265
+ owner{Declared owner?}
266
+ askAuthor[Ask the author]
267
+ askOwner[Ask the owner]
268
+ unassigned[Unassigned, and says so]
269
+
270
+ finding --> blame
271
+ blame -->|yes| bot
272
+ blame -->|no| owner
273
+ bot -->|no| askAuthor
274
+ bot -->|yes| owner
275
+ owner -->|yes| askOwner
276
+ owner -->|no| unassigned
277
+ ```
278
+
279
+ The brief opens with a "Who should look at this" section grouping the findings by person. A bot is never asked to review, so a Dependabot bump falls through to the declared owner. An uncommitted edit has no author yet and says so rather than guessing. A finding with neither name reads `unassigned`, which is a true statement about your repository and not a gap in the tool.
280
+
281
+ Blame names a line, not a fault. A reformat, a file move, or a bulk upgrade will put the wrong name on a finding, so the report always says where the name came from. Pass `--no-blame` to leave authors out entirely, for example if you would rather not have committer emails in a report that leaves the repository.
282
+
283
+ ## Brief
284
+
285
+ ```bash
286
+ uv run flyleaf brief main~1
287
+ uv run flyleaf brief v0.1.0 HEAD --format markdown
288
+ uv run flyleaf brief --baseline
289
+ ```
290
+
291
+ The first form compares a git ref with the working tree. The second compares two refs. The third compares the working tree against the approved baseline. `brief` exits 2 when the path is not a git repository, the ref does not resolve, or no baseline has been recorded.
292
+
293
+ A quiet brief means no component was added or removed, no detected evidence text changed, and no model card content changed. An unchanged missing card stays in `scan`. `brief` reports the delta.
294
+
295
+ ## Baseline
296
+
297
+ A baseline is the inventory as it stood at the last sign-off.
298
+
299
+ ```bash
300
+ uv run flyleaf baseline --approved-by you@example.com --rev v1.2.0
301
+ uv run flyleaf brief --baseline
302
+ ```
303
+
304
+ This writes `.flyleaf/baseline.json`. Commit it. Drift is then measured against an approved state rather than an arbitrary pair of commits, and the brief records who approved it and when.
305
+
306
+ ## Waivers
307
+
308
+ A finding is suppressed only by a written waiver in `.flyleaf/waivers.toml`. Commit that file too. It is the audit trail.
309
+
310
+ ```toml
311
+ [[waiver]]
312
+ component = "app.py:openai"
313
+ reason = "Internal prototype, not shipped. Card lands with the 1.3 release."
314
+ approved_by = "you@example.com"
315
+ expires = "2026-12-31"
316
+
317
+ [[waiver]]
318
+ component = "notebooks/train.ipynb:torch"
319
+ change = "card_stale"
320
+ reason = "Card rewrite tracked in issue 42."
321
+ approved_by = "you@example.com"
322
+ expires = "2026-11-15"
323
+ ```
324
+
325
+ `component`, `reason`, `approved_by`, and `expires` are all required. An entry missing any of them is ignored, reported as a warning, and the finding stays active. Omit `change` to cover every change on that component, or name one change to be narrower.
326
+
327
+ To waive a whole declared system, name it as `system:<name>`:
328
+
329
+ ```toml
330
+ [[waiver]]
331
+ component = "system:support-bot"
332
+ reason = "Card rewrite tracked in issue 42."
333
+ approved_by = "you@example.com"
334
+ expires = "2026-11-15"
335
+ ```
336
+
337
+ A waived finding is not deleted. It moves to the `waived` list in the output, with the reason, the approver, the expiry date, and the days remaining. When the date passes, the finding returns to `findings` with `waiver_state` set to `expired`, and the summary names the lapsed waiver. A waiver inside 14 days of expiry raises a warning so renewal is not a surprise.
338
+
339
+ ## Continuous integration
340
+
341
+ ```bash
342
+ uv run flyleaf brief --baseline --fail-on high --format sarif -o flyleaf.sarif
343
+ ```
344
+
345
+ `--fail-on` takes `none`, `low`, `medium`, or `high`, and defaults to `none`. The command exits 1 when an active finding reaches that severity, and 0 otherwise. Waived findings never trigger the exit code. A team picks its own policy, for example failing on runtime drift while only warning on documentation changes.
346
+
347
+ `--format sarif` writes SARIF 2.1.0, so GitHub renders the findings as annotations on the pull request. High maps to `error`, medium to `warning`, and low to `note`.
348
+
349
+ On GitHub, use the action:
350
+
351
+ ```yaml
352
+ permissions:
353
+ contents: read
354
+ pull-requests: write
355
+ security-events: write
356
+
357
+ steps:
358
+ - uses: actions/checkout@v7
359
+ with:
360
+ fetch-depth: 0
361
+ - uses: krishyaid-coder/flyleaf@v0.5.0
362
+ id: flyleaf
363
+ with:
364
+ baseline: "true"
365
+ fail-on: high
366
+ - uses: github/codeql-action/upload-sarif@v3
367
+ if: always()
368
+ with:
369
+ sarif_file: ${{ steps.flyleaf.outputs.sarif-file }}
370
+ ```
371
+
372
+ The action posts the brief as a pull request comment and edits that same comment on every later push, because a fresh comment per push is how a review bot teaches people to scroll past it. Set `comment: "false"` to turn it off. It needs `pull-requests: write`.
373
+
374
+ Every artefact is produced before the severity threshold is applied, so a failing check still leaves the comment and the annotations behind for the author to read.
375
+
376
+ `fetch-depth: 0` gives the action the history it needs for `git blame` and for comparing two refs. Without it, authors come back unknown.
377
+
378
+ SARIF annotations through `upload-sarif` are free on public repositories but need GitHub Advanced Security on private ones. The pull request comment works everywhere, which is why the action posts one rather than relying on annotations alone.
379
+
380
+ Pass `base` and `head` instead of `baseline` to compare two refs.
381
+
382
+ ## Render
383
+
384
+ ```bash
385
+ uv run flyleaf brief --baseline --format json -o brief.json
386
+ uv run flyleaf render brief.json --format markdown
387
+ uv run flyleaf render brief.json --format sarif -o brief.sarif
388
+ ```
389
+
390
+ `render` re-renders a saved report without scanning or reading git, so a pipeline that wants three formats pays for one scan, and an archived brief can be read back long after the branch is gone.
391
+
392
+ ## Card
393
+
394
+ ```bash
395
+ uv run flyleaf card . -o flyleaf-cards
396
+ ```
397
+
398
+ This writes one markdown scaffold per declared system, then one per component that no system claimed. The file is a draft with blanks for purpose, role, data, limitations, oversight, and the Annex III use case. A system scaffold lists every component inside it so the evidence is in one place. Existing scaffolds are kept unless you pass `--force`.
399
+
400
+ Scaffolds land under `--output` and never at a declared `card` path, so an empty draft is never counted as documentation. Move the file into place once it says something. A per-component scaffold has to be renamed to `MODEL_CARD.md` to count.
401
+
402
+ ## Cite
403
+
404
+ ```bash
405
+ uv run flyleaf cite
406
+ uv run flyleaf cite art-11-annex-iv
407
+ uv run flyleaf cite --changelog
408
+ ```
409
+
410
+ The current pack is `2026.07.27`. It cites Regulation (EU) 2024/1689 (CELEX `32024R1689`) as amended by Regulation (EU) 2026/1744 (CELEX `32026R1744`), in force 27 July 2026. The amendment deferred Chapter III, Sections 1, 2, and 3: 2 December 2027 for Annex III systems, and 2 August 2028 for Annex I systems. That date is citation `art-113-application`.
411
+
412
+ To record a later change in the law:
413
+
414
+ 1. Edit `src/flyleaf/citations.py`.
415
+ 2. Keep a superseded entry in place when a quote is replaced, and point the hint at the new id.
416
+ 3. Bump `PACK_VERSION` and add a `CHANGELOG` line that names which hint ids a person should re-read.
417
+
418
+ ## What it detects
419
+
420
+ Hosted model clients: OpenAI, Anthropic, Google GenAI, Mistral, Cohere.
421
+
422
+ Orchestration: LangChain, LlamaIndex, LangGraph.
423
+
424
+ Machine learning: PyTorch, TensorFlow, scikit-learn, Transformers, XGBoost.
425
+
426
+ ## Known limits
427
+
428
+ Detection is Python and notebooks only. TypeScript and JavaScript source files are not parsed, though their dependencies are read from `package.json`.
429
+
430
+ A component is one framework in one file, so a dependency entry and the import that uses it are two components. Declare a system to group them. Without a declaration they stay separate, because the grouping is a human judgement and flyleaf does not guess it.
431
+
432
+ A declared system is only as good as its `includes` patterns. A new file that no pattern covers is reported as a loose component, not quietly added to the nearest system.
433
+
434
+ `brief` compares the text of detected evidence, not line numbers, so moving code does not raise a finding. A change elsewhere in a manifest does not raise one either. A rename does count as a removal plus an addition.
435
+
436
+ ## Privacy
437
+
438
+ Scanning reads the local tree and, for `brief`, local git history including `git blame`. There is no telemetry, no account, and no network call. The GitHub Action is the one place anything is sent anywhere, and it posts to your own repository with your own token. Use `--no-blame` to keep committer names out of a report.