Skip to content
Merged
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
14 changes: 7 additions & 7 deletions src/competition-readiness.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ const IMPLEMENTATION_GATES = [
"cantonLifecycle",
"negativeSecurity",
"judgeUi",
"track1Package",
"colosseumPackage",
];

const EXTERNAL_GATES = [
"publicRepository",
"publicArtifacts",
"mana1000",
"activity10Days",
"journalNonEmpty",
"repositoryAccess",
"presentationVideo",
"technicalDemoVideo",
"projectProfileComplete",
"track1Selected",
"founderProfileComplete",
"preExistingWorkDisclosure",
"demandValidationDisclosure",
];

function normalizeStatus(value, kind) {
Expand Down
36 changes: 23 additions & 13 deletions tests/competition-readiness.test.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import test from "node:test";
import assert from "node:assert/strict";
import { evaluateCompetitionReadiness } from "../src/competition-readiness.mjs";
import { evaluateCompetitionReadiness, competitionGateNames } from "../src/competition-readiness.mjs";

const verifiedImplementation = {
nodeTests: { status: "verified", runId: "run-1", sourceCommit: "abc123" },
Expand All @@ -9,37 +9,47 @@ const verifiedImplementation = {
cantonLifecycle: { status: "verified", runId: "run-1", sourceCommit: "abc123" },
negativeSecurity: { status: "verified", runId: "run-1", sourceCommit: "abc123" },
judgeUi: { status: "verified", runId: "run-1", sourceCommit: "abc123" },
track1Package: { status: "verified", runId: "run-1", sourceCommit: "abc123" },
colosseumPackage: { status: "verified", runId: "run-1", sourceCommit: "abc123" },
};
const verifiedExternal = {
publicRepository: { status: "verified" },
publicArtifacts: { status: "verified" },
mana1000: { status: "verified" },
activity10Days: { status: "verified" },
journalNonEmpty: { status: "verified" },
repositoryAccess: { status: "verified" },
presentationVideo: { status: "verified" },
technicalDemoVideo: { status: "verified" },
projectProfileComplete: { status: "verified" },
track1Selected: { status: "verified" },
founderProfileComplete: { status: "verified" },
preExistingWorkDisclosure: { status: "verified" },
demandValidationDisclosure: { status: "verified" },
};

test("uses Colosseum-specific implementation and submission gates", () => {
assert.deepEqual(competitionGateNames.implementation, [
"nodeTests","damlBuild","damlTests","cantonLifecycle","negativeSecurity","judgeUi","colosseumPackage"
]);
assert.deepEqual(competitionGateNames.external, [
"repositoryAccess","presentationVideo","technicalDemoVideo","projectProfileComplete",
"founderProfileComplete","preExistingWorkDisclosure","demandValidationDisclosure"
]);
});

test("returns PASS only when implementation and external gates are verified", () => {
const result = evaluateCompetitionReadiness({ implementation: verifiedImplementation, external: verifiedExternal });
assert.equal(result.status, "PASS");
assert.deepEqual(result.counts, { pass: 14, blocked: 0, fail: 0 });
});

test("returns BLOCKED when an external gate is not yet verified", () => {
test("returns BLOCKED when a submission-side gate is not yet verified", () => {
const result = evaluateCompetitionReadiness({
implementation: verifiedImplementation,
external: { ...verifiedExternal, mana1000: { status: "blocked", reason: "AppsFactory account not checked" } },
external: { ...verifiedExternal, repositoryAccess: { status: "blocked", reason: "Judge repository access not yet confirmed" } },
});
assert.equal(result.status, "BLOCKED");
assert.equal(result.gates.find(g => g.name === "mana1000").status, "BLOCKED");
assert.equal(result.gates.find(g => g.name === "repositoryAccess").status, "BLOCKED");
});

test("returns FAIL when an implementation gate fails even if external gates are blocked", () => {
test("returns FAIL when an implementation gate fails even if submission gates are blocked", () => {
const result = evaluateCompetitionReadiness({
implementation: { ...verifiedImplementation, damlTests: { status: "failed", reason: "Daml test failed" } },
external: { ...verifiedExternal, publicRepository: { status: "blocked" } },
external: { ...verifiedExternal, repositoryAccess: { status: "blocked" } },
});
assert.equal(result.status, "FAIL");
assert.ok(result.counts.fail >= 1);
Expand Down
27 changes: 14 additions & 13 deletions tests/judge-ui-static.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,29 @@ import fs from 'node:fs/promises';

const html = await fs.readFile(new URL('../web/index.html', import.meta.url), 'utf8');

test('judge UI exposes competition readiness without claiming submission ready', () => {
test('judge UI marks the product ready without claiming submission ready', () => {
assert.match(html, /id="competition-readiness"/);
assert.match(html, /BLOCKED · external gates pending/);
assert.match(html, /READY · product/);
assert.doesNotMatch(html, /SUBMISSION READY/);
assert.doesNotMatch(html, /HackCanton S3|Track 1|Mana \/ activity \/ journal/);
});

test('judge UI maps all six official judging criteria', () => {
for (const label of ['Value \/ Problem','ICP \/ Audience','Metrics \/ Validation','GTM Materials','MVP Materials','Pitch Materials']) {
test('judge UI maps the six Colosseum judging criteria', () => {
for (const label of ['Functionality','Potential Impact','Novelty','UX','Open-source \/ Composability','Business Plan']) {
assert.match(html, new RegExp(label));
}
});

test('judge UI identifies Track 1 and describes proof as evidence-first', () => {
assert.match(html, /Track 1/);
assert.match(html, /no sample transaction IDs or simulated settlement success/i);
test('judge UI presents the foundation settlement story and evidence-first proof', () => {
assert.match(html, /A foundation pays contributors only after independently verified work/);
assert.match(html, /Foundation \/ Maintainer/);
assert.match(html, /Independent Verifier/);
assert.match(html, /No simulated settlement success/i);
});

test('judge cockpit exposes current verified fixture and runtime proof state', () => {
for (const label of ['Source','Authorization','Settlement','Runtime']) {
assert.match(html, new RegExp(label));
}
test('judge cockpit exposes the verified fixture and replay-rejection story', () => {
assert.match(html, /GitHub #69 → PR #73/);
assert.match(html, /Runtime[\s\S]*VERIFIED/);
assert.match(html, /PASS[\s\S]*Daml \+ real Canton proof/);
assert.match(html, /REPLAY REJECTED/);
assert.match(html, /Daml authorization \+ real Canton proof/);
assert.match(html, /Crypto World's Fair 2026/);
});
Loading
Loading