Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 22 additions & 8 deletions docs/plans/012-render-ordered-preview-diffs.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

## Status

- **Status:** TODO
- **Status:** DONE — six regressions and all acceptance gates pass
- **Priority:** P2
- **Effort:** M
- **Risk:** MED
Expand Down Expand Up @@ -188,13 +188,27 @@ The six required tests are the three initial rendering regressions, `ordered_pre

## Done criteria

- [ ] All six named tests are listed and pass; the original regressions fail before the fix.
- [ ] Create→edit and rename→edit produce truthful nonempty diffs before any physical Application.
- [ ] Repeated text operations render against their own virtual before-state, and projected after-bytes equal staged after-bytes.
- [ ] One shared ordered evaluator powers presentation and staging; no third interpreter exists.
- [ ] Stale/malformed input cannot fabricate a diff, and rendering does not write Workspace files or transaction artifacts.
- [ ] Full tests, Clippy, format, schema, fixture, and diff checks exit 0.
- [ ] Only scoped files changed and index row 012 is updated.
- [x] All six named tests are listed and pass; the original regressions fail before the fix.
- [x] Create→edit and rename→edit produce truthful nonempty diffs before any physical Application.
- [x] Repeated text operations render against their own virtual before-state, and projected after-bytes equal staged after-bytes.
- [x] One shared ordered evaluator powers presentation and staging; no third interpreter exists.
- [x] Stale/malformed input cannot fabricate a diff, and rendering does not write Workspace files or transaction artifacts.
- [x] Full tests, Clippy, format, schema, fixture, and diff checks exit 0.
- [x] Only scoped files changed; index row 012 is coordinated by the root reviewer.

## Implementation and verification evidence

- Starting HEAD `e83786f` (merged PR #59), initially clean. Reviewed drift from `5268c6a`: prior plans added directory-membership certificates, reservation ownership, and proven commit/rollback effects. These are preserved; the ordered staging interpreter itself still matched this plan's excerpt. No unexplained semantic drift.
- Initial valid RED: `cargo test --locked --bin lspctl ordered_preview` failed the create/repeated presentation assertions (`None`), and rename→edit failed opening the nonexistent virtual destination at operation 1. Unicode/CRLF WorkspaceEdits compiled and passed validation up to those intended failures. The planner regression independently failed the same missing-source path. Logs: `/tmp/48-render-red.log`, `/tmp/48-planner-red.log`.
- `ResourceState.text_source` is in-memory only. Physical file inspection initializes it; moved file/directory states retain it; empty creates and tombstones clear it. Lazy reads retain ancestor/no-follow checks and per-Document limits. The required planner test covers file, nested directory, and both chained rename forms, plus deletion non-resurrection and size rejection.
- `visit_canonical_text_outputs` is the single ordered evaluator shared by staging and presentation. It retains digest checks, virtual text/rename aliases/missing roots, cumulative staged-byte limits, and the existing access-time-preserving reader. The staging sink retains exclusive private output creation, permissions, flushes, and operation-index filenames. The presentation sink emits ordered resource notices and contextual radius-3 hunks without staging artifacts. Canonical byte conversions, ordering, bounds, and UTF-8 boundaries fail rather than panic.
- Six named `ordered_preview_*` tests pass. Equivalence covers create→edit, rename→edit, repeated edits, directory rename→nested edit, overwrite-create→edit, and delete→create→edit, comparing projected bytes and canonical digests to real staged files. Tests separately assert exact display lines/order, unchanged physical manifests, ownership marker/private Unix permissions, and cumulative staging/display limits. Stale/missing input, malformed ranges/digests, no-ops, and binary-only resource notices are covered without Workspace writes.
- Scoped GREEN on Linux: discovery lists all **6** required names; `ordered_preview` **6**, `mutation::` **44**, planner **9**, and existing private-staging exemplar **1** pass. Clippy with `-D warnings`, formatting, schema, immutable stored-state, and whitespace checks exit **0**. Logs: `/tmp/48-discovery-green.log`, `/tmp/48-step4.log`, `/tmp/48-mutation.log`, `/tmp/48-planner-all.log`, `/tmp/48-staging.log`, `/tmp/48-clippy.log`, `/tmp/48-format.log`, `/tmp/48-schema.log`, `/tmp/48-state.log`.
- Root independently reviewed the production and test diffs without blocking findings. Native path audit confirmed these tests share the planner's lexical root/file-URI convention (no Owner snapshot canonicalization mismatch). Windows/macOS/MSRV have not been run locally.
- Combined full GREEN after #49 completed its intended RED phase: `cargo test --locked --all-targets --features fake-server` passes **152** tests (104 unit + 4 CLI + 3 fake-server fixture + 38 lifecycle + 3 installation), including all six #48 regressions and existing contextual-diff/Mutation coverage. Evidence: `/tmp/49-full-green.log`, independently inspected. Combined Clippy, formatting, schema, immutable stored-state, and whitespace gates also pass.
- Only the three scoped Mutation files and this plan were changed for #48; the coordinator owns the index. Concurrent #49 changes are separately scoped. Changes remain uncommitted.

- Final coordinator verification after all three plans: **155** tests pass (107 unit + 4 CLI + 3 documentation + 38 lifecycle + 3 installation), exact regression discovery counts **6/2/5/3**, and Clippy, formatting, schema, stored-state, and whitespace gates pass. Logs: `/tmp/48-50-root-full-green.log`, `/tmp/48-50-root-clippy.log`. Independent coordinator review found no blocking findings; the shared index now marks plans 012–014 DONE. Changes remain uncommitted; native Windows/macOS/MSRV CI was not run.

## STOP conditions

Expand Down
35 changes: 24 additions & 11 deletions docs/plans/013-persist-related-diagnostic-reports.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

## Status

- **Status:** TODO
- **Status:** DONE — seven regressions and all local acceptance gates pass
- **Finding:** Audit #13
- **Priority:** P2
- **Effort:** M
Expand Down Expand Up @@ -184,16 +184,29 @@ The two cache tests protect storage semantics and bounds; the five integration t

## Done criteria

- [ ] All seven named regression tests are discovered and pass (two unit, five integration).
- [ ] Uncached unchanged children reject the entire cache update; result-ID growth cannot cause mid-response reconstruction failure.
- [ ] Workspace-only partials persist; malformed, errored, and cancelled results leave accepted cached state intact.
- [ ] Three transient CLI calls reuse the same Owner and reconstruct full related reports, including partial-only input.
- [ ] Third-call fixture assertions prove previous-result IDs survive export/import updates.
- [ ] Cache-limit tests assert both snapshot count and serialized byte bounds; no evicted entry is revived by import.
- [ ] Raw Query output and diagnostic `rawReport` evidence retain their original semantics.
- [ ] Full test/build, lint, format, schema, stored-state, and whitespace gates exit 0.
- [ ] Only scoped implementation/metadata files changed; temporary Owners cleaned up.
- [ ] Plan and index status/evidence updated.
- [x] All seven named regression tests are discovered and pass (two unit, five integration).
- [x] Uncached unchanged children reject the entire cache update; result-ID growth cannot cause mid-response reconstruction failure.
- [x] Workspace-only partials persist; malformed, errored, and cancelled results leave accepted cached state intact.
- [x] Three transient CLI calls reuse the same Owner and reconstruct full related reports, including partial-only input.
- [x] Third-call fixture assertions prove previous-result IDs survive export/import updates.
- [x] Cache-limit tests assert both snapshot count and serialized byte bounds; no evicted entry is revived by import.
- [x] Raw Query output and diagnostic `rawReport` evidence retain their original semantics.
- [x] Full test/build, lint, format, schema, stored-state, and whitespace gates exit 0.
- [x] Only scoped implementation/metadata files changed; temporary Owners cleaned up.
- [x] Plan and index status/evidence updated.

## Verification evidence (2026-09-08)

- Starting HEAD: `e83786f` (merged PR #59), detached at `origin/main`, clean worktree. #40 is closed. Drift review covered the landed complete-chunk change plus explicit-server selection, bounded handshakes/writes, and synchronization delivery; those invariants remain intact. `ActiveQuery.partial_chunks` retains whole progress values, while `partial_result_items` alone supplies the existing flattened failure evidence. Baseline full suite passed **139** tests (`/tmp/49-baseline.log`).
- Cache RED: both required unit tests failed on the original implementation: export/import reverted `main-two` to `main-one`, and an unresolved related report yielded non-null effective data instead of rejecting the update (`/tmp/49-cache-red.log`). An initial Rust sum type-inference typo was fixed before recording this intended RED.
- CLI RED: final-only and partial-only related reports both passed the first full response and failed the second independent CLI invocation with `invalid_server_result` at the related URI; Workspace follow-up lacked the partial-only record's previous ID (`/tmp/49-cli-red.log`). A relative test `--file` argument was corrected before this evidence. Malformed coverage uses an invalid report shape (`items: 17`), not deeper Diagnostic validation outside this plan.
- The Owner now merges complete chunks and validates cloned diagnostic values through the existing Query helpers only after successful post-response Document validation. It never rewrites final results or raw partial evidence. Cache reconstruction reads all prerequisites before any bounded store, so unresolved children reject the whole update and ID-growth eviction cannot interrupt current-response reconstruction. Pull cache payloads retain effective full content/latest IDs; import remains independent-record-only and published records are unchanged.
- Caller audit: `dispatch_owner_query` imports independent Owner state before composing diagnostic requests (read-only `session.rs`); document/workspace envelopes retain their existing invalid-result checks and exact current raw metadata. Owner successful responses call the shared merger/validator for only the two diagnostic methods, and errored/cancelled/failed-validation paths do not update the pull cache. `apply_pull_report` remains the independent import path; document/workspace methods reconstruct all accepted reports before storing. `store`, result-ID invalidation, and byte accounting remain the existing bounded mechanism.
- Discovery lists exactly **two** unit and **five** integration `related_diagnostics` tests. All seven pass, all six diagnostics unit tests pass, and `named_cardinality_and_invalid_results_are_normalized` passes. The five integration tests also passed three repeated runs (**15/15**). Fixtures assert actual latest previous IDs on the third process invocation, stable Owner generations, final/partial/Workspace reconstruction, malformed/unresolved/error/cancel rejection, and exact raw results/progress traces (`/tmp/49-cli-green.log`). Cancellation uses the existing partial-byte-limit/acknowledgement gate, not a sleep race.
- Full suite passed **152** tests with concurrent plan 012 changes present (104 unit + 4 CLI + 3 documentation + 38 lifecycle + 3 installation; `/tmp/49-full-green.log`). Clippy with `-D warnings`, formatting, schema, stored-state, and `git diff --check` all exit **0**. Tests ran locally on Linux; native Windows/macOS and MSRV were not run locally.
- Issue #49 changes are limited to its five allowed implementation files and this plan. Other worktree changes belong to the separately authorized plans 012/014; the root coordinator owns their shared index update and final combined review. No untracked files, dependency/schema changes, commit, push, or PR introduced by this task. Temporary fixtures stop only their own Owners, including panic cleanup.

- Final coordinator verification after all three plans: **155** tests pass (107 unit + 4 CLI + 3 documentation + 38 lifecycle + 3 installation), exact regression discovery counts **6/2/5/3**, and Clippy, formatting, schema, stored-state, and whitespace gates pass. Logs: `/tmp/48-50-root-full-green.log`, `/tmp/48-50-root-clippy.log`. Independent coordinator review found no blocking findings; the shared index now marks plans 012–014 DONE. Changes remain uncommitted; native Windows/macOS/MSRV CI was not run.

## STOP conditions

Expand Down
25 changes: 18 additions & 7 deletions docs/plans/014-correct-recursive-glob-boundaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

## Status

- **Status:** TODO
- **Status:** DONE — three regressions and all acceptance gates pass
- **Audit finding:** 14
- **Priority:** P2
- **Effort:** S
Expand Down Expand Up @@ -126,12 +126,23 @@ Three narrowly scoped unit tests cover the algorithm and both independent consum

## Done criteria

- [ ] Discovery assertion returns 0 with exactly three new `recursive_glob_*` tests.
- [ ] `**/main.rs` does not match `/workspace/domain.rs`, while all listed component-boundary positives pass.
- [ ] Document selector and file-operation consumer regressions pass.
- [ ] Existing Query/Owner tests, full suite, Clippy, formatting, and diff hygiene all pass.
- [ ] Production Owner runtime, schemas, dependencies, and unrelated glob semantics are untouched.
- [ ] This plan and its index row record completion.
- [x] Discovery assertion returns 0 with exactly three new `recursive_glob_*` tests.
- [x] `**/main.rs` does not match `/workspace/domain.rs`, while all listed component-boundary positives pass.
- [x] Document selector and file-operation consumer regressions pass.
- [x] Existing Query/Owner tests, full suite, Clippy, formatting, and diff hygiene all pass.
- [x] Production Owner runtime, schemas, dependencies, and unrelated glob semantics are untouched by this plan.
- [x] This plan records completion; the coordinating reviewer owns the index update.

## Verification evidence

- Starting HEAD: `e83786f` (detached `origin/main`). Plans 012/013 were concurrently authorized uncommitted work and were preserved. Drift inspection against `5268c6a` found no Query matcher changes; Owner changes belong to landed lifecycle/synchronization plans and retain the same file-operation filter contract. Plan 013's concurrent changes only widen two unrelated Query helper visibilities and update diagnostic caching in the Owner.
- Added exactly the three specified regressions. Discovery assertion exits **0** (`/tmp/50-discovery.log`). The initial focused run failed all three on the intended `domain.rs` admission: direct matcher returned true, Document composition admitted the suffix, and rename filtering admitted `domain.rs -> other.rs` (`/tmp/50-red.log`). No fixture or compilation failure was counted as RED.
- The only production change for this plan gates the `**/` suffix attempt on the beginning of the path or a preceding `/`. Recursive consumption and the memoization key are unchanged. Table coverage preserves zero/multiple directories, ordinary `*`, bare `**`, braces/classes, and ASCII case handling. Consumer tests cover absolute/relative selectors, either rename endpoint, and create filters with resource-kind and case options.
- Focused regressions: **3** pass (`/tmp/50-green.log`); Query tests: **18** pass (`/tmp/50-query.log`); Owner unit tests: **7** pass (`/tmp/50-owner.log`).
- Full `cargo test --locked --all-targets --features fake-server`: **155** pass (107 unit + 4 CLI + 3 documentation + 38 lifecycle + 3 installation), including concurrent plans 012/013 (`/tmp/50-full-green.log`). Clippy with `-D warnings`, formatting, discovery assertion, and `git diff --check` all exit **0** (`/tmp/50-clippy.log`).
- Scope inspection confirms this plan changes only the shared Query matcher, its two inline tests, the Owner test module, and this metadata. No dependencies, schemas, normalization, or new glob semantics were introduced. Verified locally on Linux Rust **1.98.1**; native macOS/Windows and Rust 1.89 were not run locally. Changes remain uncommitted for review.

- Final coordinator verification after all three plans: **155** tests pass (107 unit + 4 CLI + 3 documentation + 38 lifecycle + 3 installation), exact regression discovery counts **6/2/5/3**, and Clippy, formatting, schema, stored-state, and whitespace gates pass. Logs: `/tmp/48-50-root-full-green.log`, `/tmp/48-50-root-clippy.log`. Independent coordinator review found no blocking findings; the shared index now marks plans 012–014 DONE. Changes remain uncommitted; native Windows/macOS/MSRV CI was not run.

## STOP conditions

Expand Down
6 changes: 3 additions & 3 deletions docs/plans/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ Effort: **S** hours, **M** roughly a day, **L** multiple days, including tests.
| 9 | [009](009-decouple-trust-administration.md) | Decouple Trust administration from unrelated executable availability | P1 | M | MED | — | DONE — bounded fix; 129 tests/gates passed; independent named-status success deferred |
| 10 | [011](011-bound-language-server-writes.md) | Bound language-server writes and make incomplete delivery fatal | P1 | M | MED | 005 | DONE — 3 transport/4 lifecycle regressions; 136 tests and all gates passed |
| 11 | [010](010-deliver-document-synchronization-transitions.md) | Deliver committed Document synchronization transitions | P1 | M | MED | 011 | DONE — 3 lifecycle regressions; 139 tests and all gates passed |
| 12 | [012](012-render-ordered-preview-diffs.md) | Render Preview diffs against ordered virtual filesystem state | P2 | M | MED | — | TODO |
| 13 | [013](013-persist-related-diagnostic-reports.md) | Persist related diagnostic reports across CLI calls | P2 | M | MED | 004 | TODO |
| 14 | [014](014-correct-recursive-glob-boundaries.md) | Respect directory boundaries in recursive globs | P2 | S | LOW | — | TODO |
| 12 | [012](012-render-ordered-preview-diffs.md) | Render Preview diffs against ordered virtual filesystem state | P2 | M | MED | — | DONE — 6 regressions; 155 combined tests and all gates passed |
| 13 | [013](013-persist-related-diagnostic-reports.md) | Persist related diagnostic reports across CLI calls | P2 | M | MED | 004 | DONE — 2 cache/5 lifecycle regressions; 155 combined tests and all gates passed |
| 14 | [014](014-correct-recursive-glob-boundaries.md) | Respect directory boundaries in recursive globs | P2 | S | LOW | — | DONE — 3 regressions; 155 combined tests and all gates passed |

Status values: **TODO**, **IN PROGRESS**, **DONE**, **BLOCKED** (add one-line cause), **REJECTED** (add rationale, such as independently fixed), or **STALE** (requires plan refresh). A green test filter matching zero tests is not evidence of completion. Record actual command results in the individual plan before marking DONE. Native platform verification still belongs in CI when unavailable locally.

Expand Down
Loading
Loading