hermes-agent/tests/agent/lsp
ethernet eb09df6ec8 refactor(lsp): version-tagged _DocState replaces timestamp freshness tracking
The staleness fix (f9b1fd799) bolted two wall-clock dicts (_changed_at,
_pulled_at) onto a client that already scattered per-document state
across six parallel dicts (_files, _push_diagnostics, _pull_diagnostics,
_published, _published_version, _first_push_seen) — eight maps kept in
sync by hand.

Collapse all of it into one _DocState per path, and use the LSP document
version as the freshness token instead of clocks:

- didChange bumps doc.version; stored push/pull results carry the
  version they describe (push_version from the server's echoed version,
  or the current version at receipt for servers that don't echo one;
  pull_version captured at request send so an in-flight pull that a
  didChange races past is stale on arrival).
- fresh == tag >= version. Invalidation is implicit in the bump — no
  store-clearing, no clock comparisons, no race windows.
- _has_fresh_push/_has_fresh_pull helpers dissolve into two one-line
  _DocState methods; diagnostics_for(fresh_only=True) becomes a
  three-liner.

Semantics are unchanged from f9b1fd799 (same tests pass, one test
updated off private internals); net -15 lines.
2026-07-20 13:43:36 -04:00
..
__init__.py feat(lsp): semantic diagnostics from real language servers in write_file/patch (#24168) 2026-05-12 16:31:54 -07:00
_mock_lsp_server.py fix(lsp): never report stale diagnostics — wait for fresh post-edit data 2026-07-20 13:43:36 -04:00
test_backend_gate.py chore: prune unused imports and duplicate import redefinitions 2026-05-28 22:26:25 -07:00
test_broken_set.py chore: prune unused imports and duplicate import redefinitions 2026-05-28 22:26:25 -07:00
test_client_e2e.py feat(lsp): semantic diagnostics from real language servers in write_file/patch (#24168) 2026-05-12 16:31:54 -07:00
test_delta_key.py fix(lsp): shift baseline diagnostics into post-edit coordinates (#25978) 2026-05-14 15:56:07 -07:00
test_diagnostics_field.py chore: prune unused imports and duplicate import redefinitions 2026-05-28 22:26:25 -07:00
test_eventlog.py feat(lsp): semantic diagnostics from real language servers in write_file/patch (#24168) 2026-05-12 16:31:54 -07:00
test_install_and_lint_fixes.py fix(lsp): detect Windows wrapper binaries in installer probes 2026-05-30 02:08:36 -07:00
test_lifecycle.py chore: prune unused imports and duplicate import redefinitions 2026-05-28 22:26:25 -07:00
test_powershell_server.py feat(lsp): add PowerShellEditorServices language server (#55930) 2026-06-30 16:22:18 -07:00
test_protocol.py feat(lsp): semantic diagnostics from real language servers in write_file/patch (#24168) 2026-05-12 16:31:54 -07:00
test_reporter.py fix(security): sanitize LSP diagnostic fields to prevent indirect prompt injection 2026-06-30 03:48:41 -07:00
test_service.py chore: prune unused imports and duplicate import redefinitions 2026-05-28 22:26:25 -07:00
test_shell_linter_lsp_skip.py fix(lint): skip per-file shell linter when LSP will handle the file (#29054) 2026-05-20 01:46:40 -05:00
test_stale_diagnostics.py refactor(lsp): version-tagged _DocState replaces timestamp freshness tracking 2026-07-20 13:43:36 -04:00
test_workspace.py feat(lsp): semantic diagnostics from real language servers in write_file/patch (#24168) 2026-05-12 16:31:54 -07:00