Skip to content

feat(kb): Comment for Scout — marker vocabulary, parser chip, block affordance (KB phase) - #77

Open
jordanrburger wants to merge 3 commits into
mainfrom
feat/kb-comment-for-scout-impl
Open

feat(kb): Comment for Scout — marker vocabulary, parser chip, block affordance (KB phase)#77
jordanrburger wants to merge 3 commits into
mainfrom
feat/kb-comment-for-scout-impl

Conversation

@jordanrburger

Copy link
Copy Markdown
Collaborator

Implements the approved "Comment for Scout" (KB phase) design + plan from #72 (docs/superpowers/specs/2026-07-06-kb-comment-for-scout-design.md, docs/superpowers/plans/2026-07-06-kb-comment-for-scout.md), following the plan's 3-task TDD sequence.

What

Select (hover) a block in a Knowledge Base note in Read mode and leave a comment for Scout to act on during its next dreaming session. The comment is persisted as an inline //==<< … >>==// marker line beneath the block via the existing guarded + git-committed KnowledgeBaseFileWriter.save path. Dreaming already consumes and strips these markers — no plugin-side changes.

Tasks (as planned)

  1. ScoutMarker vocabulary (Scout/KnowledgeBase/Models/ScoutMarker.swift) — single source of truth for the marker syntax: format (trims, collapses newlines, rejects empty), isMarkerLine, body(of:). 6 unit tests.
  2. Parser support (KBDocSegment) — new .scoutComment kind; a standalone marker line parses as its own segment (never absorbed into an adjacent paragraph or table row; a marker inside a code fence stays code). New whole-line splicers insertLine(in:afterLineEnd:line:) / removeLines(in:start:end:) — only ever add/remove whole lines, so every other byte (incl. plugin structured tokens) stays untouched. 9 unit tests.
  3. Editor affordance (KBEditableView / KBEditorView) — hover a block → "💬 Comment for Scout" → inline composer (Cancel / Send to Scout, ⌘↵, empty-input disabled). Send splices the marker after the block and persists immediately through KBEditorView.save() (baseline conflict guard + scoped git commit + .commitFailed handling all reused as-is). Marker segments render as a "for Scout · pending" chip with a × to retract (whole-line delete + save). When dreaming strips the marker, the FSEvent reparse makes the chip disappear.

Scope guards (per spec)

Verification

  • Full ScoutTests target: 438 tests in 79 suites, 0 failures (platform=macOS).
  • Debug build succeeds; Debug app launch smoke-tested.
  • Not yet done — manual UI walkthrough (plan Task 3 Step 8): hover → composer → send → chip → rg -F '//==<<' shows the marker on its own line → scoped commit diff adds exactly one line → × retract removes it. This needs a human driving the app; @jordanrburger please run this before merging.

🤖 Generated with Claude Code

jordanrburger and others added 3 commits July 12, 2026 08:47
…ract)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…, immediate save

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jordanrburger
jordanrburger requested a review from a team July 12, 2026 12:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant