6 real bugs fixed + fake-green test corrected + stale claim removed (production hardening round 4)#1
Merged
Conversation
added 8 commits
July 11, 2026 18:34
…atus table README/AGENT.md advertised 'S3-compatible memory' but there is zero S3 / object-storage code anywhere. Storage is a tiered in-memory store with an optional SurrealDB backend. Replaced the claim with an accurate description and a component-status table marking stubs honestly.
CortexConfig.load() used .rstrip("d") on the raw TOML value, which returns
a str. The field is typed float, so it silently stored "30" instead of 30.0.
Added _parse_duration_days() to coerce numeric and unit-suffixed values to
float, with a regression test.
…value reflex_check() updated the running mean/var with the anomalous reading and then reported that post-update mean (~29.0) in the detail string and 'mean' field, instead of the baseline (~20.1) the z-score was actually computed against. Now the baseline is captured before the stats update. Added a regression test.
Every hot entry is also stored in warm, so concatenating tiers produced duplicate memory references in the dream-cycle sample (1 stored -> 2 returned). Dedupe by id across all tiers in both MemoryLayer and the SurrealDB fallback. Added a regression test.
The test published 10 events to a size-5 queue but never checked the return value of publish(), so it passed regardless of whether the queue shed overflow events (fake-green). Now it asserts the first 5 are accepted and the 5 overflow events return False.
should_render() was dead code (never called) whose logic contradicted its docstring: the comment claimed it 'always render[s] the last one (summary)' but returned False for every event past the threshold, so no summary was ever shown. Corrected it to a clean per-trace rate limiter (first N pass, rest suppressed), documented honestly that it is an opt-in filter not wired into the dispatch loop, and added a regression test.
CI previously ran only pytest, never ruff, so 40 lint errors went unseen (33 unused imports, 4 unused vars, 2 ambiguous 'l' names, 1 empty f-string). Removed genuinely-unused imports/vars across source and tests, renamed the ambiguous loop variables, and added a 'ruff check .' step to CI so lint failures fail the build going forward.
Owner
Author
|
Update — Fix 7 landed ( |
…026-07-11 # Conflicts: # .github/workflows/ci.yml # README.md # src/config/__init__.py
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.
First-pass hardening (goose), independently re-verified by me on a fresh clone (fresh install, 54/54 tests pass; reverted the reflex_check fix locally and confirmed the new test genuinely fails on pre-fix code — mean of 29.0 instead of the real 20.125 baseline, exactly as claimed).
Note on prior research: an earlier deep-dive on this repo (2026-07-03) found a fabricated 'S3-compatible storage' claim and a test suite that had never actually run due to CI masking. Both were independently re-verified as already fixed before this dispatch — this repo had a 'Tier 2 → Tier 1: fix CI, license, packaging' commit since that research (
ba8414e). Goose correctly identified this rather than wastefully re-fixing already-solved problems, and instead documented the residual truth honestly (see below) and moved on to find 6 new, real issues.docs — false S3 claim, honest status table: the README/AGENT.md tagline still claimed 'S3-compatible memory' with zero backing code anywhere in the repo (confirmed via grep — no boto/minio/amazonaws references exist). Corrected, and added an honest per-component status table.
fix(config) — retention days parsed as string, not float:
CortexConfig.load()used.rstrip("d")on the raw TOML value, silently storing"30"(str) instead of30.0(float) despite the field's type annotation. Added_parse_duration_days()handling numeric and unit-suffixed values correctly.fix(compute) — reflex anomaly reported the wrong mean:
reflex_check()updated its running mean/variance with the anomalous reading before reporting the mean the z-score was actually computed against — so an anomaly report showed a contaminated mean (~29.0) instead of the real baseline (~20.1). Confirmed via independent revert-test:8.875off from the real baseline on old code.fix(memory) — duplicate samples from
get_random_memories: every hot-tier entry is also mirrored in warm-tier, so concatenating tiers without dedup returned the same memory twice for a single stored entry. Fixed in both the in-memory backend and the SurrealDB fallback.test(bus) — fake-green
test_bus_backpressure: the test published 10 events to a size-5 queue but never checkedpublish()'s return value, so it passed regardless of whether backpressure actually worked. Rewritten to assert the first 5 succeed and the overflow 5 are shed.fix(bus) —
should_renderdead code contradicting its own docstring: the method's comment claimed it 'always renders the last one (summary)' but every branch past the threshold returnedFalse— the promised behavior never happened (and the method wasn't even wired into the dispatch loop, documented honestly as opt-in/unused rather than hidden).Verification (independently redone by me): fresh clone, fresh
pip install -e ".[dev]", full suite: 54/54 pass. Reverted the reflex-mean fix specifically and reran its regression test — genuinely fails with the exact contaminated value described, confirming it's a real guard.Operational note: goose made all 7 of these commits locally but never actually ran
git push— I found and pushed them directly after independently confirming they existed and were sound. Worth watching for in future non-interactive dispatches.