Skip to content

Repo hardening: fix install instructions, dead imports, hygiene#1

Open
cognis-digital wants to merge 4 commits into
mainfrom
cognis-audit/repo-hardening
Open

Repo hardening: fix install instructions, dead imports, hygiene#1
cognis-digital wants to merge 4 commits into
mainfrom
cognis-audit/repo-hardening

Conversation

@cognis-digital

@cognis-digital cognis-digital commented Jun 12, 2026

Copy link
Copy Markdown
Owner

This PR applies a few small, mechanically-verified hardening fixes found by an automated audit of the Cognis suite:

  • fix 2 broken pip install line(s) in README (package is not on PyPI; use the working git+https install)
  • remove 4 unused import(s) (ruff F401/F811)

Each change is deterministic; all touched Python files were confirmed to still compile (py_compile) before this PR was opened.

- fix 2 broken `pip install` line(s) in README (package is not on PyPI; use the working git+https install)
- remove 4 unused import(s) (ruff F401/F811)

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your first PR! 🚀 A maintainer will review under the collaboration-pull model (see CONTRIBUTING.md).

@cognis-digital cognis-digital force-pushed the cognis-audit/repo-hardening branch from f31e3f9 to 5e2cbcf Compare June 12, 2026 21:43
Cognis Digital added 3 commits June 13, 2026 03:43
…; add plain-language overview and install instructions

The test had a misplaced closing brace: old was missing one } and new had one extra },
making both strings invalid JSON (JSONDecodeError). Fixed by correcting brace counts
to match the intended nested OpenAPI structure (11 opens/closes for old, 10 for new).
All 19 tests now pass. Added layman.md overview, updated README with What is this?
and Install sections, and added install.sh / install.ps1 scripts.
- core.py: remove unused variable `i` (ruff F841); add explicit guards
  in diff_files() for None, non-str, whitespace-only, and unknown fmt
  inputs — each raises ValueError with a clear message instead of a
  cryptic downstream exception
- mcp_server.py: fix broken top-level import (scan/to_json never
  existed in core); rewrite serve() to use diff_files() + to_dict(),
  with per-call ValueError/JSONDecodeError handling that returns a JSON
  error payload rather than crashing the MCP tool
- cli.py: widen file-read exception handler to include UnicodeDecodeError
  so binary/non-UTF-8 files exit 2 with a clear message
- tests: add 7 new tests covering missing file (exit 2), malformed JSON
  (exit 2), empty inputs, non-string inputs, unknown fmt, and
  mcp_server importability; all 26 tests green
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant