ci(pyright): add type-check ratchet gate, fix 15 None-deref bugs#65
Merged
Conversation
Batch 0 of pyright remediation. Introduces deterministic pyright type
checking in CI with a per-rule baseline ratchet, and fixes the real
None-dereference bugs that the two blocking rules surfaced.
Infrastructure:
- pyrightconfig.json: venvPath=. / venv=.venv, basic mode, py3.10,
reportMissingModuleSource=none for deterministic venv resolution
- scripts/check_pyright_ratchet.py: per-rule gate (--write-baseline,
--blocking) — fails CI when a rule rises above its baseline
- typecheck-baseline.json: 568 errors across 8 rules (current floor)
- .github/workflows/ci.yml: typecheck job builds .venv, installs deps
+ pyright==1.1.410; gate blocks reportOptionalMemberAccess and
reportOptionalSubscript (both now 0), no continue-on-error
- .gitignore: ignore .venv/ and pyright-*.json
Bug fixes (15 None-deref guards):
- handlers/ingest_codebase_cypher.py: _run_query returns {} (not None)
on error paths; tests_py/handlers/test_ingest_codebase.py updated to
the new {} contract
- infrastructure/pg_store.py: guard None row (~513)
- infrastructure/pg_store_wiki.py: new _returning_id helper across 5 sites
- infrastructure/ap_bridge.py: guard None client (~294)
- infrastructure/workflow_graph_source_ast.py: capture loop local (~96)
- core/titans_memory.py: guard None grad (~196)
reportOptionalMemberAccess 9->0, reportOptionalSubscript 6->0; zero
regression; 46 targeted tests pass; ruff clean; py_compile OK.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… 624->626) The pyright None-deref fixes (f80008b) inserted lines above the canonical heat_base writers in pg_store.py, shifting bump_heat_raw's UPDATE to line 566 and update_memories_heat_batch's SET to line 626. Update _ALLOWED_WRITERS pins in test_I2_canonical_writer.py to match. Fixes the 4 failing Test jobs on PR #65. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
cdeust
added a commit
that referenced
this pull request
Jun 19, 2026
…pliance bundle Consolidates the cortex-official-mcp working tree onto main (base 9241ffd / #65), applied as a 33-file --binary patch via --3way (clean, no conflicts): - rename neuro-cortex-memory -> hypermnesia-mcp across pyproject.toml, manifest.json, server.json, plugin.json, package.json; install-plugin.sh keeps the intentional dual-cleanup of the legacy name; marketplace.json version_note left as history - MCP Directory submission bundle: server.json, manifest.json (12 tools annotated), icon.png, PRIVACY.md, .mcpbignore, mcp-name marker in README - docs/papers: science.md -> trimmed bibliography.md - infra/handlers carried from the #65 base (upstream_availability, pg_schema, pooled_sink, sqlite_store_search, staging_resolve_sink, tool_registry_ingest, ingest_codebase_schema, ingest_prd, wiki_adr) uv.lock regenerated (hypermnesia-mcp v3.23.0). Pyright per-rule ratchet: 568 errors == baseline 568, no blocking-rule regression (reportOptionalMemberAccess/Subscript 0). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Batch 0 of the pyright remediation. Introduces deterministic pyright type checking in CI with a per-rule baseline ratchet, and fixes the real None-dereference bugs that the two blocking rules surfaced.
What changed
Type-check infrastructure
pyrightconfig.json—venvPath=./venv=.venv, basic mode, py3.10,reportMissingModuleSource=nonefor deterministic venv resolution.scripts/check_pyright_ratchet.py— per-rule gate (--write-baseline,--blocking); fails CI when a rule's error count rises above its recorded baseline.typecheck-baseline.json— current floor: 568 errors across 8 rules..github/workflows/ci.yml—typecheckjob builds.venv, installs deps +pyright==1.1.410; the gate blocksreportOptionalMemberAccessandreportOptionalSubscript(both now at 0), with nocontinue-on-error..gitignore— ignore.venv/andpyright-*.json.Bug fixes — 15 None-deref guards
handlers/ingest_codebase_cypher.py—_run_querynow returns{}(notNone) on error paths;tests_py/handlers/test_ingest_codebase.pyupdated to the new{}contract.infrastructure/pg_store.py— guardNonerow.infrastructure/pg_store_wiki.py— new_returning_idhelper applied across 5 sites.infrastructure/ap_bridge.py— guardNoneclient.infrastructure/workflow_graph_source_ast.py— capture loop-local binding.core/titans_memory.py— guardNonegrad.Verification
reportOptionalMemberAccess9 → 0,reportOptionalSubscript6 → 0.ruffclean;py_compileOK.Notes
The
--blockingset is intentionally narrow (the two rules fully cleared) so the gate is green today while the 568-error baseline ratchets down in later batches. Working-doc files undertasks/are deliberately not part of this commit.🤖 Generated with Claude Code