provedone 0.0.1 → 0.2.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 +21 -0
- package/README.md +233 -0
- package/dist/bin.js +4 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.js +385 -0
- package/dist/done.d.ts +32 -0
- package/dist/done.js +20 -0
- package/dist/gate.d.ts +26 -0
- package/dist/gate.js +14 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +5 -0
- package/dist/intents.d.ts +41 -0
- package/dist/intents.js +62 -0
- package/dist/markdown.js +42 -0
- package/dist/receipt.d.ts +30 -0
- package/dist/receipt.js +37 -0
- package/dist/store.js +50 -0
- package/package.json +73 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ofri Peretz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
<p align="center">
|
|
2
|
+
<a href="https://github.com/ofri-peretz/burgee/tree/main/packages/provedone" target="blank">
|
|
3
|
+
<picture>
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/ofri-peretz/burgee/main/brand-assets/provedone-lockup.svg" />
|
|
5
|
+
<img src="https://raw.githubusercontent.com/ofri-peretz/burgee/main/brand-assets/provedone-lockup-light.svg" alt="provedone" width="360" />
|
|
6
|
+
</picture>
|
|
7
|
+
</a>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
Done, with the receipt: every change says how it was verified, and a gate reads it.
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
<p align="center">
|
|
15
|
+
<a href="https://www.npmjs.com/package/provedone"><img src="https://img.shields.io/npm/v/provedone?style=flat-square&color=0a6b47" alt="provedone on npm: the latest version" /></a>
|
|
16
|
+
<a href="https://www.npmjs.com/package/provedone"><img src="https://img.shields.io/npm/dm/provedone?style=flat-square" alt="provedone downloads per month on npm" /></a>
|
|
17
|
+
<a href="https://github.com/ofri-peretz/burgee/actions/workflows/quality.yml?query=branch%3Amain"><img src="https://img.shields.io/github/actions/workflow/status/ofri-peretz/burgee/quality.yml?branch=main&style=flat-square&label=Quality%20Gate" alt="Quality Gate: the CI status of main" /></a>
|
|
18
|
+
<a href="https://app.codecov.io/gh/ofri-peretz/burgee/components"><img src="https://img.shields.io/codecov/c/github/ofri-peretz/burgee/main?component=provedone&style=flat-square" alt="provedone line coverage: its Codecov component" /></a>
|
|
19
|
+
<a href="https://scorecard.dev/viewer/?uri=github.com/ofri-peretz/burgee"><img src="https://img.shields.io/ossf-scorecard/github.com/ofri-peretz/burgee?style=flat-square&label=OpenSSF%20Scorecard" alt="OpenSSF Scorecard for the repository" /></a>
|
|
20
|
+
<a href="https://www.npmjs.com/package/provedone?activeTab=code"><img src="https://img.shields.io/npm/unpacked-size/provedone?style=flat-square" alt="Unpacked size of the latest provedone release on npm" /></a>
|
|
21
|
+
<a href="https://github.com/ofri-peretz/burgee/blob/main/packages/provedone/package.json"><img src="https://img.shields.io/badge/dependencies-2%20in%20family%2C%200%20outside-0a6b47?style=flat-square" alt="Two dependencies, all in the burgee family (bellpull, burgee), none outside it" /></a>
|
|
22
|
+
<a href="https://github.com/ofri-peretz/burgee/blob/main/packages/provedone/package.json"><img src="https://img.shields.io/badge/types-included-blue?style=flat-square" alt="TypeScript types included for every entry point" /></a>
|
|
23
|
+
<a href="https://github.com/ofri-peretz/burgee/blob/main/packages/provedone/package.json"><img src="https://img.shields.io/badge/Node.js-22.13%2B-green?style=flat-square" alt="Node.js 22.13+" /></a>
|
|
24
|
+
<a href="https://github.com/ofri-peretz/burgee/blob/main/packages/provedone/LICENSE"><img src="https://img.shields.io/badge/License-MIT-blue?style=flat-square" alt="License: MIT" /></a>
|
|
25
|
+
<a href="https://www.npmjs.com/package/provedone#provenance"><img src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fregistry.npmjs.org%2Fprovedone%2Flatest&query=%24.dist.attestations.provenance~&label=npm&style=flat-square&color=0a6b47" alt="npm provenance of the latest release, read live from its registry attestation" /></a>
|
|
26
|
+
</p>
|
|
27
|
+
|
|
28
|
+
<p align="center">
|
|
29
|
+
Docs: <a href="https://burgee.interlace.tools/docs/packages/provedone">https://burgee.interlace.tools/docs/packages/provedone</a><br />
|
|
30
|
+
Migrating from: <a href="https://github.com/ofri-peretz/burgee/tree/main/packages/provedone#migrating">@commitlint/cli</a>
|
|
31
|
+
</p>
|
|
32
|
+
|
|
33
|
+
**provedone** puts a receipt on every change: the command that proved it, how it exited, and a
|
|
34
|
+
digest of what it printed, as git trailers beside `Co-Authored-By:`. `provedone stamp` runs the
|
|
35
|
+
command and writes the lines; `provedone gate` reads a commit message or a PR body and, in
|
|
36
|
+
`enforce` mode, blocks one with no receipt; `provedone done` asks whether every success criterion
|
|
37
|
+
of an intent has a passing stamp on the branch. Every finding names its fix, as the same record
|
|
38
|
+
for a person, for `--json` and for a coding agent.
|
|
39
|
+
|
|
40
|
+
It covers the trailer half of **@commitlint/cli**: where a `trailer-exists` rule asks that a
|
|
41
|
+
`Verified-by:` line be present, provedone also writes it from a run that happened and checks it
|
|
42
|
+
gives a reason when it says `none`. Keep commitlint for the message's shape, and put
|
|
43
|
+
`npx provedone gate` in the `commit-msg` hook, as
|
|
44
|
+
[Migrating](https://github.com/ofri-peretz/burgee/tree/main/packages/provedone#migrating) shows.
|
|
45
|
+
|
|
46
|
+
## Install
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npm install provedone
|
|
50
|
+
pnpm add provedone
|
|
51
|
+
yarn add provedone
|
|
52
|
+
bun add provedone
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Install it as a dev dependency (`-D`) of the repository whose commits it reads. It needs only git.
|
|
56
|
+
|
|
57
|
+
## Quick start
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npm install provedone
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
```js
|
|
64
|
+
import { digest, trailers, verdict } from "provedone";
|
|
65
|
+
|
|
66
|
+
// What `provedone stamp --run "npm test" --not-checked "the docs site"` records.
|
|
67
|
+
const receipt = {
|
|
68
|
+
checks: [{ command: "npm test", exit: 0, digest: digest("Tests 81 passed (81)\n") }],
|
|
69
|
+
captures: [],
|
|
70
|
+
notChecked: ["the docs site"],
|
|
71
|
+
};
|
|
72
|
+
console.log(trailers(receipt).join("\n"));
|
|
73
|
+
|
|
74
|
+
// And what the gate says of a message with no receipt.
|
|
75
|
+
const v = verdict("fix: make CI green");
|
|
76
|
+
console.log(`${v.reason}. fix: ${v.fix}`);
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
```text
|
|
80
|
+
Verified-by: npm test -> exit 0 (sha256:a5fa1eae52b6)
|
|
81
|
+
Not-checked: the docs site
|
|
82
|
+
no Verified-by: line. fix: run `provedone stamp --run "<the command that proves it>" --not-checked "<what you did not check>"` and paste its lines, or add `Verified-by: none (<why it needs no check>)`
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
That is the check `npx provedone gate .git/COMMIT_EDITMSG` runs in a `commit-msg` hook: `observe`
|
|
86
|
+
mode passes and logs what `enforce` would block.
|
|
87
|
+
|
|
88
|
+
## What it checks
|
|
89
|
+
|
|
90
|
+
```sh
|
|
91
|
+
provedone stamp --run "npm test" --not-checked "the docs site" # trailers for the commit
|
|
92
|
+
provedone stamp --run "npm test" --not-checked nothing --pr # the PR's "How this was checked" block
|
|
93
|
+
provedone stamp --none "comment-only change" # Verified-by: none, with its reason
|
|
94
|
+
provedone gate .git/COMMIT_EDITMSG # observe: passes, logs what enforce would block
|
|
95
|
+
provedone gate pr-body.md --mode enforce # blocks a body with no receipt
|
|
96
|
+
provedone done faster-help # every success criterion has a passing stamp?
|
|
97
|
+
provedone intent new faster-help # intent.md and spec.md from _template/
|
|
98
|
+
provedone intent check --evidence # the intent rules, and the shipped evidence re-run
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
| Command | Exit 1 when |
|
|
102
|
+
| :-- | :-- |
|
|
103
|
+
| `stamp` | a `--run` command failed (it is still recorded) |
|
|
104
|
+
| `gate` | `enforce`, no `Verified-by:` line or a `none` with no reason, and fewer than two blocks this session |
|
|
105
|
+
| `done` | a success criterion has no passing stamp on this branch; each gets a `fix:` naming the stamp to run |
|
|
106
|
+
| `intent check` | an intent breaks a rule, the index disagrees, or a re-run evidence command no longer matches |
|
|
107
|
+
|
|
108
|
+
```text
|
|
109
|
+
Verified-by: npm test -> exit 0 (sha256:85f7e552faae)
|
|
110
|
+
Captured: shots/home.png
|
|
111
|
+
Not-checked: the docs site
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
One `Verified-by:` per command, with its exit code and the first 12 hex of the output's sha256;
|
|
115
|
+
`Verified-by: none (<reason>)` for a change that needs no check. They are git trailers, so
|
|
116
|
+
`git log --format='%(trailers:key=Verified-by)'` answers which commits were never verified. Git
|
|
117
|
+
reads trailers from the message's last paragraph only, so paste them beside `Co-Authored-By:`,
|
|
118
|
+
with no blank line between.
|
|
119
|
+
|
|
120
|
+
Stamps and the gate log are JSON lines under `.git/provedone/`, never in the tree. `done` reads
|
|
121
|
+
the stamps of the current branch. The gate's session is `PROVEDONE_SESSION`, else the agent's
|
|
122
|
+
session id (`CLAUDE_CODE_SESSION_ID`, `CLAUDE_SESSION_ID`), else the branch; after two blocks in
|
|
123
|
+
one session the gate lets the next commit through and logs it, so an agent is never stuck.
|
|
124
|
+
|
|
125
|
+
## Migrating
|
|
126
|
+
|
|
127
|
+
The switch is one command, `npx provedone gate` in the `commit-msg` hook, next to commitlint:
|
|
128
|
+
|
|
129
|
+
```diff
|
|
130
|
+
# lefthook.yml
|
|
131
|
+
commit-msg:
|
|
132
|
+
commands:
|
|
133
|
+
commitlint:
|
|
134
|
+
run: npx commitlint --edit {1}
|
|
135
|
+
+ provedone:
|
|
136
|
+
+ run: npx provedone gate {1}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
and the `trailer-exists` rule for `Verified-by:` comes out of `commitlint.config.js`. Start in
|
|
140
|
+
`observe` mode, which passes and logs; add `--mode enforce` once the log shows only real misses.
|
|
141
|
+
|
|
142
|
+
## Compatibility
|
|
143
|
+
|
|
144
|
+
Not graded: provedone reads commit messages, PR bodies and intents, and no suite is graded
|
|
145
|
+
against it. It runs anywhere git does.
|
|
146
|
+
|
|
147
|
+
## Benchmarks
|
|
148
|
+
|
|
149
|
+
Every number here is produced by `npm run bench` and published at [burgee.interlace.tools/docs/benchmarks](https://burgee.interlace.tools/docs/benchmarks).
|
|
150
|
+
|
|
151
|
+
No suite is graded against this package yet, so there is no compatibility number to quote.
|
|
152
|
+
|
|
153
|
+
## For agents
|
|
154
|
+
|
|
155
|
+
- **`provedone stamp --json`**, **`gate --json`** and **`done --json`** print burgee's `--json`
|
|
156
|
+
envelope, every finding with a message that ends in `fix:`.
|
|
157
|
+
- **`--json`, `--schema` and an MCP server** come from one declaration on burgee:
|
|
158
|
+
`provedone --mcp` serves its commands as tools.
|
|
159
|
+
- **Exit codes are the contract.** `0` passed; `1` a check failed, as the table above says; `2` a
|
|
160
|
+
usage error, with the `fix:` to run.
|
|
161
|
+
- **The docs are machine-readable** at
|
|
162
|
+
[burgee.interlace.tools/llms.txt](https://burgee.interlace.tools/llms.txt).
|
|
163
|
+
|
|
164
|
+
## API
|
|
165
|
+
|
|
166
|
+
| Import | What it gives you |
|
|
167
|
+
| :-- | :-- |
|
|
168
|
+
| `provedone` | `trailers()`, `verdict()`, `digest()`, `checkedLine()`, `prBlock()`, `decide()`, `doneReport()`, `checkIntent()` and `program` |
|
|
169
|
+
|
|
170
|
+
The `provedone` bin is that API, declared once on burgee.
|
|
171
|
+
|
|
172
|
+
## Requirements
|
|
173
|
+
|
|
174
|
+
Node 22.13 or later, and git.
|
|
175
|
+
|
|
176
|
+
## Where it sits
|
|
177
|
+
|
|
178
|
+
It hosts no plugin key of its own.
|
|
179
|
+
|
|
180
|
+
Nothing in this family builds on it yet, and it builds on `bellpull` and `burgee`.
|
|
181
|
+
|
|
182
|
+
## The family
|
|
183
|
+
|
|
184
|
+
15 packages, one repository, one release pipeline. Each installs and works on its own, and each owns
|
|
185
|
+
one job. Seven of them — `bellpull`, `closeout`, `linegauge`, `paratext`, `roundel`, `seniority`,
|
|
186
|
+
`truefit` — depend on nothing; the others depend only on packages in this table, and every
|
|
187
|
+
dependency points one way, down the [layers](https://burgee.interlace.tools/docs/concepts/family).
|
|
188
|
+
|
|
189
|
+
No package declares a dependency from outside the family; `react` and `react-reconciler` are
|
|
190
|
+
optional peers of `controlroom`, which npm does not install; `vitest` is an optional peer of
|
|
191
|
+
`oxmutate`, which npm does not install; `eslint` is an optional peer of `truepass`, which npm does
|
|
192
|
+
not install.
|
|
193
|
+
[`package-shape-lock`](https://github.com/ofri-peretz/burgee/blob/main/scripts/package-shape-lock.test.ts)
|
|
194
|
+
holds that for every manifest, and
|
|
195
|
+
[`independence-install-lock`](https://github.com/ofri-peretz/burgee/blob/main/scripts/independence-install-lock.test.ts)
|
|
196
|
+
installs each package alone and finds nothing but the family packages it declares.
|
|
197
|
+
|
|
198
|
+
Releases are published by one workflow through npm trusted publishing: no npm token is used, and
|
|
199
|
+
each release carries SLSA provenance, which `npm view <package> dist.attestations` shows.
|
|
200
|
+
[`trusted-publishing-lock`](https://github.com/ofri-peretz/burgee/blob/main/scripts/trusted-publishing-lock.test.ts)
|
|
201
|
+
keeps both true.
|
|
202
|
+
|
|
203
|
+
| Package | What it is | Migrates from |
|
|
204
|
+
| :-- | :-- | :-- |
|
|
205
|
+
| [burgee](https://burgee.interlace.tools/docs/packages/burgee) | The CLI framework: one declaration, every surface | commander, yargs and meow |
|
|
206
|
+
| [roundel](https://roundel.interlace.tools/docs) | Colour: one output policy, semantic tokens, a theme | chalk, colorette, kleur, picocolors, supports-color and yoctocolors |
|
|
207
|
+
| [flagstaff](https://flagstaff.interlace.tools/docs) | The frame loop: spinners, progress, boxes and tables | ora, log-update, boxen and cli-table3 |
|
|
208
|
+
| [caique](https://caique.interlace.tools/docs) | Prompts that are flags first, and never hang | @inquirer/core |
|
|
209
|
+
| [linegauge](https://linegauge.interlace.tools/docs) | Measuring, wrapping, truncating and slicing styled text | string-width, wrap-ansi, strip-ansi, slice-ansi, cli-truncate and widest-line |
|
|
210
|
+
| [paratext](https://paratext.interlace.tools/docs) | Hyperlinks, images, title, clipboard and notifications | ansi-escapes, terminal-link and term-img |
|
|
211
|
+
| [seniority](https://seniority.interlace.tools/docs) | Configuration precedence and discovery, with provenance | cosmiconfig, lilconfig, dotenv and rc |
|
|
212
|
+
| [closeout](https://closeout.interlace.tools/docs) | Exit handlers, terminal restore and a bounded shutdown | signal-exit, exit-hook, restore-cursor, cli-cursor and onetime |
|
|
213
|
+
| [bellpull](https://bellpull.interlace.tools/docs) | Subprocesses, and which executable actually ran | cross-spawn and which |
|
|
214
|
+
| [controlroom](https://controlroom.interlace.tools/docs) | Keyboard-driven terminal screens, inline or full-screen | ink |
|
|
215
|
+
| [oxmutate](https://oxmutate.interlace.tools/docs) | Mutation testing on the oxc engine, inside your own Vitest | Stryker |
|
|
216
|
+
| [truepass](https://burgee.interlace.tools/docs/packages/truepass) | Lint rules and a pre-push check that keep a test suite honest | @vitest/eslint-plugin |
|
|
217
|
+
| [contractdiff](https://burgee.interlace.tools/docs/packages/contractdiff) | API contracts: breaking-change diff, lint, and code from the spec | openapi-typescript |
|
|
218
|
+
| [truefit](https://burgee.interlace.tools/docs/packages/truefit) | Validation whose schemas are data, with no eval | zod |
|
|
219
|
+
| **provedone** (this package) | A receipt for how every change was verified, and a gate that reads it | @commitlint/cli |
|
|
220
|
+
|
|
221
|
+
Every migration guide, and the family-wide [compatibility](https://burgee.interlace.tools/docs/compatibility)
|
|
222
|
+
and [benchmarks](https://burgee.interlace.tools/docs/benchmarks) pages, are on
|
|
223
|
+
[burgee.interlace.tools](https://burgee.interlace.tools/docs/packages).
|
|
224
|
+
|
|
225
|
+
## Contributing
|
|
226
|
+
|
|
227
|
+
Issues and pull requests are welcome at [ofri-peretz/burgee](https://github.com/ofri-peretz/burgee/issues); read
|
|
228
|
+
[CONTRIBUTING.md](https://github.com/ofri-peretz/burgee/blob/main/CONTRIBUTING.md) first. Report a vulnerability privately, as
|
|
229
|
+
[SECURITY.md](https://github.com/ofri-peretz/burgee/blob/main/SECURITY.md) describes — never in a public issue.
|
|
230
|
+
|
|
231
|
+
## Licence
|
|
232
|
+
|
|
233
|
+
MIT © Ofri Peretz — see [LICENSE](https://github.com/ofri-peretz/burgee/blob/main/packages/provedone/LICENSE).
|
package/dist/bin.js
ADDED
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { join, resolve } from 'node:path';
|
|
3
|
+
import { defineCommand, defineProgram, UsageError } from 'burgee';
|
|
4
|
+
import { doneLine, doneReport } from './done.js';
|
|
5
|
+
import { decide, MODES, sessionOf } from './gate.js';
|
|
6
|
+
import { checkIntent, criteria, evidenceRows, expectedExit, fillTemplate, indexDrift, missingOutput, SLUG, statusOf, unevidenced } from './intents.js';
|
|
7
|
+
import { checkedLine, digest, prBlock, trailers, verdict } from './receipt.js';
|
|
8
|
+
import { appendLines, branchOf, gitUser, readLines, runnable, runShell, storeDir } from './store.js';
|
|
9
|
+
export const VERSION = JSON.parse(readFileSync(new URL('../package.json', import.meta.url), 'utf8')).version;
|
|
10
|
+
const TEXT = Symbol.for('burgee.text');
|
|
11
|
+
const withText = (data, text) => Object.assign(data, { [TEXT]: () => text });
|
|
12
|
+
class Refusal extends UsageError {
|
|
13
|
+
fix;
|
|
14
|
+
constructor(message, fix) {
|
|
15
|
+
super(message);
|
|
16
|
+
this.fix = fix;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
class Failure extends Error {
|
|
20
|
+
constructor(message, fix) {
|
|
21
|
+
super(`${message}. fix: ${fix}`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const root = {
|
|
25
|
+
type: 'string',
|
|
26
|
+
description: 'the repository to read (default: the current directory)',
|
|
27
|
+
};
|
|
28
|
+
const dir = {
|
|
29
|
+
type: 'string',
|
|
30
|
+
description: 'the intents directory, from the root (default .sdlc/intents)',
|
|
31
|
+
};
|
|
32
|
+
const commandTimeout = {
|
|
33
|
+
type: 'number',
|
|
34
|
+
description: 'seconds each command may run (default 600)',
|
|
35
|
+
};
|
|
36
|
+
const DEFAULT_TIMEOUT_S = 600;
|
|
37
|
+
const MS_PER_S = 1000;
|
|
38
|
+
const ISO_DATE = 10;
|
|
39
|
+
const rootOf = (options) => resolve(options.root ?? '');
|
|
40
|
+
const intentsOf = (top, options) => join(top, options.dir ?? '.sdlc/intents');
|
|
41
|
+
const timeoutOf = (options) => (options.commandTimeout ?? DEFAULT_TIMEOUT_S) * MS_PER_S;
|
|
42
|
+
const read = (file) => (existsSync(file) ? readFileSync(file, 'utf8') : undefined);
|
|
43
|
+
const kebab = (text) => text
|
|
44
|
+
.toLowerCase()
|
|
45
|
+
.replace(/[^a-z\d]+/gu, '-')
|
|
46
|
+
.replace(/^-|-$/gu, '');
|
|
47
|
+
const STAMPS = 'stamps.jsonl';
|
|
48
|
+
const GATE_LOG = 'gate.jsonl';
|
|
49
|
+
const newCommand = defineCommand({
|
|
50
|
+
name: 'new',
|
|
51
|
+
description: "Write an intent and its spec from the repository's templates",
|
|
52
|
+
arguments: [{ name: 'slug', description: 'the intent, in kebab case', required: true }],
|
|
53
|
+
options: {
|
|
54
|
+
root,
|
|
55
|
+
dir,
|
|
56
|
+
owner: {
|
|
57
|
+
type: 'string',
|
|
58
|
+
description: 'the owner handle (default: git config user.name)',
|
|
59
|
+
},
|
|
60
|
+
date: {
|
|
61
|
+
type: 'string',
|
|
62
|
+
description: 'the opened date (default: today, UTC)',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
effects: 'non_idempotent',
|
|
66
|
+
examples: [
|
|
67
|
+
{
|
|
68
|
+
command: 'provedone intent new faster-help --owner @me',
|
|
69
|
+
description: 'intent.md and spec.md, from _template/',
|
|
70
|
+
},
|
|
71
|
+
],
|
|
72
|
+
run: async ({ args, options }) => {
|
|
73
|
+
if (!SLUG.test(args.slug))
|
|
74
|
+
throw new Refusal(`"${args.slug}" is not a slug`, `provedone intent new ${kebab(args.slug)}`);
|
|
75
|
+
const top = rootOf(options);
|
|
76
|
+
const intents = intentsOf(top, options);
|
|
77
|
+
const target = join(intents, args.slug);
|
|
78
|
+
if (existsSync(target))
|
|
79
|
+
throw new Failure(`${target} already exists`, `edit ${join(target, 'intent.md')}, or pick another slug`);
|
|
80
|
+
const templates = ['intent.md', 'spec.md'].map((name) => [name, read(join(intents, '_template', name))]);
|
|
81
|
+
const missing = templates.find(([, text]) => text === undefined);
|
|
82
|
+
if (missing !== undefined)
|
|
83
|
+
throw new Failure(`no template ${join(intents, '_template', missing[0])}`, `add _template/${missing[0]} under ${intents}`);
|
|
84
|
+
const date = options.date ?? new Date().toISOString().slice(0, ISO_DATE);
|
|
85
|
+
const owner = options.owner ?? (await gitUser(top)) ?? 'owner';
|
|
86
|
+
mkdirSync(target, { recursive: true });
|
|
87
|
+
const written = templates.map(([name, text]) => {
|
|
88
|
+
writeFileSync(join(target, name), fillTemplate(text, date, owner));
|
|
89
|
+
return join(target, name);
|
|
90
|
+
});
|
|
91
|
+
return withText({ changed: true, written }, written.join('\n'));
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
const rerunEvidence = async (texts, top, timeoutMs) => {
|
|
95
|
+
const evidence = { reruns: [], notRerun: [] };
|
|
96
|
+
for (const [slug, text] of texts) {
|
|
97
|
+
if (statusOf(text) !== 'shipped')
|
|
98
|
+
continue;
|
|
99
|
+
for (const row of evidenceRows(text)) {
|
|
100
|
+
if (row.command === undefined || !runnable(row.command, top))
|
|
101
|
+
evidence.notRerun.push({ intent: slug, criterion: row.criterion });
|
|
102
|
+
else {
|
|
103
|
+
const ran = await runShell(row.command, top, timeoutMs);
|
|
104
|
+
evidence.reruns.push({
|
|
105
|
+
intent: slug,
|
|
106
|
+
criterion: row.criterion,
|
|
107
|
+
command: row.command,
|
|
108
|
+
exit: ran.exit,
|
|
109
|
+
expected: expectedExit(row.output),
|
|
110
|
+
missing: missingOutput(row.output, ran.output),
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
return evidence;
|
|
116
|
+
};
|
|
117
|
+
const staleLine = (r) => `${r.intent}: \`${r.command}\` ${r.exit === r.expected ? `no longer prints ${r.missing.map((m) => `\`${m}\``).join(', ')}` : `exits ${String(r.exit)}, recorded ${String(r.expected)}`}. fix: re-run it and update the evidence row, or restore what it proved`;
|
|
118
|
+
const checkCommand = defineCommand({
|
|
119
|
+
name: 'check',
|
|
120
|
+
description: "Check every intent against the rules; with --evidence, re-run each shipped intent's evidence commands",
|
|
121
|
+
options: {
|
|
122
|
+
root,
|
|
123
|
+
dir,
|
|
124
|
+
evidence: {
|
|
125
|
+
type: 'boolean',
|
|
126
|
+
description: 're-run every evidence row whose command is one plain shell command',
|
|
127
|
+
},
|
|
128
|
+
commandTimeout,
|
|
129
|
+
},
|
|
130
|
+
effects: 'read_only',
|
|
131
|
+
examples: [
|
|
132
|
+
{
|
|
133
|
+
command: 'provedone intent check',
|
|
134
|
+
description: 'one line per broken rule, each with a fix',
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
command: 'provedone intent check --evidence --json',
|
|
138
|
+
description: 'the re-runs too, and every row that could not be re-run',
|
|
139
|
+
},
|
|
140
|
+
],
|
|
141
|
+
run: async ({ options }) => {
|
|
142
|
+
const top = rootOf(options);
|
|
143
|
+
const intents = intentsOf(top, options);
|
|
144
|
+
if (!existsSync(intents))
|
|
145
|
+
throw new Failure(`no intents directory at ${intents}`, 'run `provedone intent new <slug>` after adding _template/, or pass --dir');
|
|
146
|
+
const slugs = readdirSync(intents, { withFileTypes: true })
|
|
147
|
+
.filter((e) => e.isDirectory() && e.name !== '_template')
|
|
148
|
+
.map((e) => e.name)
|
|
149
|
+
.sort();
|
|
150
|
+
const texts = new Map(slugs.map((slug) => [slug, read(join(intents, slug, 'intent.md')) ?? '']));
|
|
151
|
+
const findings = [
|
|
152
|
+
...slugs.flatMap((slug) => checkIntent(slug, texts.get(slug), read(join(intents, slug, 'spec.md')))),
|
|
153
|
+
...indexDrift(read(join(intents, 'README.md')) ?? '', new Map(slugs.map((slug) => [slug, statusOf(texts.get(slug))]))),
|
|
154
|
+
];
|
|
155
|
+
const noEvidence = slugs.filter((slug) => unevidenced(texts.get(slug)));
|
|
156
|
+
const asked = options.evidence === true;
|
|
157
|
+
const { reruns, notRerun } = asked ? await rerunEvidence(texts, top, timeoutOf(options)) : { reruns: [], notRerun: [] };
|
|
158
|
+
const stale = reruns.filter((r) => r.exit !== r.expected || r.missing.length > 0);
|
|
159
|
+
const problems = findings.length + stale.length;
|
|
160
|
+
const lines = [
|
|
161
|
+
...findings.map((f) => `${f.intent}: ${f.message}. fix: ${f.fix}`),
|
|
162
|
+
...stale.map(staleLine),
|
|
163
|
+
`${String(slugs.length)} intents, ${String(problems)} problems, ${String(noEvidence.length)} shipped with no evidence${asked ? `, ${String(reruns.length)} re-run, ${String(notRerun.length)} not re-run` : ''}`,
|
|
164
|
+
];
|
|
165
|
+
return withText({
|
|
166
|
+
exitCode: problems > 0 ? 1 : 0,
|
|
167
|
+
intents: slugs.length,
|
|
168
|
+
findings,
|
|
169
|
+
noEvidence,
|
|
170
|
+
reruns,
|
|
171
|
+
notRerun,
|
|
172
|
+
}, lines.join('\n'));
|
|
173
|
+
},
|
|
174
|
+
});
|
|
175
|
+
const intentCommand = defineCommand({
|
|
176
|
+
name: 'intent',
|
|
177
|
+
description: 'Write intents, and check them and their evidence',
|
|
178
|
+
commands: [newCommand, checkCommand],
|
|
179
|
+
});
|
|
180
|
+
const refuseStamp = (options) => {
|
|
181
|
+
const runs = options.run ?? [];
|
|
182
|
+
if (options.none === undefined && runs.length === 0)
|
|
183
|
+
throw new Refusal('nothing to stamp', 'provedone stamp --run "<command>" --not-checked "<gap>", or provedone stamp --none "<reason>"');
|
|
184
|
+
if (options.none !== undefined && runs.length > 0)
|
|
185
|
+
throw new Refusal('--none and --run together', 'drop --none: the commands are the receipt');
|
|
186
|
+
if (options.none === undefined && (options.notChecked ?? []).length === 0)
|
|
187
|
+
throw new Refusal('no --not-checked', 'add --not-checked "<what you did not check>", or --not-checked nothing');
|
|
188
|
+
if ((options.criterion === undefined) !== (options.intent === undefined))
|
|
189
|
+
throw new Refusal('--intent and --criterion go together', 'pass both, or neither');
|
|
190
|
+
};
|
|
191
|
+
const stampCommand = defineCommand({
|
|
192
|
+
name: 'stamp',
|
|
193
|
+
description: 'Run the commands that prove a change and print its receipt: Verified-by: trailers, or the PR block with --pr',
|
|
194
|
+
options: {
|
|
195
|
+
run: {
|
|
196
|
+
type: 'string',
|
|
197
|
+
multiple: true,
|
|
198
|
+
separator: false,
|
|
199
|
+
description: 'a command that proves the change; run here, its exit code and output digest recorded',
|
|
200
|
+
},
|
|
201
|
+
capture: {
|
|
202
|
+
type: 'string',
|
|
203
|
+
multiple: true,
|
|
204
|
+
description: 'a screenshot or terminal capture of the running app, by path',
|
|
205
|
+
},
|
|
206
|
+
notChecked: {
|
|
207
|
+
type: 'string',
|
|
208
|
+
multiple: true,
|
|
209
|
+
separator: false,
|
|
210
|
+
description: 'what was not checked; required, "nothing" when nothing',
|
|
211
|
+
},
|
|
212
|
+
none: {
|
|
213
|
+
type: 'string',
|
|
214
|
+
description: 'stamp the change unverified, and say why',
|
|
215
|
+
},
|
|
216
|
+
intent: {
|
|
217
|
+
type: 'string',
|
|
218
|
+
description: 'the intent this proves, for `provedone done`',
|
|
219
|
+
},
|
|
220
|
+
criterion: {
|
|
221
|
+
type: 'number',
|
|
222
|
+
description: 'the success criterion of --intent this proves, from 1',
|
|
223
|
+
},
|
|
224
|
+
pr: {
|
|
225
|
+
type: 'boolean',
|
|
226
|
+
description: 'print the PR "How this was checked" block instead of the trailers',
|
|
227
|
+
},
|
|
228
|
+
root,
|
|
229
|
+
commandTimeout,
|
|
230
|
+
},
|
|
231
|
+
effects: 'non_idempotent',
|
|
232
|
+
examples: [
|
|
233
|
+
{
|
|
234
|
+
command: 'provedone stamp --run "npm test" --not-checked "the docs site"',
|
|
235
|
+
description: 'two trailers to paste into the commit message',
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
command: 'provedone stamp --none "comment-only change"',
|
|
239
|
+
description: 'Verified-by: none, with its reason',
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
command: 'provedone stamp --intent faster-help --criterion 2 --run "npm run bench" --not-checked nothing --pr',
|
|
243
|
+
description: 'evidence for criterion 2, as a PR block',
|
|
244
|
+
},
|
|
245
|
+
],
|
|
246
|
+
run: async ({ options }) => {
|
|
247
|
+
refuseStamp(options);
|
|
248
|
+
const top = rootOf(options);
|
|
249
|
+
const branch = await branchOf(top);
|
|
250
|
+
const at = new Date().toISOString();
|
|
251
|
+
const checks = [];
|
|
252
|
+
for (const command of options.run ?? []) {
|
|
253
|
+
const ran = await runShell(command, top, timeoutOf(options));
|
|
254
|
+
checks.push({ command, exit: ran.exit, digest: digest(ran.output) });
|
|
255
|
+
}
|
|
256
|
+
const notChecked = (options.notChecked ?? []).filter((gap) => gap !== 'nothing');
|
|
257
|
+
const receipt = {
|
|
258
|
+
checks,
|
|
259
|
+
captures: options.capture ?? [],
|
|
260
|
+
notChecked,
|
|
261
|
+
...(options.none === undefined ? {} : { none: options.none }),
|
|
262
|
+
};
|
|
263
|
+
const cited = options.intent === undefined ? {} : { intent: options.intent, criterion: options.criterion };
|
|
264
|
+
appendLines(join(await storeDir(top), STAMPS), checks.map((c) => ({ branch, at, ...c, ...cited })));
|
|
265
|
+
const failed = checks.filter((c) => c.exit !== 0);
|
|
266
|
+
const text = options.pr === true ? prBlock(receipt) : trailers(receipt).join('\n');
|
|
267
|
+
const warning = failed.length > 0 ? `\nerror: ${failed.map((c) => `\`${c.command}\` exited ${String(c.exit)}`).join(', ')}\nfix: make it pass and stamp again; a failing command is not a receipt` : '';
|
|
268
|
+
return withText({
|
|
269
|
+
exitCode: failed.length > 0 ? 1 : 0,
|
|
270
|
+
changed: true,
|
|
271
|
+
receipt,
|
|
272
|
+
trailers: trailers(receipt),
|
|
273
|
+
checked: checkedLine(receipt),
|
|
274
|
+
pr: prBlock(receipt),
|
|
275
|
+
}, `${text}${warning}`);
|
|
276
|
+
},
|
|
277
|
+
});
|
|
278
|
+
const gateText = (v, decision, mode) => {
|
|
279
|
+
if (v.ok)
|
|
280
|
+
return `provedone: ${v.reason}`;
|
|
281
|
+
if (decision.bypass)
|
|
282
|
+
return `provedone: ${v.reason}; passed after two blocks in this session, logged. fix: ${String(v.fix)}`;
|
|
283
|
+
return `provedone${mode === 'observe' ? ' (observe, not blocking)' : ''}: ${v.reason}. fix: ${String(v.fix)}`;
|
|
284
|
+
};
|
|
285
|
+
const modeOf = (asked, env) => {
|
|
286
|
+
const fromEnv = env['PROVEDONE_MODE'];
|
|
287
|
+
return asked ?? (MODES.includes(fromEnv) ? fromEnv : 'observe');
|
|
288
|
+
};
|
|
289
|
+
const gateCommand = defineCommand({
|
|
290
|
+
name: 'gate',
|
|
291
|
+
description: 'Pass or block a commit message or PR body on its receipt: off, observe (log only) or enforce',
|
|
292
|
+
arguments: [
|
|
293
|
+
{
|
|
294
|
+
name: 'file',
|
|
295
|
+
description: 'the commit message or PR body; lefthook passes {1}',
|
|
296
|
+
required: true,
|
|
297
|
+
},
|
|
298
|
+
],
|
|
299
|
+
options: {
|
|
300
|
+
mode: {
|
|
301
|
+
type: 'string',
|
|
302
|
+
choices: MODES,
|
|
303
|
+
description: 'off, observe or enforce (default: PROVEDONE_MODE, else observe)',
|
|
304
|
+
},
|
|
305
|
+
root,
|
|
306
|
+
},
|
|
307
|
+
effects: 'non_idempotent',
|
|
308
|
+
examples: [
|
|
309
|
+
{
|
|
310
|
+
command: 'provedone gate .git/COMMIT_EDITMSG',
|
|
311
|
+
description: 'observe: always passes, logs what enforce would block',
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
command: 'provedone gate pr-body.md --mode enforce',
|
|
315
|
+
description: 'blocks a PR body with no receipt',
|
|
316
|
+
},
|
|
317
|
+
],
|
|
318
|
+
run: async ({ args, options, env }) => {
|
|
319
|
+
const mode = modeOf(options.mode, env);
|
|
320
|
+
if (mode === 'off')
|
|
321
|
+
return withText({ mode, ok: true, blocked: false, bypass: false }, 'provedone: off');
|
|
322
|
+
const message = read(resolve(args.file));
|
|
323
|
+
if (message === undefined)
|
|
324
|
+
throw new Refusal(`no file ${args.file}`, 'pass the commit message file, as lefthook does with {1}');
|
|
325
|
+
const top = rootOf(options);
|
|
326
|
+
const v = verdict(message);
|
|
327
|
+
const logFile = join(await storeDir(top), GATE_LOG);
|
|
328
|
+
const session = sessionOf(env, await branchOf(top));
|
|
329
|
+
const decision = decide(mode, v, readLines(logFile), session);
|
|
330
|
+
appendLines(logFile, [
|
|
331
|
+
{
|
|
332
|
+
at: new Date().toISOString(),
|
|
333
|
+
session,
|
|
334
|
+
mode,
|
|
335
|
+
ok: v.ok,
|
|
336
|
+
...decision,
|
|
337
|
+
reason: v.reason,
|
|
338
|
+
},
|
|
339
|
+
]);
|
|
340
|
+
return withText({ exitCode: decision.blocked ? 1 : 0, mode, ...v, ...decision }, gateText(v, decision, mode));
|
|
341
|
+
},
|
|
342
|
+
});
|
|
343
|
+
const doneCommand = defineCommand({
|
|
344
|
+
name: 'done',
|
|
345
|
+
description: "Fail unless every success criterion of an intent has a passing command stamped on this branch; print the PR's Checked: line",
|
|
346
|
+
arguments: [{ name: 'slug', description: 'the intent the PR cites', required: true }],
|
|
347
|
+
options: { root, dir },
|
|
348
|
+
effects: 'read_only',
|
|
349
|
+
examples: [
|
|
350
|
+
{
|
|
351
|
+
command: 'provedone done faster-help',
|
|
352
|
+
description: 'the Checked: line, or one fix per criterion with no evidence',
|
|
353
|
+
},
|
|
354
|
+
],
|
|
355
|
+
run: async ({ args, options }) => {
|
|
356
|
+
const top = rootOf(options);
|
|
357
|
+
const intent = read(join(intentsOf(top, options), args.slug, 'intent.md'));
|
|
358
|
+
if (intent === undefined)
|
|
359
|
+
throw new Failure(`no intent ${args.slug}`, `provedone intent new ${args.slug}`);
|
|
360
|
+
const list = criteria(intent);
|
|
361
|
+
if (list.length === 0)
|
|
362
|
+
throw new Failure(`${args.slug} lists no success criteria`, 'add `- ` items under its `## Success criteria`');
|
|
363
|
+
const report = doneReport({
|
|
364
|
+
slug: args.slug,
|
|
365
|
+
criteria: list,
|
|
366
|
+
rows: evidenceRows(intent),
|
|
367
|
+
stamps: readLines(join(await storeDir(top), STAMPS)),
|
|
368
|
+
branch: await branchOf(top),
|
|
369
|
+
});
|
|
370
|
+
const open = report.filter((r) => r.fix !== undefined);
|
|
371
|
+
const line = doneLine(report);
|
|
372
|
+
return withText({
|
|
373
|
+
exitCode: open.length > 0 ? 1 : 0,
|
|
374
|
+
intent: args.slug,
|
|
375
|
+
criteria: report,
|
|
376
|
+
checked: line,
|
|
377
|
+
}, [line, ...open.map((r) => `C${String(r.n)} has no evidence. fix: ${String(r.fix)}`)].join('\n'));
|
|
378
|
+
},
|
|
379
|
+
});
|
|
380
|
+
export const program = defineProgram({
|
|
381
|
+
name: 'provedone',
|
|
382
|
+
version: VERSION,
|
|
383
|
+
description: 'Every change says how it was verified, and a gate reads it',
|
|
384
|
+
commands: [stampCommand, gateCommand, doneCommand, intentCommand],
|
|
385
|
+
});
|
package/dist/done.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The "done" check (spec R9): every success criterion of the intent a PR cites has a passing
|
|
3
|
+
* command recorded on this branch. Pure: the caller hands it the criteria, the evidence table and
|
|
4
|
+
* the branch's stamps.
|
|
5
|
+
*/
|
|
6
|
+
import { type EvidenceRow } from './intents.js';
|
|
7
|
+
/** One stamped command, as the store keeps it. */
|
|
8
|
+
export interface Stamp {
|
|
9
|
+
readonly branch: string;
|
|
10
|
+
readonly at: string;
|
|
11
|
+
readonly command: string;
|
|
12
|
+
readonly exit: number;
|
|
13
|
+
readonly digest: string;
|
|
14
|
+
readonly intent?: string;
|
|
15
|
+
readonly criterion?: number;
|
|
16
|
+
}
|
|
17
|
+
export interface CriterionReport {
|
|
18
|
+
readonly n: number;
|
|
19
|
+
readonly criterion: string;
|
|
20
|
+
readonly commands: readonly string[];
|
|
21
|
+
readonly fix?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface DoneInput {
|
|
24
|
+
readonly slug: string;
|
|
25
|
+
readonly criteria: readonly string[];
|
|
26
|
+
readonly rows: readonly EvidenceRow[];
|
|
27
|
+
readonly stamps: readonly Stamp[];
|
|
28
|
+
readonly branch: string;
|
|
29
|
+
}
|
|
30
|
+
export declare const doneReport: ({ slug, criteria, rows, stamps, branch }: DoneInput) => CriterionReport[];
|
|
31
|
+
/** The `Checked:` line of a done report: each criterion met and by what, then each one not. */
|
|
32
|
+
export declare const doneLine: (report: readonly CriterionReport[]) => string;
|
package/dist/done.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const rowFor = (rows, n) => (rows.some((row) => /^C\d+\./u.test(row.criterion)) ? rows.find((row) => row.criterion.startsWith(`C${String(n)}.`)) : rows[n - 1]);
|
|
2
|
+
export const doneReport = ({ slug, criteria, rows, stamps, branch }) => criteria.map((criterion, i) => {
|
|
3
|
+
const n = i + 1;
|
|
4
|
+
const commands = stamps.filter((s) => s.branch === branch && s.intent === slug && s.criterion === n && s.exit === 0).map((s) => s.command);
|
|
5
|
+
if (commands.length > 0)
|
|
6
|
+
return { n, criterion, commands };
|
|
7
|
+
const command = rowFor(rows, n)?.command ?? '<the command that proves it>';
|
|
8
|
+
return {
|
|
9
|
+
n,
|
|
10
|
+
criterion,
|
|
11
|
+
commands,
|
|
12
|
+
fix: `provedone stamp --intent ${slug} --criterion ${String(n)} --run "${command}" --not-checked "<what you did not check>"`,
|
|
13
|
+
};
|
|
14
|
+
});
|
|
15
|
+
export const doneLine = (report) => {
|
|
16
|
+
const met = report.filter((r) => r.fix === undefined);
|
|
17
|
+
const open = report.filter((r) => r.fix !== undefined);
|
|
18
|
+
const metText = met.length > 0 ? met.map((r) => `C${String(r.n)} by ${r.commands.map((c) => `\`${c}\``).join(', ')}`).join('; ') : 'no criterion';
|
|
19
|
+
return `Checked: ${metText}. Not checked: ${open.length > 0 ? open.map((r) => `C${String(r.n)}`).join(', ') : 'nothing'}.`;
|
|
20
|
+
};
|
package/dist/gate.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The gate's decision (spec R5, R6), apart from where the message and the log come from.
|
|
3
|
+
*/
|
|
4
|
+
import { type Verdict } from './receipt.js';
|
|
5
|
+
export declare const MODES: readonly ["off", "observe", "enforce"];
|
|
6
|
+
export type Mode = (typeof MODES)[number];
|
|
7
|
+
/** Blocks in one session after which the next run passes, logged. */
|
|
8
|
+
export declare const ESCAPE_AFTER = 2;
|
|
9
|
+
export interface LogEntry {
|
|
10
|
+
readonly at: string;
|
|
11
|
+
readonly session: string;
|
|
12
|
+
readonly mode: Mode;
|
|
13
|
+
readonly ok: boolean;
|
|
14
|
+
readonly blocked: boolean;
|
|
15
|
+
readonly bypass: boolean;
|
|
16
|
+
readonly reason: string;
|
|
17
|
+
}
|
|
18
|
+
export interface Decision {
|
|
19
|
+
readonly blocked: boolean;
|
|
20
|
+
readonly bypass: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** The blocks in `session` since its last run that was not blocked. */
|
|
23
|
+
export declare const recentBlocks: (log: readonly LogEntry[], session: string) => number;
|
|
24
|
+
export declare const decide: (mode: Mode, verdict: Verdict, log: readonly LogEntry[], session: string) => Decision;
|
|
25
|
+
/** The session a block counts against: the agent's session id when the environment names one, else the branch. */
|
|
26
|
+
export declare const sessionOf: (env: Readonly<Record<string, string | undefined>>, branch: string) => string;
|
package/dist/gate.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const MODES = ['off', 'observe', 'enforce'];
|
|
2
|
+
export const ESCAPE_AFTER = 2;
|
|
3
|
+
export const recentBlocks = (log, session) => {
|
|
4
|
+
const mine = log.filter((entry) => entry.session === session);
|
|
5
|
+
const last = mine.findLastIndex((entry) => !entry.blocked);
|
|
6
|
+
return mine.length - last - 1;
|
|
7
|
+
};
|
|
8
|
+
export const decide = (mode, verdict, log, session) => {
|
|
9
|
+
if (mode !== 'enforce' || verdict.ok)
|
|
10
|
+
return { blocked: false, bypass: false };
|
|
11
|
+
const bypass = recentBlocks(log, session) >= ESCAPE_AFTER;
|
|
12
|
+
return { blocked: !bypass, bypass };
|
|
13
|
+
};
|
|
14
|
+
export const sessionOf = (env, branch) => env['PROVEDONE_SESSION'] ?? env['CLAUDE_CODE_SESSION_ID'] ?? env['CLAUDE_SESSION_ID'] ?? `branch:${branch}`;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** provedone's library surface: the pure pieces its commands are built from, for a host that runs them itself. */
|
|
2
|
+
export { program, VERSION } from './cli.js';
|
|
3
|
+
export { decide, ESCAPE_AFTER, MODES, recentBlocks, sessionOf, type Decision, type LogEntry, type Mode } from './gate.js';
|
|
4
|
+
export { doneLine, doneReport, type CriterionReport, type Stamp } from './done.js';
|
|
5
|
+
export { checkIntent, criteria, evidenceRows, indexDrift, unevidenced, type EvidenceRow, type Finding } from './intents.js';
|
|
6
|
+
export { checkedLine, digest, prBlock, trailers, verdict, type Check, type Receipt, type Verdict } from './receipt.js';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { program, VERSION } from './cli.js';
|
|
2
|
+
export { decide, ESCAPE_AFTER, MODES, recentBlocks, sessionOf } from './gate.js';
|
|
3
|
+
export { doneLine, doneReport } from './done.js';
|
|
4
|
+
export { checkIntent, criteria, evidenceRows, indexDrift, unevidenced } from './intents.js';
|
|
5
|
+
export { checkedLine, digest, prBlock, trailers, verdict } from './receipt.js';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare const STATUSES: readonly ["draft", "review", "approved", "shipped", "dropped"];
|
|
2
|
+
export declare const INTENT_SECTIONS: readonly ["## What is wanted", "## Why now", "## Constraints"];
|
|
3
|
+
export declare const SUCCESS_HEADINGS: readonly ["Success criteria", "How we will know it worked"];
|
|
4
|
+
export declare const REJECTION: RegExp;
|
|
5
|
+
/** Where a shipped intent records how it was checked: a heading, or an evidence table. */
|
|
6
|
+
export declare const EVIDENCE: RegExp;
|
|
7
|
+
export interface Finding {
|
|
8
|
+
readonly intent: string;
|
|
9
|
+
readonly rule: string;
|
|
10
|
+
readonly message: string;
|
|
11
|
+
readonly fix: string;
|
|
12
|
+
}
|
|
13
|
+
/** The status an intent's header declares, or undefined. */
|
|
14
|
+
export declare const statusOf: (intent: string) => string | undefined;
|
|
15
|
+
/** Every finding for one intent: its `intent.md` text and, when it has one, its `spec.md` text. */
|
|
16
|
+
export declare const checkIntent: (slug: string, intent: string, spec: string | undefined) => Finding[];
|
|
17
|
+
/** True when a shipped intent records no evidence: no `## Shipped`, no `## Restated`, no evidence table. */
|
|
18
|
+
export declare const unevidenced: (intent: string) => boolean;
|
|
19
|
+
/** One finding per index row of `readme` whose status cell disagrees with the intent's own header. */
|
|
20
|
+
export declare const indexDrift: (readme: string, statuses: ReadonlyMap<string, string | undefined>) => Finding[];
|
|
21
|
+
/** The success criteria of an intent, in order, numbered from 1. */
|
|
22
|
+
export declare const criteria: (intent: string) => string[];
|
|
23
|
+
export interface EvidenceRow {
|
|
24
|
+
readonly criterion: string;
|
|
25
|
+
readonly command: string | undefined;
|
|
26
|
+
readonly output: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Each row of an evidence table (`| Criterion | Command… | Output |`). `command` is set only when
|
|
30
|
+
* the cell is one code span and nothing else: a plain shell command (spec R3). Anything with prose
|
|
31
|
+
* around it is a description of what ran, which cannot be re-run, and says so as `undefined`.
|
|
32
|
+
*/
|
|
33
|
+
export declare const evidenceRows: (intent: string) => EvidenceRow[];
|
|
34
|
+
/** The exit code an output cell records (`exit 2`), else 0. */
|
|
35
|
+
export declare const expectedExit: (output: string) => number;
|
|
36
|
+
/** The code spans of an output cell that the re-run's output no longer contains. */
|
|
37
|
+
export declare const missingOutput: (output: string, actual: string) => string[];
|
|
38
|
+
/** The `<YYYY-MM-DD>` and `<handle>` of a template, filled. */
|
|
39
|
+
export declare const fillTemplate: (template: string, date: string, owner: string) => string;
|
|
40
|
+
/** A slug `intent new` accepts: lowercase words joined by `-`. */
|
|
41
|
+
export declare const SLUG: RegExp;
|
package/dist/intents.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { codeSpans, items, section, tableRows } from './markdown.js';
|
|
2
|
+
export const STATUSES = ['draft', 'review', 'approved', 'shipped', 'dropped'];
|
|
3
|
+
export const INTENT_SECTIONS = ['## What is wanted', '## Why now', '## Constraints'];
|
|
4
|
+
export const SUCCESS_HEADINGS = ['Success criteria', 'How we will know it worked'];
|
|
5
|
+
export const REJECTION = /^## (Rejected\b|Explicit non-goals|Non-goals|Out of scope|Risks and rejected)/mu;
|
|
6
|
+
export const EVIDENCE = /^## (Shipped|Restated)\b|^\| *Criterion *\|/mu;
|
|
7
|
+
export const statusOf = (intent) => /^\*\*Status:\*\*\s*([a-z]+)/mu.exec(intent)?.[1];
|
|
8
|
+
export const checkIntent = (slug, intent, spec) => {
|
|
9
|
+
const found = [];
|
|
10
|
+
const add = (rule, message, fix) => {
|
|
11
|
+
found.push({ intent: slug, rule, message, fix });
|
|
12
|
+
};
|
|
13
|
+
if (!/^# Intent — \S/mu.test(intent))
|
|
14
|
+
add('title', 'no `# Intent — <title>` line', 'make the first line `# Intent — <short title>`');
|
|
15
|
+
const status = statusOf(intent);
|
|
16
|
+
if (!STATUSES.includes(status)) {
|
|
17
|
+
add('status', `unknown or missing status "${String(status)}"`, `write \`**Status:** <${STATUSES.join('|')}>\` under the title`);
|
|
18
|
+
}
|
|
19
|
+
for (const heading of INTENT_SECTIONS)
|
|
20
|
+
if (!intent.includes(heading))
|
|
21
|
+
add('section', `lacks ${heading}`, `add a \`${heading}\` section`);
|
|
22
|
+
if (section(intent, SUCCESS_HEADINGS) === undefined)
|
|
23
|
+
add('success', 'no `## Success criteria`', 'add `## Success criteria`: each line checkable by a person or a command');
|
|
24
|
+
if ((status === 'approved' || status === 'shipped') && spec === undefined) {
|
|
25
|
+
add('spec', `is "${String(status)}" but has no spec.md`, `write .sdlc/intents/${slug}/spec.md, or set the status back to review`);
|
|
26
|
+
}
|
|
27
|
+
if (spec !== undefined && !REJECTION.test(spec))
|
|
28
|
+
add('rejected', 'spec.md records nothing rejected', 'add `## Rejected alternatives` or `## Out of scope` to spec.md');
|
|
29
|
+
return found;
|
|
30
|
+
};
|
|
31
|
+
export const unevidenced = (intent) => statusOf(intent) === 'shipped' && !EVIDENCE.test(intent);
|
|
32
|
+
export const indexDrift = (readme, statuses) => [...statuses].flatMap(([slug, real]) => readme
|
|
33
|
+
.split('\n')
|
|
34
|
+
.filter((line) => line.startsWith('|') && line.includes(`[\`${slug}/\`]`))
|
|
35
|
+
.flatMap((row) => {
|
|
36
|
+
const shown = row.split('|').at(-2).trim();
|
|
37
|
+
return STATUSES.includes(shown) && shown !== real
|
|
38
|
+
? [
|
|
39
|
+
{
|
|
40
|
+
intent: slug,
|
|
41
|
+
rule: 'index',
|
|
42
|
+
message: `the index says "${shown}", the intent says "${String(real)}"`,
|
|
43
|
+
fix: `set the index row's status to "${String(real)}"`,
|
|
44
|
+
},
|
|
45
|
+
]
|
|
46
|
+
: [];
|
|
47
|
+
}));
|
|
48
|
+
export const criteria = (intent) => {
|
|
49
|
+
const body = section(intent, SUCCESS_HEADINGS);
|
|
50
|
+
return body === undefined ? [] : items(body);
|
|
51
|
+
};
|
|
52
|
+
const EVIDENCE_CELLS = 3;
|
|
53
|
+
export const evidenceRows = (intent) => tableRows(intent, 'Criterion')
|
|
54
|
+
.filter((row) => row.length >= EVIDENCE_CELLS)
|
|
55
|
+
.map((row) => {
|
|
56
|
+
const [criterion, command, output] = row;
|
|
57
|
+
return { criterion, command: /^`[^`]+`$/u.test(command) ? codeSpans(command)[0] : undefined, output };
|
|
58
|
+
});
|
|
59
|
+
export const expectedExit = (output) => Number(/\bexit (\d+)\b/u.exec(output)?.[1] ?? 0);
|
|
60
|
+
export const missingOutput = (output, actual) => codeSpans(output).filter((span) => !actual.includes(span));
|
|
61
|
+
export const fillTemplate = (template, date, owner) => template.replaceAll('<YYYY-MM-DD>', date).replaceAll('<handle>', owner);
|
|
62
|
+
export const SLUG = /^[a-z\d]+(?:-[a-z\d]+)*$/u;
|
package/dist/markdown.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export const section = (text, headings) => {
|
|
2
|
+
const lines = text.split('\n');
|
|
3
|
+
const start = lines.findIndex((line) => headings.some((h) => line.startsWith(`## ${h}`)));
|
|
4
|
+
if (start === -1)
|
|
5
|
+
return undefined;
|
|
6
|
+
const rest = lines.slice(start + 1);
|
|
7
|
+
const end = rest.findIndex((line) => line.startsWith('## '));
|
|
8
|
+
return (end === -1 ? rest : rest.slice(0, end)).join('\n');
|
|
9
|
+
};
|
|
10
|
+
export const cells = (row) => row
|
|
11
|
+
.trim()
|
|
12
|
+
.replace(/^\|/u, '')
|
|
13
|
+
.replace(/\|$/u, '')
|
|
14
|
+
.split(/(?<!\\)\|/u)
|
|
15
|
+
.map((cell) => cell.trim());
|
|
16
|
+
export const tableRows = (text, first) => {
|
|
17
|
+
const rows = [];
|
|
18
|
+
let inTable = false;
|
|
19
|
+
for (const line of text.split('\n')) {
|
|
20
|
+
if (!line.trimStart().startsWith('|')) {
|
|
21
|
+
inTable = false;
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
const row = cells(line);
|
|
25
|
+
if (row[0] === first)
|
|
26
|
+
inTable = true;
|
|
27
|
+
else if (inTable && !/^:?-+:?$/u.test(row[0]))
|
|
28
|
+
rows.push(row);
|
|
29
|
+
}
|
|
30
|
+
return rows;
|
|
31
|
+
};
|
|
32
|
+
export const items = (body) => {
|
|
33
|
+
const found = [];
|
|
34
|
+
for (const line of body.split('\n')) {
|
|
35
|
+
if (line.startsWith('- '))
|
|
36
|
+
found.push(line.slice(2).trim());
|
|
37
|
+
else if (found.length > 0 && line.startsWith(' ') && line.trim() !== '')
|
|
38
|
+
found[found.length - 1] += ` ${line.trim()}`;
|
|
39
|
+
}
|
|
40
|
+
return found;
|
|
41
|
+
};
|
|
42
|
+
export const codeSpans = (text) => [...text.matchAll(/`([^`]+)`/gu)].map((m) => m[1]);
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface Check {
|
|
2
|
+
readonly command: string;
|
|
3
|
+
readonly exit: number;
|
|
4
|
+
readonly digest: string;
|
|
5
|
+
}
|
|
6
|
+
export interface Receipt {
|
|
7
|
+
readonly checks: readonly Check[];
|
|
8
|
+
readonly captures: readonly string[];
|
|
9
|
+
readonly notChecked: readonly string[];
|
|
10
|
+
/** Set only on `Verified-by: none (<reason>)`. */
|
|
11
|
+
readonly none?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const digest: (output: string) => string;
|
|
14
|
+
/** The commit trailers: one `Verified-by:` per check (or one `none`), one `Captured:` per path, one `Not-checked:` per gap. */
|
|
15
|
+
export declare const trailers: (receipt: Receipt) => string[];
|
|
16
|
+
/** The PR's `Checked:` line: each command and how it ended, then what was not checked. */
|
|
17
|
+
export declare const checkedLine: (receipt: Receipt) => string;
|
|
18
|
+
/** The "How this was checked" block for a PR body: the `Checked:` line, then the trailers, which the gate reads. */
|
|
19
|
+
export declare const prBlock: (receipt: Receipt) => string;
|
|
20
|
+
export interface Verdict {
|
|
21
|
+
readonly ok: boolean;
|
|
22
|
+
readonly reason: string;
|
|
23
|
+
readonly fix?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Whether a commit message or PR body carries a receipt (spec R5): a `Verified-by:` line with a
|
|
27
|
+
* command, or `Verified-by: none (<reason>)` with a reason. `#` lines are a commit template's
|
|
28
|
+
* comments and are not read; a merge commit carries its parents' receipts and passes.
|
|
29
|
+
*/
|
|
30
|
+
export declare const verdict: (message: string) => Verdict;
|
package/dist/receipt.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
const DIGEST_HEX = 12;
|
|
3
|
+
export const digest = (output) => `sha256:${createHash('sha256').update(output).digest('hex').slice(0, DIGEST_HEX)}`;
|
|
4
|
+
const oneLine = (text) => text.replace(/\s+/gu, ' ').trim();
|
|
5
|
+
export const trailers = (receipt) => [
|
|
6
|
+
...(receipt.none === undefined ? receipt.checks.map((c) => `Verified-by: ${oneLine(c.command)} -> exit ${String(c.exit)} (${c.digest})`) : [`Verified-by: none (${oneLine(receipt.none)})`]),
|
|
7
|
+
...receipt.captures.map((path) => `Captured: ${oneLine(path)}`),
|
|
8
|
+
...receipt.notChecked.map((gap) => `Not-checked: ${oneLine(gap)}`),
|
|
9
|
+
];
|
|
10
|
+
export const checkedLine = (receipt) => {
|
|
11
|
+
const ran = receipt.none === undefined ? receipt.checks.map((c) => `\`${oneLine(c.command)}\` (${c.exit === 0 ? 'pass' : `exit ${String(c.exit)}`})`).join(', ') : `nothing (${oneLine(receipt.none)})`;
|
|
12
|
+
const looked = receipt.captures.length > 0 ? `; looked at ${receipt.captures.map((p) => `\`${oneLine(p)}\``).join(', ')}` : '';
|
|
13
|
+
return `Checked: ${ran}${looked}. Not checked: ${receipt.notChecked.length > 0 ? receipt.notChecked.map(oneLine).join('; ') : 'nothing'}.`;
|
|
14
|
+
};
|
|
15
|
+
export const prBlock = (receipt) => ['## How this was checked', '', checkedLine(receipt), '', ...trailers(receipt)].join('\n');
|
|
16
|
+
const FIX = 'run `provedone stamp --run "<the command that proves it>" --not-checked "<what you did not check>"` and paste its lines, or add `Verified-by: none (<why it needs no check>)`';
|
|
17
|
+
export const verdict = (message) => {
|
|
18
|
+
const lines = message.split('\n').filter((line) => !line.startsWith('#'));
|
|
19
|
+
if (/^Merge /u.test(lines.join('\n')))
|
|
20
|
+
return { ok: true, reason: 'merge commit' };
|
|
21
|
+
const values = lines.flatMap((line) => /^Verified-by:(.*)/iu.exec(line)?.slice(1) ?? []).map((v) => v.trim());
|
|
22
|
+
if (values.length === 0)
|
|
23
|
+
return { ok: false, reason: 'no Verified-by: line', fix: FIX };
|
|
24
|
+
const bareNone = values.find((v) => /^none\b/iu.test(v) && !/^none \(\s*\S[^)]*\)$/iu.test(v));
|
|
25
|
+
if (bareNone !== undefined)
|
|
26
|
+
return {
|
|
27
|
+
ok: false,
|
|
28
|
+
reason: `"Verified-by: ${bareNone}" gives no reason`,
|
|
29
|
+
fix: 'write it as `Verified-by: none (<why it needs no check>)`',
|
|
30
|
+
};
|
|
31
|
+
if (values.some((v) => v === ''))
|
|
32
|
+
return { ok: false, reason: 'an empty Verified-by: line', fix: FIX };
|
|
33
|
+
return {
|
|
34
|
+
ok: true,
|
|
35
|
+
reason: values.every((v) => /^none\b/iu.test(v)) ? 'unverified, with a reason' : 'receipt',
|
|
36
|
+
};
|
|
37
|
+
};
|
package/dist/store.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { appendFileSync, existsSync, mkdirSync, readFileSync, renameSync, statSync } from 'node:fs';
|
|
2
|
+
import { join, resolve } from 'node:path';
|
|
3
|
+
import { ambientRuntime, run } from 'bellpull';
|
|
4
|
+
const git = async (root, args) => {
|
|
5
|
+
const r = await run('git', args, { cwd: root, runtime: ambientRuntime() });
|
|
6
|
+
return r.ok ? r.stdout.trim() : undefined;
|
|
7
|
+
};
|
|
8
|
+
export const branchOf = async (root) => (await git(root, ['symbolic-ref', '--short', '-q', 'HEAD'])) ?? 'HEAD';
|
|
9
|
+
export const gitUser = async (root) => git(root, ['config', 'user.name']);
|
|
10
|
+
export const isDirectory = (path) => statSync(path, { throwIfNoEntry: false })?.isDirectory() === true;
|
|
11
|
+
export const storeDir = async (root) => {
|
|
12
|
+
const common = await git(root, ['rev-parse', '--git-common-dir']);
|
|
13
|
+
if (common === undefined)
|
|
14
|
+
return join(root, '.provedone');
|
|
15
|
+
const dir = join(resolve(root, common), 'provedone');
|
|
16
|
+
const legacy = join(resolve(root, common), 'proofline');
|
|
17
|
+
try {
|
|
18
|
+
renameSync(legacy, dir);
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
if (error.code !== 'ENOENT' && !isDirectory(dir))
|
|
22
|
+
throw error;
|
|
23
|
+
}
|
|
24
|
+
return dir;
|
|
25
|
+
};
|
|
26
|
+
const parsed = (line) => {
|
|
27
|
+
try {
|
|
28
|
+
return [JSON.parse(line)];
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
export const readLines = (file) => existsSync(file)
|
|
35
|
+
? readFileSync(file, 'utf8')
|
|
36
|
+
.split('\n')
|
|
37
|
+
.flatMap((line) => parsed(line))
|
|
38
|
+
: [];
|
|
39
|
+
export const appendLines = (file, rows) => {
|
|
40
|
+
mkdirSync(join(file, '..'), { recursive: true });
|
|
41
|
+
appendFileSync(file, rows.map((row) => `${JSON.stringify(row)}\n`).join(''));
|
|
42
|
+
};
|
|
43
|
+
export const runShell = async (command, root, timeoutMs) => {
|
|
44
|
+
const r = await run(command, [], { cwd: root, shell: true, runtime: ambientRuntime(), timeout: timeoutMs });
|
|
45
|
+
return { exit: r.code ?? 1, output: `${r.stdout}${r.stderr}` };
|
|
46
|
+
};
|
|
47
|
+
export const runnable = (command, root) => {
|
|
48
|
+
const file = join(root, /\S+/u.exec(command)[0]);
|
|
49
|
+
return !existsSync(file) || !statSync(file).isFile() || readFileSync(file, 'utf8').startsWith('#!');
|
|
50
|
+
};
|
package/package.json
CHANGED
|
@@ -1 +1,73 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "provedone",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Verified commits for JS and TS repos: each commit carries a receipt of the command that proved it, each intent a done check, and a gate reads both. No dependency outside the burgee family. A @commitlint/cli migration path.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"author": "Ofri Peretz <ofriperetzdev@gmail.com>",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/ofri-peretz/burgee.git",
|
|
10
|
+
"directory": "packages/provedone"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/ofri-peretz/burgee/issues"
|
|
14
|
+
},
|
|
15
|
+
"homepage": "https://burgee.interlace.tools",
|
|
16
|
+
"type": "module",
|
|
17
|
+
"private": false,
|
|
18
|
+
"sideEffects": [
|
|
19
|
+
"./dist/bin.js"
|
|
20
|
+
],
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=22.13.0"
|
|
23
|
+
},
|
|
24
|
+
"bin": {
|
|
25
|
+
"provedone": "dist/bin.js"
|
|
26
|
+
},
|
|
27
|
+
"types": "./dist/index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"import": "./dist/index.js",
|
|
32
|
+
"default": "./dist/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./package.json": "./package.json"
|
|
35
|
+
},
|
|
36
|
+
"typesVersions": {
|
|
37
|
+
"*": {}
|
|
38
|
+
},
|
|
39
|
+
"keywords": [
|
|
40
|
+
"verification",
|
|
41
|
+
"definition-of-done",
|
|
42
|
+
"commit-trailer",
|
|
43
|
+
"pull-request",
|
|
44
|
+
"pre-push",
|
|
45
|
+
"lefthook",
|
|
46
|
+
"git-hooks",
|
|
47
|
+
"ai-agents",
|
|
48
|
+
"cli"
|
|
49
|
+
],
|
|
50
|
+
"publishConfig": {
|
|
51
|
+
"access": "public",
|
|
52
|
+
"provenance": true
|
|
53
|
+
},
|
|
54
|
+
"files": [
|
|
55
|
+
"dist",
|
|
56
|
+
"!dist/**/*.map",
|
|
57
|
+
"!dist/**/*.test.*"
|
|
58
|
+
],
|
|
59
|
+
"scripts": {
|
|
60
|
+
"build": "tsc -p tsconfig.build.json && node ../../scripts/strip-comments.mjs dist && node ../../scripts/declaration-reach.mts --prune",
|
|
61
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
62
|
+
"test": "vitest run",
|
|
63
|
+
"coverage": "vitest run --coverage.enabled",
|
|
64
|
+
"lint": "eslint src"
|
|
65
|
+
},
|
|
66
|
+
"dependencies": {
|
|
67
|
+
"bellpull": "^2.0.3",
|
|
68
|
+
"burgee": "^2.2.1"
|
|
69
|
+
},
|
|
70
|
+
"devDependencies": {
|
|
71
|
+
"vitest": "^5.0.1"
|
|
72
|
+
}
|
|
73
|
+
}
|