docs: spec traceability for the locale/template/lint domain#33
Conversation
Deepen docstrings, type hints and inline comments across the locale, template, dialog, prompt, language-matching and lint modules so every non-obvious decision cites the OVOS spec clause it implements. Docs, typing and comments only — no runtime behaviour change. - expansion.py (OVOS-INTENT-1): cite §4.1 step 1 / §3.7 on inline_keywords; flag its max_values cap and lenient unknown-ref handling as non-spec. - resources.py (OVOS-INTENT-2): Args/Returns + § citations on the common reader, locale-dir discovery, keyword_form and match helpers; add the Iterator return hint to iter_locale_dirs; note the §4.4 HTML-comment gap on read_prompt_file. - dialog.py / prompt.py (§4.2 / §4.4): cite the three substitution conditions and the fence heuristic; document the unimplemented §4.4 author-comment stripping as a known conformance gap, not a silent workaround. - language.py: module docstring now traces the BCP-47 rules to INTENT-2 §2 (case-insensitive) and §2.2 (fallback, threshold 10) and the SESSION-1 lang family; document the dialect-fallback ladder precisely. - lint.py: clause map in the module docstring; per-finding § citations in messages and comments; document the .intent union-slot relaxation that reconciles INTENT-1 §5.5 with INTENT-3 §5.3 (kept a warning by design). - docs: spec-coverage headers per page; worked §4.1 expansion example; dialect-fallback table; union-slot-set section; §4.4 prompt-comment gap. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (10)
📝 WalkthroughWalkthroughThe PR expands spec-facing documentation and docstrings across template rendering, language matching, locale resources, linting, and prompt handling. It clarifies rule coverage, fallback behavior, slot substitution, and documented conformance gaps. ChangesSpec documentation alignment
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greetings! I've analyzed your changes and have some results to share. 🖖I've aggregated the results of the automated checks for this PR below. 📋 Repo HealthScanning for any signs of 'large file' weight gain. ⚖️ ✅ All required files present. Latest Version: ✅ 🔨 Build TestsThe build report has been filed and is ready. 📁 ✅ All versions pass
🔒 Security (pip-audit)I've audited the packages. Safety first! 🦺 ✅ No known vulnerabilities found (32 packages scanned). ⚖️ License CheckEnsuring our legal documentation is accessible. 📖 ✅ No license violations found. Policy: Apache 2.0 (universal donor). StrongCopyleft / NetworkCopyleft / WeakCopyleft / Other / Error categories fail. MPL allowed. 📊 CoverageMapping out the 'known' vs 'unknown' in your code. 🗺️ ✅ 96.9% total coverage Full report: download the 🏷️ Release PreviewI've checked the 'Performance Improvements' metrics. 📈 Current:
✅ PR title follows conventional commit format. 🚀 Release Channel Compatibility Predicted next version:
🔍 LintI've performed a routine sweep of your changes. 🧹 ❌ ruff: issues found — see job log Built by scripts, maintained by community 🤝 |
Makes the locale / template / dialog / prompt / language-matching / lint
domain of ovos-spec-tools exemplary for spec traceability: deepened docstrings,
complete type hints, and inline comments connecting every non-obvious decision
to a specific OVOS-INTENT clause.
Docs / typing / comments only — no runtime behaviour change.
python -m pytest test/stays green (327 passed).What changed
expansion.py(OVOS-INTENT-1): cite §4.1 step 1 / §3.7 oninline_keywords; flag itsmax_valuescap and lenient unknown-referencehandling as deliberately non-spec.
resources.py(OVOS-INTENT-2): Args/Returns + § citations on the commonreader (§3), locale-dir discovery (§5/§2),
keyword_form(§4.3) and the matchhelpers (§4.3 whole-word occurrence); add the
Iterator[...]return hint toiter_locale_dirs.dialog.py/prompt.py(§4.2 / §4.4): cite the three substitutionconditions and the fence heuristic.
language.py: module docstring traces the BCP-47 rules to INTENT-2 §2(case-insensitive comparison) and §2.2 (fallback, threshold 10) and the
SESSION-1 lang family; the dialect-fallback ladder is documented precisely.
lint.py: clause map in the module docstring; per-finding § citations inmessages and comments, so a red lint points at the exact MUST.
dialect-fallback table; union-slot-set section.
Findings surfaced (documented, not changed)
.promptHTML-comment stripping (OVOS-INTENT-2 §4.4) is unimplemented.§4.4 requires
<!-- … -->author comments be stripped before a promptreaches a model (a MUST), and an unterminated
<!--be reported.read_prompt_file/render_promptpass them through verbatim. Documented asa known conformance gap in both modules and
docs/dialog.md..intentunion-slot relaxation. INTENT-1 §5.5 ("MUST reject" differingslot sets) is relaxed to a warning for
.intentto reconcile with themulti-slot template-intent example in INTENT-3 §5.3. This is intentional; the
reasoning is now documented inline in
lint.pyand indocs/linting.md.🤖 Generated with Claude Code
Summary by CodeRabbit