@am_shork/attest 0.2.2 → 0.3.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/CHANGELOG.md +593 -61
- package/README.md +121 -18
- package/dist/cli/index.js +91 -21
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/json.d.ts +52 -5
- package/dist/cli/json.d.ts.map +1 -1
- package/dist/cli/json.js +50 -2
- package/dist/cli/json.js.map +1 -1
- package/dist/cli/report.d.ts +11 -1
- package/dist/cli/report.d.ts.map +1 -1
- package/dist/cli/report.js +52 -0
- package/dist/cli/report.js.map +1 -1
- package/dist/core/apply.d.ts +8 -0
- package/dist/core/apply.d.ts.map +1 -1
- package/dist/core/apply.js +10 -0
- package/dist/core/apply.js.map +1 -1
- package/dist/core/gate.d.ts +27 -1
- package/dist/core/gate.d.ts.map +1 -1
- package/dist/core/gate.js +48 -1
- package/dist/core/gate.js.map +1 -1
- package/dist/core/loader.d.ts +8 -0
- package/dist/core/loader.d.ts.map +1 -1
- package/dist/core/loader.js +1 -0
- package/dist/core/loader.js.map +1 -1
- package/dist/core/locate.d.ts +4 -0
- package/dist/core/locate.d.ts.map +1 -1
- package/dist/core/locate.js +8 -3
- package/dist/core/locate.js.map +1 -1
- package/dist/core/paths.d.ts +15 -0
- package/dist/core/paths.d.ts.map +1 -0
- package/dist/core/paths.js +36 -0
- package/dist/core/paths.js.map +1 -0
- package/dist/core/pipeline.d.ts +63 -2
- package/dist/core/pipeline.d.ts.map +1 -1
- package/dist/core/pipeline.js +190 -34
- package/dist/core/pipeline.js.map +1 -1
- package/dist/core/red-record.d.ts +50 -0
- package/dist/core/red-record.d.ts.map +1 -0
- package/dist/core/red-record.js +148 -0
- package/dist/core/red-record.js.map +1 -0
- package/dist/core/render.d.ts +1 -1
- package/dist/core/render.d.ts.map +1 -1
- package/dist/core/render.js +16 -2
- package/dist/core/render.js.map +1 -1
- package/dist/core/runner.d.ts.map +1 -1
- package/dist/core/runner.js +16 -6
- package/dist/core/runner.js.map +1 -1
- package/dist/core/skill.d.ts +23 -0
- package/dist/core/skill.d.ts.map +1 -0
- package/dist/core/skill.js +276 -0
- package/dist/core/skill.js.map +1 -0
- package/dist/core/static-registry.d.ts +28 -0
- package/dist/core/static-registry.d.ts.map +1 -1
- package/dist/core/static-registry.js +86 -25
- package/dist/core/static-registry.js.map +1 -1
- package/dist/core/status.d.ts +39 -0
- package/dist/core/status.d.ts.map +1 -0
- package/dist/core/status.js +64 -0
- package/dist/core/status.js.map +1 -0
- package/dist/core/targets.d.ts +52 -0
- package/dist/core/targets.d.ts.map +1 -0
- package/dist/core/targets.js +141 -0
- package/dist/core/targets.js.map +1 -0
- package/dist/core/types.d.ts +13 -0
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/types.js.map +1 -1
- package/dist/core/validator.d.ts +11 -0
- package/dist/core/validator.d.ts.map +1 -1
- package/dist/core/validator.js +28 -12
- package/dist/core/validator.js.map +1 -1
- package/dist/core/write.d.ts +2 -0
- package/dist/core/write.d.ts.map +1 -0
- package/dist/core/write.js +21 -0
- package/dist/core/write.js.map +1 -0
- package/dist/runtime.d.ts +9 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +10 -2
- package/dist/runtime.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"static-registry.js","sourceRoot":"","sources":["../../src/core/static-registry.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"static-registry.js","sourceRoot":"","sources":["../../src/core/static-registry.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,qEAAqE;AACrE,EAAE;AACF,+EAA+E;AAC/E,+EAA+E;AAC/E,iFAAiF;AACjF,iFAAiF;AACjF,4EAA4E;AAC5E,2EAA2E;AAC3E,EAAE;AACF,+EAA+E;AAC/E,8EAA8E;AAC9E,4EAA4E;AAC5E,kBAAkB;AAClB,EAAE;AACF,iFAAiF;AACjF,iFAAiF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EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC;IACvD,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,SAAS,CAAC,IAAI,EAAE,uCAAuC,CAAC,CAAC;IAC5F,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { RedRecord } from './red-record.js';
|
|
2
|
+
import type { AttestPlan, Outcome } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* What remains for one added requirement. Each name is the gate issue it
|
|
5
|
+
* predicts: `no-scenario` is `uncovered-requirement`, `unproven` is `never-red`,
|
|
6
|
+
* and `proven` is the absence of both.
|
|
7
|
+
*/
|
|
8
|
+
export type ObligationState = 'no-scenario' | 'unproven' | 'proven';
|
|
9
|
+
export interface ScenarioStatus {
|
|
10
|
+
name: string;
|
|
11
|
+
file: string;
|
|
12
|
+
line: number;
|
|
13
|
+
/**
|
|
14
|
+
* The recorded first run, or `null` when the record has never seen it.
|
|
15
|
+
*
|
|
16
|
+
* Kept as a third value rather than folded into a boolean because the two
|
|
17
|
+
* fixes differ, exactly as they do in the gate's two `never-red` messages: a
|
|
18
|
+
* recorded `pass` means the scenario does not test what it claims, while
|
|
19
|
+
* nothing recorded means the workflow's stage-1 run was skipped.
|
|
20
|
+
*/
|
|
21
|
+
firstRun: Outcome | null;
|
|
22
|
+
}
|
|
23
|
+
export interface StatusRow {
|
|
24
|
+
reqId: string;
|
|
25
|
+
state: ObligationState;
|
|
26
|
+
scenarios: ScenarioStatus[];
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* One row per id the change adds, in id order.
|
|
30
|
+
*
|
|
31
|
+
* Ordered through the same code-unit comparator as everything else Attest
|
|
32
|
+
* commits or compares, so the report is a function of the input alone.
|
|
33
|
+
* Scenarios keep plan order — file, then line — because that is the order the
|
|
34
|
+
* author reads them in.
|
|
35
|
+
*/
|
|
36
|
+
export declare function statusRows(addedIds: readonly string[], plan: AttestPlan, firstRun: RedRecord): StatusRow[];
|
|
37
|
+
/** How many rows are in each state — the roll-up both renderings need. */
|
|
38
|
+
export declare function statusCounts(rows: readonly StatusRow[]): Record<ObligationState, number>;
|
|
39
|
+
//# sourceMappingURL=status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../src/core/status.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAEtD;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEpE,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;OAOG;IACH,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,eAAe,CAAC;IACvB,SAAS,EAAE,cAAc,EAAE,CAAC;CAC7B;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CACxB,QAAQ,EAAE,SAAS,MAAM,EAAE,EAC3B,IAAI,EAAE,UAAU,EAChB,QAAQ,EAAE,SAAS,GAClB,SAAS,EAAE,CAYb;AAeD,0EAA0E;AAC1E,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,SAAS,EAAE,GAAG,MAAM,CAAC,eAAe,EAAE,MAAM,CAAC,CAQxF"}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// Per-change progress: which of the gate's obligations a change has already
|
|
2
|
+
// met, computed from what can be read without running the suite (design §6, §8).
|
|
3
|
+
//
|
|
4
|
+
// `archive` is a change's only other touchpoint and it answers exactly one
|
|
5
|
+
// question — does the gate pass. Between "not started" and "archivable" there
|
|
6
|
+
// was no reportable state at all, so neither a person nor an agent could ask
|
|
7
|
+
// what remained without reading the delta and inferring.
|
|
8
|
+
//
|
|
9
|
+
// **This is a projection of the gate, not a second gate.** Every state here is
|
|
10
|
+
// named after the issue the gate will raise if the change is archived as it
|
|
11
|
+
// stands, and the obligation predicate is the gate's own (`hasRecordedRed`), so
|
|
12
|
+
// the two cannot answer differently about the same change. What it deliberately
|
|
13
|
+
// cannot answer is `tests-red`: that needs the suite, and a `status` that ran the
|
|
14
|
+
// suite would be `verify` with a filter. The last honest state is therefore
|
|
15
|
+
// "everything readable is in order", never "done".
|
|
16
|
+
//
|
|
17
|
+
// **Scoped to the ids the change ADDs**, for the same reason the never-red
|
|
18
|
+
// obligation is (design §6): a modified or removed requirement carries no
|
|
19
|
+
// obligation this command could report progress against, so listing one would
|
|
20
|
+
// add a row with nothing to do about it.
|
|
21
|
+
import { byCodeUnit } from './order.js';
|
|
22
|
+
import { hasRecordedRed, recordedOutcome } from './red-record.js';
|
|
23
|
+
/**
|
|
24
|
+
* One row per id the change adds, in id order.
|
|
25
|
+
*
|
|
26
|
+
* Ordered through the same code-unit comparator as everything else Attest
|
|
27
|
+
* commits or compares, so the report is a function of the input alone.
|
|
28
|
+
* Scenarios keep plan order — file, then line — because that is the order the
|
|
29
|
+
* author reads them in.
|
|
30
|
+
*/
|
|
31
|
+
export function statusRows(addedIds, plan, firstRun) {
|
|
32
|
+
return [...addedIds].sort(byCodeUnit).map((reqId) => {
|
|
33
|
+
const scenarios = plan.scenarios
|
|
34
|
+
.filter((s) => s.reqId === reqId)
|
|
35
|
+
.map((s) => ({
|
|
36
|
+
name: s.name,
|
|
37
|
+
file: s.file,
|
|
38
|
+
line: s.line,
|
|
39
|
+
firstRun: recordedOutcome(firstRun, reqId, s.name) ?? null,
|
|
40
|
+
}));
|
|
41
|
+
return { reqId, state: obligationState(reqId, scenarios, firstRun), scenarios };
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
function obligationState(reqId, scenarios, firstRun) {
|
|
45
|
+
if (scenarios.length === 0)
|
|
46
|
+
return 'no-scenario';
|
|
47
|
+
// Every scenario, not any: the gate raises never-red per scenario, so one
|
|
48
|
+
// proven scenario beside an unproven one is still a blocked change.
|
|
49
|
+
return scenarios.every((s) => hasRecordedRed(firstRun, reqId, s.name))
|
|
50
|
+
? 'proven'
|
|
51
|
+
: 'unproven';
|
|
52
|
+
}
|
|
53
|
+
/** How many rows are in each state — the roll-up both renderings need. */
|
|
54
|
+
export function statusCounts(rows) {
|
|
55
|
+
const counts = {
|
|
56
|
+
'no-scenario': 0,
|
|
57
|
+
unproven: 0,
|
|
58
|
+
proven: 0,
|
|
59
|
+
};
|
|
60
|
+
for (const row of rows)
|
|
61
|
+
counts[row.state]++;
|
|
62
|
+
return counts;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../src/core/status.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,iFAAiF;AACjF,EAAE;AACF,2EAA2E;AAC3E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,EAAE;AACF,+EAA+E;AAC/E,4EAA4E;AAC5E,gFAAgF;AAChF,gFAAgF;AAChF,kFAAkF;AAClF,4EAA4E;AAC5E,mDAAmD;AACnD,EAAE;AACF,2EAA2E;AAC3E,0EAA0E;AAC1E,8EAA8E;AAC9E,yCAAyC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAgClE;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CACxB,QAA2B,EAC3B,IAAgB,EAChB,QAAmB;IAEnB,OAAO,CAAC,GAAG,QAAQ,CAAC,CAAC,IAAI,CAAC,UAAU,CAA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B,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Issue } from './types.js';
|
|
2
|
+
/** One agent's instructions: a path Attest owns, and the bytes to put there. */
|
|
3
|
+
export interface AgentTarget {
|
|
4
|
+
/** The value `attest init --target <name>` accepts. */
|
|
5
|
+
name: string;
|
|
6
|
+
/** The tool this reaches, for `--help` and the human report. */
|
|
7
|
+
tool: string;
|
|
8
|
+
/**
|
|
9
|
+
* Where the file goes, relative to the project root, spelled `/` on every
|
|
10
|
+
* platform (ATX-28) because it is also what the report carries.
|
|
11
|
+
*/
|
|
12
|
+
file: string;
|
|
13
|
+
/** The whole file. A pure function of nothing at all — see `workflowBody`. */
|
|
14
|
+
content(): string;
|
|
15
|
+
}
|
|
16
|
+
/** Where the Claude Code skill goes, relative to the project root. */
|
|
17
|
+
export declare const SKILL_FILE = ".claude/skills/attest/SKILL.md";
|
|
18
|
+
/**
|
|
19
|
+
* The Claude Code skill (ATX-27). `name` is what the user types to invoke it by
|
|
20
|
+
* hand; `description` is what loads it without being asked.
|
|
21
|
+
*/
|
|
22
|
+
export declare function skillContent(): string;
|
|
23
|
+
/**
|
|
24
|
+
* Every target `init` can write, in the order it writes them.
|
|
25
|
+
*
|
|
26
|
+
* The order is this table's, never the order the flags were typed: two runs
|
|
27
|
+
* asking for the same set have to produce the same report.
|
|
28
|
+
*/
|
|
29
|
+
export declare const TARGETS: readonly AgentTarget[];
|
|
30
|
+
/**
|
|
31
|
+
* What `init` writes when the user names no target.
|
|
32
|
+
*
|
|
33
|
+
* One target rather than all of them: the others are files in a repository
|
|
34
|
+
* whose owner did not ask for them, and a tool that scatters configuration for
|
|
35
|
+
* editors nobody here uses is a tool people stop running.
|
|
36
|
+
*/
|
|
37
|
+
export declare const DEFAULT_TARGET = "claude";
|
|
38
|
+
export declare const TARGET_NAMES: readonly string[];
|
|
39
|
+
/**
|
|
40
|
+
* Resolve requested names to targets, or refuse the whole set.
|
|
41
|
+
*
|
|
42
|
+
* All-or-nothing on purpose, and the caller writes nothing while `issues` is
|
|
43
|
+
* non-empty: a name already known to be unwritable must not leave half a set of
|
|
44
|
+
* instruction files behind, in the same way `archive` validates a change name
|
|
45
|
+
* before a loader is even created. Duplicates collapse, because asking twice is
|
|
46
|
+
* not asking for two files.
|
|
47
|
+
*/
|
|
48
|
+
export declare function resolveTargets(names: readonly string[]): {
|
|
49
|
+
targets: AgentTarget[];
|
|
50
|
+
issues: Issue[];
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=targets.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"targets.d.ts","sourceRoot":"","sources":["../../src/core/targets.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGxC,gFAAgF;AAChF,MAAM,WAAW,WAAW;IAC1B,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;IACb,gEAAgE;IAChE,IAAI,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,8EAA8E;IAC9E,OAAO,IAAI,MAAM,CAAC;CACnB;AAED,sEAAsE;AACtE,eAAO,MAAM,UAAU,mCAAmC,CAAC;AAE3D;;;GAGG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAQrC;AAwCD;;;;;GAKG;AACH,eAAO,MAAM,OAAO,EAAE,SAAS,WAAW,EAmBzC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,WAAW,CAAC;AAEvC,eAAO,MAAM,YAAY,EAAE,SAAS,MAAM,EAA+B,CAAC;AAE1E;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG;IACxD,OAAO,EAAE,WAAW,EAAE,CAAC;IACvB,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB,CAgBA"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
// Where the workflow document goes, per agent (design §9).
|
|
2
|
+
//
|
|
3
|
+
// `attest init` wrote one file, `.claude/skills/attest/SKILL.md`, so an adopter
|
|
4
|
+
// whose agent reads somewhere else got the engine and not the workflow — the
|
|
5
|
+
// exact gap `init` exists to close, open for every tool but one. A target is a
|
|
6
|
+
// destination path plus the frontmatter that tool reads; the document itself is
|
|
7
|
+
// `skill.ts` and is the same bytes for all of them.
|
|
8
|
+
//
|
|
9
|
+
// **Two rules decide what may become a target, and neither is about effort.**
|
|
10
|
+
//
|
|
11
|
+
// 1. *Attest owns the path.* `.claude/skills/attest/SKILL.md` exists because
|
|
12
|
+
// Attest exists, and so does every path below. `AGENTS.md` and `CLAUDE.md`
|
|
13
|
+
// exist because the *project* does, and what is in them is prose their
|
|
14
|
+
// maintainer curated: writing there is a read-modify-write on someone else's
|
|
15
|
+
// document, whose failure modes are destructive on a file the user cannot
|
|
16
|
+
// regenerate, and it would demote idempotence from a property of a pure
|
|
17
|
+
// function to a behaviour needing test coverage. That is a permanent scoping
|
|
18
|
+
// rule (design §9), not a gap waiting to be filled — an adopter whose agent
|
|
19
|
+
// reads such a file writes one line pointing at one of these instead.
|
|
20
|
+
// 2. *The instructions load on demand.* A skill body is fetched when its
|
|
21
|
+
// description matches, a Cursor rule when the agent asks for it, a Copilot
|
|
22
|
+
// instructions file when the open path matches its `applyTo`. A carrier that
|
|
23
|
+
// is unconditionally resident charges every unrelated request in the repo for
|
|
24
|
+
// a workflow it will not use.
|
|
25
|
+
//
|
|
26
|
+
// Adding a target is a row in the table below plus a scenario: the document,
|
|
27
|
+
// the writer and the CLI are already general over it.
|
|
28
|
+
import { WORKFLOW_DESCRIPTION, workflowBody } from './skill.js';
|
|
29
|
+
/** Where the Claude Code skill goes, relative to the project root. */
|
|
30
|
+
export const SKILL_FILE = '.claude/skills/attest/SKILL.md';
|
|
31
|
+
/**
|
|
32
|
+
* The Claude Code skill (ATX-27). `name` is what the user types to invoke it by
|
|
33
|
+
* hand; `description` is what loads it without being asked.
|
|
34
|
+
*/
|
|
35
|
+
export function skillContent() {
|
|
36
|
+
return `---
|
|
37
|
+
name: attest
|
|
38
|
+
description: ${WORKFLOW_DESCRIPTION}
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
${workflowBody()}
|
|
42
|
+
`;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* A Cursor project rule. `alwaysApply: false` with a description is Cursor's
|
|
46
|
+
* agent-requested mode — the model pulls the rule in when the description
|
|
47
|
+
* matches, which is the same loading model as the skill. Deliberately no
|
|
48
|
+
* `globs`: that is the auto-attach mode, and it would make the rule fire on a
|
|
49
|
+
* file being open rather than on the work being about intent.
|
|
50
|
+
*/
|
|
51
|
+
function cursorContent() {
|
|
52
|
+
return `---
|
|
53
|
+
description: ${WORKFLOW_DESCRIPTION}
|
|
54
|
+
alwaysApply: false
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
${workflowBody()}
|
|
58
|
+
`;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* A Copilot instructions file. Copilot has no description-triggered mode, so
|
|
62
|
+
* the trigger is the path: `applyTo` is the intent layer, the specs and a change
|
|
63
|
+
* folder — where the decisions this document is about are made.
|
|
64
|
+
*
|
|
65
|
+
* The limit is real and is the reason the glob is not `**`: editing an
|
|
66
|
+
* implementation file to make a scenario pass does not load these instructions,
|
|
67
|
+
* so the rules about *not* editing the scenario instead arrive when the agent is
|
|
68
|
+
* in the spec, not when it is tempted. Unconditional loading buys that at the
|
|
69
|
+
* cost of every unrelated request in the repo, which rule 2 above declines.
|
|
70
|
+
*/
|
|
71
|
+
function copilotContent() {
|
|
72
|
+
return `---
|
|
73
|
+
description: ${WORKFLOW_DESCRIPTION}
|
|
74
|
+
applyTo: '**/*.reqs.ts,**/*.spec.ts,**/changes/**'
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
${workflowBody()}
|
|
78
|
+
`;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Every target `init` can write, in the order it writes them.
|
|
82
|
+
*
|
|
83
|
+
* The order is this table's, never the order the flags were typed: two runs
|
|
84
|
+
* asking for the same set have to produce the same report.
|
|
85
|
+
*/
|
|
86
|
+
export const TARGETS = [
|
|
87
|
+
{
|
|
88
|
+
name: 'claude',
|
|
89
|
+
tool: 'Claude Code',
|
|
90
|
+
file: SKILL_FILE,
|
|
91
|
+
content: skillContent,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: 'copilot',
|
|
95
|
+
tool: 'GitHub Copilot',
|
|
96
|
+
file: '.github/instructions/attest.instructions.md',
|
|
97
|
+
content: copilotContent,
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'cursor',
|
|
101
|
+
tool: 'Cursor',
|
|
102
|
+
file: '.cursor/rules/attest.mdc',
|
|
103
|
+
content: cursorContent,
|
|
104
|
+
},
|
|
105
|
+
];
|
|
106
|
+
/**
|
|
107
|
+
* What `init` writes when the user names no target.
|
|
108
|
+
*
|
|
109
|
+
* One target rather than all of them: the others are files in a repository
|
|
110
|
+
* whose owner did not ask for them, and a tool that scatters configuration for
|
|
111
|
+
* editors nobody here uses is a tool people stop running.
|
|
112
|
+
*/
|
|
113
|
+
export const DEFAULT_TARGET = 'claude';
|
|
114
|
+
export const TARGET_NAMES = TARGETS.map((t) => t.name);
|
|
115
|
+
/**
|
|
116
|
+
* Resolve requested names to targets, or refuse the whole set.
|
|
117
|
+
*
|
|
118
|
+
* All-or-nothing on purpose, and the caller writes nothing while `issues` is
|
|
119
|
+
* non-empty: a name already known to be unwritable must not leave half a set of
|
|
120
|
+
* instruction files behind, in the same way `archive` validates a change name
|
|
121
|
+
* before a loader is even created. Duplicates collapse, because asking twice is
|
|
122
|
+
* not asking for two files.
|
|
123
|
+
*/
|
|
124
|
+
export function resolveTargets(names) {
|
|
125
|
+
const wanted = new Set(names);
|
|
126
|
+
const issues = [];
|
|
127
|
+
for (const name of wanted) {
|
|
128
|
+
if (!TARGETS.some((t) => t.name === name)) {
|
|
129
|
+
issues.push({
|
|
130
|
+
level: 'ERROR',
|
|
131
|
+
code: 'unknown-target',
|
|
132
|
+
message: `Unknown agent target '${name}'. Known targets: ${TARGET_NAMES.join(', ')}.`,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return {
|
|
137
|
+
targets: issues.length > 0 ? [] : TARGETS.filter((t) => wanted.has(t.name)),
|
|
138
|
+
issues,
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=targets.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"targets.js","sourceRoot":"","sources":["../../src/core/targets.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,EAAE;AACF,gFAAgF;AAChF,6EAA6E;AAC7E,+EAA+E;AAC/E,gFAAgF;AAChF,oDAAoD;AACpD,EAAE;AACF,8EAA8E;AAC9E,EAAE;AACF,6EAA6E;AAC7E,8EAA8E;AAC9E,0EAA0E;AAC1E,gFAAgF;AAChF,6EAA6E;AAC7E,2EAA2E;AAC3E,gFAAgF;AAChF,+EAA+E;AAC/E,yEAAyE;AACzE,yEAAyE;AACzE,8EAA8E;AAC9E,gFAAgF;AAChF,iFAAiF;AACjF,iCAAiC;AACjC,EAAE;AACF,6EAA6E;AAC7E,sDAAsD;AAGtD,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAiBhE,sEAAsE;AACtE,MAAM,CAAC,MAAM,UAAU,GAAG,gCAAgC,CAAC;AAE3D;;;GAGG;AACH,MAAM,UAAU,YAAY;IAC1B,OAAO;;eAEM,oBAAoB;;;EAGjC,YAAY,EAAE;CACf,CAAC;AACF,CAAC;AAED;;;;;;GAMG;AACH,SAAS,aAAa;IACpB,OAAO;eACM,oBAAoB;;;;EAIjC,YAAY,EAAE;CACf,CAAC;AACF,CAAC;AAED;;;;;;;;;;GAUG;AACH,SAAS,cAAc;IACrB,OAAO;eACM,oBAAoB;;;;EAIjC,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CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;QAC3E,MAAM;KACP,CAAC;AACJ,CAAC"}
|
package/dist/core/types.d.ts
CHANGED
|
@@ -19,12 +19,25 @@ export interface AttestPlan {
|
|
|
19
19
|
scenarios: ParsedScenario[];
|
|
20
20
|
paramRefs: ParamRef[];
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* What one scenario did in a run. Only the two executed states exist: a skipped
|
|
24
|
+
* or todo scenario has no outcome at all, which is what `declared-not-run`
|
|
25
|
+
* reports (design §8) and what keeps a skip from being recorded as a red.
|
|
26
|
+
*/
|
|
27
|
+
export type Outcome = 'pass' | 'fail';
|
|
22
28
|
/** Result of an executable verification run (design §5.4). */
|
|
23
29
|
export interface RunResult {
|
|
24
30
|
/** True when no test failed. */
|
|
25
31
|
passed: boolean;
|
|
26
32
|
/** reqId -> set of scenario names that actually executed (from the task tree). */
|
|
27
33
|
runtimeCoverage: Map<string, Set<string>>;
|
|
34
|
+
/**
|
|
35
|
+
* reqId -> scenario name -> how it ended. The same task-tree walk that fills
|
|
36
|
+
* `runtimeCoverage` already had to tell `pass` from `fail` to decide whether a
|
|
37
|
+
* scenario executed at all; this keeps that distinction instead of discarding
|
|
38
|
+
* it, which is what §6's mechanism 2 records.
|
|
39
|
+
*/
|
|
40
|
+
outcomes: Map<string, Map<string, Outcome>>;
|
|
28
41
|
}
|
|
29
42
|
/** Severity levels for graded reporting (design §5.3). */
|
|
30
43
|
export type Level = 'ERROR' | 'WARNING' | 'INFO';
|
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,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ClF,eAAe,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1C;;;;;OAKG;IACH,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CAC7C;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.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;AAqEhF;;;;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
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import type { AttestPlan, Issue, ParamRef, Registry } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Uncovered requirements: intent exists but no scenario attests it (design §5.3).
|
|
4
|
+
*
|
|
5
|
+
* Exported because `check` and `cover` both report this, and `cover` used to
|
|
6
|
+
* report it only as a `covered: false` row — so a `--json` consumer following
|
|
7
|
+
* the documented rule ("branch on `ok` / `issues[].code`") got a false verdict
|
|
8
|
+
* with an empty `issues` array from exactly one command. Two commands stating
|
|
9
|
+
* one fact in two shapes is the same clerical agreement `declaredNotRunIssues`
|
|
10
|
+
* was extracted to remove.
|
|
11
|
+
*/
|
|
12
|
+
export declare function uncoveredIssues(registry: Registry, plan: AttestPlan): Issue[];
|
|
2
13
|
/**
|
|
3
14
|
* Static structural validation (design §5.3). Emits ERROR-level issues for:
|
|
4
15
|
* - orphan-test: a scenario covers an unknown requirement id
|
|
@@ -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,EAAkB,QAAQ,EAAE,MAAM,YAAY,CAAC;AAExF;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,GAAG,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"validator.d.ts","sourceRoot":"","sources":["../../src/core/validator.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,QAAQ,EAAkB,QAAQ,EAAE,MAAM,YAAY,CAAC;AAExF;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,GAAG,KAAK,EAAE,CAc7E;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,GAAG,KAAK,EAAE,CAiE/E;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,QAAQ,EAAE,GACf,KAAK,EAAE,CA+BT"}
|
package/dist/core/validator.js
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
// Structural validation + anti-drift heuristic (design §5.3, §6).
|
|
2
2
|
// Graded reporting: ERROR / WARNING / INFO, each with file + line + fix hint.
|
|
3
|
+
/**
|
|
4
|
+
* Uncovered requirements: intent exists but no scenario attests it (design §5.3).
|
|
5
|
+
*
|
|
6
|
+
* Exported because `check` and `cover` both report this, and `cover` used to
|
|
7
|
+
* report it only as a `covered: false` row — so a `--json` consumer following
|
|
8
|
+
* the documented rule ("branch on `ok` / `issues[].code`") got a false verdict
|
|
9
|
+
* with an empty `issues` array from exactly one command. Two commands stating
|
|
10
|
+
* one fact in two shapes is the same clerical agreement `declaredNotRunIssues`
|
|
11
|
+
* was extracted to remove.
|
|
12
|
+
*/
|
|
13
|
+
export function uncoveredIssues(registry, plan) {
|
|
14
|
+
const coveredIds = new Set(plan.scenarios.map((s) => s.reqId));
|
|
15
|
+
const issues = [];
|
|
16
|
+
for (const id of Object.keys(registry)) {
|
|
17
|
+
if (!coveredIds.has(id)) {
|
|
18
|
+
issues.push({
|
|
19
|
+
level: 'ERROR',
|
|
20
|
+
code: 'uncovered-requirement',
|
|
21
|
+
reqId: id,
|
|
22
|
+
message: `Requirement "${id}" has no scenario attesting it. Add a scenario, or mark it deferred.`,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return issues;
|
|
27
|
+
}
|
|
3
28
|
/**
|
|
4
29
|
* Static structural validation (design §5.3). Emits ERROR-level issues for:
|
|
5
30
|
* - orphan-test: a scenario covers an unknown requirement id
|
|
@@ -12,7 +37,6 @@
|
|
|
12
37
|
export function validateStructure(registry, plan) {
|
|
13
38
|
const issues = [];
|
|
14
39
|
const knownIds = new Set(Object.keys(registry));
|
|
15
|
-
const coveredIds = new Set(plan.scenarios.map((s) => s.reqId));
|
|
16
40
|
// orphan-test: covers a requirement that does not exist.
|
|
17
41
|
for (const s of plan.scenarios) {
|
|
18
42
|
if (!knownIds.has(s.reqId)) {
|
|
@@ -26,17 +50,9 @@ export function validateStructure(registry, plan) {
|
|
|
26
50
|
});
|
|
27
51
|
}
|
|
28
52
|
}
|
|
29
|
-
// uncovered-requirement: intent exists but no scenario attests it.
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
issues.push({
|
|
33
|
-
level: 'ERROR',
|
|
34
|
-
code: 'uncovered-requirement',
|
|
35
|
-
reqId: id,
|
|
36
|
-
message: `Requirement "${id}" has no scenario attesting it. Add a scenario, or mark it deferred.`,
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
}
|
|
53
|
+
// uncovered-requirement: intent exists but no scenario attests it. Shared
|
|
54
|
+
// with `cover`, so the two commands cannot drift apart.
|
|
55
|
+
issues.push(...uncoveredIssues(registry, plan));
|
|
40
56
|
// unbound-param: statement uses {param} but params does not define it.
|
|
41
57
|
// `Object.hasOwn`, never `in`: `'toString' in {}` is true, so an `in` probe
|
|
42
58
|
// silently accepts placeholders no author declared — and render.ts would then
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../../src/core/validator.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,8EAA8E;AAI9E
|
|
1
|
+
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../../src/core/validator.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,8EAA8E;AAI9E;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe,CAAC,QAAkB,EAAE,IAAgB;IAClE,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/D,MAAM,MAAM,GAAY,EAAE,CAAC;IAC3B,KAAK,MAAM,EAAE,IAAI,MAAM,CAAC,IAAI,CAAC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":["../../src/core/write.ts"],"names":[],"mappings":"AAeA,wBAAsB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAM9E"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Writing a file that will be committed.
|
|
2
|
+
//
|
|
3
|
+
// Every file Attest writes is one a user commits — a rendering, the skill, a
|
|
4
|
+
// change's first-run record. A plain write that is interrupted leaves a
|
|
5
|
+
// truncated file on disk, and the failure mode is that someone commits the
|
|
6
|
+
// wreckage before anything notices. `rename` within a directory is atomic, so
|
|
7
|
+
// the destination is either the whole old file or the whole new one.
|
|
8
|
+
//
|
|
9
|
+
// Shared rather than owned by one caller: `render --out` had this argument to
|
|
10
|
+
// itself (0.1.7), and it applies unchanged to anything else written to a path
|
|
11
|
+
// under version control.
|
|
12
|
+
import { writeFile, rename } from 'node:fs/promises';
|
|
13
|
+
import { dirname, join } from 'node:path';
|
|
14
|
+
export async function writeAtomic(dest, content) {
|
|
15
|
+
// Same directory as the destination, so the rename cannot cross a filesystem
|
|
16
|
+
// boundary and stop being atomic. The pid keeps two concurrent runs apart.
|
|
17
|
+
const tmp = join(dirname(dest), `.attest.${process.pid}.tmp`);
|
|
18
|
+
await writeFile(tmp, content, 'utf8');
|
|
19
|
+
await rename(tmp, dest);
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=write.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write.js","sourceRoot":"","sources":["../../src/core/write.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC,EAAE;AACF,6EAA6E;AAC7E,wEAAwE;AACxE,2EAA2E;AAC3E,8EAA8E;AAC9E,qEAAqE;AACrE,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,yBAAyB;AAEzB,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAE1C,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,IAAY,EAAE,OAAe;IAC7D,6EAA6E;IAC7E,2EAA2E;IAC3E,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,WAAW,OAAO,CAAC,GAAG,MAAM,CAAC,CAAC;IAC9D,MAAM,SAAS,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IACtC,MAAM,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
package/dist/runtime.d.ts
CHANGED
|
@@ -6,6 +6,14 @@ export declare function requirement(id: string, body: () => void): void;
|
|
|
6
6
|
/**
|
|
7
7
|
* Declare a single verifiable scenario. Must be nested inside requirement().
|
|
8
8
|
* The assertion itself is delegated to Vitest `it` (design §3).
|
|
9
|
+
*
|
|
10
|
+
* `timeoutMs` is passed straight through to `it`. It exists because `verify`
|
|
11
|
+
* runs the suite **isolated** (§5.4) — no `vitest.config.ts` unless
|
|
12
|
+
* `--vitest-config` names one — so Vitest's 5-second default is what every
|
|
13
|
+
* scenario gets, and a scenario that drives a subprocess, a container or a
|
|
14
|
+
* build had no way to say otherwise. The alternative, raising the default for
|
|
15
|
+
* everyone, would hide a genuinely hung test; the one after that, a config file
|
|
16
|
+
* for the whole suite, sets one number for what is a property of one scenario.
|
|
9
17
|
*/
|
|
10
|
-
export declare function scenario(name: string, fn: () => void | Promise<void
|
|
18
|
+
export declare function scenario(name: string, fn: () => void | Promise<void>, timeoutMs?: number): void;
|
|
11
19
|
//# sourceMappingURL=runtime.d.ts.map
|
package/dist/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,IAAI,GAAG,IAAI,CAU9D;AAED
|
|
1
|
+
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../src/runtime.ts"],"names":[],"mappings":"AAQA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,IAAI,GAAG,IAAI,CAU9D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,EAC9B,SAAS,CAAC,EAAE,MAAM,GACjB,IAAI,CAKN"}
|
package/dist/runtime.js
CHANGED
|
@@ -22,11 +22,19 @@ export function requirement(id, body) {
|
|
|
22
22
|
/**
|
|
23
23
|
* Declare a single verifiable scenario. Must be nested inside requirement().
|
|
24
24
|
* The assertion itself is delegated to Vitest `it` (design §3).
|
|
25
|
+
*
|
|
26
|
+
* `timeoutMs` is passed straight through to `it`. It exists because `verify`
|
|
27
|
+
* runs the suite **isolated** (§5.4) — no `vitest.config.ts` unless
|
|
28
|
+
* `--vitest-config` names one — so Vitest's 5-second default is what every
|
|
29
|
+
* scenario gets, and a scenario that drives a subprocess, a container or a
|
|
30
|
+
* build had no way to say otherwise. The alternative, raising the default for
|
|
31
|
+
* everyone, would hide a genuinely hung test; the one after that, a config file
|
|
32
|
+
* for the whole suite, sets one number for what is a property of one scenario.
|
|
25
33
|
*/
|
|
26
|
-
export function scenario(name, fn) {
|
|
34
|
+
export function scenario(name, fn, timeoutMs) {
|
|
27
35
|
if (!currentReqId) {
|
|
28
36
|
throw new Error(`scenario("${name}") must be nested inside requirement(...)`);
|
|
29
37
|
}
|
|
30
|
-
it(name, fn);
|
|
38
|
+
it(name, fn, timeoutMs);
|
|
31
39
|
}
|
|
32
40
|
//# sourceMappingURL=runtime.js.map
|
package/dist/runtime.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.js","sourceRoot":"","sources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