Sprint 63: Learned Adapter Hints (Non-Authoritative) — Steps 859-868
Implements the learned adapter hints layer with governance guardrails: - HintFeatureExtractor: extract features from decision ledgers (step 859) - HintModelInterface: pair-specific hint query interface (step 860) - DeterministicFallback: safe fallback when hints unavailable (step 861) - HintConfidencePacket: confidence bands and escalation logic (step 862) - HintABHarness: A/B harness to measure hint effectiveness (step 863) - HintRollbackControl: suppress and lift hint suppression per pair (step 864) - whetstone_get_adapter_hints MCP tool (step 865) - whetstone_set_hint_policy MCP tool (step 866) - HintSafetyGuardrails: non-authoritative enforcement + audit (step 867) - Sprint63IntegrationSummary (step 868) All 10 steps passing (94 tests). Governance rule: learned hints may suggest; deterministic policy decides. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
47
editor/tests/step862_test.cpp
Normal file
47
editor/tests/step862_test.cpp
Normal file
@@ -0,0 +1,47 @@
|
||||
// Step 862: Hint confidence + uncertainty packet format (10 tests)
|
||||
#include "graduation/HintConfidencePacket.h"
|
||||
#include <iostream>
|
||||
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(hint_id_set);
|
||||
auto p2=HintConfidencePacketModel::make("H-1",0.9f,0.1f,"model");
|
||||
C(p2.hintId=="H-1","id");P();}
|
||||
void t2(){T(confidence_stored);
|
||||
auto p2=HintConfidencePacketModel::make("H-1",0.75f,0.1f,"model");
|
||||
C(p2.confidence==0.75f,"conf");P();}
|
||||
void t3(){T(band_high);
|
||||
auto p2=HintConfidencePacketModel::make("H-1",0.9f,0.1f,"m");
|
||||
C(p2.confidenceBand=="high","high");P();}
|
||||
void t4(){T(band_medium);
|
||||
auto p2=HintConfidencePacketModel::make("H-1",0.65f,0.1f,"m");
|
||||
C(p2.confidenceBand=="medium","medium");P();}
|
||||
void t5(){T(band_low);
|
||||
auto p2=HintConfidencePacketModel::make("H-1",0.3f,0.1f,"m");
|
||||
C(p2.confidenceBand=="low","low");P();}
|
||||
void t6(){T(band_unknown);
|
||||
auto p2=HintConfidencePacketModel::make("H-1",0.1f,0.1f,"m");
|
||||
C(p2.confidenceBand=="unknown","unknown");P();}
|
||||
void t7(){T(escalate_high_uncertainty);
|
||||
auto p2=HintConfidencePacketModel::make("H-1",0.9f,0.6f,"m");
|
||||
C(p2.shouldEscalate,"escalate");P();}
|
||||
void t8(){T(no_escalate_normal);
|
||||
auto p2=HintConfidencePacketModel::make("H-1",0.9f,0.1f,"m");
|
||||
C(!p2.shouldEscalate,"no esc");P();}
|
||||
void t9(){T(escalate_low_confidence);
|
||||
auto p2=HintConfidencePacketModel::make("H-1",0.2f,0.1f,"m");
|
||||
C(p2.shouldEscalate,"esc low conf");P();}
|
||||
void t10(){T(to_json_has_band);
|
||||
auto p2=HintConfidencePacketModel::make("H-1",0.9f,0.1f,"m");
|
||||
auto j=HintConfidencePacketModel::toJson(p2);
|
||||
C(j.contains("band"),"band");P();}
|
||||
|
||||
int main(){
|
||||
std::cout<<"Step 862: Hint confidence + uncertainty packet\n";
|
||||
t1();t2();t3();t4();t5();t6();t7();t8();t9();t10();
|
||||
std::cout<<"\nResults: "<<p<<"/"<<(p+f)<<" passed\n";
|
||||
return f?1:0;
|
||||
}
|
||||
Reference in New Issue
Block a user