세션 평가와 교수자 분석 보강

This commit is contained in:
Yun Chan 2026-07-01 12:10:52 +09:00
parent 5c4ac04e06
commit fe2796f05a
51 changed files with 4928 additions and 240 deletions

View file

@ -222,8 +222,16 @@ async def check_database(database_url: str, *, require_app_role: bool) -> Check:
SELECT 1 FROM information_schema.columns
WHERE table_schema = 'app'
AND table_name = 'turns'
AND column_name = 'provider_events'
) AS has_turn_provider_events,
AND column_name IN (
'audio_ref',
'silence_ms',
'speech_rate',
'barge_in',
'provider_events'
)
GROUP BY table_schema, table_name
HAVING count(*) = 5
) AS has_turn_voice_metadata_columns,
EXISTS (
SELECT 1 FROM information_schema.columns
WHERE table_schema = 'app'
@ -280,7 +288,7 @@ async def check_database(database_url: str, *, require_app_role: bool) -> Check:
"has_turns",
"has_session_review_status",
"has_persona_triggers",
"has_turn_provider_events",
"has_turn_voice_metadata_columns",
"has_session_review_worksheet_columns",
"has_notification_delivery_queue_index",
"has_session_write_policies",

View file

@ -28,6 +28,7 @@ EXPECTED_OWNER_COLUMN_COUNTS = {
"decide": 0,
"ext": 2,
}
EXPECTED_CRITICAL_CARD_COUNT = 3
EXPECTED_DECISION_DETAIL_ROWS = 0
EXPECTED_EXTERNAL_GATE_ROWS = 6
@ -42,6 +43,11 @@ REQUIRED_SHARED_PHRASES = (
"owner 결정 7건은 2026-06-30 전건 확정",
"결정 0개(전건 확정)",
"MASTERPLAN_REVISIONS F-10 승인",
"Public API <b>recovered OK</b>",
"error code 1033",
"Docker Desktop/DB 재기동",
"watchdog healthy: engine, api, web-preview, cloudflared, public-api",
"dev-dashboard E2E redteam 10 passed",
)
FORBIDDEN_STALE_PHRASES = (
@ -65,6 +71,9 @@ FORBIDDEN_STALE_PHRASES = (
"블로커 2 · 결정 3 · 외부조율 2",
"decisions 3건(owner 결정)",
"결정 3개",
"Public API <b>prod OK</b>",
"Public API <b>530 BLOCK</b>",
"API: prod/dev OK",
)
@ -148,6 +157,13 @@ def _planned_cards(dashboard: str) -> list[str]:
)
def _has_check_status_markup(dashboard: str) -> bool:
return bool(
re.search(r'<[^>]+class="[^"]*\btask-status\b[^"]*\bs-check\b[^"]*"', dashboard)
or re.search(r'>\s*CHECK\s*<', dashboard)
)
def run_checks(paths: argparse.Namespace) -> dict[str, Any]:
dashboard = _read(paths.dashboard)
source_gaps = _read(paths.source_gaps)
@ -172,7 +188,7 @@ def run_checks(paths: argparse.Namespace) -> dict[str, Any]:
checks.append(
Check(
name="no_doing_cards",
passed=doing_count == 0 and ">CHECK<" not in dashboard and "s-check" not in dashboard,
passed=doing_count == 0 and not _has_check_status_markup(dashboard),
detail=f"doing={doing_count}",
)
)
@ -213,6 +229,15 @@ def run_checks(paths: argparse.Namespace) -> dict[str, Any]:
)
)
critical_card_count = dashboard.count('class="critbadge"')
checks.append(
Check(
name="critical_card_count",
passed=critical_card_count == EXPECTED_CRITICAL_CARD_COUNT,
detail=f"expected={EXPECTED_CRITICAL_CARD_COUNT} actual={critical_card_count}",
)
)
decision_detail_rows = structure.decision_panel_rows
checks.append(
Check(

View file

@ -0,0 +1,88 @@
from __future__ import annotations
import argparse
import importlib.util
import sys
import unittest
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parents[1]
CHECKER_PATH = REPO_ROOT / "scripts" / "check-dev-dashboard-ssot.py"
def _load_checker():
spec = importlib.util.spec_from_file_location("check_dev_dashboard_ssot", CHECKER_PATH)
if spec is None or spec.loader is None:
raise RuntimeError(f"Cannot load {CHECKER_PATH}")
module = importlib.util.module_from_spec(spec)
sys.modules[spec.name] = module
spec.loader.exec_module(module)
return module
checker = _load_checker()
def _default_args() -> argparse.Namespace:
return argparse.Namespace(
dashboard=REPO_ROOT / "docs" / "dev_dashboard.html",
source_gaps=REPO_ROOT / "docs" / "guides" / "source-docs-and-gaps.md",
backlog=REPO_ROOT / "docs" / "ops" / "backlog-2026-06-26.md",
testing=REPO_ROOT / "docs" / "guides" / "testing.md",
local_development=REPO_ROOT / "docs" / "guides" / "local-development.md",
)
class DevDashboardSsotTests(unittest.TestCase):
def test_current_dashboard_matches_ssot_contract(self) -> None:
report = checker.run_checks(_default_args())
failed = [check for check in report["checks"] if not check["passed"]]
self.assertEqual([], failed)
self.assertTrue(report["passed"])
self.assertEqual({"done": 25}, report["status_counts"])
def test_structure_parser_counts_nested_owner_columns(self) -> None:
parser = checker._dashboard_structure(
"""
<div data-owner-col="block">
<article data-status="done" data-owner="1"></article>
<article data-status="done" data-owner="0"></article>
<div><article data-status="doing" data-owner="1"></article></div>
</div>
<div data-owner-col="decide">
<article data-status="planned" data-owner="0"></article>
</div>
<div data-owner-col="ext">
<article data-status="done" data-owner="1"></article>
</div>
<div id="panel-decisions">
<span class="task-status s-risk">DECIDE</span>
<span class="task-status s-done">DECIDED</span>
</div>
<span class="task-status s-plan">GATE</span>
"""
)
self.assertEqual({"done": 3, "doing": 1, "planned": 1}, parser.status_counts)
self.assertEqual({"block": 2, "ext": 1}, parser.owner_column_counts)
self.assertEqual(1, parser.decision_panel_rows)
self.assertEqual(1, parser.external_gate_rows)
def test_check_status_detection_ignores_plain_hyphenated_text(self) -> None:
self.assertFalse(checker._has_check_status_markup("<p>readiness-checked metadata</p>"))
self.assertTrue(
checker._has_check_status_markup('<span class="task-status s-check">CHECK</span>')
)
def test_repeated_runs_are_stateless(self) -> None:
reports = [checker.run_checks(_default_args()) for _ in range(3)]
self.assertTrue(all(report["passed"] for report in reports))
self.assertEqual(
[reports[0]["status_counts"], reports[1]["status_counts"], reports[2]["status_counts"]],
[{"done": 25}, {"done": 25}, {"done": 25}],
)
if __name__ == "__main__":
unittest.main()