Skip to content

The ultimate harness for coding agents and beyond. All your agents. All your machines. One command center. Start with code, then follow your curiosity and build across disciplines: CAD, circuits, robots, games and music.

1.2 KB
Raw Blame
// The key a remote machine names its account by has to come out of this app
// byte for byte the same, or the strip prints one subscription twice.
import 'package:flutter_test/flutter_test.dart';
import 'package:harness/usage/usage_account_key.dart';
import 'package:harness/usage/usage_window.dart';

void main() {
  test('matches the vector the CLI pins', () {
    // ⚠️ A cross-language contract: `accountUsage.spec.ts` in autonomous-harness
    // asserts these same two strings for its `accountKey`.
    expect(
      usageAccountKey(UsageProvider.claude, 'acct-123'),
      '85d2541574c31caa',
    );
    expect(
      usageAccountKey(UsageProvider.codex, 'acct-123'),
      'd9921dd1861038f4',
    );
  });

  test('the same id on two vendors is two accounts', () {
    expect(
      usageAccountKey(UsageProvider.claude, 'same'),
      isNot(usageAccountKey(UsageProvider.codex, 'same')),
    );
  });

  test(
    'a Swarm profile id is the first 16 hex of sha256(machine:engine:path)',
    () {
      expect(swarmProfileId('m', 'claude', 'default'), '71dc90339553114c');
      expect(
        swarmProfileId('m', 'codex', '/home/me/.codex-b'),
        '77103ab28be2ebd0',
      );
    },
  );
}