Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,5 @@ nul
.spawner/
svelte-check-output.txt
.gstack/
# Office lockfiles (Word/Excel/PowerPoint create these when files are open)
~$*
2 changes: 1 addition & 1 deletion src/lib/components/MissionBoard.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@
const counts = getMissionBoardWorkBreakdown(card).build;
if (!counts || counts.total <= 0) {
if (card.status === 'completed') return 100;
if (card.status === 'running') return 48;
if (card.status === 'running') return 0;
return 0;
}
return Math.round(((counts.completed + counts.failed + counts.cancelled) / counts.total) * 100);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/services/completion-evidence-display.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ export function completionEvidenceTooltipForDisplay(
): string | null {
if (!evidence || evidence.state === 'not_terminal') return null;
if (evidence.state === 'complete') return 'Completion proof is present.';
return 'Completion proof is incomplete.';
return evidence.summary || 'Completion proof is incomplete.';
}
2 changes: 1 addition & 1 deletion src/routes/canvas/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ import { get } from 'svelte/store';
// Create nodes with proper IDs, keeping track of skill-to-node mapping
const skillToNodeId = new Map<string, string>();
const canvasNodes = pipeline.nodes.map(node => {
const nodeId = `node-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
const nodeId = `node-${crypto.randomUUID()}`;
skillToNodeId.set(node.skillId, nodeId);
return {
id: nodeId,
Expand Down
2 changes: 1 addition & 1 deletion src/routes/missions/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@
<!-- Filters & Actions -->
<div class="flex items-center justify-between mb-6">
<div class="flex items-center gap-2">
{#each ['all', 'spark', 'draft', 'ready', 'running', 'completed', 'failed'] as status}
{#each ['all', 'spark', 'draft', 'ready', 'running', 'paused', 'completed', 'failed'] as status}
{@const count = statusCounts()[status] || 0}
<button
onclick={() => filterStatus = status}
Expand Down
28 changes: 28 additions & 0 deletions tests/test_canvas_page_node_id.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { describe, it, expect } from 'vitest';

const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;

function makeNodeId(): string {
return `node-${crypto.randomUUID()}`;
}

describe('canvas node ID generation', () => {
it('starts with node- prefix', () => {
expect(makeNodeId()).toMatch(/^node-/);
});
it('contains a valid UUID v4', () => {
const id = makeNodeId();
expect(UUID_RE.test(id.slice(5))).toBe(true);
});
it('does not use Math.random', () => {
const src = makeNodeId.toString();
expect(src).not.toContain('Math.random');
});
it('generates 1000 unique IDs', () => {
const ids = Array.from({ length: 1000 }, () => makeNodeId());
expect(new Set(ids).size).toBe(1000);
});
it('is a plain string', () => {
expect(typeof makeNodeId()).toBe('string');
});
});
Loading