Evidence CLI crashes with ruby-lsp InvalidLocationError on a references lookup #1284
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#1284
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
os-sdlc implementation 144 (#1280) failed at its first dispatch. The change-auditor (dispatch 1224) ran 400 s, wrote a complete work list, and returned verdict
errorbecause the evidence CLI crashed. One crash in a lookup tool ends the whole implementation.evidence/probe/lsp/lookup.rbhas no handler for the ruby-lsp error.Observed
Handoff 1257 (change-auditor, implementation 144):
Reproduce
Run the os-sdlc evidence CLI with a references lookup for token
OpenRowson main at or after commita1baa30b(files plugins/os-sdlc/lib/os_sdlc/crc/open_rows.rb, crc/open_rows/row.rb, tests/crc/progress_table_open_rows_test.rb).Cause
The ruby-lsp daemon keeps the text of a file from the first time it opens that file.
Daemon::LspSession#open_document(lib/os_sdlc/daemon/lsp_session.rb) records the path in@opened_pathsand returns early on later calls; it never sendsdidChangeor re-opens. The daemon for root.../crc-os-sdlc-run-4/plugins/os-sdlcopenedcrc/open_rows.rbat 54 lines (15:44); commita1baa30bgrew it to 60 lines.Evidence::Fingerprint#method_probes(fingerprint.rb:92) takes lines from the current disk file, so the references request fordef revisit_files(line 55, column 11) fell past the daemon copy. ruby-lsp 0.26.11 raisedInvalidLocationError;Daemon::Server#reply(daemon/server.rb:69) returned it as{"error"=>...};Daemon::Client#answer(client.rb:50) raised a bareRuntimeError; nothing betweenLookup#references_for(lookup.rb:34) and Thor rescues it, so one token aborted the whole evidence run.bin/lsp-probe stopon that root cleared it:bin/evidence --root . OpenRowsthen exited 0.Approach
Two fixes. (a) removes the cause; (b) stops any other ruby-lsp error from aborting the run.
(a)
Daemon::LspSession#open_documentremembers a content digest per opened path. When the file on disk differs from the opened text, it sends the new text to ruby-lsp (textDocument/didChangewith full text, or close and re-open) before the request.(b)
Daemon::Client#answerraisesDaemon::LspError < StandardErrorfor an error reply.Evidence::Probe::Lsp::Lookup#references_forrescues onlyDaemon::LspErrorand returns an unconfirmed result with the error text inlinesand the refs command kept. The renderer shows that token as UNCONFIRMED, not PHANTOM, because an empty sender list must not read as "no senders".Required work: none beyond the acceptance criteria.
Acceptance criteria
Daemon::Clientreads it, then it raisesDaemon::LspError.Daemon::LspError, whenbin/evidencecollects several tokens, then that token renders UNCONFIRMED with the error text, the other tokens render, and the process exits 0.Owner sketch
Tests: extend tests/evidence/probe/lsp_lookup_location_test.rb (its fake runner raises
Daemon::LspError) for AC3; add AC1 beside the LspSession tests.Origin
VERDICT: CREATE
Work started in session c1bedec6, worktree crc-os-sdlc-run-4 (branch crc-os-sdlc-run-4), through /os-sdlc:implement.
Resolution
Done: LspSession keeps each opened file's text (OpenedDocuments) and sends didChange when the text on disk differs, so a long-running daemon no longer queries stale text. Client#answer raises Daemon::LspError on an LSP error reply; Lookup#references_for rescues it and SenderEntries renders the token as UNCONFIRMED instead of crashing. OpenNotification renamed DocumentNotification. Commit
cdac7e7f, implementation 149.Evidence: Pipeline implementation 149 complete: suite-check pass twice (64 s, 52 s), contract-auditor pass. bin/evidence --root plugins/os-sdlc OpenRows exits 0 on real code.
Follow-ups: Runner staging defect seen in this run posted as an occurrence on #925 (to be fixed next). Lens proposals (A2/A15 error placement) go through the lens challenge and are filed as Lens proposal tickets if justified.