Steps 266-268: Phase 10a — semantic annotation core + sidecar persistence (32/32 tests)

Step 266: 5 semantic annotation AST types (Intent, Complexity, Risk,
Contract, SemanticTag) with JSON roundtrip and compact AST integration.
Step 267: Sidecar AST persistence (.whetstone/<file>.ast.json) with
save/load/list RPC methods, MCP tools, and permission enforcement.
Step 268: Phase 10a integration tests — multi-file sidecar workflow,
all 5 types in compact view, idempotent roundtrip, source isolation.

Also includes Sprint 10 plan, GUI/installer polish, and Emacs integration fixes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Bill
2026-02-12 16:01:56 +00:00
parent c36fd92045
commit 976161dc4a
36 changed files with 2999 additions and 69 deletions

View File

@@ -141,3 +141,44 @@ class ConstExprAnnotation : public Annotation {
public:
ConstExprAnnotation() { conceptType = "ConstExprAnnotation"; }
};
// Semantic annotations for AI guidance (Sprint 10, Step 266)
class IntentAnnotation : public Annotation {
public:
std::string summary; // 1-sentence description of what/why
std::string category; // "validation", "transformation", "io",
// "coordination", "computation", "initialization"
IntentAnnotation() { conceptType = "IntentAnnotation"; }
};
class ComplexityAnnotation : public Annotation {
public:
std::string timeComplexity; // "O(1)", "O(n)", "O(n^2)", etc.
int cognitiveComplexity = 0; // 1-10 scale
int linesOfLogic = 0;
ComplexityAnnotation() { conceptType = "ComplexityAnnotation"; }
};
class RiskAnnotation : public Annotation {
public:
std::string level; // "low", "medium", "high", "critical"
std::string reason;
int dependentCount = 0; // how many callers/consumers
RiskAnnotation() { conceptType = "RiskAnnotation"; }
};
class ContractAnnotation : public Annotation {
public:
std::string preconditions;
std::string postconditions;
std::string returnShape; // human-readable type/shape description
std::string sideEffects; // "none", "io", "mutation", "network"
ContractAnnotation() { conceptType = "ContractAnnotation"; }
};
class SemanticTagAnnotation : public Annotation {
public:
std::vector<std::string> tags; // e.g. ["@serialize", "@validation"]
SemanticTagAnnotation() { conceptType = "SemanticTagAnnotation"; }
};