@amistio/cli 0.1.25 → 0.1.26

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/index.js CHANGED
@@ -5452,6 +5452,68 @@ var canonicalAppEvaluationCategories = /* @__PURE__ */ new Map([
5452
5452
  ["operations", "other"],
5453
5453
  ["ops", "other"]
5454
5454
  ]);
5455
+ var canonicalTestCommandKinds = /* @__PURE__ */ new Map([
5456
+ ["verify", "verify"],
5457
+ ["verification", "verify"],
5458
+ ["wholeapp", "verify"],
5459
+ ["wholeappverification", "verify"],
5460
+ ["full", "verify"],
5461
+ ["fullcheck", "verify"],
5462
+ ["fullchecks", "verify"],
5463
+ ["allcheck", "verify"],
5464
+ ["allchecks", "verify"],
5465
+ ["ci", "verify"],
5466
+ ["continuousintegration", "verify"],
5467
+ ["test", "test"],
5468
+ ["tests", "test"],
5469
+ ["testing", "test"],
5470
+ ["unittest", "test"],
5471
+ ["unittests", "test"],
5472
+ ["integrationtest", "test"],
5473
+ ["integrationtests", "test"],
5474
+ ["e2etest", "test"],
5475
+ ["e2etests", "test"],
5476
+ ["endtoend", "test"],
5477
+ ["endtoendtest", "test"],
5478
+ ["spec", "test"],
5479
+ ["specs", "test"],
5480
+ ["suite", "test"],
5481
+ ["testsuite", "test"],
5482
+ ["jest", "test"],
5483
+ ["vitest", "test"],
5484
+ ["coverage", "coverage"],
5485
+ ["coveragereport", "coverage"],
5486
+ ["lint", "lint"],
5487
+ ["linting", "lint"],
5488
+ ["eslint", "lint"],
5489
+ ["format", "lint"],
5490
+ ["formatting", "lint"],
5491
+ ["style", "lint"],
5492
+ ["quality", "lint"],
5493
+ ["qualitycheck", "lint"],
5494
+ ["staticanalysis", "lint"],
5495
+ ["typecheck", "typecheck"],
5496
+ ["typechecks", "typecheck"],
5497
+ ["typechecking", "typecheck"],
5498
+ ["typecheck", "typecheck"],
5499
+ ["tsc", "typecheck"],
5500
+ ["typescript", "typecheck"],
5501
+ ["build", "build"],
5502
+ ["compile", "build"],
5503
+ ["focused", "focused"],
5504
+ ["focus", "focused"],
5505
+ ["targeted", "focused"],
5506
+ ["scoped", "focused"],
5507
+ ["package", "focused"],
5508
+ ["packaged", "focused"],
5509
+ ["affected", "focused"],
5510
+ ["affectedtests", "focused"],
5511
+ ["touched", "focused"],
5512
+ ["touchedtests", "focused"],
5513
+ ["changed", "focused"],
5514
+ ["changedtests", "focused"],
5515
+ ["other", "focused"]
5516
+ ]);
5455
5517
  var canonicalProjectContextCitationSources = /* @__PURE__ */ new Map([
5456
5518
  ["projectbrain", "projectBrain"],
5457
5519
  ["approvedbrain", "projectBrain"],
@@ -5551,7 +5613,7 @@ function createTestQualityScanPrompt(workItem, context) {
5551
5613
  "## Output Contract",
5552
5614
  "",
5553
5615
  "Print exactly one JSON object between the markers below. The CLI will submit only this structured test scan result back to Amistio.",
5554
- "Accepted command kind values: lint, typecheck, unitTest, integrationTest, e2eTest, coverage, build, verify, other.",
5616
+ "Accepted command kind values: verify, test, coverage, lint, typecheck, build, focused.",
5555
5617
  "Accepted command status values: passed, failed, skipped, missing, blocked.",
5556
5618
  "Accepted finding categories: missingTests, missingCoverage, lowCoverage, failingTests, failingQuality, missingCommand, flakyTests, unverifiedImplementation, testGap, other.",
5557
5619
  "",
@@ -6237,7 +6299,49 @@ function parseTestQualityScanResult(output) {
6237
6299
  }
6238
6300
  const payload = output.slice(start + testQualityStart.length, end).trim();
6239
6301
  const parsed = JSON.parse(stripJsonFence(payload));
6240
- return testQualityScanResultSchema.parse(parsed);
6302
+ return testQualityScanResultSchema.parse(normalizeTestQualityScanResultCommandKinds(parsed));
6303
+ }
6304
+ function normalizeTestQualityScanResultCommandKinds(value) {
6305
+ if (!isObjectRecord(value)) {
6306
+ return value;
6307
+ }
6308
+ const normalized = { ...value };
6309
+ if (isObjectRecord(normalized.profile) && Array.isArray(normalized.profile.commands)) {
6310
+ normalized.profile = {
6311
+ ...normalized.profile,
6312
+ commands: normalized.profile.commands.map(normalizeTestCommandKindObject)
6313
+ };
6314
+ }
6315
+ if (Array.isArray(normalized.commandSummaries)) {
6316
+ normalized.commandSummaries = normalized.commandSummaries.map(normalizeTestCommandKindObject);
6317
+ }
6318
+ return normalized;
6319
+ }
6320
+ function normalizeTestCommandKindObject(value) {
6321
+ if (!isObjectRecord(value)) {
6322
+ return value;
6323
+ }
6324
+ return { ...value, kind: normalizeTestCommandKind(value.kind) };
6325
+ }
6326
+ function normalizeTestCommandKind(value) {
6327
+ if (typeof value !== "string") {
6328
+ return value;
6329
+ }
6330
+ const trimmed = value.trim();
6331
+ if (!trimmed) {
6332
+ return value;
6333
+ }
6334
+ const direct = canonicalTestCommandKinds.get(normalizeEnumKey(trimmed));
6335
+ if (direct) {
6336
+ return direct;
6337
+ }
6338
+ for (const segment of trimmed.split(/[\/,|]+/)) {
6339
+ const segmentKind = canonicalTestCommandKinds.get(normalizeEnumKey(segment));
6340
+ if (segmentKind) {
6341
+ return segmentKind;
6342
+ }
6343
+ }
6344
+ return "focused";
6241
6345
  }
6242
6346
  function parseImplementationTestGateResult(output) {
6243
6347
  const start = output.indexOf(implementationTestGateStart);