Skip to content

K-Dense-AI/scientific-agent-skills / skills/scholar-evaluation

scholar-evaluation

Verified

Provides qualitative-first, evidence-traceable developmental review of scholarly works and audit low-stakes research-assessment rubrics with optional local quality controls. Never use for ranking people or consequential decisions.

scripts/validate_rubric.py

View on GitHub
#!/usr/bin/env python3
"""Validate a bounded scholar-evaluation rubric JSON file."""

from __future__ import annotations

import argparse
from pathlib import Path

import _common


def validate_file(path: Path) -> dict:
    rubric = _common.read_json(path)
    issues = _common.validate_rubric(rubric)
    errors = _common.error_issues(issues)
    return {
        "schema_version": _common.SCHEMA_VERSION,
        "report_type": "rubric_schema_validation",
        "status": "invalid" if errors else "valid",
        "rubric_id": rubric.get("rubric_id") if isinstance(rubric, dict) else None,
        "error_count": len(errors),
        "warning_count": len(issues) - len(errors),
        "issues": [issue.as_dict() for issue in issues],
    }


def build_parser() -> argparse.ArgumentParser:
    parser = argparse.ArgumentParser(
        description=(
            "Validate a strict local rubric schema; no document content, "
            "credentials, models, or network access are used."
        )
    )
    parser.add_argument("--rubric", required=True, type=Path, help="Local rubric JSON")
    parser.add_argument("--output", type=Path, help="Optional local JSON report")
    parser.add_argument(
        "--force", action="store_true", help="Replace an existing output JSON file"
    )
    return parser


def main() -> int:
    args = build_parser().parse_args()
    try:
        report = validate_file(args.rubric)
        _common.write_json(report, args.output, force=args.force)
        return 0 if report["status"] == "valid" else 2
    except _common.ValidationError as error:
        _common.write_json(_common.failure_report(error), None)
        return 2


if __name__ == "__main__":
    raise SystemExit(main())
rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics.Stars: 472kUpdated Claude CodeCodexVerifiedInstall
ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first.Stars: 194kUpdated Claude CodeCodexVerifiedInstall