@testmuai/evidence-cli 0.1.1
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 +201 -0
- package/README.md +124 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +55 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +6 -0
- package/dist/config.js +71 -0
- package/dist/config.js.map +1 -0
- package/dist/contract.d.ts +66 -0
- package/dist/contract.js +50 -0
- package/dist/contract.js.map +1 -0
- package/dist/diagnostics.d.ts +3 -0
- package/dist/diagnostics.js +11 -0
- package/dist/diagnostics.js.map +1 -0
- package/dist/finalize/index.d.ts +21 -0
- package/dist/finalize/index.js +196 -0
- package/dist/finalize/index.js.map +1 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/pack/byte-source.d.ts +33 -0
- package/dist/pack/byte-source.js +50 -0
- package/dist/pack/byte-source.js.map +1 -0
- package/dist/pack/container.d.ts +58 -0
- package/dist/pack/container.js +215 -0
- package/dist/pack/container.js.map +1 -0
- package/dist/pack/remote.d.ts +49 -0
- package/dist/pack/remote.js +258 -0
- package/dist/pack/remote.js.map +1 -0
- package/dist/report/reporter.d.ts +22 -0
- package/dist/report/reporter.js +66 -0
- package/dist/report/reporter.js.map +1 -0
- package/dist/schemas/0.1/L0/result.schema.json +150 -0
- package/dist/schemas/0.1/L0/run.schema.json +114 -0
- package/dist/schemas/0.1/L1/logs-meta.schema.json +39 -0
- package/dist/schemas/0.1/L1/video.schema.json +16 -0
- package/dist/schemas/compile.d.ts +11 -0
- package/dist/schemas/compile.js +45 -0
- package/dist/schemas/compile.js.map +1 -0
- package/dist/schemas/registry.d.ts +11 -0
- package/dist/schemas/registry.js +40 -0
- package/dist/schemas/registry.js.map +1 -0
- package/dist/validate/checks.d.ts +15 -0
- package/dist/validate/checks.js +152 -0
- package/dist/validate/checks.js.map +1 -0
- package/dist/validate/index.d.ts +5 -0
- package/dist/validate/index.js +99 -0
- package/dist/validate/index.js.map +1 -0
- package/dist/validate/l1.d.ts +12 -0
- package/dist/validate/l1.js +117 -0
- package/dist/validate/l1.js.map +1 -0
- package/dist/yaml.d.ts +4 -0
- package/dist/yaml.js +16 -0
- package/dist/yaml.js.map +1 -0
- package/package.json +70 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 LambdaTest Inc.
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
# evidence-cli — TestMu AI (formerly LambdaTest)
|
|
2
|
+
|
|
3
|
+
**An open, framework-agnostic format for what a test run produced — the
|
|
4
|
+
`.evidence` pack, and the library + CLI that validate and seal it.**
|
|
5
|
+
|
|
6
|
+
[](https://www.npmjs.com/package/@testmuai/evidence-cli)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
[](https://github.com/LambdaTest/evidence-cli/actions/workflows/ci.yml)
|
|
9
|
+

|
|
10
|
+
[](https://discord.gg/kanQPEx9)
|
|
11
|
+
|
|
12
|
+
One shape, whatever made it — a browser agent, a Playwright suite, a Jest run, an
|
|
13
|
+
API check. An evidence pack is readable by a CI dashboard, an auditor, or a human
|
|
14
|
+
without knowing the framework that wrote it.
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# As a library (Node 18+)
|
|
20
|
+
npm install @testmuai/evidence-cli
|
|
21
|
+
|
|
22
|
+
# Or the CLI, globally
|
|
23
|
+
npm install -g @testmuai/evidence-cli
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Two ways to use it
|
|
27
|
+
|
|
28
|
+
### As a library
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
import { validate, finalize } from "@testmuai/evidence-cli";
|
|
32
|
+
|
|
33
|
+
// Validate a pack — a directory or a sealed .evidence zip — against a profile.
|
|
34
|
+
const report = await validate("my-run.evidence", { profile: "L1" });
|
|
35
|
+
if (!report.valid) {
|
|
36
|
+
for (const d of report.diagnostics) {
|
|
37
|
+
console.error(`${d.severity} ${d.location}: ${d.message} [${d.code}]`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Seal a live directory into a flat, range-addressable .evidence zip (atomically).
|
|
42
|
+
const { totals, sealedPath } = await finalize("my-run.evidence", {
|
|
43
|
+
endedAt: new Date().toISOString(),
|
|
44
|
+
});
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The package ships type definitions; `validate` and `finalize` are the load-bearing
|
|
48
|
+
entry points, and the pack container types (`openContainer`, `RemoteZipContainer`,
|
|
49
|
+
…) are exported for reading packs directly — including ranged reads from a blob
|
|
50
|
+
store.
|
|
51
|
+
|
|
52
|
+
### As a CLI
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
evidence validate my-run.evidence --profile L0 # check a directory OR a sealed .evidence zip
|
|
56
|
+
evidence validate my-run.evidence --profile L1 # L1 = L0 + the captured-artifact layer
|
|
57
|
+
evidence finalize my-run.evidence/ # roll up totals, hash definitions, seal → .evidence
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Exit codes: `0` valid · `1` invalid · `2` usage error. Add `--json` for a
|
|
61
|
+
machine-readable report.
|
|
62
|
+
|
|
63
|
+
## What's in a pack
|
|
64
|
+
|
|
65
|
+
A pack is a `<name>.evidence/` directory (which zips to a `<name>.evidence` file),
|
|
66
|
+
anchored by a top-level `run.yaml`. At **L0** — the minimal profile — only three
|
|
67
|
+
artifacts are load-bearing:
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
<name>.evidence/
|
|
71
|
+
run.yaml # required — manifest anchor (run identity, lifecycle, derived totals)
|
|
72
|
+
tests/<id>/
|
|
73
|
+
<definition> # required, OPAQUE — the framework's own artifact (a Markdown spec, *.spec.ts, an API suite, …)
|
|
74
|
+
result.yaml # required — structured per-step outcomes
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
evidence-cli knows **nothing** about any framework's definition format. It
|
|
78
|
+
references and hashes the definition; it never parses it. The format scales by
|
|
79
|
+
*adding* optional files and profiles — never by rewriting the L0 core.
|
|
80
|
+
|
|
81
|
+
### Profiles — a ladder on one `0.1` contract
|
|
82
|
+
|
|
83
|
+
- **L0** — the minimal, framework-neutral core (above).
|
|
84
|
+
- **L1** — purely additive: keeps all of L0 and adds the captured **evidence
|
|
85
|
+
artifacts** (per-test execution logs and step screenshots, a global coverage
|
|
86
|
+
directory; video optional).
|
|
87
|
+
|
|
88
|
+
Version and profile are different axes: a profile only *adds* requirements and
|
|
89
|
+
never changes the version; only a breaking change to an existing meaning bumps
|
|
90
|
+
`evidence` (`0.1` → `0.2`).
|
|
91
|
+
|
|
92
|
+
## This repo is its own spec
|
|
93
|
+
|
|
94
|
+
`evidence-cli` is governed by a living decision log. The [`design/`](design)
|
|
95
|
+
directory holds the **decisions** (proposition → options → decision → reasoning),
|
|
96
|
+
the **contract**, and a **web viewer** that renders all of it. The **JSON
|
|
97
|
+
Schemas** — the single source of truth, consumed by *both* the validator and the
|
|
98
|
+
viewer — live under [`src/schemas/0.1/`](src/schemas).
|
|
99
|
+
|
|
100
|
+
> The decision is the unit of work. Code is downstream of it. No code lands
|
|
101
|
+
> without a decision; no change lands without updating the structure.
|
|
102
|
+
|
|
103
|
+
Browse it locally with `npm run docs`. See [`GOVERNANCE.md`](GOVERNANCE.md).
|
|
104
|
+
|
|
105
|
+
## Support & contributing
|
|
106
|
+
|
|
107
|
+
- **Community:** [Join us on Discord](https://discord.gg/kanQPEx9) — questions,
|
|
108
|
+
discussion, and release announcements.
|
|
109
|
+
- **Issues / bug reports:** [GitHub Issues](https://github.com/LambdaTest/evidence-cli/issues/new/choose)
|
|
110
|
+
- **Contributing:** see [CONTRIBUTING.md](CONTRIBUTING.md) — every change starts
|
|
111
|
+
with a decision.
|
|
112
|
+
- **Security:** see [SECURITY.md](SECURITY.md).
|
|
113
|
+
- **Changelog:** [CHANGELOG.md](CHANGELOG.md).
|
|
114
|
+
|
|
115
|
+
## 🚀 LambdaTest is now TestMu AI
|
|
116
|
+
|
|
117
|
+
On **January 12, 2026**, [LambdaTest evolved to TestMu AI](https://www.testmuai.com/lambdatest-is-now-testmuai/),
|
|
118
|
+
an autonomous Agentic AI Quality Engineering Platform. Same team, same
|
|
119
|
+
infrastructure, same accounts — existing logins, scripts, and integrations
|
|
120
|
+
continue to work. Find the new home at [testmuai.com](https://www.testmuai.com).
|
|
121
|
+
|
|
122
|
+
## License
|
|
123
|
+
|
|
124
|
+
[Apache-2.0](LICENSE) © LambdaTest Inc.
|
package/dist/cli.d.ts
ADDED
package/dist/cli.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
const commander_1 = require("commander");
|
|
5
|
+
const validate_1 = require("./validate");
|
|
6
|
+
const finalize_1 = require("./finalize");
|
|
7
|
+
const config_1 = require("./config");
|
|
8
|
+
const reporter_1 = require("./report/reporter");
|
|
9
|
+
const program = new commander_1.Command();
|
|
10
|
+
program
|
|
11
|
+
.name("evidence")
|
|
12
|
+
.description("Validate and finalize .evidence packs")
|
|
13
|
+
.version("0.1.0");
|
|
14
|
+
program
|
|
15
|
+
.command("validate")
|
|
16
|
+
.argument("<target>", "a <name>.evidence directory or a sealed .evidence zip")
|
|
17
|
+
.option("--profile <profile>", "validation profile (overrides config)")
|
|
18
|
+
.option("--config <path>", "path to config.json")
|
|
19
|
+
.option("--json", "machine-readable output", false)
|
|
20
|
+
.action(async (target, opts) => {
|
|
21
|
+
const reporter = (0, reporter_1.makeReporter)(opts.json);
|
|
22
|
+
try {
|
|
23
|
+
const config = await (0, config_1.loadConfig)(opts.config);
|
|
24
|
+
const profile = (0, config_1.resolveProfile)(opts.profile, config);
|
|
25
|
+
const report = await (0, validate_1.validate)(target, { profile });
|
|
26
|
+
reporter.validation(report);
|
|
27
|
+
process.exit(report.valid ? 0 : 1);
|
|
28
|
+
}
|
|
29
|
+
catch (e) {
|
|
30
|
+
reporter.usageError(e?.message ?? String(e));
|
|
31
|
+
process.exit(2);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
program
|
|
35
|
+
.command("finalize")
|
|
36
|
+
.argument("<dir>", "the live <name>.evidence/ directory")
|
|
37
|
+
.option("--config <path>", "path to config.json")
|
|
38
|
+
.option("--json", "machine-readable output", false)
|
|
39
|
+
.action(async (dir, opts) => {
|
|
40
|
+
const reporter = (0, reporter_1.makeReporter)(opts.json);
|
|
41
|
+
try {
|
|
42
|
+
const result = await (0, finalize_1.finalize)(dir, { endedAt: new Date().toISOString() });
|
|
43
|
+
reporter.finalize(result);
|
|
44
|
+
process.exit(0);
|
|
45
|
+
}
|
|
46
|
+
catch (e) {
|
|
47
|
+
reporter.usageError(e?.message ?? String(e));
|
|
48
|
+
process.exit(2);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
program.parseAsync(process.argv).catch((e) => {
|
|
52
|
+
process.stderr.write(String(e) + "\n");
|
|
53
|
+
process.exit(2);
|
|
54
|
+
});
|
|
55
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;AACA,yCAAoC;AACpC,yCAAsC;AACtC,yCAAsC;AACtC,qCAAsD;AACtD,gDAAiD;AAEjD,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAC9B,OAAO;KACJ,IAAI,CAAC,UAAU,CAAC;KAChB,WAAW,CAAC,uCAAuC,CAAC;KACpD,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,UAAU,CAAC;KACnB,QAAQ,CAAC,UAAU,EAAE,uDAAuD,CAAC;KAC7E,MAAM,CAAC,qBAAqB,EAAE,uCAAuC,CAAC;KACtE,MAAM,CAAC,iBAAiB,EAAE,qBAAqB,CAAC;KAChD,MAAM,CAAC,QAAQ,EAAE,yBAAyB,EAAE,KAAK,CAAC;KAClD,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,IAA0D,EAAE,EAAE;IAC3F,MAAM,QAAQ,GAAG,IAAA,uBAAY,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,IAAA,mBAAU,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC7C,MAAM,OAAO,GAAG,IAAA,uBAAc,EAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACrD,MAAM,MAAM,GAAG,MAAM,IAAA,mBAAQ,EAAC,MAAM,EAAE,EAAE,OAAO,EAAE,CAAC,CAAC;QACnD,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAC5B,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,OAAO,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO;KACJ,OAAO,CAAC,UAAU,CAAC;KACnB,QAAQ,CAAC,OAAO,EAAE,qCAAqC,CAAC;KACxD,MAAM,CAAC,iBAAiB,EAAE,qBAAqB,CAAC;KAChD,MAAM,CAAC,QAAQ,EAAE,yBAAyB,EAAE,KAAK,CAAC;KAClD,MAAM,CAAC,KAAK,EAAE,GAAW,EAAE,IAAwC,EAAE,EAAE;IACtE,MAAM,QAAQ,GAAG,IAAA,uBAAY,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,IAAA,mBAAQ,EAAC,GAAG,EAAE,EAAE,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QAC1E,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAC1B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAAC,OAAO,CAAM,EAAE,CAAC;QAChB,QAAQ,CAAC,UAAU,CAAC,CAAC,EAAE,OAAO,IAAI,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QAC7C,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;IAC3C,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IACvC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface EvidenceConfig {
|
|
2
|
+
defaultProfile?: string;
|
|
3
|
+
}
|
|
4
|
+
export declare function configPath(flag?: string): string;
|
|
5
|
+
export declare function loadConfig(flag?: string): Promise<EvidenceConfig>;
|
|
6
|
+
export declare function resolveProfile(flag: string | undefined, config: EvidenceConfig): string;
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.configPath = configPath;
|
|
37
|
+
exports.loadConfig = loadConfig;
|
|
38
|
+
exports.resolveProfile = resolveProfile;
|
|
39
|
+
const node_fs_1 = require("node:fs");
|
|
40
|
+
const os = __importStar(require("node:os"));
|
|
41
|
+
const path = __importStar(require("node:path"));
|
|
42
|
+
const contract_1 = require("./contract");
|
|
43
|
+
function configPath(flag) {
|
|
44
|
+
if (flag)
|
|
45
|
+
return flag;
|
|
46
|
+
if (process.env.EVIDENCE_CONFIG)
|
|
47
|
+
return process.env.EVIDENCE_CONFIG;
|
|
48
|
+
return path.join(os.homedir(), ".testmuai", "evidence", "config.json");
|
|
49
|
+
}
|
|
50
|
+
async function loadConfig(flag) {
|
|
51
|
+
const p = configPath(flag);
|
|
52
|
+
let raw;
|
|
53
|
+
try {
|
|
54
|
+
raw = await node_fs_1.promises.readFile(p, "utf8");
|
|
55
|
+
}
|
|
56
|
+
catch {
|
|
57
|
+
return {}; // a missing config is fine — built-in default applies
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
return JSON.parse(raw);
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
const e = new Error(`config at ${p} is not valid JSON`);
|
|
64
|
+
e.code = "USAGE";
|
|
65
|
+
throw e;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
function resolveProfile(flag, config) {
|
|
69
|
+
return flag ?? config.defaultProfile ?? contract_1.DEFAULT_PROFILE;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,gCAIC;AAED,gCAeC;AAED,wCAEC;AAlCD,qCAAyC;AACzC,4CAA8B;AAC9B,gDAAkC;AAClC,yCAA6C;AAM7C,SAAgB,UAAU,CAAC,IAAa;IACtC,IAAI,IAAI;QAAE,OAAO,IAAI,CAAC;IACtB,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe;QAAE,OAAO,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC;IACpE,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,CAAC,CAAC;AACzE,CAAC;AAEM,KAAK,UAAU,UAAU,CAAC,IAAa;IAC5C,MAAM,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAC3B,IAAI,GAAW,CAAC;IAChB,IAAI,CAAC;QACH,GAAG,GAAG,MAAM,kBAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC,CAAC,sDAAsD;IACnE,CAAC;IACD,IAAI,CAAC;QACH,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAmB,CAAC;IAC3C,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,CAAC,GAAG,IAAI,KAAK,CAAC,aAAa,CAAC,oBAAoB,CAA8B,CAAC;QACrF,CAAC,CAAC,IAAI,GAAG,OAAO,CAAC;QACjB,MAAM,CAAC,CAAC;IACV,CAAC;AACH,CAAC;AAED,SAAgB,cAAc,CAAC,IAAwB,EAAE,MAAsB;IAC7E,OAAO,IAAI,IAAI,MAAM,CAAC,cAAc,IAAI,0BAAe,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export declare const CONTRACT_VERSION: "0.1";
|
|
2
|
+
export declare const DEFAULT_PROFILE: "L0";
|
|
3
|
+
export type Verdict = "passed" | "failed" | "broken" | "skipped";
|
|
4
|
+
export type RunStatus = "running" | "finalized" | "aborted";
|
|
5
|
+
export type Severity = "error" | "warning";
|
|
6
|
+
export interface Diagnostic {
|
|
7
|
+
code: string;
|
|
8
|
+
severity: Severity;
|
|
9
|
+
location: string;
|
|
10
|
+
message: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ValidationReport {
|
|
13
|
+
valid: boolean;
|
|
14
|
+
profile: string;
|
|
15
|
+
version: string;
|
|
16
|
+
/** run.yaml.status (running | finalized | aborted), or null if unreadable. */
|
|
17
|
+
status: string | null;
|
|
18
|
+
diagnostics: Diagnostic[];
|
|
19
|
+
}
|
|
20
|
+
export interface Totals {
|
|
21
|
+
tests: number;
|
|
22
|
+
passed: number;
|
|
23
|
+
failed: number;
|
|
24
|
+
broken: number;
|
|
25
|
+
skipped: number;
|
|
26
|
+
}
|
|
27
|
+
export interface FinalizeResult {
|
|
28
|
+
totals: Totals;
|
|
29
|
+
sealedPath: string;
|
|
30
|
+
}
|
|
31
|
+
export declare const Codes: {
|
|
32
|
+
readonly MANIFEST_MISSING: "manifest.missing";
|
|
33
|
+
readonly MANIFEST_PARSE: "manifest.parse";
|
|
34
|
+
readonly RESULT_MISSING: "result.missing";
|
|
35
|
+
readonly RESULT_PARSE: "result.parse";
|
|
36
|
+
readonly VERSION_UNSUPPORTED: "version.unsupported";
|
|
37
|
+
readonly SCHEMA: "schema.invalid";
|
|
38
|
+
readonly TEST_ID_MISMATCH: "test.id_mismatch";
|
|
39
|
+
readonly DEFINITION_MISSING: "definition.missing";
|
|
40
|
+
readonly DEFINITION_PATH_ESCAPE: "definition.path_escape";
|
|
41
|
+
readonly ORDINAL_COLLISION: "ordinal.collision";
|
|
42
|
+
readonly ORDINAL_NOT_INCREASING: "ordinal.not_increasing";
|
|
43
|
+
readonly ENDED_BEFORE_STARTED: "ended.before_started";
|
|
44
|
+
readonly TOTALS_MISMATCH: "totals.mismatch";
|
|
45
|
+
readonly HASH_MISSING: "definition.hash_missing";
|
|
46
|
+
readonly HASH_MISMATCH: "definition.hash_mismatch";
|
|
47
|
+
readonly STATUS_DISAGREES: "status.disagrees_with_steps";
|
|
48
|
+
readonly L1_LOGS_MISSING: "l1.logs.missing";
|
|
49
|
+
readonly L1_LOGS_META_MISSING: "l1.logs.meta_missing";
|
|
50
|
+
readonly L1_LOGS_META_INVALID: "l1.logs.meta_invalid";
|
|
51
|
+
readonly L1_LOG_FILE_MISSING: "l1.logs.file_missing";
|
|
52
|
+
readonly L1_LOG_PATH_ESCAPE: "l1.logs.path_escape";
|
|
53
|
+
readonly L1_STEPS_MISSING: "l1.steps.missing";
|
|
54
|
+
readonly L1_STEPS_MALFORMED: "l1.steps.malformed_name";
|
|
55
|
+
readonly L1_STEPS_UNMATCHED: "l1.steps.unmatched";
|
|
56
|
+
readonly L1_STEPS_SCREENSHOT_MISSING: "l1.steps.screenshot_missing";
|
|
57
|
+
readonly L1_COVERAGE_MISSING: "l1.coverage.missing";
|
|
58
|
+
readonly L1_VIDEO_INVALID: "l1.video.invalid";
|
|
59
|
+
};
|
|
60
|
+
/**
|
|
61
|
+
* A profile resolves to an ordered chain of layers — additive (decision 0027/0040):
|
|
62
|
+
* L1 keeps every L0 check and adds its own. `validate --profile L1` runs the chain
|
|
63
|
+
* in order.
|
|
64
|
+
*/
|
|
65
|
+
export declare const PROFILES: Record<string, string[]>;
|
|
66
|
+
export declare function profileChain(profile: string): string[] | null;
|
package/dist/contract.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PROFILES = exports.Codes = exports.DEFAULT_PROFILE = exports.CONTRACT_VERSION = void 0;
|
|
4
|
+
exports.profileChain = profileChain;
|
|
5
|
+
exports.CONTRACT_VERSION = "0.1";
|
|
6
|
+
exports.DEFAULT_PROFILE = "L0";
|
|
7
|
+
exports.Codes = {
|
|
8
|
+
MANIFEST_MISSING: "manifest.missing",
|
|
9
|
+
MANIFEST_PARSE: "manifest.parse",
|
|
10
|
+
RESULT_MISSING: "result.missing",
|
|
11
|
+
RESULT_PARSE: "result.parse",
|
|
12
|
+
VERSION_UNSUPPORTED: "version.unsupported",
|
|
13
|
+
SCHEMA: "schema.invalid",
|
|
14
|
+
TEST_ID_MISMATCH: "test.id_mismatch",
|
|
15
|
+
DEFINITION_MISSING: "definition.missing",
|
|
16
|
+
DEFINITION_PATH_ESCAPE: "definition.path_escape",
|
|
17
|
+
ORDINAL_COLLISION: "ordinal.collision",
|
|
18
|
+
ORDINAL_NOT_INCREASING: "ordinal.not_increasing",
|
|
19
|
+
ENDED_BEFORE_STARTED: "ended.before_started",
|
|
20
|
+
TOTALS_MISMATCH: "totals.mismatch",
|
|
21
|
+
HASH_MISSING: "definition.hash_missing",
|
|
22
|
+
HASH_MISMATCH: "definition.hash_mismatch",
|
|
23
|
+
STATUS_DISAGREES: "status.disagrees_with_steps",
|
|
24
|
+
// L1 (decision 0040). Presence codes (*_MISSING for logs/steps/coverage) fire
|
|
25
|
+
// only when status: finalized; shape codes fire at any status.
|
|
26
|
+
L1_LOGS_MISSING: "l1.logs.missing",
|
|
27
|
+
L1_LOGS_META_MISSING: "l1.logs.meta_missing",
|
|
28
|
+
L1_LOGS_META_INVALID: "l1.logs.meta_invalid",
|
|
29
|
+
L1_LOG_FILE_MISSING: "l1.logs.file_missing",
|
|
30
|
+
L1_LOG_PATH_ESCAPE: "l1.logs.path_escape",
|
|
31
|
+
L1_STEPS_MISSING: "l1.steps.missing",
|
|
32
|
+
L1_STEPS_MALFORMED: "l1.steps.malformed_name",
|
|
33
|
+
L1_STEPS_UNMATCHED: "l1.steps.unmatched",
|
|
34
|
+
L1_STEPS_SCREENSHOT_MISSING: "l1.steps.screenshot_missing",
|
|
35
|
+
L1_COVERAGE_MISSING: "l1.coverage.missing",
|
|
36
|
+
L1_VIDEO_INVALID: "l1.video.invalid",
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* A profile resolves to an ordered chain of layers — additive (decision 0027/0040):
|
|
40
|
+
* L1 keeps every L0 check and adds its own. `validate --profile L1` runs the chain
|
|
41
|
+
* in order.
|
|
42
|
+
*/
|
|
43
|
+
exports.PROFILES = {
|
|
44
|
+
L0: ["L0"],
|
|
45
|
+
L1: ["L0", "L1"],
|
|
46
|
+
};
|
|
47
|
+
function profileChain(profile) {
|
|
48
|
+
return exports.PROFILES[profile] ?? null;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=contract.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract.js","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":";;;AA+EA,oCAEC;AAjFY,QAAA,gBAAgB,GAAG,KAAc,CAAC;AAClC,QAAA,eAAe,GAAG,IAAa,CAAC;AAmChC,QAAA,KAAK,GAAG;IACnB,gBAAgB,EAAE,kBAAkB;IACpC,cAAc,EAAE,gBAAgB;IAChC,cAAc,EAAE,gBAAgB;IAChC,YAAY,EAAE,cAAc;IAC5B,mBAAmB,EAAE,qBAAqB;IAC1C,MAAM,EAAE,gBAAgB;IACxB,gBAAgB,EAAE,kBAAkB;IACpC,kBAAkB,EAAE,oBAAoB;IACxC,sBAAsB,EAAE,wBAAwB;IAChD,iBAAiB,EAAE,mBAAmB;IACtC,sBAAsB,EAAE,wBAAwB;IAChD,oBAAoB,EAAE,sBAAsB;IAC5C,eAAe,EAAE,iBAAiB;IAClC,YAAY,EAAE,yBAAyB;IACvC,aAAa,EAAE,0BAA0B;IACzC,gBAAgB,EAAE,6BAA6B;IAE/C,8EAA8E;IAC9E,+DAA+D;IAC/D,eAAe,EAAE,iBAAiB;IAClC,oBAAoB,EAAE,sBAAsB;IAC5C,oBAAoB,EAAE,sBAAsB;IAC5C,mBAAmB,EAAE,sBAAsB;IAC3C,kBAAkB,EAAE,qBAAqB;IACzC,gBAAgB,EAAE,kBAAkB;IACpC,kBAAkB,EAAE,yBAAyB;IAC7C,kBAAkB,EAAE,oBAAoB;IACxC,2BAA2B,EAAE,6BAA6B;IAC1D,mBAAmB,EAAE,qBAAqB;IAC1C,gBAAgB,EAAE,kBAAkB;CAC5B,CAAC;AAEX;;;;GAIG;AACU,QAAA,QAAQ,GAA6B;IAChD,EAAE,EAAE,CAAC,IAAI,CAAC;IACV,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;CACjB,CAAC;AAEF,SAAgB,YAAY,CAAC,OAAe;IAC1C,OAAO,gBAAQ,CAAC,OAAO,CAAC,IAAI,IAAI,CAAC;AACnC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.err = err;
|
|
4
|
+
exports.warn = warn;
|
|
5
|
+
function err(code, location, message) {
|
|
6
|
+
return { code, severity: "error", location, message };
|
|
7
|
+
}
|
|
8
|
+
function warn(code, location, message) {
|
|
9
|
+
return { code, severity: "warning", location, message };
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=diagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../src/diagnostics.ts"],"names":[],"mappings":";;AAEA,kBAEC;AAED,oBAEC;AAND,SAAgB,GAAG,CAAC,IAAY,EAAE,QAAgB,EAAE,OAAe;IACjE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;AACxD,CAAC;AAED,SAAgB,IAAI,CAAC,IAAY,EAAE,QAAgB,EAAE,OAAe;IAClE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { FinalizeResult } from "../contract";
|
|
2
|
+
export interface FinalizeOptions {
|
|
3
|
+
/** RFC3339 timestamp to write as run.yaml.ended (caller-supplied for testability). */
|
|
4
|
+
endedAt: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function finalize(dir: string, opts: FinalizeOptions): Promise<FinalizeResult>;
|
|
7
|
+
export interface SweepResult {
|
|
8
|
+
/** pack names restored from a `.bak-` aside (interrupted before install). */
|
|
9
|
+
restored: string[];
|
|
10
|
+
/** stale `.tmp-` / redundant `.bak-` names removed. */
|
|
11
|
+
removed: string[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Recover leftovers from an interrupted atomic seal (decision 0042). The host
|
|
15
|
+
* calls this at startup over the directory that holds its packs; evidence-cli
|
|
16
|
+
* itself runs no daemon. After it returns, every pack is either a complete sealed
|
|
17
|
+
* file or a live directory — never a partial. A `.bak-*` is restored to the live
|
|
18
|
+
* directory when the sealed file is absent (else deleted as redundant); a
|
|
19
|
+
* `.tmp-*` is always deleted, since a re-`finalize` regenerates it deterministically.
|
|
20
|
+
*/
|
|
21
|
+
export declare function sweepIncomplete(parentDir: string): Promise<SweepResult>;
|