Skip to content

fix(roadmap): keep the brain digest soft on a store value of a wrong form - #7517

Merged
dan-petty merged 3 commits into
mainfrom
fix/7515-brain-digest-soft-on-wrong-form
Nov 28, 2026
Merged

dan-petty merged 3 commits into
mainfrom
fix/7515-brain-digest-soft-on-wrong-form

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

The brain digest of the alternatives check now stays soft on a store value of a wrong form. A number in a field of the brain index is an issue number only when it is ASCII digits, at most 10 of them, so a near word of 5,000 digits is left out and no longer makes int raise. ValkeyClient.hscan reads a field name that is not UTF-8 with the replacement character, as a reader decodes a value. The cut of 2,000 tokens counts the digest as the request holds it, one level down under brain. The near items leave out the item itself and a repeated number.

Before this change, one bad field in valkey-roadmap failed the whole alternatives round until its TTL of 45 days: no item got a verdict or a failure mark, and the sync of the round did not run.

Closes #7515

Change: openspec/changes/archive/2026-11-28-7515-brain-digest-soft-on-wrong-form/

…form

A near number of more than 10 ASCII digits and a hash field name that is not UTF-8 no longer
raise out of the alternatives round. The cut counts the digest as the request holds it, and the
near items leave out the item itself and a repeated number.
@dan-petty dan-petty added type/bug Type bug: the code does not do what it must scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them labels Nov 28, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Results for head a267ab966 (local, devcontainer):

  • uv run devops ci fail-to-pass --base origin/main: exit 0. 7 changed tests fail on the base and prove the fix:
    • tests/roadmap/test_brain_digest.py::test_a_brain_entry_of_a_wrong_form_leaves_the_round_and_its_verdict_whole[near-word-of-5000-digits] (ValueError: Exceeds the limit (4300 digits) for integer string conversion)
    • ...[non-utf8-field-name-on-the-entry-of-the-item] and ...[non-utf8-field-name-on-a-near-entry] (UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff)
    • tests/roadmap/test_brain_digest.py::test_the_digest_as_the_request_holds_it_has_at_most_2000_tokens[2002] (the request held 2,002 tokens of digest)
    • tests/roadmap/test_brain_digest.py::test_the_near_items_leave_out_the_item_itself_and_a_repeated_number (near 1 1 2 2 gave item 1 two times)
    • tests/roadmap/test_brain_index.py::test_a_watermark_number_of_5000_digits_gives_an_empty_watermark (ValueError)
    • tests/valkey/test_valkey_cache_tier.py::test_the_cache_tier_reads_a_hash_whose_field_name_is_not_utf8 (UnicodeDecodeError)
  • The covering tests: the brain, alternatives and limit tests, tests/roadmap/stores (the listing snapshot, the other caller of hscan) and tests/valkey: 1017 passed.
  • uv run devops ci --check --only lint,format,typecheck,docs,openspec,test-tree,swallowed-failures: each row passes. uv run mypy of the 4 changed source files: no issues.

The findings of the review of #7496 at 04e34ce, and their fixes:

  1. Should-fix: a store value of a wrong form failed the whole round. _number of brain_index takes an issue number of at most 10 ASCII digits, for the near field and for the watermark. ValkeyClient.hscan decodes field names with errors="replace".
  2. Nit: the cap counted the digest as a document of its own. The cut renders it under DIGEST_KEY with REQUEST_INDENT, the key and indent of alternatives_request.
  3. Nit: the near items repeated the item itself and repeated numbers. _near_items leaves both out before the cap of 5.
  4. Nit: the tests of the cut and of the area read now state their rules: test_a_digest_over_2000_tokens_leaves_out_each_whole_entry_that_does_not_fit (entries of uneven size, skip and go on) and test_the_area_read_is_empty_while_the_index_holds_no_area_check (no area key in the request or in a digest entry).

Known, and kept as they are:

  1. The system prompt of the check is longer for each item, also when the digest is empty, because it says what brain holds.
  2. A near item whose tool entry has expired is matched against the ADRs by its canonical id alone, with no tool name.

Pending a person: review the diff in tuicr (tuicr -r origin/main..HEAD).

@dan-petty
dan-petty marked this pull request as ready for review November 28, 2026 02:06
@dan-petty
dan-petty merged commit 0e2070a into main Nov 28, 2026
28 checks passed
@dan-petty
dan-petty deleted the fix/7515-brain-digest-soft-on-wrong-form branch November 28, 2026 02:08
dan-petty-release Bot added a commit that referenced this pull request Nov 28, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.232.1](v0.232.0...v0.232.1)
(2026-11-28)


### Bug Fixes

* **roadmap:** keep the brain digest soft on a store value of a wrong
form ([#7517](#7517))
([0e2070a](0e2070a))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/roadmap The roadmap jobs: intake, refine, stage, implement and the Service that runs them type/bug Type bug: the code does not do what it must

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(roadmap): the brain digest raises on a store value of a wrong form

1 participant