qa360 2.0.9 → 2.0.11

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.
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * QA360 Ask Command - Natural language to pack.yml generation
3
3
  */
4
- import { writeFileSync, existsSync, mkdirSync } from 'fs';
4
+ import { writeFileSync } from 'fs';
5
5
  import { join } from 'path';
6
6
  import chalk from 'chalk';
7
7
  import inquirer from 'inquirer';
@@ -397,11 +397,8 @@ export class QA360Ask {
397
397
  return config;
398
398
  }
399
399
  async savePack(pack) {
400
- // Ensure .qa360 directory exists
401
- if (!existsSync(this.qa360Dir)) {
402
- mkdirSync(this.qa360Dir, { recursive: true });
403
- }
404
- const packPath = join(this.qa360Dir, 'pack.yml');
400
+ // Save to qa360.yml in current directory (not .qa360/pack.yml)
401
+ const packPath = join(process.cwd(), 'qa360.yml');
405
402
  const yamlContent = dump(pack, {
406
403
  indent: 2,
407
404
  lineWidth: 120,
@@ -78,7 +78,7 @@ export class QA360History {
78
78
  'Trust': run.trust_score ? `${run.trust_score}%` : '-',
79
79
  'Duration': durationStr,
80
80
  'Pack': packName,
81
- 'Pinned': run.pinned ? 'šŸ“Œ' : ''
81
+ 'Pinned': run.pinned ? 'šŸ“Œ' : ' '
82
82
  };
83
83
  });
84
84
  console.table(table);
@@ -269,7 +269,7 @@ export class Phase3Runner {
269
269
  },
270
270
  summary,
271
271
  proofPath
272
- }, proofPath, flakinessResults);
272
+ }, proofPath, flakinessResults, startTime);
273
273
  // Final summary
274
274
  console.log(chalk.blue('\nšŸ“Š Execution Summary'));
275
275
  console.log(` Duration: ${duration}ms`);
@@ -753,16 +753,18 @@ export class Phase3Runner {
753
753
  * Save run results to Evidence Vault
754
754
  * @returns The vault run ID
755
755
  */
756
- async saveToVault(runId, result, proofPath, flakinessResults) {
756
+ async saveToVault(runId, result, proofPath, flakinessResults, startTime) {
757
757
  if (!this.vault) {
758
758
  console.log(chalk.yellow(' āš ļø Vault not initialized, skipping storage'));
759
759
  return undefined;
760
760
  }
761
761
  try {
762
762
  // Begin run in vault (returns actual runId used)
763
+ // Use startTime if provided to correctly calculate duration
763
764
  const { runId: vaultRunId } = await this.vault.beginRun({
764
765
  pack_path: `${this.pack.name || 'pack'}.yaml`,
765
- pack_hash: this.hashPack(result.pack)
766
+ pack_hash: this.hashPack(result.pack),
767
+ started_at: startTime // Use actual run start time for accurate duration
766
768
  });
767
769
  // Finish run with final status
768
770
  await this.vault.finishRun(vaultRunId, {
@@ -132,6 +132,7 @@ export interface BeginRunOptions {
132
132
  pack_path: string;
133
133
  pack_hash: string;
134
134
  weights?: Record<string, any>;
135
+ started_at?: number;
135
136
  }
136
137
  export interface FinishRunOptions {
137
138
  status: 'passed' | 'failed' | 'cancelled' | 'error';
@@ -52,7 +52,7 @@ export class EvidenceVault {
52
52
  }
53
53
  }
54
54
  const runId = randomUUID();
55
- const now = Date.now();
55
+ const now = options.started_at ?? Date.now(); // Use provided timestamp or current time
56
56
  const run = {
57
57
  id: runId,
58
58
  run_key: options.run_key,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "qa360",
3
- "version": "2.0.9",
3
+ "version": "2.0.11",
4
4
  "description": "QA360 Proof CLI - Quality as Cryptographic Proof",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -45,7 +45,6 @@
45
45
  "ollama": "^0.5.1",
46
46
  "ora": "^5.4.1",
47
47
  "playwright": "^1.57.0",
48
-
49
48
  "sqlite3": "^5.1.6",
50
49
  "tweetnacl": "^1.0.3"
51
50
  },