Skip to content

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

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

Repo hardening: fix install instructions, dead imports, hygiene#2
cognis-digital wants to merge 5 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:

  • remove 6 unused import(s) (ruff F401/F811)
  • add a standard Python .gitignore

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

- remove 6 unused import(s) (ruff F401/F811)
- add a standard Python .gitignore
@cognis-digital cognis-digital force-pushed the cognis-audit/repo-hardening branch from 7cd049d to da26624 Compare June 12, 2026 21:47
cognis-digital and others added 4 commits June 13, 2026 03:09
…-06-13)

- README install instructions point at the working git+https path
- ran the actual audit: 2 tests passed, 0 parse errors, CLI C:\Python314\python.exe: No module named https
- embedded results in README ## Verification and AUDIT.md
…age reference

- layman.md: plain-English description for non-technical readers
- README.md: insert What is this? section and comprehensive Install section
- install.sh + install.ps1: cross-platform install scripts (pipx/uv/pip/source)
- AUDIT.md + README Verification: fix wrong package name (https -> cognis_code)
  and broken CLI reference (python -m https -> cognis-code)
- cli.py: top-level exception guard; ide subcommand catches ValueError/OSError
  with clear stderr messages and non-zero exit codes; IDE list shown on error
- models.py: resolve() raises ValueError for empty/None role; warns on unknown
  role instead of silently falling back with no indication
- ide.py: validate endpoint (must be http/https, non-empty); validate ide name
  type/emptiness; improved ValueError message includes known IDE list
- serve.py: pull() validates role against MODELS before calling ollama;
  both pull() and serve() catch FileNotFoundError/OSError from subprocess
- webhook.py: validate URL scheme; guard empty stdin payload with warning;
  validate header format (Key: Value); distinguish HTTPError/URLError/Timeout
- tests/test_hardening.py: 18 new tests covering all added error paths
- ruff E401/E702/E701 style issues resolved across all modules
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