{ "intent": "Bring install_plagiarism_tools.sh under the repo's 250-line cap without changing its installed behavior, per NEXT_SESSION_PROMPT.md §3 (the first of three restructures, chosen first for being 'most mechanical').", "scope": [ "linux_configuration/scripts/single_use/utils/install_plagiarism_tools.sh (entry script, kept: banner, color/log helpers, source lines, print_summary, main)", "linux_configuration/scripts/single_use/utils/lib/plagiarism_python.sh (new: stage 1, Python NLP venv + check_plagiarism.py/plagcheck install)", "linux_configuration/scripts/single_use/utils/lib/plagiarism_sherlock.sh (new: stage 2, Sherlock clone-or-fallback)", "linux_configuration/scripts/single_use/utils/lib/plagiarism_optional.sh (new: stages 3-4, Ferret/WCopyfind availability checks)", "linux_configuration/scripts/single_use/utils/check_plagiarism.py (new: extracted from a 'cat < AGENTS.md symlink rename and .gitignore update (cocoindex_code) as a separate first commit, per explicit user instruction to land tracked dirty files but leave untracked ones alone." ], "verification": [ { "command": "bash meta/scripts/check_file_length.sh --all", "result": "pass", "evidence": "14 files over cap (was 15); install_plagiarism_tools.sh no longer listed." }, { "command": "bash meta/scripts/shell_coverage.sh plagiarism_python.sh / plagiarism_sherlock.sh / plagiarism_optional.sh / install_plagiarism_tools.sh", "result": "pass", "evidence": "plagiarism_python.sh 30/30=100.00%, plagiarism_sherlock.sh 17/17=100.00%, plagiarism_optional.sh 25/25=100.00%, install_plagiarism_tools.sh 57/57=100.00%." }, { "command": "bash linux_configuration/scripts/single_use/utils/lib/tests/test_plagiarism_python.sh (and the 3 sibling test files)", "result": "pass", "evidence": "test_plagiarism_python.sh 15/15, test_plagiarism_sherlock.sh 11/11, test_plagiarism_optional.sh 9/9, test_install_plagiarism_tools.sh 12/12 -- 47 assertions total, 0 failed." }, { "command": "python3 -m venv + pip install scikit-learn nltk PyPDF2 python-docx; then check_plagiarism.py doc1.txt doc2.txt doc3.txt --detailed and sherlock.py doc1.txt doc2.txt doc3.txt, doc1/doc2 identical, doc3 unrelated", "result": "pass", "evidence": "check_plagiarism.py reported doc1<->doc2 100.0% (flagged, detailed passages printed correctly) and both <->doc3 pairs 0.0%; sherlock.py reported the same 100.0%/0.0%/0.0% pattern with the SUSPICIOUS flag on the matching pair." }, { "command": "shellcheck on every touched .sh (entry, 3 libs, harness, 4 test files)", "result": "pass", "evidence": "Zero warnings after fixing SC2097/SC2098 (a HOME=\"$HOME\" self-referential assignment in a test file, since removed as redundant)." }, { "command": "ruff check / mypy --config-file meta/pyproject.toml / pylint --rcfile meta/pyproject.toml / bandit -c meta/pyproject.toml on check_plagiarism.py, plagiarism_similarity.py, sherlock.py", "result": "pass", "evidence": "ruff: All checks passed (all 3). mypy: Success, no issues (all 3). pylint: 10.00/10 (all 3). bandit: 0 issues, all severities/confidences (all 3, 315 lines scanned in check_plagiarism.py alone)." }, { "command": "pre-commit run --files ", "result": "pass", "evidence": "All hooks passed after two fixes caught by this run specifically: the git-index executable bit missing on 3 lib files + the harness (git add --chmod=+x), and this evidence/contract pair itself." } ], "risks": [ "check_plagiarism.py/plagiarism_similarity.py/sherlock.py have no pytest coverage gate in this repo (only linux_configuration/tests/ and python_pkg/ are gated) -- correctness rests on the manual real-venv functional run recorded above, not an automated regression test. A future edit to these files could silently break plagcheck without pre-commit catching it.", "This installer was not run against the real system (no venv creation, no pip install, no git clone against the actual network) -- only against the PATH-shim harness and a separate throwaway venv for the Python-level functional check. A real end-to-end `bash install_plagiarism_tools.sh` run was not performed." ], "rollback": [ "git revert the commit; the entry script and its libs/py files return to the single 534-line monolith with embedded heredocs.", "After rollback, confirm bash meta/scripts/check_file_length.sh --all reports install_plagiarism_tools.sh over cap again (534 lines), and that plagcheck/sherlock still work by re-running the same real-venv functional check documented above." ] }