qfai 1.7.4 → 1.7.6

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.d.cts CHANGED
@@ -402,6 +402,35 @@ declare function emitUiFidelity(input: {
402
402
  }): Record<string, unknown>;
403
403
  declare function extractDomMarkers(html: string): string[];
404
404
 
405
+ /**
406
+ * Mode resolver for prototyping obligations.
407
+ *
408
+ * Separates static-first obligations (default) from runtime-heavy checks (opt-in).
409
+ * Static-first default ensures prototyping completes without browser/backend installed.
410
+ *
411
+ * NOTE: v1.7.5 scope is foundation-only. This module defines the obligation
412
+ * vocabulary and resolution logic. Wiring into the prototyping command/validator
413
+ * evaluation path is deferred to v1.7.6 when the full mode-switching UX is added.
414
+ */
415
+ type PrototypingMode = "default" | "standard" | "low-cost" | "full-harness";
416
+ /** Static obligations that require no runtime infrastructure. */
417
+ declare const STATIC_OBLIGATIONS: readonly ["source", "route", "state", "contract-level"];
418
+ /** Runtime-heavy checks that require external infrastructure (opt-in only). */
419
+ declare const RUNTIME_HEAVY_CHECKS: readonly ["api-non-404", "db-existence", "ui-route-reachability"];
420
+ /**
421
+ * Resolve the active obligation set for a given prototyping mode.
422
+ *
423
+ * - `"default"` / `"standard"`: static obligations only
424
+ * - `"low-cost"`: static obligations (runtime-heavy excluded)
425
+ * - `"full-harness"`: static + runtime-heavy obligations
426
+ */
427
+ declare function resolveObligations(mode: PrototypingMode): string[];
428
+ /**
429
+ * Resolve obligations with explicit opt-in for runtime-heavy checks.
430
+ * Only checks listed in RUNTIME_HEAVY_CHECKS are accepted as opt-ins.
431
+ */
432
+ declare function resolveObligationsWithOptIn(mode: PrototypingMode, optIn: string[]): string[];
433
+
405
434
  type ReportSummary = {
406
435
  specs: number;
407
436
  scenarios: number;
@@ -603,4 +632,4 @@ declare function validateSpecSplitByCapability(root: string, config: QfaiConfig)
603
632
 
604
633
  declare function validateTraceability(root: string, config: QfaiConfig, phase: ValidationPhase): Promise<Issue[]>;
605
634
 
606
- export { type AtddCodeTraceabilityResult, type AtddForbiddenRef, type AtddSpecRefs, type AtddTestKind, type AtddTraceabilityMissing, type AtddTraceabilityScan, type AtddUnknownRef, type AtddUnknownRefKind, type ConfigLoadResult, type ConfigPathKey, type ConfigSearchResult, type DecisionGuardrail, type DecisionGuardrailEntry, type FailOn, type GuardrailCheckResult, type GuardrailIssue, type GuardrailIssueSeverity, type GuardrailLoadError, type GuardrailLoadResult, type GuardrailType, ID_PREFIXES, type IdFormatPrefix, type IdPrefix, type Issue, type IssueCategory, type IssueLocation, type IssueSeverity, type OrphanContractsPolicy, type OutputFormat, type QfaiConfig, type QfaiOutputConfig, type QfaiPaths, type QfaiUiuxAuditConfig, type QfaiUiuxConfig, type QfaiValidationConfig, type ReportChangeType, type ReportChangeTypeSummary, type ReportChangeTypeWarning, type ReportContractCoverage, type ReportData, type ReportDeltaCoverage, type ReportGuardrailItem, type ReportGuardrails, type ReportIds, type ReportRuleFinding, type ReportSpecContractRefs, type ReportSpecCoverage, type ReportSummary, type ReportTddCoverage, type ReportTddCoverageSpec, type ReportTestStrategy, type ReportTraceability, type ReportWaivers, type RunSddPreflightOptions, type SddPreflightResult, type SddPreflightSource, type SddPreflightStatus, type TraceabilitySeverity, type UiFidelityAutogenCrawlResult, type UiFidelityAutogenExpected, type UiFidelityAutogenMockPathResult, type UiFidelityAutogenResult, type UiFidelityGeneratedScreen, type UiFidelityLabelCoverage, type ValidationCounts, type ValidationOptions, type ValidationPhase, type ValidationResult, type ValidationTraceability, type ValidationWaiverAction, type ValidationWaiverDowngradeTo, type ValidationWaiverEntry, type ValidationWaiverMatch, type ValidationWaiverScope, type ValidationWaiverSeverity, type ValidationWaiverSuppressed, type ValidationWaivers, autogenerateUiFidelity, buildUiFidelityScreens, checkDecisionGuardrails, collectExpectedFromContracts, computeLabelCoverage, crawlRoutesAndCollectFoundLabels, createReportData, defaultConfig, emitUiFidelity, evaluateAtddCodeTraceability, extractAcSpecNumber, extractAllIds, extractBrSpecNumber, extractCapSpecNumber, extractCaseSpecNumber, extractDecisionGuardrailsFromMarkdown, extractDomMarkers, extractIds, extractInvalidIds, extractScSpecNumber, extractSpecNumber, extractUsSpecNumber, filterDecisionGuardrailsByKeyword, findConfigRoot, formatGuardrailsForLlm, formatReportJson, formatReportMarkdown, getConfigPath, lintSql, loadConfig, loadDecisionGuardrails, normalizeDecisionGuardrails, resolvePath, resolveToolVersion, runMockPaths, runSddPreflight, sortDecisionGuardrails, validateAtddCodeTraceability, validateContracts, validateDefinedIds, validateLayeredTraceability, validateOrphanProhibition, validateProject, validateSpecSplitByCapability, validateTraceability };
635
+ export { type AtddCodeTraceabilityResult, type AtddForbiddenRef, type AtddSpecRefs, type AtddTestKind, type AtddTraceabilityMissing, type AtddTraceabilityScan, type AtddUnknownRef, type AtddUnknownRefKind, type ConfigLoadResult, type ConfigPathKey, type ConfigSearchResult, type DecisionGuardrail, type DecisionGuardrailEntry, type FailOn, type GuardrailCheckResult, type GuardrailIssue, type GuardrailIssueSeverity, type GuardrailLoadError, type GuardrailLoadResult, type GuardrailType, ID_PREFIXES, type IdFormatPrefix, type IdPrefix, type Issue, type IssueCategory, type IssueLocation, type IssueSeverity, type OrphanContractsPolicy, type OutputFormat, type PrototypingMode, type QfaiConfig, type QfaiOutputConfig, type QfaiPaths, type QfaiUiuxAuditConfig, type QfaiUiuxConfig, type QfaiValidationConfig, RUNTIME_HEAVY_CHECKS, type ReportChangeType, type ReportChangeTypeSummary, type ReportChangeTypeWarning, type ReportContractCoverage, type ReportData, type ReportDeltaCoverage, type ReportGuardrailItem, type ReportGuardrails, type ReportIds, type ReportRuleFinding, type ReportSpecContractRefs, type ReportSpecCoverage, type ReportSummary, type ReportTddCoverage, type ReportTddCoverageSpec, type ReportTestStrategy, type ReportTraceability, type ReportWaivers, type RunSddPreflightOptions, STATIC_OBLIGATIONS, type SddPreflightResult, type SddPreflightSource, type SddPreflightStatus, type TraceabilitySeverity, type UiFidelityAutogenCrawlResult, type UiFidelityAutogenExpected, type UiFidelityAutogenMockPathResult, type UiFidelityAutogenResult, type UiFidelityGeneratedScreen, type UiFidelityLabelCoverage, type ValidationCounts, type ValidationOptions, type ValidationPhase, type ValidationResult, type ValidationTraceability, type ValidationWaiverAction, type ValidationWaiverDowngradeTo, type ValidationWaiverEntry, type ValidationWaiverMatch, type ValidationWaiverScope, type ValidationWaiverSeverity, type ValidationWaiverSuppressed, type ValidationWaivers, autogenerateUiFidelity, buildUiFidelityScreens, checkDecisionGuardrails, collectExpectedFromContracts, computeLabelCoverage, crawlRoutesAndCollectFoundLabels, createReportData, defaultConfig, emitUiFidelity, evaluateAtddCodeTraceability, extractAcSpecNumber, extractAllIds, extractBrSpecNumber, extractCapSpecNumber, extractCaseSpecNumber, extractDecisionGuardrailsFromMarkdown, extractDomMarkers, extractIds, extractInvalidIds, extractScSpecNumber, extractSpecNumber, extractUsSpecNumber, filterDecisionGuardrailsByKeyword, findConfigRoot, formatGuardrailsForLlm, formatReportJson, formatReportMarkdown, getConfigPath, lintSql, loadConfig, loadDecisionGuardrails, normalizeDecisionGuardrails, resolveObligations, resolveObligationsWithOptIn, resolvePath, resolveToolVersion, runMockPaths, runSddPreflight, sortDecisionGuardrails, validateAtddCodeTraceability, validateContracts, validateDefinedIds, validateLayeredTraceability, validateOrphanProhibition, validateProject, validateSpecSplitByCapability, validateTraceability };
package/dist/index.d.ts CHANGED
@@ -402,6 +402,35 @@ declare function emitUiFidelity(input: {
402
402
  }): Record<string, unknown>;
403
403
  declare function extractDomMarkers(html: string): string[];
404
404
 
405
+ /**
406
+ * Mode resolver for prototyping obligations.
407
+ *
408
+ * Separates static-first obligations (default) from runtime-heavy checks (opt-in).
409
+ * Static-first default ensures prototyping completes without browser/backend installed.
410
+ *
411
+ * NOTE: v1.7.5 scope is foundation-only. This module defines the obligation
412
+ * vocabulary and resolution logic. Wiring into the prototyping command/validator
413
+ * evaluation path is deferred to v1.7.6 when the full mode-switching UX is added.
414
+ */
415
+ type PrototypingMode = "default" | "standard" | "low-cost" | "full-harness";
416
+ /** Static obligations that require no runtime infrastructure. */
417
+ declare const STATIC_OBLIGATIONS: readonly ["source", "route", "state", "contract-level"];
418
+ /** Runtime-heavy checks that require external infrastructure (opt-in only). */
419
+ declare const RUNTIME_HEAVY_CHECKS: readonly ["api-non-404", "db-existence", "ui-route-reachability"];
420
+ /**
421
+ * Resolve the active obligation set for a given prototyping mode.
422
+ *
423
+ * - `"default"` / `"standard"`: static obligations only
424
+ * - `"low-cost"`: static obligations (runtime-heavy excluded)
425
+ * - `"full-harness"`: static + runtime-heavy obligations
426
+ */
427
+ declare function resolveObligations(mode: PrototypingMode): string[];
428
+ /**
429
+ * Resolve obligations with explicit opt-in for runtime-heavy checks.
430
+ * Only checks listed in RUNTIME_HEAVY_CHECKS are accepted as opt-ins.
431
+ */
432
+ declare function resolveObligationsWithOptIn(mode: PrototypingMode, optIn: string[]): string[];
433
+
405
434
  type ReportSummary = {
406
435
  specs: number;
407
436
  scenarios: number;
@@ -603,4 +632,4 @@ declare function validateSpecSplitByCapability(root: string, config: QfaiConfig)
603
632
 
604
633
  declare function validateTraceability(root: string, config: QfaiConfig, phase: ValidationPhase): Promise<Issue[]>;
605
634
 
606
- export { type AtddCodeTraceabilityResult, type AtddForbiddenRef, type AtddSpecRefs, type AtddTestKind, type AtddTraceabilityMissing, type AtddTraceabilityScan, type AtddUnknownRef, type AtddUnknownRefKind, type ConfigLoadResult, type ConfigPathKey, type ConfigSearchResult, type DecisionGuardrail, type DecisionGuardrailEntry, type FailOn, type GuardrailCheckResult, type GuardrailIssue, type GuardrailIssueSeverity, type GuardrailLoadError, type GuardrailLoadResult, type GuardrailType, ID_PREFIXES, type IdFormatPrefix, type IdPrefix, type Issue, type IssueCategory, type IssueLocation, type IssueSeverity, type OrphanContractsPolicy, type OutputFormat, type QfaiConfig, type QfaiOutputConfig, type QfaiPaths, type QfaiUiuxAuditConfig, type QfaiUiuxConfig, type QfaiValidationConfig, type ReportChangeType, type ReportChangeTypeSummary, type ReportChangeTypeWarning, type ReportContractCoverage, type ReportData, type ReportDeltaCoverage, type ReportGuardrailItem, type ReportGuardrails, type ReportIds, type ReportRuleFinding, type ReportSpecContractRefs, type ReportSpecCoverage, type ReportSummary, type ReportTddCoverage, type ReportTddCoverageSpec, type ReportTestStrategy, type ReportTraceability, type ReportWaivers, type RunSddPreflightOptions, type SddPreflightResult, type SddPreflightSource, type SddPreflightStatus, type TraceabilitySeverity, type UiFidelityAutogenCrawlResult, type UiFidelityAutogenExpected, type UiFidelityAutogenMockPathResult, type UiFidelityAutogenResult, type UiFidelityGeneratedScreen, type UiFidelityLabelCoverage, type ValidationCounts, type ValidationOptions, type ValidationPhase, type ValidationResult, type ValidationTraceability, type ValidationWaiverAction, type ValidationWaiverDowngradeTo, type ValidationWaiverEntry, type ValidationWaiverMatch, type ValidationWaiverScope, type ValidationWaiverSeverity, type ValidationWaiverSuppressed, type ValidationWaivers, autogenerateUiFidelity, buildUiFidelityScreens, checkDecisionGuardrails, collectExpectedFromContracts, computeLabelCoverage, crawlRoutesAndCollectFoundLabels, createReportData, defaultConfig, emitUiFidelity, evaluateAtddCodeTraceability, extractAcSpecNumber, extractAllIds, extractBrSpecNumber, extractCapSpecNumber, extractCaseSpecNumber, extractDecisionGuardrailsFromMarkdown, extractDomMarkers, extractIds, extractInvalidIds, extractScSpecNumber, extractSpecNumber, extractUsSpecNumber, filterDecisionGuardrailsByKeyword, findConfigRoot, formatGuardrailsForLlm, formatReportJson, formatReportMarkdown, getConfigPath, lintSql, loadConfig, loadDecisionGuardrails, normalizeDecisionGuardrails, resolvePath, resolveToolVersion, runMockPaths, runSddPreflight, sortDecisionGuardrails, validateAtddCodeTraceability, validateContracts, validateDefinedIds, validateLayeredTraceability, validateOrphanProhibition, validateProject, validateSpecSplitByCapability, validateTraceability };
635
+ export { type AtddCodeTraceabilityResult, type AtddForbiddenRef, type AtddSpecRefs, type AtddTestKind, type AtddTraceabilityMissing, type AtddTraceabilityScan, type AtddUnknownRef, type AtddUnknownRefKind, type ConfigLoadResult, type ConfigPathKey, type ConfigSearchResult, type DecisionGuardrail, type DecisionGuardrailEntry, type FailOn, type GuardrailCheckResult, type GuardrailIssue, type GuardrailIssueSeverity, type GuardrailLoadError, type GuardrailLoadResult, type GuardrailType, ID_PREFIXES, type IdFormatPrefix, type IdPrefix, type Issue, type IssueCategory, type IssueLocation, type IssueSeverity, type OrphanContractsPolicy, type OutputFormat, type PrototypingMode, type QfaiConfig, type QfaiOutputConfig, type QfaiPaths, type QfaiUiuxAuditConfig, type QfaiUiuxConfig, type QfaiValidationConfig, RUNTIME_HEAVY_CHECKS, type ReportChangeType, type ReportChangeTypeSummary, type ReportChangeTypeWarning, type ReportContractCoverage, type ReportData, type ReportDeltaCoverage, type ReportGuardrailItem, type ReportGuardrails, type ReportIds, type ReportRuleFinding, type ReportSpecContractRefs, type ReportSpecCoverage, type ReportSummary, type ReportTddCoverage, type ReportTddCoverageSpec, type ReportTestStrategy, type ReportTraceability, type ReportWaivers, type RunSddPreflightOptions, STATIC_OBLIGATIONS, type SddPreflightResult, type SddPreflightSource, type SddPreflightStatus, type TraceabilitySeverity, type UiFidelityAutogenCrawlResult, type UiFidelityAutogenExpected, type UiFidelityAutogenMockPathResult, type UiFidelityAutogenResult, type UiFidelityGeneratedScreen, type UiFidelityLabelCoverage, type ValidationCounts, type ValidationOptions, type ValidationPhase, type ValidationResult, type ValidationTraceability, type ValidationWaiverAction, type ValidationWaiverDowngradeTo, type ValidationWaiverEntry, type ValidationWaiverMatch, type ValidationWaiverScope, type ValidationWaiverSeverity, type ValidationWaiverSuppressed, type ValidationWaivers, autogenerateUiFidelity, buildUiFidelityScreens, checkDecisionGuardrails, collectExpectedFromContracts, computeLabelCoverage, crawlRoutesAndCollectFoundLabels, createReportData, defaultConfig, emitUiFidelity, evaluateAtddCodeTraceability, extractAcSpecNumber, extractAllIds, extractBrSpecNumber, extractCapSpecNumber, extractCaseSpecNumber, extractDecisionGuardrailsFromMarkdown, extractDomMarkers, extractIds, extractInvalidIds, extractScSpecNumber, extractSpecNumber, extractUsSpecNumber, filterDecisionGuardrailsByKeyword, findConfigRoot, formatGuardrailsForLlm, formatReportJson, formatReportMarkdown, getConfigPath, lintSql, loadConfig, loadDecisionGuardrails, normalizeDecisionGuardrails, resolveObligations, resolveObligationsWithOptIn, resolvePath, resolveToolVersion, runMockPaths, runSddPreflight, sortDecisionGuardrails, validateAtddCodeTraceability, validateContracts, validateDefinedIds, validateLayeredTraceability, validateOrphanProhibition, validateProject, validateSpecSplitByCapability, validateTraceability };
package/dist/index.mjs CHANGED
@@ -3566,6 +3566,35 @@ function formatError4(error) {
3566
3566
  return String(error);
3567
3567
  }
3568
3568
 
3569
+ // src/core/prototyping/modeResolver.ts
3570
+ var STATIC_OBLIGATIONS = ["source", "route", "state", "contract-level"];
3571
+ var RUNTIME_HEAVY_CHECKS = [
3572
+ "api-non-404",
3573
+ "db-existence",
3574
+ "ui-route-reachability"
3575
+ ];
3576
+ var FULL_HARNESS_OBLIGATIONS = [...STATIC_OBLIGATIONS, ...RUNTIME_HEAVY_CHECKS];
3577
+ function resolveObligations(mode) {
3578
+ switch (mode) {
3579
+ case "default":
3580
+ case "standard":
3581
+ return [...STATIC_OBLIGATIONS];
3582
+ case "low-cost":
3583
+ return [...STATIC_OBLIGATIONS];
3584
+ case "full-harness":
3585
+ return [...FULL_HARNESS_OBLIGATIONS];
3586
+ default: {
3587
+ const _exhaustive = mode;
3588
+ throw new Error(`Unknown prototyping mode: ${String(_exhaustive)}`);
3589
+ }
3590
+ }
3591
+ }
3592
+ function resolveObligationsWithOptIn(mode, optIn) {
3593
+ const base = resolveObligations(mode);
3594
+ const validOptIns = optIn.filter((o) => RUNTIME_HEAVY_CHECKS.includes(o));
3595
+ return [.../* @__PURE__ */ new Set([...base, ...validOptIns])];
3596
+ }
3597
+
3569
3598
  // src/core/report.ts
3570
3599
  import { readFile as readFile42 } from "fs/promises";
3571
3600
  import path54 from "path";
@@ -4326,8 +4355,8 @@ import { readFile as readFile11 } from "fs/promises";
4326
4355
  import path14 from "path";
4327
4356
  import { fileURLToPath } from "url";
4328
4357
  async function resolveToolVersion() {
4329
- if ("1.7.4".length > 0) {
4330
- return "1.7.4";
4358
+ if ("1.7.6".length > 0) {
4359
+ return "1.7.6";
4331
4360
  }
4332
4361
  try {
4333
4362
  const packagePath = resolvePackageJsonPath();
@@ -17323,6 +17352,8 @@ async function collectTddCoverage(entries) {
17323
17352
  }
17324
17353
  export {
17325
17354
  ID_PREFIXES,
17355
+ RUNTIME_HEAVY_CHECKS,
17356
+ STATIC_OBLIGATIONS,
17326
17357
  autogenerateUiFidelity,
17327
17358
  buildUiFidelityScreens,
17328
17359
  checkDecisionGuardrails,
@@ -17355,6 +17386,8 @@ export {
17355
17386
  loadConfig,
17356
17387
  loadDecisionGuardrails,
17357
17388
  normalizeDecisionGuardrails,
17389
+ resolveObligations,
17390
+ resolveObligationsWithOptIn,
17358
17391
  resolvePath,
17359
17392
  resolveToolVersion,
17360
17393
  runMockPaths,