Skip to content

6 real bugs fixed + fake-green test corrected + stale claim removed (production hardening round 4)#1

Merged
SuperInstance merged 9 commits into
masterfrom
production-round4-2026-07-11
Jul 13, 2026
Merged

6 real bugs fixed + fake-green test corrected + stale claim removed (production hardening round 4)#1
SuperInstance merged 9 commits into
masterfrom
production-round4-2026-07-11

Conversation

@SuperInstance

Copy link
Copy Markdown
Owner

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 of 30.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.875 off 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 checked publish()'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_render dead code contradicting its own docstring: the method's comment claimed it 'always renders the last one (summary)' but every branch past the threshold returned False — 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.

PurplePincher Automation 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.
@SuperInstance

Copy link
Copy Markdown
Owner Author

Update — Fix 7 landed (5f20ae2, independently verified by me on a fresh clone): ruff lint cleanup (40 → 0 errors: unused imports, unused vars, ambiguous l variable names, an empty f-string) plus a real ruff check . gate added to CI (which previously only ran pytest, so lint issues were invisible). Final state: 54/54 tests pass, ruff check . clean.

…026-07-11

# Conflicts:
#	.github/workflows/ci.yml
#	README.md
#	src/config/__init__.py
@SuperInstance SuperInstance merged commit 23bdaba into master Jul 13, 2026
7 checks passed
@SuperInstance SuperInstance deleted the production-round4-2026-07-11 branch July 13, 2026 05:23
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