Repository navigation
Description
Problem or Motivation
Each alternatives check sees only its own item (alternatives_request, src/devops_cli/roadmap/alternatives.py:825). 4 open merge-conflict items got 4 different tools (#3968, #3969, #4027, #4076). Durable-run items got 5 tools, and ADR 0008 rejects 2 of them. A decision on one item is not used again on the next item.
Proposed Solution & Architectural Design
- Before the model call, the check builds a digest of at most 2,000 tokens from the brain index:
- the near list of the item (the
nearfield of its entry in the brain index of feat(roadmap): keep alternatives results in a brain index #4676: at most 5 other items of the repository that name the same tool, the newest check first; the aggregate task of feat(roadmap): the brain files project insights through intake #4693 is not built); - their verdicts and canonical tools;
- the ADR status of each tool, and its ring when feat(roadmap): the brain files project insights through intake #4693 gives one (the index of feat(roadmap): keep alternatives results in a brain index #4676 holds no ring);
- the area verdict, when an area check exists.
- the near list of the item (the
- Each fact in the digest has its date.
- The check records
alternatives.brain_used(at most 10 entry ids). - No brain (Valkey slow or down, the index not built, or a workstation) gives an empty digest, and the check runs as today.
- Switch
roadmap.brain.digest:offoron. - Spec delta in the nested capability
openspec/specs/project-brain/digest/spec.md:roadmap-alternativesholds 81 requirements, and a capability holds at most 80 (openspec/config.yaml).
Target Subsystem
SDLC, Git & PR Governance (the roadmap alternatives check).
Existing Tool Considered
The brain index (Valkey through valkey-py) and the existing investigate run of the alternatives check. No new tool and no extra model call. Cost: about 100,000 tokens and 3 hours to build.
Acceptance Criteria
- A test: the digest of a fixture brain holds the near verdicts and stays under 2,000 tokens.
- A test (T8): with Valkey down, the check writes the verdict of today.
- Live, 7 days: prompt tokens for each check rise by at most 1,500 (
devops_cli_ai_tokens_total{row="alternatives"}over checks). - Live, 7 days:
devops_cli_brain_first_reads_total{row="alternatives"}showsansweredorpartialfor at least 30 % of checks. Fact of 2026-11-26: the counter that feat(roadmap): keep alternatives results in a brain index #4676 built has the labelrowonly, and it counts the checks whose item had no entry in the index (src/devops_cli/telemetry/instruments.py:811). It has noansweredorpartialvalue.
Dependencies
#4676, #4672. Part of the project brain plan #4624.
Source: #4624
Owner decision 2026-11-13
The approved pipeline split (tracker #5482, Phase 6) keeps this scope in the alternatives step of the research unit.
- Live proof: after the merge and the release, the alternatives step runs as the App on 3 items of the stage window. A comment gives the result lines and the digest entries that it read.
Alternatives check of 2026-11-26: none.
Tool: none found.
Reason: Searches found only general agent memory layers such as mem0, which keep their own vector store and extract memories with extra model calls; none builds a dated digest of this project's brain index with rings, ADR status and the area verdict.
Lacks:
- No digest of the existing Valkey brain index
- No ring or in-force ADR status for a tool
- No 2,000-token cut over whole entries
- Memory writes need extra model and embedding calls
Proposed design
Problem statement
Each alternatives check sees only its own item, so a decision on one item is not used on the next item. Four open merge-conflict items got four different tools, and durable-run items got five tools that ADR 0008 partly rejects. This change gives each check a dated digest of the project brain before its one model call, bounded at 2,000 tokens, and records the brain entries that the digest used.
Acceptance criteria
Requirement: The digest holds the near items of the index entry
The alternatives check SHALL build the digest from the near field of the item's entry in the brain index, and SHALL hold at most 5 near items with their verdicts and canonical tool ids.
Scenario: Five near items
- WHEN the fixture brain holds an entry for the item whose
nearfield lists 5 items, each with a verdict and a canonical tool id - THEN the digest holds the 5 items with their verdicts and canonical tool ids
Requirement: The digest stays at or below 2,000 tokens
The digest SHALL stay at or below 2,000 tokens, and SHALL cut whole entries to do so.
Scenario: More entries than the cap
- WHEN the fixture brain holds entries whose total is more than 2,000 tokens
- THEN the digest holds whole entries only, and its token count is at most 2,000
Requirement: Each digest fact has its date
The digest SHALL hold the date of each fact that it takes from the brain index.
Scenario: A dated verdict
- WHEN the fixture brain holds a verdict with the date 2026-11-01
- THEN the digest holds that verdict with the date 2026-11-01
Requirement: The digest holds the ADR status of a tool
The digest SHALL hold the number of each ADR in force that rejects a tool that the digest names.
Scenario: A tool that an ADR rejects
- WHEN the fixture brain names a tool, and a fixture ADR in force rejects that tool under a rejected option
- THEN the digest holds the tool with the number of that ADR
Requirement: The digest holds the area verdict
The digest SHALL hold the area verdict when the brain index holds an area check for the item's area.
Scenario: An area check
- WHEN the fixture brain holds an area check for the item's area with the verdict
partly - THEN the digest holds the area verdict
partly
Requirement: The request holds the digest
alternatives_request SHALL hold the digest under the key brain, and SHALL hold no brain key when the digest is empty.
Scenario: A digest and an empty digest
- WHEN the digest holds 2 near items, and a later request of another item has an empty digest
- THEN the first request holds the key
brainwith 2 entries, and the second request holds nobrainkey
Requirement: The digest adds no model call
The check SHALL add the digest to its existing model request and SHALL make no extra model call.
Scenario: One model call
- WHEN one item is checked with a digest of 5 near items, and the same item is checked with an empty digest
- THEN each run makes the same number of model calls
Requirement: No brain gives an empty digest
The check SHALL use an empty digest and SHALL run as today when the brain is unavailable.
Scenario: Valkey down
- WHEN the Valkey read fails, the index is not built, or the run is on a workstation
- THEN the request holds no
brainkey, and the check writes the verdict of its reply
Requirement: The digest switch turns the digest off
The setting roadmap.brain.digest SHALL take off or on, SHALL default to on, and SHALL make no brain read when it is off.
Scenario: The default and the off value
- WHEN
roadmap.brain.digestis unset in one run and set tooffin the next run - THEN the first run reads the brain, and the second run makes no brain read and its request holds no
brainkey
Requirement: The check records the brain entries that it used
A written check SHALL record alternatives.brain_used with the ids of at most 10 brain entries that its digest used.
Scenario: Eleven entries
- WHEN the digest takes 11 brain entries
- THEN
alternatives.brain_usedholds 10 entry ids, and the check writes one PATCH of the issue
Requirement: The digest requirements live in a nested capability
The change SHALL add the digest requirements to the nested capability openspec/specs/project-brain/digest/spec.md, and SHALL add no requirement to openspec/specs/roadmap-alternatives/spec.md.
Scenario: The nested capability holds the digest requirements
- WHEN a person runs
uv run devops openspec checkandgit grep -c '^### Requirement:' openspec/specs/roadmap-alternatives/spec.md - THEN
uv run devops openspec checkexits 0, and the grep prints at most 80 requirements foropenspec/specs/roadmap-alternatives/spec.md
Requirement: Pending a person after the merge
After the merge and the release, the alternatives step SHALL run as the App on 3 items of the stage window, and a comment SHALL give the result lines, the digest entries and the token rise of each check.
Scenario: The live proof of the digest
- WHEN a person runs the alternatives step as the App on 3 items of the stage window after the release, and 7 days pass
- THEN a comment gives the result line of each item, the brain entries of each digest, and the lines of
devops_cli_ai_tokens_total{row="alternatives"}that rise by at most 1,500 per check
Existing Tool Considered
The alternatives check of 2026-11-26 in the issue body gives the verdict none and names no tool. Its Lacks: list gives what no tool covers: a digest of the existing Valkey brain index, the ADR status of a tool, the 2,000-token cut over whole entries, and no extra model call. The change builds the digest in-house for about 100,000 tokens and 3 hours of build, keep and fix work. It reads the existing Valkey brain index through src/devops_cli/valkey/tiered.py, adds no dependency, and adds no model call.
Key questions
- Where does the check build the digest, and does it add a model call?:
_check_onebuilds the digest before its one model call atsrc/devops_cli/roadmap/alternatives.py:1527, and passes it toalternatives_requestatsrc/devops_cli/roadmap/alternatives.py:829.alternatives_requestadds the digest under the keybrainof the existing request. The check makes no extra model call. (best practice) [sources: src/devops_cli/roadmap/alternatives.py:829, src/devops_cli/roadmap/alternatives.py:1527, openspec/specs/roadmap-alternatives/spec.md]- Chosen: Build the digest in
_check_oneand add it to the existing request. It adds no model call and no dependency, and_check_oneholds the store and builds the request. - Rejected: A second model call that summarizes the brain. It adds cost and latency, and the issue rules out an extra model call.
- Chosen: Build the digest in
- Which list gives the 5 near items of the digest?: The digest reads the
nearfield of the item's entry in the brain index atsrc/devops_cli/roadmap/brain_sync.py:137. The field lists at most 5 other items of the repository that name the same tool, the newest check first. (best practice) [sources: src/devops_cli/roadmap/brain_sync.py:137, docs/adr/0023-the-project-brain-is-a-derived-index-in-two-cache-tiers-and-two-scheduled-runs-keep-it.md]- Chosen: The
nearfield of the brain index entry. The index already holds the near items of the item, so the digest makes no second search and no second embedding. - Rejected: The nearest-item function of intake. It holds a different list and needs a second embedding search and order.
- Rejected: The aggregate of feat(roadmap): the brain files project insights through intake #4693. feat(roadmap): the brain files project insights through intake #4693 is not built, so no aggregate exists to read.
- Chosen: The
- What does the digest hold, and how is it bounded?: The digest holds the near items, each with its date, verdict and canonical tool id. It holds the ADR status of each tool and the area verdict when one exists. It cuts whole entries at 2,000 tokens. (best practice) [sources: docs/adr/0023-the-project-brain-is-a-derived-index-in-two-cache-tiers-and-two-scheduled-runs-keep-it.md, CONTEXT.md, src/devops_cli/roadmap/brain_index.py:222]
- Chosen: The near items with dated verdicts, tools, ADR status and the area verdict. It gives the model the nearest decisions in one block that fits the 2,000-token budget of ADR 0023.
- Rejected: Every brain entry of the item's area. It exceeds the 2,000-token cap and the prompt budget.
- Which token count bounds the digest?: The digest reuses the token count that the check already makes on the ADR text with
CONST_ROADMAP_ALTERNATIVES_MAX_ADR_TOKENSatsrc/devops_cli/config/constants.py:3896. The change adds a constant for the 2,000-token cap and adds no tokenizer dependency. (best practice) [sources: src/devops_cli/config/constants.py:3896, src/devops_cli/roadmap/alternatives.py]- Chosen: Reuse the token count of the ADR cut. The check already counts the ADR text, so the digest needs no new dependency.
- Rejected: Add a new tokenizer dependency. It adds a dependency for a count that the check already makes.
- What does the check do when the brain is unavailable?: The digest is empty, the request holds no
brainkey, and the check runs as today. A slow or down Valkey, an index that is not built, and a workstation take this path. The tiered mapping sends no error to the caller while Valkey fails. (best practice) [sources: src/devops_cli/valkey/tiered.py, docs/adr/0023-the-project-brain-is-a-derived-index-in-two-cache-tiers-and-two-scheduled-runs-keep-it.md, CONTEXT.md]- Chosen: Empty digest and run as today. ADR 0023 gives this path for a cache failure, and the failure does not change the verdict.
- Rejected: Skip the item when the brain is down. It stops the check for a failure that does not change the verdict.
- What is the default of
roadmap.brain.digest?: The setting takesofforonand defaults toon. The empty-digest fallback keeps the check safe when the brain is down. The live proof of the owner decision needs the digest on after the release. (best practice) [sources: src/devops_cli/config/defaults.py, docs/adr/0023-the-project-brain-is-a-derived-index-in-two-cache-tiers-and-two-scheduled-runs-keep-it.md, docs/ROADMAP_WORKFLOW.md]- Chosen: Default
on. ADR 0023 records the digest as the input of the check, and the empty-digest fallback covers a brain that is down. - Rejected: Default
offuntil the live proof. The off-by-default rule governs a decision step inroadmap.decisions(ADR 0020); the digest makes no decision, andoffwould leave the live proof without the digest.
- Chosen: Default
- What does
alternatives.brain_usedrecord, and where is it written?: It records the ids of at most 10 brain entries that the digest used. The check writes it in the one PATCH that carries its block and its other marks. (best practice) [sources: openspec/specs/roadmap-alternatives/spec.md, src/devops_cli/roadmap/alternatives.py]- Chosen: The used entry ids, capped at 10. It shows which entries shaped the verdict and keeps the record small in the one PATCH.
- Rejected: Record the digest text. It copies prompt text into the issue body and grows the record.
- Which capability holds the digest requirements?: The nested capability
openspec/specs/project-brain/digest/spec.md. Theroadmap-alternativescapability is at the 80-requirement limit ofopenspec/config.yaml:24, so it gets no new requirement. (best practice) [sources: openspec/config.yaml:24, openspec/specs/roadmap-alternatives/spec.md]- Chosen: Nested capability
openspec/specs/project-brain/digest/spec.md. Theroadmap-alternativescapability holds 80 requirements, which is the limit of a capability. - Rejected: Add the requirements to
openspec/specs/roadmap-alternatives/spec.md. It exceeds the 80-requirement limit of one capability.
- Chosen: Nested capability
- Which pipeline step holds the brain digest?: The alternatives step of the research unit. The owner decision of 2026-11-13 in the issue body keeps this scope in that step (tracker feat(roadmap): track the roadmap pipeline split into jobs #5482, Phase 6). (best practice) [sources: docs/ROADMAP_WORKFLOW.md]
- Chosen: Keep the scope in the alternatives step. The owner decision of 2026-11-13 records the approved pipeline split of tracker feat(roadmap): track the roadmap pipeline split into jobs #5482 and keeps the digest in that step.
- Rejected: Move the digest to the retrieval step of the research unit. The owner decision keeps it in the alternatives step, and ADR 0023 puts the digest in the check of one item.
- Where does the project brain live?: Valkey holds the project brain index. The check reads it through the tiered mapping of the process and the shared cache tier at
src/devops_cli/valkey/tiered.py. The change adds no store. [sources: CONTEXT.md, docs/adr/0023-the-project-brain-is-a-derived-index-in-two-cache-tiers-and-two-scheduled-runs-keep-it.md, src/devops_cli/valkey/tiered.py, src/devops_cli/roadmap/brain_index.py] - Why does the digest hold no ring of a tool?: The brain index holds no ring at
src/devops_cli/roadmap/brain_index.py:222, and feat(roadmap): the brain files project insights through intake #4693, which gives the ring, is not built. The ring is deferred to its own issue. [sources: src/devops_cli/roadmap/brain_index.py:222] - Why does the live proof use no
answeredorpartialvalue?:devops_cli_brain_first_reads_totalhas the labelrowonly atsrc/devops_cli/telemetry/instruments.py:811, and it counts the checks whose item had no entry in the index. It has noansweredorpartialvalue. That part of the live proof is deferred to its own issue. [sources: src/devops_cli/telemetry/instruments.py:811]
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 11, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
featprefix of the title gives the type.(roadmap)scope of the title gives the scope.The change improves decision consistency across items but does not fix a defect or block a release.Consistent tool verdicts reduce rework and user confusion across related items.Building the digest, adding the switch, writing two tests, and updating the spec is a focused but multi-part change.Both items extend the alternatives check execution flow, but 2652 adds scheduling and refine reading the verdict while the candidate adds a brain digest as input context to the check itself.devops-cli-service commentedon Nov 14, 2026
Alternatives check: none
Reason: The searches turned up only generic retrieval/tokenising frameworks (e.g. llama-index, MIT), none of which builds a digest from this project's own brain index or feeds it into the existing alternatives check. The issue itself asks for no new tool and no extra model call: the digest is built in-repo from the existing brain index (Valkey through valkey-py, in-memory cosine), and ADR 0023 rejected a vector store for those entries, so no external tool covers the need.
Tool: none found
Lacks:
alternatives.brain_usedor reads theroadmap.brain.digestoff/on switch.Tools considered:
Searches run:
Sources:
Checked on 2026-11-14. A person decides what this means for the item. The check changes no label and closes no issue.
devops-cli-service commentedon Nov 15, 2026
Refine cannot set this item to Ready at 46c62f3 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
devops-cli-service commentedon Nov 26, 2026
Next step: the open items close, or a person replies in a comment or edits the body. See Dependencies in the section Proposed design of the body.
dan-petty commentedon Nov 26, 2026
Two facts for this item, from the work of 2026-11-26 on the project brain (#4624):
openspec/specs/roadmap-alternatives/spec.mdholds 80 requirements after feat(roadmap): link reference implementations in each checked item #7306 (feat(roadmap): link reference implementations in each checked item #4672), which is the limit of a capability. Put the requirements of the digest in a nested capability, for exampleopenspec/specs/project-brain/digest/spec.md, and move requirements there if this item must change one of the 80.uses, which copies the record keyalternatives.brain_usedby its text.decode_job_recorddrops that key until this item declares it.devops-cli-service commentedon Nov 26, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
dan-petty commentedon Nov 27, 2026
Design check, 2026-11-26
Body, 5 corrections
alternatives_request(src/devops_cli/roadmap/alternatives.py:825).nearfield of the index (src/devops_cli/roadmap/brain_sync.py:137). The aggregate task of feat(roadmap): the brain files project insights through intake #4693 is not built.src/devops_cli/roadmap/brain_index.py:222).project-brain/digest: a capability holds at most 80 requirements (openspec/config.yaml:24).devops_cli_brain_first_reads_totalhas the labelrowonly (src/devops_cli/telemetry/instruments.py:811).Refine block
_requestatalternatives.py:637. No function starts at that line now.answeredandpartial. No series has them.Dependencies: #4676 and #4672 are closed. No open item blocks this item.
devops-cli-service commentedon Nov 27, 2026
Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.
devops-cli-service commentedon Nov 28, 2026
Released in v0.232.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.232.0
devops-cli-service commentedon Nov 28, 2026
Live since 2026-11-28 02:40 UTC