@sun-asterisk/sungen 3.3.0-alpha.8 → 3.3.0-alpha.9
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/dist/cli/commands/contract-derive-command.d.ts +2 -1
- package/dist/cli/commands/contract-derive-command.d.ts.map +1 -1
- package/dist/cli/commands/contract-derive-command.js +13 -2
- package/dist/cli/commands/contract-derive-command.js.map +1 -1
- package/dist/contract/build-trace-conformance.d.ts.map +1 -1
- package/dist/contract/build-trace-conformance.js +4 -11
- package/dist/contract/build-trace-conformance.js.map +1 -1
- package/dist/contract/derive-free-feature.d.ts +9 -0
- package/dist/contract/derive-free-feature.d.ts.map +1 -1
- package/dist/contract/derive-free-feature.js +10 -3
- package/dist/contract/derive-free-feature.js.map +1 -1
- package/dist/contract/resolve-unit-trace-identities.d.ts +12 -0
- package/dist/contract/resolve-unit-trace-identities.d.ts.map +1 -1
- package/dist/contract/resolve-unit-trace-identities.js +33 -49
- package/dist/contract/resolve-unit-trace-identities.js.map +1 -1
- package/dist/contract/trace/collect-trace-evidence.d.ts +9 -3
- package/dist/contract/trace/collect-trace-evidence.d.ts.map +1 -1
- package/dist/contract/trace/collect-trace-evidence.js +45 -18
- package/dist/contract/trace/collect-trace-evidence.js.map +1 -1
- package/dist/contract/trace/scenario-id-claims.d.ts +11 -0
- package/dist/contract/trace/scenario-id-claims.d.ts.map +1 -0
- package/dist/contract/trace/scenario-id-claims.js +89 -0
- package/dist/contract/trace/scenario-id-claims.js.map +1 -0
- package/dist/contract/trace/select-final-attempt.d.ts +2 -0
- package/dist/contract/trace/select-final-attempt.d.ts.map +1 -1
- package/dist/contract/trace/select-final-attempt.js +4 -1
- package/dist/contract/trace/select-final-attempt.js.map +1 -1
- package/dist/contract/trace/trace-binding.d.ts +3 -2
- package/dist/contract/trace/trace-binding.d.ts.map +1 -1
- package/dist/contract/trace/trace-binding.js +6 -3
- package/dist/contract/trace/trace-binding.js.map +1 -1
- package/dist/contract/trace/trace-freshness.d.ts +27 -0
- package/dist/contract/trace/trace-freshness.d.ts.map +1 -0
- package/dist/contract/trace/trace-freshness.js +146 -0
- package/dist/contract/trace/trace-freshness.js.map +1 -0
- package/dist/contract/trace/trace-identity-resolution.d.ts +2 -0
- package/dist/contract/trace/trace-identity-resolution.d.ts.map +1 -1
- package/dist/contract/trace/trace-identity-resolution.js +6 -3
- package/dist/contract/trace/trace-identity-resolution.js.map +1 -1
- package/dist/contract/trace/trace-run-record.d.ts +2 -0
- package/dist/contract/trace/trace-run-record.d.ts.map +1 -1
- package/dist/contract/trace/trace-run-record.js +19 -5
- package/dist/contract/trace/trace-run-record.js.map +1 -1
- package/dist/orchestrator/templates/ai-src/commands/create-test.md +4 -1
- package/package.json +3 -3
- package/src/cli/commands/contract-derive-command.ts +12 -3
- package/src/contract/build-trace-conformance.ts +4 -6
- package/src/contract/derive-free-feature.ts +15 -3
- package/src/contract/resolve-unit-trace-identities.ts +35 -12
- package/src/contract/trace/collect-trace-evidence.ts +50 -18
- package/src/contract/trace/scenario-id-claims.ts +60 -0
- package/src/contract/trace/select-final-attempt.ts +9 -2
- package/src/contract/trace/trace-binding.ts +7 -4
- package/src/contract/trace/trace-freshness.ts +110 -0
- package/src/contract/trace/trace-identity-resolution.ts +7 -4
- package/src/contract/trace/trace-run-record.ts +20 -4
- package/src/orchestrator/templates/ai-src/commands/create-test.md +4 -1
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
*
|
|
5
5
|
* exit 0 written, unchanged, every scenario already approved, or a mobile project (not supported yet)
|
|
6
6
|
* exit 1 nothing to derive (no admissible trace — each skipped test says why, #932), refused (a
|
|
7
|
-
* secret or a machine path would have been written — nothing was),
|
|
7
|
+
* secret or a machine path would have been written — nothing was), refused because two
|
|
8
|
+
* recorded tests claim one id (#962 — both named, nothing written), or an error
|
|
8
9
|
*/
|
|
9
10
|
import type { Command } from 'commander';
|
|
10
11
|
export declare function registerDeriveCommand(contract: Command): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-derive-command.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/contract-derive-command.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"contract-derive-command.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/contract-derive-command.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAyCzC,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAqB7D"}
|
|
@@ -53,7 +53,18 @@ function print(r, unit) {
|
|
|
53
53
|
L(` + ${s.title} (${s.steps} steps${s.low ? `, ${s.low} low identity` : ''}${s.opaque ? `, ${s.opaque} opaque` : ''})`);
|
|
54
54
|
for (const s of r.skipped)
|
|
55
55
|
L(` - ${s.id} skipped: ${s.reason}`);
|
|
56
|
-
if (r.
|
|
56
|
+
if (r.duplicateIds?.length) {
|
|
57
|
+
L(" ✗ Refused — nothing was written. One ID names one test: keeping one would silently drop the other's contract.");
|
|
58
|
+
for (const d of r.duplicateIds) {
|
|
59
|
+
L(` ${d.tests.length} recorded tests claim ${d.id}:`);
|
|
60
|
+
for (const t of d.tests)
|
|
61
|
+
L(` ${t}`);
|
|
62
|
+
if (d.staleRecords?.length)
|
|
63
|
+
L(` If that test is gone, delete ${d.staleRecords.join(', ')} — an older run's record (free tests now record under test-results-free/).`);
|
|
64
|
+
}
|
|
65
|
+
L(" Give each test its own ID (its title's leading ID, or its @tag), run the free tests again with trace on, then derive.");
|
|
66
|
+
}
|
|
67
|
+
else if (r.refused?.length) {
|
|
57
68
|
L(` ✗ Refused — nothing was written. ${r.refused.length} likely secret(s) / machine path(s):`);
|
|
58
69
|
for (const h of r.refused)
|
|
59
70
|
L(` ${h.where} — ${h.reason}`);
|
|
@@ -91,7 +102,7 @@ function registerDeriveCommand(contract) {
|
|
|
91
102
|
console.log(JSON.stringify(r, null, 2));
|
|
92
103
|
else
|
|
93
104
|
print(r, unit.name);
|
|
94
|
-
process.exit(r.refused?.length || (0, derive_free_feature_1.nothingDerived)(r) ? 1 : 0);
|
|
105
|
+
process.exit(r.refused?.length || r.duplicateIds?.length || (0, derive_free_feature_1.nothingDerived)(r) ? 1 : 0);
|
|
95
106
|
}
|
|
96
107
|
catch (error) {
|
|
97
108
|
console.error('Error:', error instanceof Error ? error.message : error);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contract-derive-command.js","sourceRoot":"","sources":["../../../src/cli/commands/contract-derive-command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"contract-derive-command.js","sourceRoot":"","sources":["../../../src/cli/commands/contract-derive-command.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDA,sDAqBC;AA7DD,2CAA6B;AAC7B,4EAAqG;AACrG,gGAAuF;AACvF,kEAAoE;AACpE,4EAAqE;AAErE,SAAS,KAAK,CAAC,CAAe,EAAE,IAAY;IAC1C,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IACtB,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IACjD,CAAC,CAAC,EAAE,CAAC,CAAC;IACN,CAAC,CAAC,wBAAwB,IAAI,2BAA2B,GAAG,MAAM,CAAC,CAAC;IACpE,CAAC,CAAC,EAAE,CAAC,CAAC;IACN,IAAI,CAAC,CAAC,IAAI;QAAE,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IAC/B,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,QAAQ,IAAI,EAAE;QAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IAChD,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,SAAS;QAAE,CAAC,CA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CAAiB,EAAC;gBAChC,WAAW,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,QAAQ,EAAE,IAAA,uDAAuB,GAAE,IAAI,IAAI;aACrI,CAAC,CAAC;YACH,IAAI,OAAO,CAAC,IAAI;gBAAE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;;gBAAM,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;YACpF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC,CAAC,YAAY,EAAE,MAAM,IAAI,IAAA,oCAAc,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACzF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACxE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-trace-conformance.d.ts","sourceRoot":"","sources":["../../src/contract/build-trace-conformance.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-trace-conformance.d.ts","sourceRoot":"","sources":["../../src/contract/build-trace-conformance.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAgC,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC1F,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAA8B,MAAM,mBAAmB,CAAC;AAM/F,OAAO,EAAE,WAAW,EAAE,MAAM,gCAAgC,CAAC;AAM7D,MAAM,WAAW,oBAAoB;IAAG,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE;AAKlH,eAAO,MAAM,oBAAoB,qHAAqH,CAAC;AACvJ,4GAA4G;AAC5G,eAAO,MAAM,qBAAqB,OAAQ,CAAC;AAC3C,2FAA2F;AAC3F,wBAAgB,oBAAoB,CAAC,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,GAAG,MAAM,CAGlG;AACD,4GAA4G;AAC5G,eAAO,MAAM,kBAAkB,GAAI,MAAK,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAe,KAAG,MAC/B,CAAC;AAE7D,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,OAAO,EAAE,gBAAgB,EAAE,EAAE,IAAI,EAAE,YAAY,GAAG,IAAI,EAChH,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,IAAI,GAAE;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAO,GAC/D,oBAAoB,CAiDtB"}
|
|
@@ -50,17 +50,17 @@ exports.traceConformanceForUnit = traceConformanceForUnit;
|
|
|
50
50
|
* Bounded (review H4, M2): a deadline (`budgetMs`; the guard's default is ~3 s) — a scenario not
|
|
51
51
|
* judged in time is `unproven` when approved, a warning while proposed: fail CLOSED. An input that
|
|
52
52
|
* cannot be read while judging (test-data, a trace) makes that scenario unproven with its reason,
|
|
53
|
-
* never a thrown verdict. A trace older than the unit's
|
|
53
|
+
* never a thrown verdict. A trace older than the unit's `.feature` / lock is refused (stale) — judged
|
|
54
|
+
* by their content, so a touch or a fresh clone stales nothing (#967, trace/trace-freshness.ts).
|
|
54
55
|
*/
|
|
55
56
|
const crypto_1 = require("crypto");
|
|
56
57
|
const fs = __importStar(require("fs"));
|
|
57
58
|
const capability_1 = require("../harness/capability");
|
|
58
59
|
const classify_trace_conformance_1 = require("./classify-trace-conformance");
|
|
59
60
|
const contract_schema_1 = require("./contract-schema");
|
|
60
|
-
const contracts_lock_file_1 = require("./contracts-lock-file");
|
|
61
61
|
const data_normalize_1 = require("./data-normalize");
|
|
62
|
-
const normalize_feature_steps_1 = require("./normalize-feature-steps");
|
|
63
62
|
const render_free_gherkin_1 = require("./render-free-gherkin");
|
|
63
|
+
const trace_freshness_1 = require("./trace/trace-freshness");
|
|
64
64
|
const collect_trace_evidence_1 = require("./trace/collect-trace-evidence");
|
|
65
65
|
var collect_trace_evidence_2 = require("./trace/collect-trace-evidence");
|
|
66
66
|
Object.defineProperty(exports, "OVER_BUDGET", { enumerable: true, get: function () { return collect_trace_evidence_2.OVER_BUDGET; } });
|
|
@@ -68,12 +68,6 @@ const identity_cache_1 = require("./trace/identity-cache");
|
|
|
68
68
|
const trace_identity_resolution_1 = require("./trace/trace-identity-resolution");
|
|
69
69
|
const trace_fingerprint_1 = require("./trace/trace-fingerprint");
|
|
70
70
|
const trace_steps_1 = require("./trace/trace-steps");
|
|
71
|
-
const mtimeMs = (f) => { try {
|
|
72
|
-
return fs.statSync(f).mtimeMs;
|
|
73
|
-
}
|
|
74
|
-
catch {
|
|
75
|
-
return 0;
|
|
76
|
-
} };
|
|
77
71
|
const sha = (s) => (0, crypto_1.createHash)('sha256').update(s).digest('hex');
|
|
78
72
|
const why = (e) => (e instanceof Error ? e.message : String(e)).split('\n')[0].slice(0, 300);
|
|
79
73
|
exports.MOBILE_NOT_SUPPORTED = 'trace conformance is web-only: free / impl:code scenarios of a mobile project are not supported yet (not judged)';
|
|
@@ -101,8 +95,7 @@ function traceConformanceForUnit(projectRoot, unit, current, lock, untrusted, op
|
|
|
101
95
|
let index = { byValue: new Map() };
|
|
102
96
|
let setupError = '';
|
|
103
97
|
try {
|
|
104
|
-
|
|
105
|
-
evidence = (0, collect_trace_evidence_1.collectScenarioEvidence)(projectRoot, new Set(traced.map((s) => s.id)), notBefore, deadline, new Map(traced.map((s) => [s.id, s.source.name])));
|
|
98
|
+
evidence = (0, collect_trace_evidence_1.collectScenarioEvidence)(projectRoot, new Set(traced.map((s) => s.id)), (0, trace_freshness_1.unitContract)(projectRoot, unit), deadline, new Map(traced.map((s) => [s.id, s.source.name])));
|
|
106
99
|
index = (0, data_normalize_1.loadTestDataIndex)(unit.dir, unit.name);
|
|
107
100
|
}
|
|
108
101
|
catch (e) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-trace-conformance.js","sourceRoot":"","sources":["../../src/contract/build-trace-conformance.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"build-trace-conformance.js","sourceRoot":"","sources":["../../src/contract/build-trace-conformance.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,oDAGC;AAKD,0DAoDC;AAtGD;;;;;;;;;;;;;;;;GAgBG;AACH,mCAAoC;AACpC,uCAAyB;AACzB,sDAAyD;AACzD,6EAA0F;AAC1F,uDAA+F;AAC/F,qDAAoE;AACpE,+DAAuE;AACvE,6DAAuD;AACvD,2EAAkH;AAElH,yEAA6D;AAApD,qHAAA,WAAW,OAAA;AACpB,2DAA8E;AAC9E,iFAAkE;AAClE,iEAA6E;AAC7E,qDAAuD;AAIvD,MAAM,GAAG,GAAG,CAAC,CAAkB,EAAU,EAAE,CAAC,IAAA,mBAAU,EAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACzF,MAAM,GAAG,GAAG,CAAC,CAAU,EAAU,EAAE,CAAC,CAAC,CAAC,Y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,CAAC;YAChI,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,IAAA,8CAAiB,EAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,cAAc,EAAE,aAAa,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;QAChH,CAAC;IACH,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,QAAQ,CAAC,MAAM,EAAE;QAAE,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;IAChE,MAAM,SAAS,GAAG,IAAA,kCAAiB,EAAC,WAAW,CAAC,CAAC;IACjD,MAAM,SAAS,GAAG,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAM,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;IAC/G,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;AACrK,CAAC"}
|
|
@@ -26,6 +26,15 @@ export interface DeriveResult {
|
|
|
26
26
|
approved?: true;
|
|
27
27
|
}>;
|
|
28
28
|
refused?: SecretHit[];
|
|
29
|
+
/**
|
|
30
|
+
* Ids two or more recorded tests claim (#962), each test as `file:line "title" (run record <path>)` —
|
|
31
|
+
* nothing was written. `staleRecords`: older test-results/ records that are a claim's only source.
|
|
32
|
+
*/
|
|
33
|
+
duplicateIds?: Array<{
|
|
34
|
+
id: string;
|
|
35
|
+
tests: string[];
|
|
36
|
+
staleRecords?: string[];
|
|
37
|
+
}>;
|
|
29
38
|
note?: string;
|
|
30
39
|
/** A derived id another `.feature` of the unit already uses (#939) — `contract check` and approve would trip on it later. */
|
|
31
40
|
warnings?: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derive-free-feature.d.ts","sourceRoot":"","sources":["../../src/contract/derive-free-feature.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"derive-free-feature.d.ts","sourceRoot":"","sources":["../../src/contract/derive-free-feature.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAwD,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAS7G,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAKrE,MAAM,WAAW,WAAW;IAAG,WAAW,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,qBAAqB,GAAG,IAAI,CAAA;CAAE;AACjJ,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5F,sHAAsH;IACtH,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,IAAI,CAAA;KAAE,CAAC,CAAC;IAChE,OAAO,CAAC,EAAE,SAAS,EAAE,CAAC;IACtB;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;IAC/E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6HAA6H;IAC7H,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AAoCD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,YAAY,GAAG,OAAO,CAEvD;AAED,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CAuD7E"}
|
|
@@ -45,6 +45,8 @@ exports.deriveFreeFeature = deriveFreeFeature;
|
|
|
45
45
|
* identities asked of the registered `traceIdentity` resolver (driver-ui) when one is given,
|
|
46
46
|
* otherwise the cache, otherwise core's heuristic — `# identity low` marks those steps
|
|
47
47
|
* approved a scenario QA already approved (no `@proposed`) is never rewritten
|
|
48
|
+
* one id, one two recorded tests claiming one id (#962) refuse the derive — both named with
|
|
49
|
+
* test file:line, NOTHING written for the unit: keeping one would drop the other's contract
|
|
48
50
|
* safety redaction by field meaning, machine paths scrubbed, then the secret scanner and the
|
|
49
51
|
* semantic credential check over the exact text: any hit → NOTHING is written
|
|
50
52
|
*/
|
|
@@ -62,6 +64,7 @@ const normalize_feature_steps_1 = require("./normalize-feature-steps");
|
|
|
62
64
|
const unit_paths_1 = require("../harness/unit-paths");
|
|
63
65
|
const render_free_gherkin_1 = require("./render-free-gherkin");
|
|
64
66
|
const collect_trace_evidence_1 = require("./trace/collect-trace-evidence");
|
|
67
|
+
const scenario_id_claims_1 = require("./trace/scenario-id-claims");
|
|
65
68
|
const identity_cache_1 = require("./trace/identity-cache");
|
|
66
69
|
const trace_identity_resolution_1 = require("./trace/trace-identity-resolution");
|
|
67
70
|
const trace_fingerprint_1 = require("./trace/trace-fingerprint");
|
|
@@ -100,7 +103,7 @@ function reusedIdWarnings(unit, freeFile, ids) {
|
|
|
100
103
|
}
|
|
101
104
|
catch { /* an unparseable sibling is `contract check`'s to report */ }
|
|
102
105
|
}
|
|
103
|
-
return ids.filter((id) => owners.has(id)).map((id) => `${id} is already the ID of a scenario in ${owners.get(id)} — the derived scenario reuses it; give the free test (its title's leading ID) or that scenario its own ID, or \`sungen contract check\` reports it twice and approval refuses it`);
|
|
106
|
+
return ids.filter((id) => owners.has(id)).map((id) => `${id} is already the ID of a scenario in ${owners.get(id)} — the derived scenario reuses it; give the free test (its title's leading ID, or its @tag) or that scenario its own ID, or \`sungen contract check\` reports it twice and approval refuses it`);
|
|
104
107
|
}
|
|
105
108
|
/**
|
|
106
109
|
* Nothing was derived and nothing explains it away: no test of the unit left an admissible trace
|
|
@@ -108,7 +111,7 @@ function reusedIdWarnings(unit, freeFile, ids) {
|
|
|
108
111
|
* refused, or the project is mobile (`note`).
|
|
109
112
|
*/
|
|
110
113
|
function nothingDerived(r) {
|
|
111
|
-
return !r.note && !r.refused?.length && r.scenarios.length === 0 && !r.skipped.some((s) => s.approved);
|
|
114
|
+
return !r.note && !r.refused?.length && !r.duplicateIds?.length && r.scenarios.length === 0 && !r.skipped.some((s) => s.approved);
|
|
112
115
|
}
|
|
113
116
|
async function deriveFreeFeature(i) {
|
|
114
117
|
const unitBase = path.basename(i.unit.name);
|
|
@@ -117,7 +120,11 @@ async function deriveFreeFeature(i) {
|
|
|
117
120
|
if (((0, capability_1.readCapabilities)(i.projectRoot).platform ?? '').toLowerCase() === 'mobile')
|
|
118
121
|
return { ...result, note: build_trace_conformance_1.MOBILE_NOT_SUPPORTED };
|
|
119
122
|
const grep = i.grep ? new RegExp(i.grep, 'i') : null;
|
|
120
|
-
const found = (0, collect_trace_evidence_1.collectRuns)(i.projectRoot, (id, t) => (grep ? grep.test(`${id} ${t.title} ${t.file}`) : belongsToUnit(t.file, unitBase.toLowerCase())),
|
|
123
|
+
const found = (0, collect_trace_evidence_1.collectRuns)(i.projectRoot, (id, t) => (grep ? grep.test(`${id} ${t.title} ${t.file}`) : belongsToUnit(t.file, unitBase.toLowerCase())), null);
|
|
124
|
+
const claimed = (0, scenario_id_claims_1.idsClaimedByTwoTests)(i.projectRoot, found.runs);
|
|
125
|
+
if (claimed.size) {
|
|
126
|
+
return { ...result, duplicateIds: [...claimed].sort(([a], [b]) => a.localeCompare(b, 'en')).map(([id, c]) => ({ id, tests: c.tests, ...(c.staleRecords.length ? { staleRecords: c.staleRecords } : {}) })) };
|
|
127
|
+
}
|
|
121
128
|
const byId = new Map();
|
|
122
129
|
for (const r of found.runs)
|
|
123
130
|
byId.set(r.scenarioId, [...(byId.get(r.scenarioId) ?? []), r]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"derive-free-feature.js","sourceRoot":"","sources":["../../src/contract/derive-free-feature.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"derive-free-feature.js","sourceRoot":"","sources":["../../src/contract/derive-free-feature.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6FA,wCAEC;AAED,8CAuDC;AAxJD;;;;;;;;;;;;;;GAcG;AACH,uCAAyB;AACzB,uCAAyB;AACzB,2CAA6B;AAC7B,sDAAyD;AACzD,4CAA4C;AAC5C,uEAAiE;AACjE,qDAAqD;AACrD,yEAA6G;AAC7G,+DAAsE;AACtE,2DAA2D;AAC3D,uEAAmE;AACnE,sDAAwD;AACxD,+DAA4G;AAC5G,2EAAuE;AACvE,mEAAkE;AAClE,2DAA2D;AAE3D,iFAAqF;AACrF,iEAA0D;AAC1D,qDAAuD;AAoBvD,MAAM,YAAY,GAAG,qDAAqD,CAAC;AAE3E,SAAS,aAAa,CAAC,QAAg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
export interface TraceIdentityOutcome {
|
|
3
|
+
warnings: string[];
|
|
4
|
+
info: string[];
|
|
5
|
+
}
|
|
2
6
|
/** The first registered capability that can resolve trace identities (UI: driver-ui), if any. */
|
|
3
7
|
export declare function registeredTraceResolver(): TraceIdentityResolver | undefined;
|
|
8
|
+
export declare function traceIdentityOutcome(projectRoot: string, unit: {
|
|
9
|
+
name: string;
|
|
10
|
+
dir: string;
|
|
11
|
+
}, resolver?: TraceIdentityResolver): Promise<TraceIdentityOutcome>;
|
|
12
|
+
/**
|
|
13
|
+
* What `contract check --trace` adds to the verdict's warnings: only what needs attention (#966).
|
|
14
|
+
* The plain-words information is `traceIdentityOutcome(...).info`.
|
|
15
|
+
*/
|
|
4
16
|
export declare function resolveUnitTraceIdentities(projectRoot: string, unit: {
|
|
5
17
|
name: string;
|
|
6
18
|
dir: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-unit-trace-identities.d.ts","sourceRoot":"","sources":["../../src/contract/resolve-unit-trace-identities.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolve-unit-trace-identities.d.ts","sourceRoot":"","sources":["../../src/contract/resolve-unit-trace-identities.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAGrE,MAAM,WAAW,oBAAoB;IAAG,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE;AAE5E,iGAAiG;AACjG,wBAAgB,uBAAuB,IAAI,qBAAqB,GAAG,SAAS,CAE3E;AAED,wBAAsB,oBAAoB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,QAAQ,wBAA4B,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAsBxK;AAED;;;GAGG;AACH,wBAAsB,0BAA0B,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EAAE,QAAQ,wBAA4B,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAElK"}
|
|
@@ -1,78 +1,62 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.registeredTraceResolver = registeredTraceResolver;
|
|
4
|
+
exports.traceIdentityOutcome = traceIdentityOutcome;
|
|
37
5
|
exports.resolveUnitTraceIdentities = resolveUnitTraceIdentities;
|
|
38
6
|
/**
|
|
39
7
|
* `contract check --trace`: before the verdict is built, ask the registered `traceIdentity`
|
|
40
8
|
* resolver (driver-ui — a real browser) about every target of the unit's admissible traces and
|
|
41
9
|
* cache the answers (DOS-14.5). The verdict itself never calls a browser; it reads the cache, so
|
|
42
10
|
* the CLI and the Claude Code guard keep building the same verdict from the same files.
|
|
11
|
+
*
|
|
12
|
+
* What it reports is split for QA (#966): a WARNING only when something needs attention — no
|
|
13
|
+
* resolver, a mobile project, a target the browser could not name (its steps stay opaque). "Every
|
|
14
|
+
* target was already known" and "N new targets identified" are information, in plain words.
|
|
43
15
|
*/
|
|
44
|
-
const fs = __importStar(require("fs"));
|
|
45
16
|
const registry_1 = require("../capabilities/registry");
|
|
46
17
|
const capability_1 = require("../harness/capability");
|
|
47
18
|
const build_trace_conformance_1 = require("./build-trace-conformance");
|
|
48
|
-
const contracts_lock_file_1 = require("./contracts-lock-file");
|
|
49
19
|
const normalize_feature_steps_1 = require("./normalize-feature-steps");
|
|
50
20
|
const collect_trace_evidence_1 = require("./trace/collect-trace-evidence");
|
|
21
|
+
const identity_cache_1 = require("./trace/identity-cache");
|
|
22
|
+
const trace_freshness_1 = require("./trace/trace-freshness");
|
|
51
23
|
const trace_identity_resolution_1 = require("./trace/trace-identity-resolution");
|
|
52
|
-
const mtimeMs = (f) => { try {
|
|
53
|
-
return fs.statSync(f).mtimeMs;
|
|
54
|
-
}
|
|
55
|
-
catch {
|
|
56
|
-
return 0;
|
|
57
|
-
} };
|
|
58
24
|
/** The first registered capability that can resolve trace identities (UI: driver-ui), if any. */
|
|
59
25
|
function registeredTraceResolver() {
|
|
60
26
|
return registry_1.capabilityRegistry.all().find((c) => typeof c.traceIdentity === 'function')?.traceIdentity;
|
|
61
27
|
}
|
|
62
|
-
async function
|
|
28
|
+
async function traceIdentityOutcome(projectRoot, unit, resolver = registeredTraceResolver()) {
|
|
29
|
+
const none = { warnings: [], info: [] };
|
|
63
30
|
const traced = (0, normalize_feature_steps_1.loadContractScenarios)(unit.dir, unit.name).filter((s) => s.implementation !== 'compiled');
|
|
64
31
|
if (!traced.length)
|
|
65
|
-
return
|
|
32
|
+
return none;
|
|
66
33
|
if (((0, capability_1.readCapabilities)(projectRoot).platform ?? '').toLowerCase() === 'mobile')
|
|
67
|
-
return [build_trace_conformance_1.MOBILE_NOT_SUPPORTED];
|
|
34
|
+
return { warnings: [build_trace_conformance_1.MOBILE_NOT_SUPPORTED], info: [] };
|
|
68
35
|
if (!resolver)
|
|
69
|
-
return ['no trace identity resolver is registered (install @sungen/driver-ui) — every target identity stays low, so nothing can match'];
|
|
70
|
-
const
|
|
71
|
-
const evidence = (0, collect_trace_evidence_1.collectScenarioEvidence)(projectRoot, new Set(traced.map((s) => s.id)), notBefore);
|
|
36
|
+
return { warnings: ['no trace identity resolver is registered (install @sungen/driver-ui) — every target identity stays low, so nothing can match'], info: [] };
|
|
37
|
+
const evidence = (0, collect_trace_evidence_1.collectScenarioEvidence)(projectRoot, new Set(traced.map((s) => s.id)), (0, trace_freshness_1.unitContract)(projectRoot, unit));
|
|
72
38
|
const traces = [...evidence.runs.values()].flat().filter((r) => r.status === 'admissible' && r.trace).map((r) => r.trace);
|
|
73
39
|
if (!traces.length)
|
|
74
|
-
return
|
|
40
|
+
return none;
|
|
75
41
|
const r = await (0, trace_identity_resolution_1.resolveWithDriver)(projectRoot, traces, resolver);
|
|
76
|
-
|
|
42
|
+
const { cache } = (0, identity_cache_1.readIdentityCache)(projectRoot);
|
|
43
|
+
const total = r.keys.length;
|
|
44
|
+
const unnamed = r.keys.filter((k) => cache.entries.get(k)?.identityConfidence !== 'high').length;
|
|
45
|
+
const blocked = r.blockedRequests ? `; the replayed pages tried ${r.blockedRequests} request(s), all blocked` : '';
|
|
46
|
+
const known = total - r.asked;
|
|
47
|
+
const info = r.asked
|
|
48
|
+
? `trace identity: ${r.asked} new target(s) identified in a real browser (${r.resolver})${known ? `, ${known} already known` : ''}${blocked}`
|
|
49
|
+
: `trace identity: all ${total} target(s) were already identified (identity cache) — nothing new to resolve`;
|
|
50
|
+
const warnings = unnamed
|
|
51
|
+
? [`trace identity: ${unnamed} of ${total} target(s) could not be identified (no unique accessible name) — the steps on them stay opaque, for QA to review, until the test targets a unique, named element`]
|
|
52
|
+
: [];
|
|
53
|
+
return { warnings, info: [info] };
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* What `contract check --trace` adds to the verdict's warnings: only what needs attention (#966).
|
|
57
|
+
* The plain-words information is `traceIdentityOutcome(...).info`.
|
|
58
|
+
*/
|
|
59
|
+
async function resolveUnitTraceIdentities(projectRoot, unit, resolver = registeredTraceResolver()) {
|
|
60
|
+
return (await traceIdentityOutcome(projectRoot, unit, resolver)).warnings;
|
|
77
61
|
}
|
|
78
62
|
//# sourceMappingURL=resolve-unit-trace-identities.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-unit-trace-identities.js","sourceRoot":"","sources":["../../src/contract/resolve-unit-trace-identities.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"resolve-unit-trace-identities.js","sourceRoot":"","sources":["../../src/contract/resolve-unit-trace-identities.ts"],"names":[],"mappings":";;AAuBA,0DAEC;AAED,oDAsBC;AAMD,gEAEC;AAzDD;;;;;;;;;GASG;AACH,uDAA8D;AAC9D,sDAAyD;AACzD,uEAAiE;AACjE,uEAAkE;AAClE,2EAAyE;AACzE,2DAA2D;AAC3D,6DAAuD;AAEvD,iFAAsE;AAItE,iGAAiG;AACjG,SAAgB,uBAAuB;IACrC,OAAO,6BAAkB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,C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pC,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,0BAA0B,CAAC,WAAmB,EAAE,IAAmC,EAAE,QAAQ,GAAG,uBAAuB,EAAE;IAC7I,OAAO,CAAC,MAAM,oBAAoB,CAAC,WAAW,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC;AAC5E,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { UnitContract } from './trace-freshness';
|
|
1
2
|
import { ParsedTrace } from './trace-file-reader';
|
|
2
3
|
import { ReportResult, ReportTest } from './select-final-attempt';
|
|
3
4
|
import { RunRecord } from './trace-run-record';
|
|
@@ -22,10 +23,15 @@ export interface ScenarioEvidence {
|
|
|
22
23
|
export declare const MAX_EVIDENCE_JSON_BYTES: number;
|
|
23
24
|
/** The reason a run is not judged once the verdict's deadline has passed (fail closed). */
|
|
24
25
|
export declare const OVER_BUDGET = "verdict budget exceeded; run `sungen contract check`";
|
|
25
|
-
/**
|
|
26
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Every judged run of the tests `want` accepts (derive: a unit's tests; check: by scenario id). A trace
|
|
28
|
+
* older than `contract` — the unit's .feature files and lock, by content (#967) — is refused; derive,
|
|
29
|
+
* which writes the contract from the traces, passes null.
|
|
30
|
+
*/
|
|
31
|
+
export declare function collectRuns(projectRoot: string, want: (id: string, test: ReportTest) => boolean, contract: UnitContract | null, deadline?: number): {
|
|
27
32
|
runs: TraceRun[];
|
|
28
33
|
problems: string[];
|
|
34
|
+
untrusted: string[];
|
|
29
35
|
inputs: string[];
|
|
30
36
|
records: number;
|
|
31
37
|
seen: Array<{
|
|
@@ -34,5 +40,5 @@ export declare function collectRuns(projectRoot: string, want: (id: string, test
|
|
|
34
40
|
}>;
|
|
35
41
|
};
|
|
36
42
|
/** The runs of each scenario id; `names` (id → scenario name) lets a missing test be explained. */
|
|
37
|
-
export declare function collectScenarioEvidence(projectRoot: string, ids: ReadonlySet<string>,
|
|
43
|
+
export declare function collectScenarioEvidence(projectRoot: string, ids: ReadonlySet<string>, contract: UnitContract | null, deadline?: number, names?: ReadonlyMap<string, string>): ScenarioEvidence;
|
|
38
44
|
//# sourceMappingURL=collect-trace-evidence.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collect-trace-evidence.d.ts","sourceRoot":"","sources":["../../../src/contract/trace/collect-trace-evidence.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"collect-trace-evidence.d.ts","sourceRoot":"","sources":["../../../src/contract/trace/collect-trace-evidence.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAiB,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEjE,OAAO,EAAsC,YAAY,EAAE,UAAU,EAAoB,MAAM,wBAAwB,CAAC;AACxH,OAAO,EAAiC,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE9E,MAAM,MAAM,SAAS,GAAG,YAAY,GAAG,cAAc,GAAG,UAAU,GAAG,SAAS,GAAG,aAAa,CAAC;AAC/F,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,MAAM,CAAC,EAAE,YAAY,CAAC;IACtB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AACD,MAAM,WAAW,gBAAgB;IAAG,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAA;CAAE;AAEzG,yGAAyG;AACzG,eAAO,MAAM,uBAAuB,QAAmB,CAAC;AASxD,2FAA2F;AAC3F,eAAO,MAAM,WAAW,yDAAyD,CAAC;AAgDlF;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,KAAK,OAAO,EAAE,QAAQ,EAAE,YAAY,GAAG,IAAI,EAAE,QAAQ,SAA2B,GACvI;IAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAAC,SAAS,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAAE,CA8B9I;AAuBD,mGAAmG;AACnG,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,YAAY,GAAG,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACnI,gBAAgB,CAalB"}
|
|
@@ -46,6 +46,9 @@ exports.collectScenarioEvidence = collectScenarioEvidence;
|
|
|
46
46
|
* refused the trace exists but may not speak (swapped, stale, rejected zip…)
|
|
47
47
|
* unsupported the trace's format version is unknown (exit ≠ 0)
|
|
48
48
|
*
|
|
49
|
+
* Two recorded TESTS claiming one scenario id (#962) make its evidence ambiguous: neither speaks —
|
|
50
|
+
* `unproven`, both named (scenario-id-claims.ts) — instead of judging two tests' runs as one.
|
|
51
|
+
*
|
|
49
52
|
* Only traces of the scenario ids asked for are opened, so a unit pays for its own tests only.
|
|
50
53
|
*/
|
|
51
54
|
const fs = __importStar(require("fs"));
|
|
@@ -53,6 +56,7 @@ const path = __importStar(require("path"));
|
|
|
53
56
|
const parse_1 = require("../../harness/parse");
|
|
54
57
|
const render_free_gherkin_1 = require("../render-free-gherkin");
|
|
55
58
|
const read_file_once_1 = require("./read-file-once");
|
|
59
|
+
const scenario_id_claims_1 = require("./scenario-id-claims");
|
|
56
60
|
const trace_binding_1 = require("./trace-binding");
|
|
57
61
|
const trace_file_reader_1 = require("./trace-file-reader");
|
|
58
62
|
const trace_zip_limits_1 = require("./trace-zip-limits");
|
|
@@ -71,22 +75,32 @@ function notRead(name, r) {
|
|
|
71
75
|
/** The reason a run is not judged once the verdict's deadline has passed (fail closed). */
|
|
72
76
|
exports.OVER_BUDGET = 'verdict budget exceeded; run `sungen contract check`';
|
|
73
77
|
const NO_RECORD = "no sungen run record under test-results-free/ (or test-results/) — run the free tests with their own config: outputDir 'test-results-free', trace: 'on' and the sungen run-record reporter";
|
|
74
|
-
/**
|
|
75
|
-
function
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
/** `p` relative to `root` when it lies under it, else null. */
|
|
79
|
+
function under(root, p) {
|
|
80
|
+
const rel = path.relative(root, p);
|
|
81
|
+
return rel && !rel.startsWith('..') && !path.isAbsolute(rel) ? rel : null;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Where a report's trace attachment is: the first candidate that exists (read later, opened once, and
|
|
85
|
+
* only from inside the project). Playwright writes attachment paths ABSOLUTE, in the checkout that ran;
|
|
86
|
+
* after a clone or a move that checkout is elsewhere, so a path under the report's own config dir is
|
|
87
|
+
* first tried at the same place under this project (#967) — the run record's sha256 still binds the bytes.
|
|
88
|
+
*/
|
|
89
|
+
function attachmentPath(projectRoot, test, p) {
|
|
90
|
+
const moved = path.isAbsolute(p) && test.configRoot && !under(path.resolve(projectRoot), p) ? under(test.configRoot, p) : null;
|
|
91
|
+
const candidates = path.isAbsolute(p)
|
|
92
|
+
? [...(moved ? [path.resolve(projectRoot, moved)] : []), p]
|
|
93
|
+
: [path.resolve(projectRoot, p), path.resolve(path.dirname(test.report), p)];
|
|
94
|
+
return candidates.find((c) => fs.existsSync(c)) ?? null;
|
|
81
95
|
}
|
|
82
|
-
function judge(projectRoot, record, test,
|
|
96
|
+
function judge(projectRoot, record, test, contract) {
|
|
83
97
|
const scenarioId = (0, select_final_attempt_1.scenarioIdOfTest)(test.title, test.tags);
|
|
84
98
|
const base = { scenarioId, test, record };
|
|
85
99
|
const fin = (0, select_final_attempt_1.finalAttempt)(test);
|
|
86
100
|
if (fin.admissibility !== 'admissible')
|
|
87
101
|
return { ...base, result: fin.result, status: fin.admissibility, reason: fin.reason };
|
|
88
102
|
const missing = { ...base, result: fin.result, status: 'unproven', reason: `no trace at ${fin.result.tracePath} (the report points at a missing file)` };
|
|
89
|
-
const cand = attachmentPath(projectRoot, test
|
|
103
|
+
const cand = attachmentPath(projectRoot, test, fin.result.tracePath);
|
|
90
104
|
if (!cand)
|
|
91
105
|
return missing;
|
|
92
106
|
// Opened once, inside the project, and what was opened is what is parsed and hashed (#926).
|
|
@@ -105,15 +119,20 @@ function judge(projectRoot, record, test, notBefore) {
|
|
|
105
119
|
const unsupported = e instanceof trace_zip_limits_1.TraceRejected && e.code === 'trace.version-unsupported';
|
|
106
120
|
return { ...base, result: fin.result, status: unsupported ? 'unsupported' : 'refused', reason: `trace refused: ${e.message}` };
|
|
107
121
|
}
|
|
108
|
-
const bound = (0, trace_binding_1.bindTrace)({ projectRoot, test, result: fin.result, record, trace,
|
|
122
|
+
const bound = (0, trace_binding_1.bindTrace)({ projectRoot, test, result: fin.result, record, trace, contract });
|
|
109
123
|
if (bound.ok === false)
|
|
110
124
|
return { ...base, result: fin.result, trace, status: 'refused', reason: `trace refused: ${bound.reason}` };
|
|
111
125
|
return { ...base, result: fin.result, trace, status: 'admissible', specFile: bound.specFile };
|
|
112
126
|
}
|
|
113
|
-
/**
|
|
114
|
-
|
|
127
|
+
/**
|
|
128
|
+
* Every judged run of the tests `want` accepts (derive: a unit's tests; check: by scenario id). A trace
|
|
129
|
+
* older than `contract` — the unit's .feature files and lock, by content (#967) — is refused; derive,
|
|
130
|
+
* which writes the contract from the traces, passes null.
|
|
131
|
+
*/
|
|
132
|
+
function collectRuns(projectRoot, want, contract, deadline = Number.POSITIVE_INFINITY) {
|
|
115
133
|
const runs = [];
|
|
116
134
|
const problems = [];
|
|
135
|
+
const untrusted = [];
|
|
117
136
|
const inputs = [];
|
|
118
137
|
const seen = [];
|
|
119
138
|
const records = (0, trace_run_record_1.findRunRecords)(projectRoot);
|
|
@@ -128,7 +147,8 @@ function collectRuns(projectRoot, want, notBefore, deadline = Number.POSITIVE_IN
|
|
|
128
147
|
record = (0, trace_run_record_1.readRunRecord)(file, recordRead.bytes.toString('utf8'));
|
|
129
148
|
}
|
|
130
149
|
catch (e) {
|
|
131
|
-
|
|
150
|
+
untrusted.push(`${path.basename(file)} is not trusted: ${e.message}`);
|
|
151
|
+
problems.push(untrusted[untrusted.length - 1]);
|
|
132
152
|
continue;
|
|
133
153
|
}
|
|
134
154
|
if (!record.report) {
|
|
@@ -154,10 +174,10 @@ function collectRuns(projectRoot, want, notBefore, deadline = Number.POSITIVE_IN
|
|
|
154
174
|
seen.push({ id, title: test.title });
|
|
155
175
|
if (!want(id, test))
|
|
156
176
|
continue;
|
|
157
|
-
runs.push(Date.now() > deadline ? { scenarioId: id, test, record, status: 'unproven', reason: exports.OVER_BUDGET } : judge(projectRoot, record, test,
|
|
177
|
+
runs.push(Date.now() > deadline ? { scenarioId: id, test, record, status: 'unproven', reason: exports.OVER_BUDGET } : judge(projectRoot, record, test, contract));
|
|
158
178
|
}
|
|
159
179
|
}
|
|
160
|
-
return { runs, problems, inputs, records: records.length, seen };
|
|
180
|
+
return { runs, problems, untrusted, inputs, records: records.length, seen };
|
|
161
181
|
}
|
|
162
182
|
/** A title without its leading id, for comparing words only: `VP-X-001 Login works` → `login works`. */
|
|
163
183
|
const wordsOf = (title) => {
|
|
@@ -180,12 +200,19 @@ function noTestFor(id, name, seen) {
|
|
|
180
200
|
+ `give the test the id ${id} (in its title and its @tag), or the scenario the id ${other}, then run it again with trace on`;
|
|
181
201
|
}
|
|
182
202
|
/** The runs of each scenario id; `names` (id → scenario name) lets a missing test be explained. */
|
|
183
|
-
function collectScenarioEvidence(projectRoot, ids,
|
|
184
|
-
const found = collectRuns(projectRoot, (id) => ids.has(id),
|
|
203
|
+
function collectScenarioEvidence(projectRoot, ids, contract, deadline, names) {
|
|
204
|
+
const found = collectRuns(projectRoot, (id) => ids.has(id), contract, deadline);
|
|
185
205
|
const runs = new Map([...ids].map((id) => [id, found.runs.filter((r) => r.scenarioId === id)]));
|
|
206
|
+
// Ambiguous evidence: no run of either test may speak for the id — never one picked arbitrarily.
|
|
207
|
+
for (const [id, claim] of (0, scenario_id_claims_1.idsClaimedByTwoTests)(projectRoot, found.runs)) {
|
|
208
|
+
if (runs.has(id))
|
|
209
|
+
runs.set(id, [{ scenarioId: id, status: 'unproven', reason: (0, scenario_id_claims_1.twoTestsClaim)(id, claim) }]);
|
|
210
|
+
}
|
|
186
211
|
for (const [id, list] of runs) {
|
|
212
|
+
// A record that was not trusted may be why (a newer reporter, a hand edit): the finding says so.
|
|
213
|
+
const why = found.untrusted.length ? ` — ${found.untrusted.join('; ')}` : '';
|
|
187
214
|
if (!list.length)
|
|
188
|
-
list.push({ scenarioId: id, status: 'unproven', reason: found.records ? noTestFor(id, names?.get(id), found.seen) : NO_RECORD });
|
|
215
|
+
list.push({ scenarioId: id, status: 'unproven', reason: found.records ? `${noTestFor(id, names?.get(id), found.seen)}${why}` : NO_RECORD });
|
|
189
216
|
}
|
|
190
217
|
return { runs, problems: found.problems, inputs: found.inputs };
|
|
191
218
|
}
|