Sprint 289: Integration into generate_taskitems (steps 1973-1977)
EnrichedExecutionContract, TaskitemLibraryAnnotator, AnnotatedTaskitemValidator, DispatchJustificationReport, Sprint289IntegrationSummary. 25/25 tests passing. Full pipeline: spec -> classifier -> selector -> advisor -> enriched contracts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
78
editor/tests/step1977_test.cpp
Normal file
78
editor/tests/step1977_test.cpp
Normal file
@@ -0,0 +1,78 @@
|
||||
// Step 1977: Sprint 289 Integration
|
||||
//
|
||||
// t1: buildAnnotatedTaskitems returns 4 contracts
|
||||
// t2: verifyAllEnriched passes
|
||||
// t3: JSON serialization task selects nlohmann_json
|
||||
// t4: matrix multiply task selects cublas
|
||||
// t5: Sprint289IntegrationSummary metadata correct + report averageScore > 0
|
||||
|
||||
#include "Sprint289IntegrationSummary.h"
|
||||
#include <iostream>
|
||||
|
||||
namespace ws = whetstone;
|
||||
static int p = 0, f = 0;
|
||||
#define T(n) { std::cout << " " << #n << "... "; }
|
||||
#define P() { std::cout << "PASS\n"; ++p; }
|
||||
#define F(m) { std::cout << "FAIL: " << m << "\n"; ++f; }
|
||||
#define C(c, m) if (!(c)) { F(m); return; }
|
||||
|
||||
void t1() {
|
||||
T(build_annotated_returns_4_contracts);
|
||||
auto contracts = ws::Sprint289IntegrationSummary::buildAnnotatedTaskitems();
|
||||
C(contracts.size() == 4, "4 contracts");
|
||||
for (const auto& c : contracts) {
|
||||
C(!c.taskDescription.empty(), "taskDescription set on each contract");
|
||||
}
|
||||
P();
|
||||
}
|
||||
|
||||
void t2() {
|
||||
T(verify_all_enriched_passes);
|
||||
C(ws::Sprint289IntegrationSummary::verifyAllEnriched(), "verifyAllEnriched");
|
||||
P();
|
||||
}
|
||||
|
||||
void t3() {
|
||||
T(json_task_selects_nlohmann_json);
|
||||
auto contracts = ws::Sprint289IntegrationSummary::buildAnnotatedTaskitems();
|
||||
// Contract 0: "implement JSON serialization"
|
||||
const auto& c = contracts[0];
|
||||
C(c.isEnriched(), "enriched");
|
||||
C(c.selectedLibrary == "nlohmann_json", "nlohmann_json selected");
|
||||
C(c.operationDomain == "serialization.json", "domain serialization.json");
|
||||
C(c.capabilityScore > 0.9f, "score > 0.9");
|
||||
P();
|
||||
}
|
||||
|
||||
void t4() {
|
||||
T(matrix_multiply_task_selects_cublas);
|
||||
auto contracts = ws::Sprint289IntegrationSummary::buildAnnotatedTaskitems();
|
||||
// Contract 1: "perform matrix multiply on GPU"
|
||||
const auto& c = contracts[1];
|
||||
C(c.isEnriched(), "enriched");
|
||||
C(c.selectedLibrary == "cublas", "cublas selected");
|
||||
C(c.operationDomain == "compute.matrix", "domain compute.matrix");
|
||||
C(c.capabilityScore > 0.95f, "cublas score > 0.95");
|
||||
P();
|
||||
}
|
||||
|
||||
void t5() {
|
||||
T(metadata_and_report);
|
||||
ws::Sprint289IntegrationSummary s;
|
||||
C(s.stepsCompleted == 5, "5 steps");
|
||||
C(s.success, "success");
|
||||
C(s.sprintName() == "Sprint 289: generate_taskitems Integration", "sprintName");
|
||||
auto report = ws::Sprint289IntegrationSummary::buildJustificationReport();
|
||||
C(report.totalTasks == 4, "4 total tasks in report");
|
||||
C(report.enrichedCount == 4, "4 enriched in report");
|
||||
C(report.averageScore > 0.0f, "averageScore > 0");
|
||||
C(report.projectId == "sprint289-proof", "projectId");
|
||||
P();
|
||||
}
|
||||
|
||||
int main() {
|
||||
std::cout << "Step 1977: Sprint 289 Integration\n";
|
||||
t1(); t2(); t3(); t4(); t5();
|
||||
std::cout << "\n" << p << "/" << (p + f) << " passed\n";
|
||||
return f > 0 ? 1 : 0;
|
||||
}
|
||||
Reference in New Issue
Block a user