F2: region-anchored threads on @cline/sdk (Feature #4) #5

Merged
benstull merged 7 commits from feat/f2-region-anchored-threads into main 2026-06-10 14:01:18 +00:00
Owner

Summary

Implements F2 (#4) — region-anchored discussion threads on the POC skeleton (#2), per vscode-cowriting-plugin-content/specs/coauthoring-inner-loop.md (§7.2 SLICE-1..5).

  • SLICE-1 src/model.ts — versioned artifact schema (shared anchors/provenance primitives, schemaVersion, empty attributions/proposals extension points for F3/F4 — INV-4) + stable, sorted serialization (INV-2). src/store.tsCoauthorStore load/save of .threads/<doc>.json sidecars.
  • SLICE-2 src/anchorer.ts — hybrid anchoring: buildFingerprint, resolution ladder (exact-unique → context-disambiguated → lineHint tiebreak → orphaned, never guesses — INV-1/INV-3), live offset shift.
  • SLICE-3 src/threadController.ts wires Store + Anchorer + vscode-free src/threadModel.ts to vscode.comments (create-on-selection, reply, resolve, render); package.json contributes the commands/menus; extension.ts returns a test API.
  • SLICE-4 reload + FileSystemWatcher external re-anchor (with self-write guard) + orphaned-thread surface; decision logic locked by unit tests.
  • SLICE-5 @vscode/test-electron host E2E across create → reply → resolve → persist → reload → re-anchor → orphan.

No live @cline/sdk turn and no credentials in F2 (INV-5); cline.ts untouched.

Test Plan

  • npm test — 24 vitest unit tests green (schema, store, anchorer, thread mutations, re-anchor decisions, + existing SDK driver).
  • npm run typecheck — clean.
  • npm run buildout/extension.cjs builds.
  • npm run test:e2e — 4 host E2E tests green against VS Code 1.124.0.
  • Manual F5: select text → "Add Coauthoring Thread on Selection" → reply/resolve → reload → edit-and-orphan (see plan's operator checklist).

Plan: docs/superpowers/plans/2026-06-10-f2-region-anchored-threads.md.

🤖 Generated with Claude Code

## Summary Implements **F2 (#4) — region-anchored discussion threads** on the POC skeleton (#2), per `vscode-cowriting-plugin-content/specs/coauthoring-inner-loop.md` (§7.2 SLICE-1..5). - **SLICE-1** `src/model.ts` — versioned artifact schema (shared `anchors`/`provenance` primitives, `schemaVersion`, empty `attributions`/`proposals` extension points for F3/F4 — INV-4) + stable, sorted serialization (INV-2). `src/store.ts` — `CoauthorStore` load/save of `.threads/<doc>.json` sidecars. - **SLICE-2** `src/anchorer.ts` — hybrid anchoring: `buildFingerprint`, resolution ladder (exact-unique → context-disambiguated → lineHint tiebreak → **orphaned**, never guesses — INV-1/INV-3), live offset `shift`. - **SLICE-3** `src/threadController.ts` wires Store + Anchorer + vscode-free `src/threadModel.ts` to `vscode.comments` (create-on-selection, reply, resolve, render); `package.json` contributes the commands/menus; `extension.ts` returns a test API. - **SLICE-4** reload + `FileSystemWatcher` external re-anchor (with self-write guard) + orphaned-thread surface; decision logic locked by unit tests. - **SLICE-5** `@vscode/test-electron` host E2E across create → reply → resolve → persist → reload → re-anchor → orphan. No live `@cline/sdk` turn and no credentials in F2 (INV-5); `cline.ts` untouched. ## Test Plan - [x] `npm test` — 24 vitest unit tests green (schema, store, anchorer, thread mutations, re-anchor decisions, + existing SDK driver). - [x] `npm run typecheck` — clean. - [x] `npm run build` — `out/extension.cjs` builds. - [x] `npm run test:e2e` — 4 host E2E tests green against VS Code 1.124.0. - [ ] Manual F5: select text → "Add Coauthoring Thread on Selection" → reply/resolve → reload → edit-and-orphan (see plan's operator checklist). Plan: `docs/superpowers/plans/2026-06-10-f2-region-anchored-threads.md`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
benstull added 7 commits 2026-06-10 14:00:57 +00:00
Plan derived from vscode-cowriting-plugin-content/specs/coauthoring-inner-loop.md
§7.2 (SLICE-1..5). UI surface ⇒ @vscode/test-electron host E2E is a first-class
plan task, not a follow-up.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Drives the extension's returned ThreadController API + asserts the on-disk
sidecar and rendered Comments state (spec §6.8 fallback). All 4 host tests
green against VS Code 1.124.0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
benstull merged commit d8e6d4a328 into main 2026-06-10 14:01:18 +00:00
benstull deleted branch feat/f2-region-anchored-threads 2026-06-10 14:01:19 +00:00
Sign in to join this conversation.