mlreps 0.1.0
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.
- package/LICENSE.md +105 -0
- package/README.md +108 -0
- package/mlreps.js +7273 -0
- package/package.json +27 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Functional Source License, Version 1.1, ALv2 Future License
|
|
2
|
+
|
|
3
|
+
## Abbreviation
|
|
4
|
+
|
|
5
|
+
FSL-1.1-ALv2
|
|
6
|
+
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 Krish Trivedi
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the Apache License, Version 2.0 that is effective on the second anniversary of
|
|
91
|
+
the date we make the Software available. On or after that date, you may use the
|
|
92
|
+
Software under the Apache License, Version 2.0, in which case the following
|
|
93
|
+
will apply:
|
|
94
|
+
|
|
95
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
96
|
+
this file except in compliance with the License.
|
|
97
|
+
|
|
98
|
+
You may obtain a copy of the License at
|
|
99
|
+
|
|
100
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
101
|
+
|
|
102
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
103
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
|
+
specific language governing permissions and limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# mlreps
|
|
2
|
+
|
|
3
|
+
Reads a repository and reports what a change to it would reach — the files, the symbols, the edges
|
|
4
|
+
between them, and what our rules found. It runs in your pipeline, on a checkout that is already
|
|
5
|
+
there.
|
|
6
|
+
|
|
7
|
+
**It never sends your source.** What leaves is the graph the scan built: paths, line numbers,
|
|
8
|
+
symbol names, route URLs and package names. There is no column in our database that could hold a
|
|
9
|
+
diff, and a build gate fails if somebody adds a place for one.
|
|
10
|
+
|
|
11
|
+
## Two ways to use it, and they are different decisions
|
|
12
|
+
|
|
13
|
+
### On a pull request, sending us nothing
|
|
14
|
+
|
|
15
|
+
```yaml
|
|
16
|
+
name: Codebase intelligence
|
|
17
|
+
|
|
18
|
+
on:
|
|
19
|
+
pull_request:
|
|
20
|
+
|
|
21
|
+
# Without this, GITHUB_TOKEN cannot write a check run and every run ends in a 403.
|
|
22
|
+
permissions:
|
|
23
|
+
contents: read
|
|
24
|
+
checks: write
|
|
25
|
+
|
|
26
|
+
jobs:
|
|
27
|
+
scan:
|
|
28
|
+
runs-on: ubuntu-latest
|
|
29
|
+
steps:
|
|
30
|
+
- uses: actions/checkout@v4
|
|
31
|
+
- uses: actions/setup-node@v4
|
|
32
|
+
with:
|
|
33
|
+
node-version: 22
|
|
34
|
+
- run: npm ci
|
|
35
|
+
- run: npx mlreps check .
|
|
36
|
+
env:
|
|
37
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
38
|
+
# On a pull request, GITHUB_SHA is a merge commit that exists nowhere in
|
|
39
|
+
# the repository — a check run posted against it is invisible.
|
|
40
|
+
PLATFORM_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The analysis happens on your runner and the check run is posted to your repository by your own CI
|
|
44
|
+
token. Nothing of yours leaves and no credential of ours is involved. This is the stronger of the
|
|
45
|
+
two arrangements, and it costs you the dashboard.
|
|
46
|
+
|
|
47
|
+
### On the default branch, publishing to your dashboard
|
|
48
|
+
|
|
49
|
+
```yaml
|
|
50
|
+
name: MLReps
|
|
51
|
+
|
|
52
|
+
on:
|
|
53
|
+
push:
|
|
54
|
+
branches: [main]
|
|
55
|
+
|
|
56
|
+
jobs:
|
|
57
|
+
scan:
|
|
58
|
+
runs-on: ubuntu-latest
|
|
59
|
+
steps:
|
|
60
|
+
- uses: actions/checkout@v4
|
|
61
|
+
with:
|
|
62
|
+
# Without this the scan reports that every file was never committed.
|
|
63
|
+
fetch-depth: 0
|
|
64
|
+
- uses: actions/setup-node@v4
|
|
65
|
+
with:
|
|
66
|
+
node-version: 24
|
|
67
|
+
- run: npm ci
|
|
68
|
+
- run: npx mlreps scan . --publish
|
|
69
|
+
env:
|
|
70
|
+
MLREPS_KEY: ${{ secrets.MLREPS_KEY }}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Make a key at https://www.mlreps.com/start and set it as the repository secret `MLREPS_KEY`. It runs
|
|
74
|
+
on `push` rather than on pull requests on purpose: a report published from every branch would make
|
|
75
|
+
your dashboard a picture of whichever job finished last.
|
|
76
|
+
|
|
77
|
+
## Anywhere else
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
MLREPS_KEY=mlrp_…
|
|
81
|
+
MLREPS_ENDPOINT=https://www.mlreps.com
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
npx mlreps scan . # analyse, print, send nothing
|
|
86
|
+
npx mlreps scan . --publish # and send the graph to your dashboard
|
|
87
|
+
npx mlreps scan . --publish --dry-run
|
|
88
|
+
npx mlreps impact --base main # what this branch's change reaches
|
|
89
|
+
npx mlreps check . # a check run on this pull request
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## It will not break your build
|
|
93
|
+
|
|
94
|
+
Every command exits 0, including when we are unreachable. A tool that turns a build red because it
|
|
95
|
+
disagreed with itself is a tool that gets removed from the pipeline the same afternoon. Ask for a
|
|
96
|
+
gate explicitly with `--fail-on-exposed`.
|
|
97
|
+
|
|
98
|
+
## Licence
|
|
99
|
+
|
|
100
|
+
[FSL-1.1-ALv2](./LICENSE.md) — the Functional Source License. You may use, read and modify this for
|
|
101
|
+
anything except a product that competes with it, and every version becomes Apache-2.0 two years after
|
|
102
|
+
it is released. Being able to read exactly what runs in your pipeline is the point.
|
|
103
|
+
|
|
104
|
+
## What it can read
|
|
105
|
+
|
|
106
|
+
TypeScript and JavaScript. A repository it resolves below 70% is declined rather than half-drawn,
|
|
107
|
+
and every screen and every run prints how much of the call sites it could follow — a region we could
|
|
108
|
+
not read is never shown as a region with nothing wrong in it.
|