@plainconceptsplatform/workflows 1.10.0 → 1.11.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.
Files changed (37) hide show
  1. package/README.md +1 -1
  2. package/dist/catalog-installation.js +5 -0
  3. package/dist/catalog-listing.js +6 -1
  4. package/dist/index.js +27 -4
  5. package/dist/template-bundles.d.ts +21 -0
  6. package/dist/template-bundles.js +108 -0
  7. package/dist/workflow-catalog.d.ts +5 -1
  8. package/dist/workflow-catalog.js +8 -0
  9. package/loops/actions/report-workflow-errors/action.yml +63 -16
  10. package/loops/actions/report-workflow-errors/report-policy.cjs +89 -5
  11. package/loops/actions/verify-route-matrix/verify-route-matrix.sh +18 -0
  12. package/loops/templates/ci/app-ci-dotnet-next.yml +776 -117
  13. package/loops/templates/platform-template/.github/workflows/platform-template-sync.yml +171 -0
  14. package/loops/templates/platform-template/scripts/check-platform-conformance.mjs +178 -0
  15. package/loops/templates/quality-gates/.jscpd.json +36 -0
  16. package/loops/templates/quality-gates/.jscpd.json.md +7 -0
  17. package/loops/templates/quality-gates/.semgrep/platform-hygiene.yml +88 -0
  18. package/loops/templates/quality-gates/.zap/rules.tsv +26 -0
  19. package/loops/templates/quality-gates/scripts/check-complexity.mjs +86 -0
  20. package/loops/templates/quality-gates/scripts/check-coverage.mjs +89 -0
  21. package/loops/templates/quality-gates/scripts/check-duplication.mjs +67 -0
  22. package/loops/templates/quality-gates/scripts/check-mutation.mjs +67 -0
  23. package/loops/templates/quality-gates/scripts/dast-wait-stable.sh +53 -0
  24. package/loops/templates/quality-gates/scripts/engineering-excellence.mjs +188 -0
  25. package/loops/templates/quality-gates/scripts/engineering-excellence.schema.json +895 -0
  26. package/loops/templates/quality-gates/scripts/engineering-excellence.schema.json.md +5 -0
  27. package/loops/templates/quality-gates/scripts/lib/complexity-gate.mjs +80 -0
  28. package/loops/templates/quality-gates/scripts/lib/complexity-gate.test.mjs +105 -0
  29. package/loops/templates/quality-gates/scripts/lib/duplication-gate.mjs +50 -0
  30. package/loops/templates/quality-gates/scripts/lib/duplication-gate.test.mjs +47 -0
  31. package/loops/templates/quality-gates/scripts/lib/engineering-excellence.mjs +674 -0
  32. package/loops/templates/quality-gates/scripts/lib/engineering-excellence.test.mjs +284 -0
  33. package/loops/templates/quality-gates/scripts/lib/hygiene-facet.test.mjs +179 -0
  34. package/loops/templates/quality-gates/scripts/lib/quality-config.mjs +65 -0
  35. package/loops/templates/quality-gates/scripts/lib/quality-config.test.mjs +29 -0
  36. package/loops/templates/quality-gates/scripts/lib/source-files.mjs +26 -0
  37. package/package.json +2 -2
@@ -2414,6 +2414,21 @@ if [ -f "$ERROR_REPORT_YML" ]; then
2414
2414
  ok(p.isQuiet(null, now, 30) === false, "no closing date is not quiet");
2415
2415
  ok(p.parseVersion("# Managed by @plainconceptsplatform/workflows@1.2.3. Source: x") === "1.2.3", "the version has no trailing full stop");
2416
2416
  ok(p.parseVersion("nothing here") === "unknown", "no version reads as unknown");
2417
+ // The layer that still got through: a secret the consumer never set, an agent failure the
2418
+ // worker had already retried, a lint check failing on a pull request, an outdated install.
2419
+ ok(p.severityOf("missing-secret") === "consumer", "a missing secret belongs to the consumer");
2420
+ ok(p.causeFromStep("Validate CODEX_API_KEY or OPENAI_API_KEY secret") === "missing-secret", "the secret check is read from its step name");
2421
+ ok(p.causeFromStep("Execute OpenCode CLI") === null, "any other step is left to the catalogue");
2422
+ const held = p.select([f("s", 39, "consumer"), f("u", 2, "unknown"), f("k", 2, "package-bug")], { minOccurrences: 2, minUnknown: 3, maxFindings: 5 });
2423
+ ok(held.file.map((x) => x.patternId).join() === "k", "a consumer cause and an undiagnosed pair are held, a diagnosed pair is filed");
2424
+ const retry = (conclusion) => [{ steps: [{ name: "Execute OpenCode CLI", conclusion: "failure" }] }, { steps: [{ name: "Send the work back through the router", conclusion }] }];
2425
+ ok(p.wasRetried(retry("success")) === true, "a run whose retry was sent is answered");
2426
+ ok(p.wasRetried(retry("skipped")) === false, "a run that parked is not");
2427
+ ok(p.isReviewCheck({ workflow: "agentics-checks.yml", event: "pull_request" }) === true, "a check failing on a pull request did its job");
2428
+ ok(p.isReviewCheck({ workflow: "agentics-checks.yml", event: "push" }) === false, "a check failing on the default branch is read");
2429
+ ok(p.isOutdated("1.6.41", "v1.10.0") === true && p.isOutdated("1.10.0", "v1.10.1") === false, "only a minor or more behind is outdated");
2430
+ ok(p.isOutdated("unknown", "v1.10.0") === false && p.isOutdated("1.9.0", "") === false, "an unknown version files as before");
2431
+ ok(p.latestVersion(["v1.9.4", "v1.10.0", "v0.28.11-alpha.1", "v1.8.3"]) === "v1.10.0", "the newest tag is read numerically, prereleases left out");
2417
2432
  if (bad.length) { console.error(bad.join("\n")); process.exit(1); }
2418
2433
  '
2419
2434
  if node -e "$policy_js" "$POLICY_CJS" 2>/tmp/policy-err; then
@@ -2432,6 +2447,9 @@ if [ -f "$ERROR_REPORT_YML" ]; then
2432
2447
  er "patternId === 'log-unavailable'\) \{ quiet\.unreadable \+= 1; continue; \}" 'files jobs whose log could not be read'
2433
2448
  er 'policy\.isQuiet\(' 'does not keep a recently closed signature quiet'
2434
2449
  er 'listAnnotations' 'does not read the job annotations, where the runner shutdown is written'
2450
+ er 'if \(policy\.wasRetried\(jobs\)\) \{ quiet\.retried \+= 1; continue; \}' 'files agent failures the worker already retried'
2451
+ er 'if \(policy\.isReviewCheck\(.*\{ quiet\.reviewChecks \+= 1; continue; \}' 'files lint checks that failed on a pull request'
2452
+ er 'if \(!existing && policy\.isOutdated\(' 'opens issues from installs a minor or more behind'
2435
2453
 
2436
2454
  # 4. No model. A model asked to summarise a failure paraphrases whatever the log held, which
2437
2455
  # is the one thing that must not cross the boundary. This job stays deterministic.