@am_shork/attest 0.1.2 → 0.1.4
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/CHANGELOG.md +98 -1
- package/README.md +13 -6
- package/dist/cli/index.js +75 -46
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/json.d.ts +7 -0
- package/dist/cli/json.d.ts.map +1 -1
- package/dist/cli/json.js +13 -2
- package/dist/cli/json.js.map +1 -1
- package/dist/cli/report.d.ts +0 -1
- package/dist/cli/report.d.ts.map +1 -1
- package/dist/cli/report.js +0 -3
- package/dist/cli/report.js.map +1 -1
- package/dist/core/pipeline.d.ts.map +1 -1
- package/dist/core/pipeline.js +2 -2
- package/dist/core/pipeline.js.map +1 -1
- package/dist/core/schema.d.ts +6 -6
- package/dist/core/schema.d.ts.map +1 -1
- package/dist/core/schema.js +8 -1
- package/dist/core/schema.js.map +1 -1
- package/dist/core/types.d.ts +6 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js +8 -1
- package/dist/core/types.js.map +1 -1
- package/dist/core/validator.d.ts +6 -3
- package/dist/core/validator.d.ts.map +1 -1
- package/dist/core/validator.js +27 -20
- package/dist/core/validator.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,101 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
Remaining work from the 0.1.3 adoption reports. The breaking items are held for
|
|
11
|
+
**0.2.0** (under 0.x SemVer a breaking change bumps the minor); the non-breaking
|
|
12
|
+
`--vitest-config` item is not yet shipped, pending a design decision. "Breaking"
|
|
13
|
+
means it changes the exit code of an existing valid setup, rejects
|
|
14
|
+
previously-valid input, removes/renames a public API or `--json` field, or
|
|
15
|
+
changes a default runtime behavior an existing invocation relies on — diagnostic
|
|
16
|
+
message text is not API.
|
|
17
|
+
|
|
18
|
+
### Planned for 0.2.0 (breaking)
|
|
19
|
+
|
|
20
|
+
- **A vacuous green stops passing.** Today `attest verify` on a spec that ran no
|
|
21
|
+
scenarios (an empty or requirement-less directory) prints
|
|
22
|
+
`✓ No issues. — 0 error, …` and exits `0`, because `runAndCollect` reads "no
|
|
23
|
+
failing tests" as `passed`. `verify` will instead emit a new `empty-spec`
|
|
24
|
+
ERROR when zero scenarios executed (or the registry has zero requirements),
|
|
25
|
+
so `ok` becomes `false` and the exit code follows the existing `hasError`
|
|
26
|
+
path. Wires up `hasSpecs()` (present in `pipeline.ts`, never called today).
|
|
27
|
+
*Breaking:* an "empty directory → exit 0" run flips to exit 1 — which is the
|
|
28
|
+
point, since that run attests nothing. *Non-breaking companion (may land
|
|
29
|
+
earlier in 0.1.x):* requirement/scenario counts in the summary line
|
|
30
|
+
(`— 33 requirements / 59 scenarios, 0 error, …`).
|
|
31
|
+
- **Default spec discovery ignores files with no `requirement()`.** `verify` at
|
|
32
|
+
a repo root currently sweeps every `**/*.spec.ts` — including a pre-existing
|
|
33
|
+
suite — into a runner with no aliases/DOM, a guaranteed red unrelated to the
|
|
34
|
+
code. The default will change to run only spec files that declare at least one
|
|
35
|
+
`requirement()`, so an incumbent suite is left untouched without forcing a
|
|
36
|
+
directory layout. *Breaking:* a repo relying on the root scan to pick up
|
|
37
|
+
requirement-less specs sees a different set run. *Non-breaking companion (may
|
|
38
|
+
land earlier in 0.1.x):* a pre-run report of how many spec files were located
|
|
39
|
+
and how many contain a `requirement()` call.
|
|
40
|
+
|
|
41
|
+
### Planned for 0.1.x (non-breaking, not yet shipped)
|
|
42
|
+
|
|
43
|
+
- **Opt-in Vitest config** (`--vitest-config <path>` or `attest.config.ts`) so
|
|
44
|
+
framework code (`.vue`, DOM, aliases, auto-imports) can be specified at all.
|
|
45
|
+
`config: false` stays the default, so the deterministic child run is unchanged.
|
|
46
|
+
Deferred: it needs a design decision on config-file precedence and how it
|
|
47
|
+
interacts with the enforced `include`/`exclude`/`root` overrides, so it is not
|
|
48
|
+
bundled with the schema/heuristic/packaging changes above.
|
|
49
|
+
|
|
50
|
+
## [0.1.4] - 2026-07-24
|
|
51
|
+
|
|
52
|
+
Non-breaking fixes from two independent 0.1.3 adoptions — a plain-TS
|
|
53
|
+
re-onboarding and a first Nuxt 4 adoption.
|
|
54
|
+
|
|
55
|
+
### Added
|
|
56
|
+
|
|
57
|
+
- **`params` accepts an array of scalars, not just a lone scalar.** List-shaped
|
|
58
|
+
constants — vendor blacklists, id sets — are the values most prone to drift,
|
|
59
|
+
and rejecting arrays kept exactly those out of the single-source mechanism.
|
|
60
|
+
An array still has one owner (the spec) read from one place (the scenario).
|
|
61
|
+
Existing scalar registries are unaffected; the `params` type union widens to
|
|
62
|
+
admit `Array<number | string | boolean>`. `schemaVersion` is unchanged (no
|
|
63
|
+
`--json` shape change).
|
|
64
|
+
|
|
65
|
+
### Changed
|
|
66
|
+
|
|
67
|
+
- **The `possible-drift` heuristic is now evaluated per requirement, not per
|
|
68
|
+
scenario.** A requirement that owns params is quiet as soon as *any* one of
|
|
69
|
+
its covering scenarios reads them, so a correct multi-facet requirement is no
|
|
70
|
+
longer flagged forever by the facets that legitimately don't touch params. The
|
|
71
|
+
INFO is emitted at most once per requirement (anchored at its first covering
|
|
72
|
+
scenario). INFO only — the verdict and exit code are unaffected.
|
|
73
|
+
- **Widened peer ranges** to `vite ^5 || ^6 || ^7 || ^8` and
|
|
74
|
+
`vitest ^2 || ^3 || ^4`. Current generations (Vitest 4 / Vite 7–8) work against
|
|
75
|
+
the `startVitest` / `state.getFiles()` / `configDefaults` surface Attest uses;
|
|
76
|
+
the old ranges emitted peer warnings an adopter could only silence by
|
|
77
|
+
downgrading their framework's test stack. Verified by the packaging test.
|
|
78
|
+
- **Documented `cover --json`'s `scenarioCount`** — the README JSON section now
|
|
79
|
+
states the coverage row shape (`{ reqId, covered, scenarioCount }`).
|
|
80
|
+
|
|
81
|
+
## [0.1.3] - 2026-07-24
|
|
82
|
+
|
|
83
|
+
### Added
|
|
84
|
+
|
|
85
|
+
- **`--json` holds on the crash path.** When a command throws, `--json` now
|
|
86
|
+
emits one parseable envelope (`ok: false` with an `internal-error` issue)
|
|
87
|
+
instead of leaving stdout empty and printing a stack on stderr, so a consumer
|
|
88
|
+
that only reads stdout can still branch on the failure. The envelope shape is
|
|
89
|
+
unchanged (`internal-error` is just a new issue `code`), so `schemaVersion`
|
|
90
|
+
stays `1`.
|
|
91
|
+
|
|
92
|
+
### Changed
|
|
93
|
+
|
|
94
|
+
- The CLI exit code is now derived from the report's `ok` for every command,
|
|
95
|
+
and `ok` itself comes from a single `hasError` predicate shared by the
|
|
96
|
+
pipeline, the JSON report and the exit code — they can no longer disagree.
|
|
97
|
+
No behavioural change to existing exit codes.
|
|
98
|
+
|
|
99
|
+
### Fixed
|
|
100
|
+
|
|
101
|
+
- README links now point at absolute GitLab URLs instead of repo-relative
|
|
102
|
+
paths, so they resolve on the npm package page (the `docs/`, `self/` and
|
|
103
|
+
`fixtures/` targets are not part of the published tarball).
|
|
104
|
+
|
|
10
105
|
## [0.1.2] - 2026-07-23
|
|
11
106
|
|
|
12
107
|
### Added
|
|
@@ -94,7 +189,9 @@ Initial release.
|
|
|
94
189
|
(MIT), whose four-stage engine and diff-first change model Attest's
|
|
95
190
|
architecture is adapted from (re-implemented from scratch, no source copied).
|
|
96
191
|
|
|
97
|
-
[Unreleased]: https://gitlab.com/Pseudorca/attest/-/compare/v0.1.
|
|
192
|
+
[Unreleased]: https://gitlab.com/Pseudorca/attest/-/compare/v0.1.4...main
|
|
193
|
+
[0.1.4]: https://gitlab.com/Pseudorca/attest/-/tags/v0.1.4
|
|
194
|
+
[0.1.3]: https://gitlab.com/Pseudorca/attest/-/tags/v0.1.3
|
|
98
195
|
[0.1.2]: https://gitlab.com/Pseudorca/attest/-/tags/v0.1.2
|
|
99
196
|
[0.1.1]: https://gitlab.com/Pseudorca/attest/-/tags/v0.1.1
|
|
100
197
|
[0.1.0]: https://gitlab.com/Pseudorca/attest/-/tags/v0.1.0
|
package/README.md
CHANGED
|
@@ -10,9 +10,11 @@ by a stable ID and continuously detects drift.
|
|
|
10
10
|
|
|
11
11
|
The killer move against drift: values that change (timeouts, limits) live **once**
|
|
12
12
|
in a requirement's `params`, and tests read them from there — so a number is
|
|
13
|
-
physically impossible to drift between the spec and the assertion.
|
|
13
|
+
physically impossible to drift between the spec and the assertion. A param may be
|
|
14
|
+
a scalar or an array of scalars, so list-shaped constants (vendor blacklists, id
|
|
15
|
+
sets) get the same single source as a lone number.
|
|
14
16
|
|
|
15
|
-
See the authoritative design — [English](docs/en/attest-design.md) · [中文](docs/zh/attest-design.md) — and the rest of the [docs](docs
|
|
17
|
+
See the authoritative design — [English](https://gitlab.com/Pseudorca/attest/-/blob/main/docs/en/attest-design.md) · [中文](https://gitlab.com/Pseudorca/attest/-/blob/main/docs/zh/attest-design.md) — and the rest of the [docs](https://gitlab.com/Pseudorca/attest/-/tree/main/docs).
|
|
16
18
|
|
|
17
19
|
## Requirements
|
|
18
20
|
|
|
@@ -102,10 +104,15 @@ attest check --json
|
|
|
102
104
|
```
|
|
103
105
|
|
|
104
106
|
`verify` adds `passed` (was the test run itself green, independent of the
|
|
105
|
-
overall verdict); `cover` adds `coverage[]`
|
|
107
|
+
overall verdict); `cover` adds `coverage[]` — one `{ reqId, covered,
|
|
108
|
+
scenarioCount }` row per requirement — plus a `requirements` roll-up;
|
|
106
109
|
`archive` adds `change`. `schemaVersion` is bumped on any breaking change to
|
|
107
110
|
the shape. The TypeScript type is exported as `JsonReport`.
|
|
108
111
|
|
|
112
|
+
Even when a command crashes, `--json` still writes one parseable envelope
|
|
113
|
+
(`ok: false` with an `internal-error` issue) rather than an empty stdout — so a
|
|
114
|
+
consumer can always parse stdout and branch on `ok`.
|
|
115
|
+
|
|
109
116
|
## Development
|
|
110
117
|
|
|
111
118
|
```bash
|
|
@@ -118,7 +125,7 @@ pnpm lint
|
|
|
118
125
|
|
|
119
126
|
### Dogfooding
|
|
120
127
|
|
|
121
|
-
Attest describes its own behaviour under [`self/`](self
|
|
128
|
+
Attest describes its own behaviour under [`self/`](https://gitlab.com/Pseudorca/attest/-/tree/main/self) and verifies itself:
|
|
122
129
|
|
|
123
130
|
```bash
|
|
124
131
|
pnpm verify:self # attest verify self -> all green
|
|
@@ -128,7 +135,7 @@ pnpm verify:self # attest verify self -> all green
|
|
|
128
135
|
|
|
129
136
|
`pnpm test:consumer` packs a real tarball, `npm install`s it into a throwaway
|
|
130
137
|
project outside the repo, and drives the installed CLI against
|
|
131
|
-
[`fixtures/consumer/`](fixtures/consumer
|
|
138
|
+
[`fixtures/consumer/`](https://gitlab.com/Pseudorca/attest/-/tree/main/fixtures/consumer). It is the only test that exercises
|
|
132
139
|
the published surface — the `files` allowlist, the `exports` map, the `bin`
|
|
133
140
|
launcher, peer resolution from a foreign `node_modules` — so it is what catches
|
|
134
141
|
"green in-repo, broken once installed" bugs. It needs network and is excluded
|
|
@@ -145,4 +152,4 @@ OpenSpec source code is included.
|
|
|
145
152
|
|
|
146
153
|
## License
|
|
147
154
|
|
|
148
|
-
[MIT](LICENSE)
|
|
155
|
+
[MIT](https://gitlab.com/Pseudorca/attest/-/blob/main/LICENSE)
|
package/dist/cli/index.js
CHANGED
|
@@ -4,11 +4,14 @@
|
|
|
4
4
|
//
|
|
5
5
|
// Every command supports `--json`: same work, same exit code, but the only
|
|
6
6
|
// thing written to stdout is one machine-readable report (see cli/json.ts).
|
|
7
|
+
// The exit code is always derived from that report's `ok`, so the JSON verdict
|
|
8
|
+
// and the process status can never disagree — including on the crash path,
|
|
9
|
+
// where the report is an `internal-error` envelope instead of a bare stack.
|
|
7
10
|
import { Command } from 'commander';
|
|
8
11
|
import chalk from 'chalk';
|
|
9
12
|
import { runCheck, runVerify, runCover, runArchive } from '../core/pipeline.js';
|
|
10
|
-
import { formatIssues, summarize, formatCoverage
|
|
11
|
-
import { archiveReport, checkReport, coverReport, renderJson, verifyReport, } from './json.js';
|
|
13
|
+
import { formatIssues, summarize, formatCoverage } from './report.js';
|
|
14
|
+
import { archiveReport, checkReport, coverReport, errorReport, renderJson, verifyReport, } from './json.js';
|
|
12
15
|
import { packageVersion } from './version.js';
|
|
13
16
|
const VERSION = packageVersion();
|
|
14
17
|
const program = new Command();
|
|
@@ -21,77 +24,103 @@ function root(dir) {
|
|
|
21
24
|
}
|
|
22
25
|
const JSON_FLAG = '--json';
|
|
23
26
|
const JSON_HELP = 'emit one machine-readable JSON report on stdout';
|
|
27
|
+
/**
|
|
28
|
+
* Run one command's work with a single output + exit-code contract:
|
|
29
|
+
* - success: print the JSON report (`--json`) or the human rendering, and set
|
|
30
|
+
* the exit code from `report.ok` — the one source of the verdict.
|
|
31
|
+
* - failure: under `--json`, still emit one parseable `internal-error`
|
|
32
|
+
* envelope on stdout; otherwise print the stack on stderr. Exit code 1.
|
|
33
|
+
*/
|
|
34
|
+
async function runAction(command, opts, action) {
|
|
35
|
+
try {
|
|
36
|
+
const { report, human } = await action();
|
|
37
|
+
if (opts.json)
|
|
38
|
+
console.log(renderJson(report));
|
|
39
|
+
else
|
|
40
|
+
human();
|
|
41
|
+
process.exitCode = report.ok ? 0 : 1;
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
if (opts.json) {
|
|
45
|
+
console.log(renderJson(errorReport(VERSION, command, err)));
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
console.error(chalk.red(err instanceof Error ? err.stack ?? err.message : String(err)));
|
|
49
|
+
}
|
|
50
|
+
process.exitCode = 1;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
24
53
|
program
|
|
25
54
|
.command('check')
|
|
26
55
|
.description('Static structural validation (fast CI pre-check).')
|
|
27
56
|
.argument('[dir]', 'project root', undefined)
|
|
28
57
|
.option(JSON_FLAG, JSON_HELP)
|
|
29
|
-
.action(
|
|
58
|
+
.action((dir, opts) => runAction('check', opts, async () => {
|
|
30
59
|
const issues = await runCheck(root(dir));
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
});
|
|
60
|
+
return {
|
|
61
|
+
report: checkReport(VERSION, issues),
|
|
62
|
+
human: () => {
|
|
63
|
+
console.log(formatIssues(issues));
|
|
64
|
+
console.log(summarize(issues));
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}));
|
|
40
68
|
program
|
|
41
69
|
.command('verify')
|
|
42
70
|
.description('Run tests + coverage + drift, emit a graded report.')
|
|
43
71
|
.argument('[dir]', 'project root', undefined)
|
|
44
72
|
.option(JSON_FLAG, JSON_HELP)
|
|
45
|
-
.action(
|
|
73
|
+
.action((dir, opts) => runAction('verify', opts, async () => {
|
|
46
74
|
const { issues, passed, ok } = await runVerify(root(dir));
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
});
|
|
75
|
+
return {
|
|
76
|
+
report: verifyReport(VERSION, issues, passed, ok),
|
|
77
|
+
human: () => {
|
|
78
|
+
console.log(formatIssues(issues));
|
|
79
|
+
console.log(summarize(issues));
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
}));
|
|
56
83
|
program
|
|
57
84
|
.command('cover')
|
|
58
85
|
.description('Coverage report: which requirements lack a scenario.')
|
|
59
86
|
.argument('[dir]', 'project root', undefined)
|
|
60
87
|
.option(JSON_FLAG, JSON_HELP)
|
|
61
|
-
.action(
|
|
88
|
+
.action((dir, opts) => runAction('cover', opts, async () => {
|
|
62
89
|
const rows = await runCover(root(dir));
|
|
63
90
|
const uncovered = rows.filter((r) => !r.covered).length;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
});
|
|
91
|
+
return {
|
|
92
|
+
report: coverReport(VERSION, rows),
|
|
93
|
+
human: () => {
|
|
94
|
+
console.log(formatCoverage(rows));
|
|
95
|
+
console.log(chalk.dim(`— ${rows.length} requirement(s), ${uncovered} uncovered`));
|
|
96
|
+
},
|
|
97
|
+
};
|
|
98
|
+
}));
|
|
73
99
|
program
|
|
74
100
|
.command('archive')
|
|
75
101
|
.argument('<change>', 'change name to archive')
|
|
76
102
|
.argument('[dir]', 'project root', undefined)
|
|
77
103
|
.option(JSON_FLAG, JSON_HELP)
|
|
78
104
|
.description('Run the archive gate; merge only if it passes.')
|
|
79
|
-
.action(
|
|
105
|
+
.action((change, dir, opts) => runAction('archive', opts, async () => {
|
|
80
106
|
const blocking = await runArchive(root(dir), change);
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
107
|
+
return {
|
|
108
|
+
report: archiveReport(VERSION, change, blocking),
|
|
109
|
+
human: () => {
|
|
110
|
+
if (blocking.length === 0) {
|
|
111
|
+
console.log(chalk.green(`✓ Gate passed: change "${change}" can be archived.`));
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
console.log(chalk.red(`✗ Gate failed: change "${change}"`));
|
|
115
|
+
console.log(formatIssues(blocking));
|
|
116
|
+
console.log(summarize(blocking));
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
};
|
|
120
|
+
}));
|
|
94
121
|
program.parseAsync().catch((err) => {
|
|
122
|
+
// Last resort for failures outside a command action (e.g. arg parsing), which
|
|
123
|
+
// are not part of the per-command `--json` contract.
|
|
95
124
|
console.error(chalk.red(err instanceof Error ? err.stack ?? err.message : String(err)));
|
|
96
125
|
process.exitCode = 1;
|
|
97
126
|
});
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"m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;QAChD,KAAK,EAAE,GAAG,EAAE;YACV,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC1B,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,KAAK,CAAC,0BAA0B,MAAM,oBAAoB,CAAC,CAClE,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,0BAA0B,MAAM,GAAG,CAAC,CAAC,CAAC;gBAC5D,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC,CAAC;gBACpC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC;YACnC,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC,CAAC,CACH,CAAC;AAEJ,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IAC1C,8EAA8E;IAC9E,qDAAqD;IACrD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACxF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC"}
|
package/dist/cli/json.d.ts
CHANGED
|
@@ -36,6 +36,13 @@ export declare function checkReport(version: string, issues: Issue[]): JsonRepor
|
|
|
36
36
|
export declare function verifyReport(version: string, issues: Issue[], passed: boolean, ok: boolean): JsonReport;
|
|
37
37
|
export declare function coverReport(version: string, rows: CoverageRow[]): JsonReport;
|
|
38
38
|
export declare function archiveReport(version: string, change: string, blocking: Issue[]): JsonReport;
|
|
39
|
+
/**
|
|
40
|
+
* The envelope for a command that threw before it could produce a report. Keeps
|
|
41
|
+
* the `--json` contract intact on the crash path: a consumer still parses one
|
|
42
|
+
* document with `ok: false` and an `internal-error` issue, instead of getting an
|
|
43
|
+
* empty stdout and a stack trace on stderr.
|
|
44
|
+
*/
|
|
45
|
+
export declare function errorReport(version: string, command: JsonCommand, err: unknown): JsonReport;
|
|
39
46
|
/** Serialize a report for stdout. Pretty-printed: still one parseable document. */
|
|
40
47
|
export declare function renderJson(report: JsonReport): string;
|
|
41
48
|
//# sourceMappingURL=json.d.ts.map
|
package/dist/cli/json.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/cli/json.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/cli/json.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,OAAO,KAAK,EAAE,KAAK,EAAS,MAAM,kBAAkB,CAAC;AAErD,8DAA8D;AAC9D,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;AAEnE,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,QAAQ,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,WAAW,CAAC;IACrB,uEAAuE;IACvE,EAAE,EAAE,OAAO,CAAC;IACZ,OAAO,EAAE,WAAW,CAAC;IACrB,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,mDAAmD;IACnD,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;IACzB,kDAAkD;IAClD,YAAY,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IACrE,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAQD,wBAAgB,WAAW,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,WAAW,CAIxD;AAqBD,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAExE;AAED,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,KAAK,EAAE,EACf,MAAM,EAAE,OAAO,EACf,EAAE,EAAE,OAAO,GACV,UAAU,CAEZ;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,UAAU,CAW5E;AAED,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,KAAK,EAAE,GAChB,UAAU,CAUZ;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,WAAW,EACpB,GAAG,EAAE,OAAO,GACX,UAAU,CAIZ;AAED,mFAAmF;AACnF,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAErD"}
|
package/dist/cli/json.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
// The shape is a contract: `schemaVersion` is bumped on any breaking change,
|
|
6
6
|
// and every command emits the same envelope (tool/version/command/ok/summary/
|
|
7
7
|
// issues) plus command-specific fields.
|
|
8
|
+
import { hasError } from '../core/types.js';
|
|
8
9
|
/** Bumped whenever the emitted shape changes incompatibly. */
|
|
9
10
|
export const SCHEMA_VERSION = 1;
|
|
10
11
|
const LEVEL_KEY = {
|
|
@@ -30,8 +31,7 @@ function envelope({ version, command, ok, issues = [] }) {
|
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
33
|
export function checkReport(version, issues) {
|
|
33
|
-
|
|
34
|
-
return envelope({ version, command: 'check', ok, issues });
|
|
34
|
+
return envelope({ version, command: 'check', ok: !hasError(issues), issues });
|
|
35
35
|
}
|
|
36
36
|
export function verifyReport(version, issues, passed, ok) {
|
|
37
37
|
return { ...envelope({ version, command: 'verify', ok, issues }), passed };
|
|
@@ -59,6 +59,17 @@ export function archiveReport(version, change, blocking) {
|
|
|
59
59
|
change,
|
|
60
60
|
};
|
|
61
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* The envelope for a command that threw before it could produce a report. Keeps
|
|
64
|
+
* the `--json` contract intact on the crash path: a consumer still parses one
|
|
65
|
+
* document with `ok: false` and an `internal-error` issue, instead of getting an
|
|
66
|
+
* empty stdout and a stack trace on stderr.
|
|
67
|
+
*/
|
|
68
|
+
export function errorReport(version, command, err) {
|
|
69
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
70
|
+
const issue = { level: 'ERROR', code: 'internal-error', message };
|
|
71
|
+
return envelope({ version, command, ok: false, issues: [issue] });
|
|
72
|
+
}
|
|
62
73
|
/** Serialize a report for stdout. Pretty-printed: still one parseable document. */
|
|
63
74
|
export function renderJson(report) {
|
|
64
75
|
return JSON.stringify(report, null, 2);
|
package/dist/cli/json.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../src/cli/json.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,yEAAyE;AACzE,8EAA8E;AAC9E,EAAE;AACF,6EAA6E;AAC7E,8EAA8E;AAC9E,wCAAwC;
|
|
1
|
+
{"version":3,"file":"json.js","sourceRoot":"","sources":["../../src/cli/json.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,yEAAyE;AACzE,8EAA8E;AAC9E,EAAE;AACF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I,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACzC,CAAC"}
|
package/dist/cli/report.d.ts
CHANGED
|
@@ -3,5 +3,4 @@ import type { Issue } from '../core/types.js';
|
|
|
3
3
|
export declare function formatIssues(issues: Issue[]): string;
|
|
4
4
|
export declare function summarize(issues: Issue[]): string;
|
|
5
5
|
export declare function formatCoverage(rows: CoverageRow[]): string;
|
|
6
|
-
export declare function hasError(issues: Issue[]): boolean;
|
|
7
6
|
//# sourceMappingURL=report.d.ts.map
|
package/dist/cli/report.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/cli/report.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,KAAK,EAAS,MAAM,kBAAkB,CAAC;AAUrD,wBAAgB,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAWpD;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAMjD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,MAAM,CAW1D
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/cli/report.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,KAAK,EAAE,KAAK,EAAS,MAAM,kBAAkB,CAAC;AAUrD,wBAAgB,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAWpD;AAED,wBAAgB,SAAS,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAMjD;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,MAAM,CAW1D"}
|
package/dist/cli/report.js
CHANGED
package/dist/cli/report.js.map
C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AAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC3D,MAAM,MAAM,GAAG,CAAC,CAAC,OAAO;YACtB,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,aAAa,YAAY,CAAC,CAAC,aAAa,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;YAC7E,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC7B,OAAO,KAAK,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,MAAM,EAAE,CAAC;IACvD,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/core/pipeline.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../src/core/pipeline.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAc,KAAK,EAAY,MAAM,YAAY,CAAC;AAE9D,2DAA2D;AAC3D,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,CAa7D;AAED,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,EAAE,EAAE,OAAO,CAAC;CACb;AAED,4DAA4D;AAC5D,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAmCnE;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,wDAAwD;AACxD,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAmBnE;AAED,4EAA4E;AAC5E,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC,CA8CnF;AAED,qFAAqF;AACrF,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAE7D"}
|
package/dist/core/pipeline.js
CHANGED
|
@@ -8,6 +8,7 @@ import { applyDelta } from './apply.js';
|
|
|
8
8
|
import { evaluateGate } from './gate.js';
|
|
9
9
|
import { join, relative } from 'node:path';
|
|
10
10
|
import { configDefaults } from 'vitest/config';
|
|
11
|
+
import { hasError } from './types.js';
|
|
11
12
|
/** Static structural check (design §9: `attest check`). */
|
|
12
13
|
export async function runCheck(root) {
|
|
13
14
|
const loader = await createLoader();
|
|
@@ -57,8 +58,7 @@ export async function runVerify(root) {
|
|
|
57
58
|
});
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
|
-
|
|
61
|
-
return { issues, passed: run.passed, ok: run.passed && !hasError };
|
|
61
|
+
return { issues, passed: run.passed, ok: run.passed && !hasError(issues) };
|
|
62
62
|
}
|
|
63
63
|
/** Coverage-only report (design §9: `attest cover`). */
|
|
64
64
|
export async function runCover(root) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pipeline.js","sourceRoot":"","sources":["../../src/core/pipeline.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,iFAAiF;AAEjF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,SAAS,GACV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACzE,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,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AAQ,CAAC,IAAY;IACzC,OAAO,CAAC,MAAM,SAAS,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AAC3E,CAAC"}
|
package/dist/core/schema.d.ts
CHANGED
|
@@ -3,34 +3,34 @@ import { z } from 'zod';
|
|
|
3
3
|
export declare const RequirementSchema: z.ZodObject<{
|
|
4
4
|
statement: z.ZodEffects<z.ZodString, string, string>;
|
|
5
5
|
rationale: z.ZodString;
|
|
6
|
-
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodBoolean]>>>;
|
|
6
|
+
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodBoolean]>, "many">]>>>;
|
|
7
7
|
outOfScope: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
8
8
|
}, "strip", z.ZodTypeAny, {
|
|
9
|
-
params: Record<string, string | number | boolean>;
|
|
9
|
+
params: Record<string, string | number | boolean | (string | number | boolean)[]>;
|
|
10
10
|
statement: string;
|
|
11
11
|
rationale: string;
|
|
12
12
|
outOfScope: string[];
|
|
13
13
|
}, {
|
|
14
14
|
statement: string;
|
|
15
15
|
rationale: string;
|
|
16
|
-
params?: Record<string, string | number | boolean> | undefined;
|
|
16
|
+
params?: Record<string, string | number | boolean | (string | number | boolean)[]> | undefined;
|
|
17
17
|
outOfScope?: string[] | undefined;
|
|
18
18
|
}>;
|
|
19
19
|
/** The requirement registry: stable ID -> requirement (design §2, §5.1). */
|
|
20
20
|
export declare const RegistrySchema: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
21
21
|
statement: z.ZodEffects<z.ZodString, string, string>;
|
|
22
22
|
rationale: z.ZodString;
|
|
23
|
-
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodBoolean]>>>;
|
|
23
|
+
params: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodBoolean]>, "many">]>>>;
|
|
24
24
|
outOfScope: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
25
25
|
}, "strip", z.ZodTypeAny, {
|
|
26
|
-
params: Record<string, string | number | boolean>;
|
|
26
|
+
params: Record<string, string | number | boolean | (string | number | boolean)[]>;
|
|
27
27
|
statement: string;
|
|
28
28
|
rationale: string;
|
|
29
29
|
outOfScope: string[];
|
|
30
30
|
}, {
|
|
31
31
|
statement: string;
|
|
32
32
|
rationale: string;
|
|
33
|
-
params?: Record<string, string | number | boolean> | undefined;
|
|
33
|
+
params?: Record<string, string | number | boolean | (string | number | boolean)[]> | undefined;
|
|
34
34
|
outOfScope?: string[] | undefined;
|
|
35
35
|
}>>;
|
|
36
36
|
/** Parsed (output) shapes — defaults applied. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/core/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,iDAAiD;AACjD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/core/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,iDAAiD;AACjD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;EAkB5B,CAAC;AAEH,4EAA4E;AAC5E,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;GAG1B,CAAC;AAEF,iDAAiD;AACjD,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAEtD,+DAA+D;AAC/D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AACjE,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
package/dist/core/schema.js
CHANGED
|
@@ -10,8 +10,15 @@ export const RequirementSchema = z.object({
|
|
|
10
10
|
message: 'statement must contain the RFC-2119 keyword SHALL or MUST',
|
|
11
11
|
}),
|
|
12
12
|
rationale: z.string().min(10, 'rationale must not be empty (the intent layer has to say why)'),
|
|
13
|
+
// A param is a scalar or a homogeneous-enough list of scalars. Lists (vendor
|
|
14
|
+
// blacklists, id sets) are the most drift-prone constants, so keeping them out
|
|
15
|
+
// of params left the highest-risk values unguarded; an array still has exactly
|
|
16
|
+
// one owner (the spec) read by exactly one place (the scenario).
|
|
13
17
|
params: z
|
|
14
|
-
.record(z.string(),
|
|
18
|
+
.record(z.string(), (() => {
|
|
19
|
+
const scalar = z.union([z.number(), z.string(), z.boolean()]);
|
|
20
|
+
return z.union([scalar, z.array(scalar)]);
|
|
21
|
+
})())
|
|
15
22
|
.default({}),
|
|
16
23
|
outOfScope: z.array(z.string()).default([]),
|
|
17
24
|
});
|
package/dist/core/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/core/schema.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,4EAA4E;AAC5E,gEAAgE;AAEhE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,iDAAiD;AACjD,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,SAAS,EAAE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,EAAE,CAAC,CAAC,CAAC;QAC9D,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC5C,CAAC,CAAC,EAAE,CAAC;SACJ,OAAO,CAAC,EAAE,CAAC;IACd,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;CAC5C,CAAC,CAAC;AAEH,4EAA4E;AAC5E,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CACpC,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE,0BAA0B,CAAC,EAC5D,iBAAiB,CAClB,CAAC"}
|
package/dist/core/types.d.ts
CHANGED
|
@@ -44,4 +44,10 @@ export interface Issue {
|
|
|
44
44
|
line?: number;
|
|
45
45
|
message: string;
|
|
46
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Whether an issue set is failing: true iff it contains any ERROR. This is the
|
|
49
|
+
* single predicate the pipeline verdict, the JSON `ok`, and the CLI exit code
|
|
50
|
+
* all read from, so those three can never disagree (design §5.3).
|
|
51
|
+
*/
|
|
52
|
+
export declare function hasError(issues: Issue[]): boolean;
|
|
47
53
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/core/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAIA,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEzD,sEAAsE;AACtE,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB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A8D;AAC9D,MAAM,WAAW,SAAS;IACxB,gCAAgC;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,kFAAkF;IAClF,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;CAC3C;AAED,0DAA0D;AAC1D,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,KAAK,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAEjD"}
|
package/dist/core/types.js
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
// Central strongly-typed model for Attest.
|
|
2
2
|
// Requirement / Registry are inferred from the Zod schema (design §5.1, the
|
|
3
3
|
// single source of truth for the intent layer); the remaining shapes live here.
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Whether an issue set is failing: true iff it contains any ERROR. This is the
|
|
6
|
+
* single predicate the pipeline verdict, the JSON `ok`, and the CLI exit code
|
|
7
|
+
* all read from, so those three can never disagree (design §5.3).
|
|
8
|
+
*/
|
|
9
|
+
export function hasError(issues) {
|
|
10
|
+
return issues.some((i) => i.level === 'ERROR');
|
|
11
|
+
}
|
|
5
12
|
//# sourceMappingURL=types.js.map
|
package/dist/core/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,4EAA4E;AAC5E,gFAAgF"}
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/core/types.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,4EAA4E;AAC5E,gFAAgF;AAuDhF;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAC,MAAe;IACtC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,OAAO,CAAC,CAAC;AACjD,CAAC"}
|
package/dist/core/validator.d.ts
CHANGED
|
@@ -7,9 +7,12 @@ import type { AttestPlan, Issue, ParamRef, Registry } from './types.js';
|
|
|
7
7
|
*/
|
|
8
8
|
export declare function validateStructure(registry: Registry, plan: AttestPlan): Issue[];
|
|
9
9
|
/**
|
|
10
|
-
* Weak anti-drift heuristic (design §6, mechanism 3).
|
|
11
|
-
* scenario
|
|
12
|
-
*
|
|
10
|
+
* Weak anti-drift heuristic (design §6, mechanism 3). Evaluated per requirement,
|
|
11
|
+
* not per scenario: a requirement that owns params is quiet as soon as *any* one
|
|
12
|
+
* of its covering scenarios reads them. Flagging each individual scenario that
|
|
13
|
+
* happens not to read params punishes correct multi-facet requirements with
|
|
14
|
+
* noise that can never be cleared — and noise that can never be cleared stops
|
|
15
|
+
* being read, the exact failure this heuristic exists to prevent.
|
|
13
16
|
*/
|
|
14
17
|
export declare function detectPotentialDrift(registry: Registry, plan: AttestPlan, refs: ParamRef[]): Issue[];
|
|
15
18
|
//# sourceMappingURL=validator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../src/core/validator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAExE;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,GAAG,KAAK,EAAE,CA+C/E;AAED
|
|
1
|
+
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../src/core/validator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAExE;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,GAAG,KAAK,EAAE,CA+C/E;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,QAAQ,EAAE,GACf,KAAK,EAAE,CAuBT"}
|
package/dist/core/validator.js
CHANGED
|
@@ -51,27 +51,34 @@ export function validateStructure(registry, plan) {
|
|
|
51
51
|
return issues;
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
|
-
* Weak anti-drift heuristic (design §6, mechanism 3).
|
|
55
|
-
* scenario
|
|
56
|
-
*
|
|
54
|
+
* Weak anti-drift heuristic (design §6, mechanism 3). Evaluated per requirement,
|
|
55
|
+
* not per scenario: a requirement that owns params is quiet as soon as *any* one
|
|
56
|
+
* of its covering scenarios reads them. Flagging each individual scenario that
|
|
57
|
+
* happens not to read params punishes correct multi-facet requirements with
|
|
58
|
+
* noise that can never be cleared — and noise that can never be cleared stops
|
|
59
|
+
* being read, the exact failure this heuristic exists to prevent.
|
|
57
60
|
*/
|
|
58
61
|
export function detectPotentialDrift(registry, plan, refs) {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
:
|
|
75
|
-
|
|
62
|
+
const readsParams = new Set(refs.map((r) => r.reqId));
|
|
63
|
+
const issues = [];
|
|
64
|
+
for (const [id, req] of Object.entries(registry)) {
|
|
65
|
+
if (Object.keys(req.params).length === 0)
|
|
66
|
+
continue;
|
|
67
|
+
const covering = plan.scenarios.filter((s) => s.reqId === id);
|
|
68
|
+
if (covering.length === 0 || readsParams.has(id))
|
|
69
|
+
continue;
|
|
70
|
+
// Anchor the hint at the first covering scenario so it stays clickable,
|
|
71
|
+
// even though the verdict is now about the requirement as a whole.
|
|
72
|
+
const at = covering[0];
|
|
73
|
+
issues.push({
|
|
74
|
+
level: 'INFO',
|
|
75
|
+
code: 'possible-drift',
|
|
76
|
+
reqId: id,
|
|
77
|
+
file: at.file,
|
|
78
|
+
line: at.line,
|
|
79
|
+
message: `${id} owns params, but none of its scenarios read them — a hardcoded literal could be drifting here.`,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
return issues;
|
|
76
83
|
}
|
|
77
84
|
//# sourceMappingURL=validator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../../src/core/validator.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,8EAA8E;AAI9E;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,QAAkB,EAAE,IAAgB;IACpE,MAAM,MAAM,GAAY,EAAE,CAAC;IAC3B,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;IAChD,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAE/D,yDAAyD;IACzD,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;QAC/B,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3B,MAAM,CAAC,IAAI,CAAC;gBACV,KAAK,EAAE,OAAO;gBACd,IAAI,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AAQ,CAAC,CAAC,CAAE,CAAC;QACxB,MAAM,CAAC,IAAI,CAAC;YACV,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,gBAAgB;YACtB,KAAK,EAAE,EAAE;YACT,IAAI,EAAE,EAAE,CAAC,IAAI;YACb,IAAI,EAAE,EAAE,CAAC,IAAI;YACb,OAAO,EAAE,GAAG,EAAE,iGAAiG;SAChH,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@am_shork/attest",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "TDD-native spec framework: tests are the source of truth for verification, ID-bound requirements the source of truth for intent.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"zod": "^3.23.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
|
-
"vite": "^5.0.0 || ^6.0.0",
|
|
54
|
-
"vitest": "^2.0.0 || ^3.0.0"
|
|
53
|
+
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0",
|
|
54
|
+
"vitest": "^2.0.0 || ^3.0.0 || ^4.0.0"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@eslint/js": "^9.9.0",
|