@veraxhq/verax 0.2.0 → 0.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 (89) hide show
  1. package/package.json +14 -4
  2. package/src/cli/commands/default.js +244 -86
  3. package/src/cli/commands/doctor.js +36 -4
  4. package/src/cli/commands/run.js +253 -69
  5. package/src/cli/entry.js +5 -5
  6. package/src/cli/util/detection-engine.js +4 -3
  7. package/src/cli/util/events.js +76 -0
  8. package/src/cli/util/expectation-extractor.js +11 -1
  9. package/src/cli/util/findings-writer.js +1 -0
  10. package/src/cli/util/observation-engine.js +69 -23
  11. package/src/cli/util/paths.js +3 -2
  12. package/src/cli/util/project-discovery.js +20 -0
  13. package/src/cli/util/redact.js +2 -2
  14. package/src/cli/util/runtime-budget.js +147 -0
  15. package/src/cli/util/summary-writer.js +12 -1
  16. package/src/types/global.d.ts +28 -0
  17. package/src/types/ts-ast.d.ts +24 -0
  18. package/src/verax/cli/doctor.js +2 -2
  19. package/src/verax/cli/init.js +1 -1
  20. package/src/verax/cli/url-safety.js +12 -2
  21. package/src/verax/cli/wizard.js +13 -2
  22. package/src/verax/core/budget-engine.js +1 -1
  23. package/src/verax/core/decision-snapshot.js +2 -2
  24. package/src/verax/core/determinism-model.js +35 -6
  25. package/src/verax/core/incremental-store.js +15 -7
  26. package/src/verax/core/replay-validator.js +4 -4
  27. package/src/verax/core/replay.js +1 -1
  28. package/src/verax/core/silence-impact.js +1 -1
  29. package/src/verax/core/silence-model.js +9 -7
  30. package/src/verax/detect/comparison.js +8 -3
  31. package/src/verax/detect/confidence-engine.js +17 -17
  32. package/src/verax/detect/detection-engine.js +1 -1
  33. package/src/verax/detect/evidence-index.js +15 -65
  34. package/src/verax/detect/expectation-model.js +54 -3
  35. package/src/verax/detect/explanation-helpers.js +1 -1
  36. package/src/verax/detect/finding-detector.js +2 -2
  37. package/src/verax/detect/findings-writer.js +9 -16
  38. package/src/verax/detect/flow-detector.js +4 -4
  39. package/src/verax/detect/index.js +37 -11
  40. package/src/verax/detect/interactive-findings.js +3 -4
  41. package/src/verax/detect/signal-mapper.js +2 -2
  42. package/src/verax/detect/skip-classifier.js +4 -4
  43. package/src/verax/detect/verdict-engine.js +4 -6
  44. package/src/verax/flow/flow-engine.js +3 -2
  45. package/src/verax/flow/flow-spec.js +1 -2
  46. package/src/verax/index.js +15 -3
  47. package/src/verax/intel/effect-detector.js +1 -1
  48. package/src/verax/intel/index.js +2 -2
  49. package/src/verax/intel/route-extractor.js +3 -3
  50. package/src/verax/intel/vue-navigation-extractor.js +81 -18
  51. package/src/verax/intel/vue-router-extractor.js +4 -2
  52. package/src/verax/learn/action-contract-extractor.js +3 -3
  53. package/src/verax/learn/ast-contract-extractor.js +53 -1
  54. package/src/verax/learn/index.js +36 -2
  55. package/src/verax/learn/manifest-writer.js +28 -14
  56. package/src/verax/learn/route-extractor.js +1 -1
  57. package/src/verax/learn/route-validator.js +8 -7
  58. package/src/verax/learn/state-extractor.js +1 -1
  59. package/src/verax/learn/static-extractor-navigation.js +1 -1
  60. package/src/verax/learn/static-extractor-validation.js +2 -2
  61. package/src/verax/learn/static-extractor.js +8 -7
  62. package/src/verax/learn/ts-contract-resolver.js +14 -12
  63. package/src/verax/observe/browser.js +22 -3
  64. package/src/verax/observe/console-sensor.js +2 -2
  65. package/src/verax/observe/expectation-executor.js +2 -1
  66. package/src/verax/observe/focus-sensor.js +1 -1
  67. package/src/verax/observe/human-driver.js +29 -10
  68. package/src/verax/observe/index.js +10 -7
  69. package/src/verax/observe/interaction-discovery.js +27 -15
  70. package/src/verax/observe/interaction-runner.js +6 -6
  71. package/src/verax/observe/loading-sensor.js +6 -0
  72. package/src/verax/observe/navigation-sensor.js +1 -1
  73. package/src/verax/observe/settle.js +1 -0
  74. package/src/verax/observe/state-sensor.js +8 -4
  75. package/src/verax/observe/state-ui-sensor.js +7 -1
  76. package/src/verax/observe/traces-writer.js +27 -16
  77. package/src/verax/observe/ui-signal-sensor.js +7 -0
  78. package/src/verax/scan-summary-writer.js +5 -2
  79. package/src/verax/shared/artifact-manager.js +1 -1
  80. package/src/verax/shared/budget-profiles.js +2 -2
  81. package/src/verax/shared/caching.js +1 -1
  82. package/src/verax/shared/config-loader.js +1 -2
  83. package/src/verax/shared/dynamic-route-utils.js +12 -6
  84. package/src/verax/shared/retry-policy.js +1 -6
  85. package/src/verax/shared/root-artifacts.js +1 -1
  86. package/src/verax/shared/zip-artifacts.js +1 -0
  87. package/src/verax/validate/context-validator.js +1 -1
  88. package/src/verax/observe/index.js.backup +0 -1
  89. package/src/verax/validate/context-validator.js.bak +0 -0
@@ -5,8 +5,7 @@
5
5
  */
6
6
 
7
7
  import { readFileSync, existsSync } from 'fs';
8
- import { resolve, dirname, join } from 'path';
9
- import { fileURLToPath } from 'url';
8
+ import { resolve } from 'path';
10
9
 
11
10
  /**
12
11
  * Default config values
@@ -88,23 +88,27 @@ export function createExamplePath(originalPath) {
88
88
  }
89
89
 
90
90
  let examplePath = originalPath;
91
- let isDynamic = false;
91
+ let _isDynamic = false;
92
+ const parameters = new Set();
92
93
 
93
94
  // Replace React/Vue :param
94
95
  examplePath = examplePath.replace(/:(\w+)/g, (match, paramName) => {
95
- isDynamic = true;
96
+ _isDynamic = true;
97
+ parameters.add(paramName);
96
98
  return getExampleValue(paramName);
97
99
  });
98
100
 
99
101
  // Replace Next.js [param]
100
102
  examplePath = examplePath.replace(/\[(\w+)\]/g, (match, paramName) => {
101
- isDynamic = true;
103
+ _isDynamic = true;
104
+ parameters.add(paramName);
102
105
  return getExampleValue(paramName);
103
106
  });
104
107
 
105
108
  // Replace template ${param}
106
109
  examplePath = examplePath.replace(/\$\{(\w+)\}/g, (match, paramName) => {
107
- isDynamic = true;
110
+ _isDynamic = true;
111
+ parameters.add(paramName);
108
112
  return getExampleValue(paramName);
109
113
  });
110
114
 
@@ -112,7 +116,8 @@ export function createExamplePath(originalPath) {
112
116
  examplePath,
113
117
  originalPattern: originalPath,
114
118
  isDynamic: true,
115
- exampleExecution: true
119
+ exampleExecution: true,
120
+ parameters: Array.from(parameters)
116
121
  };
117
122
  }
118
123
 
@@ -210,7 +215,8 @@ export function normalizeTemplateLiteral(template) {
210
215
  originalPattern: result.originalTarget,
211
216
  examplePath: result.exampleTarget,
212
217
  isDynamic: true,
213
- exampleExecution: true
218
+ exampleExecution: true,
219
+ parameters: result.parameters
214
220
  };
215
221
  }
216
222
 
@@ -64,12 +64,7 @@ export async function retryOperation(fn, operationName = 'operation', decisionRe
64
64
  // PHASE 6: Record retry decision for determinism tracking
65
65
  if (decisionRecorder && decisionRecorder.record) {
66
66
  const { recordRetryAttempt } = await import('../core/determinism-model.js');
67
- recordRetryAttempt(decisionRecorder, {
68
- attempt: attempt + 1,
69
- errorType: lastError.message,
70
- backoffMs: delayMs,
71
- operationName
72
- });
67
+ recordRetryAttempt(decisionRecorder, operationName, attempt + 1, delayMs, lastError.message);
73
68
  }
74
69
 
75
70
  await new Promise(resolve => setTimeout(resolve, delayMs));
@@ -2,7 +2,7 @@
2
2
  * Root-level artifacts helper
3
3
  * Enforces strict routing of outputs to artifacts/* subdirectories.
4
4
  */
5
- import { resolve, join } from 'path';
5
+ import { resolve } from 'path';
6
6
  import { existsSync, mkdirSync } from 'fs';
7
7
 
8
8
  const BASE = 'artifacts';
@@ -13,6 +13,7 @@ import { mkdirSync } from 'fs';
13
13
  let archiver;
14
14
  async function getArchiver() {
15
15
  if (!archiver) {
16
+ // @ts-expect-error - archiver is an optional dev dependency, types may not be available
16
17
  archiver = (await import('archiver')).default;
17
18
  }
18
19
  return archiver;
@@ -112,7 +112,7 @@ export async function validateContext(manifest, baseUrl, forced = false) {
112
112
 
113
113
  try {
114
114
  // Fetch homepage and parse internal links
115
- const response = await page.goto(baseUrl, {
115
+ await page.goto(baseUrl, {
116
116
  waitUntil: 'domcontentloaded',
117
117
  timeout: CONTEXT_CHECK_TIMEOUT_MS
118
118
  });
@@ -1 +0,0 @@
1
- This is a backup of the broken version
File without changes