qfai 2.2.0 → 2.2.1

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 (117) hide show
  1. package/README.md +46 -6
  2. package/assets/defaults/workflows/bump-dependency.yml +4 -1
  3. package/assets/defaults/workflows/decide-design.yml +5 -1
  4. package/assets/defaults/workflows/rename-concept.yml +30 -0
  5. package/assets/defaults/workflows/resolve-conflicts.yml +14 -0
  6. package/assets/defaults/workflows/retire-feature.yml +26 -0
  7. package/assets/defaults/workflows/run-release.yml +12 -0
  8. package/assets/init/.claude/settings.json +11 -11
  9. package/assets/init/.codex/hooks.json +9 -9
  10. package/assets/init/.qfai/assistant/agent/backend-engineer.md +1 -1
  11. package/assets/init/.qfai/assistant/agent/frontend-engineer.md +1 -1
  12. package/assets/init/.qfai/assistant/agent/implementation-reviewer.md +5 -0
  13. package/assets/init/.qfai/assistant/agent/product-surface-reviewer.md +8 -3
  14. package/assets/init/.qfai/assistant/rule/constitution.md +5 -3
  15. package/assets/init/.qfai/assistant/rule/drift-protocol.md +18 -0
  16. package/assets/init/.qfai/assistant/rule/references/gate-failure-autorepair.md +1 -1
  17. package/assets/init/.qfai/assistant/rule/review-convergence.md +9 -3
  18. package/assets/init/.qfai/assistant/rule/shared-skill-delegation-baseline.md +11 -2
  19. package/assets/init/.qfai/assistant/rule/shared-skill-operating-baseline.md +6 -4
  20. package/assets/init/.qfai/assistant/rule/ui-definition-protocol.md +2 -1
  21. package/assets/init/.qfai/assistant/skill/qfai-discussion/SKILL.md +5 -2
  22. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/discussion-completion-matrix.md +15 -2
  23. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui-bearing-playbook.md +17 -0
  24. package/assets/init/.qfai/assistant/skill/qfai-discussion/references/ui_ux/trend_scan_playbook.md +3 -1
  25. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/01_Context.md +4 -1
  26. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/04_Sources.md +5 -1
  27. package/assets/init/.qfai/assistant/skill/qfai-discussion/templates/uiux/00_index.md +4 -1
  28. package/assets/init/.qfai/assistant/skill/qfai-implement/SKILL.md +2 -2
  29. package/assets/init/.qfai/assistant/skill/qfai-implement/references/parallelization-policy.md +10 -0
  30. package/assets/init/.qfai/assistant/skill/qfai-implement/references/red-admissibility.md +35 -0
  31. package/assets/init/.qfai/assistant/skill/qfai-implement/references/test-runner-recipes.md +445 -0
  32. package/assets/init/.qfai/assistant/skill/qfai-implement/references/ui-affecting.md +2 -2
  33. package/assets/init/.qfai/assistant/skill/qfai-prototyping/SKILL.md +10 -9
  34. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/generator-prompt.md +33 -2
  35. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/handoff.md +77 -2
  36. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/iteration-loop.md +12 -3
  37. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/review-payload-schema.md +3 -1
  38. package/assets/init/.qfai/assistant/skill/qfai-prototyping/references/reviewer-prompt.md +31 -5
  39. package/assets/init/.qfai/assistant/skill/qfai-run/SKILL.md +17 -17
  40. package/assets/init/.qfai/assistant/skill/qfai-run/references/extraction.md +194 -129
  41. package/assets/init/.qfai/assistant/skill/qfai-run/references/operator-screens.md +29 -14
  42. package/assets/init/.qfai/assistant/skill/qfai-run/references/plan.md +46 -22
  43. package/assets/init/.qfai/assistant/skill/qfai-run/references/reached-step-observations.md +2 -0
  44. package/assets/init/.qfai/assistant/skill/qfai-run/references/stage-points.md +7 -4
  45. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/concrete-abstract-cycle.md +2 -1
  46. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/contract-artifact-rules.md +1 -1
  47. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-execution-playbook.md +2 -2
  48. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-phase-checklists.md +1 -1
  49. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-pre-draft-grilling.md +1 -0
  50. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-quality-gate.md +1 -1
  51. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/sdd-triage.md +83 -6
  52. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/spec-traceability-rules.md +1 -1
  53. package/assets/init/.qfai/assistant/skill/qfai-sdd/references/ui-contract-guide.md +23 -5
  54. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/change-request.md +1 -1
  55. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/decisions/page-NNNN.md +6 -0
  56. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/decisions.md +9 -0
  57. package/assets/init/.qfai/assistant/skill/qfai-sdd/templates/spec/open-questions.md +13 -0
  58. package/assets/init/.qfai/assistant/skill/qfai-verify/references/verify-output-contract.md +15 -9
  59. package/assets/init/.qfai/assistant/skill/web-research/SKILL.md +1 -1
  60. package/assets/init/.qfai/assistant/step/common-gate-run/STEP.md +11 -8
  61. package/assets/init/.qfai/assistant/step/common-grilling-record/STEP.md +15 -2
  62. package/assets/init/.qfai/assistant/step/common-review-cycle/STEP.md +48 -11
  63. package/assets/init/.qfai/assistant/step/discussion-interview/STEP.md +11 -3
  64. package/assets/init/.qfai/assistant/step/discussion-oq/STEP.md +12 -0
  65. package/assets/init/.qfai/assistant/step/discussion-pack/STEP.md +18 -2
  66. package/assets/init/.qfai/assistant/step/discussion-uiux/STEP.md +4 -0
  67. package/assets/init/.qfai/assistant/step/implement-acceptance/STEP.md +3 -0
  68. package/assets/init/.qfai/assistant/step/implement-credentials/STEP.md +4 -0
  69. package/assets/init/.qfai/assistant/step/implement-dep-bump/STEP.md +31 -7
  70. package/assets/init/.qfai/assistant/step/implement-diagnose/STEP.md +12 -3
  71. package/assets/init/.qfai/assistant/step/implement-procedure/STEP.md +35 -6
  72. package/assets/init/.qfai/assistant/step/implement-refactor/STEP.md +25 -5
  73. package/assets/init/.qfai/assistant/step/implement-retire/STEP.md +26 -0
  74. package/assets/init/.qfai/assistant/step/implement-scaffold/STEP.md +28 -5
  75. package/assets/init/.qfai/assistant/step/implement-tdd/STEP.md +20 -5
  76. package/assets/init/.qfai/assistant/step/maintain-edit/STEP.md +70 -6
  77. package/assets/init/.qfai/assistant/step/prototyping-grill/STEP.md +39 -6
  78. package/assets/init/.qfai/assistant/step/prototyping-handoff/STEP.md +12 -3
  79. package/assets/init/.qfai/assistant/step/prototyping-loop/STEP.md +56 -6
  80. package/assets/init/.qfai/assistant/step/prototyping-preflight/STEP.md +5 -0
  81. package/assets/init/.qfai/assistant/step/sdd-contract/STEP.md +8 -0
  82. package/assets/init/.qfai/assistant/step/sdd-cycle/STEP.md +9 -4
  83. package/assets/init/.qfai/assistant/step/sdd-story/STEP.md +22 -1
  84. package/assets/init/.qfai/assistant/step/sdd-triage/STEP.md +48 -12
  85. package/assets/init/.qfai/assistant/step/triage-close/STEP.md +7 -2
  86. package/assets/init/.qfai/assistant/step/triage-handoff/STEP.md +6 -0
  87. package/assets/init/.qfai/assistant/step/triage-operate/STEP.md +76 -3
  88. package/assets/init/.qfai/assistant/step/verify-commit/STEP.md +35 -10
  89. package/assets/init/.qfai/assistant/step/verify-repo-gate/STEP.md +65 -7
  90. package/assets/init/root/.agents/rules/api-budget.md +8 -3
  91. package/assets/init/root/.agents/rules/graph-exploration.md +18 -4
  92. package/assets/init/root/.agents/rules/reminders.json +20 -28
  93. package/assets/init/root/.agents/rules/user-questions.md +21 -11
  94. package/assets/init/root/.gitattributes +2 -0
  95. package/assets/init/root/AGENTS.md +1 -1
  96. package/assets/mdschema/manifest.yml +3 -0
  97. package/assets/mdschema/story/03_contract/tech.mdschema.yml +1 -1
  98. package/assets/mdschema/story/decisions/page-NNNN.mdschema.yml +32 -0
  99. package/assets/mdschema/story/decisions.mdschema.yml +12 -0
  100. package/assets/schemas/workflow/extraction.schema.json +94 -2
  101. package/assets/schemas/workflow/plan.schema.json +34 -1
  102. package/assets/scripts/check-mdschema.mjs +434 -45
  103. package/dist/cli/index.cjs +4930 -2264
  104. package/dist/cli/index.cjs.map +1 -1
  105. package/dist/cli/index.mjs +4690 -2016
  106. package/dist/cli/index.mjs.map +1 -1
  107. package/dist/graph/cli.cjs.map +1 -1
  108. package/dist/graph/cli.mjs.map +1 -1
  109. package/dist/graph/hook.cjs.map +1 -1
  110. package/dist/graph/hook.mjs.map +1 -1
  111. package/dist/index.cjs +3338 -1830
  112. package/dist/index.cjs.map +1 -1
  113. package/dist/index.d.cts +59 -3
  114. package/dist/index.d.ts +59 -3
  115. package/dist/index.mjs +3154 -1649
  116. package/dist/index.mjs.map +1 -1
  117. package/package.json +1 -1
package/dist/index.d.cts CHANGED
@@ -106,6 +106,28 @@ type ValidationTimings = {
106
106
  ms: number;
107
107
  }[];
108
108
  };
109
+ /**
110
+ * The time the checks under one label took. The label is the code families of the issues those
111
+ * checks returned (`STORY` for `QFAI-STORY-*`), or a check's own name when it returned none.
112
+ */
113
+ type ValidationFamilyTiming = {
114
+ family: string;
115
+ ms: number;
116
+ };
117
+ /**
118
+ * Wall-clock cost of each finding family, slowest first, written only when `--timings` asks for it.
119
+ *
120
+ * Like `ValidationTimings` it describes the machine, not the tree, so it raises no finding.
121
+ */
122
+ type ValidationFamilyTimings = {
123
+ /** Checks that ran one after another, summed per family. */
124
+ sequential: readonly ValidationFamilyTiming[];
125
+ /**
126
+ * The UI/UX group, whose checks run side by side: each time includes waiting for the others,
127
+ * so these overlap and do not add up to the group's own time.
128
+ */
129
+ overlapping: readonly ValidationFamilyTiming[];
130
+ };
109
131
  type ValidationResult = {
110
132
  toolVersion: string;
111
133
  /**
@@ -139,6 +161,7 @@ type ValidationResult = {
139
161
  counts: ValidationCounts;
140
162
  waivers?: ValidationWaivers;
141
163
  timings?: ValidationTimings;
164
+ familyTimings?: ValidationFamilyTimings;
142
165
  };
143
166
 
144
167
  type FailOn = "never" | "warning" | "error";
@@ -349,6 +372,20 @@ declare const SKIPPED_WORKFLOWS_MESSAGE: string;
349
372
  * `null` means the value is not a list of shipped names, and no entry is guessed in its place.
350
373
  */
351
374
  declare function readSkippedWorkflows(document: unknown): ReadonlySet<string> | null;
375
+ /** The config issue an invalid `workflow.acceptedDrift` raises. */
376
+ declare const ACCEPTED_DRIFT_MESSAGE: string;
377
+ /** One `workflow.acceptedDrift` entry: the digest of the accepted text and why it is kept. */
378
+ type AcceptedDrift = {
379
+ readonly digest: string;
380
+ readonly reason: string;
381
+ };
382
+ /**
383
+ * The shipped workflows `workflow.acceptedDrift` accepts as differing from the shipped text, each
384
+ * with the digest of the accepted text and its trimmed reason, read from the parsed config
385
+ * document. `null` means the value is not a list of such entries, and no entry is accepted in its
386
+ * place.
387
+ */
388
+ declare function readAcceptedDrift(document: unknown): ReadonlyMap<string, AcceptedDrift> | null;
352
389
  declare function resolvePath(root: string, config: QfaiConfig, key: ConfigPathKey): string;
353
390
  /**
354
391
  * Why the file's `prototyping.primaryUiContract` was rejected, or `undefined` when the file sets
@@ -611,10 +648,24 @@ declare function formatReportMarkdown(data: ReportData, options?: {
611
648
  }): string;
612
649
  declare function formatReportJson(data: ReportData): string;
613
650
 
651
+ /**
652
+ * The checks of a clock under the label a user can read, summed per label, slowest first and ties
653
+ * in name order. The label is the code families of the issues the check returned, sorted and
654
+ * joined with `/`, so it cannot disagree with the findings; a check that returned none keeps its
655
+ * own name.
656
+ */
657
+ declare function labelCheckTimings(clock: ReadonlyMap<string, {
658
+ ms: number;
659
+ families: ReadonlySet<string>;
660
+ }>): ValidationFamilyTiming[];
614
661
  type ValidationOptions = {
615
662
  profile?: ValidationProfile;
616
663
  platform?: string;
617
664
  flowIds?: readonly string[];
665
+ /** A rendered-text file the caller wrote (`--rendered`), compared with the UI contracts in every profile. */
666
+ renderedPath?: string;
667
+ /** Add the time of each finding family to the result (`--timings`). */
668
+ familyTimings?: boolean;
618
669
  };
619
670
  declare function validateProject(root: string, configResult?: ConfigLoadResult, options?: ValidationOptions): Promise<ValidationResult>;
620
671
  /**
@@ -770,8 +821,8 @@ type InstalledOlderThanDeclared = {
770
821
  * Whether the running qfai is older than the lowest version this project's
771
822
  * dependency declaration admits.
772
823
  *
773
- * The declaration is the only record of "the qfai this tree was written for"
774
- * that a project keeps: the files `qfai init` writes carry no version. An
824
+ * The declaration is the project's own record of "the qfai this tree was
825
+ * written for", beside the version file `qfai init` writes. An
775
826
  * installed copy below that floor is the state a lockfile that moved after the
776
827
  * last install leaves, and every rule whose input is a generated file can then
777
828
  * disagree with the tree for a reason that is not in the tree.
@@ -982,6 +1033,11 @@ interface GraphPreparation {
982
1033
  documents: "documents-not-ready";
983
1034
  failedStep?: string;
984
1035
  recovery?: string;
1036
+ /** A failed download repeated by hand into a throwaway directory, whose output shows the cause. */
1037
+ rerun?: {
1038
+ command: string;
1039
+ directory: string;
1040
+ };
985
1041
  previousInstallation?: "retained" | "none";
986
1042
  }
987
1043
 
@@ -1042,4 +1098,4 @@ declare function prepareDocumentAnalysis(root: string, run?: GraphProcess, appro
1042
1098
  /** Run one ordered spec-to-story migration step from the current project root. */
1043
1099
  declare function runMigrationStep(step: number, argv: string[]): Promise<number>;
1044
1100
 
1045
- export { AC_GHERKIN_SECTION, ARCHETYPES, ATDD_TEST_KIND_DIRS, type ApproveExternalProcessing, type Archetype, type AtddTestKind, COLOR_KEYS, type ColorKey, type ConfigLoadResult, type ConfigPathKey, type ConfigSearchResult, DESIGN_MD_SAMPLE_MARKER, DISCUSSION_NON_UI_SURFACES, DISCUSSION_UI_BEARING_SURFACES, type DesignMd, type DesignMdColors, type DesignMdFonts, type DesignMdRadius, type DesignMdShadow, type DocumentPreparation, type ExternalProcessingRequest, FONT_KEYS, type FailOn, type FenceMaskOptions, type FontKey, ID_PREFIXES, type IdFormatPrefix, type IdPrefix, type InstalledOlderThanDeclared, type InvalidIdOccurrence, type Issue, type IssueCategory, type IssueLocation, type IssueSeverity, type OutputFormat, type ParseError, type ParseResult, type QfaiConfig, type QfaiForbiddenIdentifier, type QfaiOutputConfig, type QfaiPaths, type QfaiPrototypingConfig, type QfaiPrototypingExecutionConfig, type QfaiReportConfig, type QfaiReviewProfile, type QfaiRoutingEntry, type QfaiUiuxAuditConfig, type QfaiUiuxConfig, type QfaiValidationConfig, RADIUS_KEYS, type RadiusKey, type ReportData, type RunSddPreflightOptions, SHADOW_KEYS, SKIPPED_WORKFLOWS_MESSAGE, type SddPreflightResult, type SddPreflightSource, type SddPreflightStatus, type ShadowKey, type TestFileExtensions, type TestLayerRoots, VISUAL_BROWSER_SURFACES, type ValidationCounts, type ValidationIssue, type ValidationOptions, type ValidationProfile, type ValidationResult, type ValidationTimings, type ValidationWaiverAction, type ValidationWaiverDowngradeTo, type ValidationWaiverEntry, type ValidationWaiverMatch, type ValidationWaiverScope, type ValidationWaiverSeverity, type ValidationWaiverSuppressed, type ValidationWaivers, WORKFLOW_MODE_MESSAGE, type WorkflowMode, atddAcceptanceLayerFilter, atddAcceptanceTestGlobs, atddTestKindDirs, classifyAgainstDeclaration, classifyToolLocation, compareInstalledToDeclared, countIssues, createReportData, createTestLayerRoots, defaultConfig, deriveAtddFilePattern, deriveTestFileExtensions, extractAcSpecNumber, extractAllIds, extractBrSpecNumber, extractCapSpecNumber, extractCaseSpecNumber, extractIds, extractInvalidIdOccurrences, extractInvalidIds, extractScSpecNumber, extractSpecNumber, extractUsSpecNumber, findConfigRoot, findDeclaringDir, findLinkingNodeModules, findPackageJsonUpward, formatReportJson, formatReportMarkdown, getConfigPath, isDiscussionUiBearingSurfaceType, isNonUiDiscussionSurface, isOlderVersion, isUnreplacedDesignMdSample, lintSql, loadConfig, locateToolAgainstProject, lowestVersionOfRange, maskFencedCodeBlocks, orderUiuxParts, packageRootProbe, parseDesignMd, prepareDocumentAnalysis, prepareGraphIntegration, reachedThroughLinkedNodeModules, readDeclaredQfaiRange, readRejectedPrimaryUiContract, readSkippedWorkflows, readTestFileExtensions, readWorkflowMode, renderGraphPreparation, requiresVisualBrowserEvidence, resolvePath, resolveTestKind, resolveToolPackageDir, resolveToolVersion, resolvesThroughOwnNodeModules, routingEntryName, runMigrationStep, runSddPreflight, validateContracts, validateDesignMd, validateProject, validateUiContractParse };
1101
+ export { ACCEPTED_DRIFT_MESSAGE, AC_GHERKIN_SECTION, ARCHETYPES, ATDD_TEST_KIND_DIRS, type AcceptedDrift, type ApproveExternalProcessing, type Archetype, type AtddTestKind, COLOR_KEYS, type ColorKey, type ConfigLoadResult, type ConfigPathKey, type ConfigSearchResult, DESIGN_MD_SAMPLE_MARKER, DISCUSSION_NON_UI_SURFACES, DISCUSSION_UI_BEARING_SURFACES, type DesignMd, type DesignMdColors, type DesignMdFonts, type DesignMdRadius, type DesignMdShadow, type DocumentPreparation, type ExternalProcessingRequest, FONT_KEYS, type FailOn, type FenceMaskOptions, type FontKey, ID_PREFIXES, type IdFormatPrefix, type IdPrefix, type InstalledOlderThanDeclared, type InvalidIdOccurrence, type Issue, type IssueCategory, type IssueLocation, type IssueSeverity, type OutputFormat, type ParseError, type ParseResult, type QfaiConfig, type QfaiForbiddenIdentifier, type QfaiOutputConfig, type QfaiPaths, type QfaiPrototypingConfig, type QfaiPrototypingExecutionConfig, type QfaiReportConfig, type QfaiReviewProfile, type QfaiRoutingEntry, type QfaiUiuxAuditConfig, type QfaiUiuxConfig, type QfaiValidationConfig, RADIUS_KEYS, type RadiusKey, type ReportData, type RunSddPreflightOptions, SHADOW_KEYS, SKIPPED_WORKFLOWS_MESSAGE, type SddPreflightResult, type SddPreflightSource, type SddPreflightStatus, type ShadowKey, type TestFileExtensions, type TestLayerRoots, VISUAL_BROWSER_SURFACES, type ValidationCounts, type ValidationFamilyTiming, type ValidationFamilyTimings, type ValidationIssue, type ValidationOptions, type ValidationProfile, type ValidationResult, type ValidationTimings, type ValidationWaiverAction, type ValidationWaiverDowngradeTo, type ValidationWaiverEntry, type ValidationWaiverMatch, type ValidationWaiverScope, type ValidationWaiverSeverity, type ValidationWaiverSuppressed, type ValidationWaivers, WORKFLOW_MODE_MESSAGE, type WorkflowMode, atddAcceptanceLayerFilter, atddAcceptanceTestGlobs, atddTestKindDirs, classifyAgainstDeclaration, classifyToolLocation, compareInstalledToDeclared, countIssues, createReportData, createTestLayerRoots, defaultConfig, deriveAtddFilePattern, deriveTestFileExtensions, extractAcSpecNumber, extractAllIds, extractBrSpecNumber, extractCapSpecNumber, extractCaseSpecNumber, extractIds, extractInvalidIdOccurrences, extractInvalidIds, extractScSpecNumber, extractSpecNumber, extractUsSpecNumber, findConfigRoot, findDeclaringDir, findLinkingNodeModules, findPackageJsonUpward, formatReportJson, formatReportMarkdown, getConfigPath, isDiscussionUiBearingSurfaceType, isNonUiDiscussionSurface, isOlderVersion, isUnreplacedDesignMdSample, labelCheckTimings, lintSql, loadConfig, locateToolAgainstProject, lowestVersionOfRange, maskFencedCodeBlocks, orderUiuxParts, packageRootProbe, parseDesignMd, prepareDocumentAnalysis, prepareGraphIntegration, reachedThroughLinkedNodeModules, readAcceptedDrift, readDeclaredQfaiRange, readRejectedPrimaryUiContract, readSkippedWorkflows, readTestFileExtensions, readWorkflowMode, renderGraphPreparation, requiresVisualBrowserEvidence, resolvePath, resolveTestKind, resolveToolPackageDir, resolveToolVersion, resolvesThroughOwnNodeModules, routingEntryName, runMigrationStep, runSddPreflight, validateContracts, validateDesignMd, validateProject, validateUiContractParse };
package/dist/index.d.ts CHANGED
@@ -106,6 +106,28 @@ type ValidationTimings = {
106
106
  ms: number;
107
107
  }[];
108
108
  };
109
+ /**
110
+ * The time the checks under one label took. The label is the code families of the issues those
111
+ * checks returned (`STORY` for `QFAI-STORY-*`), or a check's own name when it returned none.
112
+ */
113
+ type ValidationFamilyTiming = {
114
+ family: string;
115
+ ms: number;
116
+ };
117
+ /**
118
+ * Wall-clock cost of each finding family, slowest first, written only when `--timings` asks for it.
119
+ *
120
+ * Like `ValidationTimings` it describes the machine, not the tree, so it raises no finding.
121
+ */
122
+ type ValidationFamilyTimings = {
123
+ /** Checks that ran one after another, summed per family. */
124
+ sequential: readonly ValidationFamilyTiming[];
125
+ /**
126
+ * The UI/UX group, whose checks run side by side: each time includes waiting for the others,
127
+ * so these overlap and do not add up to the group's own time.
128
+ */
129
+ overlapping: readonly ValidationFamilyTiming[];
130
+ };
109
131
  type ValidationResult = {
110
132
  toolVersion: string;
111
133
  /**
@@ -139,6 +161,7 @@ type ValidationResult = {
139
161
  counts: ValidationCounts;
140
162
  waivers?: ValidationWaivers;
141
163
  timings?: ValidationTimings;
164
+ familyTimings?: ValidationFamilyTimings;
142
165
  };
143
166
 
144
167
  type FailOn = "never" | "warning" | "error";
@@ -349,6 +372,20 @@ declare const SKIPPED_WORKFLOWS_MESSAGE: string;
349
372
  * `null` means the value is not a list of shipped names, and no entry is guessed in its place.
350
373
  */
351
374
  declare function readSkippedWorkflows(document: unknown): ReadonlySet<string> | null;
375
+ /** The config issue an invalid `workflow.acceptedDrift` raises. */
376
+ declare const ACCEPTED_DRIFT_MESSAGE: string;
377
+ /** One `workflow.acceptedDrift` entry: the digest of the accepted text and why it is kept. */
378
+ type AcceptedDrift = {
379
+ readonly digest: string;
380
+ readonly reason: string;
381
+ };
382
+ /**
383
+ * The shipped workflows `workflow.acceptedDrift` accepts as differing from the shipped text, each
384
+ * with the digest of the accepted text and its trimmed reason, read from the parsed config
385
+ * document. `null` means the value is not a list of such entries, and no entry is accepted in its
386
+ * place.
387
+ */
388
+ declare function readAcceptedDrift(document: unknown): ReadonlyMap<string, AcceptedDrift> | null;
352
389
  declare function resolvePath(root: string, config: QfaiConfig, key: ConfigPathKey): string;
353
390
  /**
354
391
  * Why the file's `prototyping.primaryUiContract` was rejected, or `undefined` when the file sets
@@ -611,10 +648,24 @@ declare function formatReportMarkdown(data: ReportData, options?: {
611
648
  }): string;
612
649
  declare function formatReportJson(data: ReportData): string;
613
650
 
651
+ /**
652
+ * The checks of a clock under the label a user can read, summed per label, slowest first and ties
653
+ * in name order. The label is the code families of the issues the check returned, sorted and
654
+ * joined with `/`, so it cannot disagree with the findings; a check that returned none keeps its
655
+ * own name.
656
+ */
657
+ declare function labelCheckTimings(clock: ReadonlyMap<string, {
658
+ ms: number;
659
+ families: ReadonlySet<string>;
660
+ }>): ValidationFamilyTiming[];
614
661
  type ValidationOptions = {
615
662
  profile?: ValidationProfile;
616
663
  platform?: string;
617
664
  flowIds?: readonly string[];
665
+ /** A rendered-text file the caller wrote (`--rendered`), compared with the UI contracts in every profile. */
666
+ renderedPath?: string;
667
+ /** Add the time of each finding family to the result (`--timings`). */
668
+ familyTimings?: boolean;
618
669
  };
619
670
  declare function validateProject(root: string, configResult?: ConfigLoadResult, options?: ValidationOptions): Promise<ValidationResult>;
620
671
  /**
@@ -770,8 +821,8 @@ type InstalledOlderThanDeclared = {
770
821
  * Whether the running qfai is older than the lowest version this project's
771
822
  * dependency declaration admits.
772
823
  *
773
- * The declaration is the only record of "the qfai this tree was written for"
774
- * that a project keeps: the files `qfai init` writes carry no version. An
824
+ * The declaration is the project's own record of "the qfai this tree was
825
+ * written for", beside the version file `qfai init` writes. An
775
826
  * installed copy below that floor is the state a lockfile that moved after the
776
827
  * last install leaves, and every rule whose input is a generated file can then
777
828
  * disagree with the tree for a reason that is not in the tree.
@@ -982,6 +1033,11 @@ interface GraphPreparation {
982
1033
  documents: "documents-not-ready";
983
1034
  failedStep?: string;
984
1035
  recovery?: string;
1036
+ /** A failed download repeated by hand into a throwaway directory, whose output shows the cause. */
1037
+ rerun?: {
1038
+ command: string;
1039
+ directory: string;
1040
+ };
985
1041
  previousInstallation?: "retained" | "none";
986
1042
  }
987
1043
 
@@ -1042,4 +1098,4 @@ declare function prepareDocumentAnalysis(root: string, run?: GraphProcess, appro
1042
1098
  /** Run one ordered spec-to-story migration step from the current project root. */
1043
1099
  declare function runMigrationStep(step: number, argv: string[]): Promise<number>;
1044
1100
 
1045
- export { AC_GHERKIN_SECTION, ARCHETYPES, ATDD_TEST_KIND_DIRS, type ApproveExternalProcessing, type Archetype, type AtddTestKind, COLOR_KEYS, type ColorKey, type ConfigLoadResult, type ConfigPathKey, type ConfigSearchResult, DESIGN_MD_SAMPLE_MARKER, DISCUSSION_NON_UI_SURFACES, DISCUSSION_UI_BEARING_SURFACES, type DesignMd, type DesignMdColors, type DesignMdFonts, type DesignMdRadius, type DesignMdShadow, type DocumentPreparation, type ExternalProcessingRequest, FONT_KEYS, type FailOn, type FenceMaskOptions, type FontKey, ID_PREFIXES, type IdFormatPrefix, type IdPrefix, type InstalledOlderThanDeclared, type InvalidIdOccurrence, type Issue, type IssueCategory, type IssueLocation, type IssueSeverity, type OutputFormat, type ParseError, type ParseResult, type QfaiConfig, type QfaiForbiddenIdentifier, type QfaiOutputConfig, type QfaiPaths, type QfaiPrototypingConfig, type QfaiPrototypingExecutionConfig, type QfaiReportConfig, type QfaiReviewProfile, type QfaiRoutingEntry, type QfaiUiuxAuditConfig, type QfaiUiuxConfig, type QfaiValidationConfig, RADIUS_KEYS, type RadiusKey, type ReportData, type RunSddPreflightOptions, SHADOW_KEYS, SKIPPED_WORKFLOWS_MESSAGE, type SddPreflightResult, type SddPreflightSource, type SddPreflightStatus, type ShadowKey, type TestFileExtensions, type TestLayerRoots, VISUAL_BROWSER_SURFACES, type ValidationCounts, type ValidationIssue, type ValidationOptions, type ValidationProfile, type ValidationResult, type ValidationTimings, type ValidationWaiverAction, type ValidationWaiverDowngradeTo, type ValidationWaiverEntry, type ValidationWaiverMatch, type ValidationWaiverScope, type ValidationWaiverSeverity, type ValidationWaiverSuppressed, type ValidationWaivers, WORKFLOW_MODE_MESSAGE, type WorkflowMode, atddAcceptanceLayerFilter, atddAcceptanceTestGlobs, atddTestKindDirs, classifyAgainstDeclaration, classifyToolLocation, compareInstalledToDeclared, countIssues, createReportData, createTestLayerRoots, defaultConfig, deriveAtddFilePattern, deriveTestFileExtensions, extractAcSpecNumber, extractAllIds, extractBrSpecNumber, extractCapSpecNumber, extractCaseSpecNumber, extractIds, extractInvalidIdOccurrences, extractInvalidIds, extractScSpecNumber, extractSpecNumber, extractUsSpecNumber, findConfigRoot, findDeclaringDir, findLinkingNodeModules, findPackageJsonUpward, formatReportJson, formatReportMarkdown, getConfigPath, isDiscussionUiBearingSurfaceType, isNonUiDiscussionSurface, isOlderVersion, isUnreplacedDesignMdSample, lintSql, loadConfig, locateToolAgainstProject, lowestVersionOfRange, maskFencedCodeBlocks, orderUiuxParts, packageRootProbe, parseDesignMd, prepareDocumentAnalysis, prepareGraphIntegration, reachedThroughLinkedNodeModules, readDeclaredQfaiRange, readRejectedPrimaryUiContract, readSkippedWorkflows, readTestFileExtensions, readWorkflowMode, renderGraphPreparation, requiresVisualBrowserEvidence, resolvePath, resolveTestKind, resolveToolPackageDir, resolveToolVersion, resolvesThroughOwnNodeModules, routingEntryName, runMigrationStep, runSddPreflight, validateContracts, validateDesignMd, validateProject, validateUiContractParse };
1101
+ export { ACCEPTED_DRIFT_MESSAGE, AC_GHERKIN_SECTION, ARCHETYPES, ATDD_TEST_KIND_DIRS, type AcceptedDrift, type ApproveExternalProcessing, type Archetype, type AtddTestKind, COLOR_KEYS, type ColorKey, type ConfigLoadResult, type ConfigPathKey, type ConfigSearchResult, DESIGN_MD_SAMPLE_MARKER, DISCUSSION_NON_UI_SURFACES, DISCUSSION_UI_BEARING_SURFACES, type DesignMd, type DesignMdColors, type DesignMdFonts, type DesignMdRadius, type DesignMdShadow, type DocumentPreparation, type ExternalProcessingRequest, FONT_KEYS, type FailOn, type FenceMaskOptions, type FontKey, ID_PREFIXES, type IdFormatPrefix, type IdPrefix, type InstalledOlderThanDeclared, type InvalidIdOccurrence, type Issue, type IssueCategory, type IssueLocation, type IssueSeverity, type OutputFormat, type ParseError, type ParseResult, type QfaiConfig, type QfaiForbiddenIdentifier, type QfaiOutputConfig, type QfaiPaths, type QfaiPrototypingConfig, type QfaiPrototypingExecutionConfig, type QfaiReportConfig, type QfaiReviewProfile, type QfaiRoutingEntry, type QfaiUiuxAuditConfig, type QfaiUiuxConfig, type QfaiValidationConfig, RADIUS_KEYS, type RadiusKey, type ReportData, type RunSddPreflightOptions, SHADOW_KEYS, SKIPPED_WORKFLOWS_MESSAGE, type SddPreflightResult, type SddPreflightSource, type SddPreflightStatus, type ShadowKey, type TestFileExtensions, type TestLayerRoots, VISUAL_BROWSER_SURFACES, type ValidationCounts, type ValidationFamilyTiming, type ValidationFamilyTimings, type ValidationIssue, type ValidationOptions, type ValidationProfile, type ValidationResult, type ValidationTimings, type ValidationWaiverAction, type ValidationWaiverDowngradeTo, type ValidationWaiverEntry, type ValidationWaiverMatch, type ValidationWaiverScope, type ValidationWaiverSeverity, type ValidationWaiverSuppressed, type ValidationWaivers, WORKFLOW_MODE_MESSAGE, type WorkflowMode, atddAcceptanceLayerFilter, atddAcceptanceTestGlobs, atddTestKindDirs, classifyAgainstDeclaration, classifyToolLocation, compareInstalledToDeclared, countIssues, createReportData, createTestLayerRoots, defaultConfig, deriveAtddFilePattern, deriveTestFileExtensions, extractAcSpecNumber, extractAllIds, extractBrSpecNumber, extractCapSpecNumber, extractCaseSpecNumber, extractIds, extractInvalidIdOccurrences, extractInvalidIds, extractScSpecNumber, extractSpecNumber, extractUsSpecNumber, findConfigRoot, findDeclaringDir, findLinkingNodeModules, findPackageJsonUpward, formatReportJson, formatReportMarkdown, getConfigPath, isDiscussionUiBearingSurfaceType, isNonUiDiscussionSurface, isOlderVersion, isUnreplacedDesignMdSample, labelCheckTimings, lintSql, loadConfig, locateToolAgainstProject, lowestVersionOfRange, maskFencedCodeBlocks, orderUiuxParts, packageRootProbe, parseDesignMd, prepareDocumentAnalysis, prepareGraphIntegration, reachedThroughLinkedNodeModules, readAcceptedDrift, readDeclaredQfaiRange, readRejectedPrimaryUiContract, readSkippedWorkflows, readTestFileExtensions, readWorkflowMode, renderGraphPreparation, requiresVisualBrowserEvidence, resolvePath, resolveTestKind, resolveToolPackageDir, resolveToolVersion, resolvesThroughOwnNodeModules, routingEntryName, runMigrationStep, runSddPreflight, validateContracts, validateDesignMd, validateProject, validateUiContractParse };