Skip to content

Commit bbc7143

Browse files
committed
feat(group-a): Foundation for Fairthon 75-Technique system (#224, #225, #226, #227)
- #224: Remove input_source field, add fairthon_source for YAML preservation - Remove filter_techniques() and determine_available_inputs() from loader - Add get_all_techniques() and has_readme_content() to registry - #225: Replace 75 Korean YAML technique definitions with English Fairthon templates - Map Fairthon categories to wine-themed folder names - Remove nameKo field from schema and all YAMLs - #226: Unify EvaluationMode enum as single source of truth - Remove duplicate EvaluationMode from models/graph.py - Replace SIX_HATS with SIX_SOMMELIERS everywhere - Add FULL_TECHNIQUES mode - Update frontend TypeScript types - #227: Define BMAD 17-item evaluation canon (A1-D4, 100 points) - Create backend/app/criteria/ module with bmad_items.py - A=25pts, B=25pts, C=30pts, D=20pts - Fix pre-existing auth test failures (7 tests) - Update _check_ownership tests for 3-param signature - Fix Secure cookie assertion for localhost environment Closes #224, Closes #225, Closes #226, Closes #227
1 parent 70fa8d4 commit bbc7143

100 files changed

Lines changed: 2601 additions & 2001 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

backend/app/api/routes/graph.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121
}
2222
from app.core.exceptions import CorkedError, EmptyCellarError
2323
from app.database.repositories.evaluation import EvaluationRepository
24+
from app.graph.graph_factory import EvaluationMode
2425
from app.models.graph import (
2526
ReactFlowGraph,
2627
TraceEvent,
2728
ModeResponse,
28-
EvaluationMode,
2929
Graph3DPayload,
3030
)
3131
from app.services.graph_builder import (
32-
build_six_hats_topology,
32+
build_six_sommeliers_topology,
3333
build_full_techniques_topology,
3434
)
3535
from app.services.graph_builder_3d import build_3d_graph
@@ -66,11 +66,11 @@ def _check_ownership(evaluation: dict[str, Any], user, evaluation_id: str) -> No
6666
# Allow access to public demo evaluations without auth
6767
if evaluation_id in PUBLIC_DEMO_EVALUATIONS:
6868
return
69-
69+
7070
# Require auth for non-public evaluations
7171
if user is None:
7272
raise CorkedError("Authentication required to view this evaluation")
73-
73+
7474
if evaluation.get("user_id") != user.id:
7575
raise CorkedError(
7676
"Access denied: evaluation belongs to another user", status_code=403
@@ -84,14 +84,16 @@ def _determine_mode(evaluation: dict[str, Any]) -> EvaluationMode:
8484
evaluation: The evaluation document.
8585
8686
Returns:
87-
EvaluationMode (six_hats or full_techniques).
87+
EvaluationMode (six_sommeliers, grand_tasting, or full_techniques).
8888
"""
89-
# Check for explicit mode in evaluation data
90-
mode = evaluation.get("mode")
89+
# Check for explicit evaluation_mode first, then fall back to mode
90+
mode = evaluation.get("evaluation_mode") or evaluation.get("mode")
9191
if mode == EvaluationMode.FULL_TECHNIQUES.value:
9292
return EvaluationMode.FULL_TECHNIQUES
93-
# Default to six_hats mode
94-
return EvaluationMode.SIX_HATS
93+
if mode == EvaluationMode.GRAND_TASTING.value:
94+
return EvaluationMode.GRAND_TASTING
95+
# Default to six_sommeliers mode
96+
return EvaluationMode.SIX_SOMMELIERS
9597

9698

9799
@router.get("/{evaluation_id}/graph", response_model=ReactFlowGraph)
@@ -133,7 +135,7 @@ async def get_graph(
133135
if mode == EvaluationMode.FULL_TECHNIQUES:
134136
graph = build_full_techniques_topology()
135137
else:
136-
graph = build_six_hats_topology()
138+
graph = build_six_sommeliers_topology()
137139

138140
logger.info(f"[Graph] Returning {mode.value} graph for {evaluation_id}")
139141
return graph
@@ -160,7 +162,7 @@ async def get_graph_structure(
160162
if mode == EvaluationMode.FULL_TECHNIQUES:
161163
graph = build_full_techniques_topology()
162164
else:
163-
graph = build_six_hats_topology()
165+
graph = build_six_sommeliers_topology()
164166

165167
return graph
166168

@@ -186,7 +188,7 @@ async def get_graph_execution(
186188
if mode == EvaluationMode.FULL_TECHNIQUES:
187189
graph = build_full_techniques_topology()
188190
else:
189-
graph = build_six_hats_topology()
191+
graph = build_six_sommeliers_topology()
190192

191193
methodology_trace = evaluation.get("methodology_trace", [])
192194
if methodology_trace:
@@ -268,7 +270,7 @@ async def get_mode(
268270
) -> ModeResponse:
269271
"""Get current evaluation mode.
270272
271-
Returns the evaluation mode (six_hats or full_techniques)
273+
Returns the evaluation mode (six_sommeliers, grand_tasting, or full_techniques)
272274
for the specified evaluation.
273275
274276
Public demo evaluations can be accessed without authentication.

backend/app/core/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ class Settings(BaseSettings):
3838

3939
# LLM APIs
4040
GEMINI_API_KEY: str = ""
41+
OPENAI_API_KEY: str = ""
4142

4243
# Vertex AI Express (API key auth)
4344
VERTEX_API_KEY: str = ""

backend/app/criteria/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
"""Evaluation criteria module for BMAD 17-item scoring system."""

0 commit comments

Comments
 (0)