Sprints 46-58 implement the cross-language porting foundation: language-to-IR adapters, equivalence checking, gate validation, legacy ingestion, managed/dynamic families, low-level/logic-actor semantics, debug workflow tooling, AST-native family tools, Rust/CPP raising tools, system-level orchestration, query family, and porting gates. Sprint 59 adds the governance layer (policy packs, review boards, waiver packets, ambiguity triage, decision ledger) with the whetstone_review_porting_decision MCP tool. Also includes: sprint plans 46-130, MCP taskitem pipeline scripts, CLAUDE.md, docs, and full test matrix (steps 689-828). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
41 lines
1.3 KiB
C++
41 lines
1.3 KiB
C++
#pragma once
|
|
// Step 859: Hint feature extraction from decision ledgers.
|
|
#include <string>
|
|
#include <vector>
|
|
#include <nlohmann/json.hpp>
|
|
|
|
struct HintFeature {
|
|
std::string featureId;
|
|
std::string source; // "decision_ledger", "review_board"
|
|
std::string pairId;
|
|
std::string attribute;
|
|
std::string value;
|
|
float weight = 1.0f;
|
|
};
|
|
|
|
class HintFeatureExtractor {
|
|
public:
|
|
static std::vector<HintFeature> extract(const std::string& pairId,
|
|
const std::vector<nlohmann::json>& decisions) {
|
|
std::vector<HintFeature> features;
|
|
int idx = 0;
|
|
for (const auto& d : decisions) {
|
|
HintFeature f;
|
|
f.featureId = "HF-" + std::to_string(++idx);
|
|
f.pairId = pairId;
|
|
f.source = "decision_ledger";
|
|
f.attribute = d.value("decision", "unknown");
|
|
f.value = d.value("rationale", "");
|
|
f.weight = d.value("weight", 1.0f);
|
|
features.push_back(f);
|
|
}
|
|
return features;
|
|
}
|
|
|
|
static nlohmann::json toJson(const HintFeature& f) {
|
|
return {{"feature_id", f.featureId}, {"pair_id", f.pairId},
|
|
{"source", f.source}, {"attribute", f.attribute},
|
|
{"value", f.value}, {"weight", f.weight}};
|
|
}
|
|
};
|