@plune-ai/cli 0.40.1 → 0.40.2
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/README.md +32 -2
- package/dist/cli.cjs +467 -286
- package/dist/index.cjs +8 -1
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8 -1
- package/dist/reporter-core.cjs +7 -0
- package/dist/reporter-core.d.cts +13 -1
- package/dist/reporter-core.d.ts +13 -1
- package/dist/reporter-core.js +6 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -9266,6 +9266,7 @@ var safeText = (text) => noCommands(
|
|
|
9266
9266
|
// src/cli/commands/cairn-artifact.ts
|
|
9267
9267
|
var SUPPORTED_ARTIFACT_VERSION = 1;
|
|
9268
9268
|
var INGEST_SCHEMA_VERSION = 1;
|
|
9269
|
+
var RATIONALE_MAX = 400;
|
|
9269
9270
|
var NoCairnRunsError = class extends Error {
|
|
9270
9271
|
constructor(runsDir) {
|
|
9271
9272
|
super(`No Cairn run found under ${runsDir} \u2014 name the directory instead: plune ingest <dir>.`);
|
|
@@ -9536,10 +9537,14 @@ async function defaultReadEvidence(dir) {
|
|
|
9536
9537
|
function casesFromDesign(report, notes) {
|
|
9537
9538
|
const list2 = Array.isArray(report["testCases"]) ? report["testCases"] : [];
|
|
9538
9539
|
const refused = /* @__PURE__ */ new Map();
|
|
9540
|
+
let cut = 0;
|
|
9539
9541
|
const cases = list2.map((raw) => {
|
|
9540
9542
|
const c = asRecord(raw);
|
|
9541
9543
|
const steps = (Array.isArray(c["steps"]) ? c["steps"] : []).map((s) => str(s)).filter((s) => s !== "");
|
|
9542
9544
|
const title = str(c["title"], "untitled case");
|
|
9545
|
+
const why = own2(c, "rationale");
|
|
9546
|
+
const rationale = typeof why === "string" ? why.trim() : "";
|
|
9547
|
+
if (rationale.length > RATIONALE_MAX) cut += 1;
|
|
9543
9548
|
const link = own2(c, "traceUrl") ?? void 0;
|
|
9544
9549
|
const said = [];
|
|
9545
9550
|
const traceUrl = traceUrlOf(link, title, said);
|
|
@@ -9557,12 +9562,14 @@ function casesFromDesign(report, notes) {
|
|
|
9557
9562
|
expected: str(c["expected"], "(no expected result recorded)"),
|
|
9558
9563
|
...typeof c["technique"] === "string" ? { technique: c["technique"] } : {},
|
|
9559
9564
|
...typeof c["priority"] === "string" ? { priority: c["priority"] } : {},
|
|
9565
|
+
...rationale !== "" ? { rationale: clip(rationale, RATIONALE_MAX) } : {},
|
|
9560
9566
|
...traceUrl !== void 0 ? { traceUrl } : {}
|
|
9561
9567
|
};
|
|
9562
9568
|
});
|
|
9563
9569
|
for (const times of refused.values()) {
|
|
9564
9570
|
if (times > 1) notes.push(`plune: ${times - 1} more case(s) carry the same trace link \u2014 sent without it.`);
|
|
9565
9571
|
}
|
|
9572
|
+
if (cut > 0) notes.push(`plune: ${cut} case(s) carry an explanation over ${RATIONALE_MAX} characters \u2014 sent cut to ${RATIONALE_MAX}.`);
|
|
9566
9573
|
return cases;
|
|
9567
9574
|
}
|
|
9568
9575
|
function casesFromApi(report, verdicts) {
|
|
@@ -9628,7 +9635,7 @@ async function readCairnRun(dir, deps = {}) {
|
|
|
9628
9635
|
};
|
|
9629
9636
|
}
|
|
9630
9637
|
var DECLARED = { text: 500, name: 200, chapters: 200, perCase: 20 };
|
|
9631
|
-
var clip = (s) => s.slice(0,
|
|
9638
|
+
var clip = (s, max = DECLARED.text) => s.slice(0, max).replace(/[\uD800-\uDBFF]$/, "");
|
|
9632
9639
|
async function readCairnSessionFiles(dir) {
|
|
9633
9640
|
const raw = await readJson(path9.join(dir, "screencasts", "screencasts.json"));
|
|
9634
9641
|
if (!Array.isArray(raw)) return void 0;
|
package/dist/index.d.cts
CHANGED
|
@@ -1499,6 +1499,8 @@ interface CairnIngestCase {
|
|
|
1499
1499
|
verdict?: CairnVerdict;
|
|
1500
1500
|
technique?: string;
|
|
1501
1501
|
priority?: string;
|
|
1502
|
+
/** Why the case exists, in the words of whoever wrote it; the review queue shows it when the proposal is opened. */
|
|
1503
|
+
rationale?: string;
|
|
1502
1504
|
/** The https address of the run's trace, as the report gives it to the case. Absent when it gives none or the link is refused. */
|
|
1503
1505
|
traceUrl?: string;
|
|
1504
1506
|
/** The case's recordings, from `screencasts/screencasts.json`. Absent when the run recorded none for it. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1499,6 +1499,8 @@ interface CairnIngestCase {
|
|
|
1499
1499
|
verdict?: CairnVerdict;
|
|
1500
1500
|
technique?: string;
|
|
1501
1501
|
priority?: string;
|
|
1502
|
+
/** Why the case exists, in the words of whoever wrote it; the review queue shows it when the proposal is opened. */
|
|
1503
|
+
rationale?: string;
|
|
1502
1504
|
/** The https address of the run's trace, as the report gives it to the case. Absent when it gives none or the link is refused. */
|
|
1503
1505
|
traceUrl?: string;
|
|
1504
1506
|
/** The case's recordings, from `screencasts/screencasts.json`. Absent when the run recorded none for it. */
|
package/dist/index.js
CHANGED
|
@@ -9228,6 +9228,7 @@ var safeText = (text) => noCommands(
|
|
|
9228
9228
|
// src/cli/commands/cairn-artifact.ts
|
|
9229
9229
|
var SUPPORTED_ARTIFACT_VERSION = 1;
|
|
9230
9230
|
var INGEST_SCHEMA_VERSION = 1;
|
|
9231
|
+
var RATIONALE_MAX = 400;
|
|
9231
9232
|
var NoCairnRunsError = class extends Error {
|
|
9232
9233
|
constructor(runsDir) {
|
|
9233
9234
|
super(`No Cairn run found under ${runsDir} \u2014 name the directory instead: plune ingest <dir>.`);
|
|
@@ -9498,10 +9499,14 @@ async function defaultReadEvidence(dir) {
|
|
|
9498
9499
|
function casesFromDesign(report, notes) {
|
|
9499
9500
|
const list2 = Array.isArray(report["testCases"]) ? report["testCases"] : [];
|
|
9500
9501
|
const refused = /* @__PURE__ */ new Map();
|
|
9502
|
+
let cut = 0;
|
|
9501
9503
|
const cases = list2.map((raw) => {
|
|
9502
9504
|
const c = asRecord(raw);
|
|
9503
9505
|
const steps = (Array.isArray(c["steps"]) ? c["steps"] : []).map((s) => str(s)).filter((s) => s !== "");
|
|
9504
9506
|
const title = str(c["title"], "untitled case");
|
|
9507
|
+
const why = own2(c, "rationale");
|
|
9508
|
+
const rationale = typeof why === "string" ? why.trim() : "";
|
|
9509
|
+
if (rationale.length > RATIONALE_MAX) cut += 1;
|
|
9505
9510
|
const link = own2(c, "traceUrl") ?? void 0;
|
|
9506
9511
|
const said = [];
|
|
9507
9512
|
const traceUrl = traceUrlOf(link, title, said);
|
|
@@ -9519,12 +9524,14 @@ function casesFromDesign(report, notes) {
|
|
|
9519
9524
|
expected: str(c["expected"], "(no expected result recorded)"),
|
|
9520
9525
|
...typeof c["technique"] === "string" ? { technique: c["technique"] } : {},
|
|
9521
9526
|
...typeof c["priority"] === "string" ? { priority: c["priority"] } : {},
|
|
9527
|
+
...rationale !== "" ? { rationale: clip(rationale, RATIONALE_MAX) } : {},
|
|
9522
9528
|
...traceUrl !== void 0 ? { traceUrl } : {}
|
|
9523
9529
|
};
|
|
9524
9530
|
});
|
|
9525
9531
|
for (const times of refused.values()) {
|
|
9526
9532
|
if (times > 1) notes.push(`plune: ${times - 1} more case(s) carry the same trace link \u2014 sent without it.`);
|
|
9527
9533
|
}
|
|
9534
|
+
if (cut > 0) notes.push(`plune: ${cut} case(s) carry an explanation over ${RATIONALE_MAX} characters \u2014 sent cut to ${RATIONALE_MAX}.`);
|
|
9528
9535
|
return cases;
|
|
9529
9536
|
}
|
|
9530
9537
|
function casesFromApi(report, verdicts) {
|
|
@@ -9590,7 +9597,7 @@ async function readCairnRun(dir, deps = {}) {
|
|
|
9590
9597
|
};
|
|
9591
9598
|
}
|
|
9592
9599
|
var DECLARED = { text: 500, name: 200, chapters: 200, perCase: 20 };
|
|
9593
|
-
var clip = (s) => s.slice(0,
|
|
9600
|
+
var clip = (s, max = DECLARED.text) => s.slice(0, max).replace(/[\uD800-\uDBFF]$/, "");
|
|
9594
9601
|
async function readCairnSessionFiles(dir) {
|
|
9595
9602
|
const raw = await readJson(path10.join(dir, "screencasts", "screencasts.json"));
|
|
9596
9603
|
if (!Array.isArray(raw)) return void 0;
|
package/dist/reporter-core.cjs
CHANGED
|
@@ -45,6 +45,7 @@ __export(reporter_core_exports, {
|
|
|
45
45
|
repoRootOf: () => repoRootOf,
|
|
46
46
|
resultKey: () => resultKey,
|
|
47
47
|
startRun: () => startRun,
|
|
48
|
+
stepTitlesOf: () => stepTitlesOf,
|
|
48
49
|
webLink: () => webLink
|
|
49
50
|
});
|
|
50
51
|
module.exports = __toCommonJS(reporter_core_exports);
|
|
@@ -567,6 +568,11 @@ function chosen({ status, errors }) {
|
|
|
567
568
|
}
|
|
568
569
|
return errors[0];
|
|
569
570
|
}
|
|
571
|
+
function stepTitlesOf(attempt) {
|
|
572
|
+
if (attempt.status !== "passed") return void 0;
|
|
573
|
+
const titles = attempt.steps.map((s) => s.title.trim()).filter((t) => t !== "");
|
|
574
|
+
return titles.length > 0 ? titles : void 0;
|
|
575
|
+
}
|
|
570
576
|
function chainOf(steps) {
|
|
571
577
|
const chain = [];
|
|
572
578
|
for (let failed = steps.find((s) => s.failed); failed !== void 0; failed = failed.steps.find((s) => s.failed)) {
|
|
@@ -1993,5 +1999,6 @@ function resultKey(testId, retry) {
|
|
|
1993
1999
|
repoRootOf,
|
|
1994
2000
|
resultKey,
|
|
1995
2001
|
startRun,
|
|
2002
|
+
stepTitlesOf,
|
|
1996
2003
|
webLink
|
|
1997
2004
|
});
|
package/dist/reporter-core.d.cts
CHANGED
|
@@ -238,6 +238,11 @@ interface PendingResult {
|
|
|
238
238
|
* nothing found. A platform older than the field is handled as for `targets`.
|
|
239
239
|
*/
|
|
240
240
|
findings?: ResultFindings;
|
|
241
|
+
/**
|
|
242
|
+
* The titles of the top-level `test.step` calls of a passed attempt, in order (`stepTitlesOf`). The platform proposes them as the text of
|
|
243
|
+
* the test's case when they differ from its description. Absent rather than empty; a platform older than the field ignores it.
|
|
244
|
+
*/
|
|
245
|
+
stepTitles?: string[];
|
|
241
246
|
}
|
|
242
247
|
/** Where in the test a finding belongs: a declared step, by its position from 1 and its title. */
|
|
243
248
|
interface FindingStep {
|
|
@@ -713,6 +718,13 @@ declare function errorContextFields(attempt: FailedAttempt, home?: string): {
|
|
|
713
718
|
* bodies must not hold them all until a batch is sent.
|
|
714
719
|
*/
|
|
715
720
|
declare function filesOf(attempt: FailedAttempt): ResultFile[];
|
|
721
|
+
/**
|
|
722
|
+
* The titles of a passed attempt's top-level declared steps (`test.step`), in the order they ran, the empty ones left out. The platform
|
|
723
|
+
* compares them with the description of the test's case and, when they differ, queues a proposal to update it. Only a passed attempt
|
|
724
|
+
* says which steps the test has - a failed one stopped somewhere among them - and the nested steps stay out: a case's description is a
|
|
725
|
+
* flat list. Absent when there are none.
|
|
726
|
+
*/
|
|
727
|
+
declare function stepTitlesOf(attempt: Pick<FailedAttempt, 'status' | 'steps'>): string[] | undefined;
|
|
716
728
|
/**
|
|
717
729
|
* A link only for an address a browser opens as a page — never `file:`, `javascript:` or half a URL.
|
|
718
730
|
* As the platform checks it: `new URL` alone mends `https:/host` and `https:host` into https, and a
|
|
@@ -729,4 +741,4 @@ declare function webLink(href: string | undefined): string | undefined;
|
|
|
729
741
|
*/
|
|
730
742
|
declare function maskCredentials(text: string): string;
|
|
731
743
|
|
|
732
|
-
export { type AssertionRecord, type Attachment, type AttemptError, type ClientFailureKind, type ClientOptions, type ClientOutcome, DEFAULT_FALLBACK_PATH, type DeclaredStep, type DeferredBatch, type DeferredResult, type EnvSettings, type Execution, type ExpectedEntry, type ExternalKeyKind, type FailedAttempt, type FailureDetail, type Finding, type FindingStep, type FrozenSummary, type KeyRef, type PendingResult, type PlatformClient, RESULT_KEY_MAX, type ReporterConfig, type ResultFile, type ResultFindings, type ResultStatus, type ResultSubmission, type RunKind, type RunMeta, type RunRecord, type RunSession, type RunStats, type RunnerLocation, type SubmitCounts, UNSUPPORTED_VARS, type UnofferedWhy, appendBatch, ciCommit, createClient, errorContextFields, errorContextOf, failureOf, filesOf, maskCredentials, readEnv, repoRootOf, resultKey, startRun, webLink };
|
|
744
|
+
export { type AssertionRecord, type Attachment, type AttemptError, type ClientFailureKind, type ClientOptions, type ClientOutcome, DEFAULT_FALLBACK_PATH, type DeclaredStep, type DeferredBatch, type DeferredResult, type EnvSettings, type Execution, type ExpectedEntry, type ExternalKeyKind, type FailedAttempt, type FailureDetail, type Finding, type FindingStep, type FrozenSummary, type KeyRef, type PendingResult, type PlatformClient, RESULT_KEY_MAX, type ReporterConfig, type ResultFile, type ResultFindings, type ResultStatus, type ResultSubmission, type RunKind, type RunMeta, type RunRecord, type RunSession, type RunStats, type RunnerLocation, type SubmitCounts, UNSUPPORTED_VARS, type UnofferedWhy, appendBatch, ciCommit, createClient, errorContextFields, errorContextOf, failureOf, filesOf, maskCredentials, readEnv, repoRootOf, resultKey, startRun, stepTitlesOf, webLink };
|
package/dist/reporter-core.d.ts
CHANGED
|
@@ -238,6 +238,11 @@ interface PendingResult {
|
|
|
238
238
|
* nothing found. A platform older than the field is handled as for `targets`.
|
|
239
239
|
*/
|
|
240
240
|
findings?: ResultFindings;
|
|
241
|
+
/**
|
|
242
|
+
* The titles of the top-level `test.step` calls of a passed attempt, in order (`stepTitlesOf`). The platform proposes them as the text of
|
|
243
|
+
* the test's case when they differ from its description. Absent rather than empty; a platform older than the field ignores it.
|
|
244
|
+
*/
|
|
245
|
+
stepTitles?: string[];
|
|
241
246
|
}
|
|
242
247
|
/** Where in the test a finding belongs: a declared step, by its position from 1 and its title. */
|
|
243
248
|
interface FindingStep {
|
|
@@ -713,6 +718,13 @@ declare function errorContextFields(attempt: FailedAttempt, home?: string): {
|
|
|
713
718
|
* bodies must not hold them all until a batch is sent.
|
|
714
719
|
*/
|
|
715
720
|
declare function filesOf(attempt: FailedAttempt): ResultFile[];
|
|
721
|
+
/**
|
|
722
|
+
* The titles of a passed attempt's top-level declared steps (`test.step`), in the order they ran, the empty ones left out. The platform
|
|
723
|
+
* compares them with the description of the test's case and, when they differ, queues a proposal to update it. Only a passed attempt
|
|
724
|
+
* says which steps the test has - a failed one stopped somewhere among them - and the nested steps stay out: a case's description is a
|
|
725
|
+
* flat list. Absent when there are none.
|
|
726
|
+
*/
|
|
727
|
+
declare function stepTitlesOf(attempt: Pick<FailedAttempt, 'status' | 'steps'>): string[] | undefined;
|
|
716
728
|
/**
|
|
717
729
|
* A link only for an address a browser opens as a page — never `file:`, `javascript:` or half a URL.
|
|
718
730
|
* As the platform checks it: `new URL` alone mends `https:/host` and `https:host` into https, and a
|
|
@@ -729,4 +741,4 @@ declare function webLink(href: string | undefined): string | undefined;
|
|
|
729
741
|
*/
|
|
730
742
|
declare function maskCredentials(text: string): string;
|
|
731
743
|
|
|
732
|
-
export { type AssertionRecord, type Attachment, type AttemptError, type ClientFailureKind, type ClientOptions, type ClientOutcome, DEFAULT_FALLBACK_PATH, type DeclaredStep, type DeferredBatch, type DeferredResult, type EnvSettings, type Execution, type ExpectedEntry, type ExternalKeyKind, type FailedAttempt, type FailureDetail, type Finding, type FindingStep, type FrozenSummary, type KeyRef, type PendingResult, type PlatformClient, RESULT_KEY_MAX, type ReporterConfig, type ResultFile, type ResultFindings, type ResultStatus, type ResultSubmission, type RunKind, type RunMeta, type RunRecord, type RunSession, type RunStats, type RunnerLocation, type SubmitCounts, UNSUPPORTED_VARS, type UnofferedWhy, appendBatch, ciCommit, createClient, errorContextFields, errorContextOf, failureOf, filesOf, maskCredentials, readEnv, repoRootOf, resultKey, startRun, webLink };
|
|
744
|
+
export { type AssertionRecord, type Attachment, type AttemptError, type ClientFailureKind, type ClientOptions, type ClientOutcome, DEFAULT_FALLBACK_PATH, type DeclaredStep, type DeferredBatch, type DeferredResult, type EnvSettings, type Execution, type ExpectedEntry, type ExternalKeyKind, type FailedAttempt, type FailureDetail, type Finding, type FindingStep, type FrozenSummary, type KeyRef, type PendingResult, type PlatformClient, RESULT_KEY_MAX, type ReporterConfig, type ResultFile, type ResultFindings, type ResultStatus, type ResultSubmission, type RunKind, type RunMeta, type RunRecord, type RunSession, type RunStats, type RunnerLocation, type SubmitCounts, UNSUPPORTED_VARS, type UnofferedWhy, appendBatch, ciCommit, createClient, errorContextFields, errorContextOf, failureOf, filesOf, maskCredentials, readEnv, repoRootOf, resultKey, startRun, stepTitlesOf, webLink };
|
package/dist/reporter-core.js
CHANGED
|
@@ -516,6 +516,11 @@ function chosen({ status, errors }) {
|
|
|
516
516
|
}
|
|
517
517
|
return errors[0];
|
|
518
518
|
}
|
|
519
|
+
function stepTitlesOf(attempt) {
|
|
520
|
+
if (attempt.status !== "passed") return void 0;
|
|
521
|
+
const titles = attempt.steps.map((s) => s.title.trim()).filter((t) => t !== "");
|
|
522
|
+
return titles.length > 0 ? titles : void 0;
|
|
523
|
+
}
|
|
519
524
|
function chainOf(steps) {
|
|
520
525
|
const chain = [];
|
|
521
526
|
for (let failed = steps.find((s) => s.failed); failed !== void 0; failed = failed.steps.find((s) => s.failed)) {
|
|
@@ -1941,5 +1946,6 @@ export {
|
|
|
1941
1946
|
repoRootOf,
|
|
1942
1947
|
resultKey,
|
|
1943
1948
|
startRun,
|
|
1949
|
+
stepTitlesOf,
|
|
1944
1950
|
webLink
|
|
1945
1951
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plune-ai/cli",
|
|
3
|
-
"version": "0.40.
|
|
3
|
+
"version": "0.40.2",
|
|
4
4
|
"mcpName": "ai.plune/cli",
|
|
5
5
|
"description": "AI-powered assertion testing for LLM apps — write assertions, run them against any provider, get a pass/fail report (local, CI, or diff).",
|
|
6
6
|
"keywords": [
|